prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>sha2.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licen... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*!
Contains everything related to vertex buffers.
The main struct is the `VertexBuffer`, which represents a buffer in the video memory,
containing a list of vertices.
In order to create a vertex buffer, you must first create a struct that represents each vertex,
and i... | },
]; |
<|file_name|>summary_test_internal.py<|end_file_name|><|fim▁begin|># 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:/... | # See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Internal helpers for tests in this directory.""" |
<|file_name|>FrogJump.cpp<|end_file_name|><|fim▁begin|>/*
A small frog wants to get to the other side of the road. The frog is currently located at position X and wants to get to a position greater than or equal to Y. The small frog always jumps a fixed distance, D.
Count the minimal number of jumps that the small frog... | that, given three integers X, Y and D, returns the minimal number of jumps from position X to a position equal to or greater than Y.
|
<|file_name|>mapper.py<|end_file_name|><|fim▁begin|>import sys
from geopy import Point
from django.apps import apps as django_apps
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import color_style
from .geo_mixin import GeoMixin
LANDMARK_NAME = 0
LATITUDE = 2
LETTERS = lis... | def raise_if_not_in_map_area(self, point):
self.raise_if_not_in_radius(
point, self.area_center_point, self.area_radius, |
<|file_name|>test_filters.py<|end_file_name|><|fim▁begin|>from pygraz_website import filters
class TestFilters(object):
def test_url_detection(self):
"""
Test that urls are found correctly.
"""
no_urls_string = '''This is a test without any urls in it.'''
urls_string = '''Th... | |
<|file_name|>window.rs<|end_file_name|><|fim▁begin|>/* 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/. */
//! A windowing implementation using glutin.
use NestedEventL... | }
|
<|file_name|>easy-249.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
'''
given a list of stock price ticks for the day, can you tell me what
trades I should make to maximize my gain within the constraints of the
market? Remember - buy low, sell high, and you can't sell before you
buy.
Sample Input
19.35 19.3... | help='prices of a given stock')
return parser.parse_args()
|
<|file_name|>Level.js<|end_file_name|><|fim▁begin|>/*
* Copyright © 2012 Pedro Agullo Soliveres.
*
* This file is part of Log4js-ext.
*
* Log4js-ext 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 Fo... | this.initConfig(cfg);
},
|
<|file_name|>blob.rs<|end_file_name|><|fim▁begin|>/* 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/. */
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen:... | let msg = FileManagerThreadMsg::ReadFile(chan, id, check_url_validity, origin);
let _ = file_manager.send(msg); |
<|file_name|>string_type.cpp<|end_file_name|><|fim▁begin|>// -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
#define YBUTIL_SOURCE
#include "util/string_type.h"
#if defined(YB_USE_WX)
#include <wx/strconv.h>
#elif defined(YB_USE_QT)
#include <QTextCodec>
#endif
#include <cstring>
#include <l... | |
<|file_name|>shell.py<|end_file_name|><|fim▁begin|>"""Contains utility functions for working with the shell"""
from contextlib import contextmanager
import datetime
from decimal import Decimal
import json
import pprint
import sys
import time
import traceback
SHELL_CONTROL_SEQUENCES = {
'BLUE': '\033[34m',
'LT... | |
<|file_name|>gitutil.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import command
import re
import os
import series
import subprocess
import sys
import terminal
import checkpatch
import settings
def CountCommitsToBranch():
"""Returns number... | |
<|file_name|>Linux.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013-2017 Chris Lalancette <clalancette@gmail.com>
# 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;
# version 2.1 of th... | if action == "gen_only" and self.safe_icicle_gen:
# no need to teardown because we simply discard the file
# containing those changes
os.unlink(cow_diskimage) |
<|file_name|>testing.py<|end_file_name|><|fim▁begin|>from contextlib import contextmanager
import logging
import unittest
from .context import Context
log = logging.getLogger(__name__)
class EphemeralContextTestCase(unittest.TestCase):
def setUp(self):
self.context = Context()
log.debug('XXX Starting cont... | |
<|file_name|>BreadcrumbItem.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react";
import { ReactLIAttr } from "../../../typings/shared";
import { LinkProps } from "../Link";
interface InheritedProps extends ReactLIAttr {
href?: LinkProps["href"],
}
export interface BreadcrumbItemProps extends Inherite... | isCurrentPage?: boolean,
} |
<|file_name|>opts.go<|end_file_name|><|fim▁begin|>package httpmux
import "net/http"
// ConfigOption is the interface for updating config options.
type ConfigOption interface {
Set(c *Config)
}
// ConfigOptionFunc is an adapter for config option functions.
type ConfigOptionFunc func(c *Config)
// Set implements the... |
// WithRedirectTrailingSlash returns a ConfigOption that uptates the Config.
func WithRedirectTrailingSlash(v bool) ConfigOption {
return ConfigOptionFunc(func(c *Config) { c.RedirectTrailingSlash = v }) |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>declare module "svgpath" {
interface SvgPath {
(path: string): SvgPath;
new (path: string): SvgPath;
abs(): SvgPath;<|fim▁hole|> rotate(angle: number, rx?: number, ry?: number): SvgPath;
skewX(degrees: number): SvgPath;
skewY(degrees: number)... | scale(sx: number, sy?: number): SvgPath;
translate(x: number, y?: number): SvgPath; |
<|file_name|>tailsitter.cpp<|end_file_name|><|fim▁begin|>/*
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... | SRV_Channels::set_output_scaled(SRV_Channel::k_tiltMotorRight, 0);
} |
<|file_name|>ContainerValidationIntegrationTest.java<|end_file_name|><|fim▁begin|>package org.baeldung;
import static org.junit.Assert.assertEquals;
import java.util.Collections;
import java.util.OptionalInt;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
impor... | customer.setName("John"); |
<|file_name|>overloaded-index-in-field.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.... | fn get_from_ref(&self) -> int { *self }
fn inc(&mut self) { *self += 1; }
} |
<|file_name|>OverrideImplementsAnnotationsHandler.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.generation;
import com.intellij.codeInsight.AnnotationUtil;
i... | GlobalSearchScope moduleScope = module != null ? GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module) : null;
Project project = target.getProject();
JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
|
<|file_name|>native_tree_tag.hpp<|end_file_name|><|fim▁begin|>// -*- C++ -*-
// Copyright (C) 2005-2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as ... | } // namespace test
} // namespace __gnu_pbds
#endif |
<|file_name|>0005_remove_position_incumbent.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('nomcom', '0004_auto_20151027_0829'),<|fim▁hole|> model_name='p... | ]
operations = [
migrations.RemoveField( |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod block_on_serial_directory_create;
pub use block_on_serial_directory_create::block_on_serial_directory_create;
mod watch_device_directory;
pub use watch_device_directory::watch_device_directory;
use xactor::Actor;
use eyre::{
// eyre,
Result,
// Context ... | ).await;
|
<|file_name|>map.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <map>
#include <stdexcept>
using namespace std;
int main(int argc, char* argv[]){
map<string, int> m;<|fim▁hole|> m["alice"] = 89;
m["billy"] = 3;
// print it out
map<string,int>::iterator i;
for(i = m.begin(); i != m.end(); i++){... |
m["bob"] = 56; |
<|file_name|>bus.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import SUPERUSER_ID<|fim▁hole|>
class MailChatController(BusController):
def _default_request_uid(self):
""" For Anonymous people, they receive the ... | from odoo.http import request, route
from odoo.addons.bus.controllers.main import BusController
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pupa.scrape import Jurisdiction, Organization
from .bills import MNBillScraper
from .committees import MNCommitteeScraper
from .people import MNPersonScraper<|fim▁hole|>from .common import url_xpath
"""
Minnesota legislative data can be found at the Office of ... | from .vote_events import MNVoteScraper
from .events import MNEventScraper |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from safeurl.core import getRealURL
class MainTestCase(TestCase):
def test_decodeUrl(self):
self.assertEqual(getRealURL('http://bit.ly/1gaiW96'),
'https://www.yandex.ru/')
def test_decodeUrlArray... | ['Failed', 'https://www.yandex.ru/', 'Failed']) |
<|file_name|>hamster-cli.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# - coding: utf-8 -
# Copyright (C) 2010 Matías Ribecky <matias at mribecky.com.ar>
# Copyright (C) 2010-2012 Toms Bauģis <toms.baugis@gmail.com>
# Copyright (C) 2012 Ted Smith <tedks at cs.umd.edu>
# This file is part of Project Hamster.... | self._open_window(action.get_name(), data)
def on_activate_quit(self, data=None): |
<|file_name|>sample.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# sample module
from jira.client import JIRA
def main():
jira = JIRA()
JIRA(options={'server': 'http://localhost:8100'})<|fim▁hole|> print projects
for project in projects:
print project.key
# Standard boilerplate to cal... | projects = jira.projects() |
<|file_name|>DeleteAuthenticationProfileRequest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. A copy of the Li... | */
private String authenticationProfileName;
/** |
<|file_name|>test_run.py<|end_file_name|><|fim▁begin|>import tempfile
import shutil
import sys
from unittest import mock
import pytest
from tools.wpt import run
from tools import localpaths # noqa: F401
from wptrunner.browsers import product_list
<|fim▁hole|>
class Virtualenv(virtualenv.Virtualenv):
def ... |
@pytest.fixture(scope="module")
def venv():
from tools.wpt import virtualenv |
<|file_name|>test_job_submission.py<|end_file_name|><|fim▁begin|>import logging
import os
import sys
import time
import json
import jsonschema
import pprint
import pytest
import requests
from ray._private.test_utils import (
format_web_url,
wait_for_condition,
wait_until_server_available,
)
from ray.dashb... | # TODO(architkulkarni): Disable automatic camelcase.
assert entry["runtimeEnv"] == {"envVars": {"RAYTest456": "456"}} |
<|file_name|>struct-namespace.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apac... | |
<|file_name|>rdf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pygments.lexers.rdf
~~~~~~~~~~~~~~~~~~~
Lexers for semantic web and RDF query languages and markup.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re... | (r'.', String.Escape, '#pop'),
],
'end-of-string': [
(r'(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)', |
<|file_name|>ContextAware.java<|end_file_name|><|fim▁begin|>package main.origo.core.actions;
import main.origo.core.event.NodeContext;
import play.mvc.Action;
import play.mvc.Http;
import play.mvc.Result;
import play.mvc.With;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java... | } |
<|file_name|>20180515155000-app-features.js<|end_file_name|><|fim▁begin|>'use strict';
const migrate = require('../scripts/migrate-sql');
<|fim▁hole|><|fim▁end|> | exports.up = db => migrate.migrate(db, '20180515155000-app-features.sql'); |
<|file_name|>basic_definitions.py<|end_file_name|><|fim▁begin|># 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... |
def inner_fn(y): |
<|file_name|>inheritedClassAttrAssignmentAndOwnWithAttrAndInheritedSlots.py<|end_file_name|><|fim▁begin|>class B(object):
attr = 'baz'
__slots__ = ['f', 'b']
class C(B):
__slots__ = ['attr', 'bar']
C.attr = 'spam'
print(C.attr)
c = C()
<warning descr="'C' object attribute 'attr' is read-only">c.attr</war... | print(c.attr) |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import urllib2
from BeautifulSoup import BeautifulSoup
# Download the HTML
request = urllib2.Request('http://www.uci.edu')
response = urllib2.urlopen(request)
print '\r\n\r\n'
# Verify that everything went ok.
# Error codes: 200 == good, 404... |
# Parse the HTML into a dom object via our BS library. |
<|file_name|>family_filter.py<|end_file_name|><|fim▁begin|>from .sample_filter import SampleFilter, GtFilter
from .sv_gt_filter import SvGtFilter
import logging
from collections import OrderedDict, defaultdict
class FamilyFilter(object):
'''
Determine whether variants/alleles fit given inheritance
... | var_to_segregants[sb.segregant.var_id].append(sb.segregant) |
<|file_name|>rules_iterator.rs<|end_file_name|><|fim▁begin|>/* 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/. */
//! An iterator over a list of rules.
use context::Qu... | }
supports_rule.rules.read_with(self.guard).0.iter()
}, |
<|file_name|>stream.tsx<|end_file_name|><|fim▁begin|>/**
* Converts a stream query to an object representation, with
* keys representing tag names, and the magic __text key
* representing the text component of the search.
*
* Example:
*
* "python is:unresolved assigned:foo@bar.com"
* => {
* __text: "pytho... | if (text.length) {
queryObj.__text = text.join(' ');
}
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//
// Copyright 2021 The Project Oak 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
//<|fim▁hole|>// http://www.apache.org/li... | |
<|file_name|>hash.go<|end_file_name|><|fim▁begin|>/*
A hashtable class, supports a more efficient lookup than standard dynamic relations
(c) 2001-2006 F.G. McCabe
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... | ((H,V) in I *> table:=__hashinsert(table,H,V));
}.
|
<|file_name|>1.cc<|end_file_name|><|fim▁begin|>// 2001-06-14 Benjamin Kosnik <bkoz@redhat.com>
<|fim▁hole|>//
// This file is part of the GNU ISO C++ Library. This library 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... | // Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation, Inc. |
<|file_name|>TagRequestResponseHandlerTest.java<|end_file_name|><|fim▁begin|>package com.mdsgpp.cidadedemocratica.requester;
import android.test.AndroidTestCase;
import com.mdsgpp.cidadedemocratica.model.Tag;
import org.json.JSONArray;
import org.json.JSONException;
import org.junit.Test;
import java.util.ArrayList... | |
<|file_name|>test_extension.py<|end_file_name|><|fim▁begin|>import unittest
from mopidy_tunein import Extension
class ExtensionTest(unittest.TestCase):
def test_get_default_config(self):
ext = Extension()
config = ext.get_default_config()
self.assertIn("[tunein]", config)
self.a... | schema = ext.get_config_schema() |
<|file_name|>morautils.py<|end_file_name|><|fim▁begin|># Utility functions for OpenMORA scripts
#
# Part of OpenMora - https://github.com/OpenMORA
import os, sys, string
import platform
import yaml
def get_mora_paths():
""" Returns a list of paths with MORA modules, from the env var MORA_PATH
"""
if not 'MORA_PATH... | |
<|file_name|>basic.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/gopher-net/gnet-ctl/Godeps/_workspace/src/github.com/Sirupsen/logrus"
)
var log = logrus.New()
func init() {
log.Formatter = new(logrus.JSONFormatter)
log.Formatter = new(logrus.TextFormatter) // default
}
func main() {
defer f... | |
<|file_name|>help.js<|end_file_name|><|fim▁begin|>"use strict";
var os = require("os");
var fs = require('fs');
var settings = require("../config.js").settings;
exports.module = function() {
this.onCommand_help = function(nick, command) {
var chan = this.channel;
fs.readFile('./package.json', 'utf-8', function(er... | });
};
}; |
<|file_name|>synth.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC
#
# 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 re... | '\\1#\\2 Override for the service hostname, or `nil` to leave as the default.\n' + |
<|file_name|>abs.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::arithmetic::traits::{Abs, AbsAssign, UnsignedAbs};
use malachite_base_test_util::bench::{run_benchmark, BenchmarkType};
use malachite_base_test_util::generators::common::{GenConfig, GenMode};
use malachite_base_test_util::runner::Runner;
use mala... | ) {
run_benchmark( |
<|file_name|>SegmentReader.java<|end_file_name|><|fim▁begin|>package org.apache.lucene.index;
/**
* Copyright 2004 The Apache Software Foundation
*
* 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 Li... | }
else if (fi.storeOffsetWithTermVector && fi.storePositionWithTermVector == false && fieldOption == IndexReader.FieldOption.TERMVECTOR_WITH_OFFSET) { |
<|file_name|>LoadingFragment.java<|end_file_name|><|fim▁begin|>// vim: et sw=4 sts=4 tabstop=4
/*
* 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/LIC... | *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>git_db.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.utils.translation import ugettext
from django.utils import simplejson as json
from django.conf import settings
from StringIO import StringIO
from gitdb import IStream
from git import *
from git.exc import InvalidGitRepositoryError... | # Create the initial commit |
<|file_name|>vtree.cpp<|end_file_name|><|fim▁begin|>// Copyright 2017 Dan Ristic
#include "chimera/virtual/vtree.h"
<|fim▁hole|>namespace Chimera {
namespace Virtual {
VirtualElement::VirtualElement(
std::string _name,
std::vector<Attribute> _attributes)
: name{_name}
{
for (auto& attribute : _attrib... | |
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>#[test]
fn ui() {
let t = trybuild::TestCases::new();<|fim▁hole|> // https://github.com/rust-lang/rust/issues/55779
// there is a workaround in the file.
t.pass("tests/ui/04-event-sanity-check.rs");
t.compile_fail("tests/ui/05-named-fields.rs");
... | // rustc overflows when compiling this see: |
<|file_name|>modify_body_inject_iframe.py<|end_file_name|><|fim▁begin|># Usage: mitmdump -s "iframe_injector.py url"
# (this script works best with --anticache)
import sys
from bs4 import BeautifulSoup
class Injector:
def __init__(self, iframe_url):
self.iframe_url = iframe_url
def response(self, flo... | html.body.insert(0, iframe) |
<|file_name|>const-float-classify.rs<|end_file_name|><|fim▁begin|>// compile-flags: -Zmir-opt-level=0
// run-pass
#![feature(const_float_bits_conv)]
#![feature(const_float_classify)]
#![feature(const_trait_impl)]
// Don't promote
const fn nop<T>(x: T) -> T { x }
macro_rules! const_assert {
($a:expr, $b:expr) => ... | }
fn f64() {
suite_inner!(f64 $($tt)*); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """ Additional extras go here.
""" |
<|file_name|>articles.client.controller.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('articles').controller('ArticlesController', ['$scope', '$stateParams', '$location', 'Authentication', 'Articles',
function($scope, $stateParams, $location, Authentication, Articles) {
$scope.authentication = Authen... | } |
<|file_name|>lrcserv.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
#auther mengskysama
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.httpclient
import lcs
from urllib import quote
from urllib import unquote
from tornado import gen
import ttlrcdump
... |
#print repr(keyword)
keyword = keyword.encode('gbk')
#print repr(keyword) |
<|file_name|>run_pynacl_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be<|fim▁hole|>import sys
import unittest
MODULES = [
'directory_storage_test',
'gsd_storage_... | # found in the LICENSE file.
"""Run all python tests in this directory."""
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from cStringIO import StringIO
from datetime import datetime
from unidecode import unidecode
from handler import Patobj, PatentHandler<|fim▁hole|>import xml_util
import xml_driver
xml_string = 'ipg050104.xml'
xh = xml_driver.XMLHandler()
parser = xml_driver.make_parse... | import re
import uuid
import xml.sax |
<|file_name|>virtualmachineimages.go<|end_file_name|><|fim▁begin|>package compute
// Copyright (c) Microsoft and contributors. 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 ... | |
<|file_name|>introspection.py<|end_file_name|><|fim▁begin|>import warnings
from collections import namedtuple
from MySQLdb.constants import FIELD_TYPE
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models.indexes import Index
from django.utils... | cursor.execute(name_query, [table_name])
for constraint, column, ref_table, ref_column in cursor.fetchall():
if constraint not in constraints: |
<|file_name|>Komponist.java<|end_file_name|><|fim▁begin|>package de.choesel.blechwiki.model;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.util.UUID;
/**
* Created by christian on 05.05.16.
*/
@DatabaseTable(tableName = "komponist")
public class Komponist {
... | |
<|file_name|>test_lease_read.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
//! A module contains test cases for lease read on Raft leader.
use std::sync::atomic::*;
use std::sync::{mpsc, Arc, Mutex};
use std::time::*;
use std::{mem, thread};
use kvproto::metapb;
u... | must_error_read_on_peer(cluster, peer, region, key, Duration::from_secs(1));
}
#[test] |
<|file_name|>texttrackcue.rs<|end_file_name|><|fim▁begin|>/* 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 https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::... | end_time: Cell<f64>,
pause_on_exit: Cell<bool>,
}
|
<|file_name|>CodeGenTest.java<|end_file_name|><|fim▁begin|>/*
* 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
*<|fim▁hole|> * distributed under the License i... | * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software |
<|file_name|>sequenced_worker_pool.cc<|end_file_name|><|fim▁begin|>// 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.
#include "base/threading/sequenced_worker_pool.h"
#include <list>
#include <map>
#... | has_work_cv_.Signal();
if (testing_observer_) { |
<|file_name|>LambdaListParser.java<|end_file_name|><|fim▁begin|>package jcl.compiler.sa.analyzer.lambdalistparser;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.function.Predicate;
import jcl.compiler.environment.Environment;
import jcl.compiler.environment.binding.Bin... | optionalBindings.add(optionalBinding);
} else { |
<|file_name|>tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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 ... | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License. |
<|file_name|>packageResource.spec.js<|end_file_name|><|fim▁begin|>require( "../setup" );
var packageResource = require( "../../resource/package/resource.js" );
describe( "Package Resource", function() {
var server = { checkForNew: _.noop };
describe( "when getting new package callback", function() {
describe( "wit... | }
};
serverMock = sinon.mock( server ); |
<|file_name|>FieldMappingEntryTests.java<|end_file_name|><|fim▁begin|>package ar.wildstyle;
import java.lang.reflect.Field;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import ar.wildstyle.test.BaseTest;
import ar.wildstyle.test.ExamplePojo;
import ar.wildstyle.valuegenerator.IntegerValue... | final FieldMappingEntry<String> fieldMappingEntry = new FieldMappingEntry<String>(this.field, this.value);
|
<|file_name|>instr_vpsubw.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn vpsubw_1() {
run_test(&Instruct... | run_test(&Instruction { mnemonic: Mnemonic::VPSUBW, operand1: Some(Direct(YMM7)), operand2: Some(Direct(YMM0)), operand3: Some(Direct(YMM1)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 249, 249], OperandSize::Dword)
}
|
<|file_name|>extract.go<|end_file_name|><|fim▁begin|>package source
import (
log "github.com/Sirupsen/logrus"
"github.com/howardplus/lirest/describe"
"github.com/howardplus/lirest/util"
"os"
"strconv"
"strings"
"time"
)
// Extractor returns a generic data based
// on the converter.
// An object that implements... | } else if strings.HasSuffix(s.Refresh, "m") { |
<|file_name|>SSDAC1.C<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2015, Digi International Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all co... | exit(0);
}
|
<|file_name|>gui_editor.py<|end_file_name|><|fim▁begin|>import math
from pathlib import Path
from tkinter import W, N, E, StringVar, PhotoImage
from tkinter.ttk import Button, Label, LabelFrame
from overrides import overrides
from pyminutiaeviewer.gui_common import NotebookTabBase
from pyminutiaeviewer.minutia import... | self.ridge_ending_image_label = Label(self, image=self.ridge_ending_image)
self.ridge_ending_image_label.grid(row=4, column=0, sticky=W) |
<|file_name|>test_debug.py<|end_file_name|><|fim▁begin|>import importlib
import inspect
import os
import re
import sys
import tempfile
from io import StringIO
from pathlib import Path
from django.conf.urls import url
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django... | self.assertNotIn('sauce', body)
self.assertNotIn('worcestershire', body)
for k, v in self.breakfast_data.items():
# All POST parameters' names are shown. |
<|file_name|>notification_log.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from f... | |
<|file_name|>1395_count-number-of-teams.py<|end_file_name|><|fim▁begin|># 1395. Count Number of Teams - LeetCode
# https://leetcode.com/problems/count-number-of-teams/
from typing import List
# 暴力搜索都 AC 了
# 其实有两次筛选的算法
<|fim▁hole|>class Solution:
def numTeams(self, rating: List[int]) -> int:
if len(rating)... | |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>package ch.dritz.remedy2redmine;
import java.io.File;
import java.io.IOException;
import ch.dritz.common.Config;
import ch.dritz.remedy2redmine.modules.SyncModule;
/**
* Main class for Remedy2Redmine
* @author D.Ritz
*/
public class Main
{
private static void ... | usage("Unknown command");
}
}
} |
<|file_name|>ProductionStep.py<|end_file_name|><|fim▁begin|>""" Class defining a production step """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
<|fim▁hole|>from DIRAC import S_OK, S_ERROR
class ProductionStep(object):
"""Define... | import json
|
<|file_name|>AddressTerm.java<|end_file_name|><|fim▁begin|>/*
* 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 und... | protected AddressTerm(Address address) {
this.address = address;
} |
<|file_name|>run_lighthouse_tests.py<|end_file_name|><|fim▁begin|># Copyright 2020 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.... | LIGHTHOUSE_MODE_ACCESSIBILITY: {
'1': '.lighthouserc-accessibility-1.js',
'2': '.lighthouserc-accessibility-2.js'
} |
<|file_name|>memo.py<|end_file_name|><|fim▁begin|># -*- coding: ISO-8859-15 -*-
from core.Uusipuu import UusipuuModule
import random, time
class Module(UusipuuModule):
def startup(self):
if 'memo' not in self.config:
self.config['memo'] = {}
def privmsg(self, user, target, msg):
... | def meta_searchkey(self, user, key): |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import re
import socket
import sys
import time
import math
from ..compat import (
compat_cookiejar,
compat_cookies,
compat_etree_froms... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* 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/. */
//! This module contains APIs for the `profile` crate used generi... | |
<|file_name|>ErrorProcessorTestCase.java<|end_file_name|><|fim▁begin|>/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as ... | mockDispatcherServletService(request, response);
final String content = response.body(); |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>import sys
import multiprocessing
import os.path as osp
import gym
from collections import defaultdict
import tensorflow as tf
import numpy as np
from baselines.common.vec_env.vec_video_recorder import VecVideoRecorder
from baselines.common.vec_env.vec_frame_stack impor... | return 'mlp'
|
<|file_name|>messageevent.rs<|end_file_name|><|fim▁begin|>/* 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/. */
use dom::bindings::codegen::Bindings::EventBinding::Even... | HandleValue::undefined(),
DOMString::new(),
DOMString::new())
} |
<|file_name|>feature_notifications.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -alertnotify, -blocknotify and ... | with open(self.tx_filename, 'r') as f:
assert_equal(sorted(txids_rpc), sorted(f.read().splitlines()))
|
<|file_name|>lz4.rs<|end_file_name|><|fim▁begin|>extern crate lz4;
use std::env;
use std::fs::File;
use std::io::Read;
use std::io::Result;
use std::io::Write;
use std::iter::FromIterator;
use std::path::Path;
fn main() {
println!("LZ4 version: {}", lz4::version());
let suffix = ".lz4";
for arg in Vec::fr... | (_, result) => result, |
<|file_name|>LibSprite.ts<|end_file_name|><|fim▁begin|>/*****************************************************************************
* Represents a 2D sprite - An image that consists of different frames
* and is used for displaying an animation.
*
* @author Christopher Stock
* @version ... | |
<|file_name|>runhub.py<|end_file_name|><|fim▁begin|>"""
Launcher for homity-hub
"""
from Hub import app
from Hub.api import hub_config
import cherrypy
from paste.translogger import TransLogger
if hub_config.get('ssl_enable'):
from OpenSSL import SSL
def run_cherrypy():
"""Start CherryPy server."""
#Enab... | # Mount the WSGI callable object (app) on the root directory
cherrypy.tree.graft(app_logged, '/')
# Set the configuration of the web server |
<|file_name|>ajax.ts<|end_file_name|><|fim▁begin|>import { Log } from './log';
//import Url = require('./url');
import { Url } from './url';
import { HashString } from './lib';
/**
* Делаем HTTP (Ajax) запрос.
*
* @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A d... | original(jqXHR, textStatus, errorThrown);
Log('Ajax.error()', textStatus, errorThrown); |
<|file_name|>plot_timebar.py<|end_file_name|><|fim▁begin|>""" Implementation of WaterFrame.plot_bar(key, ax=None, average_time=None)"""
import datetime
def plot_timebar(self, keys, ax=None, time_interval_mean=None):
"""
Make a bar plot of the input keys.
The bars are positioned at x with date/time. T... |
if isinstance(keys, list):
ax = df[keys].plot.bar(ax=ax, legend=True)
else:
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.