code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""
Plot the scaling of the nearest neighbors algorithms with k, D, and N
"""
from time import time
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import ticker
from sklearn import datasets, neighbors
def get_data(N, D, dataset="dense"):
if dataset == "dense":
np.random.seed(0)
... | python | github | https://github.com/scikit-learn/scikit-learn | benchmarks/bench_plot_neighbors.py |
# -*- coding: utf-8 -*-
from lxml import etree as et
import sys
import os
# for TTS(default system TTS)
import pyttsx
#coding: utf-8
#function that reads the xhtml file and returns the root of the document
def getData(fname):
f=open(fname)
d=f.read()
data = d.replace('\n','')
root = et.fromstring(data)
retur... | 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/PE/utils/ordinals_lookup_tables/msvcr110_dll_lookup.hpp |
/*
* 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
import io.ktor.client.engine.mock.*
import io.ktor.client.plugins.*
import io.ktor.client.plugins.observer.*
import io.ktor.client.request.*
import io.ktor.client... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-tests/common/test/io/ktor/client/tests/ResponseObserverTest.kt |
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 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 | ||
#!/usr/bin/env python
# encoding: utf-8
from tests.base import OsfTestCase
from osf_tests.factories import ProjectFactory
from addons.osfstorage import settings as storage_settings
import collections
from framework.auth import Auth
identity = lambda value: value
class Delta(object):
def __init__(self, getter, c... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | unknown | codeparrot/codeparrot-clean | ||
//===--- FileTypes.h - Input & output formats used by the tools -*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/Basic/FileTypes.h |
"""
Test contentstore.mongo functionality
"""
import os
import logging
from uuid import uuid4
import unittest
import mimetypes
from tempfile import mkdtemp
import path
import shutil
from opaque_keys.edx.locator import CourseLocator, AssetLocator
from opaque_keys.edx.keys import AssetKey
from xmodule.tests import DATA... | unknown | codeparrot/codeparrot-clean | ||
"""
Take EHR data located in a study folder and convert it to I2B2.
Poll a base directory for incoming CSV files ready for processing. We assume that
CSV files are already anonymised and organised with the following directory structure:
2016
_ 20160407
_ patients.csv
_ diseases.csv
_ .... | unknown | codeparrot/codeparrot-clean | ||
# Taken from Python 2.6.4 and regexp module constants modified
"""A parser for SGML, using the derived class as a static DTD."""
# XXX This only supports those SGML features used by HTML.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable charac... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
import gc
'''
This snippet shows how to create a uncollectible object:
It is an object in a cycle reference chain, in which there is an object
with __del__ defined.
The simpliest is an object that refers to itself and with a __del__ defined.
> python uncollectible.py
==... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python -i
# preceding line should have path for Python on your machine
# matplotlib_plot.py
# Purpose: plot Temp of running LAMMPS simulation via matplotlib
# Syntax: plot.py in.lammps Nfreq Nsteps compute-ID
# in.lammps = LAMMPS input script
# Nfreq = plot data point every this many ... | unknown | codeparrot/codeparrot-clean | ||
from ctypes import *
import unittest, sys
from ctypes.test import is_resource_enabled
################################################################
# This section should be moved into ctypes\__init__.py, when it's ready.
from _ctypes import PyObj_FromPtr
###########################################################... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.ecl
~~~~~~~~~~~~~~~~~~~
Lexers for the ECL language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, words
from pygments.... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package command
import (
"fmt"
"strings"
"github.com/hashicorp/cli"
"github.com/posener/complete"
)
var (
_ cli.Command = (*OperatorStepDownCommand)(nil)
_ cli.CommandAutocomplete = (*OperatorStepDownCommand)(nil)
)
type Opera... | go | github | https://github.com/hashicorp/vault | command/operator_step_down.go |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Scheduler Error Mailer module for OpenERP
# Copyright (C) 2012-2013 Akretion (http://www.akretion.com/)
# @author: Sébastien Beau <sebastien.beau@akretion.com>
# @author David Beal <bealdavid@gmail.c... | 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 | ||
#!/usr/bin/env python
# Copyright 2014, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import logging
import os
import json
import server
class ZkTopoServer(server.TopoServer):
"""Implementation of TopoServer for ZooKeeper"""
... | unknown | codeparrot/codeparrot-clean | ||
"""The Distribution template."""
from equadratures.distributions.recurrence_utils import custom_recurrence_coefficients
import numpy as np
PDF_SAMPLES = 500000
class Distribution(object):
"""
The class defines a Distribution object. It serves as a template for all distributions.
:param double lower:
... | unknown | codeparrot/codeparrot-clean | ||
require 'optparse'
parser = OptionParser.new
parser.on('-x XXX', '--xxx', 'Required argument via short name') do |value|
p ['--xxx', value]
end
parser.on('-y', '--y YYY', 'Required argument via long name') do |value|
p ['--yyy', value]
end
parser.parse! | ruby | github | https://github.com/ruby/ruby | doc/optparse/ruby/required_argument.rb |
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.verification;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.excep... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockito/internal/verification/OnlyTest.java |
---
layout: step
title: Collections
position: 9
---
Let's look at fleshing out authors so each author has their own page with a
blurb and the posts they've published.
To do this you'll use collections. Collections are similar to posts except the
content doesn't have to be grouped by date.
## Configuration
To set up ... | unknown | github | https://github.com/jekyll/jekyll | docs/_docs/step-by-step/09-collections.md |
from connection import H2OConnection
from frame import H2OFrame
from job import H2OJob
from model.model_future import H2OModelFuture
from model.dim_reduction import H2ODimReductionModel
from model.autoencoder import H2OAutoEncoderModel
from model.multinomial import H2OMultinomialModel
from model.regression ... | unknown | codeparrot/codeparrot-clean | ||
"""
This plugin bypasses the actual execution of tests, and instead just collects
test names. Fixtures are also bypassed, so running nosetests with the
collection plugin enabled should be very quick.
This plugin is useful in combination with the testid plugin (``--with-id``).
Run both together to get an indexed list o... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, print_function
from datetime import datetime
from rfc822 import parsedate_tz, mktime_tz
from urlparse import urlparse
from .base import Vcs, RevisionResult, BufferParser
LOG_FORMAT = '{node}\x01{author}\x01{date|rfc822date}\x01{p1node} {p2node}\x01{branches}\x01{desc... | unknown | codeparrot/codeparrot-clean | ||
// compile
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test function signatures.
// Compiled but not run.
package main
type t1 int
type t2 int
type t3 int
func f1(t1, t2, t3)
func f2(t1, t2, t3 boo... | go | github | https://github.com/golang/go | test/func2.go |
# Necessary imports. Provides library functions to ease writing tests.
from lib import prebuild, testcase, SUBMITTY_TUTORIAL_DIR
import subprocess
import os
import glob
import shutil
import traceback
############################################################################
# COPY THE ASSIGNMENT FROM THE SAMPLE ASS... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
use crate::LanguageIdentifier;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
impl Serialize for Lan... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/icu_locale_core/src/serde.rs |
"""
spatial lag operations
"""
__authors__ = "Serge Rey <srey@asu.edu>, David C. Folch <david.folch@asu.edu>"
__all__ = ['lag_spatial']
def lag_spatial(w, y):
"""
Spatial lag operator. If w is row standardized, returns the average of
each observation's neighbors; if not, returns the weighted sum of each
... | unknown | codeparrot/codeparrot-clean | ||
import re
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.functional import cached_property
test_srs = ({
'srid': 4326,
'auth_name': ('EPSG', True),
'auth_srid': 4326,
# Only the beginning, because there are differences depending on installed li... | unknown | codeparrot/codeparrot-clean | ||
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | 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 may ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .analysis import (
create_report_for_web_service_scan,
update_web_service_report_for_organization,
update_latest_web_service_reports_for_organization,
)
from .base import (
apply_flag_to_web_service_scan,
apply_flags_to_web_servic... | unknown | codeparrot/codeparrot-clean | ||
'''
Save spectrum info to a data structure, so it's easy to retrieve spect for a special time
'''
import pymzml
class SpecBasic:
def __init__(self, rt, index, mslevel = 1):
# here the program assume the retention time is a float number
self._rt = float(rt)
self._idx = index
... | unknown | codeparrot/codeparrot-clean | ||
from flask_testing import TestCase
import testing.postgresql
from orcid_service.models import Base
class TestCaseDatabase(TestCase):
"""
Base test class for when databases are being used.
"""
postgresql_url_dict = {
'port': 1234,
'host': '127.0.0.1',
'user': 'postgres',
... | unknown | codeparrot/codeparrot-clean | ||
"""
========================================================
Hierarchical clustering (:mod:`scipy.cluster.hierarchy`)
========================================================
.. currentmodule:: scipy.cluster.hierarchy
These functions cut hierarchical clusterings into flat clusterings
or find the roots of the forest f... | unknown | codeparrot/codeparrot-clean | ||
//go:build windows
/*
Copyright 2017 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 ag... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/preflight/checks_windows.go |
"""Implements the Astropy TestRunner which is a thin wrapper around py.test."""
import inspect
import os
import glob
import copy
import shlex
import sys
import tempfile
import warnings
import importlib
from collections import OrderedDict
from importlib.util import find_spec
from functools import wraps
from astropy.co... | unknown | codeparrot/codeparrot-clean | ||
import asyncio
import collections
import itertools
import json
from .data_watcher import DataWatcher
from .party import Party
from .lock import Lock
from .recipe import Recipe
class Allocator(Recipe):
sub_recipes = {
"party": (Party, ["member_path", "name"]),
"lock": (Lock, ["lock_path"]),
... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
import linecache
import re
import tkinter as tk
from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem
from idlelib.PyShell import PyShellFileList
def StackBrowser(root, flist=None, tb=None, top=None):
if top is ... | unknown | codeparrot/codeparrot-clean | ||
# :coding: utf-8
def fetch_environment(file_id, files=None, module_names=None):
"""Return module environment dictionary from *file_id*.
*file_id* represent the identifier of the file.
*files* is an optional list of the other file names stored in the same
directory as the one analyzed.
*module_na... | unknown | codeparrot/codeparrot-clean | ||
import time
class SimpleTimer(object):
def __init__(self):
self.reset()
def now(self):
return time.time()
def elapsed(self):
return self.now() - self.t0
def reset(self):
self.t0 = self.now()
class FPSCounter(object):
def __init__(self):
self.averageComp... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package cli
import (
"context"
"fmt"
"io"
"math"
"time"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver"
"github.com/cockroachdb/cockroach/pkg/server"
"githu... | go | github | https://github.com/cockroachdb/cockroach | pkg/cli/rpc_node_shutdown.go |
#!/usr/bin/env python
#
# Copyright 2007 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 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.
try:
import resource # pylint: disable=F0401
except ImportError:
resource = None # Not available on all platforms
from telemetry import decorators
fro... | unknown | codeparrot/codeparrot-clean | ||
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Downloa... | php | github | https://github.com/composer/composer | src/Composer/Downloader/TransportException.php |
/*
* 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-auth/src/main/java/org/apache/hadoop/security/authentication/server/package-info.java |
"""The tests for the DTE Energy Bridge."""
import unittest
import requests_mock
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
DTE_ENERGY_BRIDGE_CONFIG = {
'platform': 'dte_energy_bridge',
'ip': '192.168.1.1',
}
class TestDteEnergyBridgeSetup(unittest.Test... | unknown | codeparrot/codeparrot-clean | ||
/**
* Generated by '@kontent-ai/model-generator@5.9.0'
*
* Project name: Next.js Sample App
* Environment: Production
* Project Id: a7844231-064c-016c-1dad-38228cbc505d
*/
export const contentTypeSnippets = {} as const; | typescript | github | https://github.com/vercel/next.js | examples/cms-kontent-ai/models/project/contentTypeSnippets.ts |
import pytest
from webdriver import error
from tests.support.asserts import assert_success
def delete_session(session):
return session.transport.send("DELETE", "session/{session_id}".format(**vars(session)))
def test_null_response_value(session):
response = delete_session(session)
value = assert_success(... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 the Melange 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 wr... | unknown | codeparrot/codeparrot-clean | ||
from JumpScale import j
# import JumpScale.baselib.remote
class CiscoSwitchManager(object):
def get(self, host, login,password):
return CiscoSwitch(host, login,password)
#!/usr/bin/python
from Router import Router
class CiscoSwitch(object):
def __init__(self, host, login,password):
R1 = Ro... | unknown | codeparrot/codeparrot-clean | ||
"""
Classes to represent the default SQL aggregate functions
"""
import copy
import warnings
from django.db.models.fields import IntegerField, FloatField
from django.db.models.lookups import RegisterLookupMixin
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.functional import cached_pro... | unknown | codeparrot/codeparrot-clean | ||
//===--- URI.h - File URIs with schemes --------------------------*- C++-*-===//
//
// 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/clangd/URI.h |
#
# Copyright 2006,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later ve... | unknown | codeparrot/codeparrot-clean | ||
name: Trigger Docs Build
on:
push:
branches: 'main'
paths: [ 'antora/*' ]
workflow_dispatch:
inputs:
build-version:
description: 'Version being build (e.g. 1.0.3-SNAPSHOT)'
required: false
build-sha:
description: Enter the SHA to build (e.g. 82c97891569821a7f91a77ca07... | unknown | github | https://github.com/spring-projects/spring-boot | .github/workflows/trigger-docs-build.yml |
# -*- coding: utf-8 -*-
"""
pygments.lexers._sourcemodbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names of SourceMod functions.
It is able to re-generate itself.
Do not edit the FUNCTIONS list by hand.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
... | unknown | codeparrot/codeparrot-clean | ||
"""
Apple Quicktime Movie (file extension ".mov") parser.
Documents:
- Parsing and Writing QuickTime Files in Java (by Chris Adamson, 02/19/2003)
http://www.onjava.com/pub/a/onjava/2003/02/19/qt_file_format.html
- QuickTime File Format (official technical reference)
http://developer.apple.com/documentation/QuickTi... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (c) 2015 David I. Urbina, david.urbina@utdallas.edu
#
# 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... | 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 | ||
<?php
namespace Illuminate\Tests\Database;
use Exception;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\DatabaseTransactionsManager;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Throwable;
class DatabaseTransactionsTest extends TestCase
{
/**
* Setup the database schema.
... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseTransactionsTest.php |
/*
* 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.contracts.description.booleans
import org.jetbrains.kotlin.analysis... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/contracts/description/booleans/contractLogicalCombinators.kt |
# -*- coding: utf-8 -*-
# Fichier tp3.py
from numpy import * # importation du module numpy
from numpy.linalg import * # importation du module numpy.linalg
from matplotlib.pyplot import * # importation du module matplotlib.pyplot
from mpl_toolkits.mplot3d import Axes3D # importation du module mpl_toolkits.mplot3d
impo... | unknown | codeparrot/codeparrot-clean | ||
from typing import Any
from pandas import Index
def allow_na_ops(obj: Any) -> bool:
"""Whether to skip test cases including NaN"""
is_bool_index = isinstance(obj, Index) and obj.inferred_type == "boolean"
return not is_bool_index and obj._can_hold_na | python | github | https://github.com/pandas-dev/pandas | pandas/tests/base/common.py |
# -*- coding: utf-8 -*-
# $Id: da.py 7678 2013-07-03 09:57:36Z milde $
# Author: E D
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
error: {
code: 'legacy_export_invalid',
message: 'Cannot use `export let` in runes mode — use `$props()` instead'
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/compiler-errors/samples/runes-export-let/_config.js |
/*
* 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-internal/src/main/java/org/elasticsearch/gradle/internal/release/TemplateUtils.java |
/*-------------------------------------------------------------------------
*
* slot.c
* Replication slot management.
*
*
* Copyright (c) 2012-2026, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
* src/backend/replication/slot.c
*
* NOTES
*
* Replication slots are used to keep state about r... | c | github | https://github.com/postgres/postgres | src/backend/replication/slot.c |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
### 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; version 2 only
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY;... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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
#... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear... | c | github | https://github.com/opencv/opencv | 3rdparty/libtiff/tif_write.c |
package conversion
import (
"context"
"sync/atomic"
"testing"
"time"
dashv0 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
dashv1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
dashv2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
... | go | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/conversion_cache_test.go |
## Input
```javascript
function Component(props) {
const items = (() => {
if (props.cond) {
return [];
} else {
return null;
}
})();
items?.push(props.a);
return items;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{a: {}}],
};
```
## Code
```javascript
import { ... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/iife-return-modified-later-phi.expect.md |
/*
* Copyright (c) 2017 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitoinline;
import java.util.Collections;
import java.util.Set;
import org.junit.Test;
import org.mockito.internal.invocation.finder.AllInvocationsFinder;
import org.mockito.stubbing.S... | java | github | https://github.com/mockito/mockito | mockito-integration-tests/inline-mocks-tests/src/test/java/org/mockitoinline/StubbingLocationTest.java |
#! /usr/bin/env python
# coding=utf-8
import matplotlib.pyplot as plt
path = "/home/nanook/nanook_ros/src/nanook_path_tracking/planta_motores/ensaios/ensaio_ajuste.txt"
f = open(path, 'r')
samples = []
t = []
left_speed = []
right_speed = []
##### Leitura do arquivo #####
for line in f:
line = line.split()
sampl... | 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 | ||
import copy
import filecmp
import os
import tarfile
import zipfile
from collections import deque
from io import BytesIO
from unittest import mock
import pytest
from requests import compat
from requests._internal_utils import unicode_is_ascii
from requests.cookies import RequestsCookieJar
from requests.structures impo... | python | github | https://github.com/psf/requests | tests/test_utils.py |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#----------------------------------------------------------------------------
# 04-Mar-2014 ShaneG
#
# Utility to dump the contents of a device.
#----------------------------------------------------------------------------
import sys
from os.path import splitext, basename
from intelhex import Inte... | unknown | codeparrot/codeparrot-clean | ||
---
applies_to:
stack:
serverless:
navigation_title: "Percolator"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/percolator.html
---
# Percolator field type [percolator]
The `percolator` field type parses a json structure into a native query and stores that query, so that the [p... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/mapping-reference/percolator.md |
/* Copyright (c) 2024, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including... | c | github | https://github.com/mysql/mysql-server | vector-common/vector_constants.h |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Date
"""
from dateutil import parser
from rebulk.remodule import re
_dsep = r'[-/ \.]'
_dsep_bis = r'[-/ \.x]'
date_regexps = [
re.compile(r'%s((\d{8}))%s' % (_dsep, _dsep), re.IGNORECASE),
re.compile(r'%s((\d{6}))%s' % (_dsep, _dsep), re.IGNORECASE),
re.... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from ..._models import BaseModel
from .realtime_transcription_session_audio_input import RealtimeTranscriptionSessionAudioInput
__all__ = ["RealtimeTranscriptionSessionAudio"]
class RealtimeTranscriptio... | python | github | https://github.com/openai/openai-python | src/openai/types/realtime/realtime_transcription_session_audio.py |
# Copyright (c) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for more details
"""
Tests for mamba.core.packages
"""
import sys
import tempfile
import functools
from twisted.trial import unittest
from twisted.python import filepath
from mamba.core import packages, GNU_LINUX
from mamba.application.... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.rx3
import kotlinx.coroutines.testing.*
import io.reactivex.rxjava3.core.*
import io.reactivex.rxjava3.exceptions.*
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.reactive.*
import org.junit.Test
import java.util.concurrent.Executors
import java.util.c... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | reactive/kotlinx-coroutines-rx3/test/LeakedExceptionTest.kt |
#! -*- coding: utf8 -*-
from trytond.model import ModelView, ModelSQL, fields
__all__ = ['Company']
class Company(ModelSQL, ModelView):
'Company'
__name__ = 'company.company'
pyafipws_certificate = fields.Text('Certificado AFIP WS',
help="Certificado (.crt) de la empresa para webservices AFIP")
... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
Tests for FileBrowser sites and their views.
Note that we *dynamically generate* test cases for each deployed FileBrowser
site. This includes creation of TestCase subclasses at runtime and also
creation of instance methods from functions.
"""
# PYTHON IMPORTS
from __future__ import with_statement... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015 Openstack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0
/*
* High-level sync()-related operations
*/
#include <linux/blkdev.h>
#include <linux/kernel.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/namei.h>
#include <linux/sched.h>
#include <linux/writeback.h>
#include ... | c | github | https://github.com/torvalds/linux | fs/sync.c |
"""Self documenting XML-RPC Server.
This module can be used to create XML-RPC servers that
serve pydoc-style documentation in response to HTTP
GET requests. This documentation is dynamically generated
based on the functions and methods registered with the
server.
This module is built upon the pydoc and SimpleXMLRPCSe... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | unknown | codeparrot/codeparrot-clean | ||
use rustc_index::{Idx, IndexVec};
use rustc_middle::mir::{BasicBlock, Body, Location};
/// Maps between a `Location` and a `PointIndex` (and vice versa).
pub struct DenseLocationMap {
/// For each basic block, how many points are contained within?
statements_before_block: IndexVec<BasicBlock, usize>,
/// ... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_mir_dataflow/src/points.rs |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
static char *ngx_http_flv(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static ngx_command_t ngx_http_flv_commands[] = {
{ ngx_string("flv"),
NGX_HTTP_LOC_CONF|NGX_CONF_... | c | github | https://github.com/nginx/nginx | src/http/modules/ngx_http_flv_module.c |
// This file was automatically generated from channels.md by Knit tool. Do not edit.
package kotlinx.coroutines.guide.exampleChannel09
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
data class Ball(var hits: Int)
fun main() = runBlocking {
val table = Channel<Ball>() // a shared table
launc... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/guide/example-channel-09.kt |
# Factories are self documenting
# pylint: disable=missing-docstring
import json
from functools import partial
import factory
from factory.django import DjangoModelFactory
# Imported to re-export
from student.tests.factories import UserFactory # Imported to re-export
from student.tests.factories import UserProfileFa... | 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 use thi... | unknown | codeparrot/codeparrot-clean | ||
extension Request {
/// Returns the current `Session` or creates one.
///
/// router.get("session") { req -> String in
/// req.session.data["name"] = "Vapor"
/// return "Session set"
/// }
///
/// - note: `SessionsMiddleware` must be added and enabled.
/// - r... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Sessions/Request+Session.swift |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.