code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Natural Language Toolkit: Tree-Adjoining Grammar
#
# Copyright (C) 2001-2013 NLTK Project
# Author: WANG Ziqi, Haotian Zhang <{zwa47,haotianz}@sfu.ca>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
#
from nltk.parse.projectivedependencyparser import *
from nltk.classify.naivebayes import ... | unknown | codeparrot/codeparrot-clean | ||
import logging
import subprocess
import tempfile
import unittest
class TestTail(unittest.TestCase):
def setUp(self):
self.log_file = tempfile.NamedTemporaryFile()
self.logrotate_config = tempfile.NamedTemporaryFile()
self.logrotate_config.write("""%s {
copytruncate
n... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.resolveExtensionInfoProvid... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/resolveExtensionInfoProvider/FirIdeNormalAnalysisScriptSourceModuleResolveExtensionInfoProviderTestGenerated.java |
"""
Family of two-dimensional functions indexed by x and y.
All functions are written to be valid both for scalar x and y, and for
numpy arrays of x and y (in which case the result is also an array);
the functions therefore have the same mathematical behaviour as numpy.
$Id$
"""
from __future__ import with_statement... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/lite/acceleration/configuration/flatbuffer_to_proto.h |
from __future__ import print_function
from datetime import date
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.resources import INLINE
from bokeh.util.browser import view
from bokeh.models import ColumnDataSource
from bokeh.models.layouts import Column, Row, WidgetBox
from bokeh.mode... | unknown | codeparrot/codeparrot-clean | ||
"""By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/... | unknown | codeparrot/codeparrot-clean | ||
import { test, expect } from "@playwright/test";
import {
UNSAFE_ErrorResponseImpl as ErrorResponseImpl,
UNSAFE_ServerMode as ServerMode,
} from "react-router";
import type { Fixture } from "./helpers/create-fixture.js";
import {
createAppFixture,
createFixture,
js,
} from "./helpers/create-fixture.js";
impo... | typescript | github | https://github.com/remix-run/react-router | integration/error-sanitization-test.ts |
__author__ = 'Bohdan Mushkevych'
import unittest
from settings import enable_test_mode
enable_test_mode()
from db.model.site_statistics import DOMAIN_NAME, TIMEPERIOD
from constants import PROCESS_SITE_MONTHLY
from tests import daily_fixtures
from tests import monthly_fixtures
from tests.test_abstract_worker import A... | 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 | connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorConnectorConfig.java |
'''
Cache manager
=============
The cache manager can be used to store python objects attached to a unique
key. The cache can be controlled in two ways: with a object limit or a
timeout.
For example, we can create a new cache with a limit of 10 objects and a
timeout of 5 seconds::
# register a new Cache
Cach... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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 ve... | unknown | codeparrot/codeparrot-clean | ||
from io import StringIO
import re
from string import ascii_uppercase
import sys
import textwrap
import numpy as np
import pytest
from pandas.compat import (
HAS_PYARROW,
IS64,
PYPY,
is_platform_arm,
)
from pandas import (
CategoricalIndex,
DataFrame,
Index,
MultiIndex,
Series,
... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/methods/test_info.py |
use rustc_span::Symbol;
use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
def_reg_class! {
Wasm WasmInlineAsmRegClass {
local,
}
}
impl WasmInlineAsmRegClass {
pub fn valid_modifiers(self, _arch: super::InlineAsmArch) -> &'static [char] {
&[]
}
pub fn suggest_class(self, _... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/asm/wasm.rs |
// SPDX-License-Identifier: GPL-2.0
/*
* Shared application/kernel submission and completion ring pairs, for
* supporting fast/efficient IO.
*
* A note on the read/write ordering memory barriers that are matched between
* the application and kernel side.
*
* After the application reads the CQ ring tail, it must ... | c | github | https://github.com/torvalds/linux | io_uring/io_uring.c |
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'DongMin Kim'
class ConceptNetWriter:
def __init__(self, a, out_type, out_name):
self.a = a
self.output_file_type = out_type
self.output_file_name = out_name
# Open an output file
self.output_file = open(self.output_file_name, 'w')
# Prepare the output... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
class TwitterSearchException(Exception):
"""
This class is all about exceptions (surprise, surprise!).
All exception based directly on TwitterSearch will consist of
a **code** and a **message** describing the reason of the
exception shortly.
"""
# HTTP status codes ... | unknown | codeparrot/codeparrot-clean | ||
import type { SourceMap } from 'magic-string';
import type { Binding } from '../phases/scope.js';
import type { AST, Namespace } from './template.js';
import type { ICompileDiagnostic } from '../utils/compile_diagnostic.js';
import type { StateCreationRuneName } from '../../utils.js';
import type {
AssignmentExpressio... | typescript | github | https://github.com/sveltejs/svelte | packages/svelte/src/compiler/types/index.d.ts |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# 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
import errno
import... | unknown | codeparrot/codeparrot-clean | ||
plugin: ansible.builtin.constructed
keyed_groups:
- key: os
default_value: "fedora"
prefix: host
- key: invalid_var | default(None)
prefix: none_test
default_value: default_value
- key: '""'
prefix: empty_test
default_value: default_value | unknown | github | https://github.com/ansible/ansible | test/integration/targets/inventory_constructed/keyed_group_str_default_value.yml |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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 | connect/api/src/main/java/org/apache/kafka/connect/data/ConnectSchema.java |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union, Iterable, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from .chat_completion_content_part_text_param import ChatCompletionContentPartTex... | python | github | https://github.com/openai/openai-python | src/openai/types/chat/chat_completion_assistant_message_param.py |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db.models import get_model
from django.forms import widgets
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from cms.utils.compat.dj import python_2_unicode_compatible
from cmsplugin_cascade... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python2.3
from graph import Graph, Vertex, DummyVertex, Edge, SuperEdge
from camera import Camera, OrthoCamera, X_AXIS, Y_AXIS, Z_AXIS
from graph.defs import *
# Format Information for formatmanager
# name is the name of the format displayed in the open/import and save/export
# dialogs. If not specified, ... | 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... | json | github | https://github.com/apache/kafka | clients/src/main/resources/common/message/StopReplicaResponse.json |
import django
django.setup()
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
import logging
from dateutil.parser import parse
from datetime import datetime, timedelta
from django.utils import timezone
from osf.models import AbstractNode, Preprint
from website.app import init_... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# 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 version.
#
# This program is distributed in the hope that... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Andrew Bogott for the Wikimedia 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 requi... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='undoing resolution'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
check_resolve_undo () {
msg=$1
shift
while case $# in
0) break ;;
1|2|3) die "Bug in check-resolve-undo test" ;;
esac
do
path=$1
shift
for stage in 1 2 3... | unknown | github | https://github.com/git/git | t/t2030-unresolve-info.sh |
# $Id: manpage.py 5503 2008-01-17 07:22:22Z grubert $
# Author: Engelbert Gruber <grubert@users.sourceforge.net>
# Copyright: This module is put into the public domain.
"""
Simple man page writer for reStructuredText.
Man pages (short for "manual pages") contain system documentation on unix-like
systems. The pages ar... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime
import re
import random
import asyncio
import functools
import urllib.parse
import requests
from cloudbot import hook
from cloudbot.util import timeformat, formatting
reddit_re = re.compile(r'.*(((www\.)?reddit\.com/r|redd\.it)[^ ]+)', re.I)
base_url = "http://reddit.com/r/{}/.json"
sh... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLINFO_SIZE_UPLOAD_T
Section: 3
Source: libcurl
See-also:
- CURLINFO_SIZE_DOWNLOAD_T (3)
- CURLINFO_SIZE_UPLOAD (3)
- curl_easy_getinfo (3)
- curl_easy_setopt (3)
Protocol:
- All
Added-in: 7.55.0
---
# NAME
... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md |
# 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 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 = ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, 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 ... | unknown | codeparrot/codeparrot-clean | ||
//===--- AccessNotes.h - Access Notes ---------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 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/AST/AccessNotes.h |
# strategy_best3.py
# Strategy pattern -- function-based implementation
# selecting best promotion from imported module
"""
>>> from promotions import *
>>> joe = Customer('John Doe', 0)
>>> ann = Customer('Ann Smith', 1100)
>>> cart = [LineItem('banana', 4, .5),
... LineItem('apple', 10, 1... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class L10nBrAccountNfeExport(models.TransientModel):
""" Exportar Nota Fiscal Eletrônica """
_name = 'l10n_br_account_product.nfe_export... | unknown | codeparrot/codeparrot-clean | ||
"""
A series of tests to establish that the command-line management tools work as
advertised - especially with regards to the handling of the
DJANGO_SETTINGS_MODULE and default settings.py files.
"""
import codecs
import os
import re
import shutil
import socket
import subprocess
import sys
import tempfile
import unitte... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright 2018 The Tulsi 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 requi... | 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 | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_CORE_DETAILS_EXCEPTION_PTR_H
#define OPENCV_CORE_DETAILS_EXCEPTION_PTR_H
#ifndef CV__EXCEPTION_PTR
# if defi... | unknown | github | https://github.com/opencv/opencv | modules/core/include/opencv2/core/detail/exception_ptr.hpp |
# 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
# distributed under the... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settin... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding=utf-8
#
# Copyright (c) 2016 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of c... | unknown | codeparrot/codeparrot-clean | ||
#
# Collective Knowledge (Grigori's misc research functions)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updat... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009 The Closure Library 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 | ||
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class TestURLIE(InfoExtractor):
""" Allows addressing of the test cases as test:yout.*be_1 """
IE_DESC = False # Do not list
_VALID_URL = r'test(?:url)?:(?P<id>(?P<extractor>.+?)(?:_(?... | unknown | codeparrot/codeparrot-clean | ||
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
'pyramid',
'SQLAlchemy',
'transaction',
'pyramid_tm',
'pyramid_debugt... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from __future__ import absolute_import
from requests.exceptions import ConnectionError, SSLError
import logging
import os
import re
import six
from .. import config
from ..project import Project
from ..service import ConfigError
from .docopt_command import DocoptCommand
from .ut... | unknown | codeparrot/codeparrot-clean | ||
""" A wrapper for the 'gpg' command::
Portions of this module are derived from A.M. Kuchling's well-designed
GPG.py, using Richard Jones' updated version 1.3, which can be found
in the pycrypto CVS repository on Sourceforge:
http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py
This module is *not* forward-... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! Compile-time and runtime types for Tauri plugins.
#[cfg(feature = "build")]
pub use build::*;
#[cfg(feature = "build")]
mod build {
use std::{
env::vars_os,
fs,
... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-utils/src/plugin.rs |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | 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/context/properties/bind/validation/OriginTrackedFieldError.java |
# -*- encoding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / / / / /... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* gindesc.c
* rmgr descriptor routines for access/transam/gin/ginxlog.c
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFI... | c | github | https://github.com/postgres/postgres | src/backend/access/rmgrdesc/gindesc.c |
# Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python2.5
# Copyright 2010 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 or ... | 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... | json | github | https://github.com/apache/kafka | clients/src/main/resources/common/message/AssignReplicasToDirsResponse.json |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an... | python | github | https://github.com/ansible/ansible | lib/ansible/playbook/play.py |
# ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | 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.http
import io.ktor.util.*
import kotlin.js.*
private fun locationOrigin(): String = js(
"""function() {
var tmpLocation = null
if (typeof window !== 'undefined')... | kotlin | github | https://github.com/ktorio/ktor | ktor-http/web/src/io/ktor/http/URLBuilder.web.kt |
/*
* 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/core/expressions/expressionsbeandef/ShapeGuess.java |
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | unknown | codeparrot/codeparrot-clean | ||
import os
import tempfile
from ansible.compat.tests import unittest
from ansible.module_utils._text import to_bytes
from ansible.modules.system.known_hosts import compute_diff
class KnownHostsDiffTestCase(unittest.TestCase):
def _create_file(self, content):
tmp_file = tempfile.NamedTemporaryFile(prefix=... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 | ||
# -*- test-case-name: twisted.test.test_digestauth -*-
# Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Calculations for HTTP Digest authentication.
@see: U{http://www.faqs.org/rfcs/rfc2617.html}
"""
from twisted.python.hashlib import md5, sha1
# The digest math
algorithms = {
'... | unknown | codeparrot/codeparrot-clean | ||
use actix_web::{http::StatusCode, ResponseError};
use derive_more::Display;
/// Errors which can occur when serving static files.
#[derive(Debug, PartialEq, Eq, Display)]
pub enum FilesError {
/// Path is not a directory.
#[allow(dead_code)]
#[display("path is not a directory. Unable to serve static files"... | rust | github | https://github.com/actix/actix-web | actix-files/src/error.rs |
# coding: utf-8
import re
import csv
from urllib.parse import urlparse, parse_qs
import requests
from pyquery import PyQuery as pq
import twins.kdb
from twins.misc import get_nendo
TWINS_URL = "https://twins.tsukuba.ac.jp/campusweb/campussquare.do"
class AuthError (Exception):
pass
class RequestError (Exception... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2014-11-18 21:03:22
import os
import re
import time
import json
import shutil
import unittest
from pyspider import run
from pyspider.libs import utils
f... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase, override_settings, Client
from django.utils.translation import override
@override_settings(ROOT_URLCONF="view_tests.urls")
class CsrfViewTests(TestCase):
def setUp(self):
super(CsrfViewTests, self).setUp()
self.client = Client(enforce_csrf_checks=True)
@overr... | unknown | codeparrot/codeparrot-clean | ||
from nose.tools import *
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from website import settings
from website.addons.base import AddonConfig
from website.addons.base import AddonOAuthNodeSettingsBase
from website.addons.base import AddonOAuthUserSettingsBase
from website.oa... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class Student < ActiveRecord::Base
has_and_belongs_to_many :lessons
belongs_to :college
end | ruby | github | https://github.com/rails/rails | activerecord/test/models/student.rb |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: logutil.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _m... | unknown | codeparrot/codeparrot-clean | ||
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | unknown | codeparrot/codeparrot-clean | ||
"""Implementation of magic functions related to History.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012, IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with th... | unknown | codeparrot/codeparrot-clean | ||
import gc
import unittest
from markupsafe import Markup, escape
class MarkupTestCase(unittest.TestCase):
def test_markup_operations(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="application/x-some-script">alert("foo");</script>'
safe = Markup('<em>usernam... | unknown | codeparrot/codeparrot-clean | ||
################################################################################
# Deploy Debian package to jenkins build system(s)
#
# Usage examples:
# % fab all
# % fab build && fab deploy
# % fab -H root@jenkins.example.org deploy
################################################################################
fro... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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 3 of the Lice... | unknown | codeparrot/codeparrot-clean | ||
from os.path import join
from numpy.distutils.system_info import get_info, get_standard_file, \
BlasNotFoundError
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('utils', parent_package, top_path)
config... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2023 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
set -xeuo pipefail
output_json_file="$1"
packages="$2"
if [ -z "${packages}" ]; then
echo "No packages; skipping"
touch "${output_json_file}"
ex... | unknown | github | https://github.com/cockroachdb/cockroach | build/ghactions/pr-codecov-run-tests.sh |
# Copyright 2022 The OpenBMB Team and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | python | github | https://github.com/huggingface/transformers | src/transformers/models/cpmant/configuration_cpmant.py |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python3
# SPDX-License-Identifier: GPL-2.0
# Author: Julian Sun <sunjunchao2870@gmail.com>
""" Find macro definitions with unused parameters. """
import argparse
import os
import re
parser = argparse.ArgumentParser()
parser.add_argument("path", type=str, help="The file or dir path that needs check")
pars... | python | github | https://github.com/torvalds/linux | scripts/macro_checker.py |
<?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\Test\Re... | php | github | https://github.com/composer/composer | tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php |
"""
Mercurial
=========
This module provides high-level tools for managing `Mercurial`_ repositories.
.. _Mercurial: http://mercurial.selenic.com/
"""
from fabric.api import run
from fabtools import mercurial
from fabtools.files import is_dir
from fabtools.system import UnsupportedFamily
def command():
"""
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Direct unit tests for L{twisted.trial.unittest.TestCase}.
"""
from twisted.trial.unittest import TestCase
class TestCaseTests(TestCase):
"""
L{TestCase} tests.
"""
class MyTestCase(TestCase):
"""
Some test met... | unknown | codeparrot/codeparrot-clean | ||
test_kind: py_test
selector:
roots:
- buildscripts/tests/resmoke_end2end/failtestfiles/*.py
executor: {} | unknown | github | https://github.com/mongodb/mongo | buildscripts/tests/resmoke_end2end/suites/resmoke_failing_python.yml |
"""
Django settings for test_auth project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | unknown | codeparrot/codeparrot-clean | ||
name: test-e2e-project-reset-cron
on:
# Run every Sunday at 5AM UTC
schedule:
- cron: '0 5 * * 0'
# Allow manual triggering for emergency resets
workflow_dispatch:
env:
VERCEL_TEST_TEAM: vtest314-next-e2e-tests
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_ADAPTER_TEST_TEAM: vtest314-ne... | unknown | github | https://github.com/vercel/next.js | .github/workflows/test_e2e_project_reset_cron.yml |
class Cartridge:
def __init__(self):
self.banks = {}
self.bank_id = 0
self.pc = 0
self.inespgr = 1
self.ineschr = 1
self.inesmap = 1
self.inesmir = 1
self.rs = 0
self.path = ''
def nes_id(self):
# NES
return [0x4e, 0x45, 0... | unknown | codeparrot/codeparrot-clean | ||
#if !canImport(Darwin)
import Dispatch
#endif
import Foundation
import Vapor
import VaporTestUtils
import XCTest
import XCTVapor
import AsyncHTTPClient
import NIOCore
import NIOFoundationCompat
import NIOPosix
import NIOConcurrencyHelpers
import NIOHTTP1
import NIOSSL
import Atomics
import X509
import SwiftASN1
final ... | swift | github | https://github.com/vapor/vapor | Tests/VaporTests/ServerTests.swift |
from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_almost_equal,
assert_raises, assert_array_equal
)
# Test data
_ndat = np.array([[0.6244, np.nan, 0.2692, 0.0116, np.nan... | unknown | codeparrot/codeparrot-clean | ||
package system
import (
"context"
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/containerd/log"
"github.com/golang/gddo/httputil"
"github.com/moby/moby/api/pkg/authconfig"
"github.com/moby/moby/api/types"
"github.com/moby/moby/api/types/events"
"github.com/moby/moby/api/types/registry"
"github.com/m... | go | github | https://github.com/moby/moby | daemon/server/router/system/system_routes.go |
from __future__ import absolute_import, division, unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from debug_toolbar.panels import Panel
from debug_toolbar import settings as dt_settings
import cProfile
from pstats import Stats
from colorsys impor... | unknown | codeparrot/codeparrot-clean | ||
# th.po
val = {" days." : "",
"(all)" : "",
"(any)" : "",
"(anyone)" : "(ไม่มี)",
"(available)" : "",
"(blank)" : "",
"(both)" : "",
"(everyone)" : "",
"(master user, not editable)" : "",
"(no change)" : "",
"(no deduction)" : "",
"(none)" : "(ไม่มี)",
"(unkn... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (C) 2014 The Android Open Source Project
#
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.