code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import base64
import... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Blink system camera control."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.const import CONF_MONITORED_CONDITIONS
from . import BINARY_SENSORS, BLINK_DATA
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the blink binary se... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | distribution/tools/geoip-cli/src/main/java/org/elasticsearch/geoip/GeoIpCli.java |
from django.contrib.sites.models import Site
from django.http import HttpResponsePermanentRedirect, HttpResponseRedirect
from django.test import override_settings
from django.test.client import RequestFactory
from unittest import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.sumo.midd... | unknown | codeparrot/codeparrot-clean | ||
---
applies_to:
stack:
serverless:
navigation_title: "Extract data with DISSECT and GROK"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-process-data-with-dissect-and-grok.html
---
# Extract data from unstructured text with `DISSECT` and `GROK`[esql-process-data-with-dissect... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/esql-process-data-with-dissect-grok.md |
"""
nosetests setuptools command
----------------------------
The easiest way to run tests with nose is to use the `nosetests` setuptools
command::
python setup.py nosetests
This command has one *major* benefit over the standard `test` command: *all
nose plugins are supported*.
To configure the `nosetests` comman... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
int_or_none,
xpath_attr,
xpath_element,
)
class TwentyFourVideoIE(InfoExtractor):
IE_NAME = '24video'
_VALID_URL = r'''(?x)
https?://
... | unknown | codeparrot/codeparrot-clean | ||
plugin: test_inventoryconfig | unknown | github | https://github.com/ansible/ansible | test/integration/targets/cache-plugins/test.inventoryconfig.yml |
# ext/declarative/base.py
# Copyright (C) 2005-2016 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
"""Internal implementation for declarative."""
from ...schema import Table, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Table of MultiJobs
@author: Jan Gabriel
@contact: jan.gabriel@tul.cz
"""
import datetime
from PyQt5 import QtCore
import PyQt5.QtWidgets as QtWidgets
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QDesktopServices
from JobPanel.data.states import TaskStatus
from .overview import WHIT... | unknown | codeparrot/codeparrot-clean | ||
"""
This script is used to grab the weather for the specific city
Author: David Duong
Email: dduong26@gmail.com
Date: Sept 27th 2015
"""
# Import Requests module
import requests
def Main():
# Your API Key from openweathermap.org
apikey = <your key>
# Your cityid you can obtain from openweathermap
c... | unknown | codeparrot/codeparrot-clean | ||
require("react");
require(["react-dom"]); | javascript | github | https://github.com/webpack/webpack | examples/http2-aggressive-splitting/example.js |
"""
Renderers are used to serialize a response into specific media types.
They give us a generic way of being able to handle various media types
on the response, such as JSON encoded data or HTML output.
REST framework also provides an HTML renderer the renders the browsable API.
"""
from __future__ import unicode_li... | unknown | codeparrot/codeparrot-clean | ||
/* 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/dtensor/mlir/expansions/broadcast_to_spmd_expander.h |
#########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | unknown | codeparrot/codeparrot-clean | ||
# Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your op... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
"""
Setup script to build a standalone readerviewer.exe executable on windows
using py2exe. Run: python.exe setup.py py2exe, to build executable file.
__author__ = "http://www.gemalto.com"
Copyright 2001-2010 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This file i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# stompy documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 19 14:24:20 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2009-2014 Justin Riley
#
# This file is part of StarCluster.
#
# StarCluster is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing an importer for Internet Explorer bookmarks.
"""
from __future__ import unicode_literals
import os
from PyQt5.QtCore import QCoreApplication, QDate, Qt
from .BookmarksImporter import Bookmarks... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
find_xpath_attr,
xpath_attr,
xpath_with_ns,
xpath_text,
orderedSet,
update_url_query,
int_or_none,
fl... | unknown | codeparrot/codeparrot-clean | ||
name: 'Saucelabs legacy test job'
description: 'Runs tests against Saucelabs (outside of Bazel)'
runs:
using: 'composite'
steps:
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@8757d815eb39854621b7a42ed742fd34e1c448d9
- name: Setup Saucelabs Variables
uses: angular/dev-in... | unknown | github | https://github.com/angular/angular | .github/actions/saucelabs-legacy/action.yml |
"""This file defines various models used in the test"""
import mxnet as mx
def mlp2():
data = mx.symbol.Variable('data')
out = mx.symbol.FullyConnected(data=data, name='fc1', num_hidden=1000)
out = mx.symbol.Activation(data=out, act_type='relu')
out = mx.symbol.FullyConnected(data=out, name='fc2', num_... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import code
import warnings
import string
import argparse
from flask import _request_ctx_stack
from .cli import prompt, prompt_pass, prompt_bool, prompt_choices
class InvalidCommand(Exception):
pass
class Group(object):
"""
Store... | unknown | codeparrot/codeparrot-clean | ||
from twisted.internet.defer import inlineCallbacks, succeed, Deferred
from Tribler.Test.Core.base_test import MockObject
from Tribler.Test.test_as_server import AbstractServer
from Tribler.Test.twisted_thread import deferred
from Tribler.community.market.wallet.btc_wallet import BitcoinWallet
from Tribler.dispersy.uti... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# CAUTION: This implementation of the collection loader is used by ansible-test.
# Because of this, it must be compatible with all Python versions supported on the controller or remote.
fro... | python | github | https://github.com/ansible/ansible | lib/ansible/utils/collection_loader/__init__.py |
def are_Equal(arr1,arr2,n,m):
if (n != m):
return False
arr1.sort()
arr2.sort()
for i in range(0,n - 1):
if (arr1[i] != arr2[i]):
return False
return True | unknown | mbpp | ||
from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import Library, Node, TemplateSyntaxError, VariableDoesNotExist
register = Library()
class CacheNode(Node):
def __init__(self, nodelist, expire_time_var, fragment_name... | python | github | https://github.com/django/django | django/templatetags/cache.py |
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "This schema is used to validate `values.schema.json` to ensure each parameter has `default` and `description` set, and that top level properties have a `x-docsSection` set.",
"definitions": {
"leafs": {
... | json | github | https://github.com/apache/airflow | chart/values_schema.schema.json |
"""
Using redirect route instead of simple routes since it supports strict_slash
Simple route: http://webapp-improved.appspot.com/guide/routing.html#simple-routes
RedirectRoute: http://webapp-improved.appspot.com/api/webapp2_extras/routes.html#webapp2_extras.routes.RedirectRoute
"""
from webapp2_extras.routes import R... | unknown | codeparrot/codeparrot-clean | ||
from sympy.core.compatibility import range
from sympy.core.basic import Basic
from sympy.vector.vector import Vector
from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.functions import _path
from sympy import Symbol
from sympy.core.cache import cacheit
class Point(Basic):
"""
Represents ... | 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\Bridge\Twig\Tests;
use PHPUnit\Framework\Attributes\DataProvide... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Tests/AppVariableTest.php |
#!/usr/bin/env python
#
# Copyright 2011,2013 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 optio... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# maf2SNVneighbour.py
# 150409
# Kai Yu
# github.com/readline
from __future__ import division
import os,sys,gzip
from Bio import SeqIO
def importFasta(fastaPath):
if fastaPath[-3:] == '.gz':
import gzip
infile = gzip.open(fastaPath,'rb')
else:
infile = open(fastaP... | 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
func Example_sqlfmt() {
c := NewCLITest(TestCLIParams{NoServer: true})
defer c.Cleanup()
c.RunWithArgs([]string{"sqlfmt", "-e", ";"})
c.RunWithArgs([]s... | go | github | https://github.com/cockroachdb/cockroach | pkg/cli/sqlfmt_test.go |
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/tensorflow/ir/tf_ops_tensor_helper.h |
package kotlinx.coroutines.rx3
import io.reactivex.rxjava3.core.*
import kotlinx.coroutines.*
import kotlin.coroutines.*
/**
* Creates cold [single][Single] that will run a given [block] in a coroutine and emits its result.
* Every time the returned observable is subscribed, it starts a new coroutine.
* Unsubscrib... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | reactive/kotlinx-coroutines-rx3/src/RxSingle.kt |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... | 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-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/commit/mapred/package-info.java |
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitousage.verification;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.*;
import org.junit.Before;
im... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockitousage/verification/DescriptiveMessagesOnVerificationInOrderErrorsTest.java |
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLo... | javascript | github | https://github.com/django/django | django/contrib/admin/static/admin/js/vendor/select2/i18n/fr.js |
from __future__ import unicode_literals
import datetime
import warnings
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (
display_for_field, display_for_value, get_fields_from_path,
label_for_field, lookup_field,
)
from django.contrib.admin... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#encoding:utf-8
"""
pythoner.net
Copyright (C) 2013 PYTHONER.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, either version 3 of the License, or
(at your option) any later version.
This program... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for Shopping Cart views
"""
from collections import OrderedDict
import pytz
from urlparse import urlparse
from decimal import Decimal
import json
from django.http import HttpRequest
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from django.c... | unknown | codeparrot/codeparrot-clean | ||
#ifndef HEADER_CURL_SETOPT_H
#define HEADER_CURL_SETOPT_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (... | c | github | https://github.com/curl/curl | lib/setopt.h |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/grappler/costs/graph_memory.h |
import urllib2
import re
class PageDownloader:
"""
Downloads the web page.
"""
#source code of downloaded page
page = ""
#URL of the page that will be downloaded
url = ""
def __init__(self, url):
self.url = url
def download(self):
self.page = (urllib2.urlopen... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
import {addOne, shallowCopy} from 'shared-runtime';
function foo(a, b, c) {
// Construct and freeze x
const x = shallowCopy(a);
<div>{x}</div>;
// y should depend on `x` and `b`
const y = x.foo(b);
return y;
}
export const FIXTURE_ENTRYPOINT = {
fn: foo,
params: [{foo: addOne}... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/method-call.expect.md |
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
DatetimeIndex,
Index,
MultiIndex,
NaT,
Series,
Timestamp,
date_range,
)
import pandas._testing as tm
from pandas.tseries import offsets
@pytest.fixture
def regular():
return... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/window/test_timeseries_window.py |
from wagtail.wagtailcore.rich_text import EMBED_HANDLERS
from wagtailembedder.format import embed_to_editor_html, embed_to_frontend_html
class SnippetEmbedHandler(object):
"""
SnippetEmbedHandler will be invoked whenever we encounter an element in HTML content
with an attribute of data-embedtype="snippet"... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>,
# Eric Chou <ericc@a10networks.com>
#
# 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__ = t... | unknown | codeparrot/codeparrot-clean | ||
from keras import regularizers
from keras.models import Model, Sequential
from keras.layers import Input, Activation, Conv3D, MaxPooling3D, ZeroPadding3D,UpSampling3D,Dropout, BatchNormalization, Flatten, GaussianDropout, Dense, concatenate, AveragePooling3D
from keras.layers import Conv2D, MaxPooling2D, ZeroPadding2D,... | 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 | ||
import os
import time
import sys
import shutil
from subprocess import call
import pdb
dir = sys.argv[1]
under = len(sys.argv) == 3 and sys.argv[2] == "under"
over = len(sys.argv) == 3 and sys.argv[2] == "over"
if under:
print "merging all tiles UNDER current tileset"
if over:
print "merging all tiles OVER current t... | unknown | codeparrot/codeparrot-clean | ||
"""
compute_xlylzl - Function signature:
compute_xlylzl(s,f,p,r,dist,xlylzl,[n])
Required arguments:
s : input rank-1 array('f') with bounds (n)
f : input rank-1 array('f') with bounds (n)
p : input rank-1 array('d') with bounds (4)
r : input rank-2 array('d') with bounds (3,3)
dist : input rank-1 array('d'... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/arrowFunctionErrorSpan.ts] ////
//// [arrowFunctionErrorSpan.ts]
function f(a: () => number) { }
// oneliner
f(() => { });
// multiline, body
f(() => {
});
// multiline 2, body
f(() => {
});
// multiline 3, arrow on a new line
f(()
=> { });
// multiline 4, arguments
f((a,
b,
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/arrowFunctionErrorSpan.js |
#!/usr/bin/python2.4
#
# Copyright 2008 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 | ||
# -*- coding: UTF-8 -*-
##Author Igor Támara igor@tamarapatino.org
##Use this little program as you wish, if you
#include it in your work, let others know you
#are using it preserving this note, you have
#the right to make derivative works, Use it
#at your own risk.
#Tested to work on(etch testing 13-08-2007):
# Pytho... | unknown | codeparrot/codeparrot-clean | ||
pytest_plugins = 'pytester'
def test_myplugin(testdir):
testdir.makepyfile("""\
import asyncio
import pytest
from unittest import mock
from aiohttp import web
pytest_plugins = 'aiohttp.pytest_plugin'
@asyncio.coroutine
def hello(request):
return web.Response(body=b'Hello, world')
def create_app(loop):
... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <ATen/core/GeneratorForPrivateuseone.h>
#include <ATen/detail/AcceleratorHooksInterface.h>
#include <c10/core/Allocator.h>
#include <c10/core/Device.h>
#include <c10/core/Storage.h>
#include <c10/util/Exception.h>
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wunused-parameter")
namespace at {
... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/detail/PrivateUse1HooksInterface.h |
#!/usr/bin/env python
import time
import random
class Sensor(object):
def __init__(self, name):
self.id = name
self.value = 0
def readvalue(self):
# We simulate a sensor by generating random values
self.value = random.randint(0,100)
self.timestamp = time.time()
... | 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 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from __future__ import division, print_function, unicode_literals
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.addons.sped_imposto.models.sped_calculo_imposto import... | unknown | codeparrot/codeparrot-clean | ||
import signal
import weakref
from django.utils.unittest.compatibility import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.default_handler = default_handler
def __call__(self, signum, frame):
installed_handler =... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# Copyright (C) 2012 Club Capra - capra.etsmtl.ca
#
# This file is part of CapraVision.
#
# CapraVision 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 ... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2017, Patrick Deelman <patrick@patrickdeelman.nl>
# (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
DOCUMENTATION = """
lookup: passwordstore
versi... | unknown | codeparrot/codeparrot-clean | ||
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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/io/compress/zstd/ZStandardDecompressor.java |
# Copyright (c) 2018-2021, The Bifrost Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditio... | unknown | codeparrot/codeparrot-clean | ||
import re
import itertools
def isBlank(line):
return not line
def isLabel(line):
return line[0].isdigit()
def isComment(line):
return line[0] != ' '
def isContinuation(line):
return line[5] != ' '
COMMENT, STATEMENT, CONTINUATION = 0, 1, 2
def lineType(line):
"""Return the type of a line of Fortan... | unknown | codeparrot/codeparrot-clean | ||
/* zutil.c -- target dependent utility functions for the compression library
* Copyright (C) 1995-2017 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
#ifndef Z_SOLO
# include "gzguts.h"
#endif
z_const char * const z_errmsg[10] = {
... | c | github | https://github.com/nodejs/node | deps/zlib/zutil.c |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Functions Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/ja... | html | github | https://github.com/Alamofire/Alamofire | docs/Functions.html |
<!--Copyright 2023 The HuggingFace Team. 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 agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/ja/tasks/idefics.md |
# -*- coding: utf-8 -*-
import unittest
import azure.cosmos.cosmos_client as cosmos_client
import uuid
import pytest
import test_config
pytestmark = pytest.mark.cosmosEmulator
@pytest.mark.usefixtures("teardown")
class EncodingTest(unittest.TestCase):
"""Test to ensure escaping of non-ascii characters from parti... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
__all__ = ["SkillReferenceParam"]
class SkillReferenceParam(TypedDict, total=False):
skill_id: Required[str]
"""The ID of the re... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/skill_reference_param.py |
"""
Flickr Tag
----------
This implements a Liquid-style flickr tag for Pelican.
IMPORTANT: You have to create a API key to access the flickr api.
You can do this `here <https://www.flickr.com/services/apps/create/apply>`_.
Add the created key to your config under FLICKR_API_KEY.
Syntax
------
{% flickr image_id [sma... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: false
return unless RUBY_PATCHLEVEL < 0
require_relative "../auto_ext.rb"
auto_ext(inc: true) | ruby | github | https://github.com/ruby/ruby | ext/-test-/abi/extconf.rb |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.auth.jwt
import java.util.*
internal class JWTAuthSchemes(val defaultScheme: String, vararg additionalSchemes: String) {
val schemes = (arrayOf(defaultScheme) + ad... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-auth-jwt/jvm/src/io/ktor/server/auth/jwt/JWTAuthSchemes.kt |
#-*- coding: ISO-8859-1 -*-
# pysqlite2/test/hooks.py: tests for various SQLite-specific hooks
#
# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for... | 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 us... | unknown | codeparrot/codeparrot-clean | ||
"""
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.contrib.admin.op... | unknown | codeparrot/codeparrot-clean | ||
package daemon
import (
"context"
"net"
"net/netip"
"slices"
"testing"
"time"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/moby/moby/api/types/network"
swarmtypes "github.com/moby/moby/api/types/swarm"
"github.com/moby/moby/client"
"github.com/moby/moby/v2/daemon/libnetwork/nlwrap"
"github.com/moby/... | go | github | https://github.com/moby/moby | integration/daemon/daemon_linux_test.go |
# Component input properties
Sometimes app development requires you to send data into a component. This data can be used to customize a component or perhaps send information from a parent component to a child component.
Angular uses a concept called `input`. This is similar to `props` in other frameworks. To create a... | unknown | github | https://github.com/angular/angular | adev/src/content/tutorials/learn-angular/steps/8-input/README.md |
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarationsInForOf.3.ts] ////
//// [awaitUsingDeclarationsInForOf.3.ts]
async function main() {
for (await using {} of []) {
}
}
//// [awaitUsingDeclarationsInForOf.3.js]
"use strict";
async function main() {
for (awa... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitUsingDeclarationsInForOf.3.js |
/*
* Copyright (C) 2009 The Guava 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... | java | github | https://github.com/google/guava | guava/src/com/google/common/collect/RegularImmutableSortedSet.java |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
de... | unknown | codeparrot/codeparrot-clean | ||
# GCE Cluster addons
These cluster add-ons are specific to GCE and GKE clusters. The GCE-specific addon directory is
merged with the general cluster addon directory at release, so addon paths (relative to the addon
directory) must be unique across the 2 directory structures.
More details on addons in general can be f... | unknown | github | https://github.com/kubernetes/kubernetes | cluster/gce/addons/README.md |
# -*- 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)
class ModuleDocFragment(object):
# inventory cache
DOCUMENTATION = r'''
options:
cache:
description:
- Toggle to enable/disable the caching o... | unknown | codeparrot/codeparrot-clean | ||
from sqlalchemy import Column,Integer,String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy import create_engine
from passlib.apps import custom_app_context as pwd_context
Base = declarative_base()
class User(Base):
__tablename__ = 'use... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java |
# -*- 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 | ||
# (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 | ||
# 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 Li... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2015 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 agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/container/runtime_cache.go |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.