code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
* Declaration of context structures for use with the PSA driver wrapper
* interface. This file contains the context structures for 'primitive'
* operations, i.e. those operations which do not rely on other contexts.
*
* Warning: This file will be auto-generated in the future.
*
* \note This file may not b... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/psa/crypto_driver_contexts_primitives.h |
# -*- coding: utf-8 -*-
"""
A sample of kay settings.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
DEFAULT_TIMEZONE = 'Asia/Tokyo'
DEBUG = False
PROFILE = False
SECRET_... | unknown | codeparrot/codeparrot-clean | ||
// Code generated by "enumer -type=CredentialType -trimprefix=CredentialType -transform=snake"; DO NOT EDIT.
package dbplugin
import (
"fmt"
)
const _CredentialTypeName = "passwordrsa_private_keyclient_certificate"
var _CredentialTypeIndex = [...]uint8{0, 8, 23, 41}
func (i CredentialType) String() string {
if i... | go | github | https://github.com/hashicorp/vault | sdk/database/dbplugin/v5/credentialtype_enumer.go |
from pathlib import Path
EXTENSIONS = {
"tests.test_cmdline.extensions.TestExtension": 0,
}
TEST1 = "default"
FEEDS = {
Path("items.csv"): {
"format": "csv",
"fields": ["price", "name"],
},
} | python | github | https://github.com/scrapy/scrapy | tests/test_cmdline/settings.py |
## Input
```javascript
function Component() {
// a's mutable range should be limited
// the following line
let a = someObj();
let x = [];
x.push(a);
return [x, a];
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Component() {
const $ = _c(2);
let t0;
if ($[... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver.expect.md |
#ifndef SRC_NODE_BOB_INL_H_
#define SRC_NODE_BOB_INL_H_
#include "node_bob.h"
#include <functional>
namespace node {
namespace bob {
template <typename T>
int SourceImpl<T>::Pull(
Next<T> next,
int options,
T* data,
size_t count,
size_t max_count_hint) {
int status;
if (eos_) {
status =... | c | github | https://github.com/nodejs/node | src/node_bob-inl.h |
"""
@package mi.instrument.harvard.massp.ooicore.test.test_driver
@file marine-integrations/mi/instrument/harvard/massp/ooicore/driver.py
@author Peter Cable
@brief Test cases for ooicore driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver -u [-t tes... | unknown | codeparrot/codeparrot-clean | ||
.input {
font-family: "DejaVu Sans Mono";
padding-top: 7px;
transition: none;
&:focus-within {
outline: rem(2px) solid var(--mantine-color-blue-filled);
border-color: transparent;
}
&:placeholder-shown {
font-family: unset;
}
} | css | github | https://github.com/prometheus/prometheus | web/ui/mantine-ui/src/pages/query/QueryPanel.module.css |
# Taken from Python 2.7 with permission from/by the original author.
import warnings
import sys
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warning
warnings.warn("django.utils.importlib will be removed in Django 1.9.",
RemovedInDjango19Warning, stacklevel=2)
def _resolve_na... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// 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/UsingInserter.cpp |
from esc import NUL, blank
import escargs
import esccmd
import escio
from escutil import AssertEQ, GetCursorPosition, GetScreenSize, AssertScreenCharsInRectEqual, knownBug
from esctypes import Point, Rect
class ICHTests(object):
def test_ICH_DefaultParam(self):
""" Test ICH with default parameter """
esccmd.... | unknown | codeparrot/codeparrot-clean | ||
prelude: |
class C
def m
end
end
o = C.new
m = :m
benchmark:
vm_send: |
o.__send__ :m
vm_send_var: |
o.__send__ m
loop_count: 6000000 | unknown | github | https://github.com/ruby/ruby | benchmark/vm_send.yml |
""" Collection of Model instances for use with the odrpack fitting package.
"""
import numpy as np
from scipy.odr.odrpack import Model
def _lin_fcn(B, x):
a, b = B[0], B[1:]
b.shape = (b.shape[0], 1)
return a + (x*b).sum(axis=0)
def _lin_fjb(B, x):
a = np.ones(x.shape[-1], float)
res = np.concat... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
import logging
log = logging.getLogger("modules.PhotoConverter")
import conduit
import conduit.utils as Utils
import conduit.TypeConverter as TypeConverter
import conduit.datatypes.File as File
import conduit.datatypes.Photo as Photo
MODULES = {
"PixbufPhotoConverter" : { "type": "converter" }
}
NO_RESIZE =... | unknown | codeparrot/codeparrot-clean | ||
"""
Config.py is a repository of the Cobbler object model
Copyright 2006-2008, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.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 th... | unknown | codeparrot/codeparrot-clean | ||
"""
WSGI config for domotica project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2012 CERN.
#
# Invenio 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 v... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
############ Maintenance notes #########################################
#
# ABCs are... | python | github | https://github.com/python/cpython | Lib/numbers.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 | core/spring-boot/src/main/java/org/springframework/boot/context/metrics/buffering/BufferingApplicationStartup.java |
#! /usr/bin/env python
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
# (Dec 1991 version).
__all__ = ["encode", "decode", "encodestring", "decodestring"]
ESCAPE = '='
MAXLINESIZE = 76
HEX = '0123456789ABCDEF'
EMPTYSTRING = ''
try:
from binascii import a2b_qp, b2a_qp
except Impo... | unknown | codeparrot/codeparrot-clean | ||
# React Compiler Passes Documentation
This directory contains detailed documentation for each pass in the React Compiler pipeline. The compiler transforms React components and hooks to add automatic memoization.
## High-Level Architecture
```
┌─────────────────────────────────────────────────────... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/docs/passes/README.md |
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, N... | unknown | codeparrot/codeparrot-clean | ||
# util.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 link to http://ai.berkeley.edu.
#
# Attrib... | unknown | codeparrot/codeparrot-clean | ||
// RUN: mkdir -p %t.dir/move-var
// RUN: cp %S/Inputs/var_test* %t.dir/move-var
// RUN: cd %t.dir/move-var
// RUN: clang-move -names="a::kGlobalInt" -new_header=%t.dir/move-var/new_var_test.h -old_header=../move-var/var_test.h -old_cc=../move-var/var_test.cpp -new_cc=%t.dir/move-var/new_var_test.cpp %t.dir/move-var/va... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-move/move-var.cpp |
__all__ = (
'HTTPException',
'HTTPError',
'HTTPRedirection',
'HTTPSuccessful',
'HTTPOk',
'HTTPCreated',
'HTTPAccepted',
'HTTPNonAuthoritativeInformation',
'HTTPNoContent',
'HTTPResetContent',
'HTTPPartialContent',
'HTTPMultipleChoices',
'HTTPMovedPermanently',
'HT... | unknown | codeparrot/codeparrot-clean | ||
'''
doos: A multi-threaded server for running client-provided macros in OpenOffice.org
Copyright (C) 2008 - 2009 therudegesture and dustymugs
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 v... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
from south.v2 import DataMigration
class Migration(DataMigration):
depends_on = (('socialaccount', '0002_genericmodels'),)
def forwards(self, orm):
# Migrate apps
app_id_to_sapp = {}
for app in orm.TwitterApp.objects.all():
sapp = orm['socialaccount.Socia... | unknown | codeparrot/codeparrot-clean | ||
Clock Component
===============
Symfony Clock decouples applications from the system clock.
Getting Started
---------------
```bash
composer require symfony/clock
```
```php
use Symfony\Component\Clock\NativeClock;
use Symfony\Component\Clock\ClockInterface;
class MyClockSensitiveClass
{
public function __cons... | unknown | github | https://github.com/symfony/symfony | src/Symfony/Component/Clock/README.md |
#@PydevCodeAnalysisIgnore
from lxml import etree as ET
import dictionaries.jmdict
import dictionaries.freq
import dictionaries.deinflecter
from librepo import Result
from copy import deepcopy
class Lookup(object):
'''
Combines and abstracts dict, freq and deinflecter
'''
def __init__(self):
se... | unknown | codeparrot/codeparrot-clean | ||
"Functions that help with dynamically creating decorators for views."
import types
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
def decorator_from_middleware(middleware_class):
"""
Given a middleware class (not an instance)... | unknown | codeparrot/codeparrot-clean | ||
import sys
import re
from collections import OrderedDict
from twisted.internet import defer
from polyjit.buildbot.builders import register
from polyjit.buildbot import slaves
from polyjit.buildbot.utils import (builder, define, git, ucmd, ucompile, cmd,
upload_file, ip, s_sbranch, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
###############################################################################
#
# FilterByKeyword
# Retrieves analytics, filtering down to only the results you specify in a keyword filter.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License,... | unknown | codeparrot/codeparrot-clean | ||
"""utility functions
"""
import logging
logger = logging.getLogger("tnef-decode")
def bytes_to_int(bytes=None):
"transform multi-byte values into integers"
n = num = 0
for b in bytes:
num += ( ord(b) << n)
n += 8
return num
def checksum(data):
"calculate a checksum for the TNEF data"
# N... | 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 n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/common/utils/ExponentialBackoffManagerTest.java |
from __future__ import absolute_import
from __future__ import with_statement
from datetime import datetime, timedelta
from functools import wraps
from celery import task
from celery.app import app_or_default
from celery.task import task as task_dec
from celery.exceptions import RetryTaskError
from celery.execute impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Download US Fed Rate and perform sensitivity analysis
# Author: ttoleung@gmail.com
#
from datetime import datetime
import urllib2
import MySQLdb as mdb
import sys
def rate_url():
i = datetime.now()
url = 'http://data.treasury.gov/feed.svc/DailyTreasuryYieldCurveRateData?$filter=month(NEW_DATE)%... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# 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) any later version.
#
# Written (W) 2012 Heiko Strathmann
# Copyrigh... | unknown | codeparrot/codeparrot-clean | ||
package reconcilers
import (
"github.com/grafana/grafana/pkg/infra/metrics/metricutil"
"github.com/prometheus/client_golang/prometheus"
)
// ReconcilerMetrics holds all the metrics for the IAM folder reconciler
type ReconcilerMetrics struct {
// Comprehensive reconcile operations counter with labels for action, st... | go | github | https://github.com/grafana/grafana | apps/iam/pkg/reconcilers/metrics.go |
# 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 | ||
import re
import io
import os
import sys
import codecs
from weakref import WeakKeyDictionary
PY2 = sys.version_info[0] == 2
WIN = sys.platform.startswith('win')
DEFAULT_COLUMNS = 80
_ansi_re = re.compile('\033\[((?:\d|;)*)([a-zA-Z])')
def get_filesystem_encoding():
return sys.getfilesystemencoding() or sys.getde... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const makeSnapshotResolver = require('./makeSnapshotResolver');
module.exports = makeSnapshotResolver(true); | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/scripts/jest/snapshot-resolver-with-forget.js |
#!/usr/bin/env python
# Copyright 2015 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=protected-access
import logging
import sys
import unittest
import unittest_util
class FilterTestNamesTest(unittest.... | unknown | codeparrot/codeparrot-clean | ||
minor_changes:
- deb822_repository - add include and exclude parameter arguments (https://github.com/ansible/ansible/issues/86155) | unknown | github | https://github.com/ansible/ansible | changelogs/fragments/86155-deb822_repository_include_exclude.yaml |
use std::cell::UnsafeCell;
use std::fmt;
use std::ops::Deref;
use std::panic;
/// `AtomicU16` providing an additional `unsync_load` function.
pub(crate) struct AtomicU16 {
inner: UnsafeCell<std::sync::atomic::AtomicU16>,
}
unsafe impl Send for AtomicU16 {}
unsafe impl Sync for AtomicU16 {}
impl panic::RefUnwindSa... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/loom/std/atomic_u16.rs |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package addrs
import "github.com/hashicorp/terraform/internal/tfdiags"
// DiagnosticExtraCheckRule provides an interface for diagnostic ExtraInfo to
// retrieve an embedded CheckRule from within a tfdiags.Diagnostic.
type DiagnosticExtraCheckRule ... | go | github | https://github.com/hashicorp/terraform | internal/addrs/check_rule_diagnostic.go |
from langchain_core.prompts.prompt import PromptTemplate
_DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = """You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update the summary of the provided entity in the "Entity" section based on the last line of your co... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/indexes/prompts/entity_summarization.py |
# coding=utf-8
import socket
import json
import logging
import configuracao
logger = logging.getLogger()
class Contadores(object):
def __init__(self):
self.idiomas = {}
self.com_link = 0
self.sem_link = 0
# Porta que o Servidor esta
self.tcp = socket.socket(socket.AF_INET, ... | unknown | codeparrot/codeparrot-clean | ||
import NIOCore
import NIOHTTP1
extension Client {
public func get(_ url: URI, headers: HTTPHeaders = [:], beforeSend: (inout ClientRequest) throws -> () = { _ in }) async throws -> ClientResponse {
return try await self.send(.GET, headers: headers, to: url, beforeSend: beforeSend).get()
}
public f... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Concurrency/Client+Concurrency.swift |
// Copyright 2025 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 runtime_test
import (
"os"
"regexp"
"runtime"
"testing"
)
func validateMapLabels(t *testing.T, labels []string) {
// These are the specific regio... | go | github | https://github.com/golang/go | src/runtime/decoratemappings_test.go |
from __future__ import unicode_literals
from django.utils import six
from djblets.extensions.hooks import (DataGridColumnsHook, ExtensionHook,
ExtensionHookPoint, SignalHook,
TemplateHook, URLHook)
from reviewboard.accounts.backends import (r... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2014 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 | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/ReplaceDecoratedRememberMeHandlerPass.php |
import logging
import re
import lxml.etree as ET
_account_alias_pattern = re.compile("Account: *([^(]+) *\(([0-9]+)\)")
_account_without_alias_pattern = re.compile("Account: *\(?([0-9]+)\)?")
def account_aliases(session, username, password, auth_method, saml_response, config):
alias_response = session.post(
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''ISO K-line protocol decoder
Decodes ISO9141 and ISO14230 automotive data bus protocols
'''
# Copyright © 2013 Kevin Thibedeau
# This file is part of Ripyl.
# Ripyl is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General ... | unknown | codeparrot/codeparrot-clean | ||
import base64
import os
try:
from _thread import get_ident
except ImportError:
from thread import get_ident
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
from sqlobject import col
from sqlobject import dberrors
from sqlobject.dbconnection import DBAPI, Boolean
sqlite2... | unknown | codeparrot/codeparrot-clean | ||
from PyQt5.QtWidgets import QMainWindow, QPushButton , QWidget , QMessageBox, QApplication, QHBoxLayout
import sys, sqlite3
class WinForm(QMainWindow):
def __init__(self, parent=None):
super(WinForm, self).__init__(parent)
button1 = QPushButton('插入数据')
button2 = QPushButton('显示数据')
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 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 ... | unknown | codeparrot/codeparrot-clean | ||
# 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 limitation the rights ... | unknown | codeparrot/codeparrot-clean | ||
package opts
import (
"testing"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
func TestNRIOptsJSON(t *testing.T) {
tests := []struct {
name string
json string
expErr string
expNRI NRIOpts
}{
{
name: "no config",
expNRI: NRIOpts{},
},
{
name: "json enable",
json: `{"e... | go | github | https://github.com/moby/moby | daemon/pkg/opts/nri_opts_test.go |
"""distutils.mwerkscompiler
Contains MWerksCompiler, an implementation of the abstract CCompiler class
for MetroWerks CodeWarrior on the Macintosh. Needs work to support CW on
Windows."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: mwerkscompiler.py 37828 2004-11-10 22:23:15Z loewis... | unknown | codeparrot/codeparrot-clean | ||
"""Copyright 2008 Orbitz WorldWide
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | unknown | codeparrot/codeparrot-clean | ||
import importlib
import inspect
import os
import re
import sys
import tempfile
import threading
from io import StringIO
from pathlib import Path
from unittest import mock, skipIf
from asgiref.sync import async_to_sync, iscoroutinefunction
from django.core import mail
from django.core.files.uploadedfile import SimpleU... | python | github | https://github.com/django/django | tests/view_tests/tests/test_debug.py |
"""
Use this module to get and run all tk tests.
Tkinter tests should live in a package inside the directory where this file
lives, like test_tkinter.
Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.test_support
this_dir_... | unknown | codeparrot/codeparrot-clean | ||
"""
Orthogonal Distance Regression (:mod:`scipy.odr`)
=================================================
Introduction
------------
Why Orthogonal Distance Regression (ODR)? Sometimes one has
measurement errors in the explanatory (a.k.a., "independent")
variable(s), not just the response (a.k.a., "dependent") variable... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestDFS:
def setUp(self):
# simple graph
G=nx.Graph()
G.add_edges_from([(0,1),(1,2),(1,3),(2,4),(3,4)])
self.G=G
# simple graph, disconnected
D=nx.Graph()
D.add_edges_from([(0,1),(2,3... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python -u
import sys, unittest
import libxml2
class TestCase(unittest.TestCase):
def runTest(self):
self.test1()
self.test2()
def setUp(self):
libxml2.debugMemory(1)
def tearDown(self):
libxml2.cleanupParser()
if libxml2.debugMemory(1) != 0:
... | unknown | codeparrot/codeparrot-clean | ||
import uuid
from auth_backends.adfs.base import BaseADFS
class HelsinkiLibraryAskoADFS(BaseADFS):
"""Helsinki Libraries' ASKO ADFS authentication backend"""
name = 'helsinki_library_asko_adfs'
AUTHORIZATION_URL = 'https://askofs.lib.hel.fi/adfs/oauth2/authorize'
ACCESS_TOKEN_URL = 'https://askofs.lib.... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
from .info import __doc__
from numpy.version import version as __version__
# disables OpenBLAS affinity setting of the main thread that limits
# python threads or processes to one core
import os
envbak = os.environ.copy()
if 'OPENBLAS_MAIN_FREE' not in ... | unknown | codeparrot/codeparrot-clean | ||
---
title: Reactive $: statements
---
In runes mode, reactions to state updates are handled with the [`$derived`]($derived) and [`$effect`]($effect) runes.
In legacy mode, any top-level statement (i.e. not inside a block or a function) can be made reactive by prefixing it with a `$:` [label](https://developer.mozilla... | unknown | github | https://github.com/sveltejs/svelte | documentation/docs/99-legacy/02-legacy-reactive-assignments.md |
import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
from optim import AMSGrad
# Hyper Parameters
input_size = 784
hidden_size = 500
num_classes = 10
num_epochs = 5
batch_size = 100
learning_rate = 0.001
# MNIST Datase... | unknown | codeparrot/codeparrot-clean | ||
#ifndef PARSE_OPTIONS_H
#define PARSE_OPTIONS_H
#include "gettext.h"
struct repository;
/**
* Refer to Documentation/technical/api-parse-options.adoc for the API doc.
*/
enum parse_opt_type {
/* special types */
OPTION_END,
OPTION_GROUP,
OPTION_NUMBER,
OPTION_ALIAS,
OPTION_SUBCOMMAND,
/* options with no ar... | c | github | https://github.com/git/git | parse-options.h |
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_
#define NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_
#if defined(linux) || defined(__linux) || defined(__linux__)
#define NPY_OS_LINUX
#elif defined(__FreeBSD__) || defined(__NetBSD__) || \
defined(__OpenBSD__) || defined(__DragonFly__)
#define NPY_OS_BSD
#ifdef... | c | github | https://github.com/numpy/numpy | numpy/_core/include/numpy/npy_os.h |
package daemon
import (
"context"
"errors"
"fmt"
"time"
"github.com/docker/go-units"
"github.com/moby/moby/api/types/container"
libcontainerdtypes "github.com/moby/moby/v2/daemon/internal/libcontainerd/types"
)
// ContainerTop handles `docker top` client requests.
//
// Future considerations:
// - Windows u... | go | github | https://github.com/moby/moby | daemon/top_windows.go |
import { flushSync } from 'svelte';
import { ok, test } from '../../test';
export default test({
html: `
<button>Click Me</button>
Hello World
`,
test({ assert, target, window }) {
const button = target.querySelector('button');
ok(button);
const event = new window.MouseEvent('click', { bubbles: true });
... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/event-handler-dynamic-bound-var/_config.js |
from __future__ import absolute_import
import logging
import sys
import textwrap
from pip.basecommand import Command, SUCCESS
from pip.download import PipXmlrpcTransport
from pip.models import PyPI
from pip.utils import get_terminal_size
from pip.utils.logging import indent_log
from pip.exceptions import CommandError... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package jsonfunction
import (
"fmt"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/zclconf/go-cty-debug/ctydebug"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/function"
)
func TestMarshalParameter(t *testing.T) {
te... | go | github | https://github.com/hashicorp/terraform | internal/command/jsonfunction/parameter_test.go |
import unittest
from django.core.exceptions import ImproperlyConfigured
from django.db import ProgrammingError, connection
from django.db.backends.base.base import NO_DB_ALIAS
from django.test import TestCase
try:
from django.contrib.gis.db.backends.postgis.operations import PostGISOperations
HAS_POSTGRES = ... | python | github | https://github.com/django/django | tests/gis_tests/tests.py |
#ifndef SHALLOW_H
#define SHALLOW_H
#include "commit.h"
#include "lockfile.h"
#include "object.h"
#include "repository.h"
#include "strbuf.h"
struct oid_array;
struct strvec;
void set_alternate_shallow_file(struct repository *r, const char *path, int override);
int register_shallow(struct repository *r, const struct... | c | github | https://github.com/git/git | shallow.h |
"""
Django settings for ForumSite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
InterpolationDataWidget.py
---------------------
Date : December 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 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 requ... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.apach... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
import sys
from numpy.distutils.fcompiler import FCompiler
compilers = ['NAGFCompiler']
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
description = 'NAGWare Fortran 95 Compiler'
version_pattern = r'NAGWare Fortran 95 compiler Relea... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
###################################################... | unknown | codeparrot/codeparrot-clean | ||
import calendar
import json
import time
from django.conf import settings
from django.core.urlresolvers import reverse
import jwt
import mock
from nose.tools import eq_
import mkt
import mkt.site.tests
from mkt.receipts.utils import create_receipt, get_key
from mkt.site.fixtures import fixture
from mkt.site.helpers i... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import e... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2021 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | unknown | codeparrot/codeparrot-clean | ||
"""
A package that maps incoming email to HTTP requests
Mailpost version 0.1
(C) 2010 oDesk www.oDesk.com
"""
"""
fnmatch.py - fork of original fnmatch
=====================================
.. _purpose:
Purpose of the fork
-----------------
Original fnmatch has an issue while matching escaped strings and not match
pat... | unknown | codeparrot/codeparrot-clean | ||
import struct
import logging
import threading
from SocketServer import TCPServer, ThreadingMixIn, BaseRequestHandler
from MSSQLPackets import *
from core.responder.common import *
mitmf_logger = logging.getLogger("mitmf")
class MSSQLServer():
def start(self, chal):
global Challenge; Challenge = chal
... | unknown | codeparrot/codeparrot-clean | ||
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 VMware, Inc.
#
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
import sys
# check input parameters, generate INDATA list
# code placed here to avoid unneccesary vtk loading
if len(sys.argv) == 1 :
sys.stderr.write('Using standard data set, to use other data:\n'.format(sys.argv[0]))
sys.stderr.write('Usage: {0} <pdb file> <connection file> |<protna... | unknown | codeparrot/codeparrot-clean | ||
#incrementalFind.py
#A part of theNotepad++ addon for NVDA
#Copyright (C) 2016 Tuukka Ojala, Derek Riemer
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import queueHandler
import speech
import config
import textInfos
import core
class IncrementalFind(object):
cacheB... | unknown | codeparrot/codeparrot-clean | ||
""" Decorators for the accustom library.
This includes two decorators, one for the handler function, and one to apply to any resource handling
functions.
"""
#Exceptions
from .Exceptions import FailedToSendResponseException
from .Exceptions import DataIsNotDictException
from .Exceptions import InvalidResponseStatusEx... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.