code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_transports.php |
import { useRouter } from "next/router";
import ErrorPage from "next/error";
import { getImageUrl } from "takeshape-routing";
import Container from "../../components/container";
import PostBody from "../../components/post-body";
import MoreStories from "../../components/more-stories";
import Header from "../../componen... | javascript | github | https://github.com/vercel/next.js | examples/cms-takeshape/pages/posts/[slug].js |
package container
import (
"io"
"strings"
"testing"
"github.com/moby/go-archive"
"github.com/moby/moby/client"
"github.com/moby/moby/v2/integration/internal/container"
"golang.org/x/sys/unix"
"gotest.tools/v3/assert"
"gotest.tools/v3/skip"
)
func TestNoOverlayfsWarningsAboutUndefinedBehaviors(t *testing.T) ... | go | github | https://github.com/moby/moby | integration/container/overlayfs_linux_test.go |
//===-- LSPBinderTests.cpp ------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/unittests/LSPBinderTests.cpp |
import {
Fragment,
Static,
Text,
Comment as VComment,
type VNode,
type VNodeHook,
createTextVNode,
createVNode,
invokeVNodeHook,
normalizeVNode,
} from './vnode'
import { flushPostFlushCbs } from './scheduler'
import type { ComponentInternalInstance, ComponentOptions } from './component'
import { in... | typescript | github | https://github.com/vuejs/core | packages/runtime-core/src/hydration.ts |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | unknown | codeparrot/codeparrot-clean | ||
function useFoo({obj, objIsNull}) {
const x = [];
b0: {
if (objIsNull) {
break b0;
} else {
x.push(obj.a);
}
x.push(obj.b);
}
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: useFoo,
params: [{obj: null, objIsNull: true}],
sequentialRenders: [
{obj: null, objIsNull: tru... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-break-in-scope.ts |
"""
configuration script
Copyright 2017 Anna Wirbel
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.
... | unknown | codeparrot/codeparrot-clean | ||
"""
Test some lldb command abbreviations.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ExecTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
mydir = TestBase.compute_mydir(__file_... | unknown | codeparrot/codeparrot-clean | ||
# 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... | unknown | codeparrot/codeparrot-clean | ||
#
# 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/migrations/versions/0065_3_0_0_add_new_otel_span_fields.py |
# encoding: utf-8
from __future__ import unicode_literals
import re
import json
import xml.etree.ElementTree
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_str,
compat_urllib_parse,
compat_urllib_parse_urlparse,
compat_urllib_request,
compat_urlparse,
comp... | unknown | codeparrot/codeparrot-clean | ||
# 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, software
# distributed under t... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is d... | unknown | codeparrot/codeparrot-clean | ||
# apis_v1/documentation_source/voter_sign_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_sign_out_doc_template_values(url_root):
"""
Show documentation about voterSignOut
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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 ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonPathCapabilities.java |
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_AARCH64
Entry: 0x590
ProgramHeaders:
- Type: PT_LOAD
Flags: [ PF_X, PF_R, PF_W ]
FirstSec: .dynsym
LastSec: .got
Align: ... | unknown | github | https://github.com/llvm/llvm-project | bolt/test/AArch64/Inputs/tls-trad.yaml |
"""
Timedelta benchmarks that rely only on tslibs. See benchmarks.timedeltas for
Timedelta benchmarks that rely on other parts fo pandas.
"""
import datetime
import numpy as np
from pandas import Timedelta
class TimedeltaConstructor:
def setup(self):
self.nptimedelta64 = np.timedelta64(3600)
sel... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class ScreencastIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?screencast\.com/t/(?P<id>[a-zA... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
import os.path
import sys
import types
import getopt
from getopt import GetoptError
from text import grep
from text import string_utils as str_utils
def awk(target, pattern, separator, action):
'''
awk : pattern scanning and text processing language
@param target: string list or text fil... | unknown | codeparrot/codeparrot-clean | ||
import fileinput
def check_header(header, err):
"""Validate the start of an example (everything up to the |)"""
if not header:
err("Header should not be empty")
return
parts = header.split(' ')
if len(parts) > 3:
err("Too many parts in the header: %d" % len(parts))
try:
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
eventlogging.compat
~~~~~~~~~~~~~~~~~~~
The source code for EventLogging aims to be compatible with both
Python 2 and 3 without requiring any translation to run on one or the
other version. This module supports this goal by providing import
paths and helper functions that wrap d... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <ATen/functorch/BatchRulesHelper.h>
#include <ATen/functorch/PlumbingHelper.h>
namespace at::funct... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/functorch/BatchRulesLoss.cpp |
import mock
import pytest
from django.utils import timezone
from api_tests import utils as test_utils
from osf_tests.factories import (
PreprintFactory,
AuthUserFactory,
SubjectFactory,
)
from osf.utils.workflows import DefaultStates
@pytest.mark.django_db
class PreprintListMatchesPreprintDetailMixin:
... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | unknown | codeparrot/codeparrot-clean | ||
"""
OrgRole manager class
@author Alexey Toptygin <alexeyt@americanri.com>
@copyright Copyright 2011 American Research Institute, Inc.
"""
from pr_services.object_manager import ObjectManager
from pr_services.rpc.service import service_method
import facade
class OrgRoleManager(ObjectManager):
"""
Manage role... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 IBM Corp.
#
# 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
#
#... | unknown | codeparrot/codeparrot-clean | ||
class MyGen:
def __init__(self):
self.v = 0
def __iter__(self):
return self
def __next__(self):
self.v += 1
if self.v > 5:
raise StopIteration
return self.v
def gen():
yield from MyGen()
def gen2():
yield from gen()
print(list(gen()))
print(l... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
import functools
import logging
import urllib
import markdown
import pytz
from addons.base.models import BaseNodeSettings
from bleach.callbacks import nofollow
from django.db import models
from django.utils import timezone
from framework.forms.utils import sanitize
from markdown... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "v0alpha1.global-variables-and-interpolation.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"uid": "-- Grafana --"
},
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/feature-templating/v0alpha1.global-variables-and-interpolation.v42.v1beta1.json |
---
applies_to:
stack:
serverless:
navigation_title: "Range"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
---
# Range field types [range]
Range field types represent a continuous range of values between an upper and lower bound. For example, a range can represent *a... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/mapping-reference/range.md |
# Configuring application environments
You can define different named build configurations for your project, such as `development` and `staging`, with different defaults.
Each named configuration can have defaults for any of the options that apply to the various builder targets, such as `build`, `serve`, and `test`.
... | unknown | github | https://github.com/angular/angular | adev/src/content/tools/cli/environments.md |
# Source:
# http://launchpadlibrarian.net/22565844/test-triple-strings.py
# Author: Ed Loper
# This file tests python-mode's ability to handle triple-quoted
# string. Here's how to tell if python-mode's doing the right thing:
#
# - All dashes (-) should *not* be marked as strings.
# - All Os, Xs, <s, and >s should be... | unknown | codeparrot/codeparrot-clean | ||
import re
from unknown_replies import smartass_reply
from unknown_replies import greedy_reply
class Message(object):
MAX_COMMANDS = 3
"""
A message comes from a user and is sent to a channel.
The MainBot instance handles the message.
"""
def __init__(self, user, channel, message, bot_instanc... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: locales.py Stores locale information for filtering results
# Python Library
# Author: Raymond Wagner
#-----------------------
from tmdb_exceptions import *
import locale
syslocale = None
class LocaleBase(object):
__slots__ = ['__im... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes import prepared as capi
class PreparedGeometry(GEOSBase):
"""
A geometry that is prepared for performing certain operations.
At the moment this includes the co... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
Acceptance tests for Studio's Setting pages
"""
from __future__ import unicode_literals
from nose.plugins.attrib import attr
from base_studio_test import StudioCourseTest
from bok_choy.promise import EmptyPromise
from ...fixtures.course import XBlockFixtureDesc
from ..helpers import create_user_par... | unknown | codeparrot/codeparrot-clean | ||
# Flexlay - A Generic 2D Game Editor
# Copyright (C) 2014 Ingo Ruhnke <grumbel@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 published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option)... | unknown | codeparrot/codeparrot-clean | ||
//===--- Utils.cpp - Misc utilities ---------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/IDE/Utils.cpp |
"""Unit tests for provider.py."""
from mock import Mock, patch
from third_party_auth import provider
from third_party_auth.tests import testutil
import unittest
@unittest.skipUnless(testutil.AUTH_FEATURE_ENABLED, 'third_party_auth not enabled')
class RegistryTest(testutil.TestCase):
"""Tests registry discovery an... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
test_state_machines
~~~~~~~~~~~~~~~~~~~
These tests validate the state machines directly. Writing meaningful tests for
this case can be tricky, so the majority of these tests use Hypothesis to try
to talk about general behaviours rather than specific cases.
"""
import pytest
import h2.conn... | unknown | codeparrot/codeparrot-clean | ||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include <spdlog/cfg/helpers.h>
#include <spdlog/details/registry.h>
//
// Init log levels using each argv entry that starts with "SPDLOG_LEVEL="
//
// set all logger... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/spdlog/include/spdlog/cfg/argv.h |
#!/usr/bin/python
#
# Copyright (c) 2009 NHN 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 condi... | unknown | codeparrot/codeparrot-clean | ||
"""A utility for browsing COM objects.
Usage:
Command Prompt
Use the command *"python.exe catbrowse.py"*. This will display
display a fairly small, modal dialog.
Pythonwin
Use the "Run Script" menu item, and this will create the browser in an
MDI window. This window can be fully resized.
D... | unknown | codeparrot/codeparrot-clean | ||
---
title: Ellipsis Path
--- | unknown | github | https://github.com/jekyll/jekyll | test/source/trailing-dots...md |
"""Admin display options for Library app."""
# Copyright © 2016 SUSE LLC, James Mason <jmason@suse.com>.
#
# This file is part of openbare.
#
# openbare 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 ... | unknown | codeparrot/codeparrot-clean | ||
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | unknown | github | https://github.com/opencv/opencv | modules/core/include/opencv2/core/hal/intrin_sse.hpp |
#
# x86header.py
#
# Copyright (C) 2009 Gil Dabah, http://ragestorm.net/disops/
#
class OperandType:
""" Types of possible operands in an opcode.
Refer to the diStorm's documentation or diStorm's instructions.h
for more explanation about every one of them. """
(NONE,
IMM8,
IMM16,
IMM_FULL,
... | unknown | codeparrot/codeparrot-clean | ||
"""Ansible integration test infrastructure."""
from __future__ import absolute_import, print_function
import contextlib
import os
import shutil
import tempfile
from lib.target import (
analyze_integration_target_dependencies,
walk_integration_targets,
)
from lib.config import (
NetworkIntegrationConfig,... | unknown | codeparrot/codeparrot-clean | ||
# Test file for Python language.
#
# $Id: test.py,v 1.4 2007-03-08 02:16:33 zappo Exp $
# Simle class compount statement with blank lines sprinkled.
class Foo(Bar):
x = 1
y = 2
# Simple def statement with no argument
def sss():
i = 1
# Simple def statement with arguments
def ttt(x,y,z):
i = 1
impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# update_alternatives_clang.sh
# chmod u+x update_alternatives_clang.sh
#
update_alternatives() {
local version=${1}
local priority=${2}
local z=${3}
local slaves=${4}
local path=${5}
local cmdln
cmdln="--verbose --install ${path}${master} ${master} ${path}${master}-${v... | unknown | github | https://github.com/pytorch/pytorch | .devcontainer/scripts/update_alternatives_clang.sh |
#!/usr/bin/env python
# encoding: utf-8
"""
makeBashScripts.py
"""
import sys
import os
def main():
tool_map = {'annotate': 'annotateBed',
'bamtobed': 'bamToBed',
'bamtofastq': 'bamToFastq',
'bed12tobed6': 'bed12ToBed6',
'bedpetobam': 'bedpeToBa... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import re
from dat... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from pages.desktop.refine_search_page import RefineSearchPage
from pages.desktop.search_page import Searc... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Options for selecting or identifying a specific K8s object
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
api_version:
description... | unknown | codeparrot/codeparrot-clean | ||
from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.urlresolvers import NoRe... | unknown | codeparrot/codeparrot-clean | ||
//! Multi-threaded runtime
mod counters;
use counters::Counters;
mod handle;
pub(crate) use handle::Handle;
mod overflow;
pub(crate) use overflow::Overflow;
mod idle;
use self::idle::Idle;
mod stats;
pub(crate) use stats::Stats;
mod park;
pub(crate) use park::{Parker, Unparker};
pub(crate) mod queue;
mod worker... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/scheduler/multi_thread/mod.rs |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# manual-status.py - output status of manual merges
#
# Copyright © 2008 Canonical Ltd.
# Author: Scott James Remnant <scott@ubuntu.com>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of version 3 of the GNU General Public Lic... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals, division, absolute_import
import logging
import os
from flexget import plugin
from flexget.event import event
from flexget.utils.bittorrent import Torrent, is_torrent_file
log = logging.getLogger('modif_torrent')
class TorrentFilename(object):
"""
Makes sure that ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2012 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be... | c | github | https://github.com/opencv/opencv | 3rdparty/libwebp/src/utils/color_cache_utils.c |
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import time
import os
from time import sleep
import constants as const
import loginView
import helpGuideView
import filesView
from appium import webdriver
def getWebDriver():
wd = None
desired_caps = {}
desired_caps['appium-version'] = const.K_APPIUM_VER
d... | unknown | codeparrot/codeparrot-clean | ||
// Validates that, when it cannot reach a config server, mongos assumes that the
// localhost exception does not apply. That is, if mongos cannot verify that there
// are user documents stored in the configuration information, it must assume that
// there are.
// @tags: [requires_sharding]
import {ShardingTest} from ... | javascript | github | https://github.com/mongodb/mongo | jstests/auth/access_control_with_unreachable_configs.js |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Optional
from typing_extensions import Required, TypedDict
from ...shared_params.metadata import Metadata
__all__ = ["MessageUpdateParams"]
class MessageUpdateParams(TypedDict... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/threads/message_update_params.py |
import os
import sys
from sqlobject import *
from flask import Module, url_for, redirect, session, escape, request, abort, current_app, send_file
from muzicast.const import DB_FILE
from muzicast.web.util import page_view, render_master_page
from muzicast.meta import Artist,Album,Genre,Composer,Track
search = Module(... | unknown | codeparrot/codeparrot-clean | ||
"""
data types for 2011/01 Helios
"""
from helios.datatypes import LDObject, arrayOf, DictObject, ListObject
class Trustee(LDObject):
"""
a trustee
"""
FIELDS = ['uuid', 'public_key', 'public_key_hash', 'pok', 'decryption_factors', 'decryption_proofs', 'email']
STRUCTURED_FIELDS = {
'pok' : 'pkc/elgama... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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");... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/service/launcher/LauncherExitCodes.java |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/Refactoring/ConvertGuardExprToIfLetExpr.cpp |
from order_with_respect_to.base_tests import BaseOrderWithRespectToTests
from django.test import TestCase
from .models import Answer, Post, Question
class OrderWithRespectToGFKTests(BaseOrderWithRespectToTests, TestCase):
Answer = Answer
Post = Post
Question = Question | python | github | https://github.com/django/django | tests/contenttypes_tests/test_order_with_respect_to.py |
"""empty message
Revision ID: db0b67ab42da
Revises:
Create Date: 2017-05-26 09:41:15.560418
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'db0b67ab42da'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generat... | unknown | codeparrot/codeparrot-clean | ||
import { flushSync } from 'svelte';
import { assert_ok, test } from '../../test';
export default test({
compileOptions: {
experimental: {
async: true
}
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/hydration/samples/boundary-pending-attribute/_config.js |
# Dll scope hoisting
[DllPlugin documentation](https://webpack.js.org/plugins/dll-plugin)
This example demonstrates the usage of `entryOnly` option in combination with module concatenation / scope hoisting.
By default, `DllPlugin` exposes all the modules referenced in the bundle as separate entries.
The manifest inc... | unknown | github | https://github.com/webpack/webpack | examples/dll-entry-only/template.md |
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | go | github | https://github.com/prometheus/prometheus | storage/remote/storage.go |
from tincan import Context, ContextActivities, ActivityList, Activity, Extensions
from compair.learning_records.resource_iri import ResourceIRI
from compair.learning_records.xapi.activity import XAPIActivity
from compair.learning_records.xapi.object import XAPIObject
class XAPIContext(object):
@classmethod
de... | unknown | codeparrot/codeparrot-clean | ||
package main
import (
"context"
"strings"
"testing"
"github.com/moby/moby/v2/integration-cli/cli"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
)
type DockerCLICommitSuite struct {
ds *DockerSuite
}
func (s *DockerCLICommitSuite) TearDownTest(ctx context.Context, t *testing... | go | github | https://github.com/moby/moby | integration-cli/docker_cli_commit_test.go |
class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
layout "mailer"
end | ruby | github | https://github.com/rails/rails | actionmailbox/test/dummy/app/mailers/application_mailer.rb |
"""
Name: init
Purpose: Init file for the Blender Add-On
Description:
Marv's Add-On for Re-Volt
"""
import bpy
import os
import os.path
import imp
from bpy.app.handlers import persistent # For the scene update handler
from . import (
common,
layers,
operators,
texanim,
tools,
)
from .props ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
## Copyright (C) 2005-2006 Graham I Cummins
## 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.
##
#... | unknown | codeparrot/codeparrot-clean | ||
# 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.
"""
LayerDrop as described in https://arxiv.org/abs/1909.11556.
"""
import torch
import torch.nn as nn
class LayerDropModuleList(nn.ModuleLis... | unknown | codeparrot/codeparrot-clean | ||
// This file was automatically generated from flow.md by Knit tool. Do not edit.
package kotlinx.coroutines.guide.exampleFlow08
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
suspend fun performRequest(request: Int): String {
delay(1000) // imitate long-running asynchronous work
return "response... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/guide/example-flow-08.kt |
# frozen_string_literal: true
require "cases/helper"
require "models/topic"
class TestColumnAlias < ActiveRecord::TestCase
fixtures :topics
def test_column_alias
records = Topic.lease_connection.select_all("SELECT id AS pk FROM topics")
assert_equal ["pk"], records.columns
end
end | ruby | github | https://github.com/rails/rails | activerecord/test/cases/column_alias_test.rb |
from Screens.Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Components.FileList import FileList
from Components.Sources.StaticText import StaticText
from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigText, ConfigYesNo, ConfigDirectory
from Components.ConfigList impo... | unknown | codeparrot/codeparrot-clean | ||
fun foo() {
<expr>2 > 1 && true || true || (3 + 3 <= 10)</expr>
} | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/compileTimeConstantProvider/evaluate/complexLogicExpression.kt |
# frozen_string_literal: true
require "abstract_unit"
module Admin; class User; end; end
module ParamsWrapperTestHelp
def with_default_wrapper_options(&block)
@controller.class._set_wrapper_options(format: [:json])
@controller.class.inherited(@controller.class)
yield
end
def assert_parameters(expe... | ruby | github | https://github.com/rails/rails | actionpack/test/controller/params_wrapper_test.rb |
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
import "unsafe"
// Called from compiler-generated code; declared for go vet.
func udiv()
func _div()
func _divu()
func _mod()
func _modu()
//... | go | github | https://github.com/golang/go | src/runtime/stubs_arm.go |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
import "unsafe"
type sigctxt struct {
info *siginfo
ctxt unsafe.Pointer
}
//go:nosplit
//go:nowritebarrierrec
func (c *sigctxt) regs() *mco... | go | github | https://github.com/golang/go | src/runtime/signal_netbsd_386.go |
#
# File: psychometrics/psychoanalyze.py
#
# generate pyschometrics plots from PsychometricData
from __future__ import division
import datetime
import logging
import json
import math
import numpy as np
from opaque_keys.edx.locator import BlockUsageLocator
from scipy.optimize import curve_fit
from django.conf impor... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
import os
import tarfile
import zipfile
import StringIO
import tempfile
from datetime import datetime
class Bundle(object):
def __init__(self, *args, **kwargs):
"""
Accepts an arbitrary number of logical name - data pairs::
b = Bundle(('arq1', 'arq1 content as str'))
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding=utf-8
from toughlib import utils
from toughlib import logger
import logging
try:
import redis
except:
pass
class LogTrace(object):
radius_key = "toughradius.syslog.trace.radius.{0}".format
trace_key = "toughradius.syslog.trace.{0}".format
def __init__(self, cache_c... | unknown | codeparrot/codeparrot-clean | ||
"""
raven
~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import os
import os.path
from raven.base import * # NOQA
from raven.conf import * # NOQA
from raven.versioning import * # NOQA
__all__... | unknown | codeparrot/codeparrot-clean | ||
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'LatestEntriesPlugin.category'
db.delete_column('cmsplugin_latestentriesplugin', 'category_id')
# Deleting field 'LatestEn... | unknown | codeparrot/codeparrot-clean | ||
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import sys
from io import open
from pyuca import Collator
from pyuca.utils import format_sort_key
try:
chr = unichr
except NameError:
pass
c = Collator()
prev_sort_key = None
success = 0
failure = 0
path = "CollationTest/{0}/CollationTest_NON_IGNORABLE.txt".format(... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.contrib import messages... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.