id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
4,200 | forward | # Copyright (c) OpenMMLab. All rights reserved.
from typing import Optional
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from mmdet.registry import MODELS
from .utils import weight_reduce_loss
def varifocal_loss(pred: Tensor,
target: Tensor,
we... |
4,201 | build single handler application | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
4,202 | test emg clean | import biosppy
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pytest
import scipy.stats
import neurokit2 as nk
# =============================================================================
# EMG
# =============================================================================
def test... |
4,203 | test library nucleic acid depleted in term | import pytest
def test_library_starting_quantity_post(testapp, library_starting_quantity):
testapp.post_json('/library', library_starting_quantity)
def test_library_fragmentation_method_string(testapp, library_with_invalid_fragmentation_methods_string):
res = testapp.post_json('/library', library_with_inval... |
4,204 | skip if asan class | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import ctypes
import os
import random
import socket
import time
from contextlib import c... |
4,205 | plugin init | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: https://foglamp-foglamp-documentation.readthedocs-hosted.com
# FOGLAMP_END
""" Plugin module which adds a square block of specific monochrome shade on images """
import os
import logging
import datetime
import filter_ingest
import traceback
import copy
import json
impor... |
4,206 | float to fixed to float | """
The `OpenType specification <https://docs.microsoft.com/en-us/typography/opentype/spec/otff#data-types>`_
defines two fixed-point data types:
``Fixed``
A 32-bit signed fixed-point number with a 16 bit twos-complement
magnitude component and 16 fractional bits.
``F2DOT14``
A 16-bit signed fixed-point number with... |
4,207 | test allineate inputs | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..preprocess import Allineate
def METHOD_NAME():
input_map = dict(
allcostx=dict(
argstr="-allcostx |& tee %s",
extensions=None,
position=-1,
xor=["out_file", "out_matrix", "out_param_file", "out_wei... |
4,208 | get test suite id | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... |
4,209 | setup | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
4,210 | add handle | import logging
from abc import abstractmethod
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Mapping,
Optional,
Sequence,
Union,
)
from cloudevents.conversion import to_json
from cloudevents.http import CloudEvent
from _ert_com_protocol import DispatcherMessage
from... |
4,211 | prettify | #
# Copyright 2019 The FATE 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 appli... |
4,212 | map | import sys
from collections.abc import Callable, Iterable, Iterator, Mapping
from types import TracebackType
from typing import Any, Generic, TypeVar
from typing_extensions import Literal, Self
if sys.version_info >= (3, 9):
from types import GenericAlias
__all__ = ["Pool", "ThreadPool"]
_S = TypeVar("_S")
_T = ... |
4,213 | set hash | from functools import reduce
from operator import or_
from django.db import models
from django.utils import timezone
from sentry.backup.scopes import RelocationScope
from sentry.constants import MAX_EMAIL_FIELD_LENGTH
from sentry.db.models import BoundedBigIntegerField, Model, region_silo_only_model, sane_repr
from s... |
4,214 | finalize | import logging
import numpy as np
import pymc3 as pm
from typing import Callable
from .inference_task_base import Sampler, Caller, CallerUpdateSummary, \
HybridInferenceTask, HybridInferenceParameters
from .. import config, types
from ..models.model_ploidy import PloidyModelConfig, PloidyModel, \
PloidyWorkspa... |
4,215 | test results sorted by created desc | import datetime
from unittest import mock
import pytest
from h_matchers import Any
from h.models import Group
from h.models.group import ReadableBy
from h.services.group import GroupService, groups_factory
class TestGroupServiceFetch:
def test_it_proxies_to_fetch_by_groupid_if_groupid_valid(self, svc):
... |
4,216 | test bio degradation full run | '''
Test biodegradation module
'''
from datetime import timedelta
import pytest
import numpy as np
from gnome.environment import constant_wind, Water, Waves
# from gnome.spills.elements import floating
from gnome.weatherers import (Evaporation,
NaturalDispersion,
... |
4,217 | test simple wrong body | #!/usr/bin/env python
#
# Copyright 2014 Google Inc. 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 requir... |
4,218 | name | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
4,219 | send request | # 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 ... |
4,220 | test value at returns expected value | # -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file ex... |
4,221 | wrapper | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Pyresample developers
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your o... |
4,222 | start | import logging
import typing
import rdflib
import rdflib.namespace
from tqdm import tqdm
import ontomatch.utils.blackboard
import ontomatch.utils.util
import ontomatch.knowledge.geocoding
import ontomatch.knowledge.geoNames
class Agent():
def METHOD_NAME(self, addr:str, add_knowledge:bool, http:bool=False) -> t... |
4,223 | test delete file success | #
# Copyright (c) 2015, Arista Networks, 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 condit... |
4,224 | to json | import itertools
import web
import json
from infogami.utils import delegate
from infogami.utils.view import safeint
from openlibrary.core.models import Thing
from openlibrary.plugins.upstream import utils
from openlibrary.plugins.worksearch.search import get_solr
from openlibrary.utils import (
find_olid_in_strin... |
4,225 | test pickle definition syntax error | import pickle
import pytest
from pint import (
DefinitionSyntaxError,
DimensionalityError,
LogarithmicUnitCalculusError,
OffsetUnitCalculusError,
PintError,
Quantity,
RedefinitionError,
UndefinedUnitError,
UnitRegistry,
)
from pint.errors import LOG_ERROR_DOCS_HTML, OFFSET_ERROR_DO... |
4,226 | test multapses true | # -*- coding: utf-8 -*-
#
# test_connect_fixed_outdegree.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 o... |
4,227 | double click callback | """Test render window interactor"""
import time
import pytest
import pyvista as pv
from pyvista import _vtk
def empty_callback():
return
@pytest.mark.needs_vtk_version(9, 1)
def test_observers():
pl = pv.Plotter()
# Key events
with pytest.raises(TypeError):
pl.add_key_event('w', 1)
... |
4,228 | get file type | import json
import re
from django import template
from django.conf import settings
from django.templatetags.static import static
from django.utils.html import format_html
from wagtail.models import Page
register = template.Library()
@register.filter
def clean_whitespace(value):
return re.sub(r'\s+', '-', value)... |
4,229 | verify arcsin 1d | from lpython import i32, f32, f64
from numpy import empty, arcsin, arccos, sin, cos, sqrt, arctan, tan, degrees, radians, float32, float64
from math import pi
def verify1d_same(array: f32[:], result: f32[:], size: i32):
i: i32
eps: f32
eps = f32(1e-6)
for i in range(size):
assert abs(array[i] -... |
4,230 | set up | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the model chat crowdsourcing task.
"""
import glob
import json
import os
import unittest
imp... |
4,231 | update | #!/usr/bin/env python3
"""
Test program to demonstrate the remote config interfaces in
rclone.
This program can simulate
rclone config create
rclone config update
rclone config password - NOT implemented yet
rclone authorize - NOT implemented yet
Pass the desired action as the first argument th... |
4,232 | test parse op selection invalid | import pytest
from dagster import In, asset, define_asset_job, in_process_executor, job, op, repository
from dagster._core.errors import DagsterExecutionStepNotFoundError, DagsterInvalidSubsetError
from dagster._core.selector.subset_selector import (
MAX_NUM,
Traverser,
clause_to_subset,
generate_dep_gr... |
4,233 | publish target info | #!/usr/bin/env python3
import sys
import cv2
import image_geometry
import mil_ros_tools
import numpy as np
import rospy
from geometry_msgs.msg import Pose2D
from mil_msgs.msg import RangeStamped
from std_msgs.msg import Header
from subjugator_msgs.srv import VisionRequest2D, VisionRequest2DResponse
def contour_sort(... |
4,234 | transform legacy config | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from enum import Enum
from typing import Any, List, Mapping, Optional, Type, Union
from airbyte_cdk.sources.file_based.config.avro_format import AvroFormat
from airbyte_cdk.sources.file_based.config.csv_format import CsvFormat
from airbyte_cdk.sources.file_... |
4,235 | get measurement | # coding=utf-8
#
# Created in part with code with the following copyright:
#
# Copyright (c) 2014 D. Alex Gray
# 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 w... |
4,236 | test invalid launch 2 | # Copyright (c) Robocorp Technologies Inc.
# 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 ap... |
4,237 | produce sdf | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import json
import argparse
from pr... |
4,238 | read homepage | import asyncio
from tempfile import NamedTemporaryFile
import time
from typing import Optional
from fastapi import BackgroundTasks
from fastapi import FastAPI
from fastapi import HTTPException
from fastapi import Header
from fastapi.responses import FileResponse
from fastapi.responses import StreamingResponse
from pyd... |
4,239 | test basic api | import json
import logging
from unittest.case import skipIf
from tenacity import after_log, retry_if_exception_type, stop_after_attempt, wait_exponential, wait_random
from integration.config.service_names import MODE, REST_API
from integration.helpers.base_test import BaseTest
from integration.helpers.exception impor... |
4,240 | test logistic mean | # 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,241 | json response from error | from typing import Any, Dict, Iterator, List, Mapping, Optional
import orjson
from django.http import HttpRequest, HttpResponse, HttpResponseNotAllowed
from zerver.lib.exceptions import JsonableError, UnauthorizedError
class MutableJsonResponse(HttpResponse):
def __init__(
self,
data: Dict[str, ... |
4,242 | set command entry | # Copyright (c) 2022, NVIDIA CORPORATION. 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 appli... |
4,243 | average hash and sizes | import os
import platform
import sys
from env_indigo import getPlatform, isIronPython, isJython
if sys.version_info > (3, 0):
from .bistring3 import BitString
else:
from .bistring1 import BitString
HASH_SIZE = 32
if isIronPython():
import math
elif isJython():
from java.awt import Image, RenderingHi... |
4,244 | test has identites | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2023 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This ... |
4,245 | location | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
4,246 | check max ber size | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2022 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
#
import logging
import pytest
from lib389.tasks import *
from lib389.topologies import topology_st
from lib389._constan... |
4,247 | read topographic data | ############################################################
# Program is part of MintPy #
# Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi #
# Author: Zhang Yunjun, Heresh Fattahi, 2013 #
############################################################
import os
im... |
4,248 | serve | from typing import TYPE_CHECKING, Optional
from django import shortcuts
from django.core import paginator
from django.db import models
from modelcluster.fields import ParentalKey
from wagtail import models as wagtail_models
from wagtail.admin.panels import FieldPanel, InlinePanel
from wagtail.contrib.routable_page imp... |
4,249 | supports device | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=W0613
from collections import namedtuple
from typing import Any, Dict, NewType, Optional, Sequence, Tuple, Type
import numpy
import onnx.checker
import onnx.onnx_cpp2py_export.checker as c_checker
from onnx import IR_... |
4,250 | freeze field value | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""The `BuildFileDefaultsParserState.set_defaults` is used by the pants.engine.internals.Parser,
exposed as the `__defaults__` BUILD file symbol.
When parsing a BUILD (from the rule `pants... |
4,251 | tgs to webm | # mautrix-telegram - A Matrix-Telegram puppeting bridge
# Telegram lottie sticker converter
# Copyright (C) 2019 Randall Eramde Lawrence
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ... |
4,252 | tear down | import sys
from importlib import reload, import_module
from django.contrib.auth.models import User
from django.http import JsonResponse, HttpResponse
from django.urls import reverse, clear_url_caches
from django.test import override_settings
from django.conf import settings
from tethys_apps.base.testing.testing import... |
4,253 | to str | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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,254 | prepare | #
# Copyright (C) 2012 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... |
4,255 | get seconds | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
from Qt import QtCore, QtWidgets, QtGui
from rezgui.util import update_font, create_pane
from rez.utils.formatting import readable_time_duration
import math
class Canvas(QtWidgets.QWidget):
secondsHover = QtCore.Signal(int)
s... |
4,256 | test | from typing import Any, Text, Dict, Union, List, Optional, TYPE_CHECKING
import rasa.shared.constants
# WARNING: Be careful about adding any top level imports at this place!
# These functions are imported in `rasa.__init__` and any top level import
# added here will get executed as soon as someone runs `import ra... |
4,257 | test contains conversions | #!/usr/bin/python3
import pytest
from brownie.convert.datatypes import EthAddress, HexString, ReturnValue, Wei
from brownie.project import compile_source
string_fixture = "bar baz"
@pytest.fixture
def return_value(accounts, tester):
yield tester.manyValues(
88, [False, False, False], accounts[2], [("0x... |
4,258 | authenticate | import datetime
from org.gluu.service.cdi.util import CdiUtil
from org.gluu.oxauth.security import Identity
from org.gluu.model.custom.script.type.auth import PersonAuthenticationType
from org.gluu.oxauth.service import UserService, AuthenticationService
from org.gluu.util import StringHelper, ArrayHelper
from com.unb... |
4,259 | url | # --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------... |
4,260 | test 01 create token | # coding: utf-8
"""
This test file tests the lib.tokens.sshkeytoken
This depends on lib.tokenclass
"""
from privacyidea.lib.error import TokenAdminError
from .base import MyTestCase
from privacyidea.lib.tokenclass import ROLLOUTSTATE
from privacyidea.lib.tokens.sshkeytoken import SSHkeyTokenClass
from privacyidea.model... |
4,261 | list | # 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 ... |
4,262 | make log msg | # Copyright 2019 ICON Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
4,263 | export sources | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir
from conan.tools.build import check_min_cppstd
from conan.tools... |
4,264 | client random | import socket
from _socket import _Address, _RetAddress
from _typeshed import Incomplete, ReadableBuffer
from collections.abc import Callable, MutableSequence, Sequence
from typing import Any, TypeVar
from OpenSSL.crypto import X509, PKey, X509Name
OPENSSL_VERSION_NUMBER: int
SSLEAY_VERSION: int
SSLEAY_CFLAGS: int
SS... |
4,265 | discover | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from typing import Any, Iterator, List, Mapping, MutableMapping, Optional, Tuple
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models import (
AirbyteCatalog,
AirbyteConnectionStatus,
AirbyteMessage,
AirbyteStream,
Config... |
4,266 | test anydbm keys | """Test script for the dbm.open function based on testdumbdbm.py"""
import unittest
import dbm
import os
from test.support import import_helper
from test.support import os_helper
try:
from dbm import ndbm
except ImportError:
ndbm = None
dirname = os_helper.TESTFN
_fname = os.path.join(dirname, os_helper.TEST... |
4,267 | url parameters | # --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------... |
4,268 | test html repr scalar | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
# @file
# @author Neil Vaytet
import numpy as np
import pytest
import scipp as sc
from ..factory import (
make_binned_data_array,
make_dense_data_array,
make_dense_datagroup,
make_dense_dataset,... |
4,269 | set default user | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
4,270 | hash text | # ----------------------------------------------------------------------------
# Copyright (C) 2021-2023 Deepchecks (https://www.deepchecks.com)
#
# This file is part of Deepchecks.
# Deepchecks is distributed under the terms of the GNU Affero General
# Public License (version 3 or later).
# You should have received a ... |
4,271 | test w backend options | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
4,272 | extract data | # 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 ... |
4,273 | rootfn | #
# Solver class using Scipy's adaptive time stepper
#
import casadi
import pybamm
import numpy as np
import importlib
import scipy.sparse as sparse
scikits_odes_spec = importlib.util.find_spec("scikits")
if scikits_odes_spec is not None:
scikits_odes_spec = importlib.util.find_spec("scikits.odes")
if scikits... |
4,274 | generate mars | import argparse
import json
import os
import shutil
import subprocess
import sys
import urllib.request
REPO_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
sys.path.append(REPO_ROOT)
MODEL_STORE_DIR = os.path.join(REPO_ROOT, "model_store_gen")
os.makedirs(MODEL_STORE_DIR, exist_ok=True)
MAR_CONFI... |
4,275 | resize sample | # Part of the implementation is borrowed and modified from PackNet-SfM,
# made publicly available under the MIT License at https://github.com/TRI-ML/packnet-sfm
import random
import cv2
import numpy as np
import torchvision.transforms as transforms
from PIL import Image
from modelscope.models.cv.video_depth_estimatio... |
4,276 | test no desktop section | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2019 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
4,277 | check new session | import importlib.resources
import logging
import platform
import sys
import textwrap
import time
import tempfile
import cairo
import gi
from gi.repository import Adw, Gdk, Gio, GLib, Gtk, GtkSource, Pango
from gaphor.abc import Service
from gaphor.application import Application, distribution
from gaphor.core import T... |
4,278 | test out file | #!/usr/bin/env python
# Copyright 2018, Google 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 o... |
4,279 | find line style index | from qtpy.QtWidgets import QComboBox, QDoubleSpinBox, QHBoxLayout, QLabel, QWidget
from ert.gui.plottery import PlotStyle
STYLE_OFF = ("Off", None)
STYLE_AREA = ("Area", "#")
STYLE_SOLID = ("Solid", "-")
STYLE_DASHED = ("Dashed", "--")
STYLE_DOTTED = ("Dotted", ":")
STYLE_DASH_DOTTED = ("Dash dotted", "-.")
STYLESET... |
4,280 | get level | #!/usr/bin/env python
# datetime:2020/5/22 18:29
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from dongtai_common.models.agent import IastAgent
from dongtai_common.models.header_vulnerablity import IastHeaderVulnerability
from dongtai_common.models.hook_type import Hook... |
4,281 | do node | # Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de>
# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
# Revised UI structure for crmsh
#
# Goals:
#
# - Modularity
# - Reduced global state
# - Separate static hierarchy from current context
# - Fix comple... |
4,282 | kill | # Copyright (c) 2021 Matt Colligan
#
# 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 the rights
# to use, copy, modify, merge, publish, distr... |
4,283 | test file with missing final nl | """
Test script for the 'cmd' module
Original by Michael Schneider
"""
import cmd
import sys
from test import test_support
import re
import unittest
import StringIO
class samplecmdclass(cmd.Cmd):
"""
Instance the sampleclass:
>>> mycmd = samplecmdclass()
Test for the function parseline():
>>> my... |
4,284 | get subvolume output | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
4,285 | match case block | """Match hook."""
from typing import Union, Optional, Any
import re
from tackle.models import BaseHook, Context, Field
from tackle.parser import walk_element
from tackle.render import render_string
from tackle.exceptions import HookCallException
class MatchHook(BaseHook):
"""
Hook for match / case statements... |
4,286 | commands for | # Copyright 2013-2023 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)
"""Manages the details on the images used in the various stages."""
import json
import os.path
import shlex
import sys
imp... |
4,287 | load image | # Copyright (c) 2022 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 in w... |
4,288 | which | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2018-2022 F4PGA 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
#
# Unl... |
4,289 | get blocks | import logging
import re
import numpy as np
import sympy
from pysb.bng import generate_equations
from pysb.core import Expression
from pysb.logging import setup_logger
from pysb.simulator.base import Simulator, SimulatorException
class SSABase(Simulator):
_supports = {'multi_initials': True, 'multi_param_values... |
4,290 | build legacy tx | from __future__ import annotations
from typing import Sequence, Optional, Union, Dict, Any, Set, List, NewType
import abc
import solders.hash
import solders.keypair
import solders.pubkey
import solders.instruction
import solders.signature
import solders.transaction
from .errors import SolTxSizeError
SolTxIx = sol... |
4,291 | test context is lazy | import unittest.mock as mock
import pytest
import sqlalchemy as sa
import sqlalchemy.dialects.mysql
import sqlalchemy.dialects.oracle
import sqlalchemy.dialects.postgresql
import sqlalchemy.dialects.sqlite
from sqlalchemy import inspect
from sqlalchemy_utils import Password, PasswordType, types # noqa
from sqlalchem... |
4,292 | check parameters match | # TODO inspect for Cython (see sagenb.misc.sageinspect)
import re
import inspect
import pytest
import vispy.scene.cameras.magnify
from vispy.testing import run_tests_if_main, requires_numpydoc
public_modules = [
# the list of modules users need to access for all functionality
'vispy',
'vispy.color',
... |
4,293 | test ascension day | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
4,294 | test constant dunder | import math
import pytest
from jinja2.exceptions import UndefinedError
from jinja2.nativetypes import NativeEnvironment
from jinja2.nativetypes import NativeTemplate
from jinja2.runtime import Undefined
@pytest.fixture
def env():
return NativeEnvironment()
def test_is_defined_native_return(env):
t = env.f... |
4,295 | mul | # Copyright (c) 2016, Hubert Kario
#
# See the LICENSE file for legal information regarding use of this file.
# compatibility with Python 2.6, for that we need unittest2 package,
# which is not available on 3.3 or 3.4
from __future__ import division
try:
import unittest2 as unittest
except ImportError:
... |
4,296 | test hernquist mass normalization | __author__ = "sibirrer"
import numpy as np
import numpy.testing as npt
import pytest
from lenstronomy.Cosmo.lens_cosmo import LensCosmo
from lenstronomy.Util import util
class TestLensCosmo(object):
"""Tests the UnitManager class routines."""
def setup_method(self):
z_L = 0.8
z_S = 3.0
... |
4,297 | default bpe | # Mikel Broström 🔥 Yolo Tracking 🧾 AGPL-3.0 license
import gzip
import html
from functools import lru_cache
import ftfy
import regex as re
from boxmot.utils import BOXMOT
@lru_cache()
def METHOD_NAME():
return BOXMOT / "appearance/backbones/clip/clip/bpe_simple_vocab_16e6.txt.gz"
@lru_cache()
def bytes_to_... |
4,298 | list | # pylint: disable=too-many-lines
# 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) AutoRe... |
4,299 | parse | #!/usr/bin/python3
# coding: utf-8
# Small BBCode parser for reading Godot's XML doc format, so it can be translated into different formats (not just
# Markdown, HTML etc).
class NodeText:
def __init__(self, text):
self.text = text
class NodeTag:
def __init__(self):
self.name = ""
s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.