code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Title: AWG - Akemi's Word Game
# Author: Daniel Commins
# Date: June 13, 2015
# Files: AWG_App_py2.py; SINGLE.TXT (dictionary words file)
# Tested: python 2.61
# Info: Akemi's Word Game: The game where you try and guess the computer's randomly
# selected word! Each letter appears only once.
import sys
... | unknown | codeparrot/codeparrot-clean | ||
#
# Sequence builder dialog
#
# Authors:
# Gregory Fleischer (gfleischer@gmail.com)
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 Foundat... | unknown | codeparrot/codeparrot-clean | ||
"""Module/script to byte-compile all .py files to .pyc (or .pyo) files.
When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.
Without arguments, if compiles all modules on sys.path, without
recursing into subdir... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLINFO_PROXYAUTH_USED
Section: 3
Source: libcurl
See-also:
- CURLINFO_HTTPAUTH_USED (3)
- CURLINFO_PROXYAUTH_AVAIL (3)
- CURLOPT_HTTPAUTH (3)
Protocol:
- HTTP
Added-in: 8.12.0
---
# NAME
CURLINFO_PROXYAUTH_US... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md |
{
"properties": [
{
"name": "comment",
"value": "SBOM for MDB server product; this file should comply with the format specified here: https://cyclonedx.org/docs/1.5/json/#components_items_publisher; This file is still in development; see https://jira.mongodb.org/browse/DEVPROD-2623 for details."
}... | json | github | https://github.com/mongodb/mongo | buildscripts/tests/sbom_linter/inputs/sbom_script_file_missing.json |
# Pretty-printers for libstdc++.
# Copyright (C) 2008-2014 Free Software Foundation, 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; either version 3 of the License, or
# (at your option)... | unknown | codeparrot/codeparrot-clean | ||
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/env python
#------------------------------------------------------------------------
# Copyright (c) 1997-2001 by Total Control Software
# All Rights Reserved
#------------------------------------------------------------------------
#
# Module Name: dbShelve.py
#
# Description:... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* expandedrecord.c
* Functions for manipulating composite expanded objects.
*
* This module supports "expanded objects" (cf. expandeddatum.h) that can
* store values of named composite types, domains over named composite types,
* and... | c | github | https://github.com/postgres/postgres | src/backend/utils/adt/expandedrecord.c |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Module that allows for the extension of the hsm sideband archive."""
import os
from io import FileIO, BufferedReader, BufferedWriter
from .status import HsmSidebandStatus
from .orm import SamInode, SamFile, SamPath
def extended_hsmsideband_factory(filepath, mode, sam_qfs_pa... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
# $Id: test_multi6.py,v 1.6 2005/03/11 13:24:45 kjetilja Exp $
import sys, select, time
import pycurl
c1 = pycurl.Curl()
c2 = pycurl.Curl()
c3 = pycurl.Curl()
c1.setopt(c1.URL, "http://www.python.org")
c2.setopt(c2.URL, "http://curl.haxx.se")
c3.setopt(... | unknown | codeparrot/codeparrot-clean | ||
/* dfltcc_deflate.c - IBM Z DEFLATE CONVERSION CALL compression support. */
/*
Use the following commands to build zlib-ng with DFLTCC compression support:
$ ./configure --with-dfltcc-deflate
or
$ cmake -DWITH_DFLTCC_DEFLATE=1 .
and then
$ make
*/
#include "zbuild.h"
#include "def... | c | github | https://github.com/opencv/opencv | 3rdparty/zlib-ng/arch/s390/dfltcc_deflate.c |
#
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library.
# $Id: ArgImagePlugin.py 2309 2005-03-02 15:06:34Z fredrik $
#
# ARG animation support code
#
# history:
# 1996-12-30 fl Created
# 1996-01-06 fl Added safe scripting environment
# 1996-01-10 fl Added JHDR, UHDR and sYNC support
# 2005-03-02 fl Removed... | unknown | codeparrot/codeparrot-clean | ||
'''
Lowess testing suite.
Expected outcomes are generated by R's lowess function given the same
arguments. The R script test_lowess_r_outputs.R can be used to
generate the expected outcomes.
The delta tests utilize Silverman's motorcycle collision data,
available in R's MASS package.
'''
import os
import numpy as np... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/qcom,sm8250-camss.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm CAMSS ISP
maintainers:
- Robert Foss <robert.foss@linaro.org>
description: |
The CAMSS IP is a CSI decoder and... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/media/qcom,sm8250-camss.yaml |
#!/usr/bin/env python
#pylint: disable=missing-docstring
#################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment #
# #... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, get_codemirror_value
from nose.tools import assert_in # pylint: disable=no-name-in-module
@step(u'I go to the course update... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import matplotlib.pyplot as plt
depth = np.loadtxt('../data_files/underwater_structural_trades/depth.txt', delimiter = '\t')
A_tube = np.loadtxt('../data_files/underwater_structural_trades/A_tube.txt', delimiter = '\t')
t = np.loadtxt('../data_files/underwater_structural_trades/t.txt', delimiter = '... | unknown | codeparrot/codeparrot-clean | ||
/** @type {import('jest').Config} */
module.exports = {
...require("../../jest/jest.config.shared"),
displayName: "fs-routes",
setupFiles: [],
}; | javascript | github | https://github.com/remix-run/react-router | packages/react-router-fs-routes/jest.config.js |
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import float_or_none
class AzubuIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?azubu\.tv/[^/]+#!/play/(?P<id>\d+)'
_TESTS = [
{
'url': 'http://www.azubu.tv/GSL#!/play/15575/2014-hot6-c... | unknown | codeparrot/codeparrot-clean | ||
/* MIT License
*
* Copyright (c) John Schember
*
* 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 rights
* to use, copy, modify, me... | c | github | https://github.com/nodejs/node | deps/cares/src/lib/ares_android.c |
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# Based on func.py
# (c) 2014, Michael Scherer <misc@zarb.org>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt... | unknown | codeparrot/codeparrot-clean | ||
"""Perform realignment of BAM files around indels using the GATK toolkit.
"""
import os
import shutil
from contextlib import closing
import pysam
from bcbio import bam, broad
from bcbio.bam import ref
from bcbio.log import logger
from bcbio.utils import file_exists
from bcbio.distributed.transaction import file_trans... | unknown | codeparrot/codeparrot-clean | ||
//go:build windows
package libnetwork
import (
"context"
"fmt"
"net"
"net/http"
"net/netip"
"runtime"
"strings"
"sync"
"time"
"github.com/Microsoft/hcsshim"
"github.com/containerd/log"
"github.com/moby/moby/v2/daemon/libnetwork/drivers/windows"
winlibnetwork "github.com/moby/moby/v2/daemon/libnetwork/dr... | go | github | https://github.com/moby/moby | daemon/libnetwork/network_windows.go |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _, _dict
from erpnext.stock.get_item_details import get_item_details
from frappe.utils import getdate, cstr, flt, fmt_... | unknown | codeparrot/codeparrot-clean | ||
function Component(props) {
const x = makeOptionalFunction(props);
const y = makeObject(props);
const z = x?.(y.a, props.a, foo(y.b), bar(props.b));
return z;
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call.js |
# Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
from units.compat.mock import patch... | unknown | codeparrot/codeparrot-clean | ||
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | 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 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java |
benchmark:
vm_gc_short_lived: |
a = '' # short-lived String
b = ''
c = ''
d = ''
e = ''
f = ''
loop_count: 30000000 | unknown | github | https://github.com/ruby/ruby | benchmark/vm_gc_short_lived.yml |
import warnings
from typing import Any
__all__ = ['Event', 'InternalEvent', 'MetaEvent']
class Event:
"""
An event with a name and (optionally) some data passed as named parameters.
The list of parameters can be obtained using *dir(event)*. Notice that
*name* and *data* are reserved names. If a *dela... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithProtectedAnnotatedMember.java |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Haijie Xie @hai-x
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
/**
* @param {string} type unique identifier used for HMR runtime properties
* @returns {string} HMR runtime c... | javascript | github | https://github.com/webpack/webpack | lib/hmr/JavascriptHotModuleReplacementHelper.js |
from pysb.examples.robertson import model
import numpy as np
from pysb.integrate import Solver
import scipy.optimize
from pyDOE import *
import os
import sys
import numdifftools as nd
from matplotlib import pyplot as plt
import pickle
from pysb.sensitivity import Sensitivity
method_list = ['Nelder-Mead', 'Powell', 'CG... | unknown | codeparrot/codeparrot-clean | ||
# !/usr/bin/env python
"""
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")... | unknown | codeparrot/codeparrot-clean | ||
import subprocess
releases = {"3.0": "200703112",
"3.1": "200712072",
"3.2": "200808253",
"3.3": "200902041"}
def release2catverno(rno):
if not rno in releases.keys():
raise Exception("unknown version %s" % rno)
return releases[rno]
def stop_cluster():
p.subprocess.Popen(['gps... | unknown | codeparrot/codeparrot-clean | ||
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014 Alex Forencich
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 righ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/PrecommitTask.java |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
clas... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* CCM: Counter with CBC-MAC
*
* (C) Copyright IBM Corp. 2007 - Joy Latten <latten@us.ibm.com>
*/
#include <crypto/internal/aead.h>
#include <crypto/internal/cipher.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>
#include <crypto/scatterwalk... | c | github | https://github.com/torvalds/linux | crypto/ccm.c |
# -*- coding: utf-8 -*-
import re
from ..internal.SimpleHoster import SimpleHoster
class DailyuploadsNet(SimpleHoster):
__name__ = "DailyuploadsNet"
__type__ = "hoster"
__version__ = "0.01"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?dailyuploads\.net/\w+'
__config__ = [("activ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import django_tables2 as tables
from django_tables2.utils import Accessor
from utilities.tables import BaseTable, ToggleColumn
from .models import Aggregate, IPAddress, Prefix, RIR, Role, VLAN, VLANGroup, VRF
RIR_UTILIZATION = """
<div class="progress">
{% if record.stats.... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0
/*
* CMA DebugFS Interface
*
* Copyright (c) 2015 Sasha Levin <sasha.levin@oracle.com>
*/
#include <linux/debugfs.h>
#include <linux/cma.h>
#include <linux/list.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/mm_types.h>
#include "cma.h"
struct cma_mem {
... | c | github | https://github.com/torvalds/linux | mm/cma_debug.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 | clang-tools-extra/clang-tidy/bugprone/UnsafeFunctionsCheck.h |
`Drop` was implemented on a trait object or reference, which is not allowed;
only structs, enums, and unions can implement Drop.
Erroneous code examples:
```compile_fail,E0120
trait MyTrait {}
impl Drop for MyTrait {
fn drop(&mut self) {}
}
```
```compile_fail,E0120
struct Concrete {}
impl Drop for &'_ mut Con... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0120.md |
#!/usr/bin/python
##
## (C) 2007, 2008, 2013 Muthiah Annamalai
## Licensed under GPL Version 3
##
## This module is the custom exceptions for
## the exprs language
class Messages:
LEXICAL_ERROR = "Lexical error:"
RUNTIME_ERROR = "Run-time error:"
PARSE_ERROR = "Parse error:"
TIMEOUT_ERROR = "process ex... | unknown | codeparrot/codeparrot-clean | ||
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
""" """
# Python 3 is coming
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from django.test import TestCase
from flooding_lib.util ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright 2020 The Pigweed 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 by applicab... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011 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.
"""New implementation of Visual Studio project generation for SCons."""
import common
import os
import random
import gyp.common
# hashlib is supplied as of Pyth... | unknown | codeparrot/codeparrot-clean | ||
//! Experimental route introspection helpers.
//!
//! Enabled with the `experimental-introspection` feature.
//!
//! What it reports:
//! - Configured routes with their patterns, method guards, guard details, and resource metadata
//! (`resource_name`, `resource_type`, `scope_depth`).
//! - Reachability hints for rou... | rust | github | https://github.com/actix/actix-web | actix-web/src/introspection.rs |
import type { ChildProcess } from "node:child_process";
import { sync as spawnSync, spawn } from "cross-spawn";
import { cp, mkdir, readFile, writeFile } from "node:fs/promises";
import { createRequire } from "node:module";
import { platform } from "node:os";
import type { Readable } from "node:stream";
import url from... | typescript | github | https://github.com/remix-run/react-router | integration/helpers/vite.ts |
""" Test refcounting and behavior of SCXX.
"""
import sys
from numpy.testing import TestCase, dec, assert_, assert_raises
from scipy.weave import inline_tools
class TestDictConstruct(TestCase):
#------------------------------------------------------------------------
# Check that construction from basic typ... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/distributed_runtime/eager/eager_client.h |
# 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/utils/deprecation.py |
"""benchmarking through py.test"""
from __future__ import print_function, division
import py
from py.__.test.item import Item
from py.__.test.terminal.terminal import TerminalSession
from math import ceil as _ceil, floor as _floor, log10
import timeit
from inspect import getsource
from sympy.core.compatibility imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from mothergeo.logging import loggable_class as loggable
class TestLoggable(unittest.TestCase):
"""
These test cases test the :py:func:`loggable_class` decorator method.
"""
def test_loggable_class_without_logger_name(self):
"""
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import datetime
import json
import uuid
from django.core.exceptions import NON_FIELD_ERRORS
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import RegexValidator
from django.forms import (
Boolean... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.tests.auth
import io.ktor.util.*
import io.ktor.utils.io.charsets.*
import io.ktor.utils.io.core.*
import kotlin.io.encoding.Base64
import kotlin.test.*
class CryptoTest {
... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-auth/common/test/io/ktor/tests/auth/CryptoTest.kt |
from ethereum.pow import ethash
from ethereum import utils
import time
import sys
import warnings
from collections import OrderedDict
from ethereum import utils
from ethereum.slogging import get_logger
import rlp
log = get_logger('eth.pow')
if sys.version_info.major == 2:
from repoze.lru import lru_cache
else:
... | unknown | codeparrot/codeparrot-clean | ||
# By Bradley Schatz
# simple flash/python application demonstrating bidirectional
# communicaion between flash and python. Click the sphere to see
# behavior. Uses Bounce.swf from FlashBounce.zip, available from
# http://pages.cpsc.ucalgary.ca/~saul/vb_examples/tutorial12/
# Update to the path of the .swf file (note i... | 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 agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/collect/EnumMultisetTest.java |
def _ann_simplify(self, *args, **kwargs):
print("No point in simplifying a dCGPANN expression, sorry :)")
def _sympy_simplify(self, in_sym, subs_weights = False, erc = []):
"""
simplify(in_sym, subs_weights = False, erc = [])
Simplifies the symbolic output of dCGP expressions
Returns the simplifi... | unknown | codeparrot/codeparrot-clean | ||
from typing import List
from pypika import Order
from fireant.utils import alias_selector
from .query_builder import (
QueryBuilder,
add_hints,
get_column_names,
)
from fireant.queries.execution import fetch_data
from fireant.queries.finders import find_joins_for_tables
from fireant.formats import display... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2011-2015, Michigan State University.
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitte... | 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 'CourseEnrollment.course_id'
db.alter_column('student_courseenrollment', 'course_id', self.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import uuid
from .model import Node, PrivateLink
from framework.forms.utils import sanitize
from framework.mongo.utils import from_mongo
from modularodm import Q
from website.exceptions import NodeStateError
def show_diff(seqm):
"""Unify operations between two compared strings
seqm is a di... | unknown | codeparrot/codeparrot-clean | ||
import * as ts from "../_namespaces/ts.js";
import * as Utils from "../_namespaces/Utils.js";
function withChange(text: ts.IScriptSnapshot, start: number, length: number, newText: string): { text: ts.IScriptSnapshot; textChangeRange: ts.TextChangeRange; } {
const contents = ts.getSnapshotText(text);
const newC... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/incrementalParser.ts |
# Command to run:
# nohup python stalker.py &
import codecs
import datetime
import logging
logging.basicConfig(format = '%(asctime)s %(message)s', level = logging.NOTSET)
import os
import subprocess
from textwrap import TextWrapper
import time
import tweepy
class StreamWatcherListener(tweepy.StreamListener):
stat... | unknown | codeparrot/codeparrot-clean | ||
// RUN: rm -rf %t
// RUN: mkdir -p %t
// This is a reproducer for PR37091.
//
// Verify that no temporary files are left behind by the clang-tidy invocation.
// RUN: env TMPDIR=%t TEMP=%t TMP=%t clang-tidy -checks='-*,clang-analyzer-core.NullDereference' %s -- --target=mips64
// RUN: rmdir %t | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp |
"""
GCode M562
Example: M562 P0
Reset temperature fault
Author: Elias Bakken
License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/
"""
from GCodeCommand import GCodeCommand
import numpy as np
import logging
class M562(GCodeCommand):
def execute(self, g):
if g.has_letter("P"):
h... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.symbols
import com.intellij.psi.PsiElement
import org.jetbrains... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/KaFirBasePropertyAccessorSymbol.kt |
class ndarray(object):
"""
ndarray(shape, dtype=float, buffer=None, offset=0,
strides=None, order=None)
An array object represents a multidimensional, homogeneous array
of fixed-size items. An associated data-type object describes the
format of each element in the array... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
/***************************************************************************
CartogramDialog
A QGIS plugin
Generate anamorphic maps
-------------------
begin : 2017-02-09
git sha : $Fo... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.dylan
~~~~~~~~~~~~~~~~~~~~~
Lexers for the Dylan language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, d... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import sys
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import InstallRequirement, RequirementSet, parse_requirement... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
/* 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/grappler/utils/frame.h |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/crypto/intel,keembay-ocs-ecc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Intel Keem Bay OCS ECC
maintainers:
- Daniele Alessandrelli <daniele.alessandrelli@intel.com>
- Prabhjot Khura... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/crypto/intel,keembay-ocs-ecc.yaml |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | unknown | codeparrot/codeparrot-clean | ||
#ifndef REBASE_INTERACTIVE_H
#define REBASE_INTERACTIVE_H
struct strbuf;
struct repository;
struct replay_opts;
struct todo_list;
void append_todo_help(int command_count,
const char *shortrevisions, const char *shortonto,
struct strbuf *buf);
int edit_todo_list(struct repository *r, struct replay_opts... | c | github | https://github.com/git/git | rebase-interactive.h |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'tanchao'
import sys
SIZE = 256 # defined in challenge description
MATRIX = [[0] * SIZE for i in range(SIZE)]
def set_col(orders_):
col_ = orders_[1] - 1
val_ = orders_[2]
for i in range(SIZE):
MATRIX[i][col_] = val_
def set_row(orders... | unknown | codeparrot/codeparrot-clean | ||
from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import single_source_shortest_path_length
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
# set nonzero entries to infinity
graph[np.where(graph == 0)] =... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/utils/tests/test_shortest_path.py |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generate keyboard layout and hotkey data for the keyboard overlay.
This script fetches data from the keyboard layout and hotkey... | unknown | codeparrot/codeparrot-clean | ||
<?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\Bridge\Twig\Tests\EventListener;
use PHPUnit\Framework\TestCase... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Tests/EventListener/TemplateAttributeListenerTest.php |
from langchain_core.runnables.fallbacks import RunnableWithFallbacks
__all__ = ["RunnableWithFallbacks"] | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/schema/runnable/fallbacks.py |
# Copyright 2014 Mirantis.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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/examples/speech_commands/input_data_test.py |
__author__ = 'Victor'
import time
from rubik_solver.Enums import Color
import rubik_solver.FaceCube as FaceCube
import rubik_solver.CoordCube as CoordCube
from rubik_solver.CubieCube import DupedEdge
class DupedFacelet(Exception):
pass
class NoSolution(Exception):
pass
class SolverTimeoutError(Exception):
... | unknown | codeparrot/codeparrot-clean | ||
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Util\Ht... | php | github | https://github.com/composer/composer | src/Composer/Util/Http/CurlDownloader.php |
"""
The OGRGeometry is a wrapper for using the OGR Geometry class
(see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry
may be instantiated when reading geometries from OGR Data Sources
(e.g. SHP files), or when given OGC WKT (a string).
While the 'full' API is not present yet, the API is "pythonic" u... | unknown | codeparrot/codeparrot-clean | ||
""" JSON Web Token implementation
Minimum implementation based on this spec:
http://self-issued.info/docs/draft-jones-json-web-token-01.html
"""
import base64
import hashlib
import hmac
from six import text_type, b
# default text to binary representation conversion
def binary(txt):
return txt.encode('utf-8')
try... | unknown | codeparrot/codeparrot-clean | ||
"""Base integration test for provider implementations."""
import re
import unittest
import json
import mock
from django import test
from django.contrib import auth
from django.contrib.auth import models as auth_models
from django.contrib.messages.storage import fallback
from django.contrib.sessions.backends import c... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
//go:build testonly
package vault
import (
"context"
"fmt"
"io"
"maps"
"strings"
"sync"
"time"
"github.com/hashicorp/go-uuid"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/helper/timeutil"
"github.com/hashi... | go | github | https://github.com/hashicorp/vault | vault/logical_system_activity_write_testonly.go |
"""
Tests for the certificates models.
"""
from ddt import ddt, data, unpack
from mock import patch
from django.conf import settings
from nose.plugins.attrib import attr
from badges.tests.factories import CourseCompleteImageConfigurationFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""Parameter declaration parser
:copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import UserDict
import __builtin__
import copy
import enum
im... | unknown | codeparrot/codeparrot-clean | ||
import setpath
import functions
import json
registered=True
#It returns the columns names of the table (either on a string or on a table)
# getschema outputformat=1 select * from table; -->retrun string col1,col2,col3
# getschema outputformat=0 select * from table; -->return table
# getschema select * from table; -... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.