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 u...
python
github
https://github.com/apache/airflow
airflow-core/tests/unit/api_fastapi/core_api/routes/test_routes.py
# -*- coding: utf-8 -*- import os, sys, re try: from subprocess import check_output, check_call except ImportError: import subprocess as sp def check_output(*args, **kwds): kwds['stdout'] = sp.PIPE proc = sp.Popen(*args, **kwds) output = proc.stdout.read() proc.wait() ...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 IBM Corp. # Copyright 2013 Red Hat, 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 r...
unknown
codeparrot/codeparrot-clean
package kotlinx.coroutines.test.internal import kotlinx.coroutines.* @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2 internal actual fun Dispatchers.getTestMainDispatcher(): TestMainDispatcher = when (val mainDispatcher = Main) { is ...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-test/js/src/internal/TestMainDispatcher.kt
<?php namespace Illuminate\Support; use InvalidArgumentException; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; use Symfony\Component\Uid\Ulid; class BinaryCodec { /** @var array<string, array{encode: callable(UuidInterface|Ulid|string|null): ?string, decode: callable(?string): ?string}> */ protected ...
php
github
https://github.com/laravel/framework
src/Illuminate/Support/BinaryCodec.php
# Calculate level completion rates via mixpanel export API # TODO: why are our 'time' fields in PST time? targetLevels = ['dungeons-of-kithgard', 'the-raised-sword', 'endangered-burl'] eventFunnel = ['Started Level', 'Saw Victory'] import sys from datetime import datetime, timedelta from mixpanel import Mixpanel t...
unknown
codeparrot/codeparrot-clean
W = [753, 607, 59, 501, 1283, 61, 898, 325, 508, 142, 298, 542, 42, 38, 252, 46, 92, 81, 85, 590, 239, 40, 44, 5200, 1403, 170, 34, 77, 52, 304, 120, 37, 42, 902, 125, 13, 98, 135, 30, 18, 12, 91, 460, 335, 12, 19, 12, 206, 17, 12, 13, 20, 12, 14, 11, 31, 10, 15, 10, 12, 545, 66, 11, 12, 10, 11, 12, 32, 10, 446, 30, 27...
unknown
codeparrot/codeparrot-clean
# # Copyright (c), 2018-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opensource.org/licenses/MIT. # # @author Davide Brunato <brunato@...
unknown
codeparrot/codeparrot-clean
"""SCons.Tool.masm Tool-specific initialization for the Microsoft Assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The S...
unknown
codeparrot/codeparrot-clean
/* * 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.platform.declarations import com.intellij.openapi.components.servic...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-platform-interface/src/org/jetbrains/kotlin/analysis/api/platform/declarations/KotlinDirectInheritorsProvider.kt
""" Scrapy Telnet Console extension See documentation in docs/topics/telnetconsole.rst """ from __future__ import annotations import binascii import logging import os import pprint from typing import TYPE_CHECKING, Any from twisted.conch import telnet from twisted.conch.insults import insults from twisted.internet ...
python
github
https://github.com/scrapy/scrapy
scrapy/extensions/telnet.py
/// Configuration of cg_clif as passed in through `-Cllvm-args` and various env vars. #[derive(Debug)] pub struct BackendConfig { /// Should the crate be AOT compiled or JIT executed. /// /// Defaults to AOT compilation. Can be set using `-Cllvm-args=jit-mode`. pub jit_mode: bool, /// When JIT mode...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_codegen_cranelift/src/config.rs
- targets: ['localhost:9090', 'example.org:443'] labels: foo: bar - null
unknown
github
https://github.com/prometheus/prometheus
discovery/file/fixtures/invalid_nil.yml
# -*- coding: utf-8 -*- """ pygments.formatters._mapping ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter mapping definitions. This file is generated by itself. Everytime you change something on a builtin formatter definition, run this script from the formatters folder to update it. Do not alter the FOR...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 """ Unit Tests for sickbeard/numdict.py """ # pylint: disable=line-too-long import os.path import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lib'))) sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from sickbea...
unknown
codeparrot/codeparrot-clean
/* Copyright (c) 2024, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not lim...
c
github
https://github.com/mysql/mysql-server
components/keyrings/keyring_file/option_usage.h
from __future__ import absolute_import from django.conf import settings try: from django.conf.urls import url, patterns except ImportError: # for Django version less than 1.4 from django.conf.urls.defaults import url, patterns # NOQA from django.http import HttpResponse def handler404(request): retu...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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 v...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2011 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
java
github
https://github.com/google/guava
android/guava-testlib/src/com/google/common/collect/testing/google/MultisetIteratorTester.java
# Copyright (c) 2016 EMC 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 requir...
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
package container const ( // ChangeModify represents the modify operation. ChangeModify ChangeType = 0 // ChangeAdd represents the add operation. ChangeAdd ChangeType = 1 // ChangeDelete represents the delete operation. ChangeDelete ChangeType = 2 ) func (ct ChangeType) String() string { switch ct { case Chan...
go
github
https://github.com/moby/moby
api/types/container/change_types.go
import superdesk from bs4 import BeautifulSoup from superdesk.metadata.item import ITEM_TYPE, CONTENT_TYPE from flask import render_template from jinja2 import Template def getTemplate(highlightId): """Return the string template associated with highlightId or none """ if not highlightId: return None ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import numpy as np from .mesh import MeshVisual from ..geometry import MeshData class SurfacePlotVisual(MeshVisual): """Displays a surfa...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 Nebula, 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 agree...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import datetime from typing import Union import pydantic from openai import _compat from openai._utils._json import openapi_dumps class TestOpenapiDumps: def test_basic(self) -> None: data = {"key": "value", "number": 42} json_bytes = openapi_dumps(data) ...
python
github
https://github.com/openai/openai-python
tests/test_utils/test_json.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import apps.users.models class Migration(migrations.Migration): dependencies = [ ('users', '0006_auto_20150422_1649'), ] operations = [ migrations.Alt...
unknown
codeparrot/codeparrot-clean
import optparse from html2text.compat import urllib from html2text import HTML2Text, config, __version__ from html2text.utils import wrapwrite, wrap_read def main(): baseurl = '' class bcolors: # pragma: no cover HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WA...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.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 Lice...
unknown
codeparrot/codeparrot-clean
#/*########################################################################## # Copyright (C) 2004-2012 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # # This toolkit is free software; you can redistribute it and/or m...
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/kernels/tile_ops_impl.h
// Copyright 2022 The Abseil 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 by applicable law or agr...
c
github
https://github.com/mysql/mysql-server
extra/abseil/abseil-cpp-20230802.1/absl/log/internal/test_matchers.h
from typing import Callable, List, Dict, Optional import numpy as np from typeguard import check_argument_types from neuralmonkey.model.model_part import ModelPart from neuralmonkey.decoders.beam_search_decoder import (BeamSearchDecoder, SearchStepOutput) from ne...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import datetime import os import re import sys from unittest import skipIf import warnings from xml.dom.minidom import parseString try: import pytz except ImportError: pytz = None from django.conf import settings from django.core import serializers from django.core.url...
unknown
codeparrot/codeparrot-clean
// Formatting library for C++ - legacy printf implementation // // Copyright (c) 2012 - 2016, Victor Zverovich // All rights reserved. // // For the license information refer to format.h. #ifndef FMT_PRINTF_H_ #define FMT_PRINTF_H_ #ifndef FMT_MODULE # include <algorithm> // std::max # include <limits> // std:...
c
github
https://github.com/nodejs/node
deps/LIEF/third-party/spdlog/include/spdlog/fmt/bundled/printf.h
try: from setuptools import setup except: from distutils.core import setup import cloudenvy.metadata def parse_requirements(requirements_filename='requirements.txt'): requirements = [] with open(requirements_filename) as requirements_file: for requirement in requirements_file: requ...
unknown
codeparrot/codeparrot-clean
import json from social.tests.backends.oauth import OAuth2Test class MixcloudOAuth2Test(OAuth2Test): backend_path = 'social.backends.mixcloud.MixcloudOAuth2' user_data_url = 'https://api.mixcloud.com/me/' expected_username = 'foobar' access_token_body = json.dumps({ 'access_token': 'foobar', ...
unknown
codeparrot/codeparrot-clean
use serde_derive::Deserialize; #[derive(Deserialize)] #[serde(field_identifier)] enum F { A, #[serde(other)] Other(u8, u8), } fn main() {}
rust
github
https://github.com/serde-rs/serde
test_suite/tests/ui/identifier/not_unit.rs
[ {"pk": 1, "model": "fixtures_regress.parent", "fields": {"name": "fred"}}, {"pk": 1, "model": "fixtures_regress.child", "fields": {"data": "apple"}} ]
json
github
https://github.com/django/django
tests/fixtures_regress/fixtures/model-inheritance.json
import { report } from "../tick"; import "./b"; report("c");
javascript
github
https://github.com/webpack/webpack
test/cases/async-modules/micro-ticks-parents/case-a/c.js
# (C) British Crown Copyright 2013 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Dan Levin <dlevin@net.t-labs.tu-berlin.de> # Brandon Heller <brandonh@stanford.edu> import json import logging from math import floor, pi, sin from random import choice, randint, random import random import unittest def unit_workload(sw, size, duration, numreqs): """ Return workload desc...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 Google, Inc. # Copyright 2014 Thomas Amland <thomas.amland@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "cases/helper" module ActiveModel module Type class BooleanTest < ActiveModel::TestCase def test_type_cast_boolean type = Type::Boolean.new assert_nil type.cast("") assert_nil type.cast(nil) assert type.cast(true) assert type.c...
ruby
github
https://github.com/rails/rails
activemodel/test/cases/type/boolean_test.rb
# # The Python Imaging Library. # $Id$ # # global image statistics # # History: # 1996-04-05 fl Created # 1997-05-21 fl Added mask; added rms, var, stddev attributes # 1997-08-05 fl Added median # 1998-07-05 hk Fixed integer overflow error # # Notes: # This class shows how to implement delayed evaluation of att...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import csv import json from datetime import date from unittest import mock from django.http import Http404 from django.test.client import RequestFactory from django.utils.encoding import force_text from olympia import amo from olympia.access.models import Group, GroupUser from olympia.addons....
unknown
codeparrot/codeparrot-clean
from bpy import data, types from .. import utilities, logger def _lamp(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :param *args: :param **kwargs: """ if isinstance(name, types.Lamp): lamp = name ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals from tests.utils import BaseTestCase, smtp_send_email, send_email_plain, prepare_send_to_field, SendEmailError,\ InvalidStatus from lathermail.utils import utcnow class ApiTestCase(BaseTestCase): def test_send_and_search(self): to_tuple ...
unknown
codeparrot/codeparrot-clean
import os, sys import freesound as fs import json # obtain the API key from freesound.org and add it here Key = "????????????" descriptors = [ 'lowlevel.spectral_centroid.mean', 'lowlevel.spectral_centroid.var', 'lowlevel.mfcc.mean', 'lowlevel.mfcc.var', ...
unknown
codeparrot/codeparrot-clean
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
unknown
codeparrot/codeparrot-clean
// This file was automatically generated from coroutines-basics.md by Knit tool. Do not edit. package kotlinx.coroutines.guide.exampleBasic03 import kotlinx.coroutines.* fun main() = runBlocking { doWorld() } suspend fun doWorld() = coroutineScope { // this: CoroutineScope launch { delay(1000L) ...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/jvm/test/guide/example-basic-03.kt
package kotlinx.coroutines /** * [CoroutineDispatcher] that provides a method to close it, * causing the rejection of any new tasks and cleanup of all underlying resources * associated with the current dispatcher. * Examples of closeable dispatchers are dispatchers backed by `java.lang.Executor` and * by `kotlin....
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/common/src/CloseableCoroutineDispatcher.kt
config: trigger-phrase: '.*run\W+elasticsearch-ci/bwc.*' skip-labels: - ">test-mute" - "test-full-bwc" steps: - group: bwc-snapshots steps: - label: "{{matrix.BWC_VERSION}} / bwc-snapshots" command: .ci/scripts/run-gradle.sh -Dignore.tests.seed v{{matrix.BWC_VERSION}}#bwcTest tim...
unknown
github
https://github.com/elastic/elasticsearch
.buildkite/scripts/pull-request/mocks/pipelines/bwc-snapshots.yml
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
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...
unknown
codeparrot/codeparrot-clean
from copy import deepcopy from flask import current_app, request from werkzeug.datastructures import MultiDict, FileStorage from werkzeug import exceptions import flask_restful import decimal import six class Namespace(dict): def __getattr__(self, name): try: return self[name] except Ke...
unknown
codeparrot/codeparrot-clean
// errorcheck -0 -m //go:build !goexperiment.newinliner // Copyright 2010 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. // Test, using compiler diagnostic flags, that the escape analysis is working. // Compiles but does no...
go
github
https://github.com/golang/go
test/escape4.go
# -*- coding: utf-8 -*- #*************************************************************************** #* (c) Jonathan Wiedemann (jonatan@wiedemann.fr) 2013 * #* * #* This file is part of the FreeCAD CAx development system. ...
unknown
codeparrot/codeparrot-clean
:host { display: block; .docs-dark-mode & { .adev-embedded-editor-preview-container { background: var(--gray-100); } } // account for tabs height height: calc(100% - 50px); // If preview has error, make it scrollable &:has(.adev-preview-error) { .adev-embedded-editor-preview-container ...
unknown
github
https://github.com/angular/angular
adev/src/app/editor/preview/preview.component.scss
from math import sqrt import numpy as np ''' *********************** USER-PARAMETERS *********************** ''' ''' INITIAL STATE PARAMETERS ''' MAX_TEST_DURATION = 6000; dt = 1e-3; model_path = ["/home/adelpret/devel/sot_hydro/install/share"]; urdfFileName ...
unknown
codeparrot/codeparrot-clean
"""EdX Branding API Provides a way to retrieve "branded" parts of the site, such as the site footer. This information exposed to: 1) Templates in the LMS. 2) Consumers of the branding API. This ensures that branded UI elements such as the footer are consistent across the LMS and other sites (such as the marketing si...
unknown
codeparrot/codeparrot-clean
//! An example of hooking up stdin/stdout to a TCP stream. //! //! This example will connect to a socket address specified in the argument list //! and then forward all data read on stdin to the server, printing out all data //! received on stdout. Each line entered on stdin will be translated to a TCP //! packet which...
rust
github
https://github.com/tokio-rs/tokio
examples/connect-tcp.rs
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Console; use Symfony\Bundle\Framew...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php
try: import siconos.kernel as SK except (ImportError): print('Could not import Siconos.* module') import numpy class MyR(SK.FirstOrderNonLinearR): # \brief Constructor # # \param is a (optional) def __init__(self, C, B): SK.FirstOrderNonLinearR.__init__(self) self._kappa = ....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: iso-8859-15 -*- import wx import wx.stc as stc import keyword #----------------------------------------- # History widget for IPython __version__ = 0.5 __author__ = "Laurent Dufrechou" __email__ = "laurent.dufrechou _at_ gmail.com" __license__ = "BSD" #-----------------------------...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import errno import os import tempfile class Pidfile(object): """\ Manage a PID file. If a specific name is provided it and '"%s.oldpid" % name' will be used. Otherwise we cre...
unknown
codeparrot/codeparrot-clean
#!ruby require "pathname" require "open3" Pathname.glob("**/*.gcda").sort.each do |gcda| if gcda.fnmatch("ext/*") cwd, gcda = gcda.split.map {|s| s.to_s } objdir = "." elsif gcda.fnmatch("rubyspec_temp/*") next else cwd, objdir, gcda = ".", gcda.dirname.to_s, gcda.to_s end puts "$ gcov -lpbc ...
ruby
github
https://github.com/ruby/ruby
tool/run-gcov.rb
""" Generally useful functions and classes used in this package. """ from collections import OrderedDict ################################################################################ # dict related def merge_dicts(*args, **kwargs): """ Merge dictionaries. Values in later args override former with the same...
unknown
codeparrot/codeparrot-clean
// // Code generated by grafana-app-sdk. DO NOT EDIT. // package v0alpha1 import ( "github.com/grafana/grafana-app-sdk/resource" ) // schema is unexported to prevent accidental overwrites var ( schemaCheck = resource.NewSimpleSchema("advisor.grafana.app", "v0alpha1", NewCheck(), &CheckList{}, resource.WithKind("Ch...
go
github
https://github.com/grafana/grafana
apps/advisor/pkg/apis/advisor/v0alpha1/check_schema_gen.go
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package consul const ( ObservationTypeConsulConfigAccessWrite = "consul/config/access/write" ObservationTypeConsulConfigAccessRead = "consul/config/access/read" ObservationTypeConsulRoleWrite = "consul/role/write" ObservationTypeConsulRoleR...
go
github
https://github.com/hashicorp/vault
builtin/logical/consul/observation_consts.go
import unittest from malcolm.core import Controller, Process from malcolm.modules.builtin.parts import ChoicePart class TestChoicePart(unittest.TestCase): def setUp(self): self.o = ChoicePart( name="cp", description="desc", choices=["a", "b"], value="a", writeable=True ) self.c...
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 applica...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- encoding: utf-8 -*- '''Unit tests for the display module''' # For testing purposes, clobber the rcfile import matplotlib matplotlib.use('Agg') # nopep8 import matplotlib.pyplot as plt import numpy as np # Import the hacked image comparison module from mpl_ic import image_comparison fro...
unknown
codeparrot/codeparrot-clean
<?php declare(strict_types=1); /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Test\Co...
php
github
https://github.com/composer/composer
tests/Composer/Test/Command/ConfigCommandTest.php
/* * 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/metrics2/MetricType.java
#!/usr/bin/python ################################################################################ # # Module: File.py # # Author: Paul Tindle ( mailto:Paul@Tindle.org ) # Joe White( mailto:joe@stoke.com ) # # Descr: Subs for file IO # # Version: (See below) $Id$ # # Changes: Conversion to Pytho...
unknown
codeparrot/codeparrot-clean
#-*- coding:utf8 -*- from parsers import TParsersBundle from ling_utils import TTokenMatch from ling_utils import CASE_UPPER, CASE_TITLE, CASE_LOWER from ling_utils import span_tokenize_windows1251, unify_word from segments_index import TSegmentIndexReader from crawler import * from collections import namedtuple impor...
unknown
codeparrot/codeparrot-clean
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that th...
c
github
https://github.com/opencv/opencv
3rdparty/openexr/Imath/ImathLimits.h
from __future__ import absolute_import from io import BytesIO from xml.dom import minidom import zipfile from django.conf import settings from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import HAS_SPATIAL_DB from django.contrib.sites.models import Site from django.test import TestCase...
unknown
codeparrot/codeparrot-clean
#encoding=utf-8 from __future__ import print_function import sys sys.path.append("../") import jieba def cuttest(test_sent): result = jieba.cut(test_sent,cut_all=True) for word in result: print(word, "/", end=' ') print("") if __name__ == "__main__": cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和...
unknown
codeparrot/codeparrot-clean
import arrow import discord from sigma.core.utilities.data_processing import get_image_colors from sigma.core.utilities.data_processing import user_avatar async def myreminders(cmd, message, args): here = False if args: if args[-1].lower() == 'here': here = True if here: lookup...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013, 2014 CERN. ## ## Invenio 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 opt...
unknown
codeparrot/codeparrot-clean
ErrorCodes::Error(1); ErrorCodes::Error(2); ErrorCodes::Error(3); ErrorCodes::Error(2);
cpp
github
https://github.com/mongodb/mongo
buildscripts/tests/data/errorcodes/dup_checking/file1.cpp
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation; All # Rights Reserved # # This is a backport from python 3.4 into python 2.7. Text and exclusive mode # support are removed as they're unsupported in 2.7. This backport patc...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2021 Google 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 applica...
c
github
https://github.com/opencv/opencv
3rdparty/flatbuffers/include/flatbuffers/struct.h
"""This tutorial introduces the LeNet5 neural network architecture using Theano. LeNet5 is a convolutional neural network, good for classifying images. This tutorial shows how to build the architecture, and comes with all the hyper-parameters you need to reproduce the paper's MNIST results. This implementation simpli...
unknown
codeparrot/codeparrot-clean
""" Test the Studio help links. """ from flaky import flaky from unittest import skip from common.test.acceptance.fixtures.course import XBlockFixtureDesc from common.test.acceptance.tests.studio.base_studio_test import StudioCourseTest, ContainerBase from common.test.acceptance.pages.studio.index import DashboardPag...
unknown
codeparrot/codeparrot-clean
from datetime import datetime, time from django.template.defaultfilters import date from django.test import SimpleTestCase from django.utils import timezone, translation from ..utils import setup from .timezone_utils import TimezoneTestCase class DateTests(TimezoneTestCase): @setup({"date01": '{{ d|date:"m" }}'}...
python
github
https://github.com/django/django
tests/template_tests/filter_tests/test_date.py
import PostPreview from "./post-preview"; import Post from "../types/post"; type Props = { posts: Post[]; }; export default function MoreStories({ posts }: Props) { return ( <section> <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> ...
typescript
github
https://github.com/vercel/next.js
examples/cms-umbraco/components/more-stories.tsx
"""Native adapter for serving CherryPy via its builtin server.""" import logging try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import cherrypy from cherrypy._cperror import format_exc, bare_error from cherrypy.lib import httputil from cherrypy import wsgiserver class N...
unknown
codeparrot/codeparrot-clean
apiVersion: v1 kind: ServiceAccount metadata: name: metadata-agent namespace: kube-system labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile --- kind: DaemonSet apiVersion: apps/v1 metadata: labels: app: metadata-agent kubernetes.io/cluster-service: "true" ...
unknown
github
https://github.com/kubernetes/kubernetes
cluster/addons/metadata-agent/stackdriver/metadata-agent.yaml
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef BLK_STAT_H #define BLK_STAT_H #include <linux/kernel.h> #include <linux/blkdev.h> #include <linux/ktime.h> #include <linux/rcupdate.h> #include <linux/timer.h> /** * struct blk_stat_callback - Block statistics callback. * * A &struct blk_stat_callback is associated wi...
c
github
https://github.com/torvalds/linux
block/blk-stat.h
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.webrtc.rs import io.ktor.client.webrtc.* import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch import uniffi.ktor_clie...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-webrtc/ktor-client-webrtc-rs/common/src/io/ktor/client/webrtc/rs/MediaTrack.kt
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generates a sysroot tarball for building a specific package. Meant for use after setup_board and build_packages have been run. "...
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 applica...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.network.sockets.tests import io.ktor.network.selector.* import io.ktor.test.dispatcher.* import kotlinx.coroutines.* import kotlin.coroutines.* import kotlin.test.* class Sel...
kotlin
github
https://github.com/ktorio/ktor
ktor-network/nix/test/io/ktor/network/sockets/tests/SelectNixTest.kt
from django.core.management.base import BaseCommand, CommandError from django.db import transaction from slugify import slugify from categories.models import Category from categories.settings import SLUG_TRANSLITERATOR class Command(BaseCommand): """Import category trees from a file.""" help = "Imports cate...
unknown
codeparrot/codeparrot-clean
from openerp import models from openerp.tools import mute_logger from openerp.osv.orm import except_orm from openerp.tests import common class TestAPI(common.TransactionCase): """ test the new API of the ORM """ def assertIsRecordset(self, value, model): self.assertIsInstance(value, models.BaseModel) ...
unknown
codeparrot/codeparrot-clean