id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
8,600 | print style | #
# @file printRenderInformation.py
# @brief prints an overview of the render information in the given SBML file
# @author Frank Bergmann
#
# This file is part of libSBML. Please visit http:#sbml.org for more
# information about SBML, and the latest version of libSBML.
#
import sys
import os.path
import libsb... |
8,601 | test parallel filter channel | import unittest
import numpy
import fastfilters
class TestCarvingTools(unittest.TestCase):
def test_parallel_watershed_3d(self):
from ilastik.workflows.carving.carvingTools import parallel_watershed
shape = (200,) * 3
x = numpy.random.rand(*shape).astype("float32")
seg, max_id = ... |
8,602 | finalize options | """distutils.command.build_scripts
Implements the Distutils 'build_scripts' command."""
import os, re
from stat import ST_MODE
from distutils import sysconfig
from distutils.core import Command
from distutils.dep_util import newer
from distutils.util import convert_path, Mixin2to3
from distutils import log
import tok... |
8,603 | get user group | from typing import Any
from aiohttp import web
from aiopg.sa.result import RowProxy
from models_library.users import GroupID, UserID
from ..db.plugin import get_database_engine
from ..users.api import get_user
from . import _db
from ._utils import AccessRightsDict
from .exceptions import GroupsError
async def list_... |
8,604 | test pep8 lines between cells | import pytest
from nbformat.v4.nbbase import new_code_cell, new_notebook
from jupytext import read, reads, writes
from jupytext.compare import compare
from jupytext.pep8 import (
cell_ends_with_code,
cell_ends_with_function_or_class,
cell_has_code,
next_instruction_is_function_or_class,
pep8_lines_... |
8,605 | runcall | #! /usr/bin/env python3
"""Python interface for the 'lsprof' profiler.
Compatible with the 'profile' module.
"""
__all__ = ["run", "runctx", "Profile"]
import _lsprof
import profile as _pyprofile
# ____________________________________________________________
# Simple interface
def run(statement, filename=None, ... |
8,606 | identify problems | import json
from django.core.management.base import BaseCommand
from questionnaires.models import Survey, SurveyFormField
from wagtail.core.models import PageRevision
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
"--fix",
action="store_true",
... |
8,607 | test posterior finite space model | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
from contextlib import ExitStack
import pytest
import torch
import pyro
import pyro.distributions as dist
import pyro.optim as optim
from pyro.contrib.oed.eig import (
donsker_varadhan_eig,
lfire_eig,
marginal_eig,
... |
8,608 | f | r"""Functions for lepton flavour violating $\tau\to \ell_1\ell_2\ell_3$ decays."""
import flavio
from math import pi, log, sqrt
# names of LFV sectors in WCxf
wcxf_sector_names = {('tau', 'mu'): 'mutau',
('tau', 'e'): 'taue',
('mu', 'e'): 'mue',
('tau', ... |
8,609 | get jar id | # Copyright (C) 2016 Red Hat, Inc., Michal Srb <michal@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General ... |
8,610 | clear play time | #!/usr/bin/env python3
# Script for erasing all data about a user from the database.
# Intended for GDPR erasure requests.
#
# NOTE: We recommend implementing a "GDPR Erasure Ban" on the user's last IP/HWID before erasing their data, to prevent abuse.
# This is acceptable under the GDPR as a "legitimate interest" to p... |
8,611 | test | #!/usr/bin/env python3
#
# Copyright (c) 2022, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
8,612 | block height | #!/usr/bin/env python3
# Copyright (c) 2022 RBB S.r.l
# Copyright (c) 2017-2021 The Bitcoin Core developers
# opensource@mintlayer.org
# SPDX-License-Identifier: MIT
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
8,613 | colorformat | """
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.token import Token, STANDARD_TYPES
# Default mapping of ansixxx to RGB colors.
_ansimap = {
# dark
'ansiblack... |
8,614 | dwconv2d schedule | # 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... |
8,615 | global batch size | # 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... |
8,616 | is transition defined | """State module: contains State class"""
from __future__ import annotations
__all__ = ['State']
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.showbase.DirectObject import DirectObject
class State(DirectObject):
notify = directNotify.newCategory("State")
# this 'constant' can ... |
8,617 | build json object | import inspect
from pathlib import Path
import pytest
import sqlalchemy as sa
from prefect.server.database import dependencies
from prefect.server.database.configurations import (
AioSqliteConfiguration,
AsyncPostgresConfiguration,
BaseDatabaseConfiguration,
)
from prefect.server.database.dependencies imp... |
8,618 | init w | #!/usr/bin/python
#
# Copyright (C) Christian Thurau, 2010.
# Licensed under the GNU General Public License (GPL).
# http://www.gnu.org/licenses/gpl.txt
"""
PyMF Convex Hull Non-negative Matrix Factorization [1]
CHNMF(NMF) : Class for Convex-hull NMF
quickhull : Function for finding the convex hull in 2D
[1] ... |
8,619 | logout | import logging
from smtplib import SMTPException
from django.contrib import messages
from django.contrib.auth import authenticate
from django.contrib.auth import login as loginMethod
from django.contrib.auth import METHOD_NAME as logoutMethod
from django.contrib.auth.decorators import login_required
from django.contri... |
8,620 | test adaptive avgpool3d functional | """
Copyright 2020 The OneFlow 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 applicable law or agr... |
8,621 | test cps pe | # 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... |
8,622 | load custom zodb | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
8,623 | request | #
# This file is part of LiteX-Boards.
#
# Copyright (c) 2019 Arnaud Durand <arnaud.durand@unifr.ch>
# Copyright (c) 2022 Martin Hubacek @hubmartin (Twitter)
# SPDX-License-Identifier: BSD-2-Clause
from litex.build.generic_platform import *
from litex.build.lattice import LatticeECP5Platform
from litex.build.lattice.p... |
8,624 | init ool | import sys
import numpy as np
import numba.core.typing.cffi_utils as cffi_support
from numba.tests.support import import_dynamic, temp_directory
from numba.core.types import complex128
def load_inline_module():
"""
Create an inline module, return the corresponding ffi and dll objects.
"""
from cffi ... |
8,625 | get group by id | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from ..uac import GroupV2_pb2 as uac_dot_GroupV2__pb2
class GroupServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A gr... |
8,626 | find node from type and apply action |
#
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
8,627 | attach html | from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from time import monotonic
import boto3
import botocore
from flask import current_app
from notifications_utils.recipients import InvalidEmailError
from notifications_utils.statsd_decor... |
8,628 | m1 domain fn test | from functools import partial
import numpy as np
import pytest
from scvi.data import synthetic_iid
from scvi.model import SCVI
from scvi.model.base._differential import (
DifferentialComputation,
estimate_delta,
estimate_pseudocounts_offset,
)
from scvi.model.base._utils import _prepare_obs
def test_fea... |
8,629 | get handler | import ipaddress
import logging
from datetime import timezone
from dateutil.parser import parse as parse_date
from django.db import IntegrityError, router, transaction
from django.http import Http404, HttpResponse
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt... |
8,630 | test clim slider step size and precision | import os
from unittest.mock import patch
import numpy as np
import pytest
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QPushButton
from napari._qt.layer_controls.qt_image_controls_base import (
QContrastLimitsPopup,
QRangeSliderPopup,
QtBaseImageControls,
QtLayerControls,
range_to_decima... |
8,631 | test trimcoef ndim | import unittest
import numpy
import pytest
import cupy
from cupy import testing
@testing.parameterize(*testing.product({
'trim': [True, False]
}))
class TestAsSeries(unittest.TestCase):
@testing.for_all_dtypes(no_bool=True)
@testing.numpy_cupy_array_equal()
def test_as_series(self, xp, dtype):
... |
8,632 | connect | import sys
import datetime
import asyncio
import traceback
from aiohttp_json_rpc import JsonRpcClient
class WorkerClient(JsonRpcClient):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_methods(
("", self.start_job),
)
self.current_job =... |
8,633 | set up | #!/usr/bin/env python3
# group: rw quick
#
# Test cases for the block-status cache.
#
# Copyright (C) 2022 Red Hat, 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 2 of the... |
8,634 | get fields items | import json
from urllib.parse import urljoin
from django.conf import settings
from django.core.cache import cache
from django.forms import model_to_dict
from django.shortcuts import reverse
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from common.db.encode... |
8,635 | test from environ | #!/usr/bin/python
# Copyright (C) 2014 Canonical Ltd.
#
# 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.... |
8,636 | show sls | r"""
Module to manage Windows software repo on a Standalone Minion
``file_client: local`` must be set in the minion config file.
For documentation on Salt's Windows Repo feature, see :ref:`here
<windows-package-manager>`.
"""
import logging
import os
import salt.loader
import salt.output
import salt.template
import ... |
8,637 | create random schema | from index_utils import *
from random import randint, random, choice
from xmlrpc.client import MAXINT, MININT
import string
def random_string():
size = randint(0, 100)
return ''.join(choice(string.ascii_uppercase + string.ascii_lowercase + string.whitespace + string.digits) for _ in range(size))
def random_... |
8,638 | test hier | from tally import tally
from satplacer.placer import Tech, Raster, CellLeaf, Rect, CellHier, CellInstance
def test_build_raster():
s = tally.Tally()
raster = Raster( s, 'xy', 4, 10)
s.solve()
assert s.state == 'SAT'
def test_flat_hier():
l = CellLeaf( "ndev")
l.addTerminal( "sd0", Rect(0,0,0... |
8,639 | create reindex job | # Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... |
8,640 | test dump load cycle | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
# Ansible 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.
#
# Ansible is distr... |
8,641 | api key callback | # Copyright 2021-present, the Recognai S.L. 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 la... |
8,642 | engine | import os
import shutil
import tempfile
from typing import List
import pytest
from alembic.command import upgrade as alembic_upgrade
from fastapi.testclient import TestClient
import quetz
from quetz.cli import _alembic_config
from quetz.config import Config
from quetz.dao import Dao
from quetz.database import get_eng... |
8,643 | show images | """
=======================================================
Diffeomorphic Registration with binary and fuzzy images
=======================================================
This example demonstrates registration of a binary and a fuzzy image.
This could be seen as aligning a fuzzy (sensed) image to a binary
(e.g., temp... |
8,644 | test no schema provided | import csv
import json
from pathlib import Path
import pytest
from click.testing import CliRunner
from linkml.validator.cli import cli
VALID_PERSON_1 = {"id": "id:1", "full_name": "John Doe", "age": 35}
VALID_PERSON_2 = {"id": "id:2", "full_name": "Jane Smith", "age": 25, "phone": "555-555-5550"}
PERSONINFO_SCHEMA =... |
8,645 | deret | # Ref: MIPS® Architecture for Programmers Volume II-A: The MIPS32® Instruction Set Manual
# Document Number: MD00086 Revision 6.05
# Accession: G00021
__all__ = [
# R-format
"SLL", "SRL", "SRA", "JR", "JALR", "MFHI", "MTHI", "MFLO", "MTLO", "DIV", "DIVU", "MULT",
"MULTU", "ADD", "ADDU", "SUB", "SUBU", "AND... |
8,646 | connect | from __future__ import absolute_import
from __future__ import division
import socket
import socks
from pwnlib.log import getLogger
from pwnlib.timeout import Timeout
from pwnlib.tubes.sock import sock
log = getLogger(__name__)
class remote(sock):
r"""Creates a TCP or UDP-connection to a remote host. It supports... |
8,647 | configure eth if | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import contextlib
import logging
import os
import socket
import sys
from typing import Iterator
import pytest
from pytest_embedded import Dut
from scapy.all import Ether, raw
ETH_TYPE_1 = 0x2220
ETH_TYPE_2 = 0x2221
... |
8,648 | test killall iterable argument timeout not started | from __future__ import print_function, division, absolute_import
import time
import gevent.testing as greentest
from gevent.testing import timing
import gevent
from gevent import pool
from gevent.timeout import Timeout
DELAY = timing.LARGE_TICK
class SpecialError(Exception):
pass
class Undead(object):
de... |
8,649 | send | import io
import socket
import ssl
from ..exceptions import ProxySchemeUnsupported
from ..packages import six
SSL_BLOCKSIZE = 16384
class SSLTransport:
"""
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to cha... |
8,650 | version | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import os
import benchexec.tools.template
import benchexec.result as result
from benchexec... |
8,651 | on change bitrate clicked | #!/usr/bin/python3
import sys
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst
from gi.repository import GLib
from gi.repository import Gtk
def bus_callback(bus, message, not_used):
t = message.type
if t == Gst.MessageType.EOS:
sys.stdout.write("End-of-stream\n")
Gtk.main_quit()
... |
8,652 | get filter | import re
from functools import lru_cache
from django import template
from django.core.exceptions import ImproperlyConfigured
from django.urls import NoReverseMatch
from wagtail.images.models import Filter
from wagtail.images.shortcuts import get_rendition_or_not_found
from wagtail.images.utils import to_svg_safe_spe... |
8,653 | test expansion strategy | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... |
8,654 | typemap dict | """Utilities for atomtyping a gmso topology with foyer."""
from collections import namedtuple
from foyer.atomtyper import AtomTypingRulesProvider, find_atomtypes
from foyer.exceptions import FoyerError
from foyer.topology_graph import TopologyGraph
from gmso.core.atom import Atom
from gmso.parameterization.molecule_u... |
8,655 | preferred macs | from collections.abc import Callable, Iterable, Mapping, Sequence
from logging import Logger
from socket import socket
from threading import Condition, Event, Lock, Thread
from types import ModuleType
from typing import Any, Protocol
from typing_extensions import TypeAlias
from paramiko.auth_handler import AuthHandler... |
8,656 | process gnu time | import pandas as pd
import argparse
import re
import os
from sys import argv
DEFAULT_LOG_FOLDER = "tmp_log/"
class LogParser:
"""
A class used to parse the pa.sh log files
All parse_* methods return a dataframe of only the files parsed in this call.
Use get_df for all parsed files across multible ca... |
8,657 | send message | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
In addition to the remote_call mechanism implemented in CommBase:
- Implements _wait_reply, so blocking calls can be made.
"""
import asyncio
import sys
import ... |
8,658 | test begin move end touch | """
Copyright(C) 2023 Altom Consulting
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... |
8,659 | predict | #!/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... |
8,660 | list workspace connection secrets | # 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... |
8,661 | extract data | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... |
8,662 | clean meid | """
Clean and validate a DataFrame column containing
Mobile Equipment Identifiers (MEIDs).
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches, unused-argument, E1101, E1133
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import panda... |
8,663 | test format exception only bad str | """Test cases for traceback module"""
from __future__ import with_statement
import unittest
from test.test_support import run_unittest, is_jython
import traceback
class TracebackCases(unittest.TestCase):
# For now, a very minimal set of tests. I want to be sure that
# formatting of SyntaxErrors works based ... |
8,664 | create storage | #
# IsardVDI - Open Source KVM Virtual Desktops based on KVM Linux and dockers
# Copyright (C) 2022 Simó Albert i Beltran
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, eithe... |
8,665 | key right | from Components.ActionMap import ActionMap
from Components.config import config, ConfigSubsection, ConfigSelection, getConfigListEntry
from Components.ConfigList import ConfigListScreen
from Components.Sources.Progress import Progress
from Components.Sources.StaticText import StaticText
from Components.SystemInfo impor... |
8,666 | test confirm action | # -*- coding: utf-8 -*-
"""
tests._test_mscolab.test_mscolab
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests for mscolab functionalities
This file is part of MSS.
:copyright: Copyright 2019 Shivashis Padhi
:copyright: Copyright 2019-2023 by the MSS team, see AUTHORS.
:license: APACHE-2.0, see LIC... |
8,667 | test list tables empty w timeout | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
8,668 | forward | import inspect
from typing import Any, Dict, Optional
import torch
import torch.nn.functional as F
from torch import Tensor
from torch.nn import Dropout, Linear, Sequential
from torch_geometric.nn.attention import PerformerAttention
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.nn.inits impo... |
8,669 | show left image | import json
import cv2
import base64
import threading
import time
from datetime import datetime
from websocket_server import WebsocketServer
import logging
# Graphical User Interface Class
class GUI:
# Initialization function
# The actual initialization
def __init__(self, host):
t = threading.Thre... |
8,670 | test description formatting | import falcon
import pytest
import os
import json
def test_update(client, new_dataset):
key = 'Name'
value = 'Guthrum'
body = json.dumps({
'description_fields': {
key: value
}
})
ds_id = os.path.basename(new_dataset.path)
update_response = client.simulate_post(
... |
8,671 | test contains not found | import unittest
from websockets.datastructures import *
class MultipleValuesErrorTests(unittest.TestCase):
def test_multiple_values_error_str(self):
self.assertEqual(str(MultipleValuesError("Connection")), "'Connection'")
self.assertEqual(str(MultipleValuesError()), "")
class HeadersTests(unitt... |
8,672 | get |
class CircularBuffer:
"""
Fixed capacity circular buffer that can be used as
a queue, stack or array
"""
def __init__(self, capacity:int, defaultValue=None) -> None:
if capacity <= 0:
raise ValueError("capacity must be greater than zero")
self.defaultValue = defaultValue... |
8,673 | test no holidays | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
8,674 | reorder incremental state | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import lightconv_cuda
import torch
import torch.nn.functional as F
from fairseq import utils
from fairseq.incremental_decoding_utils import wi... |
8,675 | body | from typing import Any, Dict, Optional, overload
from aws_lambda_powertools.shared.headers_serializer import (
BaseHeadersSerializer,
HttpApiHeadersSerializer,
)
from aws_lambda_powertools.utilities.data_classes.common import BaseProxyEvent
from aws_lambda_powertools.utilities.data_classes.shared_functions imp... |
8,676 | set needinfo | # 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 collections
from libmozdata.bugzilla import Bugzilla
from bugbot import logger, utils
from bugbot.bzcleaner imp... |
8,677 | row policy not found in disk | ## Syntax
# Errors: not found
not_found = "Exception: There is no {type} `{name}`"
def user_not_found_in_disk(name):
return (192,not_found.format(type="user",name=name))
def role_not_found_in_disk(name):
return (255,not_found.format(type="role",name=name))
def settings_profile_not_found_in_disk(name):
... |
8,678 | remove redundant space | import io
import json
import os
import re
import string
from typing import Dict
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import tqdm
from zhon import hanzi
def _make_w_io_base(f, mode: str):
if not isinstance(f, io.IOBase):
f_dirname = os.path.dirname(f)
if f_dirn... |
8,679 | get ds info | # piker: trading gear for hackers
# Copyright (C) Tyler Goodlet (in stewardship for pikers)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... |
8,680 | get changed files | # Copyright 2018 The Cirq Developers
#
# 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 ... |
8,681 | postrefine by frame mproc | # LIBTBX_SET_DISPATCHER_NAME cxi.postrefine
from __future__ import absolute_import, division, print_function
import os, sys
from libtbx.easy_mp import pool_map
import numpy as np
from cctbx.array_family import flex
from datetime import datetime, time
import logging
from six.moves import range
FORMAT = '%(levelname)s %... |
8,682 | test many sub polyslabs | import numpy as np
import gdstk
import tidy3d as td
from tidy3d.plugins.polyslab import ComplexPolySlab
from ..utils import assert_log_level, log_capture
def test_divide_simple_events():
"""PolySlab division for simple neighbor vertex-vertex type edge events."""
# simple edge events occurs during erosion
... |
8,683 | test response too large | # Copyright 2017 Workiva
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
#... |
8,684 | check pid | #!/usr/bin/env python
"""Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in ... |
8,685 | get bb rect | """
`regfilter` provides functions for filtering out regions outside the image space.
:Authors: Mihai Cara
:License: :doc:`LICENSE`
"""
__author__ = 'Mihai Cara'
def fast_filter_outer_regions(reglist, width, height, origin=1):
# fast_filter_outer_regions filters regions that are outside a rectangle
# ('ima... |
8,686 | analyze ensemble | import dill
from typing import Dict, Optional
import pandas as pd
from lightwood.api.types import ModelAnalysis
# Interface that must be respected by predictor objects generated from JSON ML and/or compatible with Mindsdb
class PredictorInterface:
"""
Abstraction of a Lightwood predictor. The ``PredictorInte... |
8,687 | bigquery ml advanced weights job | # Copyright 2023 The Kubeflow 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 applicabl... |
8,688 | inner | # Copyright (c) "Neo4j"
# Neo4j Sweden AB [https://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... |
8,689 | test instructions | from recipe_scrapers.saveur import Saveur
from tests import ScraperTest
class TestSaveurScraper(ScraperTest):
scraper_class = Saveur
def test_host(self):
self.assertEqual("saveur.com", self.harvester_class.host())
def test_author(self):
self.assertEqual(None, self.harvester_class.author... |
8,690 | delay update | import re
import time
import tkinter as tk
from logging import getLogger
from thonny import get_workbench, ui_utils
from thonny.languages import tr
from thonny.ui_utils import ems_to_pixels
logger = getLogger(__name__)
INFO_TEXT = "---"
class TodoView(ui_utils.TreeFrame):
def __init__(self, master):
ui... |
8,691 | evaluate | from __future__ import annotations
import asyncio
import functools
import io
import typing as t
import pandas as pd
from fastapi import APIRouter, Body, Depends, Request
from sqlmesh.core.context import Context
from sqlmesh.core.snapshot.definition import SnapshotChangeCategory
from sqlmesh.core.test import ModelTes... |
8,692 | test ias veryhyperbolic | import rebound
import unittest
import math
import rebound.data
import warnings
class TestIntegratorWHFastHyper(unittest.TestCase):
def test_whfast_veryhyperbolic(self):
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=0.,x=1.,vy=100000.)
sim.integrator = "whfast"
sim.dt = ... |
8,693 | second | # Standard Library
import errno
import os
import shutil
import sys
import time
# Third Party
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Conv2D, Dense, Flatten
from utils import log_result
# First Party
import smdistributed.modelparallel.tensorflow as smp
tf.random.set_seed(1234)
... |
8,694 | test closed | # bluemira is an integrated inter-disciplinary design tool for future fusion
# reactors. It incorporates several modules, some of which rely on other
# codes, to carry out a range of typical conceptual fusion reactor design
# activities.
#
# Copyright (C) 2021-2023 M. Coleman, J. Cook, F. Franza, I.A. Maione, S. McInto... |
8,695 | merge derived | from typing import Sequence, Tuple
import numpy as np
import xarray as xr
import vcm
from fv3net.diagnostics._shared.registry import Registry
from fv3net.diagnostics._shared.constants import WVP, COL_DRYING
from .constants import MASS_STREAMFUNCTION_MID_TROPOSPHERE
from .compute import itcz_edges
def METHOD_NAME(d... |
8,696 | test kaspersky | # Copyright 2019 Splunk, Inc.
#
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
from jinja2 import Environment, select_autoescape
from .sendmessage import sendsingle
from .splunkutils import splunk... |
8,697 | dump types | #!/usr/bin/env python
"""
The LibVMI Library is an introspection library that simplifies access to
memory in a target virtual machine or in a file containing a dump of
a system's physical memory. LibVMI is based on the XenAccess Library.
Copyright 2011 Sandia Corporation. Under the terms of Contract
DE-AC04-94AL850... |
8,698 | test return tuple assign | import pytest
from vyper.exceptions import TypeMismatch
pytestmark = pytest.mark.usefixtures("memory_mocker")
def test_return_type(get_contract_with_gas_estimation):
long_string = 35 * "test"
code = """
struct Chunk:
a: Bytes[8]
b: Bytes[8]
c: int128
chunk: Chunk
@external
def __init__():
... |
8,699 | assert none or is quant args | # Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.