code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
try:
from pyb import CAN
except ImportError:
print("SKIP")
raise SystemExit
from array import array
import micropython
import pyb
# test we can correctly create by id (2 handled in can2.py test)
for bus in (-1, 0, 1, 3):
try:
CAN(bus, CAN.LOOPBACK)
print("CAN", bus)
except ValueErr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: windows-1252 -*-
from struct import unpack, pack
import BIFFRecords
class StrCell(object):
__slots__ = ["rowx", "colx", "xf_idx", "sst_idx"]
def __init__(self, rowx, colx, xf_idx, sst_idx):
self.rowx = rowx
self.colx = colx
self.xf_idx = xf_idx
self.sst_idx = sst... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {Injectable, signal} from '@angular/core';
import {isIos} from '@angular/docs';
import {LoadingStep} from '.... | typescript | github | https://github.com/angular/angular | adev/src/app/editor/node-runtime-state.service.ts |
def topological_sort_as_sets(dependency_graph):
"""Variation of Kahn's algorithm (1962) that returns sets.
Takes a dependency graph as a dictionary of node => dependencies.
Yields sets of items in topological order, where the first set contains
all nodes without dependencies, and each following set co... | unknown | codeparrot/codeparrot-clean | ||
name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.11
# build dependencies
- versioneer
- cython<4.0.0a0
- meson=1.10.0
- meson-python=0.18.0
# test dependencies
- pytest>=8.3.4
- pytest-cov
- pytest-xdist>=3.6.1
- pytest-localserver>=0.9.0
- pytest-qt>=4.4.0
- boto3=1.37.3
... | unknown | github | https://github.com/pandas-dev/pandas | ci/deps/actions-311.yaml |
//===--- Shutdown.h - Unclean exit scenarios --------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/support/Shutdown.h |
/*
* Copyright 2010-2026 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
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.anal... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/KaSession.kt |
"""
timedelta support tools
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
overload,
)
import numpy as np
from pandas._libs import lib
from pandas._libs.tslibs import (
NaT,
NaTType,
)
from pandas._libs.tslibs.timedeltas import (
Timedelta,
disallow_ambig... | python | github | https://github.com/pandas-dev/pandas | pandas/core/tools/timedeltas.py |
#!/usr/bin/python
from __future__ import unicode_literals
import base64
from contextlib import closing
import os
import socket
import sys
import threading
from wsgiref.simple_server import make_server, WSGIRequestHandler
from .openmetrics import exposition as openmetrics
from .registry import REGISTRY
from .utils im... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Auth\Passwords;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
class PasswordResetServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* Register the service provider.
*
* @return void
*/
publi... | php | github | https://github.com/laravel/framework | src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import pickle
import re
import shutil
import tempfile
import time
import unittest
from telemetry.core import util
from telemetry import decorators... | unknown | codeparrot/codeparrot-clean | ||
# 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 with the License. You may obtain
# a ... | unknown | codeparrot/codeparrot-clean | ||
# ext/associationproxy.py
# Copyright (C) 2005-2011 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
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Pyth... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
from __future__ import unicode_literals
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from tastypie.compat import AUTH_USER_MODEL
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ApiAccess'
db.... | 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/main/java/org/apache/kafka/clients/admin/DeleteStreamsGroupsResult.java |
#!/usr/bin/python
# coding=utf-8
################################################################################
import time
from test import unittest
from mock import Mock
from mock import patch
from mock import call
import configobj
import diamond.handler.graphite as mod
from diamond.metric import Metric
# Thes... | unknown | codeparrot/codeparrot-clean | ||
# 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.
# This program is distributed in the hope that it will be useful,
# but... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.ts] ////
//// [part1.ts]
export namespace A {
export interface Point {
x: number;
y: number;
}
export namespace Utils {
export function mirror<T extend... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from_file... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.gis.db import models
class State(models.Model):
name = models.CharField(max_length=20)
objects = models.GeoManager()
class County(models.Model):
name = models.CharField(max_length=25)
state = models.ForeignKey(State)
mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in... | unknown | codeparrot/codeparrot-clean | ||
"""
HTML Widget classes
"""
from __future__ import unicode_literals
import copy
import datetime
import re
from itertools import chain
from django.conf import settings
from django.forms.utils import flatatt, to_current_timezone
from django.utils import datetime_safe, formats, six
from django.utils.datastructures impo... | unknown | codeparrot/codeparrot-clean | ||
##########################################################################
#
# Copyright (c) 2015, Image Engine Design 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:
#
# * Redistrib... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from measurements import record_per_area
from telemetry.core import wpr_modes
from telemetry.unittest import options_for_unittests
from telemetry.unittest im... | unknown | codeparrot/codeparrot-clean | ||
"""
This module implements the TextResponse class which adds encoding handling and
discovering (through HTTP headers) to base Response class.
See documentation in docs/topics/request-response.rst
"""
import six
from six.moves.urllib.parse import urljoin
import parsel
from w3lib.encoding import html_to_unicode, resol... | unknown | codeparrot/codeparrot-clean | ||
"""Simple magics for display formats"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----... | unknown | codeparrot/codeparrot-clean | ||
import logging
import logging.config
import time
import argparse
import sys
import cProfile
import re
class Main():
def __init__(self):
self.config = self._parse_args()
self.logger = self._setup_logging()
self.timer = self._setup_timing()
def _parse_args(self):
'''
Pars... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import json
import os
import sys
FILES = ['pii', 'ccn']
HEADERS = ['offset', 'content', 'context']
def main(uuid, log_path, output):
features = {}
path = os.path.normpath(os.path.join(log_path, 'bulk-' + uuid))
for name in FILE... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# This file is part of Moonfire NVR, a security camera network video recorder.
# Copyright (C) 2021 The Moonfire NVR Authors; see AUTHORS and LICENSE.txt.
# SPDX-License-Identifier: GPL-v3.0-or-later WITH GPL-3.0-linking-exception
"""Checks that expected header lines are present.
Call in either ... | unknown | codeparrot/codeparrot-clean | ||
from assetmgr.models import Asset
from courseaffils.models import Course
from django.contrib.auth.models import User
from django.test import TestCase
from djangosherd.models import SherdNote
import simplejson
class AssetTest(TestCase):
fixtures = ['unittest_sample_course.json']
def test_video(self):
#... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
QtWebKitWidgets.py
---------------------
Date : November 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
******************... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | unknown | codeparrot/codeparrot-clean | ||
"""
Low-level functions for arbitrary-precision floating-point arithmetic.
"""
__docformat__ = 'plaintext'
import math
from bisect import bisect
# Importing random is slow
#from random import getrandbits
getrandbits = None
from settings import (\
MP_BASE, MP_ZERO, MP_ONE, MP_TWO, MP_FIVE, MODE, STRICT, gmpy,
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.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
# ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2013-2014 eNovance SAS <licensing@enovance.com>
#
# 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 appl... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package awsauth
import (
"context"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/iam/iam... | go | github | https://github.com/hashicorp/vault | builtin/credential/aws/path_config_rotate_root_test.go |
# Dotenv examples
This example demonstrates using the DotenvPlugin via the `dotenv` top-level configuration option.
The DotenvPlugin loads environment variables from `.env` files and exposes them in your application through `process.env`.
## Features Demonstrated
1. **Basic Environment Variables**: Load variables w... | unknown | github | https://github.com/webpack/webpack | examples/dotenv/README.md |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2015 CERN.
#
# INSPIRE 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... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
import sys
import re
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.core.management.base import BaseCommand
from django.utils import simplejson
from django.utils.datastructures import Sort... | unknown | codeparrot/codeparrot-clean | ||
# Natural Language Toolkit: Internal utility functions
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# Nitin Madnani <nmadnani@ets.org>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import ... | unknown | codeparrot/codeparrot-clean | ||
import json
from django import forms
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStoreField']
class HStoreField(forms.CharField):
"""A field for HStore data which accepts JSON input."""
widget = forms.Tex... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import with_statement
from djangocms_text_ckeditor.models import Text
from django.contrib.admin.sites import site
from django.contrib.admin.util import unquote
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, Group, Permission
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012-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 | ||
#![cfg_attr(not(feature = "std"), allow(internal_features), feature(lang_items, start))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg_attr(not(feature = "std"), start)]
fn start(_argc: isize, _argv: *const *const u8) -> isize {
0
}
#[lang = "eh_personality"]
#[no_mangle]
#[cfg(not(feature = "std"))]
pub extern... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/displaydoc/tests/no_std/without.rs |
#-*- coding: utf-8 -*-
""" EOSS catalog system
Implementation of ESA sentinel1/2 catalog access
(https://scihub.copernicus.eu)
Users need to register at the scihub page to get access to their catalog system. These credentials are set by SENTINEL_USER and SENTINEL_PASSWORD
"""
__author__ = "Thilo Wehrmann, Steffen Ge... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2022 Meta Platforms and The HuggingFace Inc. 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
#
# Unle... | python | github | https://github.com/huggingface/transformers | src/transformers/models/data2vec/modeling_data2vec_vision.py |
# (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver... | unknown | codeparrot/codeparrot-clean | ||
package internal
import (
"encoding/json"
"io"
"slices"
"github.com/moby/moby/api/types"
)
const rs = 0x1E
type DecoderFn func(v any) error
// NewJSONStreamDecoder builds adequate DecoderFn to read json records formatted with specified content-type
func NewJSONStreamDecoder(r io.Reader, contentType string) Dec... | go | github | https://github.com/moby/moby | client/internal/json-stream.go |
"""
SAX driver for the pyexpat C module. This driver works with
pyexpat.__version__ == '2.22'.
"""
version = "0.20"
from xml.sax._exceptions import *
from xml.sax.handler import feature_validation, feature_namespaces
from xml.sax.handler import feature_namespace_prefixes
from xml.sax.handler import feature_external_... | unknown | codeparrot/codeparrot-clean | ||
"""
Asynchronous tasks for the CCX app.
"""
import logging
from ccx_keys.locator import CCXLocator
from django.dispatch import receiver
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import CourseLocator
from lms import CELERY_APP
from lms.djangoapps.ccx.models import CustomCourseForEdX
from xm... | unknown | codeparrot/codeparrot-clean | ||
import sys
from JumpScale import j
import imp
import time
import JumpScale.grid.osis
import unittest
import new
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class Tee(object):
def __init__(self, *fobjs):
self.fileobjs = fobjs
def write(self, data):
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Author: Nicolas Bessi, Leonardo Pistone
# Copyright 2013, 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
NaT,
Timestamp,
date_range,
)
import pandas._testing as tm
class TestDataFrameSortValues:
@pytest.mark.parametrize("dtype", [np.uint8, bool])
def test_sort_values_sparse_no_warning(self, dtype... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/methods/test_sort_values.py |
# -*- test-case-name: openid.test.test_xri -*-
"""Utility functions for handling XRIs.
@see: XRI Syntax v2.0 at the U{OASIS XRI Technical Committee<http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xri>}
"""
import re
XRI_AUTHORITIES = ['!', '=', '@', '+', '$', '(']
try:
unichr(0x10000)
except ValueErr... | 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 django.conf import settings
try:
import maxminddb
except ImportError:
maxminddb = None
if maxminddb is no... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import glob
import sys
from lib.config import s3_config
from lib.util import atom_gyp, execute, rm_rf, safe_mkdir, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SYMBOLS_DIR = 'dist\\symbols'
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchro... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from numpy.testing import assert_allclose
from sklearn.ensemble._hist_gradient_boosting._bitset import (
in_bitset_memoryview,
set_bitset_memoryview,
set_raw_bitset_from_binned_bitset,
)
from sklearn.ensemble._hist_gradient_boosting.common import X_DTYPE
@pytest.mark.param... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/tests/test_bitset.py |
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | go | github | https://github.com/prometheus/prometheus | storage/remote/metadata_watcher.go |
import { __nextjs_pure } from 'not-next-magic'
__nextjs_pure(console.log('test!')) | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/pure/no-name-clash/input.js |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Google, Inc.
# All rights reserved.
#
# 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 rig... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 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.
import optparse
import re
class RepeatOptions(object):
def __init__(self, page_repeat_secs=None, pageset_repeat_secs=None,
page_repeat_iter... | unknown | codeparrot/codeparrot-clean | ||
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/kuberuntime/kuberuntime_termination_order.go |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... | 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/cli/chat.py |
import logging
from xmodule.fields import Timedelta
log = logging.getLogger(__name__)
class TimeInfo(object):
"""
This is a simple object that calculates and stores datetime information for an XModule
based on the due date and the grace period string
So far it parses out three different pieces of time... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for account activation"""
from mock import patch
import unittest
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase, override_settings
from student.models import Registration
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid... | unknown | codeparrot/codeparrot-clean | ||
"""
Comparison of PCA and Manifold Learning
---------------------------------------
Figure 7.8
A comparison of PCA and manifold learning. The top-left panel shows an example
S-shaped data set (a two-dimensional manifold in a three-dimensional space).
PCA identifies three principal components within the data. Projectio... | unknown | codeparrot/codeparrot-clean | ||
import { MetadataRoute } from "next";
export const revalidate = 0;
async function getTotalCounts() {
const response = await fetch(
`${process.env.NEXT_PUBLIC_WORDPRESS_API_URL}/wp-json/sitemap/v1/totalpages`,
);
const data = await response.json();
if (!data) return [];
const propertyNames = Object.keys(... | typescript | github | https://github.com/vercel/next.js | examples/cms-wordpress/src/app/sitemap.ts |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/requests/DescribeAclsResponse.java |
#!/usr/bin/python
#
# Sched-credit tests modified from SEDF tests
#
import re
from XmTestLib import *
paramsRE = re.compile(r'^[^ ]* *[^ ]* *([^ ]*) *([^ ]*)$')
def get_sched_credit_params(domain):
status, output = traceCommand("xm sched-credit -d %s | tail -1" %
domain.getName... | unknown | codeparrot/codeparrot-clean | ||
import gtk
import ns.core
import ns.network
from visualizer.base import InformationWindow
NODE_STATISTICS_MEMORY = 10
class StatisticsCollector(object):
"""
Collects interface statistics for all nodes.
"""
class NetDevStats(object):
__slots__ = ['rxPackets', 'rxBytes', 'txPackets', 'txBytes',... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <c10/xpu/XPUStream.h>
namespace c10::xpu {
/*
* XPUEvent are movable not copyable wrappers around SYCL event. XPUEvent are
* constructed lazily when first recorded. It has a device, and this device is
* acquired from the first recording stream. Later streams that record the event
* must matc... | c | github | https://github.com/pytorch/pytorch | c10/xpu/XPUEvent.h |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: arrayTraceSimple.py
# Purpose: A simple script to demonstrate array ray tracing. We need to use
# the two functions from the module pyzdde.arraytrace --
# The first funct... | unknown | codeparrot/codeparrot-clean | ||
import caffe
import numpy as np
def main():
# This example is going to show you how you can use the API to predict
# PHOCs from a trained PHOCNet for your own word images.
# First we need to load the trained PHOCNet. We are going to use the trained
# PHOCNet supplied at
# http://patrec.cs.tu-dortm... | unknown | codeparrot/codeparrot-clean | ||
from django.conf.urls import url, patterns
from readthedocs.constants import pattern_opts
from readthedocs.builds.filters import VersionFilter
from readthedocs.projects.feeds import LatestProjectsFeed, NewProjectsFeed
from readthedocs.projects.filters import ProjectFilter
docs_urls = patterns(
'',
# For servi... | unknown | codeparrot/codeparrot-clean | ||
# orm/exc.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
"""SQLAlchemy ORM exceptions."""
from .. import exc as sa_exc, util
NO_STATE = (Attribut... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pandas as pd
def test_contains_nan(using_nan_is_na):
# GH#52840
arr = pd.array(range(5)) / 0
assert np.isnan(arr._data[0])
if using_nan_is_na:
assert arr.isna()[0]
else:
assert not arr.isna()[0]
assert np.nan in arr | python | github | https://github.com/pandas-dev/pandas | pandas/tests/arrays/floating/test_contains.py |
"""Classify changes in Ansible code."""
from __future__ import absolute_import, print_function
import collections
import os
import re
import time
from lib.target import (
walk_module_targets,
walk_integration_targets,
walk_units_targets,
walk_compile_targets,
walk_sanity_targets,
load_integra... | unknown | codeparrot/codeparrot-clean | ||
""" core implementation of testing process: init, session, runtest loop. """
import imp
import os
import re
import sys
import _pytest
import _pytest._code
import py
import pytest
try:
from collections import MutableMapping as MappingMixin
except ImportError:
from UserDict import DictMixin as MappingMixin
from... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
xmp.py
~~~~~~
Parses XMP metadata from PDF files.
By Matt Swain. Released under the MIT license.
http://blog.matt-swain.com/post/25650072381/a-lightweight-xmp-parser-for-extracting-pdf
"""
from collections import defaultdict
from xml.etree import ElementTree as ET
RDF_NS = "{http://www.w3... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
""" Downloads the location of the images hosted on the loc site
Using the photo ids obtained in script01, this downloads and parses
all of the main image information pages and extracts the location of
the stored images.
"""
import os
import urllib
import re
import socket
import copy
from multip... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
academic_year = filters.get("academic_year")
program = filters.get("pr... | 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-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/commit/Pending.java |
# 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 | ||
#!/usr/bin/env python
# Contributors:
# Christopher P. Barnes <senrabc@gmail.com>
# Andrei Sura: github.com/indera
# Mohan Das Katragadda <mohan.das142@gmail.com>
# Philip Chase <philipbchase@gmail.com>
# Ruchi Vivek Desai <ruchivdesai@gmail.com>
# Taeber Rapczak <taeber@ufl.edu>
# Nicholas Rejack <nrejack@ufl.edu>
# ... | unknown | codeparrot/codeparrot-clean | ||
# Simple test suite for Cookie.py
from test.test_support import run_unittest, run_doctest, check_warnings
import unittest
import Cookie
import pickle
class CookieTests(unittest.TestCase):
# Currently this only tests SimpleCookie
def test_basic(self):
cases = [
{ 'data': 'chips=ahoy; vienna... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 | ||
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
DOCUMENTATION = """
module: check_mode_attribute_4
short_description: Test for check mode attribute 4
description: Test for check mode attribute 4.
author:
- Ansible Core... | python | github | https://github.com/ansible/ansible | test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/check_mode_attribute_4.py |
"""
Django settings for hello_world project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2008 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/FeatureSpecificTestSuiteBuilder.java |
area: ES|QL
issues:
- 141627
pr: 141776
summary: ESQL fix TO_IP leading_zeros=octal parsing
type: bug | unknown | github | https://github.com/elastic/elasticsearch | docs/changelog/141776.yaml |
## Input
```javascript
// @validateRefAccessDuringRender
import {useRef} from 'react';
function Component() {
const ref = useRef(null);
const onClick = () => {
if (ref.current !== null) {
ref.current = '';
}
};
return (
<>
<input ref={ref} />
<button onClick={onClick} />
</... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-mutating-ref-in-callback-passed-to-jsx.expect.md |
'''
Copyright (C) 2014 ddurdle
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 distrib... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
'''HTTPHandler that supports a callback method for progress reports.
'''
import urllib2
import httplib
import logging
__all__ = ['urlopen']
logging.basicConfig()
LOG = logging.getLogger(__name__)
progress_callback = None
class ReportingSocket(object):
'''Wrapper around a socket. Give... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Ninja build generator"""
import argparse
import os
import pipes
import sys
import platform
import toolchain
import syntax
class Generator(object):
def __init__(self, project, includepaths = [], dependlibs = [], libpaths = [], variables = None):
parser = argparse.ArgumentParser(descrip... | unknown | codeparrot/codeparrot-clean | ||
from BinPy.operations import *
from nose.tools import with_setup, nottest, assert_raises
op = Operations()
def ADD_test():
if op.ADD(0, 1) != '1':
assert False
if op.ADD('0', '1') != '1':
assert False
if op.ADD('01', '10') != '11':
assert False
if op.ADD('110', '111') != '1101... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
import logging
import traceback
import time
from google.appengine.api import app_identity, mail, capabilities
from google.appengine.runtime import DeadlineExceededError
from tekton.router import PathNotFound
def get_apis_sta... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python2.4
# Copyright 2009, 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... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("./Module")} Module */
/** @typedef {import("./ModuleBu... | javascript | github | https://github.com/webpack/webpack | lib/ModuleDependencyError.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.