id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
2,900
set share properties
# 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. # --------------------------------------------------------------------...
2,901
execute
""" Database interaction """ import asyncio import logging from contextlib import contextmanager from sqlalchemy import create_engine, text from sqlalchemy.exc import DBAPIError, OperationalError from sqlalchemy.ext.asyncio import AsyncConnection as _AsyncConnection from sqlalchemy.ext.asyncio import AsyncEngine as _...
2,902
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 . imp...
2,903
test case 2a
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2023 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
2,904
get pitch counts
# 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 ...
2,905
deprecated methods
# -*- coding: utf-8 -*- # # LinOTP - the open source solution for two factor authentication # Copyright (C) 2010-2019 KeyIdentity GmbH # Copyright (C) 2019- netgo software GmbH # # This file is part of LinOTP server. # # This program is free software: you can redistribute it and/or # modify it und...
2,906
get success url
import logging from django.contrib.auth.mixins import PermissionRequiredMixin from django.shortcuts import get_object_or_404, redirect from django.views.generic import DeleteView, TemplateView from zentral.contrib.inventory.forms import EnrollmentSecretForm from zentral.contrib.osquery.forms import EnrollmentForm from ...
2,907
get emma model from strudat
from __future__ import absolute_import, division, print_function # LIBTBX_SET_DISPATCHER_NAME phenix.emma # LIBTBX_SET_DISPATCHER_NAME iotbx.emma from iotbx import crystal_symmetry_from_any import iotbx.pdb from iotbx.cns import sdb_reader from iotbx.kriber import strudat from iotbx.option_parser import option_parser ...
2,908
close
# This file is part of the Astrometry.net suite. # Licensed under a 3-clause BSD style license - see LICENSE from __future__ import print_function import multiprocessing class FakeAsyncResult(object): def __init__(self, X): self.X = X def wait(self, *a): pass def get(self, *a): ret...
2,909
test reuse
#!/usr/bin/env python import threading import time from absl.testing import absltest from grr_response_core.lib import rdfvalue from grr.test_lib import test_lib class FakeTimelineTest(absltest.TestCase): def testRunSingleSleep(self): log = [] def foo(): while True: log.append("foo") ...
2,910
mongo data
import datetime from syscore.exceptions import missingData from syscore.constants import arg_not_supplied, success from sysexecution.orders.named_order_objects import missing_order from sysdata.mongodb.mongo_generic import mongoDataWithSingleKey from sysexecution.orders.base_orders import Order from sysexecution.orde...
2,911
atomic symlink
#!/usr/bin/env python3 # This script lets you update a hierarchy of files in an atomic way by # first creating a new hierarchy using rsync's --link-dest option, and # then swapping the hierarchy into place. **See the usage message for # more details and some important caveats!** import os, sys, re, subprocess, shutil...
2,912
test set multiple via indirect
# Copyright (c) 2017 The University of Manchester # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
2,913
test custom evenv nested router
import pytest from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler, skip from aiogram.dispatcher.event.telegram import TelegramEventObserver from aiogram.dispatcher.router import Router class TestRouter: def test_including_routers(self): router1 = Router() router2 = Router() ...
2,914
test jobs view expected job
# # Copyright 2019-2023 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licen...
2,915
count
# -*- coding: utf-8 -*- """ The /api/v1/attachments API implementation. """ from django.conf import settings from django.core.files.storage import default_storage from django.http import Http404 from django.utils.translation import gettext as _ from rest_framework import renderers, viewsets from rest_framework.decorat...
2,916
ant iter
#! /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',...
2,917
test nonascii
from io import BytesIO from translate.convert import po2tmx, test_convert from translate.misc.xml_helpers import XML_NS from translate.storage import tmx class TestPO2TMX: @staticmethod def po2tmx(posource, sourcelanguage="en", targetlanguage="af", comment=None): """helper that converts po source to ...
2,918
xform inputs
#!/usr/bin/env python # # weathering.py # # - module to compute the weathering of an oil that contains one or more # "pseudo components". # # Built-in Oil Types are in the OilTypes dict. # # NOTE: # Right now we will support the three most common exponential decay methods. # These are: # - half life # - the...
2,919
test parser provider hook add list
import shutil import pytest import os import subprocess import sys from tackle.main import tackle from tackle.settings import settings @pytest.fixture() def temporary_uninstall(): """Fixture to uninstall a package and install it after the test.""" def f(package): subprocess.check_call( ...
2,920
test raw vs encoding none
""" tests.unit.payload_test ~~~~~~~~~~~~~~~~~~~~~~~ """ import copy import datetime import logging import salt.exceptions import salt.payload from salt.defaults import _Constant from salt.utils import immutabletypes from salt.utils.odict import OrderedDict log = logging.getLogger(__name__) def assert_no_or...
2,921
dispatch command
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2,922
delete objects
# Copyright 2016 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...
2,923
setup 30 days of stats for chart
import functools import logging import faker import pytest from dateutil.relativedelta import relativedelta from django import urls from django.utils import timezone from waffle.testutils import override_flag from ....accounts import models as ac_models from ... import choices as gc_choices from ... import factories ...
2,924
test charsxp encoding
import copy import gc import pytest import rpy2.rinterface as rinterface rinterface.initr() def test_invalid_init(): with pytest.raises(ValueError): rinterface.Sexp('a') def test_init_from_existing(): sexp = rinterface.baseenv.find('letters') sexp_new = rinterface.Sexp(sexp) assert sexp_new...
2,925
assert token fail
import pytest from xdsl.utils.exceptions import ParseError from xdsl.utils.lexer import Input, Lexer, Token def get_token(input: str) -> Token: file = Input(input, "<unknown>") lexer = Lexer(file) token = lexer.lex() return token def assert_single_token( input: str, expected_kind: Token.Kind, e...
2,926
upgrade registrar
"""convert allowlists to IMA policies Revision ID: 8c0f8ded1f90 Revises: 039322ea079b Create Date: 2022-10-27 18:18:31.674283 """ import copy import datetime import json import sqlalchemy as sa from alembic import op from keylime import keylime_logging from keylime.ima import ima logger = keylime_logging.init_logg...
2,927
send request
# 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) AutoRest Code Generator. # Changes may ...
2,928
get run with polling
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
2,929
test sct analyze lesion matches expected dummy
# pytest unit tests for sct_analyze_lesion import pytest import logging import math import pickle import numpy as np from spinalcordtoolbox.utils import sct_test_path, extract_fname from spinalcordtoolbox.scripts import sct_analyze_lesion, sct_label_utils logger = logging.getLogger(__name__) @pytest.fixture() def...
2,930
get version flags
import os import re from collections import deque from typing import Any, Dict, List, Optional, Tuple, Type from dmoj.cptbox import TracedPopen from dmoj.executors.compiled_executor import CompiledExecutor from dmoj.executors.mixins import SingleDigitVersionMixin from dmoj.judgeenv import env from dmoj.utils.cpp_deman...
2,931
build
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import inspect import os from spack.package import * class Lorene(MakefilePackage): """LORENE: Langage Objet pour l...
2,932
binary search
# coding=utf-8 # # This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Most of this work is copyright (C) 2013-2019 David R. MacIver # (david@drmaciver.com), but it contains contributions by others. See # CONTRIBUTING.rst for a full list of people who may hold cop...
2,933
test returns unfired deferred
""" Tests for ``magic_folder.test.eliotutil``. """ import logging from testtools import ( TestCase, ) from testtools.matchers import ( Is, IsInstance, Equals, AfterPreprocessing, ) from testtools.twistedsupport import ( succeeded, failed, ) from eliot import ( Message, ) from eliot.tw...
2,934
n create data
"""Export and import meshes with specular values.""" # ***** BEGIN LICENSE BLOCK ***** # # Copyright © 2005, NIF File Format Library and Tools contributors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditio...
2,935
test dhcp
from packetbeat import BaseTest """ Tests for the DHCPv4 protocol. """ class Test(BaseTest): def METHOD_NAME(self): self.render_config_template() self.run_packetbeat(pcap="dhcp.pcap") objs = self.read_output(types=['dhcpv4']) assert len(objs) == 4 assert "event.start" i...
2,936
add spec
import pathlib from typing import Any, Dict, List, Optional import jinja2 import yaml from conda_lock.common import get_in from conda_lock.models.lock_spec import Dependency, LockSpecification from conda_lock.src_parser.conda_common import conda_spec_to_versioned_dep from conda_lock.src_parser.selectors import filte...
2,937
set unknown threshold
#!/usr/bin/env python3 ################################################################################################### ################################################################################ # Copyright (C) 2023 Maxim Integrated Products, Inc., All Rights Reserved. # # Permission is hereby granted, free...
2,938
on 204
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
2,939
get execute combine result
# Copyright 2022 XProbe 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 writing,...
2,940
close files
# Copyright(C) 1999-2020 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with # NTESS, the U.S. Government retains certain rights in this software. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provide...
2,941
console describe
from __future__ import annotations from typing import List import typer from rich.console import Console from rich.table import Table from ...helpers import to_json, to_yaml from ...resource import Resource from ...system import system from .. import common, helpers from ..console import console @console.command(n...
2,942
assert response success
################################################################## # Copyright 2018 Open Source Geospatial Foundation and others # # licensed under MIT, Please consult LICENSE.txt for details # ################################################################## import json import logging import re import tempfile...
2,943
parse shutters xml
#!/usr/bin/env python """ This file contains the various XML parsing functions. Hazen 04/17 """ import numpy import xml.etree.ElementTree as ElementTree import storm_control.sc_library.halExceptions as halExceptions class ShutterXMLException(halExceptions.HalException): pass class ShuttersInfo(object): ...
2,944
visit translation
""" Parser for the .lang translation format. """ import codecs import re from parsimonious.exceptions import ( ParseError as ParsimoniousParseError, VisitationError, ) from parsimonious.grammar import Grammar from parsimonious.nodes import NodeVisitor from pontoon.sync.exceptions import ParseError from pontoo...
2,945
test create measurement without source
"""Test measurement collection.""" import unittest import mongomock from database.measurements import create_measurement from tests.fixtures import METRIC_ID, REPORT_ID, SOURCE_ID, SUBJECT_ID, create_report class TestMeasurements(unittest.TestCase): """Unit tests for the measurements collection.""" def s...
2,946
open image
import asyncio import logging import os import tempfile import time import uuid from functools import partial from hashlib import md5 from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices, QImage from feeluown.consts import CACHE_DIR logger = logging.getLogger(__name__) class ImgManager(object): ...
2,947
delete subscription from snuba
# Generated by Django 2.2.28 on 2022-06-15 11:14 # Based on https://github.com/getsentry/getsentry/blob/89ff1453be755ddef31f2b99de09bd03badeb25e/getsentry/migrations/0141_migrate_sessions_subs_to_metrics.py import logging import re from django.db import migrations from sentry.new_migrations.migrations import Checked...
2,948
test deps outs are sorted by path
from collections import OrderedDict from operator import itemgetter from dvc.dvcfile import LOCK_FILE from dvc.stage.utils import split_params_deps from dvc.utils.fs import remove from dvc.utils.serialize import dumps_yaml, parse_yaml_for_update from tests.func.test_run import supported_params FS_STRUCTURE = { "f...
2,949
getvalue
""" Tests for uu module. Nick Mathewson """ import unittest from test import support import sys, os import uu from io import BytesIO import io plaintext = b"The smooth-scaled python crept over the sleeping dog\n" encodedtext = b"""\ M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P (:6YG(&1O9PH """ # ...
2,950
ddl migr commit
# # This source file is part of the EdgeDB open source project. # # Copyright 2019-present MagicStack Inc. and the EdgeDB 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...
2,951
sbfdatetime
import datetime import functools import locale from sickchill import settings from .network_timezones import sb_timezone date_presets = ( "%Y-%m-%d", "%a, %Y-%m-%d", "%A, %Y-%m-%d", "%y-%m-%d", "%a, %y-%m-%d", "%A, %y-%m-%d", "%m/%d/%Y", "%a, %m/%d/%Y", "%A, %m/%d/%Y", "%m/%d/...
2,952
test hex to rgb
"""Function for testing colormap module.""" import numpy as np import numpy.testing as npt from fury import colormap from fury.optpkg import optional_package cm, have_matplotlib, _ = optional_package('matplotlib.cm') def test_boys2rgb(): expected = np.array( [ [0.23171663, 0.34383397, 0.695...
2,953
roundup
# # Module which supports allocation of memory from an mmap # # multiprocessing/heap.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import bisect import mmap import os import sys import tempfile import threading from . import context from . import reduction from . import ...
2,954
test lifecycle
""" Copyright 2020 The OneFlow 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 applicable law or agr...
2,955
create json str
# Copyright 2017 The Forseti Security 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 ap...
2,956
query parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
2,957
test npz3
# 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...
2,958
test read blob
# Copyright 2010-2023 The pygit2 contributors # # This file 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. # # In addition to the permissions in the GNU General Public License, # the authors give ...
2,959
predicate
# Copyright (c) 2018 gevent community # # 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, di...
2,960
move files
from Components.Task import PythonTask, Task, Job, job_manager as JobManager, Condition from Tools.Directories import fileExists from enigma import eTimer from os import path from shutil import rmtree, copy2, move class DeleteFolderTask(PythonTask): def openFiles(self, fileList): self.fileList = fileList def wor...
2,961
jacob f
""" Extended kalman filter (EKF) localization sample author: Atsushi Sakai (@Atsushi_twi) """ import sys import pathlib sys.path.append(str(pathlib.Path(__file__).parent.parent.parent)) import math import matplotlib.pyplot as plt import numpy as np from utils.plot import plot_covariance_ellipse # Covariance for ...
2,962
test int little byteorder
# Copyright 2020. 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 ...
2,963
handle
######################################################################### # # Copyright (C) 2020 OSGeo # Copyright (C) 2022 King's College London # # 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...
2,964
get mode
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2015 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 ...
2,965
test max speed records no value
import datetime from flask import Flask from fittrackee.users.models import User from fittrackee.workouts.models import Record, Sport, Workout class TestRecordModel: def test_record_model( self, app: Flask, user_1: User, sport_1_cycling: Sport, workout_cycling_user_1: Wor...
2,966
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 . imp...
2,967
get authorization provider output
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
2,968
get id for path
""" copy files to Google Drive using rclone """ import configparser import json import logging import subprocess from pathlib import Path from subprocess import Popen, PIPE from typing import List, Optional, Tuple, Union from tqdm.notebook import tqdm from metatlas.tools.notebook import in_papermill logger = loggi...
2,969
test version bump increase string length
from pathlib import Path from shutil import copyfile import pytest from commitizen import bump from commitizen.exceptions import CurrentVersionNotFoundError MULTIPLE_VERSIONS_INCREASE_STRING = 'version = "1.2.9"\n' * 30 MULTIPLE_VERSIONS_REDUCE_STRING = 'version = "1.2.10"\n' * 30 TESTING_FILE_PREFIX = "tests/data"...
2,970
list
# 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) AutoRest Code Generator. # Changes ...
2,971
wait for permission
from datetime import datetime, timedelta from backup.config import Config, Setting from backup.time import Time from backup.exceptions import GoogleCredGenerateError, KnownError, LogicError, ensureKey from aiohttp import ClientSession from injector import inject from .driverequests import DriveRequester from backup.lo...
2,972
files
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,973
copy
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Classes and functions to manage package tags""" import collections import METHOD_NAME from collections.abc import Mappin...
2,974
readline complete
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2,975
get subjects
# -*- coding: utf-8 -*- # # utils.py # # This file is part of MUESLI. # # Copyright (C) 2011, Matthias Kuemmerer <matthias (at) matthias-k.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ...
2,976
main
#!/usr/bin/env python ################################################################################ # # MODULE: g.compare.md5.py # # AUTHOR(S): Luca Delucchi <lucadeluge@gmail.com> # # PURPOSE: Check if two GRASS maps are the same # # COPYRIGHT: (c) 2012-2020 by Luca Delucchi and the GRASS Developm...
2,977
test narrow jsonpath node silce filter
from typing import Optional import pytest from jsonpath_ng import ( Child, Fields, Index, Slice, This, ) from jsonpath_ng.ext import parse from jsonpath_ng.ext.filter import ( Expression, Filter, ) from reconcile.utils.jsonpath import ( apply_constraint_to_path, jsonpath_parts, ...
2,978
xrecover
# ed25519.py - Optimized version of the reference implementation of Ed25519 # downloaded from https://github.com/pyca/ed25519 # # Written in 2011? by Daniel J. Bernstein <djb@cr.yp.to> # 2013 by Donald Stufft <donald@stufft.io> # 2013 by Alex Gaynor <alex.gaynor@gmail.com> # 2013 by Gre...
2,979
gen keywords bucket init
#!/usr/bin/python3 # # Copyright (C) 2021 FMSoft <https://www.fmsoft.cn> # # This file is a part of Purring Cat 2, a HVML parser and interpreter. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Fo...
2,980
map
import os from functools import wraps import bottle import numpy as np from yt.fields.derived_field import ValidateSpatial from yt.utilities.lib.misc_utilities import get_color_bounds from yt.utilities.png_writer import write_png_to_string from yt.visualization.fixed_resolution import FixedResolutionBuffer from yt.vi...
2,981
test import metadata languages
from django.db import connection from django.db.models import Q from django.urls import reverse from le_utils.constants import content_kinds from rest_framework.test import APITestCase from kolibri.core.content import base_models from kolibri.core.content import models as content from kolibri.core.content.constants.sc...
2,982
list connected cluster user credential output
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
2,983
test dataset not present
from http import HTTPStatus import io from pathlib import Path from typing import Callable, Optional from flask import Response import pytest import requests from pbench.server import JSONOBJECT from pbench.server.cache_manager import CacheManager, CacheType, Inventory from pbench.server.database.models.datasets impo...
2,984
test python
# ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## """Test foreach-dat...
2,985
supportpartners
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from django.apps import apps fr...
2,986
get context data
""" This module contains form views for our models that don't need custom handling. """ from django.contrib import messages from django.contrib.auth.mixins import PermissionRequiredMixin from django.core.exceptions import FieldDoesNotExist from django.urls import reverse from django.utils.translation import gettext as ...
2,987
lkas tx msgs
#!/usr/bin/env python3 import enum import unittest from panda import Panda from panda.tests.libpanda import libpanda_py import panda.tests.safety.common as common from panda.tests.safety.common import CANPackerPanda, MeasurementSafetyTest from functools import partial class SubaruMsg(enum.IntEnum): Brake_Status ...
2,988
is manageable
# -*- coding: utf-8 -*- # # This file is part of SKALE Admin # # Copyright (C) 2021 SKALE Labs # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
2,989
create cmd
"""Tests the GCE NFS service.""" import json import unittest from unittest import mock from absl import flags from perfkitbenchmarker import disk from perfkitbenchmarker import errors from perfkitbenchmarker import vm_util from perfkitbenchmarker.providers.gcp import gce_network from perfkitbenchmarker.providers.gcp ...
2,990
cmd path
import contextlib import json import os import shutil import sys import tempfile __all__ = ['MockCommand', 'assert_calls'] pkgdir = os.path.dirname(__file__) recording_dir = None def _make_recording_file(prefix): """Make a temp file for recording calls to a mocked command""" global recording_dir if reco...
2,991
create conf folders
# -------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU - GPL...
2,992
prepare for inference async
# Copyright (c) 2023 Intel Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writ...
2,993
donation
# -*- coding: utf-8 -*- import httpcore httpcore.SyncHTTPTransport = httpcore.AsyncHTTPProxy import sys import os import platform #redirect the original stdout and stderr stdout=sys.stdout stderr=sys.stderr sys.stdout = open(os.path.join(os.getenv("temp"), "stdout.log"), "w") sys.stderr = open(os.path.join(os.getenv("t...
2,994
get date time
# -*- coding: utf-8 -*- """Parser for Windows NT shell items.""" import pyfwsi from dfdatetime import fat_date_time as dfdatetime_fat_date_time from plaso.containers import windows_events from plaso.helpers.windows import shell_folders from plaso.lib import definitions class ShellItemsParser(object): """Parses f...
2,995
canonicalize url
from __future__ import annotations import random import urllib.parse from typing import TYPE_CHECKING, Any, Optional from sqlalchemy.orm import Session if TYPE_CHECKING: from files.classes import Comment, Submission, User Submittable = Comment | Submission else: Submittable = Any def _replace_urls(url:str) -> s...
2,996
etag
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
2,997
run
"""Autograder runner for R assignments""" import copy import nbformat as nbf import os import re import tempfile import yaml from glob import glob from nbconvert.exporters import ScriptExporter from rpy2.robjects.packages import importr from .abstract_runner import AbstractLanguageRunner from ..utils import OtterRu...
2,998
update gui
import json import rospy import cv2 import sys import base64 import threading import time import numpy as np from datetime import datetime from websocket_server import WebsocketServer # Graphical User Interface Class class GUI: # Initialization function # The actual initialization def __init__(self, host...
2,999
predict proba
from numpy import inf, nan from sklearn.semi_supervised import LabelPropagation as Op from lale.docstrings import set_docstrings from lale.operators import make_operator class _LabelPropagationImpl: def __init__(self, **hyperparams): self._hyperparams = hyperparams self._wrapped_model = Op(**self...