code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import copy
import enum
import doctest
import inspect
import os
import pydoc
import sys
import unittest
import threading
import typing
import builtins as bltns
from collections import OrderedDict
from datetime import date
from enum import Enum, EnumMeta, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto
from enum... | python | github | https://github.com/python/cpython | Lib/test/test_enum.py |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | unknown | codeparrot/codeparrot-clean | ||
"""Implements nose test program and collector.
"""
from __future__ import generators
import logging
import os
import sys
import time
import unittest
from nose.config import Config, all_config_files
from nose.loader import defaultTestLoader
from nose.plugins.manager import PluginManager, DefaultPluginManager, \
R... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
//go:build !enterprise
package dbplugin
import (
"github.com/hashicorp/vault/sdk/database/dbplugin/v5/proto"
)
var _ proto.DatabaseClient = fakeClient{}
type fakeClient struct {
initResp *proto.InitializeResponse
initErr error
newUserResp ... | go | github | https://github.com/hashicorp/vault | sdk/database/dbplugin/v5/grpc_client_oss_test.go |
import json
from django import shortcuts
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import redirect
from django.template import RequestContext
from django.template.load... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 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 a... | 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... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/integration/cache/cachestoreconfigurationcaffeine/CustomCacheConfiguration.kt |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.http
import io.ktor.util.*
internal val ROOT_PATH = listOf("")
/**
* Take url parts from [urlString]
* throws [URLParserException]
*
* [Report a problem](https://ktor.io/f... | kotlin | github | https://github.com/ktorio/ktor | ktor-http/common/src/io/ktor/http/URLParser.kt |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
unified_strdate,
clean_html,
)
class ArchiveOrgIE(InfoExtractor):
IE_NAME = 'archive.org'
IE_DESC = 'archive.org videos'
_VALID_URL = r'https?://(?:www\.)?archive\.org/(?:details|embed)/(?P<id>[^/?#]+)(... | unknown | codeparrot/codeparrot-clean | ||
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Test\Mo... | php | github | https://github.com/composer/composer | tests/Composer/Test/Mock/InstalledFilesystemRepositoryMock.php |
# Natural Language Toolkit: Text Segmentation Metrics
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# David Doukhan <david.doukhan@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Text Segment... | unknown | codeparrot/codeparrot-clean | ||
import json
import django.db
import unittest
from student.tests.factories import UserFactory, RegistrationFactory, PendingEmailChangeFactory
from student.views import (
reactivation_email_for_user, do_email_change_request, confirm_email_change,
validate_new_email, SETTING_CHANGE_INITIATED
)
from student.models... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# Copyright 2014-2020 Álvaro Justen <https://github.com/turicas/rows/>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright 2014-2016 Open Source Robotics Foundation, 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
#
# Unle... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Ranger documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 22 16:28:48 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | unknown | codeparrot/codeparrot-clean | ||
//===--- Migrator.cpp -----------------------------------------------------===//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICE... | cpp | github | https://github.com/apple/swift | lib/Migrator/Migrator.cpp |
"""Config flow to configure zone component."""
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant import config_entries
from homeassistant.const import (
CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE, CONF_ICON, CONF_RADIUS)
from homeassistant.core import callback
from hom... | 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 | ||
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 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... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/resource/v1/zz_generated.validations.go |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | unknown | codeparrot/codeparrot-clean | ||
<docs-decorative-header title="Anatomy of a component" imgSrc="adev/src/assets/images/components.svg"> <!-- markdownlint-disable-line -->
</docs-decorative-header>
TIP: This guide assumes you've already read the [Essentials Guide](essentials). Read that first if you're new to Angular.
Every component must have:
- A ... | unknown | github | https://github.com/angular/angular | adev/src/content/guide/components/anatomy-of-components.md |
import json
from datetime import timedelta
from django.conf import settings
import requests
SURVEYS = {
'general': { # This is for users browsing the KB and navigation pages.
'email_collection_survey_id': 1002970,
'exit_survey_id': 991425,
'exit_survey_campaign_id': 878533,
},
'q... | unknown | codeparrot/codeparrot-clean | ||
# (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... | python | github | https://github.com/ansible/ansible | lib/ansible/playbook/playbook_include.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | unknown | codeparrot/codeparrot-clean | ||
import os
from email.mime.image import MIMEImage
from django.core.mail import EmailMultiAlternatives
from django.core.mail.message import SafeMIMEMultipart, SafeMIMEText
from django.core.files.images import ImageFile
from django.template.loader import get_template
from django.test import TestCase
from django.test.utils... | unknown | codeparrot/codeparrot-clean | ||
import BeautifulSoup
from BeautifulSoup import Comment, Tag, NavigableString
import logging
import os
import re
import text
class textfile:
def __init__(self, gdbm_files, filter_file, path, category):
self.category = category
self.filter_file = filter_file
self.gdbm_files = gdbm_files
... | unknown | codeparrot/codeparrot-clean | ||
// AUTO-GENERATED FILE FROM genmap_japanese.py: DO NOT EDIT
static const ucs2_t __jisx0208_decmap[6956] = {
12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,
65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,
12295,12540,8213,8208,65295,92,12316,8214,65372,8230,8229,... | c | github | https://github.com/python/cpython | Modules/cjkcodecs/mappings_jp.h |
// Copyright 2015 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... | go | github | https://github.com/prometheus/prometheus | discovery/aws/metrics_msk.go |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import IuguLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imp... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/iugu.py |
# Copyright 2019 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 | ||
"""
Purpose: Set of unit tests for nilsimsa package.
Test data consists of 20 randomly selected documents from a Diffeo corpus.
This software is released under an MIT/X11 open source license.
Copyright 2012-2014 Diffeo, Inc.
"""
import cPickle as pickle
import dircache
import os
import pytest
import random
from dep... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2025 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
set -exuo pipefail
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))"
source "$dir/teamcity-support.sh" # For $root
source "$dir/teamcity-bazel... | unknown | github | https://github.com/cockroachdb/cockroach | build/teamcity/internal/release/pgo_profile_update.sh |
# Copyright 2011 OpenStack Foundation
# 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 requ... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | unknown | codeparrot/codeparrot-clean | ||
"""
/***************************************************************************
CartoDB Plugin
A QGIS plugin
----------------------------------------------------------------------------
begin : 2014-09-08
copyright : (C) 2015 by Michael Salgado, Kudos Ltda.
email : michaelsalg... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from tempfile import NamedTemporaryFile
from centerpoints.cli import parse_arguments
class TestArgumentParser(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.ptsf = NamedTemporaryFile()
@classmethod
def tearDownClass(cls):
cls.ptsf.truncate()
cls.ptsf... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/util/ctc/ctc_beam_entry.h |
"""
Tests for store_utilities.py
"""
import unittest
from mock import Mock
import ddt
from xmodule.modulestore.store_utilities import (
get_draft_subtree_roots, draft_node_constructor
)
@ddt.ddt
class TestUtils(unittest.TestCase):
"""
Tests for store_utilities
ASCII trees for ONLY_ROOTS and SOME_TREE... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import logging
from datetime import datetime
from os.path import join, dirname
import httpretty
from udata.models import Dataset, License
from udata.tests import TestCase, DBTestMixin
from udata.core.organization.factories import OrganizationFactory
from .factories import Ha... | unknown | codeparrot/codeparrot-clean | ||
import { flushSync } from 'svelte';
import { test } from '../../test';
export default test({
html: `
<input type="checkbox" value="a" data-index="x-1">
<input type="checkbox" value="b" data-index="x-1">
<input type="checkbox" value="c" data-index="x-1">
<input type="checkbox" value="a" data-index="x-2">
<in... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/binding-input-group-each-7/_config.js |
from pyjsparserdata import *
class BaseNode:
def finish(self):
pass
def finishArrayExpression(self, elements):
self.type = Syntax.ArrayExpression
self.elements = elements
self.finish()
return self
def finishArrayPattern(self, element... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import unittest
from frappe.utils import evaluate_filters, money_in_words, scrub_urls, get_url
from frappe.utils import ceil, floor
class TestFilters(unittest.TestCase):
def te... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.flow.*
import org.junit.*
class ReusableContinuationStressTest : TestBase() {
private val iterations = 1000 * stressTestMultiplierSqrt
@Test // Originally reported by @denis-bezrukov in #2736
fun testDebounceWithSta... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/ReusableContinuationStressTest.kt |
#! /usr/bin/env python
import sys
from optparse import OptionParser
import random
import math
def hfunc(index):
if index == -1:
return 'MISS'
else:
return 'HIT '
def vfunc(victim):
if victim == -1:
return '-'
else:
return str(victim)
#
# main program
#
parser = Option... | unknown | codeparrot/codeparrot-clean | ||
"""
Entry point
TODO: event handler to RPC the Wit.ai event
TODO: do we need a different person/default dict? we don't have one
"""
from wit import Wit
from pprint import pprint
from config import (
DEFAULT_DICT, DEFAULT_LANG,
PERSONA_DICT, PERSONA_LANG,
PERSONA, wit_token)
from mic import M... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... | unknown | codeparrot/codeparrot-clean | ||
# Contributing to React
Want to contribute to React? There are a few things you need to know.
We wrote a **[contribution guide](https://reactjs.org/docs/how-to-contribute.html)** to help you get started. | unknown | github | https://github.com/facebook/react | CONTRIBUTING.md |
name: Documentation
description: Report a problem with the documentation
labels: ["docs"]
body:
- type: markdown
attributes:
value: |
> [!NOTE]
> Trivial changes (for example typos) don’t require an issue before opening a PR.
- type: textarea
attributes:
label: "Documentation"
... | unknown | github | https://github.com/python/cpython | .github/ISSUE_TEMPLATE/documentation.yml |
# 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 telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class ToughImageCasesPage(page_module... | unknown | codeparrot/codeparrot-clean | ||
# -*- mode: python; coding: utf-8 -*-
import os
import os.path
import re
import string
import time
import urlparse
import logging
from drydrop_handler import DRY_ROOT
def cache_buster(html):
def url_replacer(match):
def get_stamp(files):
stamp = ""
for file in files:
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 OpenStack Foundation
# 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/li... | unknown | codeparrot/codeparrot-clean | ||
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org
#
# This program 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 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/context/annotation/DependsOn.java |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Sam Liu <sam.liu@activenetwork.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by'... | unknown | codeparrot/codeparrot-clean | ||
def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "script-src 'self' 'un... | 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... | unknown | codeparrot/codeparrot-clean | ||
"""Arithmetics for dense recursive polynomials in ``K[x]`` or ``K[X]``. """
from __future__ import print_function, division
from sympy.polys.densebasic import (
dup_slice,
dup_LC, dmp_LC,
dup_degree, dmp_degree,
dup_strip, dmp_strip,
dmp_zero_p, dmp_zero,
dmp_one_p, dmp_one,
dmp_ground, dm... | unknown | codeparrot/codeparrot-clean | ||
"""Tests of comprehensive theming."""
import unittest
from django.conf import settings
from django.test import TestCase
from path import path # pylint: disable=no-name-in-module
from django.contrib import staticfiles
from openedx.core.djangoapps.theming.test_util import with_comp_theme
from openedx.core.li... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/python
import select, signal, socket, struct, sys, time, traceback
from random import randint
from multiprocessing.managers import SyncManager
DEFAULT_PORT=10009
WAHAB_ACK='!E!T!'
def generateMulticastGroupPort():
return randint(10000,11001)
def generateMulticastGroupIP():
return str(randint(224,239)) + '... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package backendbase
import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hcltest"
"github.com/zclconf/go-cty-debug/ctydebug"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terr... | go | github | https://github.com/hashicorp/terraform | internal/backend/backendbase/base_test.go |
import webapp2
import cgi
import json
from google.appengine.api import users
from google.appengine.ext import ndb
from google.appengine.api import urlfetch
class CoreTeamMember(ndb.Model):
username = ndb.StringProperty(indexed=True)
@classmethod
def forUsername(cls, username):
return CoreTeamMember.query()... | unknown | codeparrot/codeparrot-clean | ||
##########################################################################
#
# Copyright (c) 2007-2009, 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:
#
# * Redis... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2017, Simon Dodsley <simon@purestorage.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | unknown | codeparrot/codeparrot-clean | ||
use super::AtomicU64;
use crate::loom::sync::Mutex;
pub(crate) type StaticAtomicU64 = AtomicU64;
impl AtomicU64 {
pub(crate) const fn new(val: u64) -> Self {
Self {
inner: Mutex::const_new(val),
}
}
} | rust | github | https://github.com/tokio-rs/tokio | tokio/src/loom/std/atomic_u64_static_const_new.rs |
#!/usr/bin/python2.4
#
# Copyright 2011 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2014 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 applica... | unknown | github | https://github.com/kubernetes/kubernetes | hack/install-etcd.sh |
# 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 | ||
# -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in ... | unknown | codeparrot/codeparrot-clean | ||
import socket # Import socket module
from gopigo import * #Has the basic functions for controlling the GoPiGo Robot
import sys #Used for closing the running program
import pygame #Gives access to KEYUP/KEYDOWN events
import picamera
import os, os.path
import numpy as np
import argparse
import os
import sy... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
def standalone_number(self):
return 1
class Numbers(object):
@staticmethod
def get_static_number(self):
return 2
@classmethod
def get_class_number(... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
@file statistics.py
@author Michael Behrisch
@author Daniel Krajzewicz
@date 2008-10-17
@version $Id: statistics.py 12898 2012-10-26 08:58:14Z behrisch $
Collecting statistics for the CityMobil parking lot
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright... | unknown | codeparrot/codeparrot-clean | ||
:host {
font-family: var(--inter-font);
display: flex;
justify-content: center;
}
[ngTabs] {
overflow: hidden;
width: 600px;
border-radius: 0.5rem;
border: 1px solid color-mix(in srgb, var(--primary-contrast) 10%, transparent);
}
[ngTabList] {
padding: 0;
display: flex;
list-style: none;
positio... | css | github | https://github.com/angular/angular | adev/src/content/examples/aria/tabs/src/explicit-selection/app/app.css |
# -*- 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 | ||
# -*- coding: utf-8 -*-
from factopy.models import Stream, Material, MaterialStatus, InvalidStatus
from django.test import TestCase
class TestMaterialStatuses(TestCase):
fixtures = ['initial_data.yaml', '*']
def setUp(self):
self.stream = Stream()
self.stream.save()
self.second_stream ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: latin1 -*-
################################################################################################
#
#
import snap, datetime, sys, time, json, os, os.path, shutil, time, random, math
import numpy as np
from math import*
# Script auxiliar para cálculos matemáticos que deve estar no mesmo diretório... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/extcon/wlf,arizona.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Cirrus Logic/Wolfson Microelectronics Arizona class audio SoCs
maintainers:
- patches@opensource.cirrus.com
description: |
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/extcon/wlf,arizona.yaml |
# Copyright 2018 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 | ||
/**
* \file pk.h
*
* \brief Public Key abstraction layer
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef MBEDTLS_PK_H
#define MBEDTLS_PK_H
#include "mbedtls/private_access.h"
#include "mbedtls/build_info.h"
#include "mbedtls/md.h"
#if defined... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/mbedtls/pk.h |
require_relative '../app_aobench' | ruby | github | https://github.com/ruby/ruby | benchmark/gc/aobench.rb |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from shutil import rmtree
import nibabel as nif
import numpy as np
from tempfile import mkdtemp
from nipype.testing import (assert_equal, assert_false, assert_true,
ass... | unknown | codeparrot/codeparrot-clean | ||
# Owner(s): ["module: PrivateUse1"]
import numpy as np
import torch
import torch._C
from torch.testing._internal.common_utils import run_tests, TestCase
from torch.utils.backend_registration import _setup_privateuseone_for_python_backend
_setup_privateuseone_for_python_backend("npy")
aten = torch.ops.aten
# NOTE: F... | python | github | https://github.com/pytorch/pytorch | test/test_privateuseone_python_backend.py |
import json
import requests
import contextlib
from six import u
from . import exceptions
RECEIPT_PRODUCTION_VALIDATION_URL = "https://buy.itunes.apple.com/verifyReceipt"
RECEIPT_SANDBOX_VALIDATION_URL = "https://sandbox.itunes.apple.com/verifyReceipt"
USE_PRODUCTION = True
USE_SANDBOX = False
def config_from_mode(mo... | unknown | codeparrot/codeparrot-clean | ||
use crate::cursor;
use crate::extractor::bracket_stack::BracketStack;
use crate::extractor::machine::{Machine, MachineState};
use crate::extractor::string_machine::StringMachine;
use classification_macros::ClassifyBytes;
/// Extracts arbitrary values including the brackets.
///
/// E.g.:
///
/// ```text
/// bg-[#0088c... | rust | github | https://github.com/tailwindlabs/tailwindcss | crates/oxide/src/extractor/arbitrary_value_machine.rs |
# This file is part of beets.
# Copyright 2015, Thomas Scholtes.
#
# 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,... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-2025 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 by a... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/web/webmvc/mvcservlet/mvccontainerconfig/MyWebAppInitializer.kt |
# Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | unknown | codeparrot/codeparrot-clean | ||
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | unknown | codeparrot/codeparrot-clean | ||
import {throwInput} from 'shared-runtime';
function Component(props) {
const object = {
foo() {
try {
throwInput([props.value]);
} catch (e) {
return e;
}
},
};
return object.foo();
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{value: 42}],
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-object-method-returns-caught-value.js |
/*
* 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/producer/internals/TransactionManager.java |
// Copyright 2017 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | client/v3/ordering/kv_test.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 may not u... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
from typing import TYPE_CHECKING
from scrapy.commands import ScrapyCommand
from scrapy.spiderloader import get_spider_loader
if TYPE_CHECKING:
import argparse
class Command(ScrapyCommand):
requires_project = True
requires_crawler_process = False
default_settings = ... | python | github | https://github.com/scrapy/scrapy | scrapy/commands/list.py |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.embeddings import GradientEmbeddings
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional i... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/embeddings/gradient_ai.py |
#include <ATen/core/dispatch/Dispatcher.h>
#include <ATen/record_function.h>
#include <c10/macros/Macros.h>
#include <c10/util/ThreadLocal.h>
#include <c10/util/overloaded.h>
#include <algorithm>
#include <cstdlib>
#include <random>
namespace at {
extern const std::string kParamCommsCallName = "record_param_comms";
... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/record_function.cpp |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python3
import sqlite3
import os
import hashlib
import codecs
import bcrypt
from Crypto.Cipher import AES
from password import encrypt, decrypt, toHex, fromHex
import config
pwdatabase = config.dbfile
'''This utility only needs to be run once to convert from an unencrypted database.'''
'''Fill in pa... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.