code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class Uninsta... | unknown | codeparrot/codeparrot-clean | ||
# /extensions/postprocessors/amphtml_validation_test.py
# import grow
# import grow.testing
# from grow.pods import env
# from grow.pods import pods
# from grow.preprocessors import base
# from grow.pods import storage
from protorpc import messages
import codecs
# from grow.common import utils
# from grow.testing imp... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014, Rackspace, US, 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 w... | 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 | connect/api/src/main/java/org/apache/kafka/connect/connector/Connector.java |
"""
This module has the mock object definitions used to hold reference geometry
for the GEOS and GDAL tests.
"""
import json
import os
from django.contrib import gis
from django.utils import six
from django.utils._os import upath
# This global used to store reference geometry data.
GEOMETRIES = None
# Path where ref... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for copying from pathlib.types._ReadablePath to _WritablePath.
"""
import contextlib
import unittest
from .support import is_pypi
from .support.local_path import LocalPathGround
from .support.zip_path import ZipPathGround, ReadableZipPath, WritableZipPath
class CopyTestBase:
def setUp(self):
se... | python | github | https://github.com/python/cpython | Lib/test/test_pathlib/test_copy.py |
"""The tests for the Script component."""
# pylint: disable=protected-access
import unittest
from unittest.mock import patch
from homeassistant.core import callback
from homeassistant.setup import setup_component
from homeassistant.components import script
from tests.common import get_test_home_assistant
ENTITY_ID =... | unknown | codeparrot/codeparrot-clean | ||
import threading
import Queue as queue
def make_job(job_callable, *args, **kwargs):
""" Returns a callable that calls the supplied callable with given arguements. """
def job():
return job_callable(*args, **kwargs)
return job
class _PoolThread(threading.Thread):
""" Internal thread class that ... | unknown | codeparrot/codeparrot-clean | ||
import hashlib
import time
import math
import random
import socket
import sys
from thread import *
import threading
from bitcoin import *
import requests
from time import mktime
from datetime import datetime
import ast
elementlength=1000 #max number per array element, not number of elements
vectorlength=32 #number of... | unknown | codeparrot/codeparrot-clean | ||
import { slug } from 'github-slugger'
import fromMarkdown from 'mdast-util-from-markdown'
import toString from 'mdast-util-to-string'
import { remark } from 'remark'
import remarkHtml from 'remark-html'
export function capitalizeFirstLetter(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1)
}
export f... | typescript | github | https://github.com/twbs/bootstrap | site/src/libs/utils.ts |
from browser import html, document, window
import javascript
#memorize/cache?
def _get_value(other):
if isinstance(other, LongInt):
return other.value
return other
class BigInt:
def __init__(self):
pass
def __abs__(self):
return LongInt(self.value.abs())
def __add__(self, other):
... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "v25.no-op-migration.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
}... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v25.no-op-migration.v42.v0alpha1.json |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Boyd Adamson <boyd () boydadamson.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.... | unknown | codeparrot/codeparrot-clean | ||
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package kotlinx.coroutines.rx2
import io.reactivex.*
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlinx.coroutines.reactive.*
import kotlin.coroutines.*
import kotlin.internal.*
/**
* Creates cold [flowable][Flowable] that will r... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | reactive/kotlinx-coroutines-rx2/src/RxFlowable.kt |
# Arithmetic tests for DataFrame/Series/Index/Array classes that should
# behave identically.
from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs import timezones
from pandas.compat import WASM
from pandas.errors import OutOfBoundsDatetime
import pandas.util... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/arithmetic/test_timedelta64.py |
from collections import defaultdict
from django.conf import settings
from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\
token_kwargs, Variable
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from django.utils import six
register = Library(... | unknown | codeparrot/codeparrot-clean | ||
"""
===============
GMM covariances
===============
Demonstration of several covariances types for Gaussian mixture models.
See :ref:`gmm` for more information on the estimator.
Although GMM are often used for clustering, we can compare the obtained
clusters with the actual classes from the dataset. We initialize th... | python | github | https://github.com/scikit-learn/scikit-learn | examples/mixture/plot_gmm_covariances.py |
// Copyright 2014 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package rpc
import (
"context"
"math"
"sort"
"testing"
"time"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/rpc/rpcbase"
... | go | github | https://github.com/cockroachdb/cockroach | pkg/rpc/clock_offset_test.go |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
fr... | unknown | codeparrot/codeparrot-clean | ||
import warnings
from six import BytesIO, text_type
from six.moves.urllib.parse import urlparse, parse_qsl
from .util import CaseInsensitiveDict
import logging
log = logging.getLogger(__name__)
class Request(object):
"""
VCR's representation of a request.
"""
def __init__(self, method, uri, body, head... | unknown | codeparrot/codeparrot-clean | ||
'''Character CNN code for DSL 2016 task 2
Partly based on:
https://github.com/fchollet/keras/blob/master/examples/imdb_cnn.py
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
import tensorflow as tf
tf.set_random_seed(1337) # probably not needed
from keras.prep... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2022 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 applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/decision_transformer.md |
#!/usr/bin/env python
#
# Copyright 2016 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 | ||
"""Loads tests from components
All tests.py files inside loaded components are imported and any classes
derived from unittest.TestCase are then referenced from this file itself
so that they appear at the top level of the tests "module" that Django will
import.
"""
import os
import types
import unittest
from common im... | unknown | codeparrot/codeparrot-clean | ||
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/replica_sets... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/generated_suites/replica_sets_jscore_passthrough_last_lts_new_old_new.yml |
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-pinned-query.html
---
# Pinned query [query-dsl-pinned-query]
Promotes selected documents to rank higher than those matching a given query. This feature is typically used to guide searchers to curated documents that are pr... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/query-dsl/query-dsl-pinned-query.md |
"""Interface for adding certificate generation tasks to the XQueue. """
import json
import logging
import random
from uuid import uuid4
import lxml.html
from django.conf import settings
from django.test.client import RequestFactory
from django.urls import reverse
from django.utils.encoding import python_2_unicode_com... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Cisco and/or its affiliates.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# ===============================================================================
# Copyright 2012 Jake Ross
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google 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 ... | unknown | codeparrot/codeparrot-clean | ||
import { ClientComponent } from './ClientComponent'
export default async function Page() {
return (
<>
<div>
This fixture is to assert where the bootstrap scripts and other required
scripts emit during SSR
</div>
<div>
<ClientComponent />
</div>
</>
)
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/optimize_server_react/5/input.js |
use tokio::sync::mpsc;
use criterion::measurement::WallTime;
use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion};
#[derive(Debug, Copy, Clone)]
struct Medium(#[allow(dead_code)] [usize; 64]);
impl Default for Medium {
fn default() -> Self {
Medium([0; 64])
}
}
#[der... | rust | github | https://github.com/tokio-rs/tokio | benches/sync_mpsc.rs |
# -*- coding: utf-8 -*-
##################################################################################
#
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
# and 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $
#
# This program is free software: you can redistri... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright (c) 2009, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including
but n... | c | github | https://github.com/mysql/mysql-server | cmake/stack_direction.c |
# 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.
import contextlib
import httplib
import os
import shutil
import tempfile
import unittest
from device_setup import _WprHost
from options import OPTIONS
from ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2016 Intel Corporation.
#
# 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
# witho... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/dma-router.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: DMA Router Common Properties
maintainers:
- Vinod Koul <vkoul@kernel.org>
allOf:
- $ref: dma-common.yaml#
description:
DMA routers are transpar... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/dma/dma-router.yaml |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more information
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
## Copyright (C) 2014 Maxence Tury <maxence.tury@ssi.gouv.fr>
## OpenFlow is an open standard used in SDN deployments.
## ... | unknown | codeparrot/codeparrot-clean | ||
"""
Unit tests for the container page.
"""
import datetime
import re
from django.http import Http404
from django.test.client import RequestFactory
from django.utils import http
from mock import Mock, patch
from pytz import UTC
import contentstore.views.component as views
from contentstore.tests.test_libraries import ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 | ||
#!/usr/bin/env python
# Copyright 2018, 2020 Arm Limited.
# SPDX-License-Identifier: Apache-2.0
#
# 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 | ||
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | unknown | codeparrot/codeparrot-clean | ||
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore
from django.db import models
from django.db.models import Count
from django.test import TestCase, override_settings
from .models import (
Base, Child, Derived, Fe... | unknown | codeparrot/codeparrot-clean | ||
""" Test functions for the sparse.linalg.eigen.lobpcg module
"""
from __future__ import division, print_function, absolute_import
import itertools
import platform
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal,
assert_allclose, assert_array_less)
import pyt... | unknown | codeparrot/codeparrot-clean | ||
"""The tests for the Script component."""
# pylint: disable=protected-access
import asyncio
from contextlib import contextmanager
from datetime import timedelta
import logging
from types import MappingProxyType
from unittest import mock
import pytest
import voluptuous as vol
# Otherwise can't test just this file (imp... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.shortcuts import render_to_response
from login.forms import *
def register(request):
if request.method == 'POST':
fo... | unknown | codeparrot/codeparrot-clean | ||
Here are small programs that generate some parts of source code in kotlin project, such as repetitive stdlib functions for all primitive arrays, or protobuf classes used by compiler.
Only some of them are run automatically when building the compiler, others you need to invoke manually (e.g. `./gradlew generateTests`).... | unknown | github | https://github.com/JetBrains/kotlin | generators/ReadMe.md |
import test.test_import.data.circular_imports.subpkg2.parent.child | python | github | https://github.com/python/cpython | Lib/test/test_import/data/circular_imports/subpkg2/parent/__init__.py |
from __future__ import unicode_literals
# Local Apps
from grapevine.settings import grapevine_settings
from grapevine.utils import valid_content_types
class ScheduledSendableSender(object):
"""
Loops over all ContentTypes and sends each eligible message
that extend SendableMixin.
"""
def __init__(... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Holoscopio Tecnologia
# Copyright (C) 2010 Gustavo Noronha Silva <gns@gnome.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 o... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Beneath a Binary Sky.
# Copyright (C) 2016, Aidin Gharibnavaz <aidin@aidinhut.com>
#
# Beneath a Binary Sky 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 | ||
### WikiPathways_webservice.py
#Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California
#Author Nathan Salomonis - nsalomonis@gmail.com
#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 th... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Broadcasting;
use Illuminate\Contracts\Broadcasting\HasBroadcastChannel;
use Stringable;
class Channel implements Stringable
{
/**
* The channel's name.
*
* @var string
*/
public $name;
/**
* Create a new channel instance.
*
* @param \Illumi... | php | github | https://github.com/laravel/framework | src/Illuminate/Broadcasting/Channel.php |
# 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 | ||
#!/usr/bin/env python
import os, sys, json
from common_paths import *
import spec_validator
import argparse
def expand_pattern(expansion_pattern, test_expansion_schema):
expansion = {}
for artifact_key in expansion_pattern:
artifact_value = expansion_pattern[artifact_key]
if artifact_value == ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Tests for L{ClassAlias} and L{register_class}. Both are the most
fundamental parts of PyAMF and the test suite for it is big so it makes sense
to have them in one file.
@since: 0.5
"""
import unittest
import pyamf
from pyamf import ClassAlias
fro... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2018 Red Hat 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
DOCUMENTATION = """author: Ansible Networking Team
connection: httpapi
short_description: Use httpapi to run comma... | unknown | codeparrot/codeparrot-clean | ||
{
"name": "my-vend/my-app",
"license": "MIT",
"repositories": [
{
"packagist": false
}
]
} | json | github | https://github.com/composer/composer | tests/Composer/Test/Config/Fixtures/config/config-with-packagist-false.json |
#ifndef EXPECTED_WARNINGS_INCLUDED
#define EXPECTED_WARNINGS_INCLUDED
// Copyright (c) 2018, 2025, Oracle and/or its affiliates.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License, version 2.0,
// as published by the Free Software Foundati... | c | github | https://github.com/mysql/mysql-server | client/mysqltest/expected_warnings.h |
#!/usr/bin/env/python
"""
Example of conditional simulation of ground motion fields with the OQ-hazardlib
"""
import numpy as np
from collections import OrderedDict
from shapely import wkt
from openquake.hazardlib.geo.point import Point
from openquake.hazardlib.geo.surface import PlanarSurface
from openquake.hazardli... | unknown | codeparrot/codeparrot-clean | ||
# 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.
"""Parses options for the instrumentation tests."""
import os
# TODO(gkanwar): Some downstream scripts current rely on these functions
# existing. This... | unknown | codeparrot/codeparrot-clean | ||
#-*- coding: utf-8 -*-
import datetime
import functools
import json
import logging
import itertools
import random
import copy
import re
import celery
import mock # noqa
from contextlib import nested
from mock import call
from nose.tools import * # noqa PEP8 asserts
import httpretty
from modularodm import Q
from scr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('editor', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | unknown | codeparrot/codeparrot-clean | ||
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | unknown | codeparrot/codeparrot-clean | ||
use serde_derive::Serialize;
#[derive(Serialize)]
#[serde(rename =)]
struct S;
fn main() {} | rust | github | https://github.com/serde-rs/serde | test_suite/tests/ui/malformed/cut_off.rs |
# 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.
from pylib.base import base_test_result
class InstrumentationTestResult(base_test_result.BaseTestResult):
"""Result information for a single instrumen... | unknown | codeparrot/codeparrot-clean | ||
"""
Scrapy engine tests
This starts a testing web server (using twisted.server.Site) and then crawls it
with the Scrapy crawler.
To view the testing web server in a browser you can start it by running this
module with the ``runserver`` argument::
python test_engine.py runserver
"""
from __future__ import print_... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/distributed_runtime/rpc/coordination/grpc_coordination_service_impl.h |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Radware LTD.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# Amara, universalsubtitles.org
#
# Copyright (C) 2016 Participatory Culture Foundation
#
# 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 Free Software Foundation, either version 3 of the
# License, or (at your op... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const path = require('node:path');
const { fork } = require('node:child_process');
const fs = require('node:fs');
const { styleText } = require('node:util');
const DEFAULT_RUNS = 30; // Number of runs for each n value
const CV_THRESHOLD = 0.05; // 5% coefficient of variation threshold
const ... | javascript | github | https://github.com/nodejs/node | benchmark/calibrate-n.js |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package awsauth
import (
"context"
"fmt"
"strconv"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
"github.co... | go | github | https://github.com/hashicorp/vault | builtin/credential/aws/client.go |
import json
from optparse import make_option
from couchdbkit import ResourceNotFound
from django.core.management.base import BaseCommand, CommandError
from corehq.apps.userreports.models import DataSourceConfiguration, ReportConfiguration
from corehq.apps.userreports.tasks import rebuild_indicators
from dimagi.utils.de... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.network.sockets
import java.net.*
import java.nio.channels.*
/**
* Java 1.7 networking APIs (like [java.net.StandardSocketOptions]) are only available since Android API 24.
... | kotlin | github | https://github.com/ktorio/ktor | ktor-network/jvm/src/io/ktor/network/sockets/JavaSocketOptions.kt |
This error indicates a violation of one of Rust's orphan rules for trait
implementations. The rule concerns the use of type parameters in an
implementation of a foreign trait (a trait defined in another crate), and
states that type parameters must be "covered" by a local type.
When implementing a foreign trait for a f... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0210.md |
import sys, os, glob
import argparse
from operator import itemgetter
import subprocess
uppmax_id = 'ngi2016003'
def init_sample_hash_emtry():
empty_sample_result = {
'#Archived_runs' : 0,
'#Data_runs': 0,
'#Analysis_runs': 0,
'#Reads':0,
'RowCov':0,
'#AlignedReads':... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
i... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockito/internal/AllInvocationsFinderTest.java |
//===--- ReachableBlocks.swift --------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | swift | github | https://github.com/apple/swift | SwiftCompilerSources/Sources/Optimizer/DataStructures/ReachableBlocks.swift |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from sqlalchemy.orm import defaultload, joinedload
from indico.core.db import db
from indico.core.db.sqla... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests of the LMS XBlock Runtime and associated utilities
"""
from django.contrib.auth.models import User
from django.conf import settings
from ddt import ddt, data
from mock import Mock
from unittest import TestCase
from urlparse import urlparse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from lm... | 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 | ||
import logging
import logging.config
from sha3 import sha3_256
from bitcoin import privtopub
import struct
import os
import sys
import errno
import rlp
import random
from rlp import big_endian_to_int, int_to_big_endian
logger = logging.getLogger(__name__)
# decorator
def debug(label):
def deb(f):
def inne... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
__version__ = '0.1.0'
__author__ = 'Daniel Krikun'
__license__ = 'MIT'
import sys
import logging
import msvcrt
from argparse import ArgumentParser
import zmq
from agent_pb2 import *
from ffmpeg_recorder import *
def parse_cmdline_args():
"""Parse command-line arguments."""
prsr = ArgumentPa... | 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 | connect/runtime/src/main/java/org/apache/kafka/connect/util/RetryUtil.java |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import formencode
import six
ne = formencode.validators.NotEmpty()
def _test_builtins(func):
def dummy(s):
return "builtins dummy"
import six.moves.builtins
six.moves.builtins._ = dummy
try... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package healthcheck
import (
"fmt"
"time"
"github.com/hashicorp/go-secure-stdlib/parseutil"
"github.com/hashicorp/vault/sdk/logical"
)
type TidyLastRun struct {
Enabled bool
UnsupportedVersion bool
LastRunCritical time.Duratio... | go | github | https://github.com/hashicorp/vault | command/healthcheck/pki_tidy_last_run.go |
__version__ = '0.1.2'
__author__ = 'Juan Batiz-Benet'
__email__ = 'juan@benet.ai'
__doc__ = '''
aws datastore implementation.
Tested with:
* boto 2.5.2
'''
#TODO: Implement queries using a key index.
#TODO: Implement TTL (and key configurations)
from boto.s3.key import Key as S3Key
from boto.exception import S3Resp... | unknown | codeparrot/codeparrot-clean | ||
#
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
import logging
from basil.HL.RegisterHardwareLayer import HardwareLayer
logger = logging.getLogger(__... | unknown | codeparrot/codeparrot-clean | ||
# _*_ coding:utf-8 _*_
from django.shortcuts import render
from django.shortcuts import render_to_response
import os,sys,time
from django.http import HttpResponse
from autoadmin.models import ModuleList
from autoadmin.models import ServerList
from autoadmin.models import ServerAppCateg
from autoadmin.models import Serv... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module Rails
module Generators
class MailerGenerator < NamedBase
source_root File.expand_path("templates", __dir__)
argument :actions, type: :array, default: [], banner: "method method"
check_class_collision suffix: "Mailer"
def create_mailer_file
... | ruby | github | https://github.com/rails/rails | actionmailer/lib/rails/generators/mailer/mailer_generator.rb |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package e2etest
import (
"fmt"
"os"
"path/filepath"
"testing"
"github.com/hashicorp/terraform/internal/e2e"
)
var terraformBin string
// canRunGoBuild is a short-term compromise to account for the fact that we
// have a small number of test... | go | github | https://github.com/hashicorp/terraform | internal/command/e2etest/main_test.go |
# -*- coding: utf-8 -*-
#
# This module (which must have the name queryfunc.py) is responsible
# for converting incoming queries to a database query understood by
# this particular node's database schema.
#
# This module must contain a function setupResults, taking a sql object
# as its only argument.
#
# library impo... | unknown | codeparrot/codeparrot-clean | ||
from inaugurator.server import config
import threading
import logging
import pika
import simplejson
import json
import os
import signal
import pikapatchwakeupfromanotherthread
_logger = logging.getLogger('inaugurator.server')
class Server(threading.Thread):
def __init__(self, checkInCallback, doneCallback, progre... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-2025 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 by a... | java | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/java/org/springframework/docs/web/webmvc/mvcservlet/mvcanncustomerservletcontainererrorpage/ErrorController.java |
###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:/... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 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 | ||
/*
* Copyright 2010-2022 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.fir.diagnostics
import com.intellij.psi.PsiElement
interface KaCom... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KaCompilerPluginDiagnostic.kt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.