content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
'''
Module containing functions -
image2matrix
matrix2image
'''
def image2matrix(source,pixels=1,Start='S',End='E',Path=' ',Wall='X'):
'''
Converts a maze image to a matrix.\n
-Green is considered Start \n
-Red is considered as End \n
-White is considered as paths \n
... | [
7061,
6,
198,
26796,
7268,
5499,
532,
198,
220,
220,
220,
2939,
17,
6759,
8609,
198,
220,
220,
220,
17593,
17,
9060,
198,
7061,
6,
628,
198,
4299,
2939,
17,
6759,
8609,
7,
10459,
11,
79,
14810,
28,
16,
11,
10434,
11639,
50,
3256,
... | 1.898649 | 1,628 |
from __future__ import annotations
from abc import ABC, abstractmethod
from datetime import timedelta
from difflib import SequenceMatcher
from typing import TYPE_CHECKING, List, Union, Any, Iterable
import nextcord
from .base import EventManager, get_generator_response, CacheBased
from .punishments import get_releva... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
814,
8019,
1330,
45835,
19044,
2044,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
... | 2.629973 | 754 |
from .devicelist import (
ChannelList,
ChannelInfo,
DeviceTokenList,
APIDList,
DeviceInfo,
)
from .tag import ChannelTags, OpenChannelTags
from .segment import Segment, SegmentList
from .channel_uninstall import ChannelUninstall
from .open_channel import OpenChannel
from .named_users import Nam... | [
6738,
764,
7959,
291,
46331,
1330,
357,
198,
220,
220,
220,
11102,
8053,
11,
198,
220,
220,
220,
11102,
12360,
11,
198,
220,
220,
220,
16232,
30642,
8053,
11,
198,
220,
220,
220,
3486,
2389,
8053,
11,
198,
220,
220,
220,
16232,
1236... | 3.23913 | 184 |
'''
MIT License
Copyright (c) 2019 Enrique Sandoval
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, merge, publi... | [
7061,
6,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
13130,
46879,
3837,
8325,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314,
3696,
357,
... | 3.885522 | 297 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.autograd import Variable
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
... | 3.753425 | 73 |
"""
Unit test case for src/get_json.py.
Tests positive and negative inputs for both local files and URL-based loading.
"""
import unittest
from src import get_json as GJ
class TestGetJson(unittest.TestCase):
"""
TestCase class for src/get_json.py for easy test case running.
Tests true positive, false positive, a... | [
37811,
198,
26453,
1332,
1339,
329,
12351,
14,
1136,
62,
17752,
13,
9078,
13,
198,
198,
51,
3558,
3967,
290,
4633,
17311,
329,
1111,
1957,
3696,
290,
10289,
12,
3106,
11046,
13,
198,
37811,
198,
198,
11748,
555,
715,
395,
198,
6738,
... | 3.272222 | 180 |
import logging
import numpy as np
from helpers.preprocessing import our_stft
from scipy import signal as ss
import os
import soundfile as sf
from os.path import join as pjoin
import pysepm as pm
from typing import List
nparr = np.ndarray
def our_istft(z: nparr) -> List[nparr]:
"""
:param z: matrix of size [s... | [
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
49385,
13,
3866,
36948,
1330,
674,
62,
301,
701,
198,
6738,
629,
541,
88,
1330,
6737,
355,
37786,
198,
11748,
28686,
198,
11748,
2128,
7753,
355,
264,
69,
198,
6738,
28686,
... | 2.618357 | 207 |
#!/usr/bin/env python
# This file is part of Elsim
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Elsim is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either ver... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
770,
2393,
318,
636,
286,
2574,
14323,
198,
2,
198,
2,
15069,
357,
34,
8,
2321,
11,
9953,
2935,
39369,
1279,
8906,
39369,
379,
256,
15,
83,
15,
13,
8310,
29,
198,
2,
1439... | 1.853971 | 2,027 |
from PyQt5.QtCore import Qt, pyqtSignal, QObject
from pipelineController import *
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
33734,
11,
12972,
39568,
11712,
282,
11,
1195,
10267,
198,
6738,
11523,
22130,
1330,
1635,
628,
198
] | 3.111111 | 27 |
# -*- coding: utf-8 -*-
import unittest
from gae2django.gaeapi.appengine.ext import db
from gae2django.models import RegressionTestModel as TestModel
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
308,
3609,
17,
28241,
14208,
13,
25002,
15042,
13,
1324,
18392,
13,
2302,
1330,
20613,
198,
6738,
308,
3609,
17,
28241,
14208,... | 2.781818 | 55 |
#!/bin/env python
#
# Advent of Code 2020
# Day 04
#
# author: Daniel Joseph Antrim
# e-mail: dantrim1023 AT gmail DOT com
#
import sys
from argparse import ArgumentParser
from pathlib import Path
import re
import numpy as np
if __name__ == "__main__":
parser = ArgumentParser(description="AoC day #4")
... | [
2,
48443,
8800,
14,
24330,
21015,
198,
198,
2,
198,
2,
33732,
286,
6127,
12131,
198,
2,
3596,
8702,
198,
2,
198,
2,
1772,
25,
7806,
7212,
3738,
3036,
198,
2,
304,
12,
4529,
25,
288,
415,
3036,
940,
1954,
5161,
308,
4529,
42743,
... | 2.630841 | 214 |
import keras
import tensorflow as tf
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K
import cv2
import seaborn as sns
if __name__ == "__main__":
trained_model = crea... | [
11748,
41927,
292,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
... | 2.908397 | 131 |
print("ReTask. version 0.01. All rights reserved.")
"""This is the main class"""
import datetime
from ReTask.TaskClass.taskClass import Task
from ReTask.ListTask.listTask import ListTask
from ReTask.Database import TaskDB
#Setup : Needed Func#
#Setup : When starting program#
lstDb = TaskDB.ambilSemuaData()
lst... | [
4798,
7203,
3041,
25714,
13,
2196,
657,
13,
486,
13,
1439,
2489,
10395,
19570,
198,
37811,
1212,
318,
262,
1388,
1398,
37811,
198,
198,
11748,
4818,
8079,
198,
6738,
797,
25714,
13,
25714,
9487,
13,
35943,
9487,
1330,
15941,
198,
6738,
... | 2.332308 | 650 |
menu_name = "SSH settings"
import os
import subprocess
from time import sleep
from datetime import datetime
from helpers import read_or_create_config, local_path_gen, save_config_gen, setup_logger
from ui import Menu, PrettyPrinter as Printer, LoadingIndicator, DialogBox
from actions import FirstBootAction
from libs ... | [
26272,
62,
3672,
796,
366,
5432,
39,
6460,
1,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
6738,
640,
1330,
3993,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
49385,
1330,
1100,
62,
273,
62,
17953,
62,
11250,
11,
... | 3.081081 | 259 |
import numpy as np
import seldon_core
from seldon_core.user_model import SeldonComponent
from typing import Dict, List, Union, Iterable
import os
import yaml
import logging
import xgboost as xgb
logger = logging.getLogger(__name__)
BOOSTER_FILE = "model.bst"
| [
11748,
299,
32152,
355,
45941,
198,
11748,
384,
25900,
62,
7295,
198,
6738,
384,
25900,
62,
7295,
13,
7220,
62,
19849,
1330,
1001,
25900,
21950,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
11,
40806,
540,
198,
11748,
28686,
... | 3.046512 | 86 |
"""
The code here handles receiving messages about events and has wrappers to process them.
This module is meant to be imported in API and should be independent.
"""
import logging
from typing import Iterable, Tuple, Dict, Any
import fedmsg
import requests
from packit.constants import GH2FED_RELEASE_TOPIC
logger = ... | [
37811,
198,
464,
2438,
994,
17105,
6464,
6218,
546,
2995,
290,
468,
7917,
11799,
284,
1429,
606,
13,
198,
198,
1212,
8265,
318,
4001,
284,
307,
17392,
287,
7824,
290,
815,
307,
4795,
13,
198,
37811,
198,
11748,
18931,
198,
6738,
19720... | 2.410559 | 1,269 |
from fastapi.security import OAuth2PasswordBearer
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="api/v1/user/authenticate") | [
6738,
3049,
15042,
13,
12961,
1330,
440,
30515,
17,
35215,
3856,
11258,
628,
198,
12162,
1071,
17,
62,
15952,
1326,
796,
440,
30515,
17,
35215,
3856,
11258,
7,
30001,
28165,
2625,
15042,
14,
85,
16,
14,
7220,
14,
41299,
5344,
4943
] | 3.04878 | 41 |
from trex.stl.trex_stl_hltapi import STLHltStream
class STLS1(object):
'''
Example number 4 of using HLTAPI from David
Creates Eth/802.1Q/802.1Q/IP/TCP stream with complex VM:
The first vlan_id will be incremented, second const.
MAC src, IP src, IP dst will have <mac_src_count> number of i... | [
6738,
2054,
87,
13,
301,
75,
13,
83,
21510,
62,
301,
75,
62,
71,
2528,
15042,
1330,
37269,
39,
2528,
12124,
628,
198,
4871,
3563,
6561,
16,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
17934,
1271,
604,
286,
... | 2.728324 | 173 |
# Copyright (c) 2020 | KingKevin23 (@kingkevin023)
from . import api, utils
__all__ = [api, utils] | [
2,
220,
15069,
357,
66,
8,
12131,
930,
2677,
23865,
1954,
4275,
3364,
365,
7114,
45310,
8,
198,
198,
6738,
764,
1330,
40391,
11,
3384,
4487,
198,
198,
834,
439,
834,
796,
685,
15042,
11,
3384,
4487,
60
] | 2.657895 | 38 |
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
import getpass
from .helper import Helper
from ..questions import Question, ChoiceQuestion, ConfirmationQuestion
from ..outputs import ConsoleOutput
from ..formatters import Formatter
from ..validators import Validator, Callable
from .._compat import deco... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
651,
6603,
198,
198,
6738,
764,
2978,
525,
1330,
5053,
525,
198,
6738,
11485,
6138,
507,
1330,
... | 3.724138 | 87 |
from app.worker import get_faust_app
faust_app = get_faust_app()
count_table = faust_app.GlobalTable(
"count",
default=int,
partitions=1,
)
| [
6738,
598,
13,
28816,
1330,
651,
62,
13331,
436,
62,
1324,
198,
198,
13331,
436,
62,
1324,
796,
651,
62,
13331,
436,
62,
1324,
3419,
198,
198,
9127,
62,
11487,
796,
24685,
436,
62,
1324,
13,
22289,
10962,
7,
198,
220,
220,
220,
36... | 2.369231 | 65 |
import warnings
import pandas as pd
import numpy as np
import scipy as math
import matplotlib.pyplot as plt
import seaborn as sns
import pickle
from PIL import Image
from sklearn.model_selection import train_test_split
import skimage
from skimage.color import rgb2gray, gray2rgb
from skimage import data
from skimage.tr... | [
11748,
14601,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
10688,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198... | 2.988406 | 345 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from fairseq.data import Dictionary, data_utils
if __name__ == "__main__":
import sys
dirname = s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
... | 2.880282 | 142 |
from collections import namedtuple
import os
from textwrap import dedent
import psycopg2
import pytest
from util.popularity import sql
TEST_ID = "testing"
POSTGRES_CONN_ID = os.getenv("TEST_CONN_ID")
POSTGRES_TEST_URI = os.getenv("AIRFLOW_CONN_POSTGRES_OPENLEDGER_TESTING")
TEST_IMAGE_VIEW = f"image_view_{TEST_ID}"
T... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
28686,
198,
6738,
2420,
37150,
1330,
4648,
298,
198,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
12972,
9288,
198,
198,
6738,
7736,
13,
12924,
33737,
1330,
44161,
198,
198,
51,
6465,
62,... | 2.475962 | 1,040 |
# Generated by Django 2.1.2 on 2018-12-12 15:15
import datetime
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
17,
319,
2864,
12,
1065,
12,
1065,
1315,
25,
1314,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.972222 | 36 |
"""
Module to store and restore input- and result-data from oemof into database.
Works with oemof version 2.0
Notes
-----
By now, table names are static - if you are not satisfied with resulting
table names, you have to change code yourself!
Examples
--------
The following code will setup your sqlalchemy session and
... | [
37811,
198,
26796,
284,
3650,
290,
11169,
5128,
12,
290,
1255,
12,
7890,
422,
267,
368,
1659,
656,
6831,
13,
198,
23044,
351,
267,
368,
1659,
2196,
362,
13,
15,
198,
198,
16130,
198,
30934,
198,
3886,
783,
11,
3084,
3891,
389,
9037,... | 2.332542 | 2,526 |
from collections import defaultdict
from typing import Any, Dict, List, Tuple
from ..utils.projector import AllData, register_projector_element
# Important: All functions have to be prune. This means, that thay can only
# access the data, that they get as argument and do not have any
# side eff... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
309,
29291,
198,
198,
6738,
11485,
26791,
13,
16302,
273,
1330,
1439,
6601,
11,
7881,
62,
16302,
273,
62,
30854,
628,
198,
2,
28511,
25,
1439,
... | 2.605234 | 917 |
import random
import struct
a = float_to_bin(random.random() * 10)
b = float_to_bin(random.random() * 10)
# a_gauche = a &
# b_gauche = b $
print(a)
print(b)
print(bin_to_float(a))
print(bin_to_float(b))
# print(bin(a_gauche | b_gauche))
# print(bin(extract_bit(a, 0, 9)))
gena = ""
genb = ""
for i in range(0, ... | [
11748,
4738,
198,
11748,
2878,
628,
628,
198,
198,
64,
796,
12178,
62,
1462,
62,
8800,
7,
25120,
13,
25120,
3419,
1635,
838,
8,
198,
65,
796,
12178,
62,
1462,
62,
8800,
7,
25120,
13,
25120,
3419,
1635,
838,
8,
198,
2,
257,
62,
7... | 2.177083 | 192 |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.ensemble.forest import BaseForest
from sklearn.tree import DecisionTreeClassifier
from sklearn.utils import check_random_state, check_array
from sklea... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
82,
29572,... | 2.698998 | 1,897 |
from django.shortcuts import render
from django.http import HttpResponse
from pyWebPlayer.models import music
from pyWebPlayer.models import dir
import os
from django.templatetags.static import static
from django.conf import settings
import pyWebPlayer.settings
from pathlib import Path
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
12972,
13908,
14140,
13,
27530,
1330,
2647,
198,
6738,
12972,
13908,
14140,
13,
27530,
1330,
26672,
198,
11748,
28686,
... | 3.826667 | 75 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
| [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2100,
796,
2124,
1... | 1.945652 | 92 |
# The MIT License
#
# Copyright (c) 2011 Wyss Institute at Harvard University
#
# 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
# ... | [
2,
383,
17168,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
2813,
12958,
824,
5136,
379,
11131,
2059,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
... | 3.535452 | 409 |
import discord
from discord.ext import commands
class Channel_And_VC(commands.Cog): #PLAN: Do like VoiceMaster
"""
Channel and VC Commands... For playing and skipping music commands, see the Music Commands by doing \"lm?help music\"!
"""
@commands.Cog.listener() | [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
4871,
11102,
62,
1870,
62,
15922,
7,
9503,
1746,
13,
34,
519,
2599,
1303,
6489,
1565,
25,
2141,
588,
15282,
18254,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11102,
... | 3.255814 | 86 |
#
from scipy.integrate import ode
import matplotlib.pyplot as plt
ITERATION = 2000
TIME_UPPER_LIMIT = 50.0
INITIAL_VALUES = [0.0, 1.0, 0.0, 1.0]
OSCILLATOR_WEIGHTS = [1.5, 1.5]
T = 1.0
tau = 4.0
w = 1.0
b = 2.5
class TwoNeuralOscillator(object):
"""
Matsuoka's Neural Oscillator Mdodel.
http://www.cs.cm... | [
2,
198,
198,
6738,
629,
541,
88,
13,
18908,
4873,
1330,
267,
2934,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2043,
1137,
6234,
796,
4751,
198,
34694,
62,
8577,
18973,
62,
43,
3955,
2043,
796,
2026,
13,
... | 2.174026 | 385 |
class Utilities:
"""
This class contains commonly used testing data and functions.
"""
dns_message_encoded: bytes = b'\x00\x01\x80\x80\x00\x01\x00\x00\x00\x04\x00\x08\x03www\x02cs\x03ubc' \
b'\x02ca\x00\x00\x01\x00\x01\x02ca\x00\x00\x02\x00\x01\x00\x02MY\x00\x0f' \
... | [
4871,
41086,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
1398,
4909,
8811,
973,
4856,
1366,
290,
5499,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
288,
5907,
62,
20500,
62,
12685,
9043,
25,
9881,
796,
275,
6,
59... | 1.433767 | 2,227 |
# queue length and average delay estimation
import pandas as pd
import numpy as np
import math
import sys
import os
import json
import geopy.distance
import csv
import SPaT_convertor_v3
import BSM_convertor
import wgs84_to_utm
import longitudinal_traj
import shockwave_estimation_v2
# INPUTS:
# 1 - BSM... | [
2,
16834,
4129,
290,
2811,
5711,
31850,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
10688,
220,
201,
198,
11748,
25064,
201,
198,
11748,
28686,
201,
198,
11748,
33918,
201,
198,
... | 1.887942 | 8,451 |
from flask import Blueprint, jsonify, request, Response
from sqlalchemy.exc import IntegrityError
from model import CoffeeShop
from . import db
import json
import os
api = Blueprint('api', __name__)
@api.route('/coffeeshops/')
@api.route('/coffeeshops/', methods=['POST'])
@api.route('/ping')
| [
6738,
42903,
1330,
39932,
11,
33918,
1958,
11,
2581,
11,
18261,
198,
6738,
44161,
282,
26599,
13,
41194,
1330,
39348,
12331,
198,
198,
6738,
2746,
1330,
19443,
29917,
198,
198,
6738,
764,
1330,
20613,
198,
198,
11748,
33918,
198,
11748,
... | 3.061224 | 98 |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
from rpython.rtyper.module.ll_os import RegisterOs
import os, sys
exec 'import %s as posix' % os.name
# this is the list of function which is *not* present in the posix module of
# IronPython 2.6, and that we want to ignore for now
lltype_o... | [
2,
15717,
4238,
5612,
198,
6738,
279,
4464,
88,
13,
3849,
3866,
353,
13,
76,
2966,
21412,
1330,
35250,
26796,
198,
6738,
374,
29412,
13,
81,
774,
525,
13,
21412,
13,
297,
62,
418,
1330,
17296,
16748,
198,
198,
11748,
28686,
11,
2506... | 2.049761 | 3,979 |
from django.shortcuts import render
from mezzanine.pages.page_processors import processor_for
from .models import FlexiPage
from .utils import get_flexi_template_location, get_flexi_forms
from django.conf import settings
try:
FLEXI_PREFIX = settings.VARIABLE_PREFIX
except AttributeError:
VARIABLE_PREFIX = 'fl... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
502,
3019,
272,
500,
13,
31126,
13,
7700,
62,
14681,
669,
1330,
12649,
62,
1640,
198,
6738,
764,
27530,
1330,
26719,
72,
9876,
198,
6738,
764,
26791,
1330,
651,
62,
32880,
7... | 2.58046 | 174 |
from django.test import TestCase
from .models import Image,Category,Location
# Create your tests here.
# Create your tests here.
# Set up method
# Testing instance
# Testing Save Method
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
764,
27530,
1330,
7412,
11,
27313,
11,
14749,
198,
198,
2,
13610,
534,
5254,
994,
13,
198,
198,
2,
13610,
534,
5254,
994,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
... | 2.986301 | 73 |
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
2,
15069,
1584,
19507,
605,
12052,
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... | 2.484163 | 1,105 |
'''
This module stores functions that write script files for various calculations
They are used in __main__.py
All functions must use the same keyword parameter names and the *args and **kwargs parameters as input
'''
import os
import subprocess
from .common import write_submitfile
from .common import get_m... | [
7061,
6,
198,
220,
220,
220,
770,
8265,
7000,
5499,
326,
3551,
4226,
3696,
329,
2972,
16765,
198,
220,
220,
220,
1119,
389,
973,
287,
11593,
12417,
834,
13,
9078,
198,
220,
220,
220,
1439,
5499,
1276,
779,
262,
976,
21179,
11507,
38... | 2.289913 | 4,967 |
# -*- coding: utf-8 -*-
import os
import sys
import pandas as pd
from geopandas import read_file
from shapely.geometry import Polygon
from datetime import datetime
script_path = os.path.dirname(__file__)
sys.path.append(os.path.join(script_path,".."))
from movingpandas.trajectory import Trajectory
if __name__ ==... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
220,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
6738,
30324,
392,
292,
1330,
1100,
62,
7753,
198,
6738,
5485,
306,
13,
469,
... | 2.420068 | 588 |
import networkx as nx
import matplotlib.pyplot as plt
from grafos.Arvore import hierarchy_pos
#from grafos.ScrollWindow import ScrollableWindow
from controller.Preenchimento import Preenchimento
fig = plt.figure(1, figsize=(15, 6.5))
G = nx.Graph()
raiz = 0
preenchimento = Preenchimento()
duplas = preenchimento.dup... | [
11748,
3127,
87,
355,
299,
87,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
7933,
69,
418,
13,
3163,
85,
382,
1330,
18911,
62,
1930,
198,
2,
6738,
7933,
69,
418,
13,
29261,
27703,
1330,
17428,
540,
27703,... | 2.180495 | 687 |
import asyncio
import discord
import time
from operator import itemgetter
from discord.ext import commands
from Cogs import Settings
from Cogs import ReadableTime
from Cogs import DisplayName
from Cogs import Nullify
from Cogs import FuzzySearch
from Cogs import Message
| [
11748,
30351,
952,
201,
198,
11748,
36446,
201,
198,
11748,
640,
201,
198,
6738,
220,
220,
10088,
1330,
2378,
1136,
353,
201,
198,
6738,
220,
220,
36446,
13,
2302,
1330,
9729,
201,
198,
6738,
220,
220,
327,
18463,
1330,
16163,
201,
19... | 3.170213 | 94 |
import unittest
from ee.clickhouse.queries.experiments.funnel_experiment_result import ClickhouseFunnelExperimentResult, Variant
| [
11748,
555,
715,
395,
198,
198,
6738,
304,
68,
13,
12976,
4803,
13,
421,
10640,
13,
23100,
6800,
13,
12543,
4954,
62,
23100,
3681,
62,
20274,
1330,
6914,
4803,
24629,
4954,
20468,
3681,
23004,
11,
38215,
628
] | 3.540541 | 37 |
from collections import namedtuple, defaultdict
__all__ = ["devices", "devices_by_signature"]
AVRDevice = namedtuple("AVRDevice", (
"name", "signature",
# All sizes in bytes
"calibration_size", "fuses_size",
"program_size", "program_page",
"eeprom_size", "eeprom_page",
"erase_time", # None i... | [
6738,
17268,
1330,
3706,
83,
29291,
11,
4277,
11600,
628,
198,
834,
439,
834,
796,
14631,
42034,
1600,
366,
42034,
62,
1525,
62,
12683,
1300,
8973,
628,
198,
10116,
49,
24728,
796,
3706,
83,
29291,
7203,
10116,
49,
24728,
1600,
357,
1... | 2.124796 | 1,226 |
import shutil
import sys
from pathlib import Path
cur_folder = Path(__file__).parent.absolute()
repo_folder = cur_folder.parent.parent.absolute()
src_folder = repo_folder / "src" / "msanalyzer"
python_exe = sys.executable
main_py: Path = cur_folder / "msanalyzer_cli.py"
main_gui_py: Path = Path("msanalyzer_gui.py"... | [
11748,
4423,
346,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
628,
198,
198,
22019,
62,
43551,
796,
10644,
7,
834,
7753,
834,
737,
8000,
13,
48546,
3419,
198,
260,
7501,
62,
43551,
796,
1090,
62,
43551,
13,
8000,
13,
8000,
... | 2.42042 | 333 |
#!/usr/bin/env python
import re
input_data = [
"1-3 a: abcde",
"1-3 b: cdefg",
"2-9 c: ccccccccc",
]
pattern = r"([0-9]{1,})-([0-9]{1,}) ([a-z]): ([a-z]{1,})"
counter = 0
for line in input_data:
ll, ul, letter, password = re.findall(pattern, line)[0]
if int(ll) <= password.count(letter) <= int(ul):
counter +... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
302,
198,
198,
15414,
62,
7890,
796,
685,
198,
197,
1,
16,
12,
18,
257,
25,
450,
66,
2934,
1600,
198,
197,
1,
16,
12,
18,
275,
25,
269,
4299,
70,
1600,
198,
197,
1,... | 2.153409 | 176 |
#
# Copyright Verizon Inc.
# Licensed under the terms of the Apache License 2.0 license. See LICENSE file in project root for terms.
#
import sys
import getopt
from pyangbind.lib import pybindJSON
import json
import logging
import traceback
import sys
from pprint import pformat
import re
import time
topicModelMappin... | [
2,
198,
2,
15069,
18062,
3457,
13,
198,
2,
49962,
739,
262,
2846,
286,
262,
24843,
13789,
362,
13,
15,
5964,
13,
220,
4091,
38559,
24290,
2393,
287,
1628,
6808,
329,
2846,
13,
198,
2,
198,
11748,
25064,
198,
11748,
651,
8738,
198,
... | 2.682783 | 848 |
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
######################## -*- coding: utf-8 -*-
"""Usage: readtapemonitor.py INPUTFILE
Simple script to read variables in monitor files as a function of tsnumber
This is intended for debugging taf-generated code, where we can write
multiple monitor output with the same... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
47279,
12,
3459,
3270,
12,
1314,
532,
9,
12,
198,
14468,
7804,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
28350,
25,
1100,
44335,
... | 2.074248 | 1,064 |
import time
import os
from aiohttp import web
start_time = time.time()
| [
11748,
640,
198,
11748,
28686,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
198,
9688,
62,
2435,
796,
640,
13,
2435,
3419,
198
] | 3.130435 | 23 |
"""
Modify your own source code with this piece of Python black magic.
When a piece of code calls `replace_me(value)`, that line will be replaced with the given `value`. If you want to insert a comment and keep the line that inserted it, use `insert_comment(value)`.
**ATTENTION**: Calling these functions will modify ... | [
37811,
198,
5841,
1958,
534,
898,
2723,
2438,
351,
428,
3704,
286,
11361,
2042,
5536,
13,
198,
198,
2215,
257,
3704,
286,
2438,
3848,
4600,
33491,
62,
1326,
7,
8367,
8,
47671,
326,
1627,
481,
307,
6928,
351,
262,
1813,
4600,
8367,
4... | 2.629532 | 2,648 |
import os
import webapp2
import jinja2
import re
import hashlib
import hmac
import random
import string
import time
from users import *
from google.appengine.ext import ndb
def blog_key(name='default'):
"""assigns a key to the blogpost"""
return ndb.Key('blogs', name)
class Post(ndb.Model):
"""Store... | [
198,
198,
11748,
28686,
198,
11748,
3992,
1324,
17,
198,
11748,
474,
259,
6592,
17,
198,
11748,
302,
198,
11748,
12234,
8019,
198,
11748,
289,
20285,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
640,
198,
198,
6738,
2985,
1330,
1635,... | 2.854447 | 371 |
"""Log handler."""
import logging
import sys
class LogHandler(logging.Handler):
"""Log handler class."""
terminator = '\n'
def emit(self, record):
"""Overwrite ``emit``."""
if not self._enabled:
return
if self._activated:
try:
self._out.wr... | [
37811,
11187,
21360,
526,
15931,
198,
198,
11748,
18931,
198,
11748,
25064,
628,
198,
4871,
5972,
25060,
7,
6404,
2667,
13,
25060,
2599,
198,
220,
220,
220,
37227,
11187,
21360,
1398,
526,
15931,
628,
220,
220,
220,
5651,
1352,
796,
705... | 2.018949 | 1,161 |
#!/usr/bin/python
from datetime import date
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'Bcfg2.Server.Hostbase.settings'
from Bcfg2.Server.Hostbase.hostbase.models import *
from Bcfg2.Server.Hostbase.settings import DEFAULT_MX, PRIORITY
import Bcfg2.Server.Hostbase.regex
host_attribs = ['administrato... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
4818,
8079,
1330,
3128,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
418,
13,
268,
2268,
17816,
35028,
1565,
11230,
62,
28480,
51,
20754,
62,
33365,
24212,
20520,
796,
705,
33,
... | 1.760037 | 3,213 |
from PIL import Image
import numpy as np
img_in_way=input(
"Введите имя входного изображения (\"imageName.jpg\"):")
if (img_in_way==""):
print("Пустое поле ввода")
quit()
img_out_way=input(
"Введите имя выходного изображения (\"imageName.jpg\"):")
if (img_out_way == ''):
print('Пустое ... | [
6738,
350,
4146,
1330,
7412,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
9600,
62,
259,
62,
1014,
28,
15414,
7,
201,
198,
220,
220,
220,
366,
140,
240,
38857,
16843,
43666,
18849,
20375,
16843,
12466,
116,
43108,
4062... | 1.619512 | 615 |
from builtins import object
METHOD_OVERRIDE_HEADER = 'HTTP_X_HTTP_METHOD_OVERRIDE'
| [
6738,
3170,
1040,
1330,
2134,
198,
49273,
62,
41983,
49,
14114,
62,
37682,
1137,
796,
705,
40717,
62,
55,
62,
40717,
62,
49273,
62,
41983,
49,
14114,
6,
628
] | 2.896552 | 29 |
'''
Author: jianzhnie
Date: 2021-12-23 15:56:54
LastEditTime: 2021-12-24 10:42:34
LastEditors: jianzhnie
Description:
'''
import os
import torch
from d2l import torch as d2l
def read_imdb(data_dir, is_train):
"""读取IMDb评论数据集文本序列和标签."""
data, labels = [], []
for label in ('pos', 'neg'):
folder_na... | [
7061,
6,
198,
13838,
25,
474,
666,
23548,
11952,
198,
10430,
25,
33448,
12,
1065,
12,
1954,
1315,
25,
3980,
25,
4051,
198,
5956,
18378,
7575,
25,
33448,
12,
1065,
12,
1731,
838,
25,
3682,
25,
2682,
198,
5956,
18378,
669,
25,
474,
... | 1.885754 | 1,453 |
from airflow.hooks.postgres_hook import PostgresHook
from airflow.utils.decorators import apply_defaults
from airflow.models import BaseOperator
class LoadFactOperator(BaseOperator):
"""
Operator that loads Redshift fact tables
Attributes
----------
redshift_conn_id : str
Airflow connecti... | [
6738,
45771,
13,
25480,
82,
13,
7353,
34239,
62,
25480,
1330,
2947,
34239,
39,
566,
198,
6738,
45771,
13,
26791,
13,
12501,
273,
2024,
1330,
4174,
62,
12286,
82,
198,
6738,
45771,
13,
27530,
1330,
7308,
18843,
1352,
628,
198,
4871,
87... | 2.518657 | 536 |
import pandas as pd
from pathlib import Path
import torch
from torch.utils.data import Dataset
import albumentations as A
import cv2
| [
11748,
19798,
292,
355,
279,
67,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
198,
11748,
435,
65,
1713,
602,
355,
317,
198,
11748,
269,
85,
17,
628
] | 3.292683 | 41 |
"""
Global functions for the module
"""
import contextlib
import copy
import json
import pathlib
import shutil
import subprocess
import urllib.request
import typing
# This is mandatory
__all__ = ('__return__', 'Container', 'Image', 'ImageNotFoundError')
# build-using-dockerfile Build an image using instructions in a... | [
37811,
198,
22289,
5499,
329,
262,
8265,
198,
37811,
198,
11748,
4732,
8019,
198,
11748,
4866,
198,
11748,
33918,
198,
11748,
3108,
8019,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
... | 2.76 | 725 |
# coding: utf-8
# <h1>LockAcc</h1>
#
# Lock Account User Management System
#
# Script to delete, create, lock, and change passwords for users.
#
# Script runs and gives choice for input. a b c d e etc...
#
#
#
# Script to lock username. Asks for what user you want to lock, delete, create, lock or change passwo... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1279,
71,
16,
29,
25392,
17320,
3556,
71,
16,
29,
198,
2,
220,
198,
2,
13656,
10781,
11787,
8549,
4482,
198,
2,
220,
198,
2,
12327,
284,
12233,
11,
2251,
11,
5793,
11,
290,
148... | 2.512941 | 850 |
# -*- 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,
198
] | 2.842105 | 38 |
from mosaic.mosaic import Search
from env import Environment
import configuration_space
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn import svm, datasets
import numpy as np
import os
import sys
import inspect
from sklearn.linear_model import Ridg... | [
6738,
47076,
13,
76,
8546,
291,
1330,
11140,
198,
6738,
17365,
1330,
9344,
198,
11748,
8398,
62,
13200,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
... | 2.250577 | 866 |
#This program prints out data to *.dat files, for Fig. 7 in our paper
import numpy as np
from Zstats import Zdisc, Zexcl
#X-axis
dbbyb_array=np.arange(0,0.5+0.005,0.005)
#Fig 7: Discovery case [left panel]
#Y-axis
#Set signal and background means
s=24
b=10
#Calculate Asimov Z, Mean Z, Median Z
temp = np.transpos... | [
2,
1212,
1430,
20842,
503,
1366,
284,
46866,
19608,
3696,
11,
329,
12138,
13,
767,
287,
674,
3348,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1168,
34242,
1330,
1168,
15410,
11,
1168,
1069,
565,
198,
198,
2,
55,
12,
22704,
220,
... | 2.505219 | 479 |
# -*- coding: utf-8 -*-
from .data import (
CellData,
CreatureData,
LevelData,
EventData
)
from .description import (
CellDescription,
CellImpassability,
CreatureDescription,
LevelDescription
)
from .process import (
calculate_distance,
do_computer_turn,
process
)
__all__ =... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
764,
7890,
1330,
357,
198,
220,
220,
220,
12440,
6601,
11,
198,
220,
220,
220,
33248,
6601,
11,
198,
220,
220,
220,
5684,
6601,
11,
198,
220,
220,
220,
85... | 2.491071 | 224 |
#!/usr/bin/python3
# Copyright 2015 ETH Zurich
#
# 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... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
15069,
1853,
35920,
43412,
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... | 3.289796 | 490 |
__version__ = "0.7.5"
| [
834,
9641,
834,
796,
366,
15,
13,
22,
13,
20,
1,
198
] | 1.833333 | 12 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="wikibrain",
version="0.0.6",
author="Mateusz Konieczny",
author_email="matkoniecz@gmail.com",
description="Stores knowledge and data necessary to properly use links from OpenStreetMap to W... | [
11748,
900,
37623,
10141,
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,
2617,
37623,
10141,
13,
40406,
7,
198,
... | 2.573718 | 312 |
import tensorflow as tf
import cv2
import numpy as np
def Tanimoto_loss(label, pred):
"""
Implementation of Tanimoto loss in tensorflow 2.x
-------------------------------------------------------------------------
Tanimoto coefficient with dual from: Diakogiannis et al 2019 (https://arxiv.org/abs/19... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
4299,
309,
11227,
2069,
62,
22462,
7,
18242,
11,
2747,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
46333,
286,
... | 2.659597 | 943 |
import sys
import os
from django.conf import settings
BASE_DIR = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
SECRET_KEY="very_secret",
ROOT_URLCONF="main.urls",
MIDDLEWARE_CLASSES=(),
INSTALLED_APPS=(
"django.contrib.staticfiles",
"main",
),
TEMPLATES=(
... | [
11748,
25064,
198,
11748,
28686,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
33,
11159,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
8,
198,
198,
33692,
13,
11250,
495,
7,
198,
220,
220,
220,
16... | 2.103343 | 329 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-ZTF/ampel/ztf/dev/DevAlertConsumer.py
# License: BSD-3-Clause
# Author: valery brinnel <firstname.lastname@gmail.com>
# Date: 07.06.2018
# Last Modified Date: 30.07.2020
# Last Modified By: valery brin... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
9220,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1703,
30242,
12,
57,
10234,... | 2.543817 | 1,221 |
# ISSUES: Obstacles with few points should not be seen as circels
import numpy as np
import math
import copy
import time
import random
# import kml_open # Athanas'
# import path_planner_noviz # Path planner module
import gc_functions.flight_control.kml_open as kml_open
import gc_functions.flight_control.path_p... | [
2,
3180,
12564,
1546,
25,
46378,
9928,
351,
1178,
2173,
815,
407,
307,
1775,
355,
10774,
5276,
82,
628,
628,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
4866,
198,
11748,
640,
198,
11748,
4738,
628,
198,
19... | 2.239816 | 1,522 |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 18 10:02:01 2020
@brief: Control the state and speed of adiMotor
@description: Capture commands from the user, via GUI or
CLI, and translate them to serial command. Constants are
used to construct commands.
@author: Tom Sharkey
@last-modified: 2020-11-09
"""
import loggi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2447,
1248,
838,
25,
2999,
25,
486,
12131,
198,
31,
65,
3796,
25,
6779,
262,
1181,
290,
2866,
286,
512,
72,
34919,
198,
198,
31,
11213,
... | 2.493476 | 843 |
#
# Copyright 2018-2021 Lars Pastewka
# 2019 Antoine Sanner
#
# ### MIT license
#
# 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 t... | [
2,
198,
2,
15069,
2864,
12,
1238,
2481,
31239,
11303,
413,
4914,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13130,
3738,
42722,
2986,
1008,
198,
2,
198,
2,
44386,
17168,
5964,
198,
2,
198,
2,
2448,
3411,
318,
29376,... | 2.812432 | 3,652 |
from django.core.management.base import NoArgsCommand
from feedutil.templatetags.feedutil import pull_feed
from account.models import OtherServiceInfo
from django.conf import settings
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
1400,
42035,
21575,
198,
6738,
3745,
22602,
13,
11498,
489,
265,
316,
3775,
13,
12363,
22602,
1330,
2834,
62,
12363,
198,
6738,
1848,
13,
27530,
1330,
3819,
16177,
12360,
198,
673... | 3.833333 | 48 |
# coding: utf-8
# Copyright (c) Henniggroup.
# Distributed under the terms of the MIT License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
"""
uses openbabel python api to convert a smiles string represntation of
a molecule to its xyz representation
openbabel with python ... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
367,
1697,
6950,
3233,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
17168,
13789,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
11,
28000,
... | 3.038835 | 206 |
# -*- coding: utf-8 -*-
"""
msdi_io
.. date:: 2020-01-04
.. moduleauthor:: Valentin Emiya
"""
from pathlib import Path
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
msdi_path = '../data/msdi'
# Change this to configure your path to MSDI dataset
if __name__ == '__main__':
# Exemple d'uti... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
198,
907,
10989,
62,
952,
198,
198,
492,
3128,
3712,
12131,
12,
486,
12,
3023,
198,
492,
8265,
9800,
3712,
17284,
259,
2295,
21008,
198,
37811,
198,
6738,
... | 2.395683 | 417 |
from sklearn.neighbors import LocalOutlierFactor
| [
6738,
1341,
35720,
13,
710,
394,
32289,
1330,
10714,
7975,
2505,
41384,
628
] | 3.846154 | 13 |
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | [
2,
15069,
12131,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
198,
2,
220,
220,
921,
743,
... | 2.304999 | 3,941 |
#!/usr/bin/env python3
import sys
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ElementTree
input = sys.stdin
tree = ET.fromstring(input.read())
terms = tree.findall('WORD_PAIRS_DATA')
for term in terms:
print (term.attrib)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
6738,
35555,
13,
316,
631,
13,
20180,
27660,
1330,
11703,
27660,
198,
198,
15414,
796,
25064,
13,
... | 2.771739 | 92 |
from . import *
| [
6738,
764,
1330,
1635,
198
] | 3.2 | 5 |
from __future__ import unicode_literals
import pytest
import os
from datasciencebox.core import salt
from datasciencebox.core.project import Project
from datasciencebox.core.cloud.cluster import Cluster
from datasciencebox.core.cloud.instance import Instance
cluster = Cluster()
cluster.instances.append(Instance(ip=... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
28686,
198,
198,
6738,
19395,
4234,
3524,
13,
7295,
1330,
8268,
198,
6738,
19395,
4234,
3524,
13,
7295,
13,
16302,
1330,
4935,
19... | 2.128821 | 458 |
from .base import *
DEBUG = True
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': get_env_variable('PG_NAME'),
'USER': get_env_variable('PG_USER'),
'PASSWORD': get_env_variable('PG_PASSWORD'),
'HOST': os.getenv('PG_HOST', '127.0.0.1'... | [
6738,
764,
8692,
1330,
1635,
198,
198,
30531,
796,
6407,
198,
198,
2,
24047,
198,
198,
35,
1404,
6242,
1921,
1546,
796,
1391,
198,
220,
220,
220,
705,
12286,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
26808,
8881,
103... | 2.021505 | 186 |
"""
MongoDB offset storage
"""
from pymongo import MongoClient
from .base import OffsetStorage
DEFAULT_DB_NAME = "nameko_kafka_offsets"
DEFAULT_COLLECTION_NAME = "offsets"
class MongoStorage(OffsetStorage):
"""
MongoDB offset storage
:param client: MongoDB client
:param db_name: of... | [
37811,
198,
220,
220,
220,
42591,
11012,
11677,
6143,
198,
37811,
198,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
198,
6738,
764,
8692,
1330,
3242,
2617,
31425,
198,
198,
7206,
38865,
62,
11012,
62,
20608,
796,
366,
3672,
720... | 2.867089 | 158 |
# BT3051 Assignment 3a
# Roll number: BE17B007
# Collaborators: -
# Time: 10 mins
#Header information
import networkx as nx
import matplotlib.pyplot as plt
def RegularLattice(nodes, k):
""" Function that creates and plots a reguar lattice"""
#function body
G = nx.Graph()
for i in range(nodes):
G.add_node(i)
... | [
2,
22205,
1270,
4349,
50144,
513,
64,
198,
2,
8299,
1271,
25,
9348,
1558,
33,
25816,
198,
2,
37322,
2024,
25,
532,
198,
2,
3862,
25,
838,
23550,
198,
198,
2,
39681,
1321,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
2603,
29487... | 2.338843 | 242 |
import re
MIN_NAME = 0
MAX_NAME = 128
MIN_DOMAIN = 3
MAX_DOMAIN = 256
if __name__ == '__main__':
email = 'diabramo@yandex.ru'
email_checker = EmailChecker(email)
print email_checker.check_email()
| [
11748,
302,
198,
198,
23678,
62,
20608,
796,
657,
198,
22921,
62,
20608,
796,
13108,
198,
23678,
62,
39170,
29833,
796,
513,
198,
22921,
62,
39170,
29833,
796,
17759,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
... | 2.359551 | 89 |
from unittest import TestCase
from pyhearthis.models import as_query_param
from pyhearthis.hearthis_requests import LoginRequest
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
12972,
258,
283,
5661,
13,
27530,
1330,
355,
62,
22766,
62,
17143,
198,
6738,
12972,
258,
283,
5661,
13,
258,
283,
5661,
62,
8897,
3558,
1330,
23093,
18453,
628
] | 3.421053 | 38 |
#!/usr/bin/env python3
import argparse
import ast
from dataclasses import dataclass
import sys
from typing import List
groups = [ "Node", "Layout", "Draw" ]
@dataclass
@dataclass
@dataclass
@dataclass
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generates outlines for each chapte... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
6468,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
11748,
25064,
198,
6738,
19720,
1330,
7343,
198,
198,
24432,
796,
685,
366,
19667... | 2.626459 | 257 |
"""
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: Jun Zhu <jun.zhu@xfel.eu>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
from concurrent.futures import ThreadPoolExecutor
import func... | [
37811,
198,
20344,
6169,
739,
262,
2846,
286,
262,
347,
10305,
513,
12,
2601,
682,
13789,
13,
198,
198,
464,
1336,
5964,
318,
287,
262,
2393,
38559,
24290,
11,
9387,
351,
428,
3788,
13,
198,
198,
13838,
25,
7653,
33144,
1279,
29741,
... | 2.323126 | 3,135 |
import hashstate
import pytest
ALGS = {'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'}
@pytest.mark.parametrize('alg', ALGS)
| [
11748,
12234,
5219,
198,
11748,
12972,
9288,
198,
198,
1847,
14313,
796,
1391,
6,
9132,
20,
3256,
705,
26270,
16,
3256,
705,
26270,
24137,
3256,
705,
26270,
11645,
3256,
705,
26270,
22842,
3256,
705,
26270,
25836,
6,
92,
628,
198,
31,
... | 2.362069 | 58 |
import os
#listOfFiles = os.listdir(os.getcwd()+"/tabfiles")
highestT = 0.0
highestD = 0.0
highestC = 0.0
for filename in os.listdir(os.getcwd()):
if filename.endswith(".tab"):
doc = open(filename,"r")
for line in doc:
elements = line.split("\t")
tfidf = float(elements[1])
cscore = float(elements[3])
... | [
11748,
28686,
198,
198,
2,
4868,
5189,
25876,
796,
28686,
13,
4868,
15908,
7,
418,
13,
1136,
66,
16993,
3419,
10,
1,
14,
8658,
16624,
4943,
198,
198,
35323,
51,
796,
657,
13,
15,
198,
35323,
35,
796,
657,
13,
15,
198,
35323,
34,
... | 2.224 | 250 |
from simple_logger import SimpleLogger
import numpy as np
from os.path import join
import soundfile as sf
from collections import defaultdict
tmp_dir = '/home/olli/gits/music_demixing_challenge_gits/demucs/tmp'
predict_dir = '/home/olli/gits/music_demixing_challenge_gits/demucs/data/results/'
reference_dir = '/home/o... | [
6738,
2829,
62,
6404,
1362,
1330,
17427,
11187,
1362,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
11748,
2128,
7753,
355,
264,
69,
198,
6738,
17268,
1330,
4277,
11600,
628,
198,
22065,
62,
15908,
796... | 2.796919 | 714 |
# -*- coding: utf-8 -*-
from scrapy_ddiy.spiders.GlidedSky.glided_sky_003 import GlidedSky003Spider
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
15881,
88,
62,
1860,
7745,
13,
2777,
4157,
13,
9861,
1384,
22308,
13,
4743,
1384,
62,
15688,
62,
11245,
1330,
2671,
1384,
22308,
11245,
41294,
628
] | 2.463415 | 41 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def kiwishade(path):
"""Kiwi Shading Data
The `kiwishade` data frame h... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
269,
21370,
... | 2.78354 | 887 |
from django.shortcuts import render, redirect, get_object_or_404
from apps.empleados.forms import EmpleadoForm
from apps.empleados.models import Empleado
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
6725,
13,
368,
1154,
22484,
13,
23914,
1330,
2295,
1154,
4533,
8479,
198,
6738,
6725,
13,
368,
1154,
22484,
13,
27530,
133... | 3.291667 | 48 |
import sys
from PySide6.QtSvgWidgets import QSvgWidget
from PySide6.QtWebEngineCore import QWebEnginePage
from PySide6.QtWidgets import QDialog, QVBoxLayout, QPushButton
from PySide6.QtGui import QPageLayout, QPageSize
from PySide6.QtCore import Qt, QUrl, QMarginsF
from PySide6.QtWidgets import QApplication, QMainWindo... | [
11748,
25064,
198,
6738,
9485,
24819,
21,
13,
48,
83,
50,
45119,
54,
312,
11407,
1330,
1195,
50,
45119,
38300,
198,
6738,
9485,
24819,
21,
13,
48,
83,
13908,
13798,
14055,
1330,
1195,
13908,
13798,
9876,
198,
6738,
9485,
24819,
21,
13... | 2.865031 | 163 |
import torch
import numpy as np
from config.Config import data_path_conf, arg_conf
from datautil.dataloader import load_data
from vocab.Vocab import create_vocabs
from modules.bilstm_crf import BiLSTMCRF
from tagger import SequenceTagger
if __name__ == '__main__':
np.random.seed(3347)
torch.manual_seed(1234)
... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4566,
13,
16934,
1330,
1366,
62,
6978,
62,
10414,
11,
1822,
62,
10414,
198,
6738,
1366,
22602,
13,
67,
10254,
1170,
263,
1330,
3440,
62,
7890,
198,
6738,
12776,
397,
13,
53,... | 2.136919 | 818 |
import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
#procfile.txt
#web: gunicorn app:app
#first file that we have to run first : flask server name
app = Flask(__name__)
pkl_file = open('model.pkl','rb')
model = pickle.load(open('model.pkl', 'rb'))
index_dict = pickle.... | [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
11,
8543,
62,
28243,
201,
198,
11748,
2298,
293,
201,
198,
201,
198,
2,
36942,
7753,
13,
14116,
220,
201,
198,
2,
12384,
25,
2485,
291,
12... | 2.44385 | 187 |