code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Utils,Task,TaskGen,Logs
from waflib.TaskGen import feature,before_method,after_method,extension
from waflib.Configure import conf
INC_REGEX="""(?:... | unknown | codeparrot/codeparrot-clean | ||
"""
Management utility to create superusers.
"""
from __future__ import unicode_literals
import getpass
import sys
from django.contrib.auth import get_user_model
from django.contrib.auth.management import get_default_username
from django.contrib.auth.password_validation import validate_password
from django.core impor... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package command
import (
"fmt"
"strings"
"github.com/hashicorp/terraform/internal/backend/backendrun"
"github.com/hashicorp/terraform/internal/command/arguments"
"github.com/hashicorp/terraform/internal/command/views"
"github.com/hashicorp/t... | go | github | https://github.com/hashicorp/terraform | internal/command/plan.go |
---
title: useRevalidator
---
# useRevalidator
<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
Thank you for helping improve our documentation!
This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are merged.
ht... | unknown | github | https://github.com/remix-run/react-router | docs/api/hooks/useRevalidator.md |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson
#
# 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 Softw... | unknown | codeparrot/codeparrot-clean | ||
from typing import Optional
from overrides import overrides
import torch
from torch import nn
from allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder
from allennlp.nn.util import add_positional_features
@Seq2SeqEncoder.register("pytorch_transformer")
class PytorchTransformer(Seq2SeqEncoder):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#ifndef INTERNAL_ARRAY_H /*-*-C-*-vi:se ft=c:*/
#define INTERNAL_ARRAY_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute a... | c | github | https://github.com/ruby/ruby | internal/array.h |
# -*- 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 | ||
# -*- coding: utf-8 -*-
"""QGIS Unit tests for the attribute table model.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later vers... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
#
# 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 Affero General Public L... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Ansible
# -*- coding: utf-8 -*-
#
#
# 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 | ||
//===--- SSAUpdater.swift -------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | swift | github | https://github.com/apple/swift | SwiftCompilerSources/Sources/SIL/Utilities/SSAUpdater.swift |
#!/bin/sh
test_description='bisect can handle submodules'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-submodule-update.sh
git_bisect () {
git status -su >expect &&
ls -1pR * >>expect &&
"$TAR" cf "$TRASH_DIRECTORY/tmp.tar" * &&
GOOD=$(git rev-parse --verify HEAD) &&
may_only_be_test_must_fail "$2" &&
$2 git checko... | unknown | github | https://github.com/git/git | t/t6041-bisect-submodule.sh |
from collections import OrderedDict
import pprint
'''Basic change making program using 100 base (American Currency): will create full knapsack version in
later example. This example will also be expanded, in steps, until it becomes a simple OO-based
(ie. we'll add classes) POS system with database tie-in.'''
de... | unknown | codeparrot/codeparrot-clean | ||
from django.apps.registry import Apps
from django.db import models
# We're testing app registry presence on load, so this is handy.
new_apps = Apps(["apps"])
class TotallyNormal(models.Model):
name = models.CharField(max_length=255)
class SoAlternative(models.Model):
name = models.CharField(max_length=255)
... | python | github | https://github.com/django/django | tests/apps/models.py |
#!python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 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 | ||
# frozen_string_literal: true
module LoadSchemaHelper
def load_schema
# silence verbose schema loading
original_stdout = $stdout
$stdout = StringIO.new
adapter_name = ActiveRecord::Base.lease_connection.adapter_name.downcase
adapter_specific_schema_file = SCHEMA_ROOT + "/#{adapter_name}_specific... | ruby | github | https://github.com/rails/rails | activerecord/test/support/load_schema_helper.rb |
- hosts: testhost,testhost2
gather_facts: no
vars:
run_once_flag: false
tasks:
- debug:
msg: "I am {{ item }}"
run_once: "{{ run_once_flag }}"
register: reg1
loop:
- "{{ inventory_hostname }}"
- assert:
that:
- "reg1.results[0].msg == 'I am testhost... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/strategy_linear/task_templated_run_once.yml |
/*
* 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/main/java/org/springframework/cache/support/AbstractValueAdaptingCache.java |
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/ids/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions) => boolean;
export = check; | typescript | github | https://github.com/webpack/webpack | schemas/plugins/ids/HashedModuleIdsPlugin.check.d.ts |
# This file is part of Merlin.
# Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen.
# Individual portions may be copyright by individual contributors, and
# are included in this collective work with permission of the copyright
# owners.
# This program is free software; ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2018 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.
package main
import "C"
//export GoFunc
func GoFunc() int { return 1 }
func main() {} | go | github | https://github.com/golang/go | src/cmd/cgo/internal/testcshared/testdata/go2c2go/go/shlib.go |
'''create charts showing results of rfval.py
INVOCATION
python chart-03.py [--data] [--test]
INPUT FILES
INPUT/rfval/YYYYMM.pickle
OUTPUT FILES
WORKING/chart-03/[test-]data.pickle
WORKING/chart-03/[test-]VAR-YYYY[-MM].pdf
where
VAR in {max_depth | max_features}
YYYY in {2004 | 2005 | 2006 | 2007 | 2008 | 200... | unknown | codeparrot/codeparrot-clean | ||
#ifndef HEADER_CURL_TOOL_SDECLS_H
#define HEADER_CURL_TOOL_SDECLS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* ... | c | github | https://github.com/curl/curl | src/tool_sdecls.h |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import logging
import werkzeug
import werkzeug.utils
from datetime import datetime
from math import ceil
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http impo... | unknown | codeparrot/codeparrot-clean | ||
- hosts: A,B
gather_facts: false
force_handlers: true
tasks:
- fail:
when: inventory_hostname == "A"
- run_once: true
block:
- debug:
msg: task1
- debug:
msg: task2
- debug:
msg: hosts_left | unknown | github | https://github.com/ansible/ansible | test/integration/targets/handlers/force_handlers_blocks_81533-1.yml |
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under th... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2022 The HuggingFace Team. 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 applicabl... | python | github | https://github.com/huggingface/transformers | src/transformers/utils/import_utils.py |
<!--- TEST_NAME FlowGuideTest -->
<contribute-url>https://github.com/Kotlin/kotlinx.coroutines/edit/master/docs/topics/</contribute-url>
[//]: # (title: Asynchronous Flow)
A suspending function asynchronously returns a single value, but how can we return
multiple asynchronously computed values? This is where Kotlin F... | unknown | github | https://github.com/Kotlin/kotlinx.coroutines | docs/topics/flow.md |
/*-------------------------------------------------------------------------
*
* heap_surgery.c
* Functions to perform surgery on the damaged heap table.
*
* Copyright (c) 2020-2026, PostgreSQL Global Development Group
*
* IDENTIFICATION
* contrib/pg_surgery/heap_surgery.c
*
*------------------------------... | c | github | https://github.com/postgres/postgres | contrib/pg_surgery/heap_surgery.c |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/migrations/versions/0045_3_0_0_add_last_heartbeat_at_directly_to_ti.py |
import pandas as pd
from snorkel.models import StableLabel
from snorkel.db_helpers import reload_annotator_labels
FPATH = 'data/gold_labels.tsv'
def number_of_people(sentence):
active_sequence = False
count = 0
for tag in sentence.ner_tags:
if tag == 'PERSON' and not active_sequence:
a... | unknown | codeparrot/codeparrot-clean | ||
# File Associations Example
This example demonstrates how to make associations between the application and certain file types.
This feature is commonly used for functionality such as previewing or editing files.
## Running the example
1. Run the following inside `examples/file-associations/src-tauri`
```
car... | unknown | github | https://github.com/tauri-apps/tauri | examples/file-associations/README.md |
# -*- coding: utf-8 -*-
import inspect
import re
import urlparse
from module.network.HTTPRequest import BadHeader
from ..captcha.ReCaptcha import ReCaptcha
from ..internal.Addon import Addon
from ..internal.misc import parse_html_header
def plugin_id(plugin):
return ("<%(plugintype)s %(pluginname)s%(id)s>" %
... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import os
import socket
import sys
from test.support import is_apple, os_helper, socket_helper
from test.support.import_helper import import_fresh_module
from test.support.os_helper import TESTFN
c_stat = import_fresh_module('stat', fresh=['_stat'])
py_stat = import_fresh_module('stat', blocked=['_stat... | python | github | https://github.com/python/cpython | Lib/test/test_stat.py |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/AutowiredProperties.java |
# -*- coding: utf-8 -*-
"""
shared.log
~~~~~~~~~~
AmvTek attend to take control of twisted logging
:copyright: (c) 2012 by sc AmvTek srl
:email: devel@amvtek.com
"""
import sys
from logging import DEBUG,INFO,WARNING,ERROR,FATAL
from zope.interface import implements
from twisted.python import co... | unknown | codeparrot/codeparrot-clean | ||
#
# sundtek control center
# coded by giro77
#
#
from Screens.Screen import Screen
from Screens.Console import Console
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Components.ActionMap import ActionMap
from Components.Input import Input
from Components.MenuList import MenuList
... | unknown | codeparrot/codeparrot-clean | ||
# encoding: 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 'UserInfo'
db.create_table('project_userinfo', (
('id', self.gf('django.db.models.field... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2008 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 | guava-testlib/test/com/google/common/collect/testing/MapTestSuiteBuilderTests.java |
#ifndef _RANDOMDGEN__PHILOX_H_
#define _RANDOMDGEN__PHILOX_H_
#include "numpy/npy_common.h"
#include <inttypes.h>
#define PHILOX_BUFFER_SIZE 4L
struct r123array2x64 {
uint64_t v[2];
};
struct r123array4x64 {
uint64_t v[4];
};
enum r123_enum_philox4x64 { philox4x64_rounds = 10 };
typedef struct r123array4x64 phi... | c | github | https://github.com/numpy/numpy | numpy/random/src/philox/philox.h |
# Copyright (c) 2012 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import re
import glob
import os
import bsettings
import command
class Toolchain:
"""A single toolchain
Public members:
gcc: Full path to C compiler
path: Directory path containing C compiler
cross: ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2013 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 linux
package runtime
import (
"internal/runtime/atomic"
"internal/runtime/syscall/linux"
"unsafe"
)
var (
epfd int32 = -1 /... | go | github | https://github.com/golang/go | src/runtime/netpoll_epoll.go |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.Account import Account
class YibaishiwuCom(Account):
__name__ = "YibaishiwuCom"
__type__ = "account"
__version__ = "0.08"
__status__ = "testing"
__description__ = """115.com account plugin"""
__license__ = "GPLv3"
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsUnitTypes
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__aut... | unknown | codeparrot/codeparrot-clean | ||
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013 Contributor
#
# 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 t... | unknown | codeparrot/codeparrot-clean | ||
# 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
# distributed under t... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#pylint: skip-file
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | unknown | codeparrot/codeparrot-clean | ||
/** @import { ClassDeclaration } from 'estree' */
/** @import { Context } from '../types' */
import * as w from '../../../warnings.js';
import { validate_identifier_name } from './shared/utils.js';
/**
* @param {ClassDeclaration} node
* @param {Context} context
*/
export function ClassDeclaration(node, context) {
... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/compiler/phases/2-analyze/visitors/ClassDeclaration.js |
## Input
```javascript
import {createHookWrapper} from 'shared-runtime';
function useHook({isCond, value}) {
return isCond
? {
getValue() {
return value;
},
}
: 42;
}
export const FIXTURE_ENTRYPOINT = {
fn: createHookWrapper(useHook),
params: [{isCond: true, value: 0}],
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-method-in-ternary-consequent.expect.md |
# -*- coding: utf-8 -*-
# ###
# Copyright (c) 2016, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import re
import tempfile
import unittest
import zipfile
import cnxepub
from pyramid import testing as pyr... | unknown | codeparrot/codeparrot-clean | ||
import random
# rules for standard sudoku puzzles
MAX_VALUE = 9
BLOCK_SIZE = 3
LINE_SIZE = 9
def main():
print grid_to_string(generate_grid())
def grid_to_string(grid):
row_strings = [''.join(map(str, row)) for row in grid]
return "\n".join(row_strings)
# list of rows, 9 values per row, 9 rows per grid
... | unknown | codeparrot/codeparrot-clean | ||
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Util;
... | php | github | https://github.com/composer/composer | src/Composer/Util/ErrorHandler.php |
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tf2tensorrt/convert/logger_registry.h |
#!/usr/bin/python
# James Laska (jlaska@redhat.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',
'status': ['previ... | unknown | codeparrot/codeparrot-clean | ||
"""
Giving models a custom manager
You can use a custom ``Manager`` in a particular model by extending the base
``Manager`` class and instantiating your custom ``Manager`` in your model.
There are two reasons you might want to customize a ``Manager``: to add extra
``Manager`` methods, and/or to modify the initial ``Q... | unknown | codeparrot/codeparrot-clean | ||
# Minimum version of required + optional dependencies
# Aligned with getting_started/install.rst and compat/_optional.py
name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.11
# build dependencies
- versioneer
- cython<4.0.0a0
- meson=1.2.1
- meson-python=0.17.1
# test dependencies
- p... | unknown | github | https://github.com/pandas-dev/pandas | ci/deps/actions-311-minimum_versions.yaml |
# -*- 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 | ||
"""Python booleans"""
import ast
import typy
import typy.util as _util
import typy.util.astx as astx
import _errors
class boolean_(typy.Type):
@classmethod
def init_idx(cls, idx):
if idx != ():
raise typy.TypeFormationError("Index of boolean type must be ().")
return idx
@cla... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-12-10 00:27
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import products.models
class Migration(migrations.Migration):
dependencies = [
('products', '0006_auto_20161208_1419')... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | python | github | https://github.com/apache/airflow | airflow-core/tests/integration/otel/dags/otel_test_dag_with_pause_between_tasks.py |
import os
from jedi.inference.gradual.typeshed import TYPESHED_PATH, create_stub_module
def load_proper_stub_module(inference_state, file_io, import_names, module_node):
"""
This function is given a random .pyi file and should return the proper
module.
"""
path = file_io.path
assert path.endsw... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.auth
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.request.*
import io.ktor.util.*
/**
* OAuth versi... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-auth/common/src/io/ktor/server/auth/OAuthCommon.kt |
# Content (c) 2002, 2004, 2006, 2007, 2008, 2009
# David Turner <david@freetype.org>
#
# This file contains routines used to parse the content of documentation
# comment blocks and build more structured objects out of them.
#
from sources import *
from utils import *
import string, re
# this regular expression ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
from cement.utils import test
from dscan.common.testutils import decallmethods
from dscan.tests import BaseTest, MockHash
from mock import MagicMock
from requests.exceptions import ConnectionError
import dscan
import json
import re
import responses
import sys
try:
from urllib.... | unknown | codeparrot/codeparrot-clean | ||
//===- bolt/Profile/BoltAddressTranslation.cpp ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | bolt/lib/Profile/BoltAddressTranslation.cpp |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp |
#!/usr/bin/env python
# Copyright 2014 the V8 project 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 pool import Pool
def Run(x):
if x == 10:
raise Exception("Expected exception triggered by test.")
retu... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
import datetime
from django.db.models.aggregates import Count
from south.db import db
from south.v2 import DataMigration
from django.db import models
from pybb.compat import get_image_field_full_name, get_user_model_path, get_user_frozen_models
AUTH_USER = get_user_model_path()
class Migration(DataM... | unknown | codeparrot/codeparrot-clean | ||
<!-- #docregion -->
<!doctype html>
<html lang="en">
<head>
<base href="/" />
<title>Angular i18n example</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
<!-- #enddocregion ... | html | github | https://github.com/angular/angular | adev/src/content/examples/i18n/src/index.html |
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# Copyright: (c) 2017, Swetha Chunduri (@schunduri)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCU... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, print_function
import ctypes
import operator
import llvm.core as lc
from llvm.core import Type, Function, Module
import llvm.ee as le
from llvm.passes import build_pass_managers
from .. import llvm_array as lla
from blaze.py2help import izip, _strtypes, c_ssize_t, PY... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/local/bin/python2
# Ex7.1.py Python 2 version
# Script to parse an XML file and enumerate tags
import sys
from xml.parsers import expat
# Allow user to provide a filename, or default to books.xml
filename = sys.argv[1] if sys.argv[1:] else 'books.xml'
Tags = 0
tags = {}
class ExpatError(Exception):
pass... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import ujson
from typing import Any, Dict, List
from six import string_types
from zerver.lib.test_helpers import tornado_redirected_to_list, get_display_recipient
from zerver.lib.test_classes import ZulipTestCase
from zerver.models import get_user_profile... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
# Name: ada.py #
# Purpose: Define Ada syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
... | unknown | codeparrot/codeparrot-clean | ||
"""
Django settings for example_app project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | unknown | codeparrot/codeparrot-clean | ||
import matplotlib.cm as cm
import taichi as ti
# A compressible euler equation solver using two methods
# 1: 2nd order muscl
# 2: thinc BVD, ref: "Limiter-free discontinuity-capturing scheme
# for compressible gas dynamics with reactive fronts"
real = ti.f32
ti.init(arch=ti.gpu, default_fp=real)... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import getpass
from optparse import make_option
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from django.utils.encoding import force_str
class Command(BaseCommand):
o... | unknown | codeparrot/codeparrot-clean | ||
import os
from charmhelpers.core import host
from charmhelpers.core import hookenv
def render(source, target, context, owner='root', group='root', perms=0444, templates_dir=None):
"""
Render a template.
The `source` path, if not absolute, is relative to the `templates_dir`.
The `target` path should ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
bisect_builds = __import__('bisect-builds')
class BisectTest(unittest.TestCase):
patched = []
max_rev = 10000
def monkey_patch(... | unknown | codeparrot/codeparrot-clean | ||
"""
Created on Nov 17, 2016
@author: alkorgun
"""
import uuid
import sqlalchemy
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import sessionmaker, Session as ORMSession
from sqlalchemy.sql import text
DB_PATH = "/var/lib/urlcf/urls.db"
CONNECT_STRING = "sqlite:///" + DB_PATH
SCHEMA_URLS = """
CRE... | unknown | codeparrot/codeparrot-clean | ||
//===--- REPLCodeCompletion.h - Code completion for REPL --------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/IDE/REPLCodeCompletion.h |
import math
from ert.geo import Polyline, GeometryTools , CPolyline
from ert.geo.xyz_io import XYZIo
from ert.test import ExtendedTestCase , TestAreaContext
class GeometryToolsTest(ExtendedTestCase):
def test_distance(self):
p1 = (1,1)
p2 = (1,2,3)
with self.assertRaises(ValueError):
... | unknown | codeparrot/codeparrot-clean | ||
/*
@file add_transaction_safe
@Copyright Barrett Adair 2015-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_CLBL_TRTS_ADD_TRANSACTION_SAFE_HPP
#define BOOST_CLBL_TRTS_ADD_TRANSACTION_SAFE_HPP
#include <bo... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/callable_traits/add_transaction_safe.hpp |
"""Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
# 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
import atexit
impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""
/***************************************************************************
context_help_id.py
-------------------
begin : 2009-11-16
copyright : (C) 2009 by Gary E.Sherman
email ... | unknown | codeparrot/codeparrot-clean | ||
from django.db.models import FloatField, IntegerField
from django.db.models.aggregates import Aggregate
__all__ = [
'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept',
'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate',
]
class StatAggregate(Aggregate):
def __ini... | unknown | codeparrot/codeparrot-clean | ||
import six
from json import dumps
from unittest import TestCase
try:
from unittest.mock import patch, mock_open
except ImportError:
from mock import patch
from six.moves import builtins
from .sample_data import PARAMS, RECORD0, RECORD1, RECORD2, RECORD3, RECORD4
from dark.reads import Read, Reads
from dark.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#purpose:
#o take a note of every dir that I have been to.
#o `cd ori xx' should list the dirs that match these tokens,
#o better yet, it should allow me to choose which one and the change into it.
#o The dir history should be in the order that's last visited.
#cd ori ext
import os
from pkg.o... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
flask.testsuite.testing
~~~~~~~~~~~~~~~~~~~~~~~
Test client and more.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
from flask._compat import text_type
cl... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2025 The HuggingFace Team. 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 agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/gemma3.md |
#!/usr/bin/python
import argparse, sys, time, os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from collections import deque
class RealTimePlot:
def __init__(self, filename, x_hist, y_range, y_botflex, y_topflex):
'''Create a real time data plot animation.
... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime
from django.conf import settings
from django.contrib.auth.backends import RemoteUserBackend
from django.contrib.auth.models import User
from django.test import TestCase
class RemoteUserTest(TestCase):
urls = 'django.contrib.auth.tests.urls'
middleware = 'django.contrib.auth.midd... | unknown | codeparrot/codeparrot-clean | ||
/* Type object implementation */
#include "Python.h"
#include "pycore_abstract.h" // _PySequence_IterSearch()
#include "pycore_call.h" // _PyObject_VectorcallTstate()
#include "pycore_code.h" // CO_FAST_FREE
#include "pycore_descrobject.h" // _PyMember_GetOffset()
#include "pycore_dict.h" ... | c | github | https://github.com/python/cpython | Objects/typeobject.c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.