id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
7,700 | get current verbosity level | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... |
7,701 | test commentline element unlink | """Comment and comment line items connection adapters tests."""
from typing import TypeVar
from gaphor import UML
from gaphor.core.modeling import Comment
from gaphor.diagram.general.comment import CommentItem
from gaphor.diagram.general.commentline import CommentLineItem
from gaphor.diagram.tests.fixtures import all... |
7,702 | size | import mimetypes
import datetime
from azure.common import AzureMissingResourceHttpError
from azure.storage.blob import BlockBlobService
from azure.storage.blob.models import ContentSettings
from django.core.files.storage import Storage
from django.conf import settings
from django.utils.deconstruct import deconstructi... |
7,703 | test module import | import contextlib
import imp
import importlib
import sys
import unittest
@contextlib.contextmanager
def uncache(*names):
"""Uncache a module from sys.modules.
A basic sanity check is performed to prevent uncaching modules that either
cannot/shouldn't be uncached.
"""
for name in names:
i... |
7,704 | get args | # coding=utf-8
# Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... |
7,705 | storbinary | import sys
from _typeshed import SupportsRead, SupportsReadline
from collections.abc import Callable, Iterable, Iterator
from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import Any, TextIO
from typing_extensions import Literal, Self
__all__ = ["FTP", "error_reply", "erro... |
7,706 | get loggen bin | #!/usr/bin/env python
#############################################################################
# Copyright (c) 2015-2018 Balabit
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published
# by the Free Software Foundation, ... |
7,707 | get | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable... |
7,708 | mock set password | #!/usr/bin/env python
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
#
from __future__ import annotations
import json
import os
from unittest.mock import Mock, patch
import pytest
import snowflake.connector
from snowflake.connector.compat import IS_LINUX
from snowflake.connector.errors im... |
7,709 | validate | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
7,710 | repr np array | # Copyright (c) Princeton University.
# This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.
# Authors: Alexander Raistrick
from pathlib import Path
import pdb
import numpy as np
from util import blender as butil
from nodes.node_transpiler... |
7,711 | header set | # 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... |
7,712 | xml basic value | import dataclasses
from typing import Iterator
from django.http import HttpResponse
from django.utils.timezone import make_naive
import tablib
from lxml import etree
from tablib.formats._json import serialize_objects_handler
from .models import Submission
from .query import SubmissionQuerySet
from .rendering.base im... |
7,713 | 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 . imp... |
7,714 | test get tracker for check | import pytest
from tribler.core.components.torrent_checker.torrent_checker.tracker_manager import TrackerManager
# pylint: disable=redefined-outer-name
@pytest.fixture
def tracker_manager(tmp_path, metadata_store):
return TrackerManager(state_dir=tmp_path, metadata_store=metadata_store)
def test_add_tracker(t... |
7,715 | cohort | from unittest import mock
import pytest
from pyramid.request import apply_request_extensions
from h import models
from h.services.feature import (
FeatureRequestProperty,
FeatureService,
UnknownFeatureError,
feature_service_factory,
)
class TestFeatureRequestProperty:
def test_single_feature_fet... |
7,716 | get admin user detail | #!/usr/bin/env python
import requests
import sys
admin_username = 'admin'
admin_password = 'admin'
domain_url = 'http://localhost:8080'
class UserCreation:
headers = {}
def __init__(self, username, password, domain):
self.username = username
self.password = password
self.domain = do... |
7,717 | crop image | import os
import math
import random
import functools
import numpy as np
import paddle
from PIL import Image, ImageEnhance
from paddle.io import Dataset
random.seed(0)
np.random.seed(0)
DATA_DIM = 224
RESIZE_DIM = 256
THREAD = 16
BUF_SIZE = 10240
DATA_DIR = 'data/ILSVRC2012/'
DATA_DIR = os.path.join(os.path.split(os... |
7,718 | splus rule24 | # 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":... |
7,719 | test extract coords no coords | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for the helper functions for v1 API.
"""
import pytest
import nominatim.api.v1.helpers as helper
... |
7,720 | websocket handler | import asyncio
import json
import os
import weakref
from functools import partial
import aiohttp
import numpy as np
from aiohttp import MultipartWriter, WSCloseCode, web
try:
from aiortc import RTCPeerConnection, RTCSessionDescription
from aiortc.contrib.media import MediaRelay
WEBRTC_AVAILABLE = True
ex... |
7,721 | set if gain | from optparse import OptionParser
import Initializer
from InputHandlerThread import InputHandlerThread
Initializer.init_path()
from gnuradio import blocks
from gnuradio import gr
import osmosdr
class top_block(gr.top_block):
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gai... |
7,722 | write | # Copyright (C) 2006-2014 Bastian Kleineidam
#
# 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 distr... |
7,723 | panoptic quality | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
7,724 | xaxis np dt64 transform | import cudf
import dask_cudf
import logging
import panel as pn
from bokeh.models import ColumnDataSource
from panel.config import panel_extension
from typing import Dict, Literal
from ...assets import datetime as dt
class BaseChart:
chart_type: str = None
x: str = None
y: str = None
aggregate_fn: str... |
7,725 | final | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
7,726 | set columns width | # Created By: Virgil Dupras
# Created On: 2009-11-25
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... |
7,727 | test user list | # Copyright (C) 2015 Lukas Rist <glaslos@gmail.com>
#
# 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 i... |
7,728 | rest url | """
Web terminal API.
"""
from io import StringIO
from datetime import datetime, timedelta
from oauthlib.common import generate_token
import shlex
from bottle import abort, httplib, local, post, request
from codalab.client.json_api_client import JsonApiClient
from codalab.common import UsageError
from codalab.lib imp... |
7,729 | test function import quant type | # Owner(s): ["oncall: quantization"]
from .common import AOMigrationTestCase
class TestAOMigrationQuantization(AOMigrationTestCase):
r"""Modules and functions related to the
`torch/quantization` migration to `torch/ao/quantization`.
"""
def test_function_import_quantize(self):
function_list =... |
7,730 | test find grid from directions 2d | from collections import OrderedDict
import numpy as np
from numpy.testing import assert_array_equal
from plottr.utils import num
def test_array_equality():
"""Test if two arrays are correctly identified as having equal content"""
# different dtype should not matter
a = np.arange(2 * 4).astype(int).resh... |
7,731 | test create csv response empty | """ Tests for analytics.csvs """
import pytest
from django.test import TestCase
from lms.djangoapps.instructor_analytics.csvs import create_csv_response, format_dictlist, format_instances
class TestAnalyticsCSVS(TestCase):
""" Test analytics rendering of csv files."""
def test_create_csv_response_nodata(s... |
7,732 | test excessive getattr | import unittest
import builtins
import rlcompleter
class CompleteMe:
""" Trivial class used in testing rlcompleter.Completer. """
spam = 1
class TestRlcompleter(unittest.TestCase):
def setUp(self):
self.stdcompleter = rlcompleter.Completer()
self.completer = rlcompleter.Completer(dict(spa... |
7,733 | set vertices | from __future__ import annotations
import itertools
from typing import Any, List, Dict, Optional, Tuple, TYPE_CHECKING
from igraph import Graph
from checkov.common.graph.checks_infra.enums import SolverType
from checkov.common.graph.checks_infra.solvers.base_solver import BaseSolver
from checkov.common.graph.graph_b... |
7,734 | test domain size | import numpy as np
import yt # NOQA
from yt.frontends.amrvac.api import AMRVACDataset, AMRVACGrid
from yt.testing import requires_file
from yt.units import YTArray
from yt.utilities.answer_testing.framework import (
data_dir_load,
requires_ds,
small_patch_amr,
)
blastwave_spherical_2D = "amrvac/bw_2d0000... |
7,735 | f1 | # 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... |
7,736 | test variable gpu output | #!/usr/bin/env python3
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. 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
... |
7,737 | iteritems | # Copyright 2014-2020 Scalyr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
7,738 | operation location | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from flask ... |
7,739 | list project comments | """ Handlers for project comments operations
"""
import functools
import logging
from typing import Any
from aiohttp import web
from models_library.projects import ProjectID
from models_library.projects_comments import CommentID
from models_library.rest_pagination import (
DEFAULT_NUMBER_OF_ITEMS_PER_PAGE,
M... |
7,740 | run commands | from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
from collections.abc import Iterable, Mapping
from distutils.cmd import Command
from re import Pattern
from typing import IO, Any, ClassVar, TypeVar, overload
from typing_extensions import TypeAlias
command_re: Pattern[str]
_OptionsList: TypeAlias ... |
7,741 | load | # Copyright 2023 The Flax 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 wri... |
7,742 | markdown | import datetime
import json
import re
import yaml
from django import template
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.template.defaultfilters import date
from django.utils.html import escape, strip_tags
from django.utils.safestring import mark_safe
from M... |
7,743 | test added tokens do lower case | # coding=utf-8
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2021 The HuggingFace Team. 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
#
# ... |
7,744 | bad case6 | # pylint: disable=unnecessary-comprehension,missing-docstring,too-few-public-methods,unnecessary-direct-lambda-call
"""Tests for loopvar-in-closure."""
from enum import Enum
def good_case():
"""No problems here."""
lst = []
for i in range(10):
lst.append(i)
def good_case2():
"""No problems... |
7,745 | get | from flask import request
from flask_restplus import Resource, inputs
from werkzeug.exceptions import NotFound, BadRequest
from datetime import datetime, timezone
from app.extensions import api
from app.api.utils.resources_mixins import UserMixin
from werkzeug.exceptions import InternalServerError
from app.api.activit... |
7,746 | test delete mine report | import json
import uuid
import pytest
from app.api.mines.mine.models.mine import Mine
from app.api.mines.reports.models.mine_report import MineReport
from app.api.mines.reports.models.mine_report_definition import MineReportDefinition
from app.api.constants import MINE_REPORT_TYPE
from tests.factories import MineFact... |
7,747 | init subtokenizer | # Copyright 2018 MLBenchmark Group. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
7,748 | create | # ***************************************************************************
# * Copyright (c) 2023 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
7,749 | insert data to couch | #!/usr/bin/env python
from __future__ import print_function
import json
import os
import unittest
from http.client import HTTPException
from WMCore_t.ReqMgr_t.TestConfig import config
from WMCore.REST.Test import fake_authz_headers
from WMCore.Services.ReqMgr.ReqMgr import ReqMgr
from WMQuality.REST.RESTBaseUnitTes... |
7,750 | test query by user | import datetime
from unittest.mock import patch
import uuid
from collections import namedtuple
from django.test import SimpleTestCase
from corehq.apps.es.client import manager
from corehq.apps.es.forms import FormES, form_adapter
from corehq.apps.es.tests.utils import es_test
from corehq.form_processor.utils import T... |
7,751 | debug time | # -*- encoding: utf-8 -*-
from contextlib import contextmanager
from datetime import datetime
import sys
from traceback import format_exception
import colorama
from .conf import settings
from . import const
def color(color_):
"""Utility for ability to disabling colored output."""
if settings.no_colors:
... |
7,752 | test trial component name | # Copyright 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 accompan... |
7,753 | get exception | """Different kinds of SAX Exceptions"""
import sys
if sys.platform[:4] == "java":
from java.lang import Exception
del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can contain
basic error or warning information from either the XML parser o... |
7,754 | to str | # 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 use ... |
7,755 | test display kb | # Copyright (c) 2020 Guangwang Huang
#
# 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, dis... |
7,756 | register | import astf_path
class MyNDRPlugin():
def __init__(self):
pass
def pre_iteration(self, run_results=None, **kwargs):
""" Function ran before each iteration.
:parameters:
run_results: dict
A dictionary that contains the following keys (might be em... |
7,757 | find name | import re
import uuid
from brian2.core.tracking import Trackable
from brian2.utils.logger import get_logger
__all__ = ["Nameable"]
logger = get_logger(__name__)
def METHOD_NAME(name, names=None):
"""
Determine a unique name. If the desired ``name`` is already taken, will try
to use a derived ``name_1``... |
7,758 | check schema | """
typing.Protocol classes for jsonschema interfaces.
"""
# for reference material on Protocols, see
# https://www.python.org/dev/peps/pep-0544/
from __future__ import annotations
from collections.abc import Mapping
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Iterable,
Protocol,
run... |
7,759 | test cpu vgg16 default | # Copyright 2018 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... |
7,760 | main | #!/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.
"""
Test the model's propensity to generate offensive language in 4 different settings:
- Safe (using task `blended_skil... |
7,761 | test quick sort | """
Measures the relative speeds of quicksort and selection sort.
The current output is human readable, but for large-scale experiments you will
want to modify it so that the output can be graphed
(e.g. generate CSV to put in a spreadsheet, or introduce a plotting library).
You should also consider generating special ... |
7,762 | parse yaml | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Matt Martz <matt@sivel.net>
# Copyright (C) 2015 Rackspace US, 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 ... |
7,763 | succeed record | import csv
import datetime
import re
import time
from django.core.management.base import BaseCommand
from corehq.motech.repeaters.const import RECORD_CANCELLED_STATE
from corehq.motech.repeaters.dbaccessors import iter_repeat_records_by_domain
from corehq.motech.repeaters.models import RepeatRecordAttempt, Repeater
... |
7,764 | age | # Copyright 2020-2023 OpenDR European Project
#
# 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 agree... |
7,765 | test positive | # Copyright (c) 2012-2023, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions an... |
7,766 | main | # Copyright 2019 DeepMind Technologies 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 agr... |
7,767 | test update with resource class | import re
import pytest
from cognite.client.data_classes import DataSet, DataSetList, DataSetUpdate, TimestampRange
from tests.utils import jsgz_load
@pytest.fixture
def dataset_update():
yield DataSetUpdate(id=1).description.set("_")
@pytest.fixture
def mock_ds_response(rsps, cognite_client):
response_bo... |
7,768 | find entry points | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
import string
import sys
from subprocess import Popen, P... |
7,769 | on change mode | import copy
from typing import Dict, Any
from PyQt5.QtWidgets import QDialog, QTextEdit, QVBoxLayout, QLabel
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QComboBox
from btchip.btchip import BTChipException
from electrumsv.gui.qt.password_dialog import PasswordLineEdit
from electrumsv.i18n import _
from electrums... |
7,770 | get internal address | # 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... |
7,771 | select action | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#******************************************************************************
# ZYNTHIAN PROJECT: Zynthian GUI
#
# Zynthian GUI ZS3 screen
#
# Copyright (C) 2018 Fernando Moyano <jofemodo@zynthian.org>
#
#**********************************************************************... |
7,772 | settimeout | #############################################################################
# Celestica Seastone2
#
# Watchdog contains an implementation of SONiC Platform Base API
#
#############################################################################
import os
import time
try:
from sonic_platform_base.watchdog_base im... |
7,773 | path mask | """Alignment path plotting utilities."""
import numpy as np
from sktime.distances._distance import distance_alignment_path, pairwise_distance
from sktime.utils.validation._dependencies import _check_soft_dependencies
_check_soft_dependencies("matplotlib", severity="warning")
def METHOD_NAME(cost_matrix, path, ax, t... |
7,774 | test random deploy | from os import path
from random import shuffle
from pyinfra import inventory, state
from pyinfra.context import ctx_state
from ..paramiko_util import PatchSSHTestCase
from .util import run_cli
class TestCliDeploy(PatchSSHTestCase):
def test_interdependent_deploy(self):
ctx_state.reset()
result ... |
7,775 | enable xla jit | import os
import random
import numpy as np
from . import backend as bkd
from .backend import backend_name, tf, torch, paddle
from .real import Real
# Data parallel
parallel_scaling = None
# Data parallel via Horovod
hvd = None
comm = None
world_size = 1
rank = 0
if "OMPI_COMM_WORLD_SIZE" in os.environ:
if backen... |
7,776 | unparse key | # -*- coding: utf-8 -*-
""" Unflatten nested dict/array data
*** This is a modified version of the original unflatten.py from https://github.com/dairiki/unflatten, which is
published under the license ***
Copyright (C) 2018 Geoffrey T. Dairiki
All rights reserved.
Redistribution and use in source and binary forms, wi... |
7,777 | generate compilation database | #!/usr/bin/env python3
# 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
... |
7,778 | prepare 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... |
7,779 | main | """This example is about domain adaptation for action recognition, using PyTorch Lightning.
Reference: https://github.com/thuml/CDAN/blob/master/pytorch/train_image.py
"""
import argparse
import logging
import pytorch_lightning as pl
from config import get_cfg_defaults
from model import get_model
from pytorch_lightn... |
7,780 | register plugin settings | from __future__ import annotations
import logging
import os
from typing import cast
import settngs
import comicapi.comicarchive
import comicapi.utils
import comictaggerlib.ctsettings
from comicapi.comicarchive import Archiver
from comictaggerlib.ctsettings.settngs_namespace import settngs_namespace as ct_ns
from com... |
7,781 | update dependent fields | import json
import logging
import math
from typing_extensions import Literal
from pydantic import Field
from devtools import debug
from mxcubecore.model.common import (
CommonCollectionParamters,
PathParameters,
LegacyParameters,
StandardCollectionParameters,
)
from mxcubecore import HardwareReposit... |
7,782 | tic k t o sec | # Generated by h2py from /usr/include/sys/types.h
# Included from sys/isa_defs.h
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
_LONG_ALIGNMENT = 8
_LONG_LONG_ALIGNMENT = 8
_DOUBLE_ALIGNMENT = 8
_LONG_DOUBLE_ALIGNMENT = 16
_POINTER_ALIGNMENT = 8
_MAX_ALIGNMENT = 16
_ALIGNMENT_REQUIRED = 1
_CHAR_ALIGNMENT ... |
7,783 | get library path | #**********************************************************************
# Copyright 2020 Advanced Micro Devices, Inc
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... |
7,784 | test call rpc handle reauthenticate | '''
Author: Ricardo Mateus <rmateus@suse.com>
'''
import pytest
from unittest.mock import MagicMock, patch, call
from . import mockery
mockery.setup_environment()
import sys
from ..modules import uyuni_config
from ..modules.uyuni_config import RPCClient, UyuniChannelsException, UyuniUsersException
class TestRPCCli... |
7,785 | test pair sequence | from __future__ import annotations
import unittest
from functools import partial
from typing import Any, MutableMapping
from unittest.mock import Mock, patch
import pytest
from sentry.testutils.cases import TestCase
from sentry.utils.canonical import CanonicalKeyDict
from sentry.utils.safe import (
get_path,
... |
7,786 | test youtube search matching | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
import collections
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import gettestcases
from youtube_dl.extractor import (
FacebookIE,
... |
7,787 | test statistics | # -*- coding: utf-8 -*-
#
# test_connect_symmetric_pairwise_bernoulli.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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, eithe... |
7,788 | copy | # Copyright (c) 2015, Hubert Kario
#
# See the LICENSE file for legal information regarding use of this file.
"""Handling cryptographic hashes for handshake protocol"""
from .utils.compat import compat26Str, compatHMAC
from .utils.cryptomath import MD5, SHA1
from .utils import tlshashlib as hashlib
class HandshakeHas... |
7,789 | test delete ticket holder with valid order | import datetime
from datetime import timedelta, timezone
from app.api.helpers.db import get_or_create
from app.api.helpers.scheduled_jobs import (
delete_ticket_holders_no_order_id,
expire_initializing_tickets,
expire_pending_tickets,
send_monthly_event_invoice,
this_month_date,
)
from app.api.help... |
7,790 | create task macplist | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2008-2018 (ita)
"""
MacOSX related tools
"""
import os, shutil, platform
from waflib import Task, Utils
from waflib.TaskGen import taskgen_method, feature, after_method, before_method
app_info = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "f... |
7,791 | load json conf | #
# Copyright 2019 The FATE 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... |
7,792 | build linux unsecured test | #!/usr/bin/python
# pylint: disable=C0103
# pylint: disable=C0114
# pylint: disable=C0116
# pylint: disable=W0613
# pylint: disable=W1508
# pylint: disable=R1732
import os
import sys
import platform
import subprocess
import multiprocessing
build_option_param = {
"DYNAMIC": 1,
"IPV4": 1,
"TCP": 1
}
# hel... |
7,793 | test exit reduces connection to zero | import unittest
from mock import patch
import controllers.array_action.array_connection_manager as array_connection_manager
import controllers.tests.array_action.test_settings as array_settings
import controllers.tests.common.test_settings as common_settings
from controllers.array_action.array_connection_manager impo... |
7,794 | create file | # Copyright 2022. ThingsBoard
#
# 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 ... |
7,795 | dummy batches | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
from typing import Dict, List, Mapping, Tuple, Union
import pytest
import torch
from composer.core.data_spec import _default_split_batch, _split_list, _split_tensor
def dummy_tensor_batch(batch_size=12) -> torch.Tensor:
return tor... |
7,796 | node operations entry criteria | import logging
from ocs_ci.framework import config
from ocs_ci.ocs import node, exceptions, constants
from ocs_ci.ocs.node import wait_for_nodes_status
from ocs_ci.ocs.resources import pod as pod_helpers
from ocs_ci.ocs.resources.pod import wait_for_storage_pods
from ocs_ci.utility.utils import TimeoutSampler, ceph_he... |
7,797 | stop | #!/usr/bin/env python
import time
import traceback
from queue import Empty
from threading import Lock
from GangaCore.Core.GangaThread.GangaThread import GangaThread
from GangaCore.Core.GangaThread.MTRunner.Data import DuplicateDataItemError
from GangaCore.Utility.logging import getLogger
from .Algorithm import Algor... |
7,798 | test composer metadata in state dict | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
import pathlib
import random
import pytest
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
import composer
from composer.core import Batch, Precision, State
from composer.devices import DeviceCPU, De... |
7,799 | list runtime versions | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.