code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
route_2
-------
- Path: /name/add
- Path Regex: #PATH_REGEX#
- Host: localhost
- Host Regex: #HOST_REGEX#
- Scheme: http|https
- Method: PUT|POST
- Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub
- Defaults: NONE
- Requirements: NO CUSTOM
- Options:
- `compiler_class`: Symfony\Component\Ro... | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_3.md |
"""
Middleware for the cmsplugin_redirect app.
This is basically http://djangosnippets.org/snippets/2541/
"""
from django.template import TemplateSyntaxError
class ForceResponse(Exception):
def __init__(self, response):
self.response = response
class ForceResponseMiddleware:
def process_exception(se... | unknown | codeparrot/codeparrot-clean | ||
#! env python
import os
import git
import click
from .config.common_site_config import get_config
github_username = None
github_password = None
def prepare_staging(bench_path, app, remote='upstream'):
from .release import get_release_message
validate(bench_path)
repo_path = os.path.join(bench_path, 'apps', app)
... | unknown | codeparrot/codeparrot-clean | ||
#define COMMON_DIGEST_FOR_OPENSSL 1
#include <CommonCrypto/CommonDigest.h>
#ifdef __GNUC__
RB_DIGEST_WARNING_IGNORED(-Wdeprecated-declarations)
/* Suppress deprecation warnings of MD5 from Xcode 11.1 */
/* Although we know MD5 is deprecated too, provide just for backward
* compatibility, as well as Apple does. */
#en... | c | github | https://github.com/ruby/ruby | ext/digest/md5/md5cc.h |
# Status: mostly ported. Missing is --out-xml support, 'configure' integration
# and some FIXME.
# Base revision: 64351
# Copyright 2003, 2005 Dave Abrahams
# Copyright 2006 Rene Rivera
# Copyright 2003, 2004, 2005, 2006, 2007 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanyi... | unknown | codeparrot/codeparrot-clean | ||
"""Constants for the pi_hole integration."""
from datetime import timedelta
from homeassistant.const import UNIT_PERCENTAGE
DOMAIN = "pi_hole"
CONF_LOCATION = "location"
DEFAULT_LOCATION = "admin"
DEFAULT_METHOD = "GET"
DEFAULT_NAME = "Pi-Hole"
DEFAULT_SSL = False
DEFAULT_VERIFY_SSL = True
SERVICE_DISABLE = "disab... | unknown | codeparrot/codeparrot-clean | ||
from django import template
register = template.Library()
class IndentByNode(template.Node):
def __init__(self, nodelist, indent_level, if_statement):
self.nodelist = nodelist
self.indent_level = template.Variable(indent_level)
if if_statement:
self.if_statement = template.Vari... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
import win32wnet
import struct
import string
# Constants generated by h2py from nb30.h
NCBNAMSZ = 16
MAX_LANA = 254
NAME_FLAGS_MASK = 0x87
GROUP_NAME = 0x80
UNIQUE_NAME = 0x00
REGISTERING = 0x00
REGISTERED = 0x04
DEREGISTERED = 0x05
DUPLICATE = 0x06
DUPLICATE_DEREG = 0x07
LISTEN_OUTSTANDING = 0x01
CALL_PENDING = 0x02
... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* win32pread.c
* Implementation of pread(2) for Windows.
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/port/win32pread.c
*
*---------------------------------------------------... | c | github | https://github.com/postgres/postgres | src/port/win32pread.c |
// Copyright 2018 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
// Package base exposes basic utilities used across cockroach.
package base
import (
"context"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/c... | go | github | https://github.com/cockroachdb/cockroach | pkg/base/license.go |
"""
Feed Exports extension
See documentation in docs/topics/feed-exports.rst
"""
import os
import sys
import logging
import posixpath
from tempfile import TemporaryFile
from datetime import datetime
from six.moves.urllib.parse import urlparse
from ftplib import FTP
from zope.interface import Interface, implementer
f... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import absolute_import
import os
import re
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
stri... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2007, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | unknown | codeparrot/codeparrot-clean | ||
from pyglet.gl import *
from managed_window import ManagedWindow
from plot_camera import PlotCamera
from plot_controller import PlotController
from time import clock
class PlotWindow(ManagedWindow):
def __init__(self, plot, **kwargs):
"""
Named Arguments
===============
antialia... | unknown | codeparrot/codeparrot-clean | ||
import random
def mutate_v1(dna):
dna_list = list(dna)
mutation_site = random.randint(0, len(dna_list) - 1)
dna_list[mutation_site] = random.choice(list('ATCG'))
return ''.join(dna_list)
def get_base_frequencies_v2(dna):
return {base: dna.count(base)/float(len(dna))
for base in... | unknown | codeparrot/codeparrot-clean | ||
"""
The Response class in REST framework is similar to HTTPResponse, except that
it is initialized with unrendered data, instead of a pre-rendered string.
The appropriate renderer is called during Django's template response rendering.
"""
from __future__ import unicode_literals
from django.template.response import Si... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='git rebase with its hook(s)'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
test_expect_success setup '
echo hello >file &&
git add file &&
test_tick &&
git commit -m initial &&
echo goodbye >file &&
git add file &&
test_tick ... | unknown | github | https://github.com/git/git | t/t3413-rebase-hook.sh |
from __future__ import unicode_literals
from django.db import migrations
from django.utils import six
class MigrationOptimizer(object):
"""
Powers the optimization process, where you provide a list of Operations
and you are returned a list of equal or shorter length - operations
are merged into one if... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 OpenStack Foundation
# 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 | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##
## This file is part of Harvesting Kit.
## Copyright (C) 2014 CERN.
##
## Harvesting Kit 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 t... | 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/specific/TwoConstructorsExample.java |
"""The test for the geo rss events sensor platform."""
from unittest.mock import MagicMock, patch
import pytest
from homeassistant.components import sensor
import homeassistant.components.geo_rss_events.sensor as geo_rss_events
from homeassistant.const import (
ATTR_FRIENDLY_NAME,
ATTR_ICON,
ATTR_UNIT_OF_... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
// File contains the enums used across whole application.
export const DEFAULT_PAGES = {
DOCS: 'overview',
REFE... | typescript | github | https://github.com/angular/angular | adev/src/app/core/constants/pages.ts |
EXPERIMENTS:
Experiments are only enabled in alpha releases of Terraform CLI. The following features are not yet available in stable releases.
- The experimental "deferred actions" feature, enabled by passing the `-allow-deferral` option to `terraform plan`, permits `count` and `for_each` arguments in `module`, `reso... | unknown | github | https://github.com/hashicorp/terraform | .changes/footer-with-experiments.md |
from __future__ import division
from __future__ import absolute_import
import collections
import scipy as sp
import scipy.linalg
import itertools as it
import operator as op
import functools as ft
import sympy
import math
from functools import partial as par
from os.path import join as pjoin
from math import sin, cos... | unknown | codeparrot/codeparrot-clean | ||
import sys
from cPickle import loads, dumps
from cStringIO import StringIO
from unittest import TestCase
from itcc.molecule import read, write
test_in = ''' 50 -125.3756
1 N 0.845907 -0.569507 1.239074 85 2 5 43
2 CT 1.414650 0.476344 2.075648 74 1 3 6... | unknown | codeparrot/codeparrot-clean | ||
#ifndef HEADER_CURL_CF_SOCKET_H
#define HEADER_CURL_CF_SOCKET_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* ... | c | github | https://github.com/curl/curl | lib/cf-socket.h |
#! /usr/bin/env python
# $Id: test_contents.py 5889 2009-04-01 20:00:21Z gbrandl $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for parts.py contents directive.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | unknown | codeparrot/codeparrot-clean | ||
from django.shortcuts import render
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
# from userauth.forms import UserForm, UserProfileForm, ForgotForm
from maps.models import Report, Route
from django.contrib.auth import authenticate, login, logout
from django.con... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 la... | 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 | ||
# Copyright 2013 Intel 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 | ||
import decimal
from decimal import Decimal
from unittest import TestCase
from simplejson.compat import StringIO, reload_module
import simplejson as json
class TestDecimal(TestCase):
NUMS = "1.0", "10.00", "1.1", "1234567890.1234567890", "500"
def dumps(self, obj, **kw):
sio = StringIO()
json.d... | unknown | codeparrot/codeparrot-clean | ||
if __name__ == '__main__':
import sys
import os
pkg_dir = (os.path.split(
os.path.split(
os.path.split(
os.path.abspath(__file__))[0])[0])[0])
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
... | unknown | codeparrot/codeparrot-clean | ||
# Testing the line trace facility.
from test import test_support
import unittest
import sys
import difflib
import gc
from functools import wraps
class tracecontext:
"""Contex manager that traces its enter and exit."""
def __init__(self, output, value):
self.output = output
self.value = value
... | unknown | codeparrot/codeparrot-clean | ||
import requests
session = requests.Session()
session.headers.update({'Cookie': 'crossSessionId=u2lwcda374udixopbw6hfunlq8onoowh; csrftoken=oFo0r2bfk3CEMQBFUC10cOBpBl08xf3qK4cxLjP4oJilCNxXt7vEsBB7e2i70wHB',
'Origin': 'https://csacademy.com',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'es-419,es;q=0.8,e... | unknown | codeparrot/codeparrot-clean | ||
import sys
def show_help():
"""
Function for printing out help on how to use this script.
"""
print 'usage: ./oddeven [number1, number2, .. number_n]'
print 'Iterates over number and tells if they are even or odd'
def is_even(value):
"""
Checks if a given value is even.
If value is eve... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.util.reflection;
/**
* Report on field initialization
*/
public class FieldInitializationReport {
private final Object fieldInstance;
private final boolean wasI... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/util/reflection/FieldInitializationReport.java |
import re
import os
import sublime
import sublime_plugin
if int(sublime.version()) < 3000:
from sublime_haskell_common import *
else:
from SublimeHaskell.sublime_haskell_common import *
def haskell_docs(module, name):
"""
Returns info for name as multiline string
"""
try:
(exit_code, s... | unknown | codeparrot/codeparrot-clean | ||
import rapidsms
from rapidsms.parsers.keyworder import Keyworder
import re
from apps.ambulances.models import *
from apps.locations.models import Location
from apps.ubuzima.models import *
from apps.reporters.models import *
from django.utils.translation import ugettext as _
from django.utils.translation import activa... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Test the function :func:`iris._lazy data.as_lazy_data`."""
# Import iris.tests first so that some things can be initialised... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, ... | unknown | codeparrot/codeparrot-clean | ||
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
tri.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*********************... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const common = require('../common');
const fs = require('fs');
const bench = common.createBenchmark(main, {
n: [20e4],
statType: ['fstat', 'lstat', 'stat'],
});
function main({ n, statType }) {
let arg;
if (statType === 'fstat')
arg = fs.openSync(__filename, 'r');
else
arg = __filenam... | javascript | github | https://github.com/nodejs/node | benchmark/fs/bench-stat.js |
"""
Tagging related views.
"""
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.list_detail import object_list
from tagging.models import Tag, TaggedItem
from tagging.utils import get_tag, get_queryset_and_model
def tagged_object_list(request, queryset_or_mo... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR 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... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from warnings import warn
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
SESSION_KEY = '_auth_user_id'
BACKEND_SESSION_KEY = '_auth_user_backend'
REDIRECT_FIELD_NAME = 'next'
def load_backend(path):
i = path.rfind('.')
module, attr = pa... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011 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.
"""Chrome WebDriver that implements extra Chrome-specific functionality.
This module is experimental and will change and break without warning.
Use at y... | unknown | codeparrot/codeparrot-clean | ||
"""
Support for ZigBee devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zigbee/
"""
import asyncio
import logging
from binascii import hexlify, unhexlify
import voluptuous as vol
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP, C... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "erb"
module Jekyll
module Commands
class New < Command
class << self
def init_with_program(prog)
prog.command(:new) do |c|
c.syntax "new PATH"
c.description "Creates a new Jekyll site scaffold in PATH"
c.option "... | ruby | github | https://github.com/jekyll/jekyll | lib/jekyll/commands/new.rb |
# 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 required by applicable law or agre... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2017-2021 Fumito Hamamura <fumito.ham@gmail.com>
# This library 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 version 3.
#
# This library is distributed in the hope that it will be use... | 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/context/ApplicationPidFileWriter.java |
/*
* 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 | connect/mirror-client/src/main/java/org/apache/kafka/connect/mirror/IdentityReplicationPolicy.java |
import os
import unittest
import mutagen
from . import TestUtil
from .. import util
test_files = "audio_pipeline\\test\\test_files\\audio\\tag_test_files"
class TestAudioFileTags(TestUtil.TestUtilMixin):
def test_artist_name(self):
tag = self.format.album_artist(self.meta)
self.check_af_tag(tag,... | 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/propertyeditors/StringArrayPropertyEditorTests.java |
#
# 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/src/airflow/serialization/typing.py |
# Gmail IMAP folder support
# Copyright (C) 2008 Riccardo Murri <riccardo.murri@gmail.com>
# Copyright (C) 2002-2007 John Goerzen <jgoerzen@complete.org>
#
# 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 So... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# $Id: manpage.py 6270 2010-03-18 22:32:09Z milde $
# Author: Engelbert Gruber <grubert@users.sourceforge.net>
# Copyright: This module is put into the public domain.
# Rewritten almost completely
# by Marcello Perathoner <marcello@perathoner.de>
"""
Nroff writer for reStructuredText. Tweaked ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# daemon/daemon.py
# Part of python-daemon, an implementation of PEP 3143.
#
# Copyright © 2008–2010 Ben Finney <ben+python@benfinney.id.au>
# Copyright © 2007–2008 Robert Niederreiter, Jens Klein
# Copyright © 2004–2005 Chad J. Schroeder
# Copyright © 2003 Clark Evans
# Copyright © 2002 Noah S... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2016-2018 Mathew Topper
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | unknown | codeparrot/codeparrot-clean | ||
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import logging
from .HTMLElement import HTMLElement
from .attr_property import attr_property
log = logging.getLogger("Thug")
class HTMLIFrameElement(HTMLElement):
def __init__(self, doc, tag):
HTMLElement.__init__(self, doc, tag)
align = attr_property("align")
fra... | 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 agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/eventbus/outside/OutsideEventBusTest.java |
# 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 | 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 | ||
formatters:
enable:
- gci
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/prometheus/prometheus)
gofumpt:
extra-rules: true
goimports:
local-prefixes:
- github.com/prometheus/prometheus
issues:
max-i... | unknown | github | https://github.com/prometheus/prometheus | .golangci.yml |
# -*-*- encoding: utf-8 -*-*-
#
# This is the base file for the PicasaWeb python client.
# It is used for lower level operations.
#
# $Id: __init__.py 148 2007-10-28 15:09:19Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | unknown | codeparrot/codeparrot-clean | ||
# PyCParser - global include wrappers
# by Albert Zeyer, 2011
# code under LGPL
from cparser import *
from interpreter import CWrapValue
import ctypes
import errno, os
def wrapCFunc(state, funcname, restype=None, argtypes=None):
f = getattr(ctypes.pythonapi, funcname)
if restype is CVoidType:
f.restype = None
el... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase <troy@gci.net>
# Distributed under the terms of the GNU General Public License v2
## TODO: match warning to location label
## TODO: fix enable/disable on change
## TODO: streamline
## TODO: provide valid marker on source edit emit
import... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
The :mod:`sklearn.metrics.pairwise` submodule implements utilities to evaluate
pairwise distances or affinity of sets of samples.
This module contains both distance metrics and kernels. A brief summary is
given on the two here.
Distance metrics are a function d(a, b) such that d(a, b) < d(... | unknown | codeparrot/codeparrot-clean | ||
"Test autoexpand, coverage 100%."
from idlelib.autoexpand import AutoExpand
import unittest
from test.support import requires
from tkinter import Text, Tk
class DummyEditwin:
# AutoExpand.__init__ only needs .text
def __init__(self, text):
self.text = text
class AutoExpandTest(unittest.TestCase):
... | python | github | https://github.com/python/cpython | Lib/idlelib/idle_test/test_autoexpand.py |
"""Copyright 2009 Chris Davis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | unknown | codeparrot/codeparrot-clean | ||
/**********************************************************************
vm_dump.c -
$Author$
Copyright (C) 2004-2007 Koichi Sasada
**********************************************************************/
#include "ruby/internal/config.h"
#include "ruby/fiber/scheduler.h"
#ifdef HAVE_UCONTEXT_H
# include <uco... | c | github | https://github.com/ruby/ruby | vm_dump.c |
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
import mock
import os
import tempfile
import unittest
from ..connect import main as glconnect
from util import SubstringMatcher
root_package_na... | unknown | codeparrot/codeparrot-clean | ||
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholiqu... | c | github | https://github.com/opencv/opencv | 3rdparty/openjpeg/openjp2/mqc_inl.h |
"""
LTI user management functionality. This module reconciles the two identities
that an individual has in the campus LMS platform and on edX.
"""
import string
import random
import uuid
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
fr... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2011, 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... | c | github | https://github.com/mysql/mysql-server | sql/mem_root_array.h |
'''
Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
import nose
import unittest
import common
from conf import const
class Data(unittest.TestCase):
def setUp(self):
out = common.runcmd_output("cd... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf8
from django import forms
from django.contrib.auth import authenticate
from stjornbord.user.models import UserStatus, validate_username
class ValidateUsernameForm(forms.ModelForm):
"""
Used in Django's admin to verify Kennitala and usernames
"""
def clean_kennitala(self):
kennita... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.tests.auth
import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.http.auth.*
import io.ktor.server.auth.*
import io.ktor.serve... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-auth/common/test/io/ktor/tests/auth/BearerAuthTest.kt |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | unknown | codeparrot/codeparrot-clean | ||
use std::marker::PhantomData;
/// [`LocalRuntime`]-only config options
///
/// Currently, there are no such options, but in the future, things like `!Send + !Sync` hooks may
/// be added.
///
/// Use `LocalOptions::default()` to create the default set of options. This type is used with
/// [`Builder::build_local`].
//... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/local_runtime/options.rs |
test_kind: tla_plus_test
selector:
roots:
- src/mongo/tla_plus/**/*.cfg
executor:
config:
java_binary: /opt/java/jdk11/bin/java | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/tla_plus.yml |
class Test {
val bar : Int = 42
}
fun box() {
val t = Test()
t.<expr>bar</expr>
} | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/compileTimeConstantProvider/evaluate/namedReference_val.kt |
/*
* Copyright (C) 2017 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/src/com/google/common/collect/ObjectCountLinkedHashMap.java |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | cpp | github | https://github.com/opencv/opencv | modules/core/test/test_countnonzero.cpp |
# 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 distributed in the hope that ... | python | github | https://github.com/ansible/ansible | lib/ansible/module_utils/facts/hardware/linux.py |
/* 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/PE/ParserConfig.hpp |
# Copyright (c) 2011-2013, ImageCat Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is di... | unknown | codeparrot/codeparrot-clean | ||
"""
This modules implements the CrawlSpider which is the recommended spider to use
for scraping typical web sites that requires crawling pages.
See documentation in docs/topics/spiders.rst
"""
import copy
from scrapy.http import Request, HtmlResponse
from scrapy.utils.spider import iterate_spider_output
from scrapy.... | unknown | codeparrot/codeparrot-clean | ||
"""Unsupervised evaluation metrics."""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import functools
from numbers import Integral
import numpy as np
from scipy.sparse import issparse
from sklearn.externals.array_api_compat import is_numpy_array
from sklearn.metrics.pairwise import ... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/metrics/cluster/_unsupervised.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.