code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
<!-- 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
dev/WHAT_GOES_INTO_THE_NEXT_RELEASE.md
import logging, re from autotest.client.shared import error from autotest.client import utils from autotest.client.virt import virt_test_utils, virt_utils, aexpect def run_ethtool(test, params, env): """ Test offload functions of ethernet device using ethtool 1) Log into a guest. 2) Initialize the cal...
unknown
codeparrot/codeparrot-clean
# vi: ts=4 expandtab # # Copyright (C) 2009-2011 Canonical Ltd. # Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This program is free software: you can redistribute it and/or mod...
unknown
codeparrot/codeparrot-clean
"""Test NotebookApp""" import logging import os from tempfile import NamedTemporaryFile import nose.tools as nt from traitlets.tests.utils import check_help_all_output from jupyter_core.application import NoStart from ipython_genutils.tempdir import TemporaryDirectory from traitlets import TraitError from notebook ...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectiona...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf8 -*- import re from Page import * class NounIterator(object): def __init__(self, start = None): self.start = start self.idx = 0 self.started = False def filtered(self, n): if self.started: return False #print "%s %s" % (n, self.start) if self.start is None or n ==...
unknown
codeparrot/codeparrot-clean
import argparse import sys import matplotlib import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import numpy as np import json parser = argparse.ArgumentParser(description="Does some awesome things.") parser.add_argument('message', type=str, help="pass a message into the script") args = parser.p...
unknown
codeparrot/codeparrot-clean
from etnaviv.parse_rng import parse_rng_file, format_path, BitSet, Domain, Stripe, Register, Array, BaseType class DomainVisitor(object): ''' Walk a rnndb domain, visit all registers recursively. ''' def __init__(self): pass def visit(self, node): if isinstance(node, Domain): ...
unknown
codeparrot/codeparrot-clean
"""A script to train the DNC on implemented tasks. You can start training the DNC model on any implemented task by executing: > python -m src.tasks.train --task=<task_name> TO SUPPORT NEW TASKS: 1) Import necessary code for task (follow necessary requirements listed below). 2) Create new section in flags and define a...
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/logging/logback/DebugLogbackConfigurator.java
// We need this feature as it changes `dylib` linking behavior and allows us to link to `rustc_driver`. #![feature(rustc_private)] // Several crates are depended upon but unused so that they are present in the sysroot #![expect(unused_crate_dependencies)] use std::process::ExitCode; // A note about jemalloc: rustc us...
rust
github
https://github.com/rust-lang/rust
compiler/rustc/src/main.rs
//===--- DumpAST.cpp ---------------------------------------------*- 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/refactor/tweaks/DumpAST.cpp
<?php namespace Illuminate\Tests\Database; use Illuminate\Database\Connection; use Illuminate\Database\Schema\Grammars\MariaDbGrammar; use Illuminate\Database\Schema\MariaDbBuilder; use Mockery as m; use PHPUnit\Framework\TestCase; class DatabaseMariaDbBuilderTest extends TestCase { public function testCreateDat...
php
github
https://github.com/laravel/framework
tests/Database/DatabaseMariaDbBuilderTest.php
/* * 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-context/src/test/java/org/springframework/cache/interceptor/CacheErrorHandlerTests.java
# Copyright 2014 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 l...
unknown
codeparrot/codeparrot-clean
"""Keras implementation of SSD.""" import keras.backend as K from keras.layers import Activation from keras.layers import Conv2D from keras.layers import Dense from keras.layers import Flatten from keras.layers import GlobalAveragePooling2D from keras.layers import Input from keras.layers import MaxPooling2D from kera...
unknown
codeparrot/codeparrot-clean
from django.db import migrations, models Q = models.Q def set_dept_code(apps, schema_editor): Event = apps.get_model("proposal", "Event") for event in Event.objects.all(): if "Zoning Board" in event.title: event.dept = "zba" elif "Planning Board" in event.title: event.de...
unknown
codeparrot/codeparrot-clean
"""Shared UI utility function.""" import hangups def get_conv_name(conv, truncate=False, show_unread=False): """Return a readable name for a conversation. If the conversation has a custom name, use the custom name. Otherwise, for one-to-one conversations, the name is the full name of the other user. For ...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack LLC. # # 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 # # htt...
unknown
codeparrot/codeparrot-clean
<div class="transfer-state-container"> <div class="header"> <h2> <mat-icon>swap_horiz</mat-icon> Transfer State </h2> </div> @if (isLoading()) { <div class="loading"> <mat-icon class="spinning">hourglass_empty</mat-icon> Loading transfer state... </div> } @else if (error...
html
github
https://github.com/angular/angular
devtools/projects/ng-devtools/src/lib/devtools-tabs/transfer-state/transfer-state.component.html
//// [tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer.ts] //// //// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_0.ts] interface c { q3: number; } export = c; //// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_1.ts] import moduleA = require("./aliasWithInterfaceExp...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.js
# Copyright 2018 VEXXHOST, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
unknown
codeparrot/codeparrot-clean
import os, sys, mock, gc from os.path import normpath import mock_urwid from libmproxy import console from libmproxy.console import common import tutils class TestConsoleState: def test_flow(self): """ normal flow: connect -> request -> response """ c = console...
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. import unittest from telemetry import decorators from telemetry.core import util from telemetry.unittest import run_tests class MockPossibleBrowser(object)...
unknown
codeparrot/codeparrot-clean
import datetime from email import utils import test.support import time import unittest from test.support import cpython_only from test.support.import_helper import ensure_lazy_imports class TestImportTime(unittest.TestCase): @cpython_only def test_lazy_import(self): ensure_lazy_imports("email.utils"...
python
github
https://github.com/python/cpython
Lib/test/test_email/test_utils.py
from BinaryTreeExceptions import * class Node(object): def __init__(self, element, parent=None): self.element = element self.parent = parent self.left = None self.right = None def __contains__(self, other): if other == self.element: return True elif...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\View\Compilers\Concerns; use Illuminate\Support\Str; trait CompilesConditionals { /** * Identifier for the first case in the switch statement. * * @var bool */ protected $firstCaseInSwitch = true; /** * Compile the if-auth statements into valid PHP. ...
php
github
https://github.com/laravel/framework
src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php
# swift_build_support/products/ninja.py -------------------------*- python -*- # # 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/LICENSE.tx...
unknown
codeparrot/codeparrot-clean
import re from django.utils.cache import patch_vary_headers from django.utils.deprecation import MiddlewareMixin from django.utils.text import compress_sequence, compress_string re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(MiddlewareMixin): """ This middleware compresses content if the brow...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software 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, # thi...
unknown
codeparrot/codeparrot-clean
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import hashlib import json import os import traceback import urlparse from abc import ABCMeta, abstractmethod from ..te...
unknown
codeparrot/codeparrot-clean
from gaphas.item import Line class LineInstance: """ Class representation of the ASCEND 'ARE_THE_SAME' relationship signified by a ConnectorLine on the BlockCanvas. There will be a reference to a LineInstance stored within a LineItem object. The intention is that it should be possible to encapsulate all the n...
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. import argparse import lib2to3.refactor from webkitpy.common.system.systemhost import SystemHost from webkitpy.thirdparty import autopep8 def parse_args(ar...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-30 23:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TblAcad...
unknown
codeparrot/codeparrot-clean
# (c) 2014, Matt Martz <matt@sivel.net> # # 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
""" Tests for Management commands of comprehensive theming. """ from django.test import TestCase from django.core.management import call_command, CommandError from openedx.core.djangoapps.theming.helpers import get_themes from openedx.core.djangoapps.theming.management.commands.compile_sass import Command class TestU...
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...
unknown
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/site/markdown/release/0.14.3/CHANGELOG.0.14.3.md
import inspect import types import unittest import contextlib from test.support.import_helper import import_module from test.support import gc_collect, requires_working_socket asyncio = import_module("asyncio") requires_working_socket(module=True) _no_default = object() class AwaitException(Exception): pass @t...
python
github
https://github.com/python/cpython
Lib/test/test_asyncgen.py
//===--- Replacement.h - Migrator Replacements ------------------*- C++ -*-===// // // 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...
c
github
https://github.com/apple/swift
include/swift/Migrator/Replacement.h
<?php namespace Illuminate\Queue; use Carbon\Carbon; use Closure; use DateTimeInterface; use Illuminate\Bus\UniqueLock; use Illuminate\Container\Container; use Illuminate\Contracts\Cache\Repository as Cache; use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Contracts\Queue\ShouldBeEncrypted; use Illuminat...
php
github
https://github.com/laravel/framework
src/Illuminate/Queue/Queue.php
from django.test import TestCase from models import Album, Image class AlbumModelTests(TestCase): def setUp(self): a, created = Album.objects.get_or_create(title="lion", public=True) # a.save() b, created = Album.objects.get_or_create(title="cat", public=True) # b.save() def t...
unknown
codeparrot/codeparrot-clean
import asyncio import hastebin import discord from discord.ext import commands from clembot.core.logs import init_loggers from itertools import chain, cycle import random import re class TextUtil: # Convert an arbitrary string into something which # is acceptable as a Discord channel name. @staticmethod ...
unknown
codeparrot/codeparrot-clean
""" Django settings for firstblog1 project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/mluke.md
from __future__ import absolute_import from __future__ import print_function # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU # GPL v2 or later. import argparse import os.path import s...
unknown
codeparrot/codeparrot-clean
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import threading import contextlib from socorro.external.hbase import hbase_client from configman.config_manager import...
unknown
codeparrot/codeparrot-clean
/* * jdmerge.h * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2020, 2022, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. */ #define JPEG_INTERNALS #in...
c
github
https://github.com/opencv/opencv
3rdparty/libjpeg-turbo/src/jdmerge.h
""" Starts a service to scan in intervals for new devices. Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are loaded before the EVENT_PLATFORM_DISCOVERED is fired. """ import json from datetime import timedelta import lo...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/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. import os.path import re import shutil import sys import tempfile import time import urlparse import browserprocess class LaunchFailu...
unknown
codeparrot/codeparrot-clean
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/Context.h> #include <ATen/TensorGeometry.h> #include <ATen/TensorUtils.h> #include <ATen/core/Tensor.h> #include <ATen/cuda/CUDAConfig.h> #include <ATen/cuda/EmptyTensor.h> #include <ATen/native/ConvUtils.h> #if AT_CUDNN_ENABLED() #include <ATen/native/cudnn/C...
cpp
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/cudnn/ConvShared.cpp
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings from django.views.generic.base import View from django.utils.encoding import force_str from .models import Author, Artist class ListViewTests(TestCase): fixtures = [...
unknown
codeparrot/codeparrot-clean
global: scrape_interval: 15s
unknown
github
https://github.com/prometheus/prometheus
config/testdata/agent_mode.without_remote_writes.yml
# Copyright 2015 NEC Corporation. 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 ...
unknown
codeparrot/codeparrot-clean
import jax.numpy as np from jax.scipy.special import erf, gammaln from jax import jit, partial, jacrev, random, vmap, grad from jax.scipy.linalg import cholesky, cho_factor, cho_solve from utils import inv, softplus, sigmoid, logphi, gaussian_moment_match, softplus_inv, gauss_hermite, \ ensure_positive_precision pi...
unknown
codeparrot/codeparrot-clean
# Copyright 2011 VMware, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
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
# coding: utf-8 from fabric.api import env, local, cd, run, sudo from fabric.operations import put env.use_ssh_config = True env.keepalive = 60 def tarball(): """Create tarball for june.""" local('make static') local('python setup.py sdist --formats=gztar', capture=False) def upload(): """Upload tar...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/main/java/org/apache/kafka/common/utils/ChunkedBytesStream.java
'''Test (selected) IDLE Edit menu items. Edit modules have their own test files ''' from test.support import requires requires('gui') import tkinter as tk from tkinter import ttk import unittest from idlelib import pyshell class PasteTest(unittest.TestCase): '''Test pasting into widgets that allow pasting. O...
python
github
https://github.com/python/cpython
Lib/idlelib/idle_test/test_editmenu.py
# -*- coding: utf-8 -*- ############################################################################### # # GetWeather # Retrieves the Yahoo Weather RSS Feed for any specified location by WOEID. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "L...
unknown
codeparrot/codeparrot-clean
export const a = "a"; export const b = "b"; export default "default"; export const usedExports = __webpack_exports_info__.usedExports;
javascript
github
https://github.com/webpack/webpack
test/cases/chunks/inline-options/dir13/b.js
import time import unittest import threading import synapse.async as s_async import synapse.lib.scope as s_scope from synapse.tests.common import * class AsyncTests(SynTest): def test_async_basics(self): boss = s_async.Boss() data = {} def jobmeth(x, y=20): return x + y ...
unknown
codeparrot/codeparrot-clean
// Copyright The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
github
https://github.com/prometheus/prometheus
tsdb/tombstones/tombstones_test.go
# Copyright (C) 2018-present MongoDB, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the Server Side Public License, version 1, # as published by MongoDB, Inc. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without e...
python
github
https://github.com/mongodb/mongo
buildscripts/idl/tests/context.py
# Lispy: Scheme Interpreter in Python # (c) Peter Norvig, 2010-16; See http://norvig.com/lispy.html from __future__ import division import math import operator as op # Types Symbol = str # A Lisp Symbol is implemented as a Python str List = list # A Lisp List is implemented as a Python list Numb...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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
<!--- # 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
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/site/markdown/release/0.22.1/CHANGELOG.0.22.1.md
# 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 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. # pylint: disable=W0401,W0614 from telemetry.page.actions.all_page_actions import * from telemetry.page import page as page_module from telemetry.page import ...
unknown
codeparrot/codeparrot-clean
from datetime import date from django.conf import settings from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.http import base36_to_int, int_to_base36 class PasswordResetTokenGenerator(object): """ Strategy object used to generate and check tokens...
unknown
codeparrot/codeparrot-clean
# !/usr/bin/env python # # Copyright 2015 clowwindy # # 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
from textwrap import dedent import pytest from pandas import ( DataFrame, Series, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( {"A": [0, 1], "B": [-0.61, -1.22], "C": Series(["ab", "cd"], dtype=object)} ) @pytest.fixt...
python
github
https://github.com/pandas-dev/pandas
pandas/tests/io/formats/style/test_to_typst.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import psycopg2 from odoo.models import BaseModel from odoo.tests.common import TransactionCase from odoo.tools import mute_logger import odoo.osv.expression as expression class TestExpression(TransactionCase): de...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # This module uses OpenERP, Open Source Management Solution Framework. # Copyright (C) 2012-Today Serpent Consulting Services # (<http://www.serpentcs.com>) # # This program is f...
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 applica...
unknown
codeparrot/codeparrot-clean
import React, { FC } from "react"; // import { useToastContext } from "../../contexts/ToastContext"; import { formatSeries } from "../../lib/formatSeries"; import classes from "./SeriesName.module.css"; import { escapeString } from "../../lib/escapeString"; import { notifications } from "@mantine/notifications"; import...
typescript
github
https://github.com/prometheus/prometheus
web/ui/mantine-ui/src/pages/query/SeriesName.tsx
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ===--- test_compare_perf_tests.py --------------------------------------===// # # 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 Li...
python
github
https://github.com/apple/swift
benchmark/scripts/test_compare_perf_tests.py
import sys from os import walk from os.path import isdir, join, abspath, dirname import pep8 import time htmlmode = False pep8_ignores = ( 'E125', # continuation line does not # distinguish itself from next logical line 'E126', # continuation line over-indented for hanging indent 'E127', #...
unknown
codeparrot/codeparrot-clean
# 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 to in...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- """ MoEDAL and CERN@school - Skimming Panoptes classifications. See the README.md file and the GitHub wiki for more information. http://cernatschool.web.cern.ch """ # Import the code needed to manage files. import os, glob #...for parsing the arguments. import arg...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/allowSyntheticDefaultImports7.ts] //// //// [b.d.ts] export function foo(); export function bar(); //// [a.ts] import { default as Foo } from "./b"; Foo.bar(); Foo.foo(); //// [a.js] System.register(["./b"], function (exports_1, context_1) { "use strict"; var b_1; var __module...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/allowSyntheticDefaultImports7.js
import * as evaluator from "../../_namespaces/evaluator.js"; import * as ts from "../../_namespaces/ts.js"; describe("unittests:: evaluation:: forAwaitOfEvaluation", () => { it("sync (es5)", async () => { const result = evaluator.evaluateTypeScript( ` let i = 0; const iterator: ...
typescript
github
https://github.com/microsoft/TypeScript
src/testRunner/unittests/evaluation/forAwaitOf.ts
"""cx_Freeze extension Extends: - the 'build' command with the 'exe-command' option to allow using a different command from 'build_exe' to build executables from Python scripts. - the 'install' command with the 'skip-sub-commands' option to allow not running a set of sub commands, e.g.: install --skip-sub-comma...
unknown
codeparrot/codeparrot-clean
# Typical run: # C:\home\eric\wrk\scipy\weave\examples>python fibonacci.py # Recursively computing the first 30 fibonacci numbers: # speed in python: 4.31599998474 # speed in c: 0.0499999523163 # speed up: 86.32 # Looping to compute the first 30 fibonacci numbers: # speed in python: 0.000520999908447 # speed in c:...
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
import { bench } from 'vitest' import { segment } from './segment' const values = [ ['hover:focus:underline', ':'], ['var(--a, 0 0 1px rgb(0, 0, 0)), 0 0 1px rgb(0, 0, 0)', ','], ['var(--some-value,env(safe-area-inset-top,var(--some-other-value,env(safe-area-inset))))', ','], ] bench('segment', () => { for (l...
typescript
github
https://github.com/tailwindlabs/tailwindcss
packages/tailwindcss/src/utils/segment.bench.ts
prelude: | class A0 def method_missing(m); m end end class A1 def method_missing(m, a) a; end end class S def method_missing(m, *a) a; end end class B def method_missing(m, kw: 1) kw end end class SB def method_missing(m, *a, kw: 1) kw end end t0 = 0.times.to_a t1 = 1.times....
unknown
github
https://github.com/ruby/ruby
benchmark/vm_call_method_missing.yml
/* 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/DEX/deopt.hpp
#!/usr/bin/env bash # Copyright 2023 The Cockroach Authors. # # Use of this software is governed by the CockroachDB Software License # included in the /LICENSE file. set -euxo pipefail gcloud secrets versions access 2 --secret=engflow-mesolite-key > /home/agent/engflow.key gcloud secrets versions access 2 --secret=e...
unknown
github
https://github.com/cockroachdb/cockroach
build/github/get-engflow-keys.sh
# -*- coding: utf-8 -*- """ *************************************************************************** GridDataMetrics.py --------------------- Date : October 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
unknown
codeparrot/codeparrot-clean
import {identity} from 'shared-runtime'; function Foo() { const CONSTANT = 1; const x = { foo() { return identity(CONSTANT); }, }; return x.foo(); } export const FIXTURE_ENTRYPOINT = { fn: Foo, params: [{}], };
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-prop-to-object-method.js
import util from 'util'; import {Readable} from 'stream'; import utils from "../utils.js"; import readBlob from "./readBlob.js"; import platform from "../platform/index.js"; const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_'; const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new ...
javascript
github
https://github.com/axios/axios
lib/helpers/formDataToStream.js
from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.db.models import F, Max, Min from django.db.transaction import atomic from django.contrib.contenttypes.models import ContentType from django_comments.models import Comment def max_thread_level_for_co...
unknown
codeparrot/codeparrot-clean
###################################################################### # Copyright (C) 2011,2012,2014 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ##########...
unknown
codeparrot/codeparrot-clean
# Welcome to \Rails ## What's \Rails? \Rails is a web application framework that includes everything needed to create database-backed web applications according to the [Model-View-Controller (MVC)](https://en.wikipedia.org/wiki/Model-view-controller) pattern. Understanding the MVC pattern is key to understanding \Ra...
unknown
github
https://github.com/rails/rails
railties/RDOC_MAIN.md
# (originally from https://github.com/tensorflow/models/tree/master/research/differential_privacy, # possibly with some small edits by @corcra) # 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 complia...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import datetime import os import sys def extract_datetime_from_line(line, year): # Expected format: I0210 13:39:22.381027 25210 solver.cpp:204] Iteration 100, lr = 0.00992565 line = line.strip().split() month = int(line[0][1:3]) day = int(line[0][3:]) timestamp = line[1] p...
unknown
codeparrot/codeparrot-clean
#ifndef RBIMPL_INTERN_FILE_H /*-*-C++-*-vi:se ft=cpp:*/ #define RBIMPL_INTERN_FILE_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> * @copyright This file is a part of the programming language Ruby. * Permission is hereby granted, to either re...
c
github
https://github.com/ruby/ruby
include/ruby/internal/intern/file.h
import os import dj_database_url ### Basic config BASE = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) DEBUG = TEMPLATE_DEBUG = True SITE_ID = 1 SECRET_KEY = 'its-a-secret-to-everybody' # Until Sentry works on Py3, do errors the old-fashioned way. ADMINS = [] # General project information # T...
unknown
codeparrot/codeparrot-clean