code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/python2.6
import os
import sys
import Queue
import threading
from subprocess import Popen, PIPE, STDOUT
import copy
import time
import re
import logging
class ExecutionError(Exception): pass
class Shell:
@classmethod
def sh(cls, cmd, host=None, username=None):
'''Execute a command locally or remot... | unknown | codeparrot/codeparrot-clean | ||
from thorpy.elements.slider import SliderX
from thorpy.elements.element import Element
from thorpy.miscgui import functions, style, painterstyle
class SliderXSetter(SliderX):
"""Like a slider, but has a get_value method"""
def __init__(self,
length,
limvals=None,
... | unknown | codeparrot/codeparrot-clean | ||
'''
Facebook error classes also see
http://fbdevwiki.com/wiki/Error_codes#User_Permission_Errors
'''
from __future__ import unicode_literals
import ssl
try:
# python 2 imports
from urllib2 import HTTPError, URLError
except ImportError:
# python 3 imports
from urllib.error import HTTPError, URLError
c... | unknown | codeparrot/codeparrot-clean | ||
#
# lasheight_classify.py
#
# (c) 2012, Martin Isenburg
# LASSO - rapid tools to catch reality
#
# uses lasheight to compute the height of LiDAR points above the ground
# and uses the height information to classify the points.
#
# The LiDAR input can be in LAS/LAZ/BIN/TXT/SHP/... format.
# The LiDAR output can be in LA... | unknown | codeparrot/codeparrot-clean | ||
"""
GitLab API: https://docs.gitlab.com/ce/api/pipeline_schedules.html
"""
import pytest
import responses
@pytest.fixture
def resp_project_pipeline_schedule(created_content):
content = {
"id": 14,
"description": "Build packages",
"ref": "master",
"cron": "0 1 * * 5",
"cron_t... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseMode.currency'
db.add_column('course_modes_coursemode', 'currency',
... | unknown | codeparrot/codeparrot-clean | ||
{
"$schema": "https://context7.com/schema/context7.json",
"projectTitle": "Angular",
"description": "Angular is a web framework that empowers developers to build fast, reliable applications",
"folders": [
"adev/src/content/guide/**",
"adev/src/content/ecosystem/**",
"adev/src/content/reference/error... | json | github | https://github.com/angular/angular | context7.json |
import datetime
from django.contrib import messages
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from celerydemo.tasks import do_something
def homepage(request):
return HttpResp... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import re
from .amp import AMPIE
from .common import InfoExtractor
class FoxNewsIE(AMPIE):
IE_NAME = 'foxnews'
IE_DESC = 'Fox News and Fox Business Video'
_VALID_URL = r'https?://(?P<host>video\.(?:insider\.)?fox(?:news|business)\.com)/v/(?:video-embed\.html\?video... | unknown | codeparrot/codeparrot-clean | ||
## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
##... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package os
import (
"errors"
_ "unsafe" // for linkname
)
//go:linkname executablePath
var executablePath string // set by ../runtime/os_darwin.go
var init... | go | github | https://github.com/golang/go | src/os/executable_darwin.go |
#!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | unknown | codeparrot/codeparrot-clean | ||
module.exports = require('@vue/compiler-sfc')
require('./register-ts.js') | javascript | github | https://github.com/vuejs/core | packages/vue/compiler-sfc/index.js |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch
import to... | unknown | codeparrot/codeparrot-clean | ||
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for letsencrypt.account."""
import datetime
import os
import shutil
import stat
import tempfile
import unittest
import mock
import pytz
from acme import jose
from acme import messages
from letsencrypt import errors
from letsencrypt.tests import test_util
KEY = jose.JWKRSA.load(test_util.load_vector("rsa51... | 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-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java |
//===--- ParseDecl.cpp - Swift Language Parser for Declarations -----------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/Parse/ParseDecl.cpp |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
from account import Account
from logpy import unifiable, run, var, eq, membero, variables
from logpy.core import lall
from logpy.arith import add, gt, sub
unifiable(Account) # Register Account class
accounts = (Account('Adam', 'Smith', 1, 20),
Account('Carl', 'Marx', 2, 3),
Account('John', 'R... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import with_statement
from distutils.version import StrictVersion
from itertools import chain
from select import select
import os
import socket
import sys
import threading
import warnings
try:
import ssl
ssl_available = True
except ImportError:
ssl_available = False
from redis._compat impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (C) 2007 - 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | unknown | codeparrot/codeparrot-clean | ||
import logging
import yaml
from sn_agent.ontology.settings import OntologySettings
logger = logging.getLogger(__name__)
class Service(dict):
def __init__(self, node_id, name, description):
super().__init__()
self.node_id = node_id
self.name = name
self.description = description
... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2025 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/safe_cast.h |
#!/bin/bash -eu
# The modified version of `travis_wait` to output a log as the command goes.
# https://github.com/travis-ci/travis-ci/issues/4190#issuecomment-353342526
# Produce an output log every 9 minutes as the timeout without output is 10
# minutes. A job finishes with a timeout if it takes longer than 50 minute... | unknown | github | https://github.com/ruby/ruby | tool/travis_wait.sh |
/*
* 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/build/BuildpackReference.java |
//===-- ConfigProviderTests.cpp -------------------------------------------===//
//
// 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
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/unittests/ConfigProviderTests.cpp |
#!/usr/bin/env python
#
# Copyright (c) 2011 Vit Suchomel and Jan Pomikalek
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from distutils.core import setup
setup(
name='chared',
version='1.2.1',
descript... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/collect/NullsFirstOrdering.java |
# -*- coding: utf-8 -*-
#
# 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
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Oppia 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 ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Blemjhoo Tezoulbr <baobab@heresiarch.info>.
#
# 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, incl... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2026 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package ktorbuild.vcpkg
import ktorbuild.internal.gradle.loadProperties
import ktorbuild.internal.withLimitedParallelism
import org.gradle.api.DefaultTask
import org.gradle.api.file.Directory... | kotlin | github | https://github.com/ktorio/ktor | build-logic/src/main/kotlin/ktorbuild/vcpkg/VcpkgInstall.kt |
from __future__ import unicode_literals
from django import forms
from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet
from django.forms.models import (
BaseModelFormSet, inlineformset_factory, modelform_factory,
modelformset_factory,
)
from django.forms.utils import ErrorDict, ErrorList
from djan... | unknown | codeparrot/codeparrot-clean | ||
from base import *
SERVER = "redir_paths_1"
MAGIC = 'Reproducing bug report #432'
CONF = """
vserver!2270!nick = %s
vserver!2270!document_root = %s
vserver!2270!rule!1!match = default
vserver!2270!rule!1!handler = file
vserver!2270!rule!10!match = request
vserver!2270!rule!10!match!request = file.*
vserver!2270!... | unknown | codeparrot/codeparrot-clean | ||
import Foundation
import NIOCore
import NIOHTTP1
/// Captures all errors and transforms them into an internal server error HTTP response.
public final class ErrorMiddleware: Middleware {
/// Structure of `ErrorMiddleware` default response.
internal struct ErrorResponse: Codable {
/// Always `true` to i... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Middleware/ErrorMiddleware.swift |
from django.core.management.base import NoArgsCommand
from networkdashboard.summary import database_helper, datetime_helper, geoip_helper
from networkdashboard.summary.models import *
from django.conf import settings
from datetime import datetime
import os
import json
import psycopg2
import psycopg2.extras
import time
... | unknown | codeparrot/codeparrot-clean | ||
"""
Wood author: thislight
Copyright 2016 thislight
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | unknown | codeparrot/codeparrot-clean | ||
"""Core connection objects"""
import ast
import sys
import collections
import copy
import logging
import math
import numbers
import platform
import warnings
if sys.version_info > (3,):
import urllib.parse as urlparse # pylint: disable=E0611,F0401
else:
import urlparse
from pika import __version__
from pika i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Command Line Client}.
"""
import os
import errno
import sys
import argparse
import shutil
from entropy.const import etpConst, const_setup_dir... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 multiprocessing
import os
import sqlite3
from profile_creators import fast_navigation_profile_extender
from profile_creators import profile_safe_url_l... | 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 | ||
# mypy: allow-untyped-defs
import argparse
import sys
# Unroll loops when block_size is a multiple of vector length.
def unroll(num_unrolls, IndexType, InType, OutType):
def compute_output(num_unrolls, InType, is_main):
code = []
pred = "svAll" if is_main else "pg"
if InType == "float":
... | python | github | https://github.com/pytorch/pytorch | caffe2/perfkernels/sve_emblookup_codegen.py |
import re
import csv
import sys
import getpass
import xmlrpclib
import htmlentitydefs
import xml.dom.minidom
from itertools import groupby
from urllib import quote_plus, urlencode
from urllib2 import urlopen, HTTPError
from xml.parsers.expat import ExpatError
try:
set
except NameError:
import sets.Set as set
... | unknown | codeparrot/codeparrot-clean | ||
apiVersion: kubeadm.k8s.io/v1beta4
kind: InitConfiguration | unknown | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/test/cmd/testdata/init/v1beta4.yaml |
# Copyright 2013 Metacloud Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 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 | ||
import json
import base64
import io
import logging
import posixpath
import stat
import tarfile
import zipfile
from pymisp import MISPEvent, MISPObject, MISPAttribute
from pymisp.tools import make_binary_objects
from collections import OrderedDict
log = logging.getLogger(__name__)
misperrors = {'error': 'Error'}
modu... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase
from django.contrib.auth.models import Permission, User, Group
from django.conf import settings
from django.db.models import get_models
from django.utils.module_loading import import_module
try:
from django.test import override_settings
except ImportError:
from django.test.util... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
import math
import time
from util import hook, urlnorm, timesince
expiration_period = 60 * 60 * 24 # 1 day
ignored_urls = [urlnorm.normalize("http://google.com")]
def db_init(db):
db.execute("create table if not exists urlhistory"
"(chan, url, nick, time)")
db.commit()
def insert_history(db... | unknown | codeparrot/codeparrot-clean | ||
"""Provides factories for student models."""
from datetime import datetime
from uuid import uuid4
import factory
from django.contrib.auth.models import AnonymousUser, Group, Permission
from django.contrib.contenttypes.models import ContentType
from factory.django import DjangoModelFactory
from opaque_keys.edx.keys im... | 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
# ... | 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 use ... | unknown | codeparrot/codeparrot-clean | ||
//go:build !windows
package opts
const (
// DefaultHTTPHost Default HTTP Host used if only port is provided to -H flag e.g. dockerd -H tcp://:8080
DefaultHTTPHost = "localhost"
// DefaultHost constant defines the default host string used by docker on other hosts than Windows
DefaultHost = "unix://" + DefaultUnix... | go | github | https://github.com/moby/moby | daemon/pkg/opts/hosts_unix.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 | ||
// Code generated by "enumer -type=DefaultDirectoryPolicyType"; DO NOT EDIT.
package pki
import (
"fmt"
)
const _DefaultDirectoryPolicyTypeName = "ForbidSignVerbatimRoleExternalPolicy"
var _DefaultDirectoryPolicyTypeIndex = [...]uint8{0, 6, 18, 22, 36}
func (i DefaultDirectoryPolicyType) String() string {
if i <... | go | github | https://github.com/hashicorp/vault | builtin/logical/pki/defaultdirectorypolicytype_enumer.go |
"""
differential_evolution: The differential evolution global optimization algorithm
Added by Andrew Nelson 2014
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.optimize import OptimizeResult, minimize
from scipy.optimize.optimize import _status_message
import numbers
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be... | c | github | https://github.com/opencv/opencv | 3rdparty/libwebp/src/dsp/filters_neon.c |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Style.padding_left'
db.add_column('cmsplugin_style', 'padding_left',
se... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
//go:build testonly
package vault
import (
"context"
"encoding/json"
"sort"
"testing"
"time"
"github.com/golang/protobuf/proto"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/helper/timeutil"
"github.com/hashi... | go | github | https://github.com/hashicorp/vault | vault/logical_system_activity_write_testonly_test.go |
# -*- coding: utf-8 -*-
"""setup -- setuptools setup file for cocos2d.
Supports the usual 'setup.py install' for cocos.
As a release builder:
last used: release 0.6.0, built from py2.6 + setuptools 3.3
example operation for generating release without handling the docs:
svn checkout http://los-cocos.goo... | unknown | codeparrot/codeparrot-clean | ||
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# This file is part of the E-Cell System
#
# Copyright (C) 1996-2016 Keio University
# Copyright (C) 2008-2016 RIKEN
# Copyright (C) 2005-2009 The Molecular Sciences Institute
#
#:::::::::::::::::::::::::::::::::::::::... | unknown | codeparrot/codeparrot-clean | ||
from django.conf import settings
from django.template import Context
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
class BaseBackend(object):
"""
The base backend.
"""
def __init__(self, medium_id, spam_sensitivity=None):
self.medium_id = medi... | unknown | codeparrot/codeparrot-clean | ||
"""Provide animated GIF loops of Buienradar imagery."""
from __future__ import annotations
import asyncio
from datetime import datetime, timedelta
import logging
import aiohttp
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.config_entries import Config... | unknown | codeparrot/codeparrot-clean | ||
#[cfg(test)]
mod tests;
use std::ops::Range;
use std::{hash, iter};
use rustc_abi::Size;
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable};
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use super::AllocRange;
type Block = u64;
/// A bitmask where each bit refers to the byte ... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs |
try:
# Available in Python 3
from tokenize import open as open_py_source
except ImportError:
# Copied from python3 tokenize
from codecs import lookup, BOM_UTF8
import re
from io import TextIOWrapper, open
cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
def _get_normal_name(orig_enc):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2003 Python Software Foundation
import unittest
import os
import sys
from test import test_support
MacOS = test_support.import_module('MacOS')
#The following modules should exist if MacOS exists.
import Carbon.File
import macostools
TESTFN2 = test_support.TESTFN + '2'
class TestMacostools(unittest.T... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import os
import posixpath
import shutil
import sys
import tempfile
from django.template import loader, Context
from django.conf import settings
from django.core.cache.backends.base import BaseCache
from django.core.exceptions import Impr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2025 Google Inc. 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
#
# Unless requir... | python | github | https://github.com/huggingface/transformers | src/transformers/models/gemma3/processing_gemma3.py |
# CTCI 4.5
# Validate BST
class Node():
def __init__(self, value, left=None, right=None):
self.value, self.left, self.right = value, left, right
# My Solution
def validate(root):
return helper(root, None, None)
def helper(root, min, max):
if root is None:
return True
# In order left <= cur... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.configuration.injection;
import static org.mockito.internal.util.Checks.checkItemsNotNull;
import static org.mockito.internal.util.Checks.checkNotNull;
import static org.... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/configuration/injection/MockInjection.java |
#
# Copyright 2013 Rackspace Hosting.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
import os
from six.moves import urllib
import zipfile
from bokeh.util.string import encode_utf8
def extract_hosted_zip(data_url, save_dir, exclude_term=None):
"""Downloads, then extracts a zip file."""
zip_name = os.path.join(save_dir, 'temp.zip')
# get the zip file
try:
print('Downloading %r... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Broadcasting\Broadcasters;
class NullBroadcaster extends Broadcaster
{
/**
* {@inheritdoc}
*/
public function auth($request)
{
//
}
/**
* {@inheritdoc}
*/
public function validAuthenticationResponse($request, $result)
{
//
... | php | github | https://github.com/laravel/framework | src/Illuminate/Broadcasting/Broadcasters/NullBroadcaster.php |
#ifndef BOOST_CORE_VERBOSE_TERMINATE_HANDLER_HPP_INCLUDED
#define BOOST_CORE_VERBOSE_TERMINATE_HANDLER_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// Copyright 2022 Peter Dimov
// Distributed under the Boost Software License, Version... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/core/verbose_terminate_handler.hpp |
# Copyright (c) 2015 Egor Tensin <Egor.Tensin@gmail.com>
# This file is part of the "Sorting algorithms" project.
# For details, see https://github.com/egor-tensin/sorting-algorithms.
# Distributed under the MIT License.
import sys
from ..algorithm import SortingAlgorithm
# Disclaimer: implemented in the most litera... | unknown | codeparrot/codeparrot-clean | ||
from tcga_encoder.models.vae.batcher_ABC import *
class DnaBatcher( TCGABatcherABC ):
def PostInitInit(self):
if self.data_dict.has_key("dna_genes"):
self.dna_genes = self.data_dict["dna_genes"]
self.dna_store = self.dna_store[self.dna_genes]
self.dna_dim = len(self.dna_genes)
self.dims... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
"""
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty
string).
Each of these API functions, except connection.close(), raise
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.base.base import BaseDatabase... | python | github | https://github.com/django/django | django/db/backends/dummy/base.py |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
funzioni per comando SPEZZA per tagliare un oggetto
-------------------
begin : 2019-08-08
copyright : iiii... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
Python and Ansible for Network Engineers
Week 4, Exercise 5
Use Netmiko to enter into configuration mode on pynet-rtr2. Also use Netmiko
to verify your state (i.e. that you are currently in configuration mode).
'''
from netmiko import ConnectHandler
from getpass import getpass
password = ge... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "models/author"
class PostgresqlDeferredConstraintsTest < ActiveRecord::PostgreSQLTestCase
def setup
@connection = ActiveRecord::Base.lease_connection
@fk = @connection.foreign_keys("authors").first.name
@other_fk = @connection.foreign_keys("l... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/adapters/postgresql/deferred_constraints_test.rb |
# Copyright (c) 2010 Philip Taylor
# Released under the BSD license and W3C Test Suite License: see LICENSE.txt
# Current code status:
#
# This was originally written for use at
# http://philip.html5.org/tests/canvas/suite/tests/
#
# It has been adapted for use with the Web Platform Test Suite suite at
# https://githu... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
#
# 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 p... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
// This package is used to implement Key Derivation Functions (KDF)
// based on the recommendations of NIST SP 800-108. These are useful
// for generating unique-per-transaction keys, or situations in which
// a key hierarchy may be useful.
package ... | go | github | https://github.com/hashicorp/vault | sdk/helper/kdf/kdf.go |
/* public domain rewrite of hypot */
#include "ruby/missing.h"
#include <math.h>
double hypot(double x, double y)
{
if (x < 0) x = -x;
if (y < 0) y = -y;
if (x < y) {
double tmp = x;
x = y; y = tmp;
}
if (y == 0.0) return x;
y /= x;
return x * sqrt(1.0+y*y);
} | c | github | https://github.com/ruby/ruby | missing/hypot.c |
# Databricks notebook source exported at Mon, 14 Mar 2016 03:33:29 UTC
# MAGIC %md
# MAGIC **SOURCE:** This is from the Community Edition of databricks and has been added to this databricks shard at [/#workspace/scalable-data-science/xtraResources/edXBigDataSeries2015/CS100-1x](/#workspace/scalable-data-science/xtraRes... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (c) 2009-2017 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""weedb driver for the MySQL database"""
import decimal
import MySQLdb
from _mysql_exceptions import DatabaseError, IntegrityError, ProgrammingError, OperationalError
from weeutil.weeutil import to_... | 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 | connect/api/src/main/java/org/apache/kafka/connect/storage/package-info.java |
"""Mozilla / Netscape cookie loading / saving.
Copyright 2002-2006 John J Lee <jjl@pobox.com>
Copyright 1997-1999 Gisle Aas (original libwww-perl code)
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distri... | unknown | codeparrot/codeparrot-clean | ||
deprecated_foo
==============
bar
*Since symfony/framework-bundle 6.4: The parameter "deprecated_foo" is deprecated.* | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/deprecated_parameter.md |
# -*- coding: utf-8 -*-
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package aws
import (
"context"
"fmt"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/helper/consts"
"github.com/hashicorp/vault/sdk/logical"
)
func (b *backend) walRollback(ctx context.Context, req *logical.Reques... | go | github | https://github.com/hashicorp/vault | builtin/logical/aws/rollback.go |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.