content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import pandas as pd
from .base import BaseIsolatedDataset
from ..data_readers import load_frames_from_folder
from bs4 import BeautifulSoup
import json
class ASLLVDDataset(BaseIsolatedDataset):
"""
American Isolated Sign language dataset from the paper:
`The American Sign Language Lexicon Vi... | [
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
764,
8692,
1330,
7308,
3792,
50027,
27354,
292,
316,
198,
6738,
11485,
7890,
62,
961,
364,
1330,
3440,
62,
37805,
62,
6738,
62,
43551,
198,
6738,
275,
82,
19,
1330,
23762,... | 2.895349 | 172 |
import sys
import random
from mpy_decimal.mpy_decimal import *
# Imports modules and it sets limits depending on the implementation
if sys.implementation.name == "cpython":
import traceback
import time
iteration_limit: int = 100000
iteration_limit2: int = 40000
pi_decimals: int = 1000
if sys.implem... | [
11748,
25064,
198,
11748,
4738,
198,
6738,
285,
9078,
62,
12501,
4402,
13,
3149,
88,
62,
12501,
4402,
1330,
1635,
198,
198,
2,
1846,
3742,
13103,
290,
340,
5621,
7095,
6906,
319,
262,
7822,
198,
361,
25064,
13,
320,
32851,
13,
3672,
... | 2.647157 | 1,196 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from unittest import TestCase
import mock
import json
import urllib2
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from libdict.macmillan import models, query_site
words = [
'take-on', # multiple keys in last sense
'yours', # intr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
11748,
15290,
198,
11748,
33918,
198,
198,
11748,
2956,
297,
571,
17,... | 2.56087 | 690 |
# kpbochenek@gmail.com
def trns():
""" calculates triangular numbers up to 1000"""
result = []
c = 0
for i in range(1000):
c = c+i
if c > 2000: break
result.append(c)
return result[1:]
trnsx = trns()
if __name__ == '__main__':
# These "asserts" using only for self-ch... | [
2,
479,
40842,
420,
29473,
74,
31,
14816,
13,
785,
628,
198,
4299,
491,
5907,
33529,
198,
220,
220,
220,
37227,
43707,
46963,
3146,
510,
284,
8576,
37811,
198,
220,
220,
220,
1255,
796,
17635,
198,
220,
220,
220,
269,
796,
657,
198,... | 2.358156 | 282 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2020-08-21
# @Filename: test_time.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
import astropy.time
import pytest
from coordio import IERS, Time
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
2488,
13838,
25,
36997,
311,
21162,
2395,
89,
12,
26552,
1455,
78,
357,
13528,
1455,
13210,
31,
84,
86,
... | 2.357724 | 123 |
import heapq
from collections import defaultdict
import random
import csv
from tqdm import tqdm
if __name__ == '__main__':
exportNames = ['export_test', 'export_test1', 'export_test2', 'export_test3', 'export_test4']
resultNames = ['result_test', 'result_test1', 'result_test2', 'result_test3'... | [
11748,
24575,
80,
201,
198,
6738,
17268,
1330,
4277,
11600,
201,
198,
11748,
4738,
201,
198,
11748,
269,
21370,
201,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
1... | 2.408072 | 223 |
import json
from flask import Flask, make_response, redirect, request
app = Flask(__name__)
PRODUCTION_DOMAIN = 'readthedocs.org'
@app.route('/')
if __name__ == '__main__':
app.run()
| [
11748,
33918,
198,
198,
6738,
42903,
1330,
46947,
11,
787,
62,
26209,
11,
18941,
11,
2581,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
4805,
28644,
2849,
62,
39170,
29833,
796,
705,
961,
83,
704,
420,
82,
13,
2398,
... | 2.621622 | 74 |
from behave.model_core import Status
from behave_django.testcase import BehaviorDrivenTestCase
from rest_framework.test import APIClient
| [
6738,
17438,
13,
19849,
62,
7295,
1330,
12678,
198,
6738,
17438,
62,
28241,
14208,
13,
9288,
7442,
1330,
20181,
20564,
574,
14402,
20448,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2149,
75,
1153,
628,
198
] | 3.756757 | 37 |
import numpy as np
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def inputs(dataset, is_training=False, num_epochs=None):
"""Reads input data num_epochs times.
Args:
train: Selects between the training (True) and validation (False) data.
num_epochs: Number of times to read the input data, or 0/Non... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
38948,
50,
796,
48700,
13,
1324,
13,
33152,
13,
38948,
50,
628,
628,
198,
4299,
17311,
7,
19608,
292,
316,
11,
318,
62,
34409,
28,
25101,
11,
997,
62,
53... | 2.640604 | 729 |
"""Main module."""
import os
from pathlib import Path, PurePath
from rpgmaker_mv_decoder.exceptions import FileFormatError
import sys
import click
import struct
import uuid
import magic
RPG_MAKER_MV_MAGIC = "5250474d560000000003010000000000"
PNG_HEADER = "89504e470d0a1a0a0000000d49484452"
OCT_STREAM = "application/oct... | [
37811,
13383,
8265,
526,
15931,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
11,
17129,
15235,
198,
6738,
374,
6024,
10297,
62,
76,
85,
62,
12501,
12342,
13,
1069,
11755,
1330,
9220,
26227,
12331,
198,
11748,
25064,
198,
11748,
... | 2.830508 | 118 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
import random
import string
from model.project import Project
| [
11748,
4738,
198,
11748,
4731,
198,
6738,
2746,
13,
16302,
1330,
4935,
628,
198
] | 4.571429 | 14 |
from pathlib import Path
from typing import Union
from .pano_features_reader import PanoFeaturesReader
from .features_reader import FeaturesReader
from .bnb_features_reader import BnBFeaturesReader
| [
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4479,
198,
6738,
764,
79,
5733,
62,
40890,
62,
46862,
1330,
350,
5733,
23595,
33634,
198,
6738,
764,
40890,
62,
46862,
1330,
17571,
33634,
198,
6738,
764,
31971,
62,
40890,
62,
4686... | 4.081633 | 49 |
"""Test the environment module."""
import os
import glob
from tqdm import tqdm
import numpy as np
import imageio
from tf_agents.environments.utils import validate_py_environment
from tf_agents.environments.tf_py_environment import TFPyEnvironment
from tf_agents.policies.random_py_policy import RandomPyPolicy
from tf_... | [
37811,
14402,
262,
2858,
8265,
526,
15931,
628,
198,
11748,
28686,
198,
11748,
15095,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2939,
952,
198,
6738,
48700,
62,
49638,
13,
268,
1210... | 2.790627 | 1,643 |
# ****************************************************************************************
# ****************************************************************************************
#
# Name: harmonica.py
# Purpose: Base Harmonica Class
# Date: 9th August 2018
# Author: Paul Robson (paul@robsons.org.uk)
#
# ****... | [
2,
41906,
17174,
8412,
4557,
198,
2,
41906,
17174,
8412,
4557,
198,
2,
198,
2,
197,
197,
5376,
25,
197,
197,
29155,
32752,
13,
9078,
198,
2,
197,
197,
30026,
3455,
25,
197,
14881,
17925,
32752,
5016,
198,
2,
197,
197,
10430,
25,
1... | 3 | 378 |
import tensorflow.keras.layers as KL
from tensorflow.keras.layers import *
import sys, reg, image_warp
from tensorflow.keras.models import Model, load_model
import numpy as np
import scipy.stats as st
import tensorflow as tf
from scipy import signal
"""
Gaussian kernel
"""
def gkern2(n=41, std=20., normalised=True):
... | [
11748,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
355,
48253,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
1635,
198,
11748,
25064,
11,
842,
11,
2939,
62,
86,
5117,
198,
6738,
11192,
273,
11125,
13,
6122,
29... | 2.505747 | 435 |
import os,sys
# change the path accoring to the test folder in system
from datetime import datetime
import copy
import json
import requests
import time
import pytest
import ld_data
import sys
# change it by broker ip and port
brokerIp="http://localhost:8070"
discoveryIp="http://localhost:8090"
print("Testing of NGSI-... | [
11748,
28686,
11,
17597,
198,
2,
1487,
262,
3108,
697,
3255,
284,
262,
1332,
9483,
287,
1080,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
4866,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
640,
198,
11748,
12972,
9288,
198,... | 3.534254 | 1,737 |
from django.shortcuts import render, redirect
from django.contrib import messages
from django.http import HttpResponse
from .models import Register
from django.contrib.auth.forms import UserCreationForm
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
764,
27530,
1330,
17296,
198,
6738,
42625,
14208,
13,
... | 3.898305 | 59 |
"""Classes for Piezo support."""
from abc import abstractmethod
from datetime import timedelta
from enum import Enum
from typing import Type, Union
from j5.components.component import Component, Interface
class Note(float, Enum):
"""An enumeration of notes.
An enumeration of notes from scientific pitch
... | [
37811,
9487,
274,
329,
21690,
10872,
1104,
526,
15931,
198,
198,
6738,
450,
66,
1330,
12531,
24396,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
5994,
11,
4479,
198,
198,
6738,
47... | 2.500732 | 1,366 |
# Generated by Django 2.0.2 on 2018-03-19 05:27
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
17,
319,
2864,
12,
3070,
12,
1129,
8870,
25,
1983,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import os
from redis import Redis
import rq
from .utils import load_secret
| [
11748,
28686,
198,
6738,
2266,
271,
1330,
2297,
271,
198,
11748,
374,
80,
198,
6738,
764,
26791,
1330,
3440,
62,
21078,
628,
628
] | 3.391304 | 23 |
import sys
# encoding=utf-8
__author__ = 'Hinsteny'
# Set maximum recursion depth exceeded value
sys.setrecursionlimit(100)
class Singleton(object):
"""
Implements the Singleton pattern by use /__new__/ method, this will be very simple
"""
if __name__ == '__main__':
a = A('apple')
print(id(a))... | [
11748,
25064,
198,
2,
21004,
28,
40477,
12,
23,
198,
834,
9800,
834,
796,
705,
39,
8625,
28558,
6,
198,
198,
2,
5345,
5415,
664,
24197,
6795,
20672,
1988,
198,
17597,
13,
2617,
8344,
24197,
32374,
7,
3064,
8,
628,
198,
4871,
5573,
... | 2.268551 | 283 |
from containers import SDContainer
from dependency_injector.wiring import Provide, inject
from models import OnPathway
from .mutation_type import mutation
from authentication.authentication import needsAuthorization
from graphql.type import GraphQLResolveInfo
from datetime import datetime, timedelta
from config import ... | [
6738,
16472,
1330,
9834,
29869,
198,
6738,
20203,
62,
259,
752,
273,
13,
86,
3428,
1330,
44290,
11,
8677,
198,
6738,
4981,
1330,
1550,
15235,
1014,
198,
6738,
764,
76,
7094,
62,
4906,
1330,
15148,
198,
6738,
18239,
13,
41299,
3299,
13... | 3.925373 | 134 |
import os.path
_PATH_PREFIX = os.path.dirname(os.path.realpath(__file__))
_TEMPLATE_PATH = os.path.join(_PATH_PREFIX, 'tmpl')
_TEMPLATE_EXT = '.jinja'
_EPUB_SKELETON_PATH = os.path.join(_PATH_PREFIX, 'epub')
_BASIC_CH_PAR_STYLE = 'par-indent'
_FIRST_CH_PAR_STYLE = 'texttop'
_DROP_CAP_STYLE = 'dropcap'
_CLEAR_STYLE... | [
11748,
28686,
13,
6978,
198,
198,
62,
34219,
62,
47,
31688,
10426,
796,
220,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
4008,
198,
62,
51,
3620,
6489,
6158,
62,
34219,
796,
220,
28686,
1... | 1.968912 | 193 |
from model import Model
from linear_regression import LinearRegression
from perceptron import Perceptron
from perceptron_kernel import PerceptronKernel
| [
198,
198,
6738,
2746,
1330,
9104,
198,
198,
6738,
14174,
62,
2301,
2234,
1330,
44800,
8081,
2234,
198,
6738,
34953,
1313,
1330,
2448,
984,
1313,
198,
6738,
34953,
1313,
62,
33885,
1330,
2448,
984,
1313,
42,
7948,
628
] | 4.105263 | 38 |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
33160,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 2.580492 | 1,261 |
#!/bin/python
import time
from ctypes import c_uint64, windll, c_uint32, c_void_p, c_char, Structure, c_long, c_ulong, POINTER, sizeof, c_size_t, c_wchar, c_int, c_bool, WinDLL
from ctypes.wintypes import *
from pprint import pprint
import win32api
import win32con
import pywintypes
import win32process
from hexdump imp... | [
2,
48443,
8800,
14,
29412,
198,
11748,
640,
198,
6738,
269,
19199,
1330,
269,
62,
28611,
2414,
11,
2344,
297,
11,
269,
62,
28611,
2624,
11,
269,
62,
19382,
62,
79,
11,
269,
62,
10641,
11,
32522,
11,
269,
62,
6511,
11,
269,
62,
3... | 2.282642 | 651 |
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import abc
import re
import semver
from reframe.core.warnings import user_deprecation_warning
def parse(version_str):
'... | [
2,
15069,
1584,
12,
1238,
1828,
14780,
2351,
3115,
785,
48074,
9072,
357,
34,
6173,
50,
14,
20702,
43412,
8,
198,
2,
797,
19778,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
38559,
24290,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
... | 2.68932 | 824 |
#
import unittest
from webtest import TestApp
from zope import component
from zope.principalannotation.utility import PrincipalAnnotationUtility
from zope.principalannotation.interfaces import IPrincipalAnnotationUtility
| [
2,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
3992,
9288,
1330,
6208,
4677,
198,
198,
6738,
1976,
3008,
1330,
7515,
198,
6738,
1976,
3008,
13,
1050,
1939,
8521,
1236,
14221,
13,
315,
879,
1330,
32641,
2025,
38983,
18274,
879,
198... | 3.476923 | 65 |
'''
Given a nested list of integers, return the sum of all integers in the list weighted by their depth.
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
Example 1:
Given the list [[1,1],2,[1,1]], return 10. (four 1's at depth 2, one 2 at depth 1)
Example 2:
Given t... | [
7061,
6,
198,
15056,
257,
28376,
1351,
286,
37014,
11,
1441,
262,
2160,
286,
477,
37014,
287,
262,
1351,
26356,
416,
511,
6795,
13,
198,
198,
10871,
5002,
318,
2035,
281,
18253,
11,
393,
257,
1351,
1377,
3025,
4847,
743,
635,
307,
3... | 2.790254 | 472 |
# Copyright (c) 2021 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,
33448,
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,
... | 3.567164 | 201 |
from .deepmimic_a3c_base import *
# network_opts["init_sigma"] = 0.05
network = "ContinuousA2CNetwork" | [
6738,
764,
22089,
76,
320,
291,
62,
64,
18,
66,
62,
8692,
1330,
1635,
198,
198,
2,
3127,
62,
404,
912,
14692,
15003,
62,
82,
13495,
8973,
796,
657,
13,
2713,
198,
27349,
796,
366,
17875,
5623,
32,
17,
34,
26245,
1
] | 2.452381 | 42 |
from ._FibonacciAction import *
from ._FibonacciActionFeedback import *
from ._FibonacciActionGoal import *
from ._FibonacciActionResult import *
from ._FibonacciFeedback import *
from ._FibonacciGoal import *
from ._FibonacciResult import *
from ._IoTSensor import *
| [
6738,
47540,
37,
571,
261,
44456,
12502,
1330,
1635,
198,
6738,
47540,
37,
571,
261,
44456,
12502,
18332,
1891,
1330,
1635,
198,
6738,
47540,
37,
571,
261,
44456,
12502,
49045,
1330,
1635,
198,
6738,
47540,
37,
571,
261,
44456,
12502,
2... | 3.190476 | 84 |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
"""
A modified data container for storing associating data with a project.
Spec:
The `Project` class should have da... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
5436,
12,
20854,
694,
12,
6310,
270,
315,
277,
25151,
22633,
69,
669,
354,
2150,
402,
2022,
39,
532,
22476,
864,
24310,
8495,
357,
24187,
8,
2732,
198,
2,
4307,
6169,
73... | 3.353093 | 388 |
"""Aqara Roller Shade Driver E1 device."""
from __future__ import annotations
from typing import Any
from zigpy import types as t
from zigpy.profiles import zha
from zigpy.zcl import foundation
from zigpy.zcl.clusters.closures import WindowCovering
from zigpy.zcl.clusters.general import (
Alarms,
AnalogOutput... | [
37811,
32,
80,
3301,
24945,
48747,
12434,
412,
16,
3335,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
1976,
328,
9078,
1330,
3858,
355,
256,
198,
6738,
1976,
328,
9078,
13,
... | 2.01074 | 4,190 |
from flask import Flask, render_template, request, jsonify
from guesslang import Guess
app = Flask(__name__)
app.config.update(dict(DEBUG=True, SECRET_KEY='development key'))
guess = Guess()
@app.route('/', methods=['GET', 'POST'])
@app.route('/language-name', methods=['POST'])
| [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
33918,
1958,
198,
198,
6738,
4724,
17204,
1330,
37571,
628,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
11250,
13,
19119,
7,
11600,
7,
30531,
28,
17821,
11... | 3 | 96 |
"""Send msg on twitter."""
import sys
import re
from collections import namedtuple
from datetime import datetime
import time
import logging
import tweepy
import pytz
from latubot import cfg
# Twitter keys
TwitterKeys = namedtuple(
"TwitterKeys", "consumer_key consumer_secret access_key access_secret"
)
logger... | [
37811,
25206,
31456,
319,
17044,
526,
15931,
198,
198,
11748,
25064,
198,
11748,
302,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
640,
198,
11748,
18931,
198,
198,
11748,
4184,
538,
88,
... | 2.376685 | 1,261 |
from core import views
from django.urls import path
app_name = 'core'
urlpatterns = [
path('', views.HomeView.as_view(), name='home'),
path('sobre-nos', views.AboutView.as_view(), name='about'),
path('dashboard', views.DashboardView.as_view(), name='dashboard'),
]
| [
6738,
4755,
1330,
5009,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
1324,
62,
3672,
796,
705,
7295,
6,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
16060,
7680,
13,
292,
62,
... | 2.79 | 100 |
#!/usr/bin/env p @staticmethodython
import math
import numpy as np
from dataio import readcolumn
import os
import ConfigParser
import logging
| [
2,
48443,
14629,
14,
8800,
14,
24330,
279,
220,
220,
220,
2488,
12708,
76,
2788,
1118,
400,
261,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1366,
952,
1330,
1100,
28665,
198,
11748,
28686,
198,
11748,
17056,
46677... | 3.195652 | 46 |
from load_obj import load_obj
filepath = "cone_simple.obj"
V, T, N, F = load_obj(filepath)
sortedLayers, verticesOrganizedByZ = organize_by_z(V)
coordToIndex = {}
for i in range(len(V)):
coordToIndex[tuple(V[i])] = i
verticesToFace_temp = []
for face in F:
vertices = [face[0][0], face[1][0], face[2][0], ... | [
6738,
3440,
62,
26801,
1330,
3440,
62,
26801,
198,
198,
7753,
6978,
796,
366,
49180,
62,
36439,
13,
26801,
1,
628,
628,
628,
198,
53,
11,
309,
11,
399,
11,
376,
796,
3440,
62,
26801,
7,
7753,
6978,
8,
198,
82,
9741,
43,
6962,
11... | 2.330798 | 263 |
# pylint: disable=redefined-outer-name
from uuid import uuid1
import pytest
from slash._compat import iteritems, OrderedDict
from slash.core.local_config import LocalConfig
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
2,
279,
2645,
600,
25,
15560,
28,
445,
18156,
12,
39605,
12,
3672,
198,
6738,
334,
27112,
1330,
334,
27112,
16,
198,
198,
11748,
12972,
9288,
198,
6738,
24632,
13557,
5589,
265,
1330,
11629,
23814,
11,
14230,
1068,
35,
713,
198,
6738,... | 2.924051 | 79 |
import argparse
from model import Model
parser = argparse.ArgumentParser(description="UniMVSNet args")
# network
parser.add_argument("--fea_mode", type=str, default="fpn", choices=["fpn", "unet"])
parser.add_argument("--agg_mode", type=str, default="variance", choices=["variance", "adaptive"])
parser.add_argument("--... | [
11748,
1822,
29572,
198,
6738,
2746,
1330,
9104,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
2625,
3118,
72,
44,
20304,
7934,
26498,
4943,
198,
198,
2,
3127,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
5036,
6... | 2.955307 | 1,611 |
"""
FactSet Formula API
**FactSet Formula API** FactSet’s Formula API is a modern, flexible, formula-based API that enables users to access FactSet’s wide range of financial data and content. The API offers two endpoints, one optimized for time-series analysis and one designed for cross-sectional analysis, p... | [
37811,
198,
220,
220,
220,
19020,
7248,
19639,
7824,
628,
220,
220,
220,
220,
12429,
29054,
7248,
19639,
7824,
1174,
220,
19020,
7248,
447,
247,
82,
19639,
7824,
318,
257,
3660,
11,
12846,
11,
10451,
12,
3106,
7824,
326,
13536,
2985,
... | 3.185537 | 14,838 |
## **************
## Copyright 2015 MIT Lincoln Laboratory
## Project: PACE
## Authors: CS
## Description: Authenticated skiplists embedded in Accumulo
## Modifications:
## Date Name Modification
## ---- ---- ------------
## 10 Feb 2015 CS Original file
## **************
import os
import ... | [
2235,
220,
46068,
1174,
198,
2235,
220,
15069,
1853,
17168,
12406,
18643,
198,
2235,
220,
4935,
25,
350,
11598,
198,
2235,
220,
46665,
25,
9429,
198,
2235,
220,
12489,
25,
31885,
3474,
19984,
489,
1023,
14553,
287,
6366,
388,
43348,
198... | 2.314129 | 2,916 |
# -*- coding:utf-8 -*-
# https://leetcode.com/problems/binary-tree-inorder-traversal/description/
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
39491,
12,
21048,
12,
259,
2875,
12,
9535,
690,
282,
14,
11213,
14,
198,
198,
2,
30396,
329,
257,
13934,
55... | 2.310345 | 116 |
import os
from ranger.api.commands import Command
from ranger.core.loader import CommandLoader
class select(Command):
"""
:select
Select a file or a directory under current working directory with `find` and `fzf`.
"""
class locate(Command):
"""
:locate
Find a file system-wide with `ripgr... | [
11748,
28686,
198,
6738,
43570,
13,
15042,
13,
9503,
1746,
1330,
9455,
198,
6738,
43570,
13,
7295,
13,
29356,
1330,
9455,
17401,
198,
198,
4871,
2922,
7,
21575,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1058,
19738,
628,
22... | 2.956897 | 116 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=missing-module-docstring
ANSIBLE_METADATA = {'metadata_version': '0.1', 'status': ['preview'], 'supported_by': 'community'}
DOCUMENTATION = '''
---
module: iida.local.ios_ip_acl
short_description: IOS ip access-list config generator
version_added: 2.9
des... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
21412,
12,
15390,
8841,
198,
198,
15037,
34563,
62,
47123,
2885,
13563,
796,
13... | 2.451158 | 993 |
"""
Contains the Flask extension for Stack Sentinel.
Installation is simple. The extension will register itself with the root logger.
app.config['STACKSENTINEL_ACCOUNT_TOKEN'] = 'YOUR ACCOUNT TOKEN'
app.config['STACKSENTINEL_PROJECT_TOKEN'] = 'YOUR PROJECT TOKEN'
>>> # app is a Flask app
>>> app.config['STACKSENTINEL... | [
37811,
198,
4264,
1299,
262,
46947,
7552,
329,
23881,
26716,
13,
198,
198,
30838,
318,
2829,
13,
383,
7552,
481,
7881,
2346,
351,
262,
6808,
49706,
13,
198,
1324,
13,
11250,
17816,
2257,
8120,
50,
3525,
1268,
3698,
62,
26861,
28270,
6... | 3.007619 | 525 |
VOLUME_SQL = """
SELECT {aggregate_operation} as data, toDateTime({interval}({timestamp}), 'UTC') as date from events {event_join} where team_id = {team_id} and event = %(event)s {filters} {parsed_date_from} {parsed_date_to} GROUP BY {interval}({timestamp})
"""
VOLUME_ACTIONS_SQL = """
SELECT {aggregate_operation} as ... | [
44558,
38340,
62,
17861,
796,
37227,
198,
46506,
1391,
9460,
49373,
62,
27184,
92,
355,
1366,
11,
284,
10430,
7575,
15090,
3849,
2100,
92,
15090,
16514,
27823,
92,
828,
705,
17429,
11537,
355,
3128,
422,
2995,
1391,
15596,
62,
22179,
92... | 2.715543 | 341 |
import os
from Tests.test_utils import checked_type
| [
11748,
28686,
198,
6738,
30307,
13,
9288,
62,
26791,
1330,
10667,
62,
4906,
628,
628,
628,
628,
628
] | 3.388889 | 18 |
import json
import pytest
from ...src.common.python.substitutions import _lookup, substitute_job_data, substitute_into_filenames
@pytest.mark.parametrize("target, expect", [
("string", "string_value"),
("number", "99"),
("list", [1,2,3]),
("dict", {"a":1,"b":2}),
])
| [
11748,
33918,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
2644,
10677,
13,
11321,
13,
29412,
13,
7266,
301,
270,
3508,
1330,
4808,
5460,
929,
11,
15373,
62,
21858,
62,
7890,
11,
15373,
62,
20424,
62,
10379,
268,
1047,
628,
198,
31,
... | 2.54386 | 114 |
# test dict iterator
for k, v in {"a":1, "b":2, "c":3}.items():
print(k, v)
| [
2,
1332,
8633,
41313,
198,
1640,
479,
11,
410,
287,
19779,
64,
1298,
16,
11,
366,
65,
1298,
17,
11,
366,
66,
1298,
18,
27422,
23814,
33529,
198,
220,
220,
220,
3601,
7,
74,
11,
410,
8,
198
] | 2.105263 | 38 |
"""
Management command to make sure the permissions exist
for all kinds of proposals.
"""
from django.core.management.base import BaseCommand
| [
37811,
198,
48032,
3141,
284,
787,
1654,
262,
21627,
2152,
198,
1640,
477,
6982,
286,
11628,
13,
198,
37811,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
628
] | 4.333333 | 33 |
""" Pure-SCIP evaluations (no learning involved). """
import os
import argparse
import pickle
from src.environments import SCIPEvalEnv
import multiprocessing as mp
import pdb
import faulthandler
faulthandler.enable()
# solver parametric setting, key ('sandbox' or 'default') to be specified in argparse --setting... | [
37811,
17129,
12,
6173,
4061,
34109,
357,
3919,
4673,
2950,
737,
37227,
198,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
198,
11748,
2298,
293,
198,
198,
6738,
12351,
13,
268,
12103,
1330,
6374,
4061,
36,
2100,
4834,
85,
198,
198,
... | 2.268371 | 1,252 |
###############################################################################
# Name: elistctrl.py #
# Purpose: Base ListCtrl #
# Author: Cody Precord <cprecord@editra.org> #
... | [
29113,
29113,
7804,
4242,
21017,
198,
2,
6530,
25,
1288,
396,
44755,
13,
9078,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.213277 | 2,832 |
"""
Test expression operations in class constrained protocols
"""
from __future__ import print_function
import os
import time
import re
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
| [
37811,
198,
14402,
5408,
4560,
287,
1398,
31070,
19565,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
628,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
302,
198,
11748,
32660,
9945,
198,
11748,
32660,
67,
1443,
... | 3.2 | 85 |
#
# @lc app=leetcode.cn id=52 lang=python3
#
# [52] N皇后 II
#
# https://leetcode-cn.com/problems/n-queens-ii/description/
#
# algorithms
# Hard (82.18%)
# Likes: 213
# Dislikes: 0
# Total Accepted: 51.5K
# Total Submissions: 62.7K
# Testcase Example: '4'
#
# n 皇后问题研究的是如何将 n 个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击。
#
#
... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
13,
31522,
4686,
28,
4309,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
4309,
60,
399,
19021,
229,
28938,
236,
2873,
198,
2,
198,
2,
3740,
1378,
293,
316,
8189,
12,
31522,
13,
785,
... | 1.219497 | 1,590 |
import datetime
import json
import logging, sys
try:
from src.blynklib import Blynk
except ModuleNotFoundError:
from blynklib import Blynk
def prev_date_wday(wday):
""" returns datetime object of last date at 00:00 which has the weekday given by wday.
E.g. if today is Friday, 20th of June and wday = 0... | [
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
18931,
11,
25064,
198,
28311,
25,
198,
220,
220,
220,
422,
12351,
13,
65,
6213,
74,
8019,
1330,
347,
6213,
74,
198,
16341,
19937,
3673,
21077,
12331,
25,
198,
220,
220,
220,
422,
275,
... | 2.778022 | 455 |
from .. import *
from urlparse import urljoin
from werkzeug.contrib.atom import AtomFeed
from flask import jsonify
# Endpoint-related definitions
@app.route('/recent_items.atom')
@app.route('/recent_items.json')
| [
6738,
11485,
1330,
1635,
198,
6738,
19016,
29572,
1330,
19016,
22179,
198,
6738,
266,
9587,
2736,
1018,
13,
3642,
822,
13,
37696,
1330,
33102,
18332,
198,
6738,
42903,
1330,
33918,
1958,
198,
198,
2,
5268,
4122,
12,
5363,
17336,
628,
19... | 3.15942 | 69 |
#importing libraries
from urlparse import urlparse
import urlparse
import re
import urllib2
import urllib
from xml.dom import minidom
import csv
import pygeoip
import urllib2
import numpy as np
import csv
import os
import pandas as pd
#various feature extraction methods
opener = urllib2.build_opener()
... | [
2,
11748,
278,
12782,
201,
198,
6738,
19016,
29572,
1330,
19016,
29572,
201,
198,
11748,
19016,
29572,
201,
198,
11748,
302,
201,
198,
11748,
2956,
297,
571,
17,
201,
198,
11748,
2956,
297,
571,
201,
198,
6738,
35555,
13,
3438,
1330,
... | 2.462963 | 162 |
from .cluster_bandit import ClusterBandit
__all__ = [
'ClusterBandit'
]
| [
6738,
764,
565,
5819,
62,
3903,
270,
1330,
38279,
31407,
270,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
2601,
5819,
31407,
270,
6,
198,
60,
198
] | 2.483871 | 31 |
import enum
chart_types = []
for p in ProductCode:
for c in Candlestick:
chart_types.append((f'{p.name}_{c.name}', enum.auto()))
ChartType = enum.Enum('ChartType', chart_types)
| [
11748,
33829,
628,
628,
628,
628,
198,
198,
40926,
62,
19199,
796,
17635,
198,
1640,
279,
287,
8721,
10669,
25,
198,
220,
220,
220,
329,
269,
287,
15518,
32712,
624,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8262,
62,
19199,
13,
... | 2.469136 | 81 |
from dd import *
from gen_feats import *
from util import *
| [
6738,
49427,
1330,
1635,
198,
6738,
2429,
62,
5036,
1381,
1330,
1635,
198,
6738,
7736,
1330,
1635,
198
] | 3.333333 | 18 |
import asyncio
from aiohttp_xmlrpc.client import ServerProxy
loop = asyncio.get_event_loop()
client = ServerProxy("http://127.0.0.1:8080/", loop=loop)
if __name__ == "__main__":
loop.run_until_complete(main())
| [
11748,
30351,
952,
198,
6738,
257,
952,
4023,
62,
19875,
81,
14751,
13,
16366,
1330,
9652,
44148,
628,
198,
26268,
796,
30351,
952,
13,
1136,
62,
15596,
62,
26268,
3419,
198,
16366,
796,
9652,
44148,
7203,
4023,
1378,
16799,
13,
15,
1... | 2.679012 | 81 |
import unittest
import cykhash
| [
11748,
555,
715,
395,
198,
198,
11748,
3075,
14636,
1077,
628
] | 3 | 11 |
import sys
sys.path.append('../../lib')
from UI import *
from tkinter import filedialog
FILE_TYPES=[('PDF files', '.pdf'),
('JPG files', '.jpg'),
('PNG files', '.png'),
('Py files', '*.py'),
('all files', '.*')]
root = BEGIN()
root.title("demo")
root.dimension(500,300... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
40720,
8019,
11537,
198,
198,
6738,
12454,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
198,
25664,
62,
9936,
47,
1546,
41888,
10786,
20456,
3696,
3256,
45... | 2.131579 | 304 |
#!/usr/bin/env python3
"""ares unit tests"""
import unittest
try:
# So this works directly and with test discovery
from core import CVESearch # type: ignore
except ModuleNotFoundError:
from ares import CVESearch
class TestCVEAPI(unittest.TestCase):
"""Test the ares CVESearch interface"""
def tes... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
3565,
4326,
5254,
37811,
198,
198,
11748,
555,
715,
395,
198,
198,
28311,
25,
198,
220,
220,
220,
1303,
1406,
428,
2499,
3264,
290,
351,
1332,
9412,
198,
220,
220,
220,
42... | 2.505814 | 1,204 |
from __future__ import annotations
from typing import Optional, TYPE_CHECKING
from spark_auto_mapper_fhir.fhir_types.list import FhirList
from spark_auto_mapper_fhir.fhir_types.string import FhirString
from spark_auto_mapper_fhir.extensions.extension_base import ExtensionBase
from spark_auto_mapper_fhir.base_types.fh... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
19720,
1330,
32233,
11,
41876,
62,
50084,
2751,
198,
198,
6738,
9009,
62,
23736,
62,
76,
11463,
62,
69,
71,
343,
13,
69,
71,
343,
62,
19199,
13,
4868,
1330,
376,
71,
343,
8053,
198,
... | 2.909643 | 1,483 |
from setuptools import setup, Extension, find_packages
import sys
with open("VERSION") as fp:
package_version = fp.read().strip()
extended_numpy = Extension(
'geometrypy',
sources = [
'profilerTools/geometrypy/geometrypy.c',
]
)
ext_gsl_ridge = Extension(
'gslpyridge',
sources = [... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
27995,
11,
1064,
62,
43789,
198,
11748,
25064,
198,
198,
4480,
1280,
7203,
43717,
4943,
355,
277,
79,
25,
198,
220,
220,
220,
5301,
62,
9641,
796,
277,
79,
13,
961,
22446,
36311,
3419,
198,
1... | 2.213836 | 636 |
import re
from typing import Pattern
class Token:
"""
Base token class from which all useful token classes are derived.
This class is abstract and is intended to be subclassed by user, though
`StringToken` and `RegexToken` should be enough for regular applications.
`Token`'s subclasses must impl... | [
11748,
302,
198,
6738,
19720,
1330,
23939,
628,
198,
4871,
29130,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7308,
11241,
1398,
422,
543,
477,
4465,
11241,
6097,
389,
10944,
13,
628,
220,
220,
220,
770,
1398,
318,
12531,
290,
... | 2.972119 | 538 |
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
# externals
import itertools
# class declaration
class Grid(list):
"""
A logically Cartesian grid implemented as a list with a custom indexing function
"""
# constants
ROW_MAJOR = "row-major"
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
285,
40302,
257,
13,
70,
13,
257,
26884,
85,
6557,
89,
271,
198,
2,
29617,
39795,
198,
2,
357,
66,
8,
7795,
12,
1238,
1828,
477,
2489,
10395,
198,
2,
... | 2.180029 | 2,744 |
#!/usr/bin/env python
# Quick rough & ready maze generator for Minecraft Pi edition.
# Dave Finch 2013
# mcpipy.com retrieved from URL below, written by davef21370
# https://github.com/brooksc/mcpipy/blob/master/davef21370_maze.py
from __future__ import print_function
import mcpi.minecraft as minecraft
i... | [
201,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
201,
198,
2,
12029,
5210,
1222,
3492,
31237,
17301,
329,
24609,
13993,
8313,
13,
201,
198,
2,
9935,
45277,
2211,
201,
198,
201,
198,
2,
285,
13155,
541,
88,
13,
785,
... | 2.113109 | 1,724 |
import pytest
from therandy.rules.history import match, get_new_command
from therandy.types import Command
@pytest.fixture(autouse=True)
@pytest.mark.parametrize('script', ['ls cet', 'daff x'])
@pytest.mark.parametrize('script', ['apt-get', 'nocommand y'])
@pytest.mark.parametrize('script, result', [
('ls c... | [
11748,
12972,
9288,
198,
6738,
10811,
10757,
13,
38785,
13,
23569,
1330,
2872,
11,
651,
62,
3605,
62,
21812,
198,
6738,
10811,
10757,
13,
19199,
1330,
9455,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
2306,
1076,
28,
17821,
8,
628,
1... | 2.574468 | 141 |
import scipy.misc
import numpy as np
| [
11748,
629,
541,
88,
13,
44374,
198,
11748,
299,
32152,
355,
45941,
628,
198
] | 2.785714 | 14 |
# code reference : https://medium.com/datadriveninvestor/using-the-super-resolution-convolutional-neural-network-for-image-restoration-ff1e8420d846
import sys
import os
import cv2
# prepare degraded image by introducing quality distortions via resizing
FACTOR = 2
if __name__ == "__main__":
prepare_images('da... | [
2,
2438,
4941,
1058,
3740,
1378,
24132,
13,
785,
14,
19608,
324,
380,
574,
24859,
273,
14,
3500,
12,
1169,
12,
16668,
12,
29268,
12,
42946,
2122,
282,
12,
710,
1523,
12,
27349,
12,
1640,
12,
9060,
12,
2118,
6944,
12,
487,
16,
68,
... | 2.923497 | 183 |
#Desenvolva um programa que leia o primeiro termo e a razão de uma progressão aritmética(Pa). No final, mostre 10 primeiros termos dessa prograssão.
primeiro = int(input('Primeiro termo: '))
razão = int(input('Razão: '))
decimo = primeiro+(10-1)*razão #Este é o cálculo de progressão aritmética (colocamos 10, por que ... | [
2,
5960,
268,
10396,
6862,
23781,
1430,
64,
8358,
443,
544,
267,
6994,
7058,
3381,
78,
304,
257,
374,
1031,
28749,
390,
334,
2611,
4371,
28749,
610,
270,
76,
25125,
3970,
7,
28875,
737,
1400,
2457,
11,
749,
260,
838,
6994,
72,
4951,... | 2.517045 | 176 |
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | [
2,
38093,
25609,
855,
1303,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.692935 | 368 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Will Thames <@willthames>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
module: k8s_info
short_description... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
357,
66,
8,
2864,
11,
2561,
42521,
32406,
10594,
400,
1047,
29,
198,
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,... | 2.832767 | 1,471 |
#!python
#
#Test for parse_anrl_prototype.py in structure_builders
#
import os
import sys
import pytest
from pymatgen.core import Structure
from monty.serialization import loadfn
try:
import dfttk.structure_builders.parse_anrl_prototype as parse_proto
except:
dfttkhome = os.path.abspath(os.path.join('..'))
... | [
2,
0,
29412,
198,
2,
198,
2,
14402,
329,
21136,
62,
272,
45895,
62,
38124,
13,
9078,
287,
4645,
62,
50034,
198,
2,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
12972,
9288,
198,
6738,
279,
4948,
265,
5235,
13,
7295,
1330,
... | 2.636364 | 176 |
import os, sys
print ("Started as " + os.getlogin())
if os.geteuid() != 0:
os.execvp("sudo", ["sudo"] + [os.environ['_']] + sys.argv)
activate_this_file = os.path.abspath("venv/bin/activate_this.py")
with open(activate_this_file) as f:
exec(f.read(), {'__file__': activate_this_file})
import cherrypy
import log... | [
11748,
28686,
11,
25064,
198,
4798,
5855,
10434,
276,
355,
366,
1343,
28686,
13,
1136,
38235,
28955,
198,
361,
28686,
13,
1136,
12496,
312,
3419,
14512,
657,
25,
198,
220,
220,
220,
28686,
13,
18558,
36133,
7203,
24032,
1600,
14631,
240... | 2.677741 | 301 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging as log
from time import sleep
import requests
| [
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,
18931,
355,
2604,
198,
6738,
640,
1330,
3993,
198,
11748,
7007,
198
] | 2.868421 | 38 |
import math
import torch
from torch.distributions import Normal | [
11748,
10688,
198,
11748,
28034,
198,
6738,
28034,
13,
17080,
2455,
507,
1330,
14435
] | 4.5 | 14 |
r"""
Subsets of Topological Manifolds
The class :class:`ManifoldSubset` implements generic subsets of a
topological manifold. Open subsets are implemented by the class
:class:`~sage.manifolds.manifold.TopologicalManifold` (since an
open subset of a manifold is a manifold by itself), which inherits
from :class:`Manifol... | [
81,
37811,
198,
7004,
28709,
286,
5849,
2770,
1869,
361,
10119,
198,
198,
464,
1398,
1058,
4871,
25,
63,
5124,
361,
727,
7004,
2617,
63,
23986,
14276,
6352,
1039,
286,
257,
198,
4852,
2770,
48048,
13,
4946,
6352,
1039,
389,
9177,
416,... | 2.125959 | 18,895 |
### IMPORT ###
import sys
from flask import Flask, render_template, request, redirect, abort
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
### CONSTANTS ###
ENV = 'development'
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://demouser:demopwd@localhost:5432/udacity-fullstack'
### CODE ... | [
21017,
30023,
9863,
44386,
198,
11748,
25064,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
15614,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
76,
42175,
1330,
... | 2.748555 | 346 |
import asyncio
import sys
import traceback
from datetime import datetime
from logging import DEBUG, INFO
from pathlib import Path
from retry import retry # type: ignore
from lisa.parameter_parser.argparser import parse_args
from lisa.util import constants, get_datetime_path
from lisa.util.logger import create_file_h... | [
11748,
30351,
952,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
18931,
1330,
16959,
11,
24890,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
1005,
563,
1330,
1005,
563,
220,
1303,
... | 2.581197 | 351 |
import os
import sys
import torch
from botorch.settings import debug
from botorch.test_functions.synthetic import Ackley
from torch import Tensor
torch.set_default_dtype(torch.float64)
torch.autograd.set_detect_anomaly(True)
debug._set_state(True)
script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
print(sc... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
28034,
198,
198,
6738,
10214,
273,
354,
13,
33692,
1330,
14257,
198,
6738,
10214,
273,
354,
13,
9288,
62,
12543,
2733,
13,
1837,
429,
6587,
1330,
36031,
1636,
198,
198,
6738,
28034,
1330,
309... | 2.462963 | 486 |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 26 18:01:59 2017
@author: Friend
"""
"""
Программа, выводящая квадрат числа, вводимого с клавиатуры
"""
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("square",
help="number, which square is given",
type=in... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
5267,
2608,
1248,
25,
486,
25,
3270,
2177,
198,
198,
31,
9800,
25,
9182,
198,
37811,
198,
198,
37811,
198,
140,
253,
21169,
25443,
111,
2... | 1.431937 | 382 |
import setuptools
import pg_raxarchive
REQUIRES = [
'pyrax>=1.4.11'
]
setuptools.setup(
name='pg_raxarchive',
version=pg_raxarchive.__version__,
author=pg_raxarchive.__author__,
author_email='maurizio@skicelab.com',
description=pg_raxarchive.__doc__.splitlines()[0].strip(),
long_descri... | [
11748,
900,
37623,
10141,
198,
11748,
23241,
62,
32040,
17474,
198,
198,
2200,
10917,
4663,
1546,
796,
685,
198,
220,
220,
220,
705,
9078,
32040,
29,
28,
16,
13,
19,
13,
1157,
6,
198,
220,
220,
220,
2361,
198,
198,
2617,
37623,
1014... | 2.444934 | 454 |
from __future__ import unicode_literals
import random
import time
from faker import Factory
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from django.db.transaction import atomic
from django.utils import timezone
from misago.categories.models import Category
from... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
4738,
198,
11748,
640,
198,
198,
6738,
277,
3110,
1330,
19239,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6... | 3.259434 | 212 |
# Generated by Django 3.2.8 on 2021-11-02 12:25
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
23,
319,
33448,
12,
1157,
12,
2999,
1105,
25,
1495,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
from __future__ import absolute_import
import pytest as _pytest
from mock import patch as _patch, MagicMock as _MagicMock
from flytekit.common.exceptions import user as _user_exceptions
from flytekit.common.tasks import task as _task
from flytekit.models import task as _task_models
from flytekit.models.core import id... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
12972,
9288,
355,
4808,
9078,
9288,
198,
6738,
15290,
1330,
8529,
355,
4808,
17147,
11,
6139,
44,
735,
355,
4808,
22975,
44,
735,
198,
198,
6738,
6129,
660,
15813,
13,
1... | 3.235294 | 136 |
#! /usr/bin/python
#compilation script turning all classes and libraries into shared (.so) C# libraries.
#
# To compile type: ./c_setup.py build_ext --inplace
import glob,os,shutil,numpy
from distutils.core import setup
from Cython.Build import cythonize
# classlist = glob.glob('classes/*.py')
librarylist = glob.g... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
198,
2,
5589,
10520,
4226,
6225,
477,
6097,
290,
12782,
656,
4888,
20262,
568,
8,
327,
2,
12782,
13,
220,
198,
2,
198,
2,
1675,
17632,
2099,
25,
24457,
66,
62,
40406,
13,
9078,
1382,
... | 2.875 | 160 |
"""
Thermodynamic Topology Optimization
===================================
The implementation in [Jantos et al. 2019](https://dx.doi.org/10.1007/s00161-018-0706-y)
claims to be comparable in efficiency and resulting structrual compliance, but
* requires less (no?) artificial control parameters
* based purely on Newto... | [
37811,
198,
35048,
76,
34743,
5849,
1435,
30011,
1634,
198,
10052,
18604,
198,
198,
464,
7822,
287,
685,
41,
415,
418,
2123,
435,
13,
13130,
16151,
5450,
1378,
34350,
13,
34023,
13,
2398,
14,
940,
13,
44318,
14,
82,
405,
25948,
12,
... | 2.363281 | 512 |
__________________________________________________________________________________________________
sample 60 ms submission
__________________________________________________________________________________________________
sample 13436 kb submission
_______________________________________________________________________... | [
27193,
10221,
834,
198,
39873,
3126,
13845,
14498,
198,
27193,
10221,
834,
198,
39873,
22352,
2623,
47823,
14498,
198,
27193,
10221,
834,
198
] | 15.130435 | 23 |
from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('',views.index, name='index'),
path('photo/<str:pk>/',views.photos, name='photo'),
path('search/', views.search_results, name='search_results'),
]
if settings... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
628,
198,
6371,
33279,
82,
796,
685,
19... | 2.935714 | 140 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.mail.tests.common import TestMail
from odoo.tools.misc import mute_logger
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2142,
286,
10529,
2238,
13,
4091,
38559,
24290,
2393,
329,
1336,
6634,
290,
15665,
3307,
13,
198,
198,
6738,
16298,
2238,
13,
39996,
13,
4529,
13,
41989,
13,
11321,
... | 3.147541 | 61 |
"""Repository management tasks powered by `invoke`.
More information on `invoke` can be found at http://www.pyinvoke.org/.
"""
# pylint: disable=import-outside-toplevel
import datetime as dt
import os
import re
import sys
from pathlib import Path
from typing import TYPE_CHECKING
from invoke import task
if TYPE_CHECK... | [
37811,
6207,
13264,
4542,
8861,
13232,
416,
4600,
37669,
44646,
198,
198,
5167,
1321,
319,
4600,
37669,
63,
460,
307,
1043,
379,
2638,
1378,
2503,
13,
9078,
37669,
13,
2398,
11757,
198,
37811,
198,
2,
279,
2645,
600,
25,
15560,
28,
11... | 2.284747 | 2,216 |
#!/home/phil_/python-projects/Personal_Site/PS-VE/bin/python3.6
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| [
2,
48443,
11195,
14,
28864,
62,
14,
29412,
12,
42068,
14,
30228,
62,
29123,
14,
3705,
12,
6089,
14,
8800,
14,
29412,
18,
13,
21,
198,
6738,
42625,
14208,
13,
7295,
1330,
4542,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
... | 2.833333 | 60 |
import argparse
import os
import shutil
import subprocess
from tqdm import tqdm
parser = argparse.ArgumentParser(description='Runs newsjam experiments.')
parser.add_argument('--type', help='The type of experiment (summarization or evaluation). Summarization experiments generate summaries using one of the impl... | [
11748,
1822,
29572,
201,
198,
11748,
28686,
201,
198,
11748,
4423,
346,
201,
198,
11748,
850,
14681,
201,
198,
201,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
201,
198,
201,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
... | 2.283078 | 6,016 |
"""
Some common utility functions.
"""
from dc_federated.backend._constants import GLOBAL_MODEL, GLOBAL_MODEL_VERSION
def create_model_dict(model_serialized, model_version):
"""
Simple utility function to create the model dictionary as
per the specification in the DCFServer.
Parameters
------... | [
37811,
198,
4366,
2219,
10361,
5499,
13,
198,
37811,
198,
6738,
30736,
62,
69,
5702,
515,
13,
1891,
437,
13557,
9979,
1187,
1330,
10188,
9864,
1847,
62,
33365,
3698,
11,
10188,
9864,
1847,
62,
33365,
3698,
62,
43717,
628,
198,
4299,
2... | 2.622975 | 679 |