id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
13,100 | max nb | # Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
import numpy as np
import logging
try:
from numba i... |
13,101 | 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
from . im... |
13,102 | process licenses | #!/bin/true
#
# license.py - part of autospec
# Copyright (C) 2015 Intel Corporation
#
# 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 ... |
13,103 | set final index config | import json
import logging
import time
from django.conf import settings
from usaspending_api.awards.v2.lookups.elasticsearch_lookups import INDEX_ALIASES_TO_AWARD_TYPES
from usaspending_api.etl.elasticsearch_loader_helpers.utilities import format_log, is_snapshot_running
logger = logging.getLogger("script")
ES_AWAR... |
13,104 | write data file | #!/usr/bin/env python
""" MultiQC Utility functions, used in a variety of places. """
import io
import json
import os
import shutil
import sys
import time
import yaml
from . import config
def robust_rmtree(path, logger=None, max_retries=10):
"""Robustly tries to delete paths.
Retries several times (with ... |
13,105 | bytecode storage | """
abstract: Tests [EIP-5656: MCOPY - Memory copying instruction](https://eips.ethereum.org/EIPS/eip-5656)
Test memory copy under different call contexts [EIP-5656: MCOPY - Memory copying instruction](https://eips.ethereum.org/EIPS/eip-5656)
""" # noqa: E501
from itertools import cycle, islice
from typing impor... |
13,106 | test nested character group compile | from __future__ import absolute_import
import unittest
try:
import regex as re
_regex_available = True
except ImportError:
import re
_regex_available = False
from django.test import TestCase
from ner_v1.detectors.pattern.regex.regex_detection import RegexDetector
class TestRegexDetector(TestCas... |
13,107 | propagate | import gc
import traceback
import torch
from torch.fx.node import Node, map_aggregate
from atorch.utils.meta_model_utils import move_args_kwargs_to_device, reload_meta_module
from atorch.utils.sharding_spec import _extract_sharding_spec
from atorch.utils.version import torch_version
class SpecProp(torch.fx.Interpre... |
13,108 | escape bytes | import datetime
from decimal import Decimal
from .err import DataError
import re
import time
def escape_item(val, mapping=None):
if mapping is None:
mapping = encoders
encoder = mapping.get(type(val))
# Fallback to default when no encoder found
if not encoder:
try:
encoder... |
13,109 | mic getline | #!/usr/bin/env python
##
# Copyright (c) 2008 Jelmer Vernooij <jelmer@samba.org>
#
# 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 requ... |
13,110 | get size | # (C) Copyright 2004-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
13,111 | add auth | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import sys
from http.client import HTTPMessage
from http.server import BaseHTTPRequestHandler
from types import SimpleNamespace
import pytest
from pants.backend.url_handlers.s3.register ... |
13,112 | inv mapping func | import copy
import numpy as np
import time
import torch
from funasr.modules.eend_ola.utils.power import create_powerlabel
from itertools import combinations
metrics = [
('diarization_error', 'speaker_scored', 'DER'),
('speech_miss', 'speech_scored', 'SAD_MR'),
('speech_falarm', 'speech_scored', 'SAD_FR'),
... |
13,113 | ordered indices | # 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 torch
from . import FairseqDataset
class TransformEosDataset(FairseqDataset):
"""A :class:`~fairseq.data.FairseqDataset` wrapper... |
13,114 | test graph communication error | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
13,115 | get next | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
13,116 | get ordered | import abc
import os
import sys
from contextlib import contextmanager
from .exceptions import OrderError
@contextmanager
def suppress_stdout():
with open(os.devnull, "w") as devnull:
old_stdout = sys.stdout
old_stderr = sys.stderr
sys.stdout = devnull
sys.stderr = devnull
t... |
13,117 | csfield definition get quantity type | #-------------------------------------------------------------------------------
# FieldDefinition
#-------------------------------------------------------------------------------
class FieldDefinitionAbstractAPI:
@staticmethod
def init_field_definition_environment(object):
pass
@staticmethod
def finish_field_d... |
13,118 | size | # 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... |
13,119 | format time | # pylint: disable-msg=R0904
import json
import time
from django.urls import reverse
from mediathread.api import ClassLevelAuthentication, UserResource
from mediathread.assetmgr.models import Asset, Source
from mediathread.djangosherd.api import SherdNoteResource
from tastypie import fields
from tastypie.resources impor... |
13,120 | l a measurement | import FWCore.ParameterSet.Config as cms
byLayer = cms.int32(0)
byModule = cms.int32(1)
byModuleSummary = cms.int32(2)
METHOD_WIDTH = cms.int32( 1 )
METHOD_PROB1 = cms.int32( 2 )
METHOD_AVGV2 = cms.int32( 4 )
METHOD_AVGV3 = cms.int32( 8 )
METHOD_RMSV2 = cms.int32( 16 )
METHOD_RMSV3 = cms.int32( 32 )
def LA... |
13,121 | 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__ ... |
13,122 | wrap resource for execution | from contextlib import contextmanager
from typing import Any, Dict, Generator, Mapping, Optional, cast
import dagster._check as check
from dagster._config import process_config
from dagster._core.definitions.resource_definition import (
ResourceDefinition,
Resources,
ScopedResourcesBuilder,
)
from dagster.... |
13,123 | sequence loc formatter | """
Identification of the ribosomal binding site
============================================
In this example we identify the ribosomal binding site on mRNA, also
called *Shine–Dalgarno* sequence, in *Escherichia coli*.
In the beginning of the translation the 16S rRNA of the ribosome
recognizes this purine-rich regio... |
13,124 | test write update | """ tests for otupdate.buildroot.file_actions
Checks functionality and error cases for the update utility functions there
"""
import binascii
import hashlib
import os
import subprocess
from unittest import mock
import zipfile
import pytest
from otupdate.buildroot import update_actions
from otupdate.common import fil... |
13,125 | test missing asic evpn info | import json
import os
import pytest
from deepdiff import DeepDiff
from dump.helper import create_template_dict, populate_mock
from dump.plugins.evpn import Evpn
from dump.match_infra import MatchEngine, ConnectionPool
from swsscommon.swsscommon import SonicV2Connector
from utilities_common.constants import DEFAULT_NAME... |
13,126 | test retry on error set | import pytest
from redis.asyncio import Redis
from redis.asyncio.connection import Connection, UnixDomainSocketConnection
from redis.asyncio.retry import Retry
from redis.backoff import AbstractBackoff, ExponentialBackoff, NoBackoff
from redis.exceptions import ConnectionError, TimeoutError
class BackoffMock(Abstract... |
13,127 | host | """ZMQServer Driver."""
from schema import Use, Or
import zmq
from testplan.common.config import ConfigOption
from testplan.common.utils.documentation_helper import emphasized
from testplan.common.utils.timing import retry_until_timeout
from ..base import Driver, DriverConfig
class ZMQServerConfig(DriverConfig):
... |
13,128 | test parse value for display precision incorrect | import pytest
import numpy as np
import logging
from qtpy.QtWidgets import QWidget
from pydm.widgets.display_format import DisplayFormat, parse_value_for_display
# --------------------
# POSITIVE TEST CASES
# --------------------
@pytest.mark.parametrize("value, precision, display_format, widget, expected", [
... |
13,129 | add disabler | import functools
import re
from robot.api.parsing import Comment, ModelVisitor, Token
def skip_if_disabled(func):
"""
Do not transform node if it's not within passed ``start_line`` and ``end_line`` or
it does match any ``# robotidy: off`` disabler
"""
@functools.wraps(func)
def wrapper(self,... |
13,130 | reindex command | import os
import click
import dagster._check as check
from dagster._core.instance import DagsterInstance
from .utils import get_instance_for_cli
@click.group(name="instance")
def instance_cli():
"""Commands for working with the current Dagster instance."""
@instance_cli.command(name="info", help="List the in... |
13,131 | get class definition | #!/usr/bin/env python3
import argparse
import sys
import re
from rest_client_generator import RestClientGenerator
class PythonClientGenerator(RestClientGenerator):
def __init__(self, server_url, output_dir):
super().__init__(server_url, output_dir)
self.param_types = {
'string': 's... |
13,132 | rdoc | """Diagnostic functions, mainly for use when doing tech support."""
# Use of this source code is governed by the MIT license.
__license__ = "MIT"
import cProfile
from io import BytesIO
from html.parser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__
from bs4.builder import builder_registry
im... |
13,133 | test substance filtering protocol | """
Units tests for openff.evaluator.protocols.miscellaneous
"""
import operator
import random
import tempfile
from functools import reduce
import pytest
from openff.units import unit
from openff.evaluator.backends import ComputeResources
from openff.evaluator.forcefield import ParameterGradient, ParameterGradientKey... |
13,134 | test valid endpoint url | # 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... |
13,135 | get sprite hash | import functools
import hashlib
from django.conf import settings
from django.http import Http404
from django.urls import include, path, re_path
from django.views.decorators.cache import never_cache
from django.views.defaults import page_not_found
from django.views.generic import TemplateView
from django.views.i18n imp... |
13,136 | test string argument | # coding: utf-8
import pytest
import rpy2.rinterface as rinterface
import rpy2.rlike.container as rlc
rinterface.initr()
def _noconsole(x):
pass
@pytest.fixture(scope='module')
def silent_consolewrite():
module = rinterface.callbacks
name = 'consolewrite_print'
backup_func = getattr(module, name)
... |
13,137 | log | import datetime
from syscore.constants import arg_not_supplied
from syslogging.logger import *
LOG_CLEARED = object()
NO_LOG_ENTRY = object()
FREQUENCY_TO_CHECK_LOG_MINUTES = 10
class reportStatus(object):
## Report on status when waiting and paused, ensures we don't spam the log
def __init__(self, METHOD_N... |
13,138 | get object | from sqlalchemy import and_
from tangos import Base, Creator, get_default_session
from tangos.core import (HaloProperty, Simulation, SimulationObjectBase,
TimeStep)
def all_simulations(session=None):
if session is None:
session = get_default_session()
return session.query(Sim... |
13,139 | test unicode text row | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
13,140 | divider and more menu | import six.moves.urllib.parse
from collections import namedtuple
from django.urls import reverse
from django.utils.translation import gettext as _
def dropdown_dict(title, url=None, html=None,
is_header=False, is_divider=False, data_id=None,
second_level_dropdowns=[]):
if seco... |
13,141 | test pandas input fn | # Copyright (c) Recommenders contributors.
# Licensed under the MIT License.
import itertools
import os
import numpy as np
import pandas as pd
import pytest
from recommenders.utils.constants import (
DEFAULT_USER_COL,
DEFAULT_ITEM_COL,
DEFAULT_RATING_COL,
SEED,
)
from recommenders.evaluation.python_eva... |
13,142 | generate ncl plots | # This file is part of the MJO_teleconnection module of the MDTF code package (see LICENSE.txt)
# ==============================================================================================
# mjo_teleconnection.py
# ----------------------------------------------------------------------------------------------
# ... |
13,143 | test delete public metadata for voucher | import graphene
from . import PRIVATE_KEY, PRIVATE_VALUE, PUBLIC_KEY, PUBLIC_VALUE
from .test_delete_metadata import (
execute_clear_public_metadata_for_item,
item_without_public_metadata,
)
from .test_delete_private_metadata import (
execute_clear_private_metadata_for_item,
item_without_private_metada... |
13,144 | cleanup | #!/usr/bin/env python
#
############################################################################
#
# MODULE: r.denoise.py
# AUTHOR(S): John A Stevenson
# Converted to Python by Carlos H. Grohmann
# PURPOSE: Run Sun's denoising algorithm from within GRASS
# COPYRIGHT: (C) 2009 GRASS De... |
13,145 | test smtp submit error | # -*- coding: utf-8 -*-
# (c) 2022 The mqttwarn developers
import sys
from unittest import mock
from unittest.mock import call
import pytest
from mqttwarn.model import ProcessorItem as Item
from mqttwarn.model import Struct
from mqttwarn.util import load_module_from_file
@pytest.mark.skipif(sys.version_info < (3, 8... |
13,146 | check plproxy config | from django.apps import apps
from django.conf import settings
from django.core import checks
from django.db import connections as django_connections, DEFAULT_DB_ALIAS, router
from corehq.sql_db.exceptions import PartitionValidationError
@checks.register('settings')
def custom_db_checks(app_configs, **kwargs):
er... |
13,147 | safe lower | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
13,148 | get position vec | '''
Created on Dec 4, 2012
Module to handle dynamic decoration of LCIO classes
@author: <a href="mailto:christian.grefe@cern.ch">Christian Grefe</a>
'''
from __future__ import absolute_import, unicode_literals
from ROOT import TVector3, TLorentzVector
from pyLCIO import EVENT, IMPL, IO, UTIL
from array import array
... |
13,149 | dqm seq | #!/usr/bin/env python3
"""
_Utils_
Module containing some utility tools
"""
def stepALCAPRODUCER(skims):
"""
_stepALCAPRODUCER_
Creates and returns the configuration string for the ALCAPRODUCER step
starting from the list of AlcaReco path to be run.
"""
step = ''
if len(skims) >0:
... |
13,150 | download url | import gzip
import os
from django.shortcuts import redirect, render
from django.urls import reverse
from physionet.utility import file_content_type
from project.utility import get_dir_breadcrumbs
MAX_PLAIN_SIZE = 5 * 1024 * 1024
class FileView:
"""
Base class for displaying file content.
To display a f... |
13,151 | main | """
This module can parse a Delphi Form (dfm) file.
The main is used in experimenting (to find which files fail
to parse, and where), but isn't useful for anything else.
"""
__version__ = "1.0"
__author__ = "Daniel 'Dang' Griffith <pythondev - dang at lazytwinacres . net>"
from pyparsing import (
Literal,
Ca... |
13,152 | get lab account | # 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... |
13,153 | min cppstd | from conan import ConanFile, conan_version
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, rmdir, get
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
from conan.tools.build import check_min_cppstd
from... |
13,154 | get remaining time | #!/usr/bin/env python
#############################################################################
#
# Watchdog contains an implementation of SONiC Platform Base Watchdog API
#
#############################################################################
import fcntl
import os
import array
try:
from sonic_platf... |
13,155 | to str | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
13,156 | create player | from xbmcgui import Dialog
from tmdbhelper.lib.addon.plugin import get_localized
from tmdbhelper.lib.addon.consts import PLAYERS_BASEDIR_SAVE, PLAYERS_BASEDIR_TEMPLATES
from tmdbhelper.lib.files.futils import get_files_in_folder, read_file, write_to_file
from tmdbhelper.lib.api.kodi.rpc import get_directory
from tmdbhe... |
13,157 | get extra for needinfo template | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import collections
from libmozdata import utils as lmdutils
from bugbot import logger, people, utils
from bugbot.bzcle... |
13,158 | test knows its default name | import warnings
from django.test import TestCase
from django_tables2 import Table
from django_tables2.data import TableData, TableListData, TableQuerysetData
from .app.models import Person, Region
from .utils import build_request
class TableDataFactoryTest(TestCase):
def test_invalid_data(self):
messag... |
13,159 | update | import pychromecast
from t_modules.t_extra import shooter
import time
import socket
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.settimeout(0)
try:
# doesn't even have to be reachable
s.connect(('10.255.255.255', 1))
IP = s.getsockname()[0]
except Excepti... |
13,160 | download blob from url | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os... |
13,161 | test extract flexible | """Tests the api.ast module."""
import pathlib
import api
import api.ast
import api.types
from testing import source
def test_extract_empty(tmp_path: pathlib.Path) -> None:
def func() -> None:
pass # pragma: no cover
funcs = api.ast.extract(source.make_file(tmp_path, func))
assert funcs == {
... |
13,162 | check task | #! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2011 (ita)
"""
Common mistakes highlighting.
There is a performance impact, so this tool is only loaded when running ``waf -v``
"""
typos = {
'feature':'features',
'sources':'source',
'targets':'target',
'include':'includes',
'export_include':'export_includes',... |
13,163 | main | # Copyright 2023 The Magenta 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 ... |
13,164 | policy | # 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 os
from fairseq import checkpoint_utils, tasks
import sentencepiece as spm
import torch
try:
from simuleval import READ_ACTION, W... |
13,165 | forward | # 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 torch
import torch.nn as nn
import torch.nn.functional as F
class GumbelVectorQuantizer(nn.Module):
def __init__(
self,
... |
13,166 | test github url with owner repo blob | # pylint: disable=line-too-long
import pytest
from cffconvert.cli.rawify_url import rawify_url
@pytest.mark.cli
def test_github_url_with_owner_repo():
actual = rawify_url("https://github.com/theownername/thereponame")
expected = "https://raw.githubusercontent.com/theownername/thereponame/main/CITATION.cff"
... |
13,167 | time to instruction | # This code is part of Qiskit.
#
# (C) Copyright IBM 2023
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wor... |
13,168 | mkfs hfs | from collections import namedtuple
import os
import shlex
import subprocess
import tempfile
import time
ConfigDmgtools = namedtuple('Config', 'dmg hfsplus newfs_hfs verbose')
ConfigHdiutil = namedtuple('Config', 'hdiutil verbose')
def chunks(l, n):
"""
Yield successive n-sized chunks from l.
From https://stackov... |
13,169 | test check connection account type exception | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from copy import deepcopy
import pytest
from airbyte_cdk.models import AirbyteConnectionStatus, ConnectorSpecification, Status
from facebook_business import FacebookAdsApi, FacebookSession
from source_facebook_marketing import SourceFacebookMarketing
from ... |
13,170 | save config | """
Set of Utilities to deal with reading/writing to configuration file during sam deploy
"""
from typing import Any
import click
from samcli.cli.context import get_cmd_names
from samcli.commands.deploy.exceptions import GuidedDeployFailedError
from samcli.lib.config.exceptions import SamConfigFileReadException
from ... |
13,171 | test max caption length | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2023
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
13,172 | any new from field | #-------------------------------------------------------------------------------
# Any
#-------------------------------------------------------------------------------
class AnyAbstractAPI:
@staticmethod
def init_any_environment(object):
pass
@staticmethod
def finish_any_environment(object):
pass
@staticmet... |
13,173 | test delete left word from inside first | """Unit tests for Input widget value modification actions."""
from __future__ import annotations
from textual.app import App, ComposeResult
from textual.widgets import Input
TEST_INPUTS: dict[str | None, str] = {
"empty": "",
"multi-no-punctuation": "Curse your sudden but inevitable betrayal",
"multi-pun... |
13,174 | to str | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
13,175 | smooth | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from pytorch3d.loss.mesh_laplacian_smoothing import mesh_laplacian_smoothing
fro... |
13,176 | post download | __all__ = ("http_syncer",)
import errno
import os
import ssl
import sys
import urllib.request
from snakeoil.fileutils import AtomicWriteFile, readfile_ascii
from snakeoil.osutils import pjoin
from ..log import logger
from . import base
class http_syncer(base.Syncer):
"""Syncer that fetches files over HTTP(S)."... |
13,177 | socketio | #
# IsardVDI - Open Source KVM Virtual Desktops based on KVM Linux and dockers
# Copyright (C) 2023 Simó Albert i Beltran
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, eithe... |
13,178 | encrypt | from time import time
from typing import List
from unittest.mock import PropertyMock, patch
import pytest
import pytest_twisted
from eth_typing import ChecksumAddress
from twisted.internet.threads import deferToThread
from web3.datastructures import AttributeDict
from nucypher_core.ferveo import FerveoVariant
from nu... |
13,179 | test sentiment training | import unittest
import pandas as pd
import tests.test_utils as t
from nlu import *
class SentimentTrainingTests(unittest.TestCase):
def METHOD_NAME(self):
# sentiment datase
df_train = (
self.load_sentiment_dl_dataset()
) #'/home/loan/Documents/freelancework/jsl/nlu/4realnl... |
13,180 | shader black w noise shader | # 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: Yiming Zuo
import bpy
import mathutils
from numpy.random import uniform, normal, randint
from nodes.node_wrangler import Nodes, NodeWrang... |
13,181 | test raw data loader | import argparse
import logging
import time
import os
import sys
# add the FedML root directory to the python path
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "../../../")))
import data.raw_data_loader.news_20.data_loader
import data.raw_data_loader.AGNews.data_loader
import data.raw_data_loader.CNN_Da... |
13,182 | test unit systran service translate file ok | import io
import responses
from typing import BinaryIO
from typing import List
from tracim_backend.lib.translate.services.systran import FILE_TRANSLATION_ENDPOINT
from tracim_backend.lib.translate.services.systran import SUPPORTED_FORMAT_ENDPOINT
from tracim_backend.lib.translate.services.systran import SUPPORTED_LANG... |
13,183 | generate sky image | #**********************************************************************
# 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... |
13,184 | get admin rule collection | # 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... |
13,185 | show more | # -*- coding: utf-8 -*-
#
# This file is part of SENAITE.CORE.
#
# SENAITE.CORE is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, bu... |
13,186 | recv | # Copyright (c) 2013 Commissariat à l'énergie atomique et aux énergies alternatives (CEA)
# Copyright (c) 2013 Centre national de la recherche scientifique (CNRS)
# Copyright (c) 2019-2023 Simons Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... |
13,187 | user storage arm 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... |
13,188 | del cron | #!/usr/bin/env python
data = {
"default_prefix": "OSVC_COMP_CRON_ENTRY_",
"example_value": "add:osvc:* * * * *:/path/to/mycron:/etc/cron.d/opensvc",
"description": """* Add and Remove cron entries
* Support arbitrary cron file location
""",
}
import os
import sys
import shutil
import glob
from subprocess import... |
13,189 | test authenticate conflicts | """IMAP migration tests."""
import os
import shutil
import tempfile
from unittest import mock
from six.moves import configparser
from django.core.management import call_command
from django.urls import reverse
from modoboa.admin import factories as admin_factories
from modoboa.admin import models as admin_models
fro... |
13,190 | get default gh token | import re
from collections.abc import Iterable
from typing import Optional
from gitlab.v4.objects import ProjectMergeRequest
from reconcile.typed_queries.github_orgs import GithubOrgV1
from reconcile.typed_queries.gitlab_instances import GitlabInstanceV1
from reconcile.utils.github_api import GithubRepositoryApi
from... |
13,191 | asset to atoken | import logging
from typing import NamedTuple, Optional, Union
from rotkehlchen.accounting.structures.balance import Balance
from rotkehlchen.assets.asset import Asset, CryptoAsset, EvmToken
from rotkehlchen.chain.evm.constants import ETH_SPECIAL_ADDRESS
from rotkehlchen.constants.assets import A_AETH_V1, A_AREP_V1, A_... |
13,192 | list cases | #!/usr/bin/env python3
"""
Command line tool to bisect failing CPython tests.
Find the test_os test method which alters the environment:
./python -m test.bisect_cmd --fail-env-changed test_os
Find a reference leak in "test_os", write the list of failing tests into the
"bisect" file:
./python -m test.bisect_... |
13,193 | repository download url | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... |
13,194 | on before transform resource | from samtranslator.metrics.method_decorator import cw_timer
from samtranslator.model.exceptions import InvalidResourceException
from samtranslator.model.intrinsics import is_intrinsic_if, is_intrinsic_no_value
from samtranslator.model.resource_policies import PolicyTypes, ResourcePolicies
from samtranslator.plugins imp... |
13,195 | test raises fit | # pylint: disable-all
from datetime import datetime
import numpy as np
import pytest
from pyspark.sql import functions as sf
from replay.data import LOG_SCHEMA
from replay.models import LightFMWrap
from replay.scenarios.two_stages.two_stages_scenario import (
get_first_level_model_features,
)
from tests.utils imp... |
13,196 | main | import argparse
import bigfile
import logging
from mpi4py import MPI
import numpy as np
logger = logging
logging.basicConfig(level=logging.INFO)
from nbodykit.lab import BigFileCatalog
from os.path import exists
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simplefilter(action... |
13,197 | test make gwcs | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the make module.
"""
import numpy as np
import pytest
from astropy.modeling.models import Moffat2D
from astropy.table import Table
from astropy.utils.exceptions import AstropyUserWarning
from numpy.testing import assert_allclose
from photut... |
13,198 | timer | """
This module provides functions for platform integration. Most of the functionality here
could also be achieved with psutils, but we want to avoid the large dependency.
"""
from __future__ import annotations
import os
import resource
import requests
import time
import logging
import socket
from pathlib import Path
... |
13,199 | migration zerocopy option again | import json
from virttest import libvirt_version
from virttest import utils_split_daemons
from virttest import virsh
from virttest.utils_libvirt import libvirt_memory
from virttest.utils_test import libvirt
from provider.migration import base_steps
from provider.migration import migration_base
def run(test, params... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.