code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
* Copyright 2010-2024 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.standalone.fir.test.cases.generated.cases.components.symbolInfoProvi... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/symbolInfoProvider/FirStandaloneNormalAnalysisSourceModuleAnnotationApplicableTargetsTestGenerated.java |
"""
WSGI config for example project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtCore, QtGui
if not hasattr(QtCore, 'Signal'):
QtCore.Signal = QtCore.pyqtSignal
import weakref
class CanvasManager(QtCore.QObject):
SINGLETON = None
sigCanvasListChanged = QtCore.Signal()
def __init__(self):
if CanvasManager.SINGLETON is not ... | unknown | codeparrot/codeparrot-clean | ||
"""
Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile)
in each of NUM_THREADS threads, recording the number of successes and
failures. A failure is a bug in tempfile, and may be due to:
+ Trying to create more than one tempfile with the same name.
+ Trying to delete a tempfile that doesn't sti... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including... | c | github | https://github.com/mysql/mysql-server | sql/rpl_log_encryption.h |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
gspread.urls
~~~~~~~~~~~~
This module is Google API url patterns storage.
"""
import re
from .exceptions import UnsupportedFeedTypeError, UrlParameterMissing
SPREADSHEETS_SERVER = 'spreadsheets.google.com'
SPREADSHEETS_FEED_URL = 'https://%s/%s/' % (SPREADSHEETS_SERVER, 'feeds')
# Gen... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
/*
* open file cache caches
* open file handles with stat() info;
* directories stat() info;
* files and directories errors: not found, access denied, etc.
*/
#define NG... | c | github | https://github.com/nginx/nginx | src/core/ngx_open_file_cache.c |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_vlag
from units.modules.utils import set_module_args
from .cnos_module import TestCnosModule, load_fixture
class TestCnosVlagModule(TestCnosModule):... | unknown | codeparrot/codeparrot-clean | ||
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/deepseek_v3/modular_deepseek_v3.py.
# Do NOT edit this file manually as any edits will be overwritten by the gene... | python | github | https://github.com/huggingface/transformers | src/transformers/models/deepseek_v3/modeling_deepseek_v3.py |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.formtools.wizard.views import NamedUrlSessionWizardView
from django.core.files.storage import FileSystemStorage
import os, json, cStringIO, pdb, csv
from VECNet import settings
from django.http import HttpResponse
from django.core.servers.basehttp import FileWrapper
from django.db.models.loading imp... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, print_function
from os import path
import csv
import yaml
from dynd import nd, ndt
import datashape
import blaze
from .. import py2help
def compatible_array_dshape(arr, ds):
"""Checks if the array is compatible with the given dshape.
Examples
----... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Deep Q-network implementation with chainer and rlglue
Copyright (c) 2015 Naoto Yoshida All Right Reserved.
"""
import copy
import pickle
import numpy as np
import scipy.misc as spm
from chainer import cuda, FunctionSet, Variable, optimizers
import chainer.functions as F
from rlglue.agen... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | unknown | codeparrot/codeparrot-clean | ||
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng-add-localize": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": tr... | json | github | https://github.com/angular/angular | integration/ng-add-localize/angular.json |
/* Copyright 2019 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/map_dataset_op.h |
# -*- coding: utf-8 -*-
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.token import Token, STANDARD_TYPES
class StyleMeta(type):
def __new__(mcs, name, bases, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2005 Michael Urman
#
# 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.
import wa... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from collections import defaultdict
from contextlib import contextmanager
from threading import local
from django.contrib.auth import get_permission_codename, get_user_model
from django.contrib.auth.models import Group
from django.contrib.sites.models import Site
from django.db.models import Q
... | 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/io/nativeio/package-info.java |
<script src="../../dist/vue.global.js"></script>
<div>click to hydrate</div>
<div id="app"><button>0</button></div>
<style>
body {
margin: 0;
}
</style>
<script>
const isFragment = location.search.includes('?fragment')
if (isFragment) {
document.getElementById('app').innerHTML =
`<!--[--><!--[--... | html | github | https://github.com/vuejs/core | packages/vue/__tests__/e2e/hydration-strat-interaction.html |
import unittest
import codecs
import string
import random
from openid import oidutil
def test_base64():
allowed_s = string.ascii_letters + string.digits + '+/='
allowed_d = {}
for c in allowed_s:
allowed_d[c] = None
isAllowed = allowed_d.has_key
def checkEncoded(s):
for c in s:
... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from django.forms.util import flatatt
from django.utils.encoding import force_unicode
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from wiki.editors.base import BaseEditor
from wiki.editors.m... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.db import models
class UserManager(BaseUserManager):
def _create_user(self, username, **extra_fields):
user = self.model(username=username, **extra_fields)
user.save(using=self._db)
return user
def ... | python | github | https://github.com/django/django | tests/auth_tests/models/no_password.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("web2py")
import json
import argparse
import logging
import os
from db.LDA_DB import LDA_DB
from readers.STMReader import STMReader
def main():
parser = argparse.ArgumentParser(description = 'Import a STM topic model as a folder of files.')
... | 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 | ||
#!/usr/bin/python
import platform
import os
import sys, select
import subprocess
import time
import math
from distutils.version import LooseVersion
class SetupCephUtils(object):
global POOL_CRUSH_MAP
POOL_CRUSH_MAP = '/tmp/ma-crush-map-pool'
global POOL_CRUSH_MAP_TXT
POOL_CRUSH_MAP_TXT = '/tmp/ma-crus... | unknown | codeparrot/codeparrot-clean | ||
"""
Contains reusable, expandable commands for the lifecycle and listing of
repositories.
Customization of the commands in this module can be done either by specifying
a method to the command's constructor or by subclassing and overriding the
``run(self, **kwargs)`` method.
Subclasses should be sure to call the super... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@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, eithe... | unknown | codeparrot/codeparrot-clean | ||
"use turbopack no side effects";
export { getHeaders } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%3A%7B%22name%22%3A%22getHeaders%22%7D%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%... | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | unknown | codeparrot/codeparrot-clean | ||
// This script must be run with tsx
import fs from 'node:fs/promises'
import yargs from 'yargs'
import { hideBin } from 'yargs/helpers'
import { default as patchPackageJson } from './pack-utils/patch-package-json.js'
import buildNative from './build-native.js'
import {
NEXT_DIR,
exec,
execAsyncWithOutput,
glo... | typescript | github | https://github.com/vercel/next.js | scripts/pack-next.ts |
package kotlinx.coroutines.exceptions
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.CoroutineStart.*
import kotlinx.coroutines.testing.exceptions.*
import org.junit.Test
import java.io.*
import kotlin.test.*
@Suppress("DEPRECATION") // cancel(cause)
class JobExceptionHandli... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/exceptions/JobExceptionHandlingTest.kt |
export * from "./missing";
export * from "./a"; | javascript | github | https://github.com/webpack/webpack | test/cases/errors/harmony-import-missing/module.js |
# -*- coding: utf-8 -*-
"""
==========================================
Create a very large FITS file from scratch
==========================================
This example demonstrates how to create a large file (larger than will fit in
memory) from scratch using `astropy.io.fits`.
*By: Erik Bray*
*License: BSD*
"""
... | 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 | ||
global:
convert_classic_histograms_to_nhcb: true
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:8080'] | unknown | github | https://github.com/prometheus/prometheus | config/testdata/global_convert_classic_hist_to_nhcb.good.yml |
# -*- coding: utf-8 -*-
"""
***************************************************************************
EnumModelerWidget.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***********... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.3
// source: packages.proto
package packages
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.... | go | github | https://github.com/hashicorp/terraform | internal/rpcapi/terraform1/packages/packages_grpc.pb.go |
"""Request body processing for CherryPy.
When an HTTP request includes an entity body, it is often desirable to
provide that information to applications in a form other than the raw bytes.
Different content types demand different approaches. Examples:
* For a GIF file, we want the raw bytes in a stream.
* An HTML f... | unknown | codeparrot/codeparrot-clean | ||
# Simple implementation of a json test runner to run the test against json-py.
import sys
import os.path
import json
import types
if len(sys.argv) != 2:
print "Usage: %s input-json-file", sys.argv[0]
sys.exit(3)
input_path = sys.argv[1]
base_path = os.path.splitext(input_path)[0]
actual_path = base_path + '.... | unknown | codeparrot/codeparrot-clean | ||
#include "internal.h"
#include "internal/missing.h"
#if defined HAVE_DLADDR
#include <dlfcn.h>
#endif
#if defined HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
static void* stub_options(int argc, char **argv);
#define ruby_options stub_options
#include <main.c>
#undef ruby_options
void *
stub_options(int argc, char *... | c | github | https://github.com/ruby/ruby | rubystub.c |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !race
package regexp
import (
"testing"
)
// This test is excluded when running under the race detector because
// it is a very expensive test an... | go | github | https://github.com/golang/go | src/regexp/exec2_test.go |
import formatDistanceToNowStrict from "date-fns/formatDistanceToNowStrict";
export default function distanceToNow(dateTime: number | Date) {
return formatDistanceToNowStrict(dateTime, {
addSuffix: true,
});
} | typescript | github | https://github.com/vercel/next.js | examples/blog-with-comment/lib/dateRelative.ts |
from django.conf import settings
from django import forms
from django.forms.widgets import RadioSelect
from crits.campaigns.campaign import Campaign
from crits.core import form_consts
from crits.core.forms import add_bucketlist_to_form, add_ticket_to_form
from crits.core.widgets import CalWidget
from crits.core.handle... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015-2016 Contributors as noted in the AUTHORS file
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from datetime import datetime
from ... | 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/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java |
'use client'
import * as React from 'react'
import * as DialogPrimitive from '@radix-ui/react-dialog'
import { XIcon } from 'lucide-react'
import { cn } from '@/lib/utils'
function Dialog({
...props
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
return <DialogPrimitive.Root data-slot="dialog" {...props}... | typescript | github | https://github.com/vercel/next.js | apps/bundle-analyzer/components/ui/dialog.tsx |
/* MIT License
*
* Copyright (c) Daniel Stenberg
*
* 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, ... | c | github | https://github.com/nodejs/node | deps/cares/include/ares_version.h |
// Copyright 2015 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 | server/etcdmain/doc.go |
# Copyright 2024 weak-kajuma and the HuggingFace Inc. team. All rights reserved.
#
# This code is based on Llama implementations in this library and Microsoft's
# Differential Transformer implementations.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance... | python | github | https://github.com/huggingface/transformers | src/transformers/models/diffllama/modular_diffllama.py |
"""Test that we handle inferiors that send signals to themselves"""
from __future__ import print_function
import lldb
import re
from lldbsuite.test.lldbplatformutil import getDarwinOSTriples
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@skipIfWindo... | unknown | codeparrot/codeparrot-clean | ||
//===--- Join.swift -------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | swift | github | https://github.com/apple/swift | benchmark/single-source/Join.swift |
from Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigSelection, getConfigListEntry
from Components.SystemInfo import SystemInfo
from Components.Task import job_manager
from InfoBarGenerics import InfoBarNotifications
import Screens.St... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob 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 License, or
# (at your op... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (C) 2020 Shadow Robot Company Ltd - All Rights Reserved. Proprietary and Confidential.
# Unauthorized copying of the content in this file, via any medium is strictly prohibited.
import argparse
import dynamic_reconfigure
import dynamic_reconfigure.client
import psutil
import rospy
i... | unknown | codeparrot/codeparrot-clean | ||
package client
import (
"context"
"encoding/json"
"net/url"
"github.com/moby/moby/api/types/checkpoint"
)
// CheckpointListOptions holds parameters to list checkpoints for a container.
type CheckpointListOptions struct {
CheckpointDir string
}
// CheckpointListResult holds the result from the CheckpointList me... | go | github | https://github.com/moby/moby | client/checkpoint_list.go |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Zulip, Inc.
#
# 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,... | unknown | codeparrot/codeparrot-clean | ||
class Solution:
def isSolvable(self, words, result) -> bool:
for word in words:
if len(word) > len(result):
return False
words = [word[::-1] for word in words]
result = result[::-1]
c2i = [-1] * 26
i2c = [False] * 10
def dfs(idx, digit, s)... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | 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\TokenParser;
use Symfony\Bridge\Twig\Node\TransDefa... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php |
"""
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 | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/pl061-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ARM PL061 GPIO controller
maintainers:
- Linus Walleij <linusw@kernel.org>
- Rob Herring <robh@kernel.org>
# We need a select h... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/gpio/pl061-gpio.yaml |
<?php
namespace Illuminate\Broadcasting;
class FakePendingBroadcast extends PendingBroadcast
{
/**
* Create a new pending broadcast instance.
*/
public function __construct()
{
//
}
/**
* Broadcast the event using a specific broadcaster.
*
* @param string|null $... | php | github | https://github.com/laravel/framework | src/Illuminate/Broadcasting/FakePendingBroadcast.php |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union
from typing_extensions import Literal, Annotated, TypeAlias
from ..._utils import PropertyInfo
from ..._models import BaseModel
from .text_content import TextContent
from .summary_text_content import S... | python | github | https://github.com/openai/openai-python | src/openai/types/conversations/message.py |
import Prism, { type hooks } from 'prismjs'
const { Token } = Prism
let isPrismConfigured = false
export function configurePrism() {
if (isPrismConfigured) {
return
}
isPrismConfigured = true
Prism.hooks.add('after-tokenize', lineWrapPlugin)
}
// A plugin to wrap each line in a .line span, except for c... | typescript | github | https://github.com/twbs/bootstrap | site/src/libs/prism.ts |
import typing
import logging
import os
from pathlib import Path
from functools import lru_cache
log = logging.getLogger(__name__)
ENV_SHARED_DATA_PATH = "OT_SHARED_DATA_PATH"
class SharedDataMissingError(IOError):
pass
@lru_cache(maxsize=1)
def get_shared_data_root() -> Path:
"""
Get the root directory ... | unknown | codeparrot/codeparrot-clean | ||
import fp
from fp import cfg
class chip(fp.base):
"""Generator for chip resistors, capacitors, inductors, MELF and Tantal devices"""
def __init__(self, name, model, description, tags, package_width, package_height, pad_width, pad_height, pad_distance):
super(chip, self).__init__(name, model, description, tags, Tr... | unknown | codeparrot/codeparrot-clean | ||
"""
Support for Efergy sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.efergy/
"""
import logging
import voluptuous as vol
from requests import RequestException, get
import homeassistant.helpers.config_validation as cv
from homeassistant... | unknown | codeparrot/codeparrot-clean | ||
# from http://code.activestate.com/recipes/523034/
try:
from collections import defaultdict
except:
class defaultdict(dict):
def __init__(self, default_factory=None, *a, **kw):
if (default_factory is not None and
not hasattr(default_factory, '__call__')):
rais... | unknown | codeparrot/codeparrot-clean | ||
Cloudflare platform abstractions for React Router
```bash
npm install @react-router/cloudflare @cloudflare/workers-types
``` | unknown | github | https://github.com/remix-run/react-router | packages/react-router-cloudflare/README.md |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=E1101, W0201
"""
Tests for Courses
"""
import httpretty
import json
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.factories import CourseFactory
from opaque_keys.edx.keys import CourseKey
from ..test_utils import SocialFacebookTestCase
class TestCourses(SocialFacebookTe... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import type { InvokeArgs, InvokeOptions } from './core'
import { EventName } from './event'
function mockInternals() {
window.__TAURI_INTERNALS__ = window.__TAURI_INTERNALS__ ... | typescript | github | https://github.com/tauri-apps/tauri | packages/api/src/mocks.ts |
import logging
import os
import sys
import six
from devassistant import actions
from devassistant import bin
from devassistant.cli import argparse_generator
from devassistant import exceptions
from devassistant import logger
from devassistant import path_runner
from devassistant import settings
from devassistant impor... | unknown | codeparrot/codeparrot-clean | ||
--
-- HMAC-SHA1
--
SELECT hmac(
'Hi There',
'\x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b'::bytea,
'sha1');
-- 2
SELECT hmac(
'Jefe',
'what do ya want for nothing?',
'sha1');
-- 3
SELECT hmac(
'\xdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'::bytea,
'\xaaaaaaaaaaaaaaaaaa... | sql | github | https://github.com/postgres/postgres | contrib/pgcrypto/sql/hmac-sha1.sql |
import cPickle as pickle
import gzip
import numpy
from midi_to_statematrix import *
import multi_training
import model
def gen_adaptive(m,pcs,times,keep_thoughts=False,name="final"):
xIpt, xOpt = map(lambda x: numpy.array(x, dtype='int8'), multi_training.getPieceSegment(pcs))
all_outputs = [xOpt[0]]
if keep_though... | unknown | codeparrot/codeparrot-clean | ||
use super::{HttpDate, EXPIRES};
crate::http::header::common_header! {
/// `Expires` header, defined
/// in [RFC 7234 §5.3](https://datatracker.ietf.org/doc/html/rfc7234#section-5.3)
///
/// The `Expires` header field gives the date/time after which the
/// response is considered stale.
///
... | rust | github | https://github.com/actix/actix-web | actix-web/src/http/header/expires.rs |
#!/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.
import sys
from idl_log import ErrOut, InfoOut, WarnOut
from idl_option import GetOption, Option, ParseOptions
from idl_parser imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python2
# coding: utf-8
import requests
import json
# Demands Stanford Core NLP server running on a defined port
# Start server with something like:
# java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer --port 9999
port = 9999
conversion = {"CC": "CONJ",
"CD": "ADJ",
... | 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/ha/TestZKFailoverController.java |
# -*- test-case-name: twisted.web.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I am a virtual hosts implementation.
"""
# Twisted Imports
from twisted.python import roots
from twisted.web import resource
class VirtualHostCollection(roots.Homogenous):
"""Wrapper for virtual hosts c... | unknown | codeparrot/codeparrot-clean | ||
""" Test functions for matrix module
"""
from numpy.testing import *
from numpy import ( arange, rot90, add, fliplr, flipud, zeros, ones, eye,
array, diag, histogram2d, tri, mask_indices, triu_indices,
triu_indices_from, tril_indices, tril_indices_from )
import numpy as np
fr... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of onepageblog.
#
# onepageblog 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.
#
# onepageblog is distributed in t... | unknown | codeparrot/codeparrot-clean | ||
import ML_algorithms as ml
import util
import numpy as np
from smac.configspace import ConfigurationSpace
from smac.tae.execute_func import ExecuteTAFuncDict
from smac.scenario.scenario import Scenario
from smac.facade.smac_facade import SMAC
class Model:
def __init__(self, settings={'algorithm':None, 'hyperpara... | unknown | codeparrot/codeparrot-clean | ||
'''OpenGL extension EXT.occlusion_query_boolean
This module customises the behaviour of the
OpenGL.raw.GLES2.EXT.occlusion_query_boolean to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/occlusion_query_boolean.txt
'''
from Open... | unknown | codeparrot/codeparrot-clean | ||
#!/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 | ||
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build plan9
package os
import (
"internal/strconv"
"syscall"
)
func executable() (string, error) {
fn := "/proc/" + strconv.Itoa(Getpid()) + "/text"
... | go | github | https://github.com/golang/go | src/os/executable_plan9.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 may not u... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/cli/commands/test_db_command.py |
#!/usr/bin/env python
from panda3d.core import *
import sys
import os
import direct.directbase.DirectStart
from direct.interval.IntervalGlobal import *
from direct.gui.DirectGui import OnscreenText
from direct.showbase.DirectObject import DirectObject
from direct.actor import Actor
from random import *
# Function to... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
import os
import sys
global colors
# 7 er taket, enkanals
# 8-9-10 er noen på pila, trekanals
# 11-12-13-14 er den siste på pila, firekanals
colors = {
'off': {
i+1:0 for i in range(512)
},
'test': {
i+1:255 for i in range(512)... | unknown | codeparrot/codeparrot-clean | ||
import pkgutil
from importlib import import_module
from pathlib import Path
from asgiref.local import Local
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
DEFAULT_DB_ALI... | unknown | codeparrot/codeparrot-clean | ||
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | unknown | codeparrot/codeparrot-clean | ||
require "coverage.so"
Coverage.start
ext = ENV["COVERUBY_EXT"] || ".cov"
accum = ENV["COVERUBY_ACCUM"]
accum = !accum || accum == "" || !(%w(f n 0).include?(accum[0]))
pwd = Dir.pwd
at_exit do
exit_exc = $!
Dir.chdir(pwd) do
Coverage.result.each do |sfile, covs|
cfile = sfile + ext
writable = pr... | ruby | github | https://github.com/ruby/ruby | sample/coverage.rb |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import pytest
import spack.util.spack_yaml as syaml
@pytest.fixture()
def minimal_configuration():
return {
'... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper(object)... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.