id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
1,900 | test testscenario object args only | #!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
__author__ = ["fkiraly"]
__all__ = []
from aeon.utils._testing.scenarios import TestScenario
class TestedMockClass:
"""Mock class to test TestScenario."""
def __init__(self, a):
self.a = a
def foo(self, b):
"""Test method for mock clas... |
1,901 | test cond acquire success | """Generic thread tests.
Meant to be used by dummy_thread and thread. To allow for different modules
to be used, test_main() can be called with the module to use as the thread
implementation as its sole argument.
"""
import dummy_thread as _thread
import time
import Queue
import random
import unittest
from test impo... |
1,902 | class gradient | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018
#
# 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
# r... |
1,903 | copy adaptive exodus test files | #pylint: disable=missing-docstring
#* 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/... |
1,904 | test init | """Test runway.cfngin.hooks.awslambda.source_code."""
# pylint: disable=protected-access, unnecessary-dunder-call
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from mock import Mock, call
from runway.cfngin.hooks.awslambda.source_code import SourceCode
if... |
1,905 | test anonymous | import platform
from unittest.mock import patch
from uuid import uuid4
import responses
import sentry
from sentry import options
from sentry.models import Broadcast
from sentry.tasks.beacon import BEACON_URL, send_beacon, send_beacon_metric
from sentry.testutils.cases import TestCase
from sentry.testutils.silo import... |
1,906 | forward | #!/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.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq.models import (
Fairs... |
1,907 | create | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... |
1,908 | exeption handler | from __future__ import print_function
import sys
from qtpy import QtWidgets
from pprint import pformat
import atexit
import openpype.hosts.flame.api as opfapi
from openpype.pipeline import (
install_host,
registered_host,
)
def openpype_install():
"""Registering OpenPype in context
"""
install_ho... |
1,909 | read table | """
Tool for training the EnergyRegressor
"""
import numpy as np
from ctapipe.core import Tool
from ctapipe.core.traits import Int, IntTelescopeParameter, Path
from ctapipe.exceptions import TooFewEvents
from ctapipe.io import TableLoader
from ctapipe.reco import CrossValidator, EnergyRegressor
from ctapipe.reco.prepr... |
1,910 | test add instructions | #!/usr/bin/env python
import logging
import sys
from pathlib import Path
from unittest.mock import Mock
from pyscaffold import shell
from pyscaffold.api import create_project
from pyscaffold.cli import run
from pyscaffold.extensions import pre_commit
from pyscaffold.templates import get_template
def assert_in_logs(c... |
1,911 | get sql hash | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import hashlib
from typing import (
Iterator, List, Optional,
)
from databuilder.models.graph_node import GraphNode
from databuilder.models.graph_relationship import GraphRelationship
from databuilder.models.query.base import ... |
1,912 | is shortcut | import os
import sys
sys.setrecursionlimit(10000)
ALL_WEIGHT_OP = [
'conv2d', 'mul', 'matmul', 'embedding', 'conv2d_transpose',
'depthwise_conv2d', 'batch_norm', 'layer_norm', 'instance_norm',
'sync_batch_norm', 'matmul_v2'
]
def traversal_ops(op, graph, target_op_idx):
""" Get all operators in the m... |
1,913 | get next | # 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... |
1,914 | menus | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2019, the ilastik team
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# modify it... |
1,915 | is subnet address | import os
import socket
import struct
from urllib.parse import unquote, urlparse
"""
_url.py
websocket - WebSocket client library for Python
Copyright 2023 engn33r
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 o... |
1,916 | mesh | """
stl_export
==========
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecification, Specifica... |
1,917 | avg | # Copyright (c) 2022 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... |
1,918 | 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
from . im... |
1,919 | config random id | # =================================================================
#
# Authors: Francesco Bartoli <xbartolone@gmail.com>
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2020 Francesco Bartoli
# Copyright (c) 2022 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining... |
1,920 | drop unsupported columns and fetch raw data | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
1,921 | 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
# --------------------------------... |
1,922 | test noop | # Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Tests for unitdata models."""
from django.urls import reverse
from django.utils.html import format_html
from weblate.checks.models import Check
from weblate.checks.tasks import batch_update_checks
from weblate.trans.mode... |
1,923 | help msg | # Author: Hubert Kario, (c) 2015
# Released under Gnu GPL v2.0, see LICENSE file for details
"""Minimal test for verifying DHE_RSA key exchange support"""
from __future__ import print_function
import traceback
import sys
import getopt
import re
from itertools import chain
from random import sample
from tlsfuzzer.run... |
1,924 | translate ui | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 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
... |
1,925 | test delete proxy | import json
import falcon
from mock import PropertyMock, MagicMock, patch
from ddt import ddt, data, unpack
from tests import RestTestBase
from monitorrent.rest.settings_proxy import SettingsProxyEnabled, SettingsProxy
from monitorrent.settings_manager import SettingsManager
@ddt
class SettingsProxyEnabledTest(RestTe... |
1,926 | generate | """SCons.Tool.rpm
Tool-specific initialization for rpm.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
The rpm tool calls the rpmbuild command. The first and only argument should a
tar.gz consisting of the sourc... |
1,927 | test read no chunks | import unittest
from test import audiotests
from test import support
from audioop import byteswap
import io
import struct
import sys
import wave
class WaveTest(audiotests.AudioWriteTests,
audiotests.AudioTestsWithSourceFile):
module = wave
class WavePCM8Test(WaveTest, unittest.TestCase):
sndf... |
1,928 | test large testcase list | # Copyright 2019 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, ... |
1,929 | update memory cost | import copy
import operator
from functools import reduce
from typing import List
from colossalai.auto_parallel.tensor_shard.node_handler.strategy.strategy_generator import FollowingStrategyGenerator
from colossalai.auto_parallel.tensor_shard.sharding_strategy import (
CommAction,
CommType,
MemoryCost,
... |
1,930 | release read lock | import logging
import threading
log = logging.getLogger(__name__)
class LockError(Exception):
pass
class ReadWriteMutex(object):
"""A mutex which allows multiple readers, single writer.
:class:`.ReadWriteMutex` uses a Python ``threading.Condition``
to provide this functionality across threads with... |
1,931 | expected protocol | # -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... |
1,932 | pulsar from opencv projection | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
from typing import Tuple
import torch
from ..transforms import matrix_to_rotation_6d
from .cam... |
1,933 | draw buttons | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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) any later version.
#
# This program is distrib... |
1,934 | build list request | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
1,935 | type | # Copyright 2021 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.txt" file accom... |
1,936 | post | from pathlib import PurePath
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.http.response import HttpResponseRedirect
from drf_spectacular.utils import extend_schema, extend_schema_view
from qfieldcloud.core import exceptions, permissions_utils, serializers, utils
from... |
1,937 | delete cols | import wx
import wx.grid
from cellprofiler_core.preferences import get_error_color
from cellprofiler_core.setting import Table
class TableController(wx.grid.GridTableBase):
DEFAULT_ATTR = wx.grid.GridCellAttr()
ERROR_ATTR = wx.grid.GridCellAttr()
ERROR_ATTR.SetTextColour(get_error_color())
def __init... |
1,938 | util neg inf | #
# @file TestXMLAttributes.py
# @brief TestXMLAttributes unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting the fil... |
1,939 | definition | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... |
1,940 | compute output shape | # 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... |
1,941 | get metric | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
# pylint: disable=too-many-arguments
import json
import re
from collections.abc import AsyncIterator, Callable, Iterator
from pathlib import Path
from random import choice
from typing import Any
from unittest imp... |
1,942 | test assert logs invalid multiple logs | # Copyright 2020 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
1,943 | is event loop running wx | # coding: utf-8
"""
Support for creating GUI apps and starting event loops.
IPython's GUI integration allows interactive plotting and GUI usage in IPython
session. IPython has two different types of GUI integration:
1. The terminal based IPython supports GUI event loops through Python's
PyOS_InputHook. PyOS_InputH... |
1,944 | sosdict | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
# This file must have been copied to ~/.ipython/extensions/ during
# the installation of SoS (python setup.py install), with a sos
# profile with pre-loaded ... |
1,945 | validate key value | import asyncio
import aiohttp
from aiohttp import ClientConnectorError
from tracardi.service.notation.dict_traverser import DictTraverser
from tracardi.service.plugin.domain.register import Plugin, Spec, MetaData, Form, FormGroup, FormField, FormComponent
from tracardi.service.plugin.domain.result import Result
from t... |
1,946 | test pretty next run with multiple days | # Copyright Tomer Figenblat.
#
# 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, ... |
1,947 | add string | # 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 ctypes
import math
import sys
from dataclasses import dataclass, field
import torch
from fairseq.dataclass import FairseqDataclass
fro... |
1,948 | test meta | import unittest
from pathlib import PurePath
import click
from linkml.generators import jsonldcontextgen
from tests.test_scripts.environment import env
from tests.utils.clicktestcase import ClickTestCase
from tests.utils.filters import ldcontext_metadata_filter
class GenContextTestCase(ClickTestCase):
testdir =... |
1,949 | test xml output file | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# 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 above copyright
# notice, this list... |
1,950 | fixture nas desc | # 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... |
1,951 | get configuration | '''
copyright: Copyright (C) 2015-2022, Wazuh Inc.
Created by Wazuh, Inc. <info@wazuh.com>.
This program is free software; you can redistribute it and/or modify it under the terms of GPLv2
type: integration
brief: File Integrity Monitoring (FIM) system watches selected files and triggering ale... |
1,952 | extra | # 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... |
1,953 | have valid syntax | #!/usr/bin/env python3
import os, sys, re, subprocess, shutil
# TODO: add support for other basic preprocessor checks (c/kamcfg)
# TODO: add support for missing semi-colon / dangling curly brace (c/kamcfg)
# TODO: add support for recursing through kamcfg include files (kamcfg)
# global config variables
project_roo... |
1,954 | test convert lf to crlf no op | # test_line_ending.py -- Tests for the line ending functions
# Copyright (C) 2018-2019 Boris Feld <boris.feld@comet.ml>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. ... |
1,955 | get server azure ad only authentication 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
__all__ ... |
1,956 | received | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 the hope that it will b... |
1,957 | subscribe | # Copyright 2017 Workiva
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
#... |
1,958 | main | #
# Copyright 2002-2010 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any lat... |
1,959 | xml node name | ## @file
# This is an XML API that uses a syntax similar to XPath, but it is written in
# standard python so that no extra python packages are required to use it.
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __fut... |
1,960 | get data type sync | """Create dynamic types from entity, property, and data types via pydantic."""
from uuid import UUID
from graph_types import (
DataTypeSchema,
EntityTypeSchema,
PropertyTypeSchema,
)
from yarl import URL
from graph_sdk.client.concurrent import HASHClient, with_actor
from graph_sdk.filter import (
Data... |
1,961 | handle job update | import json
import select
import os
import eventlet
eventlet.monkey_patch()
from eventlet.hubs import trampoline
import urllib.request, urllib.parse, urllib.error
import requests
import psycopg2
import urllib3
urllib3.disable_warnings()
from pyinfraboxutils import get_logger, get_env, get_root_url
from pyinfraboxuti... |
1,962 | test remove removes | # TODO(mc, 2022-07-07): these tests are very coupled to the implementation
# both the tests and the code under test likely needs to be rewritten
# if we want useful unit test coverage
from mock import patch, AsyncMock # type: ignore[attr-defined]
import pytest
from robot_server.service.session.errors import SessionCr... |
1,963 | blue button pressed long | from enigma import eServiceReference
from Components.ActionMap import HelpableActionMap
from Screens.EpgSelectionChannel import EPGSelectionChannel
from Screens.EpgSelectionBase import EPGServiceZap
from Screens.InfoBar import InfoBar
from Screens.TimerEntry import addTimerFromEventSilent
from Tools.Directories import... |
1,964 | is workspace file | import logging
import os
import pathlib
import typing as t
from colorama import Fore
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.types import StrPath
from tmuxp.workspace.constants import VALID_WORKSPACE_DIR_FILE_EXTENSIONS
logger = logging.getLogger(__name__)
if t.TYPE_CHECKING:
from typing_extensions im... |
1,965 | test address | """
:codeauthor: Rahul Handay <rahulha@saltstack.com>
"""
import pytest
import salt.modules.bluez_bluetooth as bluez
import salt.utils.validate.net
from salt.exceptions import CommandExecutionError
from tests.support.mock import MagicMock, patch
class MockBluetooth:
"""
Mock class for bluetooth
"""... |
1,966 | update single job | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# 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... |
1,967 | test one upcast one function | import os
import common_tests
class TestRenameSoundDynamic(common_tests.CommonTests):
@classmethod
def get_test_driver(cls) -> common_tests.CommonTestDriver:
return common_tests.CommonTestDriver()
def write_load_config(self):
with open(os.path.join(self.test_driver.repo_dir, ".hhconfig")... |
1,968 | test get item with slice | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# 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 t... |
1,969 | test fields step submit updates submission with | from datetime import date
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from geocity.apps.submissions import models as submissions_models
from geocity.tests import factories
from geocity.tests.utils import LoggedInUserMixin, get_parser
class SubmissionUpdateTestCa... |
1,970 | add cutout | import math
from pyaedt.generic.general_methods import ET
from pyaedt.generic.general_methods import pyaedt_function_handler
class Polygon(object):
def __init__(self, ipc):
self._ipc = ipc
self.is_void = False
self.poly_steps = []
self.solid_fill_id = ""
self.cutout = []
... |
1,971 | get | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import json
import frappe
from frappe import _
from frappe.model.document import Document, get_controller
from frappe.utils import cint, quoted
from frappe.website.path_resolver import resolve_path
no_cache = 1
def get... |
1,972 | set up | import unittest
import os
from unittest import mock
from unittest.mock import MagicMock
import aim.sdk.utils as utils
class TestUtils(unittest.TestCase):
def METHOD_NAME(self):
self.maxDiff = None
def test_should_search_aim_repo_not_found_back_slash(self):
# arrange
path = '/'
... |
1,973 | unpack list | """Implements (a subset of) Sun XDR -- eXternal Data Representation.
See: RFC 1014
"""
import struct
try:
from cStringIO import StringIO as _StringIO
except ImportError:
from StringIO import StringIO as _StringIO
from functools import wraps
__all__ = ["Error", "Packer", "Unpacker", "ConversionError"]
# exc... |
1,974 | load model | # The GPEN implementation is also open-sourced by the authors,
# and available at https://github.com/yangxy/GPEN/blob/main/face_detect/retinaface_detection.py
import os
import cv2
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
from .models.retinaface import Retina... |
1,975 | test grid shape | """
Unit tests for landlab.components.overland_flow.OverlandFlow
last updated: 3/14/16
"""
import numpy as np
from landlab import RasterModelGrid
from landlab.components.overland_flow import OverlandFlow
from landlab.components.overland_flow._links import horizontal_link_ids
(_SHAPE, _SPACING, _ORIGIN) = ((32, 240),... |
1,976 | get metadata | """Authors: Heberto Mayorquin, Cody Baker and Ben Dichter."""
from typing import Optional
import numpy as np
from pynwb import NWBFile
from pynwb.device import Device
from pynwb.ophys import Fluorescence, ImageSegmentation, ImagingPlane, TwoPhotonSeries
from ...baseextractorinterface import BaseExtractorInterface
fro... |
1,977 | delete file | """ Utility functions for the tests.
Access: from test import test_utils.
"""
import os
import numpy as np
import scipy.sparse as sps
import porepy as pp
def permute_matrix_vector(A, rhs, block_dof, full_dof, grids, variables):
"""Permute the matrix and rhs from assembler order to a specified order.
Args... |
1,978 | status is | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyowm.commons import exceptions
def METHOD_NAME(weather, status, weather_code_registry):
"""
Checks if the weather status code of a *Weather* object corresponds to the
detailed status indicated. The lookup is performed against the provided
*WeatherC... |
1,979 | main |
import sys, re, csv, cgi
from optparse import OptionParser
class CsvOutput:
def __init__(self):
self.writer = csv.writer(sys.stdout)
def header(self, headerRow):
self.writer.writerow(headerRow)
def footer(self):
pass
def row(self, rowdata):
self.writer.writerow(rowdata)
class HtmlOutput:
def header(s... |
1,980 | generate sharedkey | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
1,981 | test compare viscpu with pyuvsim | """Compare vis_cpu with pyuvsim visibilities."""
import pytest
import copy
import numpy as np
from astropy import units
from astropy.coordinates import Latitude, Longitude
from astropy.time import Time
from astropy.units import Quantity
from pyradiosky import SkyModel
from pyuvsim import AnalyticBeam, simsetup, uvsim
... |
1,982 | get node thread stacks | # Copyright 1999-2021 Alibaba Group Holding 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 or a... |
1,983 | create tensor | import logging
import unittest
import torch
from torch.testing._internal import common_utils
logging.getLogger("torch").setLevel(logging.WARNING)
from apex.transformer import parallel_state
from apex.transformer.pipeline_parallel import p2p_communication
from apex.transformer.testing.distributed_test_base import Ncc... |
1,984 | get sample | import functools
import operator
import os
import os.path
import sys
import numpy as np
# Bamboo utilities
current_file = os.path.realpath(__file__)
current_dir = os.path.dirname(current_file)
sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python'))
import tools
# ==============================... |
1,985 | skorch regressor explainer | import pytest
import numpy as np
import pandas as pd
from sklearn.datasets import make_classification, make_regression
from torch import nn
from skorch import NeuralNetClassifier, NeuralNetRegressor
from explainerdashboard.explainers import RegressionExplainer, ClassifierExplainer
@pytest.fixture(scope="session")
d... |
1,986 | extract test key | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
# !/usr/bin/env python
"""
Provides "diff-like" comparison of images.
Currently relies on matplotlib for image processing so l... |
1,987 | 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
# --------------------------------... |
1,988 | log in | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... |
1,989 | import data | import os
import subprocess
import time
from benchmark_base import BenchmarkBase
import pandas as pd
import csv
# Dont fail if not imported locally
try:
from neo4j import GraphDatabase
except ImportError:
pass
def create_graph_projection(tx):
tx.run(
"""
CALL gds.graph.project.cypher(
... |
1,990 | test delete channel member no member | import datetime
from unittest.mock import ANY
import pytest
from quetz.metrics.db_models import PackageVersionMetric
def test_get_package_list(package_version, package_name, channel_name, client):
response = client.get("/api/dummylogin/bartosz")
response = client.get(
f"/api/channels/{channel_name}/... |
1,991 | er get local package path | #
# (c) 2008 Mandriva, http://www.mandriva.com/
#
# $Id: package_api.py 713 2009-02-27 14:06:11Z oroussy $
#
# This file is part of Pulse 2, http://pulse2.mandriva.org
#
# Pulse 2 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 So... |
1,992 | prepare | # Copyright 2023 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... |
1,993 | test absent when trail does not exist | import logging
import random
import string
import pytest
import salt.loader
import salt.states.boto_cloudtrail as boto_cloudtrail
from tests.support.mock import MagicMock, patch
boto = pytest.importorskip("boto")
boto3 = pytest.importorskip("boto3", "1.2.1")
botocore = pytest.importorskip("botocore", "1.4.41")
log ... |
1,994 | encode puzzle hash | # Copyright (c) 2017 Pieter Wuille
#
# 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, merge, publish, distr... |
1,995 | opencomplete | #!/usr/bin/python3 -OO
# Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org)
#
# 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) any later ver... |
1,996 | test add | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
1,997 | worker init fn | import itertools
import random
from functools import partial
from typing import Any, Sequence, Union
import numpy as np
from torch.utils.data import DataLoader
from typeguard import check_argument_types
from espnet2.iterators.abs_iter_factory import AbsIterFactory
from espnet2.samplers.abs_sampler import AbsSampler
... |
1,998 | message | # (C) Copyright 2004-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
1,999 | keys | # -*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.