code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
use crate::media::{MediaCodec, MediaStreamSinkWrapper, MediaStreamTrack, MediaStreamTrackInner};
use crate::rtc::RtcError;
use crate::rtc::RtcError::MediaTrackError;
use arc_swap::ArcSwapOption... | rust | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-webrtc/ktor-client-webrtc-rs/common/rust/media/track.rs |
import logging
import re
from django.contrib.staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles import finders
from django.conf import settings
from static_replace.models import AssetBaseUrlConfig
from xmodule.modulestore.django import modulestore
from xmodule.modulestore import ModuleStor... | unknown | codeparrot/codeparrot-clean | ||
from _weakrefset import WeakSet
def get_cache_token():
"""Returns the current ABC cache token.
The token is an opaque object (supporting equality testing) identifying the
current version of the ABC cache for virtual subclasses. The token changes
with every call to ``register()`` on any ABC.
"""
... | python | github | https://github.com/python/cpython | Lib/_py_abc.py |
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo"
"github.com/cockroachdb/cockroach/pkg/sql/types"
)
var noColumns = make(colinfo.Resul... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/plan_columns.go |
# icu_locale_data [](https://crates.io/crates/icu_locale_data)
<!-- cargo-rdme start -->
Data for the `icu_locale` crate
This data was generated with CLDR version 47.0.0, ICU version icu4x/2025-05-01/77.x, and
LSTM segmenter version v0.1.0.
<!-- cargo-rdm... | unknown | github | https://github.com/nodejs/node | deps/crates/vendor/icu_locale_data/README.md |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Test client vfs."""
import os
import stat
import psutil
# pylint: disable=unused-import,g-bad-import-order
from grr.client import client_plugins
# pylint: enable=unused-import,g-bad-import-order
import logging
from grr.client import vfs
from grr.clie... | unknown | codeparrot/codeparrot-clean | ||
"""
WSGI config for test_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... | 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/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorCheckpointTaskTest.java |
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/phases/certs/renewal/main_test.go |
/*
* This file was generated by grafana-app-sdk. DO NOT EDIT.
*/
import { Spec } from './types.spec.gen';
import { Status } from './types.status.gen';
import { Custom } from './types.custom.gen';
export interface Metadata {
name: string;
namespace: string;
generateName?: string;
selfLink?: string;
... | typescript | github | https://github.com/grafana/grafana | apps/example/plugin/src/generated/example/v1alpha1/example_object_gen.ts |
# -*- coding: utf-8 -*-
"""
pygments.lexers._lasso_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Built-in Lasso types, traits, methods, and members.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
BUILTINS = {
'Types': (
'null'... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Example**
```esql
ROW deg = [90.0, 180.0, 270.0]
| EVAL rad = TO_RADIANS(deg)
```
| deg:double | rad:double |
| --- | --- |
| [90.0, 180.0, 270.0] | [1.5707963267948966, 3.141592653589793, 4.712388980... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/examples/to_radians.md |
#!/usr/bin/env python
from nose.tools import *
import networkx as nx
from test_graph import TestGraph
from test_digraph import TestDiGraph
from test_multigraph import TestMultiGraph
from test_multidigraph import TestMultiDiGraph
try: # python 2.7+
from collections import OrderedDict
except ImportError: # python 2... | unknown | codeparrot/codeparrot-clean | ||
import time
import timeit
import numpy as np
import torch
import torch._dynamo.config
# to satisfy linter complaining about undefined variable
foo = None
args = [f"x{i}" for i in range(100)]
fn_str = f"""\
def foo({", ".join(args)}):
n = {" + ".join(arg + ".shape[0]" for arg in args)}
return x0 + n
"""
exe... | python | github | https://github.com/pytorch/pytorch | benchmarks/dynamo/microbenchmarks/dynamo_guard_eval.py |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0005_make_filter_spec_unique'),
]
operations = [
migrations.AlterField(
... | unknown | codeparrot/codeparrot-clean | ||
"""distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
__revision__ = "$Id$"
import sys
import os
from distutils.errors import Di... | unknown | codeparrot/codeparrot-clean | ||
"""Chain that carries on a conversation from a prompt plus history.""" | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chains/conversation/__init__.py |
import { test } from '../../test';
export default test({
mode: ['client', 'hydrate'],
html: `
<p>Reactive: foo</p>
<p>Value: foo</p>
`
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/deconflict-value/_config.js |
# 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 annotations
DOCUMENTATION = """
inventory: statichost
broken:
short_description: Add a single host
description: Add a single host
extends_doc... | python | github | https://github.com/ansible/ansible | test/integration/targets/ansible-doc/broken-docs/collections/ansible_collections/testns/testcol/plugins/inventory/statichost.py |
# MLIR dialects
## Overview
To separate different hardware and software targets, MLIR has “dialects”,
including:
* TensorFlow IR, which represents all things possible in TensorFlow graphs.
* XLA HLO IR, which is designed to take advantage of XLA’s compilation
abilities (with output to, among other things, TPUs).
*... | unknown | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/g3doc/dialects.md |
//// [tests/cases/compiler/assignmentCompatWithOverloads.ts] ////
//// [assignmentCompatWithOverloads.ts]
function f1(x: string): number { return null; }
function f2(x: string): string { return null; }
function f3(x: number): number { return null; }
function f4(x: string): string;
function f4(x: number): number;
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/assignmentCompatWithOverloads.js |
#! /usr/bin/env python
"""RCS Proxy.
Provide a simplified interface on RCS files, locally or remotely.
The functionality is geared towards implementing some sort of
remote CVS like utility. It is modeled after the similar module
FSProxy.
The module defines two classes:
RCSProxyLocal -- used for local access
RCSPr... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from datetime import date, datetime
from decimal import Decimal
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_text
from django.utils.formats imp... | unknown | codeparrot/codeparrot-clean | ||
"""Provides the User class."""
from ..const import API_PATH
from .base import PRAWBase
from .listing.generator import ListingGenerator
from .reddit.redditor import Redditor
from .reddit.subreddit import Subreddit
class User(PRAWBase):
"""The user class provides methods for the currently authenticated user."""
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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.
#
# Most of this file was ported over from Blink's
# webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
#
import unittest
import json
... | unknown | codeparrot/codeparrot-clean | ||
manufacturer: Mercedes
models:
- model: A-Klasse
price: 32,000.00
- model: B-Klasse
price: 35,000.00 | unknown | github | https://github.com/jekyll/jekyll | test/fixtures/test-theme/_data/cars.yml |
# (c) Nelen & Schuurmans, see LICENSE.rst.
from io import IOBase
from qgis.core import QgsProject
import logging
import os
logger = logging.getLogger()
class ProjectStateMixin(object):
"""class mixin for writing and loading states of tools to the Qgis Project
files (``*.qgs``). Expects a class with:
- ... | 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/ha/ServiceFailedException.java |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import * as animations from '@angular/animations';
import * as animationsBrowser from '@angular/animations/browser';... | typescript | github | https://github.com/angular/angular | integration/typings_test_ts59/include-all.ts |
---
navigation_title: "Community ID"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/community-id-processor.html
---
# Community ID processor [community-id-processor]
Computes the Community ID for network flow data as defined in the [Community ID Specification](https://github.com/cor... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/enrich-processor/community-id-processor.md |
from collections import namedtuple
knapsack_item = namedtuple("knapsack_item", ["weight", "value"])
max_weight = 15
items = [
knapsack_item(weight=2, value=2),
knapsack_item(weight=1, value=2),
knapsack_item(weight=12, value=4),
knapsack_item(weight=1, value=1),
knapsack_item(weight=4, value=10),... | unknown | codeparrot/codeparrot-clean | ||
{
"filters": {
"response": {
"all": "Όλα",
"pending": "Σε εκκρεμότητα",
"received": "Εξετασμένα"
}
},
"requiredAction_one": "Απαιτούμενη Ενέργεια",
"requiredAction_other": "Απαιτούμενες Ενέργειες",
"requiredActionCount_one": "Απαιτούμενη Ενέργεια ({{count}})",
"requiredActionCount_... | json | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/locales/el/hitl.json |
# Copyright (C) 2012- Sebastian Spaeth & contributors
#
# 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.
#
# ... | unknown | codeparrot/codeparrot-clean | ||
//===- GenDiffFunc.cpp - Swift IR Generation For @differentiable Functions ===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2019 - 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/IRGen/GenDiffFunc.cpp |
# -*- coding: utf-8 -*-
"""
Tests the usecols functionality during parsing
for all of the parsers defined in parsers.py
"""
import pytest
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame, Index
from pandas._libs.lib import Timestamp
from pandas.compat import StringIO
class UsecolsTe... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Eduardo B <ms7rbeta@gmail.com>
# site: http://root404.com/eduardo
from data import Interface
from data import Core
from data import Files
def main():
"""Enviar y recibir archivos en red local mediante sockets.
Por el momento cuenta con lo ecesario para e... | unknown | codeparrot/codeparrot-clean | ||
"""
Utilities for end-users.
"""
from __future__ import absolute_import
import __main__
from collections import namedtuple
import re
import os
import sys
from jedi import Interpreter
from jedi.api.helpers import completion_parts
from jedi.parser.user_context import UserContext
def setup_readline(namespace_module=__m... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import sys, time
# sys.path.append('gen-py')
from ThriftSecureEventTransmissionService import ThriftSecureEventTransmissionService
from ThriftSecureEventTransmissionService.ttypes import *
from thrift import Thrift
from thrift.transport import TSSLSocket
from thrift.transport import TTransport
... | unknown | codeparrot/codeparrot-clean | ||
import kotlinx.coroutines.reactive.ContextInjector;
import kotlinx.coroutines.reactor.ReactorContextInjector;
module kotlinx.coroutines.reactor {
requires kotlin.stdlib;
requires kotlinx.coroutines.core;
requires kotlinx.coroutines.reactive;
requires org.reactivestreams;
requires reactor.core;
... | java | github | https://github.com/Kotlin/kotlinx.coroutines | reactive/kotlinx-coroutines-reactor/src/module-info.java |
import operator_benchmark as op_bench
import torch
add_configs = op_bench.cross_product_configs(
M=[8, 1], N=[8, 2], K=[8, 4], tags=["short"]
)
# This benchmark uses the auto_set to automatically set requires_grad
# for both inputs. The test name can also be used for filtering.
class AddBenchmark(op_bench.TorchB... | python | github | https://github.com/pytorch/pytorch | benchmarks/operator_benchmark/common/tests/pt_backward_test.py |
# challenge_1.py
#
# Copyright (C) 2014-2017 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# A chapter of the story
from linux_story.StepTemplate import StepTemplate
from linux_story.story.terminals.terminal_ls import TerminalLs
from linux_story.sound_manager import SoundManager
f... | unknown | codeparrot/codeparrot-clean | ||
#ifndef RYU_DIGIT_TABLE_H
#define RYU_DIGIT_TABLE_H
/*
* A table of all two-digit numbers. This is used to speed up decimal digit
* generation by copying pairs of digits into the final output.
*/
static const char DIGIT_TABLE[200] = {
'0', '0', '0', '1', '0', '2', '0', '3', '0', '4', '0', '5', '0', '6', '0', '7', ... | c | github | https://github.com/postgres/postgres | src/common/digit_table.h |
"""Callback handlers allow listening to events in LangChain."""
from typing import TYPE_CHECKING
from langchain_core._import_utils import import_attr
if TYPE_CHECKING:
from langchain_core.callbacks.base import (
AsyncCallbackHandler,
BaseCallbackHandler,
BaseCallbackManager,
Callb... | python | github | https://github.com/langchain-ai/langchain | libs/core/langchain_core/callbacks/__init__.py |
"""cases
Revision ID: 9474324542c6
Revises:
Create Date: 2017-06-08 09:02:37.384472
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9474324542c6'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Al... | unknown | codeparrot/codeparrot-clean | ||
from model_mommy.recipe import Recipe, seq
django_traceback = '''Traceback (most recent call last):
File "python2.7/site-packages/django/core/handlers/base.py", line 139, in get_response
response = response.render()
File "python2.7/site-packages/django/template/response.py", line 105, in render
self.conten... | 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 use ... | unknown | codeparrot/codeparrot-clean | ||
import inspect
import threading
import time
from datetime import datetime, timedelta
from unittest import mock
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import (
DEFAULT_DB_ALIAS,
DatabaseError,
connection,
connections,
models,
transaction,
)
... | python | github | https://github.com/django/django | tests/basic/tests.py |
/*
* 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/requests/AssignReplicasToDirsRequest.java |
lockfileVersion: '9.0'
settings:
autoInstallPeers: false
excludeLinksFromLockfile: false
overrides:
https-proxy-agent: 7.0.6
saucelabs: 9.0.2
packageExtensionsChecksum: sha256-3L73Fw32UVtE6x5BJxJPBtQtH/mgsr31grNpdhHP1IY=
pnpmfileChecksum: sha256-TYPFsbGgXlr65uhno3A1oHE+n2qqt8R+w/szQ+Wq97s=
importers:
.:... | unknown | github | https://github.com/angular/angular | pnpm-lock.yaml |
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/controlplane/controller/leaderelection/leasecandidategc_controller.go |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package vault
import (
"context"
"fmt"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/sdk/helper/consts"
"github.com/hashicorp/vault/sdk/helper/pluginutil"
"github.com/hashicorp/vault/sdk/logical"
)
var _ logical... | go | github | https://github.com/hashicorp/vault | vault/extended_system_view.go |
/*
* 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.fir.test.cases.generated.cases.components.typeCreator;
import com.i... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/typeCreator/FirIdeDependentAnalysisSourceModuleBuildArrayTypeTestGenerated.java |
import re
null_parameter = re.compile(",{2,}") # detect optional null parameter as two consecutive commas, and remove
converters = {
"str": str,
"int": int,
"float": float,
"bool": lambda x: bool(int(x)),
}
def to_string(value):
tval = type(value)
if tval is str:
return value
elif... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-04-04 04:04
from __future__ import unicode_literals
from django.db import migrations
import django.utils.timezone
import osf.utils.fields
class Migration(migrations.Migration):
dependencies = [
('osf', '0006_add_jsonb_index_for_fileversions'),
... | unknown | codeparrot/codeparrot-clean | ||
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"target": {
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dev_dashboards/datasource-loki/v1beta1.loki_fakedata.v42.json |
# -*- 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 terms... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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
import os
import unittest
import apt
import unattended_upgrade
apt.apt_pkg.config.set("APT::Architecture", "amd64")
class MockOptions(object):
debug = True
verbose = False
dry_run = True
apt_debug = False
minimal_upgrade_steps = False
class TestUntrusted(unittest.TestCase):
... | unknown | codeparrot/codeparrot-clean | ||
from django.forms import modelform_factory
from django.http import Http404
from django.shortcuts import redirect
from django.template import RequestContext
from django.template.response import TemplateResponse
from django.utils.timezone import now
from pyconcz_2016.proposals.config import proposals
def proposal_creat... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# called from wnf.py
# lib/wnf.py --install [rootpassword] [dbname] [source]
from __future__ import unicode_literals
import os, json
import frappe
import frappe.database
import getpass
from frappe.model.db_schema i... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (C) 2014-2015 Zeex
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | unknown | codeparrot/codeparrot-clean | ||
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
A script to analyze RNAi brood size assays.
author: David Angeles
contact: dangeles@caltech.edu
"""
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import seaborn as sns
input_path = '../input/rnai_screen_results/'
df = pd.read_csv(input_path + 'brood_ass... | unknown | codeparrot/codeparrot-clean | ||
import {browser, element, by, protractor, ElementFinder, ElementArrayFinder} from 'protractor';
// THESE TESTS ARE INCOMPLETE
describe('Form Validation Tests', () => {
beforeAll(() => browser.get(''));
describe('Template-driven form', () => {
beforeAll(() => {
getPage('app-actor-form-template');
});... | typescript | github | https://github.com/angular/angular | adev/src/content/examples/form-validation/e2e/src/app.e2e-spec.ts |
/*
* 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/util/concurrent/ForwardingObjectTester.java |
# coding=utf-8
from django.contrib.auth.models import User
from django.test import TestCase
from events.models import Survey
class ExportSurveyResultsAsExcelTests(TestCase):
def setUp(self):
self.user1 = User.objects.create_user(
username='testuser1',
email='test1@example.com',
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019 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 runtime
import "unsafe"
type sigctxt struct {
info *siginfo
ctxt unsafe.Pointer
}
//go:nosplit
//go:nowritebarrierrec
func (c *sigctxt) regs() *mco... | go | github | https://github.com/golang/go | src/runtime/signal_netbsd_arm64.go |
#
# 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 | ||
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.unittest import tab_test_case
class InspectorRuntimeTest(tab_test_case.... | unknown | codeparrot/codeparrot-clean | ||
# (c) 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) any lat... | 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/portmap/package-info.java |
/*
* 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... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/web/webmvc/mvcconfig/mvcconfigviewcontroller/WebConfiguration.kt |
from __future__ import unicode_literals
from frappe import _
from frappe.desk.moduleview import add_setup_section
def get_data():
data = [
{
"label": _("Settings"),
"icon": "icon-wrench",
"items": [
{
"type": "doctype",
"name": "Global Defaults",
"label": _("Global Settings"),
"desc... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski (@zikalino)
#
# 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',
's... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2006 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 agreed ... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/util/concurrent/FluentFuture.java |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import oscar.core.validators
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0001_initial'),
migrations... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) Seth Edwards, 2014
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from urllib3.connectionpool import (
connection_from_url,
HTTPConnection,
HTTPConnectionPool,
)
from urllib3.util.timeout import Timeout
from urllib3.packages.ssl_match_hostname import CertificateError
from urllib3.exceptions import (
ClosedPoolError,
EmptyPoolError,
HostChanged... | 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.stubbing.defaultanswers;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.mockitoutil.TestBase;
... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockito/internal/stubbing/defaultanswers/ReturnsMoreEmptyValuesTest.java |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | docs/examples/postit2.c |
from __future__ import absolute_import
from __future__ import print_function
import os, sys, re
import glob
import tempfile
import shutil
import subprocess
import logging, logging.handlers
import datetime
from lmatools.flashsort.flash_stats import calculate_flash_stats, Flash, FlashMetadata
from lmatools.io.LMAarrayFi... | unknown | codeparrot/codeparrot-clean | ||
import argparse
import json
import os
import time
import zipfile
from get_ci_error_statistics import download_artifact, get_artifacts_links
from transformers import logging
logger = logging.get_logger(__name__)
def extract_warnings_from_single_artifact(artifact_path, targets):
"""Extract warnings from a downloa... | python | github | https://github.com/huggingface/transformers | utils/extract_warnings.py |
'use client'
export default function App() {
async function fn() {
'use server'
}
return <div>App</div>
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/input.js |
// Copyright 2021 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 runtime_test
import (
"testing"
)
func TestIssue48807(t *testing.T) {
for _, i := range []uint64{
0x8234508000000001, // from issue48807
1<<56 +... | go | github | https://github.com/golang/go | src/runtime/float_test.go |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | unknown | codeparrot/codeparrot-clean | ||
["os"] | json | github | https://github.com/tauri-apps/tauri | crates/tests/acl/fixtures/capabilities/platform-specific-permissions/required-plugins.json |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, 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/LICE... | unknown | codeparrot/codeparrot-clean | ||
//===--- NSErrorTest.swift ------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | swift | github | https://github.com/apple/swift | benchmark/single-source/NSErrorTest.swift |
import Alert from "./alert";
import Footer from "./footer";
import Meta from "./meta";
type Props = {
preview?: boolean;
children: React.ReactNode;
};
export default function Layout({ preview, children }: Props) {
return (
<>
<Meta />
<div className="min-h-screen">
<Alert preview={previe... | typescript | github | https://github.com/vercel/next.js | examples/cms-enterspeed/components/layout.tsx |
import numpy as np
import pytest
from sklearn.utils._weight_vector import (
WeightVector32,
WeightVector64,
)
@pytest.mark.parametrize(
"dtype, WeightVector",
[
(np.float32, WeightVector32),
(np.float64, WeightVector64),
],
)
def test_type_invariance(dtype, WeightVector):
"""Ch... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/utils/tests/test_weight_vector.py |
#### Note: this error code is no longer emitted by the compiler.
You cannot define a struct (or enum) `Foo` that requires an instance of `Foo`
in order to make a new `Foo` value. This is because there would be no way a
first instance of `Foo` could be made to initialize another instance!
Here's an example of a struct... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0073.md |
#!/usr/bin/env python
#
# Copyright 2013, Couchbase, 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 r... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for built in Function expressions.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=50)
alias = models.CharField(max_lengt... | unknown | codeparrot/codeparrot-clean | ||
#
# tests/utils
#
"""
Useful functions for all tests
"""
import asyncio
import pytest
from growler.aio.http_protocol import GrowlerHTTPProtocol
import growler
def random_port():
from random import randint
return randint(1024, 2**16)
@asyncio.coroutine
def setup_test_server(unused_tcp_port, event_loop):
"... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright (C) 2016 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
import socket
from testrunner import run
IEEE802154_FRAME... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# These methods are used by test.py and waf to look for and read the
# .ns3rc configuration file, which is used to specify the modules that
# should be enabled
import os
import sys
def get_list_from_file(file_path, list_name):
'''Looks for a Python list called list_name in the file specifi... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <ATen/native/DispatchStub.h>
#include <ATen/native/Gelu.h>
#include <c10/util/Exception.h>
namespace c10 {
class Scalar;
}
namespace at {
struct TensorIterator;
struct TensorIteratorBase;
class TensorBase;
}
namespace at::native {
using structured_activation_fn = void (*)(TensorIteratorBase&)... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/Activation.h |
from django.db import connection, models
class CurrentTranslation(models.ForeignObject):
"""
Creates virtual relation to the translation with model cache enabled.
"""
# Avoid validation
requires_unique_target = False
def __init__(self, to, from_fields, to_fields, **kwargs):
# Disable r... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.