id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
7,500 | client predict | # Copyright 2019 The MLPerf 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 ... |
7,501 | map task to id | # 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 torch
from fairseq.optim.amp_optimizer import AMPOptimizer
from fairseq.tasks import register_task
from fairseq.tasks.speech_to_text im... |
7,502 | test missing recommended on nested class | import pytest
from linkml_runtime.linkml_model import SchemaDefinition
from linkml_runtime.loaders import yaml_loader
from linkml.validator.plugins.recommended_slots_plugin import RecommendedSlotsPlugin
from linkml.validator.validation_context import ValidationContext
SCHEMA = """id: https://w3id.org/test/recommended... |
7,503 | set up module | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
7,504 | load | import tkinter as tk
from tkinter import font, ttk
THEME_DARK: str = "black"
PADX: tuple[int, int] = (0, 5)
PADY: tuple[int, int] = (0, 5)
FRAME_PAD: int = 5
DIALOG_PAD: int = 5
class Styles:
tooltip: str = "Tooltip.TLabel"
tooltip_frame: str = "Tooltip.TFrame"
service_checkbutton: str = "Service.TCheckb... |
7,505 | set temp device token | # -*- coding: utf-8 -*-
# This file is part of Tautulli.
#
# Tautulli 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.
#
# Tautu... |
7,506 | test create inference graph with micro | # Copyright 2017 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... |
7,507 | error | #-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frederic Rodrigo 2013 ##
## ... |
7,508 | 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
# --------------------------------... |
7,509 | test develop canonicalize path no args | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import shutil
import pytest
import llnl.util.filesystem as fs
import spack.environment as ev
import spack.spec... |
7,510 | 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... |
7,511 | run | #!/usr/bin/env python3
'''
Main Script to run all SiStrip DAQ O2Os at the same time.
@author: Huilin Qu
'''
import os
import sys
import atexit
import logging
import argparse
import subprocess
import traceback
import json
from functools import partial
import CondTools.SiStrip.o2o_helper as helper
logDirVar = 'O2O_LOG... |
7,512 | test without imports | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import lief
import random
from utils import get_sample
def METHOD_NAME():
"""
By convention if a binary hasn't import, imphash is '0'
"""
binary = lief.PE.Binary(lief.PE.PE_TYPE.PE32)
assert int(lief.PE.get_imphash(binary), 16) == 0
def test_casse()... |
7,513 | view column lineage count | # Copyright 2022 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... |
7,514 | user music dir | """macOS."""
from __future__ import annotations
import os.path
from .api import PlatformDirsABC
class MacOS(PlatformDirsABC):
"""
Platform directories for the macOS operating system. Follows the guidance from `Apple documentation
<https://developer.apple.com/library/archive/documentation/FileManagement/... |
7,515 | register | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import types
from _weakrefset import WeakSet
# Instance of old-style class
class _C: pass
_InstanceType = type(_C())
def abstractmethod(funcobj):
"""A d... |
7,516 | get | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import os
try:
from collections.abc import MutableMapping
except ImportError:
from collections import M... |
7,517 | test absent | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import pytest
import salt.modules.boto_route53 as boto53mod
import salt.modules.boto_vpc as botovpcmod
import salt.states.boto_route53 as boto_route53
from tests.support.mock import MagicMock, create_autospec, patch
@pytest.fixture
def configure_loader_m... |
7,518 | open configs | # 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... |
7,519 | raw page | # -*- 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 required by applicable law or... |
7,520 | calc cell volumes | """
1D Mesh
"""
from __future__ import unicode_literals
__docformat__ = 'restructuredtext'
from fipy.tools import numerix
from fipy.tools.dimensions.physicalField import PhysicalField
from fipy.tools import parallelComm
from fipy.meshes.nonUniformGrid1D import NonUniformGrid1D
__all__ = ["SphericalNonUniformGrid1D"]... |
7,521 | batched | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
7,522 | configure filter | import sys
from _typeshed import StrOrBytesPath
from collections.abc import Callable, Hashable, Iterable, Sequence
from configparser import RawConfigParser
from re import Pattern
from threading import Thread
from typing import IO, Any, overload
from typing_extensions import Literal, SupportsIndex, TypeAlias, TypedDict
... |
7,523 | priority | # 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... |
7,524 | normal |
import numpy as np
from types import ModuleType
from fealpy.functionspace import LagrangeFiniteElementSpace
from ..quadrature import TriangleQuadrature
from .mesh_tools import unique_row, find_node, find_entity, show_mesh_2d
class SurfaceTriangleMesh():
def __init__(self, mesh, surface, p=1, scale=None):
... |
7,525 | get solves for challenge id | import datetime
from collections import namedtuple
from sqlalchemy import func as sa_func
from sqlalchemy.sql import and_, false, true
from CTFd.cache import cache
from CTFd.models import Challenges, Solves, Users, db
from CTFd.schemas.tags import TagSchema
from CTFd.utils import get_config
from CTFd.utils.dates impo... |
7,526 | test url has newer version affirmative | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import gzip
import sys
try:
import StringIO
except:
pass
from test.testlib.testcase import BaseTestCase
from unittest.mock import MagicMock, patch
import cfnlint.helpers
class TestGetUrlContent(BaseTest... |
7,527 | test bug id from url | # pylint: disable=attribute-defined-outside-init
import os
import time
import unittest
from tcms.core.contrib.linkreference.models import LinkReference
from tcms.issuetracker.types import Gitlab
from tcms.rpc.tests.utils import APITestCase
from tcms.testcases.models import BugSystem
from tcms.tests.factories import C... |
7,528 | mocked requests get | import io
import os
import shutil
from unittest.mock import MagicMock
import pandas as pd
import pytest
from ert.gui.tools.plot.plot_api import PlotApi
from ert.services import StorageService
class MockResponse:
def __init__(self, json_data, status_code, text="", url=""):
self.json_data = json_data
... |
7,529 | system data | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
7,530 | update from dict | import six
import attr
from attr import validators
__all__ = ['range_validator', 'param', 'percent_param', 'TaskParameters']
def _canonize_validator(current_validator):
"""
Convert current_validator to a new list and return it.
If current_validator is None return an empty list.
If current_validator... |
7,531 | test copy in str | import pytest
import string
from random import randrange, choice
from psycopg import sql, errors as e
from psycopg.pq import Format
from psycopg.adapt import PyFormat
from psycopg.types.numeric import Int4
from ..utils import eur, gc_collect, gc_count
from ..test_copy import sample_text, sample_binary # noqa
from ..... |
7,532 | standardise ids | #!/usr/bin/python
# Copyright (c) 2020, 2022, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ =... |
7,533 | test remove is idempotent | from unittest import mock
import pytest
from pyramid import httpexceptions
from h.views.admin.admins import admins_add, admins_index, admins_remove
@pytest.mark.usefixtures("routes")
class TestAdminsIndex:
def test_when_no_admins(self, pyramid_request):
result = admins_index(pyramid_request)
as... |
7,534 | readline | import _compression
import sys
from _compression import BaseStream
from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer
from collections.abc import Iterable
from typing import IO, Any, Protocol, TextIO, overload
from typing_extensions import Literal, Self, SupportsIndex, TypeAlias, final
__all__ = ["B... |
7,535 | ndim | # Copyright 2018 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... |
7,536 | update display properties | import abc
import typing
from nion.swift import Undo
from nion.swift.model import DisplayItem
from nion.swift.model import DocumentModel
from nion.swift.model import Graphics
from nion.swift.model import Persistence
from nion.ui import CanvasItem
from nion.ui import UserInterface
from nion.utils import Geometry
clas... |
7,537 | test l10n en us | # 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... |
7,538 | save | import os
import logging
import time
from dataclasses import dataclass
from typing import List, Tuple, Optional, TypeVar, Type
from medcat.cdb import CDB
from medcat.utils.decorators import check_positive
T = TypeVar("T", bound="Checkpoint")
logger = logging.getLogger(__name__) # separate logger from the package-lev... |
7,539 | request | import asyncio
import inspect
import os
from concurrent.futures import ThreadPoolExecutor
import pytest
import requests
from certipy import Certipy
from sqlalchemy import text
from tornado.httputil import url_concat
from jupyterhub import metrics, orm
from jupyterhub.objects import Server
from jupyterhub.roles import... |
7,540 | super surface | #!/usr/bin/env python
# Searches for site overlap between two lattices
# All input between lines 72 - 79
# Requires the surface_points.py file, which defines the different surfaces
################################################################################
# Copyright Keith T Butler (2015) ... |
7,541 | parent path str | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# color
# -----
@property
def color(self):
"""
Sets the marker color of all decreasing values.
The 'color' property is a color an... |
7,542 | get proposal | import json
from moto.core.responses import BaseResponse
from .models import managedblockchain_backends, ManagedBlockchainBackend
from .utils import (
networkid_from_managedblockchain_url,
proposalid_from_managedblockchain_url,
invitationid_from_managedblockchain_url,
memberid_from_managedblockchain_re... |
7,543 | add metric | #!/usr/bin/env python3
#
# Plot the output of test/heapwatch/client_ram_report.py --csv
import csv
import random
from matplotlib import pyplot as plt
from matplotlib.ticker import MaxNLocator, FuncFormatter
_meta_cols = {'when', 'dt', 'round'}
_metrics_cols = {'free', 'inuse', 'released', 'total'}
# see https://mat... |
7,544 | convert to new filename | #!/usr/bin/env python3
"""
Collection of CLI commands for an administrator to use
"""
import logging
import os
import re
import time
from argparse import ArgumentParser
from getpass import getpass
from sys import stderr
from szurubooru import config, db, errors, model
from szurubooru.func import files, images
from s... |
7,545 | setup | r"""
A role and directive to display mathtext in Sphinx
==================================================
.. warning::
In most cases, you will likely want to use one of `Sphinx's builtin Math
extensions
<https://www.sphinx-doc.org/en/master/usage/extensions/math.html>`__
instead of this one.
Mathtext... |
7,546 | open std fd | from functools import update_wrapper
from functools import partial
from inspect import signature, Parameter
import logging
from parsl.app.errors import wrap_error
from parsl.app.app import AppBase
from parsl.dataflow.dflow import DataFlowKernelLoader
logger = logging.getLogger(__name__)
def remote_side_bash_executo... |
7,547 | sign | # Author: Stanislav Zidek
# See the LICENSE file for legal information regarding use of this file.
"""Abstract class for ECDSA."""
from .cryptomath import secureHash
class ECDSAKey(object):
"""This is an abstract base class for ECDSA keys.
Particular implementations of ECDSA keys, such as
:py:class:`~.... |
7,548 | test main includes | # Data Parallel Control (dpctl)
#
# Copyright 2020-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.... |
7,549 | clear | from _typeshed import Incomplete
from _typeshed.wsgi import WSGIEnvironment
from collections.abc import ItemsView, Iterator, KeysView, MutableMapping, ValuesView
from datetime import date, datetime, timedelta
from typing import TypeVar, overload
from typing_extensions import Literal
from webob.descriptors import _Asym... |
7,550 | current model | # Copyright 2023 Canonical Ltd.
# Licensed under the Apache V2, see LICENCE file for details.
import inspect
import subprocess
import uuid
from contextlib import contextmanager
from pathlib import Path
import pytest
from juju.client.jujudata import FileJujuData
from juju.controller import Controller
from juju.jasync... |
7,551 | test environment mapping | import numpy as np
import pyproj
from . import *
from datetime import datetime, timedelta
from opendrift.readers import reader_netCDF_CF_generic
from opendrift.readers import reader_constant
from opendrift.models.physics_methods import wind_drift_factor_from_trajectory
from opendrift.models.oceandrift import OceanDrift... |
7,552 | source subfolder | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.33.0"
class QCoroConan(ConanFile):
name = "qcoro"
license = "MIT"
homepage = "https://github.com/danvratil/qcoro"
url = "https://github.com/conan-io/conan-center-inde... |
7,553 | builtin filters | """
FormES
--------
"""
from copy import copy
from datetime import datetime
from jsonobject.exceptions import BadValueError
from casexml.apps.case.exceptions import PhoneDateValueError
from casexml.apps.case.xml.parser import (
CaseGenerationException,
case_update_from_block,
)
from couchforms.geopoint import... |
7,554 | setup default | import re
from avocado.utils import cpu as cpu_utils
from virttest import cpu
from virttest import utils_misc
from virttest import virsh
from virttest.libvirt_xml import vm_xml
from provider.numa import numa_base
def METHOD_NAME(test_obj):
"""
Default setup function for the test
:param test_obj: NumaT... |
7,555 | start | #!/usr/bin/env python3
import stat
import rospy
import os
from subprocess import Popen, PIPE
# If DRI_NAME is not set by user, use card0
DRI_PATH = os.path.join("/dev/dri", os.environ.get("DRI_NAME", "card0"))
EXERCISE = "rescue_people_newmanager"
TIMEOUT = 30
MAX_ATTEMPT = 2
# Check if acceleration can be enabled... |
7,556 | method | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
7,557 | fsym | import numpy as np
from molSimplify.Classes.mol3D import mol3D
from molSimplify.Scripts.geometry import distance
# xyzf = '/Users/tzuhsiungyang/Downloads/cuacetate1k2acetate1o-pyridylphenyl1_0_1_RIJCOSX-B3LYP-D3_BS_TS-ar-carboxylation.numfreq.xyz'
def fpriority(xyzf):
# setting properties
xyz = mol3D()
... |
7,558 | lonwrong | from argparse import ArgumentParser
from datetime import datetime, time
import os
import pytest
import numpy as np
from test import TEST_DIR, pushd
SCENARIO = os.path.join(TEST_DIR, "scenario_4")
from RAiDER.cli import AttributeDict
from RAiDER.cli.validators import (
modelName2Module, getBufferedExtent, isOu... |
7,559 | test revoked playbook | # -*- coding: UTF-8 -*-
import sys
import pytest
from mock.mock import patch
from pytest import raises
# don't even bother on 2.6
if sys.version_info >= (2, 7):
from insights.client.apps.ansible.playbook_verifier import verify, PlaybookVerificationError, getRevocationList, normalizeSnippet, loadPlaybookYaml # noq... |
7,560 | test eks mxnet multinode training | import json
import os
import random
import datetime
import pytest
from invoke import run
from invoke.context import Context
from retrying import retry
import test.test_utils.eks as eks_utils
import test.test_utils.ec2 as ec2_utils
from test.test_utils import is_pr_context, SKIP_PR_REASON
LOGGER = eks_utils.LOGGER
... |
7,561 | pkcs12 | from __future__ import print_function
import base64
import os
import sys
import foreign.six as six
import core.exceptions as ex
from core.objects.data import DataMixin
from core.objects.svc import BaseSvc
from utilities.converters import print_size
from utilities.lazy import lazy
from utilities.naming import factory... |
7,562 | initialize | # 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... |
7,563 | test transactions create no id | # =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2023 Tom Kralidis
#
# 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 ... |
7,564 | test concatentate multi | try:
from . import generic as g
except BaseException:
import generic as g
class TextureTest(g.unittest.TestCase):
def test_uv_to_color(self):
try:
import PIL.Image
except ImportError:
return
# n_vertices = 100
uv = g.np.array([[0.25, 0.2], [0.4, 0.... |
7,565 | test valid partition | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import pytest
import torch
import deepspeed.comm as dist
from deepspeed.runtime.utils import partition_uniform
from deepspeed.runtime.utils import partition_balanced
from deepspeed.runtime.utils import prefix_sum_inc
from ... |
7,566 | initialize metric | #!/usr/bin/env python
"""Default implementation for a stats-collector."""
import abc
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import stats as rdf_stats
from grr_response_core.stats import stats_collector
from grr_response_core.stats import stats_utils
def _FieldsToKey(fields):
... |
7,567 | stop withgrab | # Copyright (C) 2011 Chris Dekter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in t... |
7,568 | get audit spec | # Bob build tool
# Copyright (C) 2016 Jan Klötzke
#
# SPDX-License-Identifier: GPL-3.0-or-later
from ..errors import BuildError
from ..stringparser import IfExpression
from ..utils import joinLines, check_output
from .scm import Scm, ScmAudit, ScmTaint, ScmStatus
from shlex import quote
from textwrap import indent
im... |
7,569 | rewire node | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
import shutil
import tempfile
from collections import OrderedDict
from llnl.util.symlink import symli... |
7,570 | inc error | # Copyright 2016 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 or a... |
7,571 | cls | import importlib_resources as resources
import torch
import sentencepiece as spm
"""
From the YaLM GitHub repository (https://github.com/yandex/YaLM-100B),
adapted from https://github.com/yandex/YaLM-100B/blob/main/megatron_lm/megatron/tokenizer/sp_tokenization.py.
"""
YALM_TOKENIZER_PACKAGE: str = "helm.proxy.clien... |
7,572 | pixbuf2 image | #!/usr/bin/python3
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GObject
from PIL import Image
class EyeDropper(Gtk.HBox):
__gsignals__ = {
'color-picked': (GObject.SignalFlags.RUN_LAST, None, (GObject.TYPE_STRING,))
}
def __init__(self):
Gtk.HBox.__init__... |
7,573 | test sysconfig compiler vars | """Tests for distutils.sysconfig."""
import os
import test
import unittest
import shutil
from distutils import sysconfig
from distutils.tests import support
from test.test_support import TESTFN
class SysconfigTestCase(support.EnvironGuard,
unittest.TestCase):
def setUp(self):
super... |
7,574 | test fail shape | # Copyright 2018 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... |
7,575 | copy | # Copyright 2018-2023 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... |
7,576 | test set parameters | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
7,577 | check is cached | """Server tests for document caching."""
import re
from unittest.mock import patch, Mock
from timApp.auth.accesstype import AccessType
from timApp.document.caching import clear_doc_cache
from timApp.document.docentry import DocEntry
from timApp.item import routes
from timApp.item.routes import render_doc_view
from tim... |
7,578 | metrics | import tensorflow as tf
from tensorflow import keras
from keras.integration_test.models.input_spec import InputSpec
from keras.saving import serialization_lib
IMG_SIZE = (64, 64)
LATENT_DIM = 128
def get_data_spec(batch_size):
return InputSpec((batch_size,) + IMG_SIZE + (3,))
def get_input_preprocessor():
... |
7,579 | matcher | """Index analyzer plugin for matching against data in BigQuery tables."""
import itertools
import logging
from timesketch.lib import emojis
from timesketch.lib.analyzers import interface
from timesketch.lib.analyzers import manager
has_required_deps = True
try:
from google.cloud import bigquery
from google.au... |
7,580 | init | #! /usr/bin/env python
# encoding: utf-8
#
# Project: MXCuBE
# https://github.com/mxcube
#
# This file is part of MXCuBE software.
#
# MXCuBE is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either... |
7,581 | test get fingerprint for ourselves | import datetime
import unittest
import stem
import stem.response
import stem.version
from unittest.mock import Mock, patch
from stem.interpreter.commands import ControlInterpreter, _get_fingerprint
from stem.response import ControlMessage
from test.unit.interpreter import CONTROLLER
EXPECTED_EVENTS_RESPONSE = """\
... |
7,582 | get unauthenticated user path file queryset |
from django.db import models
from feeds.models import Feed
from servicefiles.models import ServiceFile
from pacsfiles.models import PACSFile
from uploadedfiles.models import UploadedFile
from plugininstances.models import PluginInstanceFile
from pipelines.models import PipelineSourceFile
def get_path_file_model_cla... |
7,583 | flag handler | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Flexi(CMakePackage):
"""Open Source High-Order Unstructured Discontinuous Galerkin... |
7,584 | create benchmark spec from config dict | # Copyright 2020 PerfKitBenchmarker 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... |
7,585 | close | import asyncio
import os
import sqlite3
from functools import wraps
from typing import Any, Callable, List, Optional, Sequence, Tuple, TypeVar
import aiosqlite
from pypika import SQLLiteQuery
from tortoise.backends.base.client import (
BaseDBAsyncClient,
BaseTransactionWrapper,
Capabilities,
Connectio... |
7,586 | dispatch line | import sys
from _typeshed import ExcInfo, TraceFunction
from collections.abc import Callable, Iterable, Mapping
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, SupportsInt, TypeVar
from typing_extensions import Literal, ParamSpec
__all__ = ["BdbQuit", "Bdb", "Breakpoint"]
_T = TypeVar... |
7,587 | f32tou16 | # 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... |
7,588 | test bool scalar bool | import operator
import unittest
import numpy
import pytest
import cupy
from cupy import testing
class TestArrayBoolOp(unittest.TestCase):
@testing.for_all_dtypes()
def test_bool_empty(self, dtype):
with testing.assert_warns(DeprecationWarning):
assert not bool(cupy.array((), dtype=dtype... |
7,589 | test pandas feeding | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
7,590 | cb | import copy
import os
import tempfile
from threading import Thread, current_thread
from unittest import TestCase
import six
from pyff import utils
from pyff.constants import NS, as_list_of_string
from pyff.resource import Resource, ResourceOpts
from pyff.samlmd import entities_list, find_entity
from pyff.utils import... |
7,591 | reverse pointer | import sys
from collections.abc import Container, Iterable, Iterator
from typing import Any, Generic, SupportsInt, TypeVar, overload
from typing_extensions import Literal, Self, TypeAlias
# Undocumented length constants
IPV4LENGTH: Literal[32]
IPV6LENGTH: Literal[128]
_A = TypeVar("_A", IPv4Address, IPv6Address)
_N =... |
7,592 | fcn | # Copyright 2021 Planet Labs, Inc.
# Copyright 2022 Planet Labs PBC.
#
# 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 a... |
7,593 | ref adadelta |
import functools
import hypothesis
from hypothesis import given, settings, HealthCheck
import hypothesis.strategies as st
import numpy as np
from caffe2.python import core
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
class TestAdadelta(seri... |
7,594 | add common params | # -*- coding: UTF-8 -*-
# Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Common code and constants"""
import argparse
import enum
import logging
import platform
from pathlib import Path
# ... |
7,595 | get moments | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from torch.autograd import grad
import pyro
import pyro.distributions as dist
from pyro import poutine
from pyro.distributions.util import is_identically_one
from pyro.infer.autoguide.initialization impo... |
7,596 | make profile image name | """
Helper functions for the accounts API.
"""
import hashlib
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.exceptions import ObjectDoesNotExist
from django.core.files.storage import get_storage_class
from openedx.core.djangoapps.site_configurat... |
7,597 | forward | """
This script provides an exmaple to wrap UER-py for C3 (a multiple choice dataset).
"""
import sys
import os
import argparse
import json
import random
import torch
import torch.nn as nn
uer_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.append(uer_dir)
from uer.embeddings import *
fr... |
7,598 | get dir | """
Thread-safe file downloading and cacheing
Authors
* Leo 2022
* Cheng Liang 2022
"""
import hashlib
import logging
import os
import shutil
import sys
import tempfile
import time
from pathlib import Path
from urllib.request import Request, urlopen
import requests
from filelock import FileLock
from tqdm import ... |
7,599 | is default | import functools
import re
from typing import Dict
from typing import Optional
from typing import Tuple
from xsdata.models.enums import Namespace
from xsdata.utils import text
__uri_ignore__ = ("www", "xsd", "wsdl")
URI_REGEX = re.compile(
r"^(([a-zA-Z][0-9a-zA-Z+\\-\\.]*:)?"
r"/{0,2}[0-9a-zA-Z;/?:@&=+$\\.\\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.