id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
2,500 | capped | # 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... |
2,501 | cell flowsheet model | #################################################################################
# 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... |
2,502 | about | """
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
Copyright 2016-2023, Pulumi 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/L... |
2,503 | get service name | import random
from pathlib import Path
from typing import Callable, Dict, Tuple
import opentelemetry.sdk.metrics.export
import opentelemetry.sdk.metrics.view
import pytest
from opentelemetry.sdk.metrics.export import (
AggregationTemporality,
MetricExporter,
MetricExportResult,
MetricsData,
Periodi... |
2,504 | method | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
2,505 | set | import logging
from pyvo.utils.http import create_session
from . import securitymethods
__all__ = ["CredentialStore"]
class CredentialStore(object):
"""
The credential store takes user credentials, and uses them
to create appropriate requests sessions for dispatching
requests using those credential... |
2,506 | 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... |
2,507 | create dyn state matrices | #!/usr/bin/env python3
"""
Dynamic bicycle model from "The Science of Vehicle Dynamics (2014), M. Guiggiani"
The state is x = [v, r]^T
with v lateral speed [m/s], and r rotational speed [rad/s]
The input u is the steering angle [rad], and roll [rad]
The system is defined by
x_dot = A*x + B*u
A depends on longitudin... |
2,508 | test filename | from unittest import mock
import pytest
from sentry import eventstore
from sentry.event_manager import EventManager
from sentry.interfaces.stacktrace import get_context, is_url
def test_is_url():
assert is_url("http://example.org/") is True
assert is_url("https://example.org/") is True
assert is_url("fi... |
2,509 | acr scope map show | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
2,510 | test encoding flat map | import json
from datetime import datetime, timedelta, timezone
from bytewax._encoder import encode_dataflow
from bytewax.dataflow import Dataflow
from bytewax.inputs import PartitionedInput
from bytewax.window import EventClockConfig, TumblingWindow
# Helper functions for some steps
def acc_values(acc, event):
a... |
2,511 | test variable positive matches | """
Typograhic Number Theory tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pytest
from pygments.lexers.tnt import TNTLexer
from pygments.token import Text, Operator, Keyword, Name, Number, \
... |
2,512 | has ipv6 | from __future__ import absolute_import
import socket
from .wait import wait_for_read
from .selectors import HAS_SELECT, SelectorError
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connection is dropped and should be closed.
:param conn:
:class:`httplib.HTTPConnecti... |
2,513 | echo | # -*- coding: utf-8 -*-
"""Format and display CLI output.
Classes:
CliTable: Pretty prints tabular data to stdout, via Rich's Console API
"""
import os
from typing import Any, List, Union
import rich
from rich import box, print
from rich.console import Console
from rich.style import Style
from rich.table import C... |
2,514 | test cpu features with static template | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for the CPU features for aarch64."""
import platform
import re
import pytest
import framework.utils_cpuid as cpuid_utils
from framework.utils_cpu_templates import nonci_on_arm
PLATFORM = platform... |
2,515 | test call | #
# 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 us... |
2,516 | token | from typing import Any, Dict, List, NamedTuple, Optional, Tuple
from neo4j import GraphDatabase
from pandas import DataFrame, Series
from pyarrow import flight
from pyarrow.flight import ClientMiddleware, ClientMiddlewareFactory
from .query_runner import QueryRunner
from graphdatascience.query_runner.graph_constructo... |
2,517 | compressed image | import time
from typing import Tuple, List, Union
import depthai as dai
import numpy as np
import rclpy
import rclpy.node as node
# from geometry_msgs.msg import Vector3, Quaternion, Pose2D, Point, Transform, TransformStamped
# from std_msgs.msg import Header, ColorRGBA, String
# from visualization_msgs.msg import Ima... |
2,518 | get gw mac address | """
Copyright 2022 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... |
2,519 | do for each proc | # Copyright 2018 ARM Limited
#
# 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... |
2,520 | path | """
.. _slice_example:
Slicing
~~~~~~~
Extract thin planar slices from a volume.
"""
import matplotlib.pyplot as plt
import numpy as np
# sphinx_gallery_thumbnail_number = 2
import pyvista as pv
from pyvista import examples
###############################################################################
# PyVista me... |
2,521 | json seems like protocol | """File identifier interface."""
import json
from dataclasses import dataclass
from typing import Any, Dict, Sequence, Union
import anyio
from opentrons_shared_data.robot.dev_types import RobotType
from opentrons.protocols.api_support.definitions import MAX_SUPPORTED_VERSION
from opentrons.protocols.api_support.typ... |
2,522 | main | #!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-only
#
# Advanced cgclassify functionality test - '-b' '-g' <controller> (cgroup v2)
#
# Copyright (c) 2023 Oracle and/or its affiliates.
# Author: Kamalesh Babulal <kamalesh.babulal@oracle.com>
#
from cgroup import Cgroup, CgroupVersion
from systemd import Sy... |
2,523 | test is cors | from datetime import datetime
from unittest.mock import Mock, patch
from actstream.actions import follow
from actstream.models import Action, Follow
from actstream.signals import action
from django.contrib.contenttypes.models import ContentType
from rest_framework.test import APIClient
from kitsune.notifications impo... |
2,524 | remove data loading plan | import os
import re
from cache import cached
from db import node_database
from flask import request, g
from middlewares import middleware, medical_folder_dataset, common
from schemas import ValidateMedicalFolderReferenceCSV, \
ValidateMedicalFolderRoot, \
ValidateSubjectsHasAllModalities, \
ValidateMedical... |
2,525 | output child post | import typing as t
from ast import literal_eval
from ast import parse
from itertools import chain
from itertools import islice
from types import GeneratorType
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
fro... |
2,526 | rgb to hex | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division # just to be safe...
import numpy as np
###############################################################################
# Ut... |
2,527 | whiteout section | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2013 - 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
... |
2,528 | load partition data mnist | import json
import os
import numpy as np
import wget
from ...ml.engine import ml_engine_adapter
cwd = os.getcwd()
import zipfile
from ...constants import FEDML_DATA_MNIST_URL
import logging
def download_mnist(data_cache_dir):
if not os.path.exists(data_cache_dir):
os.makedirs(data_cache_dir, exist_ok=... |
2,529 | name op | # 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... |
2,530 | unwrap | from typing import Union
import torch
import torch.nn as nn
from torch import Tensor
from torch.optim import Optimizer
class OptimizerWrapper:
"""
A standard interface for optimizers wrapped by the Booster.
Args:
optim (Optimizer): The optimizer to be wrapped.
"""
def __init__(self, opt... |
2,531 | run validations | # This file is autogenerated.
# To change this file you should edit assets/configuration/spec.yaml and then run the following commands:
# ddev -x validate config -s <INTEGRATION_NAME>
# ddev -x validate models -s <INTEGRATION_NAME>
from __future__ import annotations
from typing import Any, Mapping, Optional, ... |
2,532 | remove embedded layers | import logging
import os
from pathlib import Path
from core.models import ProjectMapUrlAlias
from core.signals import (execute_search_on_models, load_layer_actions,
pre_delete_project, pre_update_project)
from django.conf import settings
from django.contrib.auth.signals import user_logged_out... |
2,533 | test altconstraints | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the DataLad package for the
# copyright and license terms.
#
### ### ### ### ##... |
2,534 | delete | '''
local.py - this file is part of S3QL.
Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This work can be distributed under the terms of the GNU GPLv3.
'''
import _thread
import logging
import os
import struct
from contextlib import ExitStack
from typing import Any, BinaryIO, Dict, Optional
from ..common import... |
2,535 | test missing final newline | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for coverage.py's improved tokenizer."""
from __future__ import annotations
import os.path
import re
import textwrap
import warnings
import pytest
from... |
2,536 | test index | import pytest
from typing import Optional
from mlserver.errors import ModelNotFound
from mlserver.registry import MultiModelRegistry
from mlserver.handlers import ModelRepositoryHandlers
from mlserver.settings import ModelSettings
from mlserver.types import RepositoryIndexRequest, State
async def METHOD_NAME(
m... |
2,537 | test intrinsicparamschema | #
# Copyright (C) 2019 ifm electronic, gmbh
#
# 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... |
2,538 | graph | # Copyright (c) 2023 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... |
2,539 | test scalar param array | from __future__ import annotations
import datetime
from collections import OrderedDict
import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
import sqlalchemy as sa
from pytest import param
import ibis
import ibis.expr.datatypes as dt
from ibis import _
try:
from google.api_core.excep... |
2,540 | test fopen with disallowed fds | """
Unit Tests for functions located in salt/utils/files.py
"""
import copy
import io
import os
import pytest
import salt.utils.files
from tests.support.mock import MagicMock, patch
def test_safe_rm():
with patch("os.remove") as os_remove_mock:
salt.utils.files.safe_rm("dummy_tgt")
assert os_r... |
2,541 | drop user granted directly | from testflows.core import *
from testflows.asserts import error
from rbac.requirements import *
from rbac.helper.common import *
import rbac.helper.errors as errors
@TestSuite
def METHOD_NAME(self, node=None):
"""Check that a user is able to execute `DROP USER` with privileges are granted directly.
"""
... |
2,542 | evaluate | # 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... |
2,543 | method | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
2,544 | test distance | """GridLAB-D Geodata Distance Package
The distance package computes the shortest distance between consecutive
positions.
INPUT
id - record id (see column_names configuration)
latitude - latitude of record (see column_names configuration)
longitude - longitude of record (see column_names configuration... |
2,545 | read mat ark | # To use this file, the dependency (https://github.com/vesis84/kaldi-io-for-python)
# needs to be installed. This is a light wrapper around kaldi_io that returns
# torch.Tensors.
from typing import Any, Callable, Iterable, Tuple
import torch
from torch import Tensor
from torchaudio._internal import module_utils as _mo... |
2,546 | cf security adaptive network hardenings | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
2,547 | double data type | from __future__ import annotations
from typing import Collection
from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
from typing_extensions import override
from metricflow.errors.errors import UnsupportedEngineFeat... |
2,548 | test transform skipped | import base64
import json
import unittest
import zlib
from unittest.mock import patch, ANY
import asyncio
from orangecontrib.text.vectorization.sbert import SBERT, EMB_DIM
from orangecontrib.text import Corpus
PATCH_METHOD = 'httpx.AsyncClient.post'
RESPONSES = {
t: [i] * EMB_DIM for i, t in enumerate(Corpus.from... |
2,549 | output size | import numpy as np
import pandas as pd
from torch import nn
from torch.utils.data import sampler
from clinicadl.utils.exceptions import ClinicaDLArgumentError
from clinicadl.utils.task_manager.task_manager import TaskManager
class RegressionManager(TaskManager):
def __init__(
self,
mode,
):
... |
2,550 | width value changed | """
@package rdigit.toolbars
@brief rdigit toolbars and icons.
Classes:
- toolbars::RDigitToolbar
(C) 2014 by the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
@author Anna Petrasova <kratochanna gmail.com>... |
2,551 | proc7 | """
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness has been used,
... |
2,552 | kickin cost | """
When an attendee or group preregisters or changes their registration, we want a way to determine the potential costs and
credits to add to their receipt. These items are defined here. Each cost/credit should return None if there is no applicable
charge for that model or a tuple of the cost description, the cost pr... |
2,553 | fprime | """
Holds files for l1 regularization of LikelihoodModel, using
scipy.optimize.slsqp
"""
import numpy as np
from scipy.optimize import fmin_slsqp
import statsmodels.base.l1_solvers_common as l1_solvers_common
def fit_l1_slsqp(
f, score, start_params, args, kwargs, disp=False, maxiter=1000,
callback=No... |
2,554 | sbc compare audio frames | #!/usr/bin/env python3
import numpy as np
import wave
import struct
import sys
from sbc import *
from sbc_encoder import *
from sbc_decoder import *
error = 0.99
max_error = -1
def sbc_compare_subband_samples(frame_count, actual_frame, expected_frame):
global error, max_error
for blk in range(actual_frame.nr... |
2,555 | 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
from . im... |
2,556 | test get document url with deeplinking url | from unittest.mock import create_autospec, sentinel
import pytest
from lms.product.canvas._plugin.misc import CanvasMiscPlugin
from lms.resources._js_config import JSConfig
from tests import factories
class TestCanvasMiscPlugin:
@pytest.mark.parametrize("is_gradable", [True, False])
@pytest.mark.parametrize... |
2,557 | test step1b | #
# Copyright (c) 2020-2023, NVIDIA 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 ag... |
2,558 | create n user | #!/usr/bin/env python3
import subprocess
import random
import re
alphabet = 'azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN123456789-_'
a_length = len(alphabet)
""" ACL support attribute """
ACL4_SUPPORT_ALLOW_ACL = 0x00000001
ACL4_SUPPORT_DENY_ACL = 0x00000002
ACL4_SUPPORT_AUDIT_ACL = 0x00000004
ACL4_SUPPORT_A... |
2,559 | hash code | #
# 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... |
2,560 | test invalid json data | # This file is part of Buildbot. Buildbot 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, but WITHOUT
# ANY WARRANTY; without eve... |
2,561 | save model | #
# This sets up how models are displayed
# in the web admin interface.
#
from django import forms
from django.conf import settings
from django.contrib import admin
from evennia.scripts.models import ScriptDB
from . import utils as adminutils
from .attributes import AttributeInline
from .tags import TagInline
class... |
2,562 | analyze python coverage | """Analyze code coverage data to determine which integration test targets provide coverage for each arc or line."""
from __future__ import annotations
import os
import typing as t
from .....encoding import (
to_text,
)
from .....data import (
data_context,
)
from .....util_common import (
ResultType,
)
... |
2,563 | bad message | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test message sending before handshake completion.
A node should never send anything other than VERSION/VERA... |
2,564 | cookies | """Code to run before and after certain events during testing."""
import pymongo
import requests
from behave.model import Step
from behave.runner import Context
JSON_CONTENT_TYPE = "application/json"
def before_all(context: Context) -> None: # noqa: C901
"""Create shortcuts to send requests to the server API."... |
2,565 | on 204 | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
2,566 | add f aliases | import inspect
import ast
import astunparse
from ast import NodeVisitor
from typing import Any, Dict, List
from dlt.common.reflection.utils import find_outer_func_def
import dlt.reflection.names as n
class PipelineScriptVisitor(NodeVisitor):
def __init__(self, source: str):
self.source = source
... |
2,567 | paypal | """Provides data related to payment."""
import re
import string
import typing as t
from mimesis.data import CREDIT_CARD_NETWORKS
from mimesis.enums import CardType, Gender
from mimesis.exceptions import NonEnumerableError
from mimesis.locales import Locale
from mimesis.providers.base import BaseProvider
from mimesis.... |
2,568 | splus rule1 | # Leo colorizer control file for splus mode.
# This file is in the public domain.
# Properties for splus mode.
properties = {
"doubleBracketIndent": "false",
"indentCloseBrackets": "}",
"indentNextLine": "\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\\))[^{;]*)",
"indentOpenBrackets":... |
2,569 | remove current task | """Undocumented Module"""
__all__ = ['TaskManagerPanel', 'TaskManagerWidget']
from direct.tkwidgets.AppShell import AppShell
from direct.showbase.DirectObject import DirectObject
import Pmw
import tkinter as tk
from tkinter.messagebox import askokcancel
class TaskManagerPanel(AppShell):
# Override class variabl... |
2,570 | execute | """
Abstracts the various concerns of external table creation as much as possible
This operator originally ran using airflow's bigquery hooks. However, for the
version we had to use (airflow v1.14) they used an outdated form of authentication.
Now, the pipeline aims to use bigquery's sqlalchemy client where possible.
... |
2,571 | test stringwrapper eq | import copy
import pytest
from astropy.time import Time
from sunpy.net import attr, attrs, hek
@pytest.fixture
def foostrwrap(request):
return hek.attrs._StringParamAttrWrapper("foo")
class HEKResult:
"""
Basic caching class to run the remote query once and return the result many times.
"""
... |
2,572 | get namespace authorization rule 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... |
2,573 | test interpolate | import lenstronomy.Util.util as util
import numpy as np
import numpy.testing as npt
import pytest
import unittest
from lenstronomy.LightModel.Profiles.shapelets import Shapelets, ShapeletSet
class TestShapeletSet(object):
"""Class to test Shapelets."""
def setup_method(self):
self.shapeletSet = Shape... |
2,574 | test basicauth revoke | """Client authentication tests across all endpoints.
Client authentication in OAuth2 serve two purposes, to authenticate
confidential clients and to ensure public clients are in fact public. The
latter is achieved with authenticate_client_id and the former with
authenticate_client.
We make sure authentication is done... |
2,575 | test altitude agl | """ Unit Tests for Py-ART's io/nexrad_cdm.py module. """
import bz2
import numpy as np
import pytest
from numpy.ma.core import MaskedArray
from numpy.testing import assert_almost_equal
import pyart
###################################################
# read_nexrad_cdm tests (verify radar attributes) #
##############... |
2,576 | create layer variables | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
2,577 | test stop scheduler many | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
import time
import vdsm.common.time
from vdsm import schedule
from testlib import VdsmTestCase
from testVal... |
2,578 | run test | # Copyright 2013-present Barefoot Networks, 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... |
2,579 | 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 . im... |
2,580 | factor rule8 | # Leo colorizer control file for factor mode.
# This file is in the public domain.
# Properties for factor mode.
properties = {
"commentEnd": ")",
"commentStart": "(",
"doubleBracketIndent": "true",
"indentCloseBrackets": "]",
"indentNextLines": "^(\\*<<|:).*",
"indentOpenBrackets": "[",
"l... |
2,581 | get argparser ctor args | # -------------------------------------------------------------------------
#
# 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
#
# ---------------------------------------------------... |
2,582 | lot solvent string | """ Utilities to determine level of theory, task type, and calculation type for Q-Chem calculations"""
from typing import Any, Dict, Optional
from emmet.core.qchem.calc_types import LevelOfTheory, CalcType, TaskType
from emmet.core.qchem.calc_types.calc_types import (
FUNCTIONALS,
BASIS_SETS,
)
__author__ = ... |
2,583 | predicate | # Copyright 2021 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 ... |
2,584 | execute | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2022 Bitergia
#
# 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 l... |
2,585 | convert to text | from collections import OrderedDict, defaultdict
from typing import List
from deeplake.util.hash import hash_str_to_int32
from deeplake.util.exceptions import EmptyTensorError
from deeplake.client.log import logger
import numpy as np
import deeplake
def convert_to_idx(samples, class_names: List[str]):
class_idx ... |
2,586 | is applied | # Copyright 2020-2023 Capypara and the SkyTemple Contributors
#
# This file is part of SkyTemple.
#
# SkyTemple 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 y... |
2,587 | run | from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME phenix.resolution
from iotbx import reflection_file_reader
from cctbx import maptbx
from cctbx.array_family import flex
from libtbx.utils import Sorry
import sys, math, time
from scitbx import regular_grid_on_unit_sphere
impo... |
2,588 | command | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import re
from typing import Optional, Type
from lisa.executable import Tool
from lisa.operating_system import Alpine, Debian
from lisa.tools.ip import Ip
from lisa.util import UnsupportedDistroException
from lisa.util.process import Process
INT... |
2,589 | config date | from bisect import bisect
from collections import OrderedDict
from decimal import Decimal
from itertools import groupby
from dateutil.parser import parse
from flask import current_app as app
from main import db
from sqlalchemy import true, inspect
from sqlalchemy.orm.base import NO_VALUE
from sqlalchemy.sql.functions... |
2,590 | copy from local | #!/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 logging
import os
import shutil
from typing import List, Optional
logger = logging.getLogger(__file__)
try:... |
2,591 | test partial summarize transform | import pytest
from db.transforms.base import Summarize, Limit
from db.transforms.operations.serialize import serialize_transformation
fully_speced_summarize = \
Summarize(
dict(
aggregation_expressions=[
dict(
function='distinct_aggregate_to_array',
... |
2,592 | test get vsicurl | # =================================================================
#
# 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... |
2,593 | get mi cols | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Converter utilities between dask and pandas, with multiindex convention.
Converts between:
pd.DataFrames with ordinary (single-level) index or pd.Multiindex, and
dask DataFrame
If pd.DataFrame has ordinary index, converts using dask compute/fr... |
2,594 | add | #
# data_source.py -- utilities to assist in making time-series plots
#
from collections import deque
import numpy as np
class XYDataSource:
"""Monitor a data source efficiently.
Uses a static array circular queue and a sliding window algorithm to
efficiently keep track of the current set of points and ... |
2,595 | form valid | from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db.models.functions import Concat
from django.forms import CharField, HiddenInput, ModelForm, Textarea
from django.http i... |
2,596 | wrapped | #!/usr/bin/env python3
"""
This is a minimal, speed-optimized version of a FASTQ->FASTA conversion script. It lacks a
lot of options other scripts might have, but I got tired of runtimes taking hours with
billion-read FASTQ files.
Example timing information on a 5.4GB input file (with 21.7 million records)**:
-... |
2,597 | run | """
Contains objects that define UI related workers that perform tasks in the
background.
Copyright (c) 2015-2022 Nicholas H.Tollervey and others (see the AUTHORS file).
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 S... |
2,598 | get all | # Stubs for ply.yacc (Python 3.7)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional, TypeVar, Generic, List
from ply.lex import Lexer
from inmanta.ast.statements import Statement
__tabversion__: str
yaccdebug: bool
debug_file: str
tab_module: str
default_... |
2,599 | setup | # -*- coding: utf-8 -*-
import pytest
try:
from ddtrace.appsec.iast import oce
from ddtrace.appsec.iast._taint_tracking import as_formatted_evidence
from tests.appsec.iast.aspects.aspect_utils import BaseReplacement
from tests.appsec.iast.aspects.aspect_utils import create_taint_range_with_format
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.