code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# frozen_string_literal: true
module ActiveRecord
# = Active Record \RecordInvalid
#
# Raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and
# {ActiveRecord::Base#create!}[rdoc-ref:Persistence::ClassMethods#create!] when the record is invalid.
# Use the #record method to retrieve the record wh... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/validations.rb |
/* adler32_simd.c
*
* Copyright 2017 The Chromium Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the Chromium source repository LICENSE file.
*
* Per http://en.wikipedia.org/wiki/Adler-32 the adler32 A value (aka s1) is
* the sum of N input data bytes D1 ... DN,
*
*... | c | github | https://github.com/nodejs/node | deps/zlib/adler32_simd.c |
# coding: utf-8
import filecmp
import os
from corehq.apps.app_manager.management.commands.build_app_manager_v2_diffs import (
get_diff_filename,
get_diff,
)
from django.test import SimpleTestCase
RELATIVE_DIFF_STORAGE_YAML = 'data/v2_diffs/yaml'
RELATIVE_YAML_V1 = '../static/app_manager/json/v1'
RELATIVE_YAML... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
// @target="18"
function Component() {
return <div>Hello world</div>;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [],
isComponent: true,
};
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime"; // @target="18"
function Component() {
const $ ... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/target-flag.expect.md |
# Copyright (c) 2013 eBay Inc.
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | unknown | codeparrot/codeparrot-clean | ||
from flask.ext.wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import Required, Length, Email, Regexp, EqualTo
from wtforms import ValidationError
from ..models import User
class LoginForm(Form):
email = StringField('Email', validators=[Required(), Len... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_country_to_online_events(apps, schema_editor):
"""Add an 'Online' country to all events tagged with 'online' tag."""
Event = apps.get_model('workshops', 'Event')
Tag = apps.get_model('workshop... | unknown | codeparrot/codeparrot-clean | ||
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: latin-1; py-indent-offset:4 -*-
################################################################################
#
# This file is part of HttxLib
#
# HttxLib is an HTTP(s) Python library suited multithreaded/multidomain
# applications
#
# Copyright (C) 2010-2011 Daniel Rodriguez (ak... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain th... | 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.
"""Provides a variety of device interactions based on adb.
Eventually, this will be based on adb_wrapper.
"""
# pylint: disable=unused-argument
import coll... | unknown | codeparrot/codeparrot-clean | ||
#ifndef PROGRESS_H
#define PROGRESS_H
#include "gettext.h"
struct progress;
struct repository;
#ifdef GIT_TEST_PROGRESS_ONLY
extern int progress_testing;
extern uint64_t progress_test_ns;
void progress_test_force_update(void);
#endif
void display_throughput(struct progress *progress, uint64_t total);
void display_... | c | github | https://github.com/git/git | progress.h |
# 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 | ||
# Copyright (c) 2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condit... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 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 | client/pkg/types/urls_test.go |
"""List subnets."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
@click.command()
@click.option('--sortby',
help='Column to sort by',
type=click.Choice(['... | unknown | codeparrot/codeparrot-clean | ||
//===--- IncludeCleaner.cpp - Unused/Missing Headers Analysis ---*- C++ -*-===//
//
// 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/clangd/IncludeCleaner.cpp |
# pylint: skip-file
import sys
sys.path.insert(0, "../../python/")
from data import mnist_iterator
import mxnet as mx
import numpy as np
import logging
import time
logging.basicConfig(level=logging.DEBUG)
def build_network():
data = mx.symbol.Variable('data')
fc1 = mx.symbol.FullyConnected(data = data, name='... | 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 | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | unknown | codeparrot/codeparrot-clean | ||
from pandas import (
Index,
Series,
)
import pandas._testing as tm
def test_astype_str_from_bytes():
# https://github.com/pandas-dev/pandas/issues/38607
# GH#49658 pre-2.0 Index called .values.astype(str) here, which effectively
# did a .decode() on the bytes object. In 2.0 we go through
# e... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/indexes/string/test_astype.py |
# -*- coding: utf-8 -*-
from . import BASE_DIR
import os
# TODO: if you want to choose another directory, change LOG_DIR path.
LOG_DIR = BASE_DIR + '/log/'
if os.path.exists(LOG_DIR) is False:
os.mkdir(LOG_DIR)
APP_KEY = 'app'
INBOUND_KEY = 'inbound'
OUTBOUND_KEY = 'outbound'
EPISODE_RESULT_KEY = 'episode_result... | unknown | codeparrot/codeparrot-clean | ||
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_modsupport.h" // _PyArg_B... | c | github | https://github.com/python/cpython | Modules/clinic/_lzmamodule.c.h |
# Copyright 2018 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 __future__ import unicode_literals
from . import Tags, Warning, register
@register(Tags.urls)
def check_url_config(app_configs, **kwargs):
from django.core.urlresolvers import get_resolver
resolver = get_resolver()
return check_resolver(resolver)
def check_resolver(resolver):
"""
Recursively... | unknown | codeparrot/codeparrot-clean | ||
{
"format_version": "1.0",
"applyable": true,
"complete": true,
"planned_values": {
"root_module": {
"child_modules": [
{
"address": "module.my_module",
"child_modules": [
{
"resources": [
{
"address": "module.my_m... | json | github | https://github.com/hashicorp/terraform | internal/command/testdata/show-json/nested-modules/output.json |
# python imports
import uuid
# django imports
from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
# lfs imports
impor... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/batching_util/basic_batch_scheduler.h |
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Connection;
use Illuminate\Database\Schema\Grammars\MySqlGrammar;
use Illuminate\Database\Schema\MySqlBuilder;
use Mockery as m;
use PHPUnit\Framework\TestCase;
class DatabaseMySqlBuilderTest extends TestCase
{
public function testCreateDatabase(... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseMySqlBuilderTest.php |
h = {}
syms = ('a'..'z').map { |s| s.to_sym }
syms.each { |s| h[s] = 1 }
200_000.times { syms.each { |s| h[s] } } | ruby | github | https://github.com/ruby/ruby | benchmark/hash_aref_dsym.rb |
#!/usr/bin/env python
from math import sqrt
animals = ['cat', 'dog', 'monkey']
for animal in animals:
print animal
# for List
nums = [0, 1, 2, 3, 4]
square = []
for num in nums:
square.append( num ** 2 )
print square
## learn this type of assignment in the [ ]
even_squares = [ num ** 2 for num in nums if num % 2 =... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2011, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010-2011, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modificatio... | unknown | codeparrot/codeparrot-clean | ||
#
# Implements encrypting functions.
#
# Copyright (c) 2008, F S 3 Consulting Inc.
#
# Maintainer:
# Alec Joseph Rivera (agi<at>fs3.ph)
# refactored by Antony Lesuisse <al<at>openerp.com>
#
import hashlib
import hmac
import logging
from random import sample
from string import ascii_letters, digits
import openerp
from... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Interface for user defined mapper."""
from . import shard_life_cycle
# pylint: disable=invalid-name
# pylint: disable=protected-access
# TODO(user): Move common APIs to parent class.
class Mapper(shard_life_cycle._ShardLifeCycle):
"""Interface user's mapper should implement.
Each shard i... | unknown | codeparrot/codeparrot-clean | ||
from boto.compat import json
from tests.compat import mock, unittest
from tests.unit.cloudsearch2.test_search import HOSTNAME, \
CloudSearchSearchBaseTest
from boto.cloudsearch2.search import SearchConnection, SearchServiceException
def fake_loads_value_error(content, *... | unknown | codeparrot/codeparrot-clean | ||
/* This files contains various key structs that are widely used
* and do not depend on other headers. */
#ifndef Py_INTERNAL_STRUCTS_H
#define Py_INTERNAL_STRUCTS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h> // uint16_t
typedef struct {
uint16_t value_and_backoff;
} _Py_BackoffCounter;
/* ... | c | github | https://github.com/python/cpython | Include/internal/pycore_structs.h |
#
# 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 | ||
#!/usr/bin/python
import pylab as p
import numpy as N
import glob
import os
import sys
import re
import pdb
def loadResultOfOneRun(basename="test"):
""" Returns an dictionary of before/after/diff """
results={}
results["diff"] = N.loadtxt(basename + 'diff.csv', delimiter=",")
results["after"] = N.load... | unknown | codeparrot/codeparrot-clean | ||
""" monkeypatching and mocking functionality. """
import os, sys
from py.builtin import _basestring
def pytest_funcarg__monkeypatch(request):
"""The returned ``monkeypatch`` funcarg provides these
helper methods to modify objects, dictionaries or os.environ::
monkeypatch.setattr(obj, name, value, ra... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
sphinx.websupport.storage.sqlalchemy_db
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQLAlchemy table and mapper definitions used by the
:class:`sphinx.websupport.storage.sqlalchemystorage.SQLAlchemyStorage`.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const _ = require('lodash');
const async = require('async');
const path = require('path');
const file = require('../common/file');
const util = require('../common/util');
const basePath = path.join(__dirname, '..', '..');
const distPath = path.join(basePath, 'dist');
const filePairs = [
[path.join(d... | javascript | github | https://github.com/lodash/lodash | lib/main/build-modules.js |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import textwrap
def _create_test_package_submodule(env):
env.scratch_path.join("version_pkg_submodule").mkdir()
submodule_path = env.scratch_path / 'version_pkg_submodule'
env.run('touch', 'testfile', cwd=submodule_path)
env.run('git', 'init', cwd=submodule_path)... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Roku."""
import logging
from roku import Roku, RokuException
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_ROKU
from homeassistant.const import CONF_HOST
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
_LOGGER = logging... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# theano documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 7 16:34:06 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 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 by applicable law or agreed t... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsNetworkContentFetcher
.. note:: 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 versio... | unknown | codeparrot/codeparrot-clean | ||
{
"variable": {
"foo": {},
"bar": {
"default": "hello"
},
"baz": {
"type": "list"
},
"bar-baz": {
"default": [],
"type": "list"
},
"cheese_pizza": {
"description": "Nothing special"
},
"π": {
"default": 3.14159265359
},
"sensitive_val... | json | github | https://github.com/hashicorp/terraform | internal/configs/testdata/valid-files/variables.tf.json |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\SecuredPageBundle;... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/SecuredPageBundle/SecuredPageBundle.php |
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class KeySearchMobilePage(page_module... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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.
"""Build the NOTICE file distributed with the NaCl SDK from a set of given
license files."""
import argparse
import os
import sys
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# This example demonstrates the reading of a field and conversion to PolyData
# The output should be the same as polyEx.tcl.
# Create a reader and write out the field
reade... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.webrtc.media
import io.ktor.utils.io.InternalAPI
import kotlinx.cinterop.ExperimentalForeignApi
@InternalAPI
@OptIn(ExperimentalForeignApi::class)
public actual fun de... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-webrtc/iosSimulatorArm64/src/io/ktor/client/webrtc/media/MediaDevices.iosSimulatorArm64.kt |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
from outsourcer import Code
from . import utils
from .base import Expression
from .constants import POS, RESULT, STATUS, TEXT
class Str(Expression):
is_commented = False
def __init__(self, value):
if not isinstance(value, (bytes, str)):
raise TypeError(f'Expected bytes or str. Received: {... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
html: '<span title=\'"foo"\'>foo</span>'
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/attribute-dynamic-quotemarks/_config.js |
from django import template
from DUlSine.models.DPS import Dimensionnement
from DUlSine.models.team import Inscription, Wish
from DUlSine.models.dulsine_commons import DIPLOME_CI, DIPLOME_PSC1, WISH_ND
register = template.Library()
@register.simple_tag
def badge(dim_id, function_id):
function_id = int(function_i... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2020 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 b... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/lite/experimental/tac/execution_metadata_exporter.h |
# coding: utf-8
"""
VariableApi.py
Copyright 2015 SmartBear Software
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 | ||
{
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@types/node": "18.11.18",
"@types/react": "18.2.8",
"@types/react-dom": "18.0.10",
"@kontent-ai/delivery-sdk": "^12.4.2",
"classnames": "2.3.1",
"date-fns": "2.28... | json | github | https://github.com/vercel/next.js | examples/cms-kontent-ai/package.json |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
from frappe.model.document import Document
class CForm(Document):
def validate(self):
... | unknown | codeparrot/codeparrot-clean | ||
function hoisting(cond) {
let items = [];
if (cond) {
let foo = () => {
items.push(bar());
};
let bar = () => true;
foo();
}
return items;
}
export const FIXTURE_ENTRYPOINT = {
fn: hoisting,
params: [true],
isComponent: false,
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-nested-let-declaration-2.js |
package kotlinx.coroutines.selects
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlin.test.*
class SelectOldTest : TestBase() {
@Test
fun testSelectCompleted() = runTest {
expect(1)
launch { // makes sure we don't yield to it earlier
finish(4) // after ma... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/selects/SelectOldTest.kt |
# 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 | ||
#!/usr/bin/env python
import os
import numpy as np
from ase.data import chemical_symbols
import matplotlib.pyplot as plt
from abipy.abilab import abiopen
from pyDFTutils.perovskite.perovskite_mode import label_zone_boundary, label_Gamma
from ase.units import Ha
from spglib import spglib
def displacement_cart_to_evec(d... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
__author__ = "Dmitry Zhiltsov"
__copyright__ = "Copyright 2015, Dmitry Zhiltsov"
from django.contrib.auth import logout, decorators
from django.http import HttpResponseRedirect
from django.views.generic import TemplateView, RedirectView, CreateView, DetailView, UpdateView, ListView
from guest_book.defs... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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': ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
from .NVD3Chart import NVD... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding:utf8 -*-
# File : kv.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 3/30/17
#
# This file is part of TensorArtist.
from .base import SimpleDataFlowBase
from .rng import RandomizedDataFlowBase
__all__ = ['KVStoreDataFlow', 'KVStoreRandomSampleDataFlow']
class KVStoreDataFlow(Simpl... | unknown | codeparrot/codeparrot-clean | ||
# HMAC.py - Implements the HMAC algorithm as described by RFC 2104.
#
# ===================================================================
# Portions Copyright (c) 2001, 2002, 2003 Python Software Foundation;
# All Rights Reserved
#
# This file contains code from the Python 2.2 hmac.py module (the
# "Original Code"), ... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/types.hpp |
// #docregion
import {Injectable} from '@angular/core';
import {DropdownQuestion} from './question-dropdown';
import {QuestionBase} from './question-base';
import {TextboxQuestion} from './question-textbox';
import {of} from 'rxjs';
@Injectable()
export class QuestionService {
// TODO: get from a remote source of q... | typescript | github | https://github.com/angular/angular | adev/src/content/examples/dynamic-form/src/app/question.service.ts |
<?php
namespace Illuminate\Queue\Console;
use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Contracts\Queue\ClearableQueue;
use Illuminate\Support\Str;
use ReflectionClass;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use S... | php | github | https://github.com/laravel/framework | src/Illuminate/Queue/Console/ClearCommand.php |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# coding: utf-8
# (c) 2018, Jan Christian Grünhage <jan.christian@gruenhage.xyz>
# 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 | ||
## Input
```javascript
function foo(a, b, c) {
const x = {...a};
x[b] = c[b];
x[1 + 2] = c[b * 4];
}
export const FIXTURE_ENTRYPOINT = {
fn: foo,
params: ['TodoAdd'],
isComponent: 'TodoAdd',
};
```
## Code
```javascript
function foo(a, b, c) {
const x = { ...a };
x[b] = c[b];
x[3] = c[b * 4];
}
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-computed-access-assignment.expect.md |
import os
import sys
import json
import base64
import sqlalchemy.orm.exc
from flask import Blueprint, request, make_response
from functools import wraps, partial
import rfk
import rfk.database
from rfk.database import session
from rfk.database.base import User, Loop
from rfk.database.show import Show, Tag, UserShow
f... | unknown | codeparrot/codeparrot-clean | ||
<docs-decorative-header title="Angular Routing" imgSrc="adev/src/assets/images/routing.svg"> <!-- markdownlint-disable-line -->
Routing helps you change what the user sees in a single-page app.
</docs-decorative-header>
Angular Router (`@angular/router`) is the official library for managing navigation in Angular appli... | unknown | github | https://github.com/angular/angular | adev/src/content/guide/routing/overview.md |
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package ktorbuild.targets
import com.gradle.develocity.agent.gradle.test.DevelocityTestConfiguration
import com.gradle.develocity.agent.gradle.test.TestRetryConfiguration
import ktorbuild.int... | kotlin | github | https://github.com/ktorio/ktor | build-logic/src/main/kotlin/ktorbuild/targets/CiConfig.kt |
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class product_template(osv.osv):
_inherit = 'product.template'
_columns = {
'event_ok': fields.boolean('Event Subscription', help='Determine if a product needs to create automatically an event registration at the confirmation of a sales order... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from collections import Counter
import datetime
import inspect
import json
import re
import time
import frappe
import sqlparse
from frappe import _
RECOR... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
from .utils.theano_utils import shared_zeros, shared_scalar
from six.moves import zip
def clip_norm(g, c, n):
if c > 0:
g = T.switch(T.ge(n, c), g*c/n, g)
return g
def kl_divergence(p, p_hat):
return... | 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 u... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import reuters
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.normalization import BatchNormaliz... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2013 Alessio Ababilov
# Copyright 2013 Grid Dynamics
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you ... | unknown | codeparrot/codeparrot-clean | ||
//go:build freebsd
/*
Copyright 2020 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 ag... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/util/boottime_util_freebsd.go |
from zerver.lib.test_classes import WebhookTestCase
class PivotalV3HookTests(WebhookTestCase):
STREAM_NAME = "pivotal"
URL_TEMPLATE = "/api/v1/external/pivotal?stream={stream}&api_key={api_key}"
def test_accepted(self) -> None:
expected_topic = "My new Feature story"
expected_message = 'Le... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import json
from collections import namedtuple
from powerdnsadmin.lib.validators import validate_apikey
from powerdnsadmin.lib.schema import ApiKeySchema
from tests.fixtures import client, initial_data, basic_auth_admin_headers
from tests.fixtures import user_apikey_data, admin_apikey_data, zone_data
cl... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from numpy.random import RandomState
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from sx.pisa3.pisa_util import *
_datauri = """data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAACJBAMAAABjvlPWAAAAMFBMVEUAAAAKBgQYFA8tJh5MQjZ3
YEWPgHGynIK+oXvHsJbRvanZ0Mbv6+b48+//+/f///9agwt8AAAM7UlEQVR4XnWXXWwbV3bHZ+Jg
gb7NJUdy06dQEmW3AYrQIilFAQKP+CGLSRcQxSEpKTVg8UO0sjVgU7JsuTWQSKQuuS91JEsz46KA
VxL... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2020 The SQLFlow 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 o... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/convert/Delimiter.java |
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
@file:Suppress("FunctionName")
package io.ktor.network.util
import io.ktor.utils.io.bits.*
import io.ktor.utils.io.errors.*
import kotlinx.cinterop.*
import platform.posix.*
import kotlin.ex... | kotlin | github | https://github.com/ktorio/ktor | ktor-network/posix/src/io/ktor/network/util/SocketUtils.kt |
#!/usr/bin/env python
from paddle.trainer_config_helpers import *
height = 32
width = 32
num_class = 10
batch_size = get_config_arg('batch_size', int, 128)
args = {'height': height, 'width': width, 'color': True, 'num_class': num_class}
define_py_data_sources2(
"train.list", None, module="provider", obj="proces... | 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 applica... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/examples/custom_ops_doc/multiplex_4/multiplex_4_test.py |
import socket
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "Sends a test email to the email addresses specified as arguments."
missing_args_message = "You must specify... | unknown | codeparrot/codeparrot-clean | ||
---
am_i_convertible: yes
permalink: /slides/example-slide-7.php
---
Am I convertible? {{ page.am_i_convertible }} | unknown | github | https://github.com/jekyll/jekyll | test/source/_slides/example-slide-7.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.