prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>rtconfig.py<|end_file_name|><|fim▁begin|>import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='keil'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
i... | AFLAGS += ' -gdwarf-2'
else:
CFLAGS += ' -O2' |
<|file_name|>tables.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/lic... | &['\u{646}', '\u{631}']), ('\u{fc8b}', &['\u{646}', '\u{632}']), ('\u{fc8c}', &['\u{646}', |
<|file_name|>DDTabSheetState.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 John Ahlroos
*
* 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/LICENS... | * or implied. See the License for the specific language governing permissions and limitations under
* the License. |
<|file_name|>311_srtp1_recv_avp.py<|end_file_name|><|fim▁begin|># $Id: 311_srtp1_recv_avp.py 2036 2008-06-20 17:43:55Z nanang $
import inc_sip as sip
import inc_sdp as sdp
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
s=tester
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtpmap:101 ... | include = ["m=audio \d+ RTP/AVP", "a=crypto"] |
<|file_name|>cleanup.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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... | |
<|file_name|>StahnuTo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
from pyload.plugin.Account import Account
<|fim▁hole|>
__description = """StahnuTo account plugin"""
__license = "GPLv3"
__authors = [("zoidberg", "zoidberg@mujmail.cz")]
def loadAccountInfo(self, user, ... | class StahnuTo(Account):
__name = "StahnuTo"
__type = "account"
__version = "0.05" |
<|file_name|>projectiles.py<|end_file_name|><|fim▁begin|># Projectiles
import pygame
import environment
from models import Projectile
class Laser(Projectile):
def __init__(self, laser_x, laser_y, sign=None, speed=20):
self.laser_height = 20
self.laser_width = environment.WINDOW_WIDTH - laser_x
... | def __init__(self, posx=0, posy=0, dimx=10, dimy=3, sign=None, parent_stat=None, speed=20):
dummy_rect = pygame.Rect(posx, posy, dimx, dimy)
Projectile.__init__(self, dummy_rect, sign, parent_stats=parent_stat) |
<|file_name|>Frame-onPop-return-throw.js<|end_file_name|><|fim▁begin|>// |jit-test| error: TestComplete
// onPop can change a normal return into a throw.
load(libdir + "asserts.js");
var g = newGlobal('new-compartment');
var dbg = new Debugger(g);
function test(type, provocation) {
var log;
// Help people fi... | log += 'd';
};
dbg.onEnterFrame = function handleEnterFrame(f) { |
<|file_name|>SubscriptionManager.js<|end_file_name|><|fim▁begin|>/**
* Created by maomao on 2020/4/20.
*/
Java.perform(function() {
var cn = "android.telephony.SubscriptionManager";
var target = Java.use(cn);
if (target) {
target.addOnSubscriptionsChangedListener.overloads[0].implementation = func... | send(myArray);
return this.getActiveSubscriptionInfoCount.apply(this, arguments);
};
|
<|file_name|>DongleCENDEvent.java<|end_file_name|><|fim▁begin|>package org.asteriskjava.manager.event;
public class DongleCENDEvent extends ManagerEvent
{
private static final long serialVersionUID = 3257845467831284784L;
private String device;
private String endstatus;
private String cccause;
private String... | this.endstatus = endstatus;
} |
<|file_name|>ganeti.mcpu_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (C) 2009, 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:
#
# 1. Redistributio... | self.fail("Exception not raised")
# Once more without the whitelist |
<|file_name|>test_widget_doctests.py<|end_file_name|><|fim▁begin|># Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
<|fim▁hole|>
from lp.testing.layers import DatabaseFunctionalLayer
def test_suite():
suite = unittest.Te... | __metaclass__ = type
import doctest
import unittest |
<|file_name|>FSP3000R7NCU.py<|end_file_name|><|fim▁begin|>######################################################################
#
# FSP3000R7NCU object class
#
# Copyright (C) 2011 Russell Dwarshuis, Merit Network, Inc.
#
# This program can be used under the GNU General Public License version 2
# You can find full inf... | import logging
log = logging.getLogger('FSP3000R7NCU')
class FSP3000R7NCU(FSP3000R7Component): |
<|file_name|>bitcoin_pt_PT.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_PT" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Horuscoin Core</source>
<translation>Sobr... | <location line="+2"/>
<source>Received from</source> |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python3
"""
Custom Bi Directional Binary Data Parser
ModParser
"""
# ====================== GPL License and Copyright Notice ======================
# This file is part of ModParser
# Copyright (C) 2017 Diana Land
#
# This program is free software: y... | #
# https://github.com/iaz3/ModParser
# |
<|file_name|>tpimporter_csv.go<|end_file_name|><|fim▁begin|>/*
Real-time Charging System for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
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, eit... | utils.ACCOUNT_ACTIONS_CSV: (*TPCSVImporter).importAccountActions,
utils.DERIVED_CHARGERS_CSV: (*TPCSVImporter).importDerivedChargers, |
<|file_name|>equality.rs<|end_file_name|><|fim▁begin|>#[stable(feature = "rust1", since = "1.0.0")]
impl<A, B, const N: usize> PartialEq<[B; N]> for [A; N]
where
A: PartialEq<B>,
{
#[inline]
fn eq(&self, other: &[B; N]) -> bool {
SpecArrayEq::spec_eq(self, other)
}
#[inline]
fn ne(&self,... | impl<A, B, const N: usize> PartialEq<[A; N]> for &[B]
where
B: PartialEq<A>, |
<|file_name|>codeFixUnusedIdentifier_parameter.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// @noUnusedParameters: true
////function g(a, b) { b; }
////g(1, 2);
verify.not.codeFixAvailable("Remove unused declaration for: 'a'");<|fim▁end|> | /// <reference path='fourslash.ts' />
// @noUnusedLocals: true |
<|file_name|>goma_date_types_gen.go<|end_file_name|><|fim▁begin|>package dao
// NOTE: THIS FILE WAS PRODUCED BY THE
// GOMA CODE GENERATION TOOL (github.com/kyokomi/goma)
// DO NOT EDIT
import (
"log"
"database/sql"
"github.com/kyokomi/goma/test/mysql/entity"
)
var tableGomaDateTypes = "goma_date_types"
var col... | func _GomaDateTypesDelete(g GomaDateTypesDaoQueryer, id int64) (sql.Result, error) { |
<|file_name|>GoogleApiTask.java<|end_file_name|><|fim▁begin|>package com.yuzhou.viewer.service;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import android.widget.Toast;
import com.google.common.eventbus.EventBus;
import com.loopj.android.http.JsonHttpResponseHandler;
import c... | if (httpCode == 400) {
errorResource = R.string.error_data_not_found;
Log.d("VIEWER", "response=" + response.getString("responseDetails")); |
<|file_name|>test_metadata.py<|end_file_name|><|fim▁begin|># Copyright 2016 Rackspace Australia
# 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
#
# htt... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func fatal(err error) {
if err != nil {
panic(err)
}
}
type board [][]string
func (b board) String() (out string) {
for _, row := range b {
out += fmt.Sprintln(row)
}
return out
}
func parseInput() (... | for lines.Scan() {
args := strings.Split(lines.Text(), " ")
out = append(out, args)
} |
<|file_name|>gdbm_insert.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
'''
This is a simple example of how to use the dbm.gnu module of the
standard python library
NOTES:
- the attempt to insert None as value throws an exception.
so only strings and bytes are allowed.
'''
import dbm.gnu # for open<|fim▁hole|>... |
# the 'c' in the next row means open rw and create if it doesn't exist
d = dbm.gnu.open('/tmp/foo.gdbm', 'c')
|
<|file_name|>base.js<|end_file_name|><|fim▁begin|>var
assert = require('assert'),
path = require('path'),
exec = require('child_process').exec,
tmp = require('../lib/tmp');
// make sure that we do not test spam the global tmp
tmp.TMP_DIR = './tmp';
function _spawnTestWithError(testFile, para... | |
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
<|fim▁hole|> INSTALLED_APPS=[
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sites",
"pinax.pinax_hello",
"p... |
DEFAULT_SETTINGS = dict( |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
import toolkit_library
from toolkit_library import inspector
def read_modules():
result = ''
package = inspector.PackageInspector(toolkit_library)
for module in package.get_all_modules():
exec('from toolkit_... | classifiers = [
'Development Status :: 4 - Beta',
|
<|file_name|>fastqc.py<|end_file_name|><|fim▁begin|>##
# Copyright 2009-2013 Ghent University
#<|fim▁hole|># with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http://www.herculesstichting.be/in_English)
# and the Dep... | # This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), |
<|file_name|>batch_norm_benchmark.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://... | _ = session.run([out.op for out in outputs]) # warm up. |
<|file_name|>error_handlers.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
desc: 错误处理handler
author: congqing.li
date: 2016-10-28
"""
from werkzeug.exceptions import HTTPException
class CustomError(HTTPException):
code = None
description = "NIMABI"
def __init__(self, description=None, response=N... |
class ObjectNotExists(CustomError): |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|>ADMIN_PORT = 48899
# Local settings of your Raspberry Pi, used for app discovery
INT_IP = '10.0.1.61'
INT_MAC = '111a02bf232b'
# Code Starts Here #
# Create UDP socket, bind to it
adminsock = socket.socket(socket.AF_INET,socket.SOCK... | import socket
# Set admin server settings
UDP_IP = '' # Leave empty for Broadcast support |
<|file_name|>vmfs_datastore_create_spec.py<|end_file_name|><|fim▁begin|>import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VmfsDatastoreCreat... | for name, value in kwargs.items(): |
<|file_name|>desktop_factory.py<|end_file_name|><|fim▁begin|>import os
from redlib.api.system import sys_command, CronDBus, CronDBusError, is_linux, is_windows
from ..util.logger import log
from . import Desktop, DesktopError
from . import gnome_desktop
from . import feh_desktop
if is_windows():
from .windows_deskto... | print(err_msg)
|
<|file_name|>msgpack.py<|end_file_name|><|fim▁begin|>#coding:utf8
from __future__ import absolute_import, unicode_literals
import msgpack
from .base import BaseSerializer
class MSGPackSerializer(BaseSerializer):
def dumps(self, value):
return msgpack.dumps(value)
<|fim▁hole|><|fim▁end|> | def loads(self, value):
return msgpack.loads(value, encoding="utf-8") |
<|file_name|>concat.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
// http://www.apache.org/licenses... | use ast;
use codemap;
use ext::base; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate matches;
#[macro_use] extern crate log;
/// Simple Rpc Module.
/// See the submodules for information on how to set up a server and a client.
pub mod rpc;
/// Common code between structs.
// TODO: This probably should not all be public
pub mod... |
///
/// Raft Client libraries
/// |
<|file_name|>test_user.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from flexget.utils import json
class TestUserAPI(object):
config = 'tasks: {}'
def test_change_password(self, ... | |
<|file_name|>e01-pass-struct.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>/// The cleanest solution is - I think - if the main thread is responsible
/// for both mallocing and freeing the memory, thus we don't need
/// the return value (or pthread_exit), but store the changes in to the arg
/// variable directly.
///
///... | /// Exercise 11.1: Modify the example code shown in Figure 11.4 to pass the structure between the
/// threads properly.
/// |
<|file_name|>live-manager.ts<|end_file_name|><|fim▁begin|>import { readFile } from 'fs-extra'
import { createServer, Server } from 'net'
import { createServer as createServerTLS, Server as ServerTLS } from 'tls'
import {
computeLowerResolutionsToTranscode,
ffprobePromise,
getLiveSegmentTime,
getVideoStreamBitra... | })
muxingSession.on('master-playlist-created', () => this.publishAndFederateLive(videoLive, localLTags))
|
<|file_name|>ImageEmbedModal.tsx<|end_file_name|><|fim▁begin|>/**
* @copyright 2009-2019 Vanilla Forums Inc.
* @license GPL-2.0-only
*/
import Button from "@library/forms/Button";
import { ButtonTypes } from "@library/forms/buttonTypes";
import InputTextBlock from "@library/forms/InputTextBlock";
import FrameBody f... | {t("Save")}
</Button>
</FrameFooter>
} |
<|file_name|>nowvideo.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from .novamov import NovaMovIE
class NowVideoIE(NovaMovIE):
IE_NAME = 'nowvideo'
IE_DESC = 'NowVideo'
_VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'nowvideo\.(?:ch|ec|sx|eu|at|ag|co|li)'}
_HOST = ... | |
<|file_name|>ascii.rs<|end_file_name|><|fim▁begin|>/// ASCII character classes
use super::{CharClass, CCStatic};
pub static digit: CharClass = CCStatic([<|fim▁hole|> ('\x21', '\x2f'),
('\x3a', '\x40'),
('\x5b', '\x60'),
('\x7b', '\x7e'),
]);
pub static space: CharClass = CCStatic([
('\x09', '\x0d... | ('\x30', '\x39'),
]);
pub static punct: CharClass = CCStatic([ |
<|file_name|>dangerousStyleValue.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be fou... | if (component && value !== '0') {
let owner = component._currentElement._owner
let ownerName = owner ? owner.getName() : null |
<|file_name|>predict_missing_word.space.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Predict missing words with n-gram model
'''
import sys, argparse
from itertools import izip
from util import tokenize_words
def opts():
parser = argparse.ArgumentParser(description=__doc__)<|fim▁hole|> parser.add... | |
<|file_name|>SouthAmericaCitiesBundle_pt_BR.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2014, Oracle and/or its affiliates.
* All rights reserved.
<|fim▁hole|><|fim▁end|> | */
"use strict";var l={"PRY_ASUNCION":[null,"Assun\u00E7\u00E3o"],"BRA_BRASILIA":[null,"Bras\u00EDlia"],"URY_MONTEVIDEO":[null,"Montevid\u00E9u"],"COL_BOGOTA":[null,"Bogot\u00E1"],"TTO_PORT_OF_SPAIN":[null,"Porto de Espanha"],"BRA_SAO_PAULO":[null,"S\u00E3o Paulo"]};(this?this:window)['DvtBaseMapManager']['_UNPROCESS... |
<|file_name|>message.js<|end_file_name|><|fim▁begin|>define(['myweb/jquery'], function ($) {
'use strict';
var error = function (message) {<|fim▁hole|> $('.form-feedback').removeClass('form-error').addClass('form-success').text(message).fadeIn(200);
};
var clear = function () {
$('.form-f... | $('.form-feedback').removeClass('form-success').addClass('form-error').text(message).fadeIn(200);
};
var success = function (message) { |
<|file_name|>WorkspaceDialog.py<|end_file_name|><|fim▁begin|># Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import List, Optional, Dict, cast
from PyQt5.QtCore import pyqtSignal, QObject, pyqtProperty, QCoreApplication
from UM.FlameProfiler import pyqtSlot
f... | return self._material_labels
def setMaterialLabels(self, material_labels: List[str]) -> None:
if self._material_labels != material_labels: |
<|file_name|>test_state.py<|end_file_name|><|fim▁begin|>from yaml import dump
from twisted.internet.defer import succeed, fail
from txaws.s3.exception import S3Error
from juju.lib.testing import TestCase
from juju.providers.ec2.tests.common import EC2TestMixin
class EC2StateTest(TestCase, EC2TestMixin):
def s... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf -8*-
from setuptools import setup<|fim▁hole|> version=0.1,
license='MIT',
author="Steven Than, Tatiana Weaver",
author_email="email@email.com",
py_modules=['linked_list', 'stack', 'dll', 'queue', 'deque'],
package_dir={' ': 'src... |
setup(
name="linked list, stack, double linked list, queue, deque implementation",
description="This package implements a linked list", |
<|file_name|>0020_auto_20170110_1556.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-01-10 15:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
<|fim▁hole|> depend... | |
<|file_name|>jquery.tinysort.min.js<|end_file_name|><|fim▁begin|>/**
* jQuery plugin wrapper for TinySort<|fim▁hole|> * @requires tinysort
* @license MIT/GPL
* @author Ron Valstar (http://www.sjeiti.com/)
* @copyright Ron Valstar <ron@ronvalstar.nl>
*/
!function(a){"use strict";"function"==typeof define&&define.am... | * Does not use the first argument in tinysort.js since that is handled internally by the jQuery selector.
* Sub-selections (option.selector) do not use the jQuery selector syntax but regular CSS3 selector syntax.
* @summary jQuery plugin wrapper for TinySort
* @version 2.2.2 |
<|file_name|>wedge3.js<|end_file_name|><|fim▁begin|>export function wedgeYZ(a, b) {<|fim▁hole|> return a.z * b.x - a.x * b.z;
}
export function wedgeXY(a, b) {
return a.x * b.y - a.y * b.x;
}<|fim▁end|> | return a.y * b.z - a.z * b.y;
}
export function wedgeZX(a, b) { |
<|file_name|>pipe.rs<|end_file_name|><|fim▁begin|>/*
copyright: (c) 2013-2020 by Blockstack PBC, a public benefit corporation.
This file is part of Blockstack.
Blockstack is free software. You may redistribute or modify
it under the terms of the GNU General Public License as published by
the Free Software Founda... |
#[cfg(test)]
mod test { |
<|file_name|>ShinyFollow.java<|end_file_name|><|fim▁begin|>package com.team2502.robot2017.command.autonomous;
<|fim▁hole|>public class ShinyFollow extends CommandGroup
{
/**
* Does a follow
*/
public ShinyFollow() { addSequential(new AutoVisionCommand(200, 0.3)); }
}<|fim▁end|> | import edu.wpi.first.wpilibj.command.CommandGroup;
|
<|file_name|>is_eq.rs<|end_file_name|><|fim▁begin|>// Compares two token tree lists. Expands to the token tree list inside the first block if the
// lists are equivalent, and the second if they are not. Expensive - generates a new macro for
// every invocation! This macro is only valid in item position, due to its use ... | fn eq_test_1() { println!("As expected, they're not equal."); } |
<|file_name|>fix_nve.cpp<|end_file_name|><|fim▁begin|>/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) San... | v[i][1] += dtfm * f[i][1]; |
<|file_name|>dosta_abcdjm_mmp_cds_recovered_driver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##
# OOIPLACEHOLDER
#
# Copyright 2014 Raytheon Co.
##
from mi.core.log import get_logger
from mi.core.versioning import version
from mi.dataset.dataset_driver import DataSetDriver
from mi.dataset.dataset_parser im... | parser = MmpCdsParser(parser_config, stream_handle, exception_callback)
driver = DataSetDriver(parser, particle_data_handler) |
<|file_name|>window_run_return.rs<|end_file_name|><|fim▁begin|>// Limit this example to only compatible platforms.
#[cfg(any(
target_os = "windows",
target_os = "macos",
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
fn ma... | |
<|file_name|>E0594.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
fn main() {
NUM = 20; //~ ERROR cannot assign to immutable static item `NUM`
}<|fim▁end|> | static NUM: i32 = 18; |
<|file_name|>0005_add_application_network_field.py<|end_file_name|><|fim▁begin|># encoding: 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 field 'InstanceApplic... | },
'apply.sshpublickey': {
'Meta': {'object_name': 'SshPublicKey'}, |
<|file_name|>version.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 ver... | } |
<|file_name|>size_hint.rs<|end_file_name|><|fim▁begin|>#![feature(core, unboxed_closures)]
extern crate core;
#[cfg(test)]
mod tests {
use core::slice::SliceExt;
use core::slice::RSplitNMut;
use core::ops::FnMut;
use core::ops::FnOnce;
// fn size_from_ptr<T>(_: *const T) -> usize {
// mem... | // #[inline]
// fn first(&self) -> Option<&T> {
// if self.is_empty() { None } else { Some(&self[0]) } |
<|file_name|>template.rs<|end_file_name|><|fim▁begin|>/*
Example demonstrating Sending a Secure Message.
*/
// ------------------------------------------
// crates.io
// ------------------------------------------
#[macro_use]
extern crate serde_json;
// ------------------------------------------
// hyperledger crat... |
fn prep(wallet_handle: i32, sender_vk: &str, receipt_vk: &str) {
let mut file = File::create(FILE).unwrap();
|
<|file_name|>verify.ts<|end_file_name|><|fim▁begin|>import { promises as fsPromises } from 'fs';
import { expect } from 'chai';
describe('Verify stryker runs with mocha < 6', () => {
let strykerLog: string;
before(async () => {
strykerLog = await fsPromises.readFile('./stryker.log', 'utf8');
});
<|fim▁hole... | it('should warn about old mocha version', async () => {
expect(strykerLog).contains('DEPRECATED: Mocha < 6 detected. Please upgrade to at least Mocha version 6. Stryker will drop support for Mocha < 6 in V5');
});
|
<|file_name|>parser_gen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import argparse
import collections
import json
import string
import sys
header_template = """
#ifndef ASPARSERATIONS_GENERATED_${class_name}_H_
#define ASPARSERATIONS_GENERATED_${class_name}_H_
#include <array>
#include <map>
#include <memory>... | """
def gen_namespace_decls(namespaces):
begin = "" |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration
// Generated on Sat Jul 04 2015 21:07:22 GMT-0300 (BRT)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',<|fim▁hole|> // frameworks to us... | |
<|file_name|>sort.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys, argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', type=str, action='store', dest='input', default=None, help="Input file")
args = parser.parse_args()
stats = dict()
if arg... | print "Error: No input file" |
<|file_name|>ui_event_gtk.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008-2018 SLIBIO <https://github.com/SLIBIO>
*
* 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 witho... | map(Keycode::NumLock, GDK_KEY_Num_Lock);
map(Keycode::ContextMenu, GDK_KEY_Menu); |
<|file_name|>ex31_set_license_key.py<|end_file_name|><|fim▁begin|># Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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
#
# ... | |
<|file_name|>LocationInstanceCreator.java<|end_file_name|><|fim▁begin|>package hu.progtech.cd2t100.asm;
import java.lang.reflect.Type;
import com.google.gson.InstanceCreator;
class LocationInstanceCreator implements
InstanceCreator<Location> {
public Location createInstance(Type type) {
return new Location(... | } |
<|file_name|>diff_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package gitutil
import (
"html/template"
"testing"
dmp "github.com/sergi/go-diff/diffmatchpatch"
... | lineType: git.DiffLineDelete, |
<|file_name|>test_success_message.py<|end_file_name|><|fim▁begin|>from StringIO import StringIO
from django.test import TestCase
from django.test.client import Client
from corehq.apps.app_manager.models import Application, APP_V1, Module
from corehq.apps.app_manager.success_message import SuccessMessage
from corehq.app... | |
<|file_name|>fake.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | throw new Error('this is just a fake file and should not be executed'); |
<|file_name|>generate_gles_conformance_tests.py<|end_file_name|><|fim▁begin|>import os
import re
import sys
def ReadFileAsLines(filename):
"""Reads a file, removing blank lines and lines that start with #"""<|fim▁hole|> for line in raw_lines:
line = line.strip()
if len(line) > 0 and not line.st... | file = open(filename, "r")
raw_lines = file.readlines()
file.close()
lines = [] |
<|file_name|>metrics.component.spec.ts<|end_file_name|><|fim▁begin|>import { ComponentFixture, TestBed, async } from '@angular/core/testing';<|fim▁hole|>import { JhiMetricsMonitoringComponent } from 'app/admin/metrics/metrics.component';
import { JhiMetricsService } from 'app/admin/metrics/metrics.service';
describe('... | import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
import { of, throwError } from 'rxjs';
import { BookstoreTestModule } from '../../../test.module'; |
<|file_name|>1.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2001-2015 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 published by the
// Free Softwa... | cons01<std::list< A<B> > >(); |
<|file_name|>print.resource.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> printOptions: any;
}
export interface IPrintResource extends ng.resource.IResourceClass<IPrint> {}
export class PrintResource {
/* @ngInject */
public static Print($resource: ng.resource.IResourceService): IPrintResource {
var url = '... | 'use strict';
export interface IPrint extends ng.resource.IResource<IPrint> { |
<|file_name|>pyminer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (c) 2011 The VirtaCoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
impo... | if 'error' in resp_obj and resp_obj['error'] != None: |
<|file_name|>TaskScheduleServiceImpl.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
*... |
package org.wso2.carbon.policy.mgt.core.task;
|
<|file_name|>_configuration.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code genera... | self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) |
<|file_name|>readable.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015 by Greg Reimer <gregreimer@gmail.com>
* MIT License. See license.txt for more info.
*/
var stream = require('stream')
, util = require('util')
, co = require('co')
, unresolved = require('./unresolved')
// -------------------------... | function output(data, enc) {
return self._ponySending.then(function() {
if (!self.push(data, enc)) {
self._ponySending = unresolved(); |
<|file_name|>conf_manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
"""
Raspymc is a multimedia centre exposed via a http server built with bottlepy
Copyright (C) 2013 Giancarlo Fringuello
This program is free software: you can redistribute it and/or modify
i... | else:
l_clean_configuration = True |
<|file_name|>F3D_syn.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import os,sys
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as plt
import argparse
ap=argparse.ArgumentParser()
ap.add_argument('-vis') # 1 plot cropped point cloud
ap.add_argument('-refine') # 1 refine mesh
ap.add_argument('-... | #!/usr/bin/env python
import numpy as np |
<|file_name|>all_time.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_resource import Ins... |
@property
def uri(self): |
<|file_name|>kwd.py<|end_file_name|><|fim▁begin|>import helpers
from config import render, db
class Keyword(object):
def GET(self):
keyword_count = db.query('SELECT KEYWORD,\
COUNT(DISTINCT IPKEY) AS PACKAGES,\
COUNT(DISTINCT UUID) AS HOSTS\<|fim▁hole|> keyword_da... | FROM GLOBAL_KEYWORDS NATURAL JOIN KEYWORDS\
NATURAL JOIN INSTALLED_PACKAGES GROUP BY KEYWORD')
keyword_data = dict()
for t in keyword_count: |
<|file_name|>Trailing Zeroes.js<|end_file_name|><|fim▁begin|>/**
*
* Trailing Zeroes
*
* @author: Corey Hart <http://www.codenothing.com>
* @description: Removes unecessary trailing zeroes from values
*
* @before:
* .example {
* width: 5.0px;
* }
*
* @after:
* .example {
* ... | "Removing unecesary trailing zeroes '" + before + "' => '" + value + "'", |
<|file_name|>release.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
<|fim▁hole|>/**
* Release this package.
*/
"use strict";
process.chdir(__dirname + '/..');
const apeTasking = require('ape-tasking'),
apeReleasing = require('ape-releasing');
apeTasking.runTasks('release', [
(callback) => {
a... | |
<|file_name|>events.py<|end_file_name|><|fim▁begin|>"""
events.py
Defines a simple event handler system similar to that used in C#. Events allow
multicast delegates and arbitrary message passing. They use weak references so
they don't keep their handlers alive if they are otherwise out of scope.
"""
import weakref
i... | |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Decorators module
"""
import logging
from docktors.core import decorated
from docktors.wdocker import DockerContainer
logger = logging.getLogger(__name__)
def docker(func=None, **kwargs):
"""<|fim▁hole|> :param ports: The port... | Decorator to startup and shutdown a docker container.
:param image: The name of the image to use.
:param command: The input docker command to run, |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>// (The MIT License)
//
// Copyright Michał Czapracki, budleigh.salterton@gmail.com
//
// 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 wit... | var cfgpath = args['config'][0];
|
<|file_name|>treeView.js<|end_file_name|><|fim▁begin|>define(['marionette',
'../../../shared/component/componentLayoutTemplate.hbs',
'./treeHtmlCodeTemplate.hbs',
'./treeJsCodeTemplate.hbs',
'./treeBodyView',
'./treeTestView',
'../../../shared/component/componentExampleCodeView',
'rup.tree'], function(Marionette... | });
|
<|file_name|>sortingButton.component.spec.ts<|end_file_name|><|fim▁begin|>import { fireEvent, render, screen } from "@testing-library/angular"
import { Store } from "../../state/store/store"
import { sortingOrderAscendingSelector } from "../../state/store/appSettings/sortingOrderAscending/sortingOrderAscending.selecto... | |
<|file_name|>test_SEAS_import.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (C) 2017 - Massachusetts Institute of Technology (MIT)
#
# 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 Fou... | |
<|file_name|>prepareOfflineInvoke.js<|end_file_name|><|fim▁begin|>'use strict';
const _ = require('lodash');
const path = require('path');<|fim▁hole|> */
module.exports = {
prepareOfflineInvoke() {
// Use service packaging for compile
_.set(this.serverless, 'service.package.individually', false);
retur... |
/**
* Special settings for use with serverless-offline. |
<|file_name|>rpcapi.py<|end_file_name|><|fim▁begin|># Copyright 2013, Red Hat, 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 - Remove 1.x backwards compat
* 2.1 - Add image_id to create_volume()
* 2.2 - Remove reservations argument to create_volume()
* 2.3 - Remove create_volume() |
<|file_name|>NTupleMaker_MagDown.py<|end_file_name|><|fim▁begin|>from Gaudi.Configuration import *
from Configurables import DaVinci
#from Configurables import AlgTool
from Configurables import GaudiSequencer
MySequencer = GaudiSequencer('Sequence')
#For 2012 MC
DaVinci.DDDBtag='dddb-20130929-1'
DaVinci.CondDBtag='sim-... | |
<|file_name|>windowInfo.js<|end_file_name|><|fim▁begin|>// Load in dependencies
var exec = require('./utils').exec;
// Helper function to collect information about a window
function windowInfo(id) {
// Get active window and window info
// http://unix.stackexchange.com/questions/61037/how-to-resize-application-wind... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# import sys
# sys.path.insert(0, '../')
import pyarchey.pyarchey as py
# o = py.Output()
# print 'Distro Name Pretty Name'
# print '---------------------------'
# print o.readDistro('./slack.test')
# print o.readDistro('./arch.test')<|fim▁hol... | # print o.readDistro('./raspbian.test')
|
<|file_name|>thread-pool.cc<|end_file_name|><|fim▁begin|>/* Thread pool
Copyright (C) 2019-2020 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify<|fim▁hole|> This program is distributed in the hope that it will be useful,
but W... | 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.
|
<|file_name|>Ping.py<|end_file_name|><|fim▁begin|>'''
@author: lockrecv@gmail.com
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Inspired by Matthew Dixon Cowles <http://www.visi.com/~mdc/>.
'''
import os
import select
import socket
impor... |
if delay == None:
print 'FAILED. (timeout within %ssec.)' % timeout |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{DEFAULT_BUILD_DIR, DEFAULT_PACKAGE_DIR, DEFAULT_SOURCE_DIR, DEFAULT_STORAGE_DIR};
use anyhow::anyhow;
use move_coverage::coverage_map::{CoverageMap, ExecCoverageMapWithModule... | /// of arguments per line). The testing framework runs the commands, compares the |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.