code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from django.db import models from datetime import datetime from osf.utils.storage import BannerImageStorage from osf.exceptions import ValidationValueError from osf.utils.fields import NonNaiveDateTimeField def validate_banner_dates(banner_id, start_date, end_date): if start_date > end_date: raise Valida...
unknown
codeparrot/codeparrot-clean
function Component(props) { eval('props.x = true'); return <div />; }
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-eval-unsupported.js
/* * 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
buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/TarGzipBuildpack.java
// @enableNameAnonymousFunctions import {Stringify} from 'shared-runtime'; function Component(props) { const onClick = () => { console.log('hello!'); }; return <div onClick={onClick} />; } export const FIXTURE_ENTRYPOINT = { fn: Component, params: [{value: 42}], };
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/name-anonymous-functions-outline.js
''' @author: Deniz Altinbuken, Emin Gun Sirer @note: The Replica keeps an object and responds to Perform messages received from the Leader. @copyright: See LICENSE ''' import inspect import time import os, sys import signal import sysv_ipc import struct import cPickle as pickle from threading import Thread, Lock, Timer...
unknown
codeparrot/codeparrot-clean
use rustc_index::IndexVec; use rustc_middle::mir::visit::{PlaceContext, Visitor}; use rustc_middle::mir::{Body, Local, Location}; use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex}; use crate::def_use::{self, DefUse}; /// A map that cross references each local with the locations where it /// is defined (a...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs
#!/usr/bin/env python # # Copyright 2013 Google Inc. 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...
unknown
codeparrot/codeparrot-clean
''' Created on Aug 5, 2011 @author: sean ''' from __future__ import print_function import unittest import ast from graphlab.meta.asttools.visitors.symbol_visitor import get_symbols class Test(unittest.TestCase): def assertHasSymbols(self, codestring, expected_symbols, ctxts=(ast.Load, ast.Store)): root ...
unknown
codeparrot/codeparrot-clean
"""smarttools URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitsend Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly)...
unknown
codeparrot/codeparrot-clean
from collections import deque import unittest from test import test_support, seq_tests import gc import weakref import copy import cPickle as pickle import random import struct BIG = 100000 def fail(): raise SyntaxError yield 1 class BadCmp: def __eq__(self, other): raise RuntimeError class Muta...
unknown
codeparrot/codeparrot-clean
# 7.1 PyFEHM tutorial 1 # Cube with fixed pressures/temperatures # 7.1.1 Getting started #import os,sys #sys.path.append('c:\\python\\pyfehm') from fdata import* from fpost import* root = 'tut1' dat = fdata() # creates an 'empty' input file # 7.1.2 Grid generation x = np.linspace(0,10,11) dat.grid.make(root+'_...
unknown
codeparrot/codeparrot-clean
# Copyright 2014-2019 M. A. Zentile, J. Keaveney, L. Weller, D. Whiting, # C. S. Adams and I. G. Hughes. # 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/L...
unknown
codeparrot/codeparrot-clean
import warnings from functools import wraps import mock def dataProvider(fn_data_provider): """ Data provider decorator, allows another callable to provide the data for the test. This is a nice feature from PHPUnit which is very useful. Am sticking with the JUnit style naming as unittest does this a...
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 us...
unknown
github
https://github.com/apache/airflow
INTHEWILD.md
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if thread...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 import unittest from test import support import errno import io import socket import select import time import traceback import queue import sys import os import array import platform import contextlib from weakref import proxy import signal import math try: import fcntl except ImportError:...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from collections import OrderedDict from ..en import Provider as AddressProvider class Provider(AddressProvider): city_prefixes = ('North', 'East', 'West', 'South', 'New', 'Lake', 'Port') city_suffixes = ( 'town', 'ton', 'land', 'ville', 'berg', 'burgh', 'boroug...
unknown
codeparrot/codeparrot-clean
""" This module contains useful utilities for GeoDjango. """ from django.contrib.gis.utils.layermapping import LayerMapError, LayerMapping from django.contrib.gis.utils.ogrinfo import ogrinfo from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect from django.contrib.gis.utils.srs import add_srs_entry __a...
python
github
https://github.com/django/django
django/contrib/gis/utils/__init__.py
# 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. import imp import os.path import sys import unittest def _GetDirAbove(dirname): """Returns the directory "above" this file containing |dirname| (which mus...
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
buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/ImagePlatform.java
//===--- SmallBitVector.cpp -----------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2022 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/Basic/SmallBitVector.cpp
# -*- coding: utf-8 -*- from __future__ import unicode_literals import errno import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation, Suspicio...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Ansible module to manage Big Monitoring Fabric service chains # (c) 2016, Ted Elhourani <ted@bigswitch.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 __metacl...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 OpenStack Foundation. # 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 req...
unknown
codeparrot/codeparrot-clean
# Grouping data Group discrete values. ## group(*iterable*, ...*keys*) {#group} [Examples](https://observablehq.com/@d3/d3-group-d3-rollup) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js) · Groups the specified *iterable* of values into an [InternMap](./intern.md#InternMap) from *key* to array of v...
unknown
github
https://github.com/d3/d3
docs/d3-array/group.md
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Evan Kaufman <evan@digitalflophouse.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 t...
unknown
codeparrot/codeparrot-clean
//////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/li...
c
github
https://github.com/realm/realm-swift
Realm/ObjectServerTests/RLMSyncTestCase.h
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package terraform import ( "fmt" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/lang" "github.com/hashicorp/terraform/internal/tfdiags"...
go
github
https://github.com/hashicorp/terraform
internal/terraform/evaluate_placeholder.go
{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations \u0026 Alerts", "type": "dashb...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/testdata/output/latest_version/v10.table_thresholds.v42.json
# -*- coding: utf-8 -*- from __future__ import unicode_literals class PaymentProvider(object): """ Base class for all Payment Service Providers. """ @property def namespace(self): """ Use a unique namespace for this payment provider. It is used to build the communication URLs ...
unknown
codeparrot/codeparrot-clean
//! The `rustc_ast_passes` crate contains passes which validate the AST in `syntax` //! parsed by `rustc_parse` and then lowered, after the passes in this crate, //! by `rustc_ast_lowering`. // tidy-alphabetical-start #![feature(box_patterns)] #![feature(if_let_guard)] #![feature(iter_intersperse)] #![feature(iter_is_...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_ast_passes/src/lib.rs
#! /usr/bin/python # -*- coding: utf-8 -*- ## Copyright (C) 2014 Bitergia ## ## 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 3 of the License, or ## (at your option) any later...
unknown
codeparrot/codeparrot-clean
""" Content Library Transformer. """ import json from courseware.models import StudentModule from openedx.core.lib.block_cache.transformer import BlockStructureTransformer from xmodule.library_content_module import LibraryContentModule from xmodule.modulestore.django import modulestore from eventtracking import tracker...
unknown
codeparrot/codeparrot-clean
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_array_almost_equal from scipy.sparse.csgraph import breadth_first_tree, depth_first_tree,\ csgraph_to_dense, csgraph_from_dense def test_graph_breadth_first(): csgraph = np.array([[0, 1, 2, 0, ...
unknown
codeparrot/codeparrot-clean
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.cpp
/** * 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...
c
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/erasurecode/erasure_coder.h
# frozen_string_literal: true module ActiveRecord class TableMetadata # :nodoc: def initialize(klass, arel_table) @klass = klass @arel_table = arel_table end def primary_key klass&.primary_key end def type(column_name) arel_table.type_for_attribute(column_name) end ...
ruby
github
https://github.com/rails/rails
activerecord/lib/active_record/table_metadata.rb
// mkerrors.sh -marm // Code generated by the command above; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -marm _const.go package syscall const ( AF_APPLETALK = 0x10 AF_ARP = 0x1c AF_BLUETOOTH = 0x1f AF_CCIT...
go
github
https://github.com/golang/go
src/syscall/zerrors_netbsd_arm.go
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function from __future__ import division from six.moves import xrange import time import tensorflow as tf from lib.datasets import PascalVOC as Data from lib.model import Model as BaseModel from lib.layer import ImageAugment, Conv2d, Fire, MaxPool, AveragePool DATA_DIR = 'data/pascal_vo...
unknown
codeparrot/codeparrot-clean
# -*- coding:utf-8 mode:python; tab-width:4; indent-tabs-mode:nil; py-indent-offset:4 -*- import hashlib import uuid import cpinterface import geoprep import sharedutilities class Mopac7Job(cpinterface.Job): def __init__(self, *args, **kw): super(Mopac7Job, self).__init__(*args, **kw) self.backend...
unknown
codeparrot/codeparrot-clean
# Copyright 2022 The HuggingFace Team and The HuggingFace Inc. 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 # ...
python
github
https://github.com/huggingface/transformers
src/transformers/models/decision_transformer/configuration_decision_transformer.py
//// [tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts] //// //// [classAndInterfaceWithSameName.ts] class C { foo: string; } interface C { foo: string; } namespace M { class D { bar: string; } interface D { bar: string; } } //// [classAndInterfaceWi...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/classAndInterfaceWithSameName.js
## Input ```javascript // @compilationMode:"infer" function Component(props) { return <div />; } ``` ## Code ```javascript import { c as _c } from "react/compiler-runtime"; // @compilationMode:"infer" function Component(props) { const $ = _c(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) ...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-component-with-jsx.expect.md
from __future__ import unicode_literals from moto.core.responses import BaseResponse from moto.core.utils import camelcase_to_underscores from moto.ec2.utils import filters_from_querystring, vpc_ids_from_querystring class VPCs(BaseResponse): def create_vpc(self): cidr_block = self.querystring.get('CidrBlo...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/async/es6/asyncEnum_es6.ts] //// //// [asyncEnum_es6.ts] async enum E { Value } //// [asyncEnum_es6.js] "use strict"; var E; (function (E) { E[E["Value"] = 0] = "Value"; })(E || (E = {}));
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/asyncEnum_es6.js
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.0 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
unknown
codeparrot/codeparrot-clean
#include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/hook.h" #include "jemalloc/internal/atomic.h" #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/seq.h" typedef struct hooks_internal_s hooks_internal_t; struct hooks_internal_s { hooks_t hooks; bool in_use; }; seq_define(h...
c
github
https://github.com/redis/redis
deps/jemalloc/src/hook.c
div.svelte-xyz > p > em { color: red; }
css
github
https://github.com/sveltejs/svelte
packages/svelte/tests/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/expected.css
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
unknown
codeparrot/codeparrot-clean
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from sqlalchemy import func, asc from operator import itemgetter from bartendro import app, db from flask import Flask, request, redirect, render_template from flask.ext.login import login_required from bartendro.model.drink import Drink from bartendro.model.booze import Booze from bartendro.mod...
unknown
codeparrot/codeparrot-clean
import io import os import pandas as pd import pyfits from astropy.io.votable import parse from astropy.io.votable.tree import VOTableFile, Resource, Table, Field from sklearn.cross_validation import StratifiedKFold, KFold from sklearn.cross_validation import train_test_split def load_header(uri): votable = parse...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.storage import test_base from translate.storage import wordfast as wf class TestWFTime(object): def test_timestring(self): """Setting and getting times set using a timestring""" wftime = wf.WordfastTime() assert wftime.timestrin...
unknown
codeparrot/codeparrot-clean
# Maildir repository support # Copyright (C) 2002 John Goerzen # <jgoerzen@complete.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 of the License, or # (at y...
unknown
codeparrot/codeparrot-clean
import tensorflow as tf flags = tf.app.flags # Change the following parameters to suit your needs # data preparation parameters # used in prepare_dataset_files flags.DEFINE_string('dataset_dir', '/home/dcausevic/datasets/cityscapes_vece_slike_new_build/', 'Directory containing folders created with...
unknown
codeparrot/codeparrot-clean
# encoding: UTF-8 SAVE_DATA = 'Save Data' RESIZE_COLUMNS = 'Resize Columns' CONTRACT_SYMBOL = 'Symbol' CONTRACT_NAME = 'Name' LAST_PRICE = 'Last' PRE_CLOSE_PRICE = 'PreClose' VOLUME = 'Volume' OPEN_INTEREST = 'Open Interest' OPEN_PRICE = 'Open' HIGH_PRICE = 'High' LOW_PRICE = 'Low' TIME = 'Time' GATEWAY = 'Gateway' C...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (c) 2009 Google Inc. 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...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, a Red Hat company # # 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, o...
unknown
codeparrot/codeparrot-clean
import unittest import skype4pytest from Skype4Py.client import * class ClientTest(skype4pytest.TestCase): def setUpObject(self): self.obj = self.skype.Client # Methods # ======= def testButtonPressed(self): self.api.enqueue('BTN_PRESSED 5') self.obj.ButtonPressed('5') ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright (c) 2014, Jelmer Tiete <jelmer@tiete.be>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright #...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2011 Zuza Software Foundation # # This file is part of Virtaal. # # 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 ...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
<div class="root svelte-xyz"> <section class="whatever svelte-xyz"> </section> </div>
html
github
https://github.com/sveltejs/svelte
packages/svelte/tests/css/samples/omit-scoping-attribute-global-children/expected.html
/* * 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.impl.base.permissions import com.intellij.openapi.Disposable import...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/permissions/KaBaseWriteActionStartedChecker.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...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/StandbyException.java
#!/usr/bin/env python # Copyright 2015 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. """The test controller for the chromoting localhost browser_tests. This test uses the legion framework to setup this controller which ...
unknown
codeparrot/codeparrot-clean
/* 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 applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/common_runtime/local_device.h
from gi.repository import Gtk from gi.repository import GdkPixbuf from trifle.utils import (SubscriptionType as SubType, sqlite, combine_ids, split_id, icon_pixbuf, SubscriptionColumn as Col) class Subscriptions(Gtk.TreeStore): def __init__(self, *args, **kwargs): # Subscription...
unknown
codeparrot/codeparrot-clean
class Node(object): __slots__ = ('name', 'path', 'local', 'is_leaf') def __init__(self, path): self.path = path self.name = path.split('.')[-1] self.local = True self.is_leaf = False def __repr__(self): return '<%s[%x]: %s>' % (self.__class__.__name__, id(self), sel...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
unknown
codeparrot/codeparrot-clean
//===--- AccessRequests.cpp - AccessLevel and AccessScope Requests --------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 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/AST/AccessRequests.cpp
//// [tests/cases/conformance/enums/awaitAndYield.ts] //// //// [awaitAndYield.ts] async function* test(x: Promise<number>) { enum E { foo = await x, baz = yield 1, } } //// [awaitAndYield.js] "use strict"; async function* test(x) { let E; (function (E) { E[E["foo"] = await x] ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/awaitAndYield.js
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from examples/modular-transformers/modular_my_new_model2.py. # Do NOT edit this file manually as any edits will be overwritten by the generati...
python
github
https://github.com/huggingface/transformers
examples/modular-transformers/modeling_my_new_model2.py
# -*- test-case-name: twisted.mail.test.test_bounce -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Support for bounce message generation. """ import StringIO import email.utils import time import os from twisted.mail import smtp BOUNCE_FORMAT = """\ From: postmaster@%(failedDomain)...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
unknown
codeparrot/codeparrot-clean
from Tkinter import TclError class WidgetRedirector: """Support for redirecting arbitrary widget subcommands. Some Tk operations don't normally pass through tkinter. For example, if a character is inserted into a Text widget by pressing a key, a default Tk binding to the widget's 'insert' operation i...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # function # function closures # @ is a decorator # http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/ # https://github.com/tuxfux-hlp/Python-examples/blob/master/devops/fabfile.py def outer(my_func): def inner(*args,**kwargs): try: my_func(*args,**kwargs) except Except...
unknown
codeparrot/codeparrot-clean
## Input ```javascript function Component(props) { let x; switch (props.cond) { case true: { x = 1; break; } case false: { x = 2; break; } default: { x = 3; } } // The values assigned to `x` are non-reactive, but the value of `x` // depends on the "contro...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
unknown
codeparrot/codeparrot-clean
#! /bin/bash silent_grep() { command grep -q "$@" >/dev/null 2>&1 } idem_file_append() { if [[ -z "$1" ]]; then return 1 fi if [[ ! -f "$1" && -n "${4-}" ]]; then return fi if [[ -z "$2" ]]; then return 2 fi if [[ -z "$3" ]]; then return 3 fi loc...
unknown
github
https://github.com/mongodb/mongo
etc/set_up_workstation.sh
""" Web API (wrapper around WSGI) (from web.py) """ __all__ = [ "config", "header", "debug", "input", "data", "setcookie", "cookies", "ctx", "HTTPError", # 200, 201, 202 "OK", "Created", "Accepted", "ok", "created", "accepted", # 301, 302, 303, 304, 307 "Redirect", "Found"...
unknown
codeparrot/codeparrot-clean
import cn from "classnames"; import DotCmsImage from "./dotcms-image"; import Link from "next/link"; export const Bold = ({ children }) => <strong>{children}</strong>; export const Italic = ({ children }) => <em>{children}</em>; export const Strike = ({ children }) => <s>{children}</s>; export const Underline = ({ chi...
typescript
github
https://github.com/vercel/next.js
examples/cms-dotcms/components/blocks.tsx
# frozen_string_literal: true class Member < ActiveRecord::Base has_one :current_membership has_one :selected_membership has_one :membership has_one :club, through: :current_membership has_one :club_without_joins, through: :current_membership, source: :club, disable_joins: true has_one :selected_club, thro...
ruby
github
https://github.com/rails/rails
activerecord/test/models/member.rb
#!/usr/bin/python # # Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.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.1', ...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 import unittest import os from sqlalchemy.engine.reflection import Inspector from niamoto.testing import set_test_path set_test_path() from niamoto.conf import settings, NIAMOTO_HOME from niamoto.testing.test_database_manager import TestDatabaseManager from niamoto.testing.base_tests import BaseTes...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python2.4 # # Copyright 2008 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 required by applicable law or...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 # # Copyright © 2010—2014 Andrey Mikhaylenko and contributors # # This file is part of Argh. # # Argh is free software under terms of the GNU Lesser # General Public License version 3 (LGPLv3) as published by the Free # Software Foundation. See the file README.rst for copying conditions. # import a...
unknown
codeparrot/codeparrot-clean
"""Support for Timers.""" from datetime import timedelta import logging import typing import voluptuous as vol from homeassistant.const import ( ATTR_EDITABLE, CONF_ICON, CONF_ID, CONF_NAME, SERVICE_RELOAD, ) from homeassistant.core import callback from homeassistant.helpers import collection impo...
unknown
codeparrot/codeparrot-clean
from .base import GEOSBase from .prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes the contains covers, and intersects operations. """ ptr_type = capi.PREPGEOM_PTR def __init__...
unknown
codeparrot/codeparrot-clean
{ "name": "e2e", "command": "ng e2e [project]", "shortDescription": "Builds and serves an Angular application, then runs end-to-end tests.", "aliases": [ "e" ], "deprecated": false, "options": [ { "name": "configuration", "type": "string", "aliases": [ "c" ], ...
json
github
https://github.com/angular/angular
adev/src/content/cli/e2e.json
#!/usr/bin/env python # ===--- swift-bench.py ------------------------------*- coding: utf-8 -*-===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http:...
unknown
codeparrot/codeparrot-clean
import json import logging from functools import partial from django.contrib.auth.models import User from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import reverse from foldit.views import foldit_ops, verify_code from foldit.models import PuzzleComplete, Sc...
unknown
codeparrot/codeparrot-clean
from django.test import SimpleTestCase from ..utils import setup class JsonScriptTests(SimpleTestCase): @setup({"json-tag01": '{{ value|json_script:"test_id" }}'}) def test_basic(self): output = self.engine.render_to_string( "json-tag01", {"value": {"a": "testing\r\njson 'string\" <b>escap...
python
github
https://github.com/django/django
tests/template_tests/filter_tests/test_json_script.py
"""SCons.Platform.os2 Platform-specific initialization for OS/2 systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ...
unknown
codeparrot/codeparrot-clean
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2014 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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 Li...
unknown
codeparrot/codeparrot-clean
/* 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 applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/grappler/clusters/utils.h
{% load i18n %} <div id="{{ widget.attrs.id }}_div_map" class="dj_map_wrapper"> <div id="{{ widget.attrs.id }}_map" class="dj_map"></div> {% if not disabled %}<span class="clear_features"><a href="">{% translate "Delete all Features" %}</a></span>{% endif %} {% if widget.attrs.display_raw %}<p>{% translate...
html
github
https://github.com/django/django
django/contrib/gis/templates/gis/openlayers.html