code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from lyricwiki.items import LyricWikiItem
class LyricWikiSpider(CrawlSpider):
name = "three6mafia" #CHANGE NAME
all... | unknown | codeparrot/codeparrot-clean | ||
"""
This config file tries to mimic the production environment more closely than the
normal dev.py. It assumes you're running a local instance of MySQL 5.1 and that
you're running memcached. You'll want to use this to test caching and database
migrations.
Assumptions:
* MySQL 5.1 (version important? (askbot breaks on... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.sqlite3.introspection import (
DatabaseIntrospection,
FlexibleFieldLookupDict,
)
class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
Subclass that includes updates the `base_data_types_reverse` dict
for geometry fiel... | python | github | https://github.com/django/django | django/contrib/gis/db/backends/spatialite/introspection.py |
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1)))) | unknown | mbpp | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import LanceDB
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
D... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/vectorstores/lancedb.py |
/*
* 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 ma... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/prefetch/EmptyPrefetchingStatistics.java |
# encoding: 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):
# Changing field 'Bug.tracker_id'
db.alter_column('search_bug', 'tracker_id', self.gf('django.db.models.fields.Pos... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | unknown | codeparrot/codeparrot-clean | ||
from Cython.TestUtils import CythonTest
class TestCodeWriter(CythonTest):
# CythonTest uses the CodeWriter heavily, so do some checking by
# roundtripping Cython code through the test framework.
# Note that this test is dependant upon the normal Cython parser
# to generate the input trees to the CodeW... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function, division
from sympy.core import S, sympify
from sympy.core.compatibility import range
from sympy.functions import Piecewise, piecewise_fold
from sympy.sets.sets import Interval
def _add_splines(c, b1, d, b2):
"""Construct c*b1 + d*b2."""
if b1 == S.Zero or c == S.Zero:
... | unknown | codeparrot/codeparrot-clean | ||
import inspect
from sqlalchemy.engine import create_engine
from sqlalchemy.engine.url import URL
from sqlalchemy.orm import configure_mappers, sessionmaker
from .base import Base, Entity
from .intersection import Intersection
from .lookup import LookupResult
from .mvt import MVTCache
from .route import Route
from .st... | unknown | codeparrot/codeparrot-clean | ||
pub mod analyze;
pub mod endpoint;
pub mod project;
pub mod turbopack_ctx;
pub mod utils; | rust | github | https://github.com/vercel/next.js | crates/next-napi-bindings/src/next_api/mod.rs |
"""
Serialize biobank objects
=========================
The general usage scheme is as follows.
.. code-block:: python
from bl.vl.kb.serialize import Serializer
devices = kb.get_devices()
engine = Serializer()
for d in devices:
d.serialize(engine)
"""
class Serializer(object):
"""kb se... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package ldap
import (
"context"
"fmt"
"strings"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/helper/automatedrotationutil"
"github.com/hashicorp/vault/sdk/helper/consts"
"github.com/hashicorp/vault/sdk/helper/... | go | github | https://github.com/hashicorp/vault | builtin/credential/ldap/path_config.go |
"""Unittests for pydelicious module.
"""
import sys, os
import unittest
import urllib
import urllib2
import pydelicious
import time
from StringIO import StringIO
test_data = {
# old rss feeds
'http://del.icio.us/rss/': 'var/rss.xml',
'http://del.icio.us/rss/popular/': 'var/rss_popular.xml',
'http://del... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from measurements import smoothness
from metrics import power
from telemetry import decorators
from telemetry.core import exceptions
from telemetr... | unknown | codeparrot/codeparrot-clean | ||
from django.conf import settings
from django.utils.html import escape
import django.db as db
import re
from django.contrib.sites.models import Site, RequestSite
from django.utils.safestring import mark_safe
from frontend.models import Message
import settings
import datetime
# Enable proper linebreaks in the SQL
enabl... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 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 agreed to ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Database\Eloquent\Factories;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class BelongsToRelationship
{
/**
* The related factory instance.
*
* @var \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Database\Eloque... | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Eloquent/Factories/BelongsToRelationship.php |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package physical
import (
"testing"
"github.com/hashicorp/go-hclog"
"github.com/stretchr/testify/require"
)
func TestTransactionalErrorInjector_TransactionLimits(t *testing.T) {
tc := []struct {
name string
be Backend
wa... | go | github | https://github.com/hashicorp/vault | sdk/physical/error_test.go |
from tests.support.fixtures import clear_all_cookies
from datetime import datetime, timedelta
def test_add_domain_cookie(session, url, server_config):
session.url = url("/common/blank.html")
clear_all_cookies(session)
create_cookie_request = {
"cookie": {
"name": "hello",
"v... | unknown | codeparrot/codeparrot-clean | ||
# PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/classHeritageWithTrailingSeparator.ts] ////
//// [classHeritageWithTrailingSeparator.ts]
class C { foo: number }
class D extends C, {
}
//// [classHeritageWithTrailingSeparator.js]
"use strict";
class C {
}
class D extends C {
} | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/classHeritageWithTrailingSeparator.js |
import Vapor
import XCTest
import Crypto
final class OTPTests: XCTestCase {
/// Basic TOTP tests using some RFC 6238 test vectors.
/// https://tools.ietf.org/html/rfc6238.html
func testTOTPBasic() {
let time = Date(timeIntervalSince1970: 59)
var key: SymmetricKey
// SHA-1 test
... | swift | github | https://github.com/vapor/vapor | Tests/VaporTests/SecurityTests.swift |
'''
Given two words (beginWord and endWord), and a dictionary, find the length of shortest transformation sequence from beginWord to endWord, such that:
Only one letter can be changed at a time
Each intermediate word must exist in the dictionary
For example,
Given:
start = "hit"
end = "cog"
dict = ["hot","dot","dog",... | 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/test/java/org/apache/kafka/common/requests/OffsetCommitResponseTest.java |
"Test editor, coverage 53%."
from idlelib import editor
import unittest
from collections import namedtuple
from test.support import requires
from tkinter import Tk, Text
Editor = editor.EditorWindow
class EditorWindowTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
requires('gui')
... | python | github | https://github.com/python/cpython | Lib/idlelib/idle_test/test_editor.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, 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',
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
## $Id: bfe_webjournal_MainArticleOverview.py,v 1.28 2009/02/12 10:00:57 jerome Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## pu... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
)
// sortNode represe... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/sort.go |
"""Test the module repeated edited nearest neighbour."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import pytest
import numpy as np
from sklearn.utils._testing import assert_allclose, assert_array_equal
from sklearn.neighbors import NearestNeighbors
from sklearn.... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import logging
import re
from email.header import decode_header
from django.conf import settings
from zerver.lib.actions import decode_email_address, internal_send_message
from zerver.lib.notifications import convert_html_to_markdown
from zerver.lib.redis_utils import get_redi... | 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 | ||
# Type printer commands.
# Copyright (C) 2010-2013 Free Software Foundation, Inc.
# 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 late... | unknown | codeparrot/codeparrot-clean | ||
from textwrap import dedent
from pontoon.base.tests import assert_attributes_equal, TestCase
from pontoon.sync.formats import json_extensions
from pontoon.sync.tests.formats import FormatTestsMixin
BASE_JSON_FILE = """
{
"SourceString": {
"message": "Translated String",
"description": "Sample comment"
},
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import cairo
import sys
import re
import gtk
class DataRange:
def __init__(self, start = 0, end = 0, value = ''):
self.start = start
self.end = end
self.value = value
class EventString... | unknown | codeparrot/codeparrot-clean | ||
"""
Populates a ConfigurationModel by deserializing JSON data contained in a file.
"""
import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext_lazy as _
from config_models.utils import deserialize_json
class Command(Ba... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 F5 Networks 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 writi... | unknown | codeparrot/codeparrot-clean | ||
"""
This is a Custom Storage System for Django with CouchDB backend.
Created by Christian Klein.
(c) Copyright 2009 HUDORA GmbH. All Rights Reserved.
"""
import os
from cStringIO import StringIO
from urlparse import urljoin
from urllib import quote_plus
from django.conf import settings
from django.core.files import Fi... | unknown | codeparrot/codeparrot-clean | ||
/* 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/DEX/MapList.cpp |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2016 CERN.
#
# CERN Analysis Preservation Framework 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... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'vstack', 'hstack',
'stack']
from . import numeric as _nx
from .numeric import asanyarray, newaxis
def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This test can be run stand-alone with something like:
# > PYTHONPATH=. python2 openerp/tests/test_misc.py
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import cgi
import lxml
import unittest
from openerp.tools import html_sanitize, html_emai... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pandas as pd
class Location:
configuration_defaults = {
'location': {
'width': 1000, # Width of our field
'height': 1000, # Height of our field
}
}
def __init__(self):
self.name = 'location'
def setup(self, builder):
... | 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/test/java/org/apache/kafka/clients/consumer/internals/FetchRequestManagerTest.java |
"""
This module defines the database schema of the node.
Each model class defines a table in the database. The fields define the columns of this table.
"""
# library import
from django.db.models import *
from django.core.exceptions import ValidationError
from vamdctap import bibtextools
import re
import datetime
f... | unknown | codeparrot/codeparrot-clean | ||
"""Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significantly contributes to numpy import times. Importing this copy has almost
no overhead.
"""
from __future__ import division, absolute_import, print_function
import types
__all__ = ['... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
from cStringIO import StringIO
from ..backends import static
# There aren't many tests here because i... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: trace-ids
Help: Transfer + connection ids in verbose output
Added: 8.2.0
Category: verbose global
Multi: boolean
Scope: global
See-also:
- trace
- verbose
Example:
- --trace-ids --trace-ascii output $URL
---
# `--t... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/trace-ids.md |
#!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import argparse
import ConfigParser
import json
import copy
from netaddr import IPNetwork
from vnc_api.vnc_api import *
def get_ip(ip_w_pfx):
return str(IPNetwork(ip_w_pfx).ip)
# end get_ip
class VncProvisioner(object):
... | unknown | codeparrot/codeparrot-clean | ||
# testClasses.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.e... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
//go:build !nomsgpack
package binding
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/u... | go | github | https://github.com/gin-gonic/gin | binding/msgpack_test.go |
/*
* 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 | integration-tests/src/test/java/org/springframework/beans/factory/xml/ComponentBeanDefinitionParserTests.java |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashboard"
}
]
},
"e... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dev_dashboards/datasource-opentsdb/v1beta1.opentsdb_v23.v42.json |
"""Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... | unknown | codeparrot/codeparrot-clean | ||
package config
import (
"encoding/json"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/moby/moby/v2/daemon/internal/filters"
"gotest.tools/v3/assert"
"gotest.tools/v3/fs"
)
func TestBuilderGC(t *testing.T) {
tempFile := fs.NewFile(t, "config", fs.WithContent(`{
"builder": {
"gc": {
"enabled"... | go | github | https://github.com/moby/moby | daemon/config/builder_test.go |
<?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\Bridge\Doctrine\ArgumentResolver;
use Doctrine\Persistence\Mana... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Doctrine/ArgumentResolver/EntityValueResolver.php |
/*
* Loongson MMI optimizations for libjpeg-turbo
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2014-2015, 2019, D. R. Commander. All Rights Reserved.
* Copyright (C) 2016-2018, Loongson Technology Corporation Limited, BeiJing.
* All Rights Reserved.
... | c | github | https://github.com/opencv/opencv | 3rdparty/libjpeg-turbo/simd/mips64/jccolext-mmi.c |
#!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
```esql
FROM employees
| KEEP emp_no, salary
| INLINE STATS avg_lt_50 = ROUND(AVG(salary)) WHERE salary < 50000,
avg_lt_60 = ROUND(AVG(salary)) WHERE salary >=50000 AND salary < 60000,
... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/commands/examples/inlinestats.csv-spec/avg-salaries-where.md |
- name: Test vars_prompt custom prompt
hosts: testhost
become: no
gather_facts: no
vars_prompt:
- name: input
prompt: "Enter some input"
tasks:
- assert:
that:
- input == 'some more input'
- debug:
var: input | unknown | github | https://github.com/ansible/ansible | test/integration/targets/builtin_vars_prompt/vars_prompt-2.yml |
# 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 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 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 agreed to in writing, s... | unknown | codeparrot/codeparrot-clean | ||
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
String,
Integer,
Bool,
Set,
Float,
Sequence,
Alias
)
from openpyxl.descriptors.excel import ExtensionList
from openpyxl.descriptors.nested import (
NestedNoneSet,
NestedBool,
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.impl.base.permissions
import com.intellij.openapi.application.Appli... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/permissions/KaBaseAnalysisPermissionChecker.kt |
/*!
* 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/pages/Dag/Code/CodeDiffViewer.tsx |
"""
masked_accumulations.py is for accumulation algorithms using a mask-based approach
for missing values.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
if TYPE_CHECKING:
from collections.abc import Callable
from pandas._typing import npt
def _cum_func(
fun... | python | github | https://github.com/pandas-dev/pandas | pandas/core/array_algos/masked_accumulations.py |
# -*- coding: utf-8 -*-
import KBEngine
import random
import wtimer
import d_spaces
import d_avatar_inittab
from KBEDebug import *
from interfaces.GameObject import GameObject
from interfaces.Teleport import Teleport
class Avatar(KBEngine.Proxy,
GameObject,
Teleport):
def __init__(self):
KBEngine.Proxy.__init... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software withou... | unknown | codeparrot/codeparrot-clean | ||
<?php
return function (Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $container) {
$container->extension('framework', [
'workflows' => [
'test_workflow' => [
'type' => 'workflow',
'supports' => [
'Symfony\Bund... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_override_config.php |
import numpy as np
from .schilling import longest_edge, cormap_pval
def cormap(*intensities):
"""Calculate the correlation map of several 1D arrays.
Idea from Franke et. al.: Correlation Map, a goodness-of-fit test for
one-dimensional X-ray scattering spectra. Nature Methods 2015, 12(5),
pp.419-422 (... | unknown | codeparrot/codeparrot-clean | ||
An array without a fixed length was pattern-matched.
Erroneous code example:
```compile_fail,E0730
fn is_123<const N: usize>(x: [u32; N]) -> bool {
match x {
[1, 2, ..] => true, // error: cannot pattern-match on an
// array without a fixed length
_ => false
}... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0730.md |
import { hydrating } from '../hydration.js';
import { clear_text_content, get_first_child } from '../operations.js';
import { queue_micro_task } from '../task.js';
/**
* @param {HTMLElement} dom
* @param {boolean} value
* @returns {void}
*/
export function autofocus(dom, value) {
if (value) {
const body = docum... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/internal/client/dom/elements/misc.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/admin/RemoveMembersFromConsumerGroupOptions.java |
# frozen_string_literal: true
require "cases/helper"
require "models/topic"
require "models/bulb"
require "models/person"
require "models/car"
require "models/aircraft"
require "models/wheel"
require "models/engine"
require "models/tire"
require "models/reply"
require "models/category"
require "models/categorization"
... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/counter_cache_test.rb |
#!/usr/bin/env python
#
# Copyright 2005,2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | 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/util/AsyncDiskService.java |
#!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# This library 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 ... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime
import operator
import os
import re
import string
from django import template
from django.conf import settings
from django.template import Template
from django.template.loader import render_to_string
from django.template.defaultfilters import truncatewords_html, stringfilter
from django.t... | unknown | codeparrot/codeparrot-clean | ||
Goodbye! (Django templates) | html | github | https://github.com/django/django | tests/template_loader/templates/template_loader/goodbye.html |
###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also contained... | unknown | codeparrot/codeparrot-clean | ||
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | unknown | codeparrot/codeparrot-clean | ||
"""
Copyright 2015 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 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/bootstrap/BootstrapRegistry.java |
"""Test the base tool implementation."""
import inspect
import json
import sys
import textwrap
import threading
from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
from functools import partial
from typing import (
Annotated,
Any,
Gener... | python | github | https://github.com/langchain-ai/langchain | libs/core/tests/unit_tests/test_tools.py |
from base64 import b64encode
import json
import requests
import cv2
import numpy as np
#from receipt_tracker.settings import GOOGLE_API_KEY
import os
GOOGLE_API_KEY = os.environ['GOOGLE_API_KEY']
ENDPOINT_URL = 'https://vision.googleapis.com/v1/images:annotate'
API_KEY = GOOGLE_API_KEY
def make_image_data_list(imag... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
import csv
import os
import sys
from collections import defaultdict
APP_HOME = os.environ['APP_HOME']
# Load the spouse dictionary for distant supervision
spouses = defaultdict(lambda: None)
with open (APP_HOME + "/input/spouses.csv") as csvfile:
reader = csv.reader(csvfile)
for line in re... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_categories(apps, schema_editor):
Category = apps.get_model('niqati', 'Category')
# We are going to add categories only if none already exists.
if not Category.objects.exists():
Category... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse, Http404
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User, Group
from django.contrib impor... | unknown | codeparrot/codeparrot-clean | ||
import React from "react";
import ComponentB from "mfe-b/Component"; // <- these are remote modules,
import ComponentC from "mfe-c/Component"; // <- but they are used as usual packages
import { de } from "date-fns/locale";
// remote modules can also be used with import() which lazy loads them as usual
const ComponentD... | javascript | github | https://github.com/webpack/webpack | examples/module-federation/src/App.js |
# Copyright 2014-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for :py:module:`provisioningserver.dns.actions`."""
import os
from os.path import join
import random
from random import randint
from subprocess import CalledProcessE... | 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/errors/RebootstrapRequiredException.java |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Fekete Mihai <feketemihai@gmail.com>, Tatár Attila <atta@nvm.ro>
# Copyright (C) 2011-2014 TOTAL PC SYSTEMS (http://www.erpsystems.ro).
# Copyright (C) 2014 Fekete Mihai
# Copyright (C) 201... | unknown | codeparrot/codeparrot-clean | ||
/* 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/lite/ir/tfl_ops.h |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import bisect
import re
_ARGUMENT_TYPE_PATTERN = re.compile('\([^()]*\)(\s*const)?')
_TEMPLATE_ARGUMENT_PATTERN = re.compile('<[^<>]*>')
_LEADING_TYPE_P... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
from twisted.internet.endpoints import ProcessEndpoint
from twisted.internet.interfaces import IStreamClientEndpointStringParserWithReactor
from twisted.plugin import IPlugin
from twisted.python imp... | unknown | codeparrot/codeparrot-clean | ||
# case where generator doesn't intercept the thrown/injected exception
def gen():
yield 123
yield 456
g = gen()
print(next(g))
try:
g.throw(KeyError)
except KeyError:
print('got KeyError from downstream!')
# case where a thrown exception is caught and stops the generator
def gen():
try:
yi... | unknown | codeparrot/codeparrot-clean | ||
import sys
import json
import operator
def helper(inputFileName,dictFileName,node_type,outputFileName):
cc_dict = {}
with open(inputFileName,'r') as inputFile,open(dictFileName,'r') as dictFile:
dictionary = json.load(dictFile)
for line in inputFile:
line = line.strip()
... | unknown | codeparrot/codeparrot-clean | ||
/*
* jctrans.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1995-1998, Thomas G. Lane.
* Modified 2000-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2020, 2022, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.i... | c | github | https://github.com/opencv/opencv | 3rdparty/libjpeg-turbo/src/jctrans.c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.