code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | unknown | codeparrot/codeparrot-clean | ||
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
"""colors.py - select how to color the atoms in the GUI."""
import gtk
from gettext import gettext as _
from ase.gui.widgets import pack, cancel_apply_ok, oops, help
import ase
from ase.data.colors import jmol_colors
import numpy as np
import colorsys
named_colors = ('Green', 'Yellow', 'Blue', 'Red'... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2006-2024 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org/libs/flyweight for library home page.
*/
#ifndef BOOST_FLYWEIGHT_REFCOUNTED_HPP
#defi... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/flyweight/refcounted.hpp |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import uuid
import requests
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth import Auth
from framework.auth.core import get_user
from website import util
from website import security
from website import settings
from website.project import n... | unknown | codeparrot/codeparrot-clean | ||
#problem found in distance computation
import codecs
from math import sqrt
users2 = {"Amy": {"Taylor Swift": 4, "PSY": 3, "Whitney Houston": 4},
"Ben": {"Taylor Swift": 5, "PSY": 2},
"Clara": {"PSY": 3.5, "Whitney Houston": 4},
"Daisy": {"Taylor Swift": 5, "Whitney Houston": 3}}
users =... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import json
import flask
import friendsNet.resources as resources
import friendsNet.database as database
DB_PATH = 'db/friendsNet_test.db'
ENGINE = database.Engine(DB_PATH)
COLLECTION_JSON = "application/vnd.collection+json"
HAL_JSON = "application/hal+json"
MEDIA_ITEM_PROFILE = "/profiles/media_item... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# encoding: utf-8
from vilya.config import DOMAIN
from dispatches.notifications import NotificationDispatcher
from vilya.libs.irc import IrcMsg
from vilya.models.actions.team_add_member import TeamAddMember
from vilya.models.notification import Notification
class Dispatcher(NotificationDispatche... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# This class is inherited by the has_one and belongs_to association classes
module ActiveRecord::Associations::Builder # :nodoc:
class SingularAssociation < Association # :nodoc:
def self.valid_options(options)
super + [:required, :touch]
end
def self.define_accessor... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/associations/builder/singular_association.rb |
# 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
# d... | unknown | codeparrot/codeparrot-clean | ||
# The MIT License (MIT)
#
# Copyright (c) 2014 Louis Marchand
#
# 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, mo... | unknown | codeparrot/codeparrot-clean | ||
# Config of faster rcnn
import sys, os, logging
sys.path.append('..')
from unrealcv import client
# RCNN config
rcnn_path = '/home/qiuwch/workspace/py-faster-rcnn'
sys.path.append(os.path.join(rcnn_path, 'tools'))
import demo as D # Use demo.py provided in faster-rcnn
import numpy as np
import matplotlib.pyplot as plt... | 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
import os,re,sys,shutil
from waflib import Utils,Errors
exclude_regs='''
**/*~
**/#*#
**/.#*
**/%*%
**/._*
**/CVS
**/CVS/**
**/.cvsignore
**/SCCS
**/SCCS/**
**/vssver.scc
**/.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import textwrap, types
from logging import CRITICAL, DEBUG, INFO, Logger, StreamHandler, Formatter
from logging import addLevelName, setLoggerClass, FileHandler, Filter
from plasTeX.Config import config as _config
MAX_WIDTH = 75
LOG_FORMAT = '[%(name)s] %(levelname)s: %(message)s'
STATUS_FORMAT ... | unknown | codeparrot/codeparrot-clean | ||
from mpi4py import MPI
import mpiunittest as unittest
class BaseTestFortran(object):
HANDLES = []
def testFortran(self):
for handle1 in self.HANDLES:
try:
fint = handle1.py2f()
except NotImplementedError:
continue
handle2 = type(handle... | unknown | codeparrot/codeparrot-clean | ||
{% if use_tag %}<{{ tag }}{% include 'django/forms/attrs.html' %}>{{ label }}</{{ tag }}>{% else %}{{ label }}{% endif %} | html | github | https://github.com/django/django | django/forms/templates/django/forms/label.html |
import datetime
import os
from django import forms
from django.conf import settings
from django.utils.safestring import mark_safe
import basket
import happyforms
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
import mkt
from mkt.comm.utils import create_comm_note
from mkt.constants import... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python
# Copyright (C) 2003 by Martin Pool <mbp@samba.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"fmt"
"math"
"sort"
"time"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/security/username"
... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/virtual_schema.go |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/CachedDNSToSwitchMapping.java |
#!/usr/bin/env python
# Copyright (c) 2013 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.
"""Schema of the JSON summary file written out by the GM tool.
This must be kept in sync with the kJsonKey_ constants in gm_expect... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | docs/examples/websocket.c |
{
"applyable": true,
"complete": true,
"configuration": {
"provider_config": {
"tfcoremock": {
"full_name": "registry.terraform.io/hashicorp/tfcoremock",
"name": "tfcoremock",
"version_constraint": "0.1.1"
}
},
"root_module": {
"resources": [
{
... | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/outputs/fully_populated_complex_update/plan.json |
from PySide import QtCore, QtGui
from colors import Colors
from demoitem import DemoItem
class ImageItem(DemoItem):
def __init__(self, image, maxWidth, maxHeight, scene=None, parent=None,
adjustSize=False, scale=1.0):
super(ImageItem, self).__init__(scene, parent)
self.image = image
... | unknown | codeparrot/codeparrot-clean | ||
"""Check Imports Script.
Quickly verify that a list of Python files can be loaded by the Python interpreter
without raising any errors. Ran before running more expensive tests. Useful in
Makefiles.
If loading a file fails, the script prints the problematic filename and the detailed
error traceback.
"""
import random... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/scripts/check_imports.py |
# This script is used by .github/workflows/wheels.yml to run the full test
# suite, and that the openblas version is correct.
set -xe
PROJECT_DIR="$1"
python -c "import numpy; numpy.show_config()"
if [[ $RUNNER_OS == "Windows" && $IS_32_BIT == true ]] ; then
# Avoid this in GHA: "ERROR: Found GNU link.exe instead ... | unknown | github | https://github.com/numpy/numpy | tools/wheels/cibw_test_command.sh |
#!/usr/bin/env python3
#
# Copyright (c) 2017-2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright... | unknown | codeparrot/codeparrot-clean | ||
# Based on _FileCache from
# http://python-twitter.googlecode.com/svn/trunk/twitter.py
# Modified to pickle/unpickle data
import md5
import os
import tempfile
import cPickle
class FileCacheError(Exception):
'''Base exception class for FileCache related errors'''
class FileCache(object):
DEPTH = 3
def __init_... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 International Business Machines 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
# ... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/nuvoton,ma35d1-nand.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Nuvoton MA35D1 NAND Flash Interface (NFI) Controller
maintainers:
- Hui-Ping Chen <hpchen0nvt@gmail.com>
allOf:
- ... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mtd/nuvoton,ma35d1-nand.yaml |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 | ||
# Copyright (C) 2013 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 ... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Description**
Converts an untyped histogram to a TDigest, assuming the values are centroids. | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/description/to_tdigest.md |
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not u... | java | github | https://github.com/elastic/elasticsearch | client/rest/src/test/java/org/elasticsearch/client/PreferHasAttributeNodeSelectorTests.java |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core import platform
class PossibleBrowser(object):
"""A browser that can be controlled.
Call Create() to launch the browser and begin m... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas.core.apply import (
_make_unique_kwarg_list,
maybe_mangle_lambdas,
)
def test_maybe_mangle_lambdas_passthrough():
assert maybe_mangle_lambdas("mean") == "mean"
assert maybe_mangle_lambdas(lambda x: x).__name__ == "<lambda>"
# don't mangle single lambda.... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/test_aggregation.py |
use crate::runtime;
use crate::runtime::{context, scheduler, RuntimeFlavor, RuntimeMetrics};
/// Handle to the runtime.
///
/// The handle is internally reference-counted and can be freely cloned. A handle can be
/// obtained using the [`Runtime::handle`] method.
///
/// [`Runtime::handle`]: crate::runtime::Runtime::h... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/handle.rs |
# -*- coding: utf-8 -*-
import os
import sys
sys.path.append(os.path.join(os.getcwd(), os.path.pardir))
import unittest
from digraph import digraph
class test_graph(unittest.TestCase):
def setUp(self):
self.gr = digraph()
self.gr.add_nodes(["a", "b", "c", "d", "e", "f"])
self.gr.add_edges... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | unknown | codeparrot/codeparrot-clean | ||
import { ok, test } from '../../test';
export default test({
get props() {
return {
/** @type {any} */
testName: 'testClassName'
};
},
html: '<div class="testClassName svelte-70s021"></div>',
test({ assert, component, target }) {
const div = target.querySelector('div');
ok(div);
assert.equal(div.... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/attribute-null-func-classname-with-style/_config.js |
from cloudinary.models import CloudinaryField
from django.contrib.auth.models import User
from django.db import models
from multiselectfield import MultiSelectField
group_permissions = (
('INVITE_MEMBER', 'Send invites'),
('DELETE_MEMBER', 'Remove members'),
('BLOCK_MEMBER', 'Block members'),
('SUSPEND... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import user_passes_test
from django.db.models import Q
from django.forms import modelformset_factory
from django.shortcuts import render, redirect
from elearning.course.fo... | unknown | codeparrot/codeparrot-clean | ||
# 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/.
from selenium.webdriver.common.by import By
from pages.base import BasePage
from pages.regions.download_button import D... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/IOSupplier.java |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de>
# 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_f... | unknown | codeparrot/codeparrot-clean | ||
"""Support annotations for C API elements.
* Reference count annotations for C API functions.
* Stable ABI annotations
* Limited API annotations
Configuration:
* Set ``refcount_file`` to the path to the reference count data file.
* Set ``stable_abi_file`` to the path to stable ABI list.
"""
from __future__ import an... | python | github | https://github.com/python/cpython | Doc/tools/extensions/c_annotations.py |
"Misc. utility functions/classes for admin documentation generator."
import re
from email.errors import HeaderParseError
from email.parser import HeaderParser
from django.core.urlresolvers import reverse
from django.utils.encoding import force_bytes
from django.utils.safestring import mark_safe
try:
import docut... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "models/post"
class OptimizerHintsTest < ActiveRecord::AbstractMysqlTestCase
if supports_optimizer_hints?
fixtures :posts
def test_optimizer_hints
assert_queries_match(%r{\ASELECT /\*\+ NO_RANGE_OPTIMIZATION\(posts index_posts_on_author_id\... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/adapters/abstract_mysql_adapter/optimizer_hints_test.rb |
from datetime import datetime
import decimal
from decimal import Decimal
import re
import numpy as np
import pytest
from pandas.errors import (
Pandas4Warning,
SpecificationError,
)
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Grouper,... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/groupby/test_groupby.py |
# FSGS - Common functionality for FS Game System.
# Copyright (C) 2013-2016 Frode Solheim <frode@openretro.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License... | unknown | codeparrot/codeparrot-clean | ||
{
"api": {
"admin": false,
"exclude_alerts": true,
"label_values_match": true,
"lifecycle": false,
"openapi_3.1": true,
"openapi_3.2": true,
"otlp_write_receiver": false,
"query_stats": true,
"query_warnings": true,
"remote_write_receiver": false,
"time_range_labels": true,... | json | github | https://github.com/prometheus/prometheus | cmd/prometheus/testdata/features.json |
# -*- coding: utf-8 -*-
#
#################################################################################################
# #
# Program for analysing HiSPARC data #
# #
# This software is made under the GNU General Public License, version 3 (GPL-3.0) #
#... | unknown | codeparrot/codeparrot-clean | ||
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn... | unknown | codeparrot/codeparrot-clean | ||
######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys, os
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
d... | unknown | codeparrot/codeparrot-clean | ||
#ifdef USE_CUDA
#include <ATen/cuda/CUDAConfig.h> // for the definition of AT_CUDNN_ENABLED
#if AT_CUDNN_ENABLED()
#include <ATen/ATen.h>
#include <torch/library.h>
#include <ATen/native/quantized/cpu/QuantUtils.h>
#include <ATen/native/quantized/cudnn/utils.h>
#include <ATen/native/quantized/library.h>
#include <AT... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cudnn/ConvPrepack.cpp |
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | unknown | codeparrot/codeparrot-clean | ||
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2013-2014 David Herrmann <dh.herrmann@gmail.com>
#
# systemd 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 F... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/common/network/ChannelBuildersTest.java |
"""ParenMatch -- for parenthesis matching.
When you hit a right paren, the cursor should move briefly to the left
paren. Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
"""
from idlelib.hyperparser import HyperParser
from idlelib.config import idleConf
_openers... | python | github | https://github.com/python/cpython | Lib/idlelib/parenmatch.py |
from datetime import timedelta
import re
import zoneinfo
from dateutil.tz import gettz
import pytest
from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
from pandas.errors import OutOfBoundsDatetime
from pandas import (
NaT,
Timestamp,
)
class TestTimestampTZLocalize:
def test_tz_localize_pushes_out_... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/scalar/timestamp/methods/test_tz_localize.py |
r"""TELNET client class.
Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds
Example:
>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79) # connect to finger port
>>> tn.write(b'guido\r\n')
>>> print(tn.read_all())
Login Name TTY Idle When... | unknown | codeparrot/codeparrot-clean | ||
"""
==============================================
A demo of the Spectral Co-Clustering algorithm
==============================================
This example demonstrates how to generate a dataset and bicluster it
using the Spectral Co-Clustering algorithm.
The dataset is generated using the ``make_biclusters`` funct... | python | github | https://github.com/scikit-learn/scikit-learn | examples/bicluster/plot_spectral_coclustering.py |
'use strict';
const common = require('../common.js');
const StringDecoder = require('string_decoder').StringDecoder;
const assert = require('node:assert');
const bench = common.createBenchmark(main, {
encoding: ['ascii', 'utf8', 'base64-utf8', 'base64-ascii', 'utf16le'],
inLen: [32, 128, 1024],
chunkLen: [16, 25... | javascript | github | https://github.com/nodejs/node | benchmark/string_decoder/string-decoder.js |
# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
# Copyright 2017 FUJITSU LIMITED
#
# 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/LICE... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* varbit.c
* Functions for the SQL datatypes BIT() and BIT VARYING().
*
* The data structure contains the following elements:
* header -- length of the whole data structure (incl header)
* in bytes (as with all varyin... | c | github | https://github.com/postgres/postgres | src/backend/utils/adt/varbit.c |
# 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 applicab... | unknown | codeparrot/codeparrot-clean | ||
import copy
import PyFBA
from PyFBA import log_and_message
def uptake_and_secretion_reactions(model_compounds, media):
"""
Figure out which compounds can be taken up from the media and/or secreted into the media. We provide an endless
reaction for these which allows them to be taken up and/or secreted with... | unknown | codeparrot/codeparrot-clean | ||
# Ahead-of-time (AOT) compilation
An Angular application consists mainly of components and their HTML templates.
Because the components and templates provided by Angular cannot be understood by the browser directly, Angular applications require a compilation process before they can run in a browser.
The Angular ahead... | unknown | github | https://github.com/angular/angular | adev/src/content/tools/cli/aot-compiler.md |
# -*- test-case-name: twisted.test.test_amp.TLSTest,twisted.test.test_iosim -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utilities and helpers for simulating a network
"""
from __future__ import print_function
import itertools
try:
from OpenSSL.SSL import Error as NativeOpenSS... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'tylin'
__version__ = '1.0.1'
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visualizing the annotations in COCO.
# Ple... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, api, exceptions, _
class Ir... | unknown | codeparrot/codeparrot-clean | ||
pr: 139752
summary: Take control of max clause count verification in Lucene searcher
area: Search
type: enhancement
issues: [] | unknown | github | https://github.com/elastic/elasticsearch | docs/changelog/139752.yaml |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | unknown | codeparrot/codeparrot-clean | ||
{
"READWRITE": {
"summary": "Enables read-write queries for a connection to a Reids Cluster replica node.",
"complexity": "O(1)",
"group": "cluster",
"since": "3.0.0",
"arity": 1,
"function": "readwriteCommand",
"command_flags": [
"FAST",
... | json | github | https://github.com/redis/redis | src/commands/readwrite.json |
/* contrib/pgstattuple/pgstattuple--1.4--1.5.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pgstattuple UPDATE TO '1.5'" to load this file. \quit
CREATE OR REPLACE FUNCTION pgstattuple(IN relname text,
OUT table_len BIGINT, -- physical table length in ... | sql | github | https://github.com/postgres/postgres | contrib/pgstattuple/pgstattuple--1.4--1.5.sql |
"""
Virtual environment (venv) package for Python. Based on PEP 405.
Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
"""
import logging
import os
import shutil
import subprocess
import sys
import sysconfig
import types
import shlex
CORE_VENV_DEPS = ('pip',)
logger = logging.get... | python | github | https://github.com/python/cpython | Lib/venv/__init__.py |
"""
This module contains general purpose URL functions not found in the standard
library.
Some of the functions that used to be imported from this module have been moved
to the w3lib.url module. Always import those from there instead.
"""
import posixpath
import urlparse
import urllib
import cgi
# scrapy.utils.url wa... | 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 | ||
from owslib.waterml.wml import SitesResponse, TimeSeriesResponse, VariablesResponse, namespaces
from owslib.etree import etree
def ns(namespace):
return namespaces.get(namespace)
class WaterML_1_1(object):
def __init__(self, element):
if isinstance(element, str) or isinstance(element, unicode):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import logging
import optparse
import traceback
import unittest
import sys
import os
import utils
import framework
from queryservice_tests import cache_tests
from queryservice_tests import nocache_tests
from queryservice_tests import stream_tests
from queryservice_tests import status_tests
from... | unknown | codeparrot/codeparrot-clean | ||
"""
Copyright (c) 2016 Keith Sterling
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, merge, publish, distribute,... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2020 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 | cmd/kube-scheduler/app/server_test.go |
"""Testing for K-means"""
import re
import sys
from io import StringIO
import numpy as np
import pytest
from scipy import sparse as sp
from threadpoolctl import threadpool_info
from sklearn.base import clone
from sklearn.cluster import KMeans, MiniBatchKMeans, k_means, kmeans_plusplus
from sklearn.cluster._k_means_c... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/cluster/tests/test_k_means.py |
'use strict';
const common = require('../common.js');
const bench = common.createBenchmark(main, {
aligned: ['true', 'false'],
method: ['swap16', 'swap32', 'swap64'/* , 'htons', 'htonl', 'htonll' */],
len: [64, 256, 768, 1024, 2056, 8192],
n: [1e6],
}, {
test: { len: 16 },
});
// The htons and htonl method... | javascript | github | https://github.com/nodejs/node | benchmark/buffers/buffer-swap.js |
"""Platform for sensor integration."""
from datetime import timedelta
import logging
from oru import Meter, MeterError
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ENERGY_KILO_WATT_HOUR
import homeassistant.helpers.config_validation as cv
from ho... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "v0alpha1.heatmap-x.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-heatmap/v0alpha1.heatmap-x.v42.v1beta1.json |
# Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
r'''>>> import pickle2_ext
>>> import pickle
>>> pickle2_ext.world.__module__
'pickle2_ext'
>>> pickle2_ext.world.__safe... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
from MDAnalysis import *
#from MDAnalysis.analysis.align import *
import numpy
import math
u = Universe("init.pdb","temp.pos.pdb")
v = Universe("init.pdb")
# residues
a1 = u.selectAtoms("segid A and resid 46")
b1 = u.selectAtoms("segid B and resid 90")
a2 = u.selectAtoms("segid A and resid 69"... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {CompilerError} from '../CompilerError';
import {
BlockId,
Effect,
GeneratedSource,
HIRFunction,
Instruction,
... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/HIR/MergeConsecutiveBlocks.ts |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##########################################################################
# OpenWebif: control
##########################################################################
# Copyright (C) 2011 - 2020 E2OpenPlugins
#
# This program is free software; you can redistribute it and/o... | unknown | codeparrot/codeparrot-clean | ||
from os import path
from mock import Mock
from golem.task.localcomputer import LocalComputer
from golem.task.taskbase import Task, ComputeTaskDef
from golem.tools.ci import ci_skip
from golem.tools.testdirfixture import TestDirFixture
from apps.blender.blenderenvironment import BlenderEnvironment
@ci_skip
class Tes... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for defer() and only().
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Secondary(models.Model):
first = models.CharField(max_length=50)
second = models.CharField(max_length=50)
@python_2_unicode_compatible
class Primary(models.Model):
name =... | unknown | codeparrot/codeparrot-clean | ||
from setuptools import setup, find_packages
NAME = 'mezzanine-blocks'
VERSION = '0.9.4'
DESCRIPTION = """
A fork of https://github.com/molokov/mezzanine-blocks.git to make it work with Django 1.9
A mezzanine flavored fork of django-flatblocks.
The goal of this project is to be able to easily create custom blocks of
... | 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/tools/kernel_gen/transforms/passes.h |
const {mutate} = require('shared-runtime');
function component(a) {
let x = {a};
let y = {};
(function () {
y.x = x;
})();
mutate(y);
return y;
}
export const FIXTURE_ENTRYPOINT = {
fn: component,
params: ['foo'],
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-mutate-iife.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.