id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
14,100 | melody log likelihood | # Copyright 2023 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
14,101 | get schedule | from datetime import datetime, time, timedelta
from operator import itemgetter
from typing import Dict
from libretime_api_client.v2 import ApiClient
from libretime_shared.datetime import time_in_milliseconds, time_in_seconds
from ..liquidsoap.models import StreamPreferences
from .events import (
ActionEvent,
... |
14,102 | scrape upper | import datetime as dt
import pytz
import os
import re
import lxml
from dateutil.relativedelta import relativedelta
import dateutil.parser
from openstates.scrape import Scraper, Event
from openstates.exceptions import EmptyScrape
from .apiclient import OpenLegislationAPIClient
from utils import hash_key
"""
Senate ... |
14,103 | test cluster setup | import pytest
import salt.modules.pcs as pcs
from tests.support.mock import MagicMock, patch
class TstData:
def __init__(self):
self.nodea = "nodea"
self.nodeb = "nodeb"
self.nodes = [self.nodea, self.nodeb]
self.extra_args = ["test", "extra", "args"]
self.cluster_name = "... |
14,104 | get endpoints is | import sys, csv
from tornado.httputil import url_concat
from datetime import datetime
if sys.version_info < (3, 0):
from urllib import pathname2url as quote
else:
from urllib.parse import quote as quote
ENDPOINT_URL_PREFIX = "http://127.0.0.1:9000/query/ldbc_snb/"
def get_messages_from_person(person_id, num):
p... |
14,105 | get token | """News source to send a notification whenever a twitch streamer goes live."""
import datetime
import discord
from dateutil import parser
from loguru import logger
from .AbstractSources import DataBasedSource
class TwitchSource(DataBasedSource):
"""News source to send a notification whenever a twitch streamer ... |
14,106 | build controller | # 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... |
14,107 | test isochrone from unkown sa | # Copyright (c) 2001-2022, Hove and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Hove (www.hove.com).
# Help us simplify mobility and open public transport:
#... |
14,108 | new version is higher | import sys
import frontmatter
import json
import os
import re
import datetime
from time import time_ns
from glob import glob
from pathlib import Path
from ruamel.yaml import YAML
from ruamel.yaml.resolver import Resolver
from deepdiff import DeepDiff
from io import StringIO
from packaging.version import Version
from os... |
14,109 | get exact | from __future__ import absolute_import, division, print_function
import time, random
from cctbx import maptbx
from scitbx.array_family import flex
from libtbx.test_utils import approx_equal
from libtbx import group_args
from six.moves import range
def func(f,x,y,z):
return eval(f)
def METHOD_NAME(f, gx,gy,gz, x,y,z... |
14,110 | start | import gc
import inspect
import sys
import time
try:
import objgraph
except ImportError:
objgraph = None
import cherrypy
from cherrypy import _cprequest, _cpwsgi
from cherrypy.process.plugins import SimplePlugin
class ReferrerTree(object):
"""An object which gathers all referrers of an object to a give... |
14,111 | test ticker | import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
sys.path.append(root)
# ----------------------------------------------------------------------------
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/... |
14,112 | should wrap | import inspect
import warnings
from functools import wraps
from typing import Dict, Iterable
from .protofeature import Feature
from pyvo.dal.exceptions import PyvoUserWarning
__all__ = ['features', 'prototype_feature', 'activate_features', 'PrototypeWarning', 'PrototypeError']
features: Dict[str, "Feature"] = {
... |
14,113 | test stringio | # Copyright 1999 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for Bio.File module."""
import os.path
import shutil
import tempfile
import unittest... |
14,114 | get user | import pytest
from django.contrib.auth.models import AnonymousUser
from resources.enums import UnitAuthorizationLevel, UnitGroupAuthorizationLevel
from resources.models import Resource, ResourceType, Unit
from users.models import User
from respa_admin import permissions as perm
@pytest.mark.django_db
@pytest.mark.... |
14,115 | test get fed | import pytest
from pandas import DataFrame
from openbb_terminal.fixedincome import fred_model
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("api_key", "MOCK_API_KEY"),
],
}
@pytest.mark.... |
14,116 | unused data | import io
from _typeshed import ReadableBuffer, StrOrBytesPath
from collections.abc import Mapping, Sequence
from typing import IO, Any, TextIO, overload
from typing_extensions import Literal, Self, TypeAlias, final
__all__ = [
"CHECK_NONE",
"CHECK_CRC32",
"CHECK_CRC64",
"CHECK_SHA256",
"CHECK_ID_M... |
14,117 | rewrite event asset url | # This file is part of Indico.
# Copyright (C) 2002 - 2023 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import base64
import mimetypes
import re
from contextlib import contextmanager
from urllib.parse import ur... |
14,118 | test args | # --- 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 io
import sys
import pytest
from lib389.cli_conf.pwpolicy import (create_user_policy, create_subtree_policy,
... |
14,119 | bijector | # 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... |
14,120 | compare explain functions | import numpy as np
import pytest
from giskard.datasets.base import Dataset
from giskard.models.base import BaseModel
from giskard.models.model_explanation import (
explain,
explain_text,
_calculate_sample_shap_values,
_calculate_dataset_shap_values,
)
@pytest.mark.parametrize(
"ds_name, model_nam... |
14,121 | close | # 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 ... |
14,122 | check output | import numpy as np
import sys
import time
from shapely.geometry import Polygon
import paddle
import unittest
from ext_op import matched_rbox_iou
def rbox2poly_single(rrect, get_best_begin_point=False):
"""
rrect:[x_ctr,y_ctr,w,h,angle]
to
poly:[x0,y0,x1,y1,x2,y2,x3,y3]
"""
x_ctr, y_ctr, width... |
14,123 | test application with rescaling | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
14,124 | check execution result | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
#
import operator
import time
from c7n.config import Config
from c7n.data import Data as DataMatcher
from c7n.utils import load_file
from c7n.output import NullTracer
from .core import CollectionRunner
from .output import RichCli, Output
... |
14,125 | change text | # vim: set sts=2 ts=2 sw=2 tw=99 et:
import argparse
import subprocess
from collections import deque
from collections import namedtuple
from pygments.token import Token as TokenKind
from pygments.lexers.c_cpp import CppLexer
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--in-place', act... |
14,126 | test convert to digital fir | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2014-2020)
#
# This file is part of GWpy.
#
# GWpy 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)... |
14,127 | test sync enabled | '''
copyright: Copyright (C) 2015-2022, Wazuh Inc.
Created by Wazuh, Inc. <info@wazuh.com>.
This program is free software; you can redistribute it and/or modify it under the terms of GPLv2
type: integration
brief: File Integrity Monitoring (FIM) system watches selected files and triggering ale... |
14,128 | sequence of | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
OpenGEODE - A tiny SDL Editor for TASTE
This module is a template for backends such as code generators
Entry point:
The AST of the model that is parsed is described in ogAST.py
A Visitor Pattern using Python's "singledispatch" mechanism is used
... |
14,129 | run infer | # Copyright 2021 Kacper Kluk. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
14,130 | get site command option | # flake8: noqa
import re
import inspect
from django.utils import timezone
from tethys_cli.site_commands import add_site_parser
args = re.findall(
"add_argument\(.*?dest='(.*?)'.*?help='(.*?)'\)",
inspect.getsource(add_site_parser),
re.DOTALL,
)
args_dict = {arg[0]: arg[1] for arg in args}
args_dict.pop(... |
14,131 | build image | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
from dataclasses import dataclass
from typing import Mapping
from pants.backend.docker.subsystems.docker_options import DockerOptions
from pa... |
14,132 | seek | import sys
from _typeshed import ReadableBuffer, Unused
from collections.abc import Iterable, Iterator, Sized
from typing import NoReturn, overload
from typing_extensions import Self
ACCESS_DEFAULT: int
ACCESS_READ: int
ACCESS_WRITE: int
ACCESS_COPY: int
ALLOCATIONGRANULARITY: int
if sys.platform == "linux":
MAP... |
14,133 | print type |
"""A set of utilities for selecting data and creating displays.
For use from the Jython shell."""
import ucar.unidata.data.DataChoice as DataChoice
shell=None
def selectData(name1='Select Field',name2=None,name3=None,name4=None,name5=None):
"""Select up to 5 data fields. This returns a List of the actual Dat... |
14,134 | draw buttons | import logging
import math
import tkinter as tk
from tkinter import ttk
from typing import TYPE_CHECKING
from core.gui import appconfig, validation
from core.gui.dialogs.dialog import Dialog
from core.gui.themes import FRAME_PAD, PADX, PADY, scale_fonts
from core.gui.validation import LARGEST_SCALE, SMALLEST_SCALE
lo... |
14,135 | test env | # Copyright 2021-2022 NVIDIA 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 ... |
14,136 | replace moving mean | import numpy as np
from scipy.special import erf
from astropy.modeling.models import Gaussian1D, custom_model
from astropy.modeling.fitting import LevMarLSQFitter
from astropy.convolution import Box1DKernel, convolve
from astropy.stats import sigma_clip
__all__ = ['clip_outliers', 'gauss_removal']
def clip_outliers(... |
14,137 | tidy | """
Documentation goes here
"""
import sys
import os
from . import config_initialization
from . import prepare
from . import prepexp
from . import workflow
from . import resubmit
from . import helpers
from . import logfiles
from . import prev_run
import esm_parser
class SimulationSetup(object):
def __init__(sel... |
14,138 | test gen new subtoken list | # Copyright 2018 MLBenchmark Group. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
14,139 | send request | # encoding: utf-8
#
# Copyright 2017-2023 Greg Neagle.
#
# 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 l... |
14,140 | get semantic ocp version from config | # -*- coding: utf8 -*-
"""
Module for version related util functions.
"""
import re
from semantic_version import Version
from ocs_ci.framework import config
from ocs_ci.ocs import defaults
from ocs_ci.ocs.exceptions import WrongVersionExpression
def get_semantic_version(version, only_major_minor=False, ignore_pre_r... |
14,141 | get sync element | import logging
from xml.sax import saxutils
from lxml import etree as ElementTree
from casexml.apps.case import const
from casexml.apps.case.xml import check_version, V1
from casexml.apps.case.xml.generator import get_generator, date_to_xml_string,\
safe_element, CaseDBXMLGenerator
import six
from casexml.apps.pho... |
14,142 | mean reduce symbolic shape | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import numpy as np
from copy import deepcopy as dc
from common import compare_numpy_output
@compare_numpy_output()
def test_sum(A: dace.float64[10, 5, 3]):
return np.sum(A)
@compare_numpy_output()
def test_sum_1(A: dace.floa... |
14,143 | generate id | #!/usr/bin/env python
# datetime:2021/1/14 下午3:35
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_elasticsearch_dsl import Document, fields
from django_elasticsearch_dsl.registries import registry
from dongtai_common.models.agent import IastAgent
from dongtai_common.mode... |
14,144 | get addrs full | from lake.models.model import Model
from lake.models.addr_gen_model import AddrGenModel
import math as mt
import kratos as kts
class OutputAddrCtrlModel(Model):
def __init__(self,
interconnect_output_ports,
mem_depth,
num_tiles,
banks,
... |
14,145 | setup | """Manage in-memory profile interaction."""
from collections import OrderedDict
from typing import Any, Mapping, Type
from weakref import ref
from ...config.injection_context import InjectionContext
from ...config.provider import ClassProvider
from ...storage.base import BaseStorage
from ...storage.vc_holder.base imp... |
14,146 | test sigtool 01 run cdiff | # Copyright (C) 2020-2023 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
"""
Run sigtool tests.
"""
import os
from pathlib import Path
import platform
import shutil
import subprocess
import sys
import time
import unittest
import testcase
os_platform = platform.platform()
operating_system = os_plat... |
14,147 | error format | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
14,148 | expected json schema | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import pytest
from airbyte_cdk.models import AirbyteStream, ConfiguredAirbyteCatalog
from airbyte_cdk.models.airbyte_protocol import DestinationSyncMode, SyncMode
from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator
from sour... |
14,149 | published json | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020-2021 CERN.
# Copyright (C) 2020-2021 Northwestern University.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Test RDMRecordService generated links."""
import p... |
14,150 | write omsconfig host telemetry | #!/usr/bin/python2
import json
import time
import datetime
import os
import math
import signal
def METHOD_NAME(message, pathToCurrentScript='', level = 'INFO'):
omsagent_telemetry_path = '/var/opt/microsoft/omsconfig/status'
dsc_host_telemetry_path = os.path.join(omsagent_telemetry_path, 'omsconfighost')
... |
14,151 | test source show one | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from poetry.config.source import Source
from poetry.poetry import Poetry
from tests.types import CommandTesterFactory
@pytest.fixture
def teste... |
14,152 | test group search | # -*- coding: utf-8 -*-
from lmfdb.tests import LmfdbTest
class BelyiTest(LmfdbTest):
def test_stats(self):
L = self.tc.get("/Belyi/stats")
assert "Galois orbits of Belyi maps" in L.get_data(as_text=True) and "proportion" in L.get_data(as_text=True)
def test_random(self):
self.check_a... |
14,153 | test xsslint violation number not found | """
Tests for paver xsslint quality tasks
"""
from unittest.mock import patch
import pytest
from paver.easy import call_task
import pavelib.quality
from .utils import PaverTestCase
class PaverXSSLintTest(PaverTestCase):
"""
Test run_xsslint with a mocked environment in order to pass in opts
"""
de... |
14,154 | get access token | #!/usr/bin/env python
# -- coding: utf-8 --
# 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 (th... |
14,155 | image key | import logging
import warnings
from typing import Callable, Dict, List, Optional, Union
import numpy as np
import PIL
from PIL import ImageFile
from torch import nn
from ..constants import COLUMN, IMAGE, IMAGE_META, IMAGE_VALID_NUM, PROMPT, TEXT
from .collator import ListCollator, PadCollator
from .utils import is_ro... |
14,156 | get lang | from rest_framework import viewsets
from .models import ListModel, DispatchListModel
from . import serializers
from utils.page import MyPageNumberPagination
from rest_framework.filters import OrderingFilter
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.response import Response
from .... |
14,157 | test get column name physical column | # 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... |
14,158 | test latest cursor | import datetime
import json
import time
from freezegun import freeze_time
from tests.util.base import add_fake_message
def add_account_with_different_namespace_id(
db_session, email_address="cypress@yahoo.com"
):
import platform
from inbox.models import Namespace
from inbox.models.backends.generic ... |
14,159 | patched execute | from ddtrace import Pin
from ddtrace import config
from ddtrace.constants import SPAN_KIND
from ddtrace.constants import SPAN_MEASURED_KEY
from ddtrace.contrib import dbapi
from ddtrace.contrib.psycopg.cursor import Psycopg2FetchTracedCursor
from ddtrace.contrib.psycopg.cursor import Psycopg2TracedCursor
from ddtrace.c... |
14,160 | histogram fixed width bins | # Copyright 2015 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... |
14,161 | use model | import itertools
import json
import os
import pprint
import time
import warnings
from dataclasses import is_dataclass, dataclass
from typing import TypeVar, Callable, Any
from urllib.parse import urlparse
import requests
from flask import Request, current_app, g, Response, has_request_context
from flask import request... |
14,162 | render | import typing as t
from ast import literal_eval
from ast import parse
from itertools import chain
from itertools import islice
from types import GeneratorType
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
fro... |
14,163 | l1 error | import numpy as np
from .GaussLobattoQuadrature import GaussLobattoQuadrature
from .GaussLegendreQuadrature import GaussLegendreQuadrature
class PolygonMeshIntegralAlg():
def __init__(self, mesh, q, cellmeasure=None, cellbarycenter=None):
self.mesh = mesh
self.integrator = mesh.integrator(q)
... |
14,164 | output summary | """Formatter base class for JSONFormatter and YamlFormatter."""
import argparse
import os
import sys
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Type
class FileFormatter(ABC):
args: argparse.Namespace
scanned_file_found: int
unformatted_file_count: int
arg_parser:... |
14,165 | test dbt repo clone patch | import os
import subprocess
import tempfile
from splitgraph.ingestion.dbt.utils import (
compile_dbt_manifest,
patch_dbt_project_sources,
prepare_git_repo,
)
from splitgraph.utils.yaml import safe_load
_REPO_PATH = "https://github.com/splitgraph/jaffle_shop_archive"
def METHOD_NAME():
# Test a coupl... |
14,166 | remove item | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# >>> TABLE OF CONTENTS:
# ------------------------------------------------------------------------------
# 1.0 Import modules
# 2.0 Lower camel case
# 3.0 Get list of files
# 4.0 Add item
# 5.0 R... |
14,167 | beta cmd | from __future__ import annotations
import zipfile
from datetime import datetime
from pathlib import Path
from typing import List, Optional
import click
from chia.cmds.beta_funcs import (
default_beta_root_path,
prepare_chia_blockchain_log,
prepare_logs,
prepare_plotting_log,
prompt_beta_warning,
... |
14,168 | 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
# --------------------------------... |
14,169 | refresh logs | import gzip
import boto3
from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from grandchallenge.algorithms.models import AlgorithmImage
from grandchallenge.core.models import UUIDModel
from grandchallenge.core.storage import copy_s3_object, private_s3_... |
14,170 | amount | import re
from .base import ObjectBase
from .customer import Customer
class Subscription(ObjectBase):
@classmethod
def get_resource_class(cls, client, **kwargs):
from ..resources import CustomerSubscriptions
customer = kwargs["customer"]
return CustomerSubscriptions(client, customer)... |
14,171 | hook connect | #!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
from qiling import Qiling
from qiling.os.windows.api import *
from qiling.os.windows.fncc import *
from qiling.os.windows.structs import *
WSAAPI = STDCALL
# int WSAStartup(
# WORD wVersionRequired,
# LPWSAD... |
14,172 | provisioning state | # 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... |
14,173 | submatrix | # Author: Leland McInnes <leland.mcinnes@gmail.com>
#
# License: BSD 3 clause
import time
from warnings import warn
import numpy as np
import numba
from sklearn.utils.validation import check_is_fitted
import scipy.sparse
@numba.njit(parallel=True)
def fast_knn_indices(X, n_neighbors):
"""A fast computation of k... |
14,174 | get version | """ Tools to bridge the Makefiles and the python build environment
(or provide utilities) for python subprojects
NOTE: This file must be python2.7 compatible
"""
import argparse
import json
import os
import subprocess
import sys
from collections import namedtuple
PackageEntry = namedtuple("PackageEntry", ("br_versi... |
14,175 | is finite | """
Root system data for type A infinity
"""
# ***************************************************************************
# Copyright (C) 2016 Andrew Mathas <Andrew dot Mathas at Sydney dot edu dot au>
#
# Distributed under the terms of the GNU General Public License (GPL)
# https://www.gnu.org/licen... |
14,176 | main | #!/usr/bin/env python3
# -*- coding: utf-8; py-indent-offset: 4 -*-
#
# Author: Linuxfabrik GmbH, Zurich, Switzerland
# Contact: info (at) linuxfabrik (dot) ch
# https://www.linuxfabrik.ch/
# License: The Unlicense, see LICENSE file.
# https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING.... |
14,177 | get qnnpack backend config | import torch
from ._common_operator_config_utils import (
_get_binary_op_configs,
_get_bn_configs,
_get_cat_config,
_get_conv_configs,
_get_default_op_configs,
_get_embedding_op_configs,
_get_fixed_qparams_op_configs,
_get_linear_configs,
_get_rnn_op_configs,
_get_share_qparams_o... |
14,178 | validate overflows | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Contains the Layout class"""
from traitlets import Unicode, Instance, CaselessStrEnum, validate
from .widget import Widget, register
from .._version import __jupyter_widgets_base_version__
CSS_PROPERTIES=['inherit... |
14,179 | error format | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
14,180 | get tax | from datetime import date, timedelta
from decimal import Decimal
from django.contrib import admin, messages
from django.db import transaction
from django.http import HttpResponse
from django.shortcuts import redirect
from django.utils.translation import gettext_lazy as _
from conferences.models import Conference
from... |
14,181 | init global port presence | # Platform-specific SFP transceiver interface for SONiC
# This plugin supports QSFP and SFP.
try:
import time
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil cl... |
14,182 | test outfile1 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
14,183 | bind | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
14,184 | test upcast | """unit tests for sparse utility functions"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal
from pytest import raises as assert_raises
from scipy.sparse import sputils
from scipy.sparse.sputils import matrix
from scipy._lib._numpy_compat imp... |
14,185 | segment | #!/usr/bin/env python
# -- coding: utf-8 --
#
############################################################################
#
# MODULE: i.segment.hierarchical
#
# AUTHOR(S): Pietro Zambelli (University of Trento)
#
# COPYRIGHT: (C) 2013 by the GRASS Development Team
#
# This program is free software under the GN... |
14,186 | test remove from department | from tests.base import ApiDBTestCase
from zou.app.services import persons_service
from zou.app.services.exception import PersonNotFoundException
from zou.app.utils import auth
class PersonServiceTestCase(ApiDBTestCase):
def setUp(self):
super(PersonServiceTestCase, self).setUp()
self.generate_fi... |
14,187 | lexists | """Pathname and path-related operations for the Macintosh."""
import os
from stat import *
import genericpath
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink",... |
14,188 | mpls lsr | # Copyright (c) 2023 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
from __future__ import annotations
from functools import cached_property
from ansible_collections.arista.avd.plugins.plugin_utils.avdfacts import AvdFacts
from ansible_co... |
14,189 | test get cluster dashboards for sharded frameworks | # Copyright 2015-2016 Yelp 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 writin... |
14,190 | get config | # coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. 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 r... |
14,191 | register queues | # Copyright The Lightning AI 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 in wri... |
14,192 | optimize tags | #!/usr/bin/env python
# lint: pylint
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Fetch OSM keys and tags.
To get the i18n names, the scripts uses `Wikidata Query Service`_ instead of for
example `OSM tags API`_ (sidenote: the actual change log from
map.atownsend.org.uk_ might be useful to normalize OSM tags).
Out... |
14,193 | get material xml | #**********************************************************************
# Copyright 2020 Advanced Micro Devices, 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.o... |
14,194 | remove | #
# SPDX-License-Identifier: GPL-2.0-only
#
from abc import ABCMeta, abstractmethod
from oe.utils import execute_pre_post_process
from oe.manifest import *
from oe.package_manager import *
import os
import traceback
class Sdk(object, metaclass=ABCMeta):
def __init__(self, d, manifest_dir):
self.d = d
... |
14,195 | get intents for material | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, Dict, Any, Set, List
from PyQt6.QtCore import Qt, QObject, pyqtProperty, pyqtSignal, QTimer
import cura.CuraApplication
from UM.Qt.ListModel import ListModel
from UM.Settings.ContainerRegistry ... |
14,196 | test invalid request content | from unittest import TestCase
from unittest.mock import patch
from samcli.local.lambda_service.lambda_error_responses import LambdaErrorResponses
class TestLambdaErrorResponses(TestCase):
@patch("samcli.local.services.base_local_service.BaseLocalService.service_response")
def test_resource_not_found(self, se... |
14,197 | build coco wholebody hand dataset | # Copyright (c) OpenMMLab. All rights reserved.
from unittest import TestCase
import numpy as np
from mmpose.datasets.datasets.hand import CocoWholeBodyHandDataset
class TestCocoWholeBodyHandDataset(TestCase):
def METHOD_NAME(self, **kwargs):
cfg = dict(
ann_file='test_coco_wholebody.json'... |
14,198 | test no asdf header | import io
import os
import pytest
import asdf
from asdf import generic_io
def test_no_yaml_end_marker(tmp_path):
content = b"""#ASDF 1.0.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.0.0
foo: bar...baz
baz: 42
"""
path = os.path.join(str(tmp_path), "test.asdf")
buff = io.BytesIO(content)
... |
14,199 | from json dict | # pylint: disable=wrong-or-nonexistent-copyright-notice
from typing import Any, Dict, FrozenSet, Iterable, Mapping, Tuple, TYPE_CHECKING, Union
import numpy as np
from cirq import linalg, protocols, value
from cirq._compat import proper_repr
from cirq.ops import raw_types
if TYPE_CHECKING:
import cirq
# TODO(#3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.