code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | unknown | codeparrot/codeparrot-clean | ||
use std::mem;
use rustc_arena::TypedArena;
use crate::ty::TyCtxt;
/// Helper trait that allows `arena_cache` queries to return `Option<&T>`
/// instead of `&Option<T>`, and avoid allocating `None` in the arena.
///
/// An arena-cached query must be declared to return a type that implements
/// this trait, i.e. eithe... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_middle/src/query/arena_cached.rs |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Access to Python's configuration information."""
import codecs
import os
import re
import sys
from os.path import pardir, realpath
try:
import configparser
except ImportError:
import Conf... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import generators
import decimal, re, inspect
import copy
try:
# yaml isn't standard with python. It shouldn't be required if it
# isn't used.
import yaml
except ImportError:
yaml = None
# Fallback since `any` isn't in Python <2.5
try:
any
except NameError:
def any(iterable):... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANSI... | 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... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/2.0.6-alpha/RELEASENOTES.2.0.6-alpha.md |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function, division
from sympy.core import Basic
from sympy.core.compatibility import iterable, as_int, range
from sympy.utilities.iterables import flatten
from collections import defaultdict
class Prufer(Basic):
"""
The Prufer correspondence is an algorithm that describes the
... | unknown | codeparrot/codeparrot-clean | ||
import numpy
import six
from chainer import cuda
from chainer import function
from chainer import utils
from chainer.utils import type_check
class TheanoFunction(function.Function):
def __init__(self, forward_func, backward_func):
utils.experimental('chainer.functions.TheanoFunction')
self.forwar... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2012 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 net
import (
"errors"
"fmt"
"internal/asan"
"internal/race"
"internal/testenv"
"net/netip"
"os"
"reflect"
"runtime"
"testing"
"time"
)
func... | go | github | https://github.com/golang/go | src/net/udpsock_test.go |
/* Generated file to emulate the Harness.SourceMapRecorder namespace. */
export * from "../sourceMapRecorder.js"; | typescript | github | https://github.com/microsoft/TypeScript | src/harness/_namespaces/Harness.SourceMapRecorder.ts |
from __future__ import print_function
import vigra
from vigra import graphs
from vigra import numpy
import pylab
# parameter
filepath = '12003.jpg' # input image path
sigmaGradMag = 2.0 # sigma Gaussian gradient
superpixelDiameter = 10 # super-pixel size
slicWeight = 10.0 # SLIC color - spatial weight
beta ... | 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/controller/resourcequota/config/v1alpha1/conversion.go |
// Copyright 2020 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 | api/etcdserverpb/raft_internal_stringer_test.go |
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import gtk
# TODO: this code should be shared with integgui and maybe others
class FileSelection(object):
# Get the selected filename
def file_... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import io
import six
import sys
import json
import runpy
import shutil
import tempfile
import unittest
from examples import storages
fr... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChangeForm(UserChangeForm):
class Meta(UserChangeForm.Meta):
model = User
c... | unknown | codeparrot/codeparrot-clean | ||
'''File: diffev.py an implementation of the differential evolution algoithm
for fitting.
Programmed by: Matts Bjorck
Last changed: 2008 11 23
'''
from numpy import *
import thread
import time
import random as random_mod
import sys, os, pickle
__parallel_loaded__ = False
_cpu_count = 1
try:
import multiprocessing... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
/*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/core/src/algorithm.cpp |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from odoo import api, models, _
from odoo.tools.safe_eval import safe_eval
#
# Use period and Journal for selection or resources
#
class ReportAssertAccount(models.AbstractModel):
_name = 'report.acc... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package depsfile
import (
"bufio"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/getproviders/providerreqs"
"g... | go | github | https://github.com/hashicorp/terraform | internal/depsfile/locks_file_test.go |
import operator_benchmark as op_bench
import torch
"""Microbenchmarks for Chunk operator"""
# Configs for PT Chunk operator
chunk_short_configs = op_bench.config_list(
attr_names=["M", "N", "chunks"],
attrs=[
[8, 8, 2],
[256, 512, 2],
[512, 512, 2],
],
cross_product_configs={
... | python | github | https://github.com/pytorch/pytorch | benchmarks/operator_benchmark/pt/chunk_test.py |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/BlasBackend.h>
#include <ATen/WrapDimUtilsMulti.h>
#include <ATen/ceil_div.h>
#include <ATen/native/Resize.h>
#include <ATen/native/mkldnn/xpu/detail/oneDNN.h>
#include <ATen/native/xpu/Blas.h>
#include <ATen/xpu/XPUScaledBlas.h>
#include <torch/library.h>
#ifn... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/mkldnn/xpu/ScaledBlas.cpp |
#!/usr/bin/python2.6
# Generate lang files with en.js file as reference
# if key does not exist in json file, the key and value are added from reference file (en.js)
# Usage : $ python ./utils/generate-lang.py
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package api
import (
"context"
"errors"
"net/http"
"github.com/mitchellh/mapstructure"
)
func (c *Sys) CORSStatus() (*CORSResponse, error) {
return c.CORSStatusWithContext(context.Background())
}
func (c *Sys) CORSStatusWithContext(ctx cont... | go | github | https://github.com/hashicorp/vault | api/sys_config_cors.go |
"use strict";
const path = require("path");
/** @type {import("webpack").Configuration} */
const config = {
// mode: "development" || "production",
entry: {
// The entry points for the pages
// They also contains router
pageA: ["./aEntry", "./router"],
pageB: ["./bEntry", "./router"]
},
output: {
path: ... | javascript | github | https://github.com/webpack/webpack | examples/hybrid-routing/webpack.config.js |
# Copyright 2013 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.
from telemetry.core import util
from telemetry.page.actions import seek
from telemetry.unittest import tab_test_case
AUDIO_1_SEEKED_CHECK = 'window.__hasEve... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package promising
import (
"context"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
)
// PromiseResolver is an object representing responsibility for a promise, which
// can be passed between tasks to delegate responsibi... | go | github | https://github.com/hashicorp/terraform | internal/promising/promise_resolver.go |
from cStringIO import StringIO
import unittest
import unittest2
from unittest2.test.support import resultFactory
class TestUnittest(unittest2.TestCase):
def assertIsSubclass(self, actual, klass):
self.assertTrue(issubclass(actual, klass), "Not a subclass.")
def testInheritance(self):
self.a... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/env/python
# -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 | ||
<?php
$container->loadFromExtension('framework', [
'cache' => [
'app' => 'cache.redis_tag_aware.foo',
'pools' => [
'cache.redis_tag_aware.foo' => [
'adapter' => 'cache.adapter.redis_tag_aware',
],
],
],
]); | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware_pool.php |
# frozen_string_literal: true
require "openssl"
module ActiveRecord
module Encryption
# Container of configuration options
class Config
attr_accessor :primary_key, :deterministic_key, :store_key_references, :key_derivation_salt, :hash_digest_class,
:support_unencrypted_data, :encry... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/encryption/config.rb |
# Copyright 2012 James McCauley
# Copyright 2008 (C) Nicira, 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 ap... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
def main():
skip = set([
'test/sanity/code-smell/%s' % os.path.basename(__file__),
'docs/docsite/rst/dev_guide/testing/sanity/no-smart-quotes.rst',
'test/integration/targets/unicode/unicode.yml',
'test/int... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import time
def sigmoid(input):
return 1.0 / (1 + np.exp(-input))
class BoltzmannMachine(object):
def __init__(self, input_size, hidden_size, output_size):
self.total_nodes = input_size + hidden_size + output_size
self.state = np.random.randint(0, 2, self.total_nodes, dtype=... | unknown | codeparrot/codeparrot-clean | ||
import os
import stat
import pytest
from . import environment
from .textwrap import DALS
from . import contexts
class TestEggInfo:
setup_script = DALS("""
from setuptools import setup
setup(
name='foo',
py_modules=['hello'],
entry_points={'console_scripts': [... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* algif_skcipher: User-space interface for skcipher algorithms
*
* This file provides the user-space API for symmetric key ciphers.
*
* Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
*
* The following concept of the memory management is used:
*
* The... | c | github | https://github.com/torvalds/linux | crypto/algif_skcipher.c |
benchmark:
vm_bigarray: |
a = [
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,10,
... | unknown | github | https://github.com/ruby/ruby | benchmark/vm_bigarray.yml |
# 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 | ||
/**
* 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/ipc/RetriableException.java |
from hypothesis import (
assume,
example,
given,
strategies as st,
)
import numpy as np
import pytest
from pandas._libs.byteswap import (
read_double_with_byteswap,
read_float_with_byteswap,
read_uint16_with_byteswap,
read_uint32_with_byteswap,
read_uint64_with_byteswap,
)
import p... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/io/sas/test_byteswap.py |
/*------------------------------------------------------------------------
*
* geqo_pool.c
* Genetic Algorithm (GA) pool stuff
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/optimizer/geqo/geqo_po... | c | github | https://github.com/postgres/postgres | src/backend/optimizer/geqo/geqo_pool.c |
{
"Id": "sha256:21635a6b4880772f3fabbf8b660907fa38636558cf787cc26f1779fc4b4e2cba",
"RepoTags": [
"ghcr.io/spring-io/spring-boot-cnb-test-builder:0.0.1"
],
"RepoDigests": [
"ghcr.io/spring-io/spring-boot-cnb-test-builder@sha256:21635a6b4880772f3fabbf8b660907fa38636558cf787cc26f1779fc4b4e2cba"
],
"Par... | json | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/docker/type/image-empty-os.json |
#!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# 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, m... | unknown | codeparrot/codeparrot-clean | ||
"""
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
import cgi
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.datastructures import MultiValueDict
fro... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | unknown | codeparrot/codeparrot-clean | ||
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/requests/messages/get_player_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _messa... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2012 The Guava 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 agre... | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/TestSortedMapGenerator.java |
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Update third_party/WebKit using git.
Under the assumption third_party/WebKit is a clone of git.webkit.org,
we can use git comma... | unknown | codeparrot/codeparrot-clean | ||
from collections import defaultdict
import mock
from searx.engines import spotify
from searx.testing import SearxTestCase
class TestSpotifyEngine(SearxTestCase):
def test_request(self):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 0
params = spotify.request(quer... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on 2011-07-14
@author: George
'''
def inject_app_defaults(application):
"""Inject an application's default settings"""
try:
__import__('%s.settings' % application)
import sys
# Import our defaults, project defaults, and project settings
_app_settings = sys.modules[... | unknown | codeparrot/codeparrot-clean | ||
/* contrib/ltree_plpython/ltree_plpython3u--1.0.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION ltree_plpython3u" to load this file. \quit
CREATE FUNCTION ltree_to_plpython3(val internal) RETURNS internal
LANGUAGE C STRICT IMMUTABLE
AS 'MODULE_PATHNAME', '... | sql | github | https://github.com/postgres/postgres | contrib/ltree_plpython/ltree_plpython3u--1.0.sql |
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def hist_dist(title, distribution_tensor, hist_range=(-4, 4)):
"""
Display histogram of a TF distribution
"""
with tf.Session() as sess:
values = sess.run(distribution_tensor)
plt.title(title)
plt.hist(values, n... | unknown | codeparrot/codeparrot-clean | ||
#$#HEADER-START
# vim:set expandtab ts=4 sw=4 ai ft=python:
#
# Reactor Configuration Event Engine
#
# Copyright (C) 2016 Brandon Gillespie
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Fre... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from matplotlib._delaunay import compute_planes, linear_interpolate_grid, nn_interpolate_grid
from matplotlib._delaunay import nn_interpolate_unstructured
__all__ = ['LinearInterpolator', 'NNInterpolator']
def slice2gridspec(key):
"""Convert a 2-tuple of slices to start,stop,steps for x and y.... | unknown | codeparrot/codeparrot-clean | ||
'''
urlresolver XBMC Addon
Copyright (C) 2016 Gujal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is di... | unknown | codeparrot/codeparrot-clean | ||
use rustc_hir::def_id::DefId;
pub use rustc_type_ir::fast_reject::*;
use super::TyCtxt;
pub type DeepRejectCtxt<
'tcx,
const INSTANTIATE_LHS_WITH_INFER: bool,
const INSTANTIATE_RHS_WITH_INFER: bool,
> = rustc_type_ir::fast_reject::DeepRejectCtxt<
TyCtxt<'tcx>,
INSTANTIATE_LHS_WITH_INFER,
INSTA... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_middle/src/ty/fast_reject.rs |
# API routes with GraphQL server
Next.js ships with [API routes](https://nextjs.org/docs/api-routes/introduction), which provide an easy solution to build your own `API`.
This example showcases how to build a lightweight and blazing fast GraphQL API with minimum configuration using GraphQL Yoga.
GraphQL Yoga comes wi... | unknown | github | https://github.com/vercel/next.js | examples/api-routes-graphql/README.md |
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* 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 req... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/PE.hpp |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "v0alpha1.influxdb-templated.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "",
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/datasource-influxdb/v0alpha1.influxdb-templated.v42.v2beta1.json |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC 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
#... | unknown | codeparrot/codeparrot-clean | ||
## NIFTY (Numerical Information Field Theory) has been developed at the
## Max-Planck-Institute for Astrophysics.
##
## Copyright (C) 2013 Max-Planck-Society
##
## Author: Marco Selig
## Project homepage: <http://www.mpa-garching.mpg.de/ift/nifty/>
##
## This program is free software: you can redistribute it and/or mod... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
/*
* NOTE: This is generated code. Look in numpy/linalg/lapack_lite for
* information on remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlam... | c | github | https://github.com/numpy/numpy | numpy/linalg/lapack_lite/f2c_c_lapack.c |
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessorExperimentalDecorators.ts] ////
//// [autoAccessorExperimentalDecorators.ts]
declare var dec: (target: any, key: PropertyKey, desc: PropertyDescriptor) => void;
class C1 {
@dec
accessor a: any;
@dec
static accessor b: any;
}... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2015).js |
#! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | unknown | codeparrot/codeparrot-clean | ||
"""
Local winner-take-all layer.
"""
__author__ = "Xia Da, Ian Goodfellow, Minh Ngoc Le"
from functools import wraps
import numpy
from theano import tensor as T
from pylearn2.models.mlp import Linear, Layer
def lwta(p, block_size):
"""
Apply hard local winner-take-all on every rows of a theano matrix.
Pa... | unknown | codeparrot/codeparrot-clean | ||
package opts
import (
"net"
"net/url"
"strconv"
"strings"
"github.com/pkg/errors"
)
const (
// DefaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. dockerd -H tcp://
// These are the IANA registered port numbers for use with Docker
// see http://www.iana.org/assignments/ser... | go | github | https://github.com/moby/moby | daemon/pkg/opts/hosts.go |
# -*- coding: utf-8 -*-
"""
fileparser
~~~~~~~~~~
parse SQL file making use of special comments
that defines dependencies & variables...
:copyright: (c) 2014 by sc AmvTek srl
:email: devel@amvtek.com
"""
import re
from os.path import abspath
from jinja2 import Environment # see PyPI jinja2
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015 Microsoft Corporation
# Simple script for executing a command and reporting the result by email
import sendmail
import sys
import subprocess
import tempfile
import config
import socket
import os
try:
hostname = socket.gethostbyaddr(socket.gethostname())[0]
except:
try:
hostname = o... | unknown | codeparrot/codeparrot-clean | ||
//! Architecture-specific routines and operations.
//!
//! LLVM will already optimize calls to some of these in cases that there are hardware
//! instructions. Providing an implementation here just ensures that the faster implementation
//! is used when calling the function directly. This helps anyone who uses `libm` d... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/arch/mod.rs |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2013 Contributor
#
# 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 | ||
# Documentation for Zulip's authentication backends is split across a few places:
#
# * https://zulip.readthedocs.io/en/latest/production/authentication-methods.html and
# zproject/prod_settings_template.py have user-level configuration documentation.
# * https://zulip.readthedocs.io/en/latest/development/authenticat... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from rwbench import ROOT
from os.path import join
from django.conf import settings
settings.configure(
TEMPLATE_DIRS=(join(ROOT, 'django'),),
TEMPLATE_LOADERS=(
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
)),
)
... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
const path = require("path");
const webpack = require("../../");
/** @type {import("../../").Configuration} */
module.exports = {
entry: ["../../hot/dev-server", "./index.js"],
output: {
filename: "bundle.js",
hotUpdateChunkFilename: "[id].[fullhash].bundle-update.js",
hashDigestLength: 4
},
p... | javascript | github | https://github.com/webpack/webpack | test/hotPlayground/webpack.config.js |
use std::iter;
use rustc_abi::{BackendRepr, TagEncoding, Variants, WrappingRange};
use rustc_hir::{Expr, ExprKind, HirId, LangItem};
use rustc_middle::bug;
use rustc_middle::ty::layout::{LayoutOf, SizeSkeleton};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_session::{declare_lint, declare_lint_... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_lint/src/types.rs |
import random
from twisted.internet import defer, reactor
from twisted.internet.protocol import Protocol, Factory
from scapy.all import get_if_list
import txtorcon
from ooni.settings import OConfig
from ooni import errors
from ooni.utils import net
from bases import ConfigTestCase
class TestSettings(ConfigTestCase):... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
import tempfile
import traceback
import unittest
from buildscripts import sync_repo_with_copybara
@unittest.skipIf(
sys.platform == "win32" or sys.platform == "darwin",
reason="No need to run this unittest on windows or macos",
)
class TestBranchFunctions(unittest.TestCase):
@staticme... | python | github | https://github.com/mongodb/mongo | buildscripts/tests/test_sync_repo_with_copybara.py |
#!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=missing-docstring
import datetime
import os
import pytz
from django.conf import settings
from lettuce import step, world
from mock import patch
from nose.tools import assert_equal, assert_in, assert_is_none, assert_true
from pytz import UTC
from selenium.common.exceptions import NoAlertPresentExcepti... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Description**
Returns the [inverse hyperbolic cosine](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) of a number. | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/description/acosh.md |
"""Testing helper functions
Warning: current status experimental, mostly copy paste
Warning: these functions will be changed without warning as the need
during refactoring arises.
The first group of functions provide consistency checks
"""
import numpy as np
from numpy.testing import assert_allclose, assert_
from ... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2014 Quantopian, 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 agreed to in wr... | unknown | codeparrot/codeparrot-clean | ||
"""
Dribbble OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/dribbble.html
http://developer.dribbble.com/v1/oauth/
"""
from social.backends.oauth import BaseOAuth2
class DribbbleOAuth2(BaseOAuth2):
"""Dribbble OAuth authentication backend"""
name = 'dribbble'
AUTHORIZATION_URL ... | unknown | codeparrot/codeparrot-clean | ||
{
"@timestamp": "2099-11-15T14:12:12",
"http": {
"request": {
"method": "get"
},
"response": {
"bytes": 1070000,
"status_code": 200
},
"version": "1.1"
},
"message": "GET /search HTTP/1.1 200 1070000",
"source": {
"ip": "192.168.0.1"
},
"user": {
"id": "user"
... | json | github | https://github.com/elastic/elasticsearch | benchmarks/src/main/resources/org/elasticsearch/benchmark/search/fetch/subphase/300b_example.json |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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 | ||
# Copyright 2025 The HuggingFace Inc. 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 appl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/csm/generation_csm.py |
from datetime import datetime
from django.db import models
RECORD_INFO = u'info'
RECORD_ERROR = u'error'
class RecordManager(models.Manager):
def log(self, level, src, msg, **kwargs):
msg = msg.format(**kwargs).encode('utf-8')
return Record.objects.create(level=RECORD_INFO, src=src, msg=msg)
... | unknown | codeparrot/codeparrot-clean | ||
class NonSolver:
def __init__(self, calculate_posibles, basecase):
self.calculate_posibles = calculate_posibles
self.basecase = basecase
self.solutions = self._solve() # type generator object
def _solve(self):
partial = []
calcs = [self.calculate_posibles(partial)]
depth = 0
while True:
if self.base... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 | ||
# Copyright 2016 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 for outputting a HTML diff of two multi-line strings.
The main purpose of this utility is to show the difference between
text baselines (-expecte... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Evgeniy Krysanov <evgeniy.krysanov@gmail.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 = {
'm... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises
from nose.tools import assert_raises
import boto
import boto3
from boto.exception import EC2ResponseError
import six
import sure # noqa
from moto import mock_ec2, mock_ec2_depr... | 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 n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/clients/admin/ShareGroupDescription.java |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.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 3 of the Lice... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.