content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
| [
11748,
28686,
198,
198,
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
628,
198
] | 3.133333 | 30 |
class DivideByZeroException(ArithmeticException):
"""
The exception that is thrown when there is an attempt to divide an integral or decimal value by zero.
DivideByZeroException()
DivideByZeroException(message: str)
DivideByZeroException(message: str,innerException: Exception)
"""
def ZZZ(self):
... | [
4871,
46894,
3886,
28667,
16922,
7,
3163,
29848,
16922,
2599,
201,
198,
37227,
201,
198,
383,
6631,
326,
318,
8754,
618,
612,
318,
281,
2230,
284,
14083,
281,
19287,
393,
32465,
1988,
416,
6632,
13,
201,
201,
198,
220,
201,
201,
198,
... | 3.014577 | 343 |
#!/usr/bin/env python
# coding=utf-8
"""
core.tenhou.log
"""
__author__ = 'Rnd495'
import os
import json
import datetime
import urllib
from core.configs import Configs
configs = Configs.instance()
class Log(object):
"""
Log
"""
@property
@property
@property
@property
@propert... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
37811,
198,
7295,
13,
1452,
15710,
13,
6404,
198,
37811,
198,
198,
834,
9800,
834,
796,
705,
49,
358,
33781,
6,
198,
198,
11748,
28686,
198,
... | 2.122761 | 2,289 |
import pytest
from eth_abi import decode_single
from eth_tester.exceptions import TransactionFailed
# web3 returns f"execution reverted: {err_str}"
# TODO move exception string parsing logic into assert_tx_failed
invalid_code = [
"""
@external
def test(a: int128) -> int128:
assert a > 1, ""
return 1 +... | [
11748,
12972,
9288,
198,
6738,
4555,
62,
17914,
1330,
36899,
62,
29762,
198,
6738,
4555,
62,
4879,
353,
13,
1069,
11755,
1330,
45389,
37,
6255,
628,
198,
2,
3992,
18,
5860,
277,
1,
18558,
1009,
50239,
25,
1391,
8056,
62,
2536,
36786,
... | 2.520697 | 459 |
#!/usr/bin/python
# -*- coding: utf-8; -*-
#
# 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
#
# Unles... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
26,
532,
9,
12,
198,
2,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
... | 2.441574 | 813 |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2022 PyMeasure Developers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | [
2,
198,
2,
770,
2393,
318,
636,
286,
262,
9485,
47384,
5301,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
2211,
12,
1238,
1828,
9485,
47384,
34152,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,... | 2.482474 | 4,850 |
# -*- 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... | 2.696754 | 4,498 |
import typing
from apistar import Settings
from apistar.interfaces import Auth
from apistar.types import ReturnValue
from raven import Client
__version__ = "0.2.0"
| [
11748,
19720,
198,
198,
6738,
2471,
47229,
1330,
16163,
198,
6738,
2471,
47229,
13,
3849,
32186,
1330,
26828,
198,
6738,
2471,
47229,
13,
19199,
1330,
8229,
11395,
198,
6738,
37735,
1330,
20985,
198,
198,
834,
9641,
834,
796,
366,
15,
1... | 3.541667 | 48 |
# import necessary libraries
# from models import create_classes
import pandas as pd
import os
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from sqlite3 import connect
import json
from flask import (
Flask,
rend... | [
2,
1330,
3306,
12782,
198,
2,
422,
4981,
1330,
2251,
62,
37724,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
198,
11748,
44161,
282,
26599,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
2306,
296,
499,
1330,
3557,
499,
62,
... | 3.056259 | 711 |
import logging
from models import tag as Tag, business as Business, business_tag_join_table
logging.getLogger().setLevel(logging.INFO)
def business_exists(yelp_id, conn):
"""Return True if the business exists."""
return conn.execute(Business.select().where(Business.c.yelp_id == yelp_id))\
.first() ... | [
11748,
18931,
198,
198,
6738,
4981,
1330,
7621,
355,
17467,
11,
1597,
355,
7320,
11,
1597,
62,
12985,
62,
22179,
62,
11487,
198,
198,
6404,
2667,
13,
1136,
11187,
1362,
22446,
2617,
4971,
7,
6404,
2667,
13,
10778,
8,
628,
198,
198,
... | 2.802198 | 182 |
from random import random
from random import choice
import numpy as np
import plotly.express as px
import struct
import operator
###
# Broadly the same as "basic_functions.py" but updated to include motility
# intentionally trying to keep them separate so as not to slow down the basic version
###
| [
6738,
4738,
1330,
4738,
198,
6738,
4738,
1330,
3572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
198,
11748,
2878,
198,
11748,
10088,
198,
198,
21017,
198,
2,
9765,
306,
262,
976,
355,
366,
3548... | 3.853659 | 82 |
import pandas as pd | [
11748,
19798,
292,
355,
279,
67
] | 3.166667 | 6 |
""" TSP SIMULATED ANNEALING """
# Imports
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# read data from file
filename = "eil51.tsp"
f = open(f"TSP-configurations/{filename}.txt", "r")
network = f.readlines()[6:-1]
# create dictionary to store coordinates
nodes = dict()
# split data and pu... | [
37811,
309,
4303,
23749,
6239,
11617,
3537,
12161,
1847,
2751,
37227,
198,
198,
2,
1846,
3742,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
628,
... | 2.300633 | 632 |
import astropy.units as u
import pytest
from benchmark import Benchmark, benchmark
@benchmark(
{
"log.initial.system.Age": {"value": 3.155760e13, "unit": u.sec},
"log.initial.system.Time": {"value": 0.000000, "unit": u.sec},
"log.initial.system.TotAngMom": {
"value": 6.747268e4... | [
11748,
6468,
28338,
13,
41667,
355,
334,
198,
11748,
12972,
9288,
198,
6738,
18335,
1330,
25187,
4102,
11,
18335,
628,
198,
31,
26968,
4102,
7,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
6404,
13,
36733,
... | 1.754299 | 51,404 |
#!/usr/bin/python
# Copyright (c) 2013, 2014-2017 Oracle and/or its affiliates. All rights reserved.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = "Andrew Hopkinson (Oracle Cloud Solutions A-Team)"
__copyright__ = "Copyright (... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
15069,
357,
66,
8,
2211,
11,
1946,
12,
5539,
18650,
290,
14,
273,
663,
29116,
13,
1439,
2489,
10395,
13,
628,
198,
37811,
15946,
485,
19937,
12489,
198,
37811,
198,
198,
2,
220,
27156,
... | 3.699422 | 346 |
'''
Module for SNooPy to download/parse data from the Open Supernova Catalog.
'''
from __future__ import print_function
import six
import json
if six.PY3:
import urllib.request as urllib
else:
import urllib
from astropy.coordinates import Angle
from snpy import sn,lc,fset
from numpy import array,log10
import ast... | [
7061,
6,
198,
26796,
329,
11346,
2238,
20519,
284,
4321,
14,
29572,
1366,
422,
262,
4946,
3115,
38438,
44515,
13,
198,
7061,
6,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
2237,
198,
11748,
33918,
198,
361,
22... | 2.044028 | 7,041 |
from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
money_machine = MoneyMachine()
coffee_maker = CoffeeMaker()
menu = Menu()
coffee_maker.report()
money_machine.report()
coffee_machine_is_on = True
while coffee_machine_is_on:
choices = menu.get_items()
... | [
6738,
6859,
1330,
21860,
11,
21860,
7449,
198,
6738,
6891,
62,
10297,
1330,
19443,
48890,
198,
6738,
1637,
62,
30243,
1330,
12911,
37573,
198,
198,
26316,
62,
30243,
796,
12911,
37573,
3419,
198,
1073,
5853,
62,
10297,
796,
19443,
48890,
... | 2.657143 | 280 |
# Copyright (c) 2013-2018, Rethink Robotics Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
15069,
357,
66,
8,
2211,
12,
7908,
11,
371,
2788,
676,
47061,
3457,
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,
11... | 2.363787 | 1,806 |
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
1584,
44628,
3457,
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... | 3.5 | 228 |
# import dependencies
from flask import Flask, jsonify, render_template, request, redirect
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
import pandas as pd
import numpy as np
import datetime as dt
# database setup using au... | [
2,
1330,
20086,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
11,
8543,
62,
28243,
11,
2581,
11,
18941,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
2306,
296,
499,
1330,
3557,
499,
62,
8692,
198,
6738,
44161,
282,
26599,
13,
579,
... | 3.070039 | 257 |
# -*- coding: utf-8 -*-
import os
import sys
from logging import getLogger
from typing import Any, List, Tuple
import cv2
import numpy as np
import torch
from bidi.algorithm import get_display
from .detection import get_detector, get_textbox
from .imgproc import loadImage
from .recognition import get_recognizer, get... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
6738,
19720,
1330,
4377,
11,
7343,
11,
309,
29291,
198,
198,
11748,
269,
85,
17,
198... | 3.017316 | 231 |
# local
from src.utils.images import ImagesHelper
from src.dtypes import ImagesInner
| [
2,
1957,
198,
6738,
12351,
13,
26791,
13,
17566,
1330,
5382,
47429,
198,
6738,
12351,
13,
67,
19199,
1330,
5382,
818,
1008,
628
] | 3.73913 | 23 |
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
import copy
import signal
import time
import re
import rpy2
import rpy2.robjects as robjects
from rpy2 import rinterface
from rpy2.robjects import pandas2ri
from rpy2.robjects.functions import Signatu... | [
11748,
25064,
198,
11748,
28686,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
7203,
526,
4008,
198,
17597,
13,
67,
756,
62,
13564,
62,
26327,
8189,
796,
6407,
198,
198,
834,
9800,
834,
796,
366,
14261,... | 2.840491 | 326 |
from __future__ import annotations
from typing import Match
import pyjokes
from bot.config import Config
from bot.data import command
from bot.data import esc
from bot.data import format_msg
@command('!joke', '!yoke')
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
13225,
198,
198,
11748,
12972,
73,
3369,
198,
198,
6738,
10214,
13,
11250,
1330,
17056,
198,
6738,
10214,
13,
7890,
1330,
3141,
198,
6738,
10214,
13,
7890,
1330,
3671,
1... | 3.484375 | 64 |
#!/usr/bin/env python
import os
import sys
import logging
import argparse
import time
import ngskit.barcodes as barcodes
from ngskit.utils import fasta_tools, fastq_tools
#import barcodes
#from utils import fasta_tools, fastq_tools
def trimming(demultiplexed_fastq, barcode, quality_threshold,
trgt_len, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
198,
11748,
23370,
8135,
270,
13,
65,
5605,
4147,
355,
2318,
40148,
198,
6738,
23370,
8... | 2.057078 | 5,326 |
from checkov.yaml_doc.base_registry import Registry
registry = Registry()
| [
6738,
2198,
709,
13,
88,
43695,
62,
15390,
13,
8692,
62,
2301,
4592,
1330,
33432,
198,
198,
2301,
4592,
796,
33432,
3419,
198
] | 3.26087 | 23 |
"""
Internal api methods for current service.
Example:
from anthill.platform.api.internal import as_internal, InternalAPI
@as_internal()
async def your_internal_api_method(api: InternalAPI, *params, **options):
# current_service = api.service
...
"""
from anthill.platform.api.internal imp... | [
37811,
198,
37693,
40391,
5050,
329,
1459,
2139,
13,
198,
198,
16281,
25,
628,
220,
220,
220,
422,
26794,
359,
13,
24254,
13,
15042,
13,
32538,
1330,
355,
62,
32538,
11,
18628,
17614,
628,
220,
220,
220,
2488,
292,
62,
32538,
3419,
... | 3.039683 | 126 |
#!/usr/bin/env mdl
# -*- coding: utf-8 -*-
# =======================================
# File Name :
# Purpose :
# Creation Date :
# Last Modified :
# Created By : sunpeiqin
# =======================================
import os
import sys
import argparse
import magic
import keyword
import importlib
import collections
impo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
285,
25404,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
46111,
50155,
198,
2,
9220,
6530,
1058,
198,
2,
32039,
1058,
198,
2,
21582,
7536,
1058,
198,
2,
4586,
40499,
... | 2.335583 | 1,630 |
# -*- coding: utf-8 -*-
import numpy as np
import random
#Load embedding vocabulary
#Load embedding vocabulary
#Load embeddings filtered by pre-given vocabulary
#Load embedding matrices input/output
#Split training and development data
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
198,
2,
8912,
11525,
12083,
25818,
198,
198,
2,
8912,
11525,
12083,
25818,
628,
198,
2,
8912,
11525,
67,
654,
29083... | 3.507246 | 69 |
import discord
from discord.ext import commands
from discord.ext.commands import Cog
from helpers.checks import check_if_staff
from helpers.userlogs import setwatch
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
36446,
13,
2302,
13,
9503,
1746,
1330,
327,
519,
198,
6738,
49385,
13,
42116,
1330,
2198,
62,
361,
62,
28120,
198,
6738,
49385,
13,
7220,
6404,
82,
1330,
900,
8340,
628,... | 3.883721 | 43 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 3.545817 | 251 |
from context import ROOT_DIR, nnUtils, train_came, came
import tensorflow as tf
import numpy as np
import argparse
import os
import progressbar
import random
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
if __name__ == "__main__":
args = parse_args()
data_x, data_y = train_came.build_dataset(train_cam... | [
6738,
4732,
1330,
15107,
2394,
62,
34720,
11,
299,
77,
18274,
4487,
11,
4512,
62,
66,
480,
11,
1625,
198,
198,
11748,
11192,
273,
11125,
220,
220,
220,
220,
220,
220,
220,
355,
48700,
198,
11748,
299,
32152,
220,
220,
220,
220,
220,... | 2.303303 | 999 |
import typing
import pytest
from genshin import paginators
@pytest.fixture(name="counting_paginator")
| [
11748,
19720,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
308,
641,
20079,
1330,
279,
23183,
2024,
628,
198,
198,
31,
9078,
9288,
13,
69,
9602,
7,
3672,
2625,
9127,
278,
62,
79,
363,
20900,
4943,
628,
628,
628,
628
] | 2.85 | 40 |
import os
import errno
from twitter.common import log
from twitter.common.recordio import ThriftRecordReader
from gen.twitter.thermos.ttypes import RunnerCkpt
| [
11748,
28686,
198,
11748,
11454,
3919,
198,
198,
6738,
17044,
13,
11321,
1330,
2604,
198,
6738,
17044,
13,
11321,
13,
22105,
952,
1330,
16283,
2135,
23739,
33634,
198,
6738,
2429,
13,
6956,
13,
490,
16785,
13,
83,
19199,
1330,
21529,
34... | 3.659091 | 44 |
# Copyright 2017 Lenovo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | [
2,
15069,
2177,
40269,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,... | 3.628571 | 210 |
"""add country code to table
Revision ID: 0367b739bb81
Revises: 1e09924c1938
Create Date: 2022-01-27 16:10:57.297020
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0367b739bb81'
down_revision = '1e09924c1938'
branch_labels = None
depends_on = None
| [
37811,
2860,
1499,
2438,
284,
3084,
198,
198,
18009,
1166,
4522,
25,
657,
27824,
65,
22,
2670,
11848,
6659,
198,
18009,
2696,
25,
352,
68,
15,
2079,
1731,
66,
1129,
2548,
198,
16447,
7536,
25,
33160,
12,
486,
12,
1983,
1467,
25,
940... | 2.508065 | 124 |
#!/usr/bin/env python
import os
import smach_based_introspection_framework.offline_part.visualize_dataset as m
if __name__ == "__main__":
m.run()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
895,
620,
62,
3106,
62,
600,
305,
31308,
62,
30604,
13,
2364,
1370,
62,
3911,
13,
41464,
1096,
62,
19608,
292,
316,
355,
285,
198,
198,
361,
11593,
367... | 2.576271 | 59 |
from core.loggers import log, dlog
from core import messages
from core.vectors import ModuleExec
from core.module import Module
from core.config import base_path
from http.server import HTTPServer, BaseHTTPRequestHandler
from tempfile import gettempdir
from socketserver import ThreadingMixIn
from urllib.parse import ur... | [
6738,
4755,
13,
6404,
5355,
1330,
2604,
11,
288,
6404,
198,
6738,
4755,
1330,
6218,
198,
6738,
4755,
13,
303,
5217,
1330,
19937,
23002,
198,
6738,
4755,
13,
21412,
1330,
19937,
198,
6738,
4755,
13,
11250,
1330,
2779,
62,
6978,
198,
67... | 2.721591 | 528 |
from .construct import GraspConstruct, MultiStartGraspConstruct
| [
6738,
764,
41571,
1330,
1902,
5126,
42316,
11,
15237,
10434,
8642,
5126,
42316,
201,
198
] | 4.333333 | 15 |
import pytest
| [
11748,
12972,
9288,
628
] | 3.75 | 4 |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.cache import never_cache
from django.utils.decorators import method_decorator
from uw_saml.decorators import group_required
from cour... | [
2,
15069,
33448,
33436,
12,
2043,
11,
2059,
286,
2669,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
2928... | 2.948787 | 371 |
import json
import os.path
import subprocess
import boto3
# This is all cribbed from the django branch's cluster_management/deployment_helpers folder
# TODO once the branches are merged, use that code and NOT this code
| [
11748,
33918,
201,
198,
11748,
28686,
13,
6978,
201,
198,
11748,
850,
14681,
201,
198,
201,
198,
11748,
275,
2069,
18,
201,
198,
201,
198,
2,
770,
318,
477,
48083,
3077,
422,
262,
42625,
14208,
8478,
338,
13946,
62,
27604,
14,
2934,
... | 3.064103 | 78 |
"""Boundarys for Responses from TelescopeController (TC) and Requests to TC.
Data entry and exit point into use_cases layer.
"""
class TelescopeControllerResponseBoundary:
"""Contains Responses from TelescopeController Device.
"""
def __init__(
self,
ra_response = None,
dec_respo... | [
37811,
49646,
560,
82,
329,
20549,
274,
422,
36789,
22130,
357,
4825,
8,
290,
9394,
3558,
284,
17283,
13,
198,
220,
220,
6060,
5726,
290,
8420,
966,
656,
779,
62,
33964,
7679,
13,
198,
37811,
198,
198,
4871,
36789,
22130,
31077,
49646... | 2.229249 | 759 |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 25 18:04:32 2020
@author: Dragana
"""
import mne
import microstates as mst
import numpy as np
HC_RS_path = 'C:/Users/.../Documents/RS_EEG/'
subj_folder = ['subj01', 'subj02', 'subj03', 'subj04', 'subj05']
# Parameteres setting up
chan_to_drop = ['E67', 'E73', 'E247'... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
3158,
1679,
1248,
25,
3023,
25,
2624,
12131,
198,
198,
31,
9800,
25,
12697,
2271,
198,
37811,
198,
11748,
285,
710,
198,
11748,
4580,
2721... | 2.134592 | 1,642 |
#
# Copyright 2011 Shopzilla.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this 1 except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | [
2,
198,
2,
15069,
2813,
13705,
16496,
13,
785,
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,
352,
2845,
287,
11846,
351,
262,
13789,
13,
198,
... | 3.707317 | 205 |
from . import DATA_DIR
import sys
import glob
from .background_systems import BackgroundSystemModel
from .export import ExportInventory
from inspect import currentframe, getframeinfo
from pathlib import Path
from scipy import sparse
import csv
import itertools
import numexpr as ne
import numpy as np
import xarray as xr... | [
6738,
764,
1330,
42865,
62,
34720,
198,
11748,
25064,
198,
11748,
15095,
198,
6738,
764,
25249,
62,
10057,
82,
1330,
25353,
11964,
17633,
198,
6738,
764,
39344,
1330,
36472,
818,
17158,
198,
6738,
10104,
1330,
1459,
14535,
11,
651,
14535,... | 1.66917 | 61,923 |
# Django settings for gtd project.
import os
from django.contrib.messages import constants as message_constants
DEBUG = get_debug_settings()
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_na... | [
2,
37770,
6460,
329,
308,
8671,
1628,
13,
198,
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
37348,
1095,
1330,
38491,
355,
3275,
62,
9979,
1187,
198,
198,
30531,
796,
651,
62,
24442,
62,
33692,
3419,
198,
198,
33,
... | 2.633199 | 1,494 |
from flask_restful import Resource
import requests
import json
import os
import redis
HEADER = {
'User-Agent': 'CompuServe Classic/1.22',
'Accept': 'application/json',
'Host': os.getenv("HOST"),
'Authorization': f'Bearer {os.getenv("ACESS_TOKEN")}'
}
class Search(Resource):
"""Recurso responsáve... | [
6738,
42903,
62,
2118,
913,
1330,
20857,
198,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
2266,
271,
628,
198,
37682,
1137,
796,
1391,
198,
220,
220,
220,
705,
12982,
12,
36772,
10354,
705,
7293,
84,
50,
3760,
... | 2.33414 | 413 |
# https://leetcode.com/problems/first-unique-character-in-a-string/
| [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
11085,
12,
34642,
12,
22769,
12,
259,
12,
64,
12,
8841,
14,
198
] | 2.72 | 25 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
# Copyright (c) OpenMMLab. All rights reserved.
from mmdet.datasets import DATASETS
from .coco_video_dataset import CocoVideoDataset
@DATASETS.register_module()
class YouTubeVISDataset(CocoVideoDataset):
"""YouTube VIS dataset for video instance segmentation."""
CLASSES_2019_version = ('person', 'giant_pand... | [
2,
15069,
357,
66,
8,
4946,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
6738,
8085,
15255,
13,
19608,
292,
1039,
1330,
360,
1404,
1921,
32716,
198,
198,
6738,
764,
66,
25634,
62,
15588,
62,
19608,
292,
316,
1330,
48222,
10798,
27... | 1.804299 | 884 |
# SPDX-FileCopyrightText: 2021 easyDiffraction contributors <support@easydiffraction.org>
# SPDX-License-Identifier: BSD-3-Clause
# © 2021 Contributors to the easyDiffraction project <https://github.com/easyScience/easyDiffractionApp>
__author__ = 'github.com/andrewsazonov'
__version__ = '0.0.1'
from random import ra... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33448,
2562,
28813,
7861,
20420,
1279,
11284,
31,
38171,
26069,
7861,
13,
2398,
29,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
18,
12,
2601,
682,
198,
2,
10673,
33448,... | 3.061069 | 131 |
# -*- coding: utf-8 -*-
# python imports
import os
import subprocess
import sys, traceback
from flask.ext.migrate import MigrateCommand
from flask.ext.script import Manager
from database import manager as database_manager
try:
from project import app
from project.application import configure_app
from proj... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
21015,
17944,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
11,
12854,
1891,
198,
6738,
42903,
13,
2302,
13,
76,
42175,
1330,
337,
42175,
21575,
... | 3.193431 | 274 |
"""PROV model fpr GitLab2PROV."""
__author__ = "Claas de Boer, Andreas Schreiber, Lynn von Kurnatowski"
__copyright__ = "Copyright 2020, German Aerospace Center (DLR) and individual contributors"
__license__ = "MIT"
__version__ = "0.5"
__status__ = "Development"
from prov.model import ProvDocument
from prov.constant... | [
37811,
41283,
2746,
277,
1050,
15151,
17822,
17,
41283,
526,
15931,
198,
198,
834,
9800,
834,
796,
366,
47404,
292,
390,
3248,
263,
11,
33728,
3059,
260,
1856,
11,
24868,
18042,
509,
700,
265,
12079,
1,
198,
834,
22163,
4766,
834,
796... | 2.971809 | 3,760 |
import json
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from enum import Enum
# This is a hard coded list of evidence, better organized for readability
ev_all = ['EXP', 'IDA', 'IMP', 'IGI', 'IPI', 'IEP', 'IGC', 'RCA', 'IBA', 'IKR', 'IC', 'NAS', 'ND', 'TAS', 'HDA', 'H... | [
11748,
33918,
198,
11748,
7007,
198,
6738,
7007,
13,
324,
12126,
1330,
14626,
47307,
198,
6738,
2956,
297,
571,
18,
13,
22602,
13,
1186,
563,
1330,
4990,
563,
198,
6738,
33829,
1330,
2039,
388,
198,
198,
2,
770,
318,
257,
1327,
30817,... | 2.47907 | 1,290 |
from django.urls import reverse
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
628
] | 3.666667 | 9 |
num_list = [1,2,3,4]
months = ['Jan', 'Feb', 'Mar', 'Apr']
months_dict = dict(zip(months, num_list)) | [
22510,
62,
4868,
796,
685,
16,
11,
17,
11,
18,
11,
19,
60,
198,
198,
41537,
796,
37250,
12128,
3256,
705,
15146,
3256,
705,
7676,
3256,
705,
13680,
20520,
198,
198,
41537,
62,
11600,
796,
8633,
7,
13344,
7,
41537,
11,
997,
62,
486... | 2.266667 | 45 |
# SPDX-License-Identifier: MIT
"""The application's interfaces that are used to connect the different components.
Notes
-----
This package's code is not really specific to the Django framework. It is an
abstraction layer.
Primary focus is the provision of a plugin API, that allows the app to be
extendable with third... | [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
37811,
464,
3586,
338,
20314,
326,
389,
973,
284,
2018,
262,
1180,
6805,
13,
198,
198,
16130,
198,
30934,
198,
1212,
5301,
338,
2438,
318,
407,
1107,
2176,
284,
262,
377... | 4.058824 | 85 |
# ===================================
# Name: Edward (Eddie) Guo
# ID: 1576381
# Partner: Jason Kim
# CMPUT 275, Fall 2020
#
# Final Assignment: EEG Visualizer
# ===================================
"""
Contains the QApplication which holds the PlotWindow QMainWindow object. The
controller class is here for c... | [
2,
46111,
855,
198,
2,
220,
220,
6530,
25,
10443,
357,
36,
1860,
494,
8,
1962,
78,
198,
2,
220,
220,
4522,
25,
1315,
4304,
36626,
198,
2,
220,
220,
35532,
25,
8982,
6502,
198,
2,
220,
220,
327,
7378,
3843,
25829,
11,
7218,
12131... | 2.80202 | 495 |
# -*- coding: utf-8 -*-
"""Test Code in __init__."""
__all__ = [
"test_get_path_to_file",
]
##############################################################################
# IMPORTS
# BUILT-IN
import os.path
# PROJECT-SPECIFIC
from utilipy.data_utils.utils import get_path_to_file
#############################... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
14402,
6127,
287,
11593,
15003,
834,
526,
15931,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
9288,
62,
1136,
62,
6978,
62,
1462,
62,
7753,
... | 4.793333 | 150 |
# Generated by Django 3.1.7 on 2021-04-20 16:20
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
3023,
12,
1238,
1467,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
# Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
2,
15069,
33448,
383,
24921,
891,
9319,
46665,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
... | 2.337441 | 3,814 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import datetime
os.chdir(os.path.abspath(os.path.dirname(__file__)))
LINUX_DISTROS = [
"almalinux-8",
"amazon-2",
"arch",
"centos-7",
"centos-8",
"debian-10",
"debian-11",
"debian-9",
"fedora-33",
"fedora-34",
"fedora-... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
4818,
8079,
198,
198,
418,
13,
354,
15908,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
418,
... | 1.901078 | 1,577 |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM Corp. 2017 and later.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
11421,
13,
2177,
290,
1568,
13,
198,
2,
198,
2,
770,
2438,
318,
... | 2.070417 | 7,342 |
import re
import bz2
import pygame
import public
import sprites
import functions
import dictionaries
import random
# :^)
| [
11748,
302,
198,
11748,
275,
89,
17,
198,
11748,
12972,
6057,
198,
11748,
1171,
198,
11748,
42866,
198,
11748,
5499,
198,
11748,
48589,
3166,
198,
11748,
4738,
628,
628,
198,
2,
1058,
61,
8,
198
] | 3.571429 | 35 |
# -*- coding: utf-8 -*-
"""
Reads an `html` formatted table.
"""
import numpy as np
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
5569,
82,
281,
4600,
6494,
63,
39559,
3084,
13,
198,
37811,
628,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
1... | 2.246492 | 2,779 |
import numpy as np
test_data = np.array([16, 1, 2, 0, 4, 2, 7, 1, 2, 14])
np_data = np.loadtxt("data.txt", delimiter=",", dtype=int)
def one(data: np.ndarray) -> int:
"""
Determine the horizontal position that the crabs can align to using the least fuel possible. How much fuel must they
spend to align to... | [
11748,
299,
32152,
355,
45941,
198,
198,
9288,
62,
7890,
796,
45941,
13,
18747,
26933,
1433,
11,
352,
11,
362,
11,
657,
11,
604,
11,
362,
11,
767,
11,
352,
11,
362,
11,
1478,
12962,
198,
37659,
62,
7890,
796,
45941,
13,
2220,
1411... | 2.774775 | 333 |
# Copyright (c) 2018 Arista Networks, Inc. All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.
#
# DON'T EDIT THIS FILE. It was generated by
# /usr/local/lib/python2.7/dist-packages/CTypeGen.py
# Please see AID/3558 for details on the contents of this file
#
from ctypes import * # pylint: disabl... | [
2,
15069,
357,
66,
8,
2864,
943,
12523,
27862,
11,
3457,
13,
220,
1439,
2489,
10395,
13,
198,
2,
943,
12523,
27862,
11,
3457,
13,
7326,
35599,
290,
1041,
3448,
8527,
13,
198,
2,
198,
2,
23917,
6,
51,
48483,
12680,
45811,
13,
632,
... | 2.624 | 250 |
from netapp.connection import NaErrorResponse, NaPagedResponse
from netapp.net import NetConnection
from netapp.net.net_port_info import NetPortInfo
conn = NetConnection("192.168.135.100", "admin", "mehmeh123")
print "LISTING ALL PORTS:"
print "-----------------------------------------------"
query = NetPortInfo(nod... | [
6738,
2010,
1324,
13,
38659,
1330,
11013,
12331,
31077,
11,
11013,
47,
1886,
31077,
198,
6738,
2010,
1324,
13,
3262,
1330,
3433,
32048,
198,
6738,
2010,
1324,
13,
3262,
13,
3262,
62,
634,
62,
10951,
1330,
3433,
13924,
12360,
198,
198,
... | 2.781116 | 466 |
# type: ignore[attr-defined]
from .core import unify, reify # noqa: F403
from .more import unifiable # noqa: F403
from .variable import var, isvar, vars, variables, Var # noqa: F403
| [
2,
2099,
25,
8856,
58,
35226,
12,
23211,
60,
198,
6738,
764,
7295,
1330,
555,
1958,
11,
302,
1958,
220,
1303,
645,
20402,
25,
376,
31552,
198,
6738,
764,
3549,
1330,
555,
16823,
220,
1303,
645,
20402,
25,
376,
31552,
198,
6738,
764,... | 2.890625 | 64 |
###############################################################################
# Copyright 2012 FastSoft Inc.
# Copyright 2012 Devin Anderson <danderson (at) fastsoft (dot) com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You m... | [
29113,
29113,
7804,
4242,
21017,
198,
2,
15069,
2321,
12549,
18380,
3457,
13,
198,
2,
15069,
2321,
37081,
9918,
1279,
67,
392,
882,
357,
265,
8,
3049,
4215,
357,
26518,
8,
401,
29,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
... | 4.314721 | 197 |
'''
Faça um programa que leia o salário de um trabalhador e o valor
da prestação de um empréstimo. Se a prestação for maior que 20%
do salário imprima: “Empréstimo não concedido”; caso contrário imprima: “Empréstimo concedido”.
'''
# entrada de dados
salarao = float(input('Digite o valor do salario: '))
prestacao = fl... | [
7061,
6,
198,
50110,
50041,
23781,
1430,
64,
8358,
443,
544,
267,
3664,
6557,
27250,
390,
23781,
491,
44349,
71,
7079,
304,
267,
1188,
273,
198,
6814,
16153,
64,
16175,
28749,
390,
23781,
795,
1050,
2634,
301,
25147,
13,
1001,
257,
16... | 2.369099 | 233 |
"""
Firefly Security and Monitoring
This is the core Firefly Security and Monitoring Service. There should be almost zero config to the user and firefly will monitor the entire house.
- Alarm System (Away)
- Alarm System (Night)
- Vacation Lighting
- Battery Monitor
- Smoke Alerts
- Flooding Alerts
"""
from Firefly im... | [
37811,
198,
13543,
12254,
4765,
290,
37484,
198,
198,
1212,
318,
262,
4755,
40374,
4765,
290,
37484,
4809,
13,
1318,
815,
307,
2048,
6632,
4566,
284,
262,
2836,
290,
2046,
12254,
481,
5671,
262,
2104,
2156,
13,
198,
12,
978,
1670,
448... | 2.804795 | 584 |
# standard gravitational parameter for Earth = G*M
EARTH_GRAV_CONST = 3.986005e5 # (km^3/s^2)
# Earth Radius
EARTH_RADIUS = 6378.137 # (km)
# Earth rotation speed (calculated from sideral period)
EARTH_ROT_RATE = 6.300387486749 / 86164 # (rad/s)
# Earth gravitation at sea leve
EARTH_GRAV_SEA_LVL = 9.80665 # (m^2... | [
2,
3210,
29973,
11507,
329,
3668,
796,
402,
9,
44,
198,
17133,
4221,
62,
38,
3861,
53,
62,
10943,
2257,
796,
513,
13,
4089,
8054,
20,
68,
20,
220,
1303,
357,
13276,
61,
18,
14,
82,
61,
17,
8,
198,
198,
2,
3668,
48838,
198,
171... | 2.314286 | 140 |
'''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import errno
import os
import sys
import time
import math
import torch.nn as nn
import torch.nn.i... | [
7061,
6,
4366,
31904,
5499,
329,
9485,
15884,
354,
11,
1390,
25,
198,
220,
220,
220,
532,
651,
62,
32604,
62,
392,
62,
19282,
25,
15284,
262,
1612,
290,
14367,
1988,
286,
27039,
13,
198,
220,
220,
220,
532,
13845,
81,
62,
15003,
2... | 2.227933 | 895 |
import numpy as np
np.random.seed(111)
'''
The data is generated adding noise to the values from y = 0.8x + 2 equation
Therefore the expectation of the auto encoder is to get the values w and b closer to 0.8 and 2 respectively
'''
'''generate random x values'''
X_train = np.random.random((1, 50))[0]
'''get the ref... | [
11748,
299,
32152,
355,
45941,
198,
198,
37659,
13,
25120,
13,
28826,
7,
16243,
8,
198,
198,
7061,
6,
198,
464,
1366,
318,
7560,
4375,
7838,
284,
262,
3815,
422,
220,
331,
796,
657,
13,
23,
87,
1343,
362,
16022,
198,
26583,
262,
1... | 2.812698 | 315 |
#Faça um programa que leia um ângulo qualquer e mostre na tela
#o valor do seno,cosseno e tangente desse ângulo.
from math import radians, sin, cos, tan
angulo = int(input('Digite um ângulo: '))
sen = sin(radians(angulo))
cos = cos(radians(angulo))
tan = tan(radians(angulo))
print('O seno do ângulo {} é {:.2f}'.format... | [
2,
50110,
50041,
23781,
1430,
64,
8358,
443,
544,
23781,
6184,
95,
782,
43348,
4140,
10819,
304,
749,
260,
12385,
256,
10304,
198,
2,
78,
1188,
273,
466,
3308,
78,
11,
66,
793,
23397,
304,
13875,
21872,
748,
325,
6184,
95,
782,
4334... | 2.43617 | 188 |
#!/usr/bin/env python
"""stereograph.py: Compute length of a geodesic in the unit sphere.
"""
from sympy import (symbols, Function, Matrix, factor, simplify, latex, sqrt)
from sympy.abc import (t, xi, eta)
from sympy.printing import print_latex
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
301,
567,
2384,
13,
9078,
25,
3082,
1133,
4129,
286,
257,
4903,
4147,
291,
287,
262,
4326,
16558,
13,
198,
37811,
198,
198,
6738,
10558,
88,
1330,
357,
1837,
2022,
10220,
11,
... | 2.794118 | 102 |
# from visdialch.decoders.gen import GenerativeDecoder
#from visdialch.decoders.disc import DiscriminativeDecoder
from visdialch.decoders.decoder import DiscriminativeDecoder
| [
2,
422,
1490,
38969,
354,
13,
12501,
375,
364,
13,
5235,
1330,
2980,
876,
10707,
12342,
198,
2,
6738,
1490,
38969,
354,
13,
12501,
375,
364,
13,
15410,
1330,
8444,
3036,
259,
876,
10707,
12342,
198,
6738,
1490,
38969,
354,
13,
12501,
... | 3.181818 | 55 |
import pytest
from ansiblediscover.graph.node import Node
@pytest.mark.parametrize('this, other, equal', [
(('myname', 'mytype', 'mypath'), ('myname', 'mytype', 'mypath'), True),
(('myname', 'mytype', 'mypath'), ('othername', 'mytype', 'mypath'), False),
(('myname', 'mytype', 'mypath'), ('myname', '... | [
11748,
12972,
9288,
198,
198,
6738,
9093,
571,
992,
29392,
13,
34960,
13,
17440,
1330,
19081,
628,
628,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
10786,
5661,
11,
584,
11,
4961,
3256,
685,
198,
220,
220,
22... | 2.509434 | 212 |
import datetime
from Models.Submission import Submission
from Core.Database import Database
from Core.Scorer import Scorer
from Core.Executer import Executer
from Core.Parser import Parser
| [
11748,
4818,
8079,
198,
6738,
32329,
13,
7004,
3411,
1330,
42641,
198,
6738,
7231,
13,
38105,
1330,
24047,
198,
6738,
7231,
13,
3351,
11934,
1330,
1446,
11934,
198,
6738,
7231,
13,
23002,
11894,
1330,
8393,
11894,
198,
6738,
7231,
13,
4... | 4.222222 | 45 |
from copy import copy
import torch
from nitorch.core.py import make_list
from nitorch.core import dtypes
from nitorch.spatial import affine_sub, affine_permute, voxel_size as affvx
from nitorch.io.utils.indexing import (expand_index, guess_shape, compose_index, neg2pos,
is_dropped... | [
6738,
4866,
1330,
4866,
198,
11748,
28034,
198,
6738,
299,
2072,
354,
13,
7295,
13,
9078,
1330,
787,
62,
4868,
198,
6738,
299,
2072,
354,
13,
7295,
1330,
288,
19199,
198,
6738,
299,
2072,
354,
13,
2777,
34961,
1330,
1527,
500,
62,
7... | 2.262884 | 15,155 |
"""
blit.py
Call if you want to run everything
"""
import json
import os
import sys
import integrate
if __name__ == '__main__':
sys.exit(main(sys.argv))
| [
37811,
198,
2436,
270,
13,
9078,
198,
198,
14134,
611,
345,
765,
284,
1057,
2279,
198,
37811,
628,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
25064,
628,
198,
11748,
19386,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
... | 2.737705 | 61 |
from random import randint
numeros = []
# programa principal
sorteia()
somapar() | [
6738,
4738,
1330,
43720,
600,
198,
77,
6975,
418,
796,
17635,
198,
2,
1430,
64,
10033,
198,
30619,
68,
544,
3419,
198,
82,
296,
499,
283,
3419
] | 2.962963 | 27 |
import pickle
import numpy as np #비선형 퍼셉트론
import matplotlib.pylab as plt
import sys, os
sys.path.append(os.pardir)
from dataset.mnist import load_mnist
from PIL import Image
def step_function(x):
'''
y = x > 0
return y.astype(np.int) #np.int와 dtype=int의 역할은 같다.
'''
ret... | [
11748,
2298,
293,
198,
198,
11748,
299,
32152,
355,
45941,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
167,
117,
226,
168,
226,
254,
169,
246,
243,
220,
169,
235,
120,
168,
227,
231,
169,
232,
116,
167,
94,
254,
198,
11748,... | 1.481768 | 905 |
# coding=utf-8
import copy
from flask import Markup, url_for
from flask.ext.security import Security, MongoEngineUserDatastore, user_registered
from flask.ext.security.core import _SecurityState
from flask.ext.security.core import _context_processor as security_default_context_processor
from flask.ext.security.views ... | [
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
4866,
198,
198,
6738,
42903,
1330,
2940,
929,
11,
19016,
62,
1640,
198,
6738,
42903,
13,
2302,
13,
12961,
1330,
4765,
11,
42591,
13798,
12982,
27354,
459,
382,
11,
2836,
62,
33736,
198,
... | 2.77853 | 1,919 |
from django.shortcuts import render
from django.urls import reverse
from django.http import Http404, HttpResponseRedirect
from flight.models import Flight, Passenger
def index(request):
''' display all flights '''
context = {
'main_header': 'Flights',
'title': 'Flights',
'flights': Flig... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
11,
367,
29281,
31077,
7738,
1060,
198,
6738,
5474,
13,
27530,
1330,
13365,
... | 2.722543 | 346 |
from setuptools import setup, find_packages, Extension
from torch.utils import cpp_extension
setup(
name='my_lib',
version='0.0',
description='Learning setup',
packages=find_packages(),
ext_package='trt_pose',
ext_modules=[cpp_extension.CppExtension('plugins', [
'Learn_cpp/learn.cpp',
... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
11,
27995,
198,
6738,
28034,
13,
26791,
1330,
269,
381,
62,
2302,
3004,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
1820,
62,
8019,
3256,
198,
220,
220,
220,
2196,
1... | 2.602484 | 161 |
# -*- coding: utf-8 -*-
from typing import Optional
from pymarc import Field
from unidecode import unidecode, UnidecodeError
from bookops_callno.errors import CallNoConstructorError
def remove_trailing_punctuation(value: str) -> str:
"""
Removes any trailing periods, commas, etc.
Args:
value:... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
12972,
3876,
66,
1330,
7663,
198,
6738,
555,
485,
8189,
1330,
555,
485,
8189,
11,
791,
485,
8189,
12331,
628,
198,
6738,
... | 2.391628 | 3,488 |
'''O Sr. Manoel Joaquim expandiu seus negócios para além dos negócios de 1,99 e agora possui uma loja de conveniências. Faça um programa que implemente uma caixa registradora rudimentar. O programa deverá receber um número desconhecido de valores referentes aos preços das mercadorias. Um valor zero deve ser informado p... | [
7061,
6,
46,
21714,
13,
1869,
78,
417,
5302,
36129,
320,
4292,
16115,
384,
385,
2469,
10205,
979,
418,
31215,
435,
2634,
76,
23430,
2469,
10205,
979,
418,
390,
352,
11,
2079,
304,
556,
5799,
1184,
9019,
334,
2611,
2376,
6592,
390,
7... | 2.36036 | 555 |
from schnetkit.engine import Stateful
models = [Dummy]
| [
6738,
264,
1349,
316,
15813,
13,
18392,
1330,
1812,
913,
628,
198,
198,
27530,
796,
685,
35,
13513,
60,
198
] | 2.9 | 20 |
import secrets
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.ha... | [
11748,
13141,
198,
198,
6738,
45898,
13,
71,
1031,
6759,
13,
1891,
2412,
1330,
4277,
62,
1891,
437,
198,
6738,
45898,
13,
71,
1031,
6759,
13,
19795,
20288,
1330,
46621,
198,
6738,
45898,
13,
71,
1031,
6759,
13,
19795,
20288,
1330,
113... | 3.487805 | 123 |
#!/usr/bin/env python2
import os
import json
import logging
from TrackDb import TrackDb
from util import subtools
from util import santitizer
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
17762,
43832,
1330,
17762,
43832,
198,
6738,
7736,
1330,
13284,
10141,
198,
6738,
7736,
1330,
264,
415,
3029,
263,
... | 3.23913 | 46 |
# coding=UTF-8
from __future__ import absolute_import, division, print_function
"""
Provides reactors that can authenticate an AQMP session
"""
import six
import typing as tp
import copy
import logging
from coolamqp.framing.definitions import ConnectionStart, ConnectionStartOk, \
ConnectionTune, ConnectionTuneOk, ... | [
2,
19617,
28,
48504,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
37811,
198,
15946,
1460,
28502,
326,
460,
8323,
5344,
281,
39514,
7378,
6246,
198,
37811,
198,
11748,
2237,
198,... | 2.481663 | 1,227 |
# Copyright 2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | [
2,
15069,
3648,
262,
569,
23,
1628,
7035,
13,
1439,
2489,
10395,
13,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
198,
2,
1138,... | 3.26738 | 561 |
"""
抽象工厂方法--对象创建型模式
1. 目标
定义一个用于创建对象的接口, 让子类决定实例化哪一个类, 使一个类的实例化延迟到子类。
"""
if __name__ == '__main__':
cream_cake_factory = CreamCakeFactory()
cream_cake = cream_cake_factory.make_cake()
print(cream_cake)
fruit_cake_factory = FruitCakeFactory()
fruit_cake = fruit_cake_factory.make_cake()
... | [
37811,
198,
162,
232,
121,
164,
109,
94,
32432,
98,
43889,
224,
43095,
37345,
243,
438,
43380,
117,
164,
109,
94,
26344,
249,
161,
119,
118,
161,
252,
233,
162,
101,
94,
28156,
237,
198,
198,
16,
13,
13328,
249,
106,
43718,
229,
1... | 1.408333 | 240 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
2,
13610,
534,
4981,
994,
13,
628
] | 3.607143 | 28 |
#!/usr/bin/env python
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Concatenates D-Bus busconfig files."""
import sys
import xml.etree.ElementTree
_BUSCONFIG_FILE_HEADER = b"""<!DOCTYPE busconfig
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
13130,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043... | 2.859649 | 171 |
import sys;
import numpy as np;
import pandas as pd;
np.set_printoptions(threshold=sys.maxsize)
# replace the range, sample size with your custom numbers
arr = np.array(np.random.choice(range(10000), 10000, replace=False))
print(arr)
DF = pd.DataFrame(arr)
DF.to_csv("temp.csv")
| [
11748,
25064,
26,
198,
11748,
299,
32152,
355,
45941,
26,
198,
11748,
19798,
292,
355,
279,
67,
26,
198,
198,
37659,
13,
2617,
62,
4798,
25811,
7,
400,
10126,
28,
17597,
13,
9806,
7857,
8,
198,
2,
6330,
262,
2837,
11,
6291,
2546,
... | 2.82 | 100 |
import torch
from sklearn.preprocessing import LabelEncoder
from torch.utils.data import Dataset, DataLoader
| [
11748,
28034,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
36052,
27195,
12342,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
11,
6060,
17401,
628,
198
] | 3.827586 | 29 |