code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
* Copyright 2012-present the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/convert/ArrayToDelimitedStringConverter.java |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["FineTuningJobFailedWebhookEvent", "Data"]
class Data(BaseModel):
"""Event data payload."""
id: str
"""The ... | python | github | https://github.com/openai/openai-python | src/openai/types/webhooks/fine_tuning_job_failed_webhook_event.py |
# Copyright (c) 2013 Spotify AB
#
# 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, s... | unknown | codeparrot/codeparrot-clean | ||
import pytest
from django.core.urlresolvers import reverse
from model_mommy import mommy
from saap.crud.base import (CrispyLayoutFormMixin, CrudListView, from_to,
get_field_display, make_pagination)
from saap.crud.tests.stub_app.models import Continent, Country
from saap.crud.tests.stub_app... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/data/cache_dataset_ops.h |
/* The following is the NetBSD libc qsort implementation modified in order to
* support partial sorting of ranges for Redis.
*
* Copyright (c) 2009-Present, Redis Ltd.
* All rights reserved.
*
* Licensed under your choice of (a) the Redis Source Available License 2.0
* (RSALv2); or (b) the Server Side Public Lic... | c | github | https://github.com/redis/redis | src/pqsort.h |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import json
from django.... | unknown | codeparrot/codeparrot-clean | ||
import pickle
import sys
import pytest
from queuelib.tests import test_queue as t
from scrapy.http import Request
from scrapy.item import Field, Item
from scrapy.loader import ItemLoader
from scrapy.selector import Selector
from scrapy.squeues import (
_MarshalFifoSerializationDiskQueue,
_MarshalLifoSerializa... | python | github | https://github.com/scrapy/scrapy | tests/test_squeues.py |
# Copyright (c) 2012 OpenStack Foundation
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
#
# Copyright (c) 2008 Kevin Ballard
#
test_description='git svn clone with percent escapes'
. ./lib-git-svn.sh
test_expect_success 'setup svnrepo' '
mkdir project project/trunk project/branches project/tags &&
echo foo > project/trunk/foo &&
svn_cmd import -m "$test_description" project "$svnrepo/pr jec... | unknown | github | https://github.com/git/git | t/t9120-git-svn-clone-with-percent-escapes.sh |
# -*- coding: utf-8 -*-
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
"""
Code generator script to make the Cython BLAS and LAPACK wrappers
from the files "cython_blas_signatures.txt" and
"cython_lapack_signatures.txt" which contain the signatures for
all the BLAS/LAPACK routines that should be included in the wrappers.
"""
from operator import itemgetter
fortran_types = {'int':'intege... | unknown | codeparrot/codeparrot-clean | ||
#include "parts.h"
#include "../_testcapi/util.h" // NULLABLE, RETURN_INT
#include "pycore_critical_section.h"
#include "pycore_setobject.h"
static PyObject *
set_update(PyObject *self, PyObject *args)
{
PyObject *set, *iterable;
if (!PyArg_ParseTuple(args, "OO", &set, &iterable)) {
return NULL;
... | c | github | https://github.com/python/cpython | Modules/_testinternalcapi/set.c |
# frozen_string_literal: true
require_relative "shared_helpers"
module Bundler
class LockfileParser
class Position
attr_reader :line, :column
def initialize(line, column)
@line = line
@column = column
end
def advance!(string)
lines = string.count("\n")
if... | ruby | github | https://github.com/ruby/ruby | lib/bundler/lockfile_parser.rb |
from autotest.frontend.afe import rpc_utils
from autotest.client.shared import kernel_versions
from autotest.frontend.tko import models
class TooManyRowsError(Exception):
"""
Raised when a database query returns too many rows.
"""
class KernelString(str):
"""
Custom string class that uses correc... | unknown | codeparrot/codeparrot-clean | ||
import weakref
from .anyQt import QtGui, QtCore
class PSpyderhive(object):
def __init__(self, parent, parentwidget):
self._parent = weakref.ref(parent)
pw = parentwidget.wrapwidget()
self.widget = QtGui.QWidget(pw)
pw.setMinimumSize(800, 50)
pw.setTitleBarWidget(QtGui.QWidg... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2020-present MongoDB, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the Server Side Public License, version 1,
# as published by MongoDB, Inc.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without e... | python | github | https://github.com/mongodb/mongo | buildscripts/idl/checkout_idl_files_from_past_releases.py |
/*
* Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.engine.internal
private val OS_NAME = System.getProperty("os.name", "")
.lowercase()
internal actual fun escapeHostname(value: String): String {
if (!OS_NAME.c... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/jvm/src/io/ktor/server/engine/internal/EngineUtilsJvm.kt |
/*
* Copyright 2002-present the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/context/annotation/ComponentScanBeanDefinitionParser.java |
# Copyright 2015, Google 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 conditions and the f... | unknown | codeparrot/codeparrot-clean | ||
# Grading scheme admin interface
from django.contrib.admin import ModelAdmin
from django.db.models import Q
from django.core.urlresolvers import resolve
from opensubmit.models import Course, Grading
def gradings(gradingScheme):
''' Determine the list of gradings in this scheme as rendered string.
TODO: Us... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Anthony Baxter
# Contact: email-sig@python.org
"""Class representing audio/* type MIME documents."""
__all__ = ['MIMEAudio']
import sndhdr
from cStringIO import StringIO
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
_s... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import mock
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import AuthUserFactory, ProjectFactory
pytestmark = pytest.mark.skip('Unskip when throttling no longer fails on travis')
class TestDefaultThr... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// 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
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h |
/*
Copyright 2018 The Kubernetes 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 writing, ... | go | github | https://github.com/kubernetes/kubernetes | cmd/kube-controller-manager/app/options/nodelifecyclecontroller.go |
# 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 | ||
use std::marker::PhantomData;
#[cfg(not(feature = "nightly"))]
use std::mem;
use std::ops::{BitAnd, BitAndAssign, BitOrAssign, Bound, Not, Range, RangeBounds, Shl};
use std::rc::Rc;
use std::{fmt, iter, slice};
use Chunk::*;
#[cfg(feature = "nightly")]
use rustc_macros::{Decodable_NoContext, Encodable_NoContext};
use... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_index/src/bit_set.rs |
"""Component for the Somfy MyLink device supporting the Synergy API."""
import asyncio
import logging
from somfy_mylink_synergy import SomfyMyLinkSynergy
import voluptuous as vol
from homeassistant.components.cover import ENTITY_ID_FORMAT
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeas... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
import fnmatch
import functools
import io
import ntpath
import os
import posixpath
import re
import sys
from collections import Sequence
from contextlib import contextmanager
from errno import EINVAL, ENOENT, ENOTDIR
from operator import attrgetter
from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR,... | unknown | codeparrot/codeparrot-clean | ||
from sklearn.kernel_approximation import (RBFSampler,Nystroem)
from sklearn.ensemble import RandomForestClassifier
import pandas
import numpy as np
import random
from sklearn.svm import SVC
from sklearn.metrics.pairwise import rbf_kernel,laplacian_kernel,chi2_kernel,linear_kernel,polynomial_kernel,cosine_similarity
fro... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# (c) 2014, James Tanner <tanner.jc@gmail.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# PYTHON_ARGCOMPLETE_OK
from __future__ import annotations
# ansible.cli needs to be imported first, to ensure the so... | python | github | https://github.com/ansible/ansible | lib/ansible/cli/vault.py |
/**
* Simple object check.
* @param item
* @returns {boolean}
*/
export function isObject(item: unknown): boolean {
return Boolean(item && typeof item === "object" && !Array.isArray(item));
}
/**
* Deep merge two objects.
* @param target
* @param ...sources
*/
export default function deepMerge<T extends obje... | typescript | github | https://github.com/vercel/next.js | examples/cms-payload/payload/utilities/deepMerge.ts |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals, print_function
from molbiox.io import tabular
from molbiox.frame import compat, interactive
TBLOUT_FIELDS = [
('target.name', None),
('target.accession', None),
('query.name', None),
('query.accession'... | unknown | codeparrot/codeparrot-clean | ||
from common import TestID, log_surl_call_result
from eu.emi.security.authn.x509.impl import PEMCredential
from exceptions import Exception
from jarray import array
from java.io import FileInputStream
from javax.net.ssl import X509ExtendedKeyManager
from net.grinder.plugin.http import HTTPRequest
from net.grinder.script... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Database\Schema;
use Illuminate\Database\QueryException;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\File;
class SQLiteBuilder extends Builder
{
/**
* Create a database in the schema.
*
* @param string $name
* @return bool
*/
public functio... | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Schema/SQLiteBuilder.php |
# -*- 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 | ||
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
# Project 4: Reducing Noise in out Input Data
import time
import sys
import os
import numpy as np
DATA_PATH='/Users/liuxiangyu/Workspace/Dororis/dist/dlnd/sentiment-network'
REVIEWS_PATH = os.path.sep.join([DATA_PATH, 'reviews.txt'])
LABELS_PATH = os.path.sep.join([DATA_PATH, 'labels.txt'])
with open(REVIEWS_PATH,... | unknown | codeparrot/codeparrot-clean | ||
"""
.. todo::
WRITEME
"""
import os
import cPickle
import logging
_logger = logging.getLogger(__name__)
import numpy as np
import warnings
N = np
from pylearn2.datasets import cache, dense_design_matrix
from pylearn2.expr.preprocessing import global_contrast_normalize
from pylearn2.utils import contains_nan
clas... | unknown | codeparrot/codeparrot-clean | ||
# ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... | unknown | codeparrot/codeparrot-clean | ||
from Globals import InitializeClass
from Products.ZenModel.ZenossSecurity import ZEN_VIEW, ZEN_CHANGE_SETTINGS
from Products.ZenRelations.RelSchema import ToOne, ToManyCont, ToMany
from Products.ZenModel.Device import Device
from Products.ZenUtils.Utils import prepId
#, convToUnits
from Products.CMFCore.utils import ... | unknown | codeparrot/codeparrot-clean | ||
"""Kazoo Exceptions"""
from collections import defaultdict
class KazooException(Exception):
"""Base Kazoo exception that all other kazoo library exceptions
inherit from"""
class ZookeeperError(KazooException):
"""Base Zookeeper exception for errors originating from the
Zookeeper server"""
class Cance... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: iso-8859-1 -*-
#############################################################################################
# Name: unittest_Ingestor.py
# Author: Jun Hu
# Date: 2012-04-30
# Description: test cases for Ingestor class
#######################################################################################... | 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 | ||
"""
=================================================
Compare evoked responses for different conditions
=================================================
In this example, an Epochs object for visual and auditory responses is created.
Both conditions are then accessed by their respective names to create a sensor
layout... | unknown | codeparrot/codeparrot-clean | ||
name: Verify i18n
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- release-*.*.*
jobs:
verify-i18n:
# Run on `grafana/grafana` main branch, or on pull requests to prevent double-running on mirrors
if: (github.event_name == 'pull_request' || (github.event_name == ... | unknown | github | https://github.com/grafana/grafana | .github/workflows/i18n-verify.yml |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility script to run chromoting test driver tests on the Chromoting bot."""
import argparse
from chromoting_test_utilities import GetJidFromHostLog
fro... | unknown | codeparrot/codeparrot-clean | ||
<script src="../../dist/vue.global.js"></script>
<!-- DemoGrid component template -->
<script type="text/x-template" id="grid-template">
<table v-if="filteredData.length">
<thead>
<tr>
<th v-for="key in columns"
@click="sortBy(key)"
:class="{ active: sortKey == key }">
... | html | github | https://github.com/vuejs/core | packages/vue/examples/classic/grid.html |
# Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
class BaseGetitemTests:
"""Tests for ExtensionArray.__getitem__."""
def test_iloc_series(self, data):
ser = pd.Series(data)
result = ser.iloc[:4]
expected = pd.Series(data[:4])
tm.assert_series_e... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/extension/base/getitem.py |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Depende... | php | github | https://github.com/composer/composer | src/Composer/DependencyResolver/DefaultPolicy.php |
# -*- coding: us-ascii -*-
# frozen_string_literal: true
require 'mkmf'
if $mswin or $mingw or $cygwin
$CPPFLAGS << " -DYAML_DECLARE_STATIC"
end
yaml_source = with_config("libyaml-source-dir")
if yaml_source
yaml_source = yaml_source.gsub(/\$\((\w+)\)|\$\{(\w+)\}/) {ENV[$1||$2]}
yaml_source = yaml_source.chomp(... | ruby | github | https://github.com/ruby/ruby | ext/psych/extconf.rb |
/*
Copyright 2017 The Kubernetes 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 writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/core/toleration_test.go |
# frozen_string_literal: true
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
begin
require 'ostruct'
rescue LoadError
end
class OpenStruct
# See #as_json.
def self.json_create(object)
new(object['t'] || object[:t])
end
# Methods <tt>OpenStruct#as_json</tt> and +OpenSt... | ruby | github | https://github.com/ruby/ruby | ext/json/lib/json/add/ostruct.rb |
# -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklabl... | unknown | codeparrot/codeparrot-clean | ||
/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/device.h>
#include <linux/types.h>
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/ioremap.h>
#ifndef arch_memremap_wb
static void *arch_memremap_wb(resource_size_t offset, unsigned long size,
unsigned long flags)
{
#ifdef ioremap_cache
retur... | c | github | https://github.com/torvalds/linux | kernel/iomem.c |
import pytest
from langchain_core.messages import AIMessage, HumanMessage, ToolMessage
from langchain_core.tools import tool
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.runtime import Runtime
from langchain.agents.factory import create_agent
from langchain.agents.middleware.model_call_limit im... | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_model_call_limit.py |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package transit
import (
"context"
"strings"
"testing"
"github.com/hashicorp/vault/sdk/logical"
"github.com/stretchr/testify/require"
)
// Check the normal flow of rewrap
func TestTransit_BatchRewrapCase1(t *testing.T) {
var resp *logical.... | go | github | https://github.com/hashicorp/vault | builtin/logical/transit/path_rewrap_test.go |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginTests.java |
from test.test_support import TestFailed, verbose
t = (1, 2, 3)
l = [4, 5, 6]
class Seq:
def __getitem__(self, i):
if i >= 0 and i < 3: return i
raise IndexError
a = -1
b = -1
c = -1
# unpack tuple
if verbose:
print 'unpack tuple'
a, b, c = t
if a != 1 or b != 2 or c != 3:
raise TestFail... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const common = require('../common.js');
const EventEmitter = require('events').EventEmitter;
const bench = common.createBenchmark(main, { n: [5e7] });
function main({ n }) {
const ee = new EventEmitter();
for (let k = 0; k < 5; k += 1) {
ee.on('dummy0', () => {});
ee.on('dummy1', () => {});... | javascript | github | https://github.com/nodejs/node | benchmark/events/ee-listener-count-on-prototype.js |
- Feature Name: User-defined SQL logical schemas
- Status: superseded by #48276
- Start Date: 2018-10-03
- Authors: (your name here!), knz
- RFC PR: #30916, originally #13319
- Cockroach Issue: #26443
**Remember, you can submit a PR with your RFC before the text is
complete. Refer to the [README](README.md#rfc-process... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20181003_schemas.md |
{
"GEORADIUS_RO": {
"summary": "Returns members from a geospatial index that are within a distance from a coordinate.",
"complexity": "O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the ind... | json | github | https://github.com/redis/redis | src/commands/georadius_ro.json |
from __future__ import unicode_literals
import glob
import gzip
import os
import warnings
import zipfile
from optparse import make_option
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.core... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright(C) 2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
# Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com>
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
# Copyright (c) 2016, Rackspace Australia
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING... | unknown | codeparrot/codeparrot-clean | ||
{
"Modules": [
{
"Key": "test",
"Source": "./sub",
"Dir": "testdata/invalid-names-in-submodules/sub"
},
{
"Key": "",
"Source": "",
"Dir": "."
}
]
} | json | github | https://github.com/hashicorp/terraform | internal/configs/configload/testdata/invalid-names-in-submodules/.terraform/modules/modules.json |
# 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 -*-
# ---------------------------------------------------------------------
# This file is part of Resistencia Cadiz 1812.
#
# 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, e... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 OpenStack Foundation.
# 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... | unknown | codeparrot/codeparrot-clean | ||
"""Define tests for the OpenUV config flow."""
from pyopenuv.errors import InvalidApiKeyError
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.openuv import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import (
CONF_API_KEY,
CONF_ELEV... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
asyncio-server.py
~~~~~~~~~~~~~~~~~
A fully-functional HTTP/2 server using asyncio. Requires Python 3.5+.
This example demonstrates handling requests with bodies, as well as handling
those without. In particular, it demonstrates the fact that DataReceived may
be called multiple times, and ... | unknown | codeparrot/codeparrot-clean | ||
""" Python Character Mapping Codec for PalmOS 3.5.
Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,i... | unknown | codeparrot/codeparrot-clean | ||
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#include "jemalloc/internal/assert.h"
#include "jemalloc/internal/malloc_io.h"
#include "jemalloc/internal/spin.h"
#ifndef _CRT_SPINCOUNT
#define _CRT_SPINCOUNT 4000
#endif
/*
* Based on benchmark results, a f... | c | github | https://github.com/redis/redis | deps/jemalloc/src/mutex.c |
"""
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... | python | github | https://github.com/scikit-learn/scikit-learn | examples/model_selection/plot_underfitting_overfitting.py |
# Copyright 2014 Lars Kellogg-Stedman <lars@oddbit.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | unknown | codeparrot/codeparrot-clean | ||
import os
import shutil
import shlex
import subprocess
def latexfig(textstr, filename, environment='align*', env_curly=None):
# ======================================
# Validate Extension
# ======================================
split = os.path.splitext(filename)
if split[1] != '.pdf':
rais... | unknown | codeparrot/codeparrot-clean | ||
"""
Extensions for debugging Scrapy
See documentation in docs/topics/extensions.rst
"""
from __future__ import annotations
import contextlib
import logging
import signal
import sys
import threading
import traceback
from pdb import Pdb
from typing import TYPE_CHECKING
from scrapy.utils.engine import format_engine_st... | python | github | https://github.com/scrapy/scrapy | scrapy/extensions/debug.py |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Compile-only tests for common patterns that should not generate false
* positive errors when compiled with Clang's context analysis.
*/
#include <linux/bit_spinlock.h>
#include <linux/build_bug.h>
#include <linux/local_lock.h>
#include <linux/mutex.h>
#include <linux/pe... | c | github | https://github.com/torvalds/linux | lib/test_context-analysis.c |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis... | unknown | codeparrot/codeparrot-clean | ||
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block breadcrumbs %}
<ol class="breadcrumbs">
<li><a href="{% url 'admin:index' %}">{% translate 'Home' %}</a></li>
<li aria-current="page">{% translate 'Server error' %}</li>
</ol>
{% endblock %}
{% block title %}{% translate 'Server error (500)' %}{% endblock ... | html | github | https://github.com/django/django | django/contrib/admin/templates/admin/500.html |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from nose.tools import *
import networkx as nx
from random import random, choice
class TestAStar:
def setUp(self):
self.XG=nx.DiGraph()
self.XG.add_edges_from([('s','u',{'weight':10}),
('s','x',{'weight':5}),
('u... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the TreeTagger POS-tagger
#
# Copyright (C) Mirko Otto
# Author: Mirko Otto <dropsy@gmail.com>
"""
A Python module for interfacing with the Treetagger by Helmut Schmid.
"""
import os
from subprocess import Popen, PIPE
from nltk.internals import find_bi... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2019 The Kubernetes 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 writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/controlplane/reconcilers/endpointsadapter.go |
<!--Copyright 2024 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 applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/paligemma.md |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, has_common, make_esc, comma_or
from frappe import session, _
from erpnext.utilities.transaction_... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='check that submodule operations do not follow symlinks'
. ./test-lib.sh
test_expect_success 'prepare' '
git config --global protocol.file.allow always &&
test_commit initial &&
git init upstream &&
test_commit -C upstream upstream submodule_file &&
git submodule add ./upstream a/sm &... | unknown | github | https://github.com/git/git | t/t7423-submodule-symlinks.sh |
# -*- coding: utf-8 -*-
"""
Display status of Dropbox daemon.
Configuration parameters:
cache_timeout: refresh interval for this module (default 10)
format: display format for this module (default "Dropbox: {status}")
status_busy: text for placeholder {status} when Dropbox is busy (default None)
status... | unknown | codeparrot/codeparrot-clean | ||
#include <gtest/gtest.h>
#include <iostream>
#include <memory>
#include <c10/util/Registry.h>
// Note: we use a different namespace to test if the macros defined in
// Registry.h actually works with a different namespace from c10.
namespace c10_test {
class Foo {
public:
explicit Foo(int x) {
// LOG(INFO) << ... | cpp | github | https://github.com/pytorch/pytorch | c10/test/util/registry_test.cpp |
from django.conf import settings
from django.core.urlresolvers import reverse, reverse_lazy
from django.forms.widgets import TextInput
from django.template.context import Context
from django.template.loader import get_template
import six
try:
import json
except ImportError:
import simplejson as json
class Uplo... | unknown | codeparrot/codeparrot-clean | ||
#include <Python.h>
#include <errcode.h>
#include "pycore_pyerrors.h" // _PyErr_ProgramDecodedTextObject()
#include "pycore_runtime.h" // _Py_ID()
#include "lexer/state.h"
#include "lexer/lexer.h"
#include "pegen.h"
// TOKENIZER ERRORS
void
_PyPegen_raise_tokenizer_init_error(PyObject *filename)
{
if ... | c | github | https://github.com/python/cpython | Parser/pegen_errors.c |
def main():
n_translations, n_pairs = [int(x) for x in input().split()]
translations = {}
for i in range(26):
translations.update({chr(i+97):[]})
for i in range(n_translations):
fr, to = input().split()
translations.get(fr).append(to)
for i in range(n_pairs):
w_a, ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# This is the parent Association class which defines the variables
# used by all associations.
#
# The hierarchy is defined as follows:
# Association
# - SingularAssociation
# - BelongsToAssociation
# - HasOneAssociation
# - CollectionAssociation
# - HasManyAssociati... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/associations/builder/association.rb |
# Pretty-printers for wxWidgets.
import gdb
import itertools
import re
import platform
class wxStringPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
ret = ""
wx29 = 0
try:
# wx-28 has m_pchData
self.val['m_pchData']
except ... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
module.exports = [
/^Pack got invalid because of write to: Compilation\/modules.+no-string[/\\]loader\.js!.+no-string[/\\]file\.js$/
]; | javascript | github | https://github.com/webpack/webpack | test/cases/loaders/no-string/infrastructure-log.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.