prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>SectionType.js<|end_file_name|><|fim▁begin|>import Element from './Element' export default class extends Element { constructor ( val ) { super({ 'w:type': {} }) if (val) this.setVal(val || null) } setVal (value) { if (value) {<|fim▁hole|> this.src['w:type']['@w:val'] = value ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright 2011, Thomas G. Dimiduk # # This file is part of GroupEng. # # Holopy 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,...
# # Holopy is distributed in the hope that it will be useful,
<|file_name|>command_line.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import tornadoredis from repi_server import RepiServer def main(): parser = argparse.ArgumentParser() parser.add_argument('-n', '--name', help='Name of Repi client', type=str, ...
parser.add_argument('-ns', '--namespace',
<|file_name|>version.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 # ...
.. seealso:: https://www.python.org/dev/peps/pep-0440 """ __version__ = "1.13.dev0"
<|file_name|>genComponsTemplate.py<|end_file_name|><|fim▁begin|>import sys import os import io from pkg_resources import parse_version import wx if parse_version(wx.__version__) < parse_version('2.9'): tmpApp = wx.PySimpleApp() else: tmpApp = wx.App(False) from psychopy import experiment from psychopy.experim...
<|file_name|>buildPy2exe.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 #coding:utf8 # *** TROUBLESHOOTING *** # 1) If you get the error "ImportError: No module named zope.interface" then add an empty __init__.py file to the PYTHONDIR/Lib/site-packages/zope directory # 2) It is expected that you will have NSI...
; !insertmacro ASSOCIATE mp4
<|file_name|>macro-expansion.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate dcrate; fn main() { // This ensures that the expansion of nested macros works correctly. example!(inner!(b" ")); // ^^^^^^^^^^^^^^^^^^^^^^^ERR(<1.44.0-beta) no method named `missing` // ^^^^^^^^^^^^^^^^^^^^^^^ERR(<1.44.0-...
<|file_name|>config.py<|end_file_name|><|fim▁begin|><|fim▁hole|> SINFONIER_API_NAME = os.environ[EnvConst.SINFONIER_ENV_KEY] if SINFONIER_API_NAME == EnvConst.DEVELOP_ENVIRONMENT: from environmentConfig.Develop import * elif SINFONIER_API_NAME == EnvConst.PROD_ENVIRONMENT: from environmentConfig.Production imp...
import os import sys from utils.SinfonierConstants import Environment as EnvConst
<|file_name|>test_floating_ips.py<|end_file_name|><|fim▁begin|># Copyright 2013 Openstack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use parking_lot::Mutex; use std::{ ops::{Deref, DerefMut}, sync::Arc, }; use tokio::task; #[macro_export] macro_rules! try_opt_r { ($x:expr) => { match $x { Some(value) => value, None => return Ok(()), } }; } #[m...
let total_mins = total_mins.into();
<|file_name|>0003_auto_20150703_0843.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('user', '0002_auto_20150703_0836'), ...
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, related_name='followers_rel_+'), ), ]
<|file_name|>selectionRendererFactory.js<|end_file_name|><|fim▁begin|>/** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v4.1.5 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, ta...
__metadata('design:paramtypes', []) ], SelectionRendererFactory); return SelectionRendererFactory;
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI :Requirement: Sync :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: Repositories :TestType: Functional :CaseImportance: High :Upstream: No """ from fauxfactory import gen_string from nailgun import entities ...
"""Create Content Custom Sync with minimal input parameters :id: 00fb0b04-0293-42c2-92fa-930c75acee89
<|file_name|>test_myplugin.py<|end_file_name|><|fim▁begin|># # coding=utf-8 import cmd2_myplugin from cmd2 import ( cmd2, ) ###### # # define a class which uses our plugin and some convenience functions # ###### class MyApp(cmd2_myplugin.MyPluginMixin, cmd2.Cmd): """Simple subclass of cmd2.Cmd with our Say...
# If you have extensive initialization needs, create a function # to initialize your cmd2 application.
<|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/. */ #![crate_name = "webdriver_server"] #![crate_type = "rlib"] #![de...
fn handle_element_attribute( &self,
<|file_name|>portfolio.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # (c) 2019 Open Risk (https://www.openriskmanagement.com) # # portfolioAnalytics is licensed under the Apache 2.0 license a copy of which is included # in the source distribution of correlationMatrix. This is notwithstanding any licenses of # thi...
<|file_name|>SyncDisabled.js<|end_file_name|><|fim▁begin|>import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let SyncDisabled = props => <SvgIcon {...props}> <path d="M10 6.35V4.26c-.8.21-1.55.54-2.23.96l1.46 1.46c.25-.12.5-.24.77-.33zm-7.14-.94l2.36 2.36C4.4...
export default SyncDisabled;
<|file_name|>JarFilter.java<|end_file_name|><|fim▁begin|>package mnm.mcpackager.gui; import java.io.File; import javax.swing.filechooser.FileFilter; public class JarFilter extends FileFilter { @Override public boolean accept(File f) { if (f.isDirectory()) return true; return getE...
} }
<|file_name|>GnomeProxySearchStrategy.java<|end_file_name|><|fim▁begin|>package com.btr.proxy.search.desktop.gnome; import java.io.File; import java.io.IOException; import java.net.ProxySelector; import java.util.Properties; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; im...
* @author Bernd Rosstauscher (proxyvole@rosstauscher.de) Copyright 2009
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Copyright (c) 2013-2014 Ben Croston 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, including witho...
self.assertEqual(GPIO.gpio_function(LED_PIN_BCM), GPIO.OUT)
<|file_name|>nc.py<|end_file_name|><|fim▁begin|>################################################################################ # nc.py # # Base class for NC code creation # And global functions for calling current creator # # Hirutso Enni, 2009-01-13 # altered by Dan Falck 2010-08-04 # added tap() arguments Michael H...
def add_stock(type_name, params):
<|file_name|>views__.py<|end_file_name|><|fim▁begin|># coding: utf-8 from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response from collections import defaultdict from django.contrib.auth.decorators import lo...
<|file_name|>PartialSortedKeyStatisticsAttributeIndexTest.java<|end_file_name|><|fim▁begin|>/** * Copyright 2012-2015 Niall Gallagher * * 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|>access_control_firerole.py<|end_file_name|><|fim▁begin|>## This file is part of Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published ...
CFG_ACC_EMPTY_ROLE_DEFINITION_SER, CFG_ACC_EMPTY_ROLE_DEFINITION_OBJ # INTERFACE
<|file_name|>all_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The b Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package b import ( "bytes" "fmt" "io" "math" "path" "runtime" "runtime/debug" "strings" "testing"...
<|file_name|>test.js<|end_file_name|><|fim▁begin|>'use strict'; <|fim▁hole|>var defaultEnvConfig = require('./default'); module.exports = { db: { uri: process.env.MONGOHQ_URL || process.env.MONGODB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/flipflop-test', options: { ...
<|file_name|>SlotFake.java<|end_file_name|><|fim▁begin|>/* * This file is part of TechReborn, licensed under the MIT License (MIT). * * Copyright (c) 2020 TechReborn * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softwar...
*
<|file_name|>uname.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_uname"] /* * This file is part of the uutils coreutils package. * * (c) Joao Oliveira <joaoxsouls@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /...
output.push_str(" "); }
<|file_name|>download.go<|end_file_name|><|fim▁begin|>package main // github.com/cheggaaa/pb import ( "fmt" "os" "path/filepath" "strconv" "time" "github.com/cavaliercoder/grab" "github.com/fatih/color" "github.com/gosuri/uilive" rss "github.com/jteeuwen/go-pkg-rss" ) func getRss(podcast *Podcast) (*rss.Fe...
curPosition++
<|file_name|>SingleRangeElem.d.ts<|end_file_name|><|fim▁begin|>import { IRangeElem } from './IRangeElem'; import { IIterator } from '../../base/iterator';<|fim▁hole|> get step(): number; get to(): number; get isAll(): boolean; get isSingle(): boolean; get isUnbound(): boolean; size(size?: number)...
export declare class SingleRangeElem implements IRangeElem { readonly from: number; constructor(from: number);
<|file_name|>client.js<|end_file_name|><|fim▁begin|>;(function(root) { /** * Constructs a new cross storage client given the url to a hub. By default, * an iframe is created within the document body that points to the url. It * also accepts an options object, which may include a timeout, frameId, and * pr...
var client, interval;
<|file_name|>test_version.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- <|fim▁hole|><|fim▁end|>
API_VERSION = 'v1' DOMAIN = {'contacts': {}}
<|file_name|>Utf8StringModule.java<|end_file_name|><|fim▁begin|>package com.github.mlk.queue.codex; import com.github.mlk.queue.Queuify; import com.github.mlk.queue.implementation.Module; public class Utf8StringModule implements Module { public static Utf8StringModule utfStrings() { return new Utf8StringM...
<|file_name|>fwidgets.py<|end_file_name|><|fim▁begin|>from plow.gui.manifest import QtCore, QtGui from plow.gui.util import formatDateTime, formatDuration <|fim▁hole|> "Decimal", "DateTime", "PillWidget", "Checkbox" ] class FormWidget(QtGui.QWidget): """ The base class for all form widgets. ...
__all__ = [ "Text", "Number",
<|file_name|>aresource.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of
<|file_name|>source.js<|end_file_name|><|fim▁begin|>(function($) { $.Redactor.prototype.source = function() { return { init: function() { var button = this.button.addFirst('html', 'HTML'); this.button.setIcon(button, '<i class="re-icon-html"></i>'); this.button.addCallback(button, this.source.togg...
code = this.paragraphize.load(code); code = this.source.setCaretOnHide(code); this.code.start(code);
<|file_name|>feature-gate-allow-internal-unstable.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be ...
// 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
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "encoding/csv" "flag" "fmt" "io" "os" "strconv" "time" "github.com/golang/glog" ) var defaultValue = flag.String("default", "0", "Default value to assign before the first merge point from the second file") func main() { flag.Parse() ...
// Merge second file into first file.
<|file_name|>CustomerPojoService.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * under the Apache License Version 2.0 (release version 0.8.0) * http://www.apache.org/licenses/LICENSE-2.0 * * Copyright (c) Hoteia, 2012-2014 * http://www.hoteia.com - http://twitter.com/hoteia - contact@hote...
/** * Most of the code in the Qalingo project is copyrighted Hoteia and licensed
<|file_name|>issue-71611.rs<|end_file_name|><|fim▁begin|>// revisions: full min #![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] fn func<A, const F: fn(inner: A)>(outer: A) { //~^ ERROR: using function pointers as const generic parameters is forbidden //~| ERROR: the...
fn main() {}
<|file_name|>iteratee.d.ts<|end_file_name|><|fim▁begin|>import { iteratee } from "./index";<|fim▁hole|>export = iteratee;<|fim▁end|>
<|file_name|>annotations.rs<|end_file_name|><|fim▁begin|>use crate::schema::*; use diesel::sql_types::Text; use diesel::*; #[test] fn association_where_struct_name_doesnt_match_table_name() { #[derive(PartialEq, Eq, Debug, Clone, Queryable, Identifiable, Associations)] #[belongs_to(Post)] #[table_name = "c...
assert!(jim.is_some()); } #[test]
<|file_name|>test_os_server.py<|end_file_name|><|fim▁begin|>import mock import pytest import yaml import inspect import collections from ansible.module_utils.six import string_types from ansible.modules.cloud.openstack import os_server class AnsibleFail(Exception): pass class AnsibleExit(Exception): pass ...
class TestCreateServer(object): def setup_method(self, method): self.cloud = FakeCloud() self.module = mock.MagicMock()
<|file_name|>set_get.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding=utf-8 import logging from db_operation import * logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',datefmt='%a, %d %b %Y %H:%M:%S') def query_conf(marathon,app): "...
logging.debug("in query_conf:{}".format(result)) return result
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>use ascii_canvas::AsciiCanvas; use grammar::parse_tree::Span; use message::builder::MessageBuilder;<|fim▁hole|> use super::*; fn install_tls() -> Tls { Tls::test_string( r#"foo bar baz "#, ) } #[test] fn hello_world() { let _tls = install_tls(); ...
use test_util::expect_debug; use tls::Tls;
<|file_name|>RustTestDescription.java<|end_file_name|><|fim▁begin|>/* * Copyright 2016-present Facebook, 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....
import com.facebook.buck.rules.ImplicitDepsInferringDescription; import com.facebook.buck.rules.SourcePath; import com.facebook.buck.rules.SourcePathRuleFinder;
<|file_name|>libdump1090.rs<|end_file_name|><|fim▁begin|>// Pitot - a customizable aviation information receiver // Copyright (C) 2017-2018 Datong Sun (dndx@idndx.com) // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // t...
<|file_name|>quic_chromium_client_session.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 "net/quic/quic_chromium_client_session.h" #include <memory> #inclu...
CancelMigrateBackToDefaultNetworkTimer();
<|file_name|>get_mnist_prediction.py<|end_file_name|><|fim▁begin|><|fim▁hole|> return chainer.datasets.get_mnist(withlabel=False)[0]<|fim▁end|>
import chainer def main():
<|file_name|>ext.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.apache.org/licenses/LI...
/// A prelude for conveniently writing platform-specific code.
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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...
from google.appengine.ext import ndb, deferred, db
<|file_name|>populate_mini_ws.py<|end_file_name|><|fim▁begin|>from biokbase.workspace.client import Workspace import requests import json import sys from time import time from fix_workspace_info import fix_all_workspace_info from pprint import pprint kb_port = 9999 mini_ws_url = f"http://localhost:{kb_port}/services/w...
})
<|file_name|>first.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # usage: A debugging class import pdb version=2.0 def my_add(a,b): ''' This is the function for addition of numbers and strings ''' print "value of a is {}".format(a) print "value of b is {}".format(b) return a+b def my_div(a,b): ''' Th...
print "division of two numbers - {}".format(my_div(4,2))
<|file_name|>budget_tests.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2018 The PIVX developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "masternode-budget.h" #include "tinyformat.h" #include "utilmoneys...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""foo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: ...
if settings.DEBUG:
<|file_name|>scene.rs<|end_file_name|><|fim▁begin|>use event::Event;<|fim▁hole|>use gamestate::GameState; pub type BoxedScene = Box<Scene + 'static>; pub trait Scene { fn handle_event(&mut self, e: &Event, state: &mut GameState) -> Option<BoxedScene>; }<|fim▁end|>
<|file_name|>HomeAutomation.py<|end_file_name|><|fim▁begin|>from org.myrobotlab.net import BareBonesBrowserLaunch def outsideLights(value): if value = 1 BareBonesBrowserLaunch.openURL("http://ip_address:3480/data_request?id=action&output_format=xml&DeviceNum=6&serviceId=urn:upnp-org:serviceId:SwitchPower1&actio...
else BareBonesBrowserLaunch.openURL("http://ip_address:3480/data_request?id=action&output_format=xml&DeviceNum=6&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0")
<|file_name|>device.py<|end_file_name|><|fim▁begin|>from lxml import etree from nxpy.interface import Interface from nxpy.vlan import Vlan from nxpy.flow import Flow from util import tag_pattern class Device(object): # Singleton _instance = None def __new__(cls, *args, **kwargs): if not cls._ins...
device = etree.Element('system') if self.name: etree.SubElement(device, "host-name").text = self.name
<|file_name|>windows.js<|end_file_name|><|fim▁begin|>import WindowController from "@/modv/window-controller"; import getLargestWindow from "@/modv/get-largest-window"; const state = {<|fim▁hole|> windows: [], size: { width: 0, height: 0 } }; // We can't store Window Objects in Vuex because the Observer traversal e...
<|file_name|>test_functions.py<|end_file_name|><|fim▁begin|># c: 14.04.2008, r: 14.04.2008 import numpy as nm from sfepy import data_dir filename_mesh = data_dir + '/meshes/2d/square_unit_tri.mesh' def get_pars(ts, coors, mode=None, region=None, ig=None, extra_arg=None): if mode == 'special': if extra_ar...
ebcs = {
<|file_name|>89.py<|end_file_name|><|fim▁begin|>""" 89. Gray Code https://leetcode.com/problems/gray-code/ """ from typing import List class Solution: def grayCode(self, n: int) -> List[int]: res = [0] for i in range(n): res += [x + 2**i for x in reversed(res)] return res de...
<|file_name|>FieldInfo.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 informat...
<|file_name|>client_legacy.py<|end_file_name|><|fim▁begin|>''' Created on May 6, 2014 @author: cmills The idea here is to provide client-side functions to interact with the TASR repo. We use the requests package here. We provide both stand-alone functions and a class with methods. The class is easier if you are us...
url = 'http://%s:%s/tasr/id/%s' % (host, port, id_str) return reg_schema_from_url(url, timeout=timeout, err_404='No schema for id.')
<|file_name|>dependencygraph.py<|end_file_name|><|fim▁begin|>from dirbalak import graph from dirbalak import repomirrorcache from dirbalak import describetime from upseto import gitwrapper class DependencyGraph: _CONTINUOUS_INTEGRATION_VIOLATION_TIME = 14 * 24 * 60 * 60 def __init__(self, dependencies, getNo...
<|file_name|>test_controller.py<|end_file_name|><|fim▁begin|>import pytest import time import ray from ray import serve def test_redeploy_start_time(serve_instance): """Check that redeploying a deployment doesn't reset its start time.""" controller = serve.api._global_client._controller @serve.deployme...
<|file_name|>splitvec.rs<|end_file_name|><|fim▁begin|>//! Test module for SplitVec use cripes::util::splitvec::SplitVec; <|fim▁hole|> v.push_and_copy_state(); panic_unless_eq!(&[1, 2, 3], &*v); v.pop(); panic_unless_eq!(&[1, 2], &*v); v.pop_state(); panic_unless_eq!(&[1, 2, 3], &*v); } /// Che...
#[test] fn test_push_and_copy_state() { let mut v = SplitVec::from(vec![1, 2, 3]);
<|file_name|>upload_clinic_codes.py<|end_file_name|><|fim▁begin|>from csv import DictReader from django.core.management.base import BaseCommand from registrations.models import ClinicCode class Command(BaseCommand): help = ( "This command takes in a CSV with the columns: uid, code, facility, province," ...
def log(self, level, msg): self.stdout.write(level(msg))
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|># Copyright 2013: Mirantis Inc. # 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....
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # sammy documentation build configuration file, created by # sphinx-quickstart on Sun Feb 17 11:46:20 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values a...
<|file_name|>EditorCommandHandlers-test.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. * * 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 t...
* the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the
<|file_name|>313_test_urllib2.py<|end_file_name|><|fim▁begin|>import unittest from test import support import os import io import socket import urllib.request from urllib.request import Request, OpenerDirector # XXX # Request # CacheFTPHandler (hard to write) # parse_keqv_list, parse_http_list, HTTPDigestAuthHandler...
class Unknown:
<|file_name|>strict_https_loader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from...
from urllib import unquote
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod areas; mod area_frame_allocator; mod paging; mod info; use self::paging::{PAGE_SIZE, PhysicalAddress}; use self::area_frame_allocator::{AreaFrameAllocator}; use spin::{Once, Mutex, MutexGuard}; pub use self::paging::{Page, VirtualAddress}; pub use self::paging::ent...
} else {
<|file_name|>test_taxonomy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os from os import path import logging import shutil from sqlalchemy import create_engine from . import config from .config import TestBase import taxtastic from taxtastic.taxonomy import Taxonomy, TaxonIntegrityError import taxt...
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-12 15:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True<|fim▁hole|> ] operations = [ m...
dependencies = [
<|file_name|>memebot.py<|end_file_name|><|fim▁begin|>import praw import json import requests import tweepy import time import os import csv import re import configparser import urllib.parse import sys from glob import glob from gfycat.client import GfycatClient from imgurpython import ImgurClient import distutils.core ...
def strip_title(title): # Shortlink is 22 characters long, plus one character for a space if len(title) < 280: return title
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2014 Frederic Branczyk fbranczyk@gmail.com # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated d...
# The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. #
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Declaration } from '@angular/compiler/src/i18n/serializers/xml_helper'; import { Component } from '@angular/core'; import {Routes, RouterModule} from '@angular/router'; <|fim▁hole|>}) export class AppComponent { title = 'app works!'; }<|fim▁end|>
@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'],
<|file_name|>findsong.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env ../jazzshell """ Perform song identification by loading up a corpus of harmonic analyses and comparing parse results to all of them, according to some distance metric. """ """ ============================== License ==================================...
def main(): usage = "%prog [options] <song-set> <results-file0> [<results-file1> ...]"
<|file_name|>all_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright (C) 2009 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<|fim▁hole|># Unless ...
# # http://www.apache.org/licenses/LICENSE-2.0 #
<|file_name|>GSnippetMetadatum.js<|end_file_name|><|fim▁begin|>/** * @license * Copyright 2015 Google Inc. 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 * * ...
}, { name: 'label',
<|file_name|>AdminToolItem.java<|end_file_name|><|fim▁begin|>package net.geforcemods.securitycraft.items;<|fim▁hole|>import net.geforcemods.securitycraft.ConfigHandler; import net.geforcemods.securitycraft.SCContent; import net.geforcemods.securitycraft.api.IModuleInventory; import net.geforcemods.securitycraft.api.IOw...
import java.util.List;
<|file_name|>std_dirs.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under The General Public License (GPL), version 3. // Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed // under the GPL Licenc...
priv_dirs.chain(pub_dirs).collect() }
<|file_name|>primitive.rs<|end_file_name|><|fim▁begin|>use value::{Value}; // Primitive views are how Eve programs access built-in functions #[derive(Clone, Debug, Copy)] pub enum Primitive { LT, LTE, NEQ, Add, Subtract, Multiply, Divide, Remainder, Round, Split, Concat, ...
}
<|file_name|>getblocktemplate_proposals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core Developers // Copyright (c) 2015 Solarminx # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from t...
n = [] if len(cur) & 1: cur.append(cur[-1])
<|file_name|>growl.ngfactory.ts<|end_file_name|><|fim▁begin|>/** * This file is generated by the Angular 2 template compiler. * Do not edit. */ /* tslint:disable */ import * as import0 from '@angular/core/src/linker/ng_module_factory'; import * as import1 from '../../../components/growl/growl'; import * as import2...
<|file_name|>2_4_1_a.rs<|end_file_name|><|fim▁begin|>/* 2.4.6: a) S -> + S S | - S S | a $> rustc -o parser 2_4_1_a.rs $> ./parser */ static CODE: &'static str = "-+aa-aa"; pub fn sa(mut head: i32) -> i32 { match CODE.chars().nth(head as usize){ None => { panic!("missing requi...
<|file_name|>test_tasks.py<|end_file_name|><|fim▁begin|>from unittest import mock import os import pytest from django.conf import settings from waffle.testutils import override_switch from olympia import amo from olympia.addons.tasks import ( recreate_theme_previews, update_addon_average_daily_users, upd...
}, { 'image': list(renderings['amo']['full']), 'thumbnail': list(renderings['amo']['thumbnail']),
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Bootstrap installation of setuptools from ez_setup import use_setuptools use_setuptools() import os import sys from fnmatch import fnmatchcase from distutils.util import convert_path from propane_distribution import cmdclassdict from setuptools impor...
stack.append((fn, prefix + name + '/', package, only_in_packages)) elif package or not only_in_packages: # is a file bad_name = False
<|file_name|>unit.py<|end_file_name|><|fim▁begin|>""" Header Unit Class """ ### INCLUDES ### import logging from gate.conversions import round_int from variable import HeaderVariable from common import MIN_ALARM, MAX_ALARM ### CONSTANTS ### ## Logger ## LOGGER = logging.getLogger(__name__) # LOGGER.setLevel(loggin...
<|file_name|>menu.js<|end_file_name|><|fim▁begin|>import collapsibleFactory from '../common/collapsible'; import collapsibleGroupFactory from '../common/collapsible-group'; const PLUGIN_KEY = 'menu'; /* * Manage the behaviour of a menu * @param {jQuery} $menu<|fim▁hole|> constructor($menu) { this.$menu =...
*/ class Menu {
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>"""ApacheParser is a member object of the ApacheConfigurator class.""" import copy import fnmatch import logging import os import re import subprocess import sys import six from certbot import errors from certbot_apache import constants logger = logging.getLogger(...
self.parser_paths[os.path.dirname(incl)] = [ os.path.basename(incl)]
<|file_name|>effective_route.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 g...
CIDR notation. :type address_prefix: list[str]
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io; use std::cmp::min; type Matrix = Vec<Vec<u64>>; fn readline () -> String { let mut input_str = String::new(); io::stdin().read_line(&mut input_str).ok().expect("read error"); input_str } fn read_matrix (n: usize) -> Matrix { (0..n).map(...
<|file_name|>SynchronouslyLoadedUserBinaryDictionary.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2012 The Android Open Source Project * * 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 Licens...
syncReloadDictionaryIfRequired(); getWordsInner(codes, prevWordForBigrams, callback, proximityInfo); }
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for @webpack-blocks/assets 2.0 // Project: https://github.com/andywer/webpack-blocks/tree/master/packages/assets // Definitions by: Max Boguslavskiy <https://github.com/maxbogus> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /...
mimetype?: string | undefined; }
<|file_name|>regions-infer-paramd-indirect.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://...
}
<|file_name|>train_ptb_dep_sa_albert_topk.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-03-07 23:48 from hanlp.metrics.parsing import conllx_eval from hanlp.datasets.parsing.ptb import PTB_SD330_DEV, PTB_SD330_TRAIN, PTB_SD330_TEST, PTB_TOKEN_MAPPING from hanlp.components.parsers...
learning_rate_transformer=1e-5, # alpha=1,
<|file_name|>text.py<|end_file_name|><|fim▁begin|>import time from torba.server import util def sessions_lines(data): """A generator returning lines for a list of sessions. data is the return value of rpc_sessions().""" fmt = ('{:<6} {:<5} {:>17} {:>5} {:>5} {:>5} ' '{:>7} {:>7} {:>7} {:>7} {...
recv_count, recv_size, send_count, send_size, time) in data: yield fmt.format(id_, flags, client, proto, '{:,d}'.format(reqs),
<|file_name|>LiveDebugVariables.cpp<|end_file_name|><|fim▁begin|>//===- LiveDebugVariables.cpp - Tracking debug info variables -------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details...
if (Segment->end < Stop) {