code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*-------------------------------------------------------------------------
*
* spgproc.c
* Common supporting procedures for SP-GiST opclasses.
*
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION... | c | github | https://github.com/postgres/postgres | src/backend/access/spgist/spgproc.c |
from __future__ import absolute_import
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 = ["aggregation.json"]
d... | unknown | codeparrot/codeparrot-clean | ||
import re
import sys
import parse_tree as pt
import mod_collins_head_finder as mchf
import warnings
import pdb
# Adapted from the Berkeley coreference system.
def extract_dependency_structure(num_words, parse_tree, head_finder):
constituents = parse_tree.get_constituents()
subtree_heads = dict()
trees = pa... | unknown | codeparrot/codeparrot-clean | ||
#
# cache.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 | ||
from os import readlink
import copy
import csv
import errno
import os
import shutil
import tempfile
import unittest
from mock import Mock, MagicMock, patch
from pulp.common.plugins.distributor_constants import MANIFEST_FILENAME
from pulp.devel.mock_distributor import get_publish_conduit
from pulp.plugins.file.distrib... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 NTT Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | unknown | codeparrot/codeparrot-clean | ||
function foo(a, b, c, d) {
let x = {};
if (someVal) {
x = {b};
} else {
x = {c};
}
return x;
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-literal-cached-in-if-else.js |
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py.
# Do NOT edit this file manually as any edits will be overwritt... | python | github | https://github.com/huggingface/transformers | src/transformers/models/deepseek_vl_hybrid/processing_deepseek_vl_hybrid.py |
# -*- coding: utf-8 -*-
# flake8: noqa
# setup.py from odoo 10.0 alpha, included as is, except for the dependencies
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This prog... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v0alpha1.panel-geomap.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "datasource",
"uid": "grafana"
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-geomap/v0alpha1.panel-geomap.v42.v2alpha1.json |
#!/usr/bin/env python3
'''Psychomotor Vigilance Task
Stateless CGI script (state is kept by passing a state string as a second parameter to the jsonp callback function; this will work with stapjs library).
Note that although this is task that is focused on millisecond-level timing, it can still be done as a standard... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include "cvutils.hpp"
namespace cv {
namespace ndsrvp {
// fastMalloc
// [0][1][2][3][4][5][6][7][8][9]
// ^udata
//... | cpp | github | https://github.com/opencv/opencv | hal/ndsrvp/src/cvutils.cpp |
/*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/test/test_posit.cpp |
# Copyright 2014 NEC Corporation. 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 ... | unknown | codeparrot/codeparrot-clean | ||
from nose.tools import *
from tests.base import OsfTestCase
from tests.factories import UserFactory
from scripts.migration.migrate_mailing_lists_to_mailchimp_field import main, get_users_with_no_mailchimp_mailing_lists
class TestMigrateMailingLists(OsfTestCase):
def setUp(self):
super(TestMigrateMailingL... | unknown | codeparrot/codeparrot-clean | ||
#include <gtest/gtest.h>
#include <ATen/ATen.h>
#include <ATen/Utils.h>
#include <c10/util/accumulate.h>
#include <algorithm>
#include <iostream>
#include <numeric>
using namespace at;
#define TRY_CATCH_ELSE(fn, catc, els) \
{ \
... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/test/scalar_tensor_test.cpp |
# -*- coding: utf-8 -*-
#
# petition/data/models.py
#
# Copyright (C) 2011-16 Tomáš Pecina <tomas@pecina.cz>
#
# This file is part of petition.pecina.cz, a web-based petition
# application.
#
# This application is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Client actions related to plist files."""
import cStringIO
import types
from binplist import binplist
from grr.client import actions
from grr.client import vfs
from grr.lib import plist as plist_lib
from grr.lib.rdfvalues import plist as rdfp... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include "ndsrvp_hal.hpp"
#include "opencv2/imgproc/hal/interface.h"
#include "cvutils.hpp"
namespace cv {
namespace ndsrvp... | cpp | github | https://github.com/opencv/opencv | hal/ndsrvp/src/remap.cpp |
// SPDX-License-Identifier: GPL-2.0
/*
* linux/mm/compaction.c
*
* Memory compaction for the reduction of external fragmentation. Note that
* this heavily depends upon page migration to do all the real heavy
* lifting
*
* Copyright IBM Corp. 2007-2010 Mel Gorman <mel@csn.ul.ie>
*/
#include <linux/cpu.h>
#includ... | c | github | https://github.com/torvalds/linux | mm/compaction.c |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Oscar Campos <oscar.campos@member.fsf.org>
# 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, o... | unknown | codeparrot/codeparrot-clean | ||
from ovito import *
from ovito.io import *
from ovito.data import *
from ovito.modifiers import *
import numpy
node = import_file("../../files/CFG/fcc_coherent_twin.0.cfg")
modifier = ElasticStrainModifier()
print("Parameter defaults:")
print(" calculate_deformation_gradients: {}".format(modifier.calculate_deformat... | unknown | codeparrot/codeparrot-clean | ||
imports:
- { resource: framework.yml }
- { resource: twig.yml } | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/default.yml |
# -*- coding: utf-8 -*-
import random
import string
from itertools import cycle
from django.core.exceptions import ValidationError
import mock
from nose.tools import eq_, ok_
import mkt.site.tests
import mkt.feed.constants as feed
from mkt.feed.models import (FeedApp, FeedBrand, FeedCollection, FeedItem,
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: ascii -*-
#
# Copyright 2011, 2012
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.apach... | unknown | codeparrot/codeparrot-clean | ||
"""Loading unittests."""
import os
import re
import sys
import traceback
import types
import functools
from fnmatch import fnmatch, fnmatchcase
from . import case, suite, util
__unittest = True
# what about .pyc (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', *and* '.pyc'
VALID_M... | python | github | https://github.com/python/cpython | Lib/unittest/loader.py |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
import urllib
import json
import gdata
from apiclient.discovery import build
from oauth2client.file import St... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
/** @type {import("webpack").Configuration} */
const config = {
// mode: "development" || "production",
optimization: {
usedExports: true,
concatenateModules: true,
chunkIds: "named" // To keep filename consistent between different modes (for example building only)
}
};
module.exports = config; | javascript | github | https://github.com/webpack/webpack | examples/scope-hoisting/webpack.config.js |
"""
osgDB module
Part of osgpyplusplus python bindings for OpenSceneGraph C++ library
https://github.com/JaneliaSciComp/osgpyplusplus
The osgDB library provides support for reading and writing scene graphs,
providing a plugin framework and file utility classes.
The plugin framework in centered around the osgDB::Regis... | unknown | codeparrot/codeparrot-clean | ||
#include "ruby.h"
static const rb_data_type_t my_integer_type = {
"MyInteger", {0}, 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
my_integer_s_new(VALUE klass)
{
return TypedData_Wrap_Struct(klass, &my_integer_type, 0);
}
void
Init_my_integer(VALUE klass)
{
VALUE cMyInteger;
cMyInteger = rb_defi... | c | github | https://github.com/ruby/ruby | ext/-test-/integer/my_integer.c |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2015 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# Module iacorr
def iacorr(X, Y):
import numpy as np
if X.size == Y.size:
X = X.ravel()
Y = Y.ravel()
Xm = X.mean()
Ym = Y.mean()
Xc = X - Xm
Yc = Y - Ym
cov = (Xc*Yc).mean()
v1 = (Xc*Xc).mean()
v2 = (Yc*Yc).mea... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
#
#Released under the MIT license, see LICENSE.txt
import unittest
import sys
import os
import copy
from contigSim.src.model import Model
from contigSim.src.contig import LinearContig
from contigSim.src.contig import CircularContig
from ... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
from __future__ import absolute_import
from octoprint.printer.estimation import TimeEstimationHelper
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released un... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.web.test.test_xmlrpc -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for XML-RPC support in L{twisted.web.xmlrpc}.
"""
import datetime
import xmlrpclib
from StringIO import StringIO
from twisted.trial import unittest
from twisted.web import xmlrpc
... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
import re
import struct
import binascii
__all__ = [
# Legacy interface exports traditional RFC 1521 Base64... | unknown | codeparrot/codeparrot-clean | ||
#
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied w... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, unicode_literals
from six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceCharacters, ascii... | unknown | codeparrot/codeparrot-clean | ||
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2022 Realm 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/li... | c | github | https://github.com/realm/realm-swift | Realm/RLMSectionedResults.h |
//===--- PrintClangClassType.cpp - Print class types in C/C++ ---*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2022 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/PrintAsClang/PrintClangClassType.cpp |
// Copyright 2009 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 time_test
import (
"errors"
"fmt"
"internal/testenv"
"math/rand"
"runtime"
"strings"
"sync"
"sync/atomic"
"testing"
. "time"
_ "unsafe" // f... | go | github | https://github.com/golang/go | src/time/sleep_test.go |
""" Fantasm: A taskqueue-based Finite State Machine for App Engine Python
Docs and examples: http://code.google.com/p/fantasm/
Copyright 2010 VendAsta Technologies 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 ob... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015 Kurt Yoder
# See the file LICENSE for copying permission.
import logging
import os
import importlib
import yaml
from . import primitives
from .role_dirs import defaults_dir, files_dir, handlers_dir, meta_dir, tasks_dir, templates_dir, vars_dir
# TODO: split this into role and playbook
class Ansi... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
import re
from psparser import PSLiteral
from glyphlist import glyphname2unicode
from latin_enc import ENCODING
## name2unicode
##
STRIP_NAME = re.compile(r'[0-9]+')
def name2unicode(name):
"""Converts Adobe glyph names to Unicode numbers."""
if name in glyphname2unicode:
retur... | unknown | codeparrot/codeparrot-clean | ||
"""setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.util import convert_path
from distutils import log
import distutils.errors
import distutils.filelist
import os
import re
import sys
import io
import warnings
i... | unknown | codeparrot/codeparrot-clean | ||
import gio
from plugin_base.provider import Mode
class File:
"""This is a wrapper class that provides file-like object but
uses gio.File for actual operations."""
def __init__(self, path, mode):
if mode == Mode.READ:
self._resource = gio.File(path).read()
elif mode == Mode.WRITE:
if gio.File(path).quer... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module Kernel
###
# An alias for Psych.dump_stream meant to be used with IRB.
def y *objects
puts Psych.dump_stream(*objects)
end
private :y
end | ruby | github | https://github.com/ruby/ruby | ext/psych/lib/psych/y.rb |
"""
==============================
Probability Calibration curves
==============================
When performing classification one often wants to predict not only the class
label, but also the associated probability. This probability gives some
kind of confidence on the prediction. This example demonstrates how to di... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import vivisect.symboliks.analysis as vsym_analysis
class MockVw(object):
def __init__(self, *args, **kwargs):
self.psize = 4
class MockVar(object):
def __init__(self, va):
self.va = va
def solve(self, *args, **kwargs):
return self.va
def nop(*args, **kwargs):
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import re
import urlparse
import flask
from sqlalchemy.event import listen
from sqlalchemy.schema import FetchedValue
from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.ext.associationproxy im... | unknown | codeparrot/codeparrot-clean | ||
//===--- OutputFileMap.h - Map of inputs to multiple outputs ----*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 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/Basic/OutputFileMap.h |
# -*- coding: utf-8 -*-
"""
========================================
A Minimal CSV writer for data collection
========================================
Problem
-------
Write (a subset of) the data to a CSV file during data collection.
Approach
--------
Write a callback function that integrates Python's built-in csv ... | unknown | codeparrot/codeparrot-clean | ||
import os
from enigma import eEPGCache, getBestPlayableServiceReference, \
eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner
from Components.config import config
from Components.UsageConfig import defaultMoviePath
from Components.TimerSanityCheck import TimerSanityCheck
from Screens.... | 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;
use C... | php | github | https://github.com/composer/composer | src/Composer/Factory.php |
import seamless
from seamless.highlevel import Context
from silk.Silk import RichValue
import json
import numpy as np
print("Load graph...")
graph = json.load(open("snakegraph.seamless"))
ctx = seamless.highlevel.load_graph(graph)
ctx.add_zip("snakegraph.zip")
ctx.translate()
print("Bind files...")
files = [("data/ge... | unknown | codeparrot/codeparrot-clean | ||
//! Demonstrates construction and usage of a TLS-capable HTTP client.
extern crate tls_rustls_0_23 as rustls;
use std::{error::Error as StdError, sync::Arc};
use actix_tls::connect::rustls_0_23::webpki_roots_cert_store;
use rustls::ClientConfig;
#[actix_rt::main]
async fn main() -> Result<(), Box<dyn StdError>> {
... | rust | github | https://github.com/actix/actix-web | awc/examples/client.rs |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | unknown | codeparrot/codeparrot-clean | ||
# Contains code from https://github.com/MagicStack/uvloop/tree/v0.16.0
# SPDX-License-Identifier: PSF-2.0 AND (MIT OR Apache-2.0)
# SPDX-FileCopyrightText: Copyright (c) 2015-2021 MagicStack Inc. http://magic.io
import enum
# After the connection is lost, log warnings after this many write()s.
LOG_THRESHOLD_FOR_CONN... | python | github | https://github.com/python/cpython | Lib/asyncio/constants.py |
# coding: utf-8
import os
import time
from flask import render_template, redirect, url_for, session, flash, request, Response
from qiniu import Auth, put_file
from PIL import Image
from . import upload
from .. import db
from ..models import UsersInfo, WebConfig, Images
from ..forms import UploadForm
from ..common imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''Test that font.Text vertical alignment works.
Four labels will be aligned top, center, baseline and bottom.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import gl
from pyglet import font
from . import base_text
class TEST_VALIGN(base_text.Text... | unknown | codeparrot/codeparrot-clean | ||
{
"BITPOS": {
"summary": "Finds the first set (1) or clear (0) bit in a string.",
"complexity": "O(N)",
"group": "bitmap",
"since": "2.8.7",
"arity": -3,
"function": "bitposCommand",
"history": [
[
"7.0.0",
"Added th... | json | github | https://github.com/redis/redis | src/commands/bitpos.json |
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/interconnect/qcom,msm8996.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm MSM8996 Network-On-Chip interconnect
maintainers:
- Konrad Dybcio <konradybcio@kernel.org>
description: |
Th... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/interconnect/qcom,msm8996.yaml |
---
mapped_pages:
- https://www.elastic.co/guide/en/kibana/current/kuery-query.html
---
# {{kib}} Query Language [kuery-query]
:::{note}
This section provides detailed **reference information**.
Refer to [KQL overview](docs-content://explore-analyze/query-filter/languages/kql.md) in the **Explore and analyze** sec... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/kql.md |
// Copyright 2025 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | cache/ringbuffer_test.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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/assets/evaluation.py |
#!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 sourc... | unknown | codeparrot/codeparrot-clean | ||
//===--- IDETypeChecking.cpp ----------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 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/IDETypeChecking.cpp |
import numpy as np
import pymbar
from pymbar.utils_for_testing import eq
import scipy.misc
from nose import SkipTest
def test_logsumexp():
a = np.random.normal(size=(200, 500, 5))
for axis in range(a.ndim):
ans_ne = pymbar.utils.logsumexp(a, axis=axis)
ans_no_ne = pymbar.utils.logsumexp(a, axi... | unknown | codeparrot/codeparrot-clean | ||
<?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\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bundle\Fra... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Functional/JsonStreamerTest.php |
from django.core.handlers.wsgi import WSGIRequest
from django.core.servers.basehttp import WSGIRequestHandler
from django.test import SimpleTestCase
from django.test.client import RequestFactory
from django.test.utils import captured_stderr
from django.utils.six import BytesIO
class Stub(object):
def __init__(self... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-only
/*
* linux/mm/memory_hotplug.c
*
* Copyright (C)
*/
#include <linux/stddef.h>
#include <linux/mm.h>
#include <linux/sched/signal.h>
#include <linux/swap.h>
#include <linux/interrupt.h>
#include <linux/pagemap.h>
#include <linux/compiler.h>
#include <linux/export.h>
#inclu... | c | github | https://github.com/torvalds/linux | mm/memory_hotplug.c |
import sys
import math
import clr
import time
clr.AddReference("MissionPlanner")
import MissionPlanner
clr.AddReference("MissionPlanner.Utilities") # includes the Utilities class
from MissionPlanner.Utilities import Locationwp
def gps_distance(lat1, lon1, lat2, lon2):
'''return distance between two points in meters,... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
This module split simulated galaxy particles hdf5 file into two sub
hdf5 files.
"""
import os
import re
import h5py
import numpy as np
class PartSplit:
"""
The partticle split class
Parameters
----------
input_dir: string
... | unknown | codeparrot/codeparrot-clean | ||
{% extends "template_used/base.html" %} | html | github | https://github.com/django/django | tests/test_utils/templates/template_used/extends.html |
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal;
import org.mockito.MockedSingleton;
import org.mockito.plugins.MockMaker;
public final class MockedSingletonImpl<T> extends ScopedMockImpl<MockMaker.SingletonMockContro... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/MockedSingletonImpl.java |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | unknown | codeparrot/codeparrot-clean | ||
import os
import shutil
import tempfile
import dnf
class DnfBaseWrapper(object):
def __init__(self, arch=None, cache_dir=None):
# prepopulate dict, everything else is redirected to the base object
self.__dict__["tmp_dir"] = None
self.__dict__["base"] = None
self.__dict__["conf"] = ... | unknown | codeparrot/codeparrot-clean | ||
# Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Logg... | unknown | codeparrot/codeparrot-clean | ||
# Used to notify core maintainers about new model PR being merged
name: New model PR merged notification
on:
push:
branches:
- main
paths:
- 'src/transformers/models/*/modeling_*'
jobs:
notify_new_model:
name: Notify new model
runs-on: ubuntu-22.04
steps:
- uses: actions/chec... | unknown | github | https://github.com/huggingface/transformers | .github/workflows/new_model_pr_merged_notification.yml |
"""Backends for traces
Available backends
------------------
1. NumPy array (pymc3.backends.NDArray)
2. Text files (pymc3.backends.Text)
3. SQLite (pymc3.backends.SQLite)
The NDArray backend holds the entire trace in memory, whereas the Text
and SQLite backends store the values while sampling.
Selecting a backend
-... | unknown | codeparrot/codeparrot-clean | ||
import {Component} from '@angular/core';
import {TestBed} from '@angular/core/testing';
import {GreetComponent} from './greet.component';
describe('greet component', () => {
it('should allow binding to an input', () => {
const fixture = TestBed.createComponent(TestCmp);
fixture.detectChanges();
expect(... | typescript | github | https://github.com/angular/angular | integration/cli-signal-inputs/src/app/greet.component.spec.ts |
# encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AgendaBill'
db.create_table('agendas_agendabill', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Python syntax checker with lint friendly output."""
import os
import parser
import re
import sys
def main():
paths, verbose, skip_patterns = parse_options()
paths = filter_paths(paths, skip_patterns)
check(paths, verbose)
def parse_options():
paths = []
skip_patterns = []... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 | ||
// errorcheck -0 -m=2
// 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.
// Test that we restrict inlining into very large functions.
// See issue #26546.
package foo
func small(a []int) int { // ERROR "can i... | go | github | https://github.com/golang/go | test/inline_big.go |
# Copyright (c) 2009-2012 testtools developers. See LICENSE for details.
__all__ = [
'KeysEqual',
]
from ..helpers import (
dict_subtract,
filter_values,
map_values,
)
from ._higherorder import (
AnnotatedMismatch,
PrefixedMismatch,
MismatchesAll,
)
from ._impl import Matcher, ... | unknown | codeparrot/codeparrot-clean | ||
---
#- name: Host in playbook is an integer
# hosts: 42
# tags: numeric_host
# tasks:
# - command: echo 'Running on {{ inventory_hostname }}'
#- name: Host in playbook is a string of digits
# hosts: "42"
# tags: string_digit_host
# tasks:
# - command: echo 'Running on {{ inventory_hostname }}'
#- name: Ho... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/hosts_field/test_hosts_field.yml |
// @panicThreshold:"none"
import {useNoAlias} from 'shared-runtime';
const cond = true;
function useFoo(props) {
props.x = 10;
if (cond) bar();
return useNoAlias({});
function bar() {
console.log('bar called');
return 5;
}
}
export const FIXTURE_ENTRYPOINT = {
fn: useFoo,
params: [{}],
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-retain-source-when-bailout.js |
//===--- FlattenList.swift ------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | swift | github | https://github.com/apple/swift | benchmark/single-source/FlattenList.swift |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.com>
#
# 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 publish... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# ###
# Copyright (c) 2013, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
"""Tests for the command-line interface cli.py
"""
import os
import sys
import tempfile
import unittest
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.md') as f:
rdm = f.read()
with open('LICENSE') as f:
lcs = f.read()
version = '1.0.1'
setup(
name='grayscale',
version=version,
packages=find_packages(exclude=['grayscale.test']),
url='https... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2008, Humanized, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditio... | unknown | codeparrot/codeparrot-clean | ||
# stdlib
import time
from types import ListType
# 3p
from nose.plugins.attrib import attr
try:
import psycopg2 as pg
except ImportError:
pg = None
# project
from tests.checks.common import AgentCheckTest
@attr(requires='pgbouncer')
class TestPgbouncer(AgentCheckTest):
CHECK_NAME = 'pgbouncer'
def te... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#
# Copyright 2020 MongoDB Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | python | github | https://github.com/mongodb/mongo | evergreen/functions/binaries_extract.py |
######################################################################
# Cloud Routes Web Application
# -------------------------------------------------------------------
# SaltStack Services Reaction - Forms Class
######################################################################
from wtforms import TextField, S... | unknown | codeparrot/codeparrot-clean | ||
import sys
from PyQt4 import QtGui, QtCore
class MultipleChoicesDialog(QtGui.QDialog):
"""Dialog with the possibility of selecting one or more
items from a list"""
def __init__(self, choices=None, title="Title"):
super().__init__(None, QtCore.Qt.WindowSystemMenuHint |
Qt... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2009 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 | ||
"""A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.