code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import lxml.html
import re
from functions import goUrl
class UrlHead:
_marvinModule = True
public = ['urlhead']
def urlhead():
None
def _urlhead(self,message):
if 'http://' or 'https://' in message.text:
try:
foo = re.findall(r'(htt... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 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.
// This program generates a test to verify that a program can be
// successfully linked even when there are very large text
// sections present.
package main
... | go | github | https://github.com/golang/go | src/cmd/link/linkbig_test.go |
"""
Unittests for migrating a course to split mongo
"""
import unittest
from django.core.management import CommandError, call_command
from contentstore.management.commands.migrate_to_split import Command
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestC... | unknown | codeparrot/codeparrot-clean | ||
#
# test_codecmaps_tw.py
# Codec mapping tests for ROC encodings
#
from test import multibytecodec_support
import unittest
class TestBIG5Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'big5'
mapfileurl = 'http://www.pythontest.net/unicode/BIG5.TXT'
class TestC... | python | github | https://github.com/python/cpython | Lib/test/test_codecmaps_tw.py |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class LeadTest(models.Model):
_name = "base.action.rule.lead.test"
_description = "Action Rule Test"
name = fields.Char(string='Subject', required=True, index=True)
user_... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 Spotify AB
#
# 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, s... | unknown | codeparrot/codeparrot-clean | ||
import {
AccessExpression,
append,
ArrowFunction,
AsExpression,
CallExpression,
CallHierarchyIncomingCall,
CallHierarchyItem,
CallHierarchyOutgoingCall,
CancellationToken,
canHaveModifiers,
ClassDeclaration,
ClassExpression,
ClassLikeDeclaration,
ClassStaticBlockD... | typescript | github | https://github.com/microsoft/TypeScript | src/services/callHierarchy.ts |
"""
Compatibility shim for .resources.simple as found on Python 3.10.
Consumers that can rely on Python 3.11 should use the other
module directly.
"""
from .resources.simple import (
SimpleReader, ResourceHandle, ResourceContainer, TraversableReader,
)
__all__ = [
'SimpleReader', 'ResourceHandle', 'ResourceC... | python | github | https://github.com/python/cpython | Lib/importlib/simple.py |
# Ubuntu build variants for testing development environments
#
# After the branching variants in this file
# should NOT run on a new rapid release (v7.1, v7.2 etc.)
# and LTS release (v7.0, v6.0 etc.) branch projects
buildvariants:
- name: &workstation_bazel_cache_hydration_arm64 workstation_bazel_cache_hydration_ar... | unknown | github | https://github.com/mongodb/mongo | etc/evergreen_yml_components/variants/ubuntu/test_dev_master_branch_only.yml |
package safepath
import (
"context"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
func TestJoinEscapingSymlink(t *testing.T) {
type testCase struct {
name string
target string
}
var cases []testCase
if runtime.GOOS == "windows" {
ca... | go | github | https://github.com/moby/moby | daemon/volume/safepath/join_test.go |
class NipapError(Exception):
""" NIPAP base error class.
"""
error_code = 1000
class NipapInputError(NipapError):
""" Erroneous input.
A general input error.
"""
error_code = 1100
class NipapMissingInputError(NipapInputError):
""" Missing input.
Most input is passed in ... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from mock import __version__
import os
NAME = 'mock'
MODULES = ['mock']
DESCRIPTION = 'A Python Mocking and Patching Library for Testing'
URL = "h... | unknown | codeparrot/codeparrot-clean | ||
# Joint copyright:
# - Copyright 2012,2013 Wikimedia Foundation
# - Copyright 2012,2013 Antoine "hashar" Musso
# - Copyright 2013 Arnaud Fabre
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com>
#
# 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 ... | 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 u... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.utils.io.charsets
import io.ktor.utils.io.core.*
import kotlinx.io.*
import kotlinx.io.bytestring.*
import java.nio.*
@Suppress("ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_... | kotlin | github | https://github.com/ktorio/ktor | ktor-io/jvm/src/io/ktor/utils/io/charsets/CharsetJVM.kt |
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Examples**
```esql
ROW base = 2.0, exponent = 2
| EVAL result = POW(base, exponent)
```
| base:double | exponent:integer | result:double |
| --- | --- | --- |
| 2.0 | 2 | 4.0 |
The exponent can be a ... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/examples/pow.md |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 | ||
use std::{
convert::Infallible,
pin::Pin,
task::{Context, Poll},
};
use bytes::Bytes;
use super::{BodySize, MessageBody};
/// Body type for responses that forbid payloads.
///
/// This is distinct from an "empty" response which _would_ contain a `Content-Length` header.
/// For an "empty" body, use `()` ... | rust | github | https://github.com/actix/actix-web | actix-http/src/body/none.rs |
# genome_test.py - unit tests for genome.py
# Authors:
# * Erich Blume <blume.erich@gmail.com>
#
# Copyright 2011 Erich Blume <blume.erich@gmail.com>
#
# This file is part of Tiger Lily.
#
# Tiger Lily is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.jetty.jakarta
import io.ktor.http.*
import io.ktor.util.logging.*
import io.ktor.utils.io.*
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineS... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-jetty-jakarta/jvm/src/io/ktor/server/jetty/jakarta/JettyRequestBodyReader.kt |
@file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlin.test.*
/**
* Tests that the transitions to the state of the [Job] correspond to documentation in the
* table that is presented in the [Job] documentation.
*/
class JobStatesTest :... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/JobStatesTest.kt |
"""
Functions for acting on a axis of an array.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
def axis_slice(a, start=None, stop=None, step=None, axis=-1):
"""Take a slice along axis 'axis' from 'a'.
Parameters
----------
a : numpy.ndarray
The array t... | unknown | codeparrot/codeparrot-clean | ||
"""Integration tests for agent middleware.""" | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/tests/integration_tests/agents/middleware/__init__.py |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... | unknown | codeparrot/codeparrot-clean | ||
import os
import unittest
import unitils
import platform
try:
from unittest import mock
except ImportError:
import mock
class TestCpCli(unittest.TestCase):
"""Test the functionality of the cp.py cli
"""
@mock.patch("unitils.cp")
def test_only_needs_src_and_dst(self, mock_cp):
argv = ["... | unknown | codeparrot/codeparrot-clean | ||
<?php
$container->loadFromExtension('framework', [
'http_client' => [
'default_options' => null,
'mock_response_factory' => 'my_factory',
'scoped_clients' => [
'notMocked' => [
'base_uri' => 'https://symfony.com',
'mock_response_factory' => false,... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_mock_response_factory.php |
"""Contains the classes that deal with constant temperature dynamics.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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 Lic... | unknown | codeparrot/codeparrot-clean | ||
---
# Run with --check
- hosts: testhost
gather_facts: False
tasks:
- command: 'echo ran'
register: command_out
- name: check that this did not run in check mode
assert:
that:
- '"check mode" in command_out["msg"]'
- hosts: testhost
gather_facts: False
check_mode: False
tasks:
- co... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/check_mode/check_mode-on-cli.yml |
import numpy as np
import pandas as pd
ops = ["mean", "sum", "median", "std", "skew", "kurt", "prod", "sem", "var"]
class FrameOps:
params = [ops, ["float", "int", "Int64"], [0, 1, None]]
param_names = ["op", "dtype", "axis"]
def setup(self, op, dtype, axis):
values = np.random.randn(100000, 4)
... | python | github | https://github.com/pandas-dev/pandas | asv_bench/benchmarks/stat_ops.py |
---
title: Next.js Pages
date: 2021/3/18
description: Learn more about Next.js pages.
tag: web development
author: You
---
# Next.js Pages
In Next.js, a **page** is a [React Component](https://react.dev/reference/react/Component) exported from a `.js`, `.jsx`, `.ts`, or `.tsx` file in the `pages` directory. Each page... | unknown | github | https://github.com/vercel/next.js | examples/blog/pages/posts/pages.md |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
import json
import re
import urllib2
from datetime import datetime
COMMAND_PATTERN = "nsenter --target %s --mount --uts --ipc --net --pid -- %s"
def execute(command):
p = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE... | unknown | codeparrot/codeparrot-clean | ||
import sys, traceback
import mal_readline
import mal_types as types
import reader, printer
from env import Env
import core
# read
def READ(str):
return reader.read_str(str)
# eval
def is_pair(x):
return types._sequential_Q(x) and len(x) > 0
def quasiquote(ast):
if not is_pair(ast):
return types._... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 VMware, 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 a... | unknown | codeparrot/codeparrot-clean | ||
//===--- LifetimeDependenceUtils.swift - Utils for lifetime dependence ----===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | swift | github | https://github.com/apple/swift | SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift |
#
# 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/example_dags/example_xcom.py |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackRuntimeHints.java |
// module cjs (commonjs)
exports.c = "e"; | javascript | github | https://github.com/webpack/webpack | examples/scope-hoisting/node_modules/cjs.js |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
import json
import os
from decimal import Decimal
from unittest import TestCase
from nba_data.data.player_status import PlayerStatusType
from nba_data.data.team import Team
from nba_data.deserializers.box_scores.game import AdvancedGameBoxScoreDeserializer
from tests.config import ROOT_DIRECTORY
class TestAdvancedBox... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Gimp-Python - allows the writing of Gimp plugins in Python.
# Copyright (C) 2005 Werner Hartnagel <info@dotmagic.de>
#
# 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 Fou... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/encryption/helper"
require "base64"
class ActiveRecord::Encryption::MessageSerializerTest < ActiveRecord::EncryptionTestCase
setup do
@serializer = ActiveRecord::Encryption::MessageSerializer.new
end
test "serializes messages" do
message = build_message
... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/encryption/message_serializer_test.rb |
import unicodedata
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@deconstructible
class NoControlCharactersValidator(object):
message = _("Control Characte... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
// @enableJsxOutlining
function Component({arr}) {
const x = useX();
return (
<>
{arr.map((i, id) => {
let jsx = (
<Bar key={id} x={x}>
<Baz i={i}></Baz>
</Bar>
);
return jsx;
})}
</>
);
}
function Bar({x, childre... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-outlining-jsx-stored-in-id.expect.md |
from collections import defaultdict, deque
import logging
import pprint
from scrapy.exceptions import NotConfigured
from scrapy.utils.misc import create_instance, load_object
from scrapy.utils.defer import process_parallel, process_chain, process_chain_both
logger = logging.getLogger(__name__)
class MiddlewareManage... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const asyncLib = require("neo-async");
const { AsyncSeriesWaterfallHook, SyncWaterfallHook } = require("tapable");
const ContextModule = require("./ContextModule");
const ModuleFactory = require("./Module... | javascript | github | https://github.com/webpack/webpack | lib/ContextModuleFactory.js |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Organization.status'
db.add_column('website_organization', 'status',
se... | 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/ListTransactionsRequest.java |
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.utils.reactor import is_asyncio_reactor_installed
class ReactorCheckExtension:
def __init__(self):
if not is_asyncio_reactor_installed():
raise RuntimeError("ReactorCheckExtension requires the asyncio reactor.")
class NoReques... | python | github | https://github.com/scrapy/scrapy | tests/CrawlerProcess/asyncio_enabled_no_reactor.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is very different to AboutModules in Ruby Koans
# Our AboutMultipleInheritance class is a little more comparable
#
from runner.koan import *
from .another_local_module import *
from .local_module_with_all_defined import *
class AboutModules(Koan):
def test_... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2009-2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for the django comment client integration models
"""
from django.test.testcases import TestCase
from nose.plugins.attrib import attr
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
import django_comment_common.mo... | unknown | codeparrot/codeparrot-clean | ||
"""
Django settings for bookstore project.
Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from settings import * # noqa
# Make sure the apps needed to test translations and core are present.
INSTALLED_APPS += (
'olympia.translations.tests.testapp',
'olympia.core.tests.db_tests_testapp',
)
# Make sure the debug toolbar isn't used during the tests.
INSTALLED_APPS = [app for a... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
"""Helper to build and publish Django artifacts.
Original author: Tim Graham.
Other authors: Mariusz Felisiak, Natalia Bidart.
"""
import hashlib
import os
import re
import subprocess
from datetime import date
PGP_KEY_ID = os.getenv("PGP_KEY_ID")
PGP_KEY_URL = os.getenv("PGP_KEY_URL")
PGP_EM... | python | github | https://github.com/django/django | scripts/do_django_release.py |
# Concurrency Guide
This is a guide to thinking about concurrency in the cruby source code, whether that's contributing to Ruby
by writing C or by contributing to one of the JITs. This does not touch on native extensions, only the core
language. It will go over:
* What needs synchronizing?
* How to use the VM lock, a... | unknown | github | https://github.com/ruby/ruby | doc/contributing/concurrency_guide.md |
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | unknown | codeparrot/codeparrot-clean | ||
"""Tests to ensure that the lxml tree builder generates good trees."""
import re
import warnings
try:
import lxml.etree
LXML_PRESENT = True
LXML_VERSION = lxml.etree.LXML_VERSION
except ImportError, e:
LXML_PRESENT = False
LXML_VERSION = (0,)
if LXML_PRESENT:
from bs4.builder import LXMLTreeB... | unknown | codeparrot/codeparrot-clean | ||
exports.__esModule = Math.random() < -1;
exports.data = "ok";
exports.default = "default"; | javascript | github | https://github.com/webpack/webpack | test/cases/mjs/cjs-import-default/dynamic.js |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import UnstructuredTSVLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling o... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/tsv.py |
#
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | unknown | codeparrot/codeparrot-clean | ||
//! Stub implementations for the platform API so that rustdoc can build linkable
//! documentation on non-windows platforms.
use crate::signal::RxFuture;
use std::io;
pub(super) fn ctrl_break() -> io::Result<RxFuture> {
panic!()
}
pub(super) fn ctrl_close() -> io::Result<RxFuture> {
panic!()
}
pub(super) fn... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/signal/windows/stub.rs |
/*
* 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 | spring-beans/src/main/java/org/springframework/beans/factory/support/InstanceSupplier.java |
<!-- Primary Nav -->
<div
[attr.id]="PRIMARY_NAV_ID"
class="wrapper"
(docsClickOutside)="closeMobileNav()"
[docsClickOutsideIgnore]="[SECONDARY_NAV_ID]"
>
<!-- Mobile nav bar -->
<div class="adev-mobile-nav-bar">
<!-- Logo icon -->
<button
type="button"
class="adev-mobile-nav-button"
... | html | github | https://github.com/angular/angular | adev/src/app/core/layout/navigation/navigation.component.html |
/* adler32_ssse3_p.h -- adler32 ssse3 utility functions
* Copyright (C) 2022 Adam Stylinski
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#ifndef ADLER32_SSSE3_P_H_
#define ADLER32_SSSE3_P_H_
#ifdef X86_SSSE3
#include <immintrin.h>
#include <stdint.h>
static inline uint32_t partial_... | c | github | https://github.com/opencv/opencv | 3rdparty/zlib-ng/arch/x86/adler32_ssse3_p.h |
// Copyright Joyent, Inc. and other Node contributors.
//
// 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, modi... | c | github | https://github.com/nodejs/node | src/node_object_wrap.h |
#!/usr/bin/env python
#******************************************************************************
# $Id: gdal_sieve.py 27044 2014-03-16 23:41:27Z rouault $
#
# Project: GDAL Python Interface
# Purpose: Application for applying sieve filter to raster data.
# Author: Frank Warmerdam, warmerdam@pobox.com
#
#**... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import fnmatch
import os
import sys
from lib.util import execute
IGNORE_FILES = [
os.path.join('atom', 'app', 'atom_main.cc'),
os.path.join('atom', 'browser', 'mac', 'atom_application.h'),
os.path.join('atom', 'browser', 'mac', 'atom_application_delegate.h'),
os.path.join('atom', 'brows... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/diagnostics/FailureAnalysis.java |
"""
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
im... | unknown | codeparrot/codeparrot-clean | ||
from django.template.defaultfilters import cut
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class CutTests(SimpleTestCase):
@setup(
{
"cut01": (
'{% autoescape off %}{{ a|cut:"x" }} {{ b|cut:"x" }}{% endautoescap... | python | github | https://github.com/django/django | tests/template_tests/filter_tests/test_cut.py |
from sqlalchemy import Integer, ForeignKey, String
from sqlalchemy.types import PickleType, TypeDecorator, VARCHAR
from sqlalchemy.orm import mapper, Session, composite
from sqlalchemy.orm.mapper import Mapper
from sqlalchemy.orm.instrumentation import ClassManager
from sqlalchemy.testing.schema import Table, Column
fr... | unknown | codeparrot/codeparrot-clean | ||
"""
General tests for all estimators in sklearn.
"""
# Authors: Andreas Mueller <amueller@ais.uni-bonn.de>
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
from __future__ import print_function
import os
import warnings
import sys
import pkgutil
from sklearn.externals.six import PY3
fr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""Tests for finding a positive semi-definite correlation or covariance matrix
Created on Mon May 27 12:07:02 2013
Author: Josef Perktold
"""
import numpy as np
import scipy.sparse as sparse
from numpy.testing import (assert_almost_equal, assert_allclose,
assert_equ... | unknown | codeparrot/codeparrot-clean | ||
global:
scrape_timeout: 1h
scrape_interval: 1h | unknown | github | https://github.com/prometheus/prometheus | config/testdata/global_timeout.good.yml |
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
use serde_derive::Deserialize;
#[derive(Deserialize)]
#[serde(default)]
enum E {
S { f: u8 },
}
fn main() {} | rust | github | https://github.com/serde-rs/serde | test_suite/tests/ui/default-attribute/enum.rs |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012, 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# h... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Sof... | unknown | codeparrot/codeparrot-clean | ||
import os
import time
import logging
import shutil
import subprocess
from autotest.client.shared import error
from virttest import virsh
from virttest import utils_test
from virttest import utils_misc
from virttest import data_dir
def func_in_thread(vm, timeout):
"""
Function run in thread to switch domstate... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2021 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/replicaset/metrics/metrics.go |
from optparse import make_option
from datetime import datetime
import errno
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.utils import autoreload
naiveip_re = re.com... | unknown | codeparrot/codeparrot-clean | ||
"""Wrapper utilities for the Bazel build system."""
import multiprocessing
import os
import pathlib
import platform
from bazel.wrapper_hook.wrapper_debug import wrapper_debug
_UNKNOWN = "Unknown"
_REPO_ROOT = str(pathlib.Path(__file__).parent.parent.parent)
_EXISTING_TERMINAL_STDOUT = None
_EXISTING_TERMINAL_STDERR ... | python | github | https://github.com/mongodb/mongo | bazel/wrapper_hook/wrapper_util.py |
module kotlinx.coroutines.guava {
requires kotlin.stdlib;
requires kotlinx.coroutines.core;
requires com.google.common;
exports kotlinx.coroutines.guava;
} | java | github | https://github.com/Kotlin/kotlinx.coroutines | integration/kotlinx-coroutines-guava/src/module-info.java |
"""Gmail toolkit.""" | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/agents/agent_toolkits/gmail/__init__.py |
# -*- coding: utf-8 -*-
# import requests
# import urllib
import re
import urllib
import json
import sys
def search_doi(s):
url = "http://search.crossref.org/?q=" + convert_string(s)
htmlfile = urllib.urlopen(url)
htmltext = htmlfile.read()
regex ="href='http://dx.doi.org/"+ '(.*)' + "'>"
pattern = re.compile(re... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | tests/e2e/ctl_v3_completion_test.go |
'use strict';
const { join } = require('node:path');
const common = require('../common.js');
const tmpdir = require('../../test/common/tmpdir');
let cnt = 0;
tmpdir.refresh();
function nextLocalStorage() {
return join(tmpdir.path, `${++cnt}.localstorage`);
}
const options = {
flags: [`--localstorage-file=${next... | javascript | github | https://github.com/nodejs/node | benchmark/webstorage/removeItem.js |
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts] ////
//// [ES5For-of30.ts]
var a: string, b: number;
var tuple: [number, string] = [2, "3"];
for ([a = 1, b = ""] of tuple) {
a;
b;
}
//// [ES5For-of30.js]
"use strict";
var _a, _b, _c;
var a, b;
var tuple = [2, "3"];
for (var _i = 0, t... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ES5For-of30(target=es5).js |
/* Copyright (c) 2018, 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 as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will ... | c | github | https://github.com/mysql/mysql-server | sql/debug_lo_misc.h |
#!/usr/bin/env python
"""
MAVProxy realtime graphing module, partly based on the wx graphing
demo by Eli Bendersky (eliben@gmail.com)
http://eli.thegreenplace.net/files/prog_code/wx_mpl_dynamic_graph.py.txt
"""
from MAVProxy.modules.lib import mp_util
class LiveGraph():
'''
a live graph object using ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# 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 | ||
import hashlib, base64
# Basic verifiable log, for demo purposes only
class VerifiableLog:
def __init__(self):
self._entries = []
self._cache = {}
def append(self, val):
self._entries.append(val)
def get_entries(self, start, end):
return self._entries[start:end + 1]
def get_tree_head(self, s... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
import {useHook} from 'shared-runtime';
function Component(props) {
const x = [];
useHook(); // intersperse a hook call to prevent memoization of x
x.push(props.value);
const y = [x];
return [y];
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{value: 'sathya'}],
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-invalidate-array.expect.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.