code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import { type CompilerError, compile } from '../../src'
import { isValidHTMLNesting } from '../../src/htmlNesting'
describe('validate html nesting', () => {
it('should warn with p > div', () => {
let err: CompilerError | undefined
compile(`<p><div></div></p>`, {
onWarn: e => (err = e),
})
expec... | typescript | github | https://github.com/vuejs/core | packages/compiler-dom/__tests__/transforms/validateHtmlNesting.spec.ts |
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Example**
```esql
ROW words="foo;bar;baz;qux;quux;corge"
| EVAL word = SPLIT(words, ";")
```
| words:keyword | word:keyword |
| --- | --- |
| foo;bar;baz;qux;quux;corge | [foo,bar,baz,qux,quux,corge] ... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/examples/split.md |
import copy
import sys
import subprocess
from subprocess import PIPE
from pprint import pprint
class FrameworkTestType:
'''Interface between a test type (json, query, plaintext, etc) and
the rest of TFB. A test type defines a number of keys it expects
to find in the benchmark_config.json, and this base class ha... | unknown | codeparrot/codeparrot-clean | ||
/*
* This file contains generation code for distribution that have been modified
* since Generator was introduced. These are preserved using identical code
* to what was in NumPy 1.16 so that the stream of values generated by
* RandomState is not changed when there are changes that affect Generator.
*
* These fun... | c | github | https://github.com/numpy/numpy | numpy/random/src/legacy/legacy-distributions.c |
# Copyright 2015, 2018 IBM Corp.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | unknown | codeparrot/codeparrot-clean | ||
"""MH interface -- purely object-oriented (well, almost)
Executive summary:
import mhlib
mh = mhlib.MH() # use default mailbox directory and profile
mh = mhlib.MH(mailbox) # override mailbox location (default from profile)
mh = mhlib.MH(mailbox, profile) # override mailbox and profile
mh.error(format, ...)... | unknown | codeparrot/codeparrot-clean | ||
import parsimonious
class EncodingError(Exception):
"""
Base exception for any error that occurs during encoding.
"""
pass
class EncodingTypeError(EncodingError):
"""
Raised when trying to encode a python value whose type is not supported for
the output ABI type.
"""
pass
class Il... | unknown | codeparrot/codeparrot-clean | ||
# crpyt: toy cryptographic python library
# Copyright (C) 2014 Quentin SANTOS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2016 Red Hat Inc.
#
# Copyright (c) 2017 Dell Inc.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2012 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | java | github | https://github.com/google/guava | guava/src/com/google/common/util/concurrent/RateLimiter.java |
# This is the rules file. It has an extra "ownership"
# field in the second group. promtool should ignore this field
# and not return an error with --ignore-unknown-fields.
groups:
- name: alerts
namespace: "foobar"
rules:
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
... | unknown | github | https://github.com/prometheus/prometheus | cmd/promtool/testdata/rules_extrafields.yml |
'''
Test single immediate client hello hook
'''
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
let shouldBeKept = 'should be kept'
export async function keep() {
console.log(shouldBeKept)
}
let shouldBeRemoved = 'should be removed'
export function removeFunction() {
console.log(shouldBeRemoved)
}
export let removeVarDeclaration = 'should be removed'
export let removeVarDeclarationUndefined // should also b... | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/shake-exports/most-usecases/input.js |
# Angular DevTools
Angular DevTools is a browser DevTools extension for debugging and profiling Angular applications.
## Developing Locally
<!-- This duplicates some general content for setting up the angular/angular repository, however it is important to
have complete instructions here for Mozilla Add-On revie... | unknown | github | https://github.com/angular/angular | devtools/README.md |
# -*- coding: utf-8 -*-
"""Utils functions."""
import sys
from functools import wraps
import numpy
def unexpected_value(x):
"""Define supspicious values."""
return (x is None) or x > 1.e4 or x == 0 or numpy.isnan(x)
def dump_on_fail(fp=sys.stdout):
"""Dump args for unexpected results to `fp`.
Parame... | unknown | codeparrot/codeparrot-clean | ||
import h5py
import os
import numpy as np
from sys import argv
from stereo_processing import align_audio, downsize
path = '/Volumes/seagate/legit_data/'
current_path = os.getcwd()+'/'
print "opening main file"
with h5py.File(current_path+argv[1], 'r') as main_data:
main_audio = main_data['audio'].value
main_depth = m... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""sslstrip is a MITM tool that implements Moxie Marlinspike's SSL stripping attacks."""
__author__ = "Moxie Marlinspike"
__email__ = "moxie@thoughtcrime.org"
__license__= """
Copyright (c) 2004-2009 Moxie Marlinspike <moxie@thoughtcrime.org>
This program is free software; you can redistribute... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package statemgr
import (
"fmt"
"github.com/hashicorp/terraform/internal/states"
"github.com/hashicorp/terraform/internal/states/statefile"
)
// PlannedStateUpdate is a special helper to obtain a statefile representation
// of a not-yet-writte... | go | github | https://github.com/hashicorp/terraform | internal/states/statemgr/plan.go |
# Copyright 2025 Deepseek AI and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | python | github | https://github.com/huggingface/transformers | src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py |
/*
Copyright 2022 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/kubelet/nodeshutdown/storage.go |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/OpensslSm4CtrCryptoCodec.java |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromium presubmit script for src/base.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! The singleton async runtime used by Tauri and exposed to users.
//!
//! Tauri uses [`tokio`] Runtime to initialize code, such as
//! [`Plugin::initialize`](../plugin/trait.Pl... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri/src/async_runtime.rs |
#!/usr/bin/env python
#
# Copyright 2008, 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2010 Collabora Ltd.
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
import gambit
import warnings
from nose.tools import assert_raises
class TestGambitStrategies(object):
def setUp(self):
self.game = gambit.Game.new_table([2,2])
self.game.players[0].label = "Alphonse"
self.game.players[1].label = "Gaston"
def tearDown(self):
del self.game
... | unknown | codeparrot/codeparrot-clean | ||
"""
This script will generate input-out plots for all of the activation
functions. These are for use in the documentation, and potentially in
online tutorials.
"""
from pathlib import Path
import matplotlib
from matplotlib import pyplot as plt
import torch
matplotlib.use("Agg")
# Create a directory for the images,... | python | github | https://github.com/pytorch/pytorch | docs/source/scripts/build_activation_images.py |
/* MIT License
*
* Copyright (c) 1998 Massachusetts Institute of Technology
* Copyright (c) The c-ares project and its 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 wi... | c | github | https://github.com/nodejs/node | deps/cares/src/tools/ahost.c |
"""
This is used to test the ElasticSearchDB module. It is used to discover all possible changes of Elasticsearch api.
If you modify the test data, you have to update the test cases...
"""
import unittest
import datetime
import time
from DIRAC import gLogger
from DIRAC.Core.Utilities.El... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.internal
internal actual typealias ReentrantLock = NoOpLock
internal actual inline fun <T> ReentrantLock.withLock(action: () -> T) = action()
internal class NoOpLock {
fun tryLock() = true
fun unlock(): Unit {}
}
internal actual fun <E> identitySet(expectedSize: Int): MutableSet<E... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jsAndWasmShared/src/internal/Concurrent.kt |
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.engine.darwin
import io.ktor.client.engine.*
import io.ktor.client.engine.darwin.internal.*
import io.ktor.client.plugins.*
import io.ktor.client.plugins.sse.*
import i... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/DarwinClientEngine.kt |
import wx
import os
from my_io import Io
from VizFrame import VizFrame
from EditTable import EditFrame, Table
from dialogs import ParameterDialog, ChoiceDialog, RemoteProcessDialog
from numpy import array, where, greater, log10, log, clip, take, argsort, arcsinh, min, max, savetxt, loadtxt
from numpy.random import shuf... | 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/DescribeLogDirsResponse.json |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/colqwen2/__init__.py |
import * as ActionCable from "../../../../app/javascript/action_cable/index"
export const testURL = "ws://cable.example.com/"
export function defer(callback) {
setTimeout(callback, 1)
}
const originalWebSocket = ActionCable.adapters.WebSocket
QUnit.testDone(() => ActionCable.adapters.WebSocket = originalWebSocket) | javascript | github | https://github.com/rails/rails | actioncable/test/javascript/src/test_helpers/index.js |
#!/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 distribut... | unknown | codeparrot/codeparrot-clean | ||
"""
# Copyright (C) 2007 Rob King (rob@re-mu.org)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This li... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2003-2004 The Regents of The University of Michigan
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
from django.utils.translation import ugettext_lazy as _
from satchmo.configuration import *
SHIP_MODULES = config_get('SHIPPING', 'MODULES')
SHIP_MODULES.add_choice(('satchmo.shipping.modules.ups', 'UPS'))
SHIPPING_GROUP = ConfigurationGroup('satchmo.shipping.modules.ups',
_('UPS Shipping Settings'),
requires... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-07-10 22:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Widgets',... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pipe2py.lib.utils
~~~~~~~~~~~~~~~~~
Utility functions
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import sys, logging
class LogFilter(logging.Filter):
"""Filters (lets through... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.algebra
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for computer algebra systems.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from py... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 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 ... | unknown | codeparrot/codeparrot-clean | ||
# @vue/compiler-ssr | unknown | github | https://github.com/vuejs/core | packages/compiler-ssr/README.md |
#!/usr/bin/env python
#
# Copyright 2014 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All cont... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import division
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jai Ram Rideout"
__email__ = "jai.rideout@gmail.com"
"""Test suite for the remote.p... | 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 ... | unknown | github | https://github.com/apache/kafka | .github/workflows/docker_rc_release.yml |
#!/usr/bin/python2.7
# Copyright 2011 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 requi... | unknown | codeparrot/codeparrot-clean | ||
# Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
import Queue
import time
import unittest
from test import test_support
#threading = test_support.import_module('threading')
import threading
QUEUE_SIZE = 5
# A thread to run a function that unclogs a blocked Queu... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
# Author: Gilbert Brietzke
# Date: July 2, 2019
from spack import *
class Asagi(CMakePackage):
"""a pArallel Server ... | unknown | codeparrot/codeparrot-clean | ||
base_suite: sharding
overrides:
- "execution_control_params.enable_prioritization_testdata_parameter" | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/sharding_execution_control_with_prioritization.yml |
# encoding:utf-8
#
# gPrime - A web-based genealogy program - Records plugin
#
# Copyright (C) 2008-2011 Reinhard Müller
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2012 Brian G. Matherly
# Copyright (C) 2013-2016 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# i... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 | ||
from Screen import Screen
from Screens.ParentalControlSetup import ProtectedScreen
from enigma import eConsoleAppContainer, eDVBDB
from Components.ActionMap import ActionMap, NumberActionMap
from Components.config import config, ConfigSubsection, ConfigText
from Components.PluginComponent import plugins
from Component... | unknown | codeparrot/codeparrot-clean | ||
# window.py
"""
Abstracts a GUI window
"""
from tkinter import *
class Window(Tk):
def __init__(self):
self.initgui()
def initgui():
"""
Defined in subclasses
"""
pass
# sortsgui.py
"""
Sorts GUI interface
"""
from window import *
class SortsGui(Window):
"""
Sort... | 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.client.tests.plugins
import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.plugins.*
import io.ktor.client.plugins.cookies.*
import io.ktor.client.request... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-tests/common/test/io/ktor/client/tests/plugins/CookiesIntegrationTests.kt |
/*
* GIT - The information manager from hell
*
* Copyright (C) Linus Torvalds, 2005
*/
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "object-name.h"
#include "odb.h"
#include "tree.h"
#include "path.h"
#include "... | c | github | https://github.com/git/git | builtin/ls-tree.c |
// Copyright The Prometheus 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 w... | go | github | https://github.com/prometheus/prometheus | discovery/zookeeper/zookeeper.go |
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
from trytond.pyson import Eval
from trytond.pool import PoolMeta
from . import luhn
__all__ = ['Address']
__metaclass__ = PoolMeta
class Addr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 | ||
#!/usr/bin/env python
"""
This script generated test_cases for test_distribution_version.py.
To do so it outputs the relevant files from /etc/*release, the output of distro.linux_distribution()
and the current ansible_facts regarding the distribution version.
This assumes a working ansible version in the path.
"""
... | python | github | https://github.com/ansible/ansible | hacking/tests/gen_distribution_version_testcase.py |
from urlparse import urlparse
import time
import traceback
import re
from couchpotato.core.helpers.encoding import tryUrlencode, toUnicode
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import cleanHost, splitString, tryInt
from couchpotato.core.logger import CPLog
from couchpotato... | unknown | codeparrot/codeparrot-clean | ||
#########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | 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 | buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuilderMetadata.java |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Heatmap.py
---------------------
Date : November 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
********************... | 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 ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/SafeMode.java |
"""Use the Doctest plugin with ``--with-doctest`` or the NOSE_WITH_DOCTEST
environment variable to enable collection and execution of :mod:`doctests
<doctest>`. Because doctests are usually included in the tested package
(instead of being grouped into packages or modules of their own), nose only
looks for them in the ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use crate::{
bundle::{
settings::Arch,
windows::{
sign::{should_sign, sign_command, try_sign},
util::{
download_webview2_bootstrapper, download_webv... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-bundler/src/bundle/windows/nsis/mod.rs |
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.preprocessing import sequence
from keras.optimizers import RMSprop
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
... | unknown | codeparrot/codeparrot-clean | ||
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashb... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/testdata/output/latest_version/v16.grid_layout_upgrade.v42.json |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_allclose
from astropy.utils.compat.optional_deps import HAS_PLT, HAS_SCIPY
if HAS_PLT:
import matplotlib.pyplot as plt
import pytest
import numpy as np
from astropy.visualization import hist
from astropy.stats impor... | unknown | codeparrot/codeparrot-clean | ||
/*
* Loongson MMI optimizations for libjpeg-turbo
*
* Copyright (C) 2014-2015, 2018-2019, D. R. Commander. All Rights Reserved.
* Copyright (C) 2016-2018, Loongson Technology Corporation Limited, BeiJing.
* All Rights Reserved.
* Authors: LiuQingfa <liuqingfa-hf@loongson.cn>
*
* Based... | c | github | https://github.com/opencv/opencv | 3rdparty/libjpeg-turbo/simd/mips64/jidctfst-mmi.c |
import { DEV } from 'esm-env';
import { state, increment } from '../internal/client/reactivity/sources.js';
import { tag } from '../internal/client/dev/tracing.js';
import { get } from '../internal/client/runtime.js';
import { get_current_url } from './url.js';
export const REPLACE = Symbol();
/**
* A reactive versi... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/reactivity/url-search-params.js |
#!/usr/bin/env python
# File: plot_histograms3.py
# Created on: Mon Aug 20 22:14:33 2012
# Last Change: Mon Oct 22 09:54:21 2012
# Purpose of script: <+INSERT+>
# Author: Steven Boada
import pylab as pyl
from mk_galaxy_struc import mk_galaxy_struc
galaxies = mk_galaxy_struc()
verylow =[]
low =[]
med=[]
high=[]
appen... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=E1103, E1101
import copy
import logging
import re
from datetime import datetime
from pytz import UTC
from django.conf import settings
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from django_comment_common.models import assign_default_role
from djan... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for util.db module."""
import threading
import time
import unittest
import ddt
from django.contrib.auth.models import User
from django.core.management import call_command
from django.db import IntegrityError, connection
from django.db.transaction import TransactionManagementError, atomic
from django.test imp... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from pychbase._pychbase import _connection, _table
from pychbase import Connection, Table, Batch
from StringIO import StringIO
from config import ZOOKEEPERS, TABLE_NAME
from datetime import datetime
class TestCConnection(unittest.TestCase):
def test_bad_cldbs(self):
# Cloudera struggles wit... | unknown | codeparrot/codeparrot-clean | ||
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | unknown | codeparrot/codeparrot-clean | ||
"""
Opal permissions
"""
import opal.core
SUBJECT_TYPES = ('USER', 'GROUP')
def add_permission_arguments(parser, permissions):
"""
Add permission arguments
"""
parser.add_argument('--add', '-a', action='store_true', help='Add a permission')
parser.add_argument('--delete', '-d', action='store_true... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Erkan Ozgur Yilmaz
#
# This module is part of oyProjectManager and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import os
import PeyeonScript
from oyProjectManager import utils
from oyProjectManager.models.entity import Envir... | unknown | codeparrot/codeparrot-clean | ||
"""
Unit tests for stub HTTP server base class.
"""
import unittest
import requests
import json
from terrain.stubs.http import StubHttpService, StubHttpRequestHandler, require_params
class StubHttpServiceTest(unittest.TestCase):
def setUp(self):
super(StubHttpServiceTest, self).setUp()
self.serve... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from .chat_session import ChatSession as ChatSession
from .chatkit_thread import ChatKitThread as ChatKitThread
from .chatkit_attachment import ChatKitAttachment as ChatKitAttachment
from .thread_l... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/chatkit/__init__.py |
# Author: Robert McGibbon <rmcgibbo@gmail.com>
# Contributors:
# Copyright (c) 2014, Stanford University and the Authors
# All rights reserved.
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019 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.
package cgotest
import (
"internal/syscall/windows"
"syscall"
"testing"
)
var syscall_dot_SIGCHLD syscall.Signal
// usesUCRT reports whether the test is u... | go | github | https://github.com/golang/go | src/cmd/cgo/internal/test/test_windows.go |
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
"""
=========================================
Plot Hierarchical Clustering Dendrogram
=========================================
This example plots the corresponding dendrogram of a hierarchical clustering
using AgglomerativeClustering and t... | python | github | https://github.com/scikit-learn/scikit-learn | examples/cluster/plot_agglomerative_dendrogram.py |
# -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from collections import Mapping
from jinja2.runtime import Undefined
from jinja2._compat impor... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright (c) 2013, 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 (includ... | c | github | https://github.com/mysql/mysql-server | sql/trigger_def.h |
import logging
import os
import sys
import subprocess
import time
_suffixes = [
[("k", "kb"), 0],
[("m", "mb"), 0],
[("g", "gb"), 0],
[("t", "tb"), 0],
]
log = logging.getLogger(__name__)
for i, s in enumerate(_suffixes):
if i == 0:
s[1] = 1024
else:
s[1] = _suffixes[i-1][1] * 1024
def human_size(size):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#
# This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Damien P. George
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | unknown | codeparrot/codeparrot-clean | ||
import operator
import functools
import random
import datetime
dbg = True
def debug_print(*args, **kwargs):
if dbg:
print(*args, **kwargs)
class Candidate:
def __init__(self, content, fitness_=None):
# ctor
self.content = content[0:10]
if fitness_ is not None:
self... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2023 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/core/tfrt/utils/debug/node_io_dump_rewriter.h |
/*
* 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/errors/StaleBrokerEpochException.java |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-15, 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 pro... | unknown | codeparrot/codeparrot-clean | ||
# Module wordnet.py
#
# Original author: Oliver Steele <steele@osteele.com>
# Project Page: http://sourceforge.net/projects/pywordnet
#
# Copyright (c) 1998-2004 by Oliver Steele. Use is permitted under
# the Artistic License
# <http://www.opensource.org/licenses/artistic-license.html>
"""An OO interface to the WordN... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (c) 2011 Thomas Rampelberg
#
"""Making cross-domain requests easy on the server (for tornado).
Here's a canonical use of janky.post in Tornado:
import janky_post.tornado_handler
import tornado.ioloop
import tornado.web
class MainHandler(janky_post.tornado_handler.Handler):
def ... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from email import _encoded_words as _ew
from email import errors
from test.test_email import TestEmailBase
class TestDecodeQ(TestEmailBase):
def _test(self, source, ex_result, ex_defects=[]):
result, defects = _ew.decode_q(source)
self.assertEqual(result, ex_result)
self.as... | python | github | https://github.com/python/cpython | Lib/test/test_email/test__encoded_words.py |
<?php
namespace Illuminate\Pipeline;
use Closure;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Pipeline\Hub as HubContract;
class Hub implements HubContract
{
/**
* The container implementation.
*
* @var \Illuminate\Contracts\Container\Container|null
*/
protected... | php | github | https://github.com/laravel/framework | src/Illuminate/Pipeline/Hub.php |
# Copyright 2014 Michael Rice <michael@michaelrice.org>
#
# 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 app... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.