prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>NativeBinarySpecInternal.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 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
*
* htt... | Collection<NativeBinaryRequirementResolveResult> getAllResolutions();
Map<File, PreCompiledHeader> getPrefixFileToPCH();
|
<|file_name|>_http.py<|end_file_name|><|fim▁begin|># Copyright 2016 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 r... | |
<|file_name|>ExternalOperation.hpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2014-2022 The Voxie Authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, incl... | |
<|file_name|>restfulhelpers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Useful classes and methods to aid RESTful webservice development in Pyramid.
PythonPro Limited
2012-01-14
"""
import json
import httplib
import logging
import traceback
#from decorator import decorator
from pyramid.request import... | the data field will contain whatever is returned from the response
normal i.e. any valid type.
""" |
<|file_name|>objects-owned-object-owned-method.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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
// htt... | struct BarStruct {
x: usize
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'app.views.home', name='ho... | |
<|file_name|>errors.ts<|end_file_name|><|fim▁begin|>export class TrainingCanceledError extends Error {
constructor() {
super('Training Canceled')
}<|fim▁hole|> constructor() {
super('Training Already Started')
}
}<|fim▁end|> | }
export class TrainingAlreadyStartedError extends Error { |
<|file_name|>extract_flat_files.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""This script run the pathologic """
try:
import optparse, sys, re, csv, traceback
from optparse import OptionGroup
import pickle
import math
from libs.python_modules.taxonomy.LCAComputation import *
import operator
... | resultLines = pythonCyc.getReactionListLines()
#pythonCyc.stopPathwayTools()
reaction_list_file = open(options.reactions_list + ".tmp", 'w')
for line in resultLines: |
<|file_name|>ChromecastMessagingController.js<|end_file_name|><|fim▁begin|>module.exports = {
clientCheckin: function(req, res, sockets) {
console.log("clientnameee:", req.body);
req.body.alert.expiresAt = new Date(new Date().getTime() + 10000); //FIVE SECS DURATION HARD CODED! NOT COOL!!
s... | res.end();
},
|
<|file_name|>processor_php.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import os
from core.base_processor import xBaseProcessor
from utilities.export_helper import xExportHelper
from utilities.file_utili... |
strContent = '' |
<|file_name|>xapi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free... | |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Provides:
- List; like list but returns None instead ... | import cPickle
import portalocker |
<|file_name|>MailboxMessages.tsx<|end_file_name|><|fim▁begin|>import * as PropTypes from 'prop-types';
import * as React from 'react';
const propTypes = {
children: PropTypes.node,
};
const MailboxMessages: React.StatelessComponent<{}> = ({ children }) => (
<div className="table-responsive mailbox-messages">
... |
export default MailboxMessages; |
<|file_name|>vnc_kombu.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
import re
from distutils.util import strtobool
import kombu
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import time
import signal
from gevent.queue import Queue
try:
from geve... | __all__ = "VncKombuClient"
class VncKombuClientBase(object): |
<|file_name|>sqlitelockfile.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division
import time
import os
try:
unicode
except NameError:
unicode = str
from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
class SQLiteLockFile(LockBase):
"Demonstrate SQL-based ... | |
<|file_name|>test_xmlreader.py<|end_file_name|><|fim▁begin|>import xml.sax
import unittest
import test_utils
import xmlreader
import os
path = os.path.dirname(os.path.abspath(__file__) )
class XmlReaderTestCase(unittest.TestCase):
def test_XmlDumpAllRevs(self):
pages = [r for r in xmlreader.XmlDump(path... | |
<|file_name|>predicates.py<|end_file_name|><|fim▁begin|>from django.contrib.contenttypes.models import ContentType
from rules import Predicate
from core.permissions.models import Rule
class HasPermission(object):
"""
Class generator which return a predicate function parametrized by a
permission name.<|f... | """ |
<|file_name|>0022_therapeutsettings_invoice_footer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('libreosteoweb', '0021_therapeutsettings_siret'),
]
... | migrations.AddField(
model_name='therapeutsettings', |
<|file_name|>t_LogUniformFactory_std.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator().SetSeed(0)
try :
distribution = LogUniform(1.0, 2.5)
size = 10000
sample = distribution.getSample(size)
factory = LogUniformFactory
covariance = Cov... | print "LogUniform =", distribution |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
#... | # Author: Leonardo Pistone |
<|file_name|>MessageVetter.java<|end_file_name|><|fim▁begin|>/*
Derby - Class org.apache.derbyBuild.MessageVetter
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 copyrigh... | /**
* Check that single-quote characters are doubled, as required by |
<|file_name|>pyligadb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
The pyligadb module is a small python wrapper for the OpenLigaDB webservice.
The pyligadb module has been released as open source under the MIT License.
Copyright (c) 2014 Patrick Dehn
Due to suds, the wrapper is very thin, but the docst... | Use getAvailLeagues() to get all shortcuts.
@param leagueSaison: A specific season (i.e. the date 2011 as integer).
@return: A list of all matches in the specified league and season. |
<|file_name|>MaybeSwitchIfEmptySingle.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2016-present, RxJava Contributors.
*
* 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://w... | }
}
}
|
<|file_name|>array_ops.py<|end_file_name|><|fim▁begin|>"""Various array operations.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
import numpy as np
from scipy.spatial.distance import pdist, squareform
QUATERNION_DTYPE = np.float64
X_AXIS, Y_AXIS, Z_AXIS = np.identity(3, dtype=np.float64)
EPS = 1e-12 # epsilon, ... | def calculate_angles(vec_arr, ref, ref_norm=None):
"""Calculate angles between vectors in `vec_arr` and `ref` vector. |
<|file_name|>native-stack-impl.hh<|end_file_name|><|fim▁begin|>/*
* This file is open source software, licensed to you under the terms
* of the Apache License, Version 2.0 (the "License"). See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. You may not use ... | |
<|file_name|>media.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($){
// Use only one frame for all upload fields
var frame = new Array(), media = wp.media;
// add image field
function dtGetImageHtml( data ) {
var template = wp.media.template('dt-post-gallery-item');
return templat... | if ( maxFileUploads > 1 )
msg += 's';
|
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | help="The output file format name (default ESRI Shapefile)",
default = 'ESRI Shapefile', metavar = 'formatname')
PARSER.add_argument("-up", |
<|file_name|>unboxed-closures-drop.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.apac... | {
let z = &Droppable::new(); |
<|file_name|>service.js<|end_file_name|><|fim▁begin|>'use strict';
moduloCategoria.factory('categoriaService', ['serverService', function (serverService) {
return {<|fim▁hole|> getFields: function () {
return [
{name: "id", shortname: "ID", longname: "Identificador... | |
<|file_name|>directives.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
sphinx.directives
~~~~~~~~~~~~~~~~~
Handlers for additional ReST directives.
:copyright: 2007-2008 by Georg Brandl.
:license: BSD.
"""
import re
import sys
import string
import posixpath
from os import path
from ... |
def centered_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine): |
<|file_name|>namespaces.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 EMBL - European Bioinformatics Institute
* 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.apach... | foaf: 'http://xmlns.com/foaf/0.1/',
sio: 'http://semanticscience.org/resource/', |
<|file_name|>JdbcLiteralFormatterTemporal.java<|end_file_name|><|fim▁begin|>/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org... | } |
<|file_name|>overflowing_shl.rs<|end_file_name|><|fim▁begin|>#![feature(core, wrapping)]
extern crate core;
#[cfg(test)]
mod tests {
use core::num::wrapping::OverflowingOps;
// mod shift_max {
// #![allow(non_upper_case_globals)]
//
// pub const i8: u32 = (1 << 3) - 1;
// pub cons... | |
<|file_name|>CFFExpertCharset.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 under the... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from datetime import date
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.dateformat import format as format_date
fro... | """
Adds page_title to ListView's context |
<|file_name|>400_nth_digit.py<|end_file_name|><|fim▁begin|># 400 Nth Digit
# Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
#
# Note:
# n is positive and will fit within the range of a 32-bit signed integer (n < 231).
#
# Example 1:
#
# Input:
# 3
#
# Output:
# 3
#
# Example... | cnt = 1
while n > num * cnt:
n -= (num * cnt) |
<|file_name|>metrics.rs<|end_file_name|><|fim▁begin|>use prometheus::IntCounterVec;
lazy_static! {
pub static ref FILE_DOWNLOAD_COUNTER_VEC: IntCounterVec = register_int_counter_vec!(
"file_download_total",
"Total number of files downloaded",
&["source"]
)
.unwrap();
pub static ... | "Total number of messages received",
&["source"]
)
.unwrap(); |
<|file_name|>angular.js<|end_file_name|><|fim▁begin|>/**
* @license AngularJS v1.2.16
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict';
/**
* @description
*
* This object provides a utility for producing rich Error messages within
* Angula... | * Can be one of:
*
* - `function(actual, expected)`: |
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>use crate::https::{HttpsConnector, TlsClientConfigExt};
use crate::request::{Form, RequestBuilder};
use crate::service::{AppNode, AppNodes, Service, ServiceDesc, ServiceEndpoint};
use crate::service_keeper::ServiceKeeper;
use crate::watcher::{WatchStream, WatchTask};
... | app_name = config.dev_app.clone();
} |
<|file_name|>regions-var-type-out-of-scope.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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://... | fn foo(cond: bool) {
// Here we will infer a type that uses the
// region of the if stmt then block:
let mut x; |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core import validators
from comperio.accounts.models import cUser, Settings, cGroup
from django.core.validators import email_re
import random, datetime, sha
MIN_PASSWORD_LENGTH = 6
class LoginForm(forms.Form):
"""account login... | honeypot = forms.CharField(widget=forms.HiddenInput(), required=False)
def isValidHuman(self, new_data): |
<|file_name|>tipp-api.js<|end_file_name|><|fim▁begin|>import Tipp from 'src/models/TippModel';
/**
* Save a new tipp
* @param {Object} req Request object
* @param {Object} res Response object
* @param {Function} next Callback for next middleware in route
*/
export const postTipp = (req, res, next) => new Tipp(req... | |
<|file_name|>response.py<|end_file_name|><|fim▁begin|>from tabulate import tabulate
<|fim▁hole|>class Response():
message = None;
data = None;
def print(self):
if self.message:
if type(self.message) == "str":
print(self.message)
elif type(self.message) == "l... | |
<|file_name|>Test-Sensor-HT-AM2315.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import time
from tentacle_pi.AM2315 import AM2315
<|fim▁hole|>am = AM2315(0x5c, "/dev/i2c-1")
for x in range(10):
temperature, humidity, crc_check = am.sense()
print "Temperature: %s" % temperature
print "Humidity: %s" %... | |
<|file_name|>middleware.js<|end_file_name|><|fim▁begin|>var _ = require("lodash");
module.exports = {
// ensure client accepts json
json_request: function(req, res, next){
if(req.accepts("application/json"))
return next();
res.stash.code = 406;
_.last(req.route.stack).handl... |
res.stash = _.defaults(res.stash, {
code: 404 |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>"""Tests covering utilities for integrating with the catalog service."""
# pylint: disable=missing-docstring
from __future__ import absolute_import
from collections import defaultdict
from datetime import timedelta
import mock
import six
from django.contrib.aut... | PROGRAM_CACHE_KEY_TPL.format(uuid=second_program['uuid']), |
<|file_name|>bot.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from xml.etree import ElementTree
import pkgutil
from json import loads as base_loads
from random import choice
import logging
import re
import urlparse
from sleekxmpp import ClientXMPP
from redis import Redis, ConnectionPool
import request... | """Details what class and JDC level is required to jump between two systems"""
if len(args) != 2:
return '!hit <source> <destination>'
source, dest = args |
<|file_name|>root.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/. */
/// Liberally derived from the [Firefox JS implementation](http:... | } |
<|file_name|>plot.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function
from abc import ABCMeta, abstractmethod
import matplotlib as mpl
mpl.use('TkAgg')
from matplotlib.ticker import MaxNLocator, Formatter, Locator
from matplotlib.widgets import Slider, Button
import matplotlib.patches as pat... | def __init__(self, hic_matrix, regions=None, title='', colormap='viridis', max_dist=None, norm="log",
vmin=None, vmax=None, show_colorbar=True, blend_masked=False):
BasePlotter1D.__init__(self, title=title) |
<|file_name|>package_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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... | # 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|>__main__.py<|end_file_name|><|fim▁begin|>from libdotfiles.packages import try_install
from libdotfiles.util import HOME_DIR, PKG_DIR, copy_file
try_install("alacritty")<|fim▁hole|>copy_file(
PKG_DIR / "alacritty.yml",
HOME_DIR / ".config" / "alacritty" / "alacritty.yml",
)<|fim▁end|> | |
<|file_name|>0034_service_account_token.py<|end_file_name|><|fim▁begin|>import django.db.models.deletion
import oauthlib.common
from django.db import migrations, models
def move_existing_token(apps, schema_editor):
ServiceAccount = apps.get_model("account", "ServiceAccount")
for service_account in ServiceAcco... | ), |
<|file_name|>agilentE4431B.py<|end_file_name|><|fim▁begin|>"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014-2016 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Sof... | |
<|file_name|>queue.py<|end_file_name|><|fim▁begin|>"""Queue implementation using Linked list."""
from __future__ import print_function
from linked_list import Linked_List, Node
class Queue(Linked_List):
def __init__(self):
Linked_List.__init__(self)
def enqueue(self, item):
node = Node(item... | if __name__ == '__main__':
test_queue() |
<|file_name|>navclass.py<|end_file_name|><|fim▁begin|>from django.template import Library, Node, resolve_variable, TemplateSyntaxError
from django.core.urlresolvers import reverse
register = Library()<|fim▁hole|>
@register.simple_tag
def active(request, pattern):
import re
if re.search(pattern, request.get... | |
<|file_name|>ios-refresh.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { IconBaseProps } from 'react-icon-base';<|fim▁hole|><|fim▁end|> | declare class IoIosRefresh extends React.Component<IconBaseProps> { }
export = IoIosRefresh; |
<|file_name|>cluster.py<|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 under the Apache ... | if await fobj.exists():
return fobj
elements = itertools.chain( |
<|file_name|>results_fetcher_mock.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011 Google Inc. 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 reta... | rv = []
for build in builds: |
<|file_name|>demo.py<|end_file_name|><|fim▁begin|>from pyh import *
list=[[1,'Lucy',25],[2,'Tom',30],[3,'Lily',20]]
page = PyH('Test')
page<<div(style="text-align:center")<<h4('Test table')
mytab = page << table(border="1",cellpadding="3",cellspacing="0",style="margin:auto")
tr1 = mytab << tr(bgcolor="lightgrey")
tr1 <... | for j in range(3):
tr2 << td(list[i][j]) |
<|file_name|>join.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::str;
use column::Column;
use condition::ConditionExpression;
use nom::branch::alt;
use nom::bytes::complete::tag_no_case;
use nom::combinator::map;
use nom::IResult;
use select::{JoinClause, SelectStatement};
use table::Table;
#[derive(Clone, De... | CrossJoin,
StraightJoin,
} |
<|file_name|>analyzer_cli.py<|end_file_name|><|fim▁begin|># 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.apac... | ap = argparse.ArgumentParser( |
<|file_name|>discover.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
<|fim▁hole|> print(zone.player_name)<|fim▁end|> | import soco
""" Prints the name of each discovered player in the network. """
for zone in soco.discover(): |
<|file_name|>test_metaclass.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
import trafaret as t
from trafaret_validator import TrafaretValidator
class ValidatorForTest(TrafaretValidator):
t_value = t.Int()
value = 5
class ValidatorForTest2(ValidatorForTest):
test = t.String()
class Te... | '_data should be empty') |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Model unit tests."""
import datetime as dt
<|fim▁hole|>import pytest
from phonedusk.user.models import User, Role
from .factories import UserFactory
@pytest.mark.usefixtures('db')
class TestUser:
def test_get_by_id(self):
... | |
<|file_name|>about.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
About<|fim▁hole|>
__version__ = '0.2.2'<|fim▁end|> | """ |
<|file_name|>dropRepeatsWith.ts<|end_file_name|><|fim▁begin|>import * as R_dropRepeatsWith from '../ramda/dist/src/dropRepeatsWith';
declare const string_to_number: (x: string) => number;
declare const string_array: string[];
// @dts-jest:pass
R_dropRepeatsWith(string_to_number);
// @dts-jest:pass
R_dropRepeatsWith(s... | R_dropRepeatsWith(string_to_number, string_array); |
<|file_name|>review_comments.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from... | primaryjoin='({0}.modified_by_id == User.id) & ~{0}.is_deleted'.format(cls.__name__), |
<|file_name|>Case.js<|end_file_name|><|fim▁begin|>/**
* @providesModule Case
*/
const DOM = require('DOM');
var Case = (function () {
/**
* A Case is a test against an element.
*/
function Case (attributes) {
return new Case.fn.init(attributes);
}
// Prototype object of the Case.
Case.fn = Case.... |
// The original element has been processed. |
<|file_name|>enlist-history-page.component.ts<|end_file_name|><|fim▁begin|>import {CollectionViewer} from '@angular/cdk/collections';
import {DataSource} from '@angular/cdk/table';
import {ChangeDetectionStrategy, Component, OnInit, ViewChild} from '@angular/core';
import {MatPaginator, PageEvent} from '@angular/materi... | |
<|file_name|>test_data_info.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# TEST_UNICODE_LITERALS
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from ...extern import six
from ..data_info imp... | 'U' Unicode |
<|file_name|>mpfit.py<|end_file_name|><|fim▁begin|>"""
Perform Levenberg-Marquardt least-squares minimization, based on MINPACK-1.
AUTHORS
The original version of this software, called LMFIT, was written in FORTRAN
as part of the MINPACK-1 package by XXX.
Craig Markwardt conve... | if status < 0: |
<|file_name|>RenderApp.js<|end_file_name|><|fim▁begin|>// @flow
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import Middleware from './Middleware';
type Base = {
href?: string,
target?: string,
};
type Link = {
crossOrigin?: string,
href?: string,
hrefLang?: string,
... | />,
)}
</head>, |
<|file_name|>trip_queries.py<|end_file_name|><|fim▁begin|>import logging
import pymongo
import emission.net.usercache.abstract_usercache as enua
import emission.core.get_database as edb
import emission.core.wrapper.trip as ecwt
import emission.core.wrapper.section as ecws
import emission.core.wrapper.stop as ecwst
i... | |
<|file_name|>types.pre.rs<|end_file_name|><|fim▁begin|>use std::{fmt, str};
#[derive(Debug)]
pub struct Machine<'a> {
pub memory: CambridgeArray<'a, u8>,
pub output: UTF8Wrapper<'a>,
#ifdef PROFILE
pub trace: ProfileShim,
#endif
}
pub struct CambridgeArray<'a, T: 'a>(pub &'a [T]); // Cambridge is Oxford'... | write!(f, " ]")
}
} |
<|file_name|>group_element_year.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities... | #
# This program is distributed in the hope that it will be useful, |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ImageAttachment'
db.create_table('... | 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'Tr... |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># Import 'datasets' from 'sklearn'
import numpy as np
from sklearn import datasets
from sklearn.decomposition import PCA, RandomizedPCA
import matplotlib.pyplot as plt
# Load in the 'digits' data
digits = datasets.load_digits()
# Print the 'digits' data
print(digits)
... | |
<|file_name|>schedule_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#coding: utf-8
from __future__ import unicode_literals
import os
import unittest
import xlrd
import msp.schedule_parser as schedule_parser
__author__ = "Andrey Konovalov"
__copyright__ = "Copyright (C) 2014 Andrey Konovalov"
__license__ =... | self.assertEqual(self.schedule.GetGroupRange(8, 3), (76, 77))
class WeekdayByRowTest(unittest.TestCase): |
<|file_name|>UkrainianWordTokenizer.java<|end_file_name|><|fim▁begin|>/* LanguageTool, a natural language style checker
* Copyright (C) 2005 Daniel Naber (http://www.danielnaber.de)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Li... | token = token.replace(SOFT_HYPHEN_WRAP_SUBST, SOFT_HYPHEN_WRAP); |
<|file_name|>registro.js<|end_file_name|><|fim▁begin|>function iniciarFormularioRegistro() {
// animacion de fadeIn
$('.register').addClass('animated fadeIn');
// elimino la clase para poder animar nuevamente
setTimeout(function () {
$('.register').removeClass('fadeIn');
}, 3000);
$('.sigP... | |
<|file_name|>unittest_preserve_unknown_enum2.pb.cc<|end_file_name|><|fim▁begin|>// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/unittest_preserve_unknown_enum2.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include <google/protobuf/unittest_preserve_unknown_enum2.pb.... | |
<|file_name|>RedshiftErrorMarshaller.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2016 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 License is locat... | *
* or in the "license" file accompanying this file. This file is distributed |
<|file_name|>upnp-mediarenderer-client-tests.ts<|end_file_name|><|fim▁begin|>import MediaRendererClient = require('upnp-mediarenderer-client');
// Instanciate a client with a device description URL (discovered by SSDP)
const client = new MediaRendererClient('http://192.168.1.50:4873/foo.xml');
// Load a stream with s... | };
client.load('http://url.to.some/stream.avi', options, (err, result) => { |
<|file_name|>template.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
Very simple script to replace a template with another one.
It also converts the old MediaWiki boilerplate format to the new format.
Syntax: python template.py [-remove] [xml[:filename]] oldTemplate [newTemplate]
Spec... | |
<|file_name|>table.go<|end_file_name|><|fim▁begin|>// Copyright 2017 PingCAP, 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
//
... | func (t *Table) ColumnBetweenRowCount(sc *stmtctx.StatementContext, a, b types.Datum, colID int64) float64 {
if t.ColumnIsInvalid(sc, colID) {
return float64(t.Count) / pseudoBetweenRate |
<|file_name|>batching.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
var undef;
/**
* Aggregate messages into batches as they are received.
*/
define(function (... |
if (opts.batch <= 0 && opts.timeout <= 0) {
throw new Error('Invalid configuration: batch size or timeout must be defined');
} |
<|file_name|>Transform.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016 Oiri Project
*
* This software is distributed under an MIT-style license.
* See LICENSE file for more information.
*/
package com.github.kimikage.oiri.svg;
import org.w3c.dom.svg.SVGMatrix;
import java.util.regex.Match... | } |
<|file_name|>htmlformelement.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::BlobBinding::Bl... | |
<|file_name|>openmm.py<|end_file_name|><|fim▁begin|>from simtk.openmm import app
import simtk.openmm as mm
from simtk import unit
def findForce(system, forcetype, add=True):
""" Finds a specific force in the system force list - added if not found."""
for force in system.getForces():
if isinstance(force, forcet... | def addHarmonicConstraint(harmonicforce, pairlist, positions, threshold, k): |
<|file_name|>object.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Object
"""
import sys
from copy import copy as _copy
from collections import defaultdict
from .errors import ConfigurationError, ExecutionError, \
InvalidParameterDatatype
from .debugging import bacpypes_debugging, ModuleLogger
from .prim... | , OptionalProperty('timeOfActiveTimeReset', DateTime)
, OptionalProperty('strikeCount', Unsigned) |
<|file_name|>mysql_advanced_data_store_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Tests the mysql data store."""
import unittest
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
import logging
from grr.lib impo... | |
<|file_name|>Finger.js<|end_file_name|><|fim▁begin|>"use strict";
const ID = require("./ID.js");
class Finger{
constructor(node, index){
this.node = node;
this.start = node.id.add(ID.powerOfTwoBuffer(index));
}<|fim▁hole|>}
module.exports = Finger;<|fim▁end|> | |
<|file_name|>mpw_v3.rs<|end_file_name|><|fim▁begin|>extern crate ring;
/*
* This file is part of Master Password.
*
* Master Password is free software: you can redistribute it and/or modify
* Mit under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of ... | "");
|
<|file_name|>AdvancedCiteDialog.java<|end_file_name|><|fim▁begin|>package org.jabref.gui.openoffice;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ButtonGroup;
import javax.swing.J... | } else {
inText.setSelected(true); |
<|file_name|>caches.go<|end_file_name|><|fim▁begin|>package storagecache
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incor... | }
var azf azure.Future
azf, err = azure.NewFutureFromResponse(resp) |
<|file_name|>agents-osquery.ts<|end_file_name|><|fim▁begin|>/*
* Wazuh app - Module for Agents/Osquery visualizations
* Copyright (C) 2015-2021 Wazuh, 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 Sof... | title: {},
}, |
<|file_name|>coverageindex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# 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... | uri = [id[:2], id, type, job_name, |
<|file_name|>EducationPrereq.ts<|end_file_name|><|fim▁begin|>import BasePrereq from './BasePrereq'
import { MultiLangStringSet } from '../auxiliary/MultiLang'
import { CertificationId } from '../auxiliary/Certification'
import { EducationStage } from '../Qualities/EducationExperience'
import { Duration } from '../auxil... | |
<|file_name|>BWRender.java<|end_file_name|><|fim▁begin|>package cn.ezandroid.ezfilter.render;
import android.content.Context;
import android.opengl.GLES20;
import cn.ezandroid.lib.ezfilter.core.util.Path;
import cn.ezandroid.lib.ezfilter.extra.IAdjustable;
import cn.ezandroid.lib.ezfilter.extra.MultiBitmapInputRender... | " \n" +
" varying highp vec2 textureCoordinate;\n" + |
<|file_name|>features.py<|end_file_name|><|fim▁begin|>#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#<|fim▁hole|># This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.