prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>footerDirective.js<|end_file_name|><|fim▁begin|>module.exports = function () { return { templateUrl : './shared/partials/footer/directives/footer.html', controller: require('./footerCtrl'), restrict: 'E', scope: {}<|fim▁hole|>};<|fim▁end|>
};
<|file_name|>config.rs<|end_file_name|><|fim▁begin|>//! Configuration module. //! //! Handles and configures the initial settings and variables needed to run the program. use std::{ cmp::{Ordering, PartialOrd}, collections::{btree_set::Iter, BTreeSet}, convert::From, fs, i64, path::{Path, PathBuf},...
Path::new("/etc/super-analyzer/rules.json") );
<|file_name|>speed.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals, division import random import string import timeit import os import zipfile import datrie def words100k(): zip_name = os.path.join( os.path.abspath(os....
"".join([random.choice(alphabet) for x in range(random.randint(1,15))]) for y in range(num)
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//! Requires the 'framework' feature flag be enabled in your project's //! `Cargo.toml`. //! //! This can be enabled by specifying the feature in the dependency section: //! //! ```toml //! [dependencies.serenity] //! git = "https://github.com/serenity-rs/serenity.git" ...
<|file_name|>UnidadFlt.java<|end_file_name|><|fim▁begin|>package com.atux.bean.consulta; <|fim▁hole|> /** * Created by MATRIX-JAVA on 27/11/2014. */ public class UnidadFlt extends FilterBaseLocal { public static final String PICK = "PICK"; public UnidadFlt(String unidad) { this.unidad = u...
import com.atux.comun.FilterBaseLocal;
<|file_name|>plugin_dnssec_test.go<|end_file_name|><|fim▁begin|>package test import ( "io/ioutil" "os" "testing" "github.com/coredns/coredns/plugin/test" "github.com/miekg/dns" ) func TestLookupBalanceRewriteCacheDnssec(t *testing.T) { t.Parallel() name, rm, err := test.TempFile(".", exampleOrg)<|fim▁hole|> ...
if err != nil { t.Fatalf("Failed to create zone: %s", err) } defer rm()
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use ::pthread_mutex_t; pub type blkcnt_t = i64; pub type blksize_t = i64; pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type fsblkcnt_t = u64; pub type fsfilcnt_t = u64; pub type ino_t = u64; pub type nlink_t = u64; pub type off_t = i64; pub t...
pub const SYS_recvmmsg: ::c_long = 357; pub const SYS_sendmmsg: ::c_long = 358;
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate android_glue; use libc; use std::ffi::{CString}; use std::sync::mpsc::{Receiver, channel}; use {CreationError, Event, MouseCursor}; use CreationError::OsError; use events::ElementState::{Pressed, Released}; use events::Event::{MouseInput, MouseMoved}; use e...
if builder.sharing.is_some() { unimplemented!() }
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod audio_io; pub mod debug; pub mod flow; pub mod livecode; use futures::executor; use std::sync::Arc; pub trait Module: Send { fn new(ifc: Arc<flow::Interface>) -> Self where Self: Sized; fn name() -> &'static str where Self: Sized...
fn stop(&mut self);
<|file_name|>result-get-panic.rs<|end_file_name|><|fim▁begin|>// run-fail // error-pattern:called `Result::unwrap()` on an `Err` value // ignore-emscripten no processes <|fim▁hole|> fn main() { println!("{}", Err::<isize, String>("kitty".to_string()).unwrap()); }<|fim▁end|>
use std::result::Result::Err;
<|file_name|>parselocator_test.go<|end_file_name|><|fim▁begin|>package maidenhead import ( "math" "strings" "testing" ) // parsed locator must be translated to the same locator // using GridSquare() func TestParseLocator(t *testing.T) { var locTests = map[string]Point{ "JN88RT": Point{48.791667, 17.416667}, "...
<|file_name|>destructured-local.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.ap...
// lldb-command:print x // lldb-check:[...]$23 = 28 // lldb-command:print y // lldb-check:[...]$24 = 29
<|file_name|>Console.cpp<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////////////// // Atol file manager project <http://atol.sf.net> // // This code is licensed under BSD license.See "license.txt" for more details. // // File: TOFIX /////////////////////////////////...
<|file_name|>divider-demo.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core'; @Component({ template: require('./divider.html') })<|fim▁hole|>export class DividerDemoComponent implements OnInit { constructor() { } ngOnInit() { } }<|fim▁end|>
<|file_name|>client_test.go<|end_file_name|><|fim▁begin|>// Copyright 2012-2016 Canonical Ltd. // Licensed under the LGPLv3, see LICENCE file for details. package gomaasapi import ( "bytes" "fmt" "io/ioutil" "net/http" "net/url" "strings" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" ) type C...
<|file_name|>test_common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import pytest import numpy as np from pandas import Series, Timestamp from pandas.compat import range, lmap import pandas.core.common as com import pandas.util.testing as tm def test_mut_exclusive(): msg = "mutually exclusive argu...
result = com.map_indices_py(data) assert (result == expected)
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import os import socket import geoip2.database from django.conf import settings from django.core.validators import ipv4_re from django.utils.ipv6 import is_valid_ipv6_address from .resources import City, Country # Creating the settings dictionary with any settings, ...
def country(self, query): """ Return a dictionary with the country code and name when given an
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import absolute_import from django.contrib import admin from django.contrib.admin.models import DELETION from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import Permission from django.core.urlresolvers import ...
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache Li...
<|file_name|>uistuff.py<|end_file_name|><|fim▁begin|>import colorsys import sys import xml.etree.cElementTree as ET # from io import BytesIO from gi.repository import Gtk, Gdk, GObject, Pango from gi.repository.GdkPixbuf import Pixbuf from pychess.System import conf from pychess.System.Log import log from pychess.Sys...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import test_invoice_mode_weekly<|fim▁hole|><|fim▁end|>
from . import test_invoice_mode_weekly_is_it_today
<|file_name|>verify.rs<|end_file_name|><|fim▁begin|>use super::{Message,ObjectData,VersionData}; use super::pow::{ProofOfWork,VerifyError,network_pow_config}; use config::Config; use std::time::{Duration,SystemTime}; use timegen::TimeType; pub enum MessageVerifierError { OurNonce, OldVersion, NoClockSync, ...
<|file_name|>SQLFrom.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2013-2015 Uncharted Software Inc. * * Property of Uncharted(TM), formerly Oculus Info Inc. * http://uncharted.software/ * * Released under the MIT License. * * Permission is hereby granted, free of charge, to any person obtaining a copy o...
<|file_name|>ProjectChannelBean.java<|end_file_name|><|fim▁begin|>package com.example.channelmanager; /** * Created by Administrator on 2017/2/7. * 频道列表 */ public class ProjectChannelBean { private String topicid; // 设置该标签是否可编辑,如果出现在我的频道中,且值为1,则可在右上角显示删除按钮 private int editStatus; private String cid...
public String getTname() { return tname; }
<|file_name|>Tree.py<|end_file_name|><|fim▁begin|>''' Tree from: http://www.quesucede.com/page/show/id/python-3-tree-implementation ''' from urllib.parse import urlparse import os (_ROOT, _DEPTH, _BREADTH) = range(3) class Node: def __init__(self, identifier): self.__identifier = identifier self...
tree.add_node("Jane", t)
<|file_name|>ui-list.js<|end_file_name|><|fim▁begin|>/* * File: ui-list.js * Author: Li XianJing <xianjimli@hotmail.com> * Brief: List * * Copyright (c) 2011 - 2015 Li XianJing <xianjimli@hotmail.com> * */ function UIList() { return; } UIList.prototype = new UIElement(); UIList.prototype.isUIList = true...
<|file_name|>0007_auto_20170620_0011.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-20 00:11<|fim▁hole|> class Migration(migrations.Migration): dependencies = [ ('blog', '0006_auto_20170620_0010'), ] operations = [ migrations.AlterField( ...
from __future__ import unicode_literals from django.db import migrations, models
<|file_name|>functions_bak.js<|end_file_name|><|fim▁begin|>log.enableAll(); (function(){ function animate() { requestAnimationFrame(animate); TWEEN.update(); } animate(); })(); var transform = getStyleProperty('transform'); var getStyle = ( function() { var getStyleFn = getComputedStyle ...
num2 = -width + num1 + 2; }
<|file_name|>xcode.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 Li...
<|file_name|>rich_helper.py<|end_file_name|><|fim▁begin|>from rich.console import Console from rich.markdown import Markdown from rich.syntax import Syntax def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap): syntax = Syntax( code, lang, theme=theme, line_num...
<|file_name|>Formula.py<|end_file_name|><|fim▁begin|>from collections import deque import re class Formula(object): """ Formula allows translation from a prefix-notation expression in a string to a complex number. This is eventually to be replaced with a cython, c++, or openCL implementation ...
return complex(float(nums[0], nums[1][:-1])) else: return EOFError
<|file_name|>SideNav.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react"; import { InternationalProps, ForwardRefReturn, ReactAttr } from "../../../typings/shared"; export type SideNavTranslationKey = "carbon.sidenav.state.closed" | "carbon.sidenav.state.open"; export interface SideNavProps extends React...
<|file_name|>AutodocsLayout.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015-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 foun...
</div> ); }
<|file_name|>0006_auto__add_field_userproject_drive_auth.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 field 'UserProject...
'projects.userproject': { 'Meta': {'object_name': 'UserProject', 'db_table': "u'user_project'"}, 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 2, 27, 0, 0)', 'null': 'True', 'blank': 'True'}),
<|file_name|>Windows.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************** * Copyright (c) 2014-2020 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/O...
<|file_name|>GUICG2.py<|end_file_name|><|fim▁begin|># GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 #...
ClassName = GUICommon.GetClassRowName (GemRB.GetVar ("Class")-1, "index") if ClassName == "": TextAreaControl.SetText(17242)
<|file_name|>option_unwrap.rs<|end_file_name|><|fim▁begin|>// The commoner has seen it all, and can handle any gift well. // All gifts are handled explicitly using `match`. fn give_commoner(gift: Option<&str>) { // Specify a course of action for each case. match gift { Some("snake") => println!("Yuck! I...
// `unwrap` returns a `panic` when it receives a `None`. let inside = gift.unwrap();
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html #![deny(unused_must_use)] pub mod backend; mod backend_proto; pub mod card; pub mod cloze; pub mod collection; pub mod config; pub mod dbche...
pub mod i18n;
<|file_name|>test_common_controls.py<|end_file_name|><|fim▁begin|># GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software...
#
<|file_name|>unreachable-lint.rs<|end_file_name|><|fim▁begin|>// check-pass // edition:2018 #![deny(unreachable_code)] <|fim▁hole|>async fn endless() -> ! { loop {} } fn main() { }<|fim▁end|>
async fn foo() { endless().await; }
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># Copyright 2021 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Mozaik Website Event Track", "summary": """ This module allows to see the event menu configuration even without activated debug mode...
"website_event_track", ], "data": [ "views/event_event.xml",
<|file_name|>FiletramCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from pyload.plugin.internal.SimpleCrypter import SimpleCrypter class FiletramCom(SimpleCrypter): __name = "FiletramCom" __type = "crypter"<|fim▁hole|> __config = [("use_premium" , "bool", "Use premium account if ...
__version = "0.03" __pattern = r'http://(?:www\.)?filetram\.com/[^/]+/.+'
<|file_name|>0008_auto_20170529_1302.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import ckeditor.fields from django.db import migrations from django.db import models <|fim▁hole|> ] operations = [ migrations.AlterField( model_name='proposa...
class Migration(migrations.Migration): dependencies = [ ('meinberlin_budgeting', '0007_update-strings'),
<|file_name|>irc.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "irc.h" #include "net.h...
struct ircaddr
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(raw)] extern crate fixed_size_array; use std::{ptr, raw}; use std::marker::PhantomData; use std::raw::Repr; use fixed_size_array::FixedSizeArray; /// An iterator constructed by the `literator!` macro. pub struct Literator<Array, Elem> where Array: Fixe...
#[test] fn smoke_test() { let v: Vec<_> = container![1, 2, 3]; assert_eq!(&v, &[1, 2, 3]);
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding: utf-8<|fim▁hole|> # Copyright (C) USC Information Sciences Institute # Author: Vladimir M. Zaytsev <zaytsev@usc.edu> # URL: <http://nlg.isi.edu/> # For more information, see README.md # For license information, see LICENSE from django.co...
<|file_name|>repr-transparent-other-reprs.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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://w...
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed
<|file_name|>enum_builder.rs<|end_file_name|><|fim▁begin|>/* Some types from or based on types from elastic: https://github.com/elastic-rs/elastic * * Licensed under Apache 2.0: https://github.com/elastic-rs/elastic/blob/51298dd64278f34d2db911bd1a35eb757c336198/LICENSE-APACHE * * Licensed under the Apache License, ...
} }
<|file_name|>glyphquery.py<|end_file_name|><|fim▁begin|>"""Glyph-specific queries on font-files""" from ttfquery import describe try: from OpenGLContext.debug.logs import text_log except ImportError: text_log = None def hasGlyph( font, char, encoding=None ): """Check to see if font appears to have explicit...
return False return True
<|file_name|>test_update_deps.py<|end_file_name|><|fim▁begin|>import unittest import os import subprocess from test.stub_config import StubConfig, StubConfigOnStubProject from test.stub_environment import StubEnvironment from test.stub_stdout import StubStdout from googkit.commands.update_deps import UpdateDepsComman...
'{depswriter_path}',
<|file_name|>re6.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- import re # Обработка телефонных номеров<|fim▁hole|># ('800', '555', '1212', '1234') print phonePattern.search('800.555.1212 x1234').groups() # ('800', '555', '1212', '1234') print phonePattern.search('800-555-1212').groups() # ('800', '555', '12...
phonePattern = re.compile(r'^(\d{3})\D*(\d{3})\D*(\d{4})\D*(\d*)$') print phonePattern.search('80055512121234').groups()
<|file_name|>m3.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<|fim▁hole|>// <LICENSE-MIT or http://...
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from string import Template import re import os import sys import time import json import math import os import subprocess import csv def saveResults(resultsList, json_fname, csv_fname): print(resultsList)<|fim▁hole|> json.dump(resultsList, outfile, indent=...
print(json.dumps(resultsList, indent=4, sort_keys=True)) with open(json_fname, 'w') as outfile:
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>import { Noise } from './noise';<|fim▁hole|> private state: AppState = AppState.Stopped; private noise: Noise; constructor() { this.noise = new Noise(); } bootstrap(): void { this.bindEvents(); this.enterState(AppState.Stopped); } private bi...
export class App {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[cfg(test)] use game; use ai; use ai::run_match; use constants::LINES; use std::sync::Arc; #[test] fn match_mc() { let structure = Arc::new(game::Structure::new(&LINES)); let mut white_player = ai::mc::MonteCarloAI::new(1000); let mut black_player = ai::mc:...
let mut rng = thread_rng(); for _ in 0..10000 {
<|file_name|>compositor.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 CompositionPipeline; use SendableFrameTree; use app_un...
warn!("Sending layout control message failed ({}).", e); } }
<|file_name|>downloads.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-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. """ Module for the downloading, checking,...
<|file_name|>feed_parse_extract夢見る世界.py<|end_file_name|><|fim▁begin|>def extract夢見る世界(item): """ Parser for '夢見る世界'<|fim▁hole|> if 'Otome Games' in item['tags']: return None if 'Drama CDs' in item['tags']: return None vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vo...
"""
<|file_name|>cache.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from cachy import CacheManager from cachy.serializers import PickleSerializer<|fim▁hole|> class Cache(CacheManager): _serializers = { 'pickle': PickleSerializer() }<|fim▁end|>
<|file_name|>test_imperative_signal_handler.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 PaddlePaddle 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 # #...
self.assertIn("Fatal", cpt.get_exception_message(ex))
<|file_name|>ip.rs<|end_file_name|><|fim▁begin|>use std::borrow::Cow; use std::net::IpAddr; use std::str::FromStr; /// Validates whether the given string is an IP V4 #[must_use] pub fn validate_ip_v4<'a, T>(val: T) -> bool where T: Into<Cow<'a, str>>, { IpAddr::from_str(val.into().as_ref()).map_or(false, |i| i...
<|file_name|>bitcoin_nb.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nb" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About scrypt</source> ...
<|file_name|>content_plugins.py<|end_file_name|><|fim▁begin|>""" Definition of the plugin. """ from django.utils.translation import ugettext_lazy as _ from fluent_contents.extensions import ContentPlugin, plugin_pool from . import models<|fim▁hole|>@plugin_pool.register class LocationPlugin(ContentPlugin): model =...
<|file_name|>history_test.go<|end_file_name|><|fim▁begin|>/* * Trap * An anti-pryer server for better privacy * * This file is a part of Trap project * * Copyright 2016 Rain Lee <raincious@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compl...
// Loop it back, we should get the same data as we created earlier on histories.GetSlot(currentTime.Add(
<|file_name|>environ.rs<|end_file_name|><|fim▁begin|>use std::env; use std::collections::BTreeSet; use regex::{Regex, escape}; use failure::{Error, err_msg, ResultExt}; use crate::config::read_settings::MergedSettings; <|fim▁hole|> for item in patterns { if var_pattern.len() > 0 { var_pattern....
fn patterns_to_regex(patterns: &BTreeSet<String>) -> Result<Regex, Error> { let mut var_pattern = String::with_capacity(100);
<|file_name|>patch_4.py<|end_file_name|><|fim▁begin|># Copyright 2008-2015 Canonical<|fim▁hole|># License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTIC...
# # 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
<|file_name|>ActionListenerSettingsControl.java<|end_file_name|><|fim▁begin|>package de.turnierverwaltung.control.settingsdialog; import java.awt.Dialog; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.sql.SQLException; import javax.swing...
mainControl.getLanguagePropertiesControl().setLanguageToEnglish(); mainControl.getPropertiesControl().writeProperties(); }
<|file_name|>messagetcp.go<|end_file_name|><|fim▁begin|>package coap import ( "encoding/binary" "errors" "io" ) // TcpMessage is a CoAP Message that can encode itself for TCP // transport. type TcpMessage struct { Message } func (m *TcpMessage) MarshalBinary() ([]byte, error) { bin, err := m.Message.MarshalBina...
| Token (if any, TKL bytes) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<|file_name|>Details.test.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import { render, waitForElement } from 'react-testing-library'; import FakeDataProvider from '@olimat/web/utils/test/FakeDataProvider'; import MockErrorProvider from '@olimat/web/utils/test/MockErrorProvider'; import MockNextContext ...
);
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>""" Django Admin pages for DiscountRestrictionConfig. """ from django.contrib import admin from django.utils.translation import gettext_lazy as _ from openedx.core.djangoapps.config_model_utils.admin import StackedConfigModelAdmin from .models import DiscountPercen...
'is in, then the more specific context overrides the more general context.' ), }), ('Configuration', {
<|file_name|>prod.py<|end_file_name|><|fim▁begin|>""" Production settings Debug OFF Djeroku Defaults: Mandrill Email -- Requires Mandrill addon dj_database_url and django-postgrespool for heroku postgres configuration memcachify for heroku memcache configuration<|fim▁hole|> ALLOWED_HOSTS - You MUST add...
Commented out by default - redisify for heroku redis cache configuration What you need to set in your heroku environment (heroku config:set key=value):
<|file_name|>products.js<|end_file_name|><|fim▁begin|>(function(){ angular.module('list-products', []) .directive('productInfo', function() { return { restrict: 'E', templateUrl: 'partials/product-info.html' } }) .directive('productForm', function() { return { res...
return {
<|file_name|>actors.js<|end_file_name|><|fim▁begin|>var fs = require('fs') , child_process = require('child_process') , _glob = require('glob') , bunch = require('./bunch') ; exports.loadEnv = function loadEnv(env, cb) { var loaders = [] function load(name, cb) {<|fim▁hole|> } for (var name in env) { ...
fs.readFile(env[name], function(error, data) { env[name] = env[name].match(/.*\.json$/) ? JSON.parse(data) : data; cb(error, data) })
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- from PIL import Image, ImageChops, ImageDraw from django.contrib.auth.models import User from filer.models.foldermodels import Folder from filer.models.clipboardmodels import Clipboard, ClipboardItem def create_superuser(): superuser = Us...
'admin@free.fr',
<|file_name|>ejs.js<|end_file_name|><|fim▁begin|>/* 基本测试,ejs 模版 测试 例子 */ var should = require('should'); var request = require('request'); var path = require('path'); var testconf = require('./testconf.js'); module.exports.rrestjsconfig = { listenPort:3000, tempSet:'ejs', tempFolder :'/static', baseDir:...
} else if(pname === '/d'){ res.render('/ejs.ejs', {"name":'hello world'}, function(err, html){
<|file_name|>square-every-digit.js<|end_file_name|><|fim▁begin|>// Welcome. In this kata, you are asked to square every digit of a number. // // For example, if we run 9119 through the function, 811181 will come out. // // Note: The function accepts an integer and returns an integer function squareDigits(num){ let d...
<|file_name|>log_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unles...
{TailLines: &negativeOne}, }
<|file_name|>test_photos.py<|end_file_name|><|fim▁begin|>import base64 import os import pytest import six from pytest_bdd import parsers, scenarios, then, when from spud import media, models scenarios('photos.feature') @when('we create a photo called <name> using <filename>') def step_create_photo(session, name, ...
'we should get a photo with description {description}')) def step_test_r_photo_description(session, description): photo = session.obj
<|file_name|>config_directory_backend.go<|end_file_name|><|fim▁begin|>// +build ignore package directory import ( "github.com/corestoreio/csfw/config/element" "github.com/corestoreio/csfw/config/model" ) // Backend will be initialized in the init() function together with ConfigStructure. var Backend *PkgBackend /...
<|file_name|>pool.go<|end_file_name|><|fim▁begin|>package models import "fmt" // Room Pool containing all rooms currently active var RoomPool = make([] *Room, 0) func AddRoom(r *Room) { RoomPool = append(RoomPool, r) } // FindRoom finds a room in the RoomPool // and returns its index and value. // If the room does...
} } }
<|file_name|>rgb_depth_exclusion.py<|end_file_name|><|fim▁begin|>import cv2 import os import scipy.misc as misc path = os.getcwd() for x in xrange(15): rgb = cv2.imread(path + '/output/rgb_img_' + str(x) + '.jpg') depth = cv2.imread(path + '/output/depth_img_' + str(x) + '.jpg') depth_inquiry = depth.copy()...
# depth_inquiry[depth_inquiry > 0] = 255 median = cv2.medianBlur(depth_inquiry,5)
<|file_name|>app.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import json from flask import Flask from flask import request from flask import jsonify import time from psutil import net_io_counters from asyncftp import __version__ import threading from asyncftp.Logger import _LogFormatter t = time.time() net...
return 'ok'
<|file_name|>transaction.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...
} impl Encodable for UnverifiedTransaction { fn rlp_append(&self, s: &mut RlpStream) { self.rlp_append_sealed_transaction(s) }
<|file_name|>tokens_test.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 Un...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(fn_traits, try_from)] extern crate redis; extern crate rand; #[macro_use]<|fim▁hole|>extern crate log; extern crate env_logger; pub mod types; pub mod pubsub; pub mod storage; pub mod feature;<|fim▁end|>
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>import sys from apps.cowry.exceptions import PaymentMethodNotFound from django.utils.importlib import import_module def _load_from_module(path): package, attr = path.rsplit('.', 1) module = import_module(package)<|fim▁hole|> return getattr(module, attr) ...
<|file_name|>search.js<|end_file_name|><|fim▁begin|>(function() { var instance = openerp; openerp.web.search = {}; var QWeb = instance.web.qweb, _t = instance.web._t, _lt = instance.web._lt; _.mixin({ sum: function (obj) { return _.reduce(obj, function (a, b) { return a + b; }, 0); } }); /** @namespa...
<|file_name|>widget.rs<|end_file_name|><|fim▁begin|>use std::io::{Result, Write}; use analysis; use env::Env; use super::{function, general}; use super::general::tabs; pub fn generate<W: Write>(w: &mut W, env: &Env, analysis: &analysis::object::Info) -> Result<()>{ let type_ = analysis.type_(&env.library); t...
<|file_name|>zuul.py<|end_file_name|><|fim▁begin|># Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
DEFAULT_URL = 'http://127.0.0.1:8001/jenkins_endpoint'
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() { let x = &5; println!("Hello, world!");<|fim▁hole|> match x { &y => println!("1. {:?}", y), } match x { ref y => println!("2. {:p} -> {:?}", y, y), } struct Point { x : i32, y : i32, } le...
<|file_name|>Control.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Tue Dec 08 13:25:40 2015 @author: J. Alejandro Cardona """ from Board import * import pygame UP, LEFT, DOWN, RIGHT = 1, 2, 3, 4 juego = Board() _2 = pygame.image.load("2.jpg"); _2re = _2.get_rect() _4 = pygame....
<|file_name|>Wiltron360SS69.py<|end_file_name|><|fim▁begin|>from ..GenericInstrument import GenericInstrument from .helper import SignalGenerator, amplitudelimiter class Wiltron360SS69(GenericInstrument, SignalGenerator): """Wiltron 360SS69 10e6, 40e9. .. figure:: images/SignalGenerator/Wiltron360SS69.jpg ...
@amplitude.setter @amplitudelimiter def amplitude(self, amplitude): self.write(f"L0{amplitude:.2f}DM")
<|file_name|>test_minion.py<|end_file_name|><|fim▁begin|>import copy import logging import os import pytest import salt.ext.tornado import salt.ext.tornado.gen import salt.ext.tornado.testing import salt.minion import salt.syspaths import salt.utils.crypt import salt.utils.event as event import salt.utils.platform imp...
Note: This test doesn't contain all of the patch decorators above the function like the other tests for _handle_decoded_payload below. This is essential to this test as the call to the function must return None BEFORE any of the processes are spun up because we should be avoiding firing duplicate jobs.
<|file_name|>1212.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|> char c = getchar(); printf("%d", b[c-'0']); while((c = getchar()) != '\n') printf("%03d", b[c-'0']); }<|fim▁end|>
#include <cstdio> int b[8] = {0,1,10,11,100,101,110,111}; int main() {
<|file_name|>Toggle_button.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 # -*- coding: utf-8 -*- """ ZetCode PyQt5 tutorial In this example, we create three toggle buttons. They will control the background colour of a QFrame. author: Jan Bodnar website: zetcode.com last edited: January 2015 """ import sys ...
blueb.clicked[bool].connect(self.setColor)
<|file_name|>0141_auto__del_field_group_is_open.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): # Deleting field 'Group.is_open' ...
'auth.user': {
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from flask import render_template, redirect, request, url_for, flash from flask_login import login_user, logout_user, login_required, current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm...
def before_request(): if current_user.is_authenticated: current_user.ping() if not current_user.confirmed \
<|file_name|>xenia_and_ringroad.py<|end_file_name|><|fim▁begin|># coding: utf-8<|fim▁hole|># xenia_and_ringroad n, m = map(int, raw_input().split()) atividades_casas = map(int, raw_input().split()) tempo = 0 posicao = 1 for i in range(len(atividades_casas)): if posicao < atividades_casas[i]: tempo += (atividades_...
# Maria Clara Dantas, UFCG
<|file_name|>hungry_zombie_kittens.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 -u #---- Includes ----# from ..army_architect import Bot_blueprint, Army_blueprint #---- General Settings ----# army_name = "The Hungry Zombie Kittens" army_description = "Previously these kittens ate cat food. But now they wan't to ...
#---- Bot Patterns ----# class Zombie_kitten(Bot_blueprint):
<|file_name|>tool.js<|end_file_name|><|fim▁begin|>// Arrays contendo os elementos editados var editedElements = []; var selectedElementIndex = null; var unsavedChanges = false; function updateIframeMinHeight() { var iframe = $('#app-tool-iframe'); var container = $('#app-iframe-container'); if (container...
} checkEditedElements(element); return;