id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
16,800 | train | import os.path as osp
import time
from math import ceil
import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.datasets import TUDataset
from torch_geometric.loader import DataLoader
from torch_geometric.nn import DenseGraphConv, GCNConv, dense_mincut_pool
from torch_geometric.u... |
16,801 | test aggregate value key | # Basic smoke tests: aggregation
import unittest
import calipertest as calitest
class CaliperAggregationTest(unittest.TestCase):
""" Caliper test case """
def test_aggregate_default(self):
target_cmd = [ './ci_test_aggregate' ]
query_cmd = [ '../../src/tools/cali-query/cali-query', '-e' ]
... |
16,802 | test cityscapes val dataloader | import unittest
from typing import Type
import pkg_resources
import yaml
from torch.utils.data import DataLoader, Dataset
from super_gradients.training.dataloaders.dataloaders import (
cityscapes_train,
cityscapes_val,
cityscapes_stdc_seg50_train,
cityscapes_stdc_seg50_val,
cityscapes_stdc_seg75_v... |
16,803 | log warning | # Copyright (c) Yugabyte, 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, sof... |
16,804 | completed | # ***************************************************************************
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
16,805 | test with scope correct user | # SPDX-License-Identifier: MPL-2.0
# Copyright (C) 2018 - 2023 Gemeente Amsterdam
from unittest import mock
from django.conf import settings
from django.test import TestCase
from rest_framework import exceptions
from signals.apps.users.factories import SuperUserFactory, UserFactory
from signals.auth import backend
fr... |
16,806 | system data | # 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... |
16,807 | properties | # 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... |
16,808 | remove | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
16,809 | analysis step version atac encode4 alignment | import pytest
@pytest.fixture
def analysis_step_version_3(testapp, analysis_step, software_version):
item = {
'schema_version': '3',
'version': 1,
'analysis_step': analysis_step['@id'],
'software_versions': [
software_version['@id'],
],
}
return item
@... |
16,810 | data out | """
This module defines a generic session class. All connection instances
(both on Portal and Server side) should inherit from this class.
"""
import time
from django.conf import settings
# ------------------------------------------------------------
# Server Session
# -----------------------------------------------... |
16,811 | get user id | ## @file
# This file is used to define class objects of INF file [UserExtension] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
InfUserExtensionsObject
'''
from Logger import StringTable as ST
fr... |
16,812 | test artifact get metadata | import pytest
import salt.modules.nexus as nexus
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {nexus: {}}
def METHOD_NAME():
with patch(
"salt.modules.nexus._get_artifact_metadata_xml",
MagicMock(
return_value="""<?xml ve... |
16,813 | test 2386 duplicate attribute error message | """
Copyright 2020 Inmanta
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 ... |
16,814 | load qa multiexp | """
desispec.io.qa
==============
IO routines for QA.
"""
from __future__ import print_function, absolute_import, division
import os, yaml
import json
from desiutil.io import yamlify
from desispec.io import findfile, read_meta_frame
from desispec.io.util import makepath
from desiutil.log import get_logger
from .uti... |
16,815 | get existing or not | #!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2020 The FIAAS 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
#
# Unle... |
16,816 | system data | # 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... |
16,817 | create subquery filter | from typing import Any, Callable, Dict, Optional, Union
import sqlalchemy as sa
from szurubooru import db, errors
from szurubooru.func import util
from szurubooru.search import criteria
from szurubooru.search.configs.base_search_config import Filter
from szurubooru.search.typing import SaColumn, SaQuery
Number = Uni... |
16,818 | test not raising error if multiple objects | # -*- coding: utf-8 -*-
# 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... |
16,819 | train | # 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... |
16,820 | filesystem | # Copyright 2019 Wilke Schwiedop. 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
"""
eval.py: evaluator for find.
"""
fro... |
16,821 | test build update | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name, attribute-defined-outside-init, objects-update-used
from xmlrpc.client import Fault as XmlRPCFault
from xmlrpc.client import ProtocolError
from django.test import override_settings
from tcms.rpc.tests.utils import APITestCase
from tcms.tests.factories import Bu... |
16,822 | prune | import dataclasses
import types
from typing import Any, Optional, cast, overload
import tmt
import tmt.base
import tmt.options
import tmt.result
import tmt.steps
import tmt.steps.report
from tmt.utils import field
DEFAULT_NAME = "junit.xml"
junit_xml: Optional[types.ModuleType] = None
# Thanks to import burried in ... |
16,823 | generic error cb | #!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
import dbus
try:
from gi.repository import GObject
except ImportError:
import gobject as GObject
import sys
from dbus.mainloop.glib import DBusGMainLoop
bus = None
mainloop = None
BLUEZ_SERVICE_NAME = 'org.bluez'
DBUS_OM_IFACE = 'org.freed... |
16,824 | test returns 401 on invalid token | from unittest import mock
from urllib.parse import urlencode
import pytest
from sentry import options
from sentry.integrations.slack.requests.action import SlackActionRequest
from sentry.integrations.slack.requests.base import SlackRequest, SlackRequestError
from sentry.integrations.slack.requests.event import SlackE... |
16,825 | inputs | # coding=utf-8
# Copyright 2020, The T5 Authors and HuggingFace 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 ... |
16,826 | on connect | import logging
import socket
import struct
import zlib
from itertools import chain
from netaddr import IPGlob, IPSet
from judge.utils.unicode import utf8text
logger = logging.getLogger('judge.bridge')
size_pack = struct.Struct('!I')
assert size_pack.size == 4
MAX_ALLOWED_PACKET_SIZE = 8 * 1024 * 1024
def proxy_l... |
16,827 | load points | import array
import geohash
import os
import math
import operator
import six
import ujson as json
from collections import defaultdict, OrderedDict
from leveldb import LevelDB
from geodata.distance.haversine import haversine_distance
class PointIndex(object):
include_only_properties = None
persistent_index ... |
16,828 | copy | import ctypes
from collections.abc import Callable, Iterable, Sequence
from ctypes import _CData, _SimpleCData, c_char
from multiprocessing.context import BaseContext
from multiprocessing.synchronize import _LockLike
from types import TracebackType
from typing import Any, Generic, Protocol, TypeVar, overload
from typin... |
16,829 | on 204 | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
16,830 | terminate | ###############################################################################
# Popen for LokyProcess.
#
# author: Thomas Moreau and Olivier Grisel
#
import os
import sys
import signal
import pickle
from io import BytesIO
from multiprocessing import util, process
from multiprocessing.connection import wait
from multi... |
16,831 | to tensor | # Copyright (c) Alibaba, Inc. and its affiliates.
import os
from typing import Dict
from modelscope.metainfo import Models
from modelscope.models import TorchModel
from modelscope.models.base import Tensor
from modelscope.models.builder import MODELS
from modelscope.models.nlp.space import SpaceGenerator, SpaceModelB... |
16,832 | inputs | """
external_layer
==============
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.METHOD_NAME import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecificati... |
16,833 | apply extension | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2017-2022 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... |
16,834 | framework version | # Copyright 2019-2020 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" fil... |
16,835 | private endpoint | # 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... |
16,836 | test event main domain kwargs | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# 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 ... |
16,837 | hill3 | # This code is from https://github.com/automl/pylearningcurvepredictor
# pylearningcurvepredictor author: Tobias Domhan, tdomhan
import numpy as np
from scipy.optimize import minimize
def optimize_model_class(fn_class, deg_freedom, x, y, bounds=None):
def likelihood(parameters):
return (
len(... |
16,838 | switch login | #!/usr/bin/env python
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... |
16,839 | 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... |
16,840 | align tilt | # Copyright (c) Princeton University.
# This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.
# Authors: Lingjie Mei
from typing import Iterable
import bpy
import numpy as np
from assets.utils.decorate import toggle_hide
from nodes import n... |
16,841 | get network watcher | # 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
__all__ ... |
16,842 | t int | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
File: visit_exprs_parser.py
Authors: Cyrus Harrison <cyrush@llnl.gov>
Maysam Moussa... |
16,843 | test indicators | import pytest
import logging as logging
import ckanext.hdx_theme.helpers.helpers as h
import ckan.model as model
import ckan.tests.legacy as tests
import ckanext.hdx_search.actions.actions as actions
import ckanext.hdx_theme.tests.hdx_test_base as hdx_test_base
import ckanext.hdx_theme.tests.hdx_test_with_inds_and_or... |
16,844 | download file | # This file is part of Trackma.
#
# 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 program is distributed in the... |
16,845 | after handler | # Copyright The OpenTelemetry 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 ... |
16,846 | main | #!/usr/bin/env python
############################################################################
#
# MODULE: hd.db.connect
# AUTHOR(S): Matej Krejci (matejkrejci@gmail.com
#
# COPYRIGHT: (C) 2016 by the GRASS Development Team
#
# This program is free software under the GNU General
# ... |
16,847 | get queryset | from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView
from dfirtrack_main.forms import... |
16,848 | get type | """Resources that represent material templates."""
from typing import List, Dict, Optional, Union, Sequence, Type
from citrine._rest.resource import GEMDResource
from citrine._serialization.properties import List as PropertyList
from citrine._serialization.properties import Union as PropertyUnion
from citrine._seriali... |
16,849 | test async 00 | #!/usr/bin/env python
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest
from gnuradio import fec
from _qa_helper import _qa_helper
from _qa_helper_async import _qa_helper_async
class test_fecap... |
16,850 | configure step | ##
# Copyright 2009-2023 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
16,851 | client error | # (c) 2022 Red Hat Inc.
#
# This file is part of Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import pytest
import sys
from unittest.mock import MagicMock
from unittest.mock import sentinel
import ansible_collections.amazon.aws.plugins.modules.ec2_instance as ec... |
16,852 | init data base environment | import ctypes
from ansys.dpf.gate import utils
from ansys.dpf.gate import errors
from ansys.dpf.gate.generated import capi
from ansys.dpf.gate.generated import data_base_abstract_api
from ansys.dpf.gate.generated.data_processing_capi import DataProcessingCAPI
#----------------------------------------------------------... |
16,853 | test when the element is not in | # These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/custom-set/canonical-data.json
# File last updated on 2023-07-19
import unittest
from custom_set import (
CustomSet,
)
class CustomSetTest(unittest.TestCase):
def test_sets_with_no_... |
16,854 | rewrite for request | import logging
from typing import Callable
from django.utils.html import format_html
from django.utils.translation import gettext as _
from rest_framework.request import Request
from openforms.authentication.constants import AuthAttribute
from openforms.config.models import GlobalConfiguration
from openforms.submiss... |
16,855 | 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... |
16,856 | prepare request | # 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... |
16,857 | orientation | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
... |
16,858 | subnet | import typing as t
from datetime import timedelta
import pytest
from pycroft.lib import user as lib_user
from pycroft.model.facilities import Room
from pycroft.model.task import Task, UserTask, TaskStatus, TaskType
from pycroft.model.task_serialization import UserMoveParams
from pycroft.model.user import User
from te... |
16,859 | mem rss | """Utilities for debugging memory usage, blocking calls, etc."""
import os
import sys
import traceback
from contextlib import contextmanager
from functools import partial
from pprint import pprint
from celery.platforms import signals
from celery.utils.text import WhateverIO
try:
from psutil import Process
except ... |
16,860 | tenant id | # 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
__all__ =... |
16,861 | get segments vectors | # -*- coding: utf-8 -*-
import logging
import numpy as np
from numpy.linalg import norm
from scipy.spatial import cKDTree
from scipy.sparse import bsr_matrix
def _subdivide_streamline(streamline, n_steps):
if n_steps < 2:
return streamline
dirs = streamline[1:] - streamline[:-1]
subdivided = np.... |
16,862 | get embed video thumbnail | import uuid
import embed_video
from django.templatetags.static import static
from django.urls import reverse
from django.db import models
from django.conf import settings
from django.utils import timezone
from embed_video.backends import detect_backend
from embed_video.fields import EmbedVideoField
class Portfolio(m... |
16,863 | test wrong input size | #!/usr/bin/env python
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... |
16,864 | revert locations to recipient countries | # -*- coding: utf-8 -*-
from django.core.exceptions import MultipleObjectsReturned
from django.db import models, migrations
def remove_country_from_validation_sets(apps, schema_editor):
"""
Removes the rsr_projectlocation.country field from all validation sets.
"""
ProjectEditorValidationSet = apps.... |
16,865 | ranking | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Print PYPI statistics in MarkDown format.
Useful sites:
* https://pepy.tech/project/psutil
* https://pypistats.org/packages/psut... |
16,866 | initialize | from bs4 import BeautifulSoup
from glob import glob
from collections import defaultdict
from math import log, exp
from random import random
import zlib
from apps.rss_feeds.models import MStory
from nltk import FreqDist
def lgammln(xx):
"""
Returns the gamma function of xx.
Gamma(z) = Integral(0,infinity) of t^(... |
16,867 | test scale | """
test_images.py contains unittests for libqtile.images.Img
and its supporting code.
"""
import os
from glob import glob
from os import path
import cairocffi
import cairocffi.pixbuf
import pytest
from libqtile import images
TEST_DIR = path.dirname(os.path.abspath(__file__))
DATA_DIR = path.join(TEST_DIR, "data")
P... |
16,868 | process | # -*- coding: utf-8 -*-
# Copyright 2022 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extractors for vichan imageboards"""
from .common import BaseExtractor, M... |
16,869 | per slot reduce | """
This example shows how to use custom reducers with PyTorch. In this example,
the custom reducer is a per-class F1 score. It is based on Determined's
mnist_pytorch tutorial code.
The parts of the file which differ from the tutorial are the PerClassF1Score class
and the calls to wrap_reducer() and self.f1_score.up... |
16,870 | fetch exchange | from csv import reader
from datetime import datetime, timedelta
from logging import Logger, getLogger
from typing import Any, Dict, List, Optional, Tuple, Union
from pytz import timezone
from requests import Response, Session
from parsers.lib.exceptions import ParserException
DATA_URL = "https://otr.ods.org.hn:3200/... |
16,871 | output | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
16,872 | test merge o s2 mixed versions | import io
import itertools
from fontTools import ttLib
from fontTools.ttLib.tables._g_l_y_f import Glyph
from fontTools.fontBuilder import FontBuilder
from fontTools.merge import Merger, main as merge_main
import difflib
import os
import re
import shutil
import sys
import tempfile
import unittest
import pathlib
import ... |
16,873 | after update | """
Module for exposing a (virtual) sensor to KNX bus.
It provides functionality for
* push local state changes to KNX bus
* KNX devices may read local values via GROUP READ.
(A typical example for using this class is the outside temperature
read from e.g. an internet serviceand exposed to the KNX bus.
KNX devices m... |
16,874 | get valid discounts | from decimal import Decimal
import itertools
__all__ = ['LineItemDiscounter']
class LineItemDiscounter:
def get_discounted_line_items(self, line_items, coupons=[]):
"""Return line items with the maximum possible discount applied."""
if not line_items:
return None
if len({line_... |
16,875 | test change password on other user | from django.urls import reverse
from ...conf.test import override_dynamic_settings
from ...core.utils import encode_json_html
from ..models import Ban
from ..test import UserTestCase, create_test_user
from ..tokens import make_password_change_token
class ForgottenPasswordViewsTests(UserTestCase):
def test_guest_... |
16,876 | export sources | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import apply_conandata_patches, chdir, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir
from conan.tools.microsoft import is_msvc
from conan.tools.scm import Version
from conans import Auto... |
16,877 | test call error if small | import numpy as np
import pytest
from probnum import filtsmooth, problems, randprocs, randvars, utils
import probnum.problems.zoo.filtsmooth as filtsmooth_zoo
@pytest.fixture(name="problem")
def fixture_problem(rng):
"""Car-tracking problem."""
return filtsmooth_zoo.car_tracking(rng=rng)
@pytest.fixture(na... |
16,878 | dequantize | import torch
from torch import Tensor
import numpy as np
from torch.ao.quantization.experimental.apot_utils import float_to_apot, apot_to_float, quant_dequant_util
# class to store APoT quantizer and
# implement quantize and dequantize
class APoTQuantizer:
alpha: torch.Tensor
gamma: torch.Tensor
quantizati... |
16,879 | main | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2016 Christoph Reiter
#
# 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 2 of the License, or
# (at your option) any late... |
16,880 | after request decorator | # -*- coding: utf-8 -*-
"""
flask_cors
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CORS) using a simple decorator.
:copyright: (c) 2014 by Cory Dolphin.
:license: MIT, see LICENSE for more details.
"""
from flask import request
from .cor... |
16,881 | test blobfs download 100 1 kb file | import os
import shutil
import sys
import unittest
import utility as util
class BlobFs_Download_SharedKey_User_Scenarios(unittest.TestCase):
def setUp(self):
cmd = util.Command("login").add_arguments("--service-principal").add_flags("application-id", os.environ['ACTIVE_DIRECTORY_APPLICATION_ID']).add_flag... |
16,882 | verify execute permission | """
Required Notice: Copyright (C) Zoomer Analytics GmbH.
xlwings PRO is dual-licensed under one of the following licenses:
* PolyForm Noncommercial License 1.0.0 (for noncommercial use):
https://polyformproject.org/licenses/noncommercial/1.0.0
* xlwings PRO License (for commercial use):
https://github.com/xlwing... |
16,883 | get availability set 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... |
16,884 | get icon | import copy
import os
import re
from openpype.lib import (
FileDef,
BoolDef,
)
from openpype.pipeline import (
CreatedInstance,
)
from openpype.pipeline.create import (
get_subset_name,
TaskNotSetError,
)
from openpype.hosts.traypublisher.api.plugin import TrayPublishCreator
from openpype.hosts.tr... |
16,885 | create pipeline from model | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import os
import zipfile
import datasets
import pandas as pd
from transformers import (AutoModelForSequenceClassification, AutoTokenizer,
pipeline)
from raiutils.common.retries import retry_function
from responsibleai_t... |
16,886 | plugin preferences | # Quod Libet Telepathy Plugin
# Copyright 2012 Christoph Reiter
# 2012,2016 Nick Boultbee
#
# 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 2 of the License, or
# (at your op... |
16,887 | tear down | #!/usr/bin/env python
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... |
16,888 | fetch exchange | #!/usr/bin/env python3
# The arrow library is used to handle datetimes consistently with other parsers
from datetime import datetime, timezone
from logging import Logger, getLogger
from typing import Any, Dict, List, Optional
# BeautifulSoup is used to parse HTML to get information
from bs4 import BeautifulSoup
from ... |
16,889 | get zetas | #!/usr/bin/env python
# Copyright 2019 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
16,890 | get attr value | #
# psuutil.py
# Platform-specific PSU status interface for SONiC
#
import logging
import os.path
try:
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError(str(e) + "- required module not found")
class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
HWMON_PATH =... |
16,891 | get stack | import linecache
import os
import sys
import tkinter as tk
from idlelib.debugobj import ObjectTreeItem, make_objecttreeitem
from idlelib.tree import TreeNode, TreeItem, ScrolledCanvas
def StackBrowser(root, flist=None, tb=None, top=None):
global sc, item, node # For testing.
if top is None:
top = tk... |
16,892 | average | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from datetime import datetime
from .core import BaseAction
from c7n.manager import resources
from c7n import utils
def METHOD_NAME(numbers):
return float(sum(numbers)) / max(len(numbers), 1)
def distinct_count(values):
return fl... |
16,893 | assert bitmap on | # Copyright iris-grib contributors
#
# This file is part of iris-grib and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Unit tests for :func:`iris_grib._save_rules.data_section`.
"""
# import iris_grib.tests first so that some thin... |
16,894 | process | # Copyright © 2022 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... |
16,895 | update | # Copyright The Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
16,896 | block number | import json
from collections import defaultdict
from dataclasses import dataclass
from threading import Lock, get_ident
from types import FunctionType, TracebackType
from typing import Any, Dict, List, Optional, Tuple, Union
from lazy_object_proxy import Proxy
from wrapt import ObjectProxy
from brownie._config import... |
16,897 | get reboot cause | #############################################################################
# Edgecore
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Chassis information which are available in the platform
#
#############################################################################
import sub... |
16,898 | test add traces | import sys
from unittest import TestCase
import plotly.graph_objs as go
from plotly.subplots import make_subplots
if sys.version_info >= (3, 3):
from unittest.mock import MagicMock
else:
from mock import MagicMock
class TestAddTracesMessage(TestCase):
def setUp(self):
# Construct initial scatter... |
16,899 | test echo and ansi | import unittest
from test import bootstrap
class TestKernel(unittest.TestCase):
def test_kernel_commands(self):
"""
Tests all commands with no arguments to test for crashes...
"""
kernel = bootstrap.bootstrap()
try:
for cmd, path, command in kernel.find("command... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.