id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
11,300 | train by numpy | """
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... |
11,301 | export default old | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import onnx
from onnx import helper
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
def dropout(X, drop_probability=0.5, seed=0, training_mode=False, return_mask=False): ... |
11,302 | post config hook | """
Display list of network interfaces and IP addresses.
This module supports both IPv4 and IPv6. There is the possibility to blacklist
interfaces and IPs, as well as to show interfaces with no IP address. It will
show an alternate text if no IP are available.
Configuration parameters:
cache_timeout: refresh inte... |
11,303 | setup avr | import os
c, link, asm, utils = emk.module("c", "link", "asm", "utils")
default_compile_flags = ["-fvisibility=hidden", "-Wall", "-Wextra", "-Wshadow", "-Werror", "-Wno-missing-field-initializers", "-Wno-unused-parameter", \
"-Wno-comment", "-Wno-unused", "-Wno-unknown-pragmas"]
default_link_flags = []
opt_flags ... |
11,304 | generate checksums | import subprocess
from subprocess import PIPE
import itertools
import shutil
from pathlib import Path
import sys
import tempfile
INCLUDE_DIRS = [
'cache',
'core',
'custom',
'dev',
'modules',
'uploads',
'vendor',
]
INCLUDE_FILES = [
'.htaccess',
'403.php',
'404.php',
'index... |
11,305 | test zero read | from collections import deque
__all__ = ["ChunkedFIFO"]
class ChunkedFIFO:
"""
A first-in first-out byte buffer that uses discontiguous storage to operate without copying.
"""
def __init__(self):
self._queue = deque()
self._chunk = None
self._offset = 0
self._length... |
11,306 | get pooled embedding | # 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 applica... |
11,307 | gen schema | import json
import sys
import os
description = """Generates the data and JSON Schema for the corpus test in the target directory.
"""
if len(sys.argv) != 2:
print(description)
print("usage: python generate-corpus.py <target directory>")
print("example: python ./generate-corpus.py ./")
sys.exit(1)
tar... |
11,308 | dest bundle symlink | import os
import shutil
from .... import ErsiliaBase
from ...bundle.repo import DockerfileFile
from ...delete.delete import ModelBentoDeleter
from .. import MODEL_INSTALL_COMMANDS_FILE
from ....default import BENTOML_PATH, H5_DATA_FILE, ISAURA_FILE_TAG, H5_EXTENSION
class _Deleter(ErsiliaBase):
def __init__(sel... |
11,309 | activate features | import inspect
import warnings
from functools import wraps
from typing import Dict, Iterable
from .protofeature import Feature
from pyvo.dal.exceptions import PyvoUserWarning
__all__ = ['features', 'prototype_feature', 'activate_features', 'PrototypeWarning', 'PrototypeError']
features: Dict[str, "Feature"] = {
... |
11,310 | get origin element | #
# Copyright 2006-2010 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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 ... |
11,311 | find project root cache clear | """Configuration and fixtures for the Pytest based test suite"""
import os
import re
from pathlib import Path
from subprocess import check_call # nosec
from typing import Dict, Iterable, List, Union
import pytest
from black import find_project_root as black_find_project_root
from darker.git import _git_check_output... |
11,312 | yiq to rgb | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... |
11,313 | instance tls ignore warning | # This file is autogenerated.
# To change this file you should edit assets/configuration/spec.yaml and then run the following commands:
# ddev -x validate config -s <INTEGRATION_NAME>
# ddev -x validate models -s <INTEGRATION_NAME>
from datadog_checks.base.utils.models.fields import get_default_field_value
d... |
11,314 | post patch | pkgname = "udev"
pkgver = "254"
pkgrel = 0
build_style = "meson"
configure_args = [
"-Dadm-group=false",
"-Danalyze=false",
"-Dapparmor=false",
"-Daudit=false",
"-Dbacklight=false",
"-Dbinfmt=false",
"-Dbpf-framework=false",
"-Dbzip2=false",
"-Dcoredump=false",
"-Ddbus=false",
... |
11,315 | test try except | import builtins
import os
import select
import socket
import sys
import unittest
import errno
from errno import EEXIST
from test import support
class SubOSError(OSError):
pass
class SubOSErrorWithInit(OSError):
def __init__(self, message, bar):
self.bar = bar
super().__init__(message)
class ... |
11,316 | add operators | # SPDX-License-Identifier: Apache-2.0
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class SubGraph(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
... |
11,317 | post | """New recentchanges implementation.
This should go into infogami.
"""
import web
import json
import yaml
from infogami.utils import delegate
from infogami.utils.view import public, render, render_template, safeint
from infogami.utils.view import add_flash_message # TODO: unused import?
from infogami.utils import fe... |
11,318 | fetch exchange | #!/usr/bin/env python3
# The arrow library is used to handle datetimes
from datetime import datetime, timedelta
from logging import Logger, getLogger
from typing import Any, Dict, List, Optional
import arrow
import pandas as pd
import pytz
from requests import Response, Session
from electricitymap.contrib.config imp... |
11,319 | stack | """
Reading register value from the inferior, and provides a
standardized interface to registers like "sp" and "pc".
"""
from __future__ import annotations
import ctypes
import re
import sys
from types import ModuleType
import gdb
import pwndbg.gdblib.arch
import pwndbg.gdblib.events
import pwndbg.gdblib.proc
import... |
11,320 | times2 | import unittest
from contextlib import contextmanager
from llvmlite import ir
from numba.core import types, typing, callconv, cpu, cgutils
from numba.core.registry import cpu_target
class TestCompileCache(unittest.TestCase):
'''
Tests that the caching in BaseContext.compile_internal() works correctly by
... |
11,321 | higher order tensors | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
11,322 | test revoke roles with proper parameters | # -*- coding: utf-8 -*-
import pytest
import time
from .test_base_class import TestBaseClass
from aerospike import exception as e
import aerospike
class TestRevokeRoles(TestBaseClass):
pytestmark = pytest.mark.skipif(
not TestBaseClass.auth_in_use(), reason="No user specified, may be not secured cluste... |
11,323 | update tasks | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=
"""
File : SummaryDB.py
Author : Valentin Kuznetsov <vkuznet AT gmail dot com>
Description: Set of modules/functions to update WMAgent SummaryDB.
"""
from future.utils import viewitems, viewvalues
# system modules
import logging
from pprint im... |
11,324 | test fetch user | from __future__ import absolute_import
from django.urls import reverse
from contentcuration.tests import testdata
from contentcuration.tests.base import StudioAPITestCase
from contentcuration.tests.viewsets.base import generate_create_event
from contentcuration.tests.viewsets.base import generate_delete_event
from co... |
11,325 | uri mapper | from __future__ import annotations
import logging
from dataclasses import dataclass, field
from test.utils import MarkListType, marks_to_list
from test.utils.graph import GraphSource, GraphSourceType
from test.utils.iri import URIMapper
from test.utils.namespace import MF
from typing import (
Callable,
Collect... |
11,326 | swap out ready buffers | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping tensors to/from (NVMe) storage devices.
"""
import torch
from deepspeed import comm as dist
from deepspeed.utils.logging import logger
from deepspeed.runtime.swap_tensor.utils import swap_out_te... |
11,327 | 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
__all__ ... |
11,328 | model fn | # 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... |
11,329 | plugin | from __future__ import annotations
from typing import Callable
from mypy.nodes import ARG_POS, TypeInfo
from mypy.METHOD_NAME import ClassDefContext, FunctionSigContext, MethodSigContext, Plugin
from mypy.plugins.common import add_attribute_to_class
from mypy.types import AnyType, CallableType, FunctionLike, Instance... |
11,330 | cl cubes | """Tests for the fixes of ACCESS-CM2."""
import unittest.mock
import iris
import numpy as np
import pytest
from esmvalcore.cmor._fixes.cmip6.access_cm2 import Cl, Cli, Clw
from esmvalcore.cmor._fixes.common import ClFixHybridHeightCoord
from esmvalcore.cmor.fix import Fix
B_POINTS = [
0.997741281986237, 0.993982... |
11,331 | test truncate from right | import shutil
import tempfile
from .test_utils import get_tokenizer_service, TEST_PROMPT
from .tokenizer_service import TokenizerService
from .window_service_factory import WindowServiceFactory
class TestYaLMWindowService:
def setup_method(self):
self.path: str = tempfile.mkdtemp()
service: Token... |
11,332 | upload to assets bucket |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""Support S3 Large Deployments using Custom Resource and Assets Bucket"""
import os
import aws_cdk as cdk
from aws_cdk import (
aws_logs as logs,
aws_s3 as s3,
aws_iam as _iam,
aws_s3_assets as s3a... |
11,333 | split sections | """
Tools for converting old- to new-style metadata.
"""
from __future__ import annotations
import functools
import itertools
import os.path
import re
import textwrap
from email.message import Message
from email.parser import Parser
from typing import Iterator
from .vendored.packaging.requirements import Requirement
... |
11,334 | query user grant | import time
from dominate import document, tags as dom
from authlib.oauth2 import OAuth2Error
from authlib.oauth2.rfc6749.grants import AuthorizationEndpointMixin
from authlib.oauth2.rfc6749.errors import InvalidClientError, UnauthorizedClientError
from authlib.oauth2.rfc8628 import (
DeviceAuthorizationEndpoint as... |
11,335 | test pack bytes | import pytest
import numpy as np
from typing import List
from mlserver.types import RequestInput, ResponseOutput, TensorData
from mlserver.raw import (
_pack_bytes,
_pack_tensor,
_unpack_bytes,
_unpack_tensor,
extract_raw,
inject_raw,
)
from mlserver.codecs.numpy import NumpyCodec
def test_u... |
11,336 | rollback | from copy import copy
from notification.models import TaskHistory
from util import get_worker_name
from workflow.workflow import steps_for_instances, rollback_for_instances_full
__all__ = ('BaseJob',)
class BaseJob(object):
step_manger_class = None
get_steps_method = None
success_msg = ''
error_msg... |
11,337 | get sorted target list | #
# SPDX-License-Identifier: GPL-2.0-only
#
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import force_text
from orm.models import Project, Build, Layer_Version
import logging
logger = logging.getLogger("toaster")
# a BuildEnvironment is the equivalent of the "build/"... |
11,338 | toggle | #@+leo-ver=5-thin
#@+node:ekr.20170217164004.1: * @file ../plugins/tables.py
"""
A plugin that inserts tables, inspired by org mode tables:
Written by Edward K. Ream, February 17, 2017.
"""
from leo.core import leoGlobals as g
#@+others
#@+node:ekr.20170217164709.1: ** top level
#@+node:ekr.20170217164759.1: *3* tabl... |
11,339 | test transform feature balance measures with valid | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import pandas as pd
import pytest
from responsibleai.databalanceanalysis.constants import Constants
from responsibleai.databalanceanalysis.data_balance_utils import (
AGGREGATE_BALANCE_MEASURES_KEY, DISTRIBUTION_BALANCE_MEASURES_KEY,
FEAT... |
11,340 | embed url | #########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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... |
11,341 | test bad header |
import os
from io import BytesIO
from mutagen.id3 import ID3, TIT2
from mutagen.musepack import Musepack, MusepackInfo, MusepackHeaderError
from tests import TestCase, DATA_DIR, get_temp_copy
class TMusepack(TestCase):
def setUp(self):
self.sv8 = Musepack(os.path.join(DATA_DIR, "sv8_header.mpc"))
... |
11,342 | create filer image | import json
import os
import tempfile
from io import StringIO
from django.conf import settings
from django.core.files import File as DjangoFile
from django.core.management import call_command
from django.test import TestCase
from filer import settings as filer_settings
from filer.models import Folder
from filer.model... |
11,343 | get image url | from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
parse_iso8601,
parse_duration,
)
class SkyNewsArabiaBaseIE(InfoExtractor):
_IMAGE_BASE_URL = 'http://www.skynewsarabia.com/web/images'
def _call_api(self, path, value):
return self._download_json('http://a... |
11,344 | main | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex.gen import *
from litex_boards.platforms import antmicro_lpddr4_test_board
from litex.soc.cores.clock import *
from litex.soc.integr... |
11,345 | parse address | import lxml
import re
from datetime import datetime
from typing import Optional
from zavod import Context, Entity
from zavod import helpers as h
MONTHS_DE = {
# We won’t know until January 2024 if the site uses the Austrian name
# or the German/Swiss name for the month January.
"Januar": "January",
"... |
11,346 | test dataset manual grouping | import datetime
import dateutil.parser as dateutil_parser
import ckan.tests.factories as factories
import ckan.model as model
import ckan.plugins.toolkit as tk
import ckanext.hdx_theme.tests.hdx_test_base as hdx_test_base
from ckanext.hdx_org_group.helpers.static_lists import ORGANIZATION_TYPE_LIST
config = tk.confi... |
11,347 | handler | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
11,348 | create netlist | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2023 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
from math import ceil
from openram.base import ... |
11,349 | plot radec on healpix | # This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from astrometry.util.util import *
from astrometry.util.starutil_numpy import *
from numpy import *
from pylab import *
def cosdeg(y):
return cos(deg2rad(y))
def plot_healpix_on_radec(nside=2, cosdec=Fals... |
11,350 | code page decode | import codecs
import sys
from _typeshed import ReadableBuffer
from collections.abc import Callable
from typing import overload
from typing_extensions import Literal, TypeAlias
# This type is not exposed; it is defined in unicodeobject.c
class _EncodingMap:
def size(self) -> int: ...
_CharMap: TypeAlias = dict[int... |
11,351 | test decode bytes | import unittest
import mock
import superscanner
# ======================================================================
def print_hex(bytestring):
print('\\x' + '\\x'.join('{:02x}'.format(x) for x in bytestring))
# ======================================================================
def get_deviceset_info(devi... |
11,352 | get initial continuation | # The MIT License (MIT)
# Copyright (c) 2014 Microsoft Corporation
# 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... |
11,353 | filter addresses | import subprocess
import os
import signal
import unittest
from scapy.all import (Ether, Packet, IP, IPv6, Raw,
UDP, TCP, IPv6ExtHdrRouting)
from xdp_test_harness.xdp_case import XDPCase, usingCustomLoader
from xdp_test_harness.utils import XDPFlag
from . common import Base, XDP_FILTER, get_mod... |
11,354 | set up | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from unittest import TestCase
from lisa import LisaException, constants
from selftests.test_testsuite import cleanup_cases_metadata, select_and_check
class SelectorTestCase(TestCase):
def METHOD_NAME(self) -> None:
cleanup_cases_me... |
11,355 | add to zip | from django.db import models
from django import forms
from django.http import HttpResponse
from django.db.models.fields import TextField
from django.core.validators import URLValidator
from django.utils.encoding import force_text
from django.core.exceptions import ValidationError
from .base import SubmissionComponent... |
11,356 | check icmp6 error | #!/usr/bin/env python
#-
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2019 Netflix, Inc.
#
# 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... |
11,357 | z | import neuron
import os
import numpy
import numpy.linalg
# from mayavi import mlab
# TODO: remove circular dependency
from . import surfaces
def _register_on_neighbor_map(the_map, pt, neighbor):
# does not assume neighbor relations are bidirectional
if pt in the_map:
the_map[pt].append(neighbor)
... |
11,358 | status | # 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__ ... |
11,359 | set headers | import datetime
from collections.abc import AsyncIterable, AsyncIterator, Iterable, Iterator
from io import BytesIO
from json import JSONEncoder
from typing import Any, Literal, TypeVar, overload, type_check_only
from django.http.cookie import SimpleCookie
from django.utils.datastructures import CaseInsensitiveMapping... |
11,360 | is valid | # Copyright 2011 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 required by applicable law... |
11,361 | create test data | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
11,362 | main | #!/usr/bin/env python3
# -*- python -*-
#
# Copyright (C) 2019 Red Hat, Inc
#
# QEMU SystemTap Trace Tool
#
# 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
# ... |
11,363 | extract data | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
11,364 | upgrade instance | # Authors:
# Matthew Harmsen <mharmsen@redhat.com>
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,... |
11,365 | recognize business card | # 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.
# --------------------------------------------------------------------... |
11,366 | mergestores | #
# Copyright 2002-2010 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 lat... |
11,367 | test node path attribute dotted | import unittest
from Cython.Compiler.Visitor import PrintTree
from Cython.TestUtils import TransformTest
from Cython.Compiler.TreePath import find_first, find_all
from Cython.Compiler import Nodes, ExprNodes
class TestTreePath(TransformTest):
_tree = None
def _build_tree(self):
if self._tree is None:
... |
11,368 | remove field | from django.db.backends.postgresql.schema import (
DatabaseSchemaEditor as PostgresDatabaseSchemaEditor,
)
from django.db.models import Field
from django.db.models.base import ModelBase
from django_zero_downtime_migrations.backends.postgres.schema import (
DatabaseSchemaEditorMixin,
Unsafe,
UnsafeOperat... |
11,369 | test win codepage path disabled shortfilename | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2023, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is... |
11,370 | define schema | #!/usr/bin/env python3
#
# (c) Copyright 2020 SUSE 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 ... |
11,371 | test minimum target temperature f | from homeassistant.components.climate.const import (
SWING_OFF,
SWING_VERTICAL,
ClimateEntityFeature,
HVACMode,
)
from homeassistant.const import UnitOfTemperature
from ..const import FERSK_VIND2_PAYLOAD
from ..helpers import assert_device_properties_set
from ..mixins.climate import TargetTemperatureTe... |
11,372 | test port interval | # -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2014-2023 Greenbone AG
#
# SPDX-License-Identifier: AGPL-3.0-or-later
""" Test module for command line arguments.
"""
import unittest
from unittest.mock import patch
from io import StringIO
from pathlib import Path
from typing import List
from ospd.parser import (
... |
11,373 | reset index | # Copyright 2023 Iguazio
#
# 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, softwa... |
11,374 | test value | from datetime import date, datetime, time
from unittest.mock import Mock
import pytest
import toga
from toga_dummy.utils import assert_action_performed
@pytest.fixture
def on_change_handler():
return Mock()
@pytest.fixture
def widget(on_change_handler):
return toga.TimeInput(on_change=on_change_handler)
... |
11,375 | test column datatype to string | # 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... |
11,376 | gen type constructor | '''
VStruct builder! Used to serialize structure definitions etc...
'''
import copy
import types
import inspect
import vstruct
import vstruct.primitives as vs_prim
TSIZES = [1, 2, 4, 8]
prim_types = [None,
vs_prim.v_uint8,
vs_prim.v_uint16,
None,
vs_prim.v_u... |
11,377 | is simple type | from __future__ import annotations
import itertools
import logging
from pathlib import Path
from typing import Any
from yaml.scanner import ScannerError
from yaml import YAMLError
from checkov.common.parsers.json import parse as json_parse
from checkov.common.parsers.yaml import loader
from checkov.common.resource_c... |
11,378 | setup args | import glob
import os.path
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
from types import ModuleType
from typing import Any, Dict
from pkg_resources import parse_requirements
from setuptools import find_packages
_PROJECT_ROOT = "."
_SOURCE_ROOT = os.path.join(_PROJECT_... |
11,379 | log message | #!/usr/bin/env python3
import os
import unittest
import requests
import threading
import http.server
import cereal.messaging as messaging
from typing import Any
from cereal.visionipc import VisionIpcClient, VisionStreamType
from openpilot.selfdrive.manager.process_config import managed_processes
LLK_DECIMATION = 10
C... |
11,380 | recompute bell | import numpy as np
import simsoptpp as sopp
from .surface import Surface
from .surfacerzfourier import SurfaceRZFourier
__all__ = ['SurfaceXYZTensorFourier']
class SurfaceXYZTensorFourier(sopp.SurfaceXYZTensorFourier, Surface):
r"""
`SurfaceXYZTensorFourier` is a surface that is represented in cartesian
... |
11,381 | test gpu | # Copyright 2019-2022 ETH Zurich and the DaCe authors. All rights reserved.
# Original application code: NPBench - https://github.com/spcl/npbench
import dace.dtypes
import numpy as np
import dace as dc
import pytest
import argparse
from dace.fpga_testing import fpga_test, xilinx_test
from dace.transformation.interstat... |
11,382 | votablefile firstresource | from pathlib import Path
import numpy as np
from astropy.table import Table
from astropy.io.votable.tree import VOTableFile, Info
from astropy.io.fits import ImageHDU
def _votablefile():
table = Table([
[23, 42, 1337],
[b'Illuminatus', b"Don't panic, and always carry a towel", b'Elite']
], n... |
11,383 | kind | # 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... |
11,384 | build list 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... |
11,385 | check lookup table vs python op | # Copyright (c) 2019-2022, NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
11,386 | do configure | pkgname = "perl"
pkgver = "5.36.1"
pkgrel = 0
_perl_cross_ver = "1.4.1"
build_style = "gnu_configure"
make_cmd = "gmake"
make_check_target = "test"
hostmakedepends = ["gmake", "less"]
makedepends = ["zlib-devel", "bzip2-devel"]
checkdepends = ["perl-AnyEvent", "perl-Test-Pod", "procps"]
depends = ["less"]
pkgdesc = "Pr... |
11,387 | test find peaks with erosion with scores | from unittest import TestCase, mock
import numpy as np
import spateo.segmentation.label as label
from ..mixins import TestMixin, create_random_adata
class TestLabel(TestMixin, TestCase):
def test_watershed(self):
X = np.zeros((10, 10))
X[:3, :3] = 1
X[7:, 7:] = 1
mask = X > 0
... |
11,388 | trans ctx check | # engine/util.py
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import annotations
import typing
from typing import Any
from typing... |
11,389 | train step | # 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)
... |
11,390 | recv | # COPYRIGHT (C) 2020-2023 Nicotine+ Contributors
# COPYRIGHT (C) 2020 Lene Preuss <lene.preuss@gmail.com>
#
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# 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... |
11,391 | const save | #
# Copyright 2021 FMSoft (<https://www.fmsoft.cn>)
# Copyright 2018-2020 Alexander Borisov
#
# 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
#
#... |
11,392 | get backend | import inspect
import os
from pathlib import Path
from hls4ml.backends.template import Template
from hls4ml.model.flow import get_backend_flows, update_flow
from hls4ml.model.optimizer import (
LayerOptimizerPass,
extract_optimizers_from_object,
extract_optimizers_from_path,
get_backend_passes,
get... |
11,393 | setup sysconfig bootloader | # Copyright (c) 2022 Marcus Schäfer
#
# This file is part of kiwi.
#
# kiwi 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.
#
# kiwi is... |
11,394 | query entity | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
11,395 | subroutine dispatch | # 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... |
11,396 | swig setattr | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swi... |
11,397 | subscribe | import json
import zmq
import zmq.asyncio
import asyncio
import unittest
class MockSubscriber():
def __init__(self, callback=None, port=19080, multipart=True, ctx=None):
self.running = False
self.ctx = ctx or zmq.asyncio.Context().instance()
self.socket = None
self.address = f'tcp... |
11,398 | value | # -*- coding: utf-8 -*-
# Copyright 2018 ICON Foundation
#
# 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 ... |
11,399 | build index | # stub for SortedList. This is an exact copy of
# https://github.com/grantjenks/python-sortedcontainers/blob/a419ffbd2b1c935b09f11f0971696e537fd0c510/sortedcontainers/sortedlist.pyi
# (from https://github.com/grantjenks/python-sortedcontainers/pull/107)
from __future__ import annotations
from typing import (
Any,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.