id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
3,100 | transient electric dipole whole space | import numpy as np
from scipy.constants import mu_0, pi
from scipy.special import erf
from SimPEG import utils
def hzAnalyticDipoleT(r, t, sigma):
theta = np.sqrt((sigma * mu_0) / (4 * t))
tr = theta * r
etr = erf(tr)
t1 = (9 / (2 * tr**2) - 1) * etr
t2 = (1 / np.sqrt(pi)) * (9 / tr + 4 * tr) * np... |
3,101 | get display info | # Created By: Virgil Dupras
# Created On: 2009-10-23
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... |
3,102 | sample region cov | """Estimate reasonable bin sizes from BAM read counts or depths."""
import logging
import os
import tempfile
import numpy as np
import pandas as pd
from skgenome import tabio, GenomicArray as GA
from . import coverage, samutil
from .antitarget import compare_chrom_names
from .descriptives import weighted_median
def... |
3,103 | impl | """
Core Implementations for Generator/BitGenerator Models.
"""
from llvmlite import ir
from numba.core import cgutils, types
from numba.core.extending import (intrinsic, make_attribute_wrapper, models,
overload, register_jitable,
register_model)
from... |
3,104 | test basic | from contextlib import closing
from urllib.parse import parse_qs
from urllib.parse import urlparse
from saml2 import BINDING_HTTP_POST
from saml2 import BINDING_SOAP
__author__ = "rolandh"
from saml2.authn_context import INTERNETPROTOCOLPASSWORD
from saml2.authn_context import requested_authn_context
from saml2.cli... |
3,105 | run on image | # Copyright (c) Facebook, Inc. and its affiliates.
import atexit
import bisect
import multiprocessing as mp
from collections import deque
import cv2
import torch
from detectron2.data import MetadataCatalog
from detectron2.engine.defaults import DefaultPredictor
from detectron2.utils.video_visualizer import VideoVisual... |
3,106 | load report from tsv | #!/usr/bin/env python3
# Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
# This source code is licensed under both the GPLv2 (found in the
# COPYING file in the root directory) and Apache 2.0 License
# (found in the LICENSE.Apache file in the root directory).
"""Access the results of benchmark run... |
3,107 | initialize | import math
import random
from collections import defaultdict
from typing import Union, Tuple, Optional, Dict, Callable, cast, Sequence
import torch
import torch.nn.functional as F
from allenact.algorithms.onpolicy_sync.policy import ObservationType
from allenact.algorithms.onpolicy_sync.storage import (
MiniBatc... |
3,108 | numba funcify qr full | import warnings
import numba
import numpy as np
from aesara.link.numba.dispatch import basic as numba_basic
from aesara.link.numba.dispatch.basic import (
_numba_funcify,
get_numba_type,
int_to_float_fn,
)
from aesara.tensor.nlinalg import (
SVD,
Det,
Eig,
Eigh,
Inv,
MatrixInverse,... |
3,109 | annotate with queryset | """Base classes for metric annotators for the standings generator.
Each metric annotator is responsible for computing a particular metric for each
item and annotating the standings with them, for example, in the case of teams,
number of wins (points), or draw strength. Subclasses should be defined in
context-specific ... |
3,110 | test add weekly schedule with invalid options | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
3,111 | build embedding | # 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.
"""
RoBERTa: A Robustly Optimized BERT Pretraining Approach.
"""
import logging
import torch
import torch.nn as nn
import torch.nn.functional... |
3,112 | cfg filter | import itertools
import time
from datetime import datetime
from typing import List
import yaml
import json
import numpy as np
import argparse
from ..utils import REPO_PATH, add_path, get_output_dir, get_output_json, dump_output
with add_path(REPO_PATH):
from components._impl.workers.subprocess_rpc import Unserial... |
3,113 | update note context | # pylint: disable-msg=R0904
import json
import time
from django.urls import reverse
from mediathread.api import ClassLevelAuthentication, UserResource
from mediathread.assetmgr.models import Asset, Source
from mediathread.djangosherd.api import SherdNoteResource
from tastypie import fields
from tastypie.resources impor... |
3,114 | update comment in doc | # Copyright (c) 2019, Frappe Technologies and contributors
# License: MIT. See LICENSE
import json
import frappe
from frappe.database.schema import add_column
from frappe.desk.notifications import notify_mentions
from frappe.exceptions import ImplicitCommitError
from frappe.model.document import Document
from frappe.m... |
3,115 | field description | from django import template
from django.db.models import Q
from questionnaires.models import Poll
from questionnaires.utils import SkipLogicPaginator
import iogt.iogt_globals as globals_
register = template.Library()
@register.inclusion_tag('questionnaires/tags/checkbox.html')
def render_checkbox(field):
return... |
3,116 | test pruning export concat model | # Copyright (c) 2023 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 writ... |
3,117 | get node label | import logging
import re
from enum import Enum
from typing import Dict, List, Optional
from hikaru.model.rel_1_26 import Node, NodeList
class ClusterProviderType(str, Enum):
GKE = "GKE"
AKS = "AKS"
EKS = "EKS"
Kind = "Kind"
Minikube = "Minikube"
RancherDesktop = "RancherDesktop"
Kapsule =... |
3,118 | test command line | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import getpass
import os
import subprocess
import pytest
from sos import execute_workflow
from sos._version import __version__
from sos.eval import get_confi... |
3,119 | chill rule11 | # Leo colorizer control file for chill mode.
# This file is in the public domain.
# Properties for chill mode.
properties = {
"commentEnd": "*/",
"commentStart": "/*",
}
# Attributes dict for chill_main ruleset.
chill_main_attributes_dict = {
"default": "null",
"digit_re": "",
"escape": "",
"h... |
3,120 | test parse | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.protocols.jabber.jid}.
"""
from twisted.trial import unittest
from twisted.words.protocols.jabber import jid
class JIDParsingTests(unittest.TestCase):
def METHOD_NAME(self) -> None:
"""
Test dif... |
3,121 | master config | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
3,122 | set up class | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB 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... |
3,123 | wrapper | # 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, software
# distributed under the Li... |
3,124 | test create t4c instance | # SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0
import pytest
import responses
from fastapi import status, testclient
from sqlalchemy import orm
from capellacollab.settings.modelsources.t4c import crud as t4c_crud
from capellacollab.sett... |
3,125 | build asn | from __future__ import absolute_import, division, print_function
from boost_adaptbx import graph
from boost_adaptbx.graph import graph_structure_comparison
import unittest
class collector(object):
def __init__(self):
self.collected = []
def __call__(self, data):
self.collected.append( data )
ret... |
3,126 | jog | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Connect to a PI stage using the E873 controller and the Q-545.140 translation stages
using Physik Instrumente (PI) GmbH & Co. KG
sc_hardware.physikInstrumente.E873.py
Alistair Boettiger, April 2019
V1.1
Functional connection to x-y axes of PI piezo stage
V1.2
Functional ... |
3,127 | test proc col checksum consistency same preprocessing | import copy
import uuid
from typing import List
from unittest import mock
import pytest
from ludwig.constants import INPUT_FEATURES, OUTPUT_FEATURES
from ludwig.data.cache.util import calculate_checksum
from ludwig.schema.model_types.base import ModelConfig
from ludwig.types import FeatureConfigDict, ModelConfigDict
... |
3,128 | set url | """
This module implements the Response class which is used to represent HTTP
responses in Scrapy.
See documentation in docs/topics/request-response.rst
"""
from typing import Generator, Tuple
from urllib.parse import urljoin
from scrapy.exceptions import NotSupported
from scrapy.http.common import obsolete_setter
fr... |
3,129 | default sortoption | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... |
3,130 | delete if existing | from pyramid.response import Response
from pyramid.view import view_config
from c2cgeoportal_commons.models import DBSession
from geoportailv3_geoportal.userconfig import UserConfig
from pyramid.httpexceptions import HTTPUnauthorized
import json
import urllib.request
import re
import logging
log = logging.getLogger(_... |
3,131 | bad | #!/usr/bin/env python
#
#
# Ravenbrook
# <https://www.ravenbrook.com/>
#
# P4-BISECT -- FIND CHANGE THAT INTRODUCED A BUG
#
# Gareth Rees, Ravenbrook Limited, 2014-04-14
#
#
# 1. INTRODUCTION
#
# This script automates (or partly automates) the process ... |
3,132 | unit sim reaction wheel |
# ISC License
#
# Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copie... |
3,133 | test channel | import os
from asyncio import to_thread
from datetime import timedelta
from math import isclose
from typing import TYPE_CHECKING, Dict
import arrow
import pytest
from humanfriendly.testing import TemporaryDirectory
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession
from virtool... |
3,134 | test bad authentication | import unittest
import base64
from django.conf.urls import include, url
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.test import TestCase
from django.test.utils import override_settings
from oauth2_provider.models import get_application_model
from apps.dot_ext.authe... |
3,135 | find invitations by status | # Copyright © 2019 Province of British Columbia
#
# 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 agr... |
3,136 | set app | from abc import ABC, abstractmethod
from decimal import ROUND_HALF_EVEN, ROUND_UP, Decimal
from travertino.size import at_least
from toga.constants import CENTER, JUSTIFY, LEFT, RIGHT, TRANSPARENT
from ..colors import native_color
from ..libs.activity import MainActivity
from ..libs.android.graphics import PorterDuf... |
3,137 | validate | # Copyright (c) 2022, Frappe Technologies and contributors
# License: MIT. See LICENSE
import json
import frappe
from frappe import _
from frappe.config import get_modules_from_all_apps_for_user
from frappe.model.document import Document
from frappe.modules.export_file import export_to_files
from frappe.query_builder... |
3,138 | tpx path | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import shlex
import sys
from typing import Optional
class Env(object):
def __init__(self, src=None) -> None:
self._d... |
3,139 | prop descriptions | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterternary"
_path_str = "scatterternary.unselected"
_valid_props = {"marker", "textf... |
3,140 | set up | import json
from django.test import TestCase
from tastypie.test import ResourceTestCaseMixin
class TestPVWindProdFactor(ResourceTestCaseMixin, TestCase):
def METHOD_NAME(self):
super(TestPVWindProdFactor, self).METHOD_NAME()
self.submit_url = '/v1/job/'
self.results_url = '/v1/job/<run_u... |
3,141 | notify | import logging
from copy import deepcopy
import requests
from redash.destinations import BaseDestination, register
from redash.models import Alert
class Webex(BaseDestination):
@classmethod
def configuration_schema(cls):
return {
"type": "object",
"properties": {
... |
3,142 | build model | # 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.
from fairseq import utils
from fairseq.models import (
FairseqLanguageModel,
register_model,
register_model_architecture,
)
from f... |
3,143 | min timer | import numpy as np
from qutip.settings import settings as qset
from timeit import default_timer as timer
def METHOD_NAME(function, *args, **kwargs):
min_time = 1e6
for kk in range(10000):
t0 = timer()
function(*args, **kwargs)
t1 = timer()
min_time = min(min_time, t1-t0)
re... |
3,144 | collect | from collections import OrderedDict
from typing import Any, Dict, Iterable, List, Tuple
import mindspore.nn as nn
from mindspore import Tensor
def _cell_list(net: nn.Cell, flatten_sequential: bool = False) -> Iterable[Tuple[str, str, nn.Cell]]:
"""Yield the partially flattened cell list from the model, together ... |
3,145 | write | """
General testing utilities.
"""
import functools
import sys
from contextlib import contextmanager
from django.dispatch import Signal
from markupsafe import escape
from mock import Mock, patch
@contextmanager
def nostderr():
"""
ContextManager to suppress stderr messages
http://stackoverflow.com/a/18... |
3,146 | send rpc | ##############################################################
# Copyright 2023 Lawrence Livermore National Security, LLC
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
#
# This file is part of the Flux resource manager framework.
# For details, see https://github.com/flux-framework.
#
# SPDX-License-Identifier: LGPL-3.0
#####... |
3,147 | geodesic distance | import multiprocessing as mp
import warnings
from typing import Optional
import numpy as np
import torch
from torch import Tensor
def METHOD_NAME(
pos: Tensor,
face: Tensor,
src: Optional[Tensor] = None,
dst: Optional[Tensor] = None,
norm: bool = True,
max_distance: Optional[float] = None,
... |
3,148 | cci | """Momentum Technical Analysis"""
__docformat__ = "numpy"
import logging
from typing import Tuple
import numpy as np
import pandas as pd
import pandas_ta as ta
from sklearn.linear_model import LinearRegression
from openbb_terminal.common.technical_analysis import ta_helpers
from openbb_terminal.decorators import log... |
3,149 | user | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
3,150 | string list |
__author__ = "Andre Merzky, Ole Weidner"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
''' Provides a parser class for the file transfer specification as it is
defined in GFD.90, sction 4.1.3.
'''
from ... import exceptions as se
# 4.1.3 File Transfer Specifications (GFD90 p... |
3,151 | get next | # 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... |
3,152 | on cmd user joined channel | import TeamTalk5
from TeamTalk5 import ttstr
class TTClient():
def __init__(self, host, tcpPort=10333, udpPort=10333, nickName="", userName="", password=""):
self.host = host
self.tcpPort = tcpPort
self.udpPort = udpPort
self.nickName = nickName
self.userName = userName
... |
3,153 | main | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
3,154 | address | from __future__ import annotations
import logging
import os
import re
from typing import List, Callable
from checkov.common.parallelizer.parallel_runner import parallel_runner
from checkov.common.util.file_utils import read_file_with_any_encoding
from checkov.terraform.module_loading.registry import module_loader_reg... |
3,155 | is tflite available | # 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... |
3,156 | codegen config | import contextlib
import copy
import pickle
import unittest
from types import FunctionType, ModuleType
from typing import Any, Dict, Set
from unittest import mock
# Types saved/loaded in configs
CONFIG_TYPES = (int, float, bool, type(None), str, list, set, tuple, dict)
def install_config_module(module):
"""
... |
3,157 | model to pk | """Define class based views for the various API views."""
import json
import logging
from django.db.models import Model
from django.http import Http404
from rest_framework import mixins, viewsets
from rest_framework.exceptions import NotFound
from rest_framework.response import Response
from tracker import logutil
fr... |
3,158 | initial seed | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed.accelerator.abstract_accelerator import DeepSpeedAccelerator
import oneccl_bindings_for_pytorch # noqa: F401 # type: ignore
import psutil
import os
# accelerator for Intel CPU
class CPU_Acceler... |
3,159 | process row | """
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, software
distri... |
3,160 | test fv | # SPDX-License-Identifier: LGPL-3.0-or-later
import os
import numpy as np
from common import (
Data,
j_loader,
tests_path,
)
from deepmd.common import (
data_requirement,
j_must_have,
)
from deepmd.env import (
GLOBAL_NP_FLOAT_PRECISION,
tf,
)
from deepmd.infer.data_modifier import (
D... |
3,161 | test content search | import os
import json
import shutil
import tarfile
import unittest
from click.testing import CliRunner
from rsconnect.main import cli
from rsconnect import VERSION
from rsconnect.models import BuildStatus
from rsconnect.metadata import _normalize_server_url
from .utils import apply_common_args, require_api_key, requi... |
3,162 | c z gates1 | #!/usr/bin/env python3
import numpy as np
import qibo
from qibo import Circuit, gates
class QuantumClassifer:
def __init__(self, nclasses, nqubits, nlayers, RY=True):
"""
Class for a multi-task variational quantum classifier
Args:
nclases: int number of classes to be classifi... |
3,163 | validate content type | # Copyright 2019 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... |
3,164 | canonic index list to biallelic gt list | """
Utility functions only used by unit tests
"""
import textwrap
from collections import defaultdict
from whatshap.core import Read, ReadSet, Genotype
def string_to_readset(s, w=None, sample_ids=None, source_id=0, scale_quality=None):
s = textwrap.dedent(s).strip()
if w is not None:
w = textwrap.dede... |
3,165 | test timeouterror deprecated | import eventlet
from eventlet import greenio, hubs, greenthread
from eventlet.green import ssl
import tests
def check_hub():
# Clear through the descriptor queue
eventlet.sleep(0)
eventlet.sleep(0)
hub = hubs.get_hub()
for nm in 'get_readers', 'get_writers':
dct = getattr(hub, nm)()
... |
3,166 | scatter | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
3,167 | pre process coco mobilenet | """
dataset related classes and methods
"""
# pylint: disable=unused-argument,missing-docstring
import logging
import sys
import time
import cv2
import numpy as np
logging.basicConfig(level=logging.INFO)
log = logging.getLogger("dataset")
class Item():
def __init__(self, label, img, idx):
self.label =... |
3,168 | test sequence of iterables | from enum import auto
from importlib.metadata import version as package_version
from os.path import abspath, expanduser, sep
from pathlib import Path
import pytest
from packaging.version import parse as parse_version
from napari.utils.misc import (
StringEnum,
_is_array_type,
_quiet_array_equal,
abspa... |
3,169 | type | # 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 . imp... |
3,170 | verify arccos 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] -... |
3,171 | test on retry | from typing import Type, Union
import pytest
from mock import AsyncMock, call
import mock
from opentrons.drivers.asyncio.communication.async_serial import AsyncSerial
from opentrons.drivers.asyncio.communication.serial_connection import (
SerialConnection,
AsyncResponseSerialConnection,
)
from opentrons.drive... |
3,172 | perform | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
""" Non-blocking database connections.
"""
from typing import Callable, Any, Optional, Iterator, Sequence
import ... |
3,173 | check | # 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)
from spack.package import *
class NetlibLapack(CMakePackage):
"""LAPACK version 3.X is a comprehensive FORTRAN libra... |
3,174 | fprint | from typing import Callable, Optional
class Colors:
red = "\033[31m"
green = "\033[32m"
yellow = "\033[33m"
blue = "\033[34m"
purple = "\033[35m"
cyan = "\033[36m"
white = "\033[37m"
underline = "\033[2m"
bold = "\033[1m"
negative = "\033[3m"
reset = "\033[0m"
def __... |
3,175 | test get subscripts of | # -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2021-2022, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
3,176 | db project event | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
from logging import getLogger
from typing import Optional, Dict
from ogr.abstract import GitProject
from ogr.parsing import RepoUrl
from packit.config import PackageConfig, JobConfigTriggerType
from packit_service.config import ServiceConf... |
3,177 | test anydbm modification | """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... |
3,178 | write registry | """
Copyright (C) 2023 Intel Corporation
Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE.TXT
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Generates a unique id for each spec function that doesn't have it.
"""
from fileinput import FileInput
import ut... |
3,179 | get frozen defaults | # 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... |
3,180 | write binary proto | # Copyright 2019 Xilinx 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, ... |
3,181 | unflatten | # 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... |
3,182 | test create temp table | from __future__ import annotations
import pathlib
from contextlib import _GeneratorContextManager, contextmanager
from typing import TYPE_CHECKING, Any, Callable, Generator, Optional
import pytest
from pydantic import ValidationError
from great_expectations.datasource.fluent import SqliteDatasource
from tests.dataso... |
3,183 | 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 . imp... |
3,184 | do template | """
Base class for TIM plugin server. THIS IS DEPRECATED, DO NOT USE IN NEW CODE!
Serving from local port 5000.
"""
import http.server
import json
import logging
import os
import socketserver
from tim_common.fileParams import (
get_template,
file_to_string,
do_headers,
multi_post_params,
get_param,... |
3,185 | post operations | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
3,186 | get sim station property options | import json
import plotly
import numpy as np
from NuRadioReco.utilities import units
from NuRadioReco.framework.parameters import stationParameters as stnp
from NuRadioReco.framework.parameters import showerParameters as shp
import radiotools.helper as hp
from dash import html
from dash import dcc
from dash.dependencie... |
3,187 | test eq | import pickle
from bluesky.plans import count
import pytest
from ..queries import (
Contains,
FullText,
In,
Key,
NotIn,
TimeRange,
Regex,
ScanID,
ScanIDRange,
)
from ..tests.utils import get_uids
def test_time_range():
# TODO Test an actual search.
# RE does not let us sp... |
3,188 | get table line | import sys
import numpy as np
def sci_not(num):
exp = int(np.log10(num))
mant = num/10.0**exp
if mant < 1:
mant *= 10.0
exp -= 1
return r"${:5.3f} \times 10^{{{}}}$".format(round(mant, 3), exp)
class Variable():
def __init__(self, name, lo, o1, med, o2, hi):
self.name = ... |
3,189 | kronecker product | # Copyright (C) Unitary Fund
# Portions of this code have been adapted from PennyLane's tutorial
# on Classical Shadows.
# Original authors: PennyLane developers: Brian Doolittle, Roeland Wiersema
# Tutorial link: https://pennylane.ai/qml/demos/tutorial_classical_shadows
#
# This source code is licensed under the GPL l... |
3,190 | assert raises unavailable solver | import pyomo.common.unittest as unittest
import pyomo.environ as pyo
from pyomo.contrib.iis import write_iis
from pyomo.contrib.iis.iis import _supported_solvers
from pyomo.common.tempfiles import TempfileManager
import os
def _get_infeasible_model():
m = pyo.ConcreteModel()
m.x = pyo.Var(within=pyo.Binary)
... |
3,191 | test llvm objcopy | import unittest
from unittest import mock
from pythonforandroid.androidndk import AndroidNDK
class TestAndroidNDK(unittest.TestCase):
"""
An inherited class of `unittest.TestCase`to test the module
:mod:`~pythonforandroid.androidndk`.
"""
def setUp(self):
"""Configure a :class:`~pythonfo... |
3,192 | test roc curve | from unittest.mock import patch
import numpy as np
import pytest
import sklearn
import torch
from sklearn.metrics import roc_curve
from ignite import distributed as idist
from ignite.contrib.metrics.roc_auc import RocCurve
from ignite.engine import Engine
from ignite.exceptions import NotComputableError
from ignite.m... |
3,193 | re emit values | """
[Name] BeamInfo
[Description]
BeamInfo hardware object is used to define final beam size and shape.
It can include aperture, slits and/or other beam definer (lenses or other eq.)
[Emited signals]
beamInfoChanged
[Included Hardware Objects]
-----------------------------------------------------------------------
|... |
3,194 | to dict | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
3,195 | get client | import json
import cv2
import base64
import threading
import time
from datetime import datetime
from websocket_server import WebsocketServer
# Graphical User Interface Class
class GUI:
# Initialization function
# The actual initialization
def __init__(self, host, car):
t = threading.Thread(target=... |
3,196 | get subcommand entry points | # Copyright 2020 pydicom authors. See LICENSE file for details.
"""Pydicom command line interface program
Each subcommand is a module within pydicom.cli, which
defines an add_subparser(subparsers) function to set argparse
attributes, and calls set_defaults(func=callback_function)
"""
import argparse
from importlib.m... |
3,197 | show mesh | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from porespy.tools import get_tqdm
__all__ = [
'bar',
'imshow',
'show_mesh',
'show_panels',
]
tqdm = get_tqdm()
def show_panels(im, rc=[3, 3], axis=0):
r"""
Show slices of a 3D image ... |
3,198 | class browser | """Class browser.
XXX TO DO:
- reparse when source changed (maybe just a button would be OK?)
(or recheck on window popup)
- add popup menu with more options (e.g. doc strings, base classes, imports)
- show function argument list? (have to do pattern matching on source)
- should the classes and methods lists also... |
3,199 | test20 | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.