code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
(torch.compiler_troubleshooting)=
# torch.compile Troubleshooting
You're trying to use `torch.compile` on your PyTorch model to enhance its performance
but it's not working as expected. Perhaps performance isn't improving, crashes are happening, or compilation time is too long. This article provides tips, workarounds... | unknown | github | https://github.com/pytorch/pytorch | docs/source/user_guide/torch_compiler/torch.compiler_troubleshooting.md |
import pickle
import time
from datetime import datetime
from django.template import engines
from django.template.response import (
ContentNotRenderedError,
SimpleTemplateResponse,
TemplateResponse,
)
from django.test import (
RequestFactory,
SimpleTestCase,
modify_settings,
override_setting... | python | github | https://github.com/django/django | tests/template_tests/test_response.py |
- name: test that import_role adds one (just one) execution of the role
hosts: localhost
gather_facts: false
tags: ['importrole']
roles:
- name: a
tasks:
- name: import role ignores dupe rule
import_role: name=a
- name: test that include_role adds one (just one) execution of the role
hosts: ... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/roles/allowed_dupes.yml |
#!/usr/bin/env python
from __future__ import division
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["Jai Ram Rideout", "Michael Dwan", "Logan Knecht",
"Damien Coy", "Levi McCracken", "Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__main... | 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/controller/volume/persistentvolume/index.go |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.db.migrations.state import ProjectState
from django.utils.datastructures import OrderedSet
class MigrationGraph(object):
"""
Represents the digraph of all migrations in a project.
Each migration is a node, and each dependency is an edge. There are
n... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: curl_ws_start_frame
Section: 3
Source: libcurl
See-also:
- curl_easy_getinfo (3)
- curl_easy_perform (3)
- curl_easy_setopt (3)
- curl_ws_recv (3)
- libcurl-ws (3)
Protocol:
- WS
Added-in: 8.16.0
---
# NAME
... | unknown | github | https://github.com/curl/curl | docs/libcurl/curl_ws_start_frame.md |
from __future__ import division, print_function
import numpy as np
import pyroomacoustics as pra
import time
try:
import pyfftw
pyfftw_available = True
except ImportError:
pyfftw_available = False
try:
import mkl_fft
mkl_available = True
except ImportError:
mkl_available = False
n_trials = 10... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 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/net/unix/DomainSocket.java |
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
MultiIndex,
)
import pandas._testing as tm
class TestDataFrameRenameAxis:
def test_rename_axis_inplace(self, float_frame):
# GH#15704
expected = float_frame.rename_axis("foo")
result = float_frame.copy()
... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/methods/test_rename_axis.py |
#!/usr/bin/env python
""" Test suite for Morphism classes. """
import inspect
import os
import re
import pytest
from ..rom import ROM
from ..morphism import Morphism
from ..thousandcurses.codec import ASCII, ReverseASCII
package_dir = os.path.dirname(os.path.abspath(__file__))
@pytest.mark.skip()
class TestASCIIMor... | unknown | codeparrot/codeparrot-clean | ||
---
navigation_title: "Circle"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-circle-processor.html
---
# Circle processor [ingest-circle-processor]
Converts circle definitions of shapes to regular polygons which approximate them.
$$$circle-processor-options$$$
| Name | Req... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/enrich-processor/ingest-circle-processor.md |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 | ||
import sys
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from ..models import Author, Article, UrlArticle
class DefaultsTests(TestCase):
"""Test django views in django/views/defaults.py"""
fixtures = ['testdata.json']
non_existing_... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
```esql
ROW language_code = "1"
| ENRICH languages_policy
```
| language_code:keyword | language_name:keyword |
| --- | --- |
| 1 | English | | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/commands/examples/enrich.csv-spec/enrich.md |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedUnixGroupsNetgroupMapping.java |
import {Component, inject} from '@angular/core';
import {CarService} from './car.service';
@Component({
selector: 'app-root',
template: ``,
})
export class App {
display = '';
} | typescript | github | https://github.com/angular/angular | adev/src/content/tutorials/learn-angular/steps/20-inject-based-di/src/app/app.ts |
#! /usr/bin/env python
"""Test script for the dbm.open function based on testdumbdbm.py"""
import os
import unittest
import glob
import test.support
# Skip tests if dbm module doesn't exist.
dbm = test.support.import_module('dbm')
_fname = test.support.TESTFN
#
# Iterates over every database module supported by dbm... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | unknown | codeparrot/codeparrot-clean | ||
import json
import math
import re
from decimal import Decimal
from django.contrib.gis.db.models import GeometryField, PolygonField, functions
from django.contrib.gis.geos import (
GEOSGeometry,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
fromstr,
)
from django... | python | github | https://github.com/django/django | tests/gis_tests/geoapp/test_functions.py |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.business import CommandExecutionException
from tekton.gae.middleware.json_middleware import JsonResponse
from servico_app import facade
def index():
cmd = facade.list_servicos_cmd()
servico_list = cmd()
short_... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import print_function, division
from sympy.core.basic import Basic
from sympy.core.compatibility import is_sequence, as_int, string_types
from sympy.core.expr import Expr
from sympy.core.symbol import Symbol, symbols as _symbols
from sympy.core.sympify import CantSympify
from mp... | unknown | codeparrot/codeparrot-clean | ||
def switch_first_and_last(sequence):
'''return a sequence with the first and last items exchanged.'''
first = sequence[0]
last = sequence[-1]
# the problem here is that array[0] returns an int, not an arr
# and you can't concatenate an int and an arr
# so test for type before concatenating
i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
celery.utils.mail
~~~~~~~~~~~~~~~~~
How task error emails are formatted and sent.
:copyright: (c) 2009 - 2011 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import sys
import smtplib
try:
from email.mime.text... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.test.test_internet -*-
# $Id: default.py,v 1.90 2004/01/06 22:35:22 warner Exp $
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Select reactor
API Stability: stable
Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>}
"""
from time ... | unknown | codeparrot/codeparrot-clean | ||
/* global QUnit, SelectFilter */
'use strict';
QUnit.module('admin.SelectFilter2');
QUnit.test('init', function(assert) {
const $ = django.jQuery;
$('<form id="test"></form>').appendTo('#qunit-fixture');
$('<label for="id_id">Test</label>').appendTo('#test');
$('<div class="helptext">This is helpful.<... | javascript | github | https://github.com/django/django | js_tests/admin/SelectFilter2.test.js |
"""
Scheduler queues
"""
from __future__ import annotations
import marshal
import pickle
from pathlib import Path
from typing import TYPE_CHECKING, Any
from queuelib import queue
from scrapy.utils.request import request_from_dict
if TYPE_CHECKING:
from collections.abc import Callable
from os import PathLik... | python | github | https://github.com/scrapy/scrapy | scrapy/squeues.py |
# -*- coding: utf-8 -*-
"""
unit test for streaming interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2009 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import Environment
env = Environment()
def test_basic_streaming():
r"""
>>> tmpl = env.from_string("... | unknown | codeparrot/codeparrot-clean | ||
# Accelerator Integration
Since PyTorch 2.1, the community has made significant progress in streamlining the process of integrating new accelerators into the PyTorch ecosystem. These improvements include, but are not limited to: refinements to the `PrivateUse1` Dispatch Key, the introduction and enhancement of core su... | unknown | github | https://github.com/pytorch/pytorch | docs/source/accelerator/index.md |
// Copyright The Prometheus 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 w... | go | github | https://github.com/prometheus/prometheus | discovery/marathon/marathon_test.go |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 2
""" Simple example plotting 2D points.
"""
from vispy import gloo
from vispy import app
import numpy as np
VERT_SHADER = """
attribute vec2 a_position;
attribute vec3 a_color;
attribute float a_size;
varying vec4 v_fg_color;
varying vec4 v_bg_color;... | unknown | codeparrot/codeparrot-clean | ||
import * as ts from "../../_namespaces/ts.js";
import { dedent } from "../../_namespaces/Utils.js";
import {
baselineTsserverLogs,
closeFilesForSession,
openFilesForSession,
setCompilerOptionsForInferredProjectsRequestForSession,
TestSession,
} from "../helpers/tsserver.js";
import {
File,
T... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import osv
from openerp.report import report_sxw
def titlize(journal_name):
words = journal_name.split()
while words.pop() != 'journal':
continue
return ' '.join(words)
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright The Prometheus 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 ... | go | github | https://github.com/prometheus/prometheus | util/almost/almost.go |
<?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\FrameworkBundle\Routing;
use Symfony\Component\Config\Ex... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/auxdisplay/maxim,max6959.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MAX6958/6959 7-segment LED display controller
maintainers:
- Andy Shevchenko <andriy.shevchenko@linux.intel.com>
de... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/auxdisplay/maxim,max6959.yaml |
# coding=utf-8
"""InaSAFE Disaster risk assessment tool developed by AusAid
Contact : ole.moller.nielsen@gmail.com
.. note:: 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... | 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/configurationsample/method/NestedProperty.java |
# Copyright 2017 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.
"""URL endpoint for adding new histograms to the dashboard."""
from __future__ import print_function
from __future__ import division
from __future__ import a... | unknown | codeparrot/codeparrot-clean | ||
import {
codeFixAll,
createCodeFixAction,
registerCodeFix,
} from "../_namespaces/ts.codefix.js";
import {
cast,
Diagnostics,
Expression,
factory,
getTokenAtPosition,
isShorthandPropertyAssignment,
ShorthandPropertyAssignment,
SourceFile,
textChanges,
} from "../_namespac... | typescript | github | https://github.com/microsoft/TypeScript | src/services/codefixes/fixPropertyAssignment.ts |
"""Grading tests"""
import unittest
from xmodule import graders
from xmodule.graders import Score, aggregate_scores
class GradesheetTest(unittest.TestCase):
'''Tests the aggregate_scores method'''
def test_weighted_grading(self):
scores = []
Score.__sub__ = lambda me, other: (me.earned - othe... | unknown | codeparrot/codeparrot-clean | ||
import base64
import os
import email
import urllib.parse
import urllib.request
import http.server
import threading
import unittest
import hashlib
from test import support
from test.support import hashlib_helper
from test.support import threading_helper
try:
import ssl
except ImportError:
ssl = None
support.r... | python | github | https://github.com/python/cpython | Lib/test/test_urllib2_localnet.py |
<?php
$container->loadFromExtension('framework', [
'php_errors' => [
'throw' => true,
],
]); | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php |
/*!
* @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
*/
export interface AlgoliaConfig {
apiKey: string;
appId: string;
indexName: string;
} | typescript | github | https://github.com/angular/angular | adev/shared-docs/interfaces/algolia-config.ts |
/*
* rmgr.h
*
* Resource managers definition
*
* src/include/access/rmgr.h
*/
#ifndef RMGR_H
#define RMGR_H
typedef uint8 RmgrId;
/*
* Built-in resource managers
*
* The actual numerical values for each rmgr ID are defined by the order
* of entries in rmgrlist.h.
*
* Note: RM_MAX_ID must fit in RmgrId; wi... | c | github | https://github.com/postgres/postgres | src/include/access/rmgr.h |
#!/usr/bin/python
# (c) 2019, NetApp, 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',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
For django channels controller (akin to views.py).
Activated by config/routing.py
"""
import logging, pprint, time
# from django.contrib.sites.models import Site
from django.core.mail import EmailMessage
from django.utils import timezone
from email_... | unknown | codeparrot/codeparrot-clean | ||
import os
import numpy
import vigra
from functools import partial
from StringIO import StringIO
## Instead of importing requests and PIL here,
## use late imports (below) so people who don't use TiledVolume don't have to have them
# New dependency: requests is way more convenient than urllib or httplib
#import reques... | unknown | codeparrot/codeparrot-clean | ||
import re
# from appendix B of rfc 3986 (http://www.ietf.org/rfc/rfc3986.txt)
uri_pattern = r'^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?'
uri_re = re.compile(uri_pattern)
# gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
#
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
# / "*"... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Checkmate.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in t... | unknown | codeparrot/codeparrot-clean | ||
"""
Copyright 2014-2021 Vincent Texier <vit@free.fr>
DuniterPy 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.
DuniterPy is distributed in... | unknown | codeparrot/codeparrot-clean | ||
#
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | unknown | codeparrot/codeparrot-clean | ||
/*
* parallel.c
*
* multi-process support
*
* Copyright (c) 2010-2026, PostgreSQL Global Development Group
* src/bin/pg_upgrade/parallel.c
*/
#include "postgres_fe.h"
#include <sys/wait.h>
#ifdef WIN32
#include <io.h>
#endif
#include "pg_upgrade.h"
static int parallel_jobs;
#ifdef WIN32
/*
* Array holding ... | c | github | https://github.com/postgres/postgres | src/bin/pg_upgrade/parallel.c |
#ifndef RBIMPL_ARITHMERIC_ST_DATA_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMERIC_ST_DATA_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to ... | c | github | https://github.com/ruby/ruby | include/ruby/internal/arithmetic/st_data_t.h |
########################################################################
# File name: anonymous.py
# This file is part of: aiosasl
#
# LICENSE
#
# This program 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 Founda... | unknown | codeparrot/codeparrot-clean | ||
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2014 Realm 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/li... | c | github | https://github.com/realm/realm-swift | examples/tvos/objc/PreloadedData/Place.h |
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"includePaths": [".github/**"],
"schedule": "* 0 * * 1",
"minimumReleaseAge": "3 days",
"assignees": ["boomanaiden154"],
"ignorePaths": [".github/workflows/containers/**"],
"groupName": "[Github]... | json | github | https://github.com/llvm/llvm-project | .github/renovate.json |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package okta
import (
"encoding/json"
"fmt"
"os"
"strings"
"time"
"github.com/hashicorp/go-secure-stdlib/base62"
pwd "github.com/hashicorp/go-secure-stdlib/password"
"github.com/hashicorp/vault/api"
)
// CLIHandler struct
type CLIHandler... | go | github | https://github.com/hashicorp/vault | builtin/credential/okta/cli.go |
"""
Access to the Unix group database.
Group entries are reported as 4-tuples containing the following fields
from the group database, in order:
name - name of the group
passwd - group password (encrypted); often empty
gid - numeric ID of the group
mem - list of members
The gid is an integer, name an... | unknown | codeparrot/codeparrot-clean | ||
###
# Copyright (c) 2004, Brett Kelly
# Copyright (c) 2010, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notic... | unknown | codeparrot/codeparrot-clean | ||
import re
from guessit.patterns import sep, build_or_pattern
from guessit.patterns.numeral import parse_numeral
range_separators = ['-', 'to', 'a']
discrete_separators = ['&', 'and', 'et']
excluded_separators = ['.'] # Dot cannot serve as a discrete_separator
discrete_sep = sep
for range_separator in range_separator... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from django.contrib import auth, messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.forms import formset_factory
from django.shortcuts import get_object_or_404, redirect, render
from django.template.context_processors impor... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import re
import json
import os
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_urllib_parse,
compat_urllib_parse_urlparse
)
from ..utils import (
unified_strdate,
)
class NHLBaseInfoExtractor(InfoExtractor):
@staticmethod
... | unknown | codeparrot/codeparrot-clean | ||
import logging
import os
import sys
import threading
import time
chroma_logger = logging.getLogger("test")
chroma_logger.setLevel(logging.DEBUG)
try:
import nose
nose_installed = True
except ImportError:
nose_installed = False
if nose_installed:
# Monkey patch TextTestResult to print errors as they... | unknown | codeparrot/codeparrot-clean | ||
# icu_provider [](https://crates.io/crates/icu_provider)
<!-- cargo-rdme start -->
`icu_provider` is one of the `ICU4X` components.
Unicode's experience with ICU4X's parent projects, ICU4C and ICU4J, led the team to realize
that data management is the most cr... | unknown | github | https://github.com/nodejs/node | deps/crates/vendor/icu_provider/README.md |
#!/usr/bin/python
# Copyright: (c) 2018, Rob White (@wimnat)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
... | unknown | codeparrot/codeparrot-clean | ||
---
title: Pre-Rendering
---
# Pre-Rendering
[MODES: framework]
<br/>
<br/>
Pre-Rendering allows you to speed up page loads for static content by rendering pages at build time instead of at runtime.
## Configuration
Pre-rendering is enabled via the `prerender` config in `react-router.config.ts`.
The simplest con... | unknown | github | https://github.com/remix-run/react-router | docs/how-to/pre-rendering.md |
"""
WSGI config for djember 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 | ||
# 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 | ||
import threading
#import time ##DEBUG
#import logging ##DEBUG
__author__ = "Mateusz Kobos"
"""
This code is a derivative of the code from ActiveState Code service at the address:
http://code.activestate.com/recipes/577803-reader-writer-lock-with-priority-for-writers
and is licensed under the MIT license.
"""
class R... | unknown | codeparrot/codeparrot-clean | ||
from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.factors import CustomFactor, SimpleMovingAverage
from quantopian.pipeline.data import morningstar
import pandas as pd
import n... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2003 Iddo Friedberg. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
import sys
# Add path to Bio
sys.path.append('../..')
"""A parser for the NCBI blastpgp version ... | unknown | codeparrot/codeparrot-clean | ||
# Orca
#
# Copyright 2005-2008 Google Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library i... | unknown | codeparrot/codeparrot-clean | ||
import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, local, global, or per-user con... | 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 | ||
/*-------------------------------------------------------------------------
*
* joininfo.c
* joininfo list manipulation routines
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/backe... | c | github | https://github.com/postgres/postgres | src/backend/optimizer/util/joininfo.c |
/*
* Copyright (C) 2013 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/eventbus/SubscriberExceptionHandler.java |
import type { HydrationState } from "../../lib/router/router";
import { createMemoryHistory } from "../../lib/router/history";
import { createRouter, IDLE_NAVIGATION } from "../../lib/router/router";
import type {
AgnosticDataRouteObject,
AgnosticRouteObject,
} from "../../lib/router/utils";
import { data, ErrorRes... | typescript | github | https://github.com/remix-run/react-router | packages/react-router/__tests__/router/router-test.ts |
"""
WSGI config for awesome-app 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_APPLICATIO... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Pelican Comment System
======================
A Pelican plugin, which allows you to add comments to your articles.
Author: Bernhard Scheirle
"""
from __future__ import unicode_literals
import logging
import os
import copy
logger = logging.getLogger(__name__)
from itertools import chain
f... | unknown | codeparrot/codeparrot-clean | ||
(torch.compiler_ir)=
# IRs
PyTorch 2.0 offers two set of IRs for backends to interface with: Core Aten IR and Prims IR.
## Core Aten IR
Core aten ops is the core subset of aten operators that can be used to compose other operators.
Core aten IR is fully functional, and there is no `inplace` or `_out` variants in th... | unknown | github | https://github.com/pytorch/pytorch | docs/source/user_guide/torch_compiler/torch.compiler_ir.md |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\___... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es2017/asyncArrowFunction/arrowFunctionWithParameterNameAsync_es2017.ts] ////
//// [arrowFunctionWithParameterNameAsync_es2017.ts]
const x = async => async;
//// [arrowFunctionWithParameterNameAsync_es2017.js]
"use strict";
var x = function (async) { return async; }; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es5).js |
/*
* Copyright (C) 2014 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/src/com/google/common/graph/Graph.java |
/* __next_internal_action_entry_do_not_use__ {"001ab723c80dcca470e0410b4b2a2fc2bf21f41476":{"name":"c"},"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"006e7bc104e4d6e7fda190c4a51be969cfd0be6d6d":{"name":"a"},"00d1f7eb64271d7c601dfef7d4d7053de1c2ca4338":{"name":"b"}} */ import { registerS... | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js |
#!/usr/bin/env python
# Copyright 2014 the V8 project 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 argparse
import os
import subprocess
import sys
BOTS = {
'--arm32': 'v8_arm32_perf_try',
'--linux32': 'v8_linux32_perf_tr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-24 23:40
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('content... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 02 08:41:08 2014
@author: Acer
"""
import sys
import pycd3
import math
class NodeFactory(pycd3.INodeFactory):
def __init__(self, node):
pycd3.INodeFactory.__init__(self)
self.node = node
print "NodeFactory.__init__"
def getNodeName(self)... | unknown | codeparrot/codeparrot-clean | ||
# This must be a play as we need to invoke it with the ANSIBLE_SCP_IF_SSH env
# to control the mechanism used. Unfortunately while ansible_scp_if_ssh is
# documented, it isn't actually used hence the separate invocation
---
- name: further fetch tests with metachar characters in filename
hosts: windows
force_handle... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/connection_windows_ssh/tests_fetch.yml |
/** Add your relevant code here for the issue to reproduce */
export default function Home() {
return null;
} | typescript | github | https://github.com/vercel/next.js | examples/reproduction-template-pages/pages/index.tsx |
---
navigation_title: Query across clusters
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-cross-clusters.html
applies_to:
stack: preview =9.0, ga 9.1+
serverless: unavailable
products:
- id: elasticsearch
---
# Use ES|QL across clusters [esql-cross-clusters]
With {{esql}... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/esql-cross-clusters.md |
@file:OptIn(ExperimentalContracts::class)
@file:Suppress("LEAKED_IN_PLACE_LAMBDA", "WRONG_INVOCATION_KIND")
package kotlinx.coroutines
import kotlinx.coroutines.internal.*
import kotlinx.coroutines.intrinsics.*
import kotlinx.coroutines.selects.*
import kotlin.contracts.*
import kotlin.coroutines.*
import kotlin.coro... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/src/Timeout.kt |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | unknown | codeparrot/codeparrot-clean | ||
use std::fmt;
use derive_more::Error;
/// Copy of `http_range::HttpRangeParseError`.
#[derive(Debug, Clone)]
enum HttpRangeParseError {
InvalidRange,
NoOverlap,
}
impl From<http_range::HttpRangeParseError> for HttpRangeParseError {
fn from(err: http_range::HttpRangeParseError) -> Self {
match err... | rust | github | https://github.com/actix/actix-web | actix-files/src/range.rs |
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
import { initializeFromLocalStorage } from "./initializeFromLocalStorage";
export const localStorageKeyCollapsedPools = "serviceDiscovery.collapsedPools";
export const localStorageKeyTargetHealthFilter =
"serviceDiscovery.healthFilter";
interface Servic... | typescript | github | https://github.com/prometheus/prometheus | web/ui/mantine-ui/src/state/serviceDiscoveryPageSlice.ts |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.