code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
use anyhow::Result;
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{ResolvedVc, Vc, fxindexmap};
use turbo_tasks_fs::FileSystemPath;
use turbopack_core::{
context::AssetContext,
issue::{Issue, IssueExt, IssueSeverity, IssueStage, OptionStyledString, StyledString},
module::Module,
reference_type::Refe... | rust | github | https://github.com/vercel/next.js | crates/next-core/src/middleware.rs |
import os
import win32security,win32file,win32api,ntsecuritycon,win32con
from security_enums import TRUSTEE_TYPE,TRUSTEE_FORM,ACE_FLAGS,ACCESS_MODE
fname = os.path.join(win32api.GetTempPath(), "win32security_test.txt")
f=open(fname, "w")
f.write("Hello from Python\n");
f.close()
print "Testing on file", fname
new_pri... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Tests of the Capa XModule
"""
# pylint: disable=invalid-name
import datetime
import json
import os
import random
import textwrap
import unittest
import pytest
import ddt
import requests
import six
import webob
from django.utils.encoding import smart_text
from edx_user_state_client.interfac... | unknown | codeparrot/codeparrot-clean | ||
# Python test set -- math module
# XXXX Should not do tests around zero only
from test.test_support import run_unittest, verbose
import unittest
import math
import os
import sys
import random
import struct
eps = 1E-05
NAN = float('nan')
INF = float('inf')
NINF = float('-inf')
# decorator for skipping tests on non-IE... | unknown | codeparrot/codeparrot-clean | ||
"""Usage:
python compare.py <path to text file with annotated data> <path to config file>
"""
import sys
import os
import codecs
import csv
import logging
from collections import Counter
from bitext import Bitext
from chatterbox import Chatterbox
from datumbox import Datumbox
from lymbix import Lymbix
from repustate... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "action_view/helpers/tags/checkable"
module ActionView
module Helpers
module Tags # :nodoc:
class RadioButton < Base # :nodoc:
include Checkable
def initialize(object_name, method_name, template_object, tag_value, options)
@tag_value = tag_v... | ruby | github | https://github.com/rails/rails | actionview/lib/action_view/helpers/tags/radio_button.rb |
# 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 | ||
//===--- Conversion.cpp - LSP data (de-)serialization through XPC - C++ -*-===//
//
// 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/clangd/xpc/Conversion.cpp |
// SPDX-License-Identifier: GPL-2.0
#include <linux/mm.h>
#include <linux/rmap.h>
#include <linux/hugetlb.h>
#include <linux/swap.h>
#include <linux/leafops.h>
#include "internal.h"
static inline bool not_found(struct page_vma_mapped_walk *pvmw)
{
page_vma_mapped_walk_done(pvmw);
return false;
}
static bool map_pt... | c | github | https://github.com/torvalds/linux | mm/page_vma_mapped.c |
#! /usr/bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
# Handle #define macros with one argument.
# Anything that isn't recognized or doesn't translate into valid
# Python is ignored.
# Without filename arguments, acts as a filter.
# If one or more filenames are given, out... | unknown | codeparrot/codeparrot-clean | ||
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2002 Gary Shao
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2009 Gary Burton
#
# This program is free software; you can redistribute i... | unknown | codeparrot/codeparrot-clean | ||
"""
media-storage : compression
===========================
Offers efficient handlers for compressing and decompressing data, using
file-like objects (often tempfiles).
This module is shared by every Python facet of the media-storage project and
changes to one instance should be reflected in all.
Usage
-----
(De)co... | 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
"""
Segment a .po file to produce smaller files based on the locations of the
messages.
"""
import copy
import fnmatch
import logging
import sys
import argparse
import polib
import textwrap
from i18n.config import CONFIGURATION
LOG = logging.getLogger(__name__)
def segment_pofiles(locale):
... | unknown | codeparrot/codeparrot-clean | ||
"""
The MIT License
Copyright (c) 2007 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 without restriction, including without limitation the right... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import traceback
from shadowsocks import shell, common
from configloader import load_config, get_config
import random
import getopt
import sys
import json
import base64
class MuJsonLoader(object):
def __init__(self):
self.json = None
def load(self, path):
l = "[]"
tr... | unknown | codeparrot/codeparrot-clean | ||
from setuptools import setup, find_packages
import os.path
def project_path(*names):
return os.path.join(os.path.dirname(__file__), *names)
setup(
name='zeit.retresco',
version='1.32.3.dev0',
author='gocept, Zeit Online',
author_email='zon-backend@zeit.de',
url='http://www.zeit.de/',
descr... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
import time
import logging
import datetime
import numpy as np
from data import *
from time import clock
from parameters import *
from collections import defaultdict
spike_generators = {} # dict name_part : spikegenerator
spike_detectors = {} # dict name_part : spikedetector
multimeters = {} ... | unknown | codeparrot/codeparrot-clean | ||
---
applies_to:
stack:
serverless:
navigation_title: "Commands"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-commands.html
---
# {{esql}} commands [esql-commands]
{{esql}} commands come in two flavors: source commands and processing commands:
- An {{esql}} query must sta... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/esql-commands.md |
#
# Unpacker for Dean Edward's p.a.c.k.e.r, a part of javascript beautifier
# by Einar Lielmanis <einar@jsbeautifier.org>
#
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
# usage:
#
# if detect(some_string):
# unpacked = unpack(some_string)
#
"""Unpacker for Dean Edward's p.a.c.k.e.r"""
import r... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, print_function, division
import numpy
import theano
from theano.misc.cudamat_utils import cudamat_available
if not cudamat_available: # noqa
from nose.plugins.skip import SkipTest
raise SkipTest("gnumpy not installed. Skip test of theano op with pycuda "
... | unknown | codeparrot/codeparrot-clean | ||
---
navigation_title: "Bucket script"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-script-aggregation.html
---
# Bucket script aggregation [search-aggregations-pipeline-bucket-script-aggregation]
A parent pipeline aggregation which executes a sc... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/aggregations/search-aggregations-pipeline-bucket-script-aggregation.md |
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <ATen/functorch/BatchRulesHelper.h>
#include <ATen/WrapDimUtils.h>
namespace at::functorch {
Tens... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/functorch/BatchRulesHelper.cpp |
"""
A test spanning all the capabilities of all the serializers.
This class sets up a model for each model field type
(except for image types, because of the PIL dependency).
"""
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
# ... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Union
from typing_extensions import Annotated, TypeAlias
from ...._utils import PropertyInfo
from .text_content_block import TextContentBlock
from .refusal_content_block import RefusalContentBlock
from .image_url_... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/threads/message_content.py |
"""This module implements additional tests ala autoconf which can be useful.
"""
from __future__ import division, absolute_import, print_function
# We put them here since they could be easily reused outside numpy.distutils
def check_inline(cmd):
"""Return the inline identifier (may be empty)."""
cmd._check_c... | unknown | codeparrot/codeparrot-clean | ||
import logging
import sys
import time
import os
import cv2
import numpy as np
def center_crop(img, out_height, out_width):
height, width, _ = img.shape
left = int((width - out_width) / 2)
right = int((width + out_width) / 2)
top = int((height - out_height) / 2)
bottom = int((height + out_height) /... | unknown | codeparrot/codeparrot-clean | ||
//===- bolt/Passes/AsmDump.h - Dump BinaryFunction as assembly --*- C++ -*-===//
//
// 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
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | bolt/include/bolt/Passes/AsmDump.h |
import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
... | unknown | codeparrot/codeparrot-clean | ||
package benchmarks.flow.scrabble;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import hu.akarnokd.rxjava2.math.MathFlowable;
import org.openjdk.jmh.annotations.*;
import benchmarks.flow.scrabble.optimizations.*;
import io.reactivex.*;
import io.reactivex.functions.Function;
/... | java | github | https://github.com/Kotlin/kotlinx.coroutines | benchmarks/src/jmh/java/benchmarks/flow/scrabble/RxJava2PlaysScrabbleOpt.java |
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include <spdlog/cfg/helpers.h>
#include <spdlog/details/os.h>
#include <spdlog/details/registry.h>
//
// Init levels and patterns from env variables SPDLOG_LEVEL
// ... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/spdlog/include/spdlog/cfg/env.h |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Grid Dynamics
# Copyright 2011 OpenStack LLC.
# 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
#
#... | 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/kubelet/oom/types.go |
#!/usr/bin/python
#
# (c) Quentin Stafford-Fraser and Andy Baker 2015
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Create webfaction mailbox using Ansible and the Webfaction API
from __future__ import absolute_import, division, print_function
__metaclass__ = type
AN... | unknown | codeparrot/codeparrot-clean | ||
"""
Contains various definitions common to modules acquired from 4Suite
"""
__all__ = ["FtException", "get_translator"]
class FtException(Exception):
def __init__(self, errorCode, messages, args):
# By defining __str__, args will be available. Otherwise
# the __init__ of Exception sets it to the ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/requests/InitProducerIdRequest.java |
# Copyright 2020 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... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tests/cast_ops_test.py |
# Copyright (c) 2012 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disclaimer.... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import numpy as np
from pprint import pprint
from datetime import datetime
import mysql.connector
import pickle
import math
instrument = 'UBCSP2' #'UBCSP2' #ECSP2
instrument_locn = 'WHI' #'WHI' POLAR6
#this script will run through all the .ptxt files for the WHI data and put the info into the myS... | unknown | codeparrot/codeparrot-clean | ||
"""
Test saved subsection grade functionality.
"""
# pylint: disable=protected-access
import datetime
import itertools
import ddt
import pytz
from django.conf import settings
from mock import patch
from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory
from courseware.access import has_access
f... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from codecs import register_error, xmlcharrefreplace_errors
from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . im... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 NEC Corporation. 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 ... | unknown | codeparrot/codeparrot-clean | ||
import os
import re
from django.contrib.gis.db.models import Extent3D, Union
from django.contrib.gis.db.models.functions import (
AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate,
)
from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon
from django.test import TestCase, skipUnlessDBFeatu... | unknown | codeparrot/codeparrot-clean | ||
from django.http import HttpResponseRedirect
try:
from urllib.parse import urlencode, parse_qs, urlsplit, urlunsplit
except ImportError:
from urlparse import parse_qs, urlsplit, urlunsplit
from urllib import urlencode
class SmoothNavigationMiddleware(object):
def process_response(self, request, respon... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2024 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION:
module: with_yaml
short_description: Short description
description: Long description
options: {}
author:
- Ansible Core Team (@ansible)
EXAMPLES: |
- name: S... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/ansible-test-sanity-action-plugin-docs/ansible_collections/ns/col/plugins/modules/with_yaml.yaml |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package stackeval
import (
"context"
"strings"
"testing"
"github.com/davecgh/go-spew/spew"
"github.com/google/go-cmp/cmp"
"github.com/zclconf/go-cty-debug/ctydebug"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackruntime/internal/stackeval/provider_test.go |
import unittest
from test.test_support import requires
from Tkinter import Tk, Text, TclError
import idlelib.AutoComplete as ac
import idlelib.AutoCompleteWindow as acw
import idlelib.macosxSupport as mac
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Event
class AutoCompleteWindow... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Encryption;
use RuntimeException;
class MissingAppKeyException extends RuntimeException
{
/**
* Create a new exception instance.
*
* @param string $message
*/
public function __construct($message = 'No application encryption key has been specified.')
{
... | php | github | https://github.com/laravel/framework | src/Illuminate/Encryption/MissingAppKeyException.php |
# -*- coding: utf-8 -*-
#
# shr.im * just an URL shortener
# Copyright (C) 2009 Camille Bouiller <aftercem@gmail.com>
# Copyright (C) 2009 Rémy Hubscher <natim@users.sf.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Flood Alerts Module - Model
@author: Fran Boon
@see: http://eden.sahanafoundation.org/wiki/Pakistan
"""
module = "flood"
if deployment_settings.has_module(module):
# -----------------------------------------------------------------------------
# Rivers
resourcenam... | unknown | codeparrot/codeparrot-clean | ||
/* Rax -- A radix tree implementation.
*
* Copyright (c) 2017-Present, Redis Ltd.
* All rights reserved.
*
* Licensed under your choice of (a) the Redis Source Available License 2.0
* (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the
* GNU Affero General Public License v3 (AGPLv3).
*/
#in... | c | github | https://github.com/redis/redis | src/rax.c |
# Copyright 2017, Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
const getStaticPaths = () => {
return []
}
export { getStaticPaths }
export default function Test() {
return <div />
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/ssg/getStaticProps/should-remove-re-exported-variable-declarations/input.js |
#pragma once
#include <ATen/core/Tensor.h>
#include <ATen/core/IListRef.h>
#include <ATen/Dispatch.h>
#include <ATen/TensorIterator.h>
#include <ATen/native/Activation.h>
#include <ATen/native/DispatchStub.h>
namespace at::native {
using qrelu_fn = void (*)(const at::Tensor& /*qx*/, at::Tensor& /*qy*/);
using qrelu_l... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/QuantizedOps.h |
"""
This page is in the table of contents.
The gts.py script is an import translator plugin to get a carving from an gts file.
An import plugin is a script in the interpret_plugins folder which has the function getCarving. It is meant to be run from the interpret tool. To ensure that the plugin works on platforms wh... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear... | c | github | https://github.com/opencv/opencv | 3rdparty/libtiff/tif_thunder.c |
'''OpenGL extension NV.vertex_program4
This module customises the behaviour of the
OpenGL.raw.GL.NV.vertex_program4 to provide a more
Python-friendly API
Overview (from the spec)
This extension builds on the common assembly instruction set
infrastructure provided by NV_gpu_program4, adding vertex program-specific
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that LD_DYLIB_INSTALL_NAME and DYLIB_INSTALL_NAME_BASE are handled
correctly.
"""
import TestGyp
import re
import subprocess
... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 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/data/compression_utils.h |
{
"description": "tests adding and removing elements from a simple set",
"include_files": [],
"ignore_fields": {}
} | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/tests/basic_set_update/spec.json |
# dump_link.py - dumps information about shell shortcuts
#
import sys, os
from win32com.shell import shell, shellcon
import pythoncom
import glob
from win32com.storagecon import *
def DumpLink(fname):
shellLink = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellL... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <stdlib.h>
#include <pytorch_qnnpack.h>
#include <qnnpack/operator.h>
enum pytorch_qnnp_st... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/operator-delete.c |
"""Define the menu contents, hotkeys, and event bindings.
There is additional configuration information in the EditorWindow class (and
subclasses): the menus are created there based on the menu_specs (class)
variable, and menus not created are silently skipped in the code here. This
makes it possible, for example, to... | python | github | https://github.com/python/cpython | Lib/idlelib/mainmenu.py |
#!/usr/bin/python
from threading import Timer
import pyupm_grove as grove
import pyupm_ttp223 as ttp
# Pins used in Grove kit.
EMERGENCY_BUTTON = 3
ALERT_LED = 4
# Alarm status.
ON = True
OFF = False
alarm_status_list = {ON: "on",
OFF: "off"}
# Succes code for Bluetooth commands.
SUCCESS_CODE =... | unknown | codeparrot/codeparrot-clean | ||
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"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/transforms/v1beta1.reuse.v42.json |
# frozen_string_literal: true
module ActionMailbox
class Record < ActiveRecord::Base # :nodoc:
self.abstract_class = true
end
end
ActiveSupport.run_load_hooks :action_mailbox_record, ActionMailbox::Record | ruby | github | https://github.com/rails/rails | actionmailbox/app/models/action_mailbox/record.rb |
from pyGBot.Plugins.games.fluxxfiles.game import Card, CardPile, Player, pretty_print_list
class FluxxGame(object):
is_removable = False
def __init__(self):
from pyGBot.Plugins.games.fluxxfiles.deck import FluxxDeck
self.started = False
self.finished = False
self.debug = False... | unknown | codeparrot/codeparrot-clean | ||
#ifndef BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_archive.hpp:
// (C) Copyright 2002 Robert Ramey - http:/... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/archive/basic_archive.hpp |
# 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
# d... | unknown | codeparrot/codeparrot-clean | ||
from copy import deepcopy
from typing import Dict, List, TypeVar
from .frozen_error import FrozenError
__all__ = ["FrozenList"]
T = TypeVar("T", covariant=True)
class FrozenList(List[T]):
"""List that can only be read, but not changed."""
def __delitem__(self, key):
raise FrozenError
def __set... | unknown | codeparrot/codeparrot-clean | ||
from flask import Flask, request, render_template, Response
import json
import time
from bson.json_util import dumps
from pymongo import MongoClient
from flask_cors import CORS, cross_origin
app = Flask(__name__, static_url_path='/static')
CORS(app)
client = MongoClient()
db = client['nearby']
# @app.route("/")
# def... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// 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/cppcoreguidelines/VirtualClassDestructorCheck.cpp |
# frozen_string_literal: true
require "cases/helper"
require "models/author"
require "models/categorization"
require "models/comment"
require "models/developer"
require "models/computer"
require "models/post"
require "models/project"
require "models/rating"
class RelationMergingTest < ActiveRecord::TestCase
fixture... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/relation/merging_test.rb |
# Copyright 2012 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 requ... | unknown | codeparrot/codeparrot-clean | ||
import alpenglow.Getter as rs
import alpenglow as prs
class NearestNeighborExperiment(prs.OnlineExperiment):
"""NearestNeighborExperiment(gamma=0.8,direction="forward",gamma_threshold=0,num_of_neighbors=10)
This class implements an online version of a similarity based recommendation model.
One of the earl... | unknown | codeparrot/codeparrot-clean | ||
#pylint: disable=C0111
#pylint: disable=W0621
# Lettuce formats proposed definitions for unimplemented steps with the
# argument name "step" instead of "_step" and pylint does not like that.
#pylint: disable=W0613
from lettuce import world, step
from nose.tools import assert_true, assert_in # pylint: disable=E0611
... | 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 (includ... | c | github | https://github.com/mysql/mysql-server | include/lex_string.h |
# pylint: disable=pointless-string-statement
# Copyright (c) 2013 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
#
# U... | unknown | codeparrot/codeparrot-clean | ||
{
"$ref": "./ModuleFederationPlugin.json#/definitions/ExternalsType"
} | json | github | https://github.com/webpack/webpack | schemas/plugins/container/ExternalsType.json |
import sys
sys.path.insert(1, "../../../")
import h2o
import random
def grid_lambda_search(ip,port):
# Log.info("Importing prostate.csv data...\n")
prostate = h2o.import_file(path=h2o.locate("smalldata/logreg/prostate.csv"))
#prostate.summary()
# Log.info("H2O GLM (binomial) with parameters: alpha = c(0.25,... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Scrapy settings for cwlinkedinemail project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/e... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# Copyright: (c) 2014, Epic Games, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, divisio... | unknown | codeparrot/codeparrot-clean | ||
import Image
import ImageChops
import ImageFilter
import sys
import os
import traceback
from athana import getTALstr
import random
import md5
filenames = []
directories = ["pdfs"]
SWFRENDER="swfrender"
PDFTOPPM="./pdftoppm"
CONVERT="convert"
PDF2SWF="pdf2swf"
COMPARE=["xpdf", "xpdf -C"]
OUTPUTDIR = "results.clip/"
... | unknown | codeparrot/codeparrot-clean | ||
""" ESC/POS Exceptions classes """
import os
class Error(Exception):
""" Base class for ESC/POS errors """
def __init__(self, msg, status=None):
Exception.__init__(self)
self.msg = msg
self.resultcode = 1
if status is not None:
self.resultcode = status
def __st... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package aws
import (
"context"
"fmt"
"net/http"
"time"
"github.com/fatih/structs"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
)
const (
pathStaticCreds = "static-creds"
paramAccessKeyID = "a... | go | github | https://github.com/hashicorp/vault | builtin/logical/aws/path_static_creds.go |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "v11.no-op-migration.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "grafana",
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dashboards_from_v0_to_v2/v2beta1.v11.no-op-migration.json |
from __future__ import unicode_literals
from .cbs import CBSBaseIE
class CBSSportsIE(CBSBaseIE):
_VALID_URL = r'https?://(?:www\.)?cbssports\.com/video/player/[^/]+/(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.cbssports.com/video/player/videos/708337219968/0/ben-simmons-the-next-lebron?-not-so-fast',
... | unknown | codeparrot/codeparrot-clean | ||
"""
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | unknown | codeparrot/codeparrot-clean | ||
import React, { Component } from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Button, ButtonGroup } from 'reactstrap';
import Filter, { FilterData, FilterProps } from './Filter';
import sinon, { SinonSpy } from 'sinon';
describe('Filter', () => {
const initialExpanded = {
scrapePool1: true... | typescript | github | https://github.com/prometheus/prometheus | web/ui/react-app/src/pages/targets/Filter.test.tsx |
//// [tests/cases/conformance/Symbols/ES5SymbolProperty2.ts] ////
//// [ES5SymbolProperty2.ts]
namespace M {
var Symbol: any;
export class C {
[Symbol.iterator]() { }
}
(new C)[Symbol.iterator];
}
(new M.C)[Symbol.iterator];
//// [ES5SymbolProperty2.js]
"use strict";
var M;
(function (M) {
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ES5SymbolProperty2(target=es2015).js |
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | unknown | codeparrot/codeparrot-clean | ||
from boto.swf.exceptions import SWFResponseError
from freezegun import freeze_time
from sure import expect
from moto.swf.models import DecisionTask, Timeout
from moto.swf.exceptions import SWFWorkflowExecutionClosedError
from ..utils import make_workflow_execution, process_first_timeout
def test_decision_task_creati... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Susanna Aro <susanna.aro@aalto.fi>
# Roman Goj <roman.goj@gmail.com>
#
# License: BSD (3-clause)
import copy as cp
import numbers
import numpy as np
from .tfr import cwt, morlet
from ..fixes import rfftfreq
from ..io.pick... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import os
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, override_settings
from .cases import StaticFilesTestCase
from .settings import TES... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Android system-wide tracing utility.
This is a tool for capturing a trace that includes data from both userland and
the kernel... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas import (
NA,
Categorical,
CategoricalDtype,
CategoricalIndex,
DatetimeIndex,
Interval,
NaT,
Period,
Timestamp,
array,
to_datetime,
)
import pandas._testing as tm
class TestAstype:
@py... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/arrays/categorical/test_astype.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.