code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, extract_attributes, float_or_none, int_or_none, try_get, ) class EllenTubeBaseIE(InfoExtractor): def _extract_data_config(self, webpage, video_id): details = self...
unknown
codeparrot/codeparrot-clean
"""CherryPy tools. A "tool" is any helper, adapted to CP. Tools are usually designed to be used in a variety of ways (although some may only offer one if they choose): Library calls: All tools are callables that can be used wherever needed. The arguments are straightforward and should be detailed ...
unknown
codeparrot/codeparrot-clean
from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.shortcuts import render, HttpResponseRedirect from .forms import NewUserForm, UserForm, UserProfileForm def...
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...
python
github
https://github.com/apache/airflow
airflow-core/tests/unit/serialization/definitions/test_assets.py
## Input ```javascript function foo(cond) { let items = []; for (const item of items) { let y = 0; if (cond) { y = 1; } } return items; } export const FIXTURE_ENTRYPOINT = { fn: foo, params: ['TodoAdd'], isComponent: 'TodoAdd', }; ``` ## Code ```javascript import { c as _c } from "r...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-for-of.expect.md
/* 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/ELF/NoteDetails/QNXStack.hpp
"""Global context for install engine. Currently, this is just a bunch of global variables initialized via install_engine.py. Eventually, should refactor into a context object which is passed to each resource manager. """ import os.path import sys import getpass import engage.utils.pw_repository as pwr password_repos...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- # # Copyright 2012 Red Hat, Inc. # # Author: Angus Salkeld <asalkeld@redhat.com> # # 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/licen...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts] //// //// [FunctionPropertyAssignments3_es6.ts] var v = { *{ } } //// [FunctionPropertyAssignments3_es6.js] "use strict"; var v = { *() { } };
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/FunctionPropertyAssignments3_es6.js
#!/usr/bin/python # # File: create_groups.py # # Create all staff_* groups for classes in data directory. import os from django.core.management.base import BaseCommand from django.conf import settings from django.contrib.auth.models import Group from path import Path as path from lxml import etree def create_group...
unknown
codeparrot/codeparrot-clean
import { DEV } from 'esm-env'; var bold = 'font-weight: bold'; var normal = 'font-weight: normal'; /** * MESSAGE * @param {string} PARAMETER */ export function CODE(PARAMETER) { if (DEV) { console.warn( `%c[svelte] ${'CODE'}\n%c${MESSAGE}\nhttps://svelte.dev/e/${'CODE'}`, bold, normal ); } else { ...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/scripts/process-messages/templates/client-warnings.js
#!/usr/bin/env python # Script to analyze code and arrange ld sections. # # Copyright (C) 2008-2010 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import sys # LD script headers/trailers COMMONHEADER = """ /* DO NOT EDIT! This is an autogenerated file....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # This file is part of Gertrude. # # Gertrude 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 optio...
unknown
codeparrot/codeparrot-clean
<!-- Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. SPDX-License-Identifier: curl --> # URL syntax and their use in curl ## Specifications The official "URL syntax" is primarily defined in these two different specifications: - [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) (although URL is call...
unknown
github
https://github.com/curl/curl
docs/URL-SYNTAX.md
import logging import click from flask.cli import with_appcontext from scout.commands.utils import builds_option from scout.export.transcript import export_transcripts from scout.server.extensions import store LOG = logging.getLogger(__name__) @click.command("transcripts", short_help="Export transcripts") @builds_o...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # coding: utf-8 import scrypt password = 'abc123uj' from base64 import b64encode, b64decode import sys, os import marionette_tg.conf password = marionette_tg.conf.get("crypt.scrypt") home = '/home/testuser/.gnupg'#marionette_tg.conf.get("crypt.clienthomedir") clientkey = marionette_tg.conf.get("c...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 right...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 from django.db import models # Create your models here. class Namespace(models.Model): namespace = models.CharField(max_length=255, default='nospace', unique=True) description = models.TextField(null=True, blank=True) def __unicode__(self): r...
unknown
codeparrot/codeparrot-clean
""" Script for exporting all courseware from Mongo to a directory and listing the courses which failed to export """ from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.xml_exporter import export_to_xml from xmodule.modulestore.django import modulestore from xmodule.contentstore.d...
unknown
codeparrot/codeparrot-clean
package jsonlog import ( "testing" "time" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) func TestFastTimeMarshalJSONWithInvalidYear(t *testing.T) { aTime := time.Date(-1, 1, 1, 0, 0, 0, 0, time.Local) _, err := fastTimeMarshalJSON(aTime) assert.Check(t, is.ErrorContains(err, "year outside of rang...
go
github
https://github.com/moby/moby
daemon/logger/jsonfilelog/jsonlog/time_marshalling_test.go
""" Library for managing messages sent to reps and tracking their responses. """ import web from settings import db def save_msg(frm, to, subj, msg, source_id=None, status=None): """saves the given msg and return back msg id. It's assumed that the msg is already sent. msg is always sent from a user to a po...
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/SpringPropertyAction.java
from django.contrib.auth.backends import ModelBackend from .models import CustomUser class CustomUserBackend(ModelBackend): def authenticate(self, request, username=None, password=None): try: user = CustomUser.custom_objects.get_by_natural_key(username) if user.check_password(passw...
python
github
https://github.com/django/django
tests/test_client_regress/auth_backends.py
# This file is part of the Trezor project. # # Copyright (C) 2012-2018 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
unknown
codeparrot/codeparrot-clean
######################################################################### # Reinforcement Tools for printing, saving and loading for RL examples # # Requirements: scipy # # Author: Frank Sehnke, sehnke@in.tum.de ######################################################################### from cPickle import load, dump fr...
unknown
codeparrot/codeparrot-clean
class BaseEventStore(object): max_batch_size = 1 machine_events = False machine_events_url = False last_machine_heartbeats = False probe_events = False probe_events_url = False probe_events_aggregations = False def __init__(self, config_d): self.name = config_d['store_name'] ...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php. """Parse SQL statements.""" __version__ = '0.1.3' class SQLParseError(Exception): """Base class for exceptions in thi...
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. */ mod sink; mod track; use crate::media::MediaCodec::{AudioOpus, VideoH264, VideoVP8}; use crate::rtc::RtcError; use crate::rtc::RtcError::MediaTrackError; use arc_swap::ArcSwapOption; use async...
rust
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-webrtc/ktor-client-webrtc-rs/common/rust/media/mod.rs
# Demonstrate usage of PyMa27 abstract class for the solution of symmetric # systems of linear equations. # Example usage: python demo_ma27.py file1.mtx ... fileN.mtx # where each fileK.mtx is in MatrixMarket format. from nlpy.linalg.pyma27 import PyMa27Context as LBLContext #from nlpy.linalg.pyma57 import PyMa57Conte...
unknown
codeparrot/codeparrot-clean
import re import lib.config as config import lib.util as util from datetime import date def nick_tracker(log_dict, track_users_on_channels = False): """ Tracks all nicks and the identifies nicks which point to same user Args: log_dict(dictionary): with key as dateTime.date object and value as ...
unknown
codeparrot/codeparrot-clean
package image import ( "bytes" "encoding/json" "testing" "github.com/moby/moby/client" iimage "github.com/moby/moby/v2/integration/internal/image" "github.com/moby/moby/v2/internal/testutil/specialimage" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" is "gotest.tools/v3/a...
go
github
https://github.com/moby/moby
integration/image/inspect_test.go
#! /usr/bin/env python from math import sin, pi from MotionModel import MotionModel class SineModel5(MotionModel): '''A five parameter motion model using a Sine wave central pattern.''' '''Typical ranges for the five model parameters, useful for generating neighbors, etc.''' typicalRanges = [(0,...
unknown
codeparrot/codeparrot-clean
import tweepy import logging import time from crawler.src.CRUD import CRUD from crawler.src.db.DBConnection import DBConnection class TwitterApiScrap: """ Define the initial parameters and create the stream object for fetching and storing the tweets. """ def __init__(self, path_home, conn_sec, schema,...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.token import T...
unknown
codeparrot/codeparrot-clean
""" Create a wheel (.whl) distribution. A wheel is a built archive format. """ import csv import hashlib import os import subprocess import warnings import shutil import json import wheel try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig i...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, merge_dicts, orderedSet, parse_duration, parse_resolution, str_to_int, url_or_none, urlencode_postdata, ) class SpankBangIE(InfoExtractor): ...
unknown
codeparrot/codeparrot-clean
""" This paver file is intended to help with the release process as much as possible. It relies on virtualenv to generate 'bootstrap' environments as independent from the user system as possible (e.g. to make sure the sphinx doc is built against the built scipy, not an installed one). The release is assumed to be done...
unknown
codeparrot/codeparrot-clean
"""The unittest.TestCase for sleeping a given amount of time.""" import time from buildscripts.resmokelib import logging from buildscripts.resmokelib.testing.testcases import interface class SleepTestCase(interface.TestCase): """SleepTestCase class.""" REGISTERED_NAME = "sleep_test" def __init__(self, ...
python
github
https://github.com/mongodb/mongo
buildscripts/resmokelib/testing/testcases/sleeptest.py
// Copyright Joyent, Inc. and other Node contributors. // // 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, modi...
c
github
https://github.com/nodejs/node
src/node_stat_watcher.h
# frozen_string_literal: true require "active_support/core_ext/class/subclasses" require "active_model/attribute_set" require "active_model/attribute/user_provided_default" module ActiveModel module AttributeRegistration # :nodoc: extend ActiveSupport::Concern module ClassMethods # :nodoc: def attrib...
ruby
github
https://github.com/rails/rails
activemodel/lib/active_model/attribute_registration.rb
from __future__ import unicode_literals from django.apps import apps from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser, User from django.contrib.auth.tests.custom_user import CustomUser from django.core.exceptions import ImproperlyConfigured from django.dispatch import...
unknown
codeparrot/codeparrot-clean
# Copyright 2014-2017 The ODL contributors # # This file is part of ODL. # # 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 https://mozilla.org/MPL/2.0/. """Functions for graphical output.""" from ...
unknown
codeparrot/codeparrot-clean
{ "css": null, "js": [], "start": 0, "end": 89, "type": "Root", "fragment": { "type": "Fragment", "nodes": [ { "type": "IfBlock", "elseif": false, "start": 0, "end": 89, "test": { "type": "BinaryExpression", "start": 5, "end": 11, "loc": { "start": { "li...
json
github
https://github.com/sveltejs/svelte
packages/svelte/tests/parser-modern/samples/if-block-elseif/output.json
# frozen_string_literal: true require_relative "../support/job_buffer" class KwargsJob < ActiveJob::Base def perform(argument: 1) JobBuffer.add("Job with argument: #{argument}") end end
ruby
github
https://github.com/rails/rails
activejob/test/jobs/kwargs_job.rb
""" Deuce Client - (File) Splitter API """ import abc from stoplight import validate from deuceclient.api.block import Block from deuceclient.common import errors from deuceclient.common.validation import * class FileSplitterBase(object): """ File Splitter Interface Class """ __metaclass__ = abc.ABCM...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # SelfTest/Util/test_asn.py: Self-test for the Crypto.Util.asn1 module # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is ...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, orderedSet, parse_duration, qualities, unified_strdate, xpath_text ) class EuropaIE(InfoExtractor): _VALID_URL = r'https?://ec\....
unknown
codeparrot/codeparrot-clean
import logging from typing import Dict, Optional from ray.tune import trial_runner from ray.tune.schedulers.trial_scheduler import TrialScheduler from ray.tune.schedulers.hyperband import HyperBandScheduler, Bracket from ray.tune.trial import Trial logger = logging.getLogger(__name__) class HyperBandForBOHB(HyperBan...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2015 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 agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/util/concurrent/TestPlatform.java
""" A Jinja extension adding support for localizable template blocks. """ from jinja2.ext import Environment, Extension, nodes class L10nBlockExtension(Extension): """ Add support for an L10n block that works like a regular "block" for now. """ tags = set(['l10n']) def parse(self, parser): ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for twisted SSL support. """ from __future__ import division, absolute_import from twisted.python.filepath import FilePath from twisted.trial import unittest from twisted.internet import protocol, reactor, interfaces, defer from twisted...
unknown
codeparrot/codeparrot-clean
from __future__ import with_statement import sys import os import subprocess from os.path import exists, join, abspath from shutil import rmtree from tempfile import mkdtemp from twisted.trial import unittest class ProjectTest(unittest.TestCase): project_name = 'testproject' def setUp(self): self.te...
unknown
codeparrot/codeparrot-clean
// Copyright 2025 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql_test import ( "context" "sync/atomic" "testing" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/sql" "github.com/co...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/index_split_scatter_test.go
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2015 Jared Morrow (github.com/jaredmorrow) # # 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 wi...
unknown
codeparrot/codeparrot-clean
/** @import { SSRContext } from '#server' */ import { DEV } from 'esm-env'; import * as e from './errors.js'; /** @type {SSRContext | null} */ export var ssr_context = null; /** @param {SSRContext | null} v */ export function set_ssr_context(v) { ssr_context = v; } /** * @template T * @returns {[() => T, (context...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/src/internal/server/context.js
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v0alpha1", "metadata": { "name": "ivx9964", "namespace": "stacks-5756", "uid": "627d3b09-32b6-4e0c-b5b7-b94be6fc94b6", "resourceVersion": "1764589364114772", "generation": 1, "creationTimestamp": "2025-12-01T11:42:44Z", "label...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/v2beta1.rows-with-nested-tabs.v0alpha1.json
# SPDX-License-Identifier: GPL-2.0 %YAML 1.2 --- $id: http://devicetree.org/schemas/leds/leds-max77650.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: LED driver for MAX77650 PMIC from Maxim Integrated. maintainers: - Bartosz Golaszewski <bgolaszewski@baylibre.com> description: | This module ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/leds/leds-max77650.yaml
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2016 Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a cop...
unknown
codeparrot/codeparrot-clean
# 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
# 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 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 IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package vault import ( "context" crand "crypto/rand" "crypto/sha256" "crypto/sha512" "encoding/base64" "encoding/hex" "encoding/json" "errors" "fmt" "hash" "math/rand" "net/http" "net/url" "path" "path/filepath" "runtime" "sort" ...
go
github
https://github.com/hashicorp/vault
vault/logical_system.go
# frozen_string_literal: true require "cases/helper" require "support/deprecated_associations_test_helpers" require "models/developer" require "models/computer" require "models/project" require "models/company" require "models/course" require "models/customer" require "models/order" require "models/categorization" req...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import unified_strdate class DFBIE(InfoExtractor): IE_NAME = 'tv.dfb.de' _VALID_URL = r'https?://tv\.dfb\.de/video/(?P<display_id>[^/]+)/(?P<id>\d+)' _TEST = { 'url': 'http://tv.dfb.de/video/u-19-em-...
unknown
codeparrot/codeparrot-clean
#!/bin/sh # # Copyright (c) 2007 Steven Grimm # test_description='git commit Tests for template, signoff, squash and -F functions.' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh commit_msg_is () { expect=commit_msg_is.expect actual=commit_msg_is.actual printf "%s" "$(git log --pretty=format:%s%b -1)" >"$ac...
unknown
github
https://github.com/git/git
t/t7500-commit-template-squash-signoff.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
core/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesRegistrar.java
import { test } from '../../test'; import { create_deferred } from '../../../helpers.js'; /** @type {ReturnType<typeof create_deferred>} */ let deferred; export default test({ before_test() { deferred = create_deferred(); }, get props() { return { thePromise: deferred.promise, show: true }; }, html: ` <d...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/await-containing-if/_config.js
{{{{raw}}}} name: Audit on: schedule: - cron: '0 0 * * *' push: branches: - main paths: - ".github/workflows/audit.yml" - "**/Cargo.lock" - "**/Cargo.toml" pull_request: branches: - main paths: - ".github/workflows/audit.yml" - "**/Cargo.lock" -...
unknown
github
https://github.com/tauri-apps/tauri
crates/tauri-cli/templates/plugin/.github/workflows/audit.yml
/* * 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/fs/store/EtagChecksum.java
"""Functions copypasted from newer versions of numpy. """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib._version import NumpyVersion if NumpyVersion(np.__version__) > '1.7.0.dev': _assert_warns = np.testing.assert_warns else: def _assert...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import json import inspect import ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env 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 unittest import deps2submodules class Deps2SubmodulesCollateDepsTest(unittest.TestCase): def testBasic(self): arg = ...
unknown
codeparrot/codeparrot-clean
# pylint: disable=g-direct-third-party-import # pylint: disable=g-bad-file-header # Copyright 2017 The Bazel 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 # # ...
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
configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/source/RecordSource.java
#! /usr/bin/env python # encoding: utf-8 # harald at klimachs.de import re from waflib import Utils from waflib.Tools import fc, fc_config, fc_scan from waflib.Configure import conf from waflib.Tools.compiler_fc import fc_compiler fc_compiler['linux'].append('fc_pgfortran') @conf def find_pgfortran(conf): """Find t...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests.java
"""Regresssion tests for urllib""" import urllib import httplib import unittest import os import sys import mimetools import tempfile import StringIO from test import test_support from base64 import b64encode def hexescape(char): """Escape char as RFC 2396 specifies""" hex_repr = hex(ord(char))[2:].upper() ...
unknown
codeparrot/codeparrot-clean
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear 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,...
unknown
codeparrot/codeparrot-clean
from congestion_approx import CongestionApprox from graph_util import EDGE_CAPACITY_ATTR class TreeCongestionApprox(CongestionApprox): def __init__(s, tree, tree_root, alpha): # TODO: node to index s.tree = tree.copy() s.root = tree_root s.cached_dfs_edges = list(s.recursive_dfs_edges(s.root, set(), Fals...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 IBM Corp. # # 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
import hashlib import logging import os import threading import time import types import uuid from collections import namedtuple from kazoo import security from kazoo.client import KazooClient from kazoo.exceptions import NoNodeError from kazoo.exceptions import KazooException from pykit import config from pykit impor...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
unknown
codeparrot/codeparrot-clean
"""Sanity test for proper import exception handling.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ... import types as t from . import ( SanityMultipleVersion, SanityMessage, SanityFailure, SanitySuccess, SanitySkipped, SANITY_ROOT, ...
unknown
codeparrot/codeparrot-clean
# Copyright 2018 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
/* * Public Key abstraction layer: wrapper functions * * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ #include "common.h" #include "mbedtls/platform_util.h" #if defined(MBEDTLS_PK_C) #include "pk_wrap.h" #include "pk_internal.h" #include "mbedtls/error.h" #...
c
github
https://github.com/nodejs/node
deps/LIEF/third-party/mbedtls/library/pk_wrap.c
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** * @param {string} str string * @returns {string} quoted meta */ const quoteMeta = (str) => str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); /** * @param {string} char character to escape for use in ...
javascript
github
https://github.com/webpack/webpack
lib/util/compileBooleanMatcher.js
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid - **InaSAFE map making module.** Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ...
unknown
codeparrot/codeparrot-clean
import sys from django import http from django.core import signals from django.utils.encoding import force_unicode from django.utils.importlib import import_module class BaseHandler(object): # Changes that are always applied to a response (in this order). response_fixes = [ http.fix_location_header, ...
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/security/JaasContext.java
import unittest from coloredcoinlib import ( ZeroSelectError, SimpleColorValue, UNCOLORED_MARKER, ColorDefinition ) from ngcccbase.pwallet import PersistentWallet from ngcccbase.txcons import InsufficientFundsError, RawTxSpec from ngcccbase.wallet_controller import WalletController from ngcccbase.p2ptrade.ewctrl im...
unknown
codeparrot/codeparrot-clean
''' Android gravity --------------------- ''' from jnius import autoclass from jnius import cast from jnius import java_method from jnius import PythonJavaClass from plyer.facades import Gravity from plyer.platforms.android import activity Context = autoclass('android.content.Context') Sensor = autoclass('android.ha...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import sys from django.core.management.base import BaseCommand, CommandError class SubcommandsCommand(BaseCommand): subcommands = {} command_name = '' def __init__(self): super(SubcommandsCommand, self).__init__() for name, subcommand in self.subcommands.items(): ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Thomas Caravia <taca@kadisius.eu> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/booleanFilterAnyArray.ts] //// //// [booleanFilterAnyArray.ts] interface Bullean { } interface BulleanConstructor { new(v1?: any): Bullean; <T>(v2?: T): v2 is T; } interface Ari<T> { filter<S extends T>(cb1: (value: T) => value is S): T extends any ? Ari<any> : Ari<S>; filte...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/booleanFilterAnyArray.js
#!/usr/bin/python """ Copyright (C) International Business Machines Corp., 2005 Author: Dan Smith <danms@us.ibm.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; under version 2 of the Licens...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' ''' Measure memory usage of the current process. The key function is memory() which returns the current memory usage in MB...
unknown
codeparrot/codeparrot-clean
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # 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, ...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
/* * 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
buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesAnalyzer.java