code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
{
"compilerOptions": {
"rootDir": "./"
}
} | json | github | https://github.com/webpack/webpack | examples/typescript/tsconfig.json |
#!/usr/bin/env bash
set -eux
#ANSIBLE_CACHE_PLUGINS=cache_plugins/ ANSIBLE_CACHE_PLUGIN=none ansible-playbook test_gathering_facts.yml -i inventory -v "$@"
ansible-playbook test_gathering_facts.yml -i inventory -e output_dir="$OUTPUT_DIR" -v "$@"
#ANSIBLE_CACHE_PLUGIN=base ansible-playbook test_gathering_facts.yml -i... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/gathering_facts/runme.sh |
'''
'''
# 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");... | unknown | codeparrot/codeparrot-clean | ||
import {
ApplicableRefactorInfo,
arrayFrom,
Debug,
Diagnostics,
emptyArray,
Expression,
factory,
FindAllReferences,
findAncestor,
findNextToken,
getAllowSyntheticDefaultImports,
getLocaleSpecificMessage,
getOwnValues,
getParentNodeInSpan,
getRefactorContextSpa... | typescript | github | https://github.com/microsoft/TypeScript | src/services/refactors/convertImport.ts |
version: 2.0.0
filters:
- "**/*.yml": # Temporary owners until these yml files are better split out
approvers:
- 10gen/devprod-build
- "backports_required_for_multiversion_tests.yml":
approvers:
- 10gen/devprod-correctness
- "burn_in_tests.yml":
approvers:
- 10gen/devprod-correctness... | unknown | github | https://github.com/mongodb/mongo | etc/OWNERS.yml |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from collections import OrderedDict
from django.apps import apps
try:
from django.utils.text import camel_case_to_spaces
except ImportError:
from django.db.models.options import (get_verbose_name as
camel_case_to_spaces)
from d... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011-2013 Mick Thomure
# All rights reserved.
#
# Please see the file LICENSE.txt in this distribution for usage terms.
import numpy as np
from glimpse.backends import _base_backend
from glimpse.backends.misc import BackendError, InputSizeError, IBackend, \
ACTIVATION_DTYPE
from glimpse.util impor... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.utilities import StackExchangeAPIWrapper
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling option... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/utilities/stackexchange.py |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Annotations for host-driven tests."""
import os
class AnnotatedFunctions(object):
"""A container for annotated methods."""
_ANNOTATED = {}
@s... | unknown | codeparrot/codeparrot-clean | ||
/* $OpenBSD: blf.c,v 1.7 2007/11/26 09:28:34 martynas Exp $ */
/*
* Blowfish block cipher for OpenBSD
* Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
* All rights reserved.
*
* Implementation advice by David Mazieres <dm@lcs.mit.edu>.
*
* Redistribution and use in source and binary forms, wi... | c | github | https://github.com/vapor/vapor | Sources/CVaporBcrypt/blf.c |
from google.appengine.api import datastore
from djangae.db.backends.appengine import caching, context
class DisableCache(object):
"""
Decorator and context manager for disabling the caches,
passing no args disables everything, but you can pass
memcache=False or context=False to only disabl... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2012 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/primitives/PackageSanityTests.java |
import asyncio
from scrapy import Request, Spider
from scrapy.crawler import AsyncCrawlerRunner
from scrapy.utils.log import configure_logging
class DataSpider(Spider):
name = "data"
async def start(self):
yield Request("data:,foo")
def parse(self, response):
return {"data": response.tex... | python | github | https://github.com/scrapy/scrapy | tests/AsyncCrawlerRunner/reactorless_datauri.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Library to extract EXIF information from digital camera image files
# https://github.com/ianare/exif-py
#
# VERSION 1.1.0
#
# To use this library call with:
# f = open(path_name, 'rb')
# tags = EXIF.process_file(f)
#
# To ignore MakerNote tags, pass the -q or --qu... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand
from kitsune.questions.models import Question, QuestionVote
from kitsune.questions.tasks import update_question_vote_chunk
from kitsune.sumo.utils import chunked
class Command(BaseCommand):
help = "Keep the num_votes_pas... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""The master watcher class.
It often makes sense to have a backup instance of the GRR server
environment running. If you decide to do so, override this class with
functionality to determine if this instance is currently active
("Master") or not and store the result using the SetMaster
function. ... | unknown | codeparrot/codeparrot-clean | ||
streams = [
[1,1,2,2,2,2,2],
[1,1,2,3,3,3,2],
[1,4,1,3,3,5,5],
[4,4,3,1,3,5,5],
[4,6,6,6,7,7,5],
[6,4,6,4,5,5,7],
[6,6,4,7,7,7,7]
]
placed = [
[2,1,1],
[2,3,7],
[2,5,6],
[2,7,4],
[3,2,7],
[3,6,1],
[4,1,4],
[4,7,5],
[5,2,... | unknown | codeparrot/codeparrot-clean | ||
"""
Table of Contents Extension for Python-Markdown
* * *
(c) 2008 [Jack Miller](http://codezen.org)
Dependencies:
* [Markdown 2.1+](http://packages.python.org/Markdown/)
"""
import markdown
from markdown.util import etree
from markdown.extensions.headerid import slugify, unique, itertext
import re
class TocTreepr... | unknown | codeparrot/codeparrot-clean | ||
#!/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 | ||
#!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import logging
from c7n_azure.constants import (CONTAINER_EVENT_TRIGGER_MODE,
CONTAINER_TIME_TRIGGER_MODE)
from c7n_azure.policy import AzureModeCommon
from c7n import utils
from c7n.policy import PullMode... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (c) 2008-2010 Stefan Krah. 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 retain the above copyright
# notice, t... | unknown | codeparrot/codeparrot-clean | ||
from gettext import gettext
_ = gettext
import _base
from html5lib.constants import cdataElements, rcdataElements, voidElements
from html5lib.constants import spaceCharacters
spaceCharacters = u"".join(spaceCharacters)
class LintError(Exception): pass
class Filter(_base.Filter):
def __iter__(self):
open... | unknown | codeparrot/codeparrot-clean | ||
import base64
import logging
import re
from functools import partial
from Crypto.Cipher import Blowfish
from streamlink.compat import bytes, is_py3
from streamlink.plugin import Plugin, PluginArguments, PluginArgument
from streamlink.plugin.api import useragents
from streamlink.plugin.api import validate
from streaml... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Kay authentication form.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import logging
from kay.i18n import lazy_gettext as _
from kay.utils ... | unknown | codeparrot/codeparrot-clean | ||
# This file is used as part of a matrix build in Jenkins where the
# values below are included as an axis of the matrix.
# This axis of the build matrix represents the versions of Java on
# which Elasticsearch will be tested. Valid Java versions are 'java'
# or 'openjdk' followed by the major release number.
ES_RUNT... | unknown | github | https://github.com/elastic/elasticsearch | .ci/matrix-runtime-javas.yml |
# Copyright 2015 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 | ||
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | unknown | codeparrot/codeparrot-clean | ||
placeholders:
- name: year
desc: >-
Year from the post's filename with four digits. May be overridden via the document's
<code>date</code> front matter.
- name: short_year
desc: >-
Year from the post's filename without the century. (00..99) May be overridden via the
document's <code>... | unknown | github | https://github.com/jekyll/jekyll | docs/_data/permalinks.yml |
import unittest
from unittest import TestLoader
from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import (resource_listdir, resource_exists,
normalize_path, working_set, _namespace_packages, add_activation_listener,
require, EntryPoint)
from setupto... | unknown | codeparrot/codeparrot-clean | ||
from gevent.server import StreamServer
import socket
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policyrequest = "<policy-file-request/>"
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain... | 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/main/java/org/apache/kafka/common/requests/UnregisterBrokerRequest.java |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ChangeDetectionStrategy, Component, computed, inject, input, output} from '@angular/core';
import {NgxFlameg... | typescript | github | https://github.com/angular/angular | devtools/projects/ng-devtools/src/lib/devtools-tabs/profiler/recording-timeline/recording-visualizer/flamegraph-visualizer/flamegraph-visualizer.component.ts |
import glob
import os
import subprocess
import sys
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from PIL import ImageEnhance
from PIL import ImageOps
import scipy.ndimage
import numpy as np
def image_convert(fname,saveAs=True,showToo=False):
"""
Convert weird TIF files into web-fri... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 PLUMgrid, 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/lic... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#if 0
# -----------------------------------------------------------------------
# $Id: __init__.py 382 2004-10-15 09:02:11Z dischi $
# -----------------------------------------------------------------------
# $Log$
# Revision 1.35 2004/10/15 09:02:11 dischi
# add ac3 parser
#
# Revision 1.34 2004/0... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from test import support
import gc
import tkinter
from tkinter import (Variable, StringVar, IntVar, DoubleVar, BooleanVar, Tcl,
TclError)
from test.support import ALWAYS_EQ
from test.test_tkinter.support import setUpModule # noqa: F401
from test.test_tkinter.support import Abstrac... | python | github | https://github.com/python/cpython | Lib/test/test_tkinter/test_variables.py |
/*
* contrib/hstore/hstore_op.c
*/
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_type.h"
#include "common/hashfn.h"
#include "funcapi.h"
#include "hstore.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
/* old names for C functions */
HSTORE_POLLUTE(hstore_fetchval, fetchval)... | c | github | https://github.com/postgres/postgres | contrib/hstore/hstore_op.c |
#!/usr/bin/env python
import argparse
import datetime
import time
from wrfpy import utils
from wrfpy.config import config
import os
#from urb import urb
import shutil
import glob
class wps_post(config):
''''
Main function to initialize WPS timestep:
- converts cylc timestring to datetime object
- ... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf8
# Copyright 2013-2015 Vincent Jacques <vincent@vincent-jacques.net>
import unittest
import MockMockMock
# This could be replaced by a mock :-D. But hum, keep it simple.
class TestDependency:
the_exception = Exception("ga", "bu")
def __init__(self):
self.instance_property = 49
cl... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 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 | ||
# coding=utf-8
"""
Copyright 2013 LinkedIn Corp. 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 l... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label ... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
function Foo(props) {
let x;
true && (x = []);
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: Foo,
params: [{}],
};
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Foo(props) {
const $ = _c(1);
let x;
if ($[0] === Symbol.for("react.me... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-logical-no-sequence.expect.md |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/ja/index.md |
<html>
<head></head>
<body>
<script async src="dist/pageA~pageB.chunk.js" charset="utf-8"></script>
<script async src="dist/bPage.chunk.js" charset="utf-8"></script>
<script async src="dist/pageB.bundle.js" charset="utf-8"></script>
</body>
</html> | html | github | https://github.com/webpack/webpack | examples/hybrid-routing/pageB.html |
"""Define tests for the Bravia TV config flow."""
from bravia_tv.braviarc import NoIPControl
from homeassistant import data_entry_flow
from homeassistant.components.braviatv.const import CONF_IGNORED_SOURCES, DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
from homeassistant.const import CON... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Pow... | c | github | https://github.com/opencv/opencv | 3rdparty/libjasper/jpc_fix.h |
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlin.test.*
class NonCancellableTest : TestBase() {
@Test
fun testNonCancellable() = runTest {
expect(1)
val job = async {
withContext(NonCancellable) {
expect(2)
yield()
... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/NonCancellableTest.kt |
from django.forms import CharField, PasswordInput
from django.utils.translation import ugettext_lazy as _
from passwords.validators import (validate_length, common_sequences,
dictionary_words, complexity,
PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH)
cla... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import fcntl
import array
import termios
import signal
import time
import collections
LOG_FATAL = -2
LOG_ERROR = -1
LOG_WARN = 0
LOG_INFO = 1
LOG_DEBUG1 = 2
LOG_DEBUG2 = 3
LOG_DEBUG3 = 4
BUFFER_INTERVAL = 0.2
def update():
logger.update()
def fatal_exit(exitcode, *msg):
logger.do_log(L... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import numpy as np
from common import *
def test_value_counts():
ds = create_base_ds()
assert len(ds.x.value_counts()) == 21
assert len(ds.y.value_counts()) == 19
assert len(ds.m.value_counts(dropmissing=True)) == 19
assert len(ds.m.value_counts()) == 20
assert len(ds.n.value_c... | unknown | codeparrot/codeparrot-clean | ||
"""
Functions for identifying peaks in signals.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import xrange
from scipy.signal.wavelets import cwt, ricker
from scipy.stats import scoreatpercentile
__all__ = ['argrelmin', 'argrelmax', 'argrelextrema', 'find... | unknown | codeparrot/codeparrot-clean | ||
import numpy
import theano
from numpy.testing import assert_equal, assert_, assert_raises
from theano.scalar.basic import all_types
from pylearn2.format.target_format import OneHotFormatter, compressed_one_hot
def test_one_hot_formatter_simple():
def check_one_hot_formatter(seed, max_labels, dtype, ncases):
... | unknown | codeparrot/codeparrot-clean | ||
"""
stile_utils.py: Various utilities for the Stile pipeline. Includes input parsing and some
numerical helper functions.
"""
import numpy
def Parser():
"""
Returns an argparse Parser object with input args used by Stile and TreeCorr.
"""
from . import treecorr_utils
import argparse
p = argpa... | unknown | codeparrot/codeparrot-clean | ||
# Unix SMB/CIFS implementation.
# Copyright (C) Sean Dague <sdague@linux.vnet.ibm.com> 2011
#
# 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 optio... | unknown | codeparrot/codeparrot-clean | ||
import copy
import logging
class StoryDatabase(object):
# callbacks you can register listeners against
EVENT_PRE_STORY_SAVE = "preStorySave"
EVENT_POST_STORY_SAVE = "postStorySave"
def __init__(self):
self._logger = logging.getLogger(__name__)
self._db = None
def storyExists(self... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2009-2015 MongoDB, 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 writin... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | kotlin | github | https://github.com/spring-projects/spring-framework | spring-aop/src/test/kotlin/org/springframework/aop/framework/CoroutinesUtilsTests.kt |
# -*- coding: utf-8 -*-
"""
XML Test Runner for PyUnit
"""
# Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in
# the Public Domain. With contributions by Paolo Borelli and others.
from __future__ import unicode_literals
__version__ = "0.2"
import os.path
import re
import sys
import time
impor... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/metaclip_2.md |
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para ovfile
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core i... | unknown | codeparrot/codeparrot-clean | ||
package queue
import (
"testing"
"time"
"gotest.tools/v3/assert"
)
func TestSerialization(t *testing.T) {
var (
q Queue
serialization = 1
)
q.Append("aaa", func() {
// simulate a long time task
time.Sleep(10 * time.Millisecond)
assert.Equal(t, serialization, 1)
serialization = 2
})
q... | go | github | https://github.com/moby/moby | daemon/internal/libcontainerd/queue/queue_test.go |
import handler from "@payloadcms/next-payload/dist/handlers/[collection]/access/[id]";
export default handler;
export const config = {
api: {
externalResolver: true,
},
}; | typescript | github | https://github.com/vercel/next.js | examples/cms-payload/pages/api/[collection]/access/[id].ts |
# Copyright (C) 2013 Yahoo! 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 ... | unknown | codeparrot/codeparrot-clean | ||
function Component() {
const x = {};
{
let x = 56;
const fn = function () {
x = 42;
};
fn();
}
return x; // should return {}
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [],
isComponent: false,
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-reassign-shadowed-primitive.js |
# `@tailwindcss/oxide-android-arm-eabi`
This is the **armv7-linux-android-eabi** binary for `@tailwindcss/oxide` | unknown | github | https://github.com/tailwindlabs/tailwindcss | crates/node/npm/android-arm-eabi/README.md |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_chain_t *from_upstream;
ngx_chain_t *from_downstream;
} ngx_stream_write_filter_ctx_t;
static ngx_int_t ngx_stream_write_filter(ngx_stream_session_t *s... | c | github | https://github.com/nginx/nginx | src/stream/ngx_stream_write_filter_module.c |
from __future__ import annotations
import sys
from typing import TYPE_CHECKING, Any, Optional, cast
from argparse import ArgumentParser
from .._utils import get_client, print_model
from ..._types import omit
from .._models import BaseModel
from .._progress import BufferReader
from ...types.audio import Transcription
... | python | github | https://github.com/openai/openai-python | src/openai/cli/_api/audio.py |
"""
Base file upload handler classes, and the built-in concrete subclasses
"""
from __future__ import unicode_literals
from io import BytesIO
from django.conf import settings
from django.core.files.uploadedfile import TemporaryUploadedFile, InMemoryUploadedFile
from django.utils.encoding import python_2_unicode_comp... | unknown | codeparrot/codeparrot-clean | ||
use crate::io::util::read_line::read_line_internal;
use crate::io::AsyncBufRead;
use pin_project_lite::pin_project;
use std::io;
use std::mem;
use std::pin::Pin;
use std::task::{ready, Context, Poll};
pin_project! {
/// Reads lines from an [`AsyncBufRead`].
///
/// A `Lines` can be turned into a `Stream` ... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/io/util/lines.rs |
"""
Defines AnimMgrBase
"""
import os, wx, math
from direct.interval.IntervalGlobal import *
from panda3d.core import VBase3,VBase4
import ObjectGlobals as OG
import AnimGlobals as AG
class AnimMgrBase:
""" AnimMgr will create, manage, update animations in the scene """
def __init__(self, editor):
s... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import marshal
import imp
import struct
import time
import unittest
from test import support
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
import zipimport
import linecache
import doctest
import inspect... | unknown | codeparrot/codeparrot-clean | ||
# (C) British Crown Copyright 2011 - 2012, Met Office
#
# This file is part of cartopy.
#
# cartopy 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 License, or
# (at your option)... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
import requests
import midata
from midata import authentication as auth
# input data
server = "https://db.scout.ch"
email = "user@pbs.ch"
password = "password"
# log in
auth_info = auth.sign_in(server, email, password)
if not auth_info:
pass
user = midata.get_person(auth_info, auth_i... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org>
#
# 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 l... | 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
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.h |
from datetime import datetime
import random
from .app import db
from .app.models import Contact, ContactGroup, Gender
def get_random_name(names_list, size=1):
name_lst = [
names_list[random.randrange(0, len(names_list))].decode("utf-8").capitalize()
for i in range(0, size)
]
return " ".joi... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# Copyright (c) 2013-2017, 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 Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-tools/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java |
"""
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2014 Rackspace, 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 ... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2019 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/controller/statefulset/config/types.go |
import json
import os
import socket
import sys
import threading
import time
import traceback
import urlparse
import uuid
from .base import (Protocol,
RefTestExecutor,
RefTestImplementation,
TestharnessExecutor,
extra_timeout,
... | unknown | codeparrot/codeparrot-clean | ||
import matplotlib.pyplot as plt
import numpy as np
from mplstyle.ewk import PLTewk
def color_map_example():
""" An example of how to use get_cmap."""
ewk_plt.set_style('default')
fig = plt.figure(figsize=(14, 12))
fig.suptitle('Define your own color maps', fontsize=20, fontweight='bold')
fig.subplo... | unknown | codeparrot/codeparrot-clean | ||
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | unknown | codeparrot/codeparrot-clean | ||
# Network Fault Injection Framework (mongobridge)
## Overview
[Mongobridge](https://github.com/mongodb/mongo/blob/e810af1916caaedb1cde8d1e1b74bb50b2461daf/src/mongo/tools/mongobridge_tool/bridge.cpp#L1) is a network fault injection testing tool that allows test authors to intentionally simulate network issues such as... | unknown | github | https://github.com/mongodb/mongo | docs/testing/network_fault_injection_mongobridge.md |
from __future__ import absolute_import
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationReleasesBaseEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.models import Release, ReleaseCommit
class Organizati... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 IBM Corp.
#
# 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 agree... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of OMG-tools.
#
# OMG-tools -- Optimal Motion Generation-tools
# Copyright (C) 2016 Ruben Van Parys & Tim Mercy, KU Leuven.
# All rights reserved.
#
# OMG-tools 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... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import copy
import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class RevisionableModel(models.Model):
base = models.ForeignKey('self', models.SE... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""An Ant wrapper that suppresses useless Ant output.
Ant build scripts output "BUILD SUCCESSFUL" and build timing at the end of
eve... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Eucalyptus Systems, Inc.
#
# 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
# withou... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActionView
module Helpers
module Tags # :nodoc:
class FileField < TextField # :nodoc:
def render
include_hidden = @options.delete(:include_hidden)
if @options[:accept].is_a?(Array)
@options[:accept] = @options[:accept].join(",")
... | ruby | github | https://github.com/rails/rails | actionview/lib/action_view/helpers/tags/file_field.rb |
/**
* 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-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/EmptyStorageStatistics.java |
from __future__ import print_function
import numpy as np
import cntk
from cntk.ops.functions import load_model
def LoadData(fn,is_training):
n=".\\Data\\"+fn
datainp=cntk.io.StreamDef("features",45)
dataout=cntk.io.StreamDef("labels",3,is_sparse=True)
dataall=cntk.io.StreamDefs(features=datainp,labels=... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.