code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
def getSocialData(post):
# Get Thread Object
threadObject = post["thread"]
domain_rank = threadObject["domain_rank"] #domain_rank
#print 'domain_rank:' + str(domain_rank)
socialObject = threadObject["social"] #social data object
facebookData = socialObject["facebook"] #facebook data
#print 'facebook data:'... | unknown | codeparrot/codeparrot-clean | ||
"""This file contains different utils and fixtures."""
import os
import pytest
class Scope(dict): # noqa: WPS600
"""This class emulates `globals()`, but does not share state in tests."""
def __init__(self, *args, **kwargs):
"""Adding `__file__` to make things work in `tools.py`."""
super().... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='rev-list/rev-parse --glob'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
commit () {
test_tick &&
echo $1 > foo &&
git add foo &&
git commit -m "$1"
}
compare () {
# Split arguments on whitespace.
git $1 $2 >expected &&
git ... | unknown | github | https://github.com/git/git | t/t6018-rev-list-glob.sh |
import base64
import binascii
import functools
import hashlib
import importlib
import math
import warnings
from asgiref.sync import sync_to_async
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receive... | python | github | https://github.com/django/django | django/contrib/auth/hashers.py |
@import url('https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined');
:host {
display: flex;
justify-content: center;
}
[ngToolbar] {
display: flex;
}
[ngToolbarWidget] {
border: none;
outline: none;
cursor: pointer;
width: 3rem;
height: 3rem;
font-size: 1.25rem;
border-radius: 2rem;... | css | github | https://github.com/angular/angular | adev/src/content/examples/aria/toolbar/src/basic/material/app/app.css |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for apply().
This converts apply(func, v, k) into (func)(*v, **k)."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:param... | 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 | ||
<!---
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/3.3.1/RELEASENOTES.3.3.1.md |
#! /usr/bin/env python
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... | unknown | codeparrot/codeparrot-clean | ||
"""
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
module.exports = function supportsAsync() {
// Node.js@10 has a bug with nested async/await
if (process.version.startsWith("v10.")) {
return false;
}
try {
eval("async () => {}");
return true;
} catch (_err) {
// Ignore
}
return false;
}; | javascript | github | https://github.com/webpack/webpack | test/helpers/supportsAsync.js |
from .entity import is_slug_value
from .country import Country
from .category import Category
from .provider import Provider
from .dataset import Dataset
from .geography import Geography
from .subscriptions import Subscriptions
from .repository.constants import (COUNTRY_FILTER, CATEGORY_FILTER, GEOGRAPHY_FILTER, GLOBAL... | 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... | javascript | github | https://github.com/apache/airflow | airflow-core/docs/static/redirects.js |
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/controller/validatingadmissionpolicystatus/config/types.go |
//===--- InstructionDeleter.h - InstructionDeleter utility ------*- C++ -*-===//
//
// 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... | c | github | https://github.com/apple/swift | include/swift/SILOptimizer/Utils/InstructionDeleter.h |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest, copy
from frappe.utils import nowdate, add_days, flt
from frappe.model.dynamic_links import get_dynamic_link_map
from erp... | unknown | codeparrot/codeparrot-clean | ||
# CockroachDB Style guide
The CockroachDB Go style guide can be found here:
https://wiki.crdb.io/wiki/spaces/CRDB/pages/181371303/Go+style+guide | unknown | github | https://github.com/cockroachdb/cockroach | docs/style.md |
# -*- coding: utf-8 -*-
# Address from Brazilian Localization ZIP by Correios to Odoo
# Copyright (C) 2015 KMEE (http://www.kmee.com.br)
# @author Michell Stuttgart <michell.stuttgart@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import logging
from openerp.exceptions import Wa... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_uint_t hash_max_size;
ngx_uint_t hash_bucket_size;
} ngx_stream_map_conf_t;
typedef struct {
ngx_hash_keys_arra... | c | github | https://github.com/nginx/nginx | src/stream/ngx_stream_map_module.c |
import sqblUI
from SQBLutil import * # Dont like this, need to fix later.
from PyQt4 import QtGui, QtCore
import isoLangCodes
from lxml import etree
def languagePickerDialog(title = "Enter Language", default = None):
lang,success = QtGui.QInputDialog.getItem(None,
title,
"""Enter a <a href='http://... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Routing\Console;
use Illuminate\Console\Concerns\CreatesMatchingTest;
use Illuminate\Console\GeneratorCommand;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand(name: 'make:middleware')]
class MiddlewareMakeCommand extends GeneratorCommand
{
use CreatesMatchingTest;
/... | php | github | https://github.com/laravel/framework | src/Illuminate/Routing/Console/MiddlewareMakeCommand.php |
from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export {runBabelPluginReactCompiler} from './Babel/RunReactCompilerBabelPlugin';
export {
CompilerError,
CompilerErrorDetail... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/index.ts |
#!/usr/bin/python3
#coding:utf-8
import re
import os
import sys
import time
import urllib.request
import html.parser
import unittest
from bs4 import BeautifulSoup
from selenium import webdriver
import datetime
import logging
try:
import configparser
except:
from six.moves import configparser
import requests
fr... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 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.
package runtime
import "unsafe"
// Called from assembly only; declared for go vet.
func load_g()
func save_g()
//go:noescape
func asmcgocall_no_g(fn, arg uns... | go | github | https://github.com/golang/go | src/runtime/stubs_riscv64.go |
/*
* 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-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/CustomEnum.java |
# 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 applica... | unknown | codeparrot/codeparrot-clean | ||
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 optio... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals, division, absolute_import
import os
from tests import FlexGetBase
class TestMigrate(FlexGetBase):
__yaml__ = """
tasks:
test:
mock:
- {title: 'foobar'}
accept_all: yes
"""
def setup(self):
import logg... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2009-2013 Sebastian Rahlf <basti at redtoad dot de>
#
# This program is release under the BSD License. You can find the full text of
# the license in the LICENSE file.
from ConfigParser import SafeConfigParser
import os
import sys
REQUIRED_KEYS = [
'access_key',
'secret_key',
'associate_ta... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* Utility functions for conversion procs.
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/backend/utils/mb/c... | c | github | https://github.com/postgres/postgres | src/backend/utils/mb/conv.c |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from ..._types import SequenceNotStr
from ..shared_params.compound_filter import CompoundFi... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/file_search_tool_param.py |
# This is a rules file with duplicate expressions
groups:
- name: base
rules:
- record: job:test:count_over_time1m
expr: sum without(instance) (count_over_time(test[1m]))
# A recording rule that doesn't depend on input series.
- record: fixed_data
expr: 1
# Subquery with... | unknown | github | https://github.com/prometheus/prometheus | cmd/promtool/testdata/rules_duplicates.yml |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 Lic... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
from __future__ import unicode_literals
import datetime
try:
import unittest2 as unittest
except ImportError:
import unittest
from sphinxit.core.nodes import Count, OR, RawAttr
from sphinxit.core.processor import Search, Snippet
from sphinxit.core.helpers import unix_timestamp, BaseSearchConfig... | unknown | codeparrot/codeparrot-clean | ||
import json
from social.p3 import urlencode
from social.tests.backends.oauth import OAuth1Test
class ReadabilityOAuth1Test(OAuth1Test):
backend_path = 'social.backends.readability.ReadabilityOAuth'
user_data_url = 'https://www.readability.com/api/rest/v1/users/_current'
expected_username = 'foobar'
ac... | unknown | codeparrot/codeparrot-clean | ||
#ifndef COROUTINE_ARM32_CONTEXT_H
#define COROUTINE_ARM32_CONTEXT_H 1
/*
* This file is part of the "Coroutine" project and released under the MIT License.
*
* Created by Samuel Williams on 10/5/2018.
* Copyright, 2018, by Samuel Williams.
*/
#pragma once
#include <assert.h>
#include <stddef.h>
#include <stdi... | c | github | https://github.com/ruby/ruby | coroutine/arm32/Context.h |
from base import BaseClient
HUBSPOT_BROADCAST_API_VERSION = '1'
class BaseSocialObject(object):
def _camel_case_to_underscores(self, text):
result = []
pos = 0
while pos < len(text):
if text[pos].isupper():
if pos - 1 > 0 and text[pos - 1].islower() or pos - 1 >... | 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 | ||
# (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | unknown | codeparrot/codeparrot-clean | ||
import os.path
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseBadRequest, JsonResponse
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.template.response import TemplateResponse
from django.urls import reverse
from d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Peter Sagerson <psagers@ignorare.net>
# (c) 2016, Jiri Tyr <jiri.tyr@gmail.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 So... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
//
// Code generated by generate-staticcheck; DO NOT EDIT.
//
//go:build bazel
package st1001
import (
util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes... | go | github | https://github.com/cockroachdb/cockroach | build/bazelutil/staticcheckanalyzers/st1001/analyzer.go |
# -*- coding: utf-8 -*-
# JSHint plugin for Gedit
# Copyright (C) 2016 Xavier Gendre <gendre.reivax@gmail.com>
#
# 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 o... | unknown | codeparrot/codeparrot-clean | ||
// @validateRefAccessDuringRender false
function VideoTab() {
const ref = useRef();
const t = ref.current;
let x = () => {
console.log(t);
};
return <VideoList videos={x} />;
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-aliased-no-added-to-dep.js |
# -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import... | unknown | codeparrot/codeparrot-clean | ||
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... | unknown | codeparrot/codeparrot-clean | ||
import * as React from 'react'
export default function page() {
return <div> hello world </div>
}
export async function getServerSideProps() {
return {}
} | javascript | github | https://github.com/vercel/next.js | bench/app-router-server/pages/index.js |
from datetime import datetime, tzinfo
import pytz
from django.template import Library, Node, TemplateSyntaxError
from django.utils import six, timezone
register = Library()
# HACK: datetime is an old-style class, create a new-style equivalent
# so we can define additional attributes.
class datetimeobject(datetime, ... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_HAL_INTRIN_MSA_HPP
#define OPENCV_HAL_INTRIN_MSA_HPP
#include <algorithm>
#include "opencv2/core/utility.hpp"... | unknown | github | https://github.com/opencv/opencv | modules/core/include/opencv2/core/hal/intrin_msa.hpp |
'''
Problem Statement:
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
<insert one-hundered 50-digit numbers here>
'''
numbers = """37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617... | 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 | ||
<?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\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundl... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AuthenticatorBundle/ProfileController.php |
# Migrating to 4.0.0
This guide walks you through the process of migrating from v3.x.y to v4.x.y.
If you are migrating to v4.x.y from an older version of Actix Web (v2.x.y or earlier), check out the other historical migration notes in this folder.
This document is not designed to be exhaustive—it focuses on the most ... | unknown | github | https://github.com/actix/actix-web | actix-web/MIGRATION-4.0.md |
/*
* 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/diagnostics/package-info.java |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | unknown | codeparrot/codeparrot-clean | ||
require 'optparse'
parser = OptionParser.new(
'ruby help_format.rb [options]', # Banner
20, # Width of options field
' ' * 2 # Indentation
)
parser.on(
'-x', '--xxx',
'Adipiscing elit. Aenean commodo ligula eget.',
'Aenean massa. Cum sociis natoque... | ruby | github | https://github.com/ruby/ruby | doc/optparse/ruby/help_format.rb |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {h, Fragment} from 'preact';
import {EnumEntryRenderable, MemberEntryRenderable} from '../entities/renderable... | typescript | github | https://github.com/angular/angular | adev/shared-docs/pipeline/api-gen/rendering/templates/enum-reference.tsx |
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.network.sockets.tests
import io.ktor.network.selector.*
import io.ktor.network.sockets.*
import io.ktor.test.dispatcher.*
import kotlinx.coroutines.*
import platform.posix.*
i... | kotlin | github | https://github.com/ktorio/ktor | ktor-network/nix/test/io/ktor/network/sockets/tests/UdpSocketTestNix.kt |
#!/usr/bin/python
#
# Copyright (C) 2008 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | unknown | codeparrot/codeparrot-clean | ||
# Django settings for blog project.
import os
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PROJECT_ROOT = os.path.abspath(os.path.join(BASE_DIR, os.pardir))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
DATABASES = {
'default': ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Midistream documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 25 23:31:57 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
This file is part of GEOVAL.
(c) Alexander Loew
For COPYING and LICENSE details, please refer to the LICENSE file
"""
import sys
sys.path.append('..')
import unittest
from geoval.core import GeoData
from geoval.statistic.mintrend import MintrendPlot
try:
import cPickle # p2
except:
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package command
import (
"encoding/json"
"fmt"
"path"
"regexp"
"slices"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform/internal/configs/configschema"
"github.com/hashicorp/terraform/internal/providers"... | go | github | https://github.com/hashicorp/terraform | internal/command/query_test.go |
import datetime
from django.utils import datetime_safe
from haystack import indexes
from faceted_search.utils import DATETIME_REGEX
class MultiValueDateField(indexes.MultiValueField):
'''
Haystack does not currently have a MultiValueField that supports data types
other than text (see: http://github.com/to... | 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 | github | https://github.com/apache/airflow | task-sdk-integration-tests/docker-compose.yaml |
# coding: utf-8
from __future__ import unicode_literals
import base64
import itertools
import random
import re
import string
import time
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlencode,
compat_ord,
)
from ..utils import (
ExtractorError,
get_element_by_attribute,... | unknown | codeparrot/codeparrot-clean | ||
"""
This test will run for annotator_token.py
"""
import unittest
from xmodule.annotator_token import retrieve_token
class TokenRetriever(unittest.TestCase):
"""
Tests to make sure that when passed in a username and secret token, that it will be encoded correctly
"""
def test_token(self):
"""
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""RPython Translator Frontend
Glue script putting together the various pieces of the translator.
Can be used for interactive testing of the translator.
Example:
t = Translation(func, [int]) # pass the list of args types
t.view() # control flow graph
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
macro_rules! downcast_get_type_id {
() => {
/// A helper method to get the type ID of the type
/// this trait is implemented on.
/// This method is unsafe to *implement*, since `downcast_ref` relies
/// on the returned `TypeId` to perform a cast.
///
/// Unfortunately... | rust | github | https://github.com/actix/actix-web | actix-web/src/error/macros.rs |
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/controller/servicecidrs/servicecidrs_controller_test.go |
# -----------------------------------------------------------------------
# VirusTotal IDA Plugin
# By Elias Bachaalany <elias at hex-rays.com>
# (c) Hex-Rays 2011
#
# Special thanks:
# - VirusTotal team
# - Bryce Boe for his VirusTotal Python code
#
import idaapi
import idc
from idaapi import Choose2, plugin_t
import ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package configs
import (
"testing"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hcltest"
"github.com/zclconf/go-cty/cty"
)
func TestDecodeActionBlock(t *testing.T) {
tests := map[string]struct {
input *hcl.Block
want ... | go | github | https://github.com/hashicorp/terraform | internal/configs/action_test.go |
#!/usr/bin/env bash
set -ex
export ROCM_HOME=/opt/rocm
export MAGMA_HOME=$ROCM_HOME/magma
# TODO: libtorch_cpu.so is broken when building with Debug info
export BUILD_DEBUG_INFO=0
# TODO Are these all used/needed?
export TH_BINARY_BUILD=1
export USE_STATIC_CUDNN=1
export USE_STATIC_NCCL=1
export ATEN_STATIC_CUDA=1
e... | unknown | github | https://github.com/pytorch/pytorch | .ci/manywheel/build_rocm.sh |
# 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 | ||
"""
Functions for generating LaTeX output from mainmatter Markdown source files.
"""
import sys
import re
import os.path
import logging
import yaml
import jinja2 as j2
from . import params
def fleuronize(s, symbol=r'\\infty', rpt=3, math=True):
"""
Replaces instances of ***, ###, and <<<>>> in string `s` (al... | unknown | codeparrot/codeparrot-clean | ||
from selenium.webdriver.common.keys import Keys
from tests.integration.tests.test_booleaninput import Test as TestBooleanInput
from . import VisualTest
class Test(VisualTest):
urls = TestBooleanInput.urls
def test_test_default_usecase(self):
self.driver.get('%s%s' % (self.live_server_url, TestBoolean... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import fileinput
from os.path import join, dirname, abspath
import sys
import os
BASEDIR = dirname(abspath(__file__))
OUTPUT = join(BASEDIR, 'output.xml')
sys.path.insert(0, join(BASEDIR, '..', '..', '..', '..', 'src'))
import robot
from robot.conf.settings import RebotSettings
from robot.repo... | unknown | codeparrot/codeparrot-clean | ||
// This file was automatically generated on Fri Oct 13 19:09:38 2023
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-21.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LI... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/config/assert_cxx03.hpp |
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("migrations", "3_auto"),
("migrations", "4_auto"),
("migrations", "5_auto"),
]
dependencies = [("migrations", "2_auto")]
operations = [migrations.RunPython(migrations.RunPython.noop)] | python | github | https://github.com/django/django | tests/migrations/test_migrations_squashed_complex/3_squashed_5.py |
use rustc_ast::{self as ast, AsmMacro, MgcaDisambiguation};
use rustc_span::{Span, Symbol, kw};
use super::{ExpKeywordPair, ForceCollect, IdentIsRaw, Trailing, UsePreAttrPos};
use crate::{PResult, Parser, errors, exp, token};
/// An argument to one of the `asm!` macros. The argument is syntactically valid, but is oth... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_parse/src/parser/asm.rs |
import discord
from discord.ext import commands
from .utils.dataIO import dataIO
from .utils import checks
from __main__ import send_cmd_help, settings
from datetime import datetime
from collections import deque, defaultdict
from cogs.utils.chat_formatting import escape_mass_mentions, box, pagify
import os
import re
im... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import subprocess
import time
import paramiko # SSH Support
import commonData
cmd = "ifconfig -a"
class showAllInterfaces(unittest.TestCase):
def setUp(self):
self.startTime = time.time()
global ssh
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
# ssh.con... | unknown | codeparrot/codeparrot-clean | ||
<!DOCTYPE html>
<html>
<head>
<title>Splashscreen</title>
<style>
body {
margin: 0;
}
.splashscreen-image {
background-color: #444;
background-image: url('icon.png');
background-position: center;
background-repeat: no-repeat;
background-size: ... | html | github | https://github.com/tauri-apps/tauri | examples/splashscreen/dist/splashscreen.html |
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/336012
import SimpleHTTPServer
import BaseHTTPServer
import httplib
import os
class StoppableHttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
"""http request handler with QUIT stopping the server"""
def do_QUIT(self):
"""send 200... | unknown | codeparrot/codeparrot-clean | ||
"""Generic entity for the HomematicIP Cloud component."""
import logging
from typing import Any, Dict, Optional
from homematicip.aio.device import AsyncDevice
from homematicip.aio.group import AsyncGroup
from homeassistant.core import callback
from homeassistant.helpers import device_registry as dr, entity_registry a... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | unknown | codeparrot/codeparrot-clean | ||
{% if errors %}<div class="errorlist">{% for error in errors %}<div class="error">{{ error }}</div>{% endfor %}</div>{% endif %} | html | github | https://github.com/django/django | tests/forms_tests/templates/forms_tests/error.html |
# 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 | ||
# frozen_string_literal: true
Rails.application.routes.draw do
scope "/rails/action_mailbox", module: "action_mailbox/ingresses" do
post "/postmark/inbound_emails" => "postmark/inbound_emails#create", as: :rails_postmark_inbound_emails
post "/relay/inbound_emails" => "relay/inbound_emails#create", as: ... | ruby | github | https://github.com/rails/rails | actionmailbox/config/routes.rb |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2017,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | 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/compiler/tests/lstm.py |
/* Copyright 2022 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/common_runtime/next_pluggable_device/plugin_op_kernel_helper.h |
//===--- Analysis.h - Swift Analysis ---------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 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/SILOptimizer/Analysis/Analysis.h |
from django.db import transaction, IntegrityError, DatabaseError
from django.test import TestCase
from models import Counter, WithCustomPK
class ForceTests(TestCase):
def test_force_update(self):
c = Counter.objects.create(name="one", value=1)
# The normal case
c.value = 2
c.save(... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.