code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import logging
import re
from django.contrib.staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles import finders
from django.conf import settings
from static_replace.models import AssetBaseUrlConfig, AssetExcludedExtensionsConfig
from xmodule.modulestore.django import modulestore
from xmodul... | unknown | codeparrot/codeparrot-clean | ||
from sympy.core import *
def test_rational():
a = Rational(1, 5)
assert a**Rational(1, 2) == a**Rational(1, 2)
assert 2 * a**Rational(1, 2) == 2 * a**Rational(1, 2)
assert a**Rational(3, 2) == a * a**Rational(1, 2)
assert 2 * a**Rational(3, 2) == 2*a * a**Rational(1, 2)
assert a**Rational(17... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime, timedelta
from django.db import models
import logging
from .constants import CACHE_DEFAULT, CACHE_INVALIDATED_HOLDER
from hashlib import sha1
#pylint: disable=C0103
encodekey = lambda *args: '.'.join([str(x) for x in args])
decodekey = lambda key: key.split('.')
encodeargs = lambda *... | 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 | ||
"""
HyperParser
===========
This module defines the HyperParser class, which provides advanced parsing
abilities for the ParenMatch and other extensions.
The HyperParser uses PyParser. PyParser is intended mostly to give information
on the proper indentation of code. HyperParser gives some information on the
structure ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
"""
TODO: add table listing each forecast's peak and peak time...
"""
import datetime
import pytz
import numpy as np
import pandas as pd
from pandas.io.sql import read_sql
import matplotlib.dates as mdates
from pyiem.plot import figure_axes
from pyiem.util import get_autoplot_context, get_dbconn
from pyiem.exceptions ... | unknown | codeparrot/codeparrot-clean | ||
import os
import platform
import shutil
import sys
import tempfile
import unittest
from git import Repo
from mock import MagicMock
from buildscripts.bazel_rules_mongo.utils import evergreen_git
changed_file_name = "changed_file.txt"
new_file_name = "new_file.txt"
def write_file(repo: Repo, file_name: str) -> None:
... | python | github | https://github.com/mongodb/mongo | buildscripts/bazel_rules_mongo/tests/test_changed_files.py |
# -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
class product(osv.osv):
_inherit = "product.product"
def get_product_available(self, cr, uid, ids, context=None):
""" Finds ... | unknown | codeparrot/codeparrot-clean | ||
def smallest_Divisor(n):
if (n % 2 == 0):
return 2;
i = 3;
while (i*i <= n):
if (n % i == 0):
return i;
i += 2;
return n; | unknown | mbpp | ||
import sys
import unittest
from contextlib import contextmanager
from django.test import LiveServerTestCase, tag
from django.utils.module_loading import import_string
from django.utils.text import capfirst
class SeleniumTestCaseBase(type(LiveServerTestCase)):
# List of browsers to dynamically create test classes ... | 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 (t... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2021 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/c/experimental/ops/math_ops.h |
#
# 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 us... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import ctypes as ct
import socket
import weakref
from ip4tc import Rule, Table, IPTCError
from util import find_library, load_kernel
from xtables import (XT_INV_PROTO, NFPROTO_IPV6, xt_align, xt_counters)
__all__ = ["Table6", "Rule6"]
load_kernel("ip6_tables")
_IFNAMSIZ = 16
def is_table6_... | unknown | codeparrot/codeparrot-clean | ||
import pexpect
import sys
import time
import datetime
import sqlite3
from SensorTag import *
from SensorCalcs import *
csvfile = r'testfile.csv'
#set this empty to turn off logging:
logfile = r'pexpect.log'
def usage():
print 'blepiTemp.py Usage:'
print ' blepiTemp.py'
print ''
print ' SensorTag ad... | unknown | codeparrot/codeparrot-clean | ||
"""
Testing signals before/after saving and deleting.
"""
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=20)
def __unicode__(self):
return self.name
class Book(models.Model):
name = models.CharField(max_length=20)
authors = models.ManyToManyField(... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Cache\Events;
class KeyWritten extends CacheEvent
{
/**
* The value that was written.
*
* @var mixed
*/
public $value;
/**
* The number of seconds the key should be valid.
*
* @var int|null
*/
public $seconds;
/**
* Create a... | php | github | https://github.com/laravel/framework | src/Illuminate/Cache/Events/KeyWritten.php |
/* Copyright 2022 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/transforms/eliminate_passthrough_iter_args/pass.h |
import json #JSON Encoder and Decoder library
from datetime import datetime
#TODO: Update/Remove default values of arguments
## JSONmodule
# This class controls file IO and stores entries in a map
class JSONmodule:
##The constructor
#@param filename A file containg the entries in valud JSON
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields,osv
from openerp import tools
import openerp.addons.decimal_precision as dp
class mrp_workorder(osv.osv):
_name = "mrp.workorder"
_description = "Work Order Report"
_auto = Fal... | unknown | codeparrot/codeparrot-clean | ||
from decimal import Decimal
from django.apps import apps
from django.core import checks
from django.db import models
from django.test import TestCase, skipIfDBFeature
from django.test.utils import isolate_apps
from .models import Bar, FkToChar, Foo, PrimaryKeyCharModel
class ForeignKeyTests(TestCase):
def test_... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\Response;
class CheckResponseForModifications
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public func... | php | github | https://github.com/laravel/framework | src/Illuminate/Http/Middleware/CheckResponseForModifications.php |
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration11_es5.ts] ////
//// [asyncFunctionDeclaration11_es5.ts]
async function await(): Promise<void> {
}
//// [asyncFunctionDeclaration11_es5.js]
"use strict";
function await() {
return __awaiter(this, void 0, void 0, function* () {
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es2015).js |
//===--- TypeLayoutDumper.h - Tool to dump fixed type layouts ---*- C++ -*-===//
//
// 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/L... | c | github | https://github.com/apple/swift | lib/IRGen/TypeLayoutDumper.h |
#!/usr/bin/python -tt
# Copyright (c) 2017 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 by applicable ... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import sys
import socket
from socket import error as SocketError, timeout as SocketTimeout
import warnings
from .packages import six
try: # Python 3
from http.client import HTTPConnection as _HTTPConnection, HTTPException
except ImportError:
from httplib import HTTPConnection as _HTTPConnectio... | unknown | codeparrot/codeparrot-clean | ||
// Macros and other things needed by ceval.c, and bytecodes.c
/* Computed GOTOs, or
the-optimization-commonly-but-improperly-known-as-"threaded code"
using gcc's labels-as-values extension
(http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html).
The traditional bytecode evaluation loop uses a "switc... | c | github | https://github.com/python/cpython | Python/ceval_macros.h |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import random
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.addons.web.http import request
class payment_transaction(orm.Model):
_inherit = 'payment.transaction'
_columns = {
# link with the sale order
'sale_order_id': fields.ma... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015 Rackspace, 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 agreed to in wr... | unknown | codeparrot/codeparrot-clean | ||
import {useReducer, useRef} from 'react';
function Component(props) {
const ref = useRef(props.value);
const [state] = useReducer(
(state, action) => state + action,
0,
init => ref.current
);
return <Stringify state={state} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{va... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-access-ref-in-reducer-init.js |
'use strict';
const common = require('../common.js');
const bench = common.createBenchmark(main, {
// Unicode confuses ab on os x.
type: ['bytes', 'buffer'],
len: [4, 1024, 102400],
chunks: [1, 4],
c: [50, 500],
chunkedEnc: [1, 0],
duration: 5,
});
function main({ type, len, chunks, c, chunkedEnc, durat... | javascript | github | https://github.com/nodejs/node | benchmark/http/simple.js |
<?php
namespace Illuminate\JsonSchema;
use Closure;
use Illuminate\JsonSchema\Types\Type;
/**
* @method static Types\ObjectType object(Closure|array<string, Types\Type> $properties = [])
* @method static Types\IntegerType integer()
* @method static Types\NumberType number()
* @method static Types\StringType stri... | php | github | https://github.com/laravel/framework | src/Illuminate/JsonSchema/JsonSchema.php |
"""Tests for the create_fake_certs management command. """
from django.test import TestCase
from django.core.management.base import CommandError
from nose.plugins.attrib import attr
from opaque_keys.edx.locator import CourseLocator
from student.tests.factories import UserFactory
from certificates.management.commands i... | unknown | codeparrot/codeparrot-clean | ||
def __getfilesystemencoding():
'''
Note: there's a copy of this method in interpreterInfo.py
'''
import sys
try:
ret = sys.getfilesystemencoding()
if not ret:
raise RuntimeError('Unable to get encoding.')
return ret
except:
try:
#Handle Jyt... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Adam.Dybbroe
# Author(s):
# Adam.Dybbroe <a000680@c20671.ad.smhi.se>
# 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, eith... | unknown | codeparrot/codeparrot-clean | ||
// RUN: %check_clang_tidy %s altera-kernel-name-restriction %t -- -- -I%S/Inputs/kernel-name-restriction
// RUN: %check_clang_tidy -check-suffix=UPPERCASE %s altera-kernel-name-restriction %t -- -- -I%S/Inputs/kernel-name-restriction/uppercase -DUPPERCASE
#ifdef UPPERCASE
// The warning should be triggered regardless ... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/altera/kernel-name-restriction.cpp |
import { Client } from 'components'
export async function Component(a) {
const b = 1
return (
<Client
// Should be 1 110000 0, which is "e0" in hex (counts as two params,
// because of the encrypted bound args param)
fn1={async (c) => {
'use cache'
return a + b + c
}}
... | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/server-actions/server-graph/52/input.js |
# Copyright 2013-2015 Free Software Foundation, Inc.
#
# This 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 prog... | unknown | codeparrot/codeparrot-clean | ||
import json
import os
import re
from threading import Thread
import time
from membase.api.rest_client import RestConnection
from memcached.helper.data_helper import MemcachedClientHelper
from remote.remote_util import RemoteMachineShellConnection, RemoteMachineHelper
import testconstants
import gzip
import urllib
from... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/package-info.java |
"""Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import socket
import io
import errno
import os
import threading
import time
import unittest
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, skipUnless... | python | github | https://github.com/python/cpython | Lib/test/test_ftplib.py |
# Copyright 2008-2015 Canonical
#
# 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
# License, or (at your option) any later version.
#
# This program is distributed... | unknown | codeparrot/codeparrot-clean | ||
"""Calendar printing functions
Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""
from __future__ impo... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
"""
[Hosted Graphite](https://www.hostedgraphite.com/) is the powerful open-source
application metrics system used by hundreds of companies. We take away the
headaches of scaling, maintenance, and upgrades and let you do what you do
best - write great software.
#### Configuration
Enable this handler
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.tests
import io.ktor.client.call.*
import io.ktor.client.request.*
import io.ktor.client.request.forms.*
import io.ktor.client.test.base.*
import io.ktor.http.*
import ... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-tests/common/test/io/ktor/client/tests/MultiPartFormDataTest.kt |
#! /usr/bin/env python
import os
import unittest
from pprint import pprint
from peyotl.api import TreeCollectionsAPI
from peyotl.test.support import test_collections_api, raise_http_error_with_more_detail
from peyotl.test.support.pathmap import get_test_ot_service_domains
from peyotl.utility import get_logger
from req... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Tests for grr.lib.email_alerts."""
import mock
from grr.lib import email_alerts
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.rdfvalues import standard as rdf_standard
class SendEmailTests(test_lib.GRRBaseTest):
def setUp(self):
super(SendEmailTests, self).setUp(... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Recruitment',
'version': '1.0',
'category': 'Human Resources/Recruitment',
'sequence': 90,
'summary': 'Track your recruitment pipeline',
'description': "",
'website': 'https://www... | unknown | codeparrot/codeparrot-clean | ||
//! Module to handle integer operations.
//! This module exists because some integer types are not supported on some gcc platforms, e.g.
//! 128-bit integers on 32-bit platforms and thus require to be handled manually.
// cSpell:words cmpti divti modti mulodi muloti udivti umodti
use gccjit::{
BinaryOp, CType, Co... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_gcc/src/int.rs |
/*
* 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 | core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnClassTests.java |
'''
https://leetcode.com/problems/sum-root-to-leaf-numbers/description/
Input: [1,2,3]
1
/ \
2 3
Output: 25
Explanation:
The root-to-leaf path 1->2 represents the number 12.
The root-to-leaf path 1->3 represents the number 13.
Therefore, sum = 12 + 13 = 25.
Input: [4,9,0,5,1]
4
/ \
9 0
/ \
5 1... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
A list of Colombian departaments as `choices` in a
formfield.
This exists in this standalone file so that it's only
imported into memory when explicitly needed.
"""
from __future__ import unicode_literals
DEPARTMENT_CHOICES = (
('AMA', 'Amazonas'),
('ANT', 'Antioquia'),
('ARA',... | unknown | codeparrot/codeparrot-clean | ||
import re, os, sys, string
import datetime
import getopt
import getpass
version = "1.0.2"
lines = ""
iesDefs = {}
ieofielist = {}
outdir = './'
filenames = []
verbosity = 0
prefix = ""
FAIL = '\033[91m'
WARN = '\033[93m'
ENDC = '\033[0m'
fileprefix = ""
fileprefix_first_upper = ""
def printFail(string):
sys.s... | unknown | codeparrot/codeparrot-clean | ||
import re
from django.conf import settings
from django.utils.encoding import smart_bytes
from pipeline.compilers import CompilerBase
from pipeline.exceptions import CompilerError
class BrowserifyCompiler(CompilerBase):
output_extension = 'browserified.js'
def match_file(self, path):
# Allow for cach... | unknown | codeparrot/codeparrot-clean | ||
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/protocolPB/ZKFCProtocolClientSideTranslatorPB.java |
# $Id: __init__.py 4813 2006-11-13 03:41:08Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This package contains the Python Source Reader modules.
"""
__docformat__ = 'reStructuredText'
import sys
import docutils.readers
from docutils.reader... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011-2012 OpenStack LLC.
# 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... | unknown | codeparrot/codeparrot-clean | ||
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
from trytond.config import CONFIG
from trytond.transaction import Transaction
from trytond.exceptions import NotLogged
def _get_pool(dbname):
d... | 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 | cluster/validate-cluster.sh |
#!/usr/bin/env bash
## /!\ This file must be used at the root of the prometheus project
## This script provides utils method to help to release and verify the readiness of each libs under the folder ui/
set -e
current=$(pwd)
root_ui_folder=${current}/web/ui
cd "${root_ui_folder}"
files=("../../LICENSE" "../../CHAN... | unknown | github | https://github.com/prometheus/prometheus | scripts/ui_release.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 | core/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/ServiceConnection.java |
/*!
* @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 {cssValueLexer} from './css-value-lexer';
describe('css-value-lexer', () => {
it('should extract the token... | typescript | github | https://github.com/angular/angular | adev/src/app/features/home/animation/parser/css-value-lexer.spec.ts |
#include "git-compat-util.h"
#include "hex.h"
#include "strbuf.h"
#include "trace2/tr2_tbuf.h"
#include "trace2/tr2_sid.h"
#define TR2_ENVVAR_PARENT_SID "GIT_TRACE2_PARENT_SID"
static struct strbuf tr2sid_buf = STRBUF_INIT;
static int tr2sid_nr_git_parents;
/*
* Compute the final component of the SID representing t... | c | github | https://github.com/git/git | trace2/tr2_sid.c |
#ifndef SRC_ENV_PROPERTIES_H_
#define SRC_ENV_PROPERTIES_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
// PER_ISOLATE_* macros: We have a lot of per-isolate properties
// and adding and maintaining their getters and setters by hand would be
// difficult so let's make the preprocessor generate them for us... | c | github | https://github.com/nodejs/node | src/env_properties.h |
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* 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 req... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/PE/LoadConfigurations/DynamicRelocation/DynamicRelocationBase.cpp |
import django
from django.contrib import admin
from .models import EmailConfirmation, EmailAddress
from .adapter import get_adapter
class EmailAddressAdmin(admin.ModelAdmin):
list_display = ('email', 'user', 'primary', 'verified')
list_filter = ('primary', 'verified')
search_fields = []
raw_id_fields ... | unknown | codeparrot/codeparrot-clean | ||
import {CONST_NUMBER0, invoke} from 'shared-runtime';
function Foo() {
const x = [{value: 0}, {value: 1}, {value: 2}];
const param = CONST_NUMBER0;
const foo = () => {
return x[param].value;
};
return invoke(foo);
}
export const FIXTURE_ENTRYPOINT = {
fn: Foo,
params: [{}],
}; | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-array-access-member-expr-captured.ts |
# 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 os
import xml... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2007-2015 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 | ||
import sys
import os
import shutil
me_filename = 'mediaelement'
mep_filename = 'mediaelementplayer'
combined_filename = 'mediaelement-and-player'
# BUILD MediaElement (single file)
print('building MediaElement.js')
me_files = []
me_files.append('me-header.js')
me_files.append('me-namespace.js')
me_files.append('me-u... | unknown | codeparrot/codeparrot-clean | ||
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.gi... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/compute/exception.hpp |
#!/usr/bin/env python
# encoding: utf-8
# Carlos Rafael Giani, 2007 (dv)
# Thomas Nagy, 2008-2010 (ita)
import sys
from waflib.Tools import ar, d
from waflib.Configure import conf
@conf
def find_dmd(conf):
"""
Find the program *dmd*, *dmd2*, or *ldc* and set the variable *D*
"""
conf.find_program(['dmd', 'dmd2', ... | unknown | codeparrot/codeparrot-clean | ||
#ifndef NUMPY_SRC_COMMON_NPYSORT_HWY_SIMD_QSORT_HPP
#define NUMPY_SRC_COMMON_NPYSORT_HWY_SIMD_QSORT_HPP
#include "common.hpp"
namespace np::highway::qsort_simd {
#include "highway_qsort.dispatch.h"
NPY_CPU_DISPATCH_DECLARE(template <typename T> void QSort, (T *arr, npy_intp size))
#include "highway_qsort_16bit.disp... | unknown | github | https://github.com/numpy/numpy | numpy/_core/src/npysort/highway_qsort.hpp |
<?php
namespace Illuminate\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Contracts\Queue\ShouldQueueAfterCommit;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Database\Eloque... | php | github | https://github.com/laravel/framework | src/Illuminate/Notifications/SendQueuedNotifications.php |
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from typing import Any, Optional, Text
import logging
import re
from email.header import decode_header
import email.message as message
from django.conf import settings
from zerver.lib.actions import decode_email_address, get_email_gateway_message_string_from_address, \
int... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'Krivenko'
from sys import maxsize
class Contact:
def __init__(self,firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None, address=None, homephone=None, mobilephone=None, workphone=None,secondaryphone=None,
fax=None,byear=None, ayear=None, addr... | unknown | codeparrot/codeparrot-clean | ||
from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-langua... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import sys
from redis import __version__
try:
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
... | unknown | codeparrot/codeparrot-clean | ||
#from opengmcore import _opengmcore.adder as adder
from opengmcore import *
from __version__ import version
from functionhelper import *
from _inf_param import _MetaInfParam , InfParam
from _visu import visualizeGm
from _misc ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Documentation on PRESUBMIT.py can be found at:
# http://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
import json
import hashl... | 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 | ||
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: templategroups.notifications.alerting.grafana.app
spec:
group: notifications.alerting.grafana.app
names:
kind: TemplateGroup
plural: templategroups
scope: Namespaced
versions:
- name: v0alpha1
schema:
openAP... | unknown | github | https://github.com/grafana/grafana | apps/alerting/notifications/definitions/templategroup.notifications.alerting.grafana.app.yaml |
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA)."""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
from numbers import Integral, Real
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import svds
from sklearn.base import (
BaseEstimato... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/decomposition/_truncated_svd.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
// 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 | discovery/kubernetes/kubernetes.go |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
'''
class Solution:
def isBalanced(self, root: TreeNode) -> bool:
return self.depth(root) != -1
def depth(self, root):
if no... | unknown | codeparrot/codeparrot-clean | ||
'''
Copyright 2013 Cosnita Radu Viorel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute... | unknown | codeparrot/codeparrot-clean | ||
- Feature Name: Follower Reads Adoption
- Implementation Status: completed
- Start Date: 2018-12-27
- Authors: Andrew Werner
- RFC PR: #33474
- Cockroach Issue: #16593
# Summary
Follower reads are consistent reads at historical timestamps from follower
replicas. They make the non-leaseholder replicas in a range suita... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20181227_follower_reads_implementation.md |
# 05.10.2007, c
# last revision: 25.02.2008
from sfepy import data_dir
filename_mesh = data_dir + '/meshes/3d/special/cube_sphere.mesh'
# Whole domain $Y$.
region_1000 = {
'name' : 'Y',
'select' : 'all',
}
# Domain $Y_1$.
region_1 = {
'name' : 'Y1',
'select' : 'elements of group 1',
}
# Domain $Y_2$... | unknown | codeparrot/codeparrot-clean | ||
bugfixes:
- password lookup plugin - replace random.SystemRandom() with secrets.SystemRandom() when
generating passwords (https://github.com/ansible/ansible/issues/85956, https://github.com/ansible/ansible/pull/85971). | unknown | github | https://github.com/ansible/ansible | changelogs/fragments/replace-random-with-secrets.yml |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package jsonformat
import (
"fmt"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/mitchellh/colorstring"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/command/... | go | github | https://github.com/hashicorp/terraform | internal/command/jsonformat/state_test.go |
# keyword.py - $Keyword$ expansion for Mercurial
#
# Copyright 2007-2012 Christian Ebert <blacktrash@gmx.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
#
# $Id$
#
# Keyword expansion hack against the grain of a Distributed SC... | unknown | codeparrot/codeparrot-clean | ||
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.