content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from io import BytesIO
from django.core.management import BaseCommand
import requests
from pyexcel_odsr import get_data
from openpersonen.contrib.demo.models import *
"""
Row index | Field name
0 | A-nummer persoon
1 | Burgerservicenummer persoon
2 | Voornamen persoon
3 | Adellijke tit... | [
6738,
33245,
1330,
2750,
4879,
9399,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
7308,
21575,
198,
198,
11748,
7007,
198,
6738,
12972,
1069,
5276,
62,
12978,
81,
1330,
651,
62,
7890,
198,
198,
6738,
1280,
6259,
268,
13,
3... | 2.392433 | 10,440 |
import numpy as np
import scipy.sparse as sp
import scipy.sparse.linalg as la
from floq.helpers.index import n_to_i, i_to_n
from floq.helpers.numpy_replacements import numba_outer, numba_zeros
import floq.helpers.blockmatrix as bm
import floq.helpers.matrix as mm
import floq.errors as errors
import itertools
import cma... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
599,
198,
11748,
629,
541,
88,
13,
82,
29572,
13,
75,
1292,
70,
355,
8591,
198,
6738,
5530,
80,
13,
16794,
364,
13,
9630,
1330,
299,
62,
1462,
62,
72,
... | 2.493261 | 742 |
# Generated by Django 2.1.7 on 2019-02-17 11:23
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
22,
319,
13130,
12,
2999,
12,
1558,
1367,
25,
1954,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = "left+-leftCUR/rightUMINUSBIN BIT CHAR CUR DEC HEX KEYWORD LABEL NEWLINE PSEUDO REGISTERstat : LABEL KEYWORD stat_valstat : KEYWORD stat_valstat : stat NEWLINE statstat ... | [
198,
2,
13544,
316,
397,
13,
9078,
198,
2,
770,
2393,
318,
6338,
7560,
13,
2141,
407,
4370,
13,
198,
2,
279,
2645,
600,
25,
15560,
28,
54,
11,
34,
11,
49,
198,
62,
8658,
9641,
796,
705,
18,
13,
940,
6,
198,
198,
62,
14050,
6... | 2.10327 | 3,089 |
import unittest
import os
import yaml
import time
from async_keepalive_httpc.aws.auth import EasyV4Sign
| [
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
11748,
640,
198,
198,
6738,
30351,
62,
14894,
282,
425,
62,
4023,
66,
13,
8356,
13,
18439,
1330,
16789,
53,
19,
11712,
628,
628
] | 3 | 36 |
import md5
import datetime
from pool import (
Connection,
ConnectionPool,
new_connection_name,
)
CONNECTION_POOL = ConnectionPool(
[Connection(new_connection_name()) for i in range(10)]
)
if __name__ == '__main__':
client = Client()
client.serial_request([some_random_data() for x in rang... | [
11748,
45243,
20,
198,
11748,
4818,
8079,
198,
198,
6738,
5933,
1330,
357,
198,
220,
220,
220,
26923,
11,
198,
220,
220,
220,
26923,
27201,
11,
198,
220,
220,
220,
649,
62,
38659,
62,
3672,
11,
198,
8,
628,
198,
10943,
45,
24565,
... | 2.724138 | 261 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
1772,
25,
1263,
6513,
692,
16115,
628,
198
] | 2.15625 | 32 |
import pathlib
import posixpath
from os import getcwd
import pytest
from json_ref_dict import RefDict
from json_ref_dict.loader import loader
from json_ref_dict.exceptions import DocumentParseError, ReferenceParseError
PINNED_FILE_URL = (
"https://raw.githubusercontent.com/jacksmith15/json-ref-dict/091af2"
... | [
11748,
3108,
8019,
198,
11748,
1426,
844,
6978,
198,
6738,
28686,
1330,
651,
66,
16993,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
33918,
62,
5420,
62,
11600,
1330,
6524,
35,
713,
198,
6738,
33918,
62,
5420,
62,
11600,
13,
29356,
1... | 2.485356 | 717 |
from keras_autodoc import DocumentationGenerator
import keras_autodoc
import shutil
client_methods = keras_autodoc.get_methods('flybrainlab.Client.Client')
ordered_methods = ['flybrainlab.Client.Client',
'flybrainlab.Client.Client.__init__',
'flybrainlab.Client.Client.tryComms',... | [
6738,
41927,
292,
62,
2306,
375,
420,
1330,
43925,
8645,
1352,
198,
11748,
41927,
292,
62,
2306,
375,
420,
198,
11748,
4423,
346,
198,
198,
16366,
62,
24396,
82,
796,
41927,
292,
62,
2306,
375,
420,
13,
1136,
62,
24396,
82,
10786,
1... | 2.540299 | 335 |
from __future__ import annotations
import os
from pathlib import Path
from typing import Iterable, Type
from findpython.providers.base import BaseProvider, T
from findpython.python import PythonVersion
class PyenvProvider(BaseProvider):
"""A provider that finds python installed with pyenv"""
@classmethod
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
40806,
540,
11,
5994,
198,
198,
6738,
1064,
29412,
13,
15234,
4157,
13,
8692,
1330,
7308,
29495,
11,
309,
198,
673... | 3.938272 | 81 |
from flask import Blueprint, render_template, redirect, url_for, request, flash
from flask_login import login_user, logout_user, login_required, current_user
from werkzeug.security import generate_password_hash, check_password_hash
import csv
from models import User, Activitat
from __init__ import db
analysis = Blue... | [
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
11,
18941,
11,
19016,
62,
1640,
11,
2581,
11,
7644,
198,
6738,
42903,
62,
38235,
1330,
17594,
62,
7220,
11,
2604,
448,
62,
7220,
11,
17594,
62,
35827,
11,
1459,
62,
7220,
198,
6738,
266... | 3.175 | 160 |
# Copyright (c) 2014 Doug Hellmann. All rights reserved.
"""Handling UNIX signals
"""
# end_pymotw_header
import asyncio
import functools
import os
import signal
event_loop = asyncio.get_event_loop()
event_loop.add_signal_handler(
signal.SIGHUP, functools.partial(signal_handler, name="SIGHUP")
)
event_loop.ad... | [
2,
15069,
357,
66,
8,
1946,
15115,
5783,
9038,
13,
220,
1439,
2489,
10395,
13,
198,
37811,
12885,
1359,
4725,
10426,
10425,
198,
37811,
198,
198,
2,
886,
62,
79,
4948,
313,
86,
62,
25677,
198,
11748,
30351,
952,
198,
11748,
1257,
31... | 2.579399 | 233 |
# coding=utf-8
from flask_rq2 import RQ
rq = RQ()
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
6738,
42903,
62,
81,
80,
17,
1330,
371,
48,
198,
198,
81,
80,
796,
371,
48,
3419,
198
] | 2 | 26 |
#!/bin/env python
# This is a simple script for generating the files include/Hexe/Terminal/EmojiGlyphRanges.h and src/emoji_blocks.h based on the emoji-sequences.txt
# file for Unicode 13.1
# src/emoji_blocks.h:
# It generates 2 bitmaps, each covering the emojis from the basic multilingual plane, aswell as the suppl... | [
2,
48443,
8800,
14,
24330,
21015,
198,
198,
2,
770,
318,
257,
2829,
4226,
329,
15453,
262,
3696,
2291,
14,
39,
13499,
14,
44798,
282,
14,
36,
5908,
7285,
38,
306,
746,
49,
6231,
13,
71,
290,
12351,
14,
368,
31370,
62,
27372,
13,
... | 2.37069 | 1,044 |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... | [
6477,
796,
1391,
6,
45346,
1546,
10354,
1391,
6,
30547,
10354,
352,
13,
2091,
18742,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16286,
14,
30547,
10354,
352,
13,
2091,
18742,
11,
198,
220,
220,
220,
220,
220,
... | 2.342785 | 29,272 |
from .gcn import GCN
from .gcn_saint import SAINT
from .r_gcn import RGCN
from .gcn_attack import GCN_attack
from .gat import GAT
from .gin import GIN
from .gcn_preprocess import GCNSVD, GCNJaccard
from .jumpingknowledge import JK
from .basicfunction import att_coef, accuracy_1
__all__ = ['GCN', 'GCNSVD', 'GCNJaccard... | [
6738,
764,
70,
31522,
1330,
20145,
45,
198,
6738,
764,
70,
31522,
62,
82,
2913,
1330,
14719,
12394,
198,
6738,
764,
81,
62,
70,
31522,
1330,
371,
15916,
45,
198,
6738,
764,
70,
31522,
62,
20358,
1330,
20145,
45,
62,
20358,
198,
6738... | 2.463855 | 166 |
import copy
import functools
import math
from pathlib import Path
from typing import List
from sources.datasets.client_dataset_definitions.client_dataset_decorators.extend_dataset_ratio_based_shared_memory import \
ExtendDatasetRatioBasedSharedMemory
from sources.simulators.serial_execution_simulator import \
... | [
11748,
4866,
198,
11748,
1257,
310,
10141,
198,
11748,
10688,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
4237,
13,
19608,
292,
1039,
13,
16366,
62,
19608,
292,
316,
62,
4299,
50101,
13,
16366,
62,
... | 2.927405 | 551 |
import copy
from collections import defaultdict
inputs = [list(line) for line in open("day11/input").read().splitlines()]
nodes = defaultdict(lambda: [])
for y in range(len(inputs)):
for x in range(len(inputs[y])):
if inputs[y][x] != ".":
for i in range(-1, 2):
for j in range... | [
11748,
4866,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
15414,
82,
796,
685,
4868,
7,
1370,
8,
329,
1627,
287,
1280,
7203,
820,
1157,
14,
15414,
11074,
961,
22446,
35312,
6615,
3419,
60,
198,
198,
77,
4147,
796,
4277,
11600,
7,
... | 1.8528 | 625 |
import functools
from flask import (
render_template, request, Blueprint, g, redirect, url_for, flash)
from flask_wtf import FlaskForm
from wtforms import IntegerField, StringField, validators
from pwnme import base
from pwnme.base import Site
from pwnme.db import get_db
bp = Blueprint('safe', __name__, url_pref... | [
11748,
1257,
310,
10141,
198,
198,
6738,
42903,
1330,
357,
198,
220,
220,
220,
8543,
62,
28243,
11,
2581,
11,
39932,
11,
308,
11,
18941,
11,
19016,
62,
1640,
11,
7644,
8,
198,
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738... | 3.035137 | 1,423 |
from django.db.models.signals import post_save
# from django.contrib.auth.models import User
from django.dispatch import receiver
import auth_api
from auth_api.spotify import create_spotify_session_with_token
from . import schemas
from .models import Profile
@receiver(post_save, sender=auth_api.models.SpotifyToken)... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
2,
422,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
198,
198,
11748,
6284,
... | 3.27551 | 98 |
from collections import OrderedDict
from enum import Enum
from typing import Type, List
from pytconf.extended_enum import str_to_enum_value, ExtendedEnum
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
19720,
1330,
5994,
11,
7343,
198,
198,
6738,
12972,
83,
10414,
13,
2302,
1631,
62,
44709,
1330,
965,
62,
1462,
62,
44709,
62,
8367,
11,
24204,... | 3.404255 | 47 |
from rest_framework import pagination
from rest_framework.response import Response
class AdminAPIPagination(pagination.LimitOffsetPagination):
"""Custom pagination to keep links separate from data"""
default_limit = 10
max_limit = 100
| [
6738,
1334,
62,
30604,
1330,
42208,
1883,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
628,
198,
4871,
32053,
2969,
4061,
363,
1883,
7,
79,
363,
1883,
13,
39184,
34519,
47,
363,
1883,
2599,
198,
220,
220,
220,
37227,
15022,
422... | 3.623188 | 69 |
a = "Paul Sinatra"
print(a.count("a"))
print(a.count("a",0,10))
print(a.endswith("tra"))
print(a.endswith("ul",1,8))
print(a.find("a"))
print(a.find("a",2,10))
print(len(a))
print(a.lower())
print(max(a))
print(min(a))
print(a.replace("a","b"))
print(a.split(" "))
print(a.strip())
print(a.upper()) | [
64,
796,
366,
12041,
10884,
26066,
1,
198,
198,
4798,
7,
64,
13,
9127,
7203,
64,
48774,
198,
4798,
7,
64,
13,
9127,
7203,
64,
1600,
15,
11,
940,
4008,
198,
198,
4798,
7,
64,
13,
437,
2032,
342,
7203,
9535,
48774,
198,
4798,
7,
... | 2.067114 | 149 |
import json
from argparse import ArgumentParser
from tqdm import tqdm
from numpy import nan
import numpy as np
import pandas as pd
import torch
from evaluation.depth_testing import compute_rel_metrics
from utils.data_loading import load_test_data, getTrainingEvalDataKITTI
from utils.model_utils import load_unet_model... | [
11748,
33918,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
299,
32152,
1330,
15709,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
... | 2.48 | 800 |
import numpy as np
from ...core.toolbox import display_message
from matplotlib import pyplot as plt
from matplotlib.figure import Figure
| [
11748,
299,
32152,
355,
45941,
198,
6738,
2644,
7295,
13,
25981,
3524,
1330,
3359,
62,
20500,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
26875,
1330,
11291,
198
] | 3.702703 | 37 |
# -*- coding: utf-8 -*-
import os
import pandas as pd
import numpy as np
import random
import operator
import math
from copy import deepcopy
import matplotlib.pyplot as plt
# # 将网格线置于曲线之下
# plt.rcParams['axes.axisbelow'] = False
plt.style.use('fivethirtyeight') # 'ggplot'
from PlotFunctions import plot_random_init_iri... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
10088,
198,
11748,
10688,
198,
6738,
4866,
1330,
2769... | 1.442761 | 3,564 |
from http.server import HTTPServer, BaseHTTPRequestHandler, ThreadingHTTPServer
from typing import Callable
class NehushtanHTTPService:
"""
Since 0.4.0
"""
@staticmethod
def run_with_selector_server(
handler_class: Callable[..., BaseHTTPRequestHandler],
listen_port: int,
... | [
6738,
2638,
13,
15388,
1330,
38288,
18497,
11,
7308,
40717,
18453,
25060,
11,
14122,
278,
6535,
28820,
18497,
198,
6738,
19720,
1330,
4889,
540,
628,
198,
4871,
44470,
1530,
38006,
6535,
28820,
712,
501,
25,
198,
220,
220,
220,
37227,
1... | 2.56912 | 557 |
from django.contrib.auth import login
from rest_framework import permissions
from rest_framework.serializers import Serializer
from rest_framework.views import APIView
from rest_framework.response import Response # Standard Response object
from rest_framework import status
from rest_framework import generics
from res... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
17594,
198,
6738,
1334,
62,
30604,
1330,
21627,
198,
6738,
1334,
62,
30604,
13,
46911,
11341,
1330,
23283,
7509,
198,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,... | 2.084416 | 8,316 |
import os
from unittest.case import TestCase
from mock import MagicMock, patch, Mock
from ingest.api.ingestapi import IngestApi
from ingest.importer.importer import SchemaRetrievalError
from ingest.importer.importer import XlsImporter
from ingest.utils.IngestError import ImporterError
BASE_PATH = os.path.dirname(__f... | [
11748,
28686,
198,
6738,
555,
715,
395,
13,
7442,
1330,
6208,
20448,
198,
198,
6738,
15290,
1330,
6139,
44,
735,
11,
8529,
11,
44123,
198,
198,
6738,
26151,
13,
15042,
13,
278,
395,
15042,
1330,
554,
3495,
32,
14415,
198,
6738,
26151,... | 3.127273 | 110 |
import json
from typing import Tuple, Optional
from logging import getLogger
import numpy as np
import tensorflow as tf
from deeppavlov.core.common.errors import ConfigError
from deeppavlov.core.layers import tf_attention_mechanisms as am, tf_layers
# noinspection PyUnresolvedReferences
from tensorflow.contrib.layer... | [
11748,
33918,
198,
6738,
19720,
1330,
309,
29291,
11,
32233,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
390,
68,
381,
615,
27086,
13,
729... | 2.454153 | 2,083 |
# coding: utf-8
# In[ ]:
import os,sys
par_dir = os.path.join(os.pardir, os.pardir)
curr_path = os.path.abspath(__file__)
root_path = os.path.abspath(os.path.join(curr_path, par_dir))
sys.path.append(str(root_path))
import unittest
import torch
from torch import nn
from unittest import TestCase
from torch.autograd ... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
2361,
25,
198,
11748,
28686,
11,
17597,
198,
1845,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
26037,
343,
11,
28686,
13,
26037,
343,
8,
198,
22019,
81,
62,
... | 2.780952 | 210 |
import os
import json
import click
import fsspec
from appyter.context import get_env, get_jinja2_env
from appyter.ext.click import click_option_setenv, click_argument_setenv
from appyter.parse.nb import nb_from_ipynb_io
from appyter.parse.nbtemplate import parse_fields_from_nbtemplate
from appyter.ext.urllib import jo... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
3904,
198,
11748,
277,
824,
43106,
198,
198,
6738,
598,
88,
353,
13,
22866,
1330,
651,
62,
24330,
11,
651,
62,
18594,
6592,
17,
62,
24330,
198,
6738,
598,
88,
353,
13,
2302,
13,
12976,
13... | 3.028736 | 348 |
from RTool import *
__all__ = ["prototype","util","image","maya"]
| [
6738,
11923,
970,
1330,
1635,
198,
198,
834,
439,
834,
796,
14631,
38124,
2430,
22602,
2430,
9060,
2430,
11261,
64,
8973,
198
] | 3.045455 | 22 |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | [
2,
220,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
41906,
17174,
4557,
35625,
198,
2,
45593,
2640,
11,
262,
7311,
276,
42410,
6779,
4482,
286,
262,
10373,
57,
198,
2,
15069,
357,
66,
8,
3717,
12,
1238,
2481,
... | 3.906849 | 365 |
import math
"""定义盒子"""
class Box:
"""输入True改变装载方向(一种转法,不能倒放)
返回改了装载方向的盒子"""
@staticmethod
"""这个box减去一个box的结果
返回组成剩余空间的四个box,
z方向上不分层"""
"""这个box加上一个box的结果"""
"""print尺寸"""
#测试
bx=Box([1,2,3])
print(bx.turn())
print(bx)
print(bx.size())
subx=bx-Box([0.4,... | [
11748,
10688,
198,
198,
37811,
22522,
248,
20046,
231,
33566,
240,
36310,
37811,
198,
4871,
8315,
25,
198,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
164,
122,
241,
17739,
98,
17821,
162,
242,
117,
20998,
246,
35318,
164,
121,
121... | 1.57646 | 2,158 |
import tensorflow as tf
from modules.gram_matrix import gram_matrix
# see the paper A Neural Algorithm of Artistic Style
# by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge
def style_loss(content_feats, style_grams, style_weights):
"""
Computes the style loss at a set of layers.
Inputs:
-... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
13103,
13,
4546,
62,
6759,
8609,
1330,
14599,
62,
6759,
8609,
198,
198,
2,
766,
262,
3348,
317,
47986,
978,
42289,
286,
3683,
2569,
17738,
220,
198,
2,
416,
10592,
317,
13,
29074,
893,
... | 2.686893 | 412 |
#
# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
#
""" Demo how to merge tables in Deephaven."""
import pandas as pd
from examples.import_test_data import import_taxi_records
from examples.demo_query import demo_query
from examples.demo_table_ops import demo_chained_table_ops
from pydeephaven import... | [
2,
198,
2,
15069,
357,
66,
8,
1584,
12,
1238,
1828,
10766,
39487,
6060,
23500,
290,
34830,
350,
1571,
198,
2,
198,
198,
37811,
34588,
703,
284,
20121,
8893,
287,
10766,
39487,
526,
15931,
198,
11748,
19798,
292,
355,
279,
67,
198,
1... | 3.162393 | 117 |
#-------------------------------------------------------------------------------
# Part of this Python script is taken from the Pycom NanoGateway
# https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway
#
# Adapted by Congduc.Pham@univ-pau.fr
#
# This file is part of the low-cost LoRa gatewa... | [
2,
10097,
24305,
198,
2,
2142,
286,
428,
11361,
4226,
318,
2077,
422,
262,
9485,
785,
33504,
22628,
1014,
198,
2,
3740,
1378,
12567,
13,
785,
14,
9078,
785,
14,
9078,
785,
12,
75,
11127,
14,
21048,
14,
9866,
14,
1069,
12629,
14,
4... | 2.569704 | 911 |
"""
This code contains support code for formatting products to NetCDF for the LP DAAC.
Authors: Philip G. Brodrick, philip.brodrick@jpl.nasa.gov
Nimrod Carmon, nimrod.carmon@jpl.nasa.gov
"""
"""
#TODO - UMMG updates
TemporalExtent - tbd
Platforms - implemented, test to see if it breaks
X extend add_files (f... | [
37811,
198,
1212,
2438,
4909,
1104,
2438,
329,
33313,
3186,
284,
3433,
34,
8068,
329,
262,
18470,
17051,
2246,
13,
198,
198,
30515,
669,
25,
14576,
402,
13,
2806,
67,
5557,
11,
5206,
541,
13,
7957,
67,
5557,
31,
73,
489,
13,
77,
1... | 2.503359 | 6,997 |
from flask import Flask, request, session, redirect, flash, render_template
# Configure the app
app = Flask(__name__)
app.secret_key = 'secret key for cookie signing'
# Set up views
@app.route('/')
@app.route('/login')
@app.route('/logout')
# Wrap with middleware that will automatically replace scheme with https
... | [
6738,
42903,
1330,
46947,
11,
2581,
11,
6246,
11,
18941,
11,
7644,
11,
8543,
62,
28243,
198,
198,
2,
17056,
495,
262,
598,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
21078,
62,
2539,
796,
705,
21078,
1994,
329,
19... | 2.913978 | 186 |
from redis import Redis
from cache_gs.cache_classes.cache_data import CacheData
from cache_gs.interfaces.super_cache import SuperCache
class RedisCache(SuperCache):
"""
Connection string
redis://localhost:6379?ConnectTimeout=5000&IdleTimeOutSecs=180
"""
@staticmethod
| [
6738,
2266,
271,
1330,
2297,
271,
198,
198,
6738,
12940,
62,
14542,
13,
23870,
62,
37724,
13,
23870,
62,
7890,
1330,
34088,
6601,
198,
6738,
12940,
62,
14542,
13,
3849,
32186,
13,
16668,
62,
23870,
1330,
3115,
30562,
628,
198,
4871,
2... | 3.010309 | 97 |
"""Networking sending and receiving blocks."""
import socket
from typing import Optional, Tuple
from being.block import Block
from being.resources import register_resource
from being.serialization import EOT, FlyByDecoder, dumps
from being.connectables import MessageOutput, MessageInput
Socket = socket.socket
Addres... | [
37811,
7934,
16090,
7216,
290,
6464,
7021,
526,
15931,
198,
11748,
17802,
198,
6738,
19720,
1330,
32233,
11,
309,
29291,
198,
198,
6738,
852,
13,
9967,
1330,
9726,
198,
6738,
852,
13,
37540,
1330,
7881,
62,
31092,
198,
6738,
852,
13,
... | 2.869955 | 446 |
from django.core.exceptions import PermissionDenied
| [
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
2448,
3411,
21306,
798,
198
] | 3.714286 | 14 |
"""Command Line Interface for TGAN."""
import argparse
from tgan.research.experiments import run_experiments
def get_train_parser():
"""Build the ArgumentParser for CLI."""
parser = argparse.ArgumentParser()
parser.add_argument('--gpu', help='comma separated list of GPU(s) to use.')
parser.add_argum... | [
37811,
21575,
6910,
26491,
329,
44121,
1565,
526,
15931,
198,
198,
11748,
1822,
29572,
198,
198,
6738,
256,
1030,
13,
34033,
13,
23100,
6800,
1330,
1057,
62,
23100,
6800,
628,
198,
4299,
651,
62,
27432,
62,
48610,
33529,
198,
220,
220,
... | 2.799763 | 844 |
"""Contains general utility functions to be used by the execution server."""
import os
import signal
import json
import sys
import subprocess
import threading
import platform
| [
37811,
4264,
1299,
2276,
10361,
5499,
284,
307,
973,
416,
262,
9706,
4382,
526,
15931,
198,
198,
11748,
28686,
198,
11748,
6737,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
11748,
4704,
278,
198,
11748,
3859,
628,
... | 4.285714 | 42 |
import os
import tempfile
from collections import namedtuple
from multiprocessing import Queue
import unittest
import numpy as np
from ray.tune import Trainable
from ray.tune.function_runner import wrap_function
from ray.tune.integration.wandb import (
WandbLoggerCallback,
_WandbLoggingProcess,
_WANDB_QUE... | [
11748,
28686,
198,
11748,
20218,
7753,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
18540,
305,
919,
278,
1330,
4670,
518,
198,
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
26842,
13,
83,
1726,
... | 2.66 | 250 |
import json
import codecs
MENU_INDENTATION_LEVEL = 4
with open("menu.json") as json_data, codecs.open("list.txt", "w", "utf-8") as menu_list_file:
data = json.load(json_data)
menu_list_file.write(build_menu_tree(data))
| [
11748,
33918,
198,
11748,
40481,
82,
198,
198,
49275,
52,
62,
12115,
3525,
6234,
62,
2538,
18697,
796,
604,
628,
628,
198,
198,
4480,
1280,
7203,
26272,
13,
17752,
4943,
355,
33918,
62,
7890,
11,
40481,
82,
13,
9654,
7203,
4868,
13,
... | 2.489362 | 94 |
__all__ = ['lns', 'lns_iterative']
| [
834,
439,
834,
796,
37250,
75,
5907,
3256,
705,
75,
5907,
62,
2676,
876,
20520,
198
] | 2.1875 | 16 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
47,
7252,
50,
33176,
111,
2... | 3.586806 | 288 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
628,
628,
198
] | 2.875 | 8 |
from enum import auto, Enum
| [
6738,
33829,
1330,
8295,
11,
2039,
388,
628,
198
] | 3.333333 | 9 |
from .comparison_collectors import *
from .predict_model import *
| [
6738,
764,
785,
1845,
1653,
62,
33327,
669,
1330,
1635,
198,
6738,
764,
79,
17407,
62,
19849,
1330,
1635,
198
] | 3.3 | 20 |
# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
"""Services Instances Registry module"""
import uuid
from enum import IntEnum
from foglamp.common import logger
__author__ = "Praveen Garg, Amarendra Kumar Sinha"
__copyright__ = "Copyright (c) 2017 OSIsoft, LLC"
__license__... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
376,
7730,
43,
23518,
62,
33,
43312,
198,
2,
4091,
25,
2638,
1378,
69,
28678,
696,
13,
961,
83,
704,
420,
82,
13,
952,
14,
198,
2,
376,
7730,
43,
23518,
... | 2.637681 | 138 |
from manga_py.provider import Provider
from .helpers.std import Std
main = ZeroScansCom
| [
6738,
15911,
62,
9078,
13,
15234,
1304,
1330,
32549,
198,
6738,
764,
16794,
364,
13,
19282,
1330,
520,
67,
628,
198,
198,
12417,
796,
12169,
3351,
504,
5377,
198
] | 3.137931 | 29 |
'''
Created on May 5, 2017
@author: kashefy
'''
import os
import logging
from abc import abstractmethod, ABCMeta
import h5py
import lmdb
from nideep.iow import read_lmdb
class CreateDatasource(object):
""" Factory method for instantiating appropriate data source """
@classmethod
class AbstractDataSource(obje... | [
7061,
6,
198,
41972,
319,
1737,
642,
11,
2177,
198,
198,
31,
9800,
25,
479,
292,
258,
24928,
198,
7061,
6,
198,
11748,
28686,
198,
11748,
18931,
198,
6738,
450,
66,
1330,
12531,
24396,
11,
9738,
48526,
198,
11748,
289,
20,
9078,
198... | 2.170435 | 575 |
# -*- coding: utf-8 -*-
"""
Config for Gomoku Alpha Zero.
"""
# params of the board and the game
SIZE = (9, 9)
PIECE = 5
# params for policy value network
K = 2
STEP = 3
DIM = (2 * STEP + 1, SIZE[0], SIZE[1])
KERNELS = (3, 3)
FILTERS = 32
# train params for policy value network during self-play
INIT = 0
AUGMENT = ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
16934,
329,
402,
296,
11601,
12995,
12169,
13,
198,
37811,
198,
198,
2,
42287,
286,
262,
3096,
290,
262,
983,
198,
33489,
796,
357,
24,
11,
860,
8,
198,
... | 2.318408 | 201 |
import numpy
import torch
import util
| [
11748,
299,
32152,
198,
11748,
28034,
198,
198,
11748,
7736,
628,
628,
198
] | 3.307692 | 13 |
"""
This code is used to display the output of the agent for a specific traffic situations, but for different positions
of the ego vehicle. The action, the aleatoric uncertainty, and the epistemic uncertainty of the agent for different
positions are displayed.
Note that the interaction between this feature and SUMO cr... | [
37811,
198,
1212,
2438,
318,
973,
284,
3359,
262,
5072,
286,
262,
5797,
329,
257,
2176,
4979,
7445,
11,
475,
329,
1180,
6116,
198,
1659,
262,
19225,
4038,
13,
383,
2223,
11,
262,
31341,
1352,
291,
13479,
11,
290,
262,
34795,
5314,
1... | 4.626374 | 91 |
"""Functions to convert python seconds <-> UTC and to compensate for clock error.
History:
2014-04-25 ROwen Add from __future__ import division, absolute_import.
2015-09-24 ROwen Replace "== None" with "is None" to modernize the code.
"""
__all__ = ["setClockError", "getClockError", "getCurrPySec", "utcFromPySe... | [
198,
37811,
24629,
2733,
284,
10385,
21015,
4201,
1279,
3784,
18119,
290,
284,
21392,
329,
8801,
4049,
13,
198,
198,
18122,
25,
198,
4967,
12,
3023,
12,
1495,
15107,
21006,
220,
220,
220,
3060,
422,
11593,
37443,
834,
1330,
7297,
11,
... | 3.091314 | 898 |
import pandas as pd
import numpy as np
from scipy.signal import find_peaks
import matplotlib.pyplot as plt
if __name__ == "__main__":
#import pilot data
df = pd.read_csv(r"C:\Users\Σπύρος\Documents\ΣΠΥΡΟΣ\Pycharm Projects\Parkinson dfa app\Android-Sensor-Stride\code\python scripts\pilot data acc spyros.... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
1064,
62,
431,
4730,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
361,
11593,
3672,
834,
... | 2.125424 | 295 |
from sublime_db.core.typecheck import (
Optional,
List
)
from .layout import Layout
from .component import Inline, Block
html_escape_table = {
"&": "&",
">": ">",
"<": "<",
" ": "\u2003" # HACK spaces inside <a> tags are not clickable. We replaces spaces with em spaces
}
def html_escape(text: str)... | [
198,
6738,
41674,
62,
9945,
13,
7295,
13,
4906,
9122,
1330,
357,
198,
197,
30719,
11,
198,
197,
8053,
198,
8,
198,
198,
6738,
764,
39786,
1330,
47639,
198,
6738,
764,
42895,
1330,
554,
1370,
11,
9726,
628,
198,
6494,
62,
41915,
62,
... | 2.70625 | 160 |
import pygame as pg
import sys
import random
from pygame.locals import *
pg.init()
# Constant values
# width,height -> x,y
screensize = width, height = 640, 720
screen = pg.display.set_mode(screensize)
time_clock = pg.time.Clock()
# directions
right_direction = 'RIGHT'
left_direction = 'LEFT'
up_direction = 'UP'
down_... | [
11748,
12972,
6057,
355,
23241,
198,
11748,
25064,
198,
11748,
4738,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
198,
6024,
13,
15003,
3419,
198,
2,
20217,
3815,
198,
2,
9647,
11,
17015,
4613,
2124,
11,
88,
198,
1416,
568... | 3.111437 | 341 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='terrachecker',
version='0.0.5',
description='Terraform checker.',
author='Mark Winterbottom',
author_email='mark.winterbottom@jisc.ac.uk',
url='https://github.com/JiscRDSS/rdss-terraform-standards-checker',
pac... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
353,
81,
4891,
15280,
3256,
198,
220,
220,
220,
2196,
11639,
15,
1... | 2.267399 | 273 |
import requests
import os
from requests.exceptions import HTTPError
import datetime
from on_n_scraper.urls import (
add_path_to_url, add_subdomain_to_url,
is_url_have_host, url_replace_path
)
from bs4 import BeautifulSoup
from collections import OrderedDict
import re
from pytz import timezone
import pprint
... | [
11748,
7007,
198,
11748,
28686,
198,
6738,
7007,
13,
1069,
11755,
1330,
14626,
12331,
198,
11748,
4818,
8079,
198,
6738,
319,
62,
77,
62,
1416,
38545,
13,
6371,
82,
1330,
357,
198,
220,
220,
220,
751,
62,
6978,
62,
1462,
62,
6371,
1... | 2.626437 | 174 |
root = TreeNode(10)
root.left = TreeNode(10)
root.left.left = TreeNode(7)
root.left.right = TreeNode(9)
root.right = TreeNode(12)
root.right.left = TreeNode(11)
root.right.right = TreeNode(15)
root.right.right.right = TreeNode(17)
root.right.right.right.right = TreeNode(18)
root.right.right.left = TreeNode(13)
root.... | [
198,
15763,
796,
12200,
19667,
7,
940,
8,
198,
15763,
13,
9464,
796,
12200,
19667,
7,
940,
8,
198,
15763,
13,
9464,
13,
9464,
796,
12200,
19667,
7,
22,
8,
198,
15763,
13,
9464,
13,
3506,
796,
12200,
19667,
7,
24,
8,
198,
198,
15... | 2.596154 | 156 |
"""
Defaults for nailbiter app.
"""
# Defines image processors.
PROCESSORS = (
'nailbiter.processors.colorspace',
'nailbiter.processors.autocrop',
'nailbiter.processors.scale_and_crop',
'nailbiter.processors.filters',
)
| [
37811,
198,
7469,
13185,
329,
17864,
2545,
263,
598,
13,
198,
37811,
198,
198,
2,
2896,
1127,
2939,
20399,
13,
198,
4805,
4503,
7597,
20673,
796,
357,
198,
220,
220,
220,
705,
77,
603,
2545,
263,
13,
14681,
669,
13,
4033,
669,
10223... | 2.393939 | 99 |
from image_augmentation.wide_resnet.wrn import WideResNet
| [
6738,
2939,
62,
559,
5154,
341,
13,
4421,
62,
411,
3262,
13,
18351,
77,
1330,
23399,
4965,
7934,
198
] | 3.052632 | 19 |
from functools import cache
result = 0
with open("input.txt", "r") as input:
for line in input:
line = line.strip().split()
treeList = list(map(int, line))
(_, root) = readNode(treeList, 0)
@cache
result = value(root)
with open("output2.txt", "w") as output:
output.write(str(result))
... | [
6738,
1257,
310,
10141,
1330,
12940,
198,
20274,
796,
657,
198,
198,
4480,
1280,
7203,
15414,
13,
14116,
1600,
366,
81,
4943,
355,
5128,
25,
198,
220,
220,
220,
329,
1627,
287,
5128,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1627,... | 2.45 | 140 |
import os
from typing import Any, Optional, List
from parseridge.parser.evaluation.callbacks.base_eval_callback import EvalCallback
| [
11748,
28686,
198,
6738,
19720,
1330,
4377,
11,
32233,
11,
7343,
198,
198,
6738,
30751,
3130,
13,
48610,
13,
18206,
2288,
13,
13345,
10146,
13,
8692,
62,
18206,
62,
47423,
1330,
26439,
47258,
628
] | 3.941176 | 34 |
import torch
import BboxToolkit as bt
from mmdet.ops import obb_overlaps
from .builder import IOU_CALCULATORS
@IOU_CALCULATORS.register_module()
class OBBOverlaps(object):
"""2D IoU Calculator"""
def __call__(self, bboxes1, bboxes2, mode='iou', is_aligned=False):
"""Calculate IoU between 2D bboxes
... | [
11748,
28034,
198,
11748,
347,
3524,
25391,
15813,
355,
275,
83,
198,
198,
6738,
8085,
15255,
13,
2840,
1330,
909,
65,
62,
2502,
75,
1686,
198,
6738,
764,
38272,
1330,
314,
2606,
62,
34,
1847,
34,
6239,
1404,
20673,
628,
198,
31,
40... | 1.994012 | 1,336 |
x=range(1,10,2)
print (x)
for item in x:
print(item,end=",")
| [
198,
87,
28,
9521,
7,
16,
11,
940,
11,
17,
8,
198,
4798,
357,
87,
8,
198,
1640,
2378,
287,
2124,
25,
198,
220,
220,
220,
3601,
7,
9186,
11,
437,
28,
2430,
8,
628
] | 1.914286 | 35 |
'''
Curso de creación de GUIs con Qt5 y Python
Author: Kiko Correoso
Website: pybonacci.org
Licencia: MIT
'''
import os
os.environ['QT_API'] = 'pyside2'
import sys
from qtpy.QtWidgets import QApplication, QWidget
if __name__ == '__main__':
app = QApplication(sys.argv)
w = QWidget()
w.resize(500, 300)... | [
7061,
6,
198,
26628,
568,
390,
1126,
32009,
18840,
390,
19348,
3792,
369,
33734,
20,
331,
11361,
198,
198,
13838,
25,
509,
12125,
2744,
260,
28213,
198,
33420,
25,
12972,
4189,
44456,
13,
2398,
220,
198,
26656,
29634,
25,
17168,
198,
... | 2.25 | 184 |
# -*- coding: utf-8 -*-
from functools import wraps
from flask import current_app, jsonify, request
from jsonschema import Draft4Validator, validate, ValidationError
from gsenhaapi.exceptions import *
from werkzeug.exceptions import BadRequest
import os
import json
import traceback | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
42903,
1330,
1459,
62,
1324,
11,
33918,
1958,
11,
2581,
198,
6738,
44804,
684,
2395,
2611,
1330,
13650,
19,
47139,
1352,
... | 3.439024 | 82 |
import numpy as np
from inferelator_ng import utils
from inferelator_ng import regression
from inferelator_ng import tfa_workflow
from sklearn.linear_model import ElasticNetCV
ELASTICNET_PARAMETERS = dict(l1_ratio=[0.5, 0.7, 0.9],
eps=0.001,
n_alphas=50,
... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1167,
567,
41880,
62,
782,
1330,
3384,
4487,
198,
6738,
1167,
567,
41880,
62,
782,
1330,
20683,
198,
6738,
1167,
567,
41880,
62,
782,
1330,
256,
13331,
62,
1818,
11125,
198,
6738,
1341,
3... | 1.838095 | 1,260 |
import coloredlogs
import io
import matplotlib.pyplot as pp
import math
import multiprocessing as mp
import numpy as np
import os
import tensorflow as tf
import scipy.stats
import random
import logging
from os.path import splitext, basename
from time import strftime, gmtime
######################################
# Lo... | [
11748,
16396,
6404,
82,
198,
11748,
33245,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
9788,
198,
11748,
10688,
198,
11748,
18540,
305,
919,
278,
355,
29034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
1119... | 2.292591 | 3,968 |
#!/usr/bin/env python
"""
Github: https://github.com/Jiezhi/myleetcode
Created on 2019-08-14
Leetcode: https://leetcode.com/problems/powx-n/
"""
# FIXME
# Fixme
if __name__ == '__main__':
# print(pow(1.00001, 123456))
# print(Solution().myPow1(1.00001, 123456))
# print(pow(0.00001, 21474836... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
38,
10060,
25,
3740,
1378,
12567,
13,
785,
14,
41,
494,
89,
5303,
14,
1820,
293,
316,
8189,
198,
198,
41972,
319,
13130,
12,
2919,
12,
1415,
198,
198,
3123,
316,
8189,
... | 2.1 | 160 |
import uasyncio as asyncio
import io
import network_async
import mqtt_io
import garbage
from mqtt_as import config
# Main
# execute main()
main()
| [
11748,
334,
292,
13361,
952,
355,
30351,
952,
201,
198,
11748,
33245,
201,
198,
11748,
3127,
62,
292,
13361,
201,
198,
11748,
285,
80,
926,
62,
952,
201,
198,
11748,
15413,
201,
198,
6738,
285,
80,
926,
62,
292,
1330,
4566,
201,
198... | 2.606557 | 61 |
from ncclient import manager
eos=manager.connect(host="10.81.117.80", port="22", timeout=30, username="cvpadmin", password="arista", hostkey_verify=False)
#######################################################################################
# ... | [
6738,
299,
535,
75,
1153,
1330,
4706,
198,
68,
418,
28,
37153,
13,
8443,
7,
4774,
2625,
940,
13,
6659,
13,
17657,
13,
1795,
1600,
2493,
2625,
1828,
1600,
26827,
28,
1270,
11,
20579,
2625,
33967,
15636,
1084,
1600,
9206,
2625,
283,
1... | 1.600298 | 5,364 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
import numpy as np
from Config import Config
from Net import PolicyNet
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
17080,
2455,
507,
1330,
327,
2397,
12409,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17056,
1330,
170... | 3.72 | 50 |
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
2,
15069,
357,
34,
8,
13130,
12,
42334,
1168,
359,
528,
13,
1439,
2489,
10395,
13,
201,
198,
2,
201,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,
2845,... | 3.700599 | 167 |
import sys
from os.path import join
from flair.data import TaggedCorpus
from flair.data_fetcher import NLPTaskDataFetcher, NLPTask
from flair.embeddings import WordEmbeddings, FlairEmbeddings, DocumentLSTMEmbeddings
from flair.models import TextClassifier
from flair.trainers import ModelTrainer
import argparse
parse... | [
11748,
25064,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
198,
6738,
37457,
13,
7890,
1330,
309,
14655,
45680,
385,
198,
6738,
37457,
13,
7890,
62,
34045,
2044,
1330,
22879,
11571,
2093,
6601,
37,
316,
2044,
11,
22879,
11571,
2093,
198... | 3.325444 | 169 |
import os
import logging
import torch
import torch.nn as nn
import glob
from collections import OrderedDict
from .resnet import Bottleneck, BN_MOMENTUM
logger = logging.getLogger(__name__)
| [
11748,
28686,
198,
11748,
18931,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
15095,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
764,
411,
3262,
1330,
14835,
43163,
11,
347,
45,
62,
44,
... | 3.180328 | 61 |
"""*****************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to ... | [
37811,
17174,
17174,
4557,
35625,
198,
9,
15069,
357,
34,
8,
13130,
4527,
35902,
8987,
3457,
13,
290,
663,
34943,
13,
198,
9,
198,
9,
15540,
284,
534,
11846,
351,
777,
2846,
11,
345,
743,
779,
4527,
35902,
3788,
198,
9,
290,
597,
... | 3.443878 | 980 |
"""
modules/xrenner_sequence.py
Adapter class to accommodate sequence labeler
* Supplies a uniform predict_proba() method
* Reads serialized models
* Compatible with flair embeddings
Author: Amir Zeldes
"""
import sys, os
script_dir = os.path.dirname(os.path.realpath(__file__)) + os.sep
PY3 = sys.version_inf... | [
37811,
198,
18170,
14,
87,
918,
1008,
62,
43167,
13,
9078,
198,
198,
47307,
1398,
284,
15550,
8379,
6167,
263,
198,
220,
1635,
8105,
13508,
257,
8187,
4331,
62,
1676,
7012,
3419,
2446,
198,
220,
1635,
4149,
82,
11389,
1143,
4981,
198,... | 2.899123 | 228 |
# File: preference_graph.py
# Author: Michael Huelsman
# Created: 8 July 2019
# Purpose:
# Builds classes which are useful for handling induced preference graphs.
import sys, os
sys.path.insert(0, os.path.abspath('..'))
from examples.relation import Relation
# Precond:
# domain is a list of integers indic... | [
2,
9220,
25,
12741,
62,
34960,
13,
9078,
198,
2,
6434,
25,
3899,
11256,
1424,
805,
198,
2,
15622,
25,
807,
2901,
13130,
198,
2,
32039,
25,
198,
2,
220,
220,
10934,
82,
6097,
543,
389,
4465,
329,
9041,
18268,
12741,
28770,
13,
198,... | 2.608897 | 1,079 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
if __name__ == "__main__":
main()
| [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 3.375 | 40 |
from sandhill.utils import solr
| [
6738,
6450,
12639,
13,
26791,
1330,
1540,
81,
198,
220,
220,
220,
220,
198
] | 2.642857 | 14 |
"""
author: minujeong
"""
import time
import moderngl as mg
import numpy as np
import imageio as ii
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from PyQt5 import QtWidgets
from PyQt5 import QtCore
if __name__ == "__main__":
main()
| [
37811,
198,
9800,
25,
949,
84,
18015,
506,
198,
37811,
198,
198,
11748,
640,
198,
198,
11748,
7019,
782,
75,
355,
10527,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2939,
952,
355,
21065,
198,
198,
6738,
26856,
13,
672,
2655,
690,... | 3.041667 | 96 |
from django.contrib import admin
from django.urls import path,include
from . import views
urlpatterns = [
path('new_item/', views.new_item_view, name='new_item'),
path('details/<int:item_id>', views.item_details, name='details'),
path('delete/<int:item_id>',views.delete_item, name='delete'),
]
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
17256,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3605,
62,
9186,
14,
3256,
... | 2.774775 | 111 |
""" A minimal application using the ZMQ-based terminal IPython frontend.
This is not a complete console app, as subprocess will not be able to receive
input, there is no real readline support, among other limitations.
Authors:
* Min RK
* Paul Ivanov
"""
#------------------------------------------------------------... | [
37811,
317,
10926,
3586,
1262,
262,
1168,
49215,
12,
3106,
12094,
6101,
7535,
2166,
437,
13,
198,
198,
1212,
318,
407,
257,
1844,
8624,
598,
11,
355,
850,
14681,
481,
407,
307,
1498,
284,
3328,
198,
15414,
11,
612,
318,
645,
1103,
1... | 3.974963 | 679 |
import json
from asyncio import shield
from aiohttp import WSMsgType
from .base import ConnectionClosedException
from .base_async import BaseAsyncConnectionContext, BaseAsyncSubscriptionServer
| [
11748,
33918,
198,
6738,
30351,
952,
1330,
7614,
198,
198,
6738,
257,
952,
4023,
1330,
25290,
50108,
6030,
198,
198,
6738,
764,
8692,
1330,
26923,
2601,
1335,
16922,
198,
6738,
764,
8692,
62,
292,
13361,
1330,
7308,
42367,
32048,
21947,
... | 4.104167 | 48 |
"""A command-line utility for creating jobs.
.. note::
In the examples below, it is assumed that the spalloc server hostname and a
suitable owner name have been specified in a :py:mod:`~spalloc.config`
file.
Basic usage
-----------
By default, the ``spalloc`` command allocates a job according to the
co... | [
37811,
32,
3141,
12,
1370,
10361,
329,
4441,
3946,
13,
198,
198,
492,
3465,
3712,
628,
220,
220,
220,
554,
262,
6096,
2174,
11,
340,
318,
9672,
326,
262,
599,
32332,
4382,
2583,
3672,
290,
257,
198,
220,
220,
220,
11080,
4870,
1438,... | 2.905845 | 2,857 |
import numpy as np
import pickle as pkl
import scipy.sparse as sp
import sys
import os
import networkx as nx
from utils import *
import json
from networkx.readwrite import json_graph
# 'cora', 'citeseer', 'pubmed'
if __name__=="__main__":
data_name = 'cora'
adj, features, y_train, y_val, y_test, train_mask, ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
355,
279,
41582,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
599,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
3127,
87,
355,
299,
87,
198,
6738,
3384,
4487,
1330,
1635,
198... | 2.170807 | 644 |
# -*- coding: utf-8 -*-
NUMBER_OF_CONSECUTIVE_ODD = 6
if __name__ == '__main__':
main() | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
41359,
13246,
62,
19238,
62,
10943,
23683,
3843,
9306,
62,
3727,
35,
796,
718,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
... | 1.978723 | 47 |
# coding: utf-8
import os,glob,re
import numpy as np
import tensorflow as tf
from numpy.random import randint, choice
from multiprocessing import Pool
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
#import horovod.tensorflow as hvd
#hvd_valid = True
#hvd.init()
folder="./"
epochs = 50
noise_dim = (64, 64, 1)
... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
628,
198,
11748,
28686,
11,
4743,
672,
11,
260,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
299,
32152,
13,
25120,
1330,
43720,
600,
11,
3572,
1... | 2.024724 | 2,265 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
220,
220,
15069,
357,
66,
8,
2864,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 2.756786 | 921 |
import logging
import synapse.lib.module as s_module
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
198,
11748,
6171,
7512,
13,
8019,
13,
21412,
355,
264,
62,
21412,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198
] | 2.967742 | 31 |
import socket
import sys
import hashlib
import json
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket successfully created')
except socket.error as err:
print('socket creation failed with error %s' % err)
port = 15000
try:
host_ip = socket.gethostbyname('localhost')
except socket.gaierro... | [
11748,
17802,
198,
11748,
25064,
198,
11748,
12234,
8019,
198,
11748,
33918,
198,
198,
28311,
25,
198,
197,
82,
735,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
198,
197,
... | 2.650568 | 352 |
#Apodo.py
#By Christian Kruep
"""A pseudonym generator"""
from __future__ import print_function
import random
import time
def main():
"""Chooses two names from the two seperated
word banks and prints them to the command line."""
first_bank = ('Gus', 'Enoch', 'Flo', 'Theoden', 'Pippin', 'Samwise',
... | [
2,
25189,
24313,
13,
9078,
198,
2,
3886,
4302,
13685,
518,
79,
198,
198,
37811,
32,
48129,
17301,
37811,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
4738,
198,
11748,
640,
198,
198,
4299,
1388,
33529,
198,
220,
220... | 2.067708 | 960 |
# Import modules
from ctypes import windll
from time import sleep
"""
Block keyboard & mouse
Admin rights is required.
""" | [
198,
2,
17267,
13103,
198,
6738,
269,
19199,
1330,
2344,
297,
198,
6738,
640,
1330,
3993,
198,
198,
37811,
198,
12235,
10586,
1222,
10211,
198,
46787,
2489,
318,
2672,
13,
198,
37811
] | 3.875 | 32 |