code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | unknown | codeparrot/codeparrot-clean | ||
"""
These type-specific answer models use a text field to allow for flexible
field sizes depending on the actual question this answer corresponds to any
"required" attribute will be enforced by the form.
"""
import logging
from django.core.exceptions import ValidationError
from django.db import models
fro... | unknown | codeparrot/codeparrot-clean | ||
//! Object files providing support for basic runtime facilities and added to the produced binaries
//! at the start and at the end of linking.
//!
//! Table of CRT objects for popular toolchains.
//! The `crtx` ones are generally distributed with libc and the `begin/end` ones with gcc.
//! See <https://dev.gentoo.org/~... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/crt_objects.rs |
"""The tests for mqtt camera component."""
from unittest.mock import ANY
from homeassistant.components import camera, mqtt
from homeassistant.components.mqtt.discovery import async_start
from homeassistant.setup import async_setup_component
from tests.common import (
MockConfigEntry,
async_fire_mqtt_message,
... | unknown | codeparrot/codeparrot-clean | ||
## This file reverse renames symbols in the wx package to give
## them their wx prefix again, for backwards compatibility.
##
## Generated by BuildRenamers in config.py
# This silly stuff here is so the wxPython.wx module doesn't conflict
# with the wx package. We need to import modules from the wx package
# here, th... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: latin-1 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any later
# version.
#
# This program is distributed in the hope... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
import datetime
import ftplib
import tempfile
import shutil
import os
import glob
import pytest
import sh
import util
nh_shp = util.NH_SHP_PATH
STD_ARGS = {
'modis': ('modis', '-s', nh_shp, '-d', '2012-337', '-v4'),
'modisndti': ('modis', '-s', nh_shp, '-d', '2012-336'... | 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 ... | java | github | https://github.com/apache/hadoop | hadoop-cloud-storage-project/hadoop-huaweicloud/src/main/java/org/apache/hadoop/fs/obs/OBS.java |
__author__ = 'tkcook'
from gi.repository import Gtk
import os
class FileManager(Gtk.Box):
def __init__(self):
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.button = Gtk.FileChooserButton(title='Choose a Root Folder', action=Gtk.FileChooserAction.SELECT_FOLDER)
self.butt... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# Copyright: (c) 2016 H2O.ai
# License: Apache License Version 2.0 (see LICENSE for details)
"""
:mod:`h2o.exceptions` -- all exceptions classes in h2o module.
All H2O exceptions derive from :class:`H2OError`.
"""
from __future__ import absolute_import, division, print_function, unicode_lit... | unknown | codeparrot/codeparrot-clean | ||
# Track expression resulted in duplicated keys for a given collection.
A track expression specified in the `@for` loop evaluated to duplicated keys for a given collection, ex.:
```angular-ts
@Component({
template: `@for (item of items; track item.value) {
{{ item.value }}
}`,
})
class Test {
items = [
{... | unknown | github | https://github.com/angular/angular | adev/src/content/reference/errors/NG0955.md |
#!/usr/bin/env python3
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contrac... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2011 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)
# ... | unknown | codeparrot/codeparrot-clean | ||
package benchmarks.flow
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import org.openjdk.jmh.annotations.*
import java.util.concurrent.TimeUnit
import java.util.concurrent.CancellationException
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
import benchmarks.flow.scrabble.flow as unsaf... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | benchmarks/src/jmh/kotlin/benchmarks/flow/TakeBenchmark.kt |
import warnings
from ..backbone_utils import BackboneConfigMixin, BackboneMixin
class BackboneConfigMixin(BackboneConfigMixin):
warnings.warn(
"Importing `BackboneConfigMixin` from `utils/backbone_utils.py` is deprecated and will be removed in "
"Transformers v5.10. Import as `from transformers.ba... | python | github | https://github.com/huggingface/transformers | src/transformers/utils/backbone_utils.py |
#include <ATen/native/sparse/cuda/cuSPARSELtOps.h>
#include <unordered_map>
#include <mutex>
#include <string_view>
#if AT_CUSPARSELT_ENABLED()
namespace at::native {
// Ideally we would use the same DeviceThreadHandlePool mechanism as used in
// aten/src/ATen/cuda/CuSparseHandlePool.cpp which would handle this for u... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/sparse/cuda/cuSPARSELtOps.cpp |
#pragma once
#include <c10/util/Exception.h>
#include <sycl/sycl.hpp>
namespace c10::xpu {
static inline sycl::async_handler asyncHandler =
[](const sycl::exception_list& el) {
if (el.size() == 0) {
return;
}
for (const auto& e : el) {
try {
std::rethrow_exception(e);
... | c | github | https://github.com/pytorch/pytorch | c10/xpu/XPUException.h |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import os
import re
import shutil
import sys
from telemetry.page import cloud_storage
class PageSetArchiveInfo(object):
de... | unknown | codeparrot/codeparrot-clean | ||
import { cacheLife } from 'next/cache';
export async function test() {
cacheLife('days');
return null;
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/errors/react-server-components/client-graph/cache-life/output.js |
# استكشاف الأخطاء وإصلاحها
تحدث الأخطاء أحيانًا، لكننا هنا للمساعدة! يغطي هذا الدليل بعض المشكلات الأكثر شيوعًا التي واجهناها وكيفية حلها. مع ذلك، لا يُقصد بهذا الدليل أن يكون مجموعة شاملة لكل مشكلات 🤗 Transformers. لمزيد من المساعدة في استكشاف مشكلتك وإصلاحها، جرب ما يلي:
<Youtube id="S2EEG3JIt2A"/>
1. اطلب المساعد... | unknown | github | https://github.com/huggingface/transformers | docs/source/ar/troubleshooting.md |
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | python | github | https://github.com/ansible/ansible | lib/ansible/module_utils/facts/network/aix.py |
/* Auto-generated by generate-wrappers.py script. Do not modify */
#if defined(__i386__) || defined(__i686__) || defined(__x86_64__)
#include <u8maxpool/sub16-sse2.c>
#endif /* defined(__i386__) || defined(__i686__) || defined(__x86_64__) */ | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/wrappers/u8maxpool/sub16-sse2.c |
//===--- SimplificationPasses.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/Optimizer/FunctionPasses/CleanupDebugSteps.swift |
//// [tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts] ////
//// [computedPropertyNames1_ES5.ts]
var v = {
get [0 + 1]() { return 0 },
set [0 + 1](v: string) { } //No error
}
//// [computedPropertyNames1_ES5.js]
"use strict";
var _a;
var v = (_a = {},
Object.defineProperty(_a,... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/computedPropertyNames1_ES5(target=es5).js |
{
"title": "OccurrenceChunkIdsPluginOptions",
"type": "object",
"additionalProperties": false,
"properties": {
"prioritiseInitial": {
"description": "Prioritise initial size over total size.",
"type": "boolean"
}
}
} | json | github | https://github.com/webpack/webpack | schemas/plugins/ids/OccurrenceChunkIdsPlugin.json |
#!/usr/bin/env python
import re
try:
import unittest2 as unittest
except ImportError:
import unittest
from csvkit.grep import FilteringCSVReader
from csvkit.exceptions import ColumnIdentifierError
class TestGrep(unittest.TestCase):
def setUp(self):
self.tab1 = [
['id', 'name', 'i_wo... | unknown | codeparrot/codeparrot-clean | ||
"""Update the IP addresses of your Route53 DNS records."""
from datetime import timedelta
import logging
from typing import List
import voluptuous as vol
from homeassistant.const import CONF_DOMAIN, CONF_TTL, CONF_ZONE
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 IBM Corp.
# Copyright 2011 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 ... | unknown | codeparrot/codeparrot-clean | ||
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
unknownField: unknown | unknown | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/util/config/strict/testdata/invalid_unknown_field_kubeproxycfg.yaml |
/*!
* 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/vite.config.ts |
#! /usr/bin/env python
'''
Simple tool for set intersection
Copyright (C) 2014 Sergey Kolevatov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# pylint: disable=W0212
"""Test for Video Xmodule functional logic.
These test data read from xml, not from mongo.
We have a ModuleStoreTestCase class defined in
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py. You can
search for usages of this in the cms and lms tests for examples... | unknown | codeparrot/codeparrot-clean | ||
# graphicsGridworldDisplay.py
# ---------------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a li... | 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
# d... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2022 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/core/async/async_subgraph.h |
- hosts: all
gather_facts: no
roles:
- { role: ../unarchive } | unknown | github | https://github.com/ansible/ansible | test/integration/targets/unarchive/runme.yml |
// SPDX-License-Identifier: GPL-2.0
/*
* NIST SP800-90A DRBG derivation function
*
* Copyright (C) 2014, Stephan Mueller <smueller@chronox.de>
*/
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#include <crypto/aes.h>
#include <crypto/df_sp80090a.h>
#include ... | c | github | https://github.com/torvalds/linux | crypto/df_sp80090a.c |
"""
===============================================
Feature transformations with ensembles of trees
===============================================
Transform your features into a higher dimensional, sparse space. Then train a
linear model on these features.
First fit an ensemble of trees (totally random trees, a rand... | python | github | https://github.com/scikit-learn/scikit-learn | examples/ensemble/plot_feature_transformation.py |
import logging
from fabric.api import serial, task, parallel, env, execute, runs_once, settings,sudo
from fabfile.safety import noopable
from multiprocessing import Manager
from timestamps import no_ts
from packages import PackageInfo
import tempfile
from output import notify
@task
@parallel
def collect_installed_pack... | unknown | codeparrot/codeparrot-clean | ||
# $Id: __init__.py 6164 2009-10-11 11:00:11Z grubert $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This is the Docutils (Python Documentation Utilities) package.
Package Structure
=================
Modules:
- __init__.py: Contains component base cl... | unknown | codeparrot/codeparrot-clean | ||
REPORT_CASE_INDEX="report_cases_ae5ce2b30b6c42dea585a223333290f1"
REPORT_CASE_MAPPING={'_meta': {'comment': '2013-11-05 dmyung',
'created': None},
'date_detection': False,
'date_formats': ['yyyy-MM-dd',
"yyyy-MM-dd'T'HH:mm:ssZZ",
"yyyy-MM-dd'T'HH:mm:ss.SSSSSS",
... | unknown | codeparrot/codeparrot-clean | ||
from wtforms.utils import WebobInputWrapper
from wtforms import i18n
class DefaultMeta(object):
"""
This is the default Meta class which defines all the default values and
therefore also the 'API' of the class Meta interface.
"""
# -- Basic form primitives
def bind_field(self, form, unbound_f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2003-2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | unknown | codeparrot/codeparrot-clean | ||
from south.db import db
from django.db import models
from cms.plugins.snippet.models import *
class Migration:
needed_by = (
# Migration after cms.publisher2, keep migrations in sync with real db
# Fixes migration error in MySQL
("cms", "0022_login_required_added.py"),
)
def forwar... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for the LTI provider views
"""
from unittest.mock import MagicMock, patch
from django.test import TestCase
from django.test.client import RequestFactory
from django.urls import reverse
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from common.djangoapps.student.tests.factories import... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division
import os
import json
import socket
import logging
import operator
import threading
from datetime import datetime, timedelta
from time import sleep
from functools import total_ordering, wraps, partial
import amqp
from flask import Flask, Blueprint
from flask import render_template, redi... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: curl_getdate
Section: 3
Source: libcurl
See-also:
- CURLOPT_TIMECONDITION (3)
- CURLOPT_TIMEVALUE (3)
- curl_easy_escape (3)
- curl_easy_unescape (3)
Protocol:
- All
Added-in: 7.1
---
# NAME
curl_getdate - co... | unknown | github | https://github.com/curl/curl | docs/libcurl/curl_getdate.md |
#!/usr/bin/env python
"""
inkex.py
A helper module for creating Inkscape extensions
Copyright (C) 2005,2007 Aaron Spike, aaron@ekips.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either versio... | unknown | codeparrot/codeparrot-clean | ||
/* 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/compiler/mlir/utils/name_utils.h |
# 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 | ||
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlin.js.*
import kotlin.test.*
class PromiseTest : TestBase() {
@Test
fun testPromiseResolvedAsDeferred() = GlobalScope.promise {
val promise = Promise<JsReference<String>> { resolve, _ ->
resolve("OK".toJsReference())... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/wasmJs/test/PromiseTest.kt |
-- These tests display internal details that would not be stable under
-- debug_parallel_query, so make sure that option is disabled.
SET debug_parallel_query = off;
-- Make sure that we don't print any JIT-related information, as that
-- would also make results unstable.
SET jit = off;
-- These options do not exist,... | sql | github | https://github.com/postgres/postgres | contrib/pg_overexplain/sql/pg_overexplain.sql |
Anything in this description will be included in the commit message. Replace or delete this text before merging. Add links to testing in the comments of the PR. | unknown | github | https://github.com/mongodb/mongo | .github/pull_request_template.md |
package v0alpha1
import (
"fmt"
"slices"
"time"
)
func (o *RecordingRule) GetProvenanceStatus() string {
if o == nil || o.Annotations == nil {
return ProvenanceStatusNone
}
s, ok := o.Annotations[ProvenanceStatusAnnotationKey]
if !ok {
return ProvenanceStatusNone
}
return s
}
func (o *RecordingRule) Set... | go | github | https://github.com/grafana/grafana | apps/alerting/rules/pkg/apis/alerting/v0alpha1/recordingrule_ext.go |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: interface
Arg: <name>
Help: Use network interface
Category: connection
Added: 7.3
Multi: single
See-also:
- dns-interface
Example:
- --interface eth0 $URL
- --interface "host!10.0.0.1" $URL
- --interface "if!enp3s... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/interface.md |
"""
API related to providing field overrides for individual students. This is used
by the individual due dates feature.
"""
import json
from .field_overrides import FieldOverrideProvider
from .models import StudentFieldOverride
class IndividualStudentOverrideProvider(FieldOverrideProvider):
"""
A concrete im... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | unknown | codeparrot/codeparrot-clean | ||
# Tests for rich comparisons
import unittest
from test import test_support
import operator
class Number:
def __init__(self, x):
self.x = x
def __lt__(self, other):
return self.x < other
def __le__(self, other):
return self.x <= other
def __eq__(self, other):
return... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActiveRecord
module ConnectionAdapters
module SQLite3
class SchemaCreation < SchemaCreation # :nodoc:
private
def visit_ForeignKeyDefinition(o)
super.dup.tap do |sql|
sql << " DEFERRABLE INITIALLY #{o.deferrable.to_s.upcase}" ... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/connection_adapters/sqlite3/schema_creation.rb |
from __future__ import print_function
import unittest
from test import test_support as support
import os
import sys
# Setup bsddb warnings
try:
bsddb = support.import_module('bsddb', deprecated=True)
except unittest.SkipTest:
pass
class NoAll(RuntimeError):
pass
class FailedImport(RuntimeError):
pas... | unknown | codeparrot/codeparrot-clean | ||
#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2005, 2006, 2007 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# ... | unknown | codeparrot/codeparrot-clean | ||
"""
A generic comment-moderation system which allows configuration of
moderation options on a per-model basis.
To use, do two things:
1. Create or import a subclass of ``CommentModerator`` defining the
options you want.
2. Import ``moderator`` from this module and register one or more
models, passing the model... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui/main.ui'
#
# Created by: PyQt5 UI code generator 5.8
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_PyreeMainWindow(object):
def setupUi(self, PyreeMainWindow):
... | unknown | codeparrot/codeparrot-clean | ||
from math import *
import proteus.MeshTools
from proteus import Domain
from proteus.default_n import *
from proteus.Profiling import logEvent
from proteus.ctransportCoefficients import smoothedHeaviside
from proteus.ctransportCoefficients import smoothedHeaviside_integral
from proteus import Gauges
from proteus.Gauges ... | unknown | codeparrot/codeparrot-clean | ||
# Generated by Django 2.2.19 on 2021-04-16 14:31
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('aklub', '0100_auto_20210416_1347'),
]
operations = [
migrations.AddField(
... | unknown | codeparrot/codeparrot-clean | ||
@file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED", "UNREACHABLE_CODE") // KT-21913
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlin.test.*
class WithTimeoutTest : TestBase() {
/**
* Tests a case of no timeout and no suspension inside.
*/
@Test
fun testBasicNoSuspend() = r... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/WithTimeoutTest.kt |
from __future__ import print_function
import os
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
# If modifying these scopes, delete the file token.json.
# this scope allows the reading and writing of files to Google Drive
SCOPES = "https://www.google... | unknown | codeparrot/codeparrot-clean | ||
# vim:fileencoding=utf-8
# Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__package__ = 'gentoolkit.eshowkw'
__version__ = 'svn'
__author__ = "Tomáš Chvátal <scarabeus@gentoo.org>"
import sys, os, fnmatch
import argparse
from portage import output as porto
from por... | 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/testing/FakeTickerTest.java |
# Copyright 2011 Software Freedom Conservancy.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 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 | ||
class Test {
var bar : Int = 42
}
fun box() {
val t = Test()
t.<expr>bar</expr>
} | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/compileTimeConstantProvider/evaluate/namedReference_var.kt |
"""Integration tests for Azure Active Directory / Microsoft Account provider."""
from __future__ import absolute_import
from third_party_auth.tests.specs import base
class AzureADOauth2IntegrationTest(base.Oauth2IntegrationTest):
"""Integration tests for Azure Active Directory / Microsoft Account provider."""
... | unknown | codeparrot/codeparrot-clean | ||
#ifndef MATRIX_H
#define MATRIX_H
// The following macro defines the prototypes for a family of
// functions that work with 2D arrays with the forms
//
// TYPE SNAMEDet( TYPE matrix[2][2]);
// TYPE SNAMEMax( TYPE * matrix, int rows, int cols);
// TYPE SNAMEMin( int rows, int cols, TYPE * matrix);
... | c | github | https://github.com/numpy/numpy | tools/swig/test/Matrix.h |
"Implementation of tzinfo classes for use with datetime.datetime."
from __future__ import unicode_literals
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING
# Python's doc say: "A tzinfo subclass must have an __init__() method that ca... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2009 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 net
import (
"internal/poll"
"io"
"os"
"syscall"
"time"
)
// Network file descriptor.
type netFD struct {
pfd poll.FD
// immutable until Close... | go | github | https://github.com/golang/go | src/net/fd_plan9.go |
//// [tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts] ////
//// [ES3For-ofTypeCheck4.ts]
var union: string | string[];
for (const v of union) { }
//// [ES3For-ofTypeCheck4.js]
"use strict";
var union;
for (const v of union) { } | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).js |
// Copyright 2022 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package binding
import (
"errors"
"strconv"
"testing"
)
func BenchmarkSliceValidationError(b *testing.B) {
const size int = 100
e := make(SliceValidationE... | go | github | https://github.com/gin-gonic/gin | binding/default_validator_benchmark_test.go |
import unittest
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import gradient_check
from chainer import initializers
from chainer import links
from chainer import memory_layouts
from chainer import testing
from chainer.testing import attr
from chaine... | unknown | codeparrot/codeparrot-clean | ||
"""Tracking for bluetooth low energy devices."""
import logging
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker import (
YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL,
load_config, SOURCE_TYPE_BLUETOOTH_LE
)
import homeassis... | unknown | codeparrot/codeparrot-clean | ||
import tkinter as tk
import os
class Navodila:
def __init__(self, master):
self.master = master
self.polje = tk.Canvas(master)
self.polje.pack(fill='both', expand='yes')
self.polje.config(bg="grey20")
# Vse slike:
master.slika_ozadje_id = tk.PhotoImage(
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright Antony Polukhin, 2020-2024.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/any for Documentation.
#ifndef BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED
#define BOOST_ANY... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/any/bad_any_cast.hpp |
import logging
import shutil
import json
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed, Http404
fro... | unknown | codeparrot/codeparrot-clean | ||
# sql/functions.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL function API, factories, and built-in functions.
"""
from . import sqltypes... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
""" Logging, config, constants & utilities """
from __future__ import unicode_literals, absolute_import
import os
import re
import sys
import logging
import unicodedata
from pprint import pformat as pretty
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Constants
#... | unknown | codeparrot/codeparrot-clean | ||
/*------------------------------------------------------------------------
*
* geqo_ox2.c
*
* order crossover [OX] routines;
* OX2 operator according to Syswerda
* (The Genetic Algorithms Handbook, ed L Davis)
*
* src/backend/optimizer/geqo/geqo_ox2.c
*
*--------------------------------------------------------------... | c | github | https://github.com/postgres/postgres | src/backend/optimizer/geqo/geqo_ox2.c |
"""
Contains functions implementing edit distance algorithms.
"""
from whoosh.compat import xrange
def levenshtein(seq1, seq2, limit=None):
"""Returns the Levenshtein edit distance between two strings.
"""
oneago = None
thisrow = range(1, len(seq2) + 1) + [0]
for x in xrange(len(seq1)):
#... | unknown | codeparrot/codeparrot-clean | ||
//===--- PassManagerVerifierAnalysis.h ------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 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/SILOptimizer/Analysis/PassManagerVerifierAnalysis.h |
"""
DIRECTED MUTAGENESIS
Example case: Barnase-Barstar
"""
from aesop import DirectedMutagenesis, plotScan, writePDB
if __name__ == '__main__': # Protect entry point of Windows application for parallel processes
path_apbs = 'apbs' # Make sure these
path_coulomb = 'coulomb' # are correct
path_pdb2pqr = 'pdb2p... | unknown | codeparrot/codeparrot-clean | ||
# Generating code using schematics
A schematic is a template-based code generator that supports complex logic.
It is a set of instructions for transforming a software project by generating or modifying code.
Schematics are packaged into collections and installed with npm.
The schematic collection can be a powerful to... | unknown | github | https://github.com/angular/angular | adev/src/content/tools/cli/schematics.md |
from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import traceback
import warnings
import zipfile
from distutils import sysconfig
from distutils.util import change_root
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from... | unknown | codeparrot/codeparrot-clean | ||
import time
import logging
import random
import collections
import gevent
from Worker import Worker
from Config import config
from util import helper
from Plugin import PluginManager
import util
@PluginManager.acceptPlugins
class WorkerManager(object):
def __init__(self, site):
self.site = site
... | unknown | codeparrot/codeparrot-clean | ||
import os
import argparse
import datetime
import yaml
import api.src.common.initial_environment_config
from ..models.dense import create_model
from ..data_processing.data_generator import DataGenerator
from ..common.config import TrainingConfig, DataConfig, Config
from ..common.utils import print_info, ensure_dir
from... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
#
"""This is the interface for managing cron jobs."""
import itertools
import time
from grr.gui import renderers
from grr.gui.plugins import fileview
from grr.gui.plugins import flow_management
from grr.gui.plugins import forms
from grr.gui.plugins import... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sqlalchemy import (
Column,
Integer,
Text,
)
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
validates,
)
from zope.sqlalchemy import... | unknown | codeparrot/codeparrot-clean | ||
import batoid
import galsim
import numpy as np
from test_helpers import timer, do_pickle, all_obj_diff, rays_allclose
@timer
def test_horner2d():
rng = np.random.default_rng(5)
for _ in range(1000):
nx = rng.integers(1, 21)
ny = rng.integers(1, 21)
arr = rng.normal(size=(ny, nx))
... | unknown | codeparrot/codeparrot-clean | ||
/* Testing module for multi-phase initialization of extension modules (PEP 489)
*/
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#include "Python.h"
#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_namespace.h" // _PyNamespace_New()
/* State for testing modul... | c | github | https://github.com/python/cpython | Modules/_testmultiphase.c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.