content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""Module Var provides the abstract class Var, and the concrete subclasses:
ConstantVar: a Var representing a constant
SimpleVar: a Var read directly from an HDF5 file table
GroupedVar: a Var representing a grouping operation on a base Var
MutatedVar: a Var representing a length-preserving transformation on a b... | [
37811,
26796,
12372,
3769,
262,
12531,
1398,
12372,
11,
290,
262,
10017,
850,
37724,
25,
198,
220,
20217,
19852,
25,
257,
12372,
10200,
257,
6937,
198,
220,
17427,
19852,
25,
257,
12372,
1100,
3264,
422,
281,
5572,
37,
20,
2393,
3084,
... | 2.583316 | 4,747 |
import pytest
import grpc
import time
import logging
from peloton_client.pbgen.peloton.api.v0.task import task_pb2
from peloton_client.pbgen.peloton.api.v1alpha.job.stateless import (
stateless_pb2,
)
from peloton_client.pbgen.peloton.api.v1alpha.job.stateless.stateless_pb2 import (
JobSpec,
)
from peloton_cli... | [
11748,
12972,
9288,
198,
11748,
1036,
14751,
198,
11748,
640,
198,
11748,
18931,
198,
198,
6738,
16176,
18970,
62,
16366,
13,
40842,
5235,
13,
30242,
18970,
13,
15042,
13,
85,
15,
13,
35943,
1330,
4876,
62,
40842,
17,
198,
6738,
16176,
... | 3.206515 | 1,627 |
# Converts screenshot dump from the stepper analyzer to a png.
# Crude and for developement purposes only.
import sys
from PIL import Image, ImageDraw
import os
from datetime import datetime
# Read lines from input file
file1 = open(
'c:/projects/simple_stepper_motor_analyzer/repo/tools/screenshot.txt', 'r')
lin... | [
2,
1482,
24040,
22032,
10285,
422,
262,
2876,
2848,
4284,
9107,
284,
257,
279,
782,
13,
198,
2,
3864,
2507,
290,
329,
1205,
972,
4959,
691,
13,
198,
198,
11748,
25064,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
198,
11748,
2... | 2.557411 | 479 |
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler, LabelEncoder
from querying.tracking_query import get_play
def preprocess_tracking(track18, track19, track20, play_df, play_type):
'''
This function creates the tracking dataframes by play-type by year.
Parameters:
... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
8997,
3351,
36213,
11,
36052,
27195,
12342,
198,
198,
6738,
42517,
1112,
13,
36280,
62,
22766,
1330,
651,
62,
1759,
198,... | 2.561484 | 4,123 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# midioutwrapper.py
#
"""Wrap MidiOut to add convenience methods for sending common MIDI events."""
import binascii
from rtmidi.midiconstants import (ALL_NOTES_OFF, ALL_SOUND_OFF, BALANCE, BANK_SELECT_LSB,
BANK_SELECT_MSB, BREATH_CONTRO... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
3095,
72,
448,
48553,
13,
9078,
198,
2,
198,
37811,
54,
2416,
7215,
72,
7975,
284,
751,
15607,
5050,
329... | 1.842857 | 910 |
'''
convert to Tusimple json/txt format.
'''
import cv2
import json
import numpy as np
import os
'''
datasets name:vil-100
paper link: https://arxiv.org/abs/2108.08482
reference: https://github.com/yujun0-0/MMA-Net/tree/main/dataset
datasets structure:
VIL-100
|----Annotations
|----data
... | [
7061,
6,
201,
198,
1102,
1851,
284,
46233,
320,
1154,
33918,
14,
14116,
5794,
13,
201,
198,
7061,
6,
201,
198,
201,
198,
11748,
269,
85,
17,
201,
198,
11748,
33918,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
28686,
20... | 1.814746 | 2,143 |
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup
import re
site = 'https://www.hltv.org/results?team=4773'
hdr = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'}
req = Request(site,headers=hdr)
html = urlo... | [
6738,
2956,
297,
571,
13,
25927,
1330,
19390,
11,
19016,
9654,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
302,
198,
15654,
796,
705,
5450,
1378,
2503,
13,
71,
2528,
85,
13,
2398,
14,
43420,
30,
15097,
28,
2857,
4790... | 2.354167 | 288 |
import rclpy
from subscriber import SubscriberExample
from publisher import PublisherExample
from rclpy.executors import SingleThreadedExecutor, MultiThreadedExecutor
# Initialize rclpy
rclpy.init(args=None)
# This establishes an executor which will run all the nodes
# In this case they will all be run on one thread
... | [
11748,
374,
565,
9078,
198,
6738,
32944,
1330,
3834,
1416,
24735,
16281,
198,
6738,
9991,
1330,
28045,
16281,
198,
6738,
374,
565,
9078,
13,
18558,
315,
669,
1330,
14206,
16818,
276,
23002,
38409,
11,
15237,
16818,
276,
23002,
38409,
198,... | 3.258706 | 201 |
import pickle
import os
import json
from tqdm import tqdm
import pandas as pd
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from transformers import LxmertForQuestionAnswering, LxmertTokenizer
from transformers import AdamW # is this needed for training?
from config.util import get_co... | [
11748,
2298,
293,
198,
11748,
28686,
198,
11748,
33918,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,... | 2.421053 | 969 |
# Copyright © 2018 Stanislav Hnatiuk. All rights reserved.
"""The test admin from the subjects app."""
from django.test import TestCase
from generic.tests import AdminTestMixin
from ..models import Subject, Category
class CategoryAdminTest(AdminTestMixin, TestCase):
"""Tests for Category admin."""
fixtures ... | [
2,
15069,
10673,
2864,
7299,
3044,
615,
367,
77,
7246,
2724,
13,
1439,
2489,
10395,
13,
198,
198,
37811,
464,
1332,
13169,
422,
262,
7481,
598,
526,
15931,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
14276,
1... | 3.206061 | 165 |
from django.db import models
from json_field import JSONField
DEFAULT_VIDEO_OUTPUT = {
"public": True,
"width": 640,
"height": 320
}
VIDEO_PREFERENCES = {
"video/mp4" : 0.75,
"video/webm": 1.25
}
class Video(models.Model):
"""This is a very lightweight model that basically wraps an extern... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
33918,
62,
3245,
1330,
19449,
15878,
628,
198,
7206,
38865,
62,
42937,
62,
2606,
7250,
3843,
796,
1391,
198,
220,
220,
220,
366,
11377,
1298,
6407,
11,
198,
220,
220,
220,
366,... | 2.582339 | 419 |
version="1.5.1"
| [
9641,
2625,
16,
13,
20,
13,
16,
1,
198
] | 1.777778 | 9 |
import json
import os
from gdelt20utils.common import gd_path_gen
from gdelt20utils.common.gd_logger import logger_obj
from gdelt20utils.extract.gd_api_client import gd_api_client
| [
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
308,
67,
2120,
1238,
26791,
13,
11321,
1330,
308,
67,
62,
6978,
62,
5235,
198,
6738,
308,
67,
2120,
1238,
26791,
13,
11321,
13,
21287,
62,
6404,
1362,
1330,
49706,
62,
26801,
198,
6738,... | 2.84375 | 64 |
from copy import deepcopy
from pizza.input import ExampleInput, MediumInput
from pizza.models.slice import Slice
#
if __name__ == '__main__':
example_input = ExampleInput()
medium_input = MediumInput()
# example_input.read_file()
medium_input.read_file()
# p = Process(example_input)
p = Pro... | [
6738,
4866,
1330,
2769,
30073,
198,
198,
6738,
14256,
13,
15414,
1330,
17934,
20560,
11,
13398,
20560,
198,
6738,
14256,
13,
27530,
13,
48369,
1330,
3454,
501,
628,
198,
2,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
... | 2.861789 | 123 |
import logging
import datetime
import sys
from volttron.platform.agent import utils
from volttron.platform.messaging import topics, headers as headers_mod
from volttron.platform.agent.math_utils import mean
from volttron.platform.agent.utils import (setup_logging, format_timestamp, get_aware_utc_now, parse_timestamp_st... | [
11748,
18931,
198,
11748,
4818,
8079,
198,
11748,
25064,
198,
6738,
2322,
926,
1313,
13,
24254,
13,
25781,
1330,
3384,
4487,
198,
6738,
2322,
926,
1313,
13,
24254,
13,
37348,
3039,
1330,
10233,
11,
24697,
355,
24697,
62,
4666,
198,
6738... | 2.75 | 324 |
import sqlite3
queries = []
# Count how many rows you have - it should be 249!
query1 = '''SELECT COUNT("User Id")
FROM review;'''
queries.append(query1)
# How many users who reviewed at least 100 Nature in the category also
# reviewed at least 100 in the Shopping category?
query2 = '''SELECT COUNT("User Id")
FROM r... | [
11748,
44161,
578,
18,
198,
198,
421,
10640,
796,
17635,
198,
198,
2,
2764,
703,
867,
15274,
345,
423,
532,
340,
815,
307,
34620,
0,
198,
22766,
16,
796,
705,
7061,
46506,
327,
28270,
7203,
12982,
5121,
4943,
198,
10913,
2662,
2423,
... | 2.794203 | 345 |
#!/usr/bin/env python
"""Create dataset for predicting lightning using Dataflow.
Copyright Google Inc.
2018 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,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
16447,
27039,
329,
25539,
14357,
1262,
6060,
11125,
13,
198,
198,
15269,
3012,
3457,
13,
198,
7908,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
... | 4.082474 | 194 |
"""Application factory and configuration for azure_lightning_flask applications"""
from logging import getLogger, StreamHandler
from warnings import warn
from flask import Flask
from flask_env import MetaFlaskEnv
from azure_lightning_flask.application_blueprint import application_blueprint
class Configuration(object)... | [
37811,
23416,
8860,
290,
8398,
329,
35560,
495,
62,
2971,
768,
62,
2704,
2093,
5479,
37811,
198,
198,
6738,
18931,
1330,
651,
11187,
1362,
11,
13860,
25060,
198,
6738,
14601,
1330,
9828,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
... | 2.996226 | 530 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
import sarif
| [
11748,
29008,
361,
628
] | 3.5 | 4 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 6 21:10:46 2019
@author: rdamseh
"""
import os
import sys
# add VascGraph package to python path
try:
sys.path.append(os.getcwd())
except: pass
import VascGraph as vg
from VascGraph.Skeletonize import GenerateGraph, ContractGraph, RefineGra... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
3158,
220,
718,
2310,
25,
940,
25,
3510,
13130,
198,
198,
31,
9800,
25,
374,
11043,... | 2.919796 | 1,571 |
from shutil import rmtree
import unittest
from unittest import TestCase
from mef_tools.io import MefWriter, MefReader, create_pink_noise, check_data_integrity
import os
import numpy as np
import pandas as pd
basedir = os.path.abspath(os.path.dirname(__file__))
if __name__ == '__main__':
unittest.main()
| [
6738,
4423,
346,
1330,
374,
16762,
631,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
502,
69,
62,
31391,
13,
952,
1330,
337,
891,
34379,
11,
337,
891,
33634,
11,
2251,
62,
79,
676,
62,
3919,
7... | 2.717949 | 117 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
from .access_policy import has_some_perm
def some_perm(request, view, action) -> bool:
"""
A pointles global access condition to demonstrate usage.
"""
return has_some_perm(request.user)
| [
6738,
764,
15526,
62,
30586,
1330,
468,
62,
11246,
62,
16321,
628,
198,
4299,
617,
62,
16321,
7,
25927,
11,
1570,
11,
2223,
8,
4613,
20512,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
966,
829,
3298,
1895,
4006,
284,
1... | 3.059701 | 67 |
from rest_framework import serializers
from coins.models import Coins
class CoinsSerializer(serializers.ModelSerializer):
"""it contains serializers for your api.
Serializers allow complex data such as querysets and model instances to be
converted to native Python datatypes that can then be easily ren... | [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
10796,
13,
27530,
1330,
30108,
628,
198,
4871,
30108,
32634,
7509,
7,
46911,
11341,
13,
17633,
32634,
7509,
2599,
198,
220,
220,
220,
37227,
270,
4909,
11389,
11341,
329,
534,
40391,
... | 3.715686 | 102 |
import logging
from src.Settings import ASSISTANT_SETTINGS
def check_for_wake_word(command: str):
"""
Check if wake word is in param command.
:param command: str
:return: is_triggered: bool
"""
wake_word: str = ASSISTANT_SETTINGS.get('Wake Word')
logging.debug(f'Searching for wake word ... | [
11748,
18931,
198,
198,
6738,
12351,
13,
26232,
1330,
24994,
8808,
8643,
62,
28480,
51,
20754,
628,
198,
4299,
2198,
62,
1640,
62,
48530,
62,
4775,
7,
21812,
25,
965,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6822,
611,
7... | 2.85119 | 336 |
#!/usr/bin/env python
#
# Copyright (C) 2017 - Massachusetts Institute of Technology (MIT)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
357,
34,
8,
2177,
532,
10140,
5136,
286,
8987,
357,
36393,
8,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
1... | 3.965732 | 321 |
import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.layers as layers
import numpy as np
import matplotlib.pyplot as plt
import random
relation_pos = ['VERB']
entity_pos = ['NOUN','PRON','PROPN','ADJ','ADV']
# Input structure of the graph is the center ultimate prediction
... | [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
11748,
11192,
273,
11125,
13,
6122,
292,
355,
41927,
292,
201,
198,
11748,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
355,
11685,
201,
198,
201,
198,
201,
198,
11748,
299,
32152,
35... | 2.522059 | 136 |
from .mixin import MultiWidgetMixin
from .widget import MEDIA_TYPES, Media, MediaDefiningClass, Widget
__all__ = [
MEDIA_TYPES,
Media,
MediaDefiningClass,
Widget,
MultiWidgetMixin,
]
| [
6738,
764,
19816,
259,
1330,
15237,
38300,
35608,
259,
198,
6738,
764,
42655,
1330,
26112,
3539,
62,
9936,
47,
1546,
11,
6343,
11,
6343,
7469,
3191,
9487,
11,
370,
17484,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
26112,
... | 2.487805 | 82 |
"""
test_client_transport
----------------------------------
Tests for `alpenhorn.client.transport` module.
"""
import re
import pytest
from click.testing import CliRunner
try:
from unittest.mock import call, patch
except ImportError:
from mock import patch, call
import alpenhorn.client as cli
import alpen... | [
37811,
198,
9288,
62,
16366,
62,
7645,
634,
198,
3880,
438,
198,
198,
51,
3558,
329,
4600,
282,
3617,
25311,
13,
16366,
13,
7645,
634,
63,
8265,
13,
198,
37811,
198,
198,
11748,
302,
198,
198,
11748,
12972,
9288,
198,
6738,
3904,
13... | 2.378001 | 2,291 |
# -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Python module to draw heat map for Chrome
heat map is a histogram used to analyze the locality of function layout.
This modul... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2864,
383,
18255,
1505,
7294,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
46... | 3.826633 | 398 |
# stdlib
from datetime import datetime
from typing import Any
from typing import List
from typing import Optional
# third party
from nacl.signing import VerifyKey
from sqlalchemy.engine import Engine
# relative
from ....common.uid import UID
from ..exceptions import RequestError
from ..node_service.request_receiver.r... | [
2,
14367,
8019,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
32233,
198,
198,
2,
2368,
2151,
198,
6738,
299,
37779,
13,
12683,
278,
1330,
49899,
9218,
198,
... | 4.09009 | 111 |
from django import urls
from django.utils.translation import gettext_lazy as _
from tulius.stories.catalog import stories_catalog_page
from djfw.cataloging.core import CatalogPage
EDIT_STORY_PAGES_MAIN = 'edit_story_main'
EDIT_STORY_PAGES_TEXTS = 'edit_story_texts'
EDIT_STORY_PAGES_USERS = 'edit_story_users'
EDIT_ST... | [
6738,
42625,
14208,
1330,
2956,
7278,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
48373,
3754,
13,
50164,
13,
9246,
11794,
1330,
3923,
62,
9246,
11794,
62,
7700,
198,
6738,
... | 2.43215 | 479 |
#!/usr/bin/env python3
""" A module for collecting statistics about the performance of the memory Heirarchy
"""
import numpy as np
from time import time
from os.path import isdir
from os import mkdir,chdir,getcwd
import traceback,sys
import shutil, psutil
from numpy.random import rand
def measureRandomAccess(size,file... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
317,
8265,
329,
13157,
7869,
546,
262,
2854,
286,
262,
4088,
679,
343,
9282,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
640,
1330,
640,
198,
6738,
28686,
13,... | 1.988426 | 2,592 |
from decimal import Decimal
from django.contrib.sites.models import Site
from django.test import TestCase
from product.models import Product
from satchmo_store.shop.models import Cart, Config
from satchmo_store.contact.models import Contact
from shipping.modules.fedex_web_services.shipper import Shipper, convert_weight... | [
6738,
32465,
1330,
4280,
4402,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
27530,
1330,
14413,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
1720,
13,
27530,
1330,
8721,
198,
6738,
264,
963,
5908,
62,
8095,... | 3.706349 | 126 |
from django_swagger_tester.case_checks import skip
| [
6738,
42625,
14208,
62,
2032,
7928,
62,
4879,
353,
13,
7442,
62,
42116,
1330,
14267,
628
] | 3.25 | 16 |
import os
if __name__ == "__main__":
collect_results() | [
11748,
28686,
198,
197,
197,
197,
197,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
33327,
62,
43420,
3419
] | 2.5 | 24 |
from pxtrade.assets import reset, Cash
| [
6738,
279,
742,
27585,
13,
19668,
1330,
13259,
11,
16210,
628
] | 3.636364 | 11 |
# Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... | [
2,
15069,
1584,
1578,
1829,
5070,
355,
7997,
416,
262,
22998,
198,
2,
286,
262,
2351,
15781,
261,
2306,
873,
290,
4687,
8694,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
4347,
295,
286,
428,
2438,
318,
15069,
2269,
418,
4234,
4505,
... | 2.758415 | 1,842 |
import statistics
from collections import defaultdict
from typing import Any, Dict, List, Tuple, Union
from src.db.models.event import Event
from src.db.models.match import Match
from src.db.models.team_event import TeamEvent
from src.db.models.team_match import TeamMatch
from src.db.models.team_year import TeamYear
f... | [
11748,
7869,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
309,
29291,
11,
4479,
198,
198,
6738,
12351,
13,
9945,
13,
27530,
13,
15596,
1330,
8558,
198,
6738,
12351,
13,
9945,
13,
27530... | 3.453846 | 130 |
from api.settings.base import * # noqa
# separated by space
ALLOWED_HOSTS = ('0.0.0.0', '127.0.0.1')
CORS_ORIGIN_WHITELIST = (
'http://localhost:3000',
'http://127.0.0.1:3000',
'http://0.0.0.0:3000',
)
| [
6738,
40391,
13,
33692,
13,
8692,
1330,
1635,
1303,
645,
20402,
198,
198,
2,
11266,
416,
2272,
198,
7036,
3913,
1961,
62,
39,
10892,
50,
796,
19203,
15,
13,
15,
13,
15,
13,
15,
3256,
705,
16799,
13,
15,
13,
15,
13,
16,
11537,
19... | 2.018692 | 107 |
from django.test import TestCase
from oscar.apps.catalogue import models
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
201,
198,
201,
198,
6738,
267,
13034,
13,
18211,
13,
9246,
30326,
1330,
4981,
201,
198,
201,
198
] | 3.038462 | 26 |
# -*- coding: utf-8 -*- #
# Copyright 2020 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 requir... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
2,
15069,
12131,
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... | 3.490277 | 1,697 |
#!/usr/bin/env python
# _*_ coding: utf-8_*_
#
# --- refactored entry point for the application ---
# by lwz7512
# @2016/05/17
import os.path
import ssl
import tornado.ioloop
from tornado.options import define, options
import tornado.web
from foo.global_const import *
# all the route config
import router
define("po... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
62,
9,
62,
198,
2,
198,
2,
11420,
1006,
529,
1850,
5726,
966,
329,
262,
3586,
11420,
198,
2,
416,
300,
86,
89,
2425,
1065,
198,
2,
... | 2.975 | 160 |
print(factorial(5))
print(factorial(100)) | [
198,
4798,
7,
22584,
5132,
7,
20,
4008,
198,
4798,
7,
22584,
5132,
7,
3064,
4008
] | 2.625 | 16 |
from decimal import *
b = 1
n = 8
mu = 7
p = 200
i = 10
j = 128
mensaje = 53
getcontext().prec = p
print Mbn(b, n, mu, i, j,p)*mensaje
| [
198,
6738,
32465,
1330,
1635,
198,
198,
65,
796,
352,
198,
77,
796,
807,
198,
30300,
796,
220,
767,
198,
79,
796,
939,
198,
72,
796,
838,
198,
73,
796,
13108,
198,
45535,
1228,
68,
796,
7192,
198,
1136,
22866,
22446,
3866,
66,
796... | 2.074627 | 67 |
"""Test base classifier class."""
import pytest
import pandas as pd
import geniepy.classmgmt.classifiers as clsfr
from geniepy.errors import ClassifierError
CLSFR_NAME = "pub_score"
SAMPLE_RECORD = pd.Series(["g", "e", "e", "k", "s"])
class TestClassifier:
"""Base Classifier pytest class."""
classifier = c... | [
37811,
14402,
2779,
1398,
7483,
1398,
526,
15931,
198,
11748,
12972,
9288,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2429,
494,
9078,
13,
4871,
11296,
16762,
13,
4871,
13350,
355,
537,
82,
8310,
198,
6738,
2429,
494,
9078,
13,
... | 2.612903 | 744 |
"""Converts raw North Somerset data to standardised mobile library format"""
import csv
import geopandas
from datetime import datetime
from shapely.geometry import Point
from _common import create_mobile_library_file
DATA_SOURCE = '../raw/north_somerset.csv'
def run():
"""Runs the main script"""
mobiles_ns ... | [
37811,
3103,
24040,
8246,
2258,
46123,
1366,
284,
3210,
1417,
5175,
5888,
5794,
37811,
198,
198,
11748,
269,
21370,
198,
11748,
30324,
392,
292,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
5485,
306,
13,
469,
15748,
1330,
6252,
... | 2.185043 | 1,043 |
# by Kami Bigdely
# Rename Method
# Reference: https://parade.com/1039985/marynliles/pick-up-lines/
def calculate_area_under_graph(graph): # DONE: Rename this function to reflect what it's doing.
"""Calculate the area under the input graph."""
# bla bla bla.
pass
#####################
li = [5, -1, 43,... | [
2,
416,
509,
6277,
4403,
2934,
306,
198,
2,
7152,
480,
11789,
198,
2,
20984,
25,
3740,
1378,
1845,
671,
13,
785,
14,
15197,
2079,
5332,
14,
6874,
21283,
2915,
14,
27729,
12,
929,
12,
6615,
14,
198,
198,
4299,
15284,
62,
20337,
62,... | 2.72 | 175 |
#coding=utf-8
import numpy as np
import copy
# from atlasutil.presenteragent.presenter_types import *
import cv2 as cv
def SSDPostProcess(inference_result, image_resolution, confidence_threshold, labels = []):
'''
processes SSD detection result, returns detection result
Args:
resultList: list, d... | [
2,
66,
7656,
28,
40477,
12,
23,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4866,
198,
2,
422,
379,
21921,
22602,
13,
25579,
263,
25781,
13,
25579,
263,
62,
19199,
1330,
1635,
198,
11748,
269,
85,
17,
355,
269,
85,
628,
1... | 2.418069 | 2,258 |
import time
import discord
import random
import os
from discord.ext import commands, tasks
from itertools import cycle
client = commands.Bot(command_prefix = 'xb!')
client.remove_command('help')
Statut = cycle(['Version : Beta','Crée par Xupix#0369','Programmation en cours'])
monID = 446283752730263572
l ... | [
11748,
640,
201,
198,
11748,
36446,
201,
198,
11748,
4738,
201,
198,
11748,
28686,
201,
198,
6738,
36446,
13,
2302,
1330,
9729,
11,
8861,
201,
198,
6738,
340,
861,
10141,
1330,
6772,
201,
198,
201,
198,
16366,
796,
9729,
13,
20630,
7,... | 2.335427 | 796 |
from typing import Dict, Optional, Tuple, Union
import numpy as np
from autotabular.pipeline.base import DATASET_PROPERTIES_TYPE, PIPELINE_DATA_DTYPE
from autotabular.pipeline.components.base import AutotabularPreprocessingAlgorithm
from autotabular.pipeline.constants import DENSE, INPUT, SPARSE, UNSIGNED_DATA
from Co... | [
6738,
19720,
1330,
360,
713,
11,
32233,
11,
309,
29291,
11,
4479,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1960,
313,
397,
934,
13,
79,
541,
4470,
13,
8692,
1330,
360,
1404,
1921,
2767,
62,
4805,
3185,
17395,
11015,
62,
2... | 3.30597 | 134 |
# -*- coding:utf-8 -*-#
# 平均每个字敲击键盘次数
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
2,
198,
2,
10263,
117,
111,
161,
251,
229,
162,
107,
237,
10310,
103,
27764,
245,
46763,
110,
49035,
119,
165,
242,
106,
33566,
246,
162,
105,
94,
46763,
108,
628
] | 0.906977 | 43 |
import site
from pathlib import Path
import subprocess
site_packages = Path(site.getsitepackages()[0])
patch_file = site_packages / 'tensorflow_estimator' / 'python' / 'estimator' / 'keras.py'
subprocess.run(['patch', '-b', str(patch_file), 'estimator.patch'])
| [
11748,
2524,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
850,
14681,
198,
198,
15654,
62,
43789,
796,
10644,
7,
15654,
13,
11407,
270,
538,
441,
1095,
3419,
58,
15,
12962,
198,
17147,
62,
7753,
796,
2524,
62,
43789,
1220,
705,
83,... | 2.787234 | 94 |
import indirectdep
| [
11748,
12913,
10378,
628
] | 5 | 4 |
import pygame
import numpy as np
import sys
def color_matrix(array):
"""Replace binary values with RGB black and white."""
size = array.shape + (3,)
color = np.full(size, [255,255,255], dtype=np.int)
color[array == 1] = [0,0,0]
return color
def scale(array, n):
"""Scale the array for blitti... | [
11748,
12972,
6057,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
628,
198,
4299,
3124,
62,
6759,
8609,
7,
18747,
2599,
198,
220,
220,
220,
37227,
3041,
5372,
13934,
3815,
351,
25228,
2042,
290,
2330,
526,
15931,
198,
220,
220,... | 1.991122 | 1,577 |
import io
from ontobio.io import assocparser
from ontobio.io import gafparser
from ontobio.io import assocwriter
| [
11748,
33245,
198,
198,
6738,
39585,
672,
952,
13,
952,
1330,
840,
420,
48610,
198,
6738,
39585,
672,
952,
13,
952,
1330,
308,
1878,
48610,
198,
6738,
39585,
672,
952,
13,
952,
1330,
840,
420,
16002,
198
] | 3.081081 | 37 |
# Copyright (c) 2022 PaddlePaddle Authors. 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 applic... | [
2,
15069,
357,
66,
8,
33160,
350,
37382,
47,
37382,
46665,
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... | 3.247748 | 444 |
import os
| [
11748,
28686,
198
] | 3.333333 | 3 |
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demsausage.settings")
django.setup()
import json
from urllib.parse import parse_qs
import pytz
import time
import csv
from copy import deepcopy
import requests
from haralyzer import HarParser, HarPage
from bs4 import BeautifulSoup
from demsaus... | [
11748,
28686,
198,
11748,
42625,
14208,
198,
198,
418,
13,
268,
2268,
13,
2617,
12286,
7203,
35028,
1565,
11230,
62,
28480,
51,
20754,
62,
33365,
24212,
1600,
366,
67,
5232,
8717,
496,
13,
33692,
4943,
198,
28241,
14208,
13,
40406,
3419... | 2.950943 | 265 |
#print out leadership roles for manual review
import rtyaml
import utils
with open("legislators-current.yaml") as f:
legislators = rtyaml.load(f)
for legislator in legislators:
if 'leadership_roles' in legislator:
print("{}, {}".format(legislator["name"]["last"], legislator["name"]["first"]))
for role in le... | [
2,
4798,
503,
5531,
9176,
329,
10107,
2423,
198,
198,
11748,
374,
774,
43695,
198,
11748,
3384,
4487,
198,
198,
4480,
1280,
7203,
1455,
3044,
2024,
12,
14421,
13,
88,
43695,
4943,
355,
277,
25,
198,
220,
19964,
796,
374,
774,
43695,
... | 2.848485 | 231 |
from armulator.armv6.arm_exceptions import UndefinedInstructionException
from svc_a1 import SvcA1
from stc_a1 import StcA1
from ldc_immediate_a1 import LdcImmediateA1
from ldc_literal_a1 import LdcLiteralA1
from mcrr_a1 import McrrA1
from mrrc_a1 import MrrcA1
from cdp_a1 import CdpA1
from mcr_a1 import McrA1
from mrc_... | [
6738,
3211,
8927,
13,
1670,
85,
21,
13,
1670,
62,
1069,
11755,
1330,
13794,
18156,
6310,
2762,
16922,
198,
6738,
264,
28435,
62,
64,
16,
1330,
311,
28435,
32,
16,
198,
6738,
336,
66,
62,
64,
16,
1330,
520,
66,
32,
16,
198,
6738,
... | 2.407143 | 140 |
from pylab import *
from builtins import *
import json, sys, os, re
import pandas as pd
import janitor
from toolz.curried import *
from toolz.curried import operator as op
import geopandas as gpd
import geoplot as gpl
import geoplot.crs as gcrs
cases = pd.read_csv('./data/covid_confirmed_usafacts.csv', parse_dates... | [
6738,
279,
2645,
397,
1330,
1635,
198,
6738,
3170,
1040,
1330,
1635,
198,
11748,
33918,
11,
25064,
11,
28686,
11,
302,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
42897,
2072,
198,
198,
6738,
2891,
89,
13,
22019,
2228,
1330,
163... | 2.429741 | 733 |
# ---------------------------------------------------------------------
# EdgeCore.ES.get_inventory
# ---------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Pytho... | [
2,
16529,
30934,
198,
2,
13113,
14055,
13,
1546,
13,
1136,
62,
24807,
198,
2,
16529,
30934,
198,
2,
15069,
357,
34,
8,
4343,
12,
1238,
2481,
383,
399,
4503,
4935,
198,
2,
4091,
38559,
24290,
329,
3307,
198,
2,
16529,
30934,
198,
1... | 5.204545 | 88 |
import data_provider
import tensorflow as tf
import network
import math
slim = tf.contrib.slim
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('checkpoint_dir', 'ckpt/train',
'''Directory where to load the checkpoint''')
tf.app.flags.DEFINE_string('log_dir', 'ckpt/eval_ict',
... | [
11748,
1366,
62,
15234,
1304,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
3127,
198,
11748,
10688,
198,
198,
82,
2475,
796,
48700,
13,
3642,
822,
13,
82,
2475,
198,
198,
38948,
50,
796,
48700,
13,
1324,
13,
33152,
13,
38948... | 2.385321 | 218 |
#-*- encoding: utf-8 -*-
"""
Large non-Mersenne prime
The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 26972593−1; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form 2p−1, have been found which contain more digits.
H... | [
2,
12,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
21968,
1729,
12,
44,
364,
29727,
6994,
198,
198,
464,
717,
1900,
6994,
1043,
284,
7074,
530,
1510,
19561,
373,
5071,
287,
7358,
11,
290,
318,
257,
337,
364,... | 3.348684 | 152 |
import setuptools
setuptools.setup(
name='PyPIOMAS',
version='0.1.2',
author='Weiming Hu',
author_email='weiming@psu.edu',
url='https://github.com/Weiming-Hu/PyPIOMAS',
packages=['PyPIOMAS'],
license='LICENSE',
description='A package for downloading and converting the PIOMAS dataset',
... | [
11748,
900,
37623,
10141,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
220,
220,
220,
1438,
11639,
20519,
11901,
2662,
1921,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
17,
3256,
198,
220,
220,
220,
1772,
11639,
1135,
... | 2.317365 | 167 |
# Generated by Django 2.1.7 on 2019-04-11 07:59
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
22,
319,
13130,
12,
3023,
12,
1157,
8753,
25,
3270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 10
@author: jaehyuk
"""
import numpy as np
import scipy.stats as ss
import scipy.optimize as sopt
from . import normal
from . import bsm
import pyfeng as pf
'''
MC model class for Beta=1
'''
'''
MC model class for Beta=0
'''
'''
Conditional MC model class for Beta... | [
220,
220,
220,
1303,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2556,
838,
198,
198,
31,
9800,
25,
474,
3609,
12114,
2724,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
117... | 2.572414 | 145 |
# -*- coding: utf-8 -*-
from soft_drf.api.routers import DefaultRouter
router = DefaultRouter(trailing_slash=False)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
2705,
62,
7109,
69,
13,
15042,
13,
472,
1010,
1330,
15161,
49,
39605,
198,
198,
472,
353,
796,
15161,
49,
39605,
7,
9535,
4386,
62,
6649,
1077,
28,
25101,
8,
1... | 2.543478 | 46 |
import sys, os
appKey = "APP_KEY="
baseUrl = "BASE_URL="
APP_KEY_FILE_PATH = sys.argv[1]
APP_KEY = sys.argv[2]
BASE_URL = sys.argv[3]
properties = appKey + str(APP_KEY) + '\n' + baseUrl + str(BASE_URL) +'\n'
f = open(APP_KEY_FILE_PATH, mode="w", encoding='utf8')
f.write(properties)
f.close() | [
11748,
25064,
11,
28686,
198,
198,
1324,
9218,
796,
366,
24805,
62,
20373,
2625,
198,
8692,
28165,
796,
366,
33,
11159,
62,
21886,
2625,
198,
198,
24805,
62,
20373,
62,
25664,
62,
34219,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
248... | 2.192593 | 135 |
from substance import (Command, Engine)
from substance.constants import Syncher
| [
6738,
9136,
1330,
357,
21575,
11,
7117,
8,
198,
6738,
9136,
13,
9979,
1187,
1330,
16065,
2044,
628
] | 4.5 | 18 |
import torch
from fairnr.data.data_utils import load_exr
from fairnr.criterions.flip_loss import HDRFLIPLoss
loss = HDRFLIPLoss()
dark = torch.Tensor(load_exr('data/blender/guitar_static_exr/rgb/0151.exr')).permute((2, 0, 1)).unsqueeze(0).cuda()
loss(dark, dark)
print(dark) | [
11748,
28034,
198,
6738,
3148,
48624,
13,
7890,
13,
7890,
62,
26791,
1330,
3440,
62,
1069,
81,
198,
6738,
3148,
48624,
13,
22213,
263,
507,
13,
2704,
541,
62,
22462,
1330,
33675,
3697,
4061,
43,
793,
198,
198,
22462,
796,
33675,
3697,... | 2.376068 | 117 |
import pandas as pd
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from dash import callback_context
from utils.client import plot_frame, Canvas
from tools.frame import Shape
from app import app
from layouts.watch import stream
@app.callback(
Output('frame-slider', ... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
14470,
13,
45841,
3976,
1330,
23412,
11,
25235,
11,
1812,
198,
6738,
14470,
13,
1069,
11755,
1330,
31572,
10260,
198,
6738,
14470,
1330,
23838,
62,
22866,
198,
198,
6738,
3384,
4487,
13,
16366... | 2.596774 | 496 |
"""
Parse a C source file.
To use, subclass CParser and override its handle_* methods. Then instantiate
the class with a string to parse.
"""
__docformat__ = "restructuredtext"
import os.path
import sys
from ctypesgen.parser import cgrammar, preprocessor, yacc
# ---------------------------------------------------... | [
37811,
198,
10044,
325,
257,
327,
2723,
2393,
13,
198,
198,
2514,
779,
11,
47611,
16932,
28198,
290,
20957,
663,
5412,
62,
9,
5050,
13,
220,
3244,
9113,
9386,
198,
1169,
1398,
351,
257,
4731,
284,
21136,
13,
198,
37811,
198,
198,
83... | 2.83771 | 1,485 |
import torch
EPS = 1e-5
AGGREGATORS = {"mean": aggregate_mean,
"sum": aggregate_sum,
"max": aggregate_max,
"min": aggregate_min,
"std": aggregate_std,
"var": aggregate_var,
"moment3": aggregate_moment_3,
... | [
11748,
28034,
198,
198,
36,
3705,
796,
352,
68,
12,
20,
628,
628,
628,
628,
628,
628,
198,
4760,
28934,
38,
1404,
20673,
796,
19779,
32604,
1298,
19406,
62,
32604,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 1.792793 | 222 |
# coding:utf-8
# --author-- lanhua.zhou
from __future__ import print_function
import logging
import maya.cmds as cmds
from qtpy import QtWidgets, QtGui, QtCore
import zfused_api
import zfused_maya.core.record as record
import zfused_maya.core.resource as resource
import zfused_maya.widgets.window as window
import ... | [
2,
19617,
25,
40477,
12,
23,
198,
2,
1377,
9800,
438,
26992,
33061,
13,
38536,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
18931,
198,
198,
11748,
743,
64,
13,
28758,
82,
355,
23991,
82,
198,
198,
6738,
1066... | 2.820225 | 178 |
from __future__ import division
def migRing(populations, k, selection, replacement=None, migarray=None):
"""Perform a ring migration between the *populations*. The migration first
select *k* emigrants from each population using the specified *selection*
operator and then replace *k* individuals from the a... | [
6738,
11593,
37443,
834,
1330,
7297,
628,
198,
4299,
37011,
39687,
7,
12924,
5768,
11,
479,
11,
6356,
11,
9014,
28,
14202,
11,
37011,
18747,
28,
14202,
2599,
198,
220,
220,
220,
37227,
5990,
687,
257,
5858,
13472,
1022,
262,
1635,
129... | 2.918691 | 947 |
"""
JADS 2020 Data-Driven Food Value Chain course
Introduction to Sensors
Basic Seasonal (S)ARIMA model on PAR Sensor (sunlight) data.
"""
from statsmodels.tsa.seasonal import seasonal_decompose
import matplotlib.pyplot as plt
from statsmodels.tsa.statespace.sarimax import SARIMAX
from pmdarima import au... | [
37811,
198,
220,
220,
220,
449,
47149,
12131,
6060,
12,
20564,
574,
7318,
11052,
21853,
1781,
198,
220,
220,
220,
22395,
284,
14173,
669,
628,
220,
220,
220,
14392,
7369,
282,
357,
50,
8,
1503,
3955,
32,
2746,
319,
29463,
35367,
357,
... | 2.654429 | 1,253 |
import logging
# Set log level for debugging tests here
import os
LOGLEVEL = logging.INFO
cwd = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(cwd, 'data')
# Set this to False if you want to make sure some of the big inputs work
SKIP_LONG_TESTS = True
| [
11748,
18931,
198,
198,
2,
5345,
2604,
1241,
329,
28769,
5254,
994,
198,
11748,
28686,
198,
198,
25294,
2538,
18697,
796,
18931,
13,
10778,
198,
66,
16993,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
... | 2.854167 | 96 |
#
# Oracle SE Team Italy
# (L.S.)
#
import oci
import os
import io
import sys
from pathlib import Path
from oci.config import validate_config
from oci.identity import IdentityClient
from oci.identity.models import CreateUserDetails
# configuration for connection to Oracle OCI
# for user, tenancy you have to specify th... | [
2,
198,
2,
18650,
7946,
4816,
8031,
198,
2,
357,
43,
13,
50,
2014,
198,
2,
198,
11748,
267,
979,
198,
11748,
28686,
198,
11748,
33245,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
267,
979,
13,
11250,
1330,
2657... | 2.870206 | 339 |
from django.contrib import admin
from doorstep.geo import models
from doorstep.admin import ModelAdmin
admin.site.register(models.Country, CountryAdmin)
admin.site.register(models.State, StateAdmin)
admin.site.register(models.Address, AddressAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
41594,
13,
469,
78,
1330,
4981,
198,
6738,
41594,
13,
28482,
1330,
9104,
46787,
628,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
27530,
13,
33921,
11,
12946,
46787,
8,... | 3.591549 | 71 |
import aoc_cas.aoc2021.day12 as aoc
testData1 = """
start-A
start-b
A-c
A-b
b-d
A-end
b-end
""".strip()
testData2 = """
dc-end
HN-start
start-kj
dc-start
dc-HN
LN-dc
HN-end
kj-sa
kj-HN
kj-dc
""".strip()
testData3 = """
fs-end
he-DX
fs-he
start-DX
pj-DX
end-zg
zg-sl
zg-pj
pj-he
RW-he
fs-DX
pj-RW
zg-RW
start-pj
he-WI
... | [
11748,
257,
420,
62,
34004,
13,
64,
420,
1238,
2481,
13,
820,
1065,
355,
257,
420,
198,
198,
9288,
6601,
16,
796,
37227,
198,
9688,
12,
32,
198,
9688,
12,
65,
198,
32,
12,
66,
198,
32,
12,
65,
198,
65,
12,
67,
198,
32,
12,
4... | 1.690476 | 210 |
"""
Token Auth plugin for HTTPie.
"""
import os
import sys
try:
from urllib.parse import urlsplit
except ImportError:
from urlparse import urlsplit
import requests
from httpie.plugins import AuthPlugin, builtin
auth_endpoint = os.environ.get('HTTPIE_TOKEN_AUTH_URL', '/api/token/new.json')
| [
37811,
198,
30642,
26828,
13877,
329,
14626,
494,
13,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
28311,
25,
198,
220,
220,
220,
422,
2956,
297,
571,
13,
29572,
1330,
2956,
7278,
489,
270,
198,
16341,
17267,
12331,
25,
... | 2.895238 | 105 |
"""
The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes.
The state pattern can be interpreted as a strategy pattern, which is able to switch a strategy through invocations of methods defined in the pattern's interface.
RealTime Ana... | [
37811,
201,
198,
464,
1181,
3912,
318,
257,
17211,
3788,
1486,
3912,
326,
3578,
281,
2134,
284,
8343,
663,
4069,
618,
663,
5387,
1181,
2458,
13,
201,
198,
201,
198,
464,
1181,
3912,
460,
307,
16173,
355,
257,
4811,
3912,
11,
543,
31... | 3.652614 | 593 |
"""File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject
from ...tl.tlobject import TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
from datetime import datetime
if TYPE_CHECKING:
from ...tl.types import TypeInputContact, ... | [
37811,
8979,
7560,
416,
24811,
10267,
82,
6,
17301,
13,
1439,
2458,
481,
307,
13793,
42827,
37811,
198,
6738,
2644,
28781,
13,
28781,
15252,
1330,
24811,
10267,
198,
6738,
2644,
28781,
13,
28781,
15252,
1330,
24811,
18453,
198,
6738,
1972... | 3.512821 | 117 |
import os
import sys
import wasmtime
try:
from importlib import resources as importlib_resources
importlib_resources.files # py3.9+ stdlib
except (ImportError, AttributeError):
import importlib_resources # py3.8- shim
wasm_cfg = wasmtime.Config()
wasm_cfg.cache = True
wasi_cfg = wasmtime.WasiConfig()
was... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
373,
76,
2435,
198,
28311,
25,
198,
220,
220,
220,
422,
1330,
8019,
1330,
4133,
355,
1330,
8019,
62,
37540,
198,
220,
220,
220,
1330,
8019,
62,
37540,
13,
16624,
1303,
12972,
18,
13,
24,
... | 2.447293 | 351 |
default_app_config = 'mayan.apps.redactions.apps.RedactionsApp'
| [
12286,
62,
1324,
62,
11250,
796,
705,
11261,
272,
13,
18211,
13,
445,
4658,
13,
18211,
13,
7738,
4658,
4677,
6,
198
] | 2.909091 | 22 |
"""Example graphs from causal inference literature."""
import networkx as nx
from oyster.diagram import CausalDiagram
# Graphs
mit = nx.DiGraph([('A', 'C'), ('B', 'C'), ('C', 'D'),
('C', 'E'), ('D', 'F'), ('F', 'G'),])
# Causal Inference in Statistics: A Primer
primer = {
'fig1_8': CausalDiagra... | [
37811,
16281,
28770,
422,
26558,
32278,
9285,
526,
15931,
198,
198,
11748,
3127,
87,
355,
299,
87,
198,
6738,
35104,
1706,
13,
10989,
6713,
1330,
6488,
6775,
18683,
6713,
198,
198,
2,
29681,
82,
198,
2781,
796,
299,
87,
13,
18683,
370... | 1.574184 | 5,702 |
# Generated by Django 3.2.4 on 2021-06-19 17:34
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
19,
319,
33448,
12,
3312,
12,
1129,
1596,
25,
2682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# Generated by Django 3.1 on 2021-06-25 10:50
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
319,
33448,
12,
3312,
12,
1495,
838,
25,
1120,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
import os
import tensorflow as tf
from src.utils.utils import read_embeddings_with_type,write_emd_file
from src.utils.sampler import Hegan_read_graph
import time
import numpy as np
from src.utils.evaluation import DBLP_evaluation
from src.utils.evaluation import ACM_evaluation
# from src.utils.evaluation import Amin... | [
11748,
28686,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
12351,
13,
26791,
13,
26791,
1330,
1100,
62,
20521,
67,
654,
62,
4480,
62,
4906,
11,
13564,
62,
368,
67,
62,
7753,
198,
6738,
12351,
13,
26791,
13,
37687,
20053,
1330... | 2.133206 | 1,051 |
from math import sqrt
import numpy as np
# Primality Testing
# Returns a list of primes less than n using Sieve of Erathosthenes' algorithm
# Determines if n is a prime by using the Miller-Rabin primality test
# Uses 100 different bases for testing
# Uses a probabilistic method of determining if a number is prime... | [
6738,
10688,
1330,
19862,
17034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
11460,
1483,
23983,
198,
198,
2,
16409,
257,
1351,
286,
778,
999,
1342,
621,
299,
1262,
311,
12311,
286,
5256,
776,
455,
831,
274,
6,
11862,
628,
198,
... | 3.295082 | 122 |
import firebase_admin
from firebase_admin import credentials
# conf.json not included in the repo because it have write access to the database
cred = credentials.Certificate("conf.json")
firebase_admin.initialize_app(
cred, {"databaseURL": "https://covid19maroc-632de.firebaseio.com"}
)
# Import database module.
... | [
11748,
2046,
8692,
62,
28482,
198,
6738,
2046,
8692,
62,
28482,
1330,
18031,
198,
198,
2,
1013,
13,
17752,
407,
3017,
287,
262,
29924,
780,
220,
340,
423,
3551,
1895,
284,
262,
6831,
198,
66,
445,
796,
18031,
13,
37608,
22460,
7203,
... | 3.245763 | 118 |
"""
Copyright 2020 The OneFlow Authors. 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 agr... | [
37811,
198,
15269,
12131,
383,
1881,
37535,
46665,
13,
1439,
2489,
10395,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.863354 | 161 |
"""
https://github.com/hyves-org/p2ptracker
Copyright (c) 2011, Ramon van Alteren
MIT license: http://www.opensource.org/licenses/MIT
"""
from p2ptracker.tests.helpers import utils
| [
37811,
198,
5450,
1378,
12567,
13,
785,
14,
12114,
1158,
12,
2398,
14,
79,
17,
20692,
10735,
198,
15269,
357,
66,
8,
2813,
11,
7431,
261,
5719,
12344,
14226,
198,
36393,
5964,
25,
2638,
1378,
2503,
13,
44813,
1668,
13,
2398,
14,
677... | 2.859375 | 64 |
#!/usr/bin/env python3
#
# Tests the basic methods of the adaptive covariance base class.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future__ import print_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
30307,
262,
4096,
5050,
286,
262,
29605,
44829,
590,
2779,
1398,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
34279,
4694,
357,
5450,
1378,
12567,
13,
785,
14,
79,
... | 2.181233 | 1,087 |
from sys import stdin
stdin = open("input.txt", "r")
a = sorted([int(v) for v in stdin.readlines()])
a.append(a[-1] + 3)
cur = 0
diff = [0] * 4
for v in a:
diff[v - cur] += 1
cur = v
print(diff[1] * diff[3]) | [
6738,
25064,
1330,
14367,
259,
198,
19282,
259,
796,
1280,
7203,
15414,
13,
14116,
1600,
366,
81,
4943,
198,
64,
796,
23243,
26933,
600,
7,
85,
8,
329,
410,
287,
14367,
259,
13,
961,
6615,
3419,
12962,
198,
64,
13,
33295,
7,
64,
5... | 2.148515 | 101 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np # linear algebra
np.random.seed(666)
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sklearn.model_selection import train_test_split
from subprocess import check_output
print(check_output(["ls", "../input"]).decode("utf8"))... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
11748,
299,
32152,
355,
45941,
1303,
14174,
37139,
198,
37659,
13,
25120,
13,
28826,
7,
27310,
8,
198,
117... | 2.410959 | 1,314 |
from rest_framework import generics, permissions, status
from rest_framework.response import Response
from ..models import Follow, AuthorProfile, ServerUser
from ..serializers import AuthorProfileSerializer
import requests
import json
from urllib.parse import urlparse
from django.conf import settings
| [
6738,
1334,
62,
30604,
1330,
1152,
873,
11,
21627,
11,
3722,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
11485,
27530,
1330,
7281,
11,
6434,
37046,
11,
9652,
12982,
198,
6738,
11485,
46911,
11341,
1330,
6434,
37046,
3... | 4.522388 | 67 |