code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/bin/python3
"""
Primitive calculator
Given ops *3, *2, +1, what is the fewest ops to reach n from 1?
"""
import os
import sys
def main():
sequence = optimal_sequence_linear(int(input()))
print(len(sequence) - 1)
print(*sequence)
def optimal_sequence_linear(n):
"""
Solve by calculating min-st... | unknown | codeparrot/codeparrot-clean | ||
""" Defines miscellaneous Qt-related helper classes and functions.
"""
# Standard library imports.
import inspect
# System library imports.
from IPython.external.qt import QtCore, QtGui
# IPython imports.
from IPython.utils.traitlets import HasTraits, TraitType
#-----------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
# Script Name : modifyOBIEEHOLUsers.py
# Created by : Art of BI Software (artofbi.com)
# Author : C.Screen
# Date : 2013/10/01
##---------------------------------------------------------
# NOTES
##---------------------------------------------------------
# 1. ...
#
##----------------------------... | unknown | codeparrot/codeparrot-clean | ||
import inspect
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.admindocs import utils
from django.core import urlresolvers
f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
''' Small script to rewrite McStas trace output to CSV data for plotting '''
import argparse
import sys
import numpy as np
import x3d
from util import parse_multiline, rotate, get_line, debug, draw_circle
UC_COMP = 'COMPONENT:'
MC_COMP = 'MCDISPLAY: component'
MC_COMP_SHORT = 'COMP: '
... | 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/test/java/org/apache/kafka/clients/consumer/internals/AutoOffsetResetStrategyTest.java |
/*
* jidctint.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modification developed 2002-2018 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, 2020, 2022, D. R. Commander.
* For conditions of distribution and use, see the ... | c | github | https://github.com/opencv/opencv | 3rdparty/libjpeg-turbo/src/jidctint.c |
// Package oauthserver is a very simplistic OAuth server used only for
// the testing of the "terraform login" and "terraform logout" commands.
package oauthserver
import (
"crypto/sha256"
"encoding/base64"
"fmt"
"html"
"log"
"net/http"
"net/url"
"strings"
)
// Handler is an implementation of net/http.Handler... | go | github | https://github.com/hashicorp/terraform | internal/command/testdata/login-oauth-server/oauthserver.go |
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... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from MurkyWaters import MurkyWaters
import time, json, sys
import BaseHTTPServer
import os
import zlib
def save_file( config, resid, data ):
path = os.path.join( config['data-dir'], "%x"%resid )
with open( path, 'wb' ) as handle:
handle.write( zlib.compress( data ) )
murky = None
files ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import rospy
from threading import Timer
from flexbe_core.logger import Logger
class ProxyServiceCaller(object):
"""
A proxy for calling services.
"""
_services = {}
def __init__(self, topics={}, persistent=False, wait_duration=10):
"""
Initializes the proxy ... | unknown | codeparrot/codeparrot-clean | ||
use std::env;
use std::fs;
use std::path::PathBuf;
use std::process::Command;
use std::str;
const PRIVATE: &str = "\
#[doc(hidden)]
pub mod __private$$ {
#[doc(hidden)]
pub use crate::private::*;
}
";
// The rustc-cfg strings below are *not* public API. Please let us know by
// opening a GitHub issue if your ... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/serde_core/build.rs |
/* Copyright 2021 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/tfrt/mlrt/bytecode/kernel.h |
"""
Parser and evaluator for FormulaResponse and NumericalResponse
Uses pyparsing to parse. Main function as of now is evaluator().
"""
import math
import operator
import numbers
import numpy
import scipy.constants
import functions
from pyparsing import (
Word, Literal, CaselessLiteral, ZeroOrMore, MatchFirst, O... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_chr
from ..utils import (
determine_ext,
ExtractorError,
)
class OpenloadIE(InfoExtractor):
_VALID_URL = r'https?://(?:openload\.(?:co|io)|oload\.tv)/(?:f|embed)/(?P<id>[a-zA-Z0... | unknown | codeparrot/codeparrot-clean | ||
"""
Manage AWS ElastiCache
Only Redis on Elasticache is supported at the moment
"""
import getpass
import logging
import hashlib
import boto3
import botocore
from semantic_version import Spec, Version
from .disco_config import read_config
from .disco_route53 import DiscoRoute53
from .exceptions import CommandError
fr... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2011 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/hash/Funnels.java |
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_symtable_symtable__doc__... | c | github | https://github.com/python/cpython | Modules/clinic/symtablemodule.c.h |
import esp
class FlashBdev:
SEC_SIZE = 4096
def __init__(self, start_sec, blocks):
self.start_sec = start_sec
self.blocks = blocks
def readblocks(self, n, buf, off=0):
# print("readblocks(%s, %x(%d), %d)" % (n, id(buf), len(buf), off))
esp.flash_read((n + self.start_sec) *... | unknown | codeparrot/codeparrot-clean | ||
""" Machine limits for Float32 and Float64 and (long double) if available...
"""
__all__ = ['finfo','iinfo']
from machar import MachAr
import numeric
import numerictypes as ntypes
from numeric import array
def _frz(a):
"""fix rank-0 --> rank-1"""
if a.ndim == 0: a.shape = (1,)
return a
_convert_to_float... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/beans/TestcontainerBeanDefinition.java |
"""
There are three types of functions implemented in SymPy:
1) defined functions (in the sense that they can be evaluated) like
exp or sin; they have a name and a body:
f = exp
2) undefined function which have a name but no body. Undefined
functions can be defined using a Function cla... | unknown | codeparrot/codeparrot-clean | ||
"""Support for LCN lights."""
import pypck
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_TRANSITION,
SUPPORT_BRIGHTNESS,
SUPPORT_TRANSITION,
Light,
)
from homeassistant.const import CONF_ADDRESS
from . import LcnDevice
from .const import (
CONF_CONNECTIONS,
CONF_DIMMAB... | unknown | codeparrot/codeparrot-clean | ||
extension Validator where T: Equatable & CustomStringConvertible {
/// Validates whether an item is contained in the supplied array.
public static func `in`(_ array: T...) -> Validator<T> {
.in(array)
}
/// Validates whether an item is contained in the supplied sequence.
public static func ... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Validation/Validators/In.swift |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/DockerSpec.java |
<div><p data-foo="barbaz">this is unstyled</p>
<p class="svelte-xyz" data-foo="bazbar">this is styled</p></div> | html | github | https://github.com/sveltejs/svelte | packages/svelte/tests/css/samples/omit-scoping-attribute-attribute-selector-suffix/expected.html |
# 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.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | unknown | codeparrot/codeparrot-clean | ||
import urllib2
from HTMLParser import HTMLParser
from traceback import print_exc
from sys import stderr
class _DeHTMLParser(HTMLParser):
'''
利用HTMLParse来解析网页元素
'''
def __init__(self):
HTMLParser.__init__(self)
self.img_links = []
def handle_starttag(self, tag, attrs):
if tag == 'img':
# print(attrs)
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import re
import subprocess
import string
import sys
from lib.core.enums import DBMS
from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS
fr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the ... | unknown | codeparrot/codeparrot-clean | ||
{
"favorite": {
"favoriteDags_one": "Eerste {{count}} favoriete Dags",
"favoriteDags_other": "Eerste {{count}} favoriete Dags",
"noDagRuns": "Er is nog geen Dag Run voor deze Dag.",
"noFavoriteDags": "Geen favorieten. Klik op het sterpictogram naast een Dag in de lijst om deze aan je favorieten toe te... | json | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/locales/nl/dashboard.json |
#!/usr/bin/env python
'''
License of pdfminer lzw package:
Copyright (c) 2004-2010 Yusuke Shinyama <yusuke at cs dot nyu dot edu>
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
restric... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.tests.utils
import kotlinx.atomicfu.atomic
import kotlin.test.assertEquals
internal class LogMatcher(
private val originPredicates: MutableList<LogPredicate>
) {
... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-tests/common/test/io/ktor/client/tests/utils/LogMatcher.kt |
from modules.base_module import BaseModule
class FcqCardModule(BaseModule):
fcq_ids = []
def render(self, fcq_ids, color):
self.fcq_ids = fcq_ids
self.fcq_ids.reverse()
chunks = [self.fcq_ids[x:x + 6]
for x in range(0, len(self.fcq_ids), 6)]
return self.render... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
import os
import re
import subprocess
import time
from cassandra.util import sortedset
from ccmlib import common
from dtest import Tester, debug, DISABLE_VNODES
from tools import rows_to_list, since
@since('2.0.16', max_version='3.0.0')
class TestTokenGenerator(Tester):
"""
Basic tools/bin/t... | unknown | codeparrot/codeparrot-clean | ||
export default "b2"; | javascript | github | https://github.com/webpack/webpack | test/cases/chunks/circular-correctness/module-b2.js |
#!/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.
# This is used to test the findbugs plugin, it calls
# build/android/pylib/utils/findbugs.py to analyze the classes in
# org.chro... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins.sse
import io.ktor.sse.*
/**
* Policy that controls how an SSE diagnostic buffer is captured while reading a stream.
*
* The buffer represents already proce... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/sse/SSEBufferPolicy.kt |
# These functions are part of the python-colorama module
# They have been adjusted slightly for LinkChecker
#
# Copyright: (C) 2010 Jonathan Hartley <tartley@tartley.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followi... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/test/TestConfigurationMetadataAnnotationProcessor.java |
<!-- This file is generated by scripts/process-messages/index.js. Do not edit! -->
### a11y_accesskey
```
Avoid using accesskey
```
Enforce no `accesskey` on element. Access keys are HTML attributes that allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and key... | unknown | github | https://github.com/sveltejs/svelte | documentation/docs/98-reference/.generated/compile-warnings.md |
import argparse
import json
import os
import sys
from typing import List
import jsonschema
from license_expression import get_spdx_licensing
from referencing import Registry, Resource
BOM_SCHEMA_LOCATION = os.path.join("buildscripts", "tests", "sbom_linter", "bom-1.5.schema.json")
SPDX_SCHEMA_LOCATION = os.path.join(... | python | github | https://github.com/mongodb/mongo | buildscripts/sbom_linter.py |
def Dijkstra(G, start, end=None):
"""
Find shortest paths from the start vertex to all vertices nearer
than or equal to the end.
The input graph G is assumed to have the following representation: A
vertex can be any object that can be used as an index into a
dictionary. G is a dictionary, inde... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from django.shortcuts import render_to_response
from django.utils.safestring import mark_safe
from django.db.models import Q
from airmozilla.main.models import Picture
from airmozilla.main.helpers import thumbnail
class _BaseForm(object):
def clean(self):
cleaned_data = super(_Bas... | unknown | codeparrot/codeparrot-clean | ||
import Link from "next/link";
import { draftMode } from "next/headers";
import MoreStories from "../../more-stories";
import Avatar from "../../avatar";
import Date from "../../date";
import CoverImage from "../../cover-image";
import { Markdown } from "@/lib/markdown";
import { getAllPosts, getPostAndMorePosts } fro... | typescript | github | https://github.com/vercel/next.js | examples/cms-contentful/app/posts/[slug]/page.tsx |
# Copyright (c) 2017 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
DOCUMENTATION = '''
name: auto
plugin_type: inventory
author:
- Matt Davis <@nitzm... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2008 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/primitives/UnsignedBytesTest.java |
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for
# high-level documentation on how this system works.
#
# This module is closely integrated with zerver/lib/event_schema.py
# and zerver/lib/data_types.py systems for validating the schemas of
# events; it also uses the OpenAPI tools to valid... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es5/asyncImportedPromise_es5.ts] ////
//// [task.ts]
export class Task<T> extends Promise<T> { }
//// [test.ts]
import { Task } from "./task";
class Test {
async example<T>(): Task<T> { return; }
}
//// [task.js]
"use strict";
var __extends = (this && this.__extends) || (funct... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncImportedPromise_es5(target=es5).js |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script can either source a file and dump the enironment changes done by
# it, or just simply dump the current environment as JSO... | unknown | codeparrot/codeparrot-clean | ||
from .hash import bin_double_sha256, bin_to_hex_reversed, hex_to_bin_reversed
def hex_to_bin_reversed_hashes(hex_hashes):
return [hex_to_bin_reversed(h) for h in hex_hashes]
def calculate_merkle_pairs(bin_hashes, hash_function=bin_double_sha256):
""" takes in a list of binary hashes, returns a binary hash
... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from typing_extensions import Literal, TypeAlias
from ..._models import BaseModel
from ..responses.response_input_text import ResponseInputText
from ..responses.response_input_audio import Re... | python | github | https://github.com/openai/openai-python | src/openai/types/graders/grader_inputs.py |
import NIOConcurrencyHelpers
extension Application {
public var servers: Servers {
.init(application: self)
}
public var server: Server {
guard let makeServer = self.servers.storage.makeServer.withLockedValue({ $0.factory }) else {
fatalError("No server configured. Configure wi... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Server/Application+Servers.swift |
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import numbers
from itertools import chain
from math import ceil
import numpy as np
from scipy import sparse
from scipy.stats.mstats import mquantiles
from sklearn.base import is_regressor
from sklearn.inspection import partial_dependence... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/inspection/_plot/partial_dependence.py |
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (c) 2010-2013, GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero Gen... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2014 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/routes/logs.go |
// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package gin
import (
"errors"
"fmt"
"io"
"io/fs"
"log"
"maps"
"math"
"mime/multipart"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"str... | go | github | https://github.com/gin-gonic/gin | context.go |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation
#
# 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 | ||
#!/usr/bin/env python
import sys, os, re, json
import glob, shutil
import time
################
# Sanity check #
################
import numpy as np
fail = 0
counter = 0
testcases = []
from functools import wraps
import traceback
def prompt(msg):
yn = raw_input(msg + " [y/n]: ")
return yn.lower().startswit... | unknown | codeparrot/codeparrot-clean | ||
"""
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from shutil import copystat
from django.core.files import locks
__all__ = ['file_move_safe']
def _samefile(src, dst):
# Macintosh, Unix.
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression4_es5.ts] ////
//// [awaitCallExpression4_es5.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boole... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitCallExpression4_es5(target=es2015).js |
/**
* \file platform_time.h
*
* \brief Mbed TLS Platform time abstraction
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef MBEDTLS_PLATFORM_TIME_H
#define MBEDTLS_PLATFORM_TIME_H
#include "mbedtls/build_info.h"
#ifdef __cplusplus
extern "C" {
#e... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/mbedtls/platform_time.h |
from datetime import (
datetime,
timedelta,
)
from io import StringIO
import itertools
from textwrap import dedent
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Categorical,
DataFrame,
S... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/test_block_internals.py |
import collections
import functools
import re
import socket
import string
import inspect
from threading import Timer, RLock
def lchop(string, prefix):
"""Removes a prefix from string
:param string: String, possibly prefixed with prefix
:param prefix: Prefix to remove from string
:returns: string witho... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package transit
import (
"context"
"fmt"
"testing"
"github.com/hashicorp/vault/helper/testhelpers"
"github.com/hashicorp/vault/sdk/logical"
)
func TestTransit_Restore(t *testing.T) {
// Test setup:
// - Create a key
// - Configure it to ... | go | github | https://github.com/hashicorp/vault | builtin/logical/transit/path_restore_test.go |
"""attitude constraint corrections
Revision ID: 420f9b8b9e
Revises: 162f93d4393
Create Date: 2015-06-24 16:52:02.606637
"""
# revision identifiers, used by Alembic.
revision = '420f9b8b9e'
down_revision = '162f93d4393'
branch_labels = None
depends_on = None
from alembic import op
def upgrade():
op.drop_constra... | unknown | codeparrot/codeparrot-clean | ||
########################################################################
# $HeadURL$
# File: RequestProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2012/07/20 13:18:41
########################################################################
"""
:mod: RequestProxyHandler
.. module: RequestProxyHandler... | unknown | codeparrot/codeparrot-clean | ||
# This Python file uses the following encoding: utf-8
# (C) 2020 Muthiah Annamalai
# This file is part of open-tamil project
import string
from tamil.utf8 import get_letters
from tamil.numeral import num2tamilstr
def normalize_numeral_text(text_tokens):
"""
Input @text_tokens = ["இரு","நண்பர்கள்","௹","100","கொ... | unknown | codeparrot/codeparrot-clean | ||
//===--- ASTDumper.h - Swift AST Dumper flags -------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/AST/ASTDumper.h |
from pandac.PandaModules import *
from toontown.toonbase.ToontownBattleGlobals import *
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.PyDatagram import PyDatagram
from direct.distributed.PyDatagramIterator import PyDatagramIterator
from otp.otpbase import OTPGlobals
class Experience:
n... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | connect/runtime/src/main/java/org/apache/kafka/connect/storage/AppliedConnectorConfig.java |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package collections
import "iter"
// Set represents an associative array from keys of type K to values of type V.
//
// A caller-provided "key function" defines how to produce a comparable unique
// key for each distinct value of type K.
//
// Map... | go | github | https://github.com/hashicorp/terraform | internal/collections/map.go |
from __future__ import annotations
from functools import partial
import operator
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
)
import warnings
import numpy as np
from pandas._config import (
get_option,
using_string_dtype,
)
from pandas._libs im... | python | github | https://github.com/pandas-dev/pandas | pandas/core/arrays/string_.py |
package kotlinx.coroutines.flow
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlin.random.*
import kotlin.test.*
// A simplified version of StateFlowStressTest
class StateFlowCommonStressTest : TestBase() {
private val state = MutableStateFlow<Long>(0)
@Test
fun testSingleEmitt... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/concurrent/test/flow/StateFlowCommonStressTest.kt |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/platform/hash.h |
# -*- coding: utf-8 -*-
"""Methods for going back and forth between various calendars."""
from __future__ import division
import datetime
from hdate.common import HebrewDate
from hdate.htables import Months
def get_chalakim(hours, parts):
"""Return the number of total parts (chalakim)."""
return (hours * PA... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import logging
from vispy.util import logger, use_log_level
from vispy.testing import (assert_in, assert_not_in, run_tests_if_main,
assert_equal)
d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# Based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
# 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... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/mps,mp2629.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MP2629 Battery Charger PMIC from Monolithic Power System.
maintainers:
- Saravanan Sekar <sravanhome@gmail.com>
description: |
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mfd/mps,mp2629.yaml |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
##
# Copyright 2013-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2024 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | tests/robustness/validate/operations_test.go |
# -*- coding: utf-8 -*-
#
# Test links:
# https://www.oboom.com/B7CYZIEB/10Mio.dat
import re
from module.common.json_layer import json_loads
from module.plugins.internal.Hoster import Hoster
from module.plugins.captcha.ReCaptcha import ReCaptcha
class OboomCom(Hoster):
__name__ = "OboomCom"
__type__ = ... | 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 applicable ... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require 'test/unit'
require 'tempfile'
class TestTempfile < Test::Unit::TestCase
LIB_TEMPFILE_RB_PATH = File.expand_path(__dir__ + "/../lib/tempfile.rb")
def initialize(*)
super
@tempfile = nil
end
def tempfile(*args, **kw, &block)
t = Tempfile.new(*args, **kw, &bloc... | ruby | github | https://github.com/ruby/ruby | test/test_tempfile.rb |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | unknown | codeparrot/codeparrot-clean | ||
addr = 0
registers = {'a': 12, 'b': 0, 'c': 0, 'd': 0}
instructions = [line.split() for line in open('input2.txt', 'r')]
toggleMap = {'inc': 'dec', 'dec': 'inc', 'tgl': 'inc', 'cpy': 'jnz', 'jnz': 'cpy', 'mul': 'mul', 'nop': 'nop'}
def cpy(x, y):
if y not in registers:
return
registers[y] = registers[... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/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.
'''This utility cleans up the html files as emitted by doxygen so
that they are suitable for publication on a Google documentation sit... | unknown | codeparrot/codeparrot-clean | ||
#include <torch/headeronly/util/Float8_e5m2fnuz.h> | c | github | https://github.com/pytorch/pytorch | c10/util/Float8_e5m2fnuz-inl.h |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Author Yann Bayle
# E-mail bayle.yann@live.fr
# License MIT
# Created 01/12/2016
# Updated 01/12/2016
# Version 1.0.0
#
"""
Description of bayle.py
======================
0 Input the local extracted features from YAAFE
13 MFCC per frame
186 musical p... | unknown | codeparrot/codeparrot-clean | ||
{
"name": "@next/bundle-analyzer-ui",
"version": "16.0.2-canary.16",
"private": true,
"scripts": {
"build": "cross-env NEXT_TEST_NATIVE_DIR=no next build --no-mangling",
"dev": "cross-env NEXT_TEST_NATIVE_DIR=no next dev",
"lint": "eslint .",
"start": "cross-env NEXT_TEST_NATIVE_DIR=no next star... | json | github | https://github.com/vercel/next.js | apps/bundle-analyzer/package.json |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2015 ARM Limited
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 | ||
# frozen_string_literal: true
# :markup: markdown
require "delegate"
require "io/console/size"
module ActionDispatch
module Routing
class RouteWrapper < SimpleDelegator # :nodoc:
def matches_filter?(filter, value)
return __getobj__.path.match(value) if filter == :exact_path_match
value.m... | ruby | github | https://github.com/rails/rails | actionpack/lib/action_dispatch/routing/inspector.rb |
#=========================================================================
# ParcProcFL_test
#=========================================================================
from __future__ import print_function
import pytest
import pisa
import struct
from pymtl import *
from pclib.test import TestSource, TestS... | unknown | codeparrot/codeparrot-clean | ||
/* origin: FreeBSD /usr/src/lib/msun/src/s_expm1f.c */
/*
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. bu... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/expm1f.rs |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.