code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
//// [tests/cases/conformance/classes/propertyMemberDeclarations/abstractPropertyInitializer.ts] ////
//// [abstractPropertyInitializer.ts]
abstract class C {
abstract prop = 1
}
//// [abstractPropertyInitializer.js]
"use strict";
class C {
}
//// [abstractPropertyInitializer.d.ts]
declare abstract class C {
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/abstractPropertyInitializer.js |
'''
Created on Mar 12, 2011
@author: johnsalvatier
'''
from scipy import optimize
import numpy as np
from numpy import isfinite, nan_to_num, logical_not
from ..core import *
from ..vartypes import discrete_types, typefilter
from inspect import getargspec
__all__ = ['find_MAP', 'scipyminimize']
def find_MAP(start=No... | unknown | codeparrot/codeparrot-clean | ||
name: Test check_binary
on:
pull_request:
paths:
- .github/workflows/test-check-binary.yml
- .ci/pytorch/check_binary.sh
- .ci/pytorch//smoke_test/smoke_test.py
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow... | unknown | github | https://github.com/pytorch/pytorch | .github/workflows/test-check-binary.yml |
/**
* 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/io/WritableFactory.java |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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 | ||
import xml.etree.ElementTree as ET
import unittest
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.extension import TemplateExtensionNode
from test.parser.template.graph.test_graph_client import TemplateGraphTestClient
class TestExtension(object):
def execute(sel... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of t... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2010 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 agreed ... | java | github | https://github.com/google/guava | guava/src/com/google/common/base/Strings.java |
################################################################################
# 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2018 The TensorFlow Probability 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 o... | unknown | codeparrot/codeparrot-clean | ||
import smashbox.compatibility.argparse as argparse
def keyval_tuple(x):
a,b = x.split('=',1)
return (a.strip(),b)
def arg_parser(**kwds):
""" Create an ArgumentParser with common options for smash scripts and tools.
"""
parser = argparse.ArgumentParser(**kwds)
parser.add_argument('--option', '... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
from flask import Flask, abort, request, jsonify, g, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.httpauth import HTTPBasicAuth
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import sys
import os
import re
import mimetypes
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import BaseHandler
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Red Hat, 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 la... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from collections import MutableSet
from datetime import datetime
from sqlalchemy import Column, Unicode, Integer, DateTime, or_, func, Boolean
from sqlalchemy.or... | unknown | codeparrot/codeparrot-clean | ||
# USAGE
# python demo_vis.py --base-model $CAFFE_ROOT/models/bvlc_googlenet \
# --image initial_images/fear_and_loathing/fal_01.jpg \
# --vis examples/output/visualizations
# import the necessary packages
from batcountry import BatCountry
from PIL import Image
import numpy as np
import argparse
# construct the argume... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
import os.path
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(
name = "django-jamendo",
version = "0.1",
packages = find_packa... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python2.4
#
# Copyright 2008 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 o... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 OpenStack LLC.
# 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 b... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Let S_m = (x_1, x_2, ... , x_m) be the m-tuple of positive real
# numbers with x_1 + x_2 + ... + x_m = m for which
# P_m = x_1 * x_2^2 * ... * x_m^m is maximised.
# For example, it can be verified that [P_10] = 4112
# ([] is the integer part function).
# Find SUM[P_m] for 2 <= m <= 15.
# ---... | unknown | codeparrot/codeparrot-clean | ||
"""
Scrapy logging facility
See documentation in docs/topics/logging.rst
"""
import sys
import logging
import warnings
from twisted.python import log
import scrapy
from scrapy.utils.python import unicode_to_str
from scrapy.settings import overridden_settings
# Logging levels
DEBUG = logging.DEBUG
INFO = logging.INF... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v0alpha1.panel_tests_bar_gauge.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "datasource",
"uid": "g... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-bargauge/v0alpha1.panel_tests_bar_gauge.v42.v2alpha1.json |
import numpy as np
import sympy
import pytest
from devito import VectorFunction, TensorFunction, VectorTimeFunction, TensorTimeFunction
from devito import Grid, Function, TimeFunction, Dimension, Eq, div, grad
from devito.types import NODE
def dimify(dimensions):
assert isinstance(dimensions, str)
return tup... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "models/guitar"
require "models/tuning_peg"
class AssociationsNestedErrorInAssociationOrderTest < ActiveRecord::TestCase
test "index in association order" do
guitar = Guitar.create!
guitar.tuning_pegs.create!(pitch: 1)
peg2 = guitar.tuning_peg... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/associations/nested_error_test.rb |
import sys
import unittest
import pywintypes
import time
from pywin32_testutil import str2bytes, ob2memory
import datetime
import operator
class TestCase(unittest.TestCase):
def testPyTimeFormat(self):
struct_current = time.localtime()
pytime_current = pywintypes.Time(struct_current)
# try ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#coding: utf-8 -*-
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This module 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 yo... | unknown | codeparrot/codeparrot-clean | ||
name: Close issues
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
permissions:
contents: read
# Ensure scripts are run with pipefail. See:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
defaults:
run:
shell: bash
j... | unknown | github | https://github.com/microsoft/TypeScript | .github/workflows/close-issues.yml |
#!/usr/bin/python
from __future__ import annotations
DOCUMENTATION = """
module: fakemodule
short_desciption: fake module
description:
- this is a fake module
version_added: 1.0.0
options:
_notreal:
description: really not a real option
author:
- me
"""
imp... | python | github | https://github.com/ansible/ansible | test/integration/targets/ansible-doc/collections/ansible_collections/testns/testcol/plugins/modules/fakemodule.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.
"""Base class for running tests on a single device."""
import contextlib
import httplib
import logging
import os
import tempfile
import time
from pylib... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from nlpy import __version__
from nlpy.model import AmplModel
from nlpy.optimize.solvers.funnel import Funnel, LSTRFunnel, LDFPFunnel, \
StructuredLDFPFunnel
from nlpy.tools.timing import cputime
from optparse import OptionParser
import numpy
import nlpy.t... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
sphinx.util.docstrings
~~~~~~~~~~~~~~~~~~~~~~
Utilities for docstring processing.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
def prepare_docstring(s, ignore=1):
"""Convert a docstring int... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Layers to construct recurrent networks. Recurrent layers can be used similarly
to feed-forward layers except that the input shape is expected to be
``(batch_size, sequence_length, num_inputs)``. The CustomRecurrentLayer can
also support more than one "feature" dimension (e.g. using convolu... | unknown | codeparrot/codeparrot-clean | ||
from _tree import Tree
from OnlineDecisionTree import *
from utils import *
import numpy as np
import pandas as pd
class ClassificationTree(Tree):
def __init__(
self,
number_of_features,
number_of_functions=10,
min_sample_split=200,
predict_initialize={
... | unknown | codeparrot/codeparrot-clean | ||
from pextant.api_future import *
from pextant.EnvironmentalModel import *
from osgeo import gdal
dem_path = 'maps/hwmidlow.tif'
import pandas as pd
import json
pd.options.display.max_rows = 5
with open('waypoints/MD10_EVA10_Stn18_Stn23_X.json') as data_file:
data = json.load(data_file)
ways_and_segments = data['... | unknown | codeparrot/codeparrot-clean | ||
import tensorflow as tf
import numpy as np
from chatbot import seq2seq_model
PAD_ID = 0
GO_ID = 1
EOS_ID = 2
UNK_ID = 3
train_encode_vocabulary = 'train_encode_vocabulary'
train_decode_vocabulary = 'train_decode_vocabulary'
def read_vocabulary(input_file):
tmp_vocab = []
with open(input_file, "r") as f:
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Build call-back mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 20... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 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.
"""Runs Octane 2.0 javascript benchmark.
Octane 2.0 is a modern benchmark that measures a JavaScript engine's performance
by running a suite of tests repres... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage import os
from portage.util._ctypes import find_library, LoadLibrary
from portage.util._async.ForkProcess import ForkProcess
class SyncfsProcess(ForkProcess):
"""
Isolate ctypes usage in a subprocess, ... | unknown | codeparrot/codeparrot-clean | ||
""" Test script for the unicodedata module.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import sys
import unittest
import hashlib
import subprocess
import test.test_support
encoding = 'utf-8'
### Run tests
class UnicodeMethodsTest(unittest.Te... | unknown | codeparrot/codeparrot-clean | ||
# install the aoe-specific udev rules from udev.txt into
# the system's udev configuration
#
me="`basename $0`"
# find udev.conf, often /etc/udev/udev.conf
# (or environment can specify where to find udev.conf)
#
if test -z "$conf"; then
if test -r /etc/udev/udev.conf; then
conf=/etc/udev/udev.conf
else
conf="`... | unknown | github | https://github.com/torvalds/linux | Documentation/admin-guide/aoe/udev-install.sh |
"""Stdout module."""
from __future__ import print_function, absolute_import
import logging
import click
from swak.plugin import Output
from swak.formatter import Formatter, StdoutFormatter
from swak.buffer import Buffer
from swak.memorybuffer import MemoryBuffer, DEFAULT_CHUNK_MAX_RECORD,\
DEFAULT_CHUNK_MAX_SIZE... | unknown | codeparrot/codeparrot-clean | ||
//! This module contains collection types that don't expose their internal
//! ordering. This is a useful property for deterministic computations, such
//! as required by the query system.
use std::borrow::{Borrow, BorrowMut};
use std::collections::hash_map::{Entry, OccupiedError};
use std::hash::Hash;
use std::iter::... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_data_structures/src/unord.rs |
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import stix
import stix.bindings.exploit_target as exploit_target_binding
from stix.common import StructuredTextList
class Weakness(stix.Entity):
"""Implementation of STIX ``Weakness``.
Args:
cwe_i... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
*/
#include <assert.h>
#include <stdint.h>
#include <arm_neon.h>
#include <fp16/bitcasts.h>
#include <... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/requantization/q31-neon.c |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.tests
import io.ktor.http.*
import io.ktor.http.CacheControl.*
import io.ktor.server.plugins.cachingheaders.*
import kotlin.test.*
class CacheControlMergeTest {
@Test
... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-caching-headers/common/test/io/ktor/tests/CacheControlMergeTest.kt |
#!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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
#... | unknown | codeparrot/codeparrot-clean | ||
import os, sys
import pytest
from _pytest.monkeypatch import monkeypatch as MonkeyPatch
def pytest_funcarg__mp(request):
cwd = os.getcwd()
sys_path = list(sys.path)
def cleanup():
sys.path[:] = sys_path
os.chdir(cwd)
request.addfinalizer(cleanup)
return MonkeyPatch()
def test_set... | 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... | java | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/java/org/springframework/docs/web/webflux/controller/webfluxanncontrollerexceptions/SimpleController.java |
//===--- DeclAndTypePrinter.cpp - Emit ObjC decls from a Swift AST --------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/PrintAsClang/DeclAndTypePrinter.cpp |
#!/usr/bin/python
# Copyright (c) 2010 Alon Swartz <alon@turnkeylinux.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later vers... | unknown | codeparrot/codeparrot-clean | ||
@import "@sass/abstracts/mixins";
@import "@sass/abstracts/vars";
label {
background: transparent;
color: $text-basic;
}
input,
button {
display: inline-block;
box-sizing: border-box;
background: $bg-basic-color !important;
border: 1px solid $border-gray;
border-radius: 0 !important;
color: $text-basic... | unknown | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/assets/sass/base/reset/_inputs.scss |
//// [tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts] ////
//// [alwaysStrictNoImplicitUseStrict.ts]
namespace M {
export function f() {
var arguments = [];
}
}
//// [alwaysStrictNoImplicitUseStrict.js]
"use strict";
var M;
(function (M) {
function f() {
var arguments = [];
}
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/alwaysStrictNoImplicitUseStrict.js |
#pragma once
#include <c10/core/Device.h>
#include <c10/cuda/CUDAMacros.h>
#include <c10/macros/Macros.h>
#include <cstdint>
namespace c10::cuda {
namespace detail {
/// Initialize the peer-to-peer and fabric access caches.
/// Must be called before any calls to get_p2p_access or get_fabric_access.
/// @param num_... | c | github | https://github.com/pytorch/pytorch | c10/cuda/PeerToPeerAccess.h |
"""Tests for the user API at the HTTP request level. """
import datetime
import base64
import json
import re
from unittest import skipUnless, SkipTest
import ddt
import httpretty
from pytz import UTC
import mock
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core import mai... | 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/clients/consumer/internals/ShareConsumerImpl.java |
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import sys
import time
import random
import unittest
from test import test_support
try:
import threading
except ImportError:
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
set -euo pipefail
#set -x
# Find all release-xx.y branches where xx >= 24.
BRANCHES=$(git branch -r --format='%(refname)' \
| grep '^refs\/remotes/... | unknown | github | https://github.com/cockroachdb/cockroach | scripts/check-pebble-dep.sh |
"""Filesystem-related helper functions."""
import os
import tempfile
def mkdtemp_in_build_dir():
"""Use build/ as the temp directory since it's mapped to an EBS volume on Evergreen hosts."""
build_tmp_dir = os.path.join("build", "tmp")
os.makedirs(build_tmp_dir, exist_ok=True)
return tempfile.mkdtemp... | python | github | https://github.com/mongodb/mongo | buildscripts/resmokelib/utils/filesystem.py |
from collections.abc import AsyncIterator, Iterator
from contextlib import asynccontextmanager, contextmanager
from langgraph.store.base import BaseStore
from langgraph.store.memory import InMemoryStore
@contextmanager
def _store_memory() -> Iterator[BaseStore]:
store = InMemoryStore()
yield store
@asynccont... | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/tests/unit_tests/agents/conftest_store.py |
from unittest import skipIf
from django.core.exceptions import ValidationError
from django.db import connection, models
from django.test import SimpleTestCase, TestCase
from django.utils.functional import lazy
from .models import Post
class TestCharField(TestCase):
def test_max_length_passed_to_formfield(self):... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from builtins import object
from flask.json import JSONEncoder
class DynamicJSONEncoder(JSONEncoder):
""" JSON encoder for custom classes:
Uses __json__() method if available to prepare the object.
Especially useful for SQLAlchemy models
"""
def def... | unknown | codeparrot/codeparrot-clean | ||
- Feature Name: Limit handling in DistSQL
- Status: in-progress
- Start Date: 2017-06-02
- Authors: Radu Berinde
- RFC PR: [#16287](https://github.com/cockroachdb/cockroach/pull/16287)
- Cockroach Issue: (one or more # from the issue tracker)
# Summary
This RFC proposes a set of mechanisms for efficiently dealing wit... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20170602_distsql_limit.md |
//! HIR pretty-printing is layered on top of AST pretty-printing. A number of
//! the definitions in this file have equivalents in `rustc_ast_pretty`.
// tidy-alphabetical-start
#![recursion_limit = "256"]
// tidy-alphabetical-end
use std::cell::Cell;
use std::vec;
use rustc_abi::ExternAbi;
use rustc_ast::util::pars... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_hir_pretty/src/lib.rs |
import { test } from '../../test';
export default test({
html: `
<p>disabled</p>
<p>unconditional</p>`,
test({ assert, component, target }) {
component.enabled = true;
assert.htmlEqual(
target.innerHTML,
`
<p>enabled</p>
<p>unconditional</p>
`
);
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-slot-if-else-block-before-node/_config.js |
r"""Test correct treatment of various string literals by the parser.
There are four types of string literals:
'abc' -- normal str
r'abc' -- raw str
b'xyz' -- normal bytes
br'xyz' -- raw bytes
The difference between normal and raw strings is of course that in a
raw string, \ escapes (while still u... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["ResponseFunctionCallArgumentsDoneEvent"]
class ResponseFunctionCallArgumentsDoneEvent(BaseModel):
"""Emitted when function-call arguments are f... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/response_function_call_arguments_done_event.py |
"""Test ToolRuntime injection with create_agent.
This module tests the injected runtime functionality when using tools
with the create_agent factory. The ToolRuntime provides tools access to:
- state: Current graph state
- tool_call_id: ID of the current tool call
- config: RunnableConfig for the execution
- context: ... | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/tests/unit_tests/agents/test_injected_runtime_create_agent.py |
from django.db.models.query_utils import DeferredAttribute
from django.test import TestCase
from models import Secondary, Primary, Child, BigChild
class DeferTests(TestCase):
def assert_delayed(self, obj, num):
count = 0
for field in obj._meta.fields:
if isinstance(obj.__class__.__dict... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package keymanager
import (
"context"
wrapping "github.com/hashicorp/go-kms-wrapping/v2"
)
const (
KeyID = "root"
)
type KeyManager interface {
// Returns a wrapping.Wrapper which can be used to perform key-related operations.
Wrapper() wr... | go | github | https://github.com/hashicorp/vault | command/agentproxyshared/cache/keymanager/manager.go |
# Contributing to Vault
**Please note:** We take Vault's security and our users' trust very seriously.
If you believe you have found a security issue in Vault, please responsibly
disclose by contacting us at security@hashicorp.com.
**First:** if you're unsure or afraid of _anything_, just ask or submit the
issue or p... | unknown | github | https://github.com/hashicorp/vault | CONTRIBUTING.md |
// This file was automatically generated from Delay.kt by Knit tool. Do not edit.
package kotlinx.coroutines.examples.exampleDelayDuration02
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds
fun main() = runBlocking {
flow {
emit(1)
delay(90.milli... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/examples/example-delay-duration-02.kt |
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | unknown | codeparrot/codeparrot-clean | ||
import re
import pyblish.api
import pyblish_magenta.api
from maya import cmds
def short_name(node):
return node.rsplit("|", 1)[-1].rsplit(":", 1)[-1]
class ValidateShapeNoRename(pyblish.api.InstancePlugin):
"""Checks to see if there are nodes with the original names.
If so it can be a cue for a scene/mo... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
#
# Copyright (c) 2005 Amos Waterland
#
test_description='git rebase assorted tests
This test runs git rebase and checks that the author information is not lost
among other things.
'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
GIT_AUTHOR_NAME=autho... | unknown | github | https://github.com/git/git | t/t3400-rebase.sh |
from __future__ import division, absolute_import, print_function
from .info import __doc__
from numpy.version import version as __version__
import os
# disables OpenBLAS affinity setting of the main thread that limits
# python threads or processes to one core
env_added = []
for envkey in ['OPENBLAS_MAIN_FREE', 'GOTO... | unknown | codeparrot/codeparrot-clean | ||
import shesha.config as conf
simul_name = "bench_scao_sh_16x16_8pix"
# loop
p_loop = conf.Param_loop()
p_loop.set_niter(100)
p_loop.set_ittime(0.002) # =1/500
# geom
p_geom = conf.Param_geom()
p_geom.set_zenithangle(0.)
# tel
p_tel = conf.Param_tel()
p_tel.set_diam(4.0)
p_tel.set_cobs(0.12)
# atmos
p_atmos = c... | unknown | codeparrot/codeparrot-clean | ||
from django.db import migrations, models
from ..models import Child
class Migration(migrations.Migration):
dependencies = [
("with_generic_model", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="CustomGenericModel",
fields=[
(
... | python | github | https://github.com/django/django | tests/migrations/migrations_test_apps/with_generic_model/migrations/0002_customgenericmodel.py |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
*/
#include <assert.h>
#include <arm_neon.h>
#include <qnnpack/q8avgpool.h>
void pytorch_q8avgpool_uk... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/q8avgpool/up8x9-neon.c |
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | unknown | codeparrot/codeparrot-clean | ||
"""display and filter the list of maniphest tasks.
you can use the 'task id' output from this command as input to the
'arcyon task-update' command.
usage examples:
list all tasks:
$ arcyon task-query
output formats:
--format-ids
3
2
1
--format-short
8 / Open / High / ... | unknown | codeparrot/codeparrot-clean | ||
'''
@author: YYK
'''
import zstacklib.utils.shell as shell
import zstacklib.utils.ssh as ssh
import os.path
import sys
def check_and_install_ansible():
cmd = 'which ansible'
try:
shell.call(cmd)
except:
print('ansible is not installed. Will try to install ansible')
cmd = 'pip inst... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime, timedelta
from twitter.common.lang import total_ordering
# TODO(wickman) Do something that won't break if this is running over NYE?
_CURRENT_YEAR = str(datetime.now().year)
class Level(object):
DEBUG = 0
INFO = 10
WARNING = 20
ERROR = 30
FATAL = 40
@total_ordering
c... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2025 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.descriptors.symbols.descriptorBased
import org.jetbrains.kotlin.ana... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/descriptorBased/KaFe10DescEnumEntrySymbol.kt |
#pragma once
#include <cstdint>
#include <mutex>
#include <c10/core/Device.h>
#include <c10/core/DispatchKeySet.h>
#include <c10/core/TensorImpl.h>
#include <c10/macros/Export.h>
#include <c10/util/intrusive_ptr.h>
#include <c10/util/python_stub.h>
/**
* Note [Generator]
* ~~~~~~~~~~~~~~~~
* A Pseudo Random Numbe... | c | github | https://github.com/pytorch/pytorch | c10/core/GeneratorImpl.h |
import codecs
import datetime
import os
import sys
from twisted.python import log
class EncodeReplacerPipe(object):
def __init__(self, inner_file):
self.inner_file = inner_file
self.softspace = 0
def write(self, data):
if isinstance(data, unicode):
try:
data... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Free Mobile SMS platform."""
import logging
from freesms import FreeClient
import voluptuous as vol
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
from homeassistant.const import (
CONF_ACCESS_TOKEN,
CONF_USERNAME,
HTTP_BAD_REQUEST,
HTTP_FORBIDDEN,
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012-2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.reactor
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import org.junit.Test
import org.reactivestreams.*
import reactor.core.*
import reactor.core.publisher.*
import kotlin.concurrent.*
import kotlin.test.*
class MonoAwaitStressTest: TestBase() {
private val N_REPEATS ... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | reactive/kotlinx-coroutines-reactor/test/MonoAwaitStressTest.kt |
//// [tests/cases/conformance/async/es6/asyncArrowFunction/arrowFunctionWithParameterNameAsync_es6.ts] ////
//// [arrowFunctionWithParameterNameAsync_es6.ts]
const x = async => async;
//// [arrowFunctionWithParameterNameAsync_es6.js]
"use strict";
const x = async => async; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es2015).js |
import time
from typing import Any, Callable, Dict, Iterable, Iterator, TypeVar, Optional
from pynamodb.constants import (CAMEL_COUNT, ITEMS, LAST_EVALUATED_KEY, SCANNED_COUNT,
CONSUMED_CAPACITY, TOTAL, CAPACITY_UNITS)
from pynamodb.settings import OperationSettings
_T = TypeVar('_T')
... | unknown | codeparrot/codeparrot-clean | ||
import shutil, json, time, sys, csv, os
# PROGRESS BAR STUFF
# Reference: https://gist.github.com/vladignatyev/06860ec2040cb497f0f3
def progress(count, total, status=''):
bar_len = 60
filled_len = int(round(bar_len * count / float(total)))
percents = round(100.0 * count / float(total), 1)
if filled_l... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
Module for communication with libvirt, part of virt-who
Copyright (C) 2014 Radek Novacek <rnovacek@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... | unknown | codeparrot/codeparrot-clean | ||
########
# 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 | ||
# -*- coding: utf-8 -*-
"""
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re, itertools
from pygments.filter import apply_filters, Filter
from pygments.filters import get_filt... | unknown | codeparrot/codeparrot-clean | ||
# Import data from SIDER
# Current url for latest: ftp://xi.embl.de/SIDER/latest/
from __future__ import print_function
from ftplib import FTP
import gzip
import os
import csv
import json
source_domain = 'xi.embl.de'
source_folder = '/SIDER/latest/'
temp_folder = './temp'
data_folder = './data'
scope_name = 'sider'
... | unknown | codeparrot/codeparrot-clean | ||
##########################################################
# 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/aggregation_... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/generated_suites/aggregation_multiversion_fuzzer_last_continuous.yml |
/*
* Copyright (C) 2011 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 agreed ... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/cache/Weigher.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.