code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | unknown | codeparrot/codeparrot-clean | ||
import { inject } from '../apiInject'
import { warn } from '../warning'
export const ssrContextKey: unique symbol = Symbol.for('v-scx')
export const useSSRContext = <T = Record<string, any>>(): T | undefined => {
if (!__GLOBAL__) {
const ctx = inject<T>(ssrContextKey)
if (!ctx) {
__DEV__ &&
wa... | typescript | github | https://github.com/vuejs/core | packages/runtime-core/src/helpers/useSsrContext.ts |
#### Note: this error code is no longer emitted by the compiler.
An explicit generic argument was provided when calling a function that
uses `impl Trait` in argument position.
Erroneous code example:
```ignore (no longer an error)
fn foo<T: Copy>(a: T, b: impl Clone) {}
foo::<i32>(0i32, "abc".to_string());
```
Eit... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0632.md |
//go:build linux
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/eviction/memory_threshold_notifier_test.go |
from django.db import models
class SillyModel(models.Model):
silly_field = models.BooleanField(default=False)
silly_tribble = models.ForeignKey("migrations.Tribble", models.CASCADE)
is_trouble = models.BooleanField(default=True) | python | github | https://github.com/django/django | tests/migrations/migrations_test_apps/unmigrated_app/models.py |
#=========================================================================
# metaclasses.py
#=========================================================================
"""Collection of metaclasses to implement python magic."""
import inspect
import collections
#---------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
from unittest import TestCase
from unittest.mock import patch
from email_parser import fs
from email_parser.model import *
class MockPath(object):
def __init__(self, path, is_dir=False, parent='.'):
self.path = path
self._is_dir = is_dir
self.name = path.split('/')[-1]
self._parent ... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# 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 requir... | unknown | codeparrot/codeparrot-clean | ||
#########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | unknown | codeparrot/codeparrot-clean | ||
/**
* \file ccm.h
*
* \brief This file provides an API for the CCM authenticated encryption
* mode for block ciphers.
*
* CCM combines Counter mode encryption with CBC-MAC authentication
* for 128-bit block ciphers.
*
* Input to CCM includes the following elements:
* <ul><li>Payload - data that is both... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/mbedtls/ccm.h |
"""The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, hostn... | unknown | codeparrot/codeparrot-clean | ||
from DQN import DeepQNetwork
from map_env import Map
import numpy as np
EPS = 300000
STEP = 400
action_space = ['f','b','l','r']
DIST = 0.01
R = 0.5
MEMORYCAPACITY = 400000
def compute_reward(state, state_):
"""
if distance is decreasing, reward +1; if distance is increasing, reward -1;
if reach the goal,... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import json
import time
from conf import _
from init import db, cur, opener
import log
import lib
import stats
lcount = 0
def get(url):
log.write("Getting %d page(s) of %d links from: %s..." % (_['page_limit'], _['links_per_page'], url), 'message')
start = time.time()
after = ''
fo... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import werkzeug
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
from openerp.addons.website.models.website import slug
from openerp.addons.web.controllers.main import login_redirect
PPG = 20 # Products Per Page
PP... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
import string
from collections import Mapping
from markupsafe._compat import text_type, string_types, int_types, \
u... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union, Iterable, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from ..._types import SequenceNotStr
from ..shared.chat_model import ChatModel
fr... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/thread_create_and_run_params.py |
#!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | unknown | codeparrot/codeparrot-clean | ||
import torch
import torch.utils.checkpoint
from transformers.models.blip.image_processing_blip import BlipImageProcessor
class ImgprocModelImageProcessor(BlipImageProcessor):
def new_image_processing_method(self, pixel_values: torch.FloatTensor):
return pixel_values / 2 | python | github | https://github.com/huggingface/transformers | examples/modular-transformers/modular_new_imgproc_model.py |
# libclc
libclc is an open source implementation of the library
requirements of the OpenCL C programming language, as specified by the
OpenCL 1.1 Specification. The following sections of the specification
impose library requirements:
* 6.1: Supported Data Types
* 6.2.3: Explicit Conversions
* 6.2.4.2: Reinterpr... | unknown | github | https://github.com/llvm/llvm-project | libclc/README.md |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.llms import Baseten
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATE... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/llms/baseten.py |
# Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 fi... | unknown | codeparrot/codeparrot-clean | ||
DOCUMENTATION:
module: facts_one
short_description: random facts returned
version_added: historical
description: random facts for testing | unknown | github | https://github.com/ansible/ansible | test/integration/targets/ansible-doc/library/facts_one.yml |
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
"""Listado y creación del consolidado anual"""
import cgi
import cgitb; cgitb.enable()
import funciones
import datos
import pagina
import htm
import csv
import StringIO
def listado():
"""Listado de consolidado"""
pag = pagina.Pagina("Consolidado anual", 4)
prin... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
#
# example2_qt.py -- Simple, configurable FITS viewer.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys, os
import logging, logging.h... | unknown | codeparrot/codeparrot-clean | ||
# orm/path_registry.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Path tracking utilities, representing mapper graph traversals.
"""
from .. ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2024 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.
//go:build freebsd || linux || solaris
package os_test
import (
"bytes"
"io"
"math/rand"
. "os"
"runtime"
"strconv"
"strings"
"syscall"
"testing"
"t... | go | github | https://github.com/golang/go | src/os/readfrom_unix_test.go |
from collections import Counter
import datasets
import transformers
from transformers.convert_slow_tokenizer import SLOW_TO_FAST_CONVERTERS
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
from transformers.utils import logging
logging.set_verbosity_info()
TOKENIZER_CLASSES = {
name: (ge... | python | github | https://github.com/huggingface/transformers | scripts/check_tokenizers.py |
"""
LIRC interface to receive signals from a infrared remote control.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lirc/
"""
# pylint: disable=import-error
import threading
import time
import logging
import voluptuous as vol
from homeassistant.const... | 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 'CourseRegistrationCode.order'
db.add_column('shoppingcart_courseregistrationcode', 'order',
... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
from abjad import *
def test_mathtools_NonreducedFraction_with_denominator_01():
assert mathtools.NonreducedFraction((0, 6)).with_denominator(12) == mathtools.NonreducedFraction(0, 12)
assert mathtools.NonreducedFraction((1, 6)).with_denominator(12) == mathtools.NonreducedFraction(2, ... | unknown | codeparrot/codeparrot-clean | ||
from pyramid.config import Configurator
import os
import blue_yellow_app
import blue_yellow_app.controllers.home_controller as home
import blue_yellow_app.controllers.albums_controller as albums
import blue_yellow_app.controllers.account_controller as account
import blue_yellow_app.controllers.admin_controller as admin... | unknown | codeparrot/codeparrot-clean | ||
import { ok, test } from '../../test';
export default test({
get props() {
return {
/** @type {any} */
testName1: 'test1',
/** @type {any} */
testName2: 'test2'
};
},
html: '<div class="test1test2"></div>',
test({ assert, component, target }) {
const div = target.querySelector('div');
ok(div)... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/attribute-null-classnames-no-style/_config.js |
/// Sign of Y, magnitude of X (f128)
///
/// Constructs a number with the magnitude (absolute value) of its
/// first argument, `x`, and the sign of its second argument, `y`.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn copysignf128(x: f128, y: f128) -> f128 {
super::generic::copysign(x, y)
} | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/copysignf128.rs |
#Author: Tree Form starplant@gmail.com
import direct.directbase.DirectStart
from panda3d.core import FrameBufferProperties, TextNode, Vec4, BitMask32, Point3
from panda3d.core import WindowProperties, GraphicsOutput, Texture , GraphicsPipe
from direct.showbase.DirectObject import DirectObject
from direct.gui.OnscreenT... | unknown | codeparrot/codeparrot-clean | ||
try:
import autotest.common as common
except ImportError:
import common
from autotest.database import db_utils
UP_SQL = """
CREATE INDEX afe_drone_sets_drones_droneset_ibfk
ON afe_drone_sets_drones (droneset_id);
ALTER TABLE afe_drone_sets_drones
DROP KEY afe_drone_sets_drones_unique;
ALTER TABLE afe_drone_s... | unknown | codeparrot/codeparrot-clean | ||
"""
An ECMAScript 3 lexical scanner implementation and various related utilities.
"""
from .token import *
from .constants import *
from .utils import (
is_identifier_start, is_identifier_part, is_whitespace_char,
is_line_terminator, Locator, Stream
)
class Scanner(object):
"""
Produces lexical tokens ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_mask_vect.py
--------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
******************************... | unknown | codeparrot/codeparrot-clean | ||
Rust 2015 does not permit the use of `async fn`.
Erroneous code example:
```compile_fail,E0670
async fn foo() {}
```
Switch to the Rust 2018 edition to use `async fn`. | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0670.md |
# -*- coding: utf-8 -*-
""" Port of the original Rollsum (written in Go) code from Camlistore.
https://github.com/bradfitz/camlistore/blob/master/pkg/rollsum/rollsum.go
"""
__author__ = 'Thomas Sileo (thomas@trucsdedev.com)'
WINDOW_SIZE = 64
CHAR_OFFSET = 31
BLOB_BITS = 13
BLOB_SIZE = 1 << BLOB_BITS
class Rolls... | 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 | ||
import os
import hashlib
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
require_model_validation = False
def handle(self, *args, **options):
if len(args) != 1:
raise CommandError("build <role>")
self.... | 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/net/DomainNameResolverFactory.java |
import unittest
from urwid.compat import B
from urwid.escape import str_util
class DecodeOneTest(unittest.TestCase):
def gwt(self, ch, exp_ord, exp_pos):
ch = B(ch)
o, pos = str_util.decode_one(ch,0)
assert o==exp_ord, " got:%r expected:%r" % (o, exp_ord)
assert pos==exp_pos, " got... | unknown | codeparrot/codeparrot-clean | ||
/// Round `x` to the nearest integer, breaking ties away from zero.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn roundf16(x: f16) -> f16 {
super::generic::round(x)
} | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/roundf16.rs |
# Utility for Recursively Running Self Tests
# TODO {{{1
# Support for coverage is weak because the coverage tool needs to be run
# hiearchically from the current working directory whereas this tool walks the
# hierarchy running tests. Probably need a different tool for coverage.
# Consider adding support for f... | unknown | codeparrot/codeparrot-clean | ||
from .crawler import Crawler
from .tools import *
class techorange(Crawler):
def __init__(self):
self.url = 'http://buzzorange.com/techorange/'
self.queue = []
self.r = requests.Session()
def next(self):
if not self.queue:
self.grab()
get_page(self,)
de... | unknown | codeparrot/codeparrot-clean | ||
// #docregion
import {Injectable} from '@angular/core';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {QuestionBase} from './question-base';
@Injectable()
export class QuestionControlService {
toFormGroup(questions: QuestionBase<string>[]) {
const group: any = {};
questions.forE... | typescript | github | https://github.com/angular/angular | adev/src/content/examples/dynamic-form/src/app/question-control.service.ts |
"""
Use lldb Python SBWatchpoint API to set the ignore count.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class WatchpointIgnoreCountTestCase(TestBase):
mydir = TestBase.compute_mydir(__fi... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransportTests.java |
/**
* 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/fs/TrashPolicy.java |
from django.shortcuts import get_object_or_404
from basic.groups.decorators import *
from basic.groups.models import *
from basic.groups.forms import *
from basic.tools.shortcuts import render, redirect
def page_list(request, slug, template_name='groups/pages/page_list.html'):
"""
Returns a list of pages for ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mapeo', '0001_initial'),
('contraparte', '0004_auto_20150826_1711'),
]
operations = [
migrations.AlterModelOptions(
... | unknown | codeparrot/codeparrot-clean | ||
use rustc_hir::Target;
use rustc_hir::attrs::AttributeKind;
use rustc_span::{Span, Symbol, sym};
use crate::attributes::prelude::Allow;
use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
use crate::context::Stage;
use crate::target_checking::AllowedTargets;
pub(crate) struct RustcDumpUserArgsParser;
impl<S... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs |
from south.db import db
from django.db import models
from links.models import *
class Migration:
def forwards(self, orm):
# Adding model 'Link'
db.create_table('links_link', (
('id', orm['links.Link:id']),
('url', orm['links.Link:url']),
('title', orm['links.Li... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2010 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 applicable law o... | 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 u... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/api_fastapi/auth/managers/simple/user.py |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, add_days, date_diff
from webnotes import msgprint... | unknown | codeparrot/codeparrot-clean | ||
import os
import re
import sys
import unittest
from coalib import coala_format
from coalib.misc.ContextManagers import prepare_file
from tests.TestUtilities import bear_test_module, execute_coala
class coalaFormatTest(unittest.TestCase):
def setUp(self):
self.old_argv = sys.argv
def tearDown(self):
... | unknown | codeparrot/codeparrot-clean | ||
__author__ = "Ross Hendrickson savorywatt"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
import logging
import os
from octoprint.settings import settings
class CuraFactory(object):
@staticmethod
def create_slicer(path=None):
"""Utilizes the factory pattern to setup a Cu... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import tempfile
from varapp.constants.tests import TESTDB
from varapp.export import export
from varapp.samples.samples_factory import samples_list_from_db, samples_selection_factory
from varapp.variants.variants_factory import variants_collection_factory
#@unittest.skip('')
class TestExportUtils(unitte... | unknown | codeparrot/codeparrot-clean | ||
require 'benchmark_driver/runner/peak'
# Actually the same as BenchmarkDriver::Runner::Memory
class BenchmarkDriver::Runner::Size < BenchmarkDriver::Runner::Peak
METRIC = BenchmarkDriver::Metric.new(
name: 'Max resident set size', unit: 'bytes', larger_better: false, worse_word: 'larger',
)
# JobParser retu... | ruby | github | https://github.com/ruby/ruby | benchmark/lib/benchmark_driver/runner/size.rb |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Utils,Options,Context
_options=[x.split(', ')for x in'''
bindir, user executables, ${EXEC_PREFIX}/bin
sbindir, system admin executables, ${EXEC_PR... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
"""
Interactive viewer for the convolutional weights in a pickled model.
Unlike ./show_weights, this shows one unit's weights at a time. This
allows it to display weights from higher levels (which can have 100s
of input channels), not just the first.
"""
import os
import sys
import warnings
im... | unknown | codeparrot/codeparrot-clean | ||
DOCUMENTATION:
name: checksum
version_added: "1.9"
short_description: hash of input data
description:
- Returns a configurable hash of the input data. Uses L(SHA-1, https://en.wikipedia.org/wiki/SHA-1) by default.
positional: _input
options:
_input:
description: Data to checksum.
type: r... | unknown | github | https://github.com/ansible/ansible | lib/ansible/plugins/filter/hash.yml |
# -*- coding: utf-8 -*-
u"""Shadow execution template.
:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkio
from pykern.pkcollections import PKDict
from... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Command;
use Symfony\Bundle\FrameworkBun... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php |
from django.views.generic import (CreateView, DeleteView, DetailView,
ListView, UpdateView)
from braces.views import LoginRequiredMixin, SuperuserRequiredMixin
from .forms import CategoryForm
from .models import Category
from ..article.models import Article
class CategoryListView(Li... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
"""Functional interface to graph methods and assorted utilities.
"""
# Copyright (C) 2004-2012 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
import networkx as nx
import itertools
__author__ = """\n""".jo... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/requests/ShareRequestMetadata.java |
//===--- StorageImpl.h - Storage declaration access impl --------*- C++ -*-===//
//
// 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... | c | github | https://github.com/apple/swift | include/swift/AST/StorageImpl.h |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "1_auto")]
operations = [migrations.RunPython(migrations.RunPython.noop)] | python | github | https://github.com/django/django | tests/migrations/test_migrations_squashed_complex/2_auto.py |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 NEC Corporation
# Copyright 2015 Cisco Systems, 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
#
# Un... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* ginfast.c
* Fast insert routines for the Postgres inverted index access method.
* Pending entries are stored in linear list of pages. Later on
* (typically during VACUUM), ginInsertCleanup() will be invoked to
* transfer pend... | c | github | https://github.com/postgres/postgres | src/backend/access/gin/ginfast.c |
# Copyright 2009 Raymond Hettinger
#
# 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,
# dis... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Tool.Packaging.rpm
The rpm packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal i... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import logging
import re
from collections.abc import Sequence
from typing import Any
from langchain_core.callbacks import (
CallbackManagerForChainRun,
)
from langchain_core.language_models import BaseLanguageModel
from langchain_core.messages import AIMessage
from langchain_cor... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chains/flare/base.py |
// Used only by Serde doc tests. Not public API.
use crate::lib::*;
use crate::ser;
#[doc(hidden)]
#[derive(Debug)]
pub struct Error;
#[cfg_attr(not(no_diagnostic_namespace), diagnostic::do_not_recommend)]
impl ser::Error for Error {
fn custom<T>(_: T) -> Self
where
T: Display,
{
unimple... | rust | github | https://github.com/serde-rs/serde | serde_core/src/private/doc.rs |
# validateNoSetStateInEffects
## File
`src/Validation/ValidateNoSetStateInEffects.ts`
## Purpose
Validates against calling `setState` synchronously in the body of an effect (`useEffect`, `useLayoutEffect`, `useInsertionEffect`), while allowing `setState` in callbacks scheduled by the effect. Synchronous setState in e... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/docs/passes/46-validateNoSetStateInEffects.md |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Contro... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php |
# frozen_string_literal: true
require "active_record/type_caster/map"
require "active_record/type_caster/connection"
module ActiveRecord
module TypeCaster # :nodoc:
end
end | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/type_caster.rb |
from database import init_db, db_session
from flask import Flask, request, session, redirect, url_for, abort, render_template, flash
from models import Patient, GCMClient
from app import app
import json
import urllib2
url = 'https://gcm-http.googleapis.com/gcm/send'
apiKey = 'AIzaSyD9PbaRlBssxLywSnWDbocrCbqk7GyDidc'... | unknown | codeparrot/codeparrot-clean | ||
from pandas import (
Categorical,
Index,
Series,
)
from pandas.core.arrays import BaseMaskedArray
def get_array(obj, col=None):
"""
Helper method to get array for a DataFrame column or a Series.
Equivalent of df[col].values, but without going through normal getitem,
which triggers tracking... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/copy_view/util.py |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package consts
// NOTE: this file has been copied to
// https://github.com/hashicorp/vault/blob/main/api/plugin_types.go
// Any changes made should be made to both files at the same time.
import (
"encoding/json"
"fmt"
)
var PluginTypes = []Plu... | go | github | https://github.com/hashicorp/vault | sdk/helper/consts/plugin_types.go |
#!/usr/bin/python
import os
import datetime
import re
lib_pre = 'lib'
re_curly = re.compile( '(?:|{})', re.DOTALL)
#re_currly = re.compile( '(?:|{})', re.DOTALL)
# see https://docs.scipy.org/doc/numpy/user/basics.types.html
array_types = {
"float" : ( "float32" , "array1f" ),
"double" : ( "float64" , "... | unknown | codeparrot/codeparrot-clean | ||
import MapModel as Mm
from MapObjects.Wall import Wall
from MapObjects.Player import Player
from MapObjects.HeartStone import HeartStone
import random
import itertools
def get_object_by_char(char, player):
switcher = {
'.': lambda: Mm.ground,
'W': lambda: Wall(200),
'P': lambda: player,
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
RDF Graph In Memory database module.
# Author: Tomás Vírseda <tomasvirseda@gmail.com>
# License: GPLv3
# Description: In-memory database module
"""
from kb4it.core.service import Service
from kb4it.core.util import guess_datetime, sort_dictionary
class KB4ITDB(Servic... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""
/***************************************************************************
symbol_xml2db.py
-------------------
begin : 26-5-2012
copyright : (C) 2012 by Arunmozhi
email : arunt... | 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 | ||
import builtins
import functools
import itertools
import math
import numbers
import operator
import sys
import warnings
import numpy as np
from numpy.exceptions import AxisError
from . import multiarray, numerictypes, numerictypes as nt, overrides, shape_base, umath
from ._ufunc_config import errstate
from .multiarra... | python | github | https://github.com/numpy/numpy | numpy/_core/numeric.py |
from .._compat import JYTHON
from warnings import warn
from beaker.crypto.pbkdf2 import pbkdf2
from beaker.crypto.util import hmac, sha1, hmac_sha1, md5
from beaker import util
keyLength = None
if JYTHON:
try:
from beaker.crypto.jcecrypto import getKeyLength, aesEncrypt
keyLength = getKeyLength(... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_decrypt_text
from youtube_dl.utils impo... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from sentry.db.models import FlexibleForeignKey
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'AuthProvider.defau... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
set -eux
ANSIBLE_CALLBACK_RESULT_FORMAT=yaml ANSIBLE_ROLES_PATH=../ ansible-playbook template.yml -i ../../inventory -v "$@"
# Test for https://github.com/ansible/ansible/pull/35571
echo "presence of an undefined var in a template should not break things that don't access it"
ansible testhost -i ... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/template/runme.sh |
import { test } from '../../test';
export default test({
html: `
<div data-id="1">
<inner>0</inner>
<inner>1</inner>
</div>
<div data-id="2">
<inner>0</inner>
<inner>1</inner>
</div>
<div data-id="3">
<inner>0</inner>
<inner>1</inner>
</div>
`,
ssrHtml: `
<div data-id="1">
<inner... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-binding-each-remount-keyed/_config.js |
import six
import cherrypy
from cherrypy.test import helper
class IteratorBase(object):
created = 0
datachunk = 'butternut squash' * 256
@classmethod
def incr(cls):
cls.created += 1
@classmethod
def decr(cls):
cls.created -= 1
class OurGenerator(IteratorBase):
def __it... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
import pandas._testing as tm
from pandas.core.indexes.api import Index
class TestJoinInt64Index:
def test_join_non_unique(self):
left = Index([4, 4, 3, 3])
joined, lidx, ridx = left.join(left, return_indexers=True)
exp_joined = Index([4, 4, 4, 4, 3, 3, 3,... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/indexes/numeric/test_join.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.