code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
// Copyright 2013 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.
// This file implements sysSocket for platforms that provide a fast path for
// setting SetNonblock and CloseOnExec.
//go:build dragonfly || freebsd || linux |... | go | github | https://github.com/golang/go | src/net/sock_cloexec.go |
# Copyright 2015 FUJITSU LIMITED
#
# 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 writ... | unknown | codeparrot/codeparrot-clean | ||
/**
* svg-pan-zoom v3.6.2
*
* https://github.com/bumbu/svg-pan-zoom
*
* Copyright 2009-2010 Andrea Leofreddi <a.leofreddi@vleo.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* *... | javascript | github | https://github.com/scikit-learn/scikit-learn | doc/js/scripts/vendor/svg-pan-zoom.min.js |
/*
* 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-test/src/test/java/org/springframework/boot/test/util/ApplicationContextTestUtilsTests.java |
import logging
from django.core.management.base import BaseCommand
from celery.task.sets import TaskSet
from olympia.bandwagon.tasks import resize_icon
from olympia.users.tasks import resize_photo
from olympia.amo.helpers import user_media_path
from olympia.amo.utils import walkfiles
log = logging.getLogger('z.cmd'... | unknown | codeparrot/codeparrot-clean | ||
import json
import logging
import os
from collections import OrderedDict
from pokemongo_bot.base_dir import _base_dir
'''
Helper class for updating/retrieving Inventory data
Interesting info and formulas:
https://drive.google.com/file/d/0B0TeYGBPiuzaenhUNE5UWnRCVlU/view
https://www.reddit.com/r/pokemongodev/comments... | 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... | javascript | github | https://github.com/apache/airflow | airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/rules/unicorn.js |
/*
* Copyright 2010-2025 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.base
import org.jetbrains.kotlin.analysis.api.KaExperimentalApi
imp... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/base/KaContextReceiver.kt |
#ifndef RUBY_SHAPE_H
#define RUBY_SHAPE_H
#include "internal/gc.h"
#include "internal/struct.h"
typedef uint16_t attr_index_t;
typedef uint32_t shape_id_t;
#define SHAPE_ID_NUM_BITS 32
#define SHAPE_ID_OFFSET_NUM_BITS 19
STATIC_ASSERT(shape_id_num_bits, SHAPE_ID_NUM_BITS == sizeof(shape_id_t) * CHAR_BIT);
#define S... | c | github | https://github.com/ruby/ruby | shape.h |
<?php
namespace Illuminate\Database\Eloquent\Concerns;
use Closure;
use Illuminate\Database\ClassMorphViolationException;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\PendingHasThro... | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php |
# Copyright 2010-2014 Google
# 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, so... | unknown | codeparrot/codeparrot-clean | ||
// This file was automatically generated from composing-suspending-functions.md by Knit tool. Do not edit.
package kotlinx.coroutines.guide.exampleCompose01
import kotlinx.coroutines.*
import kotlin.system.*
fun main() = runBlocking<Unit> {
val time = measureTimeMillis {
val one = doSomethingUsefulOne()
... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/guide/example-compose-01.kt |
import re
import glob
import os
import time
from datetime import datetime
import utm
import scipy.io
import numpy as num
from kite import util
__all__ = ['Gamma', 'Matlab', 'ISCE', 'GMTSAR', 'ROI_PAC', 'SARscape', 'SNAP_Gamma']
try:
from osgeo import gdal
__all__.append('LiCSAR')
__all__.append('ARIA')
... | unknown | codeparrot/codeparrot-clean | ||
"""Test Z-Wave switches."""
from unittest.mock import patch
from homeassistant.components.zwave import switch
from tests.mock.zwave import MockEntityValues, MockNode, MockValue, value_changed
def test_get_device_detects_switch(mock_openzwave):
"""Test get_device returns a Z-Wave switch."""
node = MockNode()
... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const makeE2EConfig = require('../jest/makeE2EConfig');
module.exports = makeE2EConfig('e2e with forget', true); | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/scripts/jest/e2e-forget.config.js |
//// [tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration8_es5.ts] ////
//// [asyncFunctionDeclaration8_es5.ts]
var v = { [await]: foo }
//// [asyncFunctionDeclaration8_es5.js]
"use strict";
var _a;
var v = (_a = {}, _a[await] = foo, _a); | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es5).js |
## Input
```javascript
// @flow
function Component({items}) {
// Per the spec, <Foo value=<>{...}</> /> is valid.
// But many tools don't allow fragments as jsx attribute values,
// so we ensure not to emit them wrapped in an expression container
return items.length > 0 ? (
<Foo
value={
<Bar>... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-attribute-with-jsx-element-value.expect.md |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 | ||
// The stub symbols library used for testing purposes
void *memcpy(void *dest, const void *src, unsigned long n) { return 0; }
void *memset(void *dest, int c, unsigned long n) { return 0; }
int printf(const char *format, ...) { return 0; }
void exit(int status) {}
int puts(const char *s) { return 0; }
int rand(void) {... | c | github | https://github.com/llvm/llvm-project | bolt/test/Inputs/stub.c |
'''
POdB: A purchase order management system for small businesses
Copyright (C) 2016 Paulo S. V. N. Leal
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 ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import six
from django.contrib.auth.models import AnonymousUser
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from sentry.models import User
from sentry.testutils import TestCase
from sentry.utils.auth import EmailAuthBackend, login, get_login... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Session;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Carbon;
use SessionHandlerInterface;
use Symfony\Component\Finder\Finder;
class FileSessionHandler implements SessionHandlerInterface
{
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Fi... | php | github | https://github.com/laravel/framework | src/Illuminate/Session/FileSessionHandler.php |
__author__ = 'Bill French'
import argparse
from mi.idk.nose_test import NoseTest
from mi.idk.nose_test import BUILDBOT_DRIVER_FILE
from mi.idk.metadata import Metadata
from mi.core.log import get_logger ; log = get_logger()
import yaml
import os
from mi.idk.config import Config
from mi.idk.nose_test import BuildBotC... | unknown | codeparrot/codeparrot-clean | ||
from django.http import HttpResponse
from django.urls import path
def empty_response(request):
return HttpResponse()
urlpatterns = [
path("middleware_urlconf_view/", empty_response, name="middleware_urlconf_view"),
] | python | github | https://github.com/django/django | tests/test_client/urls_middleware_urlconf.py |
# Copyright (c) 2008 The Regents of The University of Michigan
# 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 | ||
/* This implements sets using the same hash table implementation as in
st.c, but without a value for each hash entry. This results in the
same basic performance characteristics as when using an st table,
but uses 1/3 less memory.
*/
#include "id.h"
#include "internal.h"
#include "internal/bits.h"
#include... | c | github | https://github.com/ruby/ruby | set.c |
# Copyright 2013 Kylin, 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... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package mime
import (
"maps"
"strings"
"testing"
)
func TestConsumeToken(t *testing.T) {
tests := [...][3]string{
{"foo bar", "foo", " bar"},
{"bar", ... | go | github | https://github.com/golang/go | src/mime/mediatype_test.go |
import copy
import csv
import os
class Gate:
def __init__(self, Sockets):
self.Sockets = Sockets
self.Inputs = []
self.UniqueInputs = ""
def canPass(self):
return(True)
def getInput(self, I):
if( (type(I) == Input) &
(I.sym().casefold() not in self.Uniq... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class nettle(test.test):
"""
Autotest module for testing basic functionality
of nettle
@author Athira Rajeev <atrajeev@in.ibm.com> ##
"""
vers... | 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
# d... | unknown | codeparrot/codeparrot-clean | ||
from django.db import models
class Cigar(models.Model):
FORM_CHOICES = (
('parejo', 'Parejo'),
('torpedo', 'Torpedo'),
('pyramid', 'Pyramid'),
('perfecto', 'Perfecto'),
('presidente', 'Presidente'),
)
name = models.CharField(max_length=25, help_text='Cigar Name')
... | unknown | codeparrot/codeparrot-clean | ||
from langchain_classic.output_parsers.regex import RegexParser
# NOTE: The almost same constant variables in ./test_combining_parser.py
DEF_EXPECTED_RESULT = {
"confidence": "A",
"explanation": "Paris is the capital of France according to Wikipedia.",
}
DEF_README = """```json
{
"answer": "Paris",
"so... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/tests/unit_tests/output_parsers/test_regex.py |
# 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 in the hope that ... | python | github | https://github.com/ansible/ansible | lib/ansible/module_utils/facts/hardware/netbsd.py |
"""The tests for the automation component."""
import unittest
from homeassistant.bootstrap import _setup_component
import homeassistant.components.automation as automation
from homeassistant.const import ATTR_ENTITY_ID
from tests.common import get_test_home_assistant
class TestAutomation(unittest.TestCase):
"""T... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Defaults
Builders and other things for the local site. Here's where we'll
duplicate the functionality of autoconf until we move it into the
installation procedure or use something like qmconf.
The code that reads the registry to find MSVC components was borrowed
from distutils.msvccompiler.
"""
#
# Copyri... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package gin
import (
"errors"
"net/http"
"strings"
"testing"
"github.com/gin-contrib/sse"
"github.com/stretchr/testify/assert"
)
func TestMiddle... | go | github | https://github.com/gin-gonic/gin | middleware_test.go |
from __future__ import absolute_import
import argparse
import sys
class FixedArgumentParser(argparse.ArgumentParser):
'''
fixes argparse's handling of empty string arguments
and changes @filename behaviour to accept multiple arguments on each line
'''
def _read_args_from_files(self, arg_strings):
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package logging
import (
"errors"
"fmt"
"io"
"path/filepath"
"strings"
"time"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-multierror"
)
const (
UnspecifiedFormat LogFormat = iota
StandardFormat
JSONFormat
)
// defaultRot... | go | github | https://github.com/hashicorp/vault | helper/logging/logger.go |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
#
# Adopted from Geomdl library: ht... | unknown | codeparrot/codeparrot-clean | ||
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | unknown | codeparrot/codeparrot-clean | ||
{
"cluster_name": "elasticsearch",
"nodes": {
"qr-SOrELSaGW8SlU8nflBw": {
"name": "m1",
"transport_address": "127.0.0.1:9300",
"host": "127.0.0.1",
"ip": "127.0.0.1",
"version": "2.0.0",
"build": "de54438",
"http_address": "127.0.0.1:9200",
"attributes": {
... | json | github | https://github.com/elastic/elasticsearch | client/sniffer/src/test/resources/2.0.0_nodes_http.json |
from PyQt4.Qt import *
from numpy import *
import Avogadro
import sys
import unittest
from util import *
class TestCamera(unittest.TestCase):
def setUp(self):
# create the GLWidget and load the default engines
self.glwidget = Avogadro.GLWidget()
self.glwidget.loadDefaultEngines()
self.molecule = Av... | unknown | codeparrot/codeparrot-clean | ||
import re
import logging
import time
from autotest.client.shared import error
from virttest import virsh
from virttest import libvirt_vm
from virttest import remote
from virttest import utils_libvirtd
from virttest.libvirt_xml import vm_xml
def run(test, params, env):
"""
Test command: virsh list.
1) Filt... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import json
import urllib
import urlparse
import xbmcaddon
import xbmcgui
import xbmcplugin
import load_channels
import hashlib
import re
import time
import server
import config
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
addondir = xbmc.translatePath( addon.getAdd... | unknown | codeparrot/codeparrot-clean | ||
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# MQTT in curl
## Usage
A plain "GET" subscribes to the topic and prints all published messages.
Doing a "POST" publishes the post data to the topic and exits.
## TLS protection
Use `mqtts://` to do MQTT over TLS: MQTT... | unknown | github | https://github.com/curl/curl | docs/internals/MQTT.md |
# Copyright 2013 Intel Corporation
# 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 require... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
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")... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | 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/core/distributed_runtime/rpc/eager/grpc_eager_service.h |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'webui.views.index', name='index'),
url(r'^add_build_conf/(.*)/$', 'webui.views.add_build_conf', name=... | 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/COFF/AuxiliarySymbols/AuxiliaryFunctionDefinition.cpp |
/* 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/compiler/jit/xla_compile_util.h |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | unknown | github | https://github.com/opencv/opencv | modules/core/include/opencv2/core/hal/intrin_neon.hpp |
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
howev... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Urwid container widget classes
# Copyright (C) 2004-2012 Ian Ward
#
# 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 Foundation; either
# version 2.1 of the Licen... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class Eye < ActiveRecord::Base
attr_reader :after_create_callbacks_stack
attr_reader :after_update_callbacks_stack
attr_reader :after_save_callbacks_stack
attr_writer :override_iris_with_read_only_foreign_key_color
# Callbacks configured before the ones has_one sets up.
after... | ruby | github | https://github.com/rails/rails | activerecord/test/models/eye.rb |
# This file is part of beets.
# Copyright 2012, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | unknown | codeparrot/codeparrot-clean | ||
import { useLoaderData } from "react-router";
export function Message() {
const { message } = useLoaderData();
return <div>Loader data: {message}</div>;
} | typescript | github | https://github.com/remix-run/react-router | playground/rsc-vite-framework/app/routes/mdx/message.tsx |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, 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 ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package cli
import (
"testing"
"time"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
)
func TestFileSelection... | go | github | https://github.com/cockroachdb/cockroach | pkg/cli/zip_helpers_test.go |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | 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/ipc/Client.java |
from __future__ import unicode_literals
from django.db import router
class Operation(object):
"""
Base class for migration operations.
It's responsible for both mutating the in-memory model state
(see db/migrations/state.py) to represent what it performs, as well
as actually performing it against... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# main.py
# v1.0.2
#
DATABASE = 'sample.db'
import sqlite3
import string
import random
from flask import Flask, render_template, request
app = Flask(__name__)
class Word():
def __init__(self, text, key=None, node_list=None):
self.text = text
if not ... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/fsi/fsi-master-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: fsi-master-gpio
maintainers:
- Eddie James <eajames@linux.ibm.com>
allOf:
- $ref: /schemas/fsi/fsi-controller.yaml
pr... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/fsi/fsi-master-gpio.yaml |
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández <hello@anler.me>
# This ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import print_function
"""
test_collate.py
test branching dependencies
"""
import os
tempdir = os.path.relpath(os.path.abspath(os.path.splitext(__file__)[0])) + "/"
import sys
# add grandparent to search path for testing
grandparent_dir = os.path.abspath(os.path.joi... | 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
# distr... | unknown | codeparrot/codeparrot-clean | ||
#![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
// No `socket` on miri.
use std::time::Duration;
use tokio::net::TcpSocket;
use tokio_test::assert_ok;
#[tokio::test]
async fn b... | rust | github | https://github.com/tokio-rs/tokio | tokio/tests/tcp_socket.rs |
from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
class Meta:
abstract = True
required_db_features = ['gis_enabled']
def __str__(self):
... | unknown | codeparrot/codeparrot-clean | ||
# TODO(okuta): Implement norm
# TODO(okuta): Implement cond
# TODO(okuta): Implement det
# TODO(okuta): Implement matrix_rank
# TODO(okuta): Implement slogdet
def trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None):
"""Returns the sum along the diagonals of an array.
It computes the sum along the d... | 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATI... | unknown | codeparrot/codeparrot-clean | ||
/* -------------------------------------------------------------------------
*
* pgstat_archiver.c
* Implementation of archiver statistics.
*
* This file contains the implementation of archiver statistics. It is kept
* separate from pgstat.c to enforce the line between the statistics access /
* storage impleme... | c | github | https://github.com/postgres/postgres | src/backend/utils/activity/pgstat_archiver.c |
# (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 | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationRecursionTests.java |
//// [tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts] ////
//// [bitwiseNotOperatorWithAnyOtherType.ts]
// ~ operator on any type
declare var ANY: any;
declare var ANY1;
declare var ANY2: any[];
declare var obj: () => {};
declare var obj1: { x:"", y: () => ... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js |
#ifndef SRC_NODE_API_TYPES_H_
#define SRC_NODE_API_TYPES_H_
#include "js_native_api_types.h"
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
napi_value exports);
// False positive: https://github.com/cpplint/cpplint/issues/409
// NOLINTNE... | c | github | https://github.com/nodejs/node | src/node_api_types.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 n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/clients/admin/UpdateFeaturesOptions.java |
/*
* 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 ... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/web/webfluxfnhandlerclasses/PersonHandler.kt |
# frozen_string_literal: true
module Arel # :nodoc: all
module Nodes
class SelectCore < Arel::Nodes::Node
attr_accessor :projections, :wheres, :groups, :windows, :comment
attr_accessor :havings, :source, :set_quantifier, :optimizer_hints
def initialize(relation = nil)
super()
@... | ruby | github | https://github.com/rails/rails | activerecord/lib/arel/nodes/select_core.rb |
#!/usr/bin/env python3
"""Host side sshed script.
Designed to be run as "sshed" on the host side in place of a text editor.
"""
import argparse
import logging
import os
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
from . import packethandler
# TODO: Move these into a common l... | unknown | codeparrot/codeparrot-clean | ||
#
# ElementTree
# $Id: ElementPath.py 3276 2007-09-12 06:52:30Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
#
# Copyright (c) 200... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers._php_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file loads the function names and their modules from the
php webpage and generates itself.
Do not alter the MODULES dict by hand!
WARNING: the generation transfers quite much data over your
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import argparse
import os
import subprocess
import sys
import textwrap
# Append the src dir
sys.path.append(os.path.join(os.path.dirname(
os.path.dirname(os.path.abspath(__file__))), 'src'))
import passes # noqa (E402 module level import not at top of file)
# TODO: This should not be hard... | unknown | codeparrot/codeparrot-clean | ||
import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from api_tests.utils import disconnected_from_listeners
from website.project.signals import contributor_removed
from osf_tests.factories import (
NodeFactory,
AuthUserFactory,
RegistrationFactory
)
@pytest.f... | unknown | codeparrot/codeparrot-clean | ||
"""
Registry of common rio CLI options. See cligj for more options.
-a, --all: Use all pixels touched by features. In rio-mask, rio-rasterize
--as-mask/--not-as-mask: interpret band as mask or not. In rio-shapes
--band/--mask: use band or mask. In rio-shapes
--bbox:
-b, --bidx: band index(es) (singular or multiple... | unknown | codeparrot/codeparrot-clean | ||
# export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# Thi... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# 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
import sys
import importlib
import os
import json
imp... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | unknown | codeparrot/codeparrot-clean | ||
""" Tests for the linecache module """
import linecache2 as linecache
import unittest2 as unittest
import os.path
import tempfile
from fixtures import NestedTempfile
FILENAME = os.__file__
if FILENAME.endswith('.pyc'):
FILENAME = FILENAME[:-1]
NONEXISTENT_FILENAME = FILENAME + '.missing'
INVALID_NAME = '!@$)(!@#... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : Oct 13, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 l... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.