code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Copyright 2021 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... | unknown | codeparrot/codeparrot-clean | ||
"""
A collection of helper utility functions for working with instructor
tasks.
"""
import json
import logging
from util.date_utils import get_default_time_display
from bulk_email.models import CourseEmail
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from instructor_... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2014 Quantopian, 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 wr... | unknown | codeparrot/codeparrot-clean | ||
/*
* px-crypt.c
* Wrapper for various crypt algorithms.
*
* Copyright (c) 2001 Marko Kreen
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must ret... | c | github | https://github.com/postgres/postgres | contrib/pgcrypto/px-crypt.c |
# 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 | ||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Boot session from cache or build
Session bootstraps info needed by common client side activities including
permission, homepage, default variables, system defaults etc
"""... | unknown | codeparrot/codeparrot-clean | ||
r"""
This module contains the functionality to arrange the nodes of a
diagram on an abstract grid, and then to produce a graphical
representation of the grid.
The currently supported back-ends are Xy-pic [Xypic].
Layout Algorithm
================
This section provides an overview of the algorithms implemented in
:cl... | unknown | codeparrot/codeparrot-clean | ||
import re
from .protocols.base import BaseProtocol
from .exceptions import WebSocketError
class WebSocketApplication(object):
protocol_class = BaseProtocol
def __init__(self, ws):
self.protocol = self.protocol_class(self)
self.ws = ws
def handle(self):
self.protocol.on_open()
... | 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 | ||
# Elasticsearch
**Elasticsearch** is a distributed, RESTful search and analytics engine capable of
solving a growing number of use cases. As the heart of the Elastic Stack, it
centrally stores your data so you can discover the expected and uncover the
unexpected.
For more information about Elasticsearch, please visit... | unknown | github | https://github.com/elastic/elasticsearch | distribution/docker/src/docker/iron_bank/README.md |
#!/usr/bin/python
#------------------------------------------------------------------------------
# Copyright (C) 2013 Bradley Hilton <bradleyhilton@bradleyhilton.com>
#
# Distributed under the terms of the GNU GENERAL PUBLIC LICENSE V3.
#____________________________________________________________________________... | unknown | codeparrot/codeparrot-clean | ||
from django.http import Http404, HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from utils import json_functions as json
import functools
def get_argument_or_404(request, param, method='REQUEST', code='404'):
try:
return getattr(request, method)[para... | 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 | ||
package kotlinx.coroutines.exceptions
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlinx.coroutines.selects.*
import org.junit.*
import org.junit.rules.*
class StackTraceRecoverySelectTest : TestBase() {
@get:Rule
val name = TestName()
@Te... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoverySelectTest.kt |
from __future__ import annotations
import base64
import contextlib
import dataclasses
import importlib.metadata
import io
import json
import os
import pathlib
import pickle
import re
import shutil
import struct
import tempfile
import unittest
from datetime import date, datetime, time, timedelta, timezone
from functool... | python | github | https://github.com/python/cpython | Lib/test/test_zoneinfo/test_zoneinfo.py |
from math import pi
import numpy as np
import pytest
import openmc
import openmc.stats
def test_discrete():
x = [0.0, 1.0, 10.0]
p = [0.3, 0.2, 0.5]
d = openmc.stats.Discrete(x, p)
elem = d.to_xml_element('distribution')
d = openmc.stats.Discrete.from_xml_element(elem)
assert d.x == x
ass... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2024 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package server
import (
"context"
"fmt"
"net/http"
"strconv"
"strings"
"time"
"github.com/cockroachdb/cockroach/pkg/jobs"
"github.com/cockroachdb/cockroach/pkg... | go | github | https://github.com/cockroachdb/cockroach | pkg/server/api_v2_databases_metadata.go |
# Copyright 2014 Google 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 ag... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.text
~~~~~~~~~~~~~~~~~~~~
Lexers for non-source code file types.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer import Lexer, LexerC... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | unknown | codeparrot/codeparrot-clean | ||
import os
import database
from gemini.config import read_gemini_config
class gene_detailed:
def __init__(self, field):
self.fields = field[:]
self.chrom = field[0]
self.gene = field[1]
self.is_hgnc = field[2]
self.ensembl_gene_id = field[3]
self.ensembl_trans_id = ... | unknown | codeparrot/codeparrot-clean | ||
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 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 "os/exec"
func installTestHooks() {}
func uninstallTestHooks() {}
// forceCloseSockets must be called only from TestMain.
func forceClose... | go | github | https://github.com/golang/go | src/net/main_plan9_test.go |
#!/usr/bin/env bash
SCRIPT_DIR=$(dirname "$0")
APP_ID=$1
INSTALL_ID=$2
APP_PRIVATE_KEY=$3
DST_FILE="$4"
ACCESS_TOKEN="$(APP_ID="$(<"${APP_ID}")" INSTALL_ID="$(<"${INSTALL_ID}")" APP_PRIVATE_KEY="$(<"${APP_PRIVATE_KEY}")" "${SCRIPT_DIR}/app_token.sh")"
echo "${ACCESS_TOKEN}" > "${DST_FILE}" | unknown | github | https://github.com/pytorch/pytorch | .github/scripts/s390x-ci/self-hosted-builder/helpers/gh_token_generator.sh |
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Holoscópio Tecnologia
# Author: Luciana Fujii Pontello <luciana@holoscopio.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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from pandas import compat
import nose
from numpy import nan
import numpy as np
from pandas import Series, DataFrame
from pandas.compat import product
from pandas.util.testing import (assert_frame_equal,
assert_series_equal,
ass... | 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 applicable law or a... | java | github | https://github.com/tensorflow/tensorflow | tensorflow/java/src/test/java/org/tensorflow/TensorTest.java |
//go:build !windows
package libnetwork
import (
"context"
"os"
"testing"
"github.com/moby/moby/v2/daemon/libnetwork/ipams/defaultipam"
"github.com/moby/moby/v2/internal/testutil/netnsutils"
)
func TestHostsEntries(t *testing.T) {
defer netnsutils.SetupTestOSContext(t)()
expectedHostsFile := `127.0.0.1 local... | go | github | https://github.com/moby/moby | daemon/libnetwork/endpoint_unix_test.go |
# Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, po... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co 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
#
# http://... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2005, 2006 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 ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java |
#!/usr/bin/env python
#
# 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
# "L... | unknown | codeparrot/codeparrot-clean | ||
# 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 to in... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
/** @typedef {import("./Dependency")} Dependency */
/** @typedef {import("./Module")} Module */
/**
* @typedef {o... | javascript | github | https://github.com/webpack/webpack | lib/ModuleFactory.js |
"""
python makenpz.py DIRECTORY
Build a npz containing all data files in the directory.
"""
import os
import numpy as np
import argparse
from distutils.util import newer # type: ignore
def main():
p = argparse.ArgumentParser(usage=(__doc__ or '').strip())
p.add_argument('--use-timestamp', action='store_tr... | unknown | codeparrot/codeparrot-clean | ||
from disco.test import TestCase
from time import sleep
from disco.ddfs import DDFS
from disco.comm import download
from uuid import uuid1
from functools import partial
FILE= "/tmp/hello"
PREFIX = "disco:test:gc:_"
COUNT = 100
def wait_for_gc_to_finish(d):
for i in range(100):
response = d._download(d.ma... | unknown | codeparrot/codeparrot-clean | ||
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Foo",
[
("id", models.AutoField(primary_key=True)),
],
),
] | python | github | https://github.com/django/django | tests/contenttypes_tests/operations_migrations/0001_initial.py |
"""Handles all VCS (version control) support"""
from __future__ import absolute_import
import errno
import logging
import os
import shutil
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, call_subprocess,
... | unknown | codeparrot/codeparrot-clean | ||
"""Metrics to assess performance on regression task
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Ma... | unknown | codeparrot/codeparrot-clean | ||
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | unknown | codeparrot/codeparrot-clean | ||
#include <gtest/gtest.h>
#include <ATen/cuda/CUDAEvent.h>
#include <ATen/cuda/CUDAGraph.h>
#include <ATen/cuda/Sleep.h>
TEST(CUDAEventTest, testCUDAExternalEvent) {
if (!at::cuda::is_available()) {
return;
}
// Create two external CUDA events
unsigned int flags = cudaEventDefault | cudaEventExternal;
a... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/test/cuda_event_test.cpp |
# Copyright: (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import copy
import json
import pytest
from mock import MagicMock
from ansible.module_utils import hetzner
class ModuleFailException(Exception):
def __init__(self, msg, **kwargs):
... | unknown | codeparrot/codeparrot-clean | ||
import requests
import fanart
from fanart.errors import RequestFanartError, ResponseFanartError
class Request(object):
def __init__(self, apikey, id, ws, type=None, sort=None, limit=None):
self._apikey = apikey
self._id = id
self._ws = ws
self._type = type or fanart.TYPE.ALL
... | unknown | codeparrot/codeparrot-clean | ||
import sys
import random
import json
import time
import pygame
import time
from renderer import draw_everything
from get_ip import check_for_internet_conection as get_ip
from event_handler import unparse
from time import sleep, localtime
from weakref import WeakKeyDictionary
from PodSixNet.Server import Server
from Po... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package stackeval
import (
"context"
"sync"
"github.com/hashicorp/terraform/internal/stacks/stackaddrs"
"github.com/hashicorp/terraform/internal/stacks/stackconfig"
)
// Removed encapsulates the somewhat complicated logic for tracking and
// ... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackruntime/internal/stackeval/removed.go |
kind: BUG FIXES
body: 'test: allow ephemeral outputs in root modules'
time: 2025-10-24T16:44:34.197847+02:00
custom:
Issue: "37813" | unknown | github | https://github.com/hashicorp/terraform | .changes/v1.14/BUG FIXES-20251024-164434.yaml |
### Slave Serializers ###
from datetime import timedelta
from django.utils import timezone
from django.core.urlresolvers import reverse
from rest_framework import serializers
from slave.models import Slave
from skill.models import Skill, SkillTrained
from area.models import Location
from task.serializers import Assign... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from api.preprint_providers.permissions import GroupHelper
from osf.models.mixins import ReviewProviderMixin
logger = logging.getL... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Generator = require("../Generator");
const {
JAVASCRIPT_TYPE,
WEBASSEMBLY_TYPE
} = require("../ModuleSourceTypeConstants");
const { WEBASSEMBLY_MODULE_TYPE_SYNC } = require("../ModuleTypeConstants... | javascript | github | https://github.com/webpack/webpack | lib/wasm-sync/WebAssemblyModulesPlugin.js |
set enable_seqscan=off;
CREATE TABLE test_name (
i name
);
INSERT INTO test_name VALUES ('a'),('ab'),('abc'),('abb'),('axy'),('xyz');
CREATE INDEX idx_name ON test_name USING gin (i);
SELECT * FROM test_name WHERE i<'abc' ORDER BY i;
SELECT * FROM test_name WHERE i<='abc' ORDER BY i;
SELECT * FROM test_name WHERE ... | sql | github | https://github.com/postgres/postgres | contrib/btree_gin/sql/name.sql |
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/common_runtime/cost_measurement_registry.h |
import _io as io # uPy does not have io module builtin
import sys
if hasattr(sys, 'print_exception'):
print_exception = sys.print_exception
else:
import traceback
print_exception = lambda e, f: traceback.print_exception(None, e, sys.exc_info()[2], file=f)
def print_exc(e):
buf = io.StringIO()
print... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#
# SPDX-License-Identifier: GPL-2.0-only
import sys, os, struct, uuid, zlib, io
# This script wraps the bootblock in a GPT partition, because that's what
# SiFive's bootrom will load.
# Size of a GPT disk block, in bytes
BLOCK_SIZE = 512
BLOCK_MASK = BLOCK_SIZE - 1
# Size of the bootcode par... | unknown | codeparrot/codeparrot-clean | ||
'''Acts as an interface between what Flask serves and what goes on in
the rest of the application.
'''
from avenue import app
from avenue.database import content
from flask import render_template, make_response, redirect
from os import path
import yaml
def read_data(filename):
'''Reads in data from a given YML fil... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from jinja2.runtime import Undefined
try:
from collections import Mapping as MappingType
... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import ArcGISLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional i... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/arcgis_loader.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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/format/WebConversionService.java |
from typing import List
from typing import Sequence
from py.io import TerminalWriter as BaseTerminalWriter # noqa: F401
class TerminalWriter(BaseTerminalWriter):
def _write_source(self, lines: List[str], indents: Sequence[str] = ()) -> None:
"""Write lines of source code possibly highlighted.
Ke... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
"""
flask-bundle-system
-------------------
Links
`````
* `documentation <http://packages.python.org/flask-bundle-system>`_
* `development version
<http://github.com/yograterol/flask-bundle-system/zipball/master>`_
"""
from setuptools import setup
setup(
name='flask-bundle-system',
version='0.2',
lice... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/scheduling/v1beta1/doc.go |
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from django.db.models import Count, QuerySet
from django.utils.timezone import now as timezone_now
from zerver.models import User... | unknown | codeparrot/codeparrot-clean | ||
"""
Here is probably the place to write the docs, since the test-cases
show how the type behave.
Later...
"""
from ctypes import *
import sys, unittest
try:
WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
WINFUNCTYPE = CFUNCTYPE
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
if ... | unknown | codeparrot/codeparrot-clean | ||
import shutil
import sys
import py
import pytest
import factory
from django.apps import apps
from django.contrib.auth import get_user_model
from pytest_factoryboy import register
from django_docutils.favicon.tests.conftest import RSTPost, favicon_app # NOQA
class UserFactory(factory.django.DjangoModelFactory):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import itertools
import mimetools
import mimetypes
from cStringIO import StringIO
import urllib2
logger = logging.getLogger(__name__)
class MultiPartForm(object):
"""Accumulate the data to be used when posting a form."""
def __init__(self):
... | unknown | codeparrot/codeparrot-clean | ||
from setuptools import setup
setup(
name='flask_signedcookies',
version='1.0.0',
url='https://github.com/lovette/flask_signedcookies',
download_url = 'https://github.com/lovette/flask_signedcookies/archive/master.tar.gz',
license='BSD',
author='Lance Lovette',
author_email='lance.lovette@gmail... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* 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 req... | unknown | github | https://github.com/nodejs/node | deps/LIEF/src/overflow_check.hpp |
"""
Opener tests - opens SublimeText
Do not run with standard unittests.
"""
import os
import unittest
from . import dispatch_cases
from . import dispatcher
from . import support
# Set correct directory for testing
file_dir = support.normalize_path(os.path.split(__file__)[0])
if not os.getcwd() == file_dir:
os.ch... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
__author__ = 'Andrew Dunai <andrew@dun.ai>'
import sys
import json
import argparse
import re
from collections import namedtuple
try:
from PyQt4 import QtGui
import argparseui
except ImportError:
CAN_GUI = False
else:
CAN_GUI = True
range_regexp = re.compile(r'^([\w\d]+)\=([\d]+)... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2018 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.junit.jupiter;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.quality.Strictness;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retent... | java | github | https://github.com/mockito/mockito | mockito-extensions/mockito-junit-jupiter/src/main/java/org/mockito/junit/jupiter/MockitoSettings.java |
write_thread_count = 1
read_thread_count = 10
check_local_file = 'sh: ls syschecker/{syschecker,stress.sh,syschecker.schema,syschecker.conf.template,gen.sh,gen_sstable} # ExceptionOnFail'
client_start_args = 'syschecker.conf.$ip'
def configure_obi(**self):
obi = find_attr(self, 'obi')
if not obi: raise Excepti... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Third Party
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
from django.db import models
from django.utils import timezone
# AskCoding
from askcoding.base.models import UUIDModel
class UserManager(BaseUserManager):
use_in_migrations = True
... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 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.client.tests.utils
import kotlinx.coroutines.Job
/**
* Utils function returning all active jobs in the hierarchy.
*/
internal fun Job.getActiveChildren(): Sequence<Job> = s... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-tests/common/test/io/ktor/client/tests/utils/JobUtils.kt |
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/change_strea... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/generated_suites/change_streams_secondary_reads.yml |
import numpy as np
import scipy.misc
c = 3e5 #km/s
class TDC2ensemble(object):
"""
In TDC2, we expect time delays to be inferred by the Good Teams and
submitted as ensembles of posterior samples, in plain text tables,
one time delay per column (AB, AC, AD) for quads, and just (AB) for
doubles. The ... | 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 | ||
"""
SQLite3 backend for django.
Python 2.4 requires pysqlite2 (http://pysqlite.org/).
Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the
standard library.
"""
import re
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection... | unknown | codeparrot/codeparrot-clean | ||
import { compile } from '../src'
function compileWithWrapper(src: string) {
return compile(`<div>${src}</div>`)
}
describe('ssr: v-model', () => {
test('<input> (text types)', () => {
expect(compileWithWrapper(`<input v-model="bar">`).code)
.toMatchInlineSnapshot(`
"const { ssrRenderAttr: _ssrRe... | typescript | github | https://github.com/vuejs/core | packages/compiler-ssr/__tests__/ssrVModel.spec.ts |
##################################################################################################################
##################################################################################################################
##
## RAS- Riddle's Authentication System (04/08/2006)
## This Python file contains the sk... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for third_party_auth utility functions.
"""
import unittest
from django.conf import settings
from third_party_auth.tests.testutil import TestCase
from third_party_auth.utils import user_exists
from student.tests.factories import UserFactory
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test onl... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import time
import hmac
import hashlib
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
sanitized_Request,
urlencode_postdata,
xpath_text,
)
class AtresPlayerIE... | unknown | codeparrot/codeparrot-clean | ||
"""The tests for the Rfxtrx light platform."""
import unittest
import pytest
from homeassistant.setup import setup_component
from homeassistant.components import rfxtrx as rfxtrx_core
from tests.common import get_test_home_assistant, mock_component
@pytest.mark.skipif("os.environ.get('RFXTRX') != 'RUN'")
class Test... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fe10.test.cases.generated.cases.components.scopeProvider;
import co... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fe10/tests-gen/org/jetbrains/kotlin/analysis/api/fe10/test/cases/generated/cases/components/scopeProvider/Fe10IdeNormalAnalysisSourceModuleFileScopeTestGenerated.java |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | docs/examples/pop3-noop.c |
"""Generate and work with PEP 425 Compatibility Tags."""
import distutils.util
import platform
import sys
import os
import sysconfig
import warnings
from .macosx_libfile import extract_macosx_min_system_version
try:
from importlib.machinery import all_suffixes as get_all_suffixes
except ImportError:
from imp... | unknown | codeparrot/codeparrot-clean | ||
The address of temporary value was taken.
Erroneous code example:
```compile_fail,E0745
fn temp_address() {
let ptr = &raw const 2; // error!
}
```
In this example, `2` is destroyed right after the assignment, which means that
`ptr` now points to an unavailable location.
To avoid this error, first bind the temp... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0745.md |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/interrupt-controller/riscv,aplic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: RISC-V Advanced Platform Level Interrupt Controller (APLIC)
maintainers:
- Anup Patel <anup@brainfault.org>
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | unknown | codeparrot/codeparrot-clean | ||
// errorcheck -0 -m -l
// Copyright 2019 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.
// Test escape analysis for sync/atomic.
package escape
import (
"sync/atomic"
"unsafe"
)
// BAD: should be "leaking param: addr to... | go | github | https://github.com/golang/go | test/escape_sync_atomic.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Artūras 'arturaz' Šlajus <x11@arturaz.net>
# Author: Naoya Nakazawa <naoya.n@gmail.com>
#
# This module is proudly sponsored by iGeolise (www.igeolise.com) and
# Tiny Lab Productions (www.tinylabproductions.com).
#
# This file is part of Ansible
#
# Ansible is free ... | unknown | codeparrot/codeparrot-clean | ||
# This suite is based on the replica_sets_jscore_passthrough and retryable_writes_jscore_passthrough
# suites. It is used to test that a replica set started with --configsvr functions correctly before
# it becomes a config shard. This is important to test because in the rs->sharding procedure, users
# will briefly be r... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/replica_sets_configsvr_param_jscore_passthrough.yml |
# 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 | ||
import { test } from '../../test';
export default test({
snapshot(target) {
const div = target.querySelector('div');
const p = target.querySelector('p');
return {
div,
p,
text: p?.childNodes[0]
};
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/hydration/samples/component-in-element/_config.js |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
class PriceRule(models.Model):
_name = "delivery.price.rule"
_description = "Delivery Price Rules"
_order = 'sequence, li... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#
# Copyright (c) 2004-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same direct... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.