content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from petisco import controller_handler
from taskmanager.src.modules.tasks.application.delete.delete_task_error_handle import (
delete_task_error_handler,
)
from taskmanager.src.modules.tasks.application.delete.task_remover import TaskRemover
from taskmanager.src.modules.tasks.domain.task_id import TaskId
@contro... | [
6738,
4273,
4861,
1330,
10444,
62,
30281,
198,
198,
6738,
4876,
37153,
13,
10677,
13,
18170,
13,
83,
6791,
13,
31438,
13,
33678,
13,
33678,
62,
35943,
62,
18224,
62,
28144,
1330,
357,
198,
220,
220,
220,
12233,
62,
35943,
62,
18224,
... | 3.275362 | 138 |
import tempfile
import os
import numpy
import numpy.testing
import h5py
from deeprank.tools.sparse import FLANgrid
| [
11748,
20218,
7753,
201,
198,
11748,
28686,
201,
198,
201,
198,
11748,
299,
32152,
201,
198,
11748,
299,
32152,
13,
33407,
201,
198,
11748,
289,
20,
9078,
201,
198,
201,
198,
6738,
2769,
43027,
13,
31391,
13,
82,
29572,
1330,
9977,
15... | 2.568627 | 51 |
# @file colorutils.h
# functions for color fill, paletters, blending, and more
from .FatsLED import *
from .pixeltypes import *
from fastled_progmem import *
from math import *
# @defgroup Colorutils Color utility functions
# A variety of functions for working with color, palletes, and leds
# @{
# fill_rainbo... | [
198,
2,
2488,
7753,
3124,
26791,
13,
71,
198,
2,
5499,
329,
3124,
6070,
11,
6340,
316,
1010,
11,
34863,
11,
290,
517,
198,
198,
6738,
764,
37,
1381,
30465,
1330,
1635,
198,
6738,
764,
32515,
19199,
1330,
1635,
198,
6738,
3049,
992,
... | 2.610079 | 5,219 |
# Generated by Django 3.1 on 2021-07-24 15:00
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
319,
33448,
12,
2998,
12,
1731,
1315,
25,
405,
198,
198,
11748,
6279,
3219,
13,
27530,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4... | 3.214286 | 56 |
from wdim.orm.database.base import DatabaseLayer
| [
6738,
266,
27740,
13,
579,
13,
48806,
13,
8692,
1330,
24047,
49925,
628
] | 3.846154 | 13 |
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.views.generic import View
from blog.models import Genre, Article, Comment, Contact
import re
# Create your views here.
class indexView(View):
'''首页'''
def get(self, request):
'''请求首页'''
articl... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
3582,
198,
6738,
4130,
13,
27530,
1330,
5215,
260,... | 1.968765 | 2,081 |
#!/usr/bin/python3
#
# Author: Jan Belohoubek
# Date: 09/2020
#
# Merge vectors of ngSPICE outputs.
#
import csv
# cmdline args
import argparse
parser = argparse.ArgumentParser(description='Merge vectors of ngSPICE outputs.')
parser.add_argument('-f', '--files', nargs='+', help='power trace file(s)', type=argparse.F... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
198,
2,
6434,
25,
2365,
3944,
1219,
12944,
988,
198,
2,
7536,
25,
7769,
14,
42334,
198,
2,
198,
2,
39407,
30104,
286,
23370,
4303,
8476,
23862,
13,
198,
2,
198,
198,
11748,
269,
... | 2.225108 | 924 |
from numpy.random import seed
from qiskit.chemistry.transformations import (
FermionicTransformation,
FermionicTransformationType,
FermionicQubitMappingType,
)
from qiskit.chemistry.drivers import PySCFDriver, UnitsType, Molecule
from qiskit import Aer
from qiskit.aqua import QuantumInstance, aqua_globals
... | [
6738,
299,
32152,
13,
25120,
1330,
9403,
198,
6738,
10662,
1984,
270,
13,
15245,
4592,
13,
35636,
602,
1330,
357,
198,
220,
220,
220,
376,
7780,
26523,
8291,
1161,
11,
198,
220,
220,
220,
376,
7780,
26523,
8291,
1161,
6030,
11,
198,
... | 2.462763 | 1,571 |
import datetime as dt
from functools import reduce
from itertools import groupby
from django import forms
from django.db.models import Q
from django.shortcuts import render
from django.utils.html import format_html, format_html_join
from django.utils.text import capfirst
from django.utils.translation import gettext_la... | [
11748,
4818,
8079,
355,
288,
83,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
340,
861,
10141,
1330,
1448,
1525,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625... | 3.280182 | 439 |
import pathlib
from lxml import etree
import requests
import pytest
from ..pmc_oai import get_sets_for_pmcid, extract_authors_from_article
directory = pathlib.Path(__file__).parent
pcmid_to_authors = dict()
pcmid_to_authors["PMC65048"] = [
{
"pmcid": "PMC65048",
"position": 1,
"fore... | [
11748,
3108,
8019,
198,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
11748,
7007,
198,
11748,
12972,
9288,
198,
198,
6738,
11485,
4426,
66,
62,
78,
1872,
1330,
651,
62,
28709,
62,
1640,
62,
4426,
66,
312,
11,
7925,
62,
41617,
62,
67... | 2.28877 | 3,553 |
from marshmallow import validates_schema, validate
from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Relationship
from app.api.helpers.exceptions import UnprocessableEntity
from app.api.helpers.utilities import dasherize
from app.api.schema.base import SoftDeletionSchema
from app.models.spea... | [
6738,
22397,
42725,
1330,
4938,
689,
62,
15952,
2611,
11,
26571,
198,
6738,
22397,
42725,
62,
17752,
15042,
1330,
7032,
198,
6738,
22397,
42725,
62,
17752,
15042,
13,
2704,
2093,
1330,
39771,
198,
198,
6738,
598,
13,
15042,
13,
16794,
3... | 2.2944 | 625 |
estCondicional02()
| [
395,
25559,
291,
1538,
2999,
3419,
198
] | 2.714286 | 7 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198
] | 3.551724 | 29 |
'''
Python mapping for the InstantMessage framework.
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import sys
import objc
import Foundation
import Quartz
from InstantMessage import _metadata
sys.modules['InstantMes... | [
7061,
6,
198,
37906,
16855,
329,
262,
24470,
12837,
9355,
13,
198,
198,
1212,
8265,
857,
407,
3994,
2205,
37336,
329,
262,
12908,
2438,
11,
2198,
4196,
338,
198,
22897,
341,
329,
3307,
319,
703,
284,
779,
777,
5499,
290,
6097,
13,
1... | 3.118644 | 236 |
"""User Services."""
from typing import List
from sqlalchemy.orm import Session
from ..entities.user import User, UserId, UserRegister, UserSignIn
from ..interfaces.db import user_db_handler
| [
37811,
12982,
6168,
526,
15931,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
23575,
198,
198,
6738,
11485,
298,
871,
13,
7220,
1330,
11787,
11,
11787,
7390,
11,
11787,
38804,
11,
11787,
11712,
818,
198... | 3.465517 | 58 |
import time
import torch.nn as nn
import math
import torch
import numpy as np
from pytorchltr.evaluation import ndcg
from meta_learn.models import NeuralNetwork
from meta_learn.abstract import RegressionModelMetaLearned
from meta_learn.util import DummyLRScheduler, _handle_input_dimensionality
from config import devi... | [
11748,
640,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
10688,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12972,
13165,
354,
75,
2213,
13,
18206,
2288,
1330,
299,
17896,
70,
198,
198,
6738,
13634,
62,
... | 2.345345 | 666 |
import json
import os
import codecs
import gzip
from argparse import ArgumentParser
if __name__ == '__main__':
# python export_raw_data.py -i ../../mydig-projects/rss_project/data -o /tmp/rss_export.jl.gz --gzip
parser = ArgumentParser()
parser.add_argument("-i", "--src", action="store", type=str, dest="sr... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
40481,
82,
198,
11748,
308,
13344,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1303,
21015,
10784,
62,
... | 2.154601 | 815 |
import numpy as np
import scipy.stats
from scipy.optimize import curve_fit
from sklearn.metrics import mean_squared_error
def compute_metrics(y_pred, y):
'''
compute metrics btw predictions & labels
'''
# compute SRCC & KRCC
SRCC = scipy.stats.spearmanr(y, y_pred)[0]
try:
KRCC = scipy.... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
34242,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330,
12133,
62,
11147,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
1612,
62,
16485,
1144,
62,
18224,
628,
198,
4299,
240... | 2.158163 | 392 |
import json
import boto3
import time
import calendar
import os
import sys
import logging
import traceback
from datetime import datetime
def lambda_handler(event, context):
"""
This function triggers from an S3 event source when a manifest file
for a new product update is put in the Manifes... | [
11748,
33918,
201,
198,
11748,
275,
2069,
18,
201,
198,
11748,
640,
201,
198,
11748,
11845,
201,
198,
11748,
28686,
201,
198,
11748,
25064,
201,
198,
11748,
18931,
201,
198,
11748,
12854,
1891,
201,
198,
201,
198,
6738,
4818,
8079,
1330... | 1.965938 | 2,789 |
import abc
from OutputMgr import OutputMgr
import numpy as np
| [
11748,
450,
66,
198,
6738,
25235,
44,
2164,
1330,
25235,
44,
2164,
198,
11748,
299,
32152,
355,
45941,
628
] | 3.315789 | 19 |
from ..input_action import InputAction
| [
6738,
11485,
15414,
62,
2673,
1330,
23412,
12502,
198
] | 4.333333 | 9 |
import json
import sqlite3
from collections import defaultdict
| [
11748,
33918,
198,
11748,
44161,
578,
18,
198,
198,
6738,
17268,
1330,
4277,
11600,
628
] | 4.333333 | 15 |
from corehq.apps.groups.tests import WrapGroupTestMixin
from corehq.apps.locations.models import Location, LocationType, SQLLocation
from corehq.apps.locations.tests.util import make_loc
from corehq.apps.commtrack.helpers import make_supply_point, make_product
from corehq.apps.commtrack.tests.util import bootstrap_loca... | [
6738,
4755,
71,
80,
13,
18211,
13,
24432,
13,
41989,
1330,
41028,
13247,
14402,
35608,
259,
198,
6738,
4755,
71,
80,
13,
18211,
13,
17946,
602,
13,
27530,
1330,
13397,
11,
13397,
6030,
11,
49747,
3069,
5040,
198,
6738,
4755,
71,
80,
... | 3.354037 | 161 |
#
# PySNMP MIB module CISCO-TCPOFFLOAD-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-TCPOFFLOAD-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:57:39 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
36159,
8220,
12,
4825,
16402,
37,
3697,
41048,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
1... | 2.633547 | 2,647 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
import test_full.models as models_module
from computedfields.models import ComputedFieldsModelType
MODELS = models_module.MODELS
class GenericModelTestBase(TestCase):
"""
Test base class to provide a customizable ... | [
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,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
11748,
1332,
62,
12853,
13,
27530,
355,
4981,
62,
... | 2.561528 | 707 |
"""
TODO: add docstring
------------------------------------------------------------------------------
COPYRIGHT/LICENSE. This file is part of the XYZ package. It is subject
to the license terms in the LICENSE file found in the top-level directory of
this distribution. No part of the XYZ package, including this fil... | [
37811,
198,
51,
3727,
46,
25,
751,
2205,
8841,
198,
198,
10097,
26171,
198,
34,
3185,
38162,
9947,
14,
43,
2149,
24290,
13,
220,
770,
2393,
318,
636,
286,
262,
41420,
57,
5301,
13,
220,
632,
318,
2426,
198,
1462,
262,
5964,
2846,
... | 4.769784 | 139 |
""" Default views for Catalog."""
import logging
import django_rq
from django.utils.translation import gettext_lazy as _
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework_extensions.mixins import NestedViewSetMixin
from... | [
37811,
15161,
5009,
329,
44515,
526,
15931,
198,
198,
11748,
18931,
198,
198,
11748,
42625,
14208,
62,
81,
80,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
42625,
14208,
13,
19509,... | 2.345552 | 8,184 |
# Copyright 2020 TerraPower, 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 in writi... | [
2,
15069,
12131,
24118,
13434,
11,
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,
9... | 3.493036 | 359 |
# _*_ coding: utf-8 _*_
"""
Author: Kwong
Create time: 2020/10/22 18:32
""" | [
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
37811,
198,
220,
220,
220,
6434,
25,
31767,
506,
198,
220,
220,
220,
13610,
640,
25,
12131,
14,
940,
14,
1828,
1248,
25,
2624,
220,
198,
37811
] | 2.04878 | 41 |
x = int(input())
y = int(input())
tab = [list(map(int, input().split())) for i in range(y)]
for ix in range(1, x):
for iy in range(1, y):
if tab[iy][ix] == 1:
tab[iy][ix] = min(tab[iy][ix - 1], tab[iy - 1][ix], tab[iy - 1][ix - 1]) + 1
for jy in range(0, y):
for jx in range(0, x):
... | [
198,
198,
87,
796,
493,
7,
15414,
28955,
198,
88,
796,
493,
7,
15414,
28955,
198,
8658,
796,
685,
4868,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008,
329,
1312,
287,
2837,
7,
88,
15437,
198,
1640,
220,
844,
287,
2837,
7,
... | 1.958763 | 194 |
"""
Description:
Download tweets using tweet ID, downloaded from https://noisy-text.github.io/files/tweet_downloader.py
Usage example (in linux):
clear;python tweet_downloader.py --credentials ../data/credentials.txt --inputfile ../data/input.tids --outputtype IdTweetTok
Inputfile contains training/validatio... | [
37811,
198,
11828,
25,
220,
198,
220,
220,
220,
10472,
12665,
1262,
6126,
4522,
11,
15680,
422,
3740,
1378,
3919,
13560,
12,
5239,
13,
12567,
13,
952,
14,
16624,
14,
83,
7277,
62,
15002,
263,
13,
9078,
198,
198,
28350,
1672,
357,
25... | 2.887972 | 848 |
__version__ = '0.1.12-dev2'
from saffy.SignalManager import SignalManager
from saffy.plugins.PluginManager import PluginManager
from saffy.generators import *
| [
834,
9641,
834,
796,
705,
15,
13,
16,
13,
1065,
12,
7959,
17,
6,
198,
198,
6738,
473,
487,
88,
13,
11712,
282,
13511,
1330,
26484,
13511,
198,
6738,
473,
487,
88,
13,
37390,
13,
37233,
13511,
1330,
42636,
13511,
198,
6738,
473,
48... | 3.137255 | 51 |
# -*- coding: utf-8 -*-
# CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL).
# Copyright 2017-2020 UKRI-STFC
# Copyright 2017-2020 University of Manchester
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
220,
37963,
287,
4186,
6826,
48656,
357,
4093,
38729,
8,
7231,
48656,
10074,
357,
34,
4146,
737,
198,
198,
2,
220,
220,
15069,
2177,
12,
42334,
3482,
7112,
12,
2257... | 2.387026 | 1,819 |
REGULAR_DICT = {
"m": "м",
"e": "е",
'̩': "",
"l": "л",
'ɪ': "и",
"s": "с",
"f": "ф",
"n": "н",
"t": "т",
"i": "и",
"p": "п",
"k": "к",
"ɔ": "о",
"o": "о",
"ɑ": "о",
"d": "д",
"ɡ": "г",
"ɛ": "е",
"z": "з",
"ŋ": "нг",
"v": "в",
"b": ... | [
31553,
37232,
62,
35,
18379,
796,
1391,
198,
220,
220,
220,
366,
76,
1298,
366,
43108,
1600,
198,
220,
220,
220,
366,
68,
1298,
366,
16843,
1600,
198,
220,
220,
220,
705,
136,
102,
10354,
366,
1600,
198,
220,
220,
220,
366,
75,
12... | 1.382728 | 3,057 |
"""
Minimum Domino version supported by this python-domino library
"""
MINIMUM_SUPPORTED_DOMINO_VERSION = '4.1.0'
"""
Environment variable names used by this python-domino library
"""
DOMINO_TOKEN_FILE_KEY_NAME = 'DOMINO_TOKEN_FILE'
DOMINO_USER_API_KEY_KEY_NAME = 'DOMINO_USER_API_KEY'
DOMINO_HOST_KEY_NAME = 'DOMINO_A... | [
37811,
198,
44046,
9666,
2879,
2196,
4855,
416,
428,
21015,
12,
3438,
2879,
5888,
198,
37811,
198,
198,
23678,
3955,
5883,
62,
40331,
15490,
1961,
62,
39170,
46016,
62,
43717,
796,
705,
19,
13,
16,
13,
15,
6,
198,
198,
37811,
198,
3... | 2.696721 | 122 |
import uuid
from datetime import datetime
from flask import jsonify
MEETUPS = [{
"meetup_id":"vsv354",
"meetup_topic":"Python ML",
"created_on":datetime.now(),
"meetup_venue":"iHub",
"meetup_details":"python machine learning meetup",
... | [
11748,
334,
27112,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
42903,
1330,
33918,
1958,
198,
198,
11682,
2767,
52,
3705,
796,
685,
90,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
477... | 1.890208 | 1,011 |
import scipy.io as sio
from torch.utils.data import TensorDataset, DataLoader
import numpy as np
# from model import locNN
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import matplotlib.pyplot as plt
import math
# 3x3 Convolution
# Residual Bloc... | [
11748,
629,
541,
88,
13,
952,
355,
264,
952,
201,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
309,
22854,
27354,
292,
316,
11,
6060,
17401,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
2,
422,
2746,
1330,
1179,
6144,
201,
198... | 2.637037 | 135 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import logging
import sys
import os
import numpy as np
from inferbeddings.io import read_triples
from inferbeddings.knowledgebase import Fact, KnowledgeBaseParser
from inferbeddings import evaluation
logger = logging.getLogger(os.path.basename(sys.ar... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
... | 2.789474 | 152 |
#!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
from fontmerger import VERSION
setup(name='fontmerger',
version=VERSION,
description='merging font tools',
author='Internet Initiative Japan Inc',
license='MIT',
author_email='yosinobu@iij.ad.jp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
198,
198,
6738,
10369,
647,
1362,
1330,
44156,
2849,
198,
198,
40406,
7,
3672,
1... | 2.492248 | 258 |
import pytest
import uuid
from calm.dsl.cli.main import get_api_client
from calm.dsl.cli.constants import RUNLOG
from calm.dsl.config import get_context
from tests.api_interface.test_runbooks.test_files.exec_task import (
EscriptTask,
SetVariableOnEscript,
EscriptOnEndpoint,
PowershellTask,
SetVari... | [
11748,
12972,
9288,
198,
11748,
334,
27112,
198,
198,
6738,
9480,
13,
67,
6649,
13,
44506,
13,
12417,
1330,
651,
62,
15042,
62,
16366,
198,
6738,
9480,
13,
67,
6649,
13,
44506,
13,
9979,
1187,
1330,
32494,
25294,
198,
6738,
9480,
13,
... | 2.741803 | 244 |
import numpy as np
from scipy.spatial import distance
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import KFold
class RBML:
"""
The Default constructor method.
:param a: alfa value
:param b: beta value
:param k: nearest neigbour value
:param dataset: name of ... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
2777,
34961,
1330,
5253,
198,
6738,
1341,
35720,
13,
710,
394,
32289,
1330,
509,
46445,
32289,
9487,
7483,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
509,
37,
727,
6... | 2.991667 | 120 |
"""Implementation of Rule L011."""
from sqlfluff.core.rules.base import BaseRule, LintResult, LintFix
from sqlfluff.core.rules.doc_decorators import document_fix_compatible
@document_fix_compatible
class Rule_L011(BaseRule):
"""Implicit aliasing of table not allowed. Use explicit `AS` clause.
| **Anti-patte... | [
37811,
3546,
32851,
286,
14330,
406,
28555,
526,
15931,
198,
198,
6738,
19862,
1652,
75,
1648,
13,
7295,
13,
38785,
13,
8692,
1330,
7308,
31929,
11,
406,
600,
23004,
11,
406,
600,
22743,
198,
6738,
19862,
1652,
75,
1648,
13,
7295,
13,... | 2.126774 | 1,057 |
import time # for timing
from math import sqrt, tan, sin, cos, pi, ceil, floor, acos, atan, asin, degrees, radians, log, atan2, acos, asin
from random import *
from numpy import *
from pymclevel import alphaMaterials, MCSchematic, MCLevel, BoundingBox
from mcplatform import *
import utilityFunctions as utilityFunction... | [
11748,
640,
1303,
329,
10576,
198,
6738,
10688,
1330,
19862,
17034,
11,
25706,
11,
7813,
11,
8615,
11,
31028,
11,
2906,
346,
11,
4314,
11,
936,
418,
11,
379,
272,
11,
355,
259,
11,
7370,
11,
2511,
1547,
11,
2604,
11,
379,
272,
17,... | 3.201923 | 208 |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/03_datasets.protein_dataset.ipynb (unless otherwise specified).
__all__ = ['ProteinDataset', 'ProteinTestDataset']
# Cell
import os
from pathlib import Path
import numpy as np
import cv2
from torch.utils.data.dataset import Dataset
from ..utils.common_util import *
imp... | [
2,
47044,
7730,
1677,
1137,
11617,
0,
8410,
5626,
48483,
0,
9220,
284,
4370,
25,
299,
1443,
14,
3070,
62,
19608,
292,
1039,
13,
48693,
62,
19608,
292,
316,
13,
541,
2047,
65,
357,
25252,
4306,
7368,
737,
198,
198,
834,
439,
834,
7... | 2.968354 | 158 |
import sys
from mopidy import audio, settings
from mopidy.utils.path import path_to_uri
from tests import unittest, path_to_data_dir
@unittest.skipIf(sys.platform == 'win32',
'Our Windows build server does not support GStreamer yet')
| [
11748,
25064,
198,
198,
6738,
285,
404,
19325,
1330,
6597,
11,
6460,
198,
6738,
285,
404,
19325,
13,
26791,
13,
6978,
1330,
3108,
62,
1462,
62,
9900,
198,
198,
6738,
5254,
1330,
555,
715,
395,
11,
3108,
62,
1462,
62,
7890,
62,
15908... | 3.102564 | 78 |
"""
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.networks.base_network import BaseNetwork
from models.networks.nor... | [
37811,
198,
15269,
357,
34,
8,
13130,
15127,
10501,
13,
220,
1439,
2489,
10395,
13,
198,
26656,
15385,
739,
262,
12624,
11050,
12,
7792,
12,
4090,
604,
13,
15,
5964,
357,
5450,
1378,
20123,
425,
9503,
684,
13,
2398,
14,
677,
4541,
1... | 2.612523 | 1,102 |
#!/usr/bin/env python
################################################################################
# lidar2dems - utilties for creating DEMs from LiDAR data
#
# AUTHOR: Matthew Hanson, matt.a.hanson@gmail.com
#
# Copyright (C) 2015 Applied Geosolutions LLC, oss@appliedgeosolutions.com
#
# Redistribution and... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
29113,
29113,
14468,
198,
2,
220,
220,
19789,
283,
17,
67,
5232,
532,
3384,
2326,
444,
329,
4441,
40101,
82,
422,
7455,
35,
1503,
1366,
198,
2,
198,
2,
220,
220,
44746,
25,
9308,
3... | 2.796884 | 1,733 |
# Software developed by Pieter W.G. Bots for the PrESTO project
# Code repository: https://github.com/pwgbots/presto
# Project wiki: http://presto.tudelft.nl/wiki
"""
Copyright (c) 2019 Delft University of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and ass... | [
2,
10442,
4166,
416,
36548,
263,
370,
13,
38,
13,
40946,
329,
262,
1736,
6465,
46,
1628,
198,
2,
6127,
16099,
25,
3740,
1378,
12567,
13,
785,
14,
79,
86,
22296,
1747,
14,
79,
2118,
78,
198,
2,
4935,
22719,
25,
2638,
1378,
79,
21... | 3.280911 | 922 |
from metaL import *
mod = thisModule()
mod.TITLE = 'embedded Rust sample for stm32f130 blue pill'
mod.ABOUT = """"""
sync()
| [
198,
6738,
13634,
43,
1330,
1635,
628,
198,
198,
4666,
796,
428,
26796,
3419,
198,
4666,
13,
49560,
2538,
796,
705,
20521,
9395,
17103,
6291,
329,
336,
76,
2624,
69,
12952,
4171,
9582,
6,
198,
4666,
13,
6242,
12425,
796,
13538,
15931,... | 2.6875 | 48 |
import pytest
from app.catalog.domain.category import Category
from app.catalog.domain.product import Product
@pytest.fixture(scope='function')
| [
11748,
12972,
9288,
198,
6738,
598,
13,
9246,
11794,
13,
27830,
13,
22872,
1330,
21743,
198,
6738,
598,
13,
9246,
11794,
13,
27830,
13,
11167,
1330,
8721,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
11639,
8818,
11537,
628
] | 3.585366 | 41 |
# @Time : 2018-9-10
# @Author : zxh
import logging
from zutils.utils import relative_project_path
import os
| [
2,
2488,
7575,
220,
220,
1058,
2864,
12,
24,
12,
940,
198,
2,
2488,
13838,
1058,
1976,
87,
71,
198,
11748,
18931,
198,
6738,
1976,
26791,
13,
26791,
1330,
3585,
62,
16302,
62,
6978,
198,
11748,
28686,
628
] | 2.921053 | 38 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from raspiot.raspiot import RaspIotRenderer
from raspiot.utils import InvalidParameter, CommandError, MissingParameter
from raspiot.profiles import SmsProfile
import urllib
__all__ = ['Bulksms']
class Bulksms(RaspIotRenderer):
"""
BulkSms modu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
220,
220,
220,
220,
198,
11748,
18931,
198,
6738,
374,
5126,
5151,
13,
81,
5126,
5151,
1330,
371,
5126,
40,
313,
49,
... | 2.15762 | 3,261 |
import pytest
import random
import session7
import os
import inspect
import re
import test_session7
README_CONTENT_CHECK_FOR = [
'list',
'comprehensions',
'map',
'filter',
'zip',
'lambda',
'operator',
'partial',
'reduce'
]
CHECK_FOR_THINGS_NOT_ALLOWED = []
| [
11748,
12972,
9288,
198,
11748,
4738,
198,
11748,
6246,
22,
198,
11748,
28686,
198,
11748,
10104,
198,
11748,
302,
198,
11748,
1332,
62,
29891,
22,
198,
198,
15675,
11682,
62,
37815,
3525,
62,
50084,
62,
13775,
796,
685,
198,
220,
220,
... | 2.362963 | 135 |
import os
import subprocess
import sys
from pyshark.tshark.tshark import get_tshark_path
from pyshark.tshark.tshark_xml import packet_from_xml_packet, psml_structure_from_xml
class Capture(object):
"""
Base class for packet captures.
"""
SUPPORTED_ENCRYPTION_STANDARDS=('wep', 'wpa-pwd', 'wpa-psk')
... | [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
6738,
279,
893,
71,
668,
13,
912,
71,
668,
13,
912,
71,
668,
1330,
651,
62,
912,
71,
668,
62,
6978,
198,
6738,
279,
893,
71,
668,
13,
912,
71,
668,
13,
912,
71,
668,
... | 2.067292 | 2,452 |
import time #スリープ関数用.必須じゃない.
import RPi.GPIO as GPIO #GPIO用のライブラリ
PIN = 4 # サーボモータの信号線を接続したGPIO番号の設定
GPIO.setmode(GPIO.BCM) # ポート番号の指定方法をGPIO番号に指定
GPIO.setup(PIN, GPIO.OUT) # GPIOを出力に設定
servo = GPIO.PWM(PIN, 50) # PWMの周波数を50に設定
servo.start(3.0) # PWMのデューティー比を2.5で開始
if __name__ == '__main__':
main... | [
11748,
640,
1303,
8943,
12675,
12045,
245,
38461,
95,
46763,
108,
18796,
101,
171,
120,
236,
33232,
227,
165,
254,
230,
2515,
246,
1792,
225,
26945,
18566,
171,
120,
236,
198,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
1303,
... | 1.277778 | 252 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Title : 身份证生成器
@File : idcard_generate_request_vo.py
@Author : vincent
@Time : 2021/4/23 下午5:37
@Version : 1.0
"""
from app.main.app.vo.request.base_request_vo import ImageBaseRequest
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
19160,
220,
220,
1058,
5525,
118,
104,
20015,
121,
46237,
223,
37955,
22755,
238,
161,
247,
101,
198,
... | 2.015873 | 126 |
from tellify.tellify import Tellify
# from pytest_redis import factories
from tellify.tests.plugins.plug1 import Plug1, Plug1_events, Plug1_alarms
| [
6738,
1560,
1958,
13,
33331,
1958,
1330,
14026,
1958,
198,
2,
422,
12972,
9288,
62,
445,
271,
1330,
17590,
198,
6738,
1560,
1958,
13,
41989,
13,
37390,
13,
16875,
16,
1330,
22689,
16,
11,
22689,
16,
62,
31534,
11,
22689,
16,
62,
282... | 3.288889 | 45 |
import time
import jana
jana.SetTicker( False )
jana.WaitUntilAllThreadsRunning()
for i in range(0,20):
time.sleep(1)
print '\nCalled jana.GetNeventsProcessed: %d' % jana.GetNeventsProcessed()
| [
198,
198,
11748,
640,
198,
11748,
474,
2271,
198,
198,
73,
2271,
13,
7248,
51,
15799,
7,
10352,
1267,
198,
73,
2271,
13,
21321,
18273,
3237,
16818,
82,
28768,
3419,
198,
198,
1640,
1312,
287,
2837,
7,
15,
11,
1238,
2599,
198,
197,
... | 2.4875 | 80 |
name = 'argus'
host = '0.0.0.0'
port = 8033
#default_action = 'test_exec'
default_action = 'run'
# hook aciton:
# init_action : App start run
# before_action : Action run before run
# after_action : Action run after run
# del_action : App stop run
# If someone violently cracks your password
# alarm_a... | [
3672,
796,
705,
853,
385,
6,
198,
4774,
796,
705,
15,
13,
15,
13,
15,
13,
15,
6,
198,
634,
796,
4019,
2091,
198,
198,
2,
12286,
62,
2673,
796,
705,
9288,
62,
18558,
6,
198,
12286,
62,
2673,
796,
705,
5143,
6,
198,
198,
2,
80... | 2.411491 | 644 |
from .resnet import ResNet, resnet18, resnet34, resnet50, resnet101, resnet152, Bottleneck
from .xception import Xception, xception39 | [
6738,
764,
411,
3262,
1330,
1874,
7934,
11,
581,
3262,
1507,
11,
581,
3262,
2682,
11,
581,
3262,
1120,
11,
581,
3262,
8784,
11,
581,
3262,
17827,
11,
14835,
43163,
198,
6738,
764,
87,
4516,
1330,
1395,
4516,
11,
2124,
4516,
2670
] | 3.166667 | 42 |
# coding: utf-8
import pprint
import six
from enum import Enum
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
279,
4798,
198,
11748,
2237,
198,
6738,
33829,
1330,
2039,
388,
628,
198
] | 2.954545 | 22 |
from collections import OrderedDict
from .states import DefaultState, GoingState, StoppedState, StoppingState
from lewis.devices import StateMachineDevice
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
764,
27219,
1330,
15161,
9012,
11,
19219,
9012,
11,
22025,
1496,
9012,
11,
22025,
2105,
9012,
198,
6738,
443,
86,
271,
13,
42034,
1330,
1812,
37573,
24728,
628,
198
] | 4.131579 | 38 |
# greet("maria")
greet("pesho")
greet("ivan")
greet("stoyan")
greet("asen")
| [
628,
628,
198,
198,
2,
12589,
7203,
3876,
544,
4943,
628,
198,
70,
2871,
7203,
79,
5069,
78,
4943,
628,
198,
198,
70,
2871,
7203,
13809,
4943,
198,
70,
2871,
7203,
301,
726,
272,
4943,
198,
70,
2871,
7203,
292,
268,
4943,
198
] | 2.023256 | 43 |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import os
from datetime import datetime
from scrapy.exporters import CsvItemExporter
from vehicle_scraping import items
| [
2,
2896,
500,
534,
2378,
31108,
994,
198,
2,
198,
2,
2094,
470,
6044,
284,
751,
534,
11523,
284,
262,
7283,
3620,
62,
47,
4061,
3698,
1268,
1546,
4634,
198,
2,
4091,
25,
3740,
1378,
31628,
13,
1416,
2416,
88,
13,
2398,
14,
268,
... | 3.163043 | 92 |
import osmnx as ox
import networkx as nx
import copy
import os
import pickle
import igraph as ig
from random import sample
import matplotlib.cm as cm
import matplotlib.colors as colors
n_drivers = 100
equilibrium_steps = 20
c_traffic = 0.1
weight = 'length'
MAP_NAME='./map.pkl'
G = load_map(MAP_NAME)
starts = sample... | [
11748,
267,
5796,
77,
87,
355,
12018,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
4866,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
45329,
1470,
355,
45329,
198,
6738,
4738,
1330,
6291,
198,
11748,
2603,
29487,
8019,
13,
... | 2.063567 | 1,054 |
from qgoptax.optimizers.base_optimizer import Optimizer
from qgoptax.optimizers.utils import Manifold
from typing import Tuple, Union
import jax.numpy as jnp
class RSGD(Optimizer):
"""Riemannian gradient descent and gradient descent with momentum
optimizers.
Args:
manifold: object of the class Ma... | [
6738,
10662,
70,
8738,
897,
13,
40085,
11341,
13,
8692,
62,
40085,
7509,
1330,
30011,
7509,
198,
6738,
10662,
70,
8738,
897,
13,
40085,
11341,
13,
26791,
1330,
1869,
361,
727,
198,
6738,
19720,
1330,
309,
29291,
11,
4479,
198,
11748,
... | 2.884211 | 190 |
"""'Standard django models."""
from django.db import models
# Create your models here.
class Data(models.Model):
"""Example data for the demo app"""
name = models.CharField(max_length=100)
| [
15931,
30543,
23615,
42625,
14208,
4981,
526,
15931,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
4871,
6060,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
16281,
1366,
329,
262,
... | 3.209677 | 62 |
# -*- coding: utf-8 -*-
# Col1: " Virrib Avg;",
# Col2: " RH Avg;",
# Col3: " Vbatt Avg;",
# Col4: " EC5 Avg;",
# Col5: " TA Avg;",
# Col6: " RG Avg;",
# Col7: "TAin Avg;",
# Col8: "TAin Avg;"
#"10:56:00 27.05.2016"
# {
# 6: [u'12:42:00 27.05.2016', 20.613, 34.844, 8.791, 0.964, 28.284],
# 7: [u'14:00:... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
1623,
16,
25,
366,
16310,
822,
33455,
26,
1600,
201,
198,
2,
1623,
17,
25,
366,
35662,
33455,
26,
1600,
201,
198,
2,
1623,
18,
25,
366,
569,
65,
1078,
3345... | 2.140172 | 2,447 |
import pdb
import copy
from signjoey.vocabulary import BOS_ID, EOS_ID, PAD_ID
import utils
import torch
import types
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from modules.criterions import SeqKD
from modules.embeddings import WordEmbedding
from modules... | [
11748,
279,
9945,
198,
11748,
4866,
198,
6738,
1051,
73,
2577,
88,
13,
18893,
22528,
1330,
347,
2640,
62,
2389,
11,
412,
2640,
62,
2389,
11,
350,
2885,
62,
2389,
198,
11748,
3384,
4487,
198,
11748,
28034,
198,
11748,
3858,
198,
11748,... | 2.371951 | 820 |
#> \author Elias Ghadam Soltani
#> \brief This is an example program to solve a diffusion equation using OpenCMISS calls.
#>
#> \section LICENSE
#>
#> Version: MPL 1.1/GPL 2.0/LGPL 2.1
#>
#> The contents of this file are subject to the Mozilla Public License
#> Version 1.1 (the "License"); you may not use this file exc... | [
2,
29,
3467,
9800,
41462,
11972,
324,
321,
4294,
83,
3216,
198,
2,
29,
3467,
65,
3796,
770,
318,
281,
1672,
1430,
284,
8494,
257,
44258,
16022,
1262,
4946,
24187,
16744,
3848,
13,
198,
2,
29,
198,
2,
29,
3467,
5458,
38559,
24290,
... | 3.66913 | 7,036 |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 2 15:28:26 2018
@author: YudongCai
@Email: yudongcai216@gmail.com
last change: Fri Jul 30 11:23:36 2021
"""
import click
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matp... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
8621,
220,
362,
1315,
25,
2078,
25,
2075,
2864,
198,
198,
31,
9800,
25,
575,
463,
506,
34,
1872,
198,
198,
31,
15333,
25,
331,
463,
506... | 1.839943 | 706 |
import sys
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import dates
plt.style.use("ggplot")
csv_filepath = sys.argv[1]
day_of_interest = sys.argv[2]
df = pd.read_csv(
csv_filepath,
index_col=["commit_time_iso8601"],
parse_dates=["commit_time_iso8601"],
date_parser=lambda col: ... | [
11748,
25064,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
1330,
9667,
198,
198,
489,
83,
13,
7635,
13,
1904,
7203,
1130,
29487,
4943,
198,
198,
4066... | 2.625177 | 707 |
import hashlib
import logging
import os
import parted
import shlex
import shutil
import socket
import subprocess
import tempfile
import time
from config.config import *
class FdDevice:
'''Actions pertaining to particular devices'''
def mount_device(self, **kwargs):
'''Mount device on a tempdir, and r... | [
11748,
12234,
8019,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
37813,
198,
11748,
427,
2588,
198,
11748,
4423,
346,
198,
11748,
17802,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
11748,
640,
198,
198,
6738,
4566,
13,
1125... | 2.017351 | 5,014 |
__author__ = 'dorthyluu'
import unittest
import ast
from ctree.transformations import PyBasicConversions
from ctree.c.nodes import Array
| [
834,
9800,
834,
796,
705,
67,
18906,
2290,
84,
6,
198,
198,
11748,
555,
715,
395,
198,
11748,
6468,
198,
6738,
269,
21048,
13,
35636,
602,
1330,
9485,
26416,
3103,
47178,
198,
6738,
269,
21048,
13,
66,
13,
77,
4147,
1330,
15690,
198... | 3.209302 | 43 |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
| [
2,
24700,
1137,
11617,
11050,
509,
2662,
6981,
26144,
532,
8410,
5626,
48483,
198,
11748,
479,
296,
392,
198,
11748,
33918,
628,
220,
220,
220,
220,
198,
220,
220,
220,
220,
628
] | 2.4375 | 32 |
version = '1.39.13'
| [
9641,
796,
705,
16,
13,
2670,
13,
1485,
6,
198
] | 2 | 10 |
from onegov.core.security import Public
from onegov.org.views.homepage import view_org
from onegov.town6 import TownApp
from onegov.org.models import Organisation
from onegov.town6.layout import DefaultLayout
@TownApp.html(model=Organisation, template='homepage.pt', permission=Public)
| [
6738,
530,
9567,
13,
7295,
13,
12961,
1330,
5094,
198,
6738,
530,
9567,
13,
2398,
13,
33571,
13,
11195,
7700,
1330,
1570,
62,
2398,
198,
6738,
530,
9567,
13,
12735,
21,
1330,
8329,
4677,
198,
6738,
530,
9567,
13,
2398,
13,
27530,
13... | 3.555556 | 81 |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 00:33:30 2015
@author: victor
"""
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
#AlimPeq SPEA2
h = [789.0283169096577, 1070.7784075140216, 197.09732042268442, 1068.4364634050626, 983.076513128277, 661.0814728954969, 147.74010801145826, ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
8621,
220,
352,
3571,
25,
2091,
25,
1270,
1853,
198,
198,
31,
9800,
25,
2210,
273,
198,
37811,
198,
11748,
2603,
29487,
8019,
13,
9078,
... | 2.242876 | 19,335 |
"""
This file contains the base DataSource class, and all sub classes that implement their own methods for parsing data.
"""
import json
# data_source will extend this
# a json file data source first reads json from the file given, and then provides methods to navigate it and select fields
# used for chaining jso... | [
37811,
198,
198,
1212,
2393,
4909,
262,
2779,
6060,
7416,
1398,
11,
290,
477,
850,
6097,
326,
3494,
511,
898,
5050,
329,
32096,
1366,
13,
198,
198,
37811,
198,
198,
11748,
33918,
198,
198,
2,
1366,
62,
10459,
481,
9117,
428,
198,
19... | 4.258065 | 124 |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org, https://github.com/cloudedbats
# Copyright (c) 2020-present Arnold Andreasson
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import asyncio
import os
import datetime
import pathlib
class WurbSettings(object)... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
4935,
25,
2638,
1378,
17721,
276,
50199,
13,
2398,
11,
3740,
1378,
12567,
13,
785,
14,
17721,
276,
50199,
198,
2,
15069,... | 2.000238 | 8,389 |
import socket
PORT = 50002
files = {
"File1" : "The quick brown fox jumped over the lazy dogs" ,
"File2" : "If a woodchuck could chuck wood" ,
"File3" : "Now you're just showing off" ,
}
for i in files:
s = socket.socket(socket.AF_INET , socket.SOCK_STREAM)
s.connect(('127.0.... | [
11748,
17802,
198,
198,
15490,
796,
23336,
17,
198,
198,
16624,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
8979,
16,
1,
1058,
366,
464,
2068,
7586,
21831,
11687,
625,
262,
16931,
6844,
1,
837,
198,
220,
220,
220,
220,
... | 2.122642 | 424 |
"""API endpoints for generating formio token."""
from http import HTTPStatus
from flask import jsonify
from flask_restx import Namespace, Resource, cors
from ..services import FormIOTokenService
from ..utils.util import cors_preflight
API = Namespace('FormIOToken', description='FormIOToken')
@cors_preflight('GET... | [
37811,
17614,
886,
13033,
329,
15453,
1296,
952,
11241,
526,
15931,
198,
198,
6738,
2638,
1330,
14626,
19580,
198,
198,
6738,
42903,
1330,
33918,
1958,
198,
6738,
42903,
62,
2118,
87,
1330,
28531,
10223,
11,
20857,
11,
269,
669,
198,
19... | 2.831224 | 237 |
# inspired by https://iwatobipen.wordpress.com/2016/12/13/build-regression-model-in-keras/
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import pandas as pd
import sys
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import DataStructs
from s... | [
198,
2,
7867,
416,
3740,
1378,
14246,
265,
672,
541,
268,
13,
40346,
13,
785,
14,
5304,
14,
1065,
14,
1485,
14,
11249,
12,
2301,
2234,
12,
19849,
12,
259,
12,
6122,
292,
14,
198,
198,
11748,
14601,
198,
40539,
654,
13,
36439,
2445... | 2.358396 | 798 |
from PyQt4.QtGui import *
from PyQt4 import uic
import os
from os.path import join
from evaluator import evaluate
import random
import csv
| [
6738,
9485,
48,
83,
19,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
48,
83,
19,
1330,
334,
291,
198,
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
6738,
5418,
84,
1352,
1330,
13446,
198,
11748,
4738,
198,
11748,
... | 3.021739 | 46 |
import click
import os
import csv
import hashlib
from zipfile import ZipFile | [
11748,
3904,
198,
11748,
28686,
198,
11748,
269,
21370,
198,
11748,
12234,
8019,
198,
6738,
19974,
7753,
1330,
38636,
8979
] | 3.8 | 20 |
import itertools
import matplotlib.pyplot as plt
from mvlearn.cluster import MultiviewCoRegSpectralClustering, MultiviewKMeans
from mvlearn_adapted.mv_coreg_spectral import MultiviewCoRegSpectralClustering as MVCoReg_adapted
from sklearn.cluster import DBSCAN, MeanShift, KMeans
from sklearn.metrics import normalized_... | [
11748,
340,
861,
10141,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
285,
85,
35720,
13,
565,
5819,
1330,
7854,
452,
769,
7222,
8081,
49738,
1373,
2601,
436,
1586,
11,
7854,
452,
769,
42,
5308,
504,
... | 2.447876 | 259 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
33448,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 2.072141 | 1,303 |
import torch
def parse_model_config(path):
"""Parses the yolo-v3 layer configuration file and returns module definitions"""
file = open(path, 'r')
lines = file.read().split('\n')
lines = [x for x in lines if x and not x.startswith('#')]
lines = [x.rstrip().lstrip() for x in lines] # get rid of fr... | [
11748,
28034,
628,
198,
198,
4299,
21136,
62,
19849,
62,
11250,
7,
6978,
2599,
198,
220,
220,
220,
37227,
47,
945,
274,
262,
331,
14057,
12,
85,
18,
7679,
8398,
2393,
290,
5860,
8265,
17336,
37811,
198,
220,
220,
220,
2393,
796,
128... | 2.124031 | 1,935 |
# -*- coding: utf-8 -*-
from abc import ABCMeta
from functools import wraps
from inspect import iscoroutinefunction
from typing import (
Any,
Callable,
ClassVar,
Coroutine,
Generic,
NoReturn,
Type,
TypeVar,
Union,
overload,
)
from typing_extensions import final
from returns.pr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
450,
66,
1330,
9738,
48526,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
10104,
1330,
318,
10215,
28399,
8818,
198,
6738,
19720,
1330,
357,
198,
220,
... | 2.446272 | 4,802 |
#! /usr/bin/env python
#
# This script compares RFMIP results from RTE+RRTMGP against a benchmark
#
import os
import sys
import numpy as np
import xarray as xr
import argparse
import urllib.request
#
# Comparing reference and test results
#
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="C... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
770,
4226,
23008,
20445,
44,
4061,
2482,
422,
371,
9328,
10,
49,
14181,
44,
16960,
1028,
257,
18335,
198,
2,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
299,
32152... | 2.476549 | 1,194 |
import os
import numpy as np
import pandas as pd
from typing import Dict, \
Optional, \
Union
from ct.preprocess.tokenize import Tokenizer
| [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
19720,
1330,
360,
713,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.222222 | 81 |
#
# Copyright (c) 2020 Bitdefender
# SPDX-License-Identifier: Apache-2.0
#
"""
"""
import r2pipe
import json
import re
import os
| [
2,
198,
2,
15069,
357,
66,
8,
12131,
4722,
4299,
2194,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
198,
37811,
198,
198,
37811,
198,
198,
11748,
374,
17,
34360,
198,
11748,
33918,
198,
11748,
... | 2.693878 | 49 |
import torch
import math
from torch import nn, optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.distributions.multivariate_normal import MultivariateNormal
import ipdb
from torch.distributions import Normal
from dgl.nn.pytorch import GraphConv
"""
Taken from: https://github.com/zfjs... | [
11748,
28034,
198,
11748,
10688,
198,
6738,
28034,
1330,
299,
77,
11,
6436,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
28034,
13,
17080,
2455,
507,
13,
16680,
42524,... | 3.187845 | 181 |
import logging
from os import environ
import os.path
import sys
sys.dont_write_bytecode = True
import discord
from bot import MaliceBot
from dotenv import load_dotenv
environ["JISHAKU_NO_UNDERSCORE"] = "True"
environ["JISHAKU_HIDE"] = "True"
dotenv_path = os.path.join(os.path.dirname(__file__), "config/.env")
load... | [
11748,
18931,
198,
6738,
28686,
1330,
551,
2268,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
198,
17597,
13,
67,
756,
62,
13564,
62,
26327,
8189,
796,
6407,
198,
198,
11748,
36446,
198,
198,
6738,
10214,
1330,
4434,
501,
20630,... | 2.340996 | 522 |
def create_csp_models(ised,tau=None,tau_V=None,mu=0.3,epsilon=0.):
"""
Script to create B+C models for a given metallicity and a range of
exponential decays and dust models. Uses the following distributions
by default:
Tau (gyr) = U[0.04:9.1::35]
Tau_V (reddening) = LU[0.01:2:... | [
198,
4299,
2251,
62,
66,
2777,
62,
27530,
7,
1417,
11,
83,
559,
28,
14202,
11,
83,
559,
62,
53,
28,
14202,
11,
30300,
28,
15,
13,
18,
11,
538,
18217,
261,
28,
15,
47308,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12327,
28... | 1.937415 | 2,956 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
from bokeh.layouts import gridplot
from bokeh.models import BooleanFilter, CDSView, ColumnDataSource
from bokeh.plotting import figure, show
source = ColumnDataSource(data=dict(x=[1, 2, 3, 4, 5], y=[1, 2, 3, 4, 5]))
booleans = [True if y_val > 2 else False for y_val in source.data['y']]
view = CDSView(filter=BooleanFi... | [
6738,
1489,
365,
71,
13,
10724,
5269,
1330,
10706,
29487,
198,
6738,
1489,
365,
71,
13,
27530,
1330,
41146,
22417,
11,
327,
5258,
7680,
11,
29201,
6601,
7416,
198,
6738,
1489,
365,
71,
13,
29487,
889,
1330,
3785,
11,
905,
198,
198,
... | 2.489726 | 292 |
#Load and Visualize the
from torchvision import datasets
import torchvision.transforms as transforms
# number of subprocesses to use for data loading
num_workers = 0
# how many samples per batch to load
batch_size = 20
# convert data to torch.FloatTensor
transform = transforms.ToTensor()
# choose the training and te... | [
2,
8912,
290,
15612,
1096,
262,
198,
6738,
28034,
10178,
1330,
40522,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
198,
2,
1271,
286,
850,
14681,
274,
284,
779,
329,
1366,
11046,
198,
22510,
62,
22896,
796,
657,
198,
2,... | 2.666823 | 2,131 |
import torch.nn as nn
from torch.nn import functional as F
import math
import torch.utils.model_zoo as model_zoo
import torch
import os
import sys
import pdb
import numpy as np
from torch.autograd import Variable
import functools
affine_par = True
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
s... | [
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
201,
198,
11748,
10688,
201,
198,
11748,
28034,
13,
26791,
13,
19849,
62,
89,
2238,
355,
2746,
62,
89,
2238,
201,
198,
11748,
28034,
201,
... | 2.487696 | 894 |
# need 12h to get the result
filename = "2sum.txt"
X = [int(l) for l in open(filename)]
#print len(X)
values = [True] * len(X)
dictionary = dict(zip(X, values))
#print dictionary[X[0]]
t = range(-10000,10001)
num = {}
for target in t:
print "target: " + str(target)
'''
if target %... | [
2,
761,
1105,
71,
284,
651,
262,
1255,
220,
201,
198,
201,
198,
34345,
796,
366,
17,
16345,
13,
14116,
1,
201,
198,
55,
796,
685,
600,
7,
75,
8,
329,
300,
287,
1280,
7,
34345,
15437,
201,
198,
2,
4798,
18896,
7,
55,
8,
201,
... | 1.823762 | 505 |