code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""
WSGI config for seednetwork project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module Psych
module Nodes
###
# This class represents a {YAML Scalar}[http://yaml.org/spec/1.1/#id858081].
#
# This node type is a terminal node and should not have any children.
class Scalar < Psych::Nodes::Node
# Any style scalar, the emitter chooses
ANY... | ruby | github | https://github.com/ruby/ruby | ext/psych/lib/psych/nodes/scalar.rb |
import os
import platform
import math
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'c5abc69d'.decode('hex')
P2P_PORT = 50603
ADDRESS_VERSION = 68
RPC_PORT = 50604
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'unitusaddre... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C)2005-2011 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.e... | unknown | codeparrot/codeparrot-clean | ||
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"target": {
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dev_dashboards/panel-barchart/v1beta1.barchart-thresholds-mappings.v42.json |
import { parseISO, format } from "date-fns";
import { useEffect, useState } from "react";
// dateString might be null for unpublished posts
export default function DateComponent({ dateString }) {
const [date, setDate] = useState(dateString ? parseISO(dateString) : null);
useEffect(() => {
if (!date) {
se... | javascript | github | https://github.com/vercel/next.js | examples/cms-storyblok/components/date.js |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# 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 | ||
#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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__ = type
ANSI... | unknown | codeparrot/codeparrot-clean | ||
"""
Student and course analytics.
Format and create csv responses
"""
import csv
from django.http import HttpResponse
def create_csv_response(filename, header, datarows):
"""
Create an HttpResponse with an attached .csv file
header e.g. ['Name', 'Email']
datarows e.g. [['Jim', 'jim@edy.org'], ['Ja... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/es6/destructuring/arrayAssignmentPatternWithAny.ts] ////
//// [arrayAssignmentPatternWithAny.ts]
var a: any;
var x: string;
[x] = a;
//// [arrayAssignmentPatternWithAny.js]
"use strict";
var a;
var x;
[x] = a; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/arrayAssignmentPatternWithAny.js |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import logging
import posixpath
import time
from appengine_wrappers import urlfetch
from environment import GetAppVersion
from future impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.gl import *
from pyglet.event import *
from layout.css import *
from layout.content import *
from layout.frame import *
from layout.locator import *
from layout.view import *
from layout.gl.device import *
from layout.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2013 Dev in Cachu authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import unittest
from django import forms as django_forms
from .. import models, forms
class ParticipanteFormTestCase(unittest.Tes... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal, assert_array_almost_equal
from scipy.sparse import csgraph
def test_weak_connections():
Xde = np.array([[0, 1, 0],
[0, 0, 0],
[0, 0, 0]])
Xsp = c... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# brunel2000_rand_plastic.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | unknown | codeparrot/codeparrot-clean | ||
import os
import re
import base64
import logging
from autotest.client.shared import error
from virttest import virsh
from virttest.remote import LoginError
from virttest.virt_vm import VMError
from virttest.aexpect import ShellError
from virttest.utils_test import libvirt
from virttest.libvirt_xml import vm_xml
from vi... | unknown | codeparrot/codeparrot-clean | ||
"""
This module contains the game rules.
"""
import json
import config
def form_to_band(requestform):
"""
This function takes in a HTTP request and returns a band object.
"""
print(requestform)
bandname = requestform['bandname']
capspec = requestform['capspec']
capskill = requestform[... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
from setuptools.command.install import install
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup # noqa
from setuptools.command.install import install # noqa
cl... | unknown | codeparrot/codeparrot-clean | ||
import os
import string
import random
import re
from polib import pofile
from unittest import TestCase
from datetime import datetime, timedelta
from pytz import UTC
import generate
from config import CONFIGURATION
class TestGenerate(TestCase):
"""
Tests functionality of i18n/generate.py
"""
generated_... | unknown | codeparrot/codeparrot-clean | ||
import copy
import logging
import os
from collections import defaultdict, Mapping
from six import integer_types, iteritems, itervalues, string_types
from . import sslutils
from .utils import get_port
_renamed_props = {
"host": "browser_host",
"bind_hostname": "bind_address",
"external_host": "server_host... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | unknown | codeparrot/codeparrot-clean | ||
base_suite: jstestfuzz_sharded
overrides:
- "multiversion.sharded_fixture_last_lts_new_old_old_new"
- "multiversion.jstestfuzz_sharded_multiversion_hooks" | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/jstestfuzz_sharded_last_lts_new_old_old_new.yml |
#!/usr/bin/env python
"""
MAVProxy realtime graphing module, partly based on the wx graphing
demo by Eli Bendersky (eliben@gmail.com)
http://eli.thegreenplace.net/files/prog_code/wx_mpl_dynamic_graph.py.txt
"""
import platform
from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import multiproc... | 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 | ||
#!/usr/bin/env python
"""Tests for grr.parsers.sqlite_file."""
import os
import StringIO
from grr.lib import flags
from grr.lib import test_lib
from grr.parsers import sqlite_file
class SQLiteFileTest(test_lib.GRRBaseTest):
"""Test parsing of sqlite database files."""
query = "SELECT * FROM moz_places;"
def ... | unknown | codeparrot/codeparrot-clean | ||
#--------------------------------------------------------------------------
#Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
#
# Diogo Roberto Duarte da Costa 1715310056
# Felipe Eduardo Silva de Almeida 1715310031
# Felipe Guerreiro de Mello 13... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for the accreditor module.
"""
from unittest.mock import patch
from django.test import TestCase
from testfixtures import LogCapture
from credentials.apps.api.accreditors import Accreditor
from credentials.apps.api.exceptions import UnsupportedCredentialTypeError
from credentials.apps.credentials.issuers imp... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division
import math
import random
import sys
import time
from twisted.internet import defer, protocol, reactor
from twisted.python import failure, log
import p2pool
from p2pool import data as p2pool_data
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral, p2proto... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import os
from configuration import Builder
import configuration
import shell
from tests import testhelper
class ConfigurationTestCase(unittest.TestCase):
def setUp(self):
self.workdirectory = os.path.dirname(os.path.realpath(__file__))
# reset global shell variables
shell... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
... | unknown | codeparrot/codeparrot-clean | ||
"""Python API for composing notebook elements
The Python representation of a notebook is a nested structure of
dictionary subclasses that support attribute access
(ipython_genutils.ipstruct.Struct). The functions in this module are merely
helpers to build the structs in the right form.
"""
# Copyright (c) IPython Dev... | unknown | codeparrot/codeparrot-clean | ||
require 'mkmf'
create_makefile('-test-/sanitizers') | ruby | github | https://github.com/ruby/ruby | ext/-test-/sanitizers/extconf.rb |
from __future__ import annotations
from datetime import (
datetime,
timedelta,
)
from typing import (
TYPE_CHECKING,
Literal,
overload,
)
import warnings
from dateutil.relativedelta import (
FR,
MO,
SA,
SU,
TH,
TU,
WE,
)
import numpy as np
from pandas._libs.tslibs.offs... | python | github | https://github.com/pandas-dev/pandas | pandas/tseries/holiday.py |
import pytest
from django.core.exceptions import ValidationError
from estimators.models.estimators import Estimator
from estimators.tests.factories import EstimatorFactory
@pytest.mark.django_db
class TestEstimator():
def test_estimator_persistance_without_factory(self):
m = Estimator(estimator='new stri... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
from __future__ import print_function, unicode_literals
import os
import posixpath
from libtrakt.exceptions import traktException
from libtrakt.trakt import TraktAPI
import sickbeard
from sickbeard import helpers, logger
from sickbeard.indexers.indexer_config import INDEXER_TVDB
from sickrage.helper.... | unknown | codeparrot/codeparrot-clean | ||
import inspect
import re
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.forms import models as model_forms
from django.http import HttpResponseRedirect
from django.utils import six
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import forc... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
back.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistri... | unknown | codeparrot/codeparrot-clean | ||
# vim: set fileencoding=utf-8 :
# (c) 2009 Marcos Dione <mdione@grulic.org.ar>
# This file is part of satyr.
# satyr 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 ... | unknown | codeparrot/codeparrot-clean | ||
from flask import Blueprint, request, make_response
from celery.result import AsyncResult
from celery import chord
import redis
import json
import msgpack
import os
from api.celery_tasks import (taxbrain_postprocess,
taxbrain_elast_postprocess,
dropq_task_as... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Database\Schema;
class MariaDbBuilder extends MySqlBuilder
{
//
} | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Schema/MariaDbBuilder.php |
import numpy as np
import pytest
import yaml
from pytest import approx
from pymt.services.constant.constant import ConstantScalars
def test_initialize(tmpdir):
with tmpdir.as_cwd():
with open("params.yml", "w") as fp:
yaml.dump({"foo": 2, "bar": 3.0}, fp)
c = ConstantScalars()
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
# 'Schools' module changed to the 'Education'
# frappe.reload_doc('schools', 'doctype', 'Student Admission Program')
# frappe.reload_doc('scho... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2000, 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 | include/my_thread.h |
#include "test/jemalloc_test.h"
#include "jemalloc/internal/rtree.h"
#define INVALID_ARENA_IND ((1U << MALLOCX_ARENA_BITS) - 1)
/* Potentially too large to safely place on the stack. */
rtree_t test_rtree;
TEST_BEGIN(test_rtree_read_empty) {
tsdn_t *tsdn;
tsdn = tsdn_fetch();
base_t *base = base_new(tsdn, 0, &... | c | github | https://github.com/redis/redis | deps/jemalloc/test/unit/rtree.c |
//! Structural const qualification.
//!
//! See the `Qualif` trait for more info.
// FIXME(const_trait_impl): This API should be really reworked. It's dangerously general for
// having basically only two use-cases that act in different ways.
use rustc_errors::ErrorGuaranteed;
use rustc_hir::LangItem;
use rustc_infer:... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_const_eval/src/check_consts/qualifs.rs |
//
// Copyright (c) 2022 Klemens Morgenstern (klemens.morgenstern@gmx.net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_COBALT_GATHER_HPP
#define BOOST_COBALT_GATHER_HPP
#include <boost/coba... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/cobalt/gather.hpp |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C)
# 2004-2010 Tiny SPRL (<http://tiny.be>).
# 2009-2010 Veritos (http://veritos.nl).
# All Rights Reserved
#
# This program is free software: you can redistribute i... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import EdenaiTool
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRE... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/tools/edenai/edenai_base_tool.py |
from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from markdown import markdown
import bleach
from flask import current_app, request, url_for
from flask.ext.login import UserMixin,... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
import sys, os
templates_path = ['.templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Cilex'
copyright = u'2013, Mike van Riel'
version = '1.0'
release = '1.0.0-alpha1'
pygments_style = 'sphinx'
html_theme = 'agogo'
html_static_path = ['.static']
htmlhelp_basename = 'Cilexdoc'
# -- Options for LaTe... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2019 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/apis/flowcontrol/types.go |
# coding=utf-8
"""
Send metrics to a [influxdb](https://github.com/influxdb/influxdb/) using the
http interface.
v1.0 : creation
v1.1 : force influxdb driver with SSL
v1.2 : added a timer to delay influxdb writing in case of failure
this whill avoid the 100% cpu loop when influx in not responding
Sebast... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import logging
import re
from babelfish import Language, language_converters
from guessit import guessit
from requests import Session
from . import ParserBeautifulSoup, Provider
from .. import __short_version__
from ..cache import SHOW_EXPIRATION_TIME, region
from ..exceptions import Authentic... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from builtins import str
import argparse
import logging
from subprocess import check_call
import os
tool_description = """
Remove spurious events originating from errors in random sequence tags.
This script compares all events sharing the same coordinates. Among each group
of events the maximum... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 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 or agreed to in writing, ... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2015, Peter Sprygada <psprygada@ansible.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) any late... | unknown | codeparrot/codeparrot-clean | ||
// RUN: %check_clang_tidy %s bugprone-reserved-identifier %t -- \
// RUN: -header-filter='' -- \
// RUN: -I%S/Inputs/reserved-identifier \
// RUN: -isystem %S/Inputs/reserved-identifier/system
// no warnings expected with -header-filter=''
#include "user-header.h"
#include <system-header.h>
#define _MACRO(m) in... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier.cpp |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'PageWidget.subtext'
db.add_column(u'director_pagewidget', 'subtext',
se... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2018 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 | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { AsyncSeriesHook, SyncHook } = require("tapable");
const { makeWebpackError } = require("../HookWebpackError");
const WebpackError = require("../WebpackError");
const ArrayQueue = require("./ArrayQ... | javascript | github | https://github.com/webpack/webpack | lib/util/AsyncQueue.js |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.utils.timezone import now
except ImportError:
now = datetime.datetime.now
default_datetime = now()
class Migration(SchemaMigration):
def forwards(self, orm):
... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright (c) 2002, 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 (includ... | c | github | https://github.com/mysql/mysql-server | include/my_getopt.h |
import hashlib, base64
def checksum(string):
#return base64.urlsafe_b85encode(string.encode("utf-8")).decode("utf-8")[:8]
m = hashlib.md5()
m.update(string.encode("utf-8"))
return base64.b85encode(m.digest()).decode("utf-8")
def create_url(app_log, command, recipient, amount, operation, openfield):
... | 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 appl... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# DJANGO IMPORTS
from django.dispatch import Signal
# upload signals
# path: Absolute server path to the file/folder
# name: Name of the file/folder
# site: Current FileBrowserSite instance
filebrowser_pre_upload = Signal(providing_args=["path", "file", "site"])
filebrowser_post_upload = Signal(provid... | unknown | codeparrot/codeparrot-clean | ||
from twisted.trial import unittest
from twisted.trial.runner import TestLoader
class TestTestVisitor(unittest.TestCase):
def setUp(self):
self.loader = TestLoader()
try:
from twisted.trial.unittest import TestVisitor
class MockVisitor(TestVisitor):
def __ini... | 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/context/openGroups/OpenGroupsProvider.tsx |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLINFO_RTSP_CSEQ_RECV
Section: 3
Source: libcurl
See-also:
- CURLINFO_RTSP_SERVER_CSEQ (3)
- curl_easy_getinfo (3)
- curl_easy_setopt (3)
Protocol:
- RTSP
Added-in: 7.20.0
---
# NAME
CURLINFO_RTSP_CSEQ_RECV -... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md |
from nose.tools import eq_
from kitsune.motidings.tests import WatchFactory
from kitsune.sumo.tests import TestCase
from kitsune.sumo.urlresolvers import reverse
class UnsubscribeTests(TestCase):
def test_view_get(self):
watch = WatchFactory()
url = reverse('tidings.unsubscribe', args=(watch.id,)... | unknown | codeparrot/codeparrot-clean | ||
function Component(props) {
const wat = () => {
const pathname = 'wat';
pathname;
};
const pathname = props.wat;
const deeplinkItemId = pathname ? props.itemID : null;
return <button onClick={() => wat()}>{deeplinkItemId}</button>;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-hoisting.js |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <ATen/ATen.h>
#include <ATen/Config.h>
#if AT_MKLDNN_ENABLED()
#include <ideep/tensor.hpp>
#include <utility>
namespace at::native::mkldnn {
struct ContextConv final {
ideep::tensor weight_packed_;
std::optional<at::Tensor> at_bias_;
std::vector<int64_t> padding_;
std::vector<int64_t>... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/mkldnn/Common.h |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java |
bugfixes:
- ansible_local will no longer trigger variable injection default value deprecation. | unknown | github | https://github.com/ansible/ansible | changelogs/fragments/ansible_local_nodepr.yml |
# coding:utf-8
from django.db import models
from django.contrib.auth.models import User
from category.models import Category
class Article(models.Model):
STATUS_CHOICES = (
('d', '草稿'),
('p', '发表'),
) # 存为草稿或者发表
ARTICLE_STATUS = (
(0, u'普通'),
(1, u'精华')
... | unknown | codeparrot/codeparrot-clean | ||
# Forms Overview
Forms are a big part of many apps because they enable your app to accept user input. Let's learn about how forms are handled in Angular.
In Angular, there are two types of forms: template-driven and reactive. You'll learn about both over the next few activities.
NOTE: Learn more about [forms in Angu... | unknown | github | https://github.com/angular/angular | adev/src/content/tutorials/learn-angular/steps/15-forms/README.md |
from django.test import TestCase
from mock import Mock, NonCallableMock, NonCallableMagicMock, patch
from silk.collector import DataCollector
from silk.models import SQLQuery, Request
from silk.sql import execute_sql
from silk.tests.util import delete_all_models
def mock_sql():
mock_sql_query = Mock(spec_set=['_e... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of BHMM (Bayesian Hidden Markov Models).
#
# Copyright (c) 2016 Frank Noe (Freie Universitaet Berlin)
# and John D. Chodera (Memorial Sloan-Kettering Cancer Center, New York)
#
# BHMM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Licens... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
"""
The module for some general debug tools
"""
import numpy as np
def checkFinite(arr, name=None):
if name is None:
name = 'Array with ID['+str(id(arr))+']'
if np.any(np.logical_not(np.i... | unknown | codeparrot/codeparrot-clean | ||
"""Add columns to review questions and review ratings tables.
Revision ID: 2af245be72a6
Revises: 566d5de4e0e5
Create Date: 2017-11-24 11:38:33.292283
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '2af245be72a6'
down_revision = '566d5de4e0e5'
branch_labels = No... | 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 | ||
from .dist_math import *
__all__ = ['Binomial', 'BetaBin', 'Bernoulli', 'Poisson', 'NegativeBinomial',
'ConstantDist', 'ZeroInflatedPoisson', 'DiscreteUniform', 'Geometric',
'Categorical']
class Binomial(Discrete):
"""
Binomial log-likelihood. The discrete probability distribution
of the number of suc... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2009 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.
import gyp
import gyp.common
import gyp.SCons as SCons
import os.path
import pprint
import re
# TODO: remove when we delete the last WriteList... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and condit... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class IviIE(InfoExtractor):
IE_DESC = 'ivi.ru'
IE_NAME = 'ivi'
_VALID_URL = r'https?://(?:www\.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form.ui'
#
# Created: Wed Feb 16 22:14:47 2011
# by: pyside-uic 0.2.6 running on PySide 1.0.0~beta5
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_Form(object):
def setupUi(self,... | unknown | codeparrot/codeparrot-clean | ||
#
# webui.py
#
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Deluge is free software.... | unknown | codeparrot/codeparrot-clean | ||
from unittest import mock
import pytest
from django.http import Http404
from rest_framework.permissions import SAFE_METHODS
from know_me.profile import permissions
UNSAFE_METHODS = ("DELETE", "PATCH", "POST", "PUT")
ALL_METHODS = SAFE_METHODS + UNSAFE_METHODS
mock_has_object_read_permission = mock.patch(
"know_... | unknown | codeparrot/codeparrot-clean | ||
function mutate() {}
function foo() {
let a = {};
let b = {};
let c = {};
a = b;
b = c;
c = a;
mutate(a, b);
return c;
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-alias.js |
# Copyright 2014 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.
"""This module classifies NativeHeap objects filtering their allocations.
The only filter currently available is 'stacktrace', which works as follows:
{'na... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2018 PaddlePaddle 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 appli... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2019 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.
"""A script for fetching LLVM monorepo and building clang-tools-extra binaries.
Example: build clangd and clangd-indexer
tools/clan... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* parse_expr.c
* handle expressions in parser
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/backend/pa... | c | github | https://github.com/postgres/postgres | src/backend/parser/parse_expr.c |
import os
from django.conf import settings as django_settings
from django.test.signals import setting_changed
DEFAULTS = {
'AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1:2000',
'AUTO_INSTRUMENT': True,
'AWS_XRAY_CONTEXT_MISSING': 'RUNTIME_ERROR',
'PLUGINS': (),
'SAMPLING': True,
'SAMPLING_RULES': None,... | unknown | codeparrot/codeparrot-clean | ||
import rasterio
from rasterio._fill import _fillnodata
def fillnodata(
image,
mask=None,
max_search_distance=100.0,
smoothing_iterations=0):
"""
Fill holes in a raster dataset by interpolation from the edges.
This algorithm will interpolate values for all designated nodata
... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.