code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
unknown
codeparrot/codeparrot-clean
--- !ELF FileHeader: Class: ELFCLASS64 Data: ELFDATA2LSB Type: ET_EXEC Machine: EM_X86_64 Entry: 0x4010A0 ProgramHeaders: - Type: PT_PHDR Flags: [ PF_R ] VAddr: 0x400040 Align: 0x8 Offset: 0x4...
unknown
github
https://github.com/llvm/llvm-project
bolt/test/X86/Inputs/build_id.yaml
#pragma once #include <math.h> #include <stdint.h> #if defined(_WIN32) && !defined (__MINGW32__) #define inline __forceinline #endif #define RK_STATE_LEN 624 #define _MT19937_N 624 #define _MT19937_M 397 #define MATRIX_A 0x9908b0dfUL #define UPPER_MASK 0x80000000UL #define LOWER_MASK 0x7fffffffUL typedef struct s_m...
c
github
https://github.com/numpy/numpy
numpy/random/src/mt19937/mt19937.h
from .flag import FlagMetaclass from .value import ZERO from .tags import has_tag, get_tag class Filter(object, metaclass=FlagMetaclass): flags = [] def __init__(self, predicate): self.predicate = predicate def __call__(self, *args): return self.predicate(*args) def __and__(self, oth...
unknown
codeparrot/codeparrot-clean
# (c) 2013, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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, ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ Copyright (C) 2010 Stephen Georg 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....
unknown
codeparrot/codeparrot-clean
import path from "pathe"; export function isReactRouterRepo() { // We use '@react-router/node' for this check since it's a // dependency of this package and guaranteed to be in node_modules let serverRuntimePath = path.dirname( require.resolve("@react-router/node/package.json"), ); let serverRuntimeParen...
typescript
github
https://github.com/remix-run/react-router
packages/react-router-dev/config/is-react-router-repo.ts
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json, os import frappe.permissions from frappe.utils.csvutils import UnicodeWriter from frappe.utils import cstr, cint, flt from frappe.core.page.data_import_t...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Tests for the account API. """ import re from unittest import skipUnless from nose.tools import raises from mock import patch import ddt from dateutil.parser import parse as parse_datetime from django.core import mail from django.test import TestCase from django.conf import settings from ...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 Viewfinder Inc. All Rights Reserved. # -*- coding: utf-8 -*- __author__ = 'spencer@emailscrubbed.com (Spencer Kimball)' import datetime import json import time from viewfinder.backend.base import util from viewfinder.backend.base.testing import async_test from viewfinder.backend.db.client_log import...
unknown
codeparrot/codeparrot-clean
def getDefaultGateway(): f = open("/proc/net/route", "r") if f: for line in f.readlines(): tokens = line.split('\t') if tokens[1] == '00000000': #dest 0.0.0.0 return int(tokens[2], 16) return None def getTelephone(): f = open("/etc/ppp/options", "r") if f: for line in f.readlines(): if line.find(...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations from typing import TYPE_CHECKING import pytest from scrapy.http import Request, Response from scrapy.spidermiddlewares.depth import DepthMiddleware from scrapy.spiders import Spider from scrapy.utils.test import get_crawler if TYPE_CHECKING: from collections.abc import Generat...
python
github
https://github.com/scrapy/scrapy
tests/test_spidermiddleware_depth.py
An inner doc comment was used in an invalid context. Erroneous code example: ```compile_fail,E0753 fn foo() {} //! foo // ^ error! fn main() {} ``` Inner document can only be used before items. For example: ``` //! A working comment applied to the module! fn foo() { //! Another working comment! } fn main() {} `...
unknown
github
https://github.com/rust-lang/rust
compiler/rustc_error_codes/src/error_codes/E0753.md
# pylint: disable=g-bad-file-header # Copyright 2016 The Bazel 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 ...
unknown
codeparrot/codeparrot-clean
#if defined __AVX512__ || defined __AVX512F__ #include <immintrin.h> void test() { __m512i zmm = _mm512_setzero_si512(); #if defined __GNUC__ && defined __x86_64__ asm volatile ("" : : : "zmm16", "zmm17", "zmm18", "zmm19"); #endif } #else #error "AVX512 is not supported" #endif int main() { return 0; }
cpp
github
https://github.com/opencv/opencv
cmake/checks/cpu_avx512.cpp
from django.forms.models import inlineformset_factory from django.test import TestCase from regressiontests.inline_formsets.models import Poet, Poem, School, Parent, Child class DeletionTests(TestCase): def test_deletion(self): PoemFormSet = inlineformset_factory(Poet, Poem, can_delete=True) poet...
unknown
codeparrot/codeparrot-clean
import h2o_cmd, h2o_util import h2o2 as h2o import re, random, math from h2o_test import check_sandbox_for_errors, dump_json, verboseprint import h2o_nodes from tabulate import tabulate # recursive walk an object check that it has valid numbers only (no "" or nan or inf def check_obj_has_good_numbers(obj, hierarchy=""...
unknown
codeparrot/codeparrot-clean
""" Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). T...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from operator import attrgetter from django.core.exceptions import FieldError from django.core.management import call_command from django.db import connection from django.test import TestCase from django.test.utils import CaptureQueriesContext from django.utils import six from...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import sys import argparse from fastavro import writer parser = argparse.ArgumentParser() parser.add_argument('output_file', help='Output Avro data file') parser.add_argument('--num_records', dest='num_records', default=1024, type=int, help='Number of records to generate (default: 1024)') parser....
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'StatusCheck.created_by' db.alter_column('cabotapp_statuscheck', 'created_by_id', self.gf('...
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...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/TokenInfo.java
""" The file is responsable for cart in flask-webpage """ from flask import current_app as app from flask_seguro.products import Products class Cart(object): """ The classe is responsable for cart in webpage """ def __init__(self, cart_dict=None): """ Initializing class """ cart_dict = cart_...
unknown
codeparrot/codeparrot-clean
"use strict"; const BinaryMiddleware = require("../lib/serialization/BinaryMiddleware"); const SerializerMiddleware = require("../lib/serialization/SerializerMiddleware"); const cont = (base, count) => { const result = []; for (let i = 0; i < count; i++) { result.push(base[i % base.length]); } return result; };...
javascript
github
https://github.com/webpack/webpack
test/BinaryMiddleware.unittest.js
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Asset; use Symfony\Component\Asset\Context\ContextInt...
php
github
https://github.com/symfony/symfony
src/Symfony/Component/Asset/UrlPackage.php
""" Support for LiteJet scenes. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/scene.litejet/ """ import logging import homeassistant.components.litejet as litejet from homeassistant.components.scene import Scene DEPENDENCIES = ['litejet'] ATTR_NUMBER...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher (clemens.prescher@gmail.com) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
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...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/oncrpc/TestRpcReply.java
# # Symbol Table # import copy import re from Errors import warning, error, InternalError from StringEncoding import EncodedString import Options, Naming import PyrexTypes from PyrexTypes import py_object_type, unspecified_type from TypeSlots import \ pyfunction_signature, pymethod_signature, \ get_special_m...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
unknown
codeparrot/codeparrot-clean
#include <ATen/native/transformers/attention.h> #include <ATen/native/transformers/sdp_utils_cpp.h> #include <ATen/native/transformers/xpu/flash_attn/flash_api.h> namespace at { namespace native { std::tuple< Tensor, Tensor, Tensor, Tensor, c10::SymInt, c10::SymInt, Tensor, Tensor, ...
cpp
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/transformers/xpu/attention.cpp
#ifndef COMP_CREATOR_INCLUDED #define COMP_CREATOR_INCLUDED /* Copyright (c) 2019, 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...
c
github
https://github.com/mysql/mysql-server
sql/comp_creator.h
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Sqrt from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class SqrtTests(TestCase): def test_null(self):...
unknown
codeparrot/codeparrot-clean
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
unknown
codeparrot/codeparrot-clean
use std::iter::FromIterator; use gccjit::{BinaryOp, RValue, ToRValue, Type}; #[cfg(feature = "master")] use gccjit::{ComparisonOp, UnaryOp}; use rustc_abi::{Align, Size}; use rustc_codegen_ssa::base::compare_simd_types; use rustc_codegen_ssa::common::{IntPredicate, TypeKind}; #[cfg(feature = "master")] use rustc_codeg...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_codegen_gcc/src/intrinsic/simd.rs
from typing import Any from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever from typing_extensions import override class SequentialRetriever(BaseRetriever): """Test util that returns a sequence of documents.""" sequential_responses: list[list[Document]] respon...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/tests/unit_tests/retrievers/sequential_retriever.py
import os class NodeGroups(object): def __init__(self): if os.path.isfile('/etc/salt/master.d/nodegroups.conf') == True: print "" else: nodegroups = file("/etc/salt/master.d/nodegroups.conf","w+") add = ["nodegroups:\n"] nodegroups.writelines(add) ...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python3 import sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import re from matplotlib.lines import Line2D # # First, use # ./postprocessing.py > postprocessing_output.txt # to generate the .txt file # fig, ax = plt.subplots(figsize=(10,7)) ax.set_xscale("log", nonpos...
unknown
codeparrot/codeparrot-clean
# PyGEGL - Python bindings for the GEGL image processing library # Copyright (C) 2007 Manish Singh # # __init__.py: initialization file for the Gegl package # # PyGEGL 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 Softw...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2020 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 import pytest from ansible.errors import AnsibleError from ansible.galaxy.col...
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...
unknown
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/site/markdown/release/2.0.5-alpha/CHANGELOG.2.0.5-alpha.md
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
unknown
codeparrot/codeparrot-clean
//===- bolt/Passes/IdenticalCodeFolding.h -----------------------*- 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/IdenticalCodeFolding.h
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/framework/kernel_def.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobu...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package schema import ( "reflect" "testing" "github.com/hashicorp/terraform/internal/legacy/terraform" ) func TestDiffFieldReader_impl(t *testing.T) { var _ FieldReader = new(DiffFieldReader) } func TestDiffFieldReader_NestedSetUpdate(t *tes...
go
github
https://github.com/hashicorp/terraform
internal/legacy/helper/schema/field_reader_diff_test.go
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) 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 License, ...
unknown
codeparrot/codeparrot-clean
import serial import string import math import time from Tkinter import * from threading import Timer comPort = '/dev/ttyACM0' #default com port comPortBaud = 38400 class App: grid_size = 15 num_pixels = 30 image_started = FALSE image_current_row = 0; ser = serial.Serial(comPort, comPortBaud) ...
unknown
codeparrot/codeparrot-clean
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
python
github
https://github.com/huggingface/transformers
src/transformers/models/dinov2/__init__.py
""" make gifti images for participation index and correlations with behav variables """ import os,sys import numpy import nibabel.gifti.giftiio from myconnectome.utils import labels_to_gii,load_dataframe basedir=os.environ['MYCONNECTOME_DIR'] rsfmridir=os.path.join(basedir,'rsfmri') def mk_participation_index_giftis...
unknown
codeparrot/codeparrot-clean
import datetime import logging import multiprocessing import os import secrets import shutil from typing import Any, Dict, Iterable, List, Optional, Tuple import orjson from bs4 import BeautifulSoup from django.conf import settings from django.core.cache import cache from django.db import connection from django.utils....
unknown
codeparrot/codeparrot-clean
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.timeline import async_slice from telemetry.timeline import model as model_module from telemetry.web_perf.metrics import maint...
unknown
codeparrot/codeparrot-clean
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholiqu...
c
github
https://github.com/opencv/opencv
3rdparty/openjpeg/openjp2/cio.h
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/clients/admin/internals/AdminFetchMetricsManagerTest.java
{ "applyable": true, "complete": true, "configuration": { "provider_config": { "tfcoremock": { "full_name": "registry.terraform.io/hashicorp/tfcoremock", "name": "tfcoremock", "version_constraint": "0.1.1" } }, "root_module": { "resources": [ { ...
json
github
https://github.com/hashicorp/terraform
testing/equivalence-tests/outputs/replace_within_map/plan.json
/* 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/apis/admissionregistration/types.go
#! /usr/bin/env python3 """ combinerefs path A helper for analyzing PYTHONDUMPREFS output. When the PYTHONDUMPREFS envar is set in a debug build, at Python shutdown time Py_Finalize() prints the list of all live objects twice: first it prints the repr() of each object while the interpreter is still fully intact. Af...
unknown
codeparrot/codeparrot-clean
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import numpy as np import pytest from scipy import linalg, sparse from scipy.linalg import eigh from scipy.sparse.linalg import eigsh from sklearn import config_context from sklearn.datasets import make_low_rank_matrix, m...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/utils/tests/test_extmath.py
--- navigation_title: "Reindex indices" mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html applies_to: stack: all serverless: ga --- # Reindex indices examples The [Reindex API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex) copies d...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/elasticsearch/rest-apis/reindex-indices.md
# Copyright 2014-2020 Scalyr 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
/* Copyright 2016 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/controller/certificates/approver/sarapprove.go
/*! * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/src/login/Login.test.tsx
# # CapTipper is a malicious HTTP traffic explorer tool # By Omri Herscovici <omriher AT gmail.com> # http://omriher.com # @omriher # # # This file is part of CapTipper, and part of the Whatype library # Whatype is an independent file type identification python libr...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # Li...
unknown
codeparrot/codeparrot-clean
--- navigation_title: "Distance feature" mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-distance-feature-query.html --- # Distance feature query [query-dsl-distance-feature-query] Boosts the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#rel...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/query-dsl/query-dsl-distance-feature-query.md
## +block def indented_block(self): print(f"Indent-dependent {self.tag} block started") start_O_line = self.O.line_number block_indent = self.I.indent_count + 1 if self.offset: self.O.offset -= block_indent #Opening block self.opening_tag() #Main block loop while 1: loop_line = self.I.line_number index...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python import os import sys import subprocess import re import mmap import string EVENT_NAME_PREFIX = "com.facebook.buck.artifact_cache." RULE_KEY_KEY = 'rulekey' TIMESTAMP_KEY = 'timestamp' EVENT_NAME_KEY = 'event_name' RESULT_KEY = 'result' INFO_KEY = 'info' class Entry(object): def __init__(self, r...
unknown
codeparrot/codeparrot-clean
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2010 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 ...
unknown
codeparrot/codeparrot-clean
"""The collection of modern alternatives to deprecated & removed functionality. Collects specimens of old ORM code and explicitly covers the recommended modern (i.e. not deprecated) alternative to them. The tests snippets here can be migrated directly to the wiki, docs, etc. """ from sqlalchemy import Integer, Strin...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python2.4 # Copyright 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...
unknown
codeparrot/codeparrot-clean
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # # 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; eith...
unknown
codeparrot/codeparrot-clean
# -*- test-case-name: twisted.test.test_plugin -*- # Copyright (c) 2005 Divmod, Inc. # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Plugin system for Twisted. @author: Jp Calderone @author: Glyph Lefkowitz """ import os import sys from zope.interface import Interface, providedBy def _d...
unknown
codeparrot/codeparrot-clean
// (C) Copyright Tobias Schwinger // // Use modification and distribution are subject to the boost Software License, // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). //------------------------------------------------------------------------------ #ifndef BOOST_FT_IS_FUNCTION_POINTER_HPP_INCLUDED #define BO...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/function_types/is_function_pointer.hpp
""" This script is publically available from the web page given below. It is not part of the live coding package but is included for the sake of completeness. Author: Tim Golden Source: http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html From recipe page: The approach here is to use ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ usage: %prog species1,species2,... nrequired < maf """ import sys import bx.align.maf from bx.cookbook import doc_optparse SPAN = 100 MIN = 100 def main(): options, args = doc_optparse.parse(__doc__) try: species = args[0].split(',') nrequired = int(args[1]) e...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 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
#! /usr/bin/env python # ---------------------------------------------------------------------- # Copyright (C) 2010, Numenta Inc. All rights reserved. # # The information and source code contained herein is the # exclusive property of Numenta Inc. No part of this software # may be used, reproduced, stored or distr...
unknown
codeparrot/codeparrot-clean
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 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 # # ...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import datetime import pickle import unittest from collections import OrderedDict from operator import attrgetter from django.core.exceptions import FieldError from django.db import DEFAULT_DB_ALIAS, connection from django.db.models import F, Q, Count from django.db.models.sql....
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2013 by Clearcode <http://clearcode.cc> # and associates (see AUTHORS). # This file is part of pytest-dbfixtures. # pytest-dbfixtures 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, ei...
unknown
codeparrot/codeparrot-clean
''' This bottle-sqlalchemy plugin integrates SQLAlchemy with your Bottle application. It connects to a database at the beginning of a request, passes the database handle to the route callback and closes the connection afterwards. The plugin inject an argument to all route callbacks that require a `db` keyword. Usage ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' from tinycss.css21 import CSS21Parser, ParseError class FontFaceRule(object...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd. F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_...
unknown
codeparrot/codeparrot-clean
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/kernels/data/prefetch_autotuner.h
#!/usr/bin/env python # -*- coding: utf-8 -*- # CAVEAT UTILITOR # # This file was automatically generated by Grako. # # https://pypi.python.org/pypi/grako/ # # Any changes you make to it will be overwritten the next time # the file is generated. from __future__ import print_function, division, absolute_import, uni...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # BigBrother # Copyright 2017, Federico Lolli aka Mr.Robot # :todo: # add db manipulation database import sqlite3 as lite from core.globals import vars import sys class DBHandler(object): def __init__(self): try: self.con = lite.connect(vars.db_path) ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """Maximum flow algorithms test suite on large graphs. """ __author__ = """Loïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2010 Loïc Séguin-C. <loicseguin@gmail.com> # All rights reserved. # BSD license. import os from nose.tools import * import networkx as nx from networkx.algorithms...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 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 without ...
unknown
codeparrot/codeparrot-clean
# rhn-client-tools # # Copyright (c) 2006--2013 Red Hat, Inc. # # 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; version 2 of the License. # # This program is distributed in the hope th...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Queue; use Exception; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Schema\Blueprint; use Illuminate\Queue\Failed\DatabaseFailedJobProvider; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; use Illuminate\Support\Str; use PHPUnit\Framework\T...
php
github
https://github.com/laravel/framework
tests/Queue/DatabaseFailedJobProviderTest.php
// #docregion import {Component, computed, inject, input} from '@angular/core'; import {FormGroup, ReactiveFormsModule} from '@angular/forms'; import {DynamicFormQuestionComponent} from './dynamic-form-question.component'; import {QuestionBase} from './question-base'; import {QuestionControlService} from './question-...
typescript
github
https://github.com/angular/angular
adev/src/content/examples/dynamic-form/src/app/dynamic-form.component.ts
import unittest from xmodule.contentstore.content import StaticContent from xmodule.contentstore.content import ContentStore from xmodule.modulestore import Location class Content: def __init__(self, location, content_type): self.location = location self.content_type = content_type class ContentTe...
unknown
codeparrot/codeparrot-clean
import re import sys from django.core.management.color import no_style from django.db import transaction, models from django.db.utils import DatabaseError from django.db.backends.util import truncate_name from django.db.backends.creation import BaseDatabaseCreation from django.db.models.fields import NOT_PROVIDED from...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2005-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
unknown
codeparrot/codeparrot-clean
# Python Classes/Functions used to Import Tycho Datasets # ------------------------------------- # # Python Package Importing # # ------------------------------------- # # TO-DO: Add time back to the read state function for Tyler's code # Importing Necessary System Packages import math import io import ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # 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': ['preview'], ...
unknown
codeparrot/codeparrot-clean
# # (c) 2018, Sumit Kumar <sumit4@netapp.com>, chris Archibald <carchi@netapp.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
unknown
codeparrot/codeparrot-clean
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
unknown
codeparrot/codeparrot-clean