code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/controller/daemon/doc.go |
# V2 to V1 Dashboard Layout Conversion
This document describes how V2beta1 dashboard layouts are converted to V1beta1 panels.
## Overview
V2 dashboards support four layout types that must be converted to V1's flat panel array:
| V2 Layout | V1 Result |
|-----------|-----------|
| GridLayout | Direct panel conversio... | unknown | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/v2_to_v1_layout_conversion.md |
The documentation has been moved to the [https://kotlinlang.org/docs/exception-handling.html](https://kotlinlang.org/docs/exception-handling.html) page.
To edit the documentation, open the [topics/exception-handling.md](topics/exception-handling.md) page. | unknown | github | https://github.com/Kotlin/kotlinx.coroutines | docs/exception-handling.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... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/EnumSetWritable.java |
import argparse
import os
import sys
import re
__author__ = 'Rob Edwards'
"""
Trim an alignment file (in phylip format) based on the contents of the columns
"""
def parse_phylip_file(filename):
"""
Parse the phylip alignment file
:param filename:The file to parse
:type filename: str
:return: Tw... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.matlib
from numpy.testing import assert_array_equal, assert_, run_module_suite
def test_empty():
x = np.matlib.empty((2,))
assert_(isinstance(x, np.matrix))
assert_(x.shape, (1, 2))
def test_ones():
asser... | unknown | codeparrot/codeparrot-clean | ||
# Minimal tests for dis module
from test.test_support import run_unittest
import unittest
import sys
import dis
import StringIO
def _f(a):
print a
return 1
dis_f = """\
%-4d 0 LOAD_FAST 0 (a)
3 PRINT_ITEM
4 PRINT_NEWLINE
%-4d 5 LOAD_CONST ... | unknown | codeparrot/codeparrot-clean | ||
'''
John Whelchel
Summer 2013
Forms used just for gateways (AG, RG, and UG).
'''
from django import forms
from django_lib.forms import LONGEST_CHAR_FIELD, LONGEST_PASS_FIELD, LONGEST_JSON_FIELD, ReadOnlyWidget
LARGEST_PORT = 65535
class ModifyGatewayConfig(forms.Form):
json_config = forms.FileField(required=F... | unknown | codeparrot/codeparrot-clean | ||
//! The implementation of built-in macros which relate to the file system.
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::sync::Arc;
use rustc_ast as ast;
use rustc_ast::tokenstream::TokenStream;
use rustc_ast::{join_path_idents, token};
use rustc_ast_pretty::pprust;
use rustc_expand::base::{
DummyResu... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_builtin_macros/src/source_util.rs |
export default function Page() {
useLayoutEffect(() => {})
useEffect(() => {})
const onClick = useCallback(() => [])
const computed = useMemo(() => {})
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/debug-fn-name/export-default-decl/input.js |
#pragma once
#include <c10/core/Backend.h> | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/Backend.h |
from rest_framework import status
from rest_framework.authtoken.models import Token
from django.utils.translation import ugettext_lazy as _
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from drfpasswordless.settings import api_settings, DEFAUL... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/utils/platform.py |
'''
This is a standalone script that is to be
used to load the vocab into the server's
mongo database. This only needs to be run
once, with the appropriate vocabulary on the
filesystem as a one column flat list text file.
'''
import re
import sys
import pymongo as pm
from optparse import OptionParser
'''
Thi... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlparse
from ..utils import (
ExtractorError,
parse_iso8601,
qualities,
)
class SRGSSRIE(InfoExtractor):
_VALID_URL = r'(?:https?://tp\.srgssr\.ch/p(?:/[^/]+)+... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
Section: 3
Source: libcurl
See-also:
- CURLINFO_CONTENT_LENGTH_UPLOAD_T (3)
- curl_easy_getinfo (3)
- curl_easy_setopt (3)
Protocol:
- All
Added-in: 7.55.0
---
# NAME
CURLINFO... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md |
import numpy as np
import pytest
from pandas import (
DataFrame,
NaT,
Series,
Timestamp,
date_range,
period_range,
)
import pandas._testing as tm
class TestDataFrameValues:
def test_values(self, float_frame):
with pytest.raises(ValueError, match="read-only"):
float_fram... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/methods/test_values.py |
"""
Script for cloning a course
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
from student.roles import CourseInstructorRole, CourseStaffRole
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
package com.google.common.graph;
import com.google.common.annotations.Beta;
import java.util.Set;
/**
* Supertype for {@link Graphs}, containing the old signatures of methods whose signatures we've
* changed. This provides binary compatibility for users who compiled against the old signatures.
*/
@Beta
abstract cl... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/graph/GraphsBridgeMethods.java |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from collections import OrderedDict
from textplot.text import Text as Text_
from tcflib.tcf import TextCorpus
class Text(Text_):
"""
Implementation of `textplot.Text` that reads an annotated text in TCF
format instead of processing plain text.
... | unknown | codeparrot/codeparrot-clean | ||
from Components.ActionMap import ActionMap
from Components.Button import Button
from Components.Label import Label
from Components.config import config
from Components.MenuList import MenuList
from Components.TimerList import TimerList
from Components.TimerSanityCheck import TimerSanityCheck
from Components.UsageConfig... | unknown | codeparrot/codeparrot-clean | ||
"""
file: datagen.py
python version: 3.5
Authors : Kantha Girish, Akshay Karki
description: This file contains functions to generate random string sequences for testing LCS
algorithms
"""
import numpy.random as rand
import sys
acgt = "acgt"
bits = "01"
def get_random_acgt(length, delta=None):
"""
:param lengt... | unknown | codeparrot/codeparrot-clean | ||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
cd src
activate_venv
set -o errexit
# Create the config file, which will contain the GCE project/zone information along with
# the expected audience that will appear on the VM's ID token.
cat <<EOF >$HOME/gce_vm_config.json
{
... | unknown | github | https://github.com/mongodb/mongo | evergreen/external_auth_gcp_setup.sh |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import svd
__all__ = ['polar']
def polar(a, side="right"):
"""
Compute the polar decomposition.
Returns the factors of the polar decomposition [1]_ `u` and `p` such
that ``a = up`` (if `side` is "ri... | unknown | codeparrot/codeparrot-clean | ||
# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API.
#
# This is used for generating API documentation and the types used by the
# client/server. See api/README.md for more information.
#
# Some style notes:
# - This file is used by ReDoc, which allows GitHub Flavored Markdown in
# descriptions.
# - There i... | unknown | github | https://github.com/moby/moby | api/docs/v1.41.yaml |
#----------------------------------------------------------------------
# Copyright (c) 2011-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing_extensions import Literal, TypeAlias
__all__ = ["RunStepInclude"]
RunStepInclude: TypeAlias = Literal["step_details.tool_calls[*].file_search.results[*].content"] | python | github | https://github.com/openai/openai-python | src/openai/types/beta/threads/runs/run_step_include.py |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib import comments
from django.utils.encoding import smart_unicode
register = template.Library()
class BaseCommentNode(template.N... | unknown | codeparrot/codeparrot-clean | ||
import errno
import imp
import importlib
import os
import six
class Config(dict):
"""
Works exactly like a dict but provides ways to fill it from files
or special dictionaries. There are two common patterns to populate the
config.
Either you can fill the config from a config file::
app.... | unknown | codeparrot/codeparrot-clean | ||
// run
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test that heavy recursion works. Simple torture test for
// segmented stacks: do math in unary by recursion.
package main
import "runtime"
type Nu... | go | github | https://github.com/golang/go | test/peano.go |
/*
* 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-support/src/main/java/org/springframework/cache/jcache/interceptor/JCacheOperationSource.java |
"""
Startmigration command, version 2.
"""
from __future__ import print_function
import sys
import os
import re
import string
import random
import inspect
from optparse import make_option
try:
set
except NameError:
from sets import Set as set
from django.core.management.base import BaseCommand
from django.c... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime
_curr_year = datetime.now().year
if datetime.now().month > 6:
CURRENT_SEASON = str(_curr_year) + "-" + str(_curr_year + 1)[2:]
else:
CURRENT_SEASON = str(_curr_year - 1) + "-" + str(_curr_year)[2:]
TEAMS = {
'ATL': {
'abbr': 'ATL',
'city': 'Atlanta',
'... | 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/test/java/org/springframework/aop/interceptor/ExposedInvocationTestBean.java |
#!/usr/bin/env python
# summarize the sql-bench trace file
import sys
import re
import os.path
class testreports:
def __init__(self):
self.reports = []
def append(self, report):
self.reports.append(report)
def duration(self, start, stop):
t0 = os.popen('date -d"' + start + '" +%... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# 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 GN... | unknown | codeparrot/codeparrot-clean | ||
/**
* SPI interfaces and configuration-related convenience classes for bean factories.
*/
@NullMarked
package org.springframework.beans.factory.config;
import org.jspecify.annotations.NullMarked; | java | github | https://github.com/spring-projects/spring-framework | spring-beans/src/main/java/org/springframework/beans/factory/config/package-info.java |
import requests.api
from requests.auth import HTTPBasicAuth
from amqpstorm.compatibility import urlparse
from amqpstorm.management.exception import ApiConnectionError
from amqpstorm.management.exception import ApiError
class HTTPClient(object):
def __init__(self, api_url, username, password, timeout):
sel... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""completely insecure encryption"""
from cgi import escape
import base64
def encryptandescape(plaintext, key):
ciphertext = encrypt(plaintext, key)
linelength = 70
escapedtext = ""
for linestart in range(0,len(ciphertext),linelength):
line = ciphertext[lines... | unknown | codeparrot/codeparrot-clean | ||
"""
=====================================
SGDOneClassSVM benchmark
=====================================
This benchmark compares the :class:`SGDOneClassSVM` with :class:`OneClassSVM`.
The former is an online One-Class SVM implemented with a Stochastic Gradient
Descent (SGD). The latter is based on the LibSVM implementa... | python | github | https://github.com/scikit-learn/scikit-learn | benchmarks/bench_online_ocsvm.py |
"""
Generalized Linear Models.
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import warnings
from abc import ABCMeta, abstractmethod
from numbers import Integral, Real
import numpy as np
import scipy.sparse as sp
from scipy import linalg, optimize, sparse
from scipy.sparse.linalg... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/linear_model/_base.py |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira Networks, 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.apac... | unknown | codeparrot/codeparrot-clean | ||
@file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
package kotlinx.coroutines.selects
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlin.test.*
class SelectLoopTest : TestBase() {
// https://github.com/Kotlin/kotlinx.coroutines/issues/1130
... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/selects/SelectLoopTest.kt |
import argparse
from os.path import join
import re
from subprocess import CalledProcessError, check_output, STDOUT
import sys
from packaging.version import Version as V
try:
import colorama
def bright(text): return "%s%s%s" % (colorama.Style.BRIGHT, text, colorama.Style.RESET_ALL)
def dim(text): return ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ===--- compare_perf_tests.py -------------------------------------------===//
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Li... | python | github | https://github.com/apple/swift | benchmark/scripts/compare_perf_tests.py |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from ..models import InfantBirthFeedVaccine, InfantVaccines
from .base_infant_model_form import BaseInfantModelForm
from microbiome.apps.mb_maternal.models import MaternalConsent
from ..models import InfantBirth
class InfantBirthFeedVaccineForm(BaseInfantModelForm):
def clean(self):
... | unknown | codeparrot/codeparrot-clean | ||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
set -o errexit
set -o verbose
activate_venv
$python -c 'import json; print(json.dumps([{
"name": "Wiki: Running Tests from Evergreen Tasks Locally",
"link": "https://github.com/mongodb/mongo/wiki/Running-Tests-from-Evergreen-T... | unknown | github | https://github.com/mongodb/mongo | evergreen/wiki_page.sh |
package app
import (
"context"
"github.com/grafana/grafana-app-sdk/app"
"github.com/grafana/grafana-app-sdk/simple"
)
var _ simple.KindMutator = NewMutator()
type Mutator struct{}
func NewMutator() *Mutator {
return &Mutator{}
}
// Mutate makes modifications to an input object from the API, and returns the ch... | go | github | https://github.com/grafana/grafana | apps/example/pkg/app/mutation.go |
# Copyright 2012 Christoph Reiter
#
# 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.
from .._compat import xran... | unknown | codeparrot/codeparrot-clean | ||
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_critical_section.h"// Py_BEG... | c | github | https://github.com/python/cpython | Modules/clinic/_collectionsmodule.c.h |
# coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '\ " update\ " è un\' espressione facoltativa come " field1=\'newvalue\'". Non è possibile aggiornare o eliminare i risultati di una JOIN',
'# of International Staff': '# di Personale Int... | unknown | codeparrot/codeparrot-clean | ||
"""
=======================================================================================
Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation
=======================================================================================
This is an example of applying :class:`~sklearn.dec... | python | github | https://github.com/scikit-learn/scikit-learn | examples/applications/plot_topics_extraction_with_nmf_lda.py |
#
# Copyright 2009 Mathieu Leocmach
#
# This file is part of Colloids.
#
# Colloids 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013, Big Switch Networks, 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 applicabl... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Red Hat, 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 agre... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActiveRecord
module Encryption
# An encryption context configures the different entities used to perform encryption:
#
# * A key provider
# * A key generator
# * An encryptor, the facade to encrypt data
# * A cipher, the encryption algorithm
# * A mess... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/encryption/context.rb |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2016, Jorge Rodriguez <jorge.rodriguez@tiriel.eu>
# Copyright: (c) 2018, John Imison <john+github@imison.net>
#
# 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
__meta... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/tile_functor_gpu.h |
/*
* 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/aop/ataspectj/aopataspectj/NotVeryUsefulAspect.java |
import cStringIO
import json
import unicodecsv as ucsv
import uuid
from celery import task
from celery import current_task
from celery.result import AsyncResult
from collections import defaultdict
from copy import deepcopy
from datetime import datetime
from django.contrib.auth.models import User
from onadata.libs.util... | unknown | codeparrot/codeparrot-clean | ||
def splitline(pt1, pt2, percent=0.5):
'''
Return a point which splits the given line at the
given percentage...
Example: splitline( (0,0), (20, 30), 0.1)
'''
pt1_x, pt1_y = pt1
pt2_x, pt2_y = pt2
deltax = (pt2_x - pt1_x) * percent
deltay = (pt2_y - pt1_y) * percent
return int... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Test whether a client subscribed to a topic receives its own message sent to that topic.
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(o... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2009-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
"""
The TCPCollector class collects metrics on TCP stats
#### Dependencies
* /proc/net/netstat
* /proc/net/snmp
#### Allowed Metric Names
<table>
<tr><th>Name</th><th>Description</th></tr>
<tr><td>SyncookiesSent</td><td>An application wasn't able to accept a
connection fast enough, so the kernel co... | unknown | codeparrot/codeparrot-clean | ||
"""
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
... | unknown | codeparrot/codeparrot-clean | ||
import json
import pytest
from units.compat import mock
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
from ansible.modules.remote_management.lxca import lxca_nodes
from ansible.module_utils.remote_management.lxca.common import setup_conn
from ansible.module_utils.remote_managem... | unknown | codeparrot/codeparrot-clean | ||
import re
import logging
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
class LineCountBear(LocalBear):
LANGUAGES = {'All'}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}... | unknown | codeparrot/codeparrot-clean | ||
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import os
import pickle
import random
import subprocess
import sys
import time
import unittest
from test import support
try:
imp... | unknown | codeparrot/codeparrot-clean | ||
import operator_benchmark as op_bench
import torch
from torch.testing._internal.common_device_type import get_all_device_types
"""Microbenchmark for Fill_ operator."""
fill_short_configs = op_bench.config_list(
attr_names=["N"],
attrs=[
[1],
[1024],
[2048],
],
cross_product_co... | python | github | https://github.com/pytorch/pytorch | benchmarks/operator_benchmark/pt/fill_test.py |
/*
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.components
import org.jetbrains.kotlin.analysis.api.fir.KaFirSe... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirKDocProvider.kt |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This program prompts for a password."""
import authentication
import getpass
def login(username, maxattempts=3):
"""This function takes input from a user and checks the password.
Arg:
username(str): String input from user.
maxattempts(... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... | unknown | codeparrot/codeparrot-clean | ||
env:
CIRRUS_CLONE_DEPTH: 1
freebsd_task:
env:
GIT_PROVE_OPTS: "--timer --jobs 10"
GIT_TEST_OPTS: "--no-chain-lint --no-bin-wrappers"
GIT_SKIP_TESTS: t7815.12
MAKEFLAGS: -j4
DEFAULT_TEST_TARGET: prove
DEFAULT_UNIT_TEST_TARGET: unit-tests-prove
DEVELOPER: 1
freebsd_instance:
image_f... | unknown | github | https://github.com/git/git | .cirrus.yml |
"""Utility functions for simple-salesforce"""
import xml.dom.minidom
from simple_salesforce.exceptions import (
SalesforceGeneralError, SalesforceExpiredSession,
SalesforceMalformedRequest, SalesforceMoreThanOneRecord,
SalesforceRefusedRequest, SalesforceResourceNotFound
)
# pylint: disable=invalid-name
... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2014 James Cammarata, <jcammarata@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@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... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2015, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including... | c | github | https://github.com/mysql/mysql-server | sql/sql_plugin_ref.h |
def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "font-src " + url1 + "... | unknown | codeparrot/codeparrot-clean | ||
//go:build windows
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/componentconfigs/kubelet_windows_test.go |
"""Fast Gradient Boosting decision trees for classification and regression."""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import itertools
from abc import ABC, abstractmethod
from contextlib import contextmanager, nullcontext, suppress
from functools import partial
from numbers imp... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py |
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include <spdlog/common.h>
#include <string>
namespace spdlog {
namespace details {
struct SPDLOG_API log_msg {
log_msg() = default;
log_msg(log_clock::time_... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/spdlog/include/spdlog/details/log_msg.h |
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | unknown | codeparrot/codeparrot-clean | ||
from troposphere import Ref, Template, Output
from troposphere.apigateway import RestApi, Method
from troposphere.apigateway import Resource, MethodResponse
from troposphere.apigateway import Integration, IntegrationResponse
from troposphere.apigateway import Deployment, Stage, ApiStage
from troposphere.apigateway impo... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from .resolvable import Resolvable
from .resolver_options import ResolverOptionsBuilder
class UnsupportedLine(Exception):
pass
def _startswith_any(line, things):
return an... | unknown | codeparrot/codeparrot-clean | ||
class Solution(object):
def solveSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: void Do not return anything, modify board in-place instead.
"""
if board is None or len(board) != 9 or len(board[0]) != 9:
return
for row in range(9):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, 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/lice... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-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... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0-only
# pylint: disable=C0103,C0209
"""
The Linux Kernel documentation build configuration file.
"""
import os
import shutil
import sys
from textwrap import dedent
import sphinx
# Location of Documentation/ directory
kern_doc_dir = os.path.dirname(os.path.abspath(__file__))
# Ad... | python | github | https://github.com/torvalds/linux | Documentation/conf.py |
# multi1.py ---
# Upi Bhalla, NCBS Bangalore 2014.
#
# Commentary:
#
# This loads in a medium-detail model incorporating
# reac-diff and elec signaling in neurons. The reac-diff model
# has just Ca and CaM in it, and there are no-cross-compartment
# reactions though Ca diffuses everywhere. The elec model controls the
#... | unknown | codeparrot/codeparrot-clean | ||
"""
Utility methods useful for Studio page tests.
"""
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from bok_choy.promise import EmptyPromise
from bok_choy.javascript import js_defined
from ...tests.helpers import disable_animations
def click_css(page... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "v0alpha1.timeseries-stacking.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"uid": "-- Grafana --"
},
"enable": t... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-timeseries/v0alpha1.timeseries-stacking.v42.v1beta1.json |
use rustc_public_bridge::IndexedVal;
use crate::abi::Layout;
use crate::mir::alloc::AllocId;
use crate::mir::mono::InstanceDef;
use crate::ty::{MirConstId, TyConstId, VariantIdx};
use crate::{CrateNum, DefId, Span, ThreadLocalIndex, Ty};
#[track_caller]
fn check_serialize<T: serde::Serialize>(value: T, expected_json:... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_public/src/tests.rs |
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { useEffect } from 'react';
import { select, selectAll } from 'd3-selection';
export default function Home() {
useEffect(function() {
new MyClass();
}, []);
return /*#__PURE__*/ React.createElement("svg", null, /*#__PU... | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/loader/issue-31627/output.js |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Stream Structure Reference</title>
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
<meta charset="utf-8">
<script src="../../js/jquery.min.js" defer></script... | html | github | https://github.com/Alamofire/Alamofire | docs/Classes/DataStreamRequest/Stream.html |
# Copyright (c) 2013 - 2015 EMC Corporation.
# 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
#
# Unle... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.