code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
h1.svelte-xyz /* (unused) h2*/ { color: red; }
css
github
https://github.com/sveltejs/svelte
packages/svelte/tests/css/samples/unused-selector-trailing/expected.css
"""Battery Charge and Range Support for the Nissan Leaf.""" import logging from homeassistant.const import DEVICE_CLASS_BATTERY from homeassistant.helpers.icon import icon_for_battery_level from homeassistant.util.distance import LENGTH_KILOMETERS, LENGTH_MILES from homeassistant.util.unit_system import IMPERIAL_SYSTE...
unknown
codeparrot/codeparrot-clean
import os from time import strftime import random from boxbranding import getMachineBrand, getMachineName from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation, ePicLoad from ServiceReference import ServiceReference from Screens.Screen import Screen from Screens.HelpMenu import HelpableScre...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2010-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, Eucalyptus Systems, Inc. # # 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, includin...
unknown
codeparrot/codeparrot-clean
version: 2 sphinx: builder: html configuration: docs/src/conf.py fail_on_warning: false build: os: "ubuntu-22.04" tools: python: "3.9" python: install: - requirements: docs/requirements.txt
unknown
github
https://github.com/nodejs/node
deps/uv/.readthedocs.yaml
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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 vers...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/input/pwm-beeper.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: PWM beeper maintainers: - Sascha Hauer <s.hauer@pengutronix.de> properties: compatible: const: pwm-beeper pwms: ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/input/pwm-beeper.yaml
# 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 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
prompb/io/prometheus/client/decoder.go
use crate::lib::*; use crate::de::{ Deserialize, Deserializer, EnumAccess, Error, MapAccess, SeqAccess, VariantAccess, Visitor, }; /// An efficient way of discarding data from a deserializer. /// /// Think of this like `serde_json::Value` in that it can be deserialized from /// any type, except that it does not s...
rust
github
https://github.com/serde-rs/serde
serde_core/src/de/ignored_any.rs
import re import subprocess import os import platform #tool_pwd=os.path.normpath(os.getcwd()+r'/packages/realtek_ameba/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/soc/realtek/8711b/misc/iar_utility/common/tools') pwd=[] def findfile(path,filename): for x in os.listdir(path): if x=='8195a': continu...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
unknown
codeparrot/codeparrot-clean
name: Deploy pr preview on: pull_request: types: - opened - synchronize - closed paths: - "docs/sources/**" permissions: {} jobs: deploy-pr-preview: permissions: contents: read # Clone repositories. id-token: write # Fetch Vault secrets. pull-requests: write ...
unknown
github
https://github.com/grafana/grafana
.github/workflows/deploy-pr-preview.yml
# -*- coding: utf-8 -*- from module.plugins.internal.MultiAccount import MultiAccount from module.plugins.internal.misc import json class RPNetBiz(MultiAccount): __name__ = "RPNetBiz" __type__ = "account" __version__ = "0.19" __status__ = "testing" __config__ = [("mh_mode" , "all;listed...
unknown
codeparrot/codeparrot-clean
import os import leveldb import time import threading import random import shutil import socket import base64 import cPickle import marshal import json import hashlib SERIALIZER = cPickle from kunai.stats import STATS from kunai.log import logger from kunai.threadmgr import threader from kunai.now import NOW # Will h...
unknown
codeparrot/codeparrot-clean
// Copyright 2020 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql import ( "context" "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroac...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/schema_changer_metrics.go
/* * 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/security/oauthbearer/internals/secured/Retryable.java
#!/bin/bash # # Copyright 2010-2025 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. # # Script to convert Space CODEOWNERS to matching GitHub CODEOWNERS # 1. Copies CODEOWNERS file to .git...
unknown
github
https://github.com/JetBrains/kotlin
.space/generate-github-codeowners.sh
//go:build !windows /* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
go
github
https://github.com/kubernetes/kubernetes
cmd/kubeadm/app/componentconfigs/kubelet_unix_test.go
<?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\Package...
php
github
https://github.com/composer/composer
src/Composer/Package/CompleteAliasPackage.php
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
unknown
codeparrot/codeparrot-clean
/* * Make sure that listCommands on sharded clusters doesn't require authentication. * @tags: [requires_sharding] */ import {runTest} from "jstests/auth/listcommands_preauth_base.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 1, mongos: 1, config: 1, other: {key...
javascript
github
https://github.com/mongodb/mongo
jstests/auth/listcommands_preauth_sharded_cluster.js
# -*- coding: utf-8 -*- # # SelfTest/Util/test_number.py: Self-test for parts of the Crypto.Util.number module # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # th...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ utils ~~~~~ Provides miscellaneous utility methods """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) import requests import itertools as it from tempfile import SpooledTempor...
unknown
codeparrot/codeparrot-clean
"""Various utilities that are handy.""" import codecs import os import os.path import re import subprocess import sys def get_git_branch(): """Return the git branch version.""" if not os.path.exists(".git") or not os.path.isdir(".git"): return None version = open(".git/HEAD", "r").read().strip() ...
python
github
https://github.com/mongodb/mongo
buildscripts/utils.py
# Copyright 2011 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 a...
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.utils.io.charsets import io.ktor.utils.io.core.* import kotlinx.io.* import kotlinx.io.Buffer public actual abstract class Charset(internal val _name: String) { public ac...
kotlin
github
https://github.com/ktorio/ktor
ktor-io/wasmJs/src/io/ktor/utils/io/charsets/Encoding.wasmJs.kt
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from shutil import copystat from django.core.files import locks __all__ = ['file_move_safe'] def _samefile(src, dst): # Macintosh, Unix. ...
unknown
codeparrot/codeparrot-clean
// boost/chrono/config.hpp -------------------------------------------------// // Copyright Beman Dawes 2003, 2006, 2008 // Copyright 2009-2011 Vicente J. Botet Escriba // Copyright (c) Microsoft Corporation 2014 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/chrono/config.hpp
"""The WaveBlocks Project This file contains the basic interface for general wavepackets. @author: R. Bourquin @copyright: Copyright (C) 2012, 2013, 2014, 2016 R. Bourquin @license: Modified BSD License """ from numpy import array, complexfloating, cumsum, vsplit, vstack, zeros, conjugate from scipy import sqrt from...
unknown
codeparrot/codeparrot-clean
import viper.lexer as vl import viper.parser.ast.nodes as ns tree = ns.FileInput([ ns.FileStmt(ns.FuncDef( vl.Name('fib'), [ns.Parameter(None, vl.Name('n'), vl.Class('Int'))], vl.Class('Int'), ns.CompoundStmtBlock([ ns.IfStmt( ...
unknown
codeparrot/codeparrot-clean
""" Course Outline page in Studio. """ import datetime from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from ..common.utils import click_css, confirm_prompt from .course_page import ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python2 # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env bash # Copyright 2022 The Cockroach Authors. # # Use of this software is governed by the CockroachDB Software License # included in the /LICENSE file. set -euo pipefail dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))" source "$dir/release/teamcity-support.sh" source "$dir/teamcity-b...
unknown
github
https://github.com/cockroachdb/cockroach
build/teamcity/internal/release/process/make-and-publish-build.sh
/* * 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
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java
from django.db.backends.utils import names_digest, split_identifier from django.db.models.expressions import Col, ExpressionList, F, Func, OrderBy from django.db.models.functions import Collate from django.db.models.query_utils import Q from django.db.models.sql import Query from django.utils.functional import partitio...
unknown
codeparrot/codeparrot-clean
""" Define a Document Schema for the Monkey document. """ import ring from mongoengine import ( BooleanField, DateTimeField, Document, DoesNotExist, DynamicField, EmbeddedDocumentField, ListField, ReferenceField, StringField, ) from common.cloud import environment_names from monkey_...
unknown
codeparrot/codeparrot-clean
""" Tests for XML importer. """ import mock from xblock.core import XBlock from xblock.fields import String, Scope, ScopeIds from xblock.runtime import Runtime, KvsFieldData, DictKeyValueStore from xmodule.x_module import XModuleMixin from opaque_keys.edx.locations import Location from xmodule.modulestore import Module...
unknown
codeparrot/codeparrot-clean
# Copyright 2025 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 applicabl...
python
github
https://github.com/huggingface/transformers
utils/compare_test_runs.py
import {useNoAlias} from 'shared-runtime'; function Component(props) { const item = {a: props.a}; const x = useNoAlias(item, () => { console.log(props); }, [props.a]); return [x, item]; } export const FIXTURE_ENTRYPOINT = { fn: Component, params: [{a: {id: 42}}], isComponent: true, };
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-noAlias.js
extension Validator where T: Collection { /// Validates that the data's count is within the supplied `ClosedRange`. public static func count(_ range: ClosedRange<Int>) -> Validator<T> { .count(min: range.lowerBound, max: range.upperBound) } /// Validates that the data's count is less than or eq...
swift
github
https://github.com/vapor/vapor
Sources/Vapor/Validation/Validators/Count.swift
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import BaseHTTPServer import json import os import os.path import re import subprocess import sys import tempfile import urllib2 # Grab the script path because that is where all the static assets are SCRIPT_DIR = os.path.d...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2017 Fujitsu Limited # 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 requi...
unknown
codeparrot/codeparrot-clean
# (c) 2014 Deutsche Telekom AG # Copyright 2014 Red Hat, Inc. # Copyright 2014 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...
unknown
codeparrot/codeparrot-clean
import inspect import os import re from importlib import import_module from django.apps import apps from django.conf import settings from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required from django.contrib.admindocs import utils from django.core import urlresolvers f...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (c) 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementatio...
unknown
codeparrot/codeparrot-clean
--- mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket.html --- # Bucket [search-aggregations-bucket] Bucket aggregations don’t calculate metrics over fields like the metrics aggregations do, but instead, they create buckets of documents. Each bucket is associ...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/aggregations/bucket.md
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class Z...
unknown
codeparrot/codeparrot-clean
from emdp.gridworld import builder_tools from emdp import actions import numpy as np TEST_CASE_SIZE = 3 def _create_tmb(): tmb = builder_tools.TransitionMatrixBuilder( TEST_CASE_SIZE, has_terminal_state=False) tmb.add_grid(p_success=0.9) return tmb def test_corner_wall(): # Wall in top left ...
unknown
codeparrot/codeparrot-clean
#!/bin/sh test_description='tests for ref^{stuff}' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh test_expect_success 'setup' ' echo blob >a-blob && git tag -a -m blob blob-tag $(git hash-object -w a-blob) && mkdir a-tree && echo moreblobs >a-tree/another-b...
unknown
github
https://github.com/git/git
t/t1511-rev-parse-caret.sh
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usag...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import random from collections import deque from datetime import datetime from time import time from typing import TYPE_CHECKING, Any from twisted.internet.defer import Deferred, inlineCallbacks from twisted.python.failure import Failure from scrapy import Request, Spider, signals ...
python
github
https://github.com/scrapy/scrapy
scrapy/core/downloader/__init__.py
''' Android GPS ----------- ''' from plyer.facades import GPS from plyer.platforms.android import activity from jnius import autoclass, java_method, PythonJavaClass Looper = autoclass('android.os.Looper') LocationManager = autoclass('android.location.LocationManager') Context = autoclass('android.content.Context') c...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 """ VarnishCollector grabs stats from Varnish and submits them the Graphite #### Dependencies * /usr/bin/varnishstat """ import diamond.collector import re import subprocess from diamond.collector import str_to_bool class VarnishCollector(diamond.collector.Collector): _RE = re.compile("^(?P<s...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python from webapp.model import Song, Songbook, hub try: # try c version for speed then fall back to python import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET import xml.parsers.expat import webapp.c_utilities as c from posixpath import * import turbogears impo...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 IBM Corp. # 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 app...
unknown
codeparrot/codeparrot-clean
// Just show the page "a" var render = require("./render"); render(require("./aPage"));
javascript
github
https://github.com/webpack/webpack
examples/hybrid-routing/aEntry.js
from flask import Flask from flask_restful import abort, Api, fields, marshal_with, reqparse, Resource from datetime import datetime from models import MessageModel import status from pytz import utc class MessageManager(): last_id = 0 def __init__(self): self.messages = {} def insert_message(self...
unknown
codeparrot/codeparrot-clean
"""Unit tests for discovery subcommand.""" import unittest from unittest.mock import MagicMock import buildscripts.resmokelib.discovery as under_test from buildscripts.resmokelib.testing.suite import Suite class TestTestDiscoverySubCommand(unittest.TestCase): def test_gather_tests_should_return_discovered_tests(...
python
github
https://github.com/mongodb/mongo
buildscripts/tests/resmokelib/discovery/test_discovery.py
import warnings from django.test import TestCase from django.db import models class FieldDeconstructionTests(TestCase): """ Tests the deconstruct() method on all core fields. """ def test_name(self): """ Tests the outputting of the correct name if assigned one. """ # Fi...
unknown
codeparrot/codeparrot-clean
from core.himesis import Himesis class HeclassOUTeSuperTypesSolveRefEClassEClassEClassEClass(Himesis): def __init__(self): """ Creates the himesis graph representing the AToM3 model HeclassOUTeSuperTypesSolveRefEClassEClassEClassEClass. """ # Flag this instance as compiled now ...
unknown
codeparrot/codeparrot-clean
def same_Length(A,B): while (A > 0 and B > 0): A = A / 10; B = B / 10; if (A == 0 and B == 0): return True; return False;
unknown
mbpp
// 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/fileutil/mmap_windows.go
# -*- coding: utf-8 -*- # Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2007,2008 Frank Scholz <coherence@beebits.net> import time import re import os.path import mimetools,mimetypes from datetime import datetime from email.Utils import parsedate_tz try: import hash...
unknown
codeparrot/codeparrot-clean
from sfa.rspecs.elements.disk_image import DiskImage class Image: def __init__(self, image=None): if image is None: image={} self.id = None self.container_format = None self.kernel_id = None self.ramdisk_id = None self.properties = None self.name = None ...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.webrtc.rs import io.ktor.client.webrtc.* import io.ktor.client.webrtc.rs.utils.* import io.ktor.utils.io.ExperimentalKtorApi import kotlinx.coroutines.CoroutineExceptio...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-webrtc/ktor-client-webrtc-rs/common/test/io/ktor/client/webrtc/rs/WebRtcEngineTest.kt
<!--- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
unknown
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/site/markdown/release/1.0.0/RELEASENOTES.1.0.0.md
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import RegexValidator from django.forms import ( Boolean...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import requests import re from in_file import InFile BRANCH_FORMAT = "https://src.chromium.org/blink/branches/chromium/%s/%s" TRUNK_PATH = "Source/platform/RuntimeEnabledFeatures.in" TRUNK_URL = "https://src.chromium.org/blink/trunk/%s" % TRUNK_PATH def features_path(branch): # RuntimeEnabl...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2012-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-boot
buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/LogUpdateEventTests.java
// 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
util/testutil/synctest/enabled.go
# YARV tool to parse assembly output. stat = {} while line = ARGF.gets if /\[start\] (\w+)/ =~ line name = $1 puts '--------------------------------------------------------------' puts line size = 0 len = 0 while line = ARGF.gets if /\[start\] (\w+)/ =~ line puts "\t; # lengt...
ruby
github
https://github.com/ruby/ruby
tool/asm_parse.rb
//go:build !linux package libnetwork import "github.com/moby/moby/api/types/system" // FirewallBackend returns the name of the firewall backend for "docker info". func (c *Controller) FirewallBackend() *system.FirewallInfo { return nil } // enabledIptablesVersions is a no-op on non-Linux systems. func (c *Controll...
go
github
https://github.com/moby/moby
daemon/libnetwork/controller_others.go
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/mmc/amlogic,meson-mx-sdio.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Amlogic Meson6, Meson8 and Meson8b SDIO/MMC controller description: | The highspeed MMC host controller on Amlogic ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml
#!/bin/sh # # Copyright (c) 2007, 2009 Sam Vilain # test_description='git-svn svn mergeinfo properties' . ./lib-git-svn.sh test_expect_success 'load svn dump' " svnadmin load -q '$rawsvnrepo' \ <'$TEST_DIRECTORY/t9151/svn-mergeinfo.dump' && git svn init --minimize-url -R svnmerge \ --rewrite-root=http://svn....
unknown
github
https://github.com/git/git
t/t9151-svn-mergeinfo.sh
""" The MIT License (MIT) Copyright (c) 2016, Mark Rogaski 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, merg...
unknown
codeparrot/codeparrot-clean
""" URLconf for tests.py usage. """ from __future__ import unicode_literals from django.conf import settings try: from django.conf.urls import patterns, include, url # django 1.4 except ImportError: from django.conf.urls.defaults import * # "patterns, include, url" is enough for django 1.3, "*" for django 1...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python import argparse import csv import sys # In order to work with kive, scripts which having a inputs # and b inputs must have a+b command line arguments, the first a # arguments specifying paths of input files, the subsequent b # arguments specifying the paths of where outputs are written] script...
unknown
codeparrot/codeparrot-clean
import unittest from dht import constants, contact, kbucket, routingtable, util class TestRoutingTable(unittest.TestCase): """Test implementation of RoutingTable.""" @classmethod def setUpClass(cls): cls.range_min = 0 cls.range_max = 2**constants.BIT_NODE_ID_LEN cls.own_num_guid ...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function import serial, struct, time, collections import numpy as np try: # this is nicer because it provides deadlock debugging information from acq4.util.Mutex import RecursiveMutex as RLock except ImportError: from threading import RLock try: from ..SerialDevice import ...
unknown
codeparrot/codeparrot-clean
""" Decorators for views based on HTTP headers. """ from django.utils.decorators import decorator_from_middleware from django.middleware.http import ConditionalGetMiddleware from django.http import HttpResponseNotAllowed conditional_page = decorator_from_middleware(ConditionalGetMiddleware) def require_http_methods(...
unknown
codeparrot/codeparrot-clean
/* SPDX-License-Identifier: MIT OR Apache-2.0 */ //! IEEE 754-2019 `maximum`. //! //! Per the spec, returns the canonicalized result of: //! - `x` if `x > y` //! - `y` if `y > x` //! - qNaN if either operation is NaN //! - Logic following +0.0 > -0.0 //! //! Excluded from our implementation is sNaN handling. use crate...
rust
github
https://github.com/nodejs/node
deps/crates/vendor/libm/src/math/generic/fmaximum.rs
""" Responsible to return the browser configs. """ import configparser import os from driloader.config.config_base import BrowserConfigBase class BrowserConfig(BrowserConfigBase): """ Parses the 'browsers.ini' file and return it's values. """ def __init__(self, browser: str): self._browser_na...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module MySQL class TypeMetadata < ActiveSupport::Delegation::DelegateClass(SqlTypeMetadata) # :nodoc: undef to_yaml if method_defined?(:to_yaml) include Deduplicable attr_reader :extra def initial...
ruby
github
https://github.com/rails/rails
activerecord/lib/active_record/connection_adapters/mysql/type_metadata.rb
cnfClass = None class Variable(object): def __init__(self, name, inverted=False): self.name = name self.inverted = inverted def __neg__(self): v = Variable(self.name) v.inverted = not self.inverted return v def __and__(self, other): c = cnfClass.create_from...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: MPL-2.0 package api import ( "context" "net/http" ) func (c *Sys) SealStatus() (*SealStatusResponse, error) { return c.SealStatusWithContext(context.Background()) } func (c *Sys) SealStatusWithContext(ctx context.Context) (*SealStatusResponse, error) ...
go
github
https://github.com/hashicorp/vault
api/sys_seal.go
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Chatham Financial <oss@chathamfinancial.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadat...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import urllib2 def resolvUrl( base, rel ) : urlbase = urllib2.urlparse.urlparse(base) urlrel = urllib2.urlparse.urlparse(rel) urlfinal = ('','','','','','') # Let's assume len(urlrel[0])==0 <=> len(urlrel[1])==0 # (they are both empty or both non empty) # Let's ignore 3 ...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
unknown
codeparrot/codeparrot-clean
#default_value:foo #include: other.manifest # #[test_name.js] # expected: ERROR # # [subtest 1] # expected: # os == win: FAIL #This is a comment # PASS # # TODO: keep comments in the tree from __future__ import unicode_literals import types from cStringIO import StringIO from node import * class Par...
unknown
codeparrot/codeparrot-clean
import hashlib import os import json import random import collections from operator import itemgetter import jinja2 from docutils import nodes from docutils.statemachine import ViewList from docutils.parsers.rst import Directive from docutils.parsers.rst.directives import flag from sphinx.util.nodes import nested_pa...
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
# A pure-python, exact delaunay triangulation. # uses robust_predicates for in-circle tests, follows # the algorithm of CGAL to the extent possible. import logging import pdb logger = logging.getLogger() import six import numpy as np import matplotlib.pyplot as plt # do these work in py2? from ..spatial import robust...
unknown
codeparrot/codeparrot-clean
//===--- XMLUtils.h - Various XML utility routines --------------*- 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/Markup/XMLUtils.h
//! `awc` is an asynchronous HTTP and WebSocket client library. //! //! # `GET` Requests //! ```no_run //! # #[actix_rt::main] //! # async fn main() -> Result<(), awc::error::SendRequestError> { //! // create client //! let mut client = awc::Client::default(); //! //! // construct request //! let req = client.get("http...
rust
github
https://github.com/actix/actix-web
awc/src/lib.rs
# -*- coding: utf-8 -*- # # Copyright 2013 Will Barton. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, thi...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub, actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
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 datetime import asyncio import strawpy import pytz import re import requests import json import discord import os import glob from PIL import Image from PythonGists import PythonGists from discord.ext import commands from cogs.utils.checks import * from bs4 import BeautifulSoup from urllib import parse from urll...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # @@@ START COPYRIGHT @@@ # # 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 Li...
unknown
codeparrot/codeparrot-clean