code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""
X11 colors.
A simple name to hex and hex to name map of X11 colors.
"""
name2hex_map = {
"black": "#000000",
"aliceblue": "#f0f8ff",
"blueviolet": "#8a2be2",
"cadetblue": "#5f9ea0",
"cadetblue1": "#98f5ff",
"cadetblue2": "#8ee5ee",
"cadetblue3": "#7ac5cd",
"cadetblue4": "#53868b",
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
@package mi.dataset.parser.test
@fid marine-integrations/mi/dataset/parser/test/test_dosta_ln_auv.py
@author Jeff Roy
@brief Test code for a dosta_ln_auv data parser
"""
import os
from nose.plugins.attrib import attr
from mi.core.exceptions import RecoverableSampleException, SampleEncodin... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
#
# Copyright (c) 2008 Dmitry V. Levin
#
test_description='fetch exit status test'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
test_expect_success setup '
>file &&
git add file &&
git commit -m initial &&
git checkout -b side &&
echo side >f... | unknown | github | https://github.com/git/git | t/t5518-fetch-exit-status.sh |
/* 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/compiler/mlir/quantization/tensorflow/python/unfreeze_constants.h |
from array import array
from copy import deepcopy
from PIL import Image
from coilsnake.exceptions.common.exceptions import InvalidArgumentError, OutOfBoundsError, InvalidUserDataError
from coilsnake.model.eb.blocks import EbCompressibleBlock
from coilsnake.model.eb.palettes import EbPalette, EbColor
from coilsnake.ut... | unknown | codeparrot/codeparrot-clean | ||
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
#
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
""" unit tests for the model and descriptor packager """
from rdkit import RDConfig
from rdkit.ML.Data import DataUtils
import unittest,os,sys
from rdkit.six.moves import cPickle
fr... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Base script for doing test setup."""
import logging
import os
from pylib import constants
from pylib import valgrind_tools
from pylib.constants impo... | 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)
from spack import *
class Libfabric(AutotoolsPackage):
"""The Open Fabrics Interfaces (OFI) is a framework focused on... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 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/compiler/mlir/tensorflow/transforms/collection_ops_util.h |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from mailchimp.exceptions import MailchimpWarning
import warnings
API_KEY = getattr(settings, 'MAILCHIMP_API_KEY', None)
if API_KEY is None:
raise ImproperlyConfigured('django-mailchimp requires the MAILCHIMP_API_KEY setting')... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2012 New Dream Network (DreamHost)
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
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... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java |
from __future__ import print_function
from math import floor
import numpy as np
import math
A = np.array
from mpl_toolkits.axisartist.grid_finder import ExtremeFinderSimple
def select_step_degree(dv):
degree_limits_ = [1.5, 3, 7, 13, 20, 40, 70, 120, 270, 520]
degree_steps_ = [ 1, 2, 5, 10, 15, 30, 45, ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2011 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.
import os
import sys
import unittest
import pyauto_functional
from pyauto import PyUITest
class ExecuteJavascriptTest(PyUITest):
... | unknown | codeparrot/codeparrot-clean | ||
def gen():
yield 1
yield 2
yield 3
yield 4
def gen2():
yield -1
print((yield from gen()))
yield 10
yield 11
g = gen2()
print(next(g))
print(next(g))
g.close()
try:
print(next(g))
except StopIteration:
print("StopIteration")
# Now variation of same test, but with leaf generator... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2020 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 runtime_test
import (
"internal/testenv"
"os/exec"
"strings"
"testing"
)
func TestCheckPtr(t *testing.T) {
// This test requires rebuilding packa... | go | github | https://github.com/golang/go | src/runtime/checkptr_test.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 may n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/common/security/authenticator/TestJaasConfig.java |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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... | unknown | codeparrot/codeparrot-clean | ||
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: CmpImg.py 36560 2004-07-18 06:16:08Z tim_one $
#
# Tix Demostration Program
#
# This sample program is structured in such a way so that it can be
# executed from the Tix demo program "tixwidgets.py": it must have a
# procedure calle... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0
/*
* NETLINK Netlink attributes
*
* Authors: Thomas Graf <tgraf@suug.ch>
* Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
*/
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/jiffies.h>
#include <linux/nospec.h>
#include <linux/skb... | c | github | https://github.com/torvalds/linux | lib/nlattr.c |
import numpy as np
import numpy.testing as npt
import scipy.ndimage
from dipy.core.ndindex import ndindex
from dipy.tracking.local import (BinaryTissueClassifier,
ThresholdTissueClassifier,
ActTissueClassifier)
from dipy.tracking.local.localtracking imp... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
unified_strdate,
)
class MusicVaultIE(InfoExtractor):
_VALID_URL = r'https?://www\.musicvault\.com/(?P<uploader_id>[^/?#]*)/video/(?P<display_id>[^/?#]*)_(?P<id>[0-9]+)\.html'
_TE... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015 SONATA-NFV, UBIWHERE
# 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 app... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import sure # noqa
import moto.server as server
'''
Test the different server responses
'''
def test_s3_server_get():
backend = server.create_backend_app("s3bucket_path")
test_client = backend.test_client()
res = test_client.get('/')
res.data.should.contain(... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package audit
import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
)
// TestMetricLabelerAuditSink_Label ensures we always get the right label based
// on the input value of the error.
func TestMetricLabelerAuditSink_Label(t *test... | go | github | https://github.com/hashicorp/vault | audit/sink_metric_labeler_test.go |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Therp BV (<http://therp.nl>)
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2016 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 agre... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/graph/EndpointPairIterator.java |
/**
* \file sha512.h
* \brief This file contains SHA-384 and SHA-512 definitions and functions.
*
* The Secure Hash Algorithms 384 and 512 (SHA-384 and SHA-512) cryptographic
* hash functions are defined in <em>FIPS 180-4: Secure Hash Standard (SHS)</em>.
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-Lic... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/mbedtls/sha512.h |
import os
import subprocess
import shlex
import signal
import sys
import locale
from pexpect.popen_spawn import PopenSpawn
# Include `unicode` in STR_TYPES for Python 2.X
try:
STR_TYPES = (str, unicode)
except NameError:
STR_TYPES = (str, )
TIMEOUT = 30
class Command(object):
def __init__(self, cmd, ti... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""usage: %prog [options] filename
Parse a document to a tree, with optional profiling
"""
import sys
import os
import traceback
from optparse import OptionParser
from html5lib import html5parser, sanitizer
from html5lib.tokenizer import HTMLTokenizer
from html5lib import treebuilders, serializ... | unknown | codeparrot/codeparrot-clean | ||
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: ... | unknown | github | https://github.com/d3/d3 | .github/workflows/test.yml |
"""An object-oriented interface to .netrc files."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
import os, shlex
__all__ = ["netrc", "NetrcParseError"]
class NetrcParseError(Exception):
"""Exception raised on syntax errors in the .netrc file."""
def __init__(self, msg, filename=None, lineno=N... | unknown | codeparrot/codeparrot-clean | ||
import logging
import os
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.http import Http404
from readthedocs.projects.models import Project
import r... | unknown | codeparrot/codeparrot-clean | ||
# - coding: utf-8 -
# Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org>
# Copyright (C) 2007-2009 Toms Baugis <toms.baugis@gmail.com>
# This file is part of Project Hamster.
# Project Hamster is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
//! This module provides a data structure for a space-efficient and time-efficient lookup of
//! sequences of 16-bit ... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/icu_collections/src/char16trie/mod.rs |
#!/bin/bash
# Test full devcontainer setup using devcontainer CLI
# This simulates the complete user experience
set -euo pipefail
echo "========================================"
echo "Devcontainer Fresh Setup Test"
echo "========================================"
# Get the absolute path to the repo root (src director... | unknown | github | https://github.com/mongodb/mongo | evergreen/devcontainer_test.sh |
# this is a virtual module that is entirely implemented server side
# 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 op... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
import os
import sys
# load mod... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package providers
// Factory is a function type that creates a new instance of a resource
// provider, or returns an error if that is impossible.
type Factory func() (Interface, error)
// FactoryFixed is a helper that creates a Factory that just r... | go | github | https://github.com/hashicorp/terraform | internal/providers/factory.go |
// Copyright 2010 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 io
type eofReader struct{}
func (eofReader) Read([]byte) (int, error) {
return 0, EOF
}
type multiReader struct {
readers []Reader
}
func (mr *mul... | go | github | https://github.com/golang/go | src/io/multi.go |
<div
ngMenu
class="material-menu"
(mouseover)="hasInteracted.set(true)"
(focusin)="hasInteracted.set(true)"
>
<ng-template ngMenuContent>
<span id="security-label" class="heading">SECURITY</span>
<div role="group" aria-labelledby="security-label">
<div ngMenuItem value="Change password">
... | html | github | https://github.com/angular/angular | adev/src/content/examples/aria/menu/src/menu-standalone/material/app/app.html |
import numpy as np
from scipy.linalg import lu_factor, lu_solve
from scipy.sparse import issparse, csc_matrix, eye
from scipy.sparse.linalg import splu
from scipy.optimize._numdiff import group_columns
from .common import (validate_max_step, validate_tol, select_initial_step,
norm, EPS, num_jac, va... | unknown | codeparrot/codeparrot-clean | ||
# Authors: Alexandre Barachant <alexandre.barachant@gmail.com>
# Nicolas Barascud <nicolas.barascud@ens.fr>
#
# License: BSD (3-clause)
from datetime import datetime, timezone, timedelta
import os.path as op
import shutil
import pytest
from numpy.testing import (assert_array_almost_equal, assert_array_equal,... | unknown | codeparrot/codeparrot-clean | ||
"""Pop up a reminder of how to call a function.
Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import __main__
import inspect
import re
import sys
import text... | python | github | https://github.com/python/cpython | Lib/idlelib/calltip.py |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package transit
import (
"context"
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"encoding/hex"
"fmt"
"hash"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
"golang.org/x/crypto/sha3"
)
func (b *... | go | github | https://github.com/hashicorp/vault | builtin/logical/transit/path_hash.go |
class AlreadyThere(Exception):
pass
class CantFollowYourself(Exception):
pass
class DirectedGraph:
def __init__(self):
self.nodes = {}
def add_node(self, node):
if node in self.nodes.keys():
raise AlreadyThere
self.nodes[node] = set()
def add_edge(self, node_... | unknown | codeparrot/codeparrot-clean | ||
//! See docs in `build/expr/mod.rs`.
use rustc_abi::FieldIdx;
use rustc_hir::lang_items::LangItem;
use rustc_index::{Idx, IndexVec};
use rustc_middle::bug;
use rustc_middle::middle::region::{self, TempLifetime};
use rustc_middle::mir::interpret::Scalar;
use rustc_middle::mir::*;
use rustc_middle::thir::*;
use rustc_mi... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs |
#!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Test download.py
TODO(epoger): Create a command to update the expected results (in
self._output_dir_expected) when appropriate. For now, you should:
1. examine the resu... | unknown | codeparrot/codeparrot-clean | ||
"""Bigmem tests - tests for the 32-bit boundary in containers.
These tests try to exercise the 32-bit boundary that is sometimes, if
rarely, exceeded in practice, but almost never tested. They are really only
meaningful on 64-bit builds on machines with a *lot* of memory, but the
tests are always run, usually with ve... | python | github | https://github.com/python/cpython | Lib/test/test_bigmem.py |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | unknown | codeparrot/codeparrot-clean | ||
import BinaryTreeRepresentation
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
# Op1 O(n logn) -> O(n^2) 176ms
def buildTree(self, inorder, postorder):
"""
:type inorder: List[int]
:type... | unknown | codeparrot/codeparrot-clean | ||
<!--- TEST_NAME ComposingGuideTest -->
<contribute-url>https://github.com/Kotlin/kotlinx.coroutines/edit/master/docs/topics/</contribute-url>
[//]: # (title: Composing suspending functions)
This section covers various approaches to composition of suspending functions.
## Sequential by default
Assume that we have tw... | unknown | github | https://github.com/Kotlin/kotlinx.coroutines | docs/topics/composing-suspending-functions.md |
from common import * # NOQA
@pytest.fixture(scope='module', autouse=True)
def disable_go_machine_service(request, super_client):
# Ensuring the goMachineService handler is disabled lets us ensure these
# tests are ran without actually calling docker machine and keeps them
# lightweight. Reenables any disa... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# 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 require... | unknown | codeparrot/codeparrot-clean | ||
form {
display: flex;
flex-direction: column;
gap: 1rem;
max-width: 400px;
padding: 1rem;
font-family:
Inter,
system-ui,
-apple-system,
sans-serif;
}
div {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
label {
display: flex;
flex-direction: column;
gap: 0.25rem;
font... | css | github | https://github.com/angular/angular | adev/src/content/tutorials/playground/4-signal-forms/src/main.css |
- name: Verify HTTPTESTER environment variable
assert:
that:
- "lookup('env', 'HTTPTESTER') == '1'"
- name: Verify endpoints respond
ansible.windows.win_uri:
url: "{{ item }}"
validate_certs: no
with_items:
- http://ansible.http.tests/
- https://ansible.http.tests/
- https://sni1.an... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/ansible-test-cloud-httptester-windows/tasks/main.yml |
# Copyright 2014 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.
RECORD_AS_MUCH_AS_POSSIBLE = 'record-as-much-as-possible'
RECORD_UNTIL_FULL = 'record-until-full'
RECORD_MODES = (RECORD_AS_MUCH_AS_POSSIBLE, RECORD_UNTIL_FU... | unknown | codeparrot/codeparrot-clean | ||
<!doctype html>
<!-- #docregion -->
<html lang="en">
<head>
<base href="/" />
<title>Drag and Drop Alternate Root Element Example</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<cdk-drag-drop-root-element-example></cdk-d... | html | github | https://github.com/angular/angular | adev/src/content/examples/drag-drop/src/root-element/index.html |
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
from test.helper import TestHelper
from beetsplug import embyupdate
import unittest
import responses
class EmbyUpdateTest(unittest.TestCase, TestHelper):
def setUp(self):
self.setup_beets()
self.load_plugins(... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .generic import GenericIE
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
parse_duration,
qualities,
str_or_none,
try_get,
unified_strdate,
unified_timestamp,
... | unknown | codeparrot/codeparrot-clean | ||
#import os
import sys
import time
import xmltodict
import pprint
pp = pprint.PrettyPrinter(indent=4,stream=sys.stderr)
testing = False
# def poll_condor(jonbr, bagnr):
def poll_condor(filename):
# filename = "hist-%d-%d.xml" % ( jobnr, bagnr )
# command = "condor_history -constraint 'HtcJob == %d && HtcBag =... | unknown | codeparrot/codeparrot-clean | ||
import { flushSync } from 'svelte';
import { ok, test } from '../../test';
export default test({
ssrHtml: `
<h1>Hello !</h1>
<select>
<option value="Harry">Harry</option>
<optgroup label="Group">
<option value="World">World</option>
</optgroup>
</select>
`,
html: `
<h1>Hello Harry!</h1>
<s... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/binding-select-optgroup/_config.js |
# -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it un... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding:utf-8 -*-
__author__ = 'TwIStOy'
import Util
import codecs
class Generator(object):
"""Renderer is the last part of the controller.
It will render the all the pages(include post, page and archive), and write them into file.
plugin can be registered at such positions as key strings:
... | 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 | ||
/*
* 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/statistics/impl/StorageStatisticsFromIOStatistics.java |
from chainer.functions.activation import relu
from chainer.functions.array import concat
from chainer.functions.pooling import max_pooling_2d
from chainer import link
from chainer.links.connection import convolution_2d
class Inception(link.Chain):
"""Inception module of GoogLeNet.
It applies four different f... | unknown | codeparrot/codeparrot-clean | ||
from DecoupeurChaine import DecoupeurChaine
import yaml
class DecoupeurRecursif(DecoupeurChaine):
def decouper(self, separateurs):
if len(separateurs[0]) == 3:
(separator, side, number) = separateurs[0]
if side == "l":
temp = self.chaine.split(separator, number)
... | unknown | codeparrot/codeparrot-clean | ||
"""This module provides access to the garbage collector for reference cycles.
enable() -- Enable automatic garbage collection.
disable() -- Disable automatic garbage collection.
isenabled() -- Returns true if automatic collection is enabled.
collect() -- Do a full collection right now.
get_count() -- Return the curren... | unknown | codeparrot/codeparrot-clean | ||
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
'''
HDFS NameNode Metrics
---------------------
hdfs.namenode.capacity_total Total disk capacity in bytes
hdfs.namenode.capacity_used Disk usage in bytes
hdfs.namenode.capaci... | unknown | codeparrot/codeparrot-clean | ||
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "dir.h"
#include "environment.h"
#include "gettext.h"
#include "quote.h"
#include "pathspec.h"
#include "parse-options.h"
#include "submodule.h"
#include "write-or-die.h"
static int quiet, verbose, stdin_paths, show_non_matching, no_... | c | github | https://github.com/git/git | builtin/check-ignore.c |
## Input
```javascript
//@flow
const foo = undefined;
component C(...{scope = foo ?? null}: any) {
return scope;
}
export const FIXTURE_ENTRYPOINT = {
fn: C,
params: [{scope: undefined}],
};
```
## Code
```javascript
const foo = undefined;
function C(t0) {
const { scope: t1 } = t0;
const scope = t1 ==... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/logical-reorder.flow.expect.md |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# loadlimit documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... | unknown | codeparrot/codeparrot-clean | ||
//===- PreprocessorTracker.h - Tracks preprocessor activities -*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===-----------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/modularize/PreprocessorTracker.h |
//===--- BasicBlockBits.h - SILBasicBlock bit utilities ---------*- 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/SIL/BasicBlockBits.h |
import sys, unittest, re, os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src'))
import Exscript.util.ipv4
class ipv4Test(unittest.TestCase):
CORRELATE = Exscript.util.ipv4
def testIsIp(self):
from Exscript.util.ipv4 import is_ip
self.assert_(is_ip('0.0.0... | unknown | codeparrot/codeparrot-clean | ||
import sys
__all__ = ['PY3', 'b', 'basestring_', 'bytes', 'next', 'is_unicode',
'iteritems']
PY3 = True if sys.version_info[0] >= 3 else False
if sys.version_info[0] < 3:
def next(obj):
return obj.next()
def iteritems(d, **kw):
return d.iteritems(**kw)
b = bytes = str
ba... | unknown | codeparrot/codeparrot-clean | ||
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
str = "foo#{i}bar#{i}baz"
end | ruby | github | https://github.com/ruby/ruby | benchmark/vm_dstr_int.rb |
# Copyright (C) 2011 One Laptop Per Child
#
# 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 version.
#
# This program is distribu... | 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/FsUrlConnection.java |
'use strict';
{
function setTheme(mode) {
if (mode !== "light" && mode !== "dark" && mode !== "auto") {
console.error(`Got invalid theme mode: ${mode}. Resetting to auto.`);
mode = "auto";
}
document.documentElement.dataset.theme = mode;
localStorage.setItem("... | javascript | github | https://github.com/django/django | django/contrib/admin/static/admin/js/theme.js |
# Registered listeners
## event1
### Listener 1
- Type: `function`
- Name: `var_dump`
- Priority: `255`
### Listener 2
- Type: `closure`
- Priority: `-1`
## event2
### Listener 1
- Type: `object`
- Name: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
- Priority: `0` | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_events.md |
/* cluster_asm.h -- Atomic slot migration implementation for cluster
*
* Copyright (c) 2025-Present, Redis Ltd.
* All rights reserved.
*
* Licensed under your choice of (a) the Redis Source Available License 2.0
* (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the
* GNU Affero General Public... | c | github | https://github.com/redis/redis | src/cluster_asm.h |
# 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 | ||
import unittest
import numpy as np
import matplotlib.pylab as plt
from prototype.estimation.kf import KF
def gaussian_noise(sigma):
if type(sigma) in [np.matrix, np.array]:
return sigma**2 * np.random.randn(sigma.shape[0], 1)
else:
return sigma**2 * np.random.randn()
def plot_trajectory(stat... | 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 | ||
import argparse
import torch
from torch_geometric.nn import Node2Vec
from ogb.nodeproppred import PygNodePropPredDataset
def save_embedding(model):
torch.save(model.embedding.weight.data.cpu(), 'embedding.pt')
def main():
parser = argparse.ArgumentParser(description='OGBN-Products (Node2Vec)')
parser.ad... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import sys
import numpy as np
import argparse
from kaffe import KaffeError, print_stderr
from kaffe.tensorflow import TensorFlowTransformer
def fatal_error(msg):
print_stderr(msg)
exit(-1)
def validate_arguments(args):
if (args.data_output_path is not None) and (args.caffe... | unknown | codeparrot/codeparrot-clean | ||
import ReactCompilerTest from 'ReactCompilerTest';
function Component() {
return ReactCompilerTest.useHookNotTypedAsHook();
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-type-provider-hook-name-not-typed-as-hook-namespace.js |
"""
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
import inspect
from .py26compat import import_module
from setuptools.extern import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need thi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
E2E tests for the LMS.
"""
from unittest import skip
from .helpers import UniqueCourseTest
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.annotation_component import AnnotationComponentPage
from ..fixtures.course import C... | unknown | codeparrot/codeparrot-clean | ||
// props.b + 1 is an non-allocating expression, which means Forget can
// emit it trivially and repeatedly (e.g. no need to memoize props.b + 1
// separately from props.b)
// Correctness:
// y depends on either props.b or props.b + 1
function PrimitiveAsDep(props) {
let y = foo(props.b + 1);
return y;
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/primitive-as-dep.js |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | unknown | codeparrot/codeparrot-clean | ||
use rustc_hir::attrs::Linkage;
use rustc_hir::def_id::DefId;
use rustc_middle::mir::mono::Visibility;
use rustc_middle::ty::Instance;
pub trait PreDefineCodegenMethods<'tcx> {
fn predefine_static(
&mut self,
def_id: DefId,
linkage: Linkage,
visibility: Visibility,
symbol_nam... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_ssa/src/traits/declare.rs |
# -*- coding: utf-8 -*-
"""
***************************************************************************
PredicatePanel.py
---------------------
Date : January 2015
Copyright : (C) 2015 by Arnaud Morvan
Email : arnaud dot morvan at camptocamp dot com
Con... | unknown | codeparrot/codeparrot-clean | ||
namespace: ns
name: col
version: 1.0.0
readme: README.rst
authors:
- Ansible | unknown | github | https://github.com/ansible/ansible | test/integration/targets/ansible-test-docker/ansible_collections/ns/col/galaxy.yml |
/*
* 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-context/src/test/java/example/scannable_implicitbasepackage/ConfigurableComponent.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.