code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package lang import ( "fmt" "os" "path/filepath" "strings" "testing" "time" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/ex...
go
github
https://github.com/hashicorp/terraform
internal/lang/functions_test.go
// Copyright 2023 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. //go:build wasip1 package syscall import "runtime" // TODO: Auto-generate some day. (Hard-coded in binaries so not likely to change.) const ( E2BIG ...
go
github
https://github.com/golang/go
src/syscall/tables_wasip1.go
/* * Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.server.auth /** * Represents a cause for an authentication challenge request. * * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.auth.AuthenticationFail...
kotlin
github
https://github.com/ktorio/ktor
ktor-server/ktor-server-plugins/ktor-server-auth/common/src/io/ktor/server/auth/AuthenticationFailedCause.kt
__author__ = 'tsungyi' import libs.datasets.pycocotools._mask as _mask # Interface for manipulating masks stored in RLE format. # # RLE is a simple yet efficient format for storing binary masks. RLE # first divides a vector (or vectorized image) into a series of piecewise # constant regions and then for each piece si...
unknown
codeparrot/codeparrot-clean
# The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also provided as a convenience to those who want to deploy these URLs # elsewhere. from django.conf.urls import url from django.contrib.auth import views ...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: GPL-2.0 %YAML 1.2 --- $id: http://devicetree.org/schemas/clock/allwinner,sun4i-a10-ve-clk.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Allwinner A10 Video Engine Clock maintainers: - Chen-Yu Tsai <wens@csie.org> - Maxime Ripard <mripard@kernel.org> deprecated: tr...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ve-clk.yaml
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CustomUser.last_ip' db.add_column('auth_customuser', 'last_ip', self.gf('django.db.models.fields.I...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Foundation; use Closure; use Composer\Autoload\ClassLoader; use Illuminate\Container\Container; use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract; use Illuminate\Contracts\Foundation\Application as ApplicationContract; use Illuminate\Contracts\Foundation\CachesConfiguration; ...
php
github
https://github.com/laravel/framework
src/Illuminate/Foundation/Application.php
import tensorflow as tf class Vanilla2DCell(tf.contrib.rnn.RNNCell): """Vanilla Recurrent Unit cell.""" def __init__(self, num_units, channels): self._num_units = num_units self._channels = channels @property def state_size(self): return self._num_units @property def ...
unknown
codeparrot/codeparrot-clean
# Changes ## Unreleased - Minimum supported Rust version (MSRV) is now 1.88. - Fix truncated body ending without error when connection closed abnormally. [#3067] - Add config/method for `TCP_NODELAY`. [#3918] [#3067]: https://github.com/actix/actix-web/pull/3067 [#3918]: https://github.com/actix/actix-web/pull/3918 ...
unknown
github
https://github.com/actix/actix-web
actix-http/CHANGES.md
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * win32stat.c * Replacements for <sys/stat.h> functions using GetFileInformationByHandle * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California ...
c
github
https://github.com/postgres/postgres
src/port/win32stat.c
import os import string import math import re import subprocess # I didn't implement getProperties, found it somewhere, just reads a java style # properties file into a dictionary. def getProperties(filename): propFile= file( filename, "rU" ) propDict= dict() for propLine in propFile: propDef= prop...
unknown
codeparrot/codeparrot-clean
# # See ../LICENSE # # This file is a configuration example for an InnoDB table with cities, with several validators. # # import config_base import field_inno_antelope as inno import scanner_shared import validators import scanner_shared import validators validate_pop = validators.make_validator_int_range(1, 1.0*10...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012 Yuvi Panda <yuvipanda@gmail.com> #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pub...
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/io/VersionedWritable.java
import { test } from '../../test'; import { create_deferred } from '../../../helpers.js'; /** @type {ReturnType<typeof create_deferred>} */ let deferred; export default test({ before_test() { deferred = create_deferred(); }, get props() { return { promise: deferred.promise }; }, html: ` <p>loading...</p>...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/await-without-catch/_config.js
# frozen_string_literal: true require "abstract_unit" require "template/erb/helper" module ERBTest class TagHelperTest < BlockTestCase test "percent equals works for content_tag and does not require parenthesis on method call" do assert_equal "<div>Hello world</div>", render_content("content_tag :div", "H...
ruby
github
https://github.com/rails/rails
actionview/test/template/erb/tag_helper_test.rb
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Entity.image' db.alter_column('contacts_and_people_entity', 'image_id', self.gf('django.db...
unknown
codeparrot/codeparrot-clean
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
unknown
codeparrot/codeparrot-clean
## Input ```javascript // @enablePreserveExistingMemoizationGuarantees:false import {useMemo} from 'react'; import {Stringify} from 'shared-runtime'; function Component(props) { let Component = Stringify; Component = useMemo(() => { return Component; }, [Component]); return <Component {...props} />; } ...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-as-jsx-element-tag.expect.md
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from textw...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- ############################################################################## # # __openerp__.py # l10n_cr_account # First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.) # Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv...
unknown
codeparrot/codeparrot-clean
""" The B{0install search} command-line interface. """ # Copyright (C) 2013, Thomas Leonard # See the README file for details, or visit http://0install.net. from __future__ import print_function import sys from zeroinstall.injector import qdom from zeroinstall.cmd import UsageError from zeroinstall import logger i...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/ko/model_doc/swin2sr.md
/*------------------------------------------------------------------------- * * receivelog.c - receive WAL files using the streaming * replication protocol. * * Author: Magnus Hagander <magnus@hagander.net> * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * * IDENTIFICATION * ...
c
github
https://github.com/postgres/postgres
src/bin/pg_basebackup/receivelog.c
#!/usr/bin/env python """ A text box stimulus. This module contains a class implementing a text box stimulus. """ __author__ = 'Florian Krause <florian@expyriment.org>, \ Oliver Lindemann <oliver@expyriment.org>' __version__ = '' __revision__ = '' __date__ = '' import os import re import pygame from . import def...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Set the `first_{revision,question}_email_sent` flags for existing users that have made the appropriate type of contribution. This is to avoid back filling welcome emails to contributors. """ from __future__ import unicode_literals import sys from django.conf import settings from django.db ...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package terraform import ( "fmt" "log" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/configs" "github.com/hashicorp/terraform/internal...
go
github
https://github.com/hashicorp/terraform
internal/terraform/node_local.go
# 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) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package repl import ( "fmt" "testing" "github.com/hashicorp/terraform/internal/lang/marks" "github.com/zclconf/go-cty/cty" ) func TestFormatValue(t *testing.T) { tests := []struct { Val cty.Value Want string }{ { cty.NullVal(cty.D...
go
github
https://github.com/hashicorp/terraform
internal/repl/format_test.go
"""Administrator interface to score_mgr.""" from django.contrib import admin from apps.managers.challenge_mgr import challenge_mgr from apps.widgets.participation.models import ParticipationSetting, TeamParticipation from apps.admin.admin import challenge_designer_site, challenge_manager_site, developer_site class Par...
unknown
codeparrot/codeparrot-clean
# browsershots.org - Test your web design in different browsers # Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org> # # Browsershots 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
import os import sys import unicodedata from subprocess import Popen as _Popen, PIPE as _PIPE def _which_dirs(cmd): result = set() for path in os.environ.get('PATH', '').split(os.pathsep): filename = os.path.join(path, cmd) if os.access(filename, os.X_OK): result.add(path) retu...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from django.test import TestCase from django.core.urlresolvers import reverse from django.test.client import RequestFactory from django.contrib.auth.models import User from django.utils import timezone from happenings.models import Event from happenings.templatetags.happenings_...
unknown
codeparrot/codeparrot-clean
import { teardown } from '../../../reactivity/effects.js'; import { active_effect, active_reaction, set_active_effect, set_active_reaction } from '../../../runtime.js'; import { add_form_reset_listener } from '../misc.js'; /** * Fires the handler once immediately (unless corresponding arg is set to `false`), * t...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/src/internal/client/dom/elements/bindings/shared.js
# frozen_string_literal: true require "cases/helper" require "support/schema_dumping_helper" if ActiveRecord::Base.lease_connection.supports_virtual_columns? class SQLite3VirtualColumnTest < ActiveRecord::SQLite3TestCase include SchemaDumpingHelper class VirtualColumn < ActiveRecord::Base end def ...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/adapters/sqlite3/virtual_column_test.rb
from transitions import Transition from transitions.extensions.markup import MarkupMachine from transitions.core import listify import logging from functools import partial import copy _LOGGER = logging.getLogger(__name__) _LOGGER.addHandler(logging.NullHandler()) # this is a workaround for dill issues when partials...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 """ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import collections from collections import OrderedDict from django.utils.encoding import force_text from rest_framework.compat import unicode_to_repr class ReturnDict(OrderedDict): """ Return object from `serializer.data` for the `Serializer` class. Includes a bac...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ This file is part of open-ihm. open-ihm 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. open-ihm is distributed ...
unknown
codeparrot/codeparrot-clean
from django.core import checks from django.db import connection, models from django.db.models import F from django.test import TestCase, skipUnlessAnyDBFeature from django.test.utils import isolate_apps @isolate_apps("composite_pk") class CompositePKChecksTests(TestCase): maxDiff = None def test_composite_pk_...
python
github
https://github.com/django/django
tests/composite_pk/test_checks.py
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Dimension Data # # This module 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. # # This ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from layout.css import * __all__ = ['html4_default_stylesheet'] # Default stylesheet for HTML 4 # http://www.w3.org/TR/CSS21/sample.html html4_default_stylesheet = Stylesheet(''' html, address, blockquote, body, dd, div, dl, dt, ...
unknown
codeparrot/codeparrot-clean
# 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 # distributed under t...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.request.forms import io.ktor.client.* import io.ktor.client.request.* import io.ktor.client.statement.* import io.ktor.http.* import io.ktor.http.content.* /** * Makes ...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-core/common/src/io/ktor/client/request/forms/formBuilders.kt
/* * 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.standalone.fir.test.cases.generated.cases.symbols; import com.intel...
java
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/symbols/FirStandaloneNormalAnalysisSourceModulePackageSymbolTestGenerated.java
import sys from glad.lang.d.generator import DGenerator if sys.version_info >= (3, 0): basestring = str class VoltGenerator(DGenerator): NAME = 'volt' NAME_LONG = 'Volt' MODULE = 'amp' LOADER = 'loader' ENUMS = 'enums' EXT = 'ext' FUNCS = 'funcs' TYPES = 'types' FILE_EXTENSIO...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Helper functions to be used in bench_pictures.cfg. """ def Config(**kwargs): config = {} for key in kwargs: config[key] = kwargs[key] retu...
unknown
codeparrot/codeparrot-clean
# mysql/mysqldb.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+mysqldb :name: MySQL-Python :dbapi: mysqldb :co...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 //go:build !enterprise package vault import ( "github.com/hashicorp/vault/sdk/logical" ) func validateSha256IsEmptyForEntPluginVersion(pluginVersion string, sha256 string) *logical.Response { return nil }
go
github
https://github.com/hashicorp/vault
vault/logical_system_plugins_stubs_oss.go
########################################################## # THIS IS A GENERATED FILE -- DO NOT MODIFY. # IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE # AND REGENERATE THE MATRIX SUITES. # # matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/replica_sets...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/matrix_suites/generated_suites/replica_sets_execution_control_with_prioritization.yml
use std::collections::hash_map::Entry; use std::hash::Hash; use std::iter; use rustc_abi::{FieldIdx, VariantIdx}; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; use rustc_data_structures::unord::{ExtendUnord, UnordItems, UnordSet}; use rustc_errors::ErrorGuaranteed; use rustc_hir::def::{DefKind, Res}; use ru...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_middle/src/ty/typeck_results.rs
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.tools import ReadFileTool from langchain_community.tools.file_management.read import ReadFileInput # Create a way to dynamically look up deprecated imports. # Used to consolidat...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/tools/file_management/read.py
''' 4 Jan 2013, vatsan.cs@utexas.edu> Utility functions for PyMADlib. Currently this supports dummy coding of categorical columns (Pivoting). ''' import pickle default_schema = 'public' default_prefix = 'gp_pymdlib_' default_prefix_arr = 'gp_pymdlib_arr_' MAX_DISTINCT_VALS = 128 #Easy way of encoding strings ...
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/io/WritableComparable.java
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
unknown
codeparrot/codeparrot-clean
/* Copyright 2022 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/dtensor/cc/dtensor_device_util.h
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/compiler/mlir/tools/kernel_gen/tf_gpu_runtime_wrappers.h
import os import tarfile import time import stat import datetime import errno import json import pytz from juliabox.cloud import JBPluginCloud, Compute from juliabox.jbox_util import unique_sessname, ensure_delete, esc_sessname, get_user_name, parse_iso_time from juliabox.jbox_util import LoggerMixin, JBoxCfg, make_su...
unknown
codeparrot/codeparrot-clean
import {Component} from '@angular/core'; @Component({ selector: 'app-root', template: ` @for (user of users; track user.id) { <p>{{ user.name }}</p> } `, }) export class App { users = [ {id: 0, name: 'Sarah'}, {id: 1, name: 'Amy'}, {id: 2, name: 'Rachel'}, {id: 3, name: 'Jessica'}...
typescript
github
https://github.com/angular/angular
adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/answer/src/app/app.ts
# frozen_string_literal: true require "abstract_unit" require "action_dispatch" require "active_support/time" require "mailers/base_mailer" require "mailers/proc_mailer" require "mailers/asset_mailer" class BaseTest < ActiveSupport::TestCase include Rails::Dom::Testing::Assertions::DomAssertions setup do @...
ruby
github
https://github.com/rails/rails
actionmailer/test/base_test.rb
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # from pyasn1.type import univ from pyasn1.type import useful from pyasn1.codec.ber import encoder from pyasn1.compat.octets import int2oct, str2octs, null from pyasn1 imp...
unknown
codeparrot/codeparrot-clean
import django_filters from rest_framework import generics from rest_framework.relations import SlugRelatedField from rest_framework.serializers import ModelSerializer from kitsune.dashboards.models import WikiMetric from kitsune.products.models import Product class WikiMetricSerializer(ModelSerializer): product =...
unknown
codeparrot/codeparrot-clean
import { test } from '../../test'; // @ts-nocheck export default test({ test({ assert, component }) { let count = 0; // @ts-ignore component.$on('state', ({ changed }) => { if (changed.bar) count += 1; }); component.x = true; assert.equal(count, 0); } });
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/component-binding-blowback/_config.js
"""Wrapper for mod_fastcgi, for use as a CherryPy HTTP server when testing. To autostart fastcgi, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl", "apache2ctl", or "httpd"--create a symlink to them if need...
unknown
codeparrot/codeparrot-clean
use std::borrow::Cow; use crate::spec::{ Abi, Arch, Cc, Env, LinkerFlavor, Lld, Os, Target, TargetMetadata, TargetOptions, cvs, }; pub(crate) fn target() -> Target { let pre_link_args = TargetOptions::link_args( LinkerFlavor::Gnu(Cc::No, Lld::No), &[ "-e", "elf_entry", ...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs
# Copyright 2018 AT&T Intellectual Property. All other 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...
unknown
codeparrot/codeparrot-clean
import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser'; import {AppComponent} from './app/app.component'; bootstrapApplication(AppComponent, { providers: [provideProtractorTestingSupport()], }).catch((err) => console.error(err));
typescript
github
https://github.com/angular/angular
adev/src/content/examples/accessibility/src/main.ts
# 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
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>React Router - Multi App Example (Home App)</title> </head> <body> <div id="root"></div> ...
html
github
https://github.com/remix-run/react-router
examples/multi-app/index.html
""" Test refcounting and behavior of SCXX. """ from __future__ import absolute_import, print_function import sys from numpy.testing import (TestCase, dec, assert_, assert_raises, run_module_suite) from scipy.weave import inline_tools class TestDictConstruct(TestCase): #---------------...
unknown
codeparrot/codeparrot-clean
// Learn more: https://github.com/testing-library/jest-dom import "@testing-library/jest-dom";
javascript
github
https://github.com/vercel/next.js
examples/with-jest/jest.setup.js
# # 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
codeparrot/codeparrot-clean
// Image Mixins // - Responsive image // - Retina image // Responsive image // // Keep images from scaling beyond the width of their parents. @mixin img-fluid { // Part 1: Set a maximum relative to the parent max-width: 100%; // Part 2: Override the height to auto, otherwise images will be stretched // when s...
unknown
github
https://github.com/twbs/bootstrap
scss/mixins/_image.scss
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <assert.h> #include <arm_neon.h> #include <qnnpack/q8gavgpool.h> void pytorch_q8gavgpool_...
c
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gavgpool/up8x7-neon.c
import os from setuptools import setup setup( name='django-seed', version=__import__('django_seed').__version__, author='Tobin Brown', author_email='tobin@brobin.me', packages=['django_seed', 'django_seed.management', 'django_seed.management.commands'], include_package_data=True, url='http:...
unknown
codeparrot/codeparrot-clean
import math import pyx import pyfeyner2._util class Label(object): from pyfeyner2._util import location def __init__(self, text, angle=0, location=None): self.text = text self.angle = angle self.location = location @property def text(self): return self._text @te...
unknown
codeparrot/codeparrot-clean
# 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 # # Unless required by applicable law or agreed to ...
unknown
codeparrot/codeparrot-clean
""" Benchmarks for code in pandas/_libs, excluding pandas/_libs/tslibs, which has its own directory. If a PR does not edit anything in _libs/, then it is unlikely that the benchmarks will be affected. """ import numpy as np from pandas._libs.lib import ( infer_dtype, is_list_like, is_scalar, ) from pand...
python
github
https://github.com/pandas-dev/pandas
asv_bench/benchmarks/libs.py
# frozen_string_literal: false $srcs = %w[sizes.c limits.c] $distcleanfiles.concat($srcs) have_type('int_least8_t') have_type('int_least16_t') have_type('int_least32_t') have_type('int_least64_t') have_type('int_fast8_t') have_type('int_fast16_t') have_type('int_fast32_t') have_type('int_fast64_t') have_type('intmax_t...
ruby
github
https://github.com/ruby/ruby
ext/rbconfig/sizeof/extconf.rb
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSHelperFn, AWSObject, AWSProperty, If, FindInMap, Ref from .validators import boolean, integer from . import cloudformation EC2_INSTANCE_LAUNCH = "autoscaling:EC2_INSTANCE_LAUNCH" EC2_INS...
unknown
codeparrot/codeparrot-clean
#![cfg_attr(any(loom, not(feature = "sync")), allow(dead_code, unreachable_pub))] use crate::loom::cell::UnsafeCell; use crate::loom::hint; use crate::loom::sync::atomic::AtomicUsize; use std::fmt; use std::panic::{resume_unwind, AssertUnwindSafe, RefUnwindSafe, UnwindSafe}; use std::sync::atomic::Ordering::{AcqRel, ...
rust
github
https://github.com/tokio-rs/tokio
tokio/src/sync/task/atomic_waker.rs
from __future__ import unicode_literals, division, absolute_import from datetime import timedelta import os from tests import FlexGetBase, with_filecopy from flexget.utils.cached_input import cached from flexget import plugin from flexget.entry import Entry class InputPersist(object): """Fake input plugin to test...
unknown
codeparrot/codeparrot-clean
# # Copyright 2015 Peter Sprygada <psprygada@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python """ Every 30 minutes backs up database to S3. To recover the database, (i.e. reverse the process) simply download the file from S3, un-tar it, and use the command: (./)mongorestore --host {hostname} --port {port} path/to/dump/mongodump where {hostname} and {port} are as they are below """ import sys...
unknown
codeparrot/codeparrot-clean
// Targets the Little-endian Cortex-R52 processor (ARMv8-R) use crate::spec::{Abi, Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base}; pub(crate) fn target() -> Target { Target { llvm_target: "thumbv8r-none-eabihf".into(), metadata: TargetMetadata { description: Some("Thumb-m...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/thumbv8r_none_eabihf.rs
import tSnapshot import Util import time import unittest import selectBrowser from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.u...
unknown
codeparrot/codeparrot-clean
from zipline.assets import Equity from zipline.finance.slippage import SlippageModel from zipline.utils.sentinel import sentinel class TestingSlippage(SlippageModel): """ Slippage model that fills a constant number of shares per tick, for testing purposes. Parameters ---------- filled_per_tick...
unknown
codeparrot/codeparrot-clean
# Django settings for zulip project. ######################################################################## # Here's how settings for the Zulip project work: # # * settings.py contains non-site-specific and settings configuration # for the Zulip Django app. # * settings.py imports local_settings.py, and any site-spec...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsSpatialiteProvider .. 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 version. ...
unknown
codeparrot/codeparrot-clean
"""Sanity test using pylint.""" from __future__ import absolute_import, print_function import json import os from lib.sanity import ( SanitySingleVersion, SanityMessage, SanityFailure, SanitySuccess, SanitySkipped, ) from lib.util import ( SubprocessError, run_command, display, ) fro...
unknown
codeparrot/codeparrot-clean
import { get, set, getNumber } from "./magic.js"; // accessing memory console.log(get()); set(42); console.log(get()); set(123); console.log(get()); // random numbers console.log(getNumber()); console.log(getNumber()); console.log(getNumber());
javascript
github
https://github.com/webpack/webpack
examples/wasm-complex/example.js
from __future__ import division, absolute_import, print_function # Code common to build tools import sys import warnings import copy import binascii from numpy.distutils.misc_util import mingw32 #------------------- # Versioning support #------------------- # How to change C_API_VERSION ? # - increase C_API_VERSIO...
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/io/retry/Idempotent.java
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import logging import cgi from collections import namedtuple import itertools import sys import os import re import mimetypes import posixpath import warnings from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor....
unknown
codeparrot/codeparrot-clean
# pylint: disable=too-many-lines from unittest import TestCase from lxml import etree from pcs_test.tools.assertions import ( assert_report_item_list_equal, assert_xml_equal, ) from pcs_test.tools import fixture from pcs_test.tools.xml import etree_to_str from pcs.common.reports import codes as report_codes f...
unknown
codeparrot/codeparrot-clean