code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@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... | unknown | codeparrot/codeparrot-clean | ||
"""
Script that shows dispatch matrices when all available functors are loaded.
Later ones will overwrite earlier ones, this is not what you will get in
reality.
Pipe the output to file and open it in browser:
$ yade-trunk dispatcher-torture.py > /tmp/aa.html
$ firefox /tmp/aa.html
"""
import collections
Dispatch=c... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
class Regexp
# See #as_json.
def self.json_create(object)
new(object['s'], object['o'])
end
# Methods <tt>Regexp#as_json</tt> and +Regexp.json_create+ may be used
# to serialize and deseriali... | ruby | github | https://github.com/ruby/ruby | ext/json/lib/json/add/regexp.rb |
'use strict';
const common = require('../common.js');
const assert = require('assert');
const bench = common.createBenchmark(main, {
n: [2e7],
method: ['match', 'doesNotMatch'],
}, {
combinationFilter(p) {
// These benchmarks purposefully do not run by default. They do not provide
// might insight, due ... | javascript | github | https://github.com/nodejs/node | benchmark/assert/match.js |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Doctrine;
use Doctrine\Common\EventArgs;
use Doctrine\Co... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php |
# sql/annotation.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The :class:`.Annotated` class and related routines; creates hash-equivalent
co... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2015-2017 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Res... | unknown | codeparrot/codeparrot-clean | ||
{
"format_version": "1.0",
"valid": false,
"error_count": 1,
"warning_count": 0,
"diagnostics": [
{
"severity": "error",
"summary": "Unsupported block type",
"detail": "Blocks of type \"resorce\" are not expected here. Did you mean \"resource\"?",
"range": {
"filename": "te... | json | github | https://github.com/hashicorp/terraform | internal/command/testdata/validate-invalid/output.json |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | unknown | codeparrot/codeparrot-clean | ||
For info on how the current borrowck works, see the [rustc dev guide].
[rustc dev guide]: https://rustc-dev-guide.rust-lang.org/borrow_check.html | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_infer/src/infer/region_constraints/README.md |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v0alpha1.candlestick.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "datasource",
"uid": "grafana"
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-candlestick/v0alpha1.candlestick.v42.v2alpha1.json |
from __future__ import print_function
from bokeh.browserlib import view
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
GMapPlot, Range1d, ColumnDataSource,
PanTool, WheelZoomTool, GMapOptions)
from bokeh.resources import INLINE
from bokeh.sampledata.world_ci... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2025 The etcd 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... | unknown | github | https://github.com/etcd-io/etcd | scripts/test_utils.sh |
## Input
```javascript
// @validatePreserveExistingMemoizationGuarantees @enablePreserveExistingMemoizationGuarantees:false
import {makeObject_Primitives, Stringify} from 'shared-runtime';
function Component(props) {
const object = {object: props.object};
const values = useMemo(() => Object.values(object), [objec... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.validate-object-values-mutation.expect.md |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git mailinfo and git mailsplit test'
. ./test-lib.sh
DATA="$TEST_DIRECTORY/t5100"
test_expect_success 'split sample box' \
'git mailsplit -o. "$DATA/sample.mbox" >last &&
last=$(cat last) &&
echo total is $last &&
test $(cat last) = 18'
check_... | unknown | github | https://github.com/git/git | t/t5100-mailinfo.sh |
/*
* 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/test/java/org/apache/kafka/common/security/oauthbearer/internals/secured/AccessTokenBuilder.java |
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2018 ##
## ... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const NO_MARKER = 0;
const IN_PROGRESS_MARKER = 1;
const DONE_MARKER = 2;
const DONE_MAYBE_ROOT_CYCLE_MARKER = 3;
const DONE_AND_ROOT_MARKER = 4;
/**
* @template T
* @typedef {Set<Node<T>>} Nodes
*/
... | javascript | github | https://github.com/webpack/webpack | lib/util/findGraphRoots.js |
import os
import versioneer
versioneer.VCS = 'git'
versioneer.versionfile_source = 'BigStash/version.py'
versioneer.versionfile_build = 'BigStash/version.py'
versioneer.tag_prefix = ''
versioneer.parentdir_prefix = 'bigstash-'
from setuptools import setup, find_packages
def pep386adapt(version):
if version is not... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
//
// Code generated by generate-staticcheck; DO NOT EDIT.
//
//go:build bazel
package st1022
import (
util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes... | go | github | https://github.com/cockroachdb/cockroach | build/bazelutil/staticcheckanalyzers/st1022/analyzer.go |
---
filter_version: 1.0
module_rejectlist:
# Specify the name of a lookup plugin here. This should have no effect as
# this is only for filtering modules
- list | unknown | github | https://github.com/ansible/ansible | test/integration/targets/plugin_filtering/filter_lookup.yml |
# (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 | ||
"""
Functions for handling encoding of web pages
Original code is https://github.com/scrapy/w3lib/blob/master/w3lib/encoding.py
"""
import re, codecs, encodings
# Python decoder doesn't follow unicode standard when handling
# bad utf-8 encoded strings. see http://bugs.python.org/issue8271
codecs.register_error('w3lib... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import unittest
from django.db import connection, migrations, models, transaction
from django.db.migrations.migration import Migration
from django.db.migrations.state import ProjectState
from django.db.models.fields import NOT_PROVIDED
from django.db.transaction import atomic
f... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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.
*/
package org.jetbrains.kotlin.analysis.api.symbols.markers
import org.jetbrains.kotlin.analysis.api.KaExperime... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/symbols/markers/markers.kt |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-01-09 14:21
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('students', '0001_initial'),
]
o... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from pixelated.bitmask_libraries.certs import LeapCertificate
from mock import MagicMock
class CertsTest(unittest.TestCase):
def setUp(self):
config = MagicMock(leap_home='/some/leap/home')
self.provider = MagicMock(server_name=u'test.leap.net', config=config)
def test_set_ce... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import codecs
import gzip
import os
import shutil
import tempfile
import unittest
from tracing_build import trace2html
class Trace2HTMLTests(unittest.T... | unknown | codeparrot/codeparrot-clean | ||
import copy_reg
import unittest
from test import test_support
from test.pickletester import ExtensionSaver
class C:
pass
class WithoutSlots(object):
pass
class WithWeakref(object):
__slots__ = ('__weakref__',)
class WithPrivate(object):
__slots__ = ('__spam',)
class WithSingleString(object):
_... | unknown | codeparrot/codeparrot-clean | ||
{
"XREVRANGE": {
"summary": "Returns the messages from a stream within a range of IDs in reverse order.",
"complexity": "O(N) with N being the number of elements returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1).",
"group": "stream... | json | github | https://github.com/redis/redis | src/commands/xrevrange.json |
# Uninvoked Track Function
This diagnostic detects when a track function is not invoked in `@for` blocks.
```angular-ts
import {Component} from '@angular/core';
@Component({
template: `@for (item of items; track trackByName) {}`,
})
class Items {
protected trackByName(item) {
return item.name;
}
}
```
## ... | unknown | github | https://github.com/angular/angular | adev/src/content/reference/extended-diagnostics/NG8115.md |
from xml.dom.minidom import parse as parse_xml
from xml.dom.minidom import parseString as parse_string
def indent(depth):
return ''.join([' ' for x in xrange(depth)])
def dump(n, depth = 0):
"Dump a minodom DOM"
if n.nodeType == n.ELEMENT_NODE:
print '%s+ %s'%(indent(depth), n.nodeName)
for (k, v) in n.attrib... | unknown | codeparrot/codeparrot-clean | ||
"""
Descriptor objects for entities that are part of the LLVM project.
"""
import ConfigParser
import StringIO
import sys
from util import *
class ParseError(Exception):
pass
class ComponentInfo(object):
"""
Base class for component descriptions.
"""
type_name = None
@staticmethod
def ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
from typing import TYPE_CHECKING
import warnings
from pandas._libs import lib
from pandas.compat._optional import import_optional_dependency
from pandas.errors import (
Pandas4Warning,
ParserError,
ParserWarning,
)
from pandas.util._exceptions import (
find_stack_lev... | python | github | https://github.com/pandas-dev/pandas | pandas/io/parsers/arrow_parser_wrapper.py |
import sys
import datetime
import os
from contextlib import contextmanager
import freezegun
import pytest
import pretend
from pip._vendor import lockfile
from pip.utils import outdated
@pytest.mark.parametrize(
['stored_time', 'newver', 'check', 'warn'],
[
('1970-01-01T10:00:00Z', '2.0', True, True),... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import numpy as np
from acoustics.standards.iec_61672_1_2013 import *
from scipy.signal import freqresp
def signal_fs():
fs = 4000.0
f = 400.0
duration = 3.0
samples = int(duration * fs)
t = np.arange(samples) / fs
x = np.sin(2.0 * np.pi * f * t)
return x, fs
def test_fast_l... | unknown | codeparrot/codeparrot-clean | ||
<!DOCTYPE html>
<html lang="en">
<head>
<title>ParameterEncoder Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script... | html | github | https://github.com/Alamofire/Alamofire | docs/Protocols/ParameterEncoder.html |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# 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 u... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 | ||
# ###############################################################################
# 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 thi... | unknown | codeparrot/codeparrot-clean | ||
"""This Q-Learning neural network agent is still a work in progress and is not complete yet."""
import random
from agents import Agent
from keras.layers import Dense
from keras.models import Sequential, model_from_json
from keras.optimizers import RMSprop, SGD
from util import info, opponent, color_name, numpify, best_... | unknown | codeparrot/codeparrot-clean | ||
#include <ATen/core/boxing/KernelFunction.h>
#include <ATen/core/dispatch/Dispatcher.h>
#include <sstream>
namespace c10 {
// This a "fake" kernel which doesn't actually do anything. Instead, it is a
// distinguished kernel which is special cased by the dispatch table to
// be handled specially. Its semantics is t... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/core/boxing/KernelFunction.cpp |
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include "fastcv_hal_imgproc.hpp"
#include "fastcv_hal_utils.hpp"
#include <opencv2/core/base.hpp>
#include <opencv2/imgproc.hpp>
int fastcv_hal_medianBlur(
const uchar* src_data,
size_t... | cpp | github | https://github.com/opencv/opencv | hal/fastcv/src/fastcv_hal_imgproc.cpp |
#
# Caids - Renderer
#
# Coded by Dr.Best (c) 2010
# Support: www.dreambox-tools.info
#
# This plugin is licensed under the Creative Commons
# Attribution-NonCommercial-ShareAlike 3.0 Unported
# License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to... | unknown | codeparrot/codeparrot-clean | ||
// This is a comment.
/* __next_internal_client_entry_do_not_use__ default,a,b,c,*,f auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy");
module.exports = createProxy("/some-project/src/some-file.js"); | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js |
//! This module contains the definition of the `TypeTree` and `Type` structs.
//! They are thin Rust wrappers around the TypeTrees used by Enzyme as the LLVM based autodiff
//! backend. The Enzyme TypeTrees currently have various limitations and should be rewritten, so the
//! Rust frontend obviously has the same limit... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_ast/src/expand/typetree.rs |
# (c) 2016 Red Hat Inc.
#
# 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 dis... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <cstdint>
#include <deque>
#include <mutex>
#include <utility>
#include <c10/util/Exception.h>
#include <c10/util/intrusive_ptr.h>
#include <c10/core/Device.h>
#include <c10/core/DispatchKeySet.h>
// For the record I don't think this is a correct pimpl idiom.
// Including Impl header in interfa... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/core/Generator.h |
# -*- coding: utf-8 -*-
#
# ===================================================================
# 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 granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction3_es6.ts] ////
//// [asyncArrowFunction3_es6.ts]
function f(await = await) {
}
//// [asyncArrowFunction3_es6.js]
"use strict";
function f(await = await) {
} | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncArrowFunction3_es6.js |
#!/usr/bin/python
# 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
# "Licen... | unknown | codeparrot/codeparrot-clean | ||
name: Reusable Windows
on:
workflow_call:
inputs:
arch:
description: CPU architecture
required: true
type: string
free-threading:
description: Whether to compile CPython in free-threading mode
required: false
type: boolean
default: false
env:
... | unknown | github | https://github.com/python/cpython | .github/workflows/reusable-windows.yml |
# 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 | ||
from test.support import verbose
import unittest
import locale
import sys
import codecs
class BaseLocalizedTest(unittest.TestCase):
#
# Base class for tests using a real locale
#
@classmethod
def setUpClass(cls):
if sys.platform == 'darwin':
import os
tlocs = ("en_U... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es2017/awaitBinaryExpression/awaitBinaryExpression5_es2017.ts] ////
//// [awaitBinaryExpression5_es2017.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitBinaryExpression5_es2017.js |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"intltool support"
import os, re
import Configure, TaskGen, Task, Utils, Runner, Options, Build, config_c
from TaskGen import feature, before, taskgen
from Logs import error
"""
Usage:
bld(features='intltool_in', source='a.po b.po', podir='po', cache... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""The module containing the code for GuessAuth."""
from requests import auth
from requests import cookies
from . import _digest_auth_compat as auth_compat, http_proxy_digest
class GuessAuth(auth.AuthBase):
"""Guesses the auth type by the WWW-Authentication header."""
def __init__(self... | unknown | codeparrot/codeparrot-clean | ||
import mixed from 'esm'
console.log(mixed.foo)
module.exports = mixed | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/loader/auto-cjs/1/input.js |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test resources processing, i.e. <if> and <include> tag handling."""
import unittest
from processor import FileCache, Processor, Lin... | 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 os
import distutils
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, local... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2013 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 collections
import optparse
import os
import re
import sys
from pylib import constants
# Uses symbol.py from third_party/and... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Google Inc. All Rights Reserved.
"""Generates credentials for gsutil."""
import base64
import json
import os
import textwrap
from googlecloudsdk.core.util import files
from oauth2client import client as oauth2_client
from oauth2client import multistore_file as oauth2_multistore_file
from oauth2clie... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# copyright: (c) 2016, Loic Blot <loic.blot@unix-experience.fr>
# Sponsored by Infopro Digital. http://www.infopro-digital.com/
# Sponsored by E.T.A.I. http://www.etai.fr/
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __futu... | unknown | codeparrot/codeparrot-clean | ||
# postgresql/zxjdbc.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the PostgreSQL database via the zxjdbc JDBC connector.
JDBC Drive... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
"""Memebot forms"""
from django import forms
from django.contrib.auth.models import User
from django.db.models import Q
from gruntle.memebot.models import Link
class EditProfileForm(forms.ModelForm):
"""Form for updating your user profile"""
password_opts = {'min_length': 3, 'max_length': 128, 'widget': for... | unknown | codeparrot/codeparrot-clean | ||
import uwsgi
import psycopg2
def ugreen_wait_callback(conn, timeout=-1):
"""A wait callback useful to allow uWSGI/uGreen to work with Psycopg."""
while True:
state = conn.poll()
if state == psycopg2.extensions.POLL_OK:
break
elif state == psycopg2.extensions.POLL_READ:
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf_8 -*-
import sqlite3 as lite
import sys, os, fnmatch, tagpy
# locate
def locate(pattern, root=os.curdir):
'''Locate all files matching supplied filename pattern in and below
supplied root directory.'''
for path, dirs, files in os.walk(os.path.abspath(root)):
for... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import unittest
from splinter import Browser
class TestGoogleSearch(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import formatdate
from erpnext.controllers.website_list_for_contact import get_customers_suppliers
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, with_statement
from unittest import TestCase
import os.path
import tempfile
from nose.tools import *
from behave import configuration
from behave.configuration import Configuration, UserData
# one entry of each kind handled
TEST_CONFIG='''[behave]
outfiles= /absolute/path1
... | unknown | codeparrot/codeparrot-clean | ||
"""Contains the logic for all of the default options for Flake8."""
from flake8 import defaults
from flake8.main import debug
from flake8.main import vcs
def register_default_options(option_manager):
"""Register the default options on our OptionManager.
The default options include:
- ``-v``/``--verbose``... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import Tkinter as tkinter
from test.test_support import requires, run_unittest
from test_ttk.support import AbstractTkTest
requires('gui')
class TextTest(AbstractTkTest, unittest.TestCase):
def setUp(self):
super(TextTest, self).setUp()
self.text = tkinter.Text(self.root)
def... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009 Neal Norwitz All Rights Reserved.
# Portions Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
app_name = "BitTorrent"
from BitTorrent import version
from BTL.language import languages, language_names, locale_sucks
from BitTorrent.NewVersion import Version
NSIS_DIR = "C:\\Program Files\\NSIS"
if not os.path.exists(NSIS_DIR):
raise Exception("Please set NSIS_DIR in winprepnsi.py!")
cur... | unknown | codeparrot/codeparrot-clean | ||
/**
* Annotation support for AOP pointcuts.
*/
@NullMarked
package org.springframework.aop.support.annotation;
import org.jspecify.annotations.NullMarked; | java | github | https://github.com/spring-projects/spring-framework | spring-aop/src/main/java/org/springframework/aop/support/annotation/package-info.java |
"""
Discrete Fourier Transforms - helper.py
"""
from numpy.compat import integer_types
from numpy.core import integer, empty, arange, asarray, roll
from numpy.core.overrides import array_function_dispatch, set_module
# Created by Pearu Peterson, September 2002
__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#coding:utf-8
# Author : tuxpy
# Email : q8886888@qq.com.com
# Last modified : 2015-09-15 08:31:23
# Filename : ipc.py
# Description :
from __future__ import print_function
from gale.utils import set_close_exec, ObjectDict, single_pattern
from gale.e import IPCError
from geve... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
import binascii
import datetime
import hashlib
import os
from pymongo import ReturnDocument
from vj4 import db
from vj4.util import argmethod
TYPE_REGISTRATION = 1
TYPE_SAVED_SESSION = 2
TYPE_UNSAVED_SESSION = 3
TYPE_LOSTPASS = 4
TYPE_CHANGEMAIL = 5
def _get_id(id_binary):
return hashlib.sha256(id_binary).digest(... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'deranjer'
#import bs4
import datetime
import urllib
#import pprint #used for printing XML trees
import xml.etree.ElementTree as ET #cElemetTree is depreciated apparently
from Settings import serverList
from flask import Flask, render_template, redirect
app = Flask(__name__, template_folder='Templates')
... | unknown | codeparrot/codeparrot-clean | ||
# sqlalchemy/ext/baked.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Baked query extension.
Provides a creational pattern for the :class:`.que... | unknown | codeparrot/codeparrot-clean | ||
# Standard Python packages
import math
import numbers
# Special dependencies
import numpy
class InfiniteType:
def __init__(self, multiplier=1.):
if multiplier == 0.: raise ZeroDivisionError, "Cannot multiply infinity and zero."
self._multiplier = multiplier
def __repr__(self):
if self... | 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 | ||
# 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 may ... | unknown | codeparrot/codeparrot-clean | ||
import random
from django.shortcuts import get_object_or_404, render
from django.views.generic.edit import CreateView
from django.core.urlresolvers import reverse_lazy
from painindex_app.models import PainSource
from painindex_app.forms import PainReportForm
from django.http import HttpResponse
def homepage(request):
... | 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 | ||
#include "ruby.h"
#include "internal/string.h"
static VALUE
bug_str_capacity(VALUE klass, VALUE str)
{
if (!STR_EMBED_P(str) && STR_SHARED_P(str)) {
return INT2FIX(0);
}
return LONG2FIX(rb_str_capacity(str));
}
void
Init_string_capacity(VALUE klass)
{
rb_define_singleton_method(klass, "capaci... | c | github | https://github.com/ruby/ruby | ext/-test-/string/capacity.c |
export function getServerSideProps() {}
export default function() {
return null;
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-server-side-props/output.js |
#!/usr/bin/env python
import argparse
import socket
import struct
from datetime import datetime, timedelta
import re
import subprocess
import os
import pcap
from daemon import DaemonContext
from daemon.pidlockfile import PIDLockFile
class SIPReg:
def __init__(self, host, lastdt, period = timedelta(seconds = 10), ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from bokeh import protocol
from bokeh import session
from . import test_utils
from ..app import bokeh_app
ws_address = "ws://localhost:5006/bokeh/sub"
class TestSubscribeWebSocket(test_utils.BokehServerTestCase):
def test_basic_subscribe(self):
self.sess1 = session... | unknown | codeparrot/codeparrot-clean | ||
/* 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... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/PE/LoadConfigurations/LoadConfiguration.cpp |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Raw data collector for coverage.py."""
import dis
import sys
from coverage import env
# We need the YIELD_VALUE opcode below, in a comparison-friendly form.
Y... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012, 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) any lat... | 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 us... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright(C) 2016 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.