code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright (c) 2015, 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 (includ... | c | github | https://github.com/mysql/mysql-server | strings/sql_chars.h |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contrib... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for grit.format.policy_templates.writers.admx_writer."""
import re
import unittest
class XmlWriterBaseTest(unittest.... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
# Time: O(n)
# Space: O(h), h is height of binary tree
#
# Given two binary trees, write a function to check if they are equal or not.
#
# Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
#
# Definition for a binary tree... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/framework/cancellation.h |
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | 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 | ||
<?php
namespace Illuminate\Contracts\Routing;
interface BindingRegistrar
{
/**
* Add a new route parameter binder.
*
* @param string $key
* @param string|callable $binder
* @return void
*/
public function bind($key, $binder);
/**
* Get the binding callback for a giv... | php | github | https://github.com/laravel/framework | src/Illuminate/Contracts/Routing/BindingRegistrar.php |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"target": {
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dev_dashboards/panel-heatmap/v1beta1.heatmap-calculate-log.v42.json |
# -*- coding: utf-8 -*-
import os
import json
from gensim.models import word2vec
from gensim import models
class Rule(object):
"""
Store the concept terms of a rule, and calculate the rule similarity.
"""
def __init__(self, domain, rule_terms, children, response, word2vec_model):
self.id_ter... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import elasticsearch
from nose.tools import eq_
from . import ElasticTestCase
from ..models import Index, Filter, FilterGroup
from ..views import SearchView
class ViewTests(ElasticTestCase):
fixtures = ElasticTestCase.fixtures + ['wiki/documents.json',
... | unknown | codeparrot/codeparrot-clean | ||
// MODULE: context
// FILE: context.kt
fun test() {
var x = 0
fun call() {
x = 1
}
<caret_context>call()
}
// MODULE: main
// MODULE_KIND: CodeFragment
// CONTEXT_MODULE: context
// FILE: fragment.kt
// CODE_FRAGMENT_KIND: EXPRESSION
call() | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments/capturing/localFunctionLocalClosureMutating.kt |
# Copyright (C) 2009 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 list of conditions and the f... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2019 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 | ||
"""
Module to read / write Fortran unformatted sequential files.
This is in the spirit of code written by Neil Martinsen-Burrell and Joe Zuntz.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
__all__ = ['FortranFile']
class FortranFile(object):
"""
A ... | unknown | codeparrot/codeparrot-clean | ||
from pyha.common.hwsim import HW
from pyha.common.sfix import Sfix, fixed_truncate, fixed_wrap
from pyhacores.moving_average.model import MovingAverage
class SimpleGardnerTimingRecovery(HW):
def __init__(self, sps):
# sps must be divisible by 2 -> required by gardner
assert not (sps & 1)
#... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 28 08:28:04 2010
Author: josef-pktd
"""
import numpy as np
from scipy import stats, special
import statsmodels.api as sm
from statsmodels.base.model import GenericLikelihoodModel
#redefine some shortcuts
np_log = np.log
np_pi = np.pi
sps_gamln = special.gammaln
def ma... | unknown | codeparrot/codeparrot-clean | ||
from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
import csv
class Command(BaseCommand):
# frequency domain/property
def has_any_hardcoded_properties(self, loc, csv_writer):
hardcoded = {
'... | unknown | codeparrot/codeparrot-clean | ||
"""Global values and configuration that apply to all of LangChain."""
from langchain_core.globals import (
get_debug,
get_llm_cache,
get_verbose,
set_debug,
set_llm_cache,
set_verbose,
)
__all__ = [
"get_debug",
"get_llm_cache",
"get_verbose",
"set_debug",
"set_llm_cache",
... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/globals.py |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLMOPT_PIPELINING
Section: 3
Source: libcurl
See-also:
- CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE (3)
- CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE (3)
- CURLMOPT_MAXCONNECTS (3)
- CURLMOPT_MAX_HOST_CONNECTIONS (3)
- CURL... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLMOPT_PIPELINING.md |
/*
* 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/context/reactive/FilteredReactiveWebContextResource.java |
import argparse
import collections
from parsing import parse_fasta_mhc_files
parser = argparse.ArgumentParser(
description='Drop positions which are always identical in a collection'
'of strings, write output to a NetMHCpan pseudosequence file'
)
parser.add_argument(
"file",
help="Directory which... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import hashlib
import urllib
import urllib2
import time
PASS_FILE = 'data/password.txt'
URL = 'http://hydroh.xyz/koi/db/dbquery.php'
class PHPQuery(object):
# 获取页面源码
@staticmethod
def parse_query(date, keyword, article):
# 过滤UTF8MB4预处理
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from odoo import fields, models
import odoo.addons.decimal_precision as dp
class VendorGoods(models.Model):
_name = 'vendor.goods'
_description = u'供应商供货价格表'
goods_id = fields.Many2one(
string=u'商品',
required=True,
comodel_name='goods',
ondelete='ca... | unknown | codeparrot/codeparrot-clean | ||
"""
Course Certificates page objects.
The methods in these classes are organized into several conceptual buckets:
* Helpers: General utility methods used throughout, such as css selection helpers
* Properties: Specific page/object field getters/setters (mainly for form inputs)
* Wait Actions: EmptyPromises ... | unknown | codeparrot/codeparrot-clean | ||
"""
.. module:: dj-stripe.tests.test_contrib.test_serializers
:synopsis: dj-stripe Serializer Tests.
.. moduleauthor:: Philippe Luickx (@philippeluickx)
"""
from __future__ import unicode_literals
from decimal import Decimal
from django.test import TestCase
from django.utils import timezone
from django.conf im... | 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/bom/bomr/version/ArtifactVersionDependencyVersion.java |
#!/usr/bin/env python
# Copyright (c) 2012 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
#
# http://www.apache.org/licenses/LICEN... | unknown | codeparrot/codeparrot-clean | ||
# 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.
from measurements import timeline_controller
from metrics import loading
from metrics import timeline
from telemetry.page import page_test
from telemetry.web_... | unknown | codeparrot/codeparrot-clean | ||
# Ansible CallBack module for Jabber (XMPP)
# Copyright (C) 2016 maxn nikolaev.makc@gmail.com
#
# This module 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 opti... | unknown | codeparrot/codeparrot-clean | ||
# SecuML
# Copyright (C) 2016-2017 ANSSI
#
# SecuML 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.
#
# SecuML is distributed in the h... | unknown | codeparrot/codeparrot-clean | ||
from unittest import mock
from django.db import connections
from django.test import TestCase, TransactionTestCase, override_settings
from django.test.testcases import DatabaseOperationForbidden
from .models import Car, Person
class TestSerializedRollbackInhibitsPostMigrate(TransactionTestCase):
"""
Transacti... | python | github | https://github.com/django/django | tests/test_utils/test_transactiontestcase.py |
# 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 | ||
import abc
from framework.auth.decorators import collect_auth
from website.util import api_url_for, web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
# TODO take addon_node_settings, addon_user_settings
def __init__(self, node_settings=None, user_settings=None):
self.node_set... | unknown | codeparrot/codeparrot-clean | ||
import sys
from io import open
from os.path import isfile, join, dirname
import json
import pytest
from tools.memap import MemapParser
from copy import deepcopy
PARSED_ARM_DATA = {
"startup/startup.o": {".text": 0xc0},
"[lib]/c_p.l/__main.o": {".text": 8},
"irqs/irqs.o": {".text": 0x98},
"data/data.o... | 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/example/scannable/NamedComponent.java |
/*
* Copyright (c) 2005, Junio C Hamano
*/
#include "git-compat-util.h"
#include "abspath.h"
#include "gettext.h"
#include "lockfile.h"
/*
* path = absolute or relative path name
*
* Remove the last path name element from path (leaving the preceding
* "/", if any). If path is empty or the root directory ("/"),... | c | github | https://github.com/git/git | lockfile.c |
//! THIR datatypes and definitions. See the [rustc dev guide] for more info.
//!
//! If you compare the THIR [`ExprKind`] to [`hir::ExprKind`], you will see it is
//! a good bit simpler. In fact, a number of the more straight-forward
//! MIR simplifications are already done in the lowering to THIR. For
//! example, met... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_middle/src/thir.rs |
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2014 Realm 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/li... | c | github | https://github.com/realm/realm-swift | Realm/TestUtils/include/RLMTestObjects.h |
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Pow... | c | github | https://github.com/opencv/opencv | 3rdparty/libjasper/jpc_bs.h |
import urlparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, QueryDict
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.http import base36_to_int
from django.utils.translation impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import logging
from aatest.check import State, OK
from aatest.events import EV_CONDITION
from aatest.result import Result, safe_path
from aatest.verify import Verify
from future.backports.urllib.parse import quote_plus
from future.backports.urllib.parse import parse_qs
from aatest.summ... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
// @flow @enableTransitivelyFreezeFunctionExpressions:false @enableNewMutationAliasingModel
import {arrayPush, setPropertyByKey, Stringify} from 'shared-runtime';
/**
* Repro of a bug fixed in the new aliasing model.
*
* 1. `InferMutableRanges` derives the mutable range of identifiers and th... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-aliased-capture-aliased-mutate.expect.md |
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build aix || darwin
package runtime_test
import (
"runtime"
"syscall"
"testing"
)
func TestSetNonblock(t *testing.T) {
t.Parallel()
r, w, errno :=... | go | github | https://github.com/golang/go | src/runtime/nbpipe_pipe_test.go |
#!/usr/bin/env python
# Copyright 2017 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 gperf
import json5_generator
import template_expander
class AtRuleNamesWriter(json5_generator.Writer):
"""
Generates At... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This server acts as an intermediary between
# an ADB forwarded Titanium application w/ debugging
# and a local debug server that is listening for a connection
# TODO: this will work for on-device debugging
import asyncore
import socket
import sys
import time
def debug(msg):
print "[DEBUG] "+m... | unknown | codeparrot/codeparrot-clean | ||
# 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.
import json
import logging
from telemetry.core.backends.chrome_inspector import websocket
from telemetry.core import exceptions
class WebSocketDisconnected... | unknown | codeparrot/codeparrot-clean | ||
/*
* @notice
* checkstyle: Checks Java source code for adherence to a set of rules.
* Copyright (C) 2001-2021 the original author or authors.
*
* 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 ... | java | github | https://github.com/elastic/elasticsearch | build-conventions/src/main/java/org/elasticsearch/gradle/internal/checkstyle/HiddenFieldCheck.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 | clients/src/main/java/org/apache/kafka/common/serialization/ShortDeserializer.java |
# Copyright 2019 Oihane Crucelaegui - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import odoo.tests.common as common
class TestResourceTime(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestResourceTime, cls).setUpClass()
start_hour = 10.0
... | unknown | codeparrot/codeparrot-clean | ||
from website.tokens.exceptions import TokenError
class OSFError(Exception):
"""Base class for exceptions raised by the Osf application"""
pass
class NodeError(OSFError):
"""Raised when an action cannot be performed on a Node model"""
pass
class NodeStateError(NodeError):
"""Raised when the Node's... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) Andrey Kartashov
# see LICENSE file
DOCUMENTATION = '''
---
module: oa_register_ns
short_description: registers name server
description: Registers name server in OAP.
version_added: "2.3.2"
author: Andrey Kartashov (gorilych@gmail.com)
options:
backnet:
description: backne... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that we can specify a dependency property in project requirements, and
# tha... | unknown | codeparrot/codeparrot-clean | ||
"""
This config file runs the simplest dev environment"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .common import *
from logsettings import get_logger_config
# import settings from LMS for consistent ... | unknown | codeparrot/codeparrot-clean | ||
/****************************************************************
*
* The author of this software is David M. Gay.
*
* Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose without fee is hereby granted, provided that this entir... | c | github | https://github.com/python/cpython | Python/dtoa.c |
/* Copyright 2020 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/lite/acceleration/configuration/c/xnnpack_plugin.h |
# -*- mode: python -*-
# Copyright: (c) 2012, Jeroen Hoekx (@jhoekx)
# Copyright: Ansible Team
# 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: group_by
short_description: Create Ansible groups based on fa... | python | github | https://github.com/ansible/ansible | lib/ansible/modules/group_by.py |
/* Copyright 2023 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/quantization/stablehlo/cc/io.h |
import numpy as np
import itertools as it
from scipy.sparse import csc_matrix
from scipy.sparse.linalg import spsolve
class PolarFD:
def __init__(self, N, a, nu, R0, R1):
self.N = N
self.a = a
self.nu = nu
self.R0 = R0
self.R1 = R1
self.calc_N_var()
@classmeth... | 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.impl.base.components
import com.intellij.psi.util.PsiTreeUtil
impor... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/components/KaBaseKDocProvider.kt |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the .automaticDestinations-ms OLECF file plugin."""
import unittest
from plaso.formatters import olecf as _ # pylint: disable=unused-import
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers.olecf_plugins import automatic_destinatio... | unknown | codeparrot/codeparrot-clean | ||
use std::io::Write;
use std::path::{Path, PathBuf};
use super::ResultCache;
/// Saves a reduced file for a given `stage`
fn save_reduction(lines: &[String], path: &Path, stage: &str) {
let mut path = path.to_path_buf();
path.set_extension(format!("rs.{stage}"));
let mut file = std::fs::File::create(&path)... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_gcc/build_system/src/fuzz/reduce.rs |
# 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
def _make_test_records(verbose):
from frappe.test_runner import make_test_objects
accounts = [
# [account_name, parent_account, is_g... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime
from sqlalchemy import Column, ForeignKey, MetaData, Table
from sqlalchemy import Boolean, DateTime, Integer, Unicode, UnicodeText
metadata = MetaData()
user_table = Table('user', metadata,
Column('id', Integer, primary_key=True),
Column('user_name', Unicode(255), nullable=False,... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 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/src/com/google/common/collect/Iterators.java |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
#
# 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 Lice... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Grid Dynamics
# 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/l... | unknown | codeparrot/codeparrot-clean | ||
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 3.0 or later
Changelog:
2009-05-28, Pilgrim: ported to Python 3
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Cop... | unknown | codeparrot/codeparrot-clean | ||
# etcd/client/v3
[](https://etcd.io/docs)
[](https://godoc.org/go.etcd.io/etcd/client/v3)
`etcd/clientv3` is the official Go etcd client for v3.
## Install
```bash
go get go.e... | unknown | github | https://github.com/etcd-io/etcd | client/v3/README.md |
#!/usr/bin/env python
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | unknown | codeparrot/codeparrot-clean | ||
"""
kombu.transport.memory
======================
In-memory transport.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from Queue import Queue
from . import virtual
class Channel(virtual.Channel):
queues = {}
do_restore = Fa... | unknown | codeparrot/codeparrot-clean | ||
# 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.
# pylint: disable=W0401,W0614
from telemetry.page.actions.all_page_actions import *
from telemetry.page import page as page_module
from telemetry.page import ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 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 | etcdutl/etcdutl/common.go |
## Input
```javascript
function Component(props) {
const count = new MaybeMutable();
return (
<View>
<View>
{<span>Text</span>}
{<span>{maybeMutate(count)}</span>}
</View>
</View>
);
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Comp... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.expect.md |
/*
* 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/example/scannable/MessageBean.java |
# -*- coding: utf-8 -*-
"""
AR-specific Form helpers.
"""
from django.forms import ValidationError
from django.core.validators import EMPTY_VALUES
from django.forms.fields import RegexField, CharField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
class... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
import random
import tornado.httpclient
import tornado.escape
import tornado.web
from common_handler import CommonHandler
import site_config
class TitleSuggestionHandler(CommonHandler):
PAGE_SIZE = 10
ENABLE_CROSSDOMAIN = site_config.ENABLE_CROSSDOMAIN
@tornado.web.asynchronous
def ge... | unknown | codeparrot/codeparrot-clean | ||
from testbase import *
class SimpleRemoveTests(OperationsTests):
@staticmethod
def buildPkgs(pkgs, *args):
pkgs.leaf = FakePackage('foo', '2.5', '1.1', '0', 'noarch')
pkgs.leaf.addFile('/bin/foo')
pkgs.requires_leaf = FakePackage('bar', '4')
pkgs.requires_leaf.addRequires('foo... | 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.http
import io.ktor.utils.io.*
import kotlin.jvm.JvmField
/**
* Represents an HTTP method (verb)
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.http.HttpMet... | kotlin | github | https://github.com/ktorio/ktor | ktor-http/common/src/io/ktor/http/HttpMethod.kt |
######################################################################
# The ATCA Sensitivity Calculator
# Calculation subroutines.
# Copyright 2015 Jamie Stevens, CSIRO
#
# This file is part of the ATCA Sensitivity Calculator.
#
# The ATCA Sensitivity Calculator is free software: you can
# redistribute it and/or modif... | unknown | codeparrot/codeparrot-clean | ||
"""
=================================================
Power Series (:mod:`numpy.polynomial.polynomial`)
=================================================
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmeti... | python | github | https://github.com/numpy/numpy | numpy/polynomial/polynomial.py |
from math import floor
def leap_year(year):
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
return True
else:
return False
else:
return True
else:
return False
cl... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | docs/examples/pop3-multi.c |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module replicates the miislita vector spaces from
"A Linear Algebra Approach to the Vector Space Model -- A Fast Track Tutorial"
by Dr. E. Garcia, admin@miislita.com
See http://www.miisl... | unknown | codeparrot/codeparrot-clean | ||
#
# cfg_symbian.py - Symbian target configurator
#
# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2011 Justin Santa Barbara
# 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 requ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Generated Fri Jul 2 13:32:50 2004 by generateDS.py.
#
import sys
from xml.dom import minidom
from xml.sax import handler, make_parser
import ??? as supermod
class purchase_orderSub(supermod.purchase_order):
def __init__(self, customer=None, date='', line_item=None, shipper=None):
... | unknown | codeparrot/codeparrot-clean | ||
attr = 'parent child two' | python | github | https://github.com/python/cpython | Lib/test/test_importlib/namespace_pkgs/project2/parent/child/two.py |
# Analyzing Prow Job Resource Usage
## 1. Introduction to Prow
[Prow](https://docs.prow.k8s.io/docs/) is a Kubernetes based CI/CD system. Jobs can be triggered by various types of events and report their status to many different services. Prow provides GitHub automation through policy enforcement and chat-ops via `/c... | unknown | github | https://github.com/etcd-io/etcd | Documentation/contributor-guide/prow_jobs.md |
"""
Python module for parsing "Prosody" template files and it's translation catalogues.
"""
import re
tag_re = re.compile("({%x%}|{{x}}|{#x#})".replace("x",
"""([^'"]|'([^\\']|\\\\.)*?'|"([^\\"]|\\\\.)*?")*?"""))
def tags(filename):
with open(filename) as f:
line_no = 0
for bit in tag_re.sp... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
from __future__ import division
from qtpy import QtGui
from functools import reduce
class QPainterPath(QtGui.QPainterPath):
'''
QainterPath with added methods to calculate
area, mean, min, max
'''
@staticmethod
def _frange(start, stop, step):
'''Helper float generator''... | 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/components/LimitedItemsList.tsx |
#!/usr/bin/env python
# This shows how to probe a dataset with a plane. The probed data is
# then contoured.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Read data.
pl3d = vtk.vtkPLOT3DReader()
pl3d.SetXYZFileName(VTK_DATA_ROOT + "/Data/combxyz.bin")
pl3d.SetQFileName(VTK_DA... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import os
from pathlib import Path
from typing import Iterable, List, Optional, Tuple, cast
from pex.variables import Variables
from pa... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
===============================================================================
GenericNetwork: Abstract class to construct pore networks
===============================================================================
"""
import scipy as sp
import scipy.sparse as sprs
import scipy.spatial a... | unknown | codeparrot/codeparrot-clean | ||
from decimal import Decimal
from django.test import TestCase
from django.contrib.auth.models import User
from .models import Product, Rating, Category
class ProductTestCast(TestCase):
def setUp(self):
self.category = Category.objects.create(name='All')
self.book = Product.objects.create(name="1984... | unknown | codeparrot/codeparrot-clean | ||
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 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... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/apis/kubeadm/v1beta3/zz_generated.deepcopy.go |
- hosts: testhost
tasks:
- include_tasks: test_includes4.yml
with_items: ["a"]
loop_control:
loop_var: r | unknown | github | https://github.com/ansible/ansible | test/integration/targets/includes/test_includes3.yml |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.