content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
Token = "ABC"
Language = {}
Language['cpp98'] = {
"Name" : "main.cpp",
"CompileName" : "main",
"RunCmd" : ["main"],
"CompileCmd" : ["/usr/bin/g++", "-O", "-w", "-fmax-errors=3", "-std=c++98", "main.cpp", "-lm", "-o", "main"],
}
Language['cpp11'] = {
"Name" : "main.cpp",
"CompileName" : "ma... | [
30642,
796,
366,
24694,
1,
628,
198,
32065,
796,
23884,
198,
198,
32065,
17816,
20322,
4089,
20520,
796,
1391,
198,
220,
220,
220,
366,
5376,
1,
1058,
366,
12417,
13,
20322,
1600,
198,
220,
220,
220,
366,
7293,
576,
5376,
1,
1058,
3... | 2.129477 | 1,815 |
import glob
import os
import argparse
import subprocess
import cv2 as cv
import numpy as np
from PIL import Image
from tqdm import tqdm
def calibrate_and_resize(img_path: str, save_path: str, calibrate: bool = False, resize: bool = False) -> None:
"""
Calibrate and resize the images.
"""
img_name = os... | [
11748,
15095,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
256,
80,
36020,
1330,
256,
80,
3... | 2.192399 | 842 |
"""
Generic has no implementation in Python
""" | [
37811,
198,
46189,
468,
645,
7822,
287,
11361,
198,
37811
] | 4.7 | 10 |
from rest_framework import viewsets
from LogRFID.models import Log
from LogRFID.serializers import LogSerializer
from rest_framework import permissions
| [
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
5972,
32754,
2389,
13,
27530,
1330,
5972,
198,
6738,
5972,
32754,
2389,
13,
46911,
11341,
1330,
5972,
32634,
7509,
198,
6738,
1334,
62,
30604,
1330,
21627,
198
] | 4.222222 | 36 |
from typing import Optional
from ariadne import ObjectType
from app.entities import User, Court
user = ObjectType("User")
@user.field("court")
def resolve_courts(obj: User, *_) -> Optional[Court]:
'''Given a user, resolve the court'''
if obj.court_id:
return Court.from_id(obj.court_id)
| [
6738,
19720,
1330,
32233,
198,
6738,
257,
21244,
710,
1330,
9515,
6030,
198,
6738,
598,
13,
298,
871,
1330,
11787,
11,
3078,
198,
198,
7220,
796,
9515,
6030,
7203,
12982,
4943,
628,
198,
31,
7220,
13,
3245,
7203,
22230,
4943,
198,
429... | 2.859813 | 107 |
import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
import requests
import json
import random
def answer(path):
'''
Генерирует случайный ответ (строку) из текстового файла path
'''
with open(path, "r", encoding='windows-1251') as file:
return random.choice(list(fi... | [
11748,
410,
74,
62,
15042,
201,
198,
6738,
410,
74,
62,
15042,
13,
6511,
30393,
1330,
569,
74,
14617,
39176,
11,
569,
74,
9237,
6030,
201,
198,
11748,
7007,
201,
198,
11748,
33918,
201,
198,
11748,
4738,
201,
198,
201,
198,
4299,
32... | 1.535354 | 2,376 |
from toapi.api import Api
from toapi.item import Item
| [
6738,
284,
15042,
13,
15042,
1330,
5949,
72,
198,
6738,
284,
15042,
13,
9186,
1330,
9097,
198
] | 3.176471 | 17 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
i = 1
sum = 0
for i in range(1000) :
if i%3==0 :
sum += i
elif i%5==0 :
sum += i
print sum
| [
198,
72,
796,
352,
198,
16345,
796,
657,
198,
1640,
1312,
287,
2837,
7,
12825,
8,
1058,
198,
197,
361,
1312,
4,
18,
855,
15,
1058,
198,
197,
197,
16345,
15853,
1312,
198,
197,
417,
361,
1312,
4,
20,
855,
15,
1058,
198,
197,
197,... | 1.886792 | 53 |
"""Collection of function for the data cleaning flow and the flow itself"""
from dataclasses import dataclass, field
import re
import sqlite3
from typing import Tuple, List, Union, Optional
import cloudpickle
import numpy as np
import pandas as pd
from category_encoders.target_encoder import TargetEncoder
from prefect ... | [
37811,
36307,
286,
2163,
329,
262,
1366,
12724,
5202,
290,
262,
5202,
2346,
37811,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
11748,
302,
198,
11748,
44161,
578,
18,
198,
6738,
19720,
1330,
309,
29291,
11,
7343,... | 2.414803 | 1,878 |
from tqdm import tqdm
import numpy as np
import math
import time
import nemo.collections.asr as nemo_asr
import util
| [
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
220,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
10688,
220,
198,
11748,
640,
220,
198,
11748,
36945,
78,
13,
4033,
26448,
13,
292,
81,
355,
36945,
78,
62,
292,
81,
198,
198,... | 2.638298 | 47 |
from hamcrest import assert_that, is_
from collection_pipelines.std import value, head, tail, freq
from collection_pipelines.text import echo, split
| [
6738,
8891,
66,
2118,
1330,
6818,
62,
5562,
11,
318,
62,
198,
198,
6738,
4947,
62,
79,
541,
20655,
13,
19282,
1330,
1988,
11,
1182,
11,
7894,
11,
2030,
80,
198,
6738,
4947,
62,
79,
541,
20655,
13,
5239,
1330,
9809,
11,
6626,
628
] | 3.431818 | 44 |
#bibliotecas
import numpy as np
import pandas as pd
import json
import requests
from datetime import date
import psycopg2
import sqlalchemy
from sqlalchemy import create_engine
import io
import sys
class Get:
'''
Generic Get class to make get calls to Pontomais API
Args:
token: authentication toke... | [
2,
65,
29142,
313,
721,
292,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
33918,
198,
11748,
7007,
198,
6738,
4818,
8079,
1330,
3128,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
44161,
282,
2... | 2.089973 | 11,070 |
from pyemvue.auth import Auth
import requests
import datetime
import json
from dateutil.parser import parse
from urllib.parse import quote
# These provide AWS cognito authentication support
import boto3
import botocore
from pycognito import Cognito
# Our files
from pyemvue.enums import Scale, Unit
from pyemvue.custom... | [
6738,
12972,
368,
85,
518,
13,
18439,
1330,
26828,
198,
11748,
7007,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
6738,
3128,
22602,
13,
48610,
1330,
21136,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
9577,
198,
198,
2,
2312,
2148,
... | 2.723077 | 585 |
from copy import deepcopy
from TextSearchEngine.mergeFindings import mergeFindings
| [
6738,
4866,
1330,
2769,
30073,
198,
6738,
8255,
18243,
13798,
13,
647,
469,
16742,
654,
1330,
20121,
16742,
654,
198
] | 4.15 | 20 |
"""
Code to test the new zfun filtering functions for matrices.
Parker MacCready
"""
import numpy as np
import matplotlib.pyplot as plt
import zfun
from importlib import reload
reload(zfun)
# make some individual time series to filter
t = np.arange(100*24)
nt = len(t)
om = 2*np.pi/12
om1 = 2*np.pi/500
a1 = np.cos(o... | [
37811,
198,
10669,
284,
1332,
262,
649,
1976,
12543,
25431,
5499,
329,
2603,
45977,
13,
198,
198,
25478,
263,
4100,
34,
1493,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,... | 1.968919 | 740 |
import io
import logging
import os
import re
import subprocess
from collections import deque
from contextlib import closing, contextmanager
from urllib.parse import urlparse
from dvc.scheme import Schemes
from dvc.utils import fix_env, tmp_fname
from .base import BaseRemoteTree, RemoteCmdError
from .pool import get_c... | [
11748,
33245,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
850,
14681,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
4732,
8019,
1330,
9605,
11,
4732,
37153,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
... | 3.548077 | 104 |
'''
Copyright 2018 IN3PD
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, software
distribu... | [
7061,
6,
198,
15269,
2864,
3268,
18,
5760,
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,
351,
262,
13789,
13,
198,
1639,
... | 3.542593 | 540 |
import numpy as np # `pip install numpy`
import cv2 # `pip install opencv-python`
import leapuvc # Ensure leapuvc.py is in this folder
# Start the Leap Capture Thread
#cv2.waitKey(20000)
leap = leapuvc.leapImageThread()
leap.start()
# Capture images until 'q' is pressed
whi... | [
11748,
299,
32152,
355,
45941,
220,
220,
220,
220,
220,
220,
220,
1303,
4600,
79,
541,
2721,
299,
32152,
63,
201,
198,
11748,
269,
85,
17,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4600,
79,
... | 2.268657 | 268 |
"""
Script for testing that ppo2_mlp experiment is working
properly by taking hyperparameters from defaults
"""
import os
import sys
import time
import gym
import gym_gazebo2
import tensorflow as tf
import multiprocessing
from importlib import import_module
from baselines import bench, logger
from baselines.ppo2 impo... | [
37811,
198,
7391,
329,
4856,
326,
279,
7501,
17,
62,
4029,
79,
6306,
318,
1762,
198,
1676,
525,
306,
416,
2263,
8718,
17143,
7307,
422,
26235,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
11550,
... | 2.352941 | 1,360 |
from dataclasses import dataclass
from somerandomapi import http
from somerandomapi.constants import ANIMALS
from somerandomapi.sync_async_handler import SyncAsyncHandler
@dataclass
class AnimalResponse:
"""
Attributes
----------
- fact: `str`
- image: `str`
"""
fact: str
image: str
... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
3870,
263,
3749,
15042,
1330,
2638,
198,
6738,
3870,
263,
3749,
15042,
13,
9979,
1187,
1330,
3537,
3955,
23333,
198,
6738,
3870,
263,
3749,
15042,
13,
27261,
62,
292,
13361,
62,... | 2.709945 | 362 |
import urllib
import contextlib
from typing import Dict, List, Union, ContextManager
import flask
import flask_login
import pytest
from tests import AuthActions
from server.api.blueprints.login import (
handle_oauth,
validate_inputs,
create_or_get_oauth,
)
from server.api.database.models import BlacklistT... | [
11748,
2956,
297,
571,
198,
11748,
4732,
8019,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
11,
30532,
13511,
198,
198,
11748,
42903,
198,
11748,
42903,
62,
38235,
198,
11748,
12972,
9288,
198,
6738,
5254,
1330,
26828,
32,
2733... | 2.621928 | 1,058 |
import pytest
import numpy as np
import pyDSlib | [
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
12972,
5258,
8019
] | 3.2 | 15 |
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='researchacademic',
version='0.9.2',
description=("A python library that aims to retrieve data from Microsoft"
"Research Academic and parse data to human readable"),
long_descr... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
40406,
7,
198,
220,
220,
22... | 2.723404 | 329 |
from __future__ import absolute_import, division, print_function
import os
import astropy
from astropy.utils.data import get_pkg_data_filename
from astropy.utils.introspection import minversion
from .. import locations
ASTROPY_LT_4_3 = not minversion(astropy, '4.3')
if ASTROPY_LT_4_3:
from astropy.utils.data i... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
198,
11748,
6468,
28338,
198,
6738,
6468,
28338,
13,
26791,
13,
7890,
1330,
651,
62,
35339,
62,
7890,
62,
34345,
198,
6738,
646... | 2.704607 | 369 |
"""Main entrypoint for the repobee CLI application.
.. module:: main
:synopsis: Main entrypoint for the repobee CLI application.
.. moduleauthor:: Simon Larsén
"""
import argparse
import contextlib
import dataclasses
import io
import logging
import os
import pathlib
import sys
from typing import List, Optional, ... | [
37811,
13383,
5726,
4122,
329,
262,
1128,
672,
1453,
43749,
3586,
13,
198,
198,
492,
8265,
3712,
1388,
198,
220,
220,
220,
1058,
28869,
24608,
25,
8774,
5726,
4122,
329,
262,
1128,
672,
1453,
43749,
3586,
13,
198,
198,
492,
8265,
9800... | 2.684835 | 1,853 |
import sys
sys.path.append('/home/iuri/workspace/dunnotheway/dunnotheway')
import functools
import itertools
import operator
import os
import numpy as np
import pandas as pd
from scipy import stats
from common.db import open_database_session
from common.settings import BASE_DIR
from common.utils import (distance_thr... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
14,
11195,
14,
72,
9900,
14,
5225,
10223,
14,
67,
403,
1662,
258,
1014,
14,
67,
403,
1662,
258,
1014,
11537,
198,
198,
11748,
1257,
310,
10141,
198,
11748,
340,
861,
10141,
198,
... | 2.365648 | 949 |
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
12131,
15841,
3216,
21852,
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,
... | 2.46996 | 6,741 |
import torch
import torch.autograd as autograd
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn.parameter import Parameter
import numpy as np
import datetime, math
from Hyperparameters import args
from torch.nn import TransformerEncode... | [
11748,
28034,
198,
11748,
28034,
13,
2306,
519,
6335,
355,
1960,
519,
6335,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
... | 2.222494 | 1,636 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013 dotCloud, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | [
2,
43907,
25,
7400,
11338,
28,
19,
6482,
10394,
28,
19,
2705,
8658,
11338,
28,
19,
198,
2,
198,
2,
15069,
357,
66,
8,
2211,
16605,
18839,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
... | 3.320755 | 265 |
from torch.utils.data import Dataset
import pandas as pd
from ast import literal_eval
from os import path
import numpy as np
from newsrec.config import model_name
import importlib
import torch
try:
config = getattr(importlib.import_module('newsrec.config'), f"{model_name}Config")
except AttributeError:
print(f... | [
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
6468,
1330,
18875,
62,
18206,
198,
6738,
28686,
1330,
3108,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1705,
8344,
13,
11250,
... | 3.12069 | 116 |
from enemy import macro
from Enemy import *
from Player import *
from Bullet import *
import random
| [
6738,
4472,
1330,
15021,
198,
6738,
21785,
1330,
1635,
198,
6738,
7853,
1330,
1635,
198,
6738,
18003,
1330,
1635,
198,
11748,
4738,
198
] | 4.347826 | 23 |
import math
import rdkit
from rdkit import Chem
from rdkit.Chem import rdchem
from prody import calcCenter
def binding_pocket_selection(pose_store, p, ligand_name, selection_radius, center):
'''
This function will find by default mass center
of the ligand using Prody.
If the -gc option is selected t... | [
11748,
10688,
198,
11748,
374,
67,
15813,
198,
198,
6738,
374,
67,
15813,
1330,
12870,
198,
6738,
374,
67,
15813,
13,
41829,
1330,
374,
67,
15245,
198,
198,
6738,
386,
9892,
1330,
42302,
23656,
628,
198,
4299,
12765,
62,
31991,
62,
49... | 2.060049 | 3,697 |
from typing import TYPE_CHECKING, Dict, List
import psutil
from rap.common.asyncio_helper import get_event_loop
from rap.common.collect_statistics import Counter, Gauge
from rap.common.utils import EventEnum, constant
from rap.server.model import Request, Response
from rap.server.plugin.processor.base import BaseProc... | [
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
360,
713,
11,
7343,
198,
198,
11748,
26692,
22602,
198,
198,
6738,
4095,
13,
11321,
13,
292,
13361,
952,
62,
2978,
525,
1330,
651,
62,
15596,
62,
26268,
198,
6738,
4095,
13,
11321,
13,
... | 3.311594 | 138 |
#!/usr/bin/env python2
'''
Copyright 2016 Aaron Stephens <aaron@icebrg.io>, ICEBRG
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 ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
628,
198,
7061,
6,
198,
15269,
1584,
12139,
37072,
1279,
64,
8045,
31,
501,
1671,
70,
13,
952,
22330,
23358,
11473,
38,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
... | 2.201356 | 1,475 |
from typing import List
from enum import Enum
| [
6738,
19720,
1330,
7343,
198,
198,
6738,
33829,
1330,
2039,
388,
628
] | 4 | 12 |
import smtplib
import pickle
from time import sleep
from email.mime.text import MIMEText
from ib.opt import ibConnection, Connection, message
from .abstract_portfolio import AbstractPortfolio
from ..utilities.params import Directions, IB, ib_silent_errors
class InteractiveBrokersPortfolio(AbstractPortfolio):
"""I... | [
11748,
895,
83,
489,
571,
198,
11748,
2298,
293,
198,
6738,
640,
1330,
3993,
198,
6738,
3053,
13,
76,
524,
13,
5239,
1330,
337,
3955,
2767,
2302,
198,
6738,
24283,
13,
8738,
1330,
24283,
32048,
11,
26923,
11,
3275,
198,
6738,
764,
3... | 2.791228 | 1,710 |
class Error(Exception):
"""Base class for exceptions in this library."""
pass
class DeviceNotFoundError(Error):
"""Exception raised when a device cannot be found."""
class DevicePermissionError(Error):
"""Exception raised when permission to access the device is denied."""
class DeviceAddressError... | [
4871,
13047,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
1398,
329,
13269,
287,
428,
5888,
526,
15931,
628,
220,
220,
220,
1208,
628,
198,
4871,
16232,
3673,
21077,
12331,
7,
12331,
2599,
198,
220,
220,
220,
37227,
16922,
4376,
... | 3.975155 | 161 |
import connexion
from flask_bootstrap import Bootstrap
from flask_pymongo import PyMongo
import dns
app = connexion.App(__name__, specification_dir='./openapi_server/openapi/')
app.app.config.from_pyfile("./config.py")
print(app.app.config)
## https://stackoverrun.com/ja/q/11355897
# must need packagename
app.app.con... | [
11748,
369,
12413,
295,
198,
198,
6738,
42903,
62,
18769,
26418,
1330,
18892,
26418,
198,
6738,
42903,
62,
79,
4948,
25162,
1330,
9485,
44,
25162,
198,
11748,
288,
5907,
198,
198,
1324,
796,
369,
12413,
295,
13,
4677,
7,
834,
3672,
83... | 2.588933 | 253 |
import os
import ipaddress
import internetnL3comm_create
import sys
# a = input("Please input the number of subnets:\n")
# subnet_var_list=[]
# for i in range(0,int(a)):
# b = input("Please input the subnet "+str(i+1)+"\n")
# var_subnet=ipaddress.ip_network(b)
# subnet_var_list.append(b)
# Tvar= sys.argv ... | [
11748,
28686,
198,
11748,
20966,
21975,
198,
11748,
5230,
77,
43,
18,
9503,
62,
17953,
198,
11748,
25064,
628,
198,
2,
257,
796,
5128,
7203,
5492,
5128,
262,
1271,
286,
850,
45938,
7479,
77,
4943,
198,
2,
850,
3262,
62,
7785,
62,
48... | 2.301282 | 156 |
# -*- coding: utf-8 -*-
"""
This file contains the GPR implementation
"""
import numpy as np
from scipy.optimize import minimize
from scipy.linalg import cholesky, cho_solve, solve_triangular
__author__ = "Aniket"
__copyright__ = "Aniket"
__license__ = "mit"
# 'Public' methods
# 'Private' helper methods
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1212,
2393,
4909,
262,
402,
4805,
7822,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330,
17775,
198,
6738... | 2.741379 | 116 |
from python.create_view.other.implement_view_file import implement_view_file
| [
6738,
21015,
13,
17953,
62,
1177,
13,
847,
13,
320,
26908,
62,
1177,
62,
7753,
1330,
3494,
62,
1177,
62,
7753,
198
] | 3.5 | 22 |
import numpy as np
from PIL import Image
from skimage import color
def load(image_path):
""" Loads an image from a file path
Args:
image_path: file path to the image
Returns:
out: numpy array of shape(image_height, image_width, 3)
"""
out = None
# YOUR CODE HERE
out = Ima... | [
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
1341,
9060,
1330,
3124,
198,
198,
4299,
3440,
7,
9060,
62,
6978,
2599,
198,
220,
220,
220,
37227,
8778,
82,
281,
2939,
422,
257,
2393,
3108,
628,
220,
220,
... | 2.281851 | 1,923 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-12 22:22
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
17,
319,
1584,
12,
940,
12,
1065,
2534,
25,
1828,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.736842 | 57 |
# -*- coding: utf-8 -*-
# Copyright 2017 Christoph Reiter
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2177,
1951,
2522,
797,
2676,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
198,
2,
257,
4866,
286,
428,
378... | 3.893048 | 187 |
from example_app import app
import requests
import json
def generate_access_token():
"""
First we get the code to generate the access token
"""
client_id = app.config['CLIENT_ID']
client_secret = app.config['CLIENT_SECRET']
api_uri = app.config['API_URI']
redirect_uri = app.config['REDIRECT... | [
6738,
1672,
62,
1324,
1330,
598,
198,
11748,
7007,
198,
11748,
33918,
198,
198,
4299,
7716,
62,
15526,
62,
30001,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3274,
356,
651,
262,
2438,
284,
7716,
262,
1895,
11241,
198,
220,
... | 2.466151 | 517 |
from django import forms
from .models import Payment
from lessons.models import Lesson
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
764,
27530,
1330,
28784,
198,
6738,
11658,
13,
27530,
1330,
12892,
261,
198
] | 4.35 | 20 |
# -*- coding: utf-8 -*-
from datetime import datetime
from app import db
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
598,
1330,
20613,
628
] | 2.846154 | 26 |
from django.contrib.auth.decorators import user_passes_test
from django.utils.decorators import method_decorator
from data_interrogator.admin.forms import AdminInvestigationForm, AdminPivotTableForm
from data_interrogator.interrogators import Allowable
from data_interrogator.views import InterrogationView, Interrogati... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
2836,
62,
6603,
274,
62,
9288,
198,
6738,
42625,
14208,
13,
26791,
13,
12501,
273,
2024,
1330,
2446,
62,
12501,
273,
1352,
198,
198,
6738,
1366,
62,
3849,
3828,... | 3.460177 | 113 |
import networkx as nx
import time
import requests
import json
| [
11748,
3127,
87,
355,
299,
87,
198,
11748,
640,
198,
11748,
7007,
198,
11748,
33918,
628,
198
] | 3.764706 | 17 |
"""function
Set the movement type of the user.
Set the movement type fo the user. By default only the player entity has definitions for multiple movement types.
- 0: Walk
- 1: Run
- 2: Bike
in:
- Numeric: movement type
"""
| [
37811,
8818,
198,
7248,
262,
3356,
2099,
286,
262,
2836,
13,
198,
198,
7248,
262,
3356,
2099,
11511,
262,
2836,
13,
2750,
4277,
691,
262,
2137,
9312,
468,
17336,
329,
3294,
3356,
3858,
13,
198,
12,
657,
25,
6857,
198,
12,
352,
25,
... | 3.546875 | 64 |
'''
Created on Oct 16, 2018
@author: lbusoni
'''
import numpy as np
def quadraticSum(arrayOfErrorsWithSign):
''' quadraticSum(arrayOfErrorsWithSign)
Sum in quadrature of errors, considering sign
5 = quadraticSum([3, 4])
8 = quadraticSum(10, -6])
'''
total = 0.
for err in arrayOfErrorsWi... | [
7061,
6,
198,
41972,
319,
2556,
1467,
11,
2864,
198,
198,
31,
9800,
25,
300,
10885,
14651,
198,
7061,
6,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
15094,
81,
1512,
13065,
7,
18747,
5189,
9139,
5965,
3152,
11712,
2599,
198,
... | 2.217822 | 202 |
#!/usr/bin/env python3
"""
Display library
Copyright (c) 2020-2021 Nicolas Beguier
Licensed under the MIT License
Written by Nicolas BEGUIER (nicolas_beguier@hotmail.com)
"""
# Own library
# pylint: disable=E0401
import lib.analysis as analysis
# Debug
# from pdb import set_trace as st
def display_header(report, ve... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
23114,
5888,
198,
198,
15269,
357,
66,
8,
12131,
12,
1238,
2481,
29737,
1355,
5162,
959,
198,
26656,
15385,
739,
262,
17168,
13789,
198,
25354,
416,
29737,
347,
7156,
1... | 2.098706 | 3,090 |
#!/bin/python
import csv
import codecs
import logging
import os
import indic_transliteration
from indic_transliteration import sanscript
from indic_transliteration.detect import detect
| [
2,
48443,
8800,
14,
29412,
198,
198,
11748,
269,
21370,
198,
11748,
40481,
82,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
2699,
62,
7645,
17201,
341,
198,
6738,
2699,
62,
7645,
17201,
341,
1330,
38078,
6519,
198,
6738,
2699,... | 3.622642 | 53 |
import logging
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.core import HomeAssistant
from .const import(
DOMAIN,
DEVICES,
STATES_MANAGER
)
from homeassistant.const import (
CONF_HOST,
CONF_PORT,
ATTR_ENTITY_ID,
)
from .stat... | [
11748,
18931,
201,
198,
11748,
1363,
562,
10167,
13,
16794,
364,
13,
11250,
62,
12102,
341,
355,
269,
85,
201,
198,
11748,
2322,
37623,
5623,
355,
2322,
201,
198,
201,
198,
6738,
1363,
562,
10167,
13,
7295,
1330,
5995,
48902,
201,
198... | 2.420732 | 164 |
# Generated by Django 3.0.10 on 2020-11-08 15:38
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
940,
319,
12131,
12,
1157,
12,
2919,
1315,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
import tensorflow as tf
from tensorflow.contrib import rnn
from tfLego.layer.Layer import Layer
class LSTM(Layer):
"""
LSTM layer implementation. Due to Tensorflow API, it represents a "block" of layers.
"""
def __init__(self, size, cell=rnn.LSTMCell, dropout=None, name=None, *args, **kwargs):
... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
1330,
374,
20471,
198,
198,
6738,
48700,
11484,
78,
13,
29289,
13,
49925,
1330,
34398,
628,
198,
4871,
406,
2257,
44,
7,
49925,
2599,
198,
220,
220,
22... | 2.512915 | 271 |
import os,sys
# Class to change working directory
class cd:
"""Context manager for changing the current working directory"""
# Main
if __name__ == '__main__':
main()
| [
11748,
28686,
11,
17597,
628,
198,
198,
2,
5016,
284,
1487,
1762,
8619,
198,
4871,
22927,
25,
198,
220,
220,
220,
37227,
21947,
4706,
329,
5609,
262,
1459,
1762,
8619,
37811,
628,
198,
2,
8774,
198,
361,
11593,
3672,
834,
6624,
705,
... | 3.377358 | 53 |
import os
from os import getcwd, mkdir, path
import sys
import shutil
import time
import importlib
import re
import fileinput
from jinja2 import Template
TEMPLATE_PATH = os.getcwd()
# utils
if __name__ == '__main__':
# read parameter
model_name = get(sys.argv, 1, default='')
model_path = get(sys.ar... | [
11748,
28686,
220,
198,
6738,
28686,
1330,
651,
66,
16993,
11,
33480,
15908,
11,
3108,
198,
11748,
25064,
198,
11748,
4423,
346,
198,
11748,
640,
220,
198,
11748,
1330,
8019,
220,
198,
11748,
302,
198,
11748,
2393,
15414,
198,
6738,
474... | 2.489209 | 695 |
from tensorflow import keras
from tensorflow.keras import Input, Sequential, Model
from tensorflow.keras.layers import Dense, Activation, Conv1D, LeakyReLU, Flatten,\
Add, BatchNormalization, MaxPooling1D
from tensorflow.keras.initializers import glorot_uniform
from tensorflow.keras.... | [
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
23412,
11,
24604,
1843,
11,
9104,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
360,
1072,
11,
13144,
341,
11,
34872,
16,... | 2.200562 | 3,560 |
import sys
sys.path.append('../../')
import numpy as np
from Bio import SeqIO
import pandas as pd
import argparse
from core import utils
use_cols = ['chrom-Enh','chromStart','chromEnd','TSS','label','id']
def _seqmat2vec(seq_mat):
"""
@seq_mat: [[seq],[seq],[seq]], numpy array
"""
_, col... | [
11748,
25064,
201,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
40720,
11537,
201,
198,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
16024,
1330,
1001,
80,
9399,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
... | 2.188623 | 668 |
#
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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,
198,
2,
770,
2393,
318,
636,
286,
12972,
12310,
51,
13,
198,
2,
198,
2,
220,
220,
15069,
1946,
23174,
12386,
72,
290,
16556,
402,
4982,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
116... | 3.138462 | 455 |
# Copyright (c) OpenMMLab. All rights reserved.
import copy
import inspect
import random
from numbers import Number
from typing import Sequence
import mmcv
import numpy as np
from ..builder import PIPELINES
from .compose import Compose
# Default hyperparameters for all Ops
_HPARAMS_DEFAULT = dict(pad_val=128)
def ... | [
2,
15069,
357,
66,
8,
4946,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
11748,
4866,
198,
11748,
10104,
198,
11748,
4738,
198,
6738,
3146,
1330,
7913,
198,
6738,
19720,
1330,
45835,
198,
198,
11748,
8085,
33967,
198,
11748,
299,
32... | 2.708279 | 4,566 |
# 202. Happy Number
#
# Note the question is straight forward, except that to be able to avoid the endless loop you have to stop if you find a already seen number.
#
| [
2,
22131,
13,
14628,
7913,
198,
2,
198,
2,
5740,
262,
1808,
318,
3892,
2651,
11,
2845,
326,
284,
307,
1498,
284,
3368,
262,
13079,
9052,
345,
423,
284,
2245,
611,
345,
1064,
257,
1541,
1775,
1271,
13,
198,
2,
198,
220,
220,
220,
... | 3.5 | 50 |
import mraa
import time
from rgb import rgb
# This just wraps the rgb class for a simple demo
| [
11748,
285,
430,
64,
198,
11748,
640,
198,
6738,
46140,
1330,
46140,
198,
198,
2,
770,
655,
27521,
262,
46140,
1398,
329,
257,
2829,
13605,
198
] | 3.653846 | 26 |
"""
Schema Registry admin scripts
"""
| [
37811,
198,
220,
220,
220,
10011,
2611,
33432,
13169,
14750,
198,
37811,
198
] | 3.230769 | 13 |
from flask import Flask, render_template, request, jsonify, redirect
from flask_redis import FlaskRedis
import utils
import validators
import os
app = Flask(__name__)
app.config['REDIS_URL'] = os.environ.get('REDIS_URL')
redis_client = FlaskRedis(app)
@app.route('/', methods=['GET'])
@app.route('/<hash>', methods... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
33918,
1958,
11,
18941,
198,
6738,
42903,
62,
445,
271,
1330,
46947,
7738,
271,
198,
11748,
3384,
4487,
198,
11748,
4938,
2024,
198,
11748,
28686,
628,
198,
1324,
796,
46947,
... | 2.845161 | 155 |
# Copyright 2016 Confluent 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 agreed to in writing, s... | [
2,
15069,
1584,
7326,
28216,
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,
11846,
351,
262,
13789,
13,
198,
2,
921,... | 2.208254 | 1,575 |
#Sunjeet Jena 7:10 PM, Saturday, 11th August 2018|
#This code is for feature mapping between two images
# By default it has been set for using test code and also by default it has been set to show the image.
# Comment the the test code below and directly use the main code to pass image 1 (left), image 2 (right), set o... | [
2,
16012,
18015,
316,
449,
8107,
767,
25,
940,
3122,
11,
3909,
11,
1367,
400,
2932,
2864,
91,
198,
2,
1212,
2438,
318,
329,
3895,
16855,
1022,
734,
4263,
198,
2,
2750,
4277,
340,
468,
587,
900,
329,
1262,
1332,
2438,
290,
635,
416... | 2.7875 | 480 |
"""
* Salom hammaga!
* Pythonni tashqi methodlari juda ko'p.
* Ulardan requests, bs4, wordcloud va matplotlib methondlardan foydalanamiz.
* Bu methodlarni hammasini kompyuteringizga o'rnatgan bo'lishingiz kerak.
* Yuklab olish uchun cmd ga kirib pip install (requests, bs4, wordcloud, matplotlib)
* ko'rinishda shu me... | [
198,
37811,
198,
9,
4849,
296,
25755,
8126,
0,
198,
9,
11361,
8461,
256,
1077,
40603,
2446,
75,
2743,
2553,
64,
41727,
6,
79,
13,
220,
198,
9,
16322,
446,
272,
7007,
11,
275,
82,
19,
11,
1573,
17721,
46935,
2603,
29487,
8019,
1124... | 2.075342 | 730 |
# This material was prepared as an account of work sponsored by an agency of the
# United States Government. Neither the United States Government nor the United
# States Department of Energy, nor Battelle, nor any of their employees, nor any
# jurisdiction or organization that has cooperated in the development of thes... | [
2,
770,
2587,
373,
5597,
355,
281,
1848,
286,
670,
15901,
416,
281,
4086,
286,
262,
198,
2,
1578,
1829,
5070,
13,
220,
16126,
262,
1578,
1829,
5070,
4249,
262,
1578,
198,
2,
1829,
2732,
286,
6682,
11,
4249,
12350,
13485,
11,
4249,
... | 2.397214 | 1,795 |
""""ATSS (Adaptive Training Sample Selector) matcher implementation.
This class takes a similarity matrix and matches columns to rows based on the
maximum value per column. One can specify matched_thresholds and
to prevent columns from matching to rows (generally resulting in a negative
training example) and unmatched... | [
15931,
15931,
1404,
5432,
357,
48003,
425,
13614,
27565,
9683,
273,
8,
2603,
2044,
7822,
13,
198,
198,
1212,
1398,
2753,
257,
26789,
17593,
290,
7466,
15180,
284,
15274,
1912,
319,
262,
198,
47033,
1988,
583,
5721,
13,
1881,
460,
11986,... | 2.475406 | 4,310 |
"""
author: ouyangtianxiong
date: 2019/12/25
des: implement some experiment executors
"""
class BasicExecutor:
"""
the base class of all executors
"""
def __init__(self, net_name, dataset_name, hyper_parameters):
"""
to execute a series experiment, model, data, and parameters is necessar... | [
37811,
198,
9800,
25,
267,
4669,
648,
83,
666,
87,
295,
70,
198,
4475,
25,
13130,
14,
1065,
14,
1495,
198,
8906,
25,
3494,
617,
6306,
3121,
669,
198,
37811,
198,
4871,
14392,
23002,
38409,
25,
198,
220,
220,
220,
37227,
198,
220,
... | 2.572614 | 241 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
198
] | 3.166667 | 6 |
'''
https://docs.micropython.org/en/latest/pyboard/tutorial/servo.html
connections:
Ground (B) - GND
Power (R) - 3V3
NC
Signal - pin X1
'''
import pyb
servo1 = pyb.Servo(1) # pix X1
#set the angle
servo1.angle(45)
#read the angle
servo1.angle()
# move two servos at the same time with speed control
s... | [
7061,
6,
198,
5450,
1378,
31628,
13,
9383,
1773,
7535,
13,
2398,
14,
268,
14,
42861,
14,
9078,
3526,
14,
83,
44917,
14,
3168,
78,
13,
6494,
198,
220,
220,
220,
220,
220,
198,
8443,
507,
25,
220,
198,
35539,
357,
33,
8,
532,
402,... | 2.372549 | 204 |
from django.conf import settings
from django.contrib import messages, auth
from django.contrib.auth import views as django_views
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from django.template.response import Te... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
11,
6284,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
5009,
355,
42625,
14208,
62,
33571,
198,
6738,
42625,
14208,
13,
3642,
822... | 3.482993 | 147 |
from django.contrib import admin
from KrillApp.models import Image, Krill
admin.site.register(Image)
admin.site.register(Krill)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
13685,
359,
4677,
13,
27530,
1330,
7412,
11,
13685,
359,
198,
198,
28482,
13,
15654,
13,
30238,
7,
5159,
8,
198,
28482,
13,
15654,
13,
30238,
7,
42,
20190,
8,
198
] | 3.095238 | 42 |
"""
Tests for CMS serializers
"""
from search.base import MockedESTestCase
from cms.serializers import (
CourseSerializer,
FacultySerializer,
RenditionSerializer,
ProgramPageSerializer,
)
from cms.factories import (
FacultyFactory,
ProgramPageFactory,
)
from courses.factories import CourseFactor... | [
37811,
198,
51,
3558,
329,
40773,
11389,
11341,
198,
37811,
198,
6738,
2989,
13,
8692,
1330,
337,
3543,
6465,
395,
20448,
198,
6738,
269,
907,
13,
46911,
11341,
1330,
357,
198,
220,
220,
220,
20537,
32634,
7509,
11,
198,
220,
220,
220... | 2.450877 | 1,140 |
"""
-*- test-case-name: PyHouse.src.Modules.Utilities.test.test_device_tools -*-
@name: PyHouse/src/Modules/Utilities/device_tools.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2015-2016 by D. Brian Kimmel
@license: MIT License
@note: Created on Jun 26, 2015
@S... | [
37811,
201,
198,
12,
9,
12,
1332,
12,
7442,
12,
3672,
25,
9485,
18102,
13,
10677,
13,
5841,
5028,
13,
18274,
2410,
13,
9288,
13,
9288,
62,
25202,
62,
31391,
532,
9,
12,
201,
198,
201,
198,
31,
3672,
25,
220,
220,
220,
220,
220,
... | 2.551948 | 462 |
from setuptools import setup, find_packages
setup(
name="pybat",
version="pre-alpha",
packages=find_packages(exclude=["docs"]),
install_requires=[
"pymatgen",
"click",
"pymongo",
"fireworks",
"custodian",
"tabulate",
"icet"
],
entry_points... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
9078,
8664,
1600,
198,
220,
220,
220,
2196,
2625,
3866,
12,
26591,
1600,
198,
220,
220,
220,
10392,
28,
19796,
62,
43789,
... | 1.955224 | 201 |
import logging
import re
import django
from django.core import signing
from django.utils import crypto
from . import packers, settings
__all__ = ["create_token", "detect_token", "parse_token"]
logger = logging.getLogger("sesame")
def get_revocation_key(user):
"""
When the value returned by this method cha... | [
11748,
18931,
198,
11748,
302,
198,
198,
11748,
42625,
14208,
198,
6738,
42625,
14208,
13,
7295,
1330,
8415,
198,
6738,
42625,
14208,
13,
26791,
1330,
21473,
198,
198,
6738,
764,
1330,
2353,
364,
11,
6460,
198,
198,
834,
439,
834,
796,
... | 2.544255 | 1,288 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
19... | 4.012195 | 410 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/usr/local/include;/usr/include/eigen3;/usr/include/pcl-1.7;/usr/include;/usr/include/ni;/usr/include/vtk-5.8".split(';') if "/usr/local/include;/usr/include/eigen3;/usr/include/pcl-1.7;/usr/include;/u... | [
2,
7560,
422,
3797,
5116,
14,
11215,
539,
14,
28243,
14,
35339,
13,
22866,
13,
14751,
13,
259,
198,
34,
1404,
42,
1268,
62,
47,
8120,
11879,
62,
47,
31688,
10426,
796,
13538,
198,
31190,
23680,
62,
40492,
38,
62,
10943,
16254,
62,
... | 2.016812 | 1,606 |
from .tutils import * | [
6738,
764,
83,
26791,
1330,
1635
] | 3.5 | 6 |
liczba = int(input("liczba: "))
while liczba > 0:
cyfra = liczba % 10
print("cyfra:", cyfra)
liczba = liczba // 10
| [
677,
89,
7012,
796,
493,
7,
15414,
7203,
677,
89,
7012,
25,
366,
4008,
198,
4514,
3476,
89,
7012,
1875,
657,
25,
198,
220,
220,
220,
3075,
69,
430,
796,
3476,
89,
7012,
4064,
838,
198,
220,
220,
220,
3601,
7203,
948,
69,
430,
25... | 1.984375 | 64 |
patterns = ['p2p', 'messaging', 'soa', 'layers', 'microkernel']
for pattern in patterns:
print(pattern) | [
33279,
82,
796,
37250,
79,
17,
79,
3256,
705,
37348,
3039,
3256,
705,
568,
64,
3256,
705,
75,
6962,
3256,
705,
24055,
33885,
20520,
198,
1640,
3912,
287,
7572,
25,
198,
220,
220,
220,
3601,
7,
33279,
8
] | 2.815789 | 38 |
import torch
import math
from torch.autograd import Variable
from torch import nn
import scipy.special as sc
import numpy as np
class Logcmk(torch.autograd.Function):
"""
The exponentially scaled modified Bessel function of the first kind
"""
@staticmethod
def forward(ctx, k):
"""
I... | [
11748,
28034,
198,
11748,
10688,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
629,
541,
88,
13,
20887,
355,
629,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
4871,
5972,
11215,
... | 2.384807 | 803 |
# coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
12131,
383,
9385,
544,
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,
74... | 1.956034 | 13,988 |
import numpy as np
import os
import glob
import trimesh
import tempfile
from collections import namedtuple
import sys
sys.path.append('..')
import lib.utils
Mesh = namedtuple('Mesh', ['file', 'name', 'mass', 'center_mass', 'inertia'])
if __name__ == '__main__':
path = '/mnt/datasets/grasping/G3DB'
g3db =... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
15095,
198,
11748,
491,
999,
71,
198,
11748,
20218,
7753,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
492,
11537,
... | 2.634921 | 126 |
import os, time, flask, string, MySQLdb, sqlalchemy, flask_bcrypt
from flask_bcrypt import Bcrypt
from os.path import join, dirname, realpath
from flask import Flask, Blueprint, render_template, request, redirect, url_for, flash, sessions, session, send_from_directory
from flask_sqlalchemy import SQLAlchemy
from fla... | [
11748,
28686,
11,
640,
11,
42903,
11,
4731,
11,
33476,
9945,
11,
44161,
282,
26599,
11,
42903,
62,
15630,
6012,
198,
198,
6738,
42903,
62,
15630,
6012,
1330,
347,
29609,
198,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
11... | 2.88862 | 826 |
from model_utils import Choices
SPONSOR_TYPES = Choices(
('diamond', 'DIAMOND', 'Diamond Sponsor'),
('lanyard', 'LANYARD', 'Lanyard Sponsor'),
('track', 'TRACK', 'Track Sponsor'),
('foodanddrinks', 'FOOD_AND_DRINKS', 'Food & Drinks Sponsor'),
('lounge', 'LOUNGE', 'Lounge Sponsor'),
('standard',... | [
6738,
2746,
62,
26791,
1330,
10031,
1063,
198,
198,
4303,
19213,
1581,
62,
9936,
47,
1546,
796,
10031,
1063,
7,
198,
220,
220,
220,
19203,
67,
8446,
3256,
705,
17931,
2390,
18672,
3256,
705,
47710,
23389,
33809,
198,
220,
220,
220,
19... | 2.699507 | 203 |
"""
Compare between-subjects statistics when computing mutual information
======================================================================
This example illustrates how to define and run a workflow for computing
mutual information and evaluate stastitics. Inference are made within-subjects
(random effect = rfx).
... | [
37811,
198,
41488,
1022,
12,
32796,
82,
7869,
618,
14492,
13584,
1321,
198,
23926,
50155,
198,
198,
1212,
1672,
21290,
703,
284,
8160,
290,
1057,
257,
30798,
329,
14492,
198,
21973,
723,
1321,
290,
13446,
336,
459,
270,
873,
13,
554,
... | 3.149541 | 1,197 |
from setuptools import *
setup(
name='icl',
version='0.0.0',
packages=['icl'],
package_dir={'icl': 'inc/icl'},
install_requires=['infinity>=1.5'],
python_requires='>=3.8',
url='https://github.com/happyxianyu/icl',
license='Apache License 2.0',
author='happyxianyu',
author_emai... | [
6738,
900,
37623,
10141,
1330,
1635,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
291,
75,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
15,
13,
15,
3256,
198,
220,
220,
220,
10392,
28,
17816,
291,
75,
6,
4357,
198,
220,
... | 2.352941 | 170 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from expyriment import __version__ as _expyriment_version
from sys import version as _python_version
expyriment_version = [int(i) for i in _expyriment_version.split('.')]
python_version = [int(i) for i in _python_version.split(' ')[0].split('.')]
from expyriment import de... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
1033,
2417,
3681,
1330,
11593,
9641,
834,
355,
4808,
11201,
2417,
3681,
62,
9641,
198,
6738,
25064,
1330,
21... | 2.500637 | 785 |
import os
import time
from collections import defaultdict, deque
import numpy as np
import pandas as pd
import itertools
import CONSTANT
from util import Config, Timer, log, timeit
from sklearn.decomposition import PCA
from sklearn.feature_extraction.text import TfidfVectorizer
from preprocess import clean_df
NUM_O... | [
11748,
28686,
198,
11748,
640,
198,
6738,
17268,
1330,
4277,
11600,
11,
390,
4188,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
11748,
340,
861,
10141,
198,
198,
11748,
7102,
2257,
8643,
198,
... | 2.992593 | 135 |
import unittest
from werkzeug.datastructures import MultiDict
from flask_sieve.requests import FormRequest, JsonRequest
from flask_sieve.exceptions import ValidationException
| [
11748,
555,
715,
395,
198,
198,
6738,
266,
9587,
2736,
1018,
13,
19608,
459,
1356,
942,
1330,
15237,
35,
713,
198,
198,
6738,
42903,
62,
82,
12311,
13,
8897,
3558,
1330,
5178,
18453,
11,
449,
1559,
18453,
198,
6738,
42903,
62,
82,
1... | 3.461538 | 52 |
# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you 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/... | [
2,
15069,
357,
66,
8,
2177,
11,
370,
15821,
17,
3457,
13,
357,
4023,
1378,
2503,
13,
86,
568,
17,
13,
2398,
8,
1439,
6923,
33876,
13,
198,
2,
198,
2,
370,
15821,
17,
3457,
13,
16625,
428,
2393,
284,
345,
739,
262,
24843,
13789,
... | 2.565257 | 1,111 |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 05 2016
Author: Cedric Vallee
"""
from sklearn.cross_validation import train_test_split
# Function to return a row from a list of lists | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
1526,
8870,
1584,
198,
13838,
25,
25789,
1173,
3254,
7197,
198,
37811,
198,
198,
6738,
1341,
35720,
13,
19692,
62,
12102,
341,
1330,
4512,
... | 3.066667 | 60 |
__all__ = ["run_cli"]
import click
from bfpy.cli.repl import repl
from bfpy.cli.run import run
@click.group() # type: ignore
run_cli.add_command(run)
run_cli.add_command(repl)
| [
834,
439,
834,
796,
14631,
5143,
62,
44506,
8973,
198,
198,
11748,
3904,
198,
198,
6738,
275,
69,
9078,
13,
44506,
13,
35666,
1330,
2186,
198,
6738,
275,
69,
9078,
13,
44506,
13,
5143,
1330,
1057,
628,
198,
31,
12976,
13,
8094,
3419... | 2.541667 | 72 |
"""pycln/utils/_nodes.py tests."""
# pylint: disable=R0201,W0613
import pytest
from pycln.utils import _nodes
class TestNodePosition:
"""`NodePosition` dataclass test case."""
@pytest.mark.parametrize("line, col", [(1, 0), (1, None)])
@pytest.mark.parametrize(
"line, col, expec_hash",
... | [
37811,
9078,
565,
77,
14,
26791,
47835,
77,
4147,
13,
9078,
5254,
526,
15931,
198,
2,
279,
2645,
600,
25,
15560,
28,
49,
15,
1264,
11,
54,
3312,
1485,
198,
11748,
12972,
9288,
198,
198,
6738,
12972,
565,
77,
13,
26791,
1330,
4808,
... | 2.021991 | 864 |