code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#! /usr/bin/python -t
## --*- python -*--
import sys
import antlr
version = sys.version.split()[0]
if version < '2.2.1':
False = 0
if version < '2.3':
True = not False
class CharScanner(antlr.CharScanner):
def __init__(self,*args):
super(CharScanner,self).__init__(*args)
self.altcomment = True... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from sqlparse.sql import Statement, Token
from sqlparse import tokens as T
class StatementFilter:
"Filter that split stream at individual statements"
def __init__(self):
self._in_declare = False
self._in_dbldollar = False
self._is_create = False
self._b... | unknown | codeparrot/codeparrot-clean | ||
import pkg_resources
import os
import ssl
import requests
from requests.adapters import HTTPAdapter
from urllib3.poolmanager import PoolManager
API_DOMAIN = os.environ.get('DROPBOX_API_DOMAIN',
os.environ.get('DROPBOX_DOMAIN', '.dropboxapi.com'))
WEB_DOMAIN = os.environ.get('DROPBOX_WEB_DOMAIN',
os.environ.g... | unknown | codeparrot/codeparrot-clean | ||
/* -------------------------------------------------------------------------
*
* pg_sequence.h
* definition of the "sequence" system catalog (pg_sequence)
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/in... | c | github | https://github.com/postgres/postgres | src/include/catalog/pg_sequence.h |
#!/usr/bin/python
# (c) 2018-2019, NetApp, 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',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
import test_support, unittest
import pickle
#myint and its test taken from pickletester, the other "my" classes and tests
# are based on it.
class myint(int):
def __init__(self, x):
self.str = str(x)
class mystr(str):
def __init__(self, x):
self.str = str(x)
class mytuple(tuple):
def... | unknown | codeparrot/codeparrot-clean | ||
import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (
<Html lang="en">
<Head>
<meta charSet="utf-8" />
<meta name="robots" content="follow, index" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
</Head>
<bod... | typescript | github | https://github.com/vercel/next.js | examples/blog-with-comment/pages/_document.tsx |
"""Test case implementation"""
import sys
import collections
import contextlib
import difflib
import logging
import pprint
import re
import traceback2 as traceback
import types
import unittest
import warnings
import six
from six.moves import range
from unittest2 import result
from unittest2.util import (
safe_re... | unknown | codeparrot/codeparrot-clean | ||
/** @type {import("../../").LoaderDefinition<{}, { updateIndex: number }>} */
module.exports = function (source) {
var idx = this.updateIndex;
var items = source.split(/---+\r?\n/g);
if (items.length > 1) {
this.cacheable(false);
}
return items[idx] || items[items.length - 1];
}; | javascript | github | https://github.com/webpack/webpack | test/hotCases/fake-update-loader.js |
"""
Various complex queries that have been problematic in the past.
"""
import threading
from django.db import models
class DumbCategory(models.Model):
pass
class NamedCategory(DumbCategory):
name = models.CharField(max_length=10)
class Tag(models.Model):
name = models.CharField(max_length=10)
pare... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 | ||
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# 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 http://mozilla.org/MPL/2.0/.
"""this app will move crashes from one storage location to another"""
from configman import Names... | 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 io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, fsencode, detect_encoding, ... | 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-context/src/test/java/org/springframework/context/annotation/ImportVersusDirectRegistrationTests.java |
#
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#vim:set fileencoding=utf-8 sw=2 expandtab
import update
import requests
import json
class Transifex(object):
def __init__(self, user, passwd):
self.auth_ = (user, passwd)
r = requests.get(
'http://www.transifex.com/api/2/project/'
'arduino-ide-15/resource/ide-15/?deta... | unknown | codeparrot/codeparrot-clean | ||
"""
Classical multi-dimensional scaling (classical MDS).
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
from numbers import Integral
import numpy as np
from scipy import linalg
from sklearn.base import BaseEstimator, _fit_context
from sklearn.metrics import pairwise_distances
fro... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/manifold/_classical_mds.py |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-19 03:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('datastore', '0021_auto_20160331_2203'),
]
operations... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright (c) 2011-2013, ESN Social Software AB and Jonas Tarnstrom
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 list o... | c | github | https://github.com/pandas-dev/pandas | pandas/_libs/src/vendored/ujson/python/ujson.c |
# frozen_string_literal: true
require "cases/helper"
require "models/dats"
# The logic of the `guard` method is extensively tested indirectly, via the test
# suites of each type of association.
#
# Those tests verify that the `report` method is invoked as expected. Here, we
# unit test the `report` method itself.
mod... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/associations/deprecation_test.rb |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.test import TestCase, override_settings
from django.utils.timezone import utc
from restclients_core.exceptions import DataFailureException
from sis_provisioner.dao.group import *
from sis_provisioner.exceptions import (
... | unknown | codeparrot/codeparrot-clean | ||
---
title: Getting started
sort_rank: 1
---
This guide is a "Hello World"-style tutorial which shows how to install,
configure, and use a simple Prometheus instance. You will download and run
Prometheus locally, configure it to scrape itself and an example application,
then work with queries, rules, and graphs to use ... | unknown | github | https://github.com/prometheus/prometheus | docs/getting_started.md |
"""
Tests for comprehensive themes.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.contrib import staticfiles
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
from openedx.core.djangolib.testing.utils im... | unknown | codeparrot/codeparrot-clean | ||
# The core functionalty of PyEphem lives in the C-language _libastro
# module, which packages the astronomy routines from XEphem as
# convenient Python types.
import ephem._libastro as _libastro
from math import pi
__version__ = '3.7.5.1'
twopi = pi * 2.
halfpi = pi / 2.
quarterpi = pi / 4.
eighthpi = pi / 8.
degre... | 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/web/servlet/support/ServletContextApplicationContextInitializer.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/api/src/main/java/org/apache/kafka/connect/errors/AlreadyExistsException.java |
from __future__ import annotations
import io as _io
from yaml.resolver import Resolver
from ansible.module_utils._internal._datatag import AnsibleTagHelper
from ansible.module_utils.common.yaml import HAS_LIBYAML
from ansible._internal._datatag import _tags
from ._constructor import AnsibleConstructor, AnsibleInstr... | python | github | https://github.com/ansible/ansible | lib/ansible/_internal/_yaml/_loader.py |
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | unknown | codeparrot/codeparrot-clean | ||
# Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import os
import sys
import unittest
import warnings
from unicodedata import normalize
from test import support
filenames = [
'1_abc',
'2_ascii',
'3_Gr\xfc\xdf-Gott'... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_iso8601,
)
class DRTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.dk/tv/se/(?:[^/]+/)*(?P<id>[\da-z-]+)(?:[/#?]|$)'
_TEST = {
'url': 'https://www.d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 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 agreed t... | go | github | https://github.com/etcd-io/etcd | pkg/cobrautl/help.go |
#!/usr/bin/python
#
# Customized Home Automation
#
# Copyright (C) 2016, David Goldfarb
#
# Distributed under the terms of the GNU General Public License
#
# Written by David Goldfarb
#
import RPi.GPIO as GPIO
import time
import sys,getopt
# Set the GPIO pins to be used for the binary selectors
A0=26
A1=24
A2=22
A3=1... | unknown | codeparrot/codeparrot-clean | ||
"""
This is the default template for our main set of AWS servers. This does NOT
cover the content machines, which use content.py
Common traits:
* Use memcached, and cache-backed sessions
* Use a MySQL 5.1 database
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables fro... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression4_es5.ts] ////
//// [awaitCallExpression4_es5.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boole... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitCallExpression4_es5(target=es5).js |
# -*- coding: utf-8 -*-
from mako.template import Template
import unittest
from test import TemplateTest, eq_, requires_python_2
from test.util import result_lines, flatten_result
from mako.compat import u
class FilterTest(TemplateTest):
def test_basic(self):
t = Template("""
${x | myfilter}
""")
... | unknown | codeparrot/codeparrot-clean | ||
"""US Capital Punishment dataset."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission from the original author,
who retains all rights."""
TITLE = __doc__
SOURCE = """
Jeff Gill's `Generalized Linear Models: A Unified Approach`
http://jgill.wustl.edu/research/books.html
"""... | unknown | codeparrot/codeparrot-clean | ||
from template_tests.utils import setup
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
class I18nGetCurrentLanguageTagTests(SimpleTestCase):
libraries = {"i18n": "django.templatetags.i18n"}
@setup({"template": "{% load i18n %} {% get_current_language %}"})
def test_... | python | github | https://github.com/django/django | tests/template_tests/syntax_tests/i18n/test_get_current_language.py |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
#
# 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 th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from decimal import Decimal
from io import BytesIO
from test_framewo... | unknown | codeparrot/codeparrot-clean | ||
import os
import argparse
import payu
from payu import cli
from payu.experiment import Experiment
from payu.laboratory import Laboratory
import payu.subcommands.args as args
from payu import fsops
title = 'run'
parameters = {'description': 'Run the model experiment'}
arguments = [args.model, args.config, args.initia... | 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
import unittest, copy
from frappe.utils import nowdate, add_days, flt
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_... | unknown | codeparrot/codeparrot-clean | ||
---
applies_to:
stack: all
serverless: ga
---
# Text similarity re-ranker retriever [text-similarity-reranker-retriever]
The `text_similarity_reranker` retriever uses an NLP model to improve search results by reordering the top-k documents based on their semantic similarity to the query.
::::{tip}
Refer to [*Seman... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/rest-apis/retrievers/text-similarity-reranker-retriever.md |
import re, copy, logging
from autotest.client import utils
from autotest.client.shared import error
from qemu.tests import qemu_disk_img
from virttest import storage
class RebaseTest(qemu_disk_img.QemuImgTest):
def __init__(self, test, params, env, tag):
self.tag = tag
t_params = params.object_par... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Embrane, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
import sys
import inspect
import random
import pylab
from numpy import *
def raiseNotDefined():
print "Method not implemented: %s" % inspect.stack()[1][3]
sys.exit(1)
def permute(a):
"""
Randomly permute the elements in array a
"""
for n in range(len(a)):
m = int(pylab.rand() * (len(a) - n)) + n
t... | unknown | codeparrot/codeparrot-clean | ||
/*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 | apps/traincascade/old_ml_data.cpp |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from django.db import models
class CONST(object):
class ATIVO(object):
SIM = True
NAO = False
choices = (
(SIM, u'Sim'),
(NAO, u'Não'),
)
class CAPITAL(object):
SIM = True
NAO = False
choices = (
(SIM, u'Sim'),
(NAO, u'Não'),
)
class TblMunicipio(models.Model):
... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Plex media server monitoring."""
import logging
from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .const import (
CONF_SERVER_IDENTIFIER,
DISPATCHERS,
DOMAIN as PLEX... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2007 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/collect/TreeMultimapExplicitTest.java |
import datetime
import model
import config
from web.form import *
search = Form(
Textbox('query'),
Button('submit', type='submit', html='Search')
)
class dateformat (Validator):
def __init__(self, fmt, msg=None):
if msg is None:
msg = "doesn't match date format (%s)" % fmt
se... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | 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 | ||
# $Id: lazy.py,v 1.5.2.1 2007/05/22 20:23:38 customdesigned Exp $
#
# This file is part of the pydns project.
# Homepage: http://pydns.sourceforge.net
#
# This code is covered by the standard Python License.
#
# routines for lazy people.
import Base
import string
class NoDataError(IndexError): pass
class StatusError(... | unknown | codeparrot/codeparrot-clean | ||
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | unknown | codeparrot/codeparrot-clean | ||
## API Report File for "router_errors"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
// @public
export const enum RuntimeErrorCode {
// (undocumented)
EMPTY_PATH_WITH_PARAMS = 4009,
// (undocumented)
ERROR_PARSING_URL = 4018,
// (undocumen... | unknown | github | https://github.com/angular/angular | goldens/public-api/router/errors.api.md |
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/sysctl/safe_sysctls_test.go |
"""
<name>CN2 Rules Viewer</name>
<description>Viewer of classification rules.</description>
<icon>icons/CN2RulesViewer.svg</icon>
<contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact>
<priority>2120</priority>
"""
import orngEnviron
import orange, orngCN2
from OWWidget import *
from OWPredictions import ... | 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/antora/AggregateContentContribution.java |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
# Copyright: (c) 2014, Matthew Vernon <mcv21@cam.ac.uk>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
DOCUMENTATION = r"""
---
module: known_hosts
short_description: Add or remove a host from the C(known_hosts) file
description:
- Th... | python | github | https://github.com/ansible/ansible | lib/ansible/modules/known_hosts.py |
import click
from helium_commander import (
Client,
Label,
Sensor,
Element,
device_sort_option,
device_mac_option,
metadata_filter_option,
ResourceParamType
)
from helium_commander.commands import metadata, timeseries
from collections import namedtuple
pass_client = click.make_pass_deco... | 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 = 'l, j F, Y'
TIME_FORMAT = 'h:i a'
... | unknown | codeparrot/codeparrot-clean | ||
#ifndef DATE_TIME_DATE_GENERATOR_PARSER_HPP__
#define DATE_TIME_DATE_GENERATOR_PARSER_HPP__
/* Copyright (c) 2005 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/date_time/date_generator_parser.hpp |
from django.http import HttpResponse
from django.core.exceptions import ValidationError
from django.db import transaction
from systems.models import System
from core.range.utils import range_usage
from core.search.compiler.django_compile import compile_to_q
from core.range.ip_choosing_utils import (
integrate_rea... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.debug
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.debug.junit4.*
import org.junit.*
open class DebugTestBase : TestBase() {
@JvmField
@Rule
val timeout = CoroutinesTimeout.seconds(60)
@Before
open fun setUp() {
Debu... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-debug/test/DebugTestBase.kt |
# -*- coding: utf-8 -*-
'''core stuf'''
from itertools import starmap
from collections import Mapping, Sequence, defaultdict, namedtuple
from stuf.six import items, keys, values
from stuf.utils import OrderedDict, getter, imap, exhaust
from stuf.base import directstuf, wrapstuf, writewrapstuf
__all__ = ('defaultstuf... | unknown | codeparrot/codeparrot-clean | ||
"""
@package mi.instrument.sunburst.sami2_pco2.pco2a.test.test_driver
@file marine-integrations/mi/instrument/sunburst/sami2_pco2/pco2a/driver.py
@author Christopher Wingard
@brief Test cases for pco2a driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_dri... | unknown | codeparrot/codeparrot-clean | ||
import os
import re
import numpy as np
import json
def path(*args):
"""
Return path relative to home
Parameters
----------
Comma separated directories
"""
return os.path.join(os.path.expanduser("~"), *args)
def rpath(*args):
"""
Return path relative to current working directory
... | unknown | codeparrot/codeparrot-clean | ||
from decimal import Decimal
from django.conf import settings
#: Are prices shown with tax included or not? (Defaults to ``True``)
#: Please note that this setting is purely presentational and has no
#: influence on the values stored in the database.
PLATA_PRICE_INCLUDES_TAX = getattr(settings, 'PLATA_PRICE_INCLUDES_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 | core/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/package-info.java |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
import webnotes
def execute():
# convert timesheet details to time logs
webnotes.reload_doc("projects", "doctype", "time_log")
# copy custom fields
custom_map = {"Timesheet":[], "Timesheet Detail":[]}
for custom_field in webnotes.conn.sql("""select * from `tabCustom Field` where
dt in ('Timesheet', 'Timesheet ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""psutil exception classes.
Not supposed to be used / imported directly.
Instead use psutil.NoSuchProcess, etc.
"""
class Error(Ex... | unknown | codeparrot/codeparrot-clean | ||
#
#
# Copyright (C) 2006, 2007 Google Inc.
#
# 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 is distri... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/brcm,bcm2835-unicam.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Broadcom BCM283x Camera Interface (Unicam)
maintainers:
- Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml |
{
"class": "",
"public": false,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": false,
"autoconfigure": false,
"deprecated": false,
"arguments": [],
"file": null,
"tags": [],
"usages": []
} | json | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_without_class.json |
/*
* 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/api/src/test/java/org/apache/kafka/connect/data/DecimalTest.java |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 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... | json | github | https://github.com/apache/kafka | clients/src/main/resources/common/message/ConsumerProtocolSubscription.json |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint, throw
from frappe.utils import flt, fmt_money
from frap... | unknown | codeparrot/codeparrot-clean | ||
"""
timeformat.py
Contains functions to format time periods. Based on code from the Django project and CloudBot contributors.
The licensing for this module isn't solid, because I started working on this module before I had a proper
system for tracking code licences. If your code is in this file and you have any queri... | unknown | codeparrot/codeparrot-clean | ||
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Mimikatz DumpCreds',
'Author': ['@JosephBialek', '@gentilkiwi'],
'Description': ("Runs PowerSploit's Invoke-Mimikatz function "
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# 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
# "... | unknown | codeparrot/codeparrot-clean | ||
from kivy.tests.common import GraphicUnitTest
class UIXWidgetTestCase(GraphicUnitTest):
def test_default_widgets(self):
from kivy.uix.button import Button
from kivy.uix.slider import Slider
r = self.render
r(Button())
r(Slider())
def test_button_properties(self):
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ImportShardError'
db.create_table(u'osmosis_importsharderror', (
(u'id', self.gf(... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | unknown | codeparrot/codeparrot-clean | ||
#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]
use tokio::sync::oneshot;
use tokio::time::{self, timeout, timeout_at, Instant};
use tokio_test::*;
use futures::future::pending;
use std::time::Duration;
#[tokio::test]
async fn simultaneous_deadline_future_completion() {
// Create a future that is immediatel... | rust | github | https://github.com/tokio-rs/tokio | tokio/tests/time_timeout.rs |
# 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 logging
import os
import re
from pylib import android_commands
from pylib import constants
from pylib import pexpect
from pylib.base import base_... | unknown | codeparrot/codeparrot-clean | ||
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import warnings
from numbers import Real
import numpy as np
from scipy import sparse
from scipy.optimize import linprog
from sklearn.base import BaseEstimator, RegressorMixin, _fit_context
from sklearn.exceptions import ConvergenceWarning... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/linear_model/_quantile.py |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import RegexValidator
from django.forms import *
from django.http import QueryDict
from django.template import Template, Context
from django.test im... | unknown | codeparrot/codeparrot-clean | ||
"""
Definition of registers
"""
# special function registers addresses contants
WREG, STATUS, BSR = 0xfe8, 0xfd8, 0xfe0
STKPTR = 0xffc
class Register:
""" Abstract class of register with bit-vector operations support """
def put(self, value):
raise NotImplementedError()
def get(self):
rais... | unknown | codeparrot/codeparrot-clean | ||
//
// Copyright 2017 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... | c | github | https://github.com/mysql/mysql-server | extra/abseil/abseil-cpp-20230802.1/absl/strings/internal/resize_uninitialized.h |
- Feature Name: Jobs Monitoring
- Status: completed ([#16733](https://github.com/cockroachdb/cockroach/pull/16733))
- Start Date: 2017-06-22
- Author: Julian Gilyadov
- RFC PR: [#16688](https://github.com/cockroachdb/cockroach/pull/16688)
- Cockroach Issue: None
# Motivation
Recent syntax additions such as `SHOW [QUE... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20170701_jobs_monitoring.md |
/*
* 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.network.selector
import io.ktor.utils.io.core.*
import kotlinx.coroutines.*
import kotlin.coroutines.*
public actual fun SelectorManager(dispatcher: CoroutineContext): Selector... | kotlin | github | https://github.com/ktorio/ktor | ktor-network/web/src/io/ktor/network/selector/SelectorManager.web.kt |
# -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.