id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
12,800 | name get | # Copyright 2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.tools.misc import format_... |
12,801 | get current statement | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
12,802 | concat video | # Copyright (c) OpenMMLab. All rights reserved.
import os
import os.path as osp
import subprocess
import tempfile
from typing import List, Optional, Union
from mmengine.utils import requires_executable
@requires_executable('ffmpeg')
def convert_video(in_file: str,
out_file: str,
p... |
12,803 | load code dict | # 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 collections
import io
import json
import librosa
import numpy as np
import soundfile as sf
import time
import torch
from scipy.io.wavfi... |
12,804 | validate against regex | # SPDX-FileCopyrightText: 2022 spdx contributors
#
# SPDX-License-Identifier: Apache-2.0
import re
import uritools
from beartype.typing import Dict, List
from spdx_tools.spdx.model import ExternalPackageRef, ExternalPackageRefCategory
from spdx_tools.spdx.model.package import CATEGORY_TO_EXTERNAL_PACKAGE_REF_TYPES
fr... |
12,805 | get instances | import json
import os
from typing import Dict, List
from helm.common.general import ensure_file_downloaded
from .scenario import Scenario, Instance, Reference, ALL_SPLITS, CORRECT_TAG, VALID_SPLIT, Input, Output
class MedQAScenario(Scenario):
"""
From "What Disease Does This Patient Have? A Large-Scale Open ... |
12,806 | set previous tab | import toga
from toga.constants import COLUMN, ROW
from toga.style import Pack
class ExampleOptionContainerApp(toga.App):
def _create_options(self):
self._box_count = 0
for i in range(3):
self.optioncontainer.content.append(*self._create_option())
self._refresh_select()
de... |
12,807 | test get user by identity new user | import pytest
from quetz.authentication import auth_dao
from quetz.db_models import Email
from quetz.errors import ValidationError
def find_email(emails, e):
for eo in emails:
if eo.email == e:
return eo
raise KeyError("Missing email from list")
def METHOD_NAME(dao, config):
profile... |
12,808 | match | # A binary morphology add-on for the Python Imaging Library
#
# History:
# 2014-06-04 Initial version.
#
# Copyright (c) 2014 Dov Grobgeld <dov.grobgeld@gmail.com>
from __future__ import print_function
import re
from . import Image, _imagingmorph
LUT_SIZE = 1 << 9
# fmt: off
ROTATION_MATRIX = [
6, 3, 0,
... |
12,809 | extend | from deeplake.util.exceptions import TensorDoesNotExistError, SampleAppendError
from deeplake.core.linked_tiled_sample import LinkedTiledSample
from deeplake.core.partial_sample import PartialSample
from deeplake.core.linked_sample import LinkedSample
from deeplake.core.sample import Sample
from deeplake.core.tensor im... |
12,810 | property1 | # 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 ... |
12,811 | package info | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd, valid_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir
f... |
12,812 | process deposit | from collections import defaultdict
from collections.abc import Iterator
from typing import TYPE_CHECKING
from rotkehlchen.accounting.mixins.event import AccountingEventType
from rotkehlchen.accounting.structures.evm_event import get_tx_event_type_identifier
from rotkehlchen.accounting.structures.types import HistoryE... |
12,813 | test choices | import asyncio
import json
import typing as t
import unittest
from piccolo.columns import (
Array,
Decimal,
ForeignKey,
Integer,
LazyTableReference,
Numeric,
Real,
Varchar,
)
from piccolo.table import Table, create_db_tables_sync, drop_db_tables_sync
from piccolo.testing.model_builder i... |
12,814 | test debounce task if proj config not | from unittest.mock import patch, sentinel
import pytest
from django.urls import reverse
from sentry.db.postgres.transactions import in_test_hide_transaction_boundary
from sentry.relay.config import ProjectConfig
from sentry.tasks.relay import build_project_config
from sentry.testutils.hybrid_cloud import simulated_tr... |
12,815 | set up class | # Copyright(c) 2018-2022, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the fo... |
12,816 | create preview results | from mage_ai.data_cleaner.cleaning_rules.base import STATUS_COMPLETED
from mage_ai.data_cleaner.cleaning_rules.clean_column_names import CleanColumnNames
from mage_ai.data_cleaner.cleaning_rules.fix_syntax_errors import FixSyntaxErrors
from mage_ai.data_cleaner.cleaning_rules.impute_values import ImputeValues
from mage... |
12,817 | config string | # coding=utf-8
"""Provider code for RSS Torrents."""
from __future__ import unicode_literals
import io
import logging
import os
import re
from bencodepy import DEFAULT as BENCODE
from medusa import (
app,
helpers,
tv,
)
from medusa.helper.exceptions import ex
from medusa.providers.generic_provider impo... |
12,818 | l2cap packet | #!/usr/bin/env python3
# BlueKitchen GmbH (c) 2022
# parse PacketLogger and reconstruct GATT DB
import sys
import datetime
import struct
def as_hex(data):
str_list = []
for byte in data:
str_list.append("{0:02x} ".format(byte))
return ''.join(str_list)
def as_bd_addr(data):
str_list = []
for byte in data:... |
12,819 | test find backend | # Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
12,820 | remove tag | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import abc
import copy
import logging
from abc import ABC
from c7n.actions import BaseAction
from c7n.utils import type_schema
log = logging.getLogger("custodian.oci.actions.base")
class OCIBaseAction(BaseAction, ABC):
failed_resour... |
12,821 | teardown module | # -*- coding: UTF-8 -*-
#
# A note on the mappings used in these tests:
#
# - 'identity_2d.h5' is the identity mapping on the unit square [0, 1] X [0, 1]
#
# - 'collela_2d.h5' is a NURBS mapping from the unit square [0, 1]^2 to the
# larger square [-1, 1]^2, with deformations going as sin(pi x) * sin(pi y)
#
#... |
12,822 | test sklearn parameter tuning | """Unit tests for sktime classifier compatability with sklearn interfaces."""
__author__ = ["MatthewMiddlehurst"]
__all__ = [
"test_sklearn_cross_validation",
"test_sklearn_cross_validation_iterators",
"test_sklearn_parameter_tuning",
"test_sklearn_composite_classifiers",
]
import numpy as np
import p... |
12,823 | get gt templates | # -*- coding: utf-8 -*-
import os
import numpy as np
import cv2
# borrowed from https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py
def get_files(img_dir):
image_list, sf_list, bbox_list, depth_list = list_files(img_dir)
return image_list, sf_list, bbox_list, depth_list
# gwanjung datas... |
12,824 | test performance pytorch gpu imagenet | import os
import time
import pytest
import re
from test.test_utils import (
CONTAINER_TESTS_PREFIX,
PT_GPU_PY3_BENCHMARK_IMAGENET_AMI_US_WEST_2,
UBUNTU_18_HPU_DLAMI_US_WEST_2,
DEFAULT_REGION,
get_framework_and_version_from_tag,
is_pr_context,
)
from test.test_utils.ec2 import (
execute_ec2_... |
12,825 | after action instance | import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_almost_equal
from scipy.spatial.transform import Rotation
from sklearn.decomposition import PCA
from gaitmap.preprocessing.sensor_alignment import PcaAlignment
from gaitmap.utils.datatype_helper import get_multi_sensor_names
from tes... |
12,826 | append var u int32 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
12,827 | component | """OTP Time-based models"""
import time
from base64 import b32encode
from binascii import unhexlify
from typing import Optional
from urllib.parse import quote, urlencode
from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.views import View
fr... |
12,828 | main | """Base Command class, and related routines"""
import functools
import logging
import logging.config
import optparse
import os
import sys
import traceback
from optparse import Values
from typing import Any, Callable, List, Optional, Tuple
from pip._vendor.rich import traceback as rich_traceback
from pip._internal.cl... |
12,829 | generate random dag | import copy
import random
import numpy as np
import pandas as pd
import sky
from sky import clouds
from sky.clouds import service_catalog
ALL_INSTANCE_TYPE_INFOS = sum(
sky.list_accelerators(gpus_only=True).values(), [])
DUMMY_NODES = [
sky.optimizer._DUMMY_SOURCE_NAME,
sky.optimizer._DUMMY_SINK_NAME,
]... |
12,830 | test keep alive return value | import pytest
import env # noqa: F401
from pybind11_tests import ConstructorStats
from pybind11_tests import call_policies as m
@pytest.mark.xfail("env.PYPY", reason="sometimes comes out 1 off on PyPy", strict=False)
def test_keep_alive_argument(capture):
n_inst = ConstructorStats.detail_reg_inst()
with cap... |
12,831 | abort render | """
Flowblade Movie Editor is a nonlinear video editor.
Copyright 2012 Janne Liljeblad.
This file is part of Flowblade Movie Editor <https://github.com/jliljebl/flowblade/>.
Flowblade Movie Editor is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public ... |
12,832 | defaults dict | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... |
12,833 | verify repository | from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class SnapshotClient(NamespacedClient):
@query_params('master_timeout', 'wait_for_completion')
def create(self, repository, snapshot, body=None, params=None):
"""
Create a snapshot in repository
`<http://www.ela... |
12,834 | respond | import logging
import time
import os
import sentry_sdk
import torch
from flask import Flask, request, jsonify
from sentry_sdk.integrations.flask import FlaskIntegration
from transformers import GPT2Tokenizer, GPT2LMHeadModel
from transformers import BartForConditionalGeneration, BartTokenizer
from string import punctu... |
12,835 | sure shrink | '''
author: im354
'''
from __future__ import division
from builtins import zip
from builtins import range
from past.utils import old_div
import numpy as np
import matplotlib.pyplot as plt
import pywt
from scipy.optimize import minimize_scalar
def blocks():
N = 2048
t = np.linspace(0,1,N)
Tj = [0.1,0.13,0.15,0.23... |
12,836 | assert in | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite
~~~~~~~~~~~~~~~~~~
Contains all test Werkzeug tests.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import re
import sys
import unittest
import shutil
import tempfile
im... |
12,837 | configuration schema | """Provide the query runner for SPARQL Endpoints.
seeAlso: https://www.w3.org/TR/rdf-sparql-query/
"""
import json
import logging
from os import environ
from redash.query_runner import BaseQueryRunner
from redash.utils import json_dumps, json_loads
from . import register
try:
import requests
from cmem.cmem... |
12,838 | is inactive | # SPDX-FileCopyrightText: 2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Script to get all the inactive gitea developers
# Usage: GITEA_API_TOKEN=<yourtoken> python3 gitea_inactive_developers.py
#
# The API Token have the "read:org" or "admin:org" scope.
#
# Potential errors:
# * 403 Client Error... |
12,839 | add missing operation | #!/usr/bin/env python3
# Contest Management System - http://cms-dev.github.io/
# Copyright © 2014 Stefano Maggiolo <s.maggiolo@gmail.com>
#
# 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... |
12,840 | end dc rights | # Support for the Dublin Core metadata extensions
# Copyright 2010-2023 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that... |
12,841 | g | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... |
12,842 | meta jobs time between status check seconds | # Copyright 2023-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
from vdk.internal.core.config import Configuration
from vdk.internal.core.config import ConfigurationBuilder
META_JOBS_DELAYED_JOBS_MIN_DELAY_SECONDS = "META_JOBS_DELAYED_JOBS_MIN_DELAY_SECONDS"
META_JOBS_DELAYED_JOBS_RANDOMIZED_ADDED_DELAY_SECON... |
12,843 | hdl wid 156 | #
# auto-pts - The Bluetooth PTS Automation Framework
#
# Copyright (c) 2017, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is ... |
12,844 | main | # Copyright (c) 2008, Willow Garage, 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of cond... |
12,845 | log dns key import | # crypto.py
# Keys and signatures.
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dist... |
12,846 | get contents |
"""scons.Node.Alias
Alias nodes.
This creates a hash of global Aliases (dummy targets).
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# 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 So... |
12,847 | sv init | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
12,848 | map providers | # Copyright (c) 2023 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2023 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... |
12,849 | preprocess | # Mikel Broström 🔥 Yolo Tracking 🧾 AGPL-3.0 license
import time
import cv2
import numpy as np
from boxmot.motion.cmc.cmc_interface import CMCInterface
from boxmot.utils import BOXMOT
from boxmot.utils import logger as LOGGER
class ECC(CMCInterface):
def __init__(
self,
warp_mode=cv2.MOTION_EU... |
12,850 | render alert group message | from apps.alerts.incident_appearance.renderers.telegram_renderer import (
AlertGroupTelegramRenderer,
AlertTelegramRenderer,
)
from apps.alerts.incident_log_builder import IncidentLogBuilder
from apps.alerts.models import AlertGroup, AlertGroupLogRecord
from apps.base.models import UserNotificationPolicyLogReco... |
12,851 | make sharded tensor for checkpoint | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
"""Utility functions used throughout Megatron core"""
import math
import operator
from functools import reduce
import torch
from megatron.core import parallel_state
from megatron.core.dist_checkpointing.mapping import ShardedTensor
def ensure_divisibil... |
12,852 | test per plug factory | ##########################################################################
#
# Copyright (c) 2014, Image Engine Design 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:
#
# * Redistrib... |
12,853 | test telemetry | import unittest
import urllib.request
import urllib.error
import urllib.parse
import json
import os
from heartbeat import BaseTest
class Test(BaseTest):
def __init__(self, *args):
self.proc = None
super(Test, self).__init__(*args)
def METHOD_NAME(self):
"""
Test that telemetry... |
12,854 | test run em | from unittest import TestCase
import numpy as np
from scipy import stats
import spateo.segmentation.em as em
from ..mixins import TestMixin
class TestEM(TestMixin, TestCase):
def test_nbn_em(self):
rng = np.random.default_rng(2021)
X = rng.negative_binomial(10, 0.5, 100) + rng.negative_binomial... |
12,855 | build arguments schema | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
12,856 | force exit | """
Python thread pool, see
http://code.activestate.com/recipes/577187-python-thread-pool/
Author: Valentin Kuznetsov <vkuznet [AT] gmail [DOT] com>
"""
# futures
from __future__ import division
from builtins import range, object
from future import standard_library
standard_library.install_aliases()
# system modules... |
12,857 | get default redirect uri | import time
from django.db.models import (
Model,
CharField,
TextField,
BooleanField,
IntegerField,
)
from django.db.models import ForeignKey, CASCADE
from django.contrib.auth.models import User
from authlib.common.security import generate_token
from authlib.oauth2.rfc6749 import (
ClientMixin,
... |
12,858 | test summarize metric kwargs | """Test the metric model."""
import unittest
from datetime import date
from typing import ClassVar
from shared.model.measurement import Measurement
from shared.model.metric import Metric
from shared.utils.functions import iso_timestamp
from tests.fixtures import METRIC_ID
class MetricTest(unittest.TestCase):
"... |
12,859 | test element mat sv sens | import unittest
import numpy as np
from tacs import TACS, constitutive, elements
class ElementTest(unittest.TestCase):
def setUp(self):
max_nodes = 64
max_vars_per_nodes = 8
max_vars = max_nodes * max_vars_per_nodes
# fd/cs step size
if TACS.dtype is complex:
... |
12,860 | test current elections not standing then standing | from unittest.mock import patch
from candidates.models import LoggedAction
from candidates.models.db import ActionType
from candidates.tests.auth import TestUserMixin
from candidates.tests.factories import faker_factory
from candidates.tests.helpers import TmpMediaRootMixin
from candidates.tests.uk_examples import UK2... |
12,861 | create path | import abc
import logging
import os
import numpy as np
import asab
from .utils.closedrows import ClosedRows, PersistentClosedRows
###
L = logging.getLogger(__name__)
###
class Matrix(abc.ABC, asab.ConfigObject):
'''
Generic `Matrix` object.
Matrix structure is organized in a following hiearchical order:
... |
12,862 | 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... |
12,863 | get child attribute value difference | # Checks htlang.xml files for overall filestructure, missing attributes etc.
#
# Checks performed:
# - overall structure (child-count, child-names, attribute-count, attribute-names)
# - presence of all master keys that are used to access the translation like value=1 for levels etc.
# - will dump the stuff to conso... |
12,864 | from parse data | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
A base class is created.
Classes based upon this are used to make more user-friendly interfaces
to the doxygen xml docs than the generated classes provide.
"""
import os
import p... |
12,865 | test ix s g to l | """Tests for dynamic structure factor."""
import numpy as np
from phonopy.spectrum.dynamic_structure_factor import atomic_form_factor_WK1995
# D. Waasmaier and A. Kirfel, Acta Cryst. A51, 416 (1995)
# f(Q) = \sum_i a_i \exp((-b_i Q^2) + c
# Q is in angstron^-1
# a1, b1, a2, b2, a3, b3, a4, b4, a5, b5, c
f_params = {
... |
12,866 | valid followers | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Website property.
"""
try:
from importlib.resources import files # @UnresolvedImport
except ImportError:
from importlib_resources import files # @UnresolvedImport
from rebulk.remodule import re
from rebulk import Rebulk, Rule, RemoveMatch
from ..common impor... |
12,867 | filter target | #!/usr/bin/env python
data = {
"default_prefix": "OSVC_COMP_GROUP_",
"example_value": """
{
"tibco": {
"members": ["tibco", "tibco1"]
},
"tibco1": {
"members": ["tibco1"]
}
}
""",
"description": """* Verify a local system group configuration
* A minus (-) prefix to the group name indicates the us... |
12,868 | lookup | #!/usr/bin/env python
"""Base class for model elements."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Callable, Iterator, Protocol, TypeVar, overload
from uuid import uuid1
from gaphor.core.modeling.event import ElementUpdated
from gaphor.core.modeling.properties import (
... |
12,869 | output | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
12,870 | test create and drop | import pytest
import sqlalchemy as sa
from sqlalchemy_utils import create_database, database_exists, drop_database
from sqlalchemy_utils.compat import get_sqlalchemy_version
pymysql = None
try:
import pymysql # noqa
except ImportError:
pass
sqlalchemy_version = get_sqlalchemy_version()
class DatabaseTest:... |
12,871 | get outdated docs | # -*- coding: utf-8 -*-
"""
sphinx.builders.texinfo
~~~~~~~~~~~~~~~~~~~~~~~
Texinfo builder.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from os import path
from six import iteritems
from docutils import nodes
from docutils.io impo... |
12,872 | get | """"""
from __future__ import annotations
from typing import Any
from flask import Flask
from abilian.core.entities import Entity
from abilian.core.models.tag import TAGS_ATTR, Tag, supports_tagging
from abilian.i18n import _l
from abilian.web import url_for
from abilian.web.forms import Form
from abilian.web.views.... |
12,873 | info | import re
import os
from collections import namedtuple
import core.exceptions as ex
from .. import BaseDisk, BASE_KEYWORDS
from env import Env
from core.objects.svcdict import KEYS
from utilities.cache import cache
from utilities.converters import convert_size
from utilities.proc import justcall, which
DRIVER_GROUP ... |
12,874 | public context | # 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... |
12,875 | add coordinate actuator | import opensim as osim
import numpy as np
import matplotlib.pyplot as plt
# Add a CoordinateActuator to the provided model with a specified optimal
# force.
def METHOD_NAME(model, coordinateName, optForce):
coordSet = model.getCoordinateSet();
actu = osim.CoordinateActuator();
actu.setName('torque_' + co... |
12,876 | execute operations | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
12,877 | send registration confirmation | import transaction # NOQA
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from functools import lru_cache
from pyramid.settings import asbool
import smtplib
from c2corg_api.models.common.attributes import default_langs
import logging
import os
log = logging.getLogger(__name__)
... |
12,878 | get workspace | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from ..uac import WorkspaceV2_pb2 as uac_dot_WorkspaceV2__pb2
class WorkspaceServiceV2Stub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
... |
12,879 | object index with highest dissimilarity | """
Diana Clustering module for clustering RNA structures according to their basepairdistance.
The cluster distance function computes the distance between the centroids of the clusters.
! This algorithm may present different results than the algorithm in R.
The reason is that the maximal diameter (criterion for selec... |
12,880 | enum key | import sys
from types import TracebackType
from typing import Any
from typing_extensions import Literal, Self, TypeAlias, final
if sys.platform == "win32":
_KeyType: TypeAlias = HKEYType | int
def CloseKey(__hkey: _KeyType) -> None: ...
def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> H... |
12,881 | set up module | #!/usr/bin/env python
# Copyright 2014-2018 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
#
# U... |
12,882 | read response | from __future__ import annotations
import asyncio
import re
from typing import Tuple
from ..datastructures import Headers
from ..exceptions import SecurityError
__all__ = ["read_request", "read_response"]
MAX_HEADERS = 128
MAX_LINE = 8192
def d(value: bytes) -> str:
"""
Decode a bytestring for interpolat... |
12,883 | unmsgpack | #!/usr/bin/env python3
import atexit
import logging
import os
import random
import sqlite3
import subprocess
import sys
import time
import msgpack
logger = logging.getLogger(__name__)
def maybedecode(x):
if hasattr(x, "decode"):
return x.decode()
return x
def mloads(x):
return msgpack.loads(x... |
12,884 | string to tokentype | # -*- coding: utf-8 -*-
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
... |
12,885 | test generate ingestion flow for s3 input | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... |
12,886 | has schema | """Submodule containing all the ONNX schema definitions."""
from __future__ import annotations
from typing import Sequence, overload
from onnx import AttributeProto, FunctionProto
class SchemaError(Exception): ...
class OpSchema:
def __init__(
self,
name: str,
domain: str,
since_... |
12,887 | check response | """Word cloud integration tests using mongo modulestore."""
import pytest
import json
from operator import itemgetter
# noinspection PyUnresolvedReferences
from xmodule.tests.helpers import override_descriptor_system # pylint: disable=unused-import
from xmodule.x_module import STUDENT_VIEW
from .helpers import Ba... |
12,888 | test mark reserved build fail if koji | """
Copyright (c) 2022 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import koji
import pytest
from flexmock import flexmock
from atomic_reactor.constants import PROG
from atomic_reactor.plugins.cancel_build_r... |
12,889 | get all available animated icons | #!/usr/bin/env python
# /*##########################################################################
#
# Copyright (c) 2016-2021 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software")... |
12,890 | test scipy unbounded | import pytest
from numpy.testing import assert_allclose
from iminuit import Minuit
from iminuit.testing import rosenbrock, rosenbrock_grad
import numpy as np
scopt = pytest.importorskip("scipy.optimize")
def fcn(a, b):
return a**2 + ((b - 1) / 2.0) ** 2 + 3
def grad(a, b):
return 2 * a, b - 1
def hess(a,... |
12,891 | close | from __future__ import annotations
import contextlib
import json
from io import BytesIO
from typing import Any, AsyncGenerator, Dict, List, Optional
from typing_extensions import Literal
from starlite import Request, Starlite
from starlite.exceptions import WebSocketDisconnect
from starlite.testing import TestClient
... |
12,892 | can stage out | import logging
import os
from parsl.utils import RepresentationMixin
from parsl.data_provider.staging import Staging
logger = logging.getLogger(__name__)
class RSyncStaging(Staging, RepresentationMixin):
"""
This staging provider will execute rsync on worker nodes
to stage in files from a remote locatio... |
12,893 | fill in future costs | # *********************************************************************************
# REopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions a... |
12,894 | do remove widget | # By @manuvarkey: https://gitlab.gnome.org/GNOME/gtk/-/issues/175
#
# This file is part of SkyTemple.
#
# SkyTemple 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
# (a... |
12,895 | clone | from contextlib import contextmanager
import random
import pylibmc
# project
import ddtrace
from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.constants import SPAN_KIND
from ddtrace.constants import SPAN_MEASURED_KEY
from ddtrace.contrib.pylibmc.addrs import parse_address... |
12,896 | test auth login device exist | import pytest
import unicodedata
from flask import url_for
from app import config
from app.db import Session
from app.models import User, AccountActivation
from tests.utils import random_email
PASSWORD_1 = "Aurélie"
PASSWORD_2 = unicodedata.normalize("NFKD", PASSWORD_1)
assert PASSWORD_1 != PASSWORD_2
def setup_mod... |
12,897 | avsinfo | #!/usr/bin/env python3
import sys
import os
import time
import syslog
import glob
import click
from platform_config import MAC_DEFAULT_PARAM
from platform_util import getSdkReg, write_sysfs, get_value, get_format_value
AVSCTROL_DEBUG_FILE = "/etc/.avscontrol_debug_flag"
AVSCTROLERROR = 1
AVSCTROLDEBUG = 2
debugleve... |
12,898 | restart | """
Module to provide information about minions
"""
import os
import sys
import time
import salt.key
import salt.utils.data
# Don't shadow built-ins.
__func_alias__ = {"list_": "list"}
def list_():
"""
Return a list of accepted, denied, unaccepted and rejected keys.
This is the same output as `salt-key... |
12,899 | type | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.