code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: utf-8 -*-
"""
Simple incremental latex lexer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import codecs
import collections
import re
class Token(collections.namedtuple("Token", "name text")):
"""Stores information about a matched token."""
__slots__ = () # efficiency
def __new__(cls, name=Non... | unknown | codeparrot/codeparrot-clean | ||
"""
Useful auxilliary data structures for query construction. Not useful outside
the SQL domain.
"""
class EmptyResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-valued join was attempted (if the caller wants to treat that
... | unknown | codeparrot/codeparrot-clean | ||
{
"severity": "error",
"summary": "Invalid newline",
"detail": "How awkward!",
"range": {
"filename": "odd-comment.tf",
"start": {
"line": 2,
"column": 5,
"byte": 4
},
"end": {
"line": 3,
"column": 1,
"byte": 6
}
},
"snippet": {
"context": null,
... | json | github | https://github.com/hashicorp/terraform | internal/command/views/json/testdata/diagnostic/error-whose-range-starts-at-a-newline.json |
#!/usr/bin/env python
#
# Copyright 2017 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
"""
This module holds the standard implementation of the :class:`PrinterInterface` and it helpers.
"""
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from scipy import ndimage
from scipy.ndimage import watershed_ift, generate_binary_structure
from skimage.morphology import watershed
from skimage import filter
def get_LUT_value(data, window, level):
return np.piecewise(data,
[data <= (level - 0.5 - (window-1)/2),
... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/ipmi/ipmi-ipmb.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: IPMI IPMB device
description: IPMI IPMB device bindings
maintainers:
- Corey Minyard <cminyard@mvista.com>
properties:
com... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/ipmi/ipmi-ipmb.yaml |
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
from django import db
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.contenttypes.views import shortcut
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpRequest
from django.test... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import os
# test_settings.py works differently from
# dev_settings.py/prod_settings.py; it actually is directly referenced
# by the test suite as DJANGO_SETTINGS_MODULE and imports settings.py
# directly and then hacks up the values that are different for the
# test suite. As wil... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies --root-target removes the unnecessary targets.
"""
import TestGyp
test = TestGyp.TestGyp()
build_error_code = {
'android':... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Michael Scherer <misc@zarb.org>
# inspired by code of github.com/dandiker/
#
# 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 Softwar... | unknown | codeparrot/codeparrot-clean | ||
"""
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the :func:`~sklearn.datasets.make_multilabel_classification`
dataset generator. Each sample consists of counts of two features (up to 50 in
total), which are dif... | python | github | https://github.com/scikit-learn/scikit-learn | examples/datasets/plot_random_multilabel_dataset.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 may... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/2.0.2-alpha/CHANGELOG.2.0.2-alpha.md |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Configuration
'''
__author__ = 'Michael Liao'
import config_default
class Dict(dict):
'''
Simple dict but support access as x.y style.
'''
def __init__(self, names=(), values=(), **kw):
super(Dict, self).__init__(**kw)
for k, v in zi... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2022 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/en/model_doc/yolos.md |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'],
[TestAction.create_vm_backup, 'vm1', 'vm1-backup1'],
[Te... | unknown | codeparrot/codeparrot-clean | ||
from django.apps.registry import apps as global_apps
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationRecorder
from django.db.utils import DatabaseError
from django.test i... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | client/pkg/types/slice_test.go |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | unknown | codeparrot/codeparrot-clean | ||
import fileinput, math, collections
### ###
# utility func #
### ###
dbug = True
def btos(b):
return 'YES' if b else 'NO'
def pd(s, label=''):
global dbug
if dbug:
header = 'debug:'
if label != '':
header += ' (%s)\t' % label
print header, s
def stoi(s):
return([ int(x) for x in s.sp... | 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/validation/MessageInterpolatorFactory.java |
<!--Copyright 2022 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/es/tasks/question_answering.md |
print('Testing dimensionSvgConstructor.py centerLines')
from dimensionSvgConstructor import *
import sys
from PySide import QtGui, QtCore, QtSvg
app = QtGui.QApplication(sys.argv)
width = 640
height = 480
graphicsScene = QtGui.QGraphicsScene(0,0,width,height)
graphicsScene.addText("Center Lines testing app.\nEsc to ... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for binary operators on subtypes of built-in types."""
import unittest
from test import support
from operator import eq, ne, lt, gt, le, ge
def gcd(a, b):
"""Greatest common divisor using Euclid's algorithm."""
while a:
a, b = b%a, a
return b
def isint(x):
"""Test whether an object i... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import options, plugin
from flexget.event import event
from flexget.task import log as task_log
from flexget.utils.log import log_once
log = l... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Released under the New BSD license.
"""
This module contains a base type which provides list-style mutations
without specific data storage methods.
See also http://static.aryehleib.com/oldsite/MutableLists.html
Author: Aryeh Leib Taurog.
"""
from fu... | python | github | https://github.com/django/django | django/contrib/gis/geos/mutable_list.py |
.image-left .component-content > div > img {
float: left;
} | unknown | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/assets/sass/components/image-alignment/_image-left.scss |
# help.py
#
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either vers... | unknown | codeparrot/codeparrot-clean | ||
import os
import WebModel.utils.redis as redis
import WebModel.utils.connection as connection
from scrapy.http import Request
from scrapy.spider import Spider
from unittest import TestCase
from .dupefilter import RFPDupeFilter
from .queue import SpiderQueue, SpiderPriorityQueue, SpiderStack
from .scheduler import Sch... | unknown | codeparrot/codeparrot-clean | ||
from cloudant.client import Cloudant
from cloudant.error import CloudantException
from cloudant.result import Result, ResultByKey
client = Cloudant("39a4348e-3ce1-40cd-b016-1f85569d409e-bluemix", "48e26645f504209f85b4c44d74a4cb14bc0d059a22b361534b78f406a513f8ff", url="https://39a4348e-3ce1-40cd-b016-1f85569d409e-bluem... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2011-2013 The tcollector Authors.
#
# This program 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 Licen... | unknown | codeparrot/codeparrot-clean | ||
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholiqu... | c | github | https://github.com/opencv/opencv | 3rdparty/openjpeg/openjp2/t2.c |
# -*- coding: utf-8 -*-
#
# pylast - A Python interface to Last.fm (and other API compatible social networks)
#
# Copyright 2008-2010 Amr Hassan
#
# 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 a... | 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/utils/ExponentialBackoff.java |
###############################################################################
##
## Copyright (C) Tavendo GmbH and/or collaborators. 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.... | unknown | codeparrot/codeparrot-clean | ||
# Format data based on locale
Angular provides the following built-in data transformation [pipes](guide/templates/pipes).
The data transformation pipes use the [`LOCALE_ID`][ApiCoreLocaleId] token to format data based on rules of each locale.
| Data transformation pipe | Details ... | unknown | github | https://github.com/angular/angular | adev/src/content/guide/i18n/format-data-locale.md |
/*
* Copyright (C) 2012 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 | android/guava-tests/test/com/google/common/io/ByteSinkTester.java |
"""Compatibility fixes for older versions of libraries
If you add content to this file, please give the version of the package
at which the fix is no longer needed.
# originally copied from scikit-learn
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquau... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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.
#
"""Creates an import library from an import description file."""
import ast
import logging
import optparse
import os
import os.pat... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2020 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/kuberuntime/convert_test.go |
#!/usr/local/bin/python2.7
from sys import exit
from os import environ, system
environ['KERAS_BACKEND'] = 'tensorflow'
import numpy as np
import utils
from keras.models import Model, load_model
from keras.utils import np_utils
import obj
# obj.DEBUG = True
# obj.truth = 'resonanceType'
# obj.n_truth = 5
pretrained ... | unknown | codeparrot/codeparrot-clean | ||
import sys
import unittest
from future.utils import isint
from pennyworth import util
class TestRandomInt(unittest.TestCase):
def test_random_range(self):
ret = util.get_random_id()
self.assertTrue(1 <= ret <= 65535)
def test_random_range2(self):
ret = util.get_random_id()
self... | unknown | codeparrot/codeparrot-clean | ||
# 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 law or agreed to in writing... | 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 th... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, print_function, unicode_literals
import functools
import collections
def save_method_args(method):
"""
Wrap a method such that when it is called, we save the args and
kwargs with which it was called.
>>> class MyClass(object):
... @save_method_args
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
#
# 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 Lice... | unknown | codeparrot/codeparrot-clean | ||
"""Tests `phydmslib.models.ExpCM_empirical_phi` class.
Written by Jesse Bloom.
"""
import random
import unittest
import numpy
import scipy.linalg
import scipy.optimize
from phydmslib.constants import (N_CODON, N_NT, CODON_NT_COUNT,
AA_TO_INDEX, N_AA)
import phydmslib.models
class tes... | unknown | codeparrot/codeparrot-clean | ||
# Repositories
This chapter will explain the concept of packages and repositories, what kinds
of repositories are available, and how they work.
## Concepts
Before we look at the different types of repositories that exist, we need to
understand some basic concepts that Composer is built on.
### Package
Composer is ... | unknown | github | https://github.com/composer/composer | doc/05-repositories.md |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2008, 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
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
from astropy.table import Table
import argparse
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--spall',
type=str,
required=True,
help='Path to spAll file')
parser.add_argument('--qso-catalog',
... | unknown | codeparrot/codeparrot-clean | ||
"""
============================
``ctypes`` Utility Functions
============================
See Also
---------
load_library : Load a C library.
ndpointer : Array restype/argtype with verification.
as_ctypes : Create a ctypes array from an ndarray.
as_array : Create an ndarray from a ctypes array.
References
----------... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2017 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 time_test
import (
"strings"
"testing"
. "time"
)
func TestHasMonotonicClock(t *testing.T) {
yes := func(expr string, tt Time) {
if GetMono(&tt)... | go | github | https://github.com/golang/go | src/time/mono_test.go |
def factorial(start,end):
res = 1
for i in range(start,end + 1):
res *= i
return res
def sum_of_square(n):
return int(factorial(n + 1, 2 * n) /factorial(1, n)) | unknown | mbpp | ||
from unittest import TestCase, main
from amgut.lib.util import (survey_fermented, survey_surf, survey_vioscreen,
survey_asd, rollback)
from amgut.lib.data_access.ag_data_access import AGDataAccess
class TestUtil(TestCase):
def setUp(self):
self.ag_data = AGDataAccess()
def ... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <c10/util/Exception.h>
namespace c10 {
template <typename T>
class IntrusiveList;
class IntrusiveListHook {
template <typename P, typename T>
friend class ListIterator;
template <typename T>
friend class IntrusiveList;
IntrusiveListHook* next_{nullptr};
IntrusiveListHook* prev_{n... | c | github | https://github.com/pytorch/pytorch | c10/util/IntrusiveList.h |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/models/dag.py |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Name: environment.py
# Purpose: Storage for user environment settings and defaults
#
# Authors: Christopher Ariza
# Michael Scott Cuthbert
#
# Copyright: Copyright © 2009-2012, 20... | 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 | ||
rust-smallvec
=============
[Documentation](https://docs.rs/smallvec/)
[Release notes](https://github.com/servo/rust-smallvec/releases)
"Small vector" optimization for Rust: store up to a small number of items on the stack
## Example
```rust
use smallvec::{SmallVec, smallvec};
// This SmallVec can hold up to 4 it... | unknown | github | https://github.com/nodejs/node | deps/crates/vendor/smallvec/README.md |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package aws
import (
"context"
"fmt"
"log"
"net/http"
"os"
"reflect"
"strings"
"sync"
"testing"
"time"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-... | go | github | https://github.com/hashicorp/vault | builtin/logical/aws/backend_test.go |
'use strict';
const fs = require('fs');
const path = require('path');
const { builtinModules } = require('module');
const common = require('../common.js');
const tmpdir = require('../../test/common/tmpdir');
let benchmarkDirectory = tmpdir.resolve('nodejs-benchmark-module');
// Filter all irregular modules.
const oth... | javascript | github | https://github.com/nodejs/node | benchmark/module/module-loader.js |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import sys
import datetime
import sqlite3
import getopt
import traceback
from os.path import isfile, getsize
def usage():
print("""tracer-client.py [optional args] sqlfile [sqlfile ...]
sqlfile SQLite File from tracer.py
optional arguments:
-x x-coor... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/distributed_runtime/message_wrappers.h |
# Natural Language Toolkit: Corpus & Model Downloader
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
The NLTK corpus and module downloader. This module defines several
interfaces which can be used to download... | unknown | codeparrot/codeparrot-clean | ||
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
mnist = input_data.read_data_sets('data', one_hot=True)
sess = tf.InteractiveSession()
x = tf.placeholder(tf.float32, shape=[None, 784])
y_ = tf.placeholder(tf.float32, shape=[None, 10])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Va... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2005,2012 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 option)
# any later version... | unknown | codeparrot/codeparrot-clean | ||
DOCUMENTATION:
name: vaulted_file
author: Ansible Core
version_added: "2.18"
short_description: Is this file an encrypted vault
description:
- Verifies if the input path is an Ansible vault file.
options:
_input:
description: The path to the possible vault.
type: path
required: Tru... | unknown | github | https://github.com/ansible/ansible | lib/ansible/plugins/test/vaulted_file.yml |
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
sys.path.append( "../../glapi_parser" )
import apiutil
apiutil.CopyrightC()
print """
/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY packspu_proto.py SCRIP... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""server.py -- the main flask server module"""
import dataset
import simplejson as json
import random
import time
from base64 import b64decode
from functools import wraps
from flask import Flask
from flask import jsonify
from flask import make_response
from flask import redirect
from flask im... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import s... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2010 Google Inc. 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, F5 Networks Inc.
# 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 | ||
from PIL import Image
from xml.dom import minidom
from numpy import *
from pylab import *
from scipy import ndimage, linalg
from scipy.misc import imsave
import os
def read_points_from_xml(xmlFileName):
""" Reads control points for face alignment. """
xmldoc = minidom.parse(xmlFileName)
facelist = xmldoc... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
function Component(props) {
const x = makeOptionalObject(props);
const y = makeObject(props);
const z = x?.method(y.a, props.a, foo(y.b), bar(props.b));
return z;
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(2... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-receiver-method-call.expect.md |
from itertools import chain
from django.apps import apps
from django.core.checks import Error
def check_generic_foreign_keys(app_configs, **kwargs):
from .fields import GenericForeignKeyDescriptor
if app_configs is None:
models = apps.get_models()
else:
models = chain.from_iterable(
... | python | github | https://github.com/django/django | django/contrib/contenttypes/checks.py |
# Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Handlers for viewing and downloading server logs.
LogHandler: Displays contents of a chosen log file.
"""
__author__ = 'spencer@emailscrubbed.com (Spencer Kimball)'
import os
import stat
import time
from tornado import auth, template
from viewfinder.backen... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <c10/util/BFloat16.h>
#include <c10/util/Exception.h>
#include <c10/util/Float4_e2m1fn_x2.h>
#include <c10/util/Float8_e4m3fn.h>
#include <c10/util/Float8_e4m3fnuz.h>
#include <c10/util/Float8_e5m2.h>
#include <c10/util/Float8_e5m2fnuz.h>
#include <c10/util/Float8_e8m0fnu.h>
#include <c10/util/Ha... | c | github | https://github.com/pytorch/pytorch | c10/core/ScalarType.h |
"""Config flow to configure the Synology DSM integration."""
import logging
from urllib.parse import urlparse
from synology_dsm import SynologyDSM
from synology_dsm.exceptions import (
SynologyDSMException,
SynologyDSMLogin2SAFailedException,
SynologyDSMLogin2SARequiredException,
SynologyDSMLoginInvali... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2008, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including... | c | github | https://github.com/mysql/mysql-server | sql/transaction.h |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to import third party repo keys to your rpm db
# (c) 2013, Héctor Acosta <hector.acosta@gazzang.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 ... | 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 Google Inc. 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
''' this is igroup module
(c) 2018-2019, NetApp, Inc
# 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',
'sta... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*
"""
Test models of VCR.
"""
import unittest
import coverage
import vcr_test_config
from baidubce.services.vcr import vcr_client
cov = coverage.coverage()
cov.start()
http_request = None
class TestVcrClient(unittest.TestCase):
"""
TestVcrClient
"""
def setUp(self):
"""
... | unknown | codeparrot/codeparrot-clean | ||
"""
Example of plotting a curve using only one input array with pyvisi
"""
# set up some data to plot
from numpy import *
x = arange(0,2*pi,0.1, dtype=floating)
y = sin(x)
#### original vtk code
import vtk
# set up the renderer and the render window
_ren = vtk.vtkRenderer()
_renWin = vtk.vtkRenderWindow()
_renWin.... | unknown | codeparrot/codeparrot-clean | ||
"""
Module for performing checks on a Kibana logging deployment
"""
import json
import ssl
try:
from urllib2 import HTTPError, URLError
import urllib2
except ImportError:
from urllib.error import HTTPError, URLError
import urllib.request as urllib2
from openshift_checks.logging.logging import Logging... | unknown | codeparrot/codeparrot-clean | ||
export const metadata = {
title: "Next.js Basic CSS Example",
description: "Generated by Next.js",
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
} | typescript | github | https://github.com/vercel/next.js | examples/basic-css/app/layout.tsx |
from django.db import models
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
class UserSite(models.Model):
user = models.ForeignKey(User, models.CASCADE, to_field="username")
data = models.IntegerField()
class UserProfile(models.Model):... | python | github | https://github.com/django/django | tests/model_formsets_regress/models.py |
var localVar = 42;
it("should not leak localVar to other modules", () => {
expect(localVar).toBe(42);
expect(require("./module")).toBe("undefined");
}); | javascript | github | https://github.com/webpack/webpack | test/cases/entry-inline/no-var-leak/index.js |
/*
* 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/aot/test/SampleReflection.java |
#
#
# You may 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.
#
# mirror is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""
fg
CLI for training and interfacing with face generating models.
"""
import argparse
import sys
import types
# ---- Available commands
def train():
"""
Command to train a model.
"""
parser = argparse.ArgumentParser(
description = "Trains a model using the Rad... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Lutron Caseta switches."""
import logging
from homeassistant.components.switch import DOMAIN, SwitchEntity
from . import DOMAIN as CASETA_DOMAIN, LutronCasetaDevice
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Lutron Case... | unknown | codeparrot/codeparrot-clean | ||
import logging
import os
from autotest.client import utils
from autotest.client.shared import error
from virttest import utils_misc, remote, utils_net, data_dir
@error.context_aware
def run_netperf_udp(test, params, env):
"""
Run netperf on server and client side, we need run this case on two
machines. If ... | unknown | codeparrot/codeparrot-clean | ||
"""
==================
RBF SVM parameters
==================
This example illustrates the effect of the parameters ``gamma`` and ``C`` of
the Radial Basis Function (RBF) kernel SVM.
Intuitively, the ``gamma`` parameter defines how far the influence of a single
training example reaches, with low values meaning 'far' a... | python | github | https://github.com/scikit-learn/scikit-learn | examples/svm/plot_rbf_parameters.py |
//// [tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts] ////
//// [ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts]
namespace A {
interface Point {
x: number;
y: number;
}
export var Origin: Point = ... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js |
name: "Ephemeral instances"
on:
issue_comment:
types: [created]
pull_request:
types: [closed]
permissions: {}
jobs:
handle-ephemeral-instances:
if: |
github.repository_owner == 'grafana' &&
(
(github.event.issue.pull_request && startsWith(github.event.comment.body, '/deploy-to-h... | unknown | github | https://github.com/grafana/grafana | .github/workflows/ephemeral-instances-pr-comment.yml |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.