id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
15,200
test get pygments style
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. import pytest import sphinx import pygments from pygme...
15,201
handler
# vimode -- Vi Mode package for QPlainTextEdit # # Copyright (c) 2012 by Wilbert Berendsen # # 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 option...
15,202
run
# COPYRIGHT (C) 2020-2023 Nicotine+ Contributors # # 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 Software Foundation, either version 3 of the License, or...
15,203
remove
#!/usr/bin/env python3 # 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. from typing import List from typing import Optional import urllib.parse from .base_api_resource import BaseAPIResource ...
15,204
parse
from datetime import datetime import time import warnings from lxml import etree as ET from osc import conf from osc.core import makeurl from osc.core import http_GET from osc.core import http_POST from urllib.error import HTTPError class OBSLock(object): """Implement a distributed lock using a shared OBS resou...
15,205
store
#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np import sys from math import * import json import os import csv def data_cpu(name_demo, iteration, ii): cpu = [0]*iteration memory = [0]*iteration i = 0 j = 0 a = name_demo nb = len(name_demo) while i != iteration*ii...
15,206
haversine adapted
from math import radians from typing import Dict import numpy as np from scipy.spatial.distance import pdist from sklearn.metrics.pairwise import haversine_distances from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.execution_engine import ExecutionEngine, ...
15,207
test bootstrap consensus msa
# Copyright (C) 2013 by Yanbo Ye (yeyanbo289@gmail.com) # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Unit tests for the Bio.Phylo.Consensus module.""" import os import unittest import tempfile ...
15,208
admin time
import re import time from datetime import datetime # pylint: disable=E0611 import pytz from django.contrib import messages from django.http import Http404 from django.utils import timezone from django.utils.translation import gettext_lazy as _ from oioioi.base.utils import request_cached from oioioi.base.utils.redi...
15,209
set tz
#!/usr/bin/env python data = { "default_prefix": "OSVC_COMP_TIMEDATECTL_", "example_value": """ { "timezone": "Europe/Paris", "ntpenabled": "no" } """, "description": """* Checks timedatectl settings * Module need to be called with the exposed target settings as variable (timedatectl.py OSV...
15,210
main
import sys import subprocess import os import collections import re import tempfile def is_clang(command): for word in command: if '--compiler-bindir' in word and 'clang' in word: return True return False def METHOD_NAME(): try: sys.argv.remove('--y_skip_nocxxinc') s...
15,211
test axis out of negative range
# 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...
15,212
datadir
# # Fastpath - event detector unit tests # from datetime import datetime from pathlib import Path import json import bottle import pytest import detector.detector as dt import detector.detector_webapp as webapp bottle.TEMPLATE_PATH.insert(0, "detector/views") data = Path("detector/tests/data") def METHOD_NAME(p)...
15,213
test getitem for non existant entry
# -*- coding: utf-8 -*- # BSD 3-Clause License # # Copyright (c) 2020-2023, Faster Speeding # All rights reserved. # # 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 abo...
15,214
download file
import datetime as dt import json import os import tempfile from collections import defaultdict from io import BytesIO from pathlib import Path from typing import Any, Dict, List import numpy as np import pandas as pd import requests import yaml from structlog import get_logger from owid.walden import add_to_catalog ...
15,215
load
# LocalStack Resource Provider Scaffolding v2 from __future__ import annotations from pathlib import Path from typing import Optional, Type, TypedDict import localstack.services.cloudformation.provider_utils as util from localstack.services.cloudformation.resource_provider import ( CloudFormationResourceProviderP...
15,216
get session stats
from marshmallow_jsonapi import fields from marshmallow_jsonapi.flask import Schema from sqlalchemy import distinct, func from app.api.helpers.cache import cache from app.api.helpers.utilities import dasherize from app.models.session import Session from app.models.speaker import Speaker from app.models.sponsor import ...
15,217
dict list map outplace
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. """ Utilities for operating with dicts and lists. """ from collections import defaultdict from typing import Any, Callable, Iterable, Optional, Tuple, Union import torch def extract_matching_values( x: Union[dict, list], predicate: Callable )...
15,218
test include stacktrace when no tb
import json import os import Queue import sys import StringIO import cyclone.web import twisted.internet import twisted.trial.unittest from mock import Mock, patch from twisted.internet import reactor from twisted.internet.defer import Deferred from twisted.logger import Logger from twisted.python import failure fro...
15,219
init temporal distance
# Original work Copyright (c) Facebook, Inc. and its affiliates. # Modified work Copyright (c) Allen Institute for AI # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Several of the models defined in this file are modified versions of those f...
15,220
add unexpected success
"""Running tests""" import sys import time from . import result from .signals import registerResult __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream def __getattr__(self, at...
15,221
convergence eval
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES). # # Copyright (c) 2018-2023 by the software own...
15,222
create multiapart request
# -*- 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. # -------------------------------------------------------------...
15,223
target
from __future__ import absolute_import, division, print_function from six.moves import range from scitbx.array_family import flex class ccp4_model(object): """Implement a sigma correction for semi-datasets, inspired by the classic treatment of SDFAC, SDB, SDADD as discussed by Phil Evans; Evans (2011) Acta ...
15,224
get
from collections import defaultdict from rest_framework import status from rest_framework.request import Request from rest_framework.response import Response from sentry import features from sentry.api.api_publish_status import ApiPublishStatus from sentry.api.base import region_silo_endpoint from sentry.api.exceptio...
15,225
export
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import itertools import os from dataclasses import dataclass from typing import Iterable, Mapping, Sequence, cast from pants.base.build_root import Bui...
15,226
should use facing
import time from utils.ConfigManager import config from utils.constants.MiscCodes import MoveType, ScriptTypes, MoveFlags, ObjectTypeIds from database.world.WorldDatabaseManager import WorldDatabaseManager from game.world.managers.objects.units.movement.helpers.MovementWaypoint import MovementWaypoint from game.world....
15,227
showtraceback
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license """ Run commands when the Scapy interpreter starts. """ from __future__ import print_function import code import sys import i...
15,228
pages per day
import time from collections import defaultdict from datetime import date from datetime import timedelta from functools import partial from typing import Any from typing import Dict from typing import List from django.http import HttpRequest from django.http import HttpResponse from django.shortcuts import render from...
15,229
set up class
"""Tests for the asdl parser in Parser/asdl.py""" import importlib.machinery import importlib.util import os from os.path import dirname import sys import sysconfig import unittest # This test is only relevant for from-source builds of Python. if not sysconfig.is_python_build(): raise unittest.SkipTest('test irr...
15,230
copy object response
# Copyright 2015 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 acc...
15,231
test javascript
from django.urls import reverse from sentry.models.groupinbox import GroupInbox from sentry.testutils.cases import APITestCase from sentry.testutils.silo import region_silo_test from sentry.utils import json @region_silo_test(stable=True) class ProjectCreateSampleTest(APITestCase): def setUp(self): self....
15,232
set worker message
import qgis.gui from qgis.core import Qgis from qgis.PyQt import QtCore from qgis.PyQt.QtCore import QCoreApplication from qgis.PyQt.QtCore import QEventLoop from qgis.PyQt.QtCore import Qt from qgis.PyQt.QtCore import QThread from qgis.PyQt.QtWidgets import QProgressBar from qgis.PyQt.QtWidgets import QPushButton from...
15,233
request respond
from builtins import range from io import StringIO from io import BytesIO from pycurl import * class RequestManager: """Manager of multiple concurrent or overlapping HTTP requests. This is a utility class acting as a pump of several overlapping HTTP requests against any number of HTTP or HTTPS servers. It uses a co...
15,234
java compile for protos
# Copyright 2022 The Bazel 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 la...
15,235
extract data
# 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...
15,236
func
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
15,237
annotate resource
#!/usr/bin/python2.7 # Copyright 2012 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 requi...
15,238
test find affiliation by org id and
# Copyright © 2019 Province of British Columbia # # 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...
15,239
get mmax
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (C) 2010-2023 GEM Foundation, G. Weatherill, M. Pagani, D. Monelli # # The Hazard Modeller's Toolkit (openquake.hmtk) is free software: you can # redistribute # it and/or modify it under the terms of the GNU Affero General Pu...
15,240
quantize check
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
15,241
fn
import os import sys from unittest.mock import MagicMock import pytest from lightning_cloud.openapi import ( Externalv1LightningappInstance, V1LightningappInstanceArtifact, V1ListCloudSpacesResponse, V1ListLightningappInstanceArtifactsResponse, V1ListLightningappInstancesResponse, V1ListMembers...
15,242
test distance function
#!/usr/bin/env python3 # # Tests the annulus distribution. # # This file is part of PINTS (https://github.com/pints-team/pints/) which is # released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # import pints import pints.toy import unittest import numpy a...
15,243
config me
from enum import Enum as PythonEnum import pytest from dagster import ( DagsterInvalidConfigError, DagsterInvalidDefinitionError, Enum, EnumValue, Field, GraphDefinition, Int, job, op, ) from dagster._config import Enum as ConfigEnum from dagster._config.validate import validate_con...
15,244
job id
# This code is part of Qiskit. # # (C) Copyright IBM 2017. # # 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...
15,245
on checkpoint load start
from typing import Any, Dict, List, Optional class PyTorchCallback: """ Abstract base class used to define a callback that should execute during the lifetime of a PyTorchTrial or DeepSpeedTrial. .. warning:: If you are defining a stateful callback (e.g., it mutates a ``self`` attribut...
15,246
artifact source id
# 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__ ...
15,247
test file arg
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from textwrap import dedent from pants.testutil.pants_integration_test import PantsResult, run_pants, setup_tmpdir from pants.testutil.python_interpret...
15,248
get driver log url
# Copyright (c) 2015 aggftw@gmail.com # Distributed under the terms of the Modified BSD License. import sparkmagic.utils.configuration as conf import sparkmagic.utils.constants as constants from sparkmagic.utils.sparklogger import SparkLog from .sessionmanager import SessionManager from .livyreliablehttpclient import ...
15,249
extract fixture data
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import math import numpy as np import torch from torch.distributions.utils import logits_to_probs from pyro.distributions.util import broadcast_shape SINGLE_TEST_DATUM_IDX = [0] BATCH_TEST_DATA_IDX = [-1] class Fixture: de...
15,250
output
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
15,251
test filter string
# 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....
15,252
display html
import html import os from os.path import realpath, join, dirname import sys import time import warnings import webbrowser import jinja2 from ..frontend_semver import DECKGL_SEMVER def in_jupyter(): try: ip = get_ipython() # noqa return ip.has_trait("kernel") except NameError: retu...
15,253
write config
#!/usr/bin/env python3 # Does a bridge resend a QoS=1 message correctly after a disconnect? from mosq_test_helper import * def METHOD_NAME(filename, port1, port2, protocol_version): with open(filename, 'w') as f: f.write("port %d\n" % (port2)) f.write("allow_anonymous true\n") f.write("\n...
15,254
json rpc
import base64 import json import requests import random import time from transaction import ( sign_payment_tx, sign_deploy_contract_tx, sign_function_call_tx, sign_create_account_with_full_access_key_and_balance_tx, sign_staking_tx) from key import Key from utils import load_binary_file from configured_logger ...
15,255
get survey id
# -*- coding: utf-8 -*- # SDAPS - Scripts for data acquisition with paper based surveys # Copyright(C) 2008, Christoph Simon <post@christoph-simon.eu> # Copyright(C) 2008,2011, Benjamin Berg <benjamin@sipsolutions.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
15,256
clean file
import os import tempfile import textwrap from zipfile import BadZipFile, ZipFile from django import forms from django.contrib import messages from django.contrib.gis import admin from django.contrib.gis.forms import MultiPolygonField, OSMWidget from django.contrib.gis.gdal import DataSource from django.contrib.gis.ge...
15,257
ifft
#!/usr/bin/env python # /*########################################################################## # # Copyright (c) 2018-2019 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software")...
15,258
seek
import re import pathlib from typing import IO import numpy.typing as npt import numpy as np str_path: str pathlib_path: pathlib.Path str_file: IO[str] bytes_file: IO[bytes] bag_obj: np.lib.npyio.BagObj[int] npz_file: np.lib.npyio.NpzFile AR_i8: npt.NDArray[np.int64] AR_LIKE_f8: list[float] class BytesWriter: ...
15,259
test a matrix general
import numpy as np import pytest from IPython.core.formatters import format_display_data from glotaran.builtin.megacomplexes.decay.k_matrix import KMatrix from glotaran.builtin.megacomplexes.decay.k_matrix import calculate_gamma from glotaran.model.item import fill_item from glotaran.parameter import Parameters clas...
15,260
mfem
class MultiFieldSolverDefinitionCommands: def mfcmmand(self, fnumb="", fname="", ext="", **kwargs): """Captures field solution options in a command file. APDL Command: MFCMMAND Parameters ---------- fnumb Field number specified by the MFELEM command. fn...
15,261
objective func
# 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...
15,262
setup once
from __future__ import absolute_import from sentry_sdk import Hub from sentry_sdk.consts import OP, SPANDATA from sentry_sdk.integrations import Integration, DidNotEnable from sentry_sdk.tracing import Span from sentry_sdk._functools import partial from sentry_sdk._types import TYPE_CHECKING from sentry_sdk.utils imp...
15,263
gen file
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
15,264
res net50
'''ResNet in PyTorch. For Pre-activation ResNet, see 'preact_resnet.py'. Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 ''' import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): expansi...
15,265
build
from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.33.0" class GameNetworkingSocketsConan(ConanFile): name = "gamenetworkingsockets" description = "GameNetworkingSockets is a basic transport layer for games." topics = ("n...
15,266
expected no right pipette values
"""Tests for the emulation_pipette_provision script.""" import json import os from typing import Any, Generator, Tuple import pytest from opentrons_hardware.firmware_bindings.constants import PipetteName from opentrons_hardware.scripts import emulation_pipette_provision from opentrons_hardware.instruments.pipettes.seri...
15,267
test one
import pathlib import json import pytest from align.schema.pdk import LayerMetal, LayerVia, PDK my_dir = pathlib.Path(__file__).resolve().parent def METHOD_NAME(): m1 = LayerMetal( name="M1", gds_layer_number=1, direction="v", min_length=1000, min_end_to_end=400, o...
15,268
load fairseq model
#!/usr/bin/evn python3 """Build Speech Recognition pipeline based on fairseq's wav2vec2.0 and dump it to TorchScript file. To use this script, you need `fairseq`. """ import argparse import logging import os from typing import Tuple import fairseq import torch import torchaudio from greedy_decoder import Decoder from...
15,269
damage create
# Xlib.ext.damage -- DAMAGE extension module # # Copyright (C) 2018 Joseph Kogut <joseph.kogut@gmail.com> # # This library 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 version 2.1 # of the ...
15,270
generate index
""" Copyright (c) 2016-2019 ARM Limited. All rights reserved. SPDX-License-Identifier: Apache-2.0 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...
15,271
get plan
## @package predictor_py_utils # Module caffe2.python.predictor.predictor_py_utils from caffe2.python import core, scope def create_predict_net(predictor_export_meta): """ Return the input prediction net. """ # Construct a new net to clear the existing settings. net = core.Net(predictor_export_m...
15,272
test centered makekernel
# Licensed under a 3-clause BSD style license - see LICENSE.rst import itertools import numpy as np import pytest from numpy.testing import assert_allclose, assert_almost_equal from astropy import units as u from astropy.convolution.convolve import convolve, convolve_fft from astropy.convolution.kernels import ( ...
15,273
ysig vs wave
""" desispec.xytraceset =================== Lightweight wrapper class for trace coordinates and wavelength solution, to be returned by :func:`~desispec.io.xytraceset.read_xytraceset`. """ class XYTraceSet(object): def __init__(self, xcoef, ycoef, wavemin, wavemax, npix_y, xsigcoef = None, ysigcoef = None, meta = ...
15,274
conv dw
# The implementation is adopted from Pytorch_Retinaface, made pubicly available under the MIT License # at https://github.com/biubug6/Pytorch_Retinaface/tree/master/models/net.py import time import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models import torchvision.models...
15,275
test 02 multiple nodes
""" This test file tests the lib.clientapplicaton.py """ import mock from datetime import datetime, timedelta from contextlib import contextmanager from privacyidea.models import ClientApplication from .base import MyTestCase from privacyidea.lib.clientapplication import (get_clientapplication, ...
15,276
add system
import logging import requests import structlog import parsel from random import sample import re from django.test import Client from django.test import RequestFactory from siteapp.urls import urlpatterns from django.urls.exceptions import Resolver404 as Resolver404 from siteapp.models import * from guidedmodules.m...
15,277
get
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2023 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- from lib389.idm.group import UniqueGroup, UniqueGroups, MUST_ATTRIBUTES from lib389.cli_base import populate_attr_argumen...
15,278
test definition
from __future__ import division, unicode_literals, print_function, absolute_import import json import pytest import podpac from podpac.core.coordinates.coordinates import Coordinates from podpac.core.coordinates.group_coordinates import GroupCoordinates class TestGroupCoordinates(object): def test_init(self): ...
15,279
metric
# Copyright The Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
15,280
test 1orbital
#!/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...
15,281
export fire render scene
# # Copyright 2020 Advanced Micro Devices, Inc # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to i...
15,282
test ask tell
#!/usr/bin/env python3 # # Tests the API of the iRprop- optimiser. # # This file is part of PINTS (https://github.com/pints-team/pints/) which is # released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # import unittest import numpy as np import pints imp...
15,283
group results
# This file is a part of Remoulade. # # Copyright (C) 2017,2018 CLEARTYPE SRL <bogdan@cleartype.io> # # Remoulade 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 version 3 of the License, or (at ...
15,284
compose document
__all__ = ['Composer', 'ComposerError'] from .error import MarkedYAMLError from .events import * from .nodes import * class ComposerError(MarkedYAMLError): pass class Composer: def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if self.ch...
15,285
test deserialise posting and format
from __future__ import annotations import datetime from decimal import Decimal from typing import TYPE_CHECKING import pytest from beancount.core.number import MISSING from beancount.core.position import CostSpec from fava.beans import create from fava.beans.helpers import replace from fava.beans.str import to_strin...
15,286
log abs determinant
# Copyright 2016 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...
15,287
test equalto
import pytest from markupsafe import Markup from jinja2 import Environment from jinja2 import TemplateAssertionError from jinja2 import TemplateRuntimeError class MyDict(dict): pass class TestTestsCase: def test_defined(self, env): tmpl = env.from_string("{{ missing is defined }}|{{ true is defined...
15,288
get city town data
import requests import re import os import json import xml.etree.ElementTree as ET from string import ascii_uppercase ROOT_DIR = os.path.dirname(__file__) COUNTY_CODE_API = "https://api.nlsc.gov.tw/other/ListCounty" COUNTY_FILE_PATH = os.path.join(ROOT_DIR, "county.json") TOWN_CODE_API = "https://api.nlsc.gov.tw/ot...
15,289
folderitem
# -*- coding: utf-8 -*- # # This file is part of SENAITE.CORE. # # SENAITE.CORE is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, version 2. # # This program is distributed in the hope that it will be useful, bu...
15,290
test sampled repr leaves range as range
# 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...
15,291
unregister file
""" This module allows SPM to use sqlite3 as the backend for SPM's package database. .. versionadded:: 2015.8.0 """ import datetime import logging import os import sqlite3 from sqlite3 import OperationalError # Get logging started log = logging.getLogger(__name__) def init(): """ Get an sqlite3 connection...
15,292
get sap disk configurations output
# 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...
15,293
generate content blocks
import re from typing import Any, Dict, List, Mapping, Optional import markdown from markdown.extensions import Extension from markdown.preprocessors import Preprocessor from zerver.lib.markdown.priorities import PREPROCESSOR_PRIORITES START_TABBED_SECTION_REGEX = re.compile(r"^\{start_tabs\}$") END_TABBED_SECTION_R...
15,294
test username not logged in
from requests.exceptions import ConnectionError import pymacaroons import responses from flask_testing import TestCase from tests.publisher.endpoint_testing import BaseTestCases from webapp.app import create_app from webapp.authentication import get_authorization_header # Make sure tests fail on stray responses. resp...
15,295
notacommand
import os.path from unittest import mock import pytest from github.tests import Framework from azure_devtools.ci_tools.bot_framework import BotHandler, order, build_from_issue_comment, build_from_issues class BotFrameworkTest(Framework.TestCase): def setUp(self): self.maxDiff = None # Big diff to come ...
15,296
main
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import time import torch import torch.nn as nn import torch.nn.parallel from contextlib import suppress import geffnet from data import Dataset, create_loader, resolve_data_config from utils im...
15,297
test get gene id
import unittest from unittest import mock from wqflask import app from wqflask.snp_browser.snp_browser import get_gene_id from wqflask.snp_browser.snp_browser import get_gene_id_name_dict from wqflask.snp_browser.snp_browser import check_if_in_gene from wqflask.snp_browser.snp_browser import get_browser_sample_lists fr...
15,298
create vmware settings file
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # 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 la...
15,299
test colocate gridded ungridded new var
import iris import numpy as np import pandas as pd import pytest from cf_units import Unit from pyaerocom import GriddedData, const, helpers from pyaerocom.colocateddata import ColocatedData from pyaerocom.colocation import ( _colocate_site_data_helper, _colocate_site_data_helper_timecol, _regrid_gridded, ...