id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
17,400 | integrand j | __author__ = "dgilman"
from scipy.integrate import quad
import numpy as np
from lenstronomy.LensModel.Profiles.sersic import Sersic
from lenstronomy.Util import param_util
from lenstronomy.LensModel.Profiles.base_profile import LensProfileBase
__all__ = ["SersicEllipseKappa"]
class SersicEllipseKappa(LensProfileBas... |
17,401 | from facets | #!/usr/bin/env python3
#
import numpy as np
import matplotlib.pyplot as plt
from fealpy.mesh import HalfEdgeDomain, HalfEdgeMesh
from scipy.spatial import Voronoi, voronoi_plot_2d
from scipy.spatial import KDTree
class HalfEdgeDomainTest:
def __init__(self):
pass
def subdomain_area_test(self):
... |
17,402 | update | """Provide CommentForest for submission comments."""
from __future__ import annotations
from heapq import heappop, heappush
from typing import TYPE_CHECKING
from ..exceptions import DuplicateReplaceException
from ..util import _deprecate_args
from .reddit.more import MoreComments
if TYPE_CHECKING: # pragma: no cove... |
17,403 | get locals | """Interface to the compiler's internal symbol tables"""
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE,
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
import weakref
__all__ = ["symtable", "SymbolTa... |
17,404 | test get issue label | from functools import cached_property
import responses
from django.test import RequestFactory
from django.urls import reverse
from sentry.testutils.cases import PluginTestCase
from sentry.utils import json
from sentry_plugins.gitlab.plugin import GitLabPlugin
class GitLabPluginTest(PluginTestCase):
@cached_prop... |
17,405 | set up | # 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... |
17,406 | set current frame | # The PEP 484 type hints stub file for the QtSvg module.
#
# Generated by SIP 6.4.0
#
# Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
#
# This file is part of PyQt5.
#
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Softwa... |
17,407 | store user address | from typing import TYPE_CHECKING
from django.conf import settings
from django.db.models import Exists, OuterRef
from ..checkout import AddressType
from ..permission.models import Permission
from .models import Group, User
if TYPE_CHECKING:
from ..plugins.manager import PluginsManager
from .models import Addr... |
17,408 | test n dimensional eotf inverse dcdm | """
Define the unit tests for the :mod:`colour.models.rgb.transfer_functions.dcdm`
module.
"""
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import eotf_inverse_DCDM, eotf_DCDM
from colour.utilities import domain_range_scale, ignore_numpy_errors
__author__ = "Colour Developers"
__copyr... |
17,409 | repr | """
Benkart-Kang-Kashiwara crystals for the general-linear Lie superalgebra
"""
#*****************************************************************************
# Copyright (C) 2017 Franco Saliola <saliola@gmail.com>
# 2017 Travis Scrimshaw <tcscrims at gmail.com>
# 2017 Ann... |
17,410 | 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 ... |
17,411 | test get dependencies task | import pickle
from collections import namedtuple
import pytest
from flash.core.serve.dag.task import (
flatten,
get,
get_dependencies,
get_deps,
istask,
literal,
preorder_traversal,
quote,
subs,
)
from flash.core.serve.dag.utils_test import add, inc
from flash.core.utilities.imports... |
17,412 | connect | from typing import Optional
from collections import OrderedDict
import pandas as pd
from pyhive import (hive, sqlalchemy_hive)
from sqlalchemy import create_engine
from mindsdb_sql import parse_sql
from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
from mindsdb_sql.parser.ast.base import ASTNode
from m... |
17,413 | test ipv4 query |
from stix_shifter.stix_translation import stix_translation
from stix_shifter_utils.utils.error_response import ErrorCode
from stix_shifter.stix_translation.stix_translation import MAPPING_ERROR
import unittest
options_file = open('stix_shifter_modules/guardium/tests/stix_translation/guardium_stix_to_qsearch/options.... |
17,414 | test sum centres of geometry | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#... |
17,415 | test fetch exchange | import unittest
from datetime import datetime
from json import loads
from pkg_resources import resource_string
from requests import Session
from requests_mock import ANY, Adapter
from electricitymap.contrib.lib.types import ZoneKey
from parsers import FR_O
class TestFR_O(unittest.TestCase):
def setUp(self):
... |
17,416 | test spec hierarchy from list | import pandas as pd
from statsforecast.utils import AirPassengersDF
from mindsdb.integrations.utilities.time_series_utils import (
transform_to_nixtla_df,
get_results_from_nixtla_df,
infer_frequency,
get_best_model_from_results_df,
spec_hierarchy_from_list,
get_hierarchy_from_df,
reconcile_f... |
17,417 | test delete stream | import boto3
import pytest
from moto import mock_kinesisvideo
from botocore.exceptions import ClientError
@mock_kinesisvideo
def test_create_stream():
client = boto3.client("kinesisvideo", region_name="ap-northeast-1")
stream_name = "my-stream"
device_name = "random-device"
# stream can be created
... |
17,418 | attributes | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
17,419 | get list display | from django.contrib.admin.sites import site
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.test import RequestFactory, TestCase
from ralph.lib.permissions.tests._base import PermissionsTestMixin
from ralph.lib.permissions.tests.models import Art... |
17,420 | launch bcm sim framework | #!/usr/bin/env python
import getopt
import logging
import os
import shutil
import subprocess
import sys
import time
BCM_BASE_DIR = "/home/bcmsim/"
BCM_CXM_PORT = 55555
SCID = 10
SOC_TARGET_PORT = 22222
SOC_BOOT_FLAGS = 0x420000
LOCALHOST = "127.0.0.1"
SIM_SRC_DIR = "/usr/local/fboss/brcmsim/simulator/%s/"
BCMSIM_USER... |
17,421 | test set subst | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import unittest
from shutil import rmtree
from tempfile import mkdtemp
import buildconfig
import mozpack.path... |
17,422 | from fn | from __future__ import annotations
import sys
import typing
from copy import deepcopy
from dataclasses import dataclass, replace
from inspect import Signature, getmembers, isclass, ismethod
from itertools import chain
from typing import Any
from typing_extensions import Self, get_type_hints
from litestar import conn... |
17,423 | compute loss csrmatrix | # Copyright (c) Recommenders contributors.
# Licensed under the MIT License.
"""
Module maintaining the IMC problem.
"""
import numpy as np
from scipy.sparse import csr_matrix
from numba import njit, prange
from pymanopt import Problem
from pymanopt.manifolds import Stiefel, Product, SymmetricPositiveDefinite
from p... |
17,424 | test span multiple years contains birthday | import doctest
from datetime import datetime
from django.test import TestCase, override_settings
from django.utils import timezone
from members import models
from members.models import Member, Profile
def load_tests(loader, tests, ignore):
"""Load doctests."""
tests.addTests(doctest.DocTestSuite(models))
... |
17,425 | code operator modulo | from talon import Context, Module, actions, settings
ctx = Context()
mod = Module()
ctx.matches = r"""
tag: user.scala
"""
# Scala Common Types
scala_common_types = {
"boolean": "Boolean",
"int": "Int",
"float": "Float",
"byte": "Byte",
"double": "Double",
"short": "Short",
"long": "Long",... |
17,426 | setup network | #!/usr/bin/env python3
# Copyright (c) 2017-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test logic for setting nMinimumChainWork on command line.
Nodes don't consider themselves out of "init... |
17,427 | version | """
Code used to get and cache the requested course-data
"""
from lms.djangoapps.course_blocks.api import get_course_blocks
from openedx.core.djangoapps.content.block_structure.api import get_block_structure_manager
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order... |
17,428 | screenshot manager | # Copyright (c) 2021 elParaguayo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... |
17,429 | test cannot assign to relationship attributes | import datetime as dt
import pytest
import pytz
import stix2
from .constants import (
FAKE_TIME, INDICATOR_ID, MALWARE_ID, RELATIONSHIP_ID, RELATIONSHIP_KWARGS,
)
EXPECTED_RELATIONSHIP = """{
"type": "relationship",
"spec_version": "2.1",
"id": "relationship--df7c87eb-75d2-4948-af81-9d49d246f301",
... |
17,430 | main | # Copyright (c) 2019 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 applic... |
17,431 | test spearman corrcoef differentiability | # 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... |
17,432 | test phase active project draft | import pytest
import rules
from adhocracy4.projects.enums import Access
from adhocracy4.test.helpers import freeze_phase
from adhocracy4.test.helpers import freeze_post_phase
from adhocracy4.test.helpers import freeze_pre_phase
from adhocracy4.test.helpers import setup_phase
from adhocracy4.test.helpers import setup_u... |
17,433 | leave call | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2023 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 requi... |
17,434 | node rank | # 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... |
17,435 | find wall pts | from typing import Dict, Generic, List, Optional, Tuple, Type, TypeVar
import numpy as np
import stp
import stp.global_parameters as global_parameters
import stp.rc as rc
import stp.skill as skill
from rj_msgs.msg import RobotIntent
# TODO: replace w/ global param server
from stp.utils.constants import BallConstants,... |
17,436 | iati language | # -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from django.core.exceptions import Va... |
17,437 | find unreferenced groups | # Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 a... |
17,438 | page ops | """
Benchmark the speed of pypdf.
The results are on https://py-pdf.github.io/pypdf/dev/bench/
Please keep in mind that the variance is high.
"""
from io import BytesIO
from pathlib import Path
import pytest
import pypdf
from pypdf import PdfReader, PdfWriter, Transformation
from pypdf._page import PageObject
from p... |
17,439 | get measurement | # coding=utf-8
import copy
from flask_babel import lazy_gettext
from mycodo.inputs.base_input import AbstractInput
from mycodo.utils.atlas_calibration import setup_atlas_device
from mycodo.utils.system_pi import str_is_float
# Measurements
measurements_dict = {
0: {
'measurement': 'temperature',
... |
17,440 | preprocess data mbart | import logging
import os
import pickle
from multiprocessing.dummy import Pool
import torch
from torch.utils.data import Dataset
from tqdm.auto import tqdm
from transformers.models.bart.modeling_bart import shift_tokens_right
logger = logging.getLogger(__name__)
def preprocess_data(data):
input_text, target_text... |
17,441 | format warning restore | import logging
import platform
import sys
import warnings
from pathlib import Path
from typing import Any
from typing import Iterator
import click
from click_default_group import DefaultGroup
from xsdata import __version__
from xsdata.codegen.transformer import SchemaTransformer
from xsdata.logger import logger
from ... |
17,442 | make blob sas url | """
Common utilities to interact with Azure Storage.
"""
import datetime
import os.path
import re
import itertools
from django.conf import settings
from django.core.files.storage import Storage
from django.core.exceptions import ImproperlyConfigured
from io import RawIOBase
# keep consistent path separators
pathjoin... |
17,443 | test conf key | from functools import cached_property
from urllib.parse import parse_qs
import pytest
import responses
from sentry.integrations.slack.message_builder import LEVEL_TO_COLOR
from sentry.models import Rule
from sentry.plugins.base import Notification
from sentry.shared_integrations.exceptions import ApiError
from sentry... |
17,444 | 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 . im... |
17,445 | get dofs | import numpy as np
import simsoptpp as sopp
from .surface import Surface
from .surfacerzfourier import SurfaceRZFourier
__all__ = ['SurfaceXYZFourier']
class SurfaceXYZFourier(sopp.SurfaceXYZFourier, Surface):
r"""`SurfaceXYZFourier` is a surface that is represented in Cartesian
coordinates using the follow... |
17,446 | adaptor registry | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 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
#
# Unl... |
17,447 | set up | # Copyright 2018 The Forseti Security 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 ap... |
17,448 | get user data content | # This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2023 Drakkar-Software, All rights reserved.
#
# OctoBot 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
... |
17,449 | fill implicit positionals | from _typeshed import Incomplete
from collections.abc import Callable, Iterable
from typing import Any, Generic, TypeVar, overload
from typing_extensions import ParamSpec, Self
from .config import Config
from .context import Context
from .parser import Argument
_P = ParamSpec("_P")
_R_co = TypeVar("_R_co", covariant=... |
17,450 | load settings | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014 GNS3 Technologies Inc.
#
# 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.
... |
17,451 | fixed pooling monotonic attention | from functools import partial
import torch
from torch import Tensor
import math
import torch.nn.functional as F
from . import register_monotonic_attention
from .monotonic_multihead_attention import (
MonotonicAttention,
MonotonicInfiniteLookbackAttention,
WaitKAttention
)
from typing import Dict, Optional... |
17,452 | solve | import haversine
import requests
from ortools.linear_solver import pywraplp
from django.conf import settings
from .mapbox_optimize import validate_routing_request
class ORToolsRadialDistanceSolver:
"""
Solves user-case location assignment based on radial distance
"""
def __init__(self, request_jso... |
17,453 | parse elements | from builtins import int, range
from pyinfrabox import ValidationError
from pyinfrabox.utils import check_allowed_properties, check_required_properties, check_number, check_color, check_text
def check_version(v, path):
if not isinstance(v, int):
raise ValidationError(path, "must be an int")
if v != 1... |
17,454 | 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 . im... |
17,455 | test vattr on cos definition | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2019 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
import logging
import time
import pytest, os, ldap
from lib389.cos import CosClassicDefinition, CosClassicDefinitions, C... |
17,456 | test runepanet step | import unittest
from os.path import abspath, dirname, join, exists
import wntr.epanet.toolkit
testdir = dirname(abspath(__file__))
datadir = join(testdir, "..", "..", "examples", "networks")
class TestEpanetToolkit(unittest.TestCase):
def test_isOpen(self):
for version in [2.0, 2.2,]:
e... |
17,457 | is url | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
17,458 | extract hard alignment | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license which can be found at
# https://github.com/facebookresearch/fairseq/blob/main/LICENSE
import collections
from collections import abc
from itertools import accumulate
import torch
import torch.nn.functional as F
... |
17,459 | get | from typing import List, Iterable
from requests import Response
import json
from TM1py.Exceptions.Exceptions import TM1pyRestException
from TM1py.Services.ObjectService import ObjectService
from TM1py.Services.RestService import RestService
from TM1py.Utils import format_url
from TM1py.Objects.Sandbox import Sandbox
... |
17,460 | load from json | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import bpy
from bpy.props import... |
17,461 | run node | import gc
import traceback
import torch
from torch.fx.node import Node, map_aggregate
from atorch.utils.meta_model_utils import move_args_kwargs_to_device, reload_meta_module
from atorch.utils.sharding_spec import _extract_sharding_spec
from atorch.utils.version import torch_version
class SpecProp(torch.fx.Interpre... |
17,462 | name | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
17,463 | update | # -*- coding: utf-8 -*-
#
# privacyIDEA is a fork of LinOTP
# 2014-12-05 Cornelius Kölbel <cornelius@privacyidea.org>
# Migration to flask
#
# May 08, 2014 Cornelius Kölbel
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# Copyright (C) 2010 - 2014 LSE Leading Security Experts GmbH
# Lice... |
17,464 | test local builder set manager port sets | from unittest.mock import MagicMock, call, patch
import pytest
import kaskada.api.session
import kaskada.client
endpoint = "some_endpoint"
is_secure = True
@pytest.fixture(autouse=True)
def run_around_tests():
kaskada.client.reset()
yield
@patch("kaskada.client.ClientFactory")
@patch("kaskada.client.Clie... |
17,465 | test wrap true | from collections import OrderedDict
from operator import itemgetter
import numpy as np
import pytest
import mbuild as mb
from mbuild.lattice import load_cif
from mbuild.tests.base_test import BaseTest
from mbuild.utils.io import get_fn, has_garnett, has_pycifrw
class TestCif(BaseTest):
"""
Unit tests for CI... |
17,466 | sideboard | from typing import Any, Dict, List, Optional
import inflect
import titlecase
from flask import session, url_for
from decksite import prepare
from decksite.view import View
from magic import card, oracle
from magic.models import Deck as DeckModel
from shared import fetch_tools
from shared.container import Container
... |
17,467 | get error message | from Components.Task import PythonTask, Task, Job, job_manager as JobManager, Condition
from Tools.Directories import fileExists
from enigma import eTimer
from os import path
from shutil import rmtree, copy2, move
class DeleteFolderTask(PythonTask):
def openFiles(self, fileList):
self.fileList = fileList
def wor... |
17,468 | tx to bytes | # Copyright 2021 Hathor Labs
#
# 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, s... |
17,469 | parse authors | # -*- coding: utf-8 -*-
import logging
import re
import js2py
from typing import Generator, Union
from bs4 import BeautifulSoup, Tag
from lncrawl.models import Chapter, SearchResult, Volume
from lncrawl.templates.browser.searchable import SearchableBrowserTemplate
from lncrawl.core.exeptions import FallbackToBrowser
... |
17,470 | call api | from abc import ABC, abstractmethod
import requests
from os import path
from app.plugins import logger
VALID_IMAGE_EXTENSIONS = ['.tiff', '.tif', '.png', '.jpeg', '.jpg']
class CloudPlatform(ABC):
"""A Cloud Platform is an online platform that can store files. For example Piwigo, Dropbox, Google Drive.
Pla... |
17,471 | mean | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
17,472 | recent activity | # 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... |
17,473 | pre 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
# --------------------------------... |
17,474 | test encoder invalid merge method | import pytest
import torch
from espnet2.asr.encoder.branchformer_encoder import BranchformerEncoder
@pytest.mark.parametrize(
"input_layer",
["linear", "conv2d", "conv2d1", "conv2d2", "conv2d6", "conv2d8", "embed"],
)
@pytest.mark.parametrize("use_linear_after_conv", [True, False])
@pytest.mark.parametrize(
... |
17,475 | test one compliant instance | from re import search
from unittest import mock
GCP_PROJECT_ID = "123456789012"
class Test_compute_instance_confidential_computing_enabled:
def test_compute_no_instances(self):
compute_client = mock.MagicMock
compute_client.project_ids = [GCP_PROJECT_ID]
compute_client.instances = []
... |
17,476 | get data | # Copyright (c) 2021 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... |
17,477 | get dpp resource guard proxy | # 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... |
17,478 | search date | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Date
"""
from dateutil import parser
from rebulk.remodule import re
_dsep = r'[-/ \.]'
_dsep_bis = r'[-/ \.x]'
date_regexps = [
# pylint:disable=consider-using-f-string
re.compile(r'%s((\d{8}))%s' % (_dsep, _dsep), re.IGNORECASE),
# pylint:disable=conside... |
17,479 | configure index | from unittest import mock
import pytest
from h.indexer.reindexer import reindex
@pytest.mark.usefixtures(
"BatchIndexer",
"configure_index",
"delete_index",
"nipsa_service",
"get_aliased_index",
"update_aliased_index",
"settings_service",
)
class TestReindex:
def test_sets_op_type_to... |
17,480 | test millisecond epoch time | # /*##########################################################################
# Copyright (C) 2016-2021 European Synchrotron Radiation Facility
#
# 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 Softw... |
17,481 | get penalty at time | # ___________________________________________________________________________
#
# Pyomo: Python Optimization Modeling Objects
# Copyright (c) 2008-2022
# National Technology and Engineering Solutions of Sandia, LLC
# Under the terms of Contract DE-NA0003525 with National Technology and
# Engineering Solutions of ... |
17,482 | run | import logging
import re
import os
import subprocess
import time
from avocado import skipUnless
from avocado_qemu import LinuxTest, BUILD_DIR
from avocado_qemu import has_cmds
from avocado_qemu import run_cmd
from avocado_qemu import wait_for_console_pattern
from avocado.utils import ssh
class VirtiofsSubmountsTest(... |
17,483 | serve on port | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Multithreaded simple HTTP directory server.
#
# The files can optionally be aes-256-cbc encrypted in a way that's compatible with:
# openssl enc -aes-256-cbc -d -in encrypted.data -out decrypted.data
import argparse
import hashlib
import os
import sys
from threading ... |
17,484 | tags | # 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... |
17,485 | any new from double on client | #-------------------------------------------------------------------------------
# Any
#-------------------------------------------------------------------------------
class AnyAbstractAPI:
@staticmethod
def init_any_environment(object):
pass
@staticmethod
def finish_any_environment(object):
pass
@staticmet... |
17,486 | test simple | import os
import networkx
import angr
import angr.analyses.decompiler
from angr.analyses.decompiler.structuring import DreamStructurer
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "binaries", "tests")
class DummyNode:
def __init__(self, n):
self.n = n
def _... |
17,487 | set array | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.structure.io.mmtf"
__author__ = "Patrick Kunzmann"
__all__ = ["MMTFFile"]
import io
from collections.abc import MutableMapping
import struct
im... |
17,488 | test no config returns default values | from fontTools.misc.configTools import AbstractConfig, Options
import pytest
from fontTools.config import (
OPTIONS,
Config,
ConfigUnknownOptionError,
ConfigValueParsingError,
ConfigValueValidationError,
)
from fontTools.ttLib import TTFont
def test_can_register_option():
MY_OPTION = Config.re... |
17,489 | get state | # Nitrogen refilling automation by JB@KIT 11/2015 jochen.braumueller@kit.edu
# model: XXX + custom controller box to monitor/switch off nitrogen refilling (R. Jehle)
# this file is named 'NitrogenControl.py' and runs on the raspberry in the controller box
# functionality: logging of switching events to 'nitrogen.log',... |
17,490 | round trip cell metadata | import re
from time import sleep
import nbformat
import pytest
from nbformat.v4.nbbase import (
new_code_cell,
new_markdown_cell,
new_notebook,
new_raw_cell,
)
import jupytext
from jupytext.cli import jupytext as jupytext_cli
from jupytext.compare import compare, compare_cells, compare_notebooks
def... |
17,491 | get service | # 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... |
17,492 | ensure directories | import contextlib
from pathlib import Path
from django.db.models.query import prefetch_related_objects
from django.http import Http404
from django.utils import translation
from django.utils.translation import gettext as _
from rest_framework import status
from rest_framework.fields import empty
from rest_framework.gen... |
17,493 | requirements | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save
from conan.tools.microsoft import is_msvc, is_msvc_static_ru... |
17,494 | univariate euclidean distance | # -*- coding: utf-8 -*-
__author__ = ["chrisholder", "tonybagnall"]
import numpy as np
from numba import njit
from aeon.distances._squared import _univariate_squared_distance, squared_distance
from aeon.distances._utils import reshape_pairwise_to_multiple
@njit(cache=True, fastmath=True)
def euclidean_distance(x: n... |
17,495 | get variable | # -*- coding: utf-8 -*-
#
# ast_for_stmt.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, o... |
17,496 | test 1 list | import os
import logging
import pprint
from sonic_cli_gen.yang_parser import YangParser
from .cli_autogen_input.yang_parser_test import assert_dictionaries
from .cli_autogen_input.cli_autogen_common import move_yang_models, remove_yang_models
logger = logging.getLogger(__name__)
test_path = os.path.dirname(os.path.a... |
17,497 | get num fans | # Sample pddf_fanutil file
# All the supported FAN SysFS aattributes are
#- fan<idx>_present
#- fan<idx>_direction
#- fan<idx>_input
#- fan<idx>_pwm
#- fan<idx>_fault
# where idx is in the range [1-12]
#
import os.path
import sys
import ast
sys.path.append('/usr/share/sonic/platform/plugins')
import pddfparse
import ... |
17,498 | print broken leases | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
import argparse
import sanlock
from vdsm import client
from vdsm import utils
from vdsm... |
17,499 | add pylang | #!/usr/bin/env python
# encoding: utf-8
# Federico Pellegrin, 2016-2018 (fedepell) adapted for Python
"""
This tool helps with finding Python Qt5 tools and libraries,
and provides translation from QT5 files to Python code.
The following snippet illustrates the tool usage::
def options(opt):
opt.load('py pyqt5')
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.