code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
'use strict';
const common = require('../common.js');
const assert = require('assert');
const bench = common.createBenchmark(main, {
method: [
'object', 'nullProtoObject', 'nullProtoLiteralObject', 'storageObject',
'fakeMap', 'map',
],
n: [1e6],
});
function runObject(n) {
const m = {};
bench.start... | javascript | github | https://github.com/nodejs/node | benchmark/es/map-bench.js |
def smallest_multiple(n):
if (n<=2):
return n
i = n * 2
factors = [number for number in range(n, 1, -1) if number * 2 > n]
while True:
for a in factors:
if i % a != 0:
i += n
break
if (a == factors[-1] and i % a == 0):
... | unknown | mbpp | ||
# Copyright (c) 2010-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 or agree... | unknown | codeparrot/codeparrot-clean | ||
steps:
- checkout: self
fetchDepth: 5
- script: echo "##vso[task.setvariable variable=diffTarget]HEAD~1"
displayName: Set default diff target
- script: |
git fetch -q origin $(System.PullRequest.TargetBranch)
echo "##vso[task.setvariable variable=diffTarget]HEAD \$(git merge-base HEAD FETCH_HEAD)"
displ... | unknown | github | https://github.com/python/cpython | .azure-pipelines/prebuild-checks.yml |
use rustc_index::IndexVec;
use rustc_middle::mir::coverage::{
BlockMarkerId, BranchSpan, CoverageInfoHi, CoverageKind, Mapping, MappingKind,
};
use rustc_middle::mir::{self, BasicBlock, StatementKind};
use rustc_middle::ty::TyCtxt;
use rustc_span::ExpnKind;
use crate::coverage::expansion::{self, ExpnTree};
use cra... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_mir_transform/src/coverage/mappings.rs |
# -*- coding: utf-8 -*-
#
# phpMyAdmin documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 26 14:04:48 2012.
#
# 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
# autogenerated file.
#
# ... | unknown | codeparrot/codeparrot-clean | ||
# # Copyright (c) 2000-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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,... | unknown | codeparrot/codeparrot-clean | ||
import operator_benchmark as op_bench
import torch
"""Microbenchmarks for topk operator"""
topk_configs_short = op_bench.config_list(
attr_names=["shape", "k", "dim"],
attrs=[
[(16, 4), 4, 1],
[(1024 * 1024,), 16, 0],
],
cross_product_configs={"device": ["cpu"], "dtype": [torch.float]... | python | github | https://github.com/pytorch/pytorch | benchmarks/operator_benchmark/pt/topk_test.py |
# -*- coding: utf-8 -*-
from sympy.physics.unitsystems.dimensions import Dimension, DimensionSystem
from sympy.physics.unitsystems.units import Unit, UnitSystem
from sympy.physics.unitsystems.quantities import Quantity
from sympy.utilities.pytest import raises
length = Dimension(name="length", symbol="L", length=1)
m... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, print_function, division
import unittest
import numpy
import theano
from theano import function, config
from theano import scalar
from theano.gof import FunctionGraph
from theano.gof.opt import out2in
from theano.tensor.opt_uncanonicalize import (
local_alloc_dimshuffle,
... | unknown | codeparrot/codeparrot-clean | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/native/cuda/IndexKernel.h>
#include <ATen/native/TensorAdvancedIndexing.h> // For at::native::index_out
#include <ATen/core/Tensor.h>
#include <ATen/core/List.h>
#include <ATen/ExpandUtils.h>
#include <ATen/MemoryOverlap.h>
#include <ATen/NamedTensorUtils.h>
#... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/cuda/IndexKernel.cpp |
'''
Created on Dec 1, 2016
@author: David Zwicker <dzwicker@seas.harvard.edu>
'''
from __future__ import division
import itertools
import numpy as np
from scipy import optimize, spatial
from six.moves import range
def _iter_problematic_edges(edges):
""" generator that goes through a list of edges and returns ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | unknown | codeparrot/codeparrot-clean | ||
# 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/dots1/__init__.py |
# frozen_string_literal: true
module ActiveModel
def self.deprecator # :nodoc:
@deprecator ||= ActiveSupport::Deprecation.new
end
end | ruby | github | https://github.com/rails/rails | activemodel/lib/active_model/deprecator.rb |
"""Provides scheduling routines for stackless tasklets.
The scheduler itself runs as a tasklet. It blocks waiting
for input on the channel passed in. When new data is sent
on this channel, the scheduler wakes and begins processing
of the data.
"""
import stackless
from pype import Pype
from graph import get_pairlist... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import ast
import re
import os
import logging
logger = logging.getLogger("logger")
def tvars_num():
logger.info("model variables:")
nvars = 0
for var in t... | unknown | codeparrot/codeparrot-clean | ||
import sys
from six import StringIO
import ccmlib
from ccmlib.cluster import Cluster
from . import TEST_DIR, ccmtest
sys.path = [".."] + sys.path
CLUSTER_PATH = TEST_DIR
class TestCCMLib(ccmtest.Tester):
def restart_test(self):
self.cluster = Cluster(CLUSTER_PATH, "restart", cassandra_version='2.0.9')... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <assert.h>
#include <arm_neon.h>
#include <qnnpack/u8rmax.h>
uint8_t pytorch_u8rmax_ukern... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/u8rmax/neon.c |
# Vendored implementation of pandas.NA, adapted from pandas/_libs/missing.pyx
#
# This is vendored to avoid adding pandas as a test dependency.
__all__ = ["pd_NA"]
import numbers
import numpy as np
def _create_binary_propagating_op(name, is_divmod=False):
is_cmp = name.strip("_") in ["eq", "ne", "le", "lt", "ge... | python | github | https://github.com/numpy/numpy | numpy/_core/tests/_natype.py |
try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import Set as set
from sets import ImmutableSet as frozenset
try:
from collections import deque
except ImportError:
from utils import deque
from constants import contentModelFlags, spaceCharacters
from const... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#/#############################################################################
#
# Jobs Global
# Copyright (C) 2014-TODAY Jobs Global(http://www.jobsglobal.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | unknown | codeparrot/codeparrot-clean | ||
export { SvelteDate } from './date.js';
export { SvelteSet } from './set.js';
export { SvelteMap } from './map.js';
export { SvelteURL } from './url.js';
export { SvelteURLSearchParams } from './url-search-params.js';
export { MediaQuery } from './media-query.js';
export { createSubscriber } from './create-subscriber.j... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/reactivity/index-client.js |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# mssql/__init__.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from sqlalchemy.dialects.mssql import base, pyodbc, adodbapi, \
pymssql, zxjdb... | unknown | codeparrot/codeparrot-clean | ||
// Code generated by go-swagger; DO NOT EDIT.
package container
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// CreateResponse ContainerCreateResponse
//
// # OK response to ContainerCreate operation
//
// swagger:model CreateRes... | go | github | https://github.com/moby/moby | api/types/container/create_response.go |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Test a Fast R-CNN network on an imdb (image database)."""
from ism.... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2018 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
gosql "database/sql"
"fmt"
"reflect"
"testing"
"time"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockro... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/plan_opt_test.go |
''' Functions to help with testing Bokeh and reporting issues.
'''
from __future__ import absolute_import, print_function
import codecs
import errno
from inspect import isclass, isfunction, getmembers
import os
import importlib
import shutil
import sys
import tempfile
import pytest
from six import string_types
from ... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009... | unknown | codeparrot/codeparrot-clean | ||
def _get_number_of_moves(tab):
rows = len(tab)
cols = None
for row in tab:
if cols is None:
cols = len(row)
if cols != len(row):
raise ValueError("la cantidad de columnas de la matriz " +
"debe ser igual en cada fila")
return (rows,cols)
def _move_ij(... | unknown | codeparrot/codeparrot-clean | ||
# The {{ project_name }} should be rendered. | python | github | https://github.com/django/django | tests/admin_scripts/custom_templates/project_template/.hidden/render.py |
/*
* 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.tests.http
import io.ktor.http.*
import kotlin.test.*
class ContentTypeMatchTest {
@Test
fun testTypeAndSubtype() {
assertTrue { ContentType.parse("text/plain... | kotlin | github | https://github.com/ktorio/ktor | ktor-http/common/test/io/ktor/tests/http/ContentTypeMatchTest.kt |
# Copyright (C) 2010-2014 GRNET S.A.
#
# 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 distributed i... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v42.hidefrom_tooltip.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dashboards_from_v0_to_v2/v2beta1.v42.hidefrom_tooltip.v2alpha1.json |
"""
test utils
"""
from nose.plugins.attrib import attr
from lms.djangoapps.ccx.tests.factories import CcxFactory
from student.roles import CourseCcxCoachRole
from student.tests.factories import (
AdminFactory,
)
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase,
TEST_DATA_SPLIT_MODU... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(u... | 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 | ||
# lifepim.py
import os
import sys
import aikif.project as mod_prj
import aikif.core_data as mod_core
import aikif.dataTools.cls_datatable as mod_dat
#print(sys.version)
def main():
fname = 'journal.csv'
p = mod_prj.Project('Journal Record')
print(p.nme)
# Attempt #1 - using DataTable directly (TOK)
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.forms import FloatField, NumberInput, ValidationError
from django.test import SimpleTestCase
from django.utils import formats, translation
from . import FormFieldAssertionsMixin
class FloatFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
def test_floatfiel... | unknown | codeparrot/codeparrot-clean | ||
import os
import sublime
import logging
from logging.handlers import RotatingFileHandler
import tempfile
mm_dir = os.path.dirname(__file__)
sublime_version = int(float(sublime.version()))
settings = None
merge_settings = None
logger = None
def setup_logging():
try:
settings = sublime.load_settings('maven... | 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 | ||
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modi... | c | github | https://github.com/nodejs/node | src/node_crypto.h |
# (c) 2016 Red Hat 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) any later version.
#
# Ansible is dis... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Import modules
import subprocess,time,sys,os,re
definepath=os.getcwd()
sys.path.append("%s/bin/ftsrc/" % (definepath))
import include
# define metasploit path
meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines()
for line in meta_path:
line=line.rstrip()
match=re.s... | unknown | codeparrot/codeparrot-clean | ||
#include <immintrin.h>
#ifdef _MSC_VER
#include <ammintrin.h>
#else
#include <x86intrin.h>
#endif
int main(void)
{
__m128i a = _mm_comge_epu32(_mm_setzero_si128(), _mm_setzero_si128());
return _mm_cvtsi128_si32(a);
} | c | github | https://github.com/numpy/numpy | numpy/_core/src/_simd/checks/cpu_xop.c |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
"""
Given a sorted array of integers nums and integer values a, b and c. Apply a function of the form f(x) = ax2 + bx + c to each element x in the array.
The returned array must be in sorted order.
Expected time complexity: O(n)
Example:
nums = [-4, -2, 2, 4], a = 1, b = 3, c = 5,
Result: [3, 9, 15, 33]
nums = [-4... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessor5.ts] ////
//// [autoAccessor5.ts]
class C1 {
accessor ["w"]: any;
accessor ["x"] = 1;
static accessor ["y"]: any;
static accessor ["z"] = 2;
}
declare var f: any;
class C2 {
accessor [f()] = 1;
}
//// [autoAccessor5.js]... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/autoAccessor5(target=es5).js |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.convert import po2prop, test_convert
from translate.misc import wStringIO
from translate.storage import po
class TestPO2Prop:
def po2prop(self, posource):
"""helper that converts po source to .properties source without requiring files"""
... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
from gettext import gettext as _
from optparse import OptionParser, OptionGroup
from subprocess import Popen, PIPE
from hashlib import sha256
PKG_DIR = 'pkg'
ARCHIVE_SUFFIX = '.tar.gz'
PATH = _('the path to be searched for puppet modules. the path must be'
' relative to the working dire... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2022 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 applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/ko/tasks/semantic_segmentation.md |
import os
class ResourceObserver(object):
"""Provides the interface for observing resources
`ResourceObserver`\s can be registered using `Project.
add_observer()`. But most of the time `FilteredResourceObserver`
should be used. `ResourceObserver`\s report all changes passed
to them and they don'... | 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-context/src/test/java/example/scannable/NamedStubDao.java |
<!--Copyright 2022 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 applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/ja/tasks/image_classification.md |
// Some combinations of features may not use these constants.
#![cfg_attr(not(feature = "full"), allow(dead_code))]
/// Error string explaining that the Tokio context hasn't been instantiated.
pub(crate) const CONTEXT_MISSING_ERROR: &str =
"there is no reactor running, must be called from the context of a Tokio 1.... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/util/error.rs |
import unittest
import fib
class Testing(unittest.TestCase):
def test_testing(self):
self.assertEqual(1,1, "Of course it does!")
class Fib_(unittest.TestCase):
def setUp(self):
self.fib = fib.fib2
def basecase_num_1(self):
self.assertEqual(self.fib(1), 0, "fib num 1 is not corre... | unknown | codeparrot/codeparrot-clean | ||
<!-- #docregion control-binding -->
<label for="name">Name: </label>
<input id="name" type="text" [formControl]="name" />
<!-- #enddocregion control-binding -->
<!-- #docregion display-value -->
<p>Value: {{ name.value }}</p>
<!-- #enddocregion display-value -->
<!-- #docregion update-value -->
<button type="button" ... | html | github | https://github.com/angular/angular | adev/src/content/examples/reactive-forms/src/app/name-editor/name-editor.component.html |
{
"compilerOptions": {
"incremental": true,
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolu... | json | github | https://github.com/vercel/next.js | examples/with-react-intl/tsconfig.json |
#!/usr/bin/env python2
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(sys... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import sys
def warn(msg):
print('[powerline-bash] ', msg)
class Powerline:
symbols = {
'compatible': {
'lock': 'RO',
'network': 'SSH',
'separator': u'\u25B... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2015 The QingYuan 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... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration3_es5.ts] ////
//// [asyncFunctionDeclaration3_es5.ts]
function f(await = await) {
}
//// [asyncFunctionDeclaration3_es5.js]
"use strict";
function f(await) {
if (await === void 0) { await = await; }
} | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es5).js |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# A... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals, division, absolute_import, print_function
import logging
from flexget import options, plugin
from flexget.event import event
from flexget.logger import console
log = logging.getLogger('try_regexp')
class PluginTryRegexp(object):
"""
This plugin allows user to test... | unknown | codeparrot/codeparrot-clean | ||
# $Id$
#
# SIP Conference Bot
#
# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your optio... | unknown | codeparrot/codeparrot-clean | ||
# Description: Shows how to use C4.5 learner
# Category: learning
# Classes: C45Learner, C45Classifier
# Uses: iris
# Referenced: C45Learner.htm
import orange
data = orange.ExampleTable("iris")
tree = orange.C45Learner(data)
print "\n\nC4.5 with default arguments"
for i in data[:5]:
print tree(i),... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/shunya/Dropbox/workspace/Python/eHayashiya/repaperCompanion.ui'
#
# Created: Mon Apr 27 17:53:27 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT8515 1.5A dual channel LED driver
maintainers:
- Linus Walleij <linusw@kernel.org>
description: |
The Richte... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/leds/richtek,rt8515.yaml |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | connect/api/src/main/java/org/apache/kafka/connect/transforms/Transformation.java |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
'''
This is an extra tool, not bundled with the default waf binary.
To add the boost tool to the waf file:
$ ./waf-light --tools=compat15,boost
or, if you have waf >= 1.6.2
... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
)
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
parse_resolution,
str_or_none,
try_get,
unified_timestamp,
url_or_no... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding: utf-8
#openbsd python setup.py
import os
from setuptools import setup
if os.name == 'nt':
import py2exe
setup(name='marionette-tg',
console=['bin/marionette_client','bin/marionette_server'],
scripts=['bin/marionette_client','bin/marionette_server'],
test_suite=... | unknown | codeparrot/codeparrot-clean | ||
import time
import pytest
import numpy as np
import multiprocessing
import psi4
# Test below is fine on its own but erratic through pytest. Most likely
# to succeed as first test collected, so here it lies.
@pytest.mark.xfail(True, reason='threading treatment suspect', run=True)
def disabled_test_threaded_blas():
... | unknown | codeparrot/codeparrot-clean | ||
from django.core.paginator import InvalidPage, Paginator
from django.utils.translation import ugettext_lazy as _
from haystack import connections
from oscar.core.loading import get_class
from . import facets
FacetMunger = get_class('search.facets', 'FacetMunger')
class SearchHandler(object):
"""
A class tha... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2011 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | unknown | codeparrot/codeparrot-clean | ||
package main
import (
"flag"
"fmt"
"net"
"os"
"os/signal"
"syscall"
"github.com/ishidawataru/sctp"
"github.com/moby/moby/v2/dockerversion"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
)
// The caller is expected to pass-in open file descriptors ...
const (
// Pipe for reporting status, as a string. "0\... | go | github | https://github.com/moby/moby | cmd/docker-proxy/main_linux.go |
from . import util
abc = util.import_importlib('importlib.abc')
init = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
importlib_util = util.import_importlib('importlib.util')
import os
import string
import sys
from test import support
import types
import unittest
import war... | unknown | codeparrot/codeparrot-clean | ||
import vstruct
import vstruct.defs.inet as vs_inet
from vstruct.primitives import *
PCAP_LINKTYPE_ETHER = 1
PCAP_LINKTYPE_RAW = 101
PCAPNG_BOM = 0x1A2B3C4D
OPT_ENDOFOPT = 0
OPT_COMMENT = 1
#PCAPNG_BLOCKTYPE_SECTION_HEADER options
OPT_SHB_HARDWARE = 2
OPT_SHB_OS ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# File created on 09 Feb 2010
from __future__ import division
__author__ = "Justin Kuczynski, Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczynski"
__email__ = "justinak... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import urllib
from django.contrib import auth
from django.contrib.auth.signals import user_logged_in
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.manager import EmptyManager
from django.contrib.contenttypes.models import ContentType
from dja... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/migrations/versions/0011_2_9_0_add_dataset_expression_in_dagmodel.py |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
import torch
from ..utils import nonzero
class BalancedPositiveNegativeSampler(object):
"""
This class samples batches, ensuring that they contain a fixed proportion of posit... | 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/api_fastapi/core_api/routes/ui/gantt.py |
fun foo() {}
fun test() {
fo<caret>o()
} | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/danglingFileReferenceResolve/functionSameFile.kt |
#!/usr/bin/env python
from flask import Flask, request
import couchdb, json, datetime
app = Flask(__name__)
''' *** List of accessible api urls ***
***NOTE: until Akash finishes user authentication/security, <string:id> will be the name of the user
1. '/' is a get request that tests accessibility to the flask serve... | unknown | codeparrot/codeparrot-clean | ||
/*
* rmgrdesc.c
*
* pg_waldump resource managers definition
*
* src/bin/pg_waldump/rmgrdesc.c
*/
#define FRONTEND 1
#include "postgres.h"
#include "access/brin_xlog.h"
#include "access/clog.h"
#include "access/commit_ts.h"
#include "access/generic_xlog.h"
#include "access/ginxlog.h"
#include "access/gistxlog.h"
... | c | github | https://github.com/postgres/postgres | src/bin/pg_waldump/rmgrdesc.c |
/* MIT License
*
* Copyright (c) 2024 Brad House
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, ... | c | github | https://github.com/nodejs/node | deps/cares/src/lib/event/ares_event_configchg.c |
#!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2016, Martin Packman <martin.packman@canonical.com>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PUR... | unknown | codeparrot/codeparrot-clean | ||
#
# This file is part of Scylla.
#
# Scylla is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Scylla is distributed in the hop... | 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/security/token/DelegationTokenIssuer.java |
# -*- coding: utf-8 -*-
"""
requests.defaults
~~~~~~~~~~~~~~~~~
This module provides the Requests configuration defaults.
Configurations:
:base_headers: Default HTTP headers.
:verbose: Stream to write request logging to.
:max_redirects: Maximum number of redirects allowed within a request.s
:keep_alive: Reuse HTTP ... | unknown | codeparrot/codeparrot-clean | ||
"""Sanity test using PSScriptAnalyzer."""
from __future__ import absolute_import, print_function
import collections
import json
import os
import re
from lib.sanity import (
SanitySingleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
SanitySkipped,
)
from lib.util import (
SubprocessErro... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package graph
import "github.com/hashicorp/terraform/internal/tfdiags"
// DiagnosticCausedByTestFailure implements multiple interfaces that enables it to
// be used in the "Extra" field of a diagnostic. This type should only be used as
// the Extr... | go | github | https://github.com/hashicorp/terraform | internal/moduletest/graph/diagnostics.go |
area: ES|QL
issues: []
pr: 142160
summary: Add `appliesTo` to the TRange and TBucket functions
type: enhancement | unknown | github | https://github.com/elastic/elasticsearch | docs/changelog/142160.yaml |
"""
Implementacion del algoritmo de recocido simulado
para la materia electiva Computacion Emergente
@author Yohan Graterol <yograterol@fedoraproject.org> 2013
"""
from collections import deque
from math import exp
try:
from numpy.random import (permutation, random_sample)
from numpy import (log, matrix, array... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import os
import subprocess
import tempfile
import logging
import hgapi
import errno
# fsutils, , misc filesystem utils, internal
import fsutils
git_logger = logging.getLogg... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.