text stringlengths 4.68k 32.9k | length int64 4.1k 4.35k | is_long_context bool 2
classes | metric_val float64 0.04 0.44 | label_metric stringclasses 1
value | source stringclasses 1
value | threshold_scale stringclasses 1
value |
|---|---|---|---|---|---|---|
# Copyright 2020 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... | 4,316 | false | 0.077669 | median | code | normalized |
# coding=utf-8
import copy
import functools
from typing import List
import torch
import torch.distributed._shard.sharding_spec as shard_spec
from .api import (
_register_sharded_op,
Shard,
ShardedTensor,
ShardedTensorMetadata,
TensorProperties,
)
from .metadata import ShardMetadata # noqa: F401
... | 4,193 | false | 0.144545 | median | code | normalized |
from .single_stage import SingleStageDetector
from ..registry import DETECTORS
from mmdet.core import bbox2result
import torch.nn as nn
import torch
from .. import builder
import numpy as np
import cv2
from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler
@DETECTORS.register_module
class CSP(Sin... | 4,099 | false | 0.129034 | median | code | normalized |
#!/usr/bin/env python3
'''
lib/ycmd/start.py
Server bootstrap logic. Includes a utility class for normalizing parameters and
calculating default ones. Also includes a helper to set up the temporary
options file.
'''
import logging
import os
import tempfile
from ..process import (
FileHandles,
Process,
)
from... | 4,174 | false | 0.102127 | median | code | normalized |
# Copyright 2017 Datera
# 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 applic... | 4,153 | false | 0.082591 | median | code | normalized |
# Copyright 2019 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... | 4,175 | true | 0.256549 | median | code | normalized |
# -*- coding: utf-8 -
from iso8601 import parse_date
from datetime import datetime, date, time, timedelta
import dateutil.parser
from pytz import timezone
import os
from decimal import Decimal
import re
TZ = timezone(os.environ['TZ'] if 'TZ' in os.environ else 'Europe/Kiev')
def get_all_etender_dates(initial_tender... | 4,231 | false | 0.062461 | median | code | normalized |
# -*- test-case-name: twisted.test.test_factories -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Standard implementations of Twisted protocol-related interfaces.
Start here if you are looking to write a new protocol implementation for
Twisted. The Protocol class contains ... | 4,188 | false | 0.087868 | median | code | normalized |
from flask_socketio import SocketIO
from flask import Flask, make_response, request, session
from flask import render_template, session, url_for, redirect
from threading import RLock
from threading import Thread
from utilslib import list_to_HTML_table
from time import sleep
from ClientStorage import Clients, User
fr... | 4,144 | false | 0.135272 | median | code | normalized |
import threading
import requests
# encryption
import Encrypt
import unicodedata
from ttk import Style, Button, Label, Entry, Progressbar, Checkbutton
from Tkinter import Tk, Frame, RIGHT, BOTH, RAISED
from Tkinter import TOP, X, N, LEFT
from Tkinter import END, Listbox, MULTIPLE
from Tkinter import Toplevel, DISABLE... | 4,170 | false | 0.079501 | median | code | normalized |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mp.models.segmentation.unet_fepegar import UNet2D
### UNet Wrapper ###
class UNet2D_dis(UNet2D):
r"""Wrapper for UNet2D to access encoder and decoder seperately.
"""
def __init__(self, *args, **kwargs):
super(UNet2D_dis, self).... | 4,261 | false | 0.102802 | median | code | normalized |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for bitcoinexodusd node under test"""
import contextlib
import decimal
import errno
from enum im... | 4,250 | false | 0.097454 | median | code | normalized |
import torch
from torch import nn, optim, multiprocessing
from torch.utils.data import DataLoader
from torch.utils.tensorboard.writer import SummaryWriter
from tqdm import tqdm
from time import time
from collections import defaultdict
from utils.run_utils import get_logger
from utils.train_utils import CheckpointMan... | 4,181 | false | 0.089429 | median | code | normalized |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 4,263 | false | 0.094608 | median | code | normalized |
from unittest import TestCase, skip
import copy
import numpy as np
from giant import rotations as at
from giant.ray_tracer import kdtree, shapes, rays
class TestKDTree(TestCase):
def setUp(self):
self.max_depth = 4
tri1 = np.array([[-5, -4, -4.5],
[0, 0, 1],
... | 4,208 | true | 0.230459 | median | code | normalized |
# # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... | 4,339 | false | 0.123319 | median | code | normalized |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2019, 2020 Matt Post <post@cs.jhu.edu>
#
# 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/LICE... | 4,122 | false | 0.097515 | median | code | normalized |
from toposort import toposort
import contextlib
import numpy as np
import tensorflow as tf
import tensorflow.contrib.graph_editor as ge
import time
import sys
sys.setrecursionlimit(10000)
# refers back to current module if we decide to split helpers out
util = sys.modules[__name__]
# getting rid of "WARNING:tensorflow... | 4,119 | false | 0.08021 | median | code | normalized |
# %% md
#### This notebook demonstrates the use of an optimized data pre-processing algorithm for bias mitigation
# - The
# debiasing
# function
# used is implemented in the
# `OptimPreproc`
#
# class .
# - Define
# parameters
# for optimized pre - processing specific to the dataset.
#
#
# - Divide
# the... | 4,121 | false | 0.094709 | median | code | normalized |
#
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" utility functionality for ... | 4,237 | false | 0.074669 | median | code | normalized |
'''
Copyright 2016, United States Government, as represented by the Administrator of
the National Aeronautics and Space Administration. All rights reserved.
The "pyCMR" platform is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may ... | 4,144 | false | 0.110661 | median | code | normalized |
import json
import os
import sys
import shutil
import tempfile
import unittest
import ray
import ray.cloudpickle as cloudpickle
from ray.rllib import _register_all
from ray import tune
from ray.tune.logger import NoopLogger
from ray.tune.utils.trainable import TrainableUtil
from ray.tune.function_runner import with_p... | 4,312 | false | 0.120113 | median | code | normalized |
"""
Copyright (c) 2018-2019 Intel Corporation
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 i... | 4,168 | true | 0.231601 | median | code | normalized |
# Copyright 1999-2021 Alibaba Group Holding 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 a... | 4,169 | false | 0.107807 | median | code | normalized |
# !/usr/bin/env python
import re
import requests
import collections
import hashlib
import os
import json
import time
def _prefix(cmd):
prefix = os.path.basename(cmd.replace('-', '_'))
for i in ['.pyc', '.py', '-cli', '-tool', '-util']:
prefix = prefix.replace(i, '')
return prefix.upper()
PREFI... | 4,099 | false | 0.08166 | median | code | normalized |
"""
Provide the functionality to group entities.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/group/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant import core as ha
from homeassistant.const import (
ATTR_ENTITY_ID... | 4,246 | false | 0.097841 | median | code | normalized |
# Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 4,251 | false | 0.091165 | median | code | normalized |
#GUI classes for the application
from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.... | 4,204 | false | 0.086087 | median | code | normalized |
# Copyright 2021, joshiayus Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 4,321 | false | 0.079924 | median | code | normalized |
import numpy as np
from os import path as osp
from mmdet3d.core import show_result, show_seg_result
from mmdet3d.core.bbox import DepthInstance3DBoxes
from mmdet.datasets import DATASETS
from mmseg.datasets import DATASETS as SEG_DATASETS
from .custom_3d import Custom3DDataset
from .custom_3d_seg import Custom3DSegDat... | 4,219 | false | 0.132236 | median | code | normalized |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 4,257 | false | 0.14696 | median | code | normalized |
#!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py ./core/i32.json
# ./run-spec-test.py ./core/float_exprs.json --line 2070
# ./run-spec-test.py ./proposals/tail-call/*.json
# ./run-spec-test.py --exec ../build-custom/wasm3
# ./run-spec-test.py --engine... | 4,165 | false | 0.064577 | median | code | normalized |
import uuid
import datetime
from sqlalchemy import Float
from sqlalchemy import Column
from sqlalchemy import String
from sqlalchemy import Integer
from sqlalchemy import Boolean
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import backref... | 4,223 | false | 0.116551 | median | code | normalized |
"""
.. module:: volume
:synopsis: Volume Indicators.
.. moduleauthor:: Dario Lopez Padial (Bukosabino)
"""
import numpy as np
import pandas as pd
from ta.utils import IndicatorMixin, ema
class AccDistIndexIndicator(IndicatorMixin):
"""Accumulation/Distribution Index (ADI)
Acting as leading indicator o... | 4,107 | true | 0.24645 | median | code | normalized |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 4,172 | false | 0.09195 | median | code | normalized |
'''
Utility functions.
'''
import argparse
import functools
import itertools
import os
import sqlite3 as sql
from contextlib import closing
from copy import deepcopy
from itertools import repeat
import numpy as np
import pandas as pd
import scipy as sp
import scipy.fftpack
import scipy.signal
from cnld import abstract... | 4,287 | false | 0.040119 | median | code | normalized |
import tkinter as tk
from tkinter import ttk
import re
import os
import wikipedia
import time
import webbrowser
import json
import requests
import ctypes
import youtube_dl
import random
import urllib
import ssl
from bs4 import BeautifulSoup
from urllib.request import urlopen
import speech_recognition as sr
import reque... | 4,227 | false | 0.072478 | median | code | normalized |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Download SQL file of MySQL database by phpMyAdmin
'''
import re
import os
import sys
import base64
import urllib
import urllib2
import traceback
from cookielib import CookieJar, DefaultCookiePolicy
from pprint import pprint
__author__ = 'furyu (furyutei@gmail.com... | 4,311 | false | 0.088134 | median | code | normalized |
# Copyright 2020 Google LLC 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 law or ag... | 4,107 | false | 0.139349 | median | code | normalized |
""" Local routines
Written by S.Haesaert
CONTENT
helpfull functions for JPL project
Bridging Tulip with the Statechart autocoder
DATE 2 June
"""
# TODO : Check whether output set of reduced mealy machines (i,e.,ctrl.outputs) is too big?
from __future__ import absolute_import
from __future__ import... | 4,318 | false | 0.141208 | median | code | normalized |
import vtk
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
import math
import numpy as np
import numpy.matlib
import os
import json
import cv2
# Z
# /
# /
# /
# ---------- X
# |
# |
# |
# Y
class vtkRenderer():
def __init__(self, widget=None... | 4,283 | false | 0.108057 | median | code | normalized |
# Copyright 2017 The TensorFlow 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 applica... | 4,134 | false | 0.125985 | median | code | normalized |
import numpy as np
from lenstronomy.Cosmo.background import Background
from lenstronomy.LensModel.profile_list_base import ProfileListBase
import lenstronomy.Util.constants as const
__all__ = ['MultiPlaneBase']
class MultiPlaneBase(ProfileListBase):
"""
Multi-plane lensing class
The lens model deflecti... | 4,178 | false | 0.110706 | median | code | normalized |
"""
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Disnake Development
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limi... | 4,228 | false | 0.0936 | median | code | normalized |
"""
BROS
Copyright 2022-present NAVER Corp.
Apache License v2.0
Do 2nd preprocess on top of the result of the 'preprocess.sh' file.
Reference: https://github.com/microsoft/unilm/blob/master/layoutlm/deprecated/examples/seq_labeling/run_seq_labeling.py
"""
import json
import os
from collections import Counter
from t... | 4,178 | false | 0.096652 | median | code | normalized |
# from flask import Flask, Blueprint
# from flask_sqlalchemy import SQLAlchemy
# from flask_login import LoginManager
# import os
from flask import Flask, jsonify, request, make_response, redirect, url_for
import jwt
import datetime
import os
from functools import wraps
from flask_sqlalchemy import SQLAlchemy
import u... | 4,129 | false | 0.107451 | median | code | normalized |
import math
import operator
from datetime import date, datetime
from operator import methodcaller
import pandas as pd
import pandas.testing as tm
import pytest
from pytest import param
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
from ibis import literal as L
clickhouse_driver = pytest.i... | 4,332 | false | 0.117149 | median | code | normalized |
import time
from collections import deque
import gym
import numpy as np
import tensorflow as tf
from stable_baselines import logger
from stable_baselines.common import explained_variance, tf_util, ActorCriticRLModel, SetVerbosity, TensorboardWriter
from stable_baselines.common.policies import ActorCriticPolicy, Recur... | 4,202 | false | 0.084817 | median | code | normalized |
"""
test_analyze.py
Testing analyze.py
"""
import os
from collections import defaultdict
import numpy as np
import seekr2.modules.common_analyze as common_analyze
import seekr2.modules.mmvt_analyze as mmvt_analyze
import seekr2.analyze as analyze
import seekr2.modules.common_base as base
import seekr2.modules.mmvt_... | 4,280 | false | 0.092167 | median | code | normalized |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
# pylint: disable=protected-access
from typing import (
Any,
IO,
Union,
List,
TYPE_CHECKING
)
from azure.core.tracing.decorator impo... | 4,178 | true | 0.237937 | median | code | normalized |
"""Script to train the Hamiltonian Generative Network
"""
import ast
import argparse
import copy
import pprint
import os
import warnings
import yaml
import numpy as np
import torch
import tqdm
from utilities.integrator import Integrator
from utilities.training_logger import TrainingLogger
from utilities import loader... | 4,264 | false | 0.082112 | median | code | normalized |
# -*- coding: utf-8 -*-
"""
Plugin to create a Yambo input file and run a calculation with the yambo executable.
"""
from __future__ import absolute_import
import os
import six
from aiida.engine import CalcJob
from aiida_quantumespresso.calculations import _lowercase_dict, _uppercase_dict
from aiida.common.datastruc... | 4,212 | false | 0.088316 | median | code | normalized |
import cv2
import numpy as np
import dlib
from imutils import face_utils, translate
class Camera(object):
def __init__(self):
self.camera = cv2.VideoCapture(0)
p = "../data/shape_predictor_68_face_landmarks.dat"
self.detector = dlib.get_frontal_face_detector()
self.predictor = dlib.shape_predictor(p)
self.... | 4,330 | false | 0.12022 | median | code | normalized |
import os
import yaml
import numpy as np
import torch
import shutil
import torchvision.transforms as transforms
from torch.autograd import Variable
from collections import namedtuple
class MyDumper(yaml.Dumper):
def increase_indent(self, flow=False, indentless=False):
return super(MyDumper, self).increase... | 4,134 | false | 0.071021 | median | code | normalized |
"""
Train a new model.
"""
import sys
import argparse
import h5py
import datetime
import subprocess as sp
import numpy as np
import pandas as pd
import gzip as gz
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
fr... | 4,260 | false | 0.100734 | median | code | normalized |
import sys
import time
import signal
import subprocess
from ._utils import get_ffmpeg_exe, logger
from ._parsing import LogCatcher, parse_ffmpeg_header, cvsecs
ISWIN = sys.platform.startswith("win")
exe = None
def _get_exe():
global exe
if exe is None:
exe = get_ffmpeg_exe()
return exe
def ... | 4,279 | false | 0.126095 | median | code | normalized |
"""Logic Blocks devices."""
from typing import Any, List
from mpf.core.delays import DelayManager
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.events import event_handler
from mpf.core.machine import MachineController
from mpf.core.mode import Mode
from mpf.core.mode_device import ModeDevice
from mp... | 4,223 | false | 0.124242 | median | code | normalized |
# MINLP written by GAMS Convert at 05/15/20 00:50:46
#
# Equation counts
# Total E G L N X C B
# 34 22 3 9 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 4,235 | false | 0.124934 | median | code | normalized |
import unittest
from test import test_support
import UserDict, random, string
class DictTest(unittest.TestCase):
def test_constructor(self):
# calling built-in types without argument must return empty
self.assertEqual(dict(), {})
self.assert_(dict() is not {})
def test_literal_constr... | 4,189 | false | 0.11429 | median | code | normalized |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 4,180 | false | 0.102001 | median | code | normalized |
"""
Module for radiometric normalization
Credits:
Copyright (c) 2018-2019 Johannes Schmid (GeoVille)
Copyright (c) 2017-2019 Matej Aleksandrov, Matic Lubej, Devis Peresutti (Sinergise)
This source code is licensed under the MIT license found in the LICENSE
file in the root directory of this source tree.
"""
import n... | 4,127 | false | 0.146482 | median | code | normalized |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 4,200 | false | 0.056066 | median | code | normalized |
# Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 4,227 | false | 0.091241 | median | code | normalized |
# -*- coding: utf-8 -*-
# (c) 2009-2021 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 Ho Chun Wei.
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Implementation of a WebDAV provider that provides a very basic, read-... | 4,301 | false | 0.104431 | median | code | normalized |
"""
Copyright 2022 RICHARD TJÖRNHAMMAR
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 4,141 | false | 0.109084 | median | code | normalized |
#!/usr/bin/env python
"""Provenance post processing script for OSA pipeline."""
import copy
import logging
import shutil
import sys
from pathlib import Path, PurePath
import yaml
from osa.configs import options
from osa.configs.config import cfg
from osa.provenance.capture import get_activity_id, get_file_hash
from... | 4,322 | false | 0.103372 | median | code | normalized |
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | 4,298 | true | 0.218041 | median | code | normalized |
"""SCons.Tool.GettextCommon module
Used by several tools of `gettext` toolset.
"""
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software withou... | 4,126 | false | 0.064292 | median | code | normalized |
from models.resnet import ResNetBase, get_norm
from models.modules.common import ConvType, NormType, conv, conv_tr
from models.modules.resnet_block import BasicBlock, Bottleneck, BasicBlockIN, BottleneckIN, BasicBlockLN
from MinkowskiEngine import MinkowskiReLU
import MinkowskiEngine.MinkowskiOps as me
class Res16UN... | 4,233 | false | 0.130473 | median | code | normalized |
'''
Created on 08.04.2019
@author: mort
ipywidget interface to the GEE for IR-MAD
'''
import ee, time, warnings, math
import ipywidgets as widgets
from IPython.display import display
from ipyleaflet import (Map,DrawControl,TileLayer,
basemaps,basemap_to_tiles,
LayersCo... | 4,133 | false | 0.101299 | median | code | normalized |
# Copyright 2019-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 4,263 | false | 0.088017 | median | code | normalized |
"""Tests for 'site'.
Tests assume the initial paths in sys.path once the interpreter has begun
executing have not been removed.
"""
import unittest
import test.support
from test.support import captured_stderr, TESTFN, EnvironmentVarGuard
import builtins
import os
import sys
import re
import encodings
import urllib.re... | 4,260 | false | 0.074763 | median | code | normalized |
import copy
from dataclasses import make_dataclass
from unittest import mock
from tests.fixtures.books import Books
from tests.fixtures.models import AttrsType
from tests.fixtures.models import ExtendedListType
from tests.fixtures.models import ExtendedType
from tests.fixtures.models import FixedType
from tests.fixtur... | 4,321 | false | 0.121117 | median | code | normalized |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import shutil
import pytest
import llnl.util.filesystem as fs
import spack.error
import spack.patch
import sp... | 4,198 | false | 0.126343 | median | code | normalized |
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, T... | 4,328 | false | 0.142009 | median | code | normalized |
import os
import traceback
import unittest
from tornado.escape import utf8, native_str, to_unicode
from tornado.template import Template, DictLoader, ParseError, Loader
from tornado.util import ObjectDict
import typing # noqa: F401
class TemplateTest(unittest.TestCase):
def test_simple(self):
template ... | 4,323 | false | 0.10089 | median | code | normalized |
# Copyright 2018 The TensorFlow 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 applica... | 4,153 | false | 0.103972 | median | code | normalized |
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 4,163 | false | 0.122715 | median | code | normalized |
"""Tests for the clip module."""
import warnings
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
import shapely
from shapely.geometry import (
Polygon,
Point,
LineString,
LinearRing,
GeometryCollection,
MultiPoint,
)
import geopandas
from geopandas import Ge... | 4,146 | false | 0.139454 | median | code | normalized |
import AppKit
import objc
from PyObjCTools.TestSupport import TestCase, min_os_level
class TestNSGraphics(TestCase):
def testConstants(self):
self.assertEqual(AppKit.NSCompositeClear, 0)
self.assertEqual(AppKit.NSCompositeCopy, 1)
self.assertEqual(AppKit.NSCompositeSourceOver, 2)
s... | 4,170 | false | 0.116423 | median | code | normalized |
# import
## batteries
import os, sys
import re
from functools import partial
import types
import logging
import tempfile
import shutil
import glob
from collections import defaultdict
from random import shuffle
from StringIO import StringIO
## 3rd party
import numpy as np
import pandas as pd
from SIPSim_pymix import mix... | 4,198 | false | 0.080637 | median | code | normalized |
from onelang_core import *
import OneLang.One.Ast.Expressions as exprs
import OneLang.One.Ast.Statements as stats
import OneLang.One.Ast.Types as types
import OneLang.One.Ast.AstTypes as astTypes
import OneLang.One.Ast.References as refs
import OneLang.One.Ast.Interfaces as ints
import onelang_core as one
import json
i... | 4,178 | false | 0.108615 | median | code | normalized |
from __future__ import print_function
import numpy as np
from openmdao.api import ExplicitComponent, Group, IndepVarComp
from wisdem.commonse.utilities import hstack, vstack
from wisdem.commonse.csystem import DirectionVector
from wisdem.commonse import gravity
# This is an extremely simple RNA mass calculator that s... | 4,164 | false | 0.085141 | median | code | normalized |
#
# Copyright (c) 2019, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import abc
import http.client
import itertools
import logging
import sys
import django
from django... | 4,260 | false | 0.085729 | median | code | normalized |
"""
Tests for line search routines
"""
from numpy.testing import (assert_, assert_equal, assert_array_almost_equal,
assert_array_almost_equal_nulp, assert_warns,
suppress_warnings)
import scipy.optimize.linesearch as ls
import scipy.optimize.nonlin as nl #(LS)
from ... | 4,204 | false | 0.130548 | median | code | normalized |
import time
import tkinter as tk
from tkinter import *
import tkinter.filedialog as filedialog
from tkinter.filedialog import askopenfilename
import utils.utils as util
import utils.similarity_measures as sm
import SMAP.MatrixProfile as mp
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg... | 4,340 | false | 0.124498 | median | code | normalized |
# -*- coding: utf-8 -*-
"""The source code classes."""
import collections
from yaldevtools import definitions
class EnumDeclaration(object):
"""Enumeration type declaration.
Attributes:
name (str): name.
constants (dict[str, str]): constant values per name.
"""
def __init__(self, name):
"""Ini... | 4,255 | false | 0.088824 | median | code | normalized |
"""
ckwg +31
Copyright 2016-2017 by Kitware, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and... | 4,297 | false | 0.111017 | median | code | normalized |
# encoding: UTF-8
import json
import traceback
import shelve
import parser
import re
from vnpy.event import Event
from vnpy.trader.vtFunction import getJsonPath, getTempPath
from vnpy.trader.vtEvent import (EVENT_TICK, EVENT_TRADE, EVENT_POSITION,
EVENT_TIMER, EVENT_ORDER)
from vnpy.... | 4,136 | false | 0.140745 | median | code | normalized |
import torch
from torch.utils.data import Dataset
from skimage import io, color, transform
import torchvision
import os, glob
import numpy as np
import random
from scipy import ndimage
from PIL import Image
import torch.nn.functional as F
from . import utils
###########################################################... | 4,258 | false | 0.088306 | median | code | normalized |
# Copyright 2016 The TensorFlow 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 applica... | 4,144 | false | 0.120259 | median | code | normalized |
# Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011,2012 Akira YOSHIYAMA <akirayoshiyama@gmail.com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | 4,243 | false | 0.098071 | median | code | normalized |
from __future__ import annotations
import json
from dataclasses import dataclass, field
from math import inf, sqrt
from queue import PriorityQueue
from typing import Any, Callable, Collection, TYPE_CHECKING, Iterable, Literal
from bitarray import bitarray
from turing_complete_interface.circuit_parser import Circuit,... | 4,324 | false | 0.119141 | median | code | normalized |
import tensorflow as tf
import keras
from keras.datasets import cifar10
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
import sys
import csv
import utils_csv
import utils_tf as utils
from cleverhans.utils_tf import model_train, model_eval
from cleverhans.attacks impo... | 4,212 | false | 0.069323 | median | code | normalized |
#!/usr/bin/env pnpython3
#
# Simple program to read and display SEG-Y file
#
# Steve Azevedo
#
import argparse
import logging
import os
from ph5.core import segy_h, ibmfloat, ebcdic
import construct
PROG_VERSION = '2019.14'
LOGGER = logging.getLogger(__name__)
SAMPLE_LENGTH = {1: 4, 2: 4, 3: 2, 4: 4, 5: 4, 8: 1}
S... | 4,111 | false | 0.091222 | median | code | normalized |
from decimal import Decimal
from opnreco.models.db import File
from opnreco.models.db import Movement
from opnreco.models.db import now_func
from opnreco.models.db import OwnerLog
from opnreco.models.db import Peer
from opnreco.models.db import TransferDownloadRecord
from opnreco.models.db import TransferRecord
from o... | 4,105 | false | 0.113249 | median | code | normalized |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Invoice.date_created'
db.alter_column(u'accounting_invoice', 'date_created', self.gf('dj... | 4,338 | true | 0.203692 | median | code | normalized |
###############################################################################
# Copyright (c) 2013 INRIA
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distr... | 4,290 | false | 0.071259 | median | code | normalized |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 4,144 | false | 0.100613 | median | code | normalized |
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 4,320 | false | 0.074909 | median | code | normalized |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.