code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.utils import model_ngettext, get_deleted_objects
from django.db import router
from django.core.exceptions import PermissionDenied
from django.template.response import TemplateResponse
from django.utils.encoding import fo... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from omrdatasettools.ExportPath import ExportPath
class ExportPathTest(unittest.TestCase):
def test_get_full_path_without_stroke_thickness(self):
# Arrange
export_path = ExportPath("data/images", "3-4-Time", "1-13", "png")
# Act
full_path = export_path.get_full_pat... | unknown | codeparrot/codeparrot-clean | ||
---
blank_issues_enabled: false
contact_links:
- about: 'Please ask and answer usage questions on Stack Overflow.'
name: Question
url: 'https://stackoverflow.com/questions/tagged/typescript'
- about: 'Alternatively, you can use the TypeScript Community Discord.'
name: Chat
url: 'https://discord.gg/t... | unknown | github | https://github.com/microsoft/TypeScript | .github/ISSUE_TEMPLATE/config.yml |
# Natural Language Toolkit: CFG visualization
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Visualization tools for CFGs.
"""
# Idea for a nice demo:
# - 3 panes: grammar, treelet, working area
# - gra... | unknown | codeparrot/codeparrot-clean | ||
// 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.go |
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.action import ActionBase
from ansible... | unknown | codeparrot/codeparrot-clean | ||
import os
import json
import time
import logging
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
TRAVIS_JOB_NUMBER = 'TRAVIS_JOB_NUMBER'
TRAVIS_BUILD_ID = 'TRAVIS_BUILD_ID'
POL... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from django.contrib.auth.models import Group, Permission
from django.core.cache import caches
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.utils import IntegrityError
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | unknown | codeparrot/codeparrot-clean | ||
#include <complex.h>
#include "opencv_lapack.h"
static char* check_fn1 = (char*)sgesv_;
static char* check_fn2 = (char*)sposv_;
static char* check_fn3 = (char*)spotrf_;
static char* check_fn4 = (char*)sgesdd_;
int main(int argc, char* argv[])
{
(void)argv;
if(argc > 1000)
return check_fn1[0] + check_f... | cpp | github | https://github.com/opencv/opencv | cmake/checks/lapack_check.cpp |
from __future__ import division
import numpy
from chainer import backend
from chainer.backends import cuda
from chainer import optimizer
_default_hyperparam = optimizer.Hyperparameter()
_default_hyperparam.lr = 0.1
_default_hyperparam.beta = 0.9
_default_hyperparam.eta = 1.0
_default_hyperparam.weight_decay_rate = 0... | 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
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp |
from __future__ import with_statement
from datetime import datetime
import importlib
import django
from django.contrib import admin
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.conf.urls import url
from django.template.response import TemplateResponse
from django.co... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, N... | unknown | codeparrot/codeparrot-clean | ||
from sqlalchemy import Integer, ForeignKey, String
from sqlalchemy.types import PickleType, TypeDecorator, VARCHAR
from sqlalchemy.orm import mapper, Session, composite
from sqlalchemy.orm.mapper import Mapper
from sqlalchemy.orm.instrumentation import ClassManager
from sqlalchemy.testing.schema import Table, Column
fr... | unknown | codeparrot/codeparrot-clean | ||
import logging
from autotest.client.shared import error
from virttest import virsh
def run(test, params, env):
"""
Test command: virsh help.
1.Get all parameters from configuration.
2.Perform virsh help operation.
3.Check help information valid or not.
4.Check result.
"""
extra = param... | unknown | codeparrot/codeparrot-clean | ||
# Community membership
This doc outlines the various responsibilities of contributor roles in etcd.
| Role | Responsibilities | Requirements | Defined by |
|------------|----------------------------------------------... | unknown | github | https://github.com/etcd-io/etcd | Documentation/contributor-guide/community-membership.md |
#!/usr/bin/env python
#############################################################################
# Copyright (c) 2017 SiteWare Corp. All right reserved
#############################################################################
from __future__ import absolute_import, print_function
import os
import sys
import six... | 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 | ||
"""DBM-like dummy module"""
from collections import defaultdict
from typing import Any
class DummyDB(dict):
"""Provide dummy DBM-like interface."""
def close(self):
pass
error = KeyError
_DATABASES: defaultdict[Any, DummyDB] = defaultdict(DummyDB)
def open(file, flag="r", mode=0o666): # noqa: A00... | python | github | https://github.com/scrapy/scrapy | tests/mocks/dummydbm.py |
"""You have deposited a specific amount of dollars into your bank account. Each year your balance increases at the same
growth rate. Find out how long it would take for your balance to pass a specific threshold with the assumption that you
don't make any additional deposits.
Example
For deposit = 100, rate = 20 and t... | unknown | codeparrot/codeparrot-clean | ||
import copy
import random
import string
import uuid
from datetime import datetime
from itertools import product
import six
from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, BaseUserManager, PermissionsMixin,
)
from django.core.validators import RegexValidator
from django.d... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.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 Pub... | unknown | codeparrot/codeparrot-clean | ||
"""
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | unknown | codeparrot/codeparrot-clean | ||
import { createApp, h } from '../src'
describe('createApp for dom', () => {
// #2926
test('mount to SVG container', () => {
const root = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
createApp({
render() {
return h('g')
},
}).mount(root)
expect(root.children.leng... | typescript | github | https://github.com/vuejs/core | packages/runtime-dom/__tests__/createApp.spec.ts |
#!/usr/bin/env python
# coding: utf-8
import time
from pykit import awssign
# to sign a request, you need to provide a dict which contain 'varb',
# 'uri', 'headers'
if __name__ == '__main__':
access_key = 'your access key'
secret_key = 'your secret key'
# use query string
request = {
'verb':... | unknown | codeparrot/codeparrot-clean | ||
"""
>>> from django.core.paginator import Paginator
>>> from pagination.templatetags.pagination_tags import paginate
>>> from django.template import Template, Context
>>> p = Paginator(range(15), 2)
>>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages']
[1, 2, 3, 4, 5, 6, 7, 8]
>>> p = Paginator(range(17), 2)... | unknown | codeparrot/codeparrot-clean | ||
import tensorflow as tf
from gan import GAN
from common import sample_mixture_of_gaussians, discriminator, generator
class WGAN(GAN):
def __init__(self, params):
self.params = params
self.z_dim = params['z_dim']
data_sampler = sample_mixture_of_gaussians(**params['data'])
z_sample... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Use an aggregation query to answer the following question.
Which Region in India has the largest number of cities with longitude between 75 and 80?
Please modify only the 'make_pipeline' function so that it creates and returns an aggregation
pipeline that can be passed to the MongoDB aggrega... | unknown | codeparrot/codeparrot-clean | ||
# Generated by Django 2.0.9 on 2018-11-05 22:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('believe_his_prophets', '0003_auto_20181105_2152'),
]
operations = [
migrations.CreateModel(
name... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito;
import static org.mockito.internal.stubbing.answers.AnswerFunctionalInterfaces.toAnswer;
import java.util.Collection;
import org.mockito.internal.stubbing.answers.AnswersWithDe... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/AdditionalAnswers.java |
/*
* Copyright (c) 2017 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitousage.stubbing;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
import java.util.ArrayList;
import java.util.List;
import org.junit... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockitousage/stubbing/StubbingReturnsSelfTest.java |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | unknown | codeparrot/codeparrot-clean | ||
#
# The Python Imaging Library.
# $Id$
#
# im.show() drivers
#
# History:
# 2008-04-06 fl Created
#
# Copyright (c) Secret Labs AB 2008.
#
# See the README file for information on usage and redistribution.
#
import Image
import os, sys
_viewers = []
def register(viewer, order=1):
try:
if issubclass(vie... | unknown | codeparrot/codeparrot-clean | ||
import os
from time import sleep
import unittest
from appium import webdriver
# Returns abs path relative to this file and not cwd
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(__file__), p)
)
# think times can be useful e.g. when testing with an emulator
THINK_TIME = 5.
class SimpleSalendroidT... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Daniele Simonetti
#
# 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.
#
# Thi... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains implementations (= different classes) which encapsulate the
idea of a Digital Library document source.
A docum... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* relfilenumbermap.c
* relfilenumber to oid mapping cache.
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/... | c | github | https://github.com/postgres/postgres | src/backend/utils/cache/relfilenumbermap.c |
// 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 ).
//! This module contains types and implementations for the Coptic calendar.
//!
//! ```rust
//! use icu::calendar::{c... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/icu_calendar/src/cal/coptic.rs |
---
navigation_title: "User agent"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/user-agent-processor.html
---
# User agent processor [user-agent-processor]
The `user_agent` processor extracts details from the user agent string a browser sends with its web requests. This processor ... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/enrich-processor/user-agent-processor.md |
# Splashscreen example
This example demonstrates how a splashscreen can be implemented when waiting on an initialization code on Rust or on the UI.
## Running the example
Run the following scripts on the root directory of the repository:
```bash
$ cargo run --example splashscreen
``` | unknown | github | https://github.com/tauri-apps/tauri | examples/splashscreen/README.md |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/test/java/org/springframework/boot/SpringApplicationNoWebTests.java |
---
name: Bug report
description: Create a report to help us improve.
body:
- type: markdown
attributes:
value: |
Thank you for opening a bug report for Prometheus.
Please do *NOT* ask support questions in Github issues.
If your issue is not a feature request or bug report use our ... | unknown | github | https://github.com/prometheus/prometheus | .github/ISSUE_TEMPLATE/bug_report.yml |
"""Test Home Assistant template helper methods."""
# pylint: disable=too-many-public-methods
import unittest
from unittest.mock import patch
from homeassistant.components import group
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import template
import homeassistant.util.dt as dt_util
... | unknown | codeparrot/codeparrot-clean | ||
from flask import jsonify
from flask_restx import inputs
from flexget import plugin
from flexget.api import APIResource, api
from flexget.api.app import BadRequest, NotFoundError, etag
tmdb_api = api.namespace('tmdb', description='TMDB lookup endpoint')
class ObjectsContainer:
poster_object = {
'type': '... | 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
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/readability/UseConcisePreprocessorDirectivesCheck.cpp |
<?php
namespace Illuminate\Auth\Access;
use Exception;
use Throwable;
class AuthorizationException extends Exception
{
/**
* The response from the gate.
*
* @var \Illuminate\Auth\Access\Response
*/
protected $response;
/**
* The HTTP response status code.
*
* @var int|... | php | github | https://github.com/laravel/framework | src/Illuminate/Auth/Access/AuthorizationException.php |
# Copyright (c) 2012 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.
"""Presubmit script for Chromium browser resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about t... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 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/storage/mvcc/store_test.go |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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 | ||
- Feature Name: Index Recommendation Engine
- Status: in-progress
- Start Date: 2018-10-18
- Authors: Neha George
- RFC PR: [#71784](https://github.com/cockroachdb/cockroach/pull/71784)
- Cockroach Issue:
# Summary
This document describes an "index recommendation engine" that would suggest table indexes for Cockroach... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20211112_index_recommendation.md |
#!/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 a... | unknown | codeparrot/codeparrot-clean | ||
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
'@angular/common':
specifier: link:./in-existing-linked-by-bazel
version: link:in-existing-linked-by-bazel
'@angular/compiler':
specifier: link:./in-existi... | unknown | github | https://github.com/angular/angular | integration/cli-hello-world/pnpm-lock.yaml |
/*!
* 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/pages/Pools/PoolBarCard.tsx |
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zbuild.h"
#include "zutil.h"
#include "inftrees.h"
const char PREFIX(inflate_copyright)[] = " inflate 1.3.1 Copyright 1995-2024 M... | c | github | https://github.com/opencv/opencv | 3rdparty/zlib-ng/inftrees.c |
# 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 | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.theorem
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for theorem-proving languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, default, words
from py... | unknown | codeparrot/codeparrot-clean | ||
# (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... | python | github | https://github.com/ansible/ansible | lib/ansible/plugins/strategy/free.py |
// Copyright 2015 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 html_test
import (
"fmt"
"html"
)
func ExampleEscapeString() {
const s = `"Fran & Freddie's Diner" <tasty@example.com>`
fmt.Println(html.EscapeStr... | go | github | https://github.com/golang/go | src/html/example_test.go |
from abjad.tools import abctools
from abjad.tools import systemtools
class TimespanCollection(abctools.AbjadObject):
r'''A mutable always-sorted collection of timespans.
::
>>> timespans = (
... abjad.Timespan(0, 3),
... abjad.Timespan(1, 3),
... abjad.Timespan(1, ... | unknown | codeparrot/codeparrot-clean | ||
from autosklearn.pipeline.implementations.MultilabelClassifier import \
MultilabelClassifier
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter
from autosklearn... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# update-database.py - Create and update Mycodo SQLite databases
#
# Copyright (C) 2015 Kyle T. Gabriel
#
# This file is part of Mycodo
#
# Mycodo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | unknown | codeparrot/codeparrot-clean | ||
"""
Classes representing uploaded files.
"""
import errno
import os
from io import BytesIO
from django.conf import settings
from django.core.files import temp as tempfile
from django.core.files.base import File
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU... | unknown | codeparrot/codeparrot-clean | ||
""" Tests to quickly see if the backends look good.
This tests only to see if all the necessary methods are implemented,
whether all the right events are mentioned, and whether the keymap
contains all keys that should be supported.
This test basically checks whether nothing was forgotten, not that the
implementation i... | unknown | codeparrot/codeparrot-clean | ||
import sys
import xbmc
import xbmcplugin
from xbmcaddon import Addon
from moviesets import getFullMovieSetsDetails
# constants
ADDON = Addon( "plugin.moviesets" )
ADDON_NAME = ADDON.getAddonInfo( "name" )
Language = ADDON.getLocalizedString # ADDON strings
LangXBMC = xbmc.getLocalizedString # XBMC strings
clas... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import org.junit.Test
import kotlin.concurrent.thread
/**
* Tests concurrent cancel & dispose of the jobs.
*/
class JobDisposeStressTest: TestBase() {
private val TEST_DURATION = 3 * stressTestMultiplier // seconds
@Volatile
private var don... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/JobDisposeStressTest.kt |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/propertyMemberDeclarations/accessorsOverrideProperty9.ts] ////
//// [accessorsOverrideProperty9.ts]
// #41347, based on microsoft/rushstack
// Mixin utilities
export type Constructor<T = {}> = new (...args: any[]) => T;
export type PropertiesOf<T> = { [K in keyof T]: T[K] };
int... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/accessorsOverrideProperty9.js |
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/test/java/org/springframework/context/annotation/Spr11310Tests.java |
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# How to get started helping out in the curl project
We are always in need of more help. If you are new to the project and are
looking for ways to contribute and help out, this document aims to give a few
good starting poi... | unknown | github | https://github.com/curl/curl | docs/HELP-US.md |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import os
import lit.Test
import lit.util
class TestFormat(object):
pass
###
class FileBasedTest(TestFormat):
def getTestsInDirectory(self, testSuite, path_in_suite,
litConfig, localConfig):
source_path = testSuite.getSourcePath(path... | unknown | codeparrot/codeparrot-clean | ||
import hal
import glib
import time
class HandlerClass:
'''
class with gladevcp callback handlers
'''
def on_button_press(self,widget,data=None):
'''
a callback method
parameters are:
the generating object instance, likte a GtkButton instance
user data pa... | 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/common/security/oauthbearer/internals/OAuthBearerSaslClientProvider.java |
#!/usr/bin/env python
"""
C to C++ Translator
Convert a C program or whole project to C++
Copyright (C) 2001-2009 Denis Sureau
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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from setuptools import setup
import re
import os
import ConfigParser
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).re... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/assignmentCompatability28.ts] ////
//// [assignmentCompatability28.ts]
namespace __test1__ {
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
export var __val__obj4 = obj4;
}
namespace _... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/assignmentCompatability28.js |
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobMethodInvocationFailedException.java |
# -------------------------------------------------------------
#
# 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 unde... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/flaubert/__init__.py |
# -*- coding: latin-1 -*-
''' Nose test generators
Need function load / save / roundtrip tests
'''
from __future__ import division, print_function, absolute_import
import os
from os.path import join as pjoin, dirname
from glob import glob
from io import BytesIO
from tempfile import mkdtemp
from scipy._lib.six impor... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2009 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/cache/CacheBuilderTest.java |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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 applic... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package testing
import (
"sync"
"github.com/zclconf/go-cty/cty"
)
// ResourceStore is a simple data store, that can let the mock provider defined
// in this package store and return interesting values for resources and data
// sources.
type Res... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackruntime/testing/store.go |
from abc import ABCMeta, abstractmethod, abstractproperty
import importlib
import os
import shlex
import subprocess
import socket
import time
import rpyc
from dpa.app.entity import EntityRegistry
from dpa.env.vars import DpaVars
from dpa.ptask.area import PTaskArea
from dpa.ptask import PTaskError, PTask
from dpa.sin... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.contrib.admin.utils import quote
from django.contrib.auth.models import User
from django.template.response import TemplateResponse
from django.test import TestCase, override_settings
from django.urls import reverse
from .models import Action, Car, Person
@override_... | 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/3.3.4/RELEASENOTES.3.3.4.md |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
from flask.globals import session, request
from flask.helpers import flash, url_for
from flask.templating import render_template
from werkzeug.utils import redirect
from edsudoku.server import app
from edsudoku.server.users import User
__author__ = 'Eli Daian <elidaian@gmail.com>'
@app.route('/')
def main_page():
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.network.tls
public data class OID(public val identifier: String) {
public val asArray: IntArray = identifier.split(".", " ").map { it.trim().toInt() }.toIntArray()
pu... | kotlin | github | https://github.com/ktorio/ktor | ktor-network/ktor-network-tls/common/src/io/ktor/network/tls/OID.kt |
from calaccess_raw.admin.base import BaseAdmin
from calaccess_raw.admin.campaign import (
CvrSoCdAdmin,
Cvr2SoCdAdmin,
CvrCampaignDisclosureCdAdmin,
Cvr2CampaignDisclosureCdAdmin,
RcptCdAdmin,
Cvr3VerificationInfoCdAdmin,
LoanCdAdmin,
S401CdAdmin,
ExpnCdAdmin,
F495P2CdAdmin,
... | unknown | codeparrot/codeparrot-clean | ||
'''
This is a test script for the RNN Encoder-Decoder
'''
from groundhog.datasets import TMIteratorPytables
from groundhog.trainer.SGD_adadelta import SGD
from groundhog.mainLoop import MainLoop
from groundhog.layers import MultiLayer, \
RecurrentLayer, \
SoftmaxLayer, \
LastState, \
D... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python
#--------------------------------#
# File name: lagrange.py
# Author: Giovanni Antonaccio
# Email: giovanniantonaccio@gmail.com
# Date created: 09/30/2017
# Date last modified: 09/30/2017
# Python Version: 2.7
#--------------------------------#
from sympy import *
import json
x =... | unknown | codeparrot/codeparrot-clean | ||
bugfixes:
- "dnf - fix package installation when specifying architecture without version (e.g., ``libgcc.i686``) where a different architecture of the same package is already installed (https://github.com/ansible/ansible/issues/86156)." | unknown | github | https://github.com/ansible/ansible | changelogs/fragments/86156-dnf-multilib-arch.yml |
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"github.com/cockroachdb/cockroach/pkg/server/telemetry"
"github.com/cockroachdb/cockroach/pkg/sql/catalog"
"github.com/cockroachdb/c... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/alter_table_set_schema.go |
//// [tests/cases/compiler/aliasUsageInArray.ts] ////
//// [aliasUsageInArray_backbone.ts]
export class Model {
public someData: string;
}
//// [aliasUsageInArray_moduleA.ts]
import Backbone = require("./aliasUsageInArray_backbone");
export class VisualizationModel extends Backbone.Model {
// interesting stuf... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/aliasUsageInArray.js |
# Create your views here.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from easymode.tree import xml as tree
from easymode.tree.xml.query import XmlQuerySetChain
from easymode.xslt.response import render_to_response as render_xslt_to_re... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
# vim: set fileencoding=utf8
import os
import sys
import requests
import urlparse
import re
import argparse
import random
import select
############################################################
# wget exit status
wget_es = {
0: "No problems occurred.",
2: "User interference.",
1<... | unknown | codeparrot/codeparrot-clean | ||
from airflow.hooks.base_hook import BaseHook
from airflow import configuration
try:
snakebite_imported = True
from snakebite.client import Client, HAClient, Namenode
except ImportError:
snakebite_imported = False
from airflow.utils import AirflowException
class HDFSHookException(AirflowException):
pa... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.