id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
19,600 | ls osd | from cli import Cli
class Crush(Cli):
"""This module provides CLI interface to manage the Crush service."""
def __init__(self, nodes, base_cmd):
super(Crush, self).__init__(nodes)
self.base_cmd = f"{base_cmd} crush"
def rule(self, *Kargs):
"""
To create rules
Kar... |
19,601 | test is preconfigured | # Copyright 2017 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 accompa... |
19,602 | test update | # (C) Copyright 2005-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... |
19,603 | flag disordered | # Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Residue class, us... |
19,604 | start convert data | import logging
import sys
from collections import defaultdict
from typing import Any, Dict
from freqtrade.configuration import TimeRange, setup_utils_configuration
from freqtrade.constants import DATETIME_PRINT_FORMAT, DL_DATA_TIMEFRAMES, Config
from freqtrade.data.converter import convert_ohlcv_format, convert_trades... |
19,605 | method3 | # This sample tests the usage of the Self type.
from typing import Callable, Generic, ParamSpec, Protocol, TypeVar
from typing_extensions import Self
from dataclasses import dataclass
_P = ParamSpec("_P")
_R = TypeVar("_R")
class A(Generic[_P, _R]):
val: _R
def __init__(self, callback: Callable[_P, _R]) -... |
19,606 | handle response | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import sys
import logging
import requests
from io import StringIO, BytesIO
from collections import namedtuple
from .processor import SignorProcessor
from indra.util import read_unicode_csv, read_unicode_csv_fileobj
... |
19,607 | test when verbose and retcode is nonzero | import hashlib
from textwrap import dedent
import pytest
import salt.modules.pdbedit as pdbedit
from tests.support.mock import MagicMock, patch
try:
hashlib.new("md4", "".encode("utf-16le"))
MD4_SUPPORTED = True
except ValueError:
MD4_SUPPORTED = False
@pytest.fixture
def configure_loader_modules():
... |
19,608 | boundary dof | #!/usr/bin/env python3
#
import numpy as np
import matplotlib.pyplot as plt
from fealpy.mesh import MeshFactory
from fealpy.functionspace.femdof import multi_index_matrix2d
# 定义一个带裂缝的线弹性模型
class LinearElasticityModel():
def __init__(self):
self.mu = 1
self.lam = 1.25
def domain(self):
... |
19,609 | backup watched | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Backup and restore the watched status of Plex libraries to a json file.
"""
import argparse
from collections import defaultdict
import json
from plexapi import utils
SECTIONS = ('movie', 'show')
def _find_server(account, servername=None):
""" Find and return a P... |
19,610 | extend markdown | import re
import markdown
# Regular expression is meant to match the following pattern:
#
# [BEGIN][PROTOCOL]HOST[:PORT][/[PATH]][END]
#
# Everything except HOST is meant to be optional, as denoted by square
# brackets.
#
# Patter elements are as follows:
#
# BEGIN
# String preceding the link. Can be empty, or any ... |
19,611 | is tuple | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import annotations
__all__ = ("RegularForm",)
from collections.abc import Callable, Iterator
import awkward as ak
from awkward._nplikes.numpylike import NumpyMetadata
from awkward._nplikes.shape import unknown_leng... |
19,612 | distance |
from functools import wraps
from itertools import repeat
try:
from collections.abc import Sequence
except ImportError:
from collections import Sequence
class DeltaPenalty(object):
r"""This decorator returns penalized fitness for invalid individuals and the
original fitness value for valid individual... |
19,613 | clean duplication ui | """
module for testing the clean_duplication() function
"""
import logging
import numpy as np
import pandas as pd
import pytest
from ...clean.clean_duplication import UserInterface
LOGGER = logging.getLogger(__name__)
@pytest.fixture(scope="module") # type: ignore
def METHOD_NAME() -> UserInterface:
df = pd.D... |
19,614 | system data | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
19,615 | policy data | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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
fr... |
19,616 | name | from datetime import datetime, timedelta
from time import sleep
import copy
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
from base import HubspotBaseTest
from client import TestClient
class TestHubspotInterruptedSync1(HubspotBaseTest... |
19,617 | on leave | """
Behaviors/Focus
===============
.. rubric:: Changing the background color when the mouse is on the widget.
To apply focus behavior, you must create a new class that is inherited from the
widget to which you apply the behavior and from the :class:`FocusBehavior` class.
Usage
-----
.. code-block:: python
fro... |
19,618 | type | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ ... |
19,619 | open file | from Plugins.Plugin import PluginDescriptor
from Components.PluginComponent import plugins
import os
#from mimetypes import guess_type, add_type
# start: temporary workaround until we discover why mimetypes.add_type() is not updating the map
from mimetypes import types_map
types_map_dict = dict(types_map)
def add_... |
19,620 | set indicator | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
#
# This file is part of Medusa.
#
# Medusa 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... |
19,621 | test options have defaults | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
19,622 | file method | # SPDX-FileCopyrightText: 2022 James R. Barlow
# SPDX-License-Identifier: MPL-2.0
"""For managing PDF encryption."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, NamedTuple, cast
if TYPE_CHECKING:
from pikepdf._core import EncryptionMethod
class Permissions(NamedTuple):
... |
19,623 | create monitor | #!/usr/bin/env python3
# Copyright (c) 2022 The MobileCoin Foundation
#
# Integration test that uses mobilecoind-json to submit a transaction and check balance.
import argparse
import glob
import json
import logging
import os
import sys
import time
import urllib.request
logging.basicConfig(stream = sys.stdout, leve... |
19,624 | init | # COPYRIGHT (C) 2020-2023 Nicotine+ Contributors
# COPYRIGHT (C) 2009 quinox <quinox@users.sf.net>
#
# 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 Softwa... |
19,625 | set up | import unittest
from unittest import mock
from betfairlightweight.resources.bettingresources import PriceSize
from flumine.order.order import OrderStatus, OrderTypes
from flumine import config
from flumine.markets.market import Market
from flumine.markets.markets import Markets
from flumine.order.order import (
Ba... |
19,626 | url | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
19,627 | step fn | """Training algorithm track submission functions for WMT."""
import functools
from typing import Dict, Iterator, List, Tuple
from flax import jax_utils
import jax
import jax.numpy as jnp
import optax
from algorithmic_efficiency import spec
def get_batch_size(workload_name):
batch_sizes = {'wmt': 128}
return ba... |
19,628 | test raw to enrich projects | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2023 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 later version.
#
# This ... |
19,629 | test validate bounded spec distinct bounds | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
19,630 | get fid score | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
19,631 | test absolute pose three points | import copy
import numpy as np
from opensfm import multiview
from opensfm import pygeometry
from opensfm import transformations as tf
def normalized(x: np.ndarray) -> np.ndarray:
return x / np.linalg.norm(x)
def test_motion_from_plane_homography() -> None:
R = tf.random_rotation_matrix()[:3, :3]
t = no... |
19,632 | items | #!/usr/bin/env python2
"""
collections.py
To avoid other dependencies. Copied OrderedDict from collections.py, and
MutableMapping from _abcoll.
"""
from typing import Any
class OrderedDict(dict):
'Dictionary that remembers insertion order'
# An inherited dict maps keys to values.
# The inherited dict p... |
19,633 | show formats | """distutils.command.bdist
Implements the Distutils 'bdist' command (create a built [binary]
distribution)."""
import os
import warnings
from ..core import Command
from ..errors import DistutilsPlatformError, DistutilsOptionError
from ..util import get_platform
def METHOD_NAME():
"""Print list of available for... |
19,634 | enlarge | from __future__ import absolute_import, division, print_function
from cctbx import sgtbx
from cctbx.uctbx import unit_cell
from rstbx.symmetry.constraints import AGconvert
class symmetrize_reduce_enlarge(object):
# symmetrize the metrical matrix &
# reduce the number of ... |
19,635 | disk to table row | import abc
import operator
from datetime import timedelta
from typing import Optional, Sequence
from rich import box
from rich.console import Group as RichGroup
from rich.console import RenderableType
from rich.table import Table
from rich.text import Text
from neuro_sdk import Disk
from neuro_cli import utils
from ... |
19,636 | test dockerfile framework | from __future__ import annotations
import logging
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from checkov.common.bridgecrew.check_type import CheckType
from checkov.common.runners.runner_registry import RunnerRegistry
from checkov.main import DEFAULT_RUNNERS
from checkov.runner_filter im... |
19,637 | has requirements file | # Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# 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... |
19,638 | decorator | # This file is part of Checkbox.
#
# Copyright 2012-2014 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundatio... |
19,639 | test templates section default nested | """Section plugin default template test suite."""
from cms.api import add_plugin
from cms.models import Placeholder
from richie.apps.core.tests.utils import CMSPluginTestCase
from richie.plugins.section.cms_plugins import SectionPlugin
# pylint: disable=too-many-ancestors
class DefaultTemplatesTestCase(CMSPluginTest... |
19,640 | schedule properties | # 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... |
19,641 | tear down class | "Test outwin, coverage 76%."
from idlelib import outwin
import unittest
from test.support import requires
from tkinter import Tk, Text
from idlelib.idle_test.mock_tk import Mbox_func
from idlelib.idle_test.mock_idle import Func
from unittest import mock
class OutputWindowTest(unittest.TestCase):
@classmethod
... |
19,642 | mark run playwright as started | """
Helper main which starts the playwright record
"""
import errno
import os
import subprocess
import sys
class InstallError(RuntimeError):
"""Error encountered during browser install"""
class RecordingError(RuntimeError):
"""Error encountered during playwright recording"""
def browsers_path():
impor... |
19,643 | command args | #!/usr/bin/env python
"""
update the copyright date in all NeXus text files
This is the bash command to find all matching lines::
grep -iR copyright | grep -i "(c)" | grep -i nexus
See copyright text at bottom of this file for example.
"""
import os, sys
import mimetypes
from build_preparation import ROOT_DIR_EX... |
19,644 | get gpu result | import numpy as np
from kernel_tuner import core
from kernel_tuner.interface import Options, _kernel_options
from kernel_tuner.integration import TuneResults
class PythonKernel(object):
def __init__(self, kernel_name, kernel_string, problem_size, arguments, params=None, inputs=None, outputs=None, device=0, plat... |
19,645 | get normalized command output and leaky tests | #!/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... |
19,646 | run | #!/usr/bin/env python
#
# Copyright 2006, 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... |
19,647 | init | """
This is a simple proxy-minion designed to connect to and communicate with
the bottle-based web service contained in https://github.com/saltstack/salt-contrib/tree/master/proxyminion_rest_example
"""
import logging
import salt.utils.http
HAS_REST_EXAMPLE = True
# This must be present or the Salt loader won't loa... |
19,648 | id | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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
fr... |
19,649 | config update |
# TRex Change
class CAPWAP_PKTS_BUILDER:
@staticmethod
def parse_message_elements(rx_pkt_buf, capwap_hlen, ap, ap_manager):
"""Parses received capwap control packet and update state on given AP."""
raise NotImplementedError
@staticmethod
def discovery(ap):
"""Returns a CAPWAP ... |
19,650 | echo | # Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
19,651 | is done alt | from __future__ import annotations
import logging
from typing import List, Dict, Any
from ..common_neon.solana_tx import SolPubKey, SolCommit
from ..common_neon.layouts import ALTAccountInfo
from ..common_neon.solana_neon_tx_receipt import SolAltIxInfo, SolTxMetaInfo, SolIxMetaInfo
from ..common_neon.constants impor... |
19,652 | test mask flag | import asyncio
import codecs
import dataclasses
import unittest
import unittest.mock
import warnings
from websockets.exceptions import PayloadTooBig, ProtocolError
from websockets.frames import OP_BINARY, OP_CLOSE, OP_PING, OP_PONG, OP_TEXT, CloseCode
from websockets.legacy.framing import *
from .utils import Asyncio... |
19,653 | select response | #!/usr/bin/env python
import difflib
import json
import logging
import numpy as np
import time
from copy import deepcopy
from os import getenv
import sentry_sdk
from flask import Flask, request, jsonify
from common.prompts import send_request_to_prompted_generative_service, compose_sending_variables
from common.utils... |
19,654 | get discount | # type: ignore
import math
import random
from collections import Counter, defaultdict
class KneserNeyLM:
def __init__(self, highest_order, ngrams, start_pad_symbol='<s>',
end_pad_symbol='</s>'):
"""
Constructor for KneserNeyLM.
Params:
highest_order [int] The order... |
19,655 | test update environment configuration bad usr modification | # -*- coding: utf-8 -*-
# Copyright 2017 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 t... |
19,656 | graph rrd | #!/usr/bin/env python
"""RRDtool monitoring relay for rtl_433."""
# Start rtl_433 (rtl_433 -C si -F syslog:127.0.0.1:1433), then this script
from __future__ import print_function
from __future__ import with_statement
import sys
import socket
import time
import json
import rrdtool
# Option: PEP 3143 - Standard daem... |
19,657 | is disconnect | # mysql/mysqlconnector.py
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: ignore-errors
r"""
.. dialect:: mysql+mysqlconnector
:name: My... |
19,658 | set nbest | # Copyright (c) 2022 Binbin Zhang(binbzha@qq.com)
#
# 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 ... |
19,659 | test async callbacks | import pytest
from pybind11_tests import callbacks as m
from threading import Thread
def test_callbacks():
from functools import partial
def func1():
return "func1"
def func2(a, b, c, d):
return "func2", a, b, c, d
def func3(a):
return "func3({})".format(a)
assert m.tes... |
19,660 | compute beta | # /usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,... |
19,661 | get doctest | import types
import unittest
from _typeshed import ExcInfo
from collections.abc import Callable
from typing import Any, NamedTuple
from typing_extensions import TypeAlias
__all__ = [
"register_optionflag",
"DONT_ACCEPT_TRUE_FOR_1",
"DONT_ACCEPT_BLANKLINE",
"NORMALIZE_WHITESPACE",
"ELLIPSIS",
"S... |
19,662 | score | """
Anomaly models base classes
"""
from abc import ABC, abstractmethod
from typing import Dict, Sequence, Union
from darts.ad.scorers.scorers import AnomalyScorer
from darts.ad.utils import (
_to_list,
eval_accuracy_from_scores,
show_anomalies_from_scores,
)
from darts.logging import raise_if_not
from da... |
19,663 | test output | # 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... |
19,664 | test cli connect timeout for blocking | # Copyright 2014 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... |
19,665 | test count without duplicates | # 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... |
19,666 | create block | import os
import shutil
import yaml
from dataclasses import dataclass, field
from jinja2 import Template
from mage_ai.data_preparation.models.block import Block
from mage_ai.data_preparation.models.constants import (
BLOCK_LANGUAGE_TO_FILE_EXTENSION,
BlockColor,
BlockLanguage,
BlockType,
)
from mage_ai.... |
19,667 | has access | """
FileCatalogClientBase is a base class for the clients of file catalog-like
services built within the DIRAC framework.
The class contains variables defining lists of implemented catalog methods
READ_METHODS
WRITE_METHODS
NO_LFN_METHODS
ADMIN_METHODS
Those lists must be complemented ... |
19,668 | get dict | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
19,669 | is faster than | import math
from math import radians, tan
from typing import Tuple
import pyk4a
from flask import Request
from pyk4a import ColorResolution, PyK4ACapture
from arcor2.data.common import BodyJointId, Direction, Position
from arcor2.exceptions import Arcor2Exception
from arcor2.logging import get_logger
from arcor2_kine... |
19,670 | is bliss | #!/usr/bin/env python
"""
Collect statistics about words in a corpus.
"""
from __future__ import annotations
import sys
import _setup_returnn_env # noqa
import returnn.__main__ as rnn
from returnn.log import log
from returnn.config import Config
import argparse
from returnn.util.basic import human_size, parse_orth... |
19,671 | start | import json
import cv2
import base64
import threading
import time
from datetime import datetime
from websocket_server import WebsocketServer
# Graphical User Interface Class
class GUI:
# Initialization function
# The actual initialization
def __init__(self, host):
t = threading.Thread(target=self.... |
19,672 | test store object can be serialized by | import io
import pickle
from unittest import mock
import pytest
from mlflow.environment_variables import MLFLOW_TRACKING_URI
from mlflow.store._unity_catalog.registry.rest_store import UcModelRegistryStore
from mlflow.store.db.db_types import DATABASE_ENGINES
from mlflow.store.model_registry.rest_store import RestSto... |
19,673 | set meta | # -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage,
# (C) 2018 MinIO, 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/lic... |
19,674 | name | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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
fr... |
19,675 | argsparser | # 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... |
19,676 | forward | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import pytest
from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers.models.llama.modeling_llama import apply_rotary_pos_emb, rotate_half
try:
from vllm import pos_encoding_ops
rotary_embedding_neox = pos_en... |
19,677 | class setup | try:
# installed by bootstrap.py
import sqla_plugin_base as plugin_base
except ImportError:
# assume we're a package, use traditional import
from . import plugin_base
import pytest
import argparse
import inspect
import collections
import os
try:
import xdist # noqa
has_xdist = True
except Imp... |
19,678 | modelstr | #!/usr/bin/env python
#############################################################################
# DellEmc S5248F
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#####... |
19,679 | parse hours | import json
import scrapy
from locations.categories import Categories
from locations.geo import MILES_TO_KILOMETERS, vincenty_distance
from locations.items import Feature
DAYS_NAME = {
"MO": "Mo",
"TU": "Tu",
"WE": "We",
"TH": "Th",
"FR": "Fr",
"SA": "Sa",
"SU": "Su",
}
USPS_URL = "https:... |
19,680 | inv | from typing import List
from uuid import UUID
import click.testing
import pytest
from boltons.urlutils import URL
import ereuse_devicehub.cli
from ereuse_devicehub.db import db
from ereuse_devicehub.devicehub import Devicehub
from ereuse_devicehub.resources.agent.models import Organization
from ereuse_devicehub.resou... |
19,681 | forward | import torch
import torch.distributed as dist
from torch import nn
from torch.nn.parallel import DistributedDataParallel
from torch.testing._internal.dist_utils import INIT_METHOD_TEMPLATE, dist_init
from torch.testing._internal.distributed.rpc.rpc_agent_test_fixture import (
RpcAgentTestFixture,
)
from torch.test... |
19,682 | test full migration logging | import logging
import re
import shutil
import netCDF4
import numpy as np
import pytest
import ert.storage
import ert.storage.migration._block_fs_native as bfn
import ert.storage.migration.block_fs as bf
from ert.config import ErtConfig
from ert.storage.local_storage import local_storage_set_ert_config
@pytest.fixtu... |
19,683 | expect raises | import contextlib
import re
import sys
def eq_(a, b, msg=None):
"""Assert a == b, with repr messaging on failure."""
assert a == b, msg or "%r != %r" % (a, b)
def ne_(a, b, msg=None):
"""Assert a != b, with repr messaging on failure."""
assert a != b, msg or "%r == %r" % (a, b)
def in_(a, b, msg=N... |
19,684 | add metadata | """
Filtering and preprocessing of buildings, streets and amenities from OpenStreetMap
"""
import os
from egon.data import db
from egon.data.datasets import Dataset
def execute_sql_script(script):
"""Execute SQL script
Parameters
----------
script : str
Filename of script
"""
db.ex... |
19,685 | record query | from typing import Any, Mapping, Optional, Union
import sentry_sdk
from sentry_sdk import Hub
from snuba import environment, settings, state
from snuba.datasets.storage import StorageNotAvailable
from snuba.query.exceptions import QueryPlanException
from snuba.querylog.query_metadata import QueryStatus, SnubaQueryMet... |
19,686 | flush metrics | # NOTE: keeps for compatibility
from __future__ import annotations
from typing import Any, Callable, Dict, List, Optional
from aws_lambda_powertools.metrics.provider.datadog.datadog import DatadogProvider
class DatadogMetrics:
"""
DatadogProvider creates metrics asynchronously via Datadog extension or expor... |
19,687 | get steps complete | from collections import Counter
from typing import List, Optional
from sqlalchemy.orm.session import Session
from src.challenges.challenge import (
ChallengeManager,
ChallengeUpdater,
FullEventMetadata,
)
from src.challenges.challenge_event import ChallengeEvent
from src.models.rewards.profile_completion_... |
19,688 | test volume integration 2 d | try:
from . import common as c
except BaseException:
import common as c
class VolumeIntegrationTest(c.unittest.TestCase):
def test_volume_integration_1D(self):
"""
Test volume integration for splines using numerical integration of the
Jacobi-Determinant
"""
# Test 1... |
19,689 | test trj no natoms | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#... |
19,690 | getdiffs | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2021 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
import time
import datetime
import logging
import re
from lib389.utils import cmp
log = logging.getLogger(__name__)
cl... |
19,691 | 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... |
19,692 | get list of fxcodes | """
Spot fx prices
"""
import numpy as np
import pandas as pd
import datetime
from sysdata.base_data import baseData
from syscore.pandas.merge_data_keeping_past_data import SPIKE_IN_DATA
from syslogging.logger import *
from sysobjects.spot_fx_prices import fxPrices, get_fx_tuple_from_code, DEFAULT_CURRENCY
DEFAULT_... |
19,693 | test system identity override 1 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
19,694 | build vocab | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
19,695 | test loading page | """Test main handlers"""
import time
from urllib.parse import quote, urlparse
import jwt
import pytest
from bs4 import BeautifulSoup
from binderhub import __version__ as binder_version
from .utils import async_requests
@pytest.mark.parametrize(
"old_url, new_url",
[
(
"/repo/binderhub-... |
19,696 | copy clicked | from .. import exporters as exporters
from .. import functions as fn
from ..graphicsItems.PlotItem import PlotItem
from ..graphicsItems.ViewBox import ViewBox
from ..Qt import QtCore, QtWidgets
from . import exportDialogTemplate_generic as ui_template
class FormatExportListWidgetItem(QtWidgets.QListWidgetItem):
d... |
19,697 | mime extensions | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os.path as osp
from itertools import filterfalse
from .jlpmapp import HERE
def pjoin(*args):
"""Join paths to create a real path."""
return osp.abspath(osp.join(*args))
def _get_default_... |
19,698 | models | import pytest
from dbt.tests.util import run_dbt, copy_file, read_file, check_relations_equal
ephemeral_copy_sql = """
{{
config(
materialized = "ephemeral"
)
}}
select * from {{ this.schema }}.users
"""
ephemeral_summary_sql = """
{{
config(
materialized = "table"
)
}}
select gender, count(*) as c... |
19,699 | set intercom | import numpy as np
import pandas as pd
from pprint import pprint
import pygama.dsp.calculators as pc
import pygama.dsp.oldtransforms as pt
from ..utils import update_progress
class Processor:
"""
base class for Tier 1 processors.
- calculators.py - calculate single values from a waveform
- transforms.p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.