text stringlengths 9.13k 52.7k | length int64 7.94k 8.45k | is_long_context bool 2
classes | metric_val float64 0.04 0.48 | label_metric stringclasses 1
value | source stringclasses 1
value | threshold_scale stringclasses 1
value |
|---|---|---|---|---|---|---|
import io
import os
import re
import pwd
import grp
import sys
import json
import uuid
import time
import glob
import base64
import socket
import hashlib
import decimal
import logging
import tarfile
import zipfile
import binascii
import calendar
import tempfile
import threading
import subprocess
import six
import shuti... | 8,202 | false | 0.063828 | median | code | normalized |
import numpy as np
import pyqtgraph as pg
from datetime import datetime, timedelta
from vnpy.trader.constant import Interval, Direction, Offset
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import QtCore, QtWidgets, QtGui
from vnpy.trader.ui.widget import BaseMonitor, BaseCell, DirectionCell, EnumCell
... | 7,992 | false | 0.088285 | median | code | normalized |
import argparse
import os
import re
import sys
from voussoirkit import betterhelp
from voussoirkit import interactive
from voussoirkit import pathclass
from voussoirkit import pipeable
from voussoirkit import spinal
from voussoirkit import stringtools
from voussoirkit import vlogging
import etiquette
# HELPERS #####... | 8,006 | false | 0.131396 | 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... | 8,124 | false | 0.158758 | median | code | normalized |
"""
<Program Name>
test_primary.py
<Purpose>
Unit testing for uptane/clients/primary.py
<Copyright>
See LICENSE for licensing information.
"""
from __future__ import unicode_literals
import uptane # Import before TUF modules; may change tuf.conf values.
import unittest
import os.path
import time
import copy
i... | 8,287 | false | 0.111909 | median | code | normalized |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE.txt file in the root directory of this source tree.
import logging
import math
import time
from collections import defaultdict
from funct... | 8,130 | false | 0.096618 | median | code | normalized |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Extensions... | 8,050 | true | 0.261853 | median | code | normalized |
# Copyright The PyTorch Lightning team.
#
# 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... | 7,952 | false | 0.120999 | median | code | normalized |
import asyncio
from datetime import datetime, timezone
from functools import wraps
import traceback
import inspect
import logging
import ujson as json_module
import hashlib
import yaml
from aiohttp import web
import aiohttp
import mongoengine
import os
from .engine.objects import Operation, Network, Domain, Log, Obse... | 8,263 | false | 0.152136 | median | code | normalized |
"""Stuff to parse AIFF-C and AIFF files.
Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.
An AIFF-C file has the following structure.
+-----------------+
| FORM |
+-----------------+
| <size> |
+----+------------+
| | AIFC ... | 8,371 | false | 0.116011 | median | code | normalized |
from unicorn import *
from unicorn.x86_const import *
from capstone import *
from importlib import import_module
from emulation.syscall import clean_stack
import argparse
import emulation.syscall as winsyscall
import pefile
import struct
import sys
import ast
import os
#TODO: Deal with SEH structure
#TODO: Randomize T... | 8,049 | false | 0.095237 | median | code | normalized |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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... | 8,105 | false | 0.078954 | median | code | normalized |
#!/usr/bin/env python3
import os
import math
from numbers import Number
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblockin... | 7,953 | false | 0.126116 | median | code | normalized |
#!/usr/bin/python
# Imports
import sys, os, re, time
import argparse
import pdb
import pickle
from itertools import *
# Science
import numpy as np
import scipy.stats as stats
import pandas as pd
# Plotting
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import colors
from mpl_to... | 8,045 | false | 0.139948 | median | code | normalized |
import pytest
from diofant import (I, Matrix, MutableDenseMatrix, MutableSparseMatrix,
PurePoly, Rational, ShapeError, SparseMatrix, eye, ones,
zeros)
from diofant.abc import x, y, z
__all__ = ()
def test_sparse_matrix():
def sparse_eye(n):
return SparseMatrix.... | 8,219 | false | 0.074455 | median | code | normalized |
""" command line options, ini-file and conftest.py processing. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import inspect
import os
import shlex
import sys
import types
import warnings
import py
import six
from pkg_resour... | 8,072 | false | 0.083167 | median | code | normalized |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | 8,367 | false | 0.126624 | median | code | normalized |
#!/usr/bin/env python3
"""
Scripts to drive a donkey 2 car
Usage:
manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical)] [--camera=(single|stereo)] [--meta=<key:value> ...] [--myconfig=<filename>]
manage.py (train) [--tubs=tubs] (--model=<model>) [--type=(linear|inferred|tensorrt_linear|tflit... | 8,027 | false | 0.127687 | median | code | normalized |
# This file defines the back end of the Tetris game
#
# GameState is the base class of GameClient.
#
# GameClient.Run() will start two threads:
# - _ProcessActions: Process the action list every x seconds
# - _AutoDrop: Auto drops the current piece.
#
# GameClient:
# - current piece
# - held piece
# - piece list... | 8,377 | false | 0.087164 | median | code | normalized |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
"""
*aces-dev* Reference Config Generator
=====================================
Defines various objects related to the generation of the *aces-dev* reference
*OpenColorIO* config:
- :func:`opencolorio_config_aces.generate_c... | 7,950 | false | 0.10804 | median | code | normalized |
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import scenario_cfg_lib
import launch_cfg_lib
import common
import pt
def is_nuc_whl_linux(names, vmid):
uos_type = names['uos_types'][vmid]
board_name = names['board_name']
if launch_cfg_lib.is_linu... | 8,071 | false | 0.130151 | median | code | normalized |
import sys
import traceback
import uuid
import os
import importlib
import yaml
import subprocess
import cProfile
import io
import pstats
import logging
import asyncio
import appdaemon.utils as utils
from appdaemon.appdaemon import AppDaemon
class AppManagement:
def __init__(self, ad: AppDaemon, config):
... | 8,382 | false | 0.121196 | median | code | normalized |
"""Model Predictive Control with a Gaussian Process model.
Based on:
* L. Hewing, J. Kabzan and M. N. Zeilinger, "Cautious Model Predictive Control Using Gaussian Process Regression,"
in IEEE Transactions on Control Systems Technology, vol. 28, no. 6, pp. 2736-2743, Nov. 2020, doi: 10.1109/TCST.2019.2949757.
... | 8,115 | false | 0.094991 | 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 u... | 8,418 | false | 0.104803 | median | code | normalized |
import os
import re
import glob
import subprocess
from collections import OrderedDict
# We need to define our own `Action` method to control the verbosity of output
# and whenever we need to run those commands in a subprocess on some platforms.
from SCons.Script import Action
from SCons import Node
from SCons.Script i... | 8,095 | false | 0.046995 | median | code | normalized |
DEFAULT_CONFIG = "Windows10SystemLog.txt"
class Windows10SystemLogger:
"""
Windows10SystemLogger writes error messages to the Windows10 System log
file for every rule in the Windows10 STIG that is violated.
"""
def __init__(self, filename=DEFAULT_CONFIG):
self.filename = f... | 8,251 | true | 0.24656 | median | code | normalized |
# -*- coding: utf-8 -*-
"""
Functions for model training and evaluation (single-partner and multi-partner cases)
"""
import operator
import os
from abc import ABC, abstractmethod
from copy import deepcopy
from timeit import default_timer as timer
import numpy as np
import random
import tensorflow as tf
from loguru im... | 8,345 | false | 0.146936 | median | code | normalized |
#!/usr/bin/env python3
##########################################
# Duino-Coin Python AVR Miner (v2.5.7)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ConfigPa... | 8,214 | false | 0.1071 | median | code | normalized |
from sympy.core.function import expand_mul
from sympy.core.numbers import (I, Rational)
from sympy.core.singleton import S
from sympy.core.symbol import (Symbol, symbols)
from sympy.core.sympify import sympify
from sympy.simplify.simplify import simplify
from sympy.matrices.matrices import (ShapeError, NonSquareMatrixE... | 7,955 | false | 0.09122 | median | code | normalized |
import time
from enum import Enum
from functools import reduce
import contextlib
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
import torchplus
from second.pytorch.core import box_torch_ops
from second.pytorch.core.losses import (WeightedSigmoidClassificationLoss,
... | 8,024 | false | 0.083346 | median | code | normalized |
from future.backports.urllib.parse import urlencode
from future.moves.urllib.parse import parse_qs
from past.builtins import basestring
import copy
import json
import logging
from collections import MutableMapping
import six
from jwkest import as_unicode
from jwkest import b64d
from jwkest import jwe
from jwkest impo... | 8,111 | false | 0.089334 | 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 u... | 8,295 | false | 0.148344 | median | code | normalized |
# Copyright 2019 The Meson development team
# 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 ... | 8,095 | false | 0.087799 | median | code | normalized |
"""Redis transport."""
from __future__ import absolute_import, unicode_literals
import numbers
import socket
from bisect import bisect
from collections import namedtuple
from contextlib import contextmanager
from time import time
from vine import promise
from kombu.exceptions import InconsistencyError, VersionMisma... | 8,403 | false | 0.102245 | median | code | normalized |
import torch, torchvision
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models.resnet import Bottleneck, conv1x1, conv3x3
import numpy as np
from functools import partial
from itertools import product, chain
from math import sqrt
from typing import List, Tuple
use_torch2trt = False
use_jit = ... | 8,068 | false | 0.060496 | median | code | normalized |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 8,042 | false | 0.083316 | median | code | normalized |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import json
import pytest
import requests
from celery.canvas import Signature
from flexmock import flexmock
from ogr.abstract import CommitStatus
from ogr.services.github import GithubProject
from ogr.utils import RequestResponse
from pack... | 8,143 | true | 0.222314 | median | code | normalized |
# -*- coding: utf-8 -*-
"""The SleuthKit (TSK) file entry implementation."""
import copy
import decimal
from dfdatetime import definitions as dfdatetime_definitions
from dfdatetime import factory as dfdatetime_factory
from dfdatetime import interface as dfdatetime_interface
import pytsk3
from dfvfs.lib import defin... | 8,447 | false | 0.137628 | median | code | normalized |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 7,976 | false | 0.127847 | median | code | normalized |
import numpy as np
import collections
import time
from pymoab import types
from pymoab import topo_util
from PyTrilinos import Epetra, AztecOO, ML
class StructuredUpscalingMethods:
"""Defines a structured upscaling mesh representation
Parameters
----------
coarse_ratio: List or array of integers
... | 8,441 | false | 0.102188 | median | code | normalized |
import platform
from datetime import datetime, timezone
import pytest
import jsii
from json import loads
from jsii_calc import (
AbstractClassReturner,
Add,
AllTypes,
AllTypesEnum,
AmbiguousParameters,
AsyncVirtualMethods,
Bell,
Calculator,
ClassWithPrivateConstructorAndAutomati... | 8,176 | false | 0.124799 | median | code | normalized |
"""
pygments.formatters.html
~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for HTML output.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import functools
import os
import sys
import os.path
from io import StringIO
from pygments.formatter imp... | 8,228 | false | 0.087299 | median | code | normalized |
from __future__ import print_function
from builtins import range, object
import inspect
import six
class _ConfigureComponent(object):
"""Denotes a class that can be used by the Processes class"""
def _isTaskComponent(self):
return False
class PrintOptions(object):
def __init__(self, indent = 0, de... | 8,386 | false | 0.076048 | median | code | normalized |
# coding: utf-8
from __future__ import unicode_literals
import base64
import re
import struct
from ..compat import (compat_etree_fromstring, compat_HTTPError,
compat_parse_qs, compat_urllib_parse_urlparse,
compat_urlparse, compat_xml_parse_error)
from ..utils import (Extrac... | 8,384 | false | 0.08745 | median | code | normalized |
#!/usr/bin/env python3
# Copyright 2015-2020 Arm Limited
#
# 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 ... | 8,077 | false | 0.088421 | median | code | normalized |
input = """
c num blocks = 1
c num vars = 150
c minblockids[0] = 1
c maxblockids[0] = 150
p cnf 150 677
138 149 113 0
122 -73 -7 0
108 33 145 0
-21 -138 134 0
80 63 -59 0
-24 98 129 0
57 -135 -148 0
-35 -20 106 0
-127 106 148 0
-28 -29 66 0
-147 57 89 0
-19 3 -47 0
112 43 70 0
138 2 -134 0
-72 122 -119 0
91 76 -79 0
11... | 8,394 | true | 0.385736 | median | code | normalized |
import numpy as np
import pytest
from pandas import DataFrame, Float64Index, Index, Int64Index, RangeIndex, Series
import pandas._testing as tm
class TestFloatIndexers:
def check(self, result, original, indexer, getitem):
"""
comparator for results
we need to take care if we are indexing ... | 8,059 | false | 0.14875 | 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.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 7,985 | true | 0.301771 | median | code | normalized |
"""Painting domain, which allows for two different grasps on an object (side or
top).
Side grasping allows for placing into the shelf, and top grasping allows
for placing into the box. The box has a lid which may need to be opened;
this lid is NOT modeled by any of the given predicates.
"""
from typing import Any, Cl... | 8,148 | false | 0.121931 | median | code | normalized |
"""
The Salt loader is the core to Salt's plugin system, the loader scans
directories for python loadable code and organizes the code into the
plugin interfaces used by Salt.
"""
import contextlib
import logging
import os
import re
import time
import types
import salt.config
import salt.defaults.events
import salt.de... | 8,242 | false | 0.114622 | median | code | normalized |
# Copyright (c) 2010-2021 openpyxl
import pytest
import datetime
from io import BytesIO
from lxml.etree import iterparse, fromstring
from openpyxl.xml.constants import SHEET_MAIN_NS
from openpyxl.utils.indexed_list import IndexedList
from openpyxl.packaging.relationship import Relationship, RelationshipList
from op... | 8,440 | false | 0.119572 | median | code | normalized |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os,sys,re,traceback
from waflib import Utils,Logs,Options,Errors
from waflib.TaskGen import after_method,feature
from waflib.Configure import conf
from waflib.Tools import ccroot,c,cxx,ar
g_ms... | 8,034 | false | 0.074963 | median | code | normalized |
#!/usr/bin/env python3
##########################################
# Duino-Coin Python AVR Miner (v2.5)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ConfigPars... | 8,045 | false | 0.116693 | 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.
# -----------------------------------------------------... | 8,210 | false | 0.158723 | median | code | normalized |
from EXOSIMS.SurveySimulation.tieredScheduler_SLSQP import tieredScheduler_SLSQP
import EXOSIMS, os
import astropy.units as u
import astropy.constants as const
import numpy as np
import itertools
from scipy import interpolate
try:
import cPickle as pickle
except:
import pickle
import time
import copy
from EXOSI... | 7,999 | false | 0.110895 | median | code | normalized |
from __future__ import unicode_literals
from distutils.version import StrictVersion
from itertools import chain
import io
import os
import socket
import sys
import threading
import warnings
try:
import ssl
ssl_available = True
except ImportError:
ssl_available = False
from redis._compat import (xrange, im... | 8,398 | false | 0.069737 | median | code | normalized |
import logging
import pandas as pd
from typing import List
import unittest
from decimal import Decimal
from math import floor, ceil
from nose.plugins.attrib import attr
from hummingbot.core.clock import Clock, ClockMode
from hummingbot.core.data_type.limit_order import LimitOrder
from hummingbot.core.data_type.order_... | 8,242 | false | 0.153263 | median | code | normalized |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | 8,031 | false | 0.067989 | median | code | normalized |
# Copyright 2018 Jonathan Xia
# 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... | 8,141 | false | 0.131924 | median | code | normalized |
import glob
import re
import sys
import os
import logging
import warnings
from traitlets.config import LoggingConfigurable, Config, get_config
from traitlets import Instance, Enum, Unicode, observe
from ..coursedir import CourseDirectory
from ..converters import GenerateAssignment, Autograde, GenerateFeedback, Genera... | 8,143 | false | 0.145549 | median | code | normalized |
# -*- coding: utf-8 -*-
"""Python's built-in :mod:`functools` module builds several useful
utilities on top of Python's first-class function
support. ``funcutils`` generally stays in the same vein, adding to and
correcting Python's standard metaprogramming facilities.
"""
from __future__ import print_function
import s... | 8,115 | false | 0.064611 | median | code | normalized |
# -*- coding: utf-8 -*-
"""Sample controller with all its actions protected."""
from tg import expose, flash, redirect, request
from tg.i18n import lazy_ugettext as l_
from molgears.model import DBSession, Tags, LCompound, LPurity, Names
from molgears.model import Compound, User, Projects
from molgears.model.auth impor... | 8,378 | false | 0.122737 | median | code | normalized |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.misc import factorial
from scipy.lib.six.moves import xrange
__all__ = ["KroghInterpolator", "krogh_interpolate", "BarycentricInterpolator", "barycentric_interpolate", "PiecewisePolynomial", "piecewise_polynomial_interpola... | 8,150 | false | 0.133994 | median | code | normalized |
#!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Utilities and (decompositions of) global constraints in Z3.
#
# Here I have collected some useful (or perhaps not that useful) methods for z3py.
# These where added mostly for simplifying the porting of my "traditional"
# constraint programming models.
#
#
############... | 8,052 | false | 0.123279 | median | code | normalized |
#!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
NOTE:
This unittest is being used as a procedural test.
The tests must be run in-order and CANNOT be parallelized!
Tests all but two RESTful interfaces:
* agent's POST /v2/keys/vkey
- Done by C... | 8,040 | false | 0.15785 | median | code | normalized |
import numpy as np
from PyQt5 import QtCore, QtGui, QtWidgets
from sscanss.config import path_for, settings
from sscanss.core.math import Plane, Matrix33, Vector3, clamp, map_range, trunc, VECTOR_EPS
from sscanss.core.geometry import mesh_plane_intersection
from sscanss.core.util import Primitives, DockFlag, StrainComp... | 8,392 | false | 0.092019 | median | code | normalized |
import os
import requests
import pymysql
import pytest
from flask import url_for
from solarforecastarbiter.datamodel import QualityFlagFilter as QFF
from sfa_dash import create_app
BASE_URL = 'http://localhost'
resample_threshold = QFF.resample_threshold_percentage
@pytest.fixture(scope='session')
def auth_toke... | 8,225 | false | 0.106692 | median | code | normalized |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v6/resources/ad_group.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection... | 8,167 | false | 0.153852 | median | code | normalized |
import hashlib
import os
import sys
import shutil
import tempfile
import filecmp
import datetime
import stat
import time
import urllib
from util.util import *
import functools
# FancyURLopener is incorrectly documented; this working handler was
# copied from
# https://mail.python.org/pipermail/python-bugs-list/2006-F... | 8,141 | false | 0.066776 | median | code | normalized |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2009 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# ================================... | 8,144 | false | 0.135525 | median | code | normalized |
# Copyright (C) 2016 Nippon Telegraph and Telephone 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 applicab... | 7,975 | false | 0.110801 | median | code | normalized |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import math
import warnings
import weakref
import numpy as np
from jax import lax, ops, tree_flatten, tree_map, vmap
from jax.flatten_util import ravel_pytree
from jax.nn import softplus
import jax.numpy as jnp
from jax.scipy.linalg ... | 8,038 | false | 0.153113 | median | code | normalized |
import numpy as np
import pytest
from scipy import sparse
from scipy.sparse import random as sparse_random
from sklearn.utils._testing import assert_array_almost_equal
from numpy.testing import assert_allclose, assert_array_equal
from scipy.interpolate import BSpline
from sklearn.linear_model import LinearRegression
f... | 7,990 | false | 0.097784 | median | code | normalized |
import os
from collections import defaultdict
import sys
import hashlib
import json
import time
import string
import random
import uuid
from metaflow.exception import MetaflowException, MetaflowInternalError
from metaflow.plugins import ResourcesDecorator, BatchDecorator, RetryDecorator
from metaflow.parameters import... | 8,236 | false | 0.097405 | median | code | normalized |
import copy
import datetime
import logging
import traceback
import warnings
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from urllib.parse import urlparse
from great_expectations._version import get_versions # isort:skip
__version__ = get_versions()["version"] # isor... | 8,023 | false | 0.076313 | median | code | normalized |
import operator
import uuid
from unittest import mock
from django import forms
from django.core import serializers
from django.core.exceptions import ValidationError
from django.core.serializers.json import DjangoJSONEncoder
from django.db import (
DataError, IntegrityError, NotSupportedError, OperationalError, co... | 8,078 | false | 0.138807 | median | code | normalized |
#! /usr/bin/env python
from __future__ import division, print_function
import argparse
import collections
import logging
import os
import random
import threading
import numpy as np
import pandas as pd
from itertools import cycle, islice
import keras
from keras import backend as K
from keras import optimizers
from ... | 8,233 | false | 0.083456 | median | code | normalized |
import datetime
import os
import pipes
import signal
import time
from gppylib.mainUtils import *
from gppylib.utils import checkNotNone
from gppylib.db import dbconn
from gppylib import gparray, gplog
from gppylib.commands import unix
from gppylib.commands import gp
from gppylib.commands import base
from gppylib.gpar... | 8,049 | false | 0.093512 | median | code | normalized |
# (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
from collections import OrderedDict, ... | 8,174 | false | 0.073185 | median | code | normalized |
import functools
import itertools
import logging
from collections import defaultdict
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
import numpy
import pandas
from pydantic import Field, root_validator, validator
from scipy.optimize import linear_sum_assignment
from typing_extensions import Liter... | 8,195 | false | 0.139112 | median | code | normalized |
# 导入必要的模块
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox, QInputDialog
from PyQt5.QtGui import QImage, QIcon, QPixmap
from PyQt5.QtCore import QTimer, QDateTime, QCoreApplication, QThread
import sys, os
import cv2, imutils
# 导入UI主界面
import main
# 导入信息采集框界面
impor... | 8,200 | false | 0.106534 | median | code | normalized |
import sys
sys.path = ['.'] + sys.path
from test.test_support import verbose, run_unittest
import re
from sre import Scanner
import sys, os, traceback
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
# what you're doing. Some of these tests were carefuly modeled t... | 7,938 | false | 0.096503 | median | code | normalized |
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import datetime
from decimal import Decimal
import pytest
from typepy import DateTime, RealNumber, String, Typecode
from dataproperty import (
Align,
DataPropertyExtractor,
Format,
LineBreakHandling,
MatrixFormatting,
Pre... | 7,973 | false | 0.14954 | median | code | normalized |
# Copyright 2013 Openstack Foundation
# 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 requ... | 8,324 | false | 0.114381 | median | code | normalized |
# coding=utf-8
# Copyright 2019 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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
#
# ... | 8,275 | false | 0.07282 | median | code | normalized |
from chain.core.api import Resource, ResourceField, CollectionField, \
MetadataCollectionField
from chain.core.api import full_reverse, render_error
from chain.core.api import CHAIN_CURIES
from chain.core.api import BadRequestException, HTTP_STATUS_BAD_REQUEST
from chain.core.api import register_resource
from chain... | 8,273 | false | 0.118486 | median | code | normalized |
"""Contains the base scenario class."""
from flow.core.params import InitialConfig
from flow.core.params import TrafficLightParams
from flow.core.params import SumoCarFollowingParams
from flow.core.params import SumoLaneChangeParams
import time
import xml.etree.ElementTree as ElementTree
from lxml import etree
from co... | 7,938 | false | 0.111065 | median | code | normalized |
# -*- coding: utf-8 -*-
#
# 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
#... | 8,201 | false | 0.068259 | median | code | normalized |
# Python standard libraries
import argparse
import glob
import json
import logging
import logging.config
import os
import sys
# Non-standard includes
import numpy as np
import tensorflow as tf
# Maybe import tqdm
show_progress = False
try:
import tqdm
show_progress = True
except ImportError:
pass
try:
... | 8,106 | false | 0.070305 | 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 us... | 8,443 | false | 0.066843 | median | code | normalized |
# Copyright The PyTorch Lightning team.
#
# 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... | 8,090 | false | 0.116335 | median | code | normalized |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import re
import shutil
import time
import warnings
from unittest import SkipTest, skipUnless
from django.conf import settings
from django.core import management
from django.core.management import execute_from_command_line
from djan... | 8,121 | false | 0.12244 | median | code | normalized |
# 定义全局变量和方法
import numpy as np
import math
# import process.process_finger_data as pfd
# 目前选用的图片尺寸
cur_pic_size = [640, 400]
# cur_pic_size = [1280, 800]
# 相机索引对应相机名称
camera_index_to_name = ['A', 'B', 'C', 'D', 'E', 'F']
# 6个相机的外参
camera_a_outer_para = np.mat([[0.574322111, 0.771054881, 0.275006333, 0.93847817],
... | 8,055 | false | 0.12715 | median | code | normalized |
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
# BSD 3-clause license
from __future__ import absolute_import
from __future__ import print_function
import math
from six.moves import range
# Find the best implementation available
from aetros.utils.pilutil import imresize
try:
from cStringIO i... | 8,366 | false | 0.075817 | median | code | normalized |
#
# ReportConverter: A graphical report generator for DRace
#
# Copyright 2019 Siemens AG
#
# Authors:
# <Philip Harr> <philip.harr@siemens.com>
#
# SPDX-License-Identifier: MIT
#
## \package ReportConverter
## \brief Python XML to HTML report converter for the better visualization of drace result data
import... | 8,028 | false | 0.078628 | median | code | normalized |
from __future__ import absolute_import, division
from . import msa_numerics
from pydca.fasta_reader import fasta_reader
import logging
import numpy as np
"""This module implements Direc Coupling Analysis (DCA) of residue coevolution
for protein and RNA sequences using the mean-field algorithm. The final
coevolution sc... | 8,004 | false | 0.092506 | median | code | normalized |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2009 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... | 7,954 | false | 0.126627 | median | code | normalized |
#!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
import ctypes
import numpy
from pyscf import lib
libcgto = lib.load_library('libcgto')
ANG_OF = 1
NPRIM_OF = 2
NCTR_OF = 3
KAPPA_OF = 4
PTR_EXP = 5
PTR_COEFF = 6
BAS_SLOTS = 8
def getints(intor_name, atm, bas, env, shls_slice=None... | 8,252 | false | 0.115694 | median | code | normalized |
"""
This file is licensed under the terms of the Apache License, Version 2.0. See the LICENSE file in the root of this
repository for complete details.
"""
# -----------------------------------------------------------------------
# FILTER MANIFEST
# -------------------------------------------... | 8,123 | false | 0.148445 | median | code | normalized |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# PTF Main framework look and feel
#
# main module imports
from src.core import *
import sys
import readline
import os
import time
import getpass
try:
import pexpect
pexpect_check = 1
except:
print("[!] python-pexpect not installed, gitlab will not work")
... | 8,097 | false | 0.120164 | median | code | normalized |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.