code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Copyright 2017, Google LLC
#
# 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 by applicable law or agreed to in writing,... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
//go:build !enterprise
package plugin
import (
"github.com/hashicorp/vault/sdk/logical"
"github.com/hashicorp/vault/sdk/plugin/pb"
"google.golang.org/grpc"
)
// newGRPCSystemViewFromSetupArgs (Vault Community edition) constructs a gRPC SystemV... | go | github | https://github.com/hashicorp/vault | sdk/plugin/grpc_backend_server_stubs_oss.go |
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | unknown | codeparrot/codeparrot-clean | ||
"""Probability data from various sources.
In this module, the "Essen corpus" refers to a corpus of 6,217 European folk
songs from the Essen Folksong Collection. The songs are available at
http://kern.ccarh.org/cgi-bin/ksbrowse?l=/essen and the list of songs used to
train the monophonic key and meter programs is publis... | unknown | codeparrot/codeparrot-clean | ||
declare module "*module.css" {
const styles: {
[className: string]: string;
};
export default styles;
} | typescript | github | https://github.com/vercel/next.js | examples/with-jest-babel/types.d.ts |
## Input
```javascript
function Component(props) {
const f = item => item;
const x = [...props.items].map(f); // `f` doesn't escape here...
return [x, f]; // ...but it does here so it's memoized
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{items: [{id: 1}]}],
isComponent: false,
};
```
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-noAlias-escaping-function.expect.md |
import unittest2
from ice import entities
class TestEntity(unittest2.TestCase):
def test_to_json(self):
e = entities.Entity()
e.id = 'test-123'
e.name = 'banana'
e.age = 12
self.assertDictEqual(
e.to_dict(),
{
'name': 'banana',
... | unknown | codeparrot/codeparrot-clean | ||
# Author: moparisthebest <admin@moparisthebest.com>
#
# This file is part of Sick Beard.
#
# Sick Beard 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 operator import methodcaller
import numpy as np
import pytest
import pandas as pd
from pandas import (
MultiIndex,
Series,
date_range,
)
import pandas._testing as tm
class TestSeries:
@pytest.mark.parametrize("func", ["rename_axis", "_set_axis_name"])
def test_set_axis_name_mi(self, func):
... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/generic/test_series.py |
#ifndef JEMALLOC_INTERNAL_PAC_H
#define JEMALLOC_INTERNAL_PAC_H
#include "jemalloc/internal/exp_grow.h"
#include "jemalloc/internal/pai.h"
#include "san_bump.h"
/*
* Page allocator classic; an implementation of the PAI interface that:
* - Can be used for arenas with custom extent hooks.
* - Can always satisfy any ... | c | github | https://github.com/redis/redis | deps/jemalloc/include/jemalloc/internal/pac.h |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Helpers for initial module or kernel cmdline parsing
* Copyright (C) 2001 Rusty Russell.
*/
#include <linux/ctype.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/kstrtox.h>
#include <linux/module.... | c | github | https://github.com/torvalds/linux | kernel/params.c |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/dags/test_impersonation.py |
@import "@sass/abstracts/vars/colors";
@import "@sass/abstracts/mixins";
.button-default,
.default {
@include default-link-button();
background: #f6f6f6;
color: $text-basic;
}
.button-success,
.success {
@include default-link-button();
background: $btn-green-light;
color: $text-white;
&:hover {
color... | unknown | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/assets/sass/base/links/_link-button.scss |
## Input
```javascript
// @flow @enableEmitHookGuards @panicThreshold:"none" @enableFire
component Foo(useDynamicHook) {
useDynamicHook();
return <div>hello world</div>;
}
```
## Code
```javascript
function Foo({
useDynamicHook,
}: $ReadOnly<{ useDynamicHook: any }>): React.Node {
useDynamicHook();
retur... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dont-add-hook-guards-on-retry.expect.md |
# -*- test-case-name: twisted.python.test.test_dist3 -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for installing Twisted on Python 3.
Only necessary while parts of Twisted are unported.
@var modules: A list of modules that have been ported,
e.g. "twisted.python.versions... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
###############################################################################
#
# ByAddress
# Retrieves weather and UV index data for a given Geo point using the Yahoo Weather and EnviroFacts APIs.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use super::SectionItem;
use super::VersionMetadata;
use colored::Colorize;
use serde::Deserialize;
use std::path::PathBuf;
use crate::error::Context;
use crate::{
error::Error... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-cli/src/info/packages_nodejs.rs |
/*
* 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-tests/test/com/google/common/collect/MapsCollectionTest.java |
#pragma once
#include <c10/hip/HIPCachingAllocator.h>
// Use of c10::hip namespace here makes hipification easier, because
// I don't have to also fix namespaces. Sorry!
namespace c10::hip {
// NB: THIS SHOULD NOT BE USED
// I couldn't find anywhere it was used in public pytorch sources or downstream projects.
// B... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/hip/impl/HIPAllocatorMasqueradingAsCUDA.h |
import maya.cmds as cmds
from tank.platform.qt import QtCore, QtGui
def _findShotCamera():
"""
Shot camera setup. You can replace this entire func with your own code to return the correct cameraShape for the app to use.
"""
camera = []
for each in cmds.ls(type = 'camera'):
getCamTransform =... | unknown | codeparrot/codeparrot-clean | ||
import { flushSync } from 'svelte';
import { ok, test } from '../../test';
export default test({
compileOptions: {
dev: true
},
test({ assert, target, window }) {
assert.htmlEqual(target.innerHTML, `<input><p>hello</p>`);
const input = target.querySelector('input');
ok(input);
input.value = 'goodbye';
... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/binding-member-expression-no-warning/_config.js |
prelude: |
$LOAD_PATH.unshift(File.expand_path("lib"))
require "strscan"
str = "test string"
scanner = StringScanner.new(str)
str = "string"
reg = /string/
benchmark:
check_until(reg): |
scanner.check_until(reg)
check_until(str): |
scanner.check_until(str)
exist?(reg): |
scanner.exist?(reg... | unknown | github | https://github.com/ruby/ruby | benchmark/search.yaml |
/*
* Copyright (C) 2014 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 | guava-tests/test/com/google/common/graph/GraphsTest.java |
# -*- coding: utf-8 -*-
"""
Swedish specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
from django.contrib.localflavor.se.se_counties import COUNTY... | unknown | codeparrot/codeparrot-clean | ||
"""A high-speed, production ready, thread pooled, generic WSGI server.
Simplest example on how to use this module directly
(without using CherryPy's application machinery):
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
status = '200 OK'
response_headers = [('Conte... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved.
# Pedro Tarrafeta <pedro@acysos.com>
# Ignacio I... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const _ = require('lodash');
/*----------------------------------------------------------------------------*/
/**
* Creates a hash object. If a `properties` object is provided, its own
* enumerable properties are assigned to the created hash.
*
* @memberOf util
* @param {Object} [properties] The p... | javascript | github | https://github.com/lodash/lodash | lib/common/util.js |
#!/usr/bin/env python
# Copyright 2014 RethinkDB, all rights reserved.
"""The `interface.db_config` test checks that the special `rethinkdb.db_config` table behaves as expected."""
from __future__ import print_function
import os, sys, time
startTime = time.time()
sys.path.append(os.path.abspath(os.path.join(os.pat... | unknown | codeparrot/codeparrot-clean | ||
# 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 their own license
# to the complete wo... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/bugprone/UnhandledExceptionAtNewCheck.h |
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
impl_tinystr_subtag!(
/// A variant subtag (examples: `"macos"`, `"posix"`, `"1996"` etc.)
///
/// [`Vari... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/icu_locale_core/src/subtags/variant.rs |
from django.db import models
from django.contrib import admin
from django.conf import settings
from django.core.urlresolvers import reverse
from autocomplete import widgets
from autocomplete.views import autocomplete as default_view
from autocomplete.utils import autocomplete_formfield
class AdminMedia:
extend = ... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
AR = np.arange(10)
AR.setflags(write=False)
with np.printoptions():
np.set_printoptions(
precision=1,
threshold=2,
edgeitems=3,
linewidth=4,
suppress=False,
nanstr="Bob",
infstr="Bill",
formatter={},
sign="+",
float... | python | github | https://github.com/numpy/numpy | numpy/typing/tests/data/pass/arrayprint.py |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | unknown | codeparrot/codeparrot-clean | ||
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
AES Key Expansion.
Expands 128, 192, or 256 bit key for use with AES
Running this file as __main__ will result in a self-test of the algorithm.
Algorithm per NIST FIPS-197 http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
Copyright (c) 2010, Adam Newman http://www.caller9.com/
L... | unknown | codeparrot/codeparrot-clean | ||
"""
Letsencrypt Integration Test Tool
- Configures (canned) boulder server
- Launches EC2 instances with a given list of AMIs for different distros
- Copies letsencrypt repo and puts it on the instances
- Runs letsencrypt tests (bash scripts) on all of these
- Logs execution and success/fail for debugging
Notes:
- ... | unknown | codeparrot/codeparrot-clean | ||
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2014 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... | swift | github | https://github.com/realm/realm-swift | RealmSwift/Aliases.swift |
"""
Render to gtk from agg
"""
from __future__ import division
import os
import matplotlib
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
show, draw_if_interactive,\
error_ms... | unknown | codeparrot/codeparrot-clean | ||
from test.test_support import verbose, run_unittest, import_module
#Skip these tests if either fcntl or termios is not available
fcntl = import_module('fcntl')
import_module('termios')
import errno
import pty
import os
import sys
import select
import signal
import socket
import unittest
TEST_STRING_1 = "I wish to bu... | 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/io/retry/package-info.java |
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file unordered_multiset_of.hpp
/// \brief Include support for unordered_multiset constrains f... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/bimap/unordered_multiset_of.hpp |
# Copyright (c) 2013 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 required by applicable law or agreed to in writ... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/embedded-controller/acer,aspire1-ec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Acer Aspire 1 Embedded Controller
maintainers:
- Nikita Travkin <nikita@trvn.ru>
description:
The Acer... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/embedded-controller/acer,aspire1-ec.yaml |
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
from collections.abc import MutableMapping
from numbers import Integral, Real
import numpy as np
from sklearn.base import (
BaseEstimator,
ClassifierMixin,
MetaEstimatorMixin,
_fit_context,
clone,
)
from sklearn.except... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/model_selection/_classification_threshold.py |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model.document import Document
from frappe.utils import get_fullname
class ToDo(Document):
def validate(self):
if self.is_new():
self... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FO... | unknown | codeparrot/codeparrot-clean | ||
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2023 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
// Code generated by "stringer"; DO NOT EDIT.
package sql
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values h... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/txneventtype_string.go |
import os
import sys
import json
import shutil
import pytest
import virtool.jobs.pathoscope
TEST_FILES_PATH = os.path.join(sys.path[0], "tests", "test_files")
PATHOSCOPE_PATH = os.path.join(TEST_FILES_PATH, "pathoscope")
BEST_HIT_PATH = os.path.join(PATHOSCOPE_PATH, "best_hit")
RESULTS_PATH = os.path.join(PATHOSCOPE... | unknown | codeparrot/codeparrot-clean | ||
"""
A DateTimeField and DateField that use the `dateutil` package for parsing.
"""
from __future__ import unicode_literals
from dateutil import parser
from wtforms.fields import Field
from wtforms.validators import ValidationError
from wtforms.widgets import TextInput
__all__ = (
'DateTimeField', 'DateField',
)
... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Created on Apr 17, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime
from django.forms import DateTimeInput
from django.test import override_settings
from django.utils import translation
from .base import WidgetTest
class DateTimeInputTest(WidgetTest):
widget = DateTimeInput()
def test_render_none(self):
self.check_html(self.widget, 'dat... | unknown | codeparrot/codeparrot-clean | ||
"""Base email backend class."""
class BaseEmailBackend(object):
"""
Base class for email backend implementations.
Subclasses must at least overwrite send_messages().
"""
def __init__(self, fail_silently=False, **kwargs):
self.fail_silently = fail_silently
def open(self):
"""Op... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{
fs::{create_dir_all, File},
io::Write,
path::{Path, PathBuf},
};
use handlebars::{to_json, Handlebars};
use include_dir::Dir;
use serde::Serialize;
use serde_js... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-cli/src/helpers/template.rs |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
package daemon
import (
"context"
"fmt"
"maps"
"os"
"path/filepath"
"slices"
"strconv"
"strings"
cdcgroups "github.com/containerd/cgroups/v3"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/apparmor"
coci "github.com/containerd/containerd/v2/pkg/oci"
"github... | go | github | https://github.com/moby/moby | daemon/oci_linux.go |
# Copyright (c) 2013 ISP RAS.
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
"""
Utilities functions assisting the system tests
"""
from six.moves import http_client
from drift.systesthelper import uuid_string, DriftBaseTestCase
class BaseCloudkitTest(DriftBaseTestCase):
def make_player(self, username=None):
username = username or uuid_string()
self.auth(username=usern... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and / or modify
# it under the ter... | unknown | codeparrot/codeparrot-clean | ||
import RPi.GPIO as GPIO, subprocess
#if( int(time.strftime('%H')) >= 8 and int(time.strftime('%H')) <= 21 ):
def checkFacebook():
nbr_notif = int(open("/home/pi/RaspiNotifier/nbr/nbr_facebook.txt", "r").read())
GPIO_PIN = int(config.get("Facebook", "gpioPin"))
GPIO.setmode(GPIO.BOARD)
GPIO.setup(GPIO_PIN, GPIO.OU... | 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-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerJsonTests.java |
groups:
- name: my-group-name
interval: 30s # defaults to global interval
rules:
- alert: HighErrors
expr: |
sum without(instance) (rate(errors_total[5m]))
/
sum without(instance) (rate(requests_total[5m]))
for: 5m
labels:
severity: critica... | unknown | github | https://github.com/prometheus/prometheus | model/rulefmt/testdata/test.yaml |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | unknown | codeparrot/codeparrot-clean | ||
"""
This module contains backported functions that are not present in Python 2.4
but are standard in more recent versions.
"""
import re
import sys
# Import backported modules
import simplejson
import collections
import itertools
if not hasattr(itertools, 'product'):
import _itertools
itertools.product = _ite... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import vtk
from vtk.test import Testing
class SimpleGlyph:
"""A simple class used to test vtkTensorGlyph."""
def __init__(self, reader):
self.reader = reader
sg = self.src_glyph = vtk.vtkSphereSource()
sg.SetRadius(0.5)
sg.SetCenter(0.5, 0.0, 0.... | unknown | codeparrot/codeparrot-clean | ||
import sys
sys.path.insert(1, "../../")
import h2o, tests
def scale_pca_rf_pipe():
from h2o.transforms.preprocessing import H2OScaler
from h2o.transforms.decomposition import H2OPCA
from h2o.estimators.random_forest import H2ORandomForestEstimator
from sklearn.pipeline import Pipeline
from sklearn.grid_sear... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from django.db import models
from django.core.exceptions import ValidationError
from pdc.apps.common.models import get_cached_id
class Service(models.Model):
# rhn, cdn, ftp
na... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Builder;
use PHPUnit\Framework\TestCase;
class DatabaseEloquentWithAttributesPendingTest extends TestCase
... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseEloquentWithAttributesPendingTest.php |
import math
from django.db.models.expressions import Func, Value
from django.db.models.fields import FloatField, IntegerField
from django.db.models.functions import Cast
from django.db.models.functions.mixins import (
FixDecimalInputMixin,
NumericOutputFieldMixin,
)
from django.db.models.lookups import Transfo... | python | github | https://github.com/django/django | django/db/models/functions/math.py |
#
# setup.py
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms... | unknown | codeparrot/codeparrot-clean | ||
<textarea name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>
{% if widget.value %}{{ widget.value }}{% endif %}</textarea> | html | github | https://github.com/django/django | django/forms/jinja2/django/forms/widgets/textarea.html |
{
"title": "V32 No-Op Migration Test Dashboard",
"schemaVersion": 31,
"panels": [
{
"type": "timeseries",
"title": "Panel with transformations remains unchanged",
"id": 1,
"transformations": [
{
"id": "labelsToFields",
"options": {
"mode": "rows"... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/testdata/input/v32.no_op_migration.json |
import tempfile
import os
import shutil
import sys
import contextlib
import site
from ..compat import StringIO
@contextlib.contextmanager
def tempdir(cd=lambda dir:None, **kwargs):
temp_dir = tempfile.mkdtemp(**kwargs)
orig_dir = os.getcwd()
try:
cd(temp_dir)
yield temp_dir
finally:
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for doc in (
{
"doctype": "Sales Order",
"stock_doctype": "Delivery Note",
"invoice_doctype": "Sales Invoic... | unknown | codeparrot/codeparrot-clean | ||
"""
Django settings for plants project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | unknown | codeparrot/codeparrot-clean | ||
"""Test correct setup/teardowns at module, class, and instance level."""
from typing import List
import pytest
from _pytest.pytester import Pytester
def test_module_and_function_setup(pytester: Pytester) -> None:
reprec = pytester.inline_runsource(
"""
modlevel = []
def setup_module(module... | unknown | codeparrot/codeparrot-clean | ||
#!/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 | ||
#!/usr/bin/python3
from ..core import memory, device, register
import time
"""
**py_register_machine2.core.processor**: The processor and his parts
"""
class EnigneControlBits(object):
"""
.. _EnigneControlBits:
Container for the static engine controll bits.
Used by the Processor_ to handle his ECR.
"""
engine... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
import json
import os
from wsgiref.handlers import CGIHandler
from philologic.runtime.DB import DB
from philologic.runtime.Query import split_terms
from philologic.runtime.QuerySyntax import group_terms, parse_query
import sys
sys.path.append("..")
import custom_functions
try:
from custo... | unknown | codeparrot/codeparrot-clean | ||
# intpyapp.py - Interactive Python application class
#
import win32con
import win32api
import win32ui
import __main__
import sys
import string
from . import app
import traceback
from pywin.mfc import window, afxres, dialog
import commctrl
from . import dbgcommands
lastLocateFileName = ".py" # used in the "File/Locate... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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 | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Werner Dijkerman (ikben@werner-dijkerman.nl)
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass_... | 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.standalone.fir.test.cases.generated.cases.components.symbolDeclarati... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/symbolDeclarationRenderer/FirStandaloneNormalAnalysisSourceModuleRendererTestGenerated.java |
import matplotlib.pyplot as plt
import numpy as np
import scattering
import scipy.constants as consts
d = np.linspace(0, 100, 500) * consts.milli
T = 0.0
wavelengths = np.array([10.0, 5.5, 3.21]) * consts.centi
lines = ['r--','b:','g-']
m_water = np.array([np.sqrt(80.255+24.313j), np.sqrt(65.476+37.026j),
np.sqrt... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 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 | server/auth/store_test.go |
"""
collate_content.py
==================
(c) 2014 - Edward Stronge
Connects to the content generator finalized signal to combine
articles and pages sharing a category into lists that will be
available in the template context.
Thanks to #pelican member @kura for suggestions on creating this
plugin.
"""
from collectio... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import os
import webapp2
from webapp2_extras import jinja2
import test_base
current_dir = os.path.abspath(os.path.dirname(__file__))
template_path = os.path.join(current_dir, 'resources', 'jinja2_templates')
compiled_path = os.path.join(current_dir, 'resources',
'... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf8 -*-
from __future__ import print_function
import sqlite3,zlib
from bs4 import BeautifulSoup
import codecs
import urllib2
import json
db = sqlite3.connect('raw_real.db')
cur = db.cursor()
info = sqlite3.connect('info.db')
infocur = info.cursor()
startid = 10000153
print("sucks1")
cur.execute('selec... | 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-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java |
# socket example - server side using thread
# usage: ruby tsvr.rb
require "socket"
gs = TCPServer.open(0)
addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
loop do
Thread.start(gs.accept) do |s|
print(s, " is accepted\n")
while line = s.gets
s.write(line)
end
print(s, " is... | ruby | github | https://github.com/ruby/ruby | sample/tsvr.rb |
import os
import pprint
import sys
import shutil
import qcengine as qcng
import psi4
import pytest
pp = pprint.PrettyPrinter(width=120)
__all__ = [
'a2a',
'compare',
'compare_integers',
'compare_strings',
'compare_values',
'compare_arrays',
'compare_recursive',
'compare_molrecs',
... | unknown | codeparrot/codeparrot-clean | ||
{
"columns": {
"description": "Opis",
"key": "Klucz",
"name": "Nazwa",
"team": "Zespół",
"value": "Wartość"
},
"config": {
"columns": {
"section": "Sekcja"
},
"title": "Konfiguracja Airflowa"
},
"connections": {
"add": "Dodaj połączenie",
"columns": {
"conne... | json | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/locales/pl/admin.json |
#!/usr/bin/python2.4
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from django.forms import ChoiceField, Form, MultiWidget, RadioSelect, TextInput
from django.test import override_settings
from django.utils.safestring import mark_safe
from .test_choicewidget import ChoiceWidgetTest
BLANK_CHOICE_DASH = (("", "------"),)
class RadioSelectTest(ChoiceWidgetTest):
w... | python | github | https://github.com/django/django | tests/forms_tests/widget_tests/test_radioselect.py |
/*
* Copyright (c) 2021-Present, Redis Ltd.
* All rights reserved.
*
* Licensed under your choice of (a) the Redis Source Available License 2.0
* (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the
* GNU Affero General Public License v3 (AGPLv3).
*/
#ifndef __FUNCTIONS_H_
#define __FUNCTIONS... | c | github | https://github.com/redis/redis | src/functions.h |
//! Unwind info generation (`.eh_frame`)
use cranelift_codegen::FinalizedMachExceptionHandler;
use cranelift_codegen::ir::Endianness;
use cranelift_codegen::isa::unwind::UnwindInfo;
use cranelift_module::DataId;
use cranelift_object::ObjectProduct;
use gimli::write::{Address, CieId, EhFrame, FrameTable, Section};
use ... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_cranelift/src/debuginfo/unwind.rs |
from rest_framework.decorators import api_view
from rest_framework.response import Response
from website.serializers import *
from rest_framework import status
from django.http import HttpResponse
@api_view([u'GET'])
def actionInventoryItems(request, pk):
try:
return Response(InventoryItemSerializer(Action... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
| Author: Thadeus Burgess
| Contributors:
| - Massimo Di Pierro for creating the original gluon/template.py
| - Jonathan Lundell for extensively testing the regex ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# localetzonemap.py
# Python module for osinstaller.
#
# Copyright (C) 2010 Ylmf, Inc.
#
#
# Ylmf Author(s): wkt <weikting@gmail.com>
#
#
import locale
from gettext import *
def N_(s):
return s
LangList=[
{"C":[[... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.