id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
13,500 | test gen solarpanel tileset no solarpanel | """
# Author: qhouyee, picas9dan #
A test suite for the agent.ifc2tileset.tile_helper submodule.
"""
# Standard library imports
import os
# Third-party import
import numpy as np
import pytest
# Self imports
from agent.ifc2tileset.tile_helper import gen_solarpanel_tileset, gen_sewagenetwork_tileset, jsonwriter, comp... |
13,501 | build flow | #!/usr/bin/env python
r"""
Phonons + dynamical quadrupoles
===============================
This example shows how to compute the dynamical matrix of GaP on a user-defined q-mesh
including Born effective charges, the macroscopic dielectric matric and the dynamical quadrupoles Q*.
The final results (out_DDB, out_DVDB) w... |
13,502 | fail | import json
import logging
from buildtest.scheduler.job import Job
from buildtest.utils.command import BuildTestCommand
logger = logging.getLogger(__name__)
class PBSJob(Job):
"""The PBSJob models a PBS Job with helper methods to retrieve job state, check if job is running/pending/suspended. We have methods
... |
13,503 | name | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
13,504 | maybe collect | """
runtime.py
"""
from __future__ import print_function
import cStringIO
import sys
from pylib import collections_
try:
import posix_ as posix
except ImportError:
# Hack for tangled dependencies.
import os
posix = os
from typing import Tuple, Dict, Optional, Any
# For conditional translation
CPP = ... |
13,505 | make company | from urllib.parse import urljoin, urlencode
from normality import collapse_spaces, slugify
from zavod import Context
from zavod import helpers as h
CACHE_DAYS = 14
COUNTRY = "md"
relationships = dict()
def parse_date(text):
return h.parse_date(text, ["%d.%m.%Y"])
def crawl_entity(context: Context, relative_u... |
13,506 | get rif port map | """
Bridge/Port mapping utility library.
"""
from swsscommon import swsscommon
import re
SONIC_ETHERNET_RE_PATTERN = "^Ethernet(\d+)$"
"""
Ethernet-BP refers to BackPlane interfaces
in multi-asic platform.
"""
SONIC_ETHERNET_BP_RE_PATTERN = "^Ethernet-BP(\d+)$"
SONIC_VLAN_RE_PATTERN = "^Vlan(\d+)$"
SONIC_PORTCHANNEL_... |
13,507 | test apply without fv inference | import os
import tempfile
from datetime import datetime, timedelta
from feast.driver_test_data import (
create_driver_hourly_stats_df,
create_global_daily_stats_df,
)
from tests.utils.basic_read_write_test import basic_rw_test
from tests.utils.cli_repo_creator import CliRunner, get_example_repo
def METHOD_NA... |
13,508 | convert version | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Collection of host system information including software versions, memory,
storage, and database configuratio... |
13,509 | set output quant fp at |
from collections import defaultdict
from nndct_shared.utils import NndctDebugLogger, NndctOption
class TensorwiseQuantInfo(object):
def __init__(self, bw, fp=None) -> None:
self._bw = bw
self._fp = fp
def get_bw_fp(self):
return self._bw, self._fp
class QuantConfig(object):
def __init__(self, bw... |
13,510 | assert tensor equal | # 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 argparse
import unittest
import tests.utils as test_utils
import torch
from fairseq.sequence_scorer import SequenceScorer
class Test... |
13,511 | test policy with neural boltzmann gumbel | # 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... |
13,512 | deco | """
Misc data models for tutorials.
"""
import abc
import asyncio
import textwrap
from cogs5e.models.embeds import EmbedWithAuthor
class Tutorial(abc.ABC):
"""
Base class for all tutorials. Each tutorial should subclass this class, and use the @state decorator to
register states.
"""
name = None... |
13,513 | test vec | __author__ = "Dilawar Singh"
__copyright__ = "Copyright 2019-, Dilawar Singh"
__maintainer__ = "Dilawar Singh"
__email__ = "dilawars@ncbs.res.in"
import moose
if moose._moose.__generated_by__ != "pybind11":
print("These bindings are not generated by pybind11.")
quit(0)
import random
import numpy as... |
13,514 | make nrc | import netrc, os, unittest, sys, textwrap
from test import test_support
temp_filename = test_support.TESTFN
class NetrcTestCase(unittest.TestCase):
def tearDown(self):
os.unlink(temp_filename)
def METHOD_NAME(self, test_data):
test_data = textwrap.dedent(test_data)
mode = 'w'
... |
13,515 | build additional features | import torch
import torch.nn as nn
from torchvision.models.resnet import resnet18, resnet34, resnet50, resnet101, resnet152
from torch.nn.parallel import DistributedDataParallel as DDP
class ResNet(nn.Module):
def __init__(self, backbone='resnet50'):
super().__init__()
if backbone == 'resnet18':
... |
13,516 | test time normalize | # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
"""Test util time functions."""
import random
import time
import unittest
fr... |
13,517 | test valid private channel selected | import pytest
import responses
from sentry.integrations.slack.utils import get_channel_id
from sentry.integrations.slack.utils.channel import CHANNEL_PREFIX, MEMBER_PREFIX
from sentry.shared_integrations.exceptions import ApiRateLimitedError, DuplicateDisplayNameError
from sentry.testutils.cases import TestCase
from s... |
13,518 | match | # don't import any costly modules
import sys
import os
is_pypy = '__pypy__' in sys.builtin_module_names
def warn_distutils_present():
if 'distutils' not in sys.modules:
return
if is_pypy and sys.version_info < (3, 7):
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
... |
13,519 | wmi query from client | #!/usr/bin/env python
"""Windows specific actions.
Most of these actions share an interface (in/out rdfvalues) with linux actions
of the same name. Windows-only actions are registered with the server via
libs/server_stubs.py
"""
import binascii
import logging
import pythoncom
import win32api
import win32com.client
i... |
13,520 | train forward | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
13,521 | set up | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complia... |
13,522 | encode outputs | import pandas as pd
import numpy as np
from typing import Optional, Any, List, Tuple
from .base import RequestCodec, register_request_codec
from .numpy import to_datatype, to_dtype, convert_nan
from .string import encode_str, StringCodec
from .utils import get_decoded_or_raw, InputOrOutput, inject_batch_dimension
fro... |
13,523 | close | # -*- 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... |
13,524 | test correct response | import json
from model_bakery import baker
from rest_framework import status
from usaspending_api.common.helpers.generic_helper import get_time_period_message
from usaspending_api.search.tests.data.search_filters_test_data import non_legacy_filters
from usaspending_api.search.tests.data.utilities import setup_elastic... |
13,525 | open plist | #--------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU ... |
13,526 | dependency met | """
Contains `ProgramRestrictions` and relevant sub-classes
"""
from abc import ABC, abstractmethod
from typing import List, Optional, Tuple
from algorithms.objects.categories import Category
from algorithms.objects.conditions import Condition
from algorithms.objects.helper import Logic
from algorithms.objects.user i... |
13,527 | inner | #!/usr/bin/env python3
import configparser
import contextlib
import json
import logging
import subprocess
import sys
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from http.server import BaseHTTPRequestHandler, HTTPServer
from typing import Dict, List, Mapping, Optional, Protoco... |
13,528 | test unwired ports warnings | import magma as m
from magma.testing import check_files_equal
import logging
import pytest
import coreir
class And2(m.Circuit):
name = "And2"
io = m.IO(I0=m.In(m.Bit), I1=m.In(m.Bit), O=m.Out(m.Bit))
@pytest.mark.parametrize("target,suffix",
[("verilog", "v"), ("coreir", "json")])
d... |
13,529 | get self bleu2 geometric | # 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 numpy as np
import nltk
from misc.bleu_utils import sentence_bleu
import warnings
def get_target_sequences(manifest, ground_truth, to... |
13,530 | size | """
torch.distributed utils
"""
from __future__ import annotations
import itertools
from typing import Optional
import os
import socket
from contextlib import contextmanager
import torch
from torch.distributed.algorithms.join import Join
from returnn.config import Config
import returnn.frontend as rf
class Distrib... |
13,531 | customise common | import FWCore.ParameterSet.Config as cms
def METHOD_NAME(process):
#####################################################################################################
####
#### Top level replaces for handling strange scenarios of early collisions
####
## TRACKING:
## Skip events with H... |
13,532 | collect sdist files | """Verify the contents of the built sdist and wheel."""
from __future__ import annotations
import contextlib
import fnmatch
import os
import pathlib
import shutil
import subprocess
import sys
import tarfile
import tempfile
import typing as t
import zipfile
from ansible.release import __version__
def METHOD_NAME(com... |
13,533 | get node label | import os.path
import shutil
from tkinter import messagebox
from typing import Any, Dict, Optional
from thonny import get_runner, get_shell, get_workbench
from thonny.common import ImmediateCommand, ToplevelCommand
from thonny.plugins.backend_config_page import BaseSshProxyConfigPage, get_ssh_password
from thonny.runn... |
13,534 | check io tune categories | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
from __future__ import division
import itertools
import logging
from vdsm import utils
from vdsm.virt import vmxml
log = logging.getLogger('virt.vmtune')
def io_tune_values_to_dom(values, dom... |
13,535 | get clipfilename | import json
import shutil
from pathlib import Path
from typing import Optional, Any
from timApp.auth.accesshelper import can_see_par_source
from timApp.document.docparagraph import DocParagraph, is_real_id
from timApp.document.document import Document
from timApp.document.documentparser import DocumentParser
from timA... |
13,536 | query parameters | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
13,537 | test unsupported np types | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
13,538 | mkdir | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
13,539 | patch optimizer param group | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from __future__ import annotations
import logging
from typing import List, Dict, overload
import torch
from torch import Tensor
from ..base.compressor import Compressor, Quantizer
from ..base.wrapper import ModuleWrapper
from ..utils import Eva... |
13,540 | thread body | """Batching file prepare requests to our API."""
import concurrent.futures
import functools
import os
import queue
import shutil
import threading
from typing import TYPE_CHECKING, NamedTuple, Optional, Union, cast
from wandb.filesync import step_upload
from wandb.sdk.lib import filesystem, runid
from wandb.sdk.lib.pa... |
13,541 | schedule nms | # 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... |
13,542 | copy | from typing import Optional
import logging
from . import MemoryMixin
from ...errors import SimMemoryLimitError, SimMemoryError, SimUnsatError
l = logging.getLogger(__name__)
class SizeNormalizationMixin(MemoryMixin):
"""
Provides basic services related to normalizing sizes. After this mixin, sizes will alwa... |
13,543 | 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... |
13,544 | get module | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from argparse import Namespace
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.utils.data
import t... |
13,545 | on take control | from qtpy import QtWidgets, QtCore
from openpype.tools.utils.delegates import pretty_date
class BaseInfoDialog(QtWidgets.QDialog):
width = 600
height = 400
def __init__(self, message, title, info_obj, parent=None):
super(BaseInfoDialog, self).__init__(parent)
self._result = 0
sel... |
13,546 | location | # 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... |
13,547 | find default | # file: transformers.py
#===============================================================================
# Copyright 2019 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
#
#... |
13,548 | tint | #
# Part of p5: A Python package based on Processing
# Copyright (C) 2017-2019 Abhik Pal
#
# 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) ... |
13,549 | test drop | import dask.dataframe as dd
from dagster import file_relative_path
from dagster._core.definitions.decorators import op
from dagster._core.definitions.input import In
from dagster._utils.test import wrap_op_in_graph_and_execute
from dagster_dask import DataFrame
@op(ins={"input_df": In(DataFrame)})
def passthrough(_, ... |
13,550 | test asm request context manager | import pytest
from ddtrace.appsec import _asm_request_context
from tests.utils import override_global_config
_TEST_IP = "1.2.3.4"
_TEST_HEADERS = {"foo": "bar"}
def test_context_set_and_reset():
with override_global_config({"_appsec_enabled": True}):
with _asm_request_context.asm_request_context_manage... |
13,551 | add transit links | from __future__ import annotations
import heapq
import math
from collections import defaultdict
from dataclasses import dataclass, field
from enum import Enum, auto
from typing import Dict, Iterator, List, Optional, Set, Tuple
from .conflicttheater import ConflictTheater
from .controlpoint import ControlPoint
class... |
13,552 | add illustrator | """
Create a edition dict that can be passed to catalog.add_book.load()
This class encapsulates the logic of creating edition dicts.
You can use add(key) to add a new key to the edition dict. This class
will take care of whether it should be a string or a list. For example,
you can use add('subject') to add an entry ... |
13,553 | required deps | ##
# Copyright 2009-2023 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
13,554 | aggregate | # Adopted from https://github.com/Limingxing00/RDE-VOS-CVPR2022
# under MIT License
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from modelscope.models.cv.video_object_segmentation.modules import (
KeyEncoder, KeyProjection, MemCrompress, ResBlock, UpsampleBlock,
ValueEncode... |
13,555 | test simple state updates | import unittest
import threading
import socket
import select
import subprocess
import logging
import time
import sys
from google.protobuf.message import DecodeError
from manticore.core.state_pb2 import StateList, State, MessageList
from pathlib import Path
PYTHON_BIN: str = sys.executable
HOST = "localhost"
PORT = ... |
13,556 | set limits | from typing import Any
from dagster_graphql.test.utils import execute_dagster_graphql
from .graphql_context_test_suite import GraphQLContextVariant, make_graphql_context_test_suite
INSTANCE_QUERY = """
query InstanceDetailSummaryQuery {
instance {
runQueuingSupported
hasInfo
}
}
"""
GET_CONC... |
13,557 | identity op | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# 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 derivat... |
13,558 | generate nxos acl | from ipaddress import ip_address
def generate_acl(
acl_name="netmiko_test_large_acl",
entries=100,
base_cmd="ip access-list extended",
base_addr="192.168.0.0",
):
cmd = f"{base_cmd} {acl_name}"
acl = [cmd]
for i in range(1, entries + 1):
addr = ip_address(base_addr)
cmd = f... |
13,559 | register unavailable formatter | # Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
13,560 | test ellipsoid sign parameters3 | import numpy as np
from skimage._shared.testing import assert_array_equal, assert_allclose
from skimage.draw import ellipsoid, ellipsoid_stats, rectangle
from skimage._shared import testing
def test_ellipsoid_sign_parameters1():
with testing.raises(ValueError):
ellipsoid(-1, 2, 2)
def test_ellipsoid_si... |
13,561 | get payment status | import asyncio
import hashlib
from typing import AsyncGenerator, Dict, Optional
import httpx
from loguru import logger
from lnbits.settings import settings
from .base import (
InvoiceResponse,
PaymentResponse,
PaymentStatus,
StatusResponse,
Wallet,
)
class LNPayWallet(Wallet):
"""https://do... |
13,562 | function b | """
Units tests for the calculation schemas registered by
`evaluator.properties`.
"""
from collections import OrderedDict
import pytest
import openff.evaluator.properties
from openff.evaluator.layers import registered_calculation_schemas
from openff.evaluator.layers.workflow import WorkflowCalculationSchema
from open... |
13,563 | nontrivial map | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... |
13,564 | interleaved | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
13,565 | get data | """Script to create a snapshot of dataset 'World Bank Education Statistics (2023)'."""
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
from time import sleep
import click
import pandas as pd
import requests
import world_bank_data as wb
from owid.datautils.io import df_to_file
from tqdm impo... |
13,566 | tags | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ ... |
13,567 | access value | import abc
import sys
from collections import UserString
from contextlib import contextmanager
from decimal import Decimal
from types import FrameType
from typing import Any, Generic, Iterator, Optional, Type, TypeVar, cast, no_type_check
from mode.utils.locals import LocalStack
from faust.exceptions import SecurityE... |
13,568 | test topdown | # Copyright (c) OpenMMLab. All rights reserved.
from unittest import TestCase
import numpy as np
from mmpose.datasets.datasets.hand import OneHand10KDataset
class TestOneHand10KDataset(TestCase):
def build_onehand10k_dataset(self, **kwargs):
cfg = dict(
ann_file='test_onehand10k.json',
... |
13,569 | read log | import datetime
import os
from typing import List, Dict, Union
import jinja2.exceptions
from flask import request, redirect, url_for, render_template, Response, session, abort, send_from_directory
from pony.orm import count, commit, db_session
from worlds.AutoWorld import AutoWorldRegister
from . import app, cache
fr... |
13,570 | thread pointer | """
This module is used when parsing the Thread Local Storage of an ELF binary. It heavily uses the TLSArchInfo
namedtuple from archinfo.
ELF TLS is implemented based on the following documents:
- https://www.uclibc.org/docs/tls.pdf
- https://www.uclibc.org/docs/tls-ppc.txt
- https://www.uclibc.org/docs/t... |
13,571 | test state average mix external fcisolver | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
13,572 | test thumbnail filename | from django.test import tag, override_settings
from django.utils import translation
from tests.BaseTestWithDB import BaseTestWithDB
from resources.utils.get_thumbnail import (
get_thumbnail_filename,
get_thumbnail_base,
get_thumbnail_static_path_for_resource,
)
from tests.resources.ResourcesTestDataGenerato... |
13,573 | test variable encoding | from http import client
import json
import pytest
import re
def assert_items_equal(x, y):
assert set(x) == set(y)
GITHUB_URL_REGEX = r"^https://github\.com/openfisca/country-template/blob/\d+\.\d+\.\d+((.dev|rc)\d+)?/openfisca_country_template/variables/(.)+\.py#L\d+-L\d+$"
# /variables
@pytest.fixture(scop... |
13,574 | test already signed in | from django.conf import settings as django_settings
from django.contrib import auth
from django.contrib.auth import authenticate
from django.contrib.auth.models import AnonymousUser
from django.shortcuts import resolve_url
from wiki.conf import settings as wiki_settings
from wiki.models import reverse
from ..base impo... |
13,575 | test wait read invalid switch | # Copyright (c) 2008 AG Projects
# Author: Denis Bilenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... |
13,576 | gray2pseudo color | # coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... |
13,577 | assert matches rows | import pytest
import hail as hl
def unless(test: bool, kvs):
return {} if test else kvs
class TestData():
globals={'hello': 'world'}
rows={'foo': ['a', 'b']}
cols={'bar': ['c', 'd']}
entries={'baz': [[1, 2], [3, 4]]}
@staticmethod
def assert_matches_globals(mt: 'hl.MatrixTable', no_props... |
13,578 | check pid | import os
import pytest
import asyncio
import numpy as np
from mlserver.errors import MLServerError
from mlserver.model import MLModel
from mlserver.settings import Settings
from mlserver.types import InferenceRequest
from mlserver.codecs import NumpyCodec, StringCodec
from mlserver.parallel.pool import InferencePool
... |
13,579 | get atom | # -*- coding: utf-8 -*-
"""This module defines classes for handling residues."""
from .subset import AtomSubset
from .atom import Atom
__all__ = ['Residue']
class Residue(AtomSubset):
"""Instances of this class point to atoms with same residue numbers (and
insertion codes) and are generated by :class:`.Hier... |
13,580 | check shots tally | import unittest
from unittest.mock import Mock
import json
import numpy as np
import pytest
import subprocess
import openqaoa
from openqaoa_azure.backends import DeviceAzure
from openqaoa.qaoa_components import (
create_qaoa_variational_params,
PauliOp,
Hamiltonian,
QAOADescriptor,
QAOAVariationalS... |
13,581 | set key | import base64
import hashlib
from io import BytesIO
import logging
from django.contrib.auth.models import User
from rest_framework.parsers import BaseParser
from rest_framework.exceptions import ParseError
from lxml import etree
from course.models import Enrollment
from exercise.exercise_models import LTIExercise
l... |
13,582 | with clause | from hypothesis.strategies import (
composite,
SearchStrategy,
lists,
sampled_from,
builds,
just,
integers,
booleans,
tuples,
)
from resotocore.model.graph_access import EdgeTypes, Direction
from tests.resotocore.hypothesis_extension import Drawer, optional, UD, any_string, any_date... |
13,583 | test run matching vary parameter | import pytest
import numpy as np
import pandas as pd
import shutil
import os
from pathlib import Path
import spikeinterface.core as sc
import spikeinterface.extractors as se
import spikeinterface.preprocessing as spre
from spikeinterface.sortingcomponents.benchmark import benchmark_matching
@pytest.fixture(scope="se... |
13,584 | run | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import sys
import os
import time
import syslog
from platform_util import get_value, set_value, exec_os_cmd, wb_os_system
from platform_config import REBOOT_CAUSE_PARA
REBOOT_CAUSE_DEBUG_FILE = "/etc/.reboot_cause_debug"
REBOOT_CAUSE_STARTED_FLAG = "/tmp/.reboot_cause_started_... |
13,585 | set exception | from __future__ import annotations
from http import HTTPStatus
import logging
from contextlib import suppress
from os import getgid, getuid
from pathlib import Path
import docker
import requests
from docker.errors import APIError, DockerException
from docker.types import Mount
from requests.adapters import HTTPAdapte... |
13,586 | process report | #
# isafw.py - Main classes for ISA FW
#
# Copyright (c) 2015 - 2016, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# ... |
13,587 | angle changed | import os
from traitlets import Bool, Unicode, observe
from glue_jupyter.common.toolbar_vuetify import read_icon
from jdaviz.configs.imviz.wcs_utils import get_compass_info
from jdaviz.core.custom_traitlets import FloatHandleEmpty
from jdaviz.core.events import AddDataMessage, RemoveDataMessage, CanvasRotationChanged... |
13,588 | write log | import os
import shlex
# importing image for python commands in DDL scripts
import signal
import time
from subprocess import Popen
import psutil
from .error import VirtualEnvError
# -----------------------------------------------------------------------------
class IPOLTimeoutError(Exception):
def __init__(se... |
13,589 | erase | ### Generic lowlevel ESP and espeasy per-node stuff.
### Used for things like flashing, serial communication, resetting, wificonfig, http communication
import serial
import sys
import time
import subprocess
import wificonfig
import requests
import serial.tools.miniterm
import re
from espcore import *
class Node():
... |
13,590 | test fsspec compressed | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Can `astropy.io.fits.open` access (remote) data using the fsspec package?
"""
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from astropy.io import fits
from astropy.nddata import Cutout2D
from astropy.ut... |
13,591 | parse object | from typing import List, Dict, Optional
from enum import Enum
import asyncio, re, os, logging
from rich.logging import RichHandler
from rich.console import Console
from rich.theme import Theme
DEFAULT_RICH_CONSOLE_THEME = Theme(
{
"task_name": "magenta",
"sim_name": "blue",
"log": "green",
... |
13,592 | update zigate ieee | # !/usr/bin/env python3
# coding: utf-8 -*-
#
# Author: pipiche38
#
# This is the Version 2 of Zigate Plugin Group Management.
#
# The aim of this Class is to be able to manage groups as they were in the previous version,
# but also to have instant groupmembership provisioning instead of the batch approach of the p... |
13,593 | render template | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
def get_jenv():
import frappe
if not getattr(frappe.local, "jenv", None):
from jinja2 import DebugUndefined
from jinja2.sandbox import SandboxedEnvironment
from frappe.utils.safe_exec import UNSAFE_ATTRIBUTES, get... |
13,594 | apptrace start | # Copyright 2020 Espressif Systems (Shanghai) PTE LTD
#
# 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 ... |
13,595 | test vector line | #!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... |
13,596 | test multiple backslash | import unittest
from robot.utils.asserts import assert_equal
from robot.utils.escaping import escape, unescape, split_from_equals
def assert_unescape(inp, exp):
assert_equal(unescape(inp), exp, repr(inp))
class TestUnEscape(unittest.TestCase):
def test_no_backslash(self):
for inp in ['no escapes',... |
13,597 | test event get status recovers after error | # pylint:disable=redefined-outer-name
# pylint:disable=unused-argument
import asyncio
import logging
from collections.abc import Iterable
from typing import Final
import pytest
from fastapi import FastAPI
from pydantic import PositiveFloat, PositiveInt
from pytest_mock import MockerFixture
from pytest_simcore.helpers... |
13,598 | remove selected traces | from typing import TYPE_CHECKING, Any, Optional
from PySide6.QtCore import QAbstractTableModel, QSize, Qt
from PySide6.QtWidgets import QAbstractItemView, QHeaderView, QMenu, QTableView, QVBoxLayout
from .view import BaseView
if TYPE_CHECKING:
import PySide6
from angrmanagement.data.trace import Trace
cla... |
13,599 | read input and confirm | #!/usr/bin/env python3
"""Provisions gripper EEPROMs.
This can be used either on a production line or locally.
A log of what has been flashed to pipettes can be found at
provision_gripper.log.
"""
import asyncio
import logging
import logging.config
import argparse
import datetime
from typing import Tuple
from opent... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.