code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
Something which is neither a tuple struct nor a tuple variant was used as a
pattern.
Erroneous code example:
```compile_fail,E0164
enum A {
B,
C,
}
impl A {
fn new() {}
}
fn bar(foo: A) {
match foo {
A::new() => (), // error!
_ => {}
}
}
```
This error means that an attempt was ... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0164.md |
import subprocess as sp
import re
from ..interfaces import config
from ..first_order.model import FO_Model # para los contraejemplos
from ..first_order.fofunctions import FO_Operation, FO_Relation
from ..first_order.fotype import FO_Type
from ..misc.misc import indent
def getops(li, st, d_universe=None):
# TODO ,... | unknown | codeparrot/codeparrot-clean | ||
# Lint as: python3
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
function showTransferState() {
cy.get('.main-toolbar > .settings > button:last-child').click();
cy.get(
'.cd... | javascript | github | https://github.com/angular/angular | devtools/cypress/integration/track-state.e2e.js |
# 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 applica... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#----------------------------------------------------------
# OpenERP HTTP layer
#----------------------------------------------------------
import ast
import collections
import contextlib
import errno
import functools
import getpass
import inspect
import logging
import mimetypes
import os
impor... | unknown | codeparrot/codeparrot-clean | ||
from django.template import Context, Engine
from django.test import SimpleTestCase
from ..utils import setup
class IfChangedTagTests(SimpleTestCase):
libraries = {'custom': 'template_tests.templatetags.custom'}
@setup({'ifchanged01': '{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}'})
... | unknown | codeparrot/codeparrot-clean | ||
---
title: Race Conditions
---
# Race Conditions
[MODES: framework, data]
<br/>
<br/>
While impossible to eliminate every possible race condition in your application, React Router automatically handles the most common race conditions found in web user interfaces.
## Browser Behavior
React Router's handling of net... | unknown | github | https://github.com/remix-run/react-router | docs/explanation/race-conditions.md |
#!/usr/bin/env python3
"""Send the contents of a directory as a MIME message."""
import os
import sys
import smtplib
# For guessing MIME type based on file name extension
import mimetypes
from argparse import ArgumentParser
from email import encoders
from email.message import Message
from email.mime.audio import MI... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (C) 2014 Red Hat, Inc.
#
# Licensed under the GNU Lesser General Public License Version 2.1
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... | 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-testcontainers/src/main/java/org/springframework/boot/testcontainers/package-info.java |
# Sparse benchmarks
# This benchmark is for sparse matmul performance test.
# They exist for comparing the performance of sparse matrix routines
# `sparse @ vector`, `sparse @ sparse` and `sparse @ dense` with different backends (CPU/CUDA)
# and with other frameworks such as scipy.
import argparse
import os
import s... | python | github | https://github.com/pytorch/pytorch | benchmarks/sparse/dlmc/matmul_bench.py |
"""
Expressions
-----------
Offer fast expression evaluation through numexpr
"""
import warnings
import numpy as np
from pandas.core.common import _values_from_object
from pandas.core.computation.check import _NUMEXPR_INSTALLED
from pandas.core.config import get_option
if _NUMEXPR_INSTALLED:
import numexpr as n... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2007 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 agreed ... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/primitives/Primitives.java |
#!/usr/bin/python3
import argparse
import os
import sys
import configuration
import shouter
from gitFunctions import Commiter
from gitFunctions import Initializer, Differ
from rtcFunctions import ImportHandler
from rtcFunctions import RTCInitializer
from rtcFunctions import RTCLogin
from rtcFunctions import Workspace... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import print_function
import argparse
def get_parser():
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("-v", "--verbose",
ac... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# wordcloud documentation build configuration file, created by
# sphinx-quickstart on Fri May 3 17:14:50 2013.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | unknown | codeparrot/codeparrot-clean | ||
###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... | unknown | codeparrot/codeparrot-clean | ||
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... | 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 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectorConfig.java |
# Copyright 2013 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 tempfile
import unittest
import md5_check
class TestMd5Check(unittest.TestCase):
def testCallAndRecordIfStale(self):
input_strings = ['string1... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2008,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | unknown | codeparrot/codeparrot-clean | ||
# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API.
#
# This is used for generating API documentation and the types used by the
# client/server. See api/README.md for more information.
#
# Some style notes:
# - This file is used by ReDoc, which allows GitHub Flavored Markdown in
# descriptions.
# - There i... | unknown | github | https://github.com/moby/moby | api/docs/v1.52.yaml |
# -*- coding: utf-8 -*-
"""
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ... | unknown | codeparrot/codeparrot-clean | ||
---
navigation_title: "Standard"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-standard-tokenizer.html
---
# Standard tokenizer [analysis-standard-tokenizer]
The `standard` tokenizer provides grammar based tokenization (based on the Unicode Text Segmentation algorithm, as ... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/text-analysis/analysis-standard-tokenizer.md |
#pragma once
#include <c10/core/Device.h> | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/Device.h |
"""
[9/17/2012] Challenge #99 [intermediate] (Unemployment map of the United States)
https://www.reddit.com/r/dailyprogrammer/comments/101mi5/9172012_challenge_99_intermediate_unemployment/
[A little while
ago](http://www.reddit.com/r/dailyprogrammer/comments/yj38u/8202012_challenge_89_difficult_coloring_the/) we too... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
function Component(props) {
const maybeMutable = new MaybeMutable();
return <div>{maybeMutate(maybeMutable)}</div>;
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(1);
let t0;
if ($[0] === Symbol.for("react.memo_... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/builtin-jsx-tag-lowered-between-mutations.expect.md |
"""Validators"""
# pylint: disable=too-few-public-methods
from formencode import Schema, validators, ForEach
from ..utils.validation import ValidateISODate
class PublicKeyValidator(Schema):
"""Public Key entity Validator"""
id = validators.String()
active = validators.Bool()
date_created = ValidateIS... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
d_c = np.genfromtxt("coarse.dat")
d_m = np.genfromtxt("medium.dat")
d_f = np.genfromtxt("fine.dat")
d_e = np.genfromtxt("exact.dat")
plt.plot(d_e[1:,0], d_e[1:,1], lw=1.5, label="exact")
plt.plot(d_c[1:,0], d_c[1:,1], "o... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ans... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=g-bad-file-header
# 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/LICENS... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2022 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
set -euo pipefail
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))"
source "$dir/teamcity-support.sh" # For $root
source "$dir/teamcity-bazel-... | unknown | github | https://github.com/cockroachdb/cockroach | build/teamcity/cockroach/nightlies/sqllogic_backup_restore.sh |
# -*- coding: utf-8 -*-
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, api
class HrTimesheetSheetSheet(models.Model):
_name = "hr_timesheet_sheet.sheet"
_inherit = [
"hr_ti... | unknown | codeparrot/codeparrot-clean | ||
"""Integration tests for ShellToolMiddleware with create_agent."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
import pytest
from langchain_core.messages import HumanMessage
from langchain_core.tools import tool
from langchain.agents import create_agent
from langchain.agents.middleware.... | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.py |
#
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library
# $Id$
#
# stuff to deal with OLE2 Structured Storage files. this module is
# used by PIL to read Image Composer and FlashPix files, but can also
# be used to read other files of this type.
#
# History:
# 1997-01-20 fl Created
# 1997-01-22 fl Fixed 64-bit... | unknown | codeparrot/codeparrot-clean | ||
"""Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']
# Hardcode the recognized whitespace characters to the US-A... | unknown | codeparrot/codeparrot-clean | ||
from .common import random_str
from rancher import ApiError
from kubernetes.client import CustomObjectsApi
from kubernetes.client import CoreV1Api
import pytest
import time
import kubernetes
import base64
def test_dns_fqdn_unique(admin_mc):
client = admin_mc.client
provider_name = random_str()
access = ran... | unknown | codeparrot/codeparrot-clean | ||
from setuptools import setup, find_packages
import os
import cms
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independe... | unknown | codeparrot/codeparrot-clean | ||
## Usage
Benchmark 3-member etcd cluster to get its read and write performance.
## Instructions
1. Start 3-member etcd cluster on 3 machines
2. Update `$leader` and `$servers` in the script
3. Run the script in a separate machine
## Caveat
1. Set environment variable `GOMAXPROCS` as the number of available cores t... | unknown | github | https://github.com/etcd-io/etcd | hack/benchmark/README.md |
def last(n):
return n[-1]
def sort_list_last(tuples):
return sorted(tuples, key=last) | unknown | mbpp | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Procedures for maintaining information about logical memory blocks.
*
* Peter Bergner, IBM Corp. June 2001.
* Copyright (C) 2001 Peter Bergner.
*/
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/p... | c | github | https://github.com/torvalds/linux | mm/memblock.c |
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software wi... | unknown | codeparrot/codeparrot-clean | ||
use crate::future::Future;
use crate::loom::sync::Arc;
use crate::runtime::scheduler::multi_thread::worker;
use crate::runtime::task::{Notified, Task, TaskHarnessScheduleHooks};
use crate::runtime::{
blocking, driver,
task::{self, JoinHandle, SpawnLocation},
TaskHooks, TaskMeta, TimerFlavor,
};
use crate::u... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/scheduler/multi_thread/handle.rs |
# 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 applica... | unknown | codeparrot/codeparrot-clean | ||
{
"message": "test message",
"errors": [
{
"code": "TEST1",
"message": "Test One",
"detail": 123
},
{
"code": "TEST2",
"message": "Test Two",
"detail": "fail"
}
]
} | json | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/docker/transport/message-and-errors.json |
/*
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 applicable law or a... | go | github | https://github.com/tensorflow/tensorflow | tensorflow/go/op/op.go |
/* global QUnit, Actions */
'use strict';
QUnit.module('admin.actions', {
beforeEach: function() {
// Number of results shown on page
/* eslint-disable */
window._actions_icnt = '100';
/* eslint-enable */
const $ = django.jQuery;
$('#qunit-fixture').append($('#resul... | javascript | github | https://github.com/django/django | js_tests/admin/actions.test.js |
#!/usr/bin/env python
#
# The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
# (the "License"). You may not use this work except in compliance with the License, which is
# available at www.apache.org/licenses/LICENSE-2.0
#
# This software is distributed on an "AS IS" basis, WITHOUT WAR... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import datetime
import uuid
import json
import requests
import six
import re
from boto3 import Session
from moto.compat import OrderedDict
from moto.core import BaseBackend, BaseModel, CloudFormationModel
from moto.core.utils import (
iso_8601_datetime_with_milliseconds,
... | unknown | codeparrot/codeparrot-clean | ||
"""
magicball.py
~~~~~~~~
Exposes the `MagicBall` object.
:copyright: (c) 2017 by Sean Callaway.
:license: MIT, see LICENSE for more details.
"""
import random
class MagicBall(object):
"""Defines a magic 8 ball."""
def __init__(self):
"""Setup the 8ball with responses."""
... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from cognitiveatlas.api import get_task, get_concept
from exceptions import ValueError
from neurovault.apps.statmaps.models import CognitiveAtlasTask, CognitiveAtlasContrast, StatisticMap
# Function to make a node
def make_node(nid,name,color,url=None):
'''make_node will return a json node for ... | unknown | codeparrot/codeparrot-clean | ||
"""
sudo mn --topo single,3 --mac --switch ovsk --controller remote
./pox.py log.level --DEBUG MultiSwitch
sudo mn --custom ~/mininet/custom/topo-3sw-3host.py --topo mytopo --mac --switch ovsk --controller remote
"""
"""
A stupid L3 switch
For each switch:
1) Keep a table that maps IP addresses to MAC addresses and ... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
import {useRef} from 'react';
function useArrayOfRef() {
const ref = useRef(null);
const callback = value => {
ref.current = value;
};
return [callback] as const;
}
export const FIXTURE_ENTRYPOINT = {
fn: () => {
useArrayOfRef();
return 'ok';
},
params: [{}],
};
```
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-ref-type-cast-in-render.expect.md |
from __future__ import absolute_import
from ..utils import ABC
from . import logger
__all__ = ('FixedScaleProvider', 'NullScaleProvider', 'ContextBasedScaleProvider')
class ScaleProvider(ABC):
_UNKNOWN_SCALE_RATIO = 0.0
def __init__(self, *args, **kwargs):
self._scale_ratio = self._UNKNOWN_SCALE_RAT... | unknown | codeparrot/codeparrot-clean | ||
/* Generated file to emulate the vpath namespace. */
export * from "../../harness/_namespaces/vpath.js"; | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/_namespaces/vpath.ts |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/bugprone/DefaultOperatorNewOnOveralignedTypeCheck.cpp |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021, Cenobit Technologies, Inc. http://cenobit.es/
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... | unknown | codeparrot/codeparrot-clean | ||
import {
codeFixAll,
createCodeFixAction,
registerCodeFix,
} from "../_namespaces/ts.codefix.js";
import {
ArrayBindingPattern,
CancellationToken,
cast,
CodeFixAction,
CodeFixContext,
Debug,
DiagnosticMessage,
DiagnosticOrDiagnosticAndArguments,
Diagnostics,
factory,
... | typescript | github | https://github.com/microsoft/TypeScript | src/services/codefixes/fixUnusedIdentifier.ts |
# Copyright 2009-2015 MongoDB, 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 writin... | unknown | codeparrot/codeparrot-clean | ||
{
"filters": {
"body": "본문",
"createdAt": "생성 시간",
"response": {
"all": "전체",
"pending": "대기 중",
"received": "검토됨"
}
},
"requiredAction_one": "필수 작업",
"requiredAction_other": "필수 작업들",
"requiredActionCount_one": "필수 작업 ({{count}})",
"requiredActionCount_other": "필수 작업들 ({{c... | json | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/locales/ko/hitl.json |
from setuptools import setup, find_packages, Command
from setuptools.command.test import test as TestCommand
import os
import sys
# Kept manually in sync with airflow.__version__
version = '1.7.0'
class Tox(TestCommand):
user_options = [('tox-args=', None, "Arguments to pass to tox")]
def initialize_options(... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2025 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 runtime_test
import (
"runtime"
"testing"
)
func TestHasAVX(t *testing.T) {
t.Parallel()
output := runTestProg(t, "testprog", "CheckAVX")
ok := o... | go | github | https://github.com/golang/go | src/runtime/cpuflags_amd64_test.go |
""" Convert HAR (HTTP Archive) to YAML/JSON testcase for HttpRunner.
Usage:
# convert to JSON format testcase
$ hrun har2case demo.har
# convert to YAML format testcase
$ hrun har2case demo.har -2y
"""
from httprunner.ext.har2case.core import HarParser
from sentry_sdk import capture_message
def ini... | unknown | codeparrot/codeparrot-clean | ||
"""
pip install m3u8 first, please
"""
import sys
import m3u8
import time
import urllib2
import os
url = "http://localhost:20119/cctv21/encoder/0/playlist.m3u8"
media_sequence = 0
playlist = m3u8.load(url)
while playlist.is_variant:
url = playlist.base_uri + "/" + playlist.playlists[0].uri
playlist = m3u8.lo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from setuptools import setup, find_packages
def _load_requires_from_file(filepath):
return [pkg_name.rstrip('\r\n') for pkg_name in open(filepath).readlines()]
def _install_requires():
requires = _load_requires_from_file('requirements.txt')
if sys.... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: false
require 'mkmf'
target = "io/nonblock"
unless RUBY_ENGINE == 'ruby'
File.write("Makefile", dummy_makefile($srcdir).join(""))
return
end
have_func("rb_io_descriptor", "ruby/io.h")
hdr = %w"fcntl.h"
if have_macro("O_NONBLOCK", hdr) and
(have_macro("F_GETFL", hdr) or have_macro("F_... | ruby | github | https://github.com/ruby/ruby | ext/io/nonblock/extconf.rb |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import QAction
from calibre.gui2.actions import InterfaceAction
from calibre.gui2.dialogs.quickview import ... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/triggers/callback.py |
'''Google Maps V3 geocoder.
Largely adapted from the existing v2 geocoder with modifications made where
possible to support the v3 api as well as to clean up the class without
breaking its compatibility or diverging its api too far from the rest of the
geocoder classes.
'''
import base64
import hashlib
import hmac
fr... | unknown | codeparrot/codeparrot-clean | ||
import {BootstrapContext, bootstrapApplication} from '@angular/platform-browser';
import {App} from './app/app';
import {config} from './app/app.config.server';
const bootstrap = (context: BootstrapContext) => bootstrapApplication(App, config, context);
export default bootstrap; | typescript | github | https://github.com/angular/angular | dev-app/src/main.server.ts |
#include <ATen/core/DeprecatedTypeProperties.h>
#include <ATen/core/UnsafeFromTH.h>
namespace at {
Tensor DeprecatedTypeProperties::unsafeTensorFromTH(void * th_pointer, bool retain) const {
return at::unsafeTensorFromTH(th_pointer, retain);
}
Storage DeprecatedTypeProperties::unsafeStorageFromTH(void * th_pointe... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/core/DeprecatedTypeProperties.cpp |
- hosts: localhost
gather_facts: no
tasks:
- import_tasks: tasks.yml | unknown | github | https://github.com/ansible/ansible | test/integration/targets/include_when_parent_is_static/playbook.yml |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
# Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... | unknown | codeparrot/codeparrot-clean | ||
# BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, t... | 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 | framework-docs/src/main/java/org/springframework/docs/integration/observability/jms/publish/JmsTemplatePublish.java |
# 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)
from pants.backend.c... | unknown | codeparrot/codeparrot-clean | ||
/*
* psql - the PostgreSQL interactive terminal
*
* Copyright (c) 2000-2026, PostgreSQL Global Development Group
*
* src/bin/psql/large_obj.h
*/
#ifndef LARGE_OBJ_H
#define LARGE_OBJ_H
bool do_lo_export(const char *loid_arg, const char *filename_arg);
bool do_lo_import(const char *filename_arg, const char *com... | c | github | https://github.com/postgres/postgres | src/bin/psql/large_obj.h |
{
"title": "String Refresh Test Dashboard",
"schemaVersion": 39,
"panels": [],
"time": {
"from": "now-6h",
"to": "now"
},
"refresh": "1m"
} | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/testdata/input/v40.refresh_string.json |
"""
These are functions that are just aliases of existing functions in NumPy.
"""
from __future__ import annotations
import inspect
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any, NamedTuple, cast
from ._helpers import _check_device, array_namespace
from ._helpers import device as _get_de... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/externals/array_api_compat/common/_aliases.py |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/misc/HeaderIncludeCycleCheck.cpp |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | unknown | codeparrot/codeparrot-clean | ||
import os,sys,pdb
from PIL import Image
def analyseImage(path):
'''
Pre-process pass over the image to determine the mode (full or additive).
Necessary as assessing single frames isn't reliable. Need to know the mode
before processing all frames.
'''
im = Image.open(path)
results = {
... | 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 | ||
#This file activates and customizes the backend admin site for the ACTIVITIES app.
from django.contrib import admin
from activities.models import Assignment, AssignmentTitle, AssignmentType
from citations.models import Validation
from django.contrib.contenttypes.admin import GenericStackedInline
class ValidationInli... | unknown | codeparrot/codeparrot-clean | ||
{% extends "self.html" %} | html | github | https://github.com/django/django | tests/template_tests/recursive_templates/fs/self.html |
class ApiAttribute(object):
"""A data descriptor that sets and returns values."""
def __init__(self, name):
"""Create an instance of ApiAttribute.
:param name: name of this attribute.
:type name: str.
"""
self.name = name
def __get__(self, obj, type=None):
"""Accesses value of this attr... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | unknown | codeparrot/codeparrot-clean | ||
import sys
import random
print "could generate random cases, and get the expected values running thru rpy2"
print "check expected values"
# look at this grammar and extend maybe..so not as many parans
# E is an expression, I an integer and M is an expression that is an argument for a multiplication operation.
# E ->... | unknown | codeparrot/codeparrot-clean | ||
from collections import OrderedDict
import pandas as pd
from bokeh.charts import Scatter
from bokeh.plotting import output_file, show, VBox
from bokeh.sampledata.iris import flowers
setosa = flowers[(flowers.species == "setosa")][["petal_length", "petal_width"]]
versicolor = flowers[(flowers.species == "versicolor")... | unknown | codeparrot/codeparrot-clean | ||
"""
Send HTTP requests and interpret responses.
The body returned by each procedure will be a python dictionary
obtained from parsing a response through a decoder, or ``None`` if the
decoder raises a ``ValueError``. The default encoder, decoder and
headers are meant to work with the JSON specification.
These procedur... | unknown | codeparrot/codeparrot-clean | ||
"""
PyScript standard functions.
Functions are declared as ... functions. Methods are written as methods
(using this), but declared as functions, and then "apply()-ed" to the
instance of interest. Declaring methods on Object is a bad idea (breaks
Bokeh, jquery).
"""
import re
# Functions not covered by this lib:
# ... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#---------------------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import argparse
from drive.road import StraightRoad, ZigZagRoad
from drive.field import Field
from drive.vehicle import HumanVehicle, RandomVehicle, LoopVehicle
from drive.sensor import PositionSensor
from drive.motor import PositionMotor, AccelerationMotor, JerkMotor
from drive.scorer import St... | unknown | codeparrot/codeparrot-clean | ||
"""Testcases for cssutils.css.CSSFontFaceRule"""
import xml.dom
import test_cssrule
import cssutils
class CSSFontFaceRuleTestCase(test_cssrule.CSSRuleTestCase):
def setUp(self):
super(CSSFontFaceRuleTestCase, self).setUp()
self.r = cssutils.css.CSSFontFaceRule()
self.rRO = cssutils.css.CS... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# author: @netmanchris
""" Copyright 2015 Hewlett Packard Enterprise Development LP
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/lic... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Nebula, 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 agree... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
# need * as we're copying the numpy namespace
from numpy import *
__version__ = np.__version__
__all__ = np.__all__[:] # copy numpy namespace
__all__ += ['rand', 'randn', 'repmat']
def empty(shape, dtype=None, order='C'):
"""
Return a ... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.