id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
1,300 | on results | from android.runnable import run_on_ui_thread
from jnius import autoclass
from jnius import java_method
from jnius import PythonJavaClass
from plyer.facades import STT
from plyer.platforms.android import activity
ArrayList = autoclass('java.util.ArrayList')
Bundle = autoclass('android.os.Bundle')
Context = autoclass... |
1,301 | degree | # sage.doctest: optional - sage.rings.finite_rings (because all doctests use finite fields)
"""
Places of function fields: rational
"""
# ****************************************************************************
# Copyright (C) 2016-2022 Kwankyu Lee <ekwankyu@gmail.com>
# 2019 B... |
1,302 | list | # 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... |
1,303 | new function | import copy
import inspect
import logging
import functools
from typing import Dict, Set
from itertools import takewhile
from weakref import WeakKeyDictionary, ref
from inspect import isgenerator
logger = logging.getLogger(__name__)
class EventsGatherMetaclass(type):
"""
Metaclass that is used for Eventful to... |
1,304 | previous page | from __future__ import annotations
import asyncio
import typing as T
import discord
from utils.default import split_list
from .Context import Context
from .views import QuotientView
class PageLine(T.NamedTuple):
line: T.Optional[str] = None
image: T.Optional[str] = None
# embed: T.Optional[discord.Emb... |
1,305 | test hybridconnetion curd | # 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.
#---------------------------------------------------------------------... |
1,306 | test proto2 file shelf | import unittest
import shelve
import glob
from test import support
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {}
de... |
1,307 | report error | import json
import os
import pickle
from datetime import date, datetime
from logging import Logger
from typing import NamedTuple, Optional
# Delay saving as JSON for a few CumulusCI releases because
# people might downgrade a release and then their
# CCI can't parse their JSON orgfiles
#
# Thus we roll out the ability... |
1,308 | run config |
"""
Run PyTorch cpu benchmarking.
"""
import argparse
import os
import numpy
from typing import List, Dict, Optional
from pathlib import Path
from cpu_utils import add_path, REPO_PATH, validate, parse_str_to_list, list_metrics, get_output_dir, get_output_json, dump_output
with add_path(str(REPO_PATH)):
from torc... |
1,309 | generate input | # 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... |
1,310 | session scope | from typing import List, Dict, Any, Optional, TYPE_CHECKING
import time
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.exc import DatabaseError
from ..errors import AngrCorruptDBError, AngrIncompatibleDBError, AngrDBError
from ..proje... |
1,311 | test go application command line arguments change | import re
from unit.applications.lang.go import ApplicationGo
prerequisites = {'modules': {'go': 'all'}}
client = ApplicationGo()
def test_go_application_variables(date_to_sec_epoch, sec_epoch):
client.load('variables')
body = 'Test body string.'
resp = client.post(
headers={
'Hos... |
1,312 | list plugins | """
This module is used to manage Wordpress installations
:depends: wp binary from http://wp-cli.org/
"""
# Import Python Modules
import collections
# Import Salt Modules
import salt.utils.path
Plugin = collections.namedtuple("Plugin", "name status update versino")
def __virtual__():
if salt.utils.path.which... |
1,313 | http post | from typing import List, Optional, Union
from urllib.error import HTTPError, URLError
import requests
from robusta.api import (
ActionParams,
ExecutionBaseEvent,
FileBlock,
Finding,
FindingSource,
FindingType,
MarkdownBlock,
action,
)
class HTTP_GET(ActionParams):
"""
:var ur... |
1,314 | show help | #!/usr/bin/env python
#
# Copyright (C) 2017 Inventec, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This p... |
1,315 | test call within randomstate | import sys
from numpy.testing import (
assert_, assert_array_equal, assert_raises,
)
from numpy import random
import numpy as np
class TestRegression:
def test_VonMises_range(self):
# Make sure generated random variables are in [-pi, pi].
# Regression test for ticket #986.
for mu ... |
1,316 | read sites file | # -*- coding: utf-8 -*-
"""
===================
Winglink Tools
===================
* module to deal with WingLink output files
Created on Mon Aug 26 17:44:20 2013
@author: jpeacock-pr
"""
#==============================================================================
import numpy as np
#========================... |
1,317 | test reduce slice prod | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
1,318 | handler | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
1,319 | test breakable scheduler time restrictions | from datetime import datetime, timedelta
import pytest
import pytz
from flexmeasures.data.models.time_series import Sensor
from flexmeasures.data.models.planning.process import ProcessScheduler
tz = pytz.timezone("Europe/Amsterdam")
start = tz.localize(datetime(2015, 1, 2))
end = tz.localize(datetime(2015, 1, 3))
re... |
1,320 | product 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
__all__ =... |
1,321 | on response | """
$description Russian live-streaming and video hosting social platform.
$url vk.com
$url vk.ru
$type live, vod
$metadata id
$metadata author
$metadata title
"""
import logging
import re
from hashlib import md5
from urllib.parse import parse_qsl, unquote, urlparse, urlunparse
from streamlink.exceptions import NoStr... |
1,322 | prepare contract value | # Copyright 2017 LasLabs Inc.
# Copyright 2018 ACSONE SA/NV.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class SaleOrder(models.Model):
_inherit = "sale.order"
is_contract = fields.Boolean(string="Is... |
1,323 | autoplan | """ an autoplanning solver which takes in courses and spits a plan """
from pprint import pprint
from typing import Tuple
from ortools.sat.python import cp_model # type: ignore
from algorithms.objects.course import Course
from algorithms.objects.user import User
from server.routers.model import CONDITIONS
# Inspired by... |
1,324 | bzip frames | #!/usr/bin/env python3
import os
import sys
import bz2
import numpy as np
import pyopencl as cl # install with `PYOPENCL_CL_PRETEND_VERSION=2.0 pip install pyopencl`
from system.hardware import PC, TICI
from common.basedir import BASEDIR
from selfdrive.test.openpilotci import BASE_URL, get_url
from system.version im... |
1,325 | set goal | import time
import pybullet as pb
import pybullet_data
import rospy
from soccer_common.transformation import Transformation
from soccer_pycontrol.links import Links
from soccer_pycontrol.ramp import Ramp
from soccer_pycontrol.soccerbot import Soccerbot
class Navigator:
"""
The 2D Navigator class, has a runn... |
1,326 | test init with duplicate gid | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
import unittest
from antlir.compiler.items.group import (
GROUP_FILE_PATH,
GroupFile,
GroupFi... |
1,327 | filter | import numpy as np
import pytest
import aesara
import aesara.graph.op as op
import aesara.tensor as at
from aesara import shared
from aesara.configdefaults import config
from aesara.graph.basic import Apply, Variable
from aesara.graph.op import Op
from aesara.graph.type import Type
from aesara.graph.utils import TestV... |
1,328 | database consistent | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... |
1,329 | get geometry output | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Provides custom functions over command-line arguments.
"""
from typing import Optional, List, Dict, Any, Sequ... |
1,330 | mime types | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from core.load_modules import load_all_modules, load_all_profiles
from core.load_modules import load_all_graphs
from core.alert import messages
from flask import abort
from config import nettacker_paths
def structure(status="", msg=""):
"""
basic JSON ... |
1,331 | create weight proxy | import operator
from abc import ABC, abstractmethod
import torch
import torch.nn.functional as F
class BiasAdditionModule(ABC):
"""
This class is used to construct the restructure computation graph for
call_module node with bias addition inside.
"""
def __init__(self, tracer, target, args, kwarg... |
1,332 | test with refcounts | import os, sys, unittest, getopt, time
use_resources = []
import ctypes
ctypes_symbols = dir(ctypes)
def need_symbol(name):
return unittest.skipUnless(name in ctypes_symbols,
'{!r} is required'.format(name))
class ResourceDenied(unittest.SkipTest):
"""Test skipped because it ... |
1,333 | get assessment 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... |
1,334 | print api input | # Copyright (c) <2021> Side Effects Software Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... |
1,335 | region 2d to vector 3d | # SPDX-FileCopyrightText: 2011-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"region_2d_to_vector_3d",
"region_2d_to_origin_3d",
"region_2d_to_location_3d",
"location_3d_to_region_2d",
)
def METHOD_NAME(region, rv3d, coord):
"""
Return a direction vector from ... |
1,336 | get error description | # Name: sfp.py, version: 1.0
#
# Description: Module contains the definitions of SFP related APIs
# for Nokia IXS 7215 platform.
#
# Copyright (c) 2023, Nokia
# All rights reserved.
#
try:
import os
from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase
from sonic_py_common.logger import Lo... |
1,337 | check run preconditions | import uuid
import os
from datetime import datetime
from django.db import transaction
from api.management.data_script import OperationalDataScript
from api.models.CompliancePeriod import CompliancePeriod
from api.models.Organization import Organization
from api.models.OrganizationActionsType import OrganizationActio... |
1,338 | test client with url ends with table | # 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.
# --------------------------------------------------------------------... |
1,339 | load elements | #!/usr/bin/python3 -u
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that i... |
1,340 | get plan original | ## @package predictor_py_utils
# Module caffe2.python.predictor.predictor_py_utils
from caffe2.python import core, scope
def create_predict_net(predictor_export_meta):
"""
Return the input prediction net.
"""
# Construct a new net to clear the existing settings.
net = core.Net(predictor_export_m... |
1,341 | tag | import os
import re
import subprocess
import sys
from contextlib import contextmanager
FORBIDDEN_CODECOV_FLAG_CHARS = re.compile(r'[^\w\.\-]')
class GoModule:
"""
A Go module abstraction.
independent specifies whether this modules is supposed to exist independently of the datadog-agent module.
If Tru... |
1,342 | unwrap | import sys
from collections.abc import Callable, Iterable, Mapping, Sequence
from typing import Any, AnyStr, Generic, NamedTuple, TypeVar, overload
from typing_extensions import Literal, TypeAlias
if sys.version_info >= (3, 9):
from types import GenericAlias
__all__ = [
"urlparse",
"urlunparse",
"urlj... |
1,343 | init | from mxcubecore import HardwareRepository as HWR
from mxcubecore.BaseHardwareObjects import Device
import logging
class ALBAFrontLight(Device):
def __init__(self, *args):
Device.__init__(self, *args)
self.limits = [None, None]
self.state = None
self.register_state = None
... |
1,344 | alca harvesting | #!/usr/bin/env python3
"""
_Scenario_
Standard cmsRun Process building interface used for data processing
for a particular data scenario.
A scenario is a macro-data-taking setting such as cosmic running,
beam halo running, or particular validation tests.
This class defines the interfaces used by the Tier 0 and Tier 1... |
1,345 | init files visit | # ===============================================================================
# NAME: InstanceTopologyHTMLVisitor.py
#
# DESCRIPTION: A visitor responsible for the generation of HTML tables
# of command ID's, etc.
#
# AUTHOR: reder
# EMAIL: reder@jpl.nasa.gov
# DATE CREATED : Sep. 13, 2016
#
# Copyri... |
1,346 | test bounding rect from offset at word2 | #tests/unit/contentRecog/test_contentRecog.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2017 NV Access Limited
"""Unit tests for the contentRecog module.
"""
import unittest
import contentRecog
import text... |
1,347 | test access with list | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for pyvo.dal.datalink
"""
from functools import partial
import pytest
import pyvo as vo
from pyvo.dal.adhoc import DatalinkResults
from pyvo.utils import vocabularies
from astropy.utils.data import get_pkg_data_contents, ... |
1,348 | plot results | """
========================================================================
Concentration Prior Type Analysis of Variation Bayesian Gaussian Mixture
========================================================================
This example plots the ellipsoids obtained from a toy dataset (mixture of three
Gaussians) fitte... |
1,349 | test categorical is not constant | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
1,350 | test app | import sys
import cherrypy
from cherrypy._cpcompat import ntob
from cherrypy.test import helper
class WSGIGraftTests(helper.CPWebCase):
@staticmethod
def setup_server():
def METHOD_NAME(environ, start_response):
status = '200 OK'
response_headers = [('Content-type', 'text/pl... |
1,351 | test core invalid | #
# Copyright (C) 2010 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... |
1,352 | head204 | # 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... |
1,353 | test single | from bsb import topology
from bsb.config import Configuration
from bsb.exceptions import *
import unittest, numpy as np
from bsb.unittest import get_data_path
def single_layer():
c = topology.Layer(thickness=150, stack_index=0)
r = topology.Stack(children=[c])
topology.create_topology([r], np.array([0, 0,... |
1,354 | test byte | # -*- coding: utf-8 -*-
from datetime import date
from datetime import datetime
import six
from mock import patch
from bravado_core.formatter import SwaggerFormat
from bravado_core.formatter import to_python
from bravado_core.spec import Spec
if not six.PY2:
long = int
def test_none(minimal_swagger_spec):
... |
1,355 | transform | # Copyright 2020 IBM 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 writing, ... |
1,356 | create base argument parser | import argparse
import errno
import re
import sys
from datetime import datetime
from typing import Any, Dict, List, Sequence, Tuple, Union
import can
from can.io import BaseRotatingLogger
from can.io.generic import MessageWriter
from can.util import cast_from_string
from . import Bus, BusState, Logger, SizedRotatingL... |
1,357 | test uhf symm | # Copyright 2014-2019 The PySCF Developers. 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 appl... |
1,358 | stub request certificate | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Stub functions that are used by the AWS Certificate Manager (ACM) unit tests.
When tests are run against an actual AWS account, the stubber class does not
set up stubs and passes all calls through to the Bot... |
1,359 | get state | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=C0111,R0903
"""Displays the state of a Space API endpoint
Space API is an API for hackspaces based on JSON. See spaceapi.io for
an example.
Requires the following libraries:
* requests
Parameters:
* spaceapi.url: String representation of the ap... |
1,360 | pmap extended | """Produces memory usage information"""
import gc
import objgraph
import os
import resource
import subprocess
import tempfile
import zlib
from StringIO import StringIO
from typing import Optional # noqa
from autopush.gcdump import Stat
from cffi import FFI
# cffi's API mode is preferable but it would assume jemall... |
1,361 | set widgets enabled | #!/usr/bin/env python
# --!-- coding: utf8 --!--
import json
import os
from PyQt5.QtCore import Qt, QPoint
from PyQt5.QtGui import QBrush, QColor, QIcon
from PyQt5.QtWidgets import QWidget, QStyle
from manuskript import exporter
from manuskript.functions import writablePath, openURL
from manuskript.ui.exporters.expor... |
1,362 | get model | ########################################################################
# Ruijie B6510-48VS8CQ
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Thermals' information which are available in the platform
#
########################################################################
try:
... |
1,363 | test chemical constants package json export does | '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2020, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
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... |
1,364 | before draw page | #!/usr/bin/env python3
import sys
import json
import html
from reportlab.lib.pagesizes import letter
from reportlab.platypus import Frame, Paragraph, Spacer, PageBreak,PageTemplate, BaseDocTemplate
from reportlab.platypus.tableofcontents import TableOfContents
from reportlab.lib.styles import getSampleStyleSheet, Parag... |
1,365 | absent strategy | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Scaleway Security Group management module
#
# Copyright (C) 2018 Antoine Barbare (antoinebarbare@gmail.com).
#
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
fro... |
1,366 | get addon version output | # 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... |
1,367 | wrapper | #
# Copyright (C) 2016 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... |
1,368 | set new range immediately | import typing as T
import random
import math
class UpdatableRandomRange:
def __init__(self, start: int, stop: int):
assert stop > start
self.min = start
self.METHOD_NAME(start, stop)
def set_new_max(self, new_max: int):
# do not replace RNG until old one is exhausted
a... |
1,369 | cmake args | # 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 os
from spack.package import *
class Casacore(CMakePackage):
"""A suite of c++ libraries for radio astronomy... |
1,370 | test permutate qubit dm | import numpy as np
from qulacs import DensityMatrix, StateVector
from qulacs.state import partial_trace, permutate_qubit, tensor_product
class TestDensityMatrixHandling:
def test_density_matrix(self) -> None:
num_qubit = 5
sv = StateVector(num_qubit)
dm = DensityMatrix(num_qubit)
... |
1,371 | format | #!/usr/bin/env python3
import multiprocessing
import os
import re
import shutil
import subprocess
from flipper.app import App
SOURCE_CODE_FILE_EXTENSIONS = [".h", ".c", ".cpp", ".cxx", ".hpp"]
SOURCE_CODE_FILE_PATTERN = r"^[0-9A-Za-z_]+\.[a-z]+$"
SOURCE_CODE_DIR_PATTERN = r"^[0-9A-Za-z_]+$"
class Main(App):
de... |
1,372 | on getaddr | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test message sending before handshake completion.
A node should never send anything other than VERSION/VERA... |
1,373 | prior realization | r"""
04. Bayesian Inversion
======================
This tutorial focuses on Bayesian inversion, a special type of inverse problem
that aims at incorporating prior information in terms of model and data
probabilities in the inversion process.
In this case we will be dealing with the same problem that we discussed in
:r... |
1,374 | test read and write scardec from open | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import numpy as np
import warnings
import obspy
from obspy.core.util.base import NamedTemporaryFile
from obspy.io.scardec.core import _is_scardec
class TestScardec():
"""
Test suite for obspy.io.scardec.
The tests usually directly utilize... |
1,375 | mult | # Ref: MIPS® Architecture for Programmers Volume II-A: The MIPS32® Instruction Set Manual
# Document Number: MD00086 Revision 6.05
# Accession: G00021
__all__ = [
# R-format
"SLL", "SRL", "SRA", "JR", "JALR", "MFHI", "MTHI", "MFLO", "MTLO", "DIV", "DIVU", "MULT",
"MULTU", "ADD", "ADDU", "SUB", "SUBU", "AND... |
1,376 | mock process | import libqtile.config
from libqtile.widget.check_updates import CheckUpdates, Popen # noqa: F401
from test.widgets.conftest import FakeBar
wrong_distro = "Barch"
good_distro = "Arch"
cmd_0_line = "export toto" # quick "monkeypatch" simulating 0 output, ie 0 update
cmd_1_line = "echo toto" # quick "monkeypatch" sim... |
1,377 | ninputs | from textwrap import TextWrapper
import re, os
# precompile a URL matching regular expression
urlexpr = re.compile(r"((https?):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)", re.MULTILINE|re.UNICODE)
def inputs(args):
'''Keeps only the input arguments in a list of elements.
'''
try:
return [arg for arg... |
1,378 | login | """
$description TV and live video game broadcasts, artist performances and personal daily-life video blogs & shows.
$url play.afreecatv.com
$type live
"""
import logging
import re
from streamlink.plugin import Plugin, pluginargument, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls... |
1,379 | set message | """Chip viewer and widget.
In the lower left corner of the main Pynche window, you will see two
ChipWidgets, one for the selected color and one for the nearest color. The
selected color is the actual RGB value expressed as an X11 #COLOR name. The
nearest color is the named color from the X11 database that is closest ... |
1,380 | get configuration category | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge-iot.readthedocs.io/
# FLEDGE_END
"""Common FledgeProcess Class"""
from abc import ABC, abstractmethod
import argparse
import time
from fledge.common.storage_client.storage_client import StorageClientAsync, ReadingsStorageClientAsync
from fledge.common impor... |
1,381 | delete root probable dead object list index | #
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# 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... |
1,382 | get dedicated ip pool output | # 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... |
1,383 | get data | """
Stores application data.
"""
# standard libraries
import copy
import json
import pathlib
import threading
import typing
# third party libraries
from nion.swift.model import Utility
from nion.utils import Event
from nion.utils import StructuredModel
class ApplicationData:
"""Application data is a singleton t... |
1,384 | isint | # This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
#
# 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 wo... |
1,385 | is normalized | # The Notices and Disclaimers for Ocean Worlds Autonomy Testbed for Exploration
# Research and Simulation can be found in README.md in the root directory of
# this repository.
from math import sqrt, isclose, acos
from geometry_msgs.msg import Quaternion, Vector3
def _types_match(a, b):
return type(a) == type(b)
de... |
1,386 | get current | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 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
... |
1,387 | validate sample list1 | # 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... |
1,388 | set basic data json | """This module contains function to save building element classes."""
import teaser.logic.utilities as utilities
import warnings
import collections
import json
def save_type_element(element, data_class):
"""Save information about building element to json.
Saves typical building elements according to their c... |
1,389 | run test | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test rejection of invalid custom TXs."""
from test_framewor... |
1,390 | file exists error | """
Compatibility module similar to six lib, which helps maintaining
a single code base working with both python 2.7 and 3.x.
"""
import errno
import os
import sys
import types
PY3 = sys.version_info[0] == 3
_SENTINEL = object()
if PY3:
def u(s):
return s
def b(s):
return s.encode("latin-1"... |
1,391 | write chartsheet | ###############################################################################
#
# Chartsheet - A class for writing the Excel XLSX Worksheet file.
#
# Copyright 2013-2017, John McNamara, jmcnamara@cpan.org
#
from . import worksheet
from .drawing import Drawing
class Chartsheet(worksheet.Worksheet):
"""
A cl... |
1,392 | async result | # Copyright (c) 2020 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2020 Martin Zimandl <martin.zimandl@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publis... |
1,393 | custom loss | # Copyright 2020 The AutoKeras 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 i... |
1,394 | verify | #!/usr/bin/env python3
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
1,395 | disable threads viewer patch add layer | import contextlib
from contextlib import suppress
import pytest
from qtpy.QtWidgets import QDialog, QInputDialog, QMessageBox
from PartSeg._roi_analysis.partseg_settings import PartSettings
from PartSeg._roi_mask.main_window import ChosenComponents
from PartSeg._roi_mask.stack_settings import StackSettings
from PartS... |
1,396 | execute process | # =================================================================
#
# Authors: Martin Pontius <m.pontius@52north.org>
# Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2022 52°North Spatial Information Research GmbH
# Copyright (c) 2022 Tom Kralidis
#
# Permission is hereby granted, free of charge, to... |
1,397 | init | #@+leo-ver=5-thin
#@+node:ekr.20160928073518.1: * @file ../plugins/pyplot_backend.py
"""
A helper for the viewrendered plugin.
This is *NOT* a real plugin.
"""
#@+<< pyplot_backend imports >>
#@+node:ekr.20160928074801.1: ** << pyplot_backend imports >>
from leo.core import leoGlobals as g
from leo.plugins impo... |
1,398 | normal | # 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 as nn
import torch.nn.functional as F
from funasr.modules.data2vec.multihead_attention import Multi... |
1,399 | create base | """
Tutorial Diagrams
-----------------
This script plots the flow-charts used in the scikit-learn tutorials.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Rectangle, Polygon, Arrow, FancyArrow
def METHOD_NAME(box_bg="#CCCCCC", arrow1="#88CCFF", arrow2="#88FF88", supe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.