id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
17,500 | on hex action triggered | from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot
from PyQt5.QtGui import QIcon, QKeyEvent, QContextMenuEvent, QTextCursor
from PyQt5.QtWidgets import QTextEdit, QMenu, QActionGroup
class TextEditProtocolView(QTextEdit):
proto_view_changed = pyqtSignal()
deletion_wanted = pyqtSignal()
show_proto_clicked =... |
17,501 | query to data | """Routines that ingest/export CSV files to/from Splitgraph images using Pandas"""
import csv
from io import StringIO
from typing import TYPE_CHECKING, Optional, Union
import pandas as pd
from pandas.core.frame import DataFrame
from pandas.core.series import Series
from pandas.io.sql import get_schema
from psycopg2.s... |
17,502 | default spec | # Copyright 2023 Xilinx 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, ... |
17,503 | set style sheet | from ..Qt import QtCore, QtWidgets
__all__ = ['FeedbackButton']
class FeedbackButton(QtWidgets.QPushButton):
"""
QPushButton which flashes success/failure indication for slow or asynchronous procedures.
"""
### For thread-safetyness
sigCallSuccess = QtCore.Signal(object, object, object)
... |
17,504 | update eol | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Status bar widgets."""
# Standard library imports
import os.path as osp
# Local imports
from spyder.api.widgets.status import StatusBarWidget
from spyder.api.tra... |
17,505 | root | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2022 The Electrum Developers
#
# 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... |
17,506 | test single file bad assignment name | import os
import sys
import pytest
import traitlets
from os.path import join
from sqlalchemy.exc import InvalidRequestError
from textwrap import dedent
from ...api import Gradebook
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderGenerateSolution(BaseTestApp):
def test_help(self):
... |
17,507 | mysql create db | '''
Test utilities to create and drop databases.
'''
import contextlib
import os
import requests
import sqlalchemy as sa
import time
from pytest import skip
folder = os.path.dirname(os.path.abspath(__file__))
info = {}
def gramex_port():
'''Wait for Gramex to start on $GRAMEX_PORT. Return port number if it does,... |
17,508 | accuracy impl | """
Commonly used metrics
Authors
* Leo 2022
* Heng-Jui Chang 2022
* Haibin Wu 2022
"""
from typing import List, Union
import editdistance as ed
from scipy.interpolate import interp1d
from scipy.optimize import brentq
from sklearn.metrics import accuracy_score, roc_curve
__all__ = [
"accuracy",
"ter",... |
17,509 | assert count gpus | # Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import reframe as rfm
import reframe.utility.sanity as sn
__all__ = ['GpuKernelLatency']
class GpuKernelLatency(rfm.Regres... |
17,510 | make policy | # Copyright 2018 DeepMind Technologies Limited. 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 ... |
17,511 | write | # Copyright 2019 Shift Cryptosecurity AG
#
# 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... |
17,512 | add detached comment | # Copyright 2020 Google LLC
#
# 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, ... |
17,513 | created at | ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
17,514 | assignment not found | import os
import datetime
import sys
import shutil
import glob
from textwrap import dedent
from rapidfuzz import fuzz
from traitlets import Unicode, Bool, default
from jupyter_core.paths import jupyter_data_dir
from nbgrader.exchange.abc import Exchange as ABCExchange
from nbgrader.exchange import ExchangeError
fro... |
17,515 | test restart | import os
import pytest
from unittest.mock import patch, call, Mock
from click.testing import CliRunner
from refresh_certs import (
refresh_certs,
restart,
reproduce_all_root_ca_certs,
reproduce_front_proxy_client_cert,
reproduce_server_cert,
)
class TestRefreshCerts(object):
@patch("subproce... |
17,516 | acsv | #this script accesses a webpage with the weather forecast for Singapore and stores the current weather conditions
from lxml import html
import requests, os, csv, sys, re, random
from datetime import datetime
#dictionary function which appends a .csv file given its address, an array with values to be saved and an arra... |
17,517 | test call fetch | #!/usr/bin/env python
"""
test code for the wave calculations
"""
import datetime
import numpy as np
from copy import copy
from gnome.environment import constant_wind
from gnome.environment import Waves
from gnome.environment import Water
from gnome.environment import Wind
from gnome.basic_types import datetime... |
17,518 | convert body frame | #!/usr/bin/env python
'''
HIL module
Andrew Tridgell
December 2012
This interfaces to Tools/autotest/jsbsim/runsim.py to run the JSBSim flight simulator
'''
import sys, os, time, socket, errno, struct, math
from math import degrees, radians
from MAVProxy.modules.lib import mp_module
from pymavlink import mavutil
cla... |
17,519 | set up | """Test script for the dumbdbm module
Original by Roger E. Masse
"""
import os
import stat
import unittest
import dumbdbm
from test import test_support
_fname = test_support.TESTFN
def _delete_files():
for ext in [".dir", ".dat", ".bak"]:
try:
os.unlink(_fname + ext)
except OSError... |
17,520 | test sync repository | from unittest.mock import patch
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.providers.bitbucket_oauth2.views import (
BitbucketOAuth2Adapter,
)
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
from allauth.socialaccount.providers.gitlab.views import... |
17,521 | 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... |
17,522 | test repr | """Tests for pymatgen.io.wannier90."""
from __future__ import annotations
import numpy as np
import pytest
from numpy.testing import assert_allclose
from pytest import approx
from pymatgen.io.wannier90 import Unk
from pymatgen.util.testing import TEST_FILES_DIR, PymatgenTest
class TestUnk(PymatgenTest):
_multi... |
17,523 | stop output | # coding=utf-8
#
# on_off_shell.py - Output for executing shell commands
#
from flask_babel import lazy_gettext
from mycodo.databases.models import OutputChannel
from mycodo.outputs.base_output import AbstractOutput
from mycodo.utils.database import db_retrieve_table_daemon
from mycodo.utils.system_pi import cmd_outpu... |
17,524 | user enroll callback | import logging
from django.core.exceptions import SuspiciousOperation
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.views.generic import FormView, View
from zentral.conf import settings
from zentral.con... |
17,525 | open search | from django.conf import settings
from django.core.paginator import Paginator, InvalidPage
from django.http import Http404
from django.utils.translation import gettext_lazy as _
from tendenci.apps.theme.shortcuts import themed_response as render_to_resp
from tendenci.apps.search.forms import ModelSearchForm
from tenden... |
17,526 | connect | #!/usr/bin/python
# encoding: utf-8
'''
naoclient.client -- shortdesc
naoclient.client is an OpenRoberta rest client
It defines nao - server communication
@author: Artem Vinokurov
@copyright: 2017 Fraunhofer IAIS.
@license: GPL 3.0
@contact: artem.vinokurov@iais.fraunhofer.de
@deffield updated: 31 Jan. 2... |
17,527 | get tensor shim | """Common Backend Shim to prepare minimization for optimizer."""
from pyhf.tensor.manager import get_backend
from pyhf.tensor.common import _TensorViewer
def _make_stitch_pars(tv=None, fixed_values=None):
"""
Construct a callable to stitch fixed parameter values into the unfixed parameters. See :func:`shim`.
... |
17,528 | mpijob state to run state | # Copyright 2023 Iguazio
#
# 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, softwa... |
17,529 | resolve template | # #
# Copyright 2009-2023 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... |
17,530 | init layout | from math import floor
from qtpy.QtCore import QSize, Qt, QThread
from qtpy.QtGui import QClipboard, QFontDatabase, QTextCursor, QTextOption
from qtpy.QtWidgets import (
QApplication,
QDialog,
QDialogButtonBox,
QMessageBox,
QPlainTextEdit,
QVBoxLayout,
)
from .file_update_worker import FileUpd... |
17,531 | parse url | from __future__ import absolute_import
from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value f... |
17,532 | visualization name | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from typing import (
Any, Dict, Iterable, List, Tuple,
)
from databuilder.rest_api.rest_api_query import RestApiQuery
class DatabricksSQLVisualizationWidget:
"""
A visualization widget in a Databricks SQL dashboard.
... |
17,533 | visitor | """Code generation for server/app/services/settings/SettingsManifest.java
Generates a settings manifest in Java for use in the CiviForm server based
on the contents of env_var_docs.json
"""
import typing
import string
import os
import sys
import dataclasses
import env_var_docs.errors_formatter
from jinja2 import Envi... |
17,534 | install | import random
import string
import sys
import pathlib
import typing
from locust import events
sys.path.append(str(pathlib.Path(__file__).resolve().parents[4] / 'lib'))
import key
from common.base import Account, Deploy, NearNodeProxy, NearUser, FunctionCall, INIT_DONE
class FTContract:
# NEAR balance given to c... |
17,535 | test max lines | import os
import re
import numpy as np
import pytest
from astropy.table.scripts import showtable
ROOT = os.path.abspath(os.path.dirname(__file__))
ASCII_ROOT = os.path.join(ROOT, "..", "..", "io", "ascii", "tests")
FITS_ROOT = os.path.join(ROOT, "..", "..", "io", "fits", "tests")
VOTABLE_ROOT = os.path.join(ROOT, ".... |
17,536 | format | """
Clean and validate a DataFrame column containing Spanish NIF numbers (NIFs).
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import pandas as pd
from stdnum.es import nif
from .... |
17,537 | 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... |
17,538 | update | # -*- 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... |
17,539 | test vander array like list | import unittest
import numpy
import pytest
import cupy
from cupy import testing
class TestMatrix(unittest.TestCase):
@testing.numpy_cupy_array_equal()
def test_diag1(self, xp):
a = testing.shaped_arange((3, 3), xp)
return xp.diag(a)
@testing.numpy_cupy_array_equal()
def test_diag2(... |
17,540 | test make ntgrid | # Copyright (c) 2012 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""py.test fo... |
17,541 | owner auth header | # Copyright 2021-present, the Recognai S.L. 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 la... |
17,542 | test old style | from pathlib import Path
from unittest.mock import mock_open, patch
import frappe
from frappe.modules import patch_handler
from frappe.tests.utils import FrappeTestCase
EMTPY_FILE = ""
EMTPY_SECTION = """
[pre_model_sync]
[post_model_sync]
"""
FILLED_SECTIONS = """
[pre_model_sync]
app.module.patch1
app.module.patch... |
17,543 | cli main | from fairseq import tasks
import numpy as np
import logging
import random
from fairseq import options
import torch
import os
import soundfile as sf
from fairseq.data.audio.audio_utils import (
get_waveform,
parse_path,
)
logging.basicConfig()
logging.root.setLevel(logging.INFO)
logging.basicConfig(level=loggi... |
17,544 | get v struct namespaces | '''
VStruct builder! Used to serialize structure definitions etc...
'''
import copy
import types
import inspect
import vstruct
import vstruct.primitives as vs_prim
TSIZES = [1, 2, 4, 8]
prim_types = [None,
vs_prim.v_uint8,
vs_prim.v_uint16,
None,
vs_prim.v_u... |
17,545 | extract dve api url | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
int_or_none,
str_or_none,
try_get,
)
class ImgGamingBaseIE(InfoExtractor):
_API_BASE = 'https://dce-frontoff... |
17,546 | mfe window callback | import os
import unittest
if __name__ == '__main__':
from py_include import taprunner
import RNApath
RNApath.addSwigInterfacePath()
import RNA
seq_con = "CCCAAAAGGGCCCAAAAGGG"
str_con = "..........(((....)))"
str_con_def = "(((....)))(((....)))"
seq_long = "AUUUCCACUAGAGAAGGUCUAGAGUGUUUGUCGUU... |
17,547 | csc | #! /usr/bin/env python3
from __future__ import print_function
from builtins import range
import sys, optparse
copyargs = sys.argv[:]
for i in range(len(copyargs)):
if copyargs[i] == "": copyargs[i] = "\"\""
if copyargs[i].find(" ") != -1: copyargs[i] = "\"%s\"" % copyargs[i]
commandline = " ".join(... |
17,548 | test add invalid attribute | from pathlib import Path
import pytest
from aequilibrae.project.field_editor import FieldEditor
class TestFieldEditor:
@pytest.fixture(scope="class")
def project_session(self, create_empty_project_session):
return create_empty_project_session()
@pytest.fixture(scope="class")
def database_bac... |
17,549 | where | # Copyright 2018 Google 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, ... |
17,550 | filter cells with syntax errors | """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... |
17,551 | location type | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
fr... |
17,552 | split ukernel name | #!/usr/bin/env python
# Copyright 2022 Google LLC
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import codecs
import math
import os
import re
import sys
import yaml
sys.path.insert(0, os.path.dirname(os.path.abspath(... |
17,553 | hsv to rgb | '''
zoo_facts.py
This example is for the Pico W with GFX Pack.
It uses the Zoo Animal API to download a list of 5 animals,
then displays them on the GFX Pack
A = Next animal
B = Last animal
D = Show stats
E = Fetch a different 5 animals
Find out more about Zoo Animal API here:
https://zoo-animal-api.herokuapp.com/
'''
... |
17,554 | check int8 applicable | # 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 u... |
17,555 | handle restart action | from AccessControl import getSecurityManager
from AccessControl.Permissions import view_management_screens
from Acquisition import aq_inner
from App.config import getConfiguration
from plone.autoform.form import AutoExtensibleForm
from plone.base import PloneMessageFactory as _
from plone.base.interfaces import IMainte... |
17,556 | test 13 next description | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import unittest
from amundsen_common.tests.fixtures import (next_application, next_col_type,
next_columns, next_database,
next_description,
... |
17,557 | test remove certificate available date from instructor | """
Tests for the `clean_stale_certificate_available_dates` management command.
"""
from datetime import datetime, timedelta
from django.core.management import CommandError, call_command
import pytz
from cms.djangoapps.contentstore.models import CleanStaleCertificateAvailabilityDatesConfig
from openedx.core.lib.cours... |
17,558 | is blacklisted | import re
from math import ceil
from django.db.models import F
from django_comments import get_model
from ajapaik.ajapaik.models import ImportBlacklist
comment_model = get_model()
def get_comment_replies(comment):
'''
Returns queryset that contain all reply for given comment.
'''
return comment_mod... |
17,559 | routing key | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
# pylint:disable=protected-access
import asyncio
import contextlib
from collections.abc import AsyncIterator, Callable
from dataclasses import dataclass
from typing import Any
import aiodocker
import docker
import ... |
17,560 | test unauthenticated userid | import unittest
from pyramid.testing import DummyRequest
class TestNamespacedAuthenticationPolicy(unittest.TestCase):
""" This is a modified version of TestRemoteUserAuthenticationPolicy
"""
def _getTargetClass(self):
from snovault.authentication import NamespacedAuthenticationPolicy
retur... |
17,561 | cd | #!/usr/bin/env python3
import argparse
import plistlib
import pathlib
import sys
import tarfile
import gzip
import os
import contextlib
# monkey-patch Python 3.8 and older to fix wrong TAR header handling
# see https://github.com/bitcoin/bitcoin/pull/24534
# and https://github.com/python/cpython/pull/18080 for more in... |
17,562 | test filtered sweep table | from typing import Dict, Any, Sequence
from datetime import datetime
import json
import pytest
import numpy as np
import pandas as pd
from ipfx.dataset.ephys_data_interface import EphysDataInterface
from ipfx.stimulus import StimulusOntology
from ipfx.dataset.ephys_data_set import EphysDataSet
def test_voltage_curr... |
17,563 | detect cadvisor | # (C) Datadog, Inc. 2010-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from __future__ import division
import logging
import numbers
from fnmatch import fnmatch
import requests
from six import iteritems
from six.moves.urllib.parse import urlparse
from datadog_checks.base.utils.t... |
17,564 | filter out unsupported compiler options | #===============================================================================
# Copyright 2020 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.o... |
17,565 | make quads | from vpython import *
scene.width = scene.height = 600
# There is an L by L grid of vertex objects, numbered 0 through L-1 by 0 through L-1.
# Only the vertex operators numbered L-2 by L-2 are used to create quads.
# The extra row and extra column of vertex objects simplifies edge calculations.
# The stride length from... |
17,566 | replace | from __future__ import annotations
import io
from typing import Any, Callable, Dict, Set, Tuple
from chia_rs import ALLOW_BACKREFS, run_chia_program, tree_hash
from clvm import SExp
from clvm.casts import int_from_bytes
from clvm.EvalError import EvalError
from clvm.serialize import sexp_from_stream, sexp_to_stream
... |
17,567 | issue tracker | # Copyright 2020 Google LLC
#
# 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, ... |
17,568 | error format | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
17,569 | inverse | """This module provides classes for non-standard space-group settings."""
from __future__ import annotations
import re
from fractions import Fraction
import numpy as np
from pymatgen.core.lattice import Lattice
from pymatgen.core.operations import MagSymmOp, SymmOp
from pymatgen.util.string import transformation_to... |
17,570 | test modify dry run | import pytest
from typer.testing import CliRunner
from hailtop.hailctl.dataproc import cli
runner = CliRunner(mix_stderr=False)
def test_stop(gcloud_run):
runner.invoke(cli.app, ['modify', 'test-cluster', '--num-workers=2'])
assert gcloud_run.call_args[0][0][:3] == ["dataproc", "clusters", "update"]
def ... |
17,571 | is includable | # (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... |
17,572 | copy file | """Copy the partitions to a cluster of machines."""
import argparse
import copy
import json
import logging
import os
import signal
import stat
import subprocess
import sys
def METHOD_NAME(file_name, ip, workspace, param=""):
print("copy {} to {}".format(file_name, ip + ":" + workspace + "/"))
cmd = "scp " + p... |
17,573 | assert node is branch | import unittest
from tree_building import Record, BuildTree
class TreeBuildingTest(unittest.TestCase):
"""
Record(record_id, parent_id): records given to be processed
Node(node_id): Node in tree
BuildTree(records): records as argument and returns tree
BuildTree should raise ValueE... |
17,574 | change peerreviewers for user | """
Short description of Python module
"""
__authors__ = ["Mika Lehtinen", "Simo Lehtinen", "Alexander Södergård"]
__license__ = "MIT"
__date__ = "29.5.2022"
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import joinedload, Query
from timApp.document.docinfo import DocInfo
from timApp.peerreview.peerr... |
17,575 | zero state | # Copyright 2019 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... |
17,576 | get resource guard 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... |
17,577 | on trigger restart | from openpype import AYON_SERVER_ENABLED
from openpype.modules import OpenPypeModule, ITrayAction
class SettingsAction(OpenPypeModule, ITrayAction):
"""Action to show Settings tool."""
name = "settings"
label = "Studio Settings"
admin_action = True
def initialize(self, _modules_settings):
... |
17,578 | test duplicates | import unittest
from os import sys, path
is_standalone = __name__ == '__main__' and __package__ is None
if is_standalone:
sys.path.append(path.abspath(path.join(path.dirname(__file__), "..")))
from ccompiler_opt import CCompilerOpt
else:
from numpy.distutils.ccompiler_opt import CCompilerOpt
arch_compiler... |
17,579 | sgd | """Function for minimizing a scalar function of multiple variables."""
from scipy.optimize import OptimizeResult
from desc.backend import jnp
from .utils import (
STATUS_MESSAGES,
check_termination,
print_header_nonlinear,
print_iteration_nonlinear,
)
def METHOD_NAME(
fun,
x0,
grad,
... |
17,580 | custom loss | # 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 math
import torch
import torch.nn.functional as F
from fairseq import metrics, utils
from fairseq.criterions import FairseqCriterion, ... |
17,581 | test fit | import re
import pytest
from cognite.client.data_classes import Asset, EntityMatchingModel, TimeSeries
from cognite.client.exceptions import ModelFailedException
from tests.utils import jsgz_load
@pytest.fixture
def mock_fit(rsps, cognite_client):
response_body = {"id": 123, "status": "Queued", "createdTime": 4... |
17,582 | generate syscall information | #!/usr/bin/python
"""
Generates common/src/SyscallInformation.C and dynutil/h/dyn_syscalls.h
"""
import os
import sys
import string
def generate_dyn_syscalls(allSyscallNames):
# Open file for writing
outFile = open("dyn_syscalls.h", "w")
# Write out "header" information
outFile.write("/* This file... |
17,583 | html decode |
# Copyright 2008-2012 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''This module supports dumping to HTML'''
# TODO paragraph indenting using margin CSS ?
# TODO use global CSS for checkboxes instead of inline style - needs also support from tempalte etc
import re
import string
from zim.formats import *
from zim... |
17,584 | only for | # -*- coding: utf-8 -*-
import datetime
from http import HTTPStatus
import logging
from functools import wraps
from flask import g, request
from flask_restful import Resource, Api
from flask_mail import Mail
from flask_jwt_extended import (
get_jwt, get_jwt_identity, jwt_required
)
from flask_socketio import Sock... |
17,585 | test statsmodels autolog ends auto created run | from unittest import mock
import numpy as np
import pytest
from statsmodels.tsa.base.tsa_model import TimeSeriesModel
import mlflow
import mlflow.statsmodels
from mlflow import MlflowClient
from tests.statsmodels.model_fixtures import (
arma_model,
failing_logit_model,
gee_model,
glm_model,
gls_m... |
17,586 | mock multichain configuration | from collections import defaultdict
import pytest
from eth_utils.crypto import keccak
from nucypher.blockchain.eth.actors import Ritualist
from nucypher.blockchain.eth.networks import NetworksInventory
from nucypher.crypto.powers import TransactingPower
from nucypher.network.nodes import Learner
from nucypher.network... |
17,587 | experiment | # -*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenSesame is distr... |
17,588 | test services video recording stop recording not | """Tests for the video_recording service in the ``core`` app of the Marsha project."""
from datetime import timedelta
import random
from unittest import mock
from django.test import TestCase, override_settings
from django.utils import timezone
from marsha.core.defaults import HARVESTING, JITSI, LIVE_CHOICES, PENDING,... |
17,589 | get vlan ports tagging | import click
from natsort import natsorted
from tabulate import tabulate
import utilities_common.cli as clicommon
@click.group(cls=clicommon.AliasedGroup)
def vlan():
"""Show VLAN information"""
pass
def get_vlan_id(ctx, vlan):
vlan_prefix, vid = vlan.split('Vlan')
return vid
def get_vlan_ip_addr... |
17,590 | process | import kaldiio
from tqdm import tqdm
import os
from funasr.utils.misc import load_scp_as_list, load_scp_as_dict
import numpy as np
import argparse
from kaldiio import WriteHelper
def calc_global_ivc(spk, spk2utt, utt2ivc):
ivc_list = [kaldiio.load_mat(utt2ivc[utt])[np.newaxis, :] for utt in spk2utt[spk]]
ivc ... |
17,591 | kerning changed | from PyQt5.QtCore import QAbstractItemModel, QModelIndex, QSize, Qt
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QTreeView, QVBoxLayout, QWidget
from trufont.objects import settings
class KerningDictModel(QAbstractItemModel):
def __init__(self, mapping={}, parent=None):
super().__init__(par... |
17,592 | invalid socket | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
import http.client
import json
import socket
import io
import pytest
from vdsm.common.units import GiB
from vdsm.storage import exception as se
from vdsm.storage import imagetickets
from testlib import recorded
class FakeResponse(... |
17,593 | test runner gpu configuration | from __future__ import annotations
import typing as t
from typing import TYPE_CHECKING
import pytest
from bentoml.exceptions import BentoMLConfigException
if TYPE_CHECKING:
from simple_di.providers import ConfigDictType
@pytest.mark.usefixtures("container_from_file")
def test_validate_configuration(container_... |
17,594 | test freq mask | """Various tests for the maskParameter"""
import os
import pytest
from io import StringIO
import astropy.units as u
import numpy as np
from pint.models.model_builder import get_model
from pint.models.parameter import maskParameter
from pint.toa import get_TOAs
from pinttestdata import datadir
@pytest.fixture
def to... |
17,595 | name | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
fr... |
17,596 | make tmp jid dirs | """
Unit tests for the Default Job Cache (local_cache).
"""
import os
import time
import pytest
import salt.returners.local_cache as local_cache
import salt.utils.files
import salt.utils.jid
import salt.utils.job
import salt.utils.platform
from tests.support.mock import MagicMock, patch
@pytest.fixture
def tmp_cac... |
17,597 | test get editable metadata fields before start | import unittest
from codalab.lib.worksheet_util import apply_func, get_editable_metadata_fields
from codalab.bundles.run_bundle import RunBundle
class WorksheetUtilTest(unittest.TestCase):
def test_apply_func(self):
"""
Test apply_func for rendering values in worksheets.
"""
self.... |
17,598 | get firewall rule output | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ =... |
17,599 | test h elfr open belw | # Impacket - Collection of Python classes for working with network protocols.
#
# Copyright (C) 2023 Fortra. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Tested so far:
# (h)ElfrOpen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.