code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from __future__ import unicode_literals
from django import forms
from mezzanine.blog.models import BlogPost
from mezzanine.core.models import CONTENT_STATUS_DRAFT
# These fields need to be in the form, hidden, with default values,
# since it posts to the blog post admin, which includes these fields
# and will use em... | unknown | codeparrot/codeparrot-clean | ||
<!-- #docplaster -->
<nav>
<button type="button" (click)="toggle()">Toggle Open/Close</button>
</nav>
<div [@openClose]="isOpen() ? 'open' : 'closed'" class="open-close-container">
<p>The box is now {{ isOpen() ? 'Open' : 'Closed' }}!</p>
</div> | html | github | https://github.com/angular/angular | adev/src/content/examples/animations/src/app/animations-package/open-close.html |
/*
* 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 | benchmarks/src/main/java/org/elasticsearch/benchmark/index/codec/tsdb/internal/LowCardinalitySupplier.java |
# Copyright (c) 2014 VMware, 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 requir... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
__author__ = 'Alan Viars @aviars'
import jwt
import sys
from cryptography.x509 import load_pem_x509_certificate, OID_COMMON_NAME
from cryptography.hazmat.backends import default_backend
from collections import OrderedDict
def verify_poet(jws, public_key_string):
python_version = sys.version_i... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# idler.py
#
# Copyright 2011, 2012 Patrick Ulbrich <zulu99@gmx.net>
# Copyright 2011 Leighton Earl <leighton.earl@gmx.com>
#
# 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
# th... | unknown | codeparrot/codeparrot-clean | ||
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../../../dist/css/bootstrap.min.css" rel="stylesheet">
<title>Modal</title>
<style>
#tall {
height: 1500px;
width: 100px;
}
... | html | github | https://github.com/twbs/bootstrap | js/tests/visual/modal.html |
from itertools import izip
from django.db.backends.util import truncate_name, typecast_timestamp
from django.db.models.sql import compiler
from django.db.models.sql.constants import TABLE_NAME, MULTI
SQLCompiler = compiler.SQLCompiler
class GeoSQLCompiler(compiler.SQLCompiler):
def get_columns(self, with_aliases... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/mediatek,mt6795-clock.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek Functional Clock Controller for MT6795
maintainers:
- AngeloGioacchino Del Regno <angelogioacchino.delregno@c... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/clock/mediatek,mt6795-clock.yaml |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package agent
import (
"context"
"fmt"
"net"
"net/http"
"os"
"testing"
"time"
"github.com/hashicorp/go-hclog"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/api"
credAppRole "github.com/hashicorp/vault/builtin/credenti... | go | github | https://github.com/hashicorp/vault | command/agent/cache_end_to_end_test.go |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | unknown | codeparrot/codeparrot-clean | ||
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 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... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/abac/zz_generated.deepcopy.go |
/*
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir
import org.jetbrains.kotlin.KtFakeSourceElementKind
import org.... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/FirUtils.kt |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: sasl-ir
Help: Initial response in SASL authentication
Protocols: LDAP IMAP POP3 SMTP
Added: 7.31.0
Category: auth
Multi: boolean
See-also:
- sasl-authzid
Example:
- --sasl-ir imap://example.com/
---
# `--sasl-ir`
En... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/sasl-ir.md |
# -*- coding: utf-8 -*-
#
# Copyright The Plasma Project.
# See LICENSE.txt for details.
"""
Flex Messaging compatibility tests.
.. versionadded:: 0.1
"""
import unittest
import datetime
import uuid
import pyamf
from plasma.flex.messaging import messages
class AbstractMessageTestCase(unittest.TestCase):
"""
... | unknown | codeparrot/codeparrot-clean | ||
import logging
import urllib
import re
import metadata_parser
import json
import pika
import gevent
import pickle
from django.template.loader import render_to_string
from socketio.namespace import BaseNamespace
from socketio.mixins import RoomsMixin, BroadcastMixin
from socketio.sdjango import namespace
from chat.mo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb service-group objects
(c) 2014, Mischa Peters <mpeters@a10networks.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 publishe... | unknown | codeparrot/codeparrot-clean | ||
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2021 Realm 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/li... | c | github | https://github.com/realm/realm-swift | examples/ios/objc/Migration/Examples/Example_v1.h |
# Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.symbols
import com.intellij.psi.PsiElement
import org.jetbrains... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/KaFirTypeParameterSymbol.kt |
#!/usr/bin/python
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
im... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import aos_version
from collections import namedtuple
Package = namedtuple('Package', ['name', 'version'])
expected_pkgs = {
"spam": {
"name": "spam",
"version": "3.2.1",
"check_multi": False,
},
"eggs": {
"name": "eggs",
"version": "3.2.1",
"c... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
#include "rvv_hal.hpp"
namespace cv { namespace ... | cpp | github | https://github.com/opencv/opencv | hal/riscv-rvv/src/imgproc/moments.cpp |
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# The curl HTTP Test Suite
This is an additional test suite using a combination of Apache httpd and
nghttpx servers to perform various tests beyond the capabilities of the
standard curl test suite.
# Usage
The test cases... | unknown | github | https://github.com/curl/curl | docs/tests/HTTP.md |
import serial
import re
from time import sleep
from datetime import datetime, timedelta
from .tty import Terminal
# -------------------------------------------------------------------------
# Terminal connection over SERIAL CONSOLE
# -------------------------------------------------------------------------
_PROMPT =... | unknown | codeparrot/codeparrot-clean | ||
"""basic inference routines"""
from __future__ import annotations
from collections import abc
from numbers import Number
import re
from re import Pattern
from typing import (
TYPE_CHECKING,
TypeGuard,
)
import numpy as np
from pandas._libs import lib
from pandas.util._decorators import set_module
if TYPE_C... | python | github | https://github.com/pandas-dev/pandas | pandas/core/dtypes/inference.py |
from typing import Optional, List
import logging
import os
import sqlite3
import tempfile
from time import time
class Storage(object):
path = None
def __init__(self, path: Optional[str] = None, user: Optional[str] = None):
log = logging.getLogger('theonionbox')
self.path = None
if ... | unknown | codeparrot/codeparrot-clean | ||
"""quodsite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | unknown | codeparrot/codeparrot-clean | ||
/*
* Generic implementation of background process infrastructure.
*/
#include "git-compat-util.h"
#include "sub-process.h"
#include "sigchain.h"
#include "pkt-line.h"
int cmd2process_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const v... | c | github | https://github.com/git/git | sub-process.c |
#!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import Mock
from mock import patch
from diamond.collector import Colle... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import unittest
import os
import asn1crypto.x509
from oscrypto import asymmetric
from ocspbuilder import OCSPRequestBuilder
from ._unittest_compat import patch
patch()
tests_root = os.path.dirname(__file__)
fixtures_... | 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/compiler/tf2xla/graph_compiler.h |
framework:
http_client:
default_options:
resolve:
host: 127.0.0.1
scoped_clients:
foo:
base_uri: http://example.com
query:
key: foo
resolve:
host: 127.0.0.1 | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/http_client_xml_key.yml |
# 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 distributed in the hope that it will be useful,
# bu... | unknown | codeparrot/codeparrot-clean | ||
#ifndef C10_UTIL_OPTIONAL_H_
#define C10_UTIL_OPTIONAL_H_
#include <optional>
#include <type_traits>
// Macros.h is not needed, but it does namespace shenanigans that lots
// of downstream code seems to rely on. Feel free to remove it and fix
// up builds.
namespace c10 {
#if !defined(FBCODE_CAFFE2) && !defined(C10... | c | github | https://github.com/pytorch/pytorch | c10/util/Optional.h |
#!/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.
"""Utility to decode a crash dump generated by untrusted_crash_dump.[ch]
Currently this produces a simple stack trace.
"""
import... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/framework/versions.h |
#! /usr/bin/env python
import os
import itertools as it
import sys
import textwrap
#import gtk
import numpy as np
import sympy as sy
import sympy.stats
import odespy as ode
import matplotlib
import matplotlib.pyplot as plt
import sympy.physics.mechanics as mech
"""
Pretty plotting code.
"""
_all_spines = ["top", "ri... | unknown | codeparrot/codeparrot-clean | ||
import csv
import codecs
import cStringIO
from collections import OrderedDict
from itertools import chain
from django.conf import settings
from pyxform.section import Section, RepeatingSection
from pyxform.question import Question
from onadata.apps.logger.models.xform import XForm
from onadata.apps.viewer.models.data... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
"""
===================================================
Label Propagation digits: Demonstrating performance
===================================================
This example demonstrates the power of semisupervised learning by
training a Label Spreading model to classify handwritten digits
with sets of very few labels.... | python | github | https://github.com/scikit-learn/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py |
import os
import sys
from flask import logging
from app import current_app as app, celery
from app.models import db
from app.models.setting import Environment
from app.settings import set_settings
from populate_db import populate
_basedir = os.path.abspath(os.path.dirname(__file__))
class Setup(object):
@static... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const StartupChunkDependenciesRuntimeModule = require("./StartupChunkDependenciesRuntimeModule");
const StartupEntrypointRuntimeModule = require("./StartupEntrypointRuntimeModule");... | javascript | github | https://github.com/webpack/webpack | lib/runtime/StartupChunkDependenciesPlugin.js |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are me... | unknown | codeparrot/codeparrot-clean | ||
########################################################################
#
# File Name: HTMLModElement
#
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights ... | unknown | codeparrot/codeparrot-clean | ||
"""Newton-CG trust-region optimization."""
from __future__ import division, print_function, absolute_import
import math
import numpy as np
import scipy.linalg
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem)
__all__ = []
def _minimize_trust_ncg(fun, x0, args=(), jac=None, hess=None, hessp... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2018 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from _hardware import Expectation
from _hardware_android import HardwareAndroid
CPU_CLOCK_RATE = 2035200
MEM_CLOCK_RATE = 13763
GPU_CLOCK_RATE = 670000000
GPU_POWER_LEVEL = 1 # lower i... | unknown | codeparrot/codeparrot-clean | ||
#!/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 or... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 logging
import time
from telemetry.core import util
class ActionNotSupported(Exception):
pass
class AndroidActionRunner(object):
"""Provides an... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2017 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/kubelet_pods_windows_test.go |
"""
Django settings for mello project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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-gwt/src-super/com/google/common/collect/super/com/google/common/collect/RegularImmutableSortedSet.java |
# -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Top-level presubmit script for auth server.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit ... | unknown | codeparrot/codeparrot-clean | ||
## begin license ##
#
# "Meresco Examples" is a project demonstrating some of the
# features of various components of the "Meresco Suite".
# Also see http://meresco.org.
#
# Copyright (C) 2012-2016 Seecr (Seek You Too B.V.) http://seecr.nl
#
# This file is part of "Meresco Examples"
#
# "Meresco Examples" is free softw... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package s3
import (
"encoding/json"
"errors"
"fmt"
"net/url"
"regexp"
"strings"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/arn"
"github.com/hashicorp/terraform/internal/tfdiags"
"github.com/zclconf/go-ct... | go | github | https://github.com/hashicorp/terraform | internal/backend/remote-state/s3/validate.go |
from django.core.exceptions import PermissionDenied
from django.template.response import TemplateResponse
from django.test import SimpleTestCase, modify_settings, override_settings
from django.urls import path
class MiddlewareAccessingContent:
def __init__(self, get_response):
self.get_response = get_respo... | python | github | https://github.com/django/django | tests/handlers/tests_custom_error_handlers.py |
from unittest import TestCase, main
from socketio.namespace import BaseNamespace
from socketio.virtsocket import Socket
class MockSocketIOServer(object):
"""Mock a SocketIO server"""
def __init__(self, *args, **kwargs):
self.sockets = {}
def get_socket(self, socket_id=''):
return self.soc... | unknown | codeparrot/codeparrot-clean | ||
from configparser import ConfigParser
import argparse
import os
from contactsdk.connector import Connector
def parse_input():
parser = argparse.ArgumentParser()
parser.add_argument("config_file", type=str, help="Configuration file")
args = parser.parse_args()
return args
def program():
print "***... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 OpenStack Foundation.
# 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 req... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Module graph
Implements a directed acyclic graph (DAG) which will throw an error
when a circular dependancy is created. A topological sort is used to determine
what nodes can be run first.
"""
import logging
logger = logging.getLogger(__name__)
class Node:
def __init__(self, name):
... | unknown | codeparrot/codeparrot-clean | ||
# *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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/eventbus/outside/AbstractEventBusTest.java |
'use strict';
const common = require('../common.js');
const bench = common.createBenchmark(main, {
size: [16, 512, 4096, 16386],
args: [1, 2, 5],
n: [1e6],
});
function main({ n, size, args }) {
const b0 = Buffer.alloc(size, 'a');
const b1 = Buffer.alloc(size, 'a');
const b0Len = b0.length;
const b1Len ... | javascript | github | https://github.com/nodejs/node | benchmark/buffers/buffer-compare-instance-method.js |
#!/usr/bin/env python
import json
import logging
import socket
import sys
import time
import traceback
import gflags
import webapp2
from actions.compressor import CompressorToggle
from actions.compressor import State
from actions.dispense_cup import DispenseCup, ReleaseCup
from actions.home import Home
from actions.... | 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 | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/package-info.java |
# Define routes
Routes serve as the fundamental building blocks for navigation within an Angular app.
## What are routes?
In Angular, a **route** is an object that defines which component should render for a specific URL path or pattern, as well as additional configuration options about what happens when a user navi... | unknown | github | https://github.com/angular/angular | adev/src/content/guide/routing/define-routes.md |
import {useState} from 'react';
function Component(props) {
const items = props.items ? props.items.slice() : [];
const [state] = useState('');
return props.cond ? (
<div>{state}</div>
) : (
<div>
{items.map(item => (
<div key={item.id}>{item.name}</div>
))}
</div>
);
}
expor... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-mutable-range-extending-into-ternary.js |
# Copyright (c) 2018 Cisco and/or its affiliates.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "v0alpha1.annotation-filtering.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "grafana... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/annotations/v0alpha1.annotation-filtering.v42.v2beta1.json |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterfa... | unknown | codeparrot/codeparrot-clean | ||
"""Ensure emitted events contain the fields legacy processors expect to find."""
from mock import sentinel
from django.test.utils import override_settings
from openedx.core.lib.tests.assertions.events import assert_events_equal
from track.tests import EventTrackingTestCase, FROZEN_TIME
LEGACY_SHIM_PROCESSOR = [
... | unknown | codeparrot/codeparrot-clean | ||
use crate::io::AsyncWrite;
use bytes::Buf;
use pin_project_lite::pin_project;
use std::future::Future;
use std::io::{self, IoSlice};
use std::marker::PhantomPinned;
use std::pin::Pin;
use std::task::{ready, Context, Poll};
pin_project! {
/// A future to write some of the buffer to an `AsyncWrite`.
#[derive(De... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/io/util/write_buf.rs |
'''trigger detect, return indices of zero value to nonzero change in trigger channel'''
from numpy import array, nonzero
class get:
def __init__(self, unsorteddatachunk, channelinstance, trigtype):
#trigtype=='TRIGGER' OR 'RESPONSE'
#trig=trigdet.get(d.data_blockunsorted, ch, 'RESPONSE')
''... | unknown | codeparrot/codeparrot-clean | ||
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | unknown | codeparrot/codeparrot-clean | ||
""" Fantasm: A taskqueue-based Finite State Machine for App Engine Python
Docs and examples: http://code.google.com/p/fantasm/
Copyright 2010 VendAsta Technologies 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 ob... | unknown | codeparrot/codeparrot-clean | ||
# For this example, we're going to write a simple momentum script. When the
# stock goes up quickly, we're going to buy; when it goes down quickly, we're
# going to sell. Hopefully we'll ride the waves.
import os
import tempfile
import time
import pandas as pd
import talib
from logbook import Logger
from catalyst i... | unknown | codeparrot/codeparrot-clean | ||
name: unstable-periodic
on:
schedule:
- cron: 45 0,4,8,12,16,20 * * *
- cron: 29 8 * * * # about 1:29am PDT, for mem leak check and rerun disabled tests
push:
tags:
- ciflow/unstable/*
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || gith... | unknown | github | https://github.com/pytorch/pytorch | .github/workflows/unstable-periodic.yml |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2014-12-10 01:34:09
import os
import sys
import time
import click
import shutil
import inspect
import unittest2 as unittest
from pyspider import run
fro... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 IBM Corp.
#
# 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 agree... | unknown | codeparrot/codeparrot-clean | ||
from test_base import MainTestCase
import os
from odk_logger.models import XForm
from unittest.case import skip
class TestUnique(MainTestCase):
@skip("DB Fields are wrong")
def test_unique_together(self):
"""
Multiple users can have the same survey, but id_strings of
surveys must be un... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | unknown | codeparrot/codeparrot-clean | ||
import os
import json
import getshorty
import unittest
import tempfile
URL = 'http://google.com'
URL_MOBILE = 'http://facebook.com'
URL_TABLET = 'https://yahoo.com'
BAD_URL = 'http//google.com'
UA = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36'
UA_MOBILE = ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage,
# (C) 2015-2020 MinIO, 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.or... | 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/server/quota/package-info.java |
#
# 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
# ... | unknown | codeparrot/codeparrot-clean | ||
import { Content } from "@prismicio/client";
import PostPreview from "../components/post-preview";
type MoreStoriesProps = {
posts: Content.PostDocument[];
};
export default function MoreStories({ posts }: MoreStoriesProps) {
return (
<section>
<h2 className="mb-8 text-6xl md:text-7xl font-bold trackin... | typescript | github | https://github.com/vercel/next.js | examples/cms-prismic/components/more-stories.tsx |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django.contrib.auth import REDIRECT_FIELD_NAME, S... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# Copyright (c) 2013-2017, 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 | ||
"""retrive local user settings"""
from ConfigParser import SafeConfigParser, NoOptionError
import os as os
from os.path import join, split, abspath, isfile, expanduser
from sys import modules
self = modules[__name__]
# define various filepaths
omelib_directory = join(split(abspath(__file__))[0], "")
ome_directory = ... | unknown | codeparrot/codeparrot-clean | ||
#encoding: utf8
import numpy as np
from scipy.misc import comb
from scipy.stats import norm
import matplotlib.pyplot as plt
import pdb
'''
容量和alpha, beta都有关, 和delta有关。一般delta取一个sigma
err1 = alpha = 0.1
err2 = beta = 0.2
正态样本容量,用来控制第二类错误(这么说还好不对)
delta 默认为一个标准差
Phi((c - mu0)*sqrt(n)/sigma) <= (1-alpha)
c <= ppf(1-... | unknown | codeparrot/codeparrot-clean | ||
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
from streamlink.utils import parse_json
class ElTreceTV(Plugin):
_url_re = re.compile(r'https?://(?:www\.)?eltrecetv.com.ar/.+')
@classmethod
def can_handle_url(cls, url):
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-beans/src/main/java/org/springframework/beans/factory/aot/InstanceSupplierCodeGenerator.java |
/* Copyright (c) 2015, 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/sql_thd_internal_api.h |
//! Cache for candidate selection.
use std::hash::Hash;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lock;
use crate::dep_graph::DepNodeIndex;
use crate::ty::TyCtxt;
pub struct WithDepNodeCache<Key, Value> {
hashmap: Lock<FxHashMap<Key, WithDepNode<Value>>>,
}
impl<Key: Clone, Val... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_middle/src/traits/cache.rs |
// RUN: %check_clang_tidy %s bugprone-misplaced-operator-in-strlen-in-alloc %t
typedef __typeof(sizeof(int)) size_t;
void *malloc(size_t);
void *alloca(size_t);
void *calloc(size_t, size_t);
void *realloc(void *, size_t);
size_t strlen(const char *);
size_t strnlen(const char *, size_t);
size_t strnlen_s(const char *... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/misplaced-operator-in-strlen-in-alloc.c |
# frozen_string_literal: true
# :markup: markdown
module ActionCable
module Server
class Worker
module ActiveRecordConnectionManagement
extend ActiveSupport::Concern
included do
if defined?(ActiveRecord::Base)
set_callback :work, :around, :with_database_connections
... | ruby | github | https://github.com/rails/rails | actioncable/lib/action_cable/server/worker/active_record_connection_management.rb |
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/kv"
"github.com/cockroachdb/cockroach/pkg/security... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/testutils.go |
/*
* 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 | buildSrc/src/main/java/org/springframework/boot/build/properties/BuildType.java |
#!/usr/bin/env python3
# ====================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# ====================================
import os
import sys
from optparse import OptionParser
import grp
import pwd
import util
# append worker binary source path
sys.path.append(os.path.dirname... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.