code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
MIN_SIZE = ENV.fetch('SMALL_ARRAY_MIN', 0).to_i
MAX_SIZE = ENV.fetch('SMALL_ARRAY_MAX', 16).to_i
ITERATIONS = ENV.fetch('SMALL_ARRAY_ITERATIONS', 100).to_i
ARRAYS = (MIN_SIZE..MAX_SIZE).map do |size1|
(MIN_SIZE..MAX_SIZE).map do |size2|
[Array.new(size1) { rand(MAX_SIZE) }, Array.new(size2) { rand(MAX_SIZE) }]
... | ruby | github | https://github.com/ruby/ruby | benchmark/array_small_diff.rb |
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins.auth
import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.engine.mock.*
import io.ktor.client.plugins.*
import io.ktor.client.plugins.auth... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-plugins/ktor-client-auth/common/test/io/ktor/client/plugins/auth/AuthTest.kt |
// Slightly modified version of fmt lib's format.cc source file.
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.
#ifndef SPDLOG_COMPILED_LIB
#error Please define SPDLOG_COMPILED_LIB to compile this file.
#endif
#if !defined(SPDLOG_FMT_EXTERNAL) && !defined(SPDLOG_USE_STD_FORMAT)
#inclu... | cpp | github | https://github.com/nodejs/node | deps/LIEF/third-party/spdlog/src/bundled_fmtlib_format.cpp |
# Copyright (c) 2017 Ansible Project
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from unittest import TestCase, main
from common import createClient, connectClient, startNufw
from nuauth import Nuauth
from nuauth_conf import NuauthConf
from inl_tests.iptables import Iptables
from filter import HOST, VALID_PORT
from plaintext import USERDB, PlaintextAcl, PlainPeriodXML, Period
from... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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
#
#... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.python.compat import set
from twisted.trial import unittest
from twisted.internet import interfaces, task, reactor, defer, error
# Be compatible with any jerks who used our private stuff
Clock = task.Clock
from twisted.p... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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/origin/OriginTrackedValue.java |
import sys, os
from time import gmtime, strftime
_H2O_IP_ = "127.0.0.1"
_H2O_PORT_ = 54321
_ON_HADOOP_ = False
_HADOOP_NAMENODE_ = None
_IS_IPYNB_ = False
_IS_PYDEMO_ = False
_IS_PYUNIT_ = False... | unknown | codeparrot/codeparrot-clean | ||
"""Entrypoint to building [Agents](https://docs.langchain.com/oss/python/langchain/agents) with LangChain.""" # noqa: E501
from langchain.agents.factory import create_agent
from langchain.agents.middleware.types import AgentState
__all__ = [
"AgentState",
"create_agent",
] | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/langchain/agents/__init__.py |
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
```esql
FROM employees
| KEEP first_name, last_name, height
| SORT height DESC
``` | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/commands/examples/docs.csv-spec/sortDesc.md |
# -*- encoding: utf8 -*-
import os
import linguistica as lxa
from linguistica.datasets import brown as corpus_path
data_dir = os.path.join(os.path.dirname(__file__), 'data')
def test_broken_words_left_to_right():
lxa_object = lxa.read_corpus(corpus_path, max_word_tokens=50000)
test_object = lxa_object.broke... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# 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'... | unknown | codeparrot/codeparrot-clean | ||
{
"INFO": {
"summary": "Returns information about the connection.",
"complexity": "O(1)",
"group": "connection",
"since": "6.2.0",
"arity": 2,
"container": "CLIENT",
"function": "clientCommand",
"command_flags": [
"NOSCRIPT",
"L... | json | github | https://github.com/redis/redis | src/commands/client-info.json |
import numpy as np
import pandas as pd
from enlopy.utils import make_timeseries
from enlopy.generate import (add_noise, gen_daily_stoch_el, gen_load_from_daily_monthly, gen_load_sinus, gen_demand_response,
disag_upsample, clean_convert, countweekend_days_per_month,
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package consul
import (
"bytes"
"compress/gzip"
"context"
"crypto/md5"
"encoding/json"
"errors"
"fmt"
"log"
"strings"
"sync"
"time"
consulapi "github.com/hashicorp/consul/api"
"github.com/hashicorp/terraform/internal/states/remote"
... | go | github | https://github.com/hashicorp/terraform | internal/backend/remote-state/consul/client.go |
#!/usr/bin/python
# Copyright (C) 2008, 2010 Red Hat Inc.
#
# This file is part of systemtap, and is free software. You can
# redistribute it and/or modify it under the terms of the GNU General
# Public License (GPL); either version 2, or (at your option) any
# later version.
import re
import sys
import os
from conf... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label ... | unknown | codeparrot/codeparrot-clean | ||
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# 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 publi... | unknown | codeparrot/codeparrot-clean | ||
from mrjob.job import MRJob
from mrjob.step import MRStep
import string
import sys
class MRGrados(MRJob):
SORT_VALUES = True
def mapper(self, _, line):
line_stripped = line.translate(string.maketrans("",""), '"')
line_split = line_stripped.split(',') #split by the comma
sorted_line = s... | unknown | codeparrot/codeparrot-clean | ||
function Component(props) {
return foo(useFoo);
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-pass-hook-as-call-arg.js |
#!/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... | unknown | codeparrot/codeparrot-clean | ||
from bs4 import BeautifulSoup
from collections import defaultdict
import requests
from phone_iso3166.country import network_country
from phone_iso3166.errors import InvalidNetwork
from io import StringIO
from pprint import pformat
names_out_file = 'phone_iso3166/e212_names.py'
html = requests.get('https://en.wikipedia... | unknown | codeparrot/codeparrot-clean | ||
from django.test import SimpleTestCase
from ..utils import SafeClass, UnsafeClass, setup
class AutoescapeStringfilterTests(SimpleTestCase):
"""
Filters decorated with stringfilter still respect is_safe.
"""
@setup({'autoescape-stringfilter01': '{{ unsafe|capfirst }}'})
def test_autoescape_stringf... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# ----------------------------------------------------------------------------
# build_console: Build cocos2d-console into executable binary file with PyInstaller
#
# Author: Bin Zhang
#
# License: MIT
# ----------------------------------------------------------------------------
'''
Build cocos2d-con... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
#
# Copyright (C) 2012-2013 Federico Manuel Echeverri Choux
#
# 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 | ||
# 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 applicable ... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for registry system.
This test uses two other modules:
* registry_test_base, which defines a registered base class.
* registry_test_impl, which defines a subclass.
Critically, although we use both as build dependencies, we do not explicitly
import registry_test_impl.
"""
import traceback
from tensorflo... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, print_function, absolute_import
from ._ufuncs import (_spherical_jn, _spherical_yn, _spherical_in,
_spherical_kn, _spherical_jn_d, _spherical_yn_d,
_spherical_in_d, _spherical_kn_d)
def spherical_jn(n, z, derivative=False):
r"""Spherical... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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
## Licens... | unknown | codeparrot/codeparrot-clean | ||
#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2005, 2006, 2007 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. This program is distributed in the hope that it
# ... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
##
## Copyright (c) Crossbar.io Technologies GmbH
##
## 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
##
##... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased
import org.jetbrains.kotlin.ana... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/descriptorBased/KaFe10DescTypeAliasSymbol.kt |
import os
import sys
import json
import doctest
import unittest
from test import support
# import json with and without accelerations
cjson = support.import_fresh_module('json', fresh=['_json'])
pyjson = support.import_fresh_module('json', blocked=['_json'])
# create two base classes that will be used by the other t... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
parse_duration,
)
class ShareSixIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sharesix\.com/(?:f/)?(?P<... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.http.cio
import io.ktor.http.*
import io.ktor.http.cio.internals.*
import io.ktor.utils.io.*
import io.ktor.utils.io.core.*
import kotlinx.coroutines.CompletableDeferred
impor... | kotlin | github | https://github.com/ktorio/ktor | ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/Multipart.kt |
'''
Detach Primary Storage will stop related VM
@author: Youyk
'''
import time
import os
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.header.vm as vm_header
... | unknown | codeparrot/codeparrot-clean | ||
"""Tests running the delete_orphan command"""
from django.core.management import call_command
from contentstore.tests.test_orphan import TestOrphanBase
class TestDeleteOrphan(TestOrphanBase):
"""
Tests for running the delete_orphan management command.
Inherits from TestOrphan in order to use its setUp met... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2009-2014 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLMOPT_NETWORK_CHANGED
Section: 3
Source: libcurl
See-also:
- CURLOPT_FRESH_CONNECT (3)
- CURLOPT_FORBID_REUSE (3)
Protocol:
- All
Added-in: 8.16.0
---
# NAME
CURLMOPT_NETWORK_CHANGED - signal network changed
... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLMOPT_NETWORK_CHANGED.md |
"""
WSGI config for hello project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | unknown | codeparrot/codeparrot-clean | ||
"""Module containing non-deprecated functions borrowed from Numeric.
"""
import functools
import math
import types
import numpy as np
from numpy._utils import set_module
from . import _methods, multiarray as mu, numerictypes as nt, overrides, umath as um
from ._multiarray_umath import _array_converter
from .multiarr... | python | github | https://github.com/numpy/numpy | numpy/_core/fromnumeric.py |
# This tests small int range for 32-bit machine
# Small ints are variable-length encoded in MicroPython, so first
# test that encoding works as expected.
print(0)
print(1)
print(-1)
# Value is split in 7-bit "subwords", and taking into account that all
# ints in Python are signed, there're 6 bits of magnitude. So, ar... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
#
# mosaic.py -- Example of quick and dirty mosaicing of FITS images
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
Usage:
$ ./mosaic.py -o output.fits input1.fits input2.fits ... inputN.fits
"""
import os
import math
import... | 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... | cpp | github | https://github.com/opencv/opencv | modules/calib3d/src/undistort.dispatch.cpp |
# test generated python code from pidl
# Copyright (C) Andrew Tridgell August 2010
#
# 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 la... | unknown | codeparrot/codeparrot-clean | ||
"""Chain for chatting with a vector database.""" | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chains/conversational_retrieval/__init__.py |
import string
import random
import json
import os
from urllib.request import urlopen
from buysell.models import Item, ItemImage
from django.conf import settings as base_set
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
from django.core.paginator import Paginator, P... | unknown | codeparrot/codeparrot-clean | ||
"""
Bit Writing Request/Response
------------------------------
TODO write mask request/response
"""
import struct
from pymodbus.constants import ModbusStatus
from pymodbus.pdu import ModbusRequest
from pymodbus.pdu import ModbusResponse
from pymodbus.pdu import ModbusExceptions as merror
from pymodbus.utilities impor... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para magnovideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core im... | unknown | codeparrot/codeparrot-clean | ||
import { __unstable__loadDesignSystem } from '@tailwindcss/node'
import { expect, test, vi } from 'vitest'
import * as versions from '../../utils/version'
import { migrateCamelcaseInNamedValue } from './migrate-camelcase-in-named-value'
vi.spyOn(versions, 'isMajor').mockReturnValue(true)
test.each([
['text-superRed'... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/@tailwindcss-upgrade/src/codemods/template/migrate-camelcase-in-named-value.test.ts |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from password_reset import views as password_reset_views
from django.http import HttpResponseRedirect
from django.views.generic import TemplateView
urlpattern... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from decimal import Decimal
from django.db.models import Avg, Sum, Count, Max, Min
from django.test import TestCase, Approximate
from models import Author, Publisher, Book, Store
class BaseAggregateTestCase(TestCase):
fixtures = ["initial_data.json"]
def test_empty_aggregate(self):
s... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import cv2
import tkinter as tk
from PIL import Image, ImageTk
import os.path as op
VIDEODIR = '/media/degoldschmidt/DATA_DENNIS_002/working_data/0007_KPEG'
VIDEOFILE = op.join(VIDEODIR, 'cam01_2018-04-18T15_39_08.avi')
START_FRAME = 4000
#Set up GUI
window = tk.Tk() #Makes main window
window.wm_t... | unknown | codeparrot/codeparrot-clean | ||
"""
Test CRUD for authorization.
"""
import copy
from django.contrib.auth.models import User
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from contentstore.tests.utils import AjaxEnabledTestClient
from contentstore.utils import reverse_url, reverse_course_url
from student.roles import Course... | unknown | codeparrot/codeparrot-clean | ||
package benchmarks.scheduler
import benchmarks.akka.*
import kotlinx.coroutines.*
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.annotations.State
import java.lang.Thread.*
import java.util.concurrent.*
import kotlin.concurrent.*
import kotlin.coroutines.*
@Warmup(iterations = 5, time = 1, timeUnit = Tim... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | benchmarks/src/jmh/kotlin/benchmarks/scheduler/DispatchersContextSwitchBenchmark.kt |
"""Main python file."""
import os
import time
import json
from flask import Flask
from vtdb import vtgate_client
# Register gRPC protocol.
from vtdb import grpc_vtgate_client # pylint: disable=unused-import
app = Flask(__name__)
# conn is the connection to vtgate.
conn = None
@app.route('/')
def index():
retu... | unknown | codeparrot/codeparrot-clean | ||
from django.core.management.base import BaseCommand, CommandError
import os
log_file_path = os.path.join(os.path.dirname(__file__), '../../static/ndf/wikidata/iteration_1.txt')
my_log = open(log_file_path, "w")
def log_class_created(label, log_flag):
"""
Function to write message in log file when topic is created.
... | unknown | codeparrot/codeparrot-clean | ||
//===--- Concurrency.h ----------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/Sema/Concurrency.h |
#!/usr/bin/python
#
# 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 distribut... | unknown | codeparrot/codeparrot-clean | ||
/**
* \file timing.h
*
* \brief Portable interface to timeouts and to the CPU cycle counter
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef MBEDTLS_TIMING_H
#define MBEDTLS_TIMING_H
#include "mbedtls/private_access.h"
#include "mbedtls/build_inf... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/mbedtls/timing.h |
import re
import cx_Oracle
from django.db.backends import BaseDatabaseIntrospection, FieldInfo
from django.utils.encoding import force_text
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseIntrospection):
# ... | unknown | codeparrot/codeparrot-clean | ||
import { flushSync } from 'svelte';
import { ok, test } from '../../test';
export default test({
html: `
<button>+1</button>
<p>count: 0</p>
`,
test({ assert, component, target, window }) {
const click = new window.MouseEvent('click', { bubbles: true });
const button = target.querySelector('button');
ok(... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-binding/_config.js |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.minimax import MiniMaxChat
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chat_models/minimax.py |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashb... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/testdata/output/latest_version/v7.timepicker.v42.json |
# ------------------------------------------------------------------------------
# This module implements Ivy's extension API of event and filter hooks.
# ------------------------------------------------------------------------------
from typing import Callable, Any, Optional, Dict, List
# Dictionary mapping hook nam... | unknown | codeparrot/codeparrot-clean | ||
//go:build windows
package windows
import (
"context"
"net"
"testing"
"github.com/moby/moby/v2/daemon/libnetwork/driverapi"
"github.com/moby/moby/v2/daemon/libnetwork/netlabel"
"github.com/moby/moby/v2/daemon/libnetwork/types"
"github.com/moby/moby/v2/internal/testutil/storeutils"
"gotest.tools/v3/assert"
)
... | go | github | https://github.com/moby/moby | daemon/libnetwork/drivers/windows/windows_test.go |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import os
import sys
try:
import tornado.web
except ImportError:
raise RuntimeError("You need tornado installed to use this worker.")
import tornado.httpserver
from tornado.ioloop imp... | unknown | codeparrot/codeparrot-clean | ||
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from .reader import *
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Re... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | unknown | codeparrot/codeparrot-clean | ||
use std::mem;
use std::ops::ControlFlow;
#[cfg(feature = "nightly")]
use rustc_macros::HashStable_NoContext;
use rustc_type_ir::data_structures::{HashMap, HashSet};
use rustc_type_ir::inherent::*;
use rustc_type_ir::relate::Relate;
use rustc_type_ir::relate::solver_relating::RelateExt;
use rustc_type_ir::search_graph:... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs |
# -*- 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 | ||
- Feature Name: Enterprise Registration
- Status: completed
- Start Date: 2017-01-17
- Authors: Daniel Harrison and David Taylor
- RFC PR: [#14114]
# Summary
CockroachDB's [business model] describes a set of "enterprise features", which
(after an evaluation period) must be purchased to be used by commercial
entities.... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20170117_enterprise.md |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
#
# 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... | 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/DUHelper.java |
"""Record of phased-in incompatible language changes.
Each line is of the form:
FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
CompilerFlag ")"
where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:
(... | 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 | ||
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# `curlx`
Functions that are prefixed with `curlx_` are internal global functions that
are written in a way to allow them to be "borrowed" and used outside of the
library: in the curl tool and in the curl test suite.
The ... | unknown | github | https://github.com/curl/curl | docs/internals/CURLX.md |
# 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 | ||
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Tool.aixlink
Tool-specific initialization for the IBM Visual Age linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 T... | unknown | codeparrot/codeparrot-clean | ||
def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "default-src 'self'; s... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | docs/examples/smooth-gtk-thread.c |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'Widgets.py',
]
PACKAGE = {
'title': 'Widgets',
'desc': 'Widgets example',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate example, MUST call ... | unknown | codeparrot/codeparrot-clean | ||
// Make the div behave like a button
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-flex;
vertical-align: middle; // match .btn alignment given font-size hack above
> .btn {
position: relative;
flex: 1 1 auto;
}
// Bring the hover, focused, and "active" buttons to the front ... | unknown | github | https://github.com/twbs/bootstrap | scss/_button-group.scss |
"""Module migrating/fixing schemas."""
import webapp2
from mimic.__mimic import common
from google.appengine.api import taskqueue
from google.appengine.datastore.datastore_query import Cursor
from . import model
from . import secret
from . import settings
from . import shared
# number of entities to fix at a time
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from string import lowercase
from copy import deepcopy
from ipdb import set_trace
import numpy as np
from sympy import *
from itertools import chain, product, repeat
from operator import add
from astar import State, Problem
def f_csp(depth, domains):
return depth + h_csp(domains)
""" Size of do... | unknown | codeparrot/codeparrot-clean | ||
use std::borrow::Cow;
use std::collections::BTreeMap;
pub use serde_json::Value as Json;
use serde_json::{Map, Number, json};
use crate::spec::TargetMetadata;
pub trait ToJson {
fn to_json(&self) -> Json;
}
impl ToJson for Json {
fn to_json(&self) -> Json {
self.clone()
}
}
macro_rules! to_json... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/json.rs |
# qmpy/materials/atom.py
"""
The Atom and Site models represent a single atom or an atomic site,
repsectively.
"""
from numpy.linalg import solve, norm
import time
import copy
from collections import defaultdict
import logging
from django.db import models
from django.db import transaction
import qmpy
from qmpy.uti... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | unknown | codeparrot/codeparrot-clean | ||
from rope.base import ast, codeanalyze
def get_indents(lines, lineno):
return codeanalyze.count_line_indents(lines.get_line(lineno))
def find_minimum_indents(source_code):
result = 80
lines = source_code.split('\n')
for line in lines:
if line.strip() == '':
continue
result ... | unknown | codeparrot/codeparrot-clean | ||
import subprocess
import sys
from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.NpmRequirement import NpmRequirement
@linter(executable='alex',
output_format='regex',
output_regex=r'(?P<line>\d+):(?P<column>\d+)-(?P<end_line>\d+):'
r'(?P<end_colum... | unknown | codeparrot/codeparrot-clean | ||
## [3.4.38](https://github.com/vuejs/core/compare/v3.4.37...v3.4.38) (2024-08-15)
### Bug Fixes
* **build:** revert entities to 4.5 to avoid runtime resolution errors ([f349af7](https://github.com/vuejs/core/commit/f349af7b65b9f8605d8b7bafcc06c25ab1f2daf0)), closes [#11603](https://github.com/vuejs/core/issues/11603)... | unknown | github | https://github.com/vuejs/core | changelogs/CHANGELOG-3.4.md |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package ssh
import (
"bufio"
"bytes"
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"time"
"github.com/apparentlymart/go-shquot/shquot"
"github.com/hashicorp/terr... | go | github | https://github.com/hashicorp/terraform | internal/communicator/ssh/communicator.go |
# -*- coding: utf-8 -*-
# Copyright 2015 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 requir... | unknown | codeparrot/codeparrot-clean | ||
import { UNINITIALIZED } from '../../../constants.js';
import { snapshot } from '../../shared/clone.js';
import { eager_effect, render_effect, validate_effect } from '../reactivity/effects.js';
import { untrack } from '../runtime.js';
import { get_error } from '../../shared/dev.js';
/**
* @param {() => any[]} get_val... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/internal/client/dev/inspect.js |
# -*- coding: utf-8 -*-
"""Serializer tests for the Box addon."""
import mock
from nose.tools import * # noqa (PEP8 asserts)
from website.addons.base.testing.serializers import StorageAddonSerializerTestSuiteMixin
from website.addons.googledrive.model import GoogleDriveProvider
from website.addons.googledrive.tests.f... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/api_fastapi/execution_api/deps.py |
/* Copyright 2022 - 2025 R. Thomas
*
* 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 t... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/DWARF/types/Dynamic.hpp |
"""
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | python | github | https://github.com/scikit-learn/scikit-learn | examples/svm/plot_weighted_samples.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.