prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use atom::Atom; pub fn replace_until_change<T, F>(atom: &Atom<Box<T>>, new_value: T, f: F) where F: Fn(Box<T>, Box<T>) -> Box<T> { let mut new_value = Box::new(new_value); loop { let value = atom.take(); let result; if let Some(ac...
} }
<|file_name|>python_create_binary.py<|end_file_name|><|fim▁begin|># Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from dataclasses import dataclass from typing import Optional from pants.backend.python.rules.pex import Pex from pants.b...
<|file_name|>02-methods-continued.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "math" ) type MyFloat float64 func (f MyFloat) Abs() float64 { if f < 0 { return float64(-f) } return float64(f)<|fim▁hole|> f := MyFloat(-math.Sqrt2) fmt.Println(f.Abs()) }<|fim▁end|>
} func main() {
<|file_name|>playlister.py<|end_file_name|><|fim▁begin|>import os import cPickle as pkl from collections import namedtuple import requests from bs4 import BeautifulSoup Song = namedtuple('Song', ['title', 'artist', 'album', 'length']) class Playlist(object): def __init__(self, title, url): self.title =...
with open(self.file_name, 'rb') as in_file: self.songs = pkl.load(in_file)
<|file_name|>Binary Tree Level Order Traversal.py<|end_file_name|><|fim▁begin|>class Solution(object): def __init__(self): self.l=[] def helper(self,root,level): if not root: return None else: if level<len(self.l): self.l[level].append(root.val) ...
def levelOrder(self, root): """ :type root: TreeNode :rtype: List[List[int]]
<|file_name|>bktptcmd.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import side_effect def useless_function(first, second): print("I have the wrong number of arguments.") <|fim▁hole|> se_value = extra_args.GetValueForKey("side_effect") se_string = se_value.GetStringValue(100) sid...
def function(frame, bp_loc, dict): side_effect.bktptcmd = "function was here" def another_function(frame, bp_loc, extra_args, dict):
<|file_name|>FontRuntime.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 import tkinter import PIL.Image import PIL.ImageTk from tkinter.ttk import Progressbar as pbar from PyFont import Font, SVG class TkFont(): CHARY = 200 CHARX = 50 LINEY = CHARY / 2 MAIN_COLOR = '#FFFFFF' def set_label...
if self.words:
<|file_name|>GUI.java<|end_file_name|><|fim▁begin|>package gui; import java.awt.Font; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.image.BufferedImage; import java.awt.Toolkit; import javax.imageio.ImageIO; import javax.swing.JFrame; import javax.swing.JLabel; import javax....
private final String FOURCHAN_BOARD = "4chan-Board - http://boards.4chan.org/x/catalog";
<|file_name|>reducer.js<|end_file_name|><|fim▁begin|>import { key, PLAY, PAUSE, MUTE, UNMUTE, UPDATE_VOLUME, UPDATE_TIME, SET_SONG, SET_TIME, updateTime } from './actions' import { store } from '../store' let audio = new Audio() audio.addEventListener('timeupdate', event => store.dispatch(updateTime(event))) const in...
{ audio.pause() return { ...state, isPlaying: !state.isPlaying }
<|file_name|>BestTimetoBuyandSellStock_121.java<|end_file_name|><|fim▁begin|>/** * hujiawei - 15/3/21. * <p/> * 贪心 * <p/> * https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ */ public class BestTimetoBuyandSellStock_121 {<|fim▁hole|> public static void main(String[] args) { System.out.pri...
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd import os import time from datetime import datetime import re from time import mktime import matplotlib import matplotlib.pyplot as plt from matplotlib import style style.use("dark_background") # path = "X:/Backups/intraQuarter" # for Windows with X ...
columns = [ 'Date',
<|file_name|>email.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals import email import logging from email.utils import formataddr from collections import defaultdict from django.conf import settings from django.contrib.auth.models import User from django.contrib.sites.models i...
reviewer = review.user limit_to=None
<|file_name|>allplot.py<|end_file_name|><|fim▁begin|>import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as mcolors from matplotlib.colors import Normalize class MidpointNormalize(Normalize): def __init__(self, vmin=None, vmax=None, midpoint=None, clip=False): self.midpoint = mid...
Normalize.__init__(self, vmin, vmax, clip)
<|file_name|>object_inspect.rs<|end_file_name|><|fim▁begin|>use command::{Command, Query}; use command::Command::ObjectInspect; use std::collections::HashMap; use command_query::CommandQuery; use queryable::Queryable; use command_line::CommandLine; use commandable::Commandable; use extendable::Extendable; use request_c...
} } impl ObjectInspectCommand {
<|file_name|>cruiz_04.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python number = 0 for a in range(999,99,-1): for b in range(999,99,-1): pal=a*b if (str(pal) == str(pal)[::-1]): if (pal > number):<|fim▁hole|> number = pal break print(number)<|fim▁end|>
<|file_name|>backbone.syphon.keysplitter.js<|end_file_name|><|fim▁begin|>// Backbone.Syphon.KeySplitter // --------------------------- // This function is used to split DOM element keys in to an array // of parts, which are then used to create a nested result structure. // returning `["foo", "bar"]` results in `{foo: ...
<|file_name|>Email.java<|end_file_name|><|fim▁begin|>/* * Copyright 2013-2014 Richard M. Hightower * 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/licen...
String detailMessage() default "";
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .api import API, ApiMethods from .config import Config <|fim▁hole|><|fim▁end|>
__all__ = ["API", "ApiMethods", "Config"]
<|file_name|>ntp-sync.py<|end_file_name|><|fim▁begin|>import math import numpy import pyaudio import time import ntplib def sine(frequency, length, rate): length = int(length * rate) factor = float(frequency) * (math.pi * 2) / rate return numpy.sin(numpy.arange(length) * factor) chunks = [] chunks.appen...
print curtime print("beep") last = curtime
<|file_name|>notebook_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import mock from tests import base from girder.models.model_base import ValidationException def setUpModule(): base.enabledPlugins.append('ythub') base.startServer() def tearDownModule(): base.stopS...
user = resp.json['user']
<|file_name|>bitcoin_pt_BR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About SwansonCoin</s...
<location line="+5"/>
<|file_name|>ec2.py<|end_file_name|><|fim▁begin|># This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and ...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// Dependencies var UFirst = require("ucfirst"); /** * CrossStyle * Returns an array of cross-browser CSS properties for given input. * * @name CrossStyle * @function * @param {String} input The CSS property (e.g. `"transform"` or `"transformOrigin"`). * @retur...
, "moz" + uInput
<|file_name|>backup1.py<|end_file_name|><|fim▁begin|>import cookielib import urllib2 import urllib import json import time #Default Settings for a system to keep cookies, please add it before testing cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) urllib2.install_opener(opener...
source_code = ErrorOut(req) try:
<|file_name|>ipc_lista2.16.py<|end_file_name|><|fim▁begin|>#EQUIPE 2 #Nahan Trindade Passos - 1615310021 #Ana Beatriz Frota - 1615310027 # # # # # # import math print("Digite os termos da equacao ax2+bx+c") a = float(input("Digite o valor de A:\n")) if(a==0): print("Nao e uma equacao de segundo grau") else: ...
<|file_name|>test_plugins.py<|end_file_name|><|fim▁begin|>import types import unittest from collections import namedtuple import mock from plugins.systems.config_container_crawler import ConfigContainerCrawler from plugins.systems.config_host_crawler import ConfigHostCrawler from plugins.systems.connection_container_c...
@mock.patch('utils.config_utils.os.lstat', side_effect=mocked_os_lstat) @mock.patch('utils.config_utils.codecs.open', side_effect=mocked_codecs_open)
<|file_name|>sequencer.py<|end_file_name|><|fim▁begin|># 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 required by ...
deque = collections.deque
<|file_name|>req_handler_unary.rs<|end_file_name|><|fim▁begin|>use crate::error; use crate::result; use crate::server::req_handler::ServerRequestStreamHandler; use crate::server::req_handler::ServerRequestUnaryHandler; use httpbis::IncreaseInWindow; use std::marker; pub(crate) struct RequestHandlerUnaryToStream<M, H> ...
}
<|file_name|>ExampleOne.cpp<|end_file_name|><|fim▁begin|>#include "ExampleOne.h" ExampleOneWrite::ExampleOneWrite(std::string name): SamClass(name) { } void ExampleOneWrite::SamInit(void) { myint=0; newPort(&myfirst2, "W2"); // add new port newPort(&myfirst, "W1"); StartModule(); puts("...
{ }
<|file_name|>xmlformatter.py<|end_file_name|><|fim▁begin|>""" Format and compress XML documents """ import getopt import re import sys import xml.parsers.expat __version__ = "0.2.4" DEFAULT_BLANKS = False DEFAULT_COMPRESS = False DEFAULT_SELFCLOSE = False DEFAULT_CORRECT = True DEFAULT_INDENT = 2 DEFAULT_INDENT_CHAR...
<|file_name|>htmltablecellelement.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 cssparser::RGBA; use dom::bindings::codegen:...
const DEFAULT_COLSPAN: u32 = 1;
<|file_name|>template_locals.ts<|end_file_name|><|fim▁begin|>import { argv } from 'yargs'; import * as CONFIG from '../../config'; /** * Returns the project configuration (consisting of the base configuration provided by seed.config.ts and the additional * project specific overrides as defined in project.config.ts) ...
export function templateLocals() { const configEnvName = argv['config-env'] || 'dev';
<|file_name|>event.py<|end_file_name|><|fim▁begin|>from __future__ import print_function from eventlet import hubs from eventlet.support import greenlets as greenlet __all__ = ['Event'] class NOT_USED: def __repr__(self): return 'NOT_USED' NOT_USED = NOT_USED() class Event(object): """An abstract...
def has_exception(self): return self._exc is not None
<|file_name|>command_modal.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 DDN. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. use crate::{ components::{font_awesome::*, modal}, dependency_tree::{build_direct_dag, traverse_grap...
use super::*; use rand_core::{RngCore, SeedableRng};
<|file_name|>fake_data_transfer_manager.cc<|end_file_name|><|fim▁begin|>// Copyright 2020 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 "chrome/browser/webshare/win/fake_data_transfer_manager.h" #include <wrl...
<< "GetDataRequestedInvoker called with no event handler registered"; return base::DoNothing(); }
<|file_name|>test_govt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- "Fully test this module's functionality through the use of fixtures." from megacosm.generators import Govt, Country, City import unittest2 as unittest import fakeredis import fixtures from config import TestConfigura...
def test_static_body_city(self):
<|file_name|>equipmentscheduleitem.py<|end_file_name|><|fim▁begin|>from indivo.lib import iso8601 from indivo.models import EquipmentScheduleItem XML = 'xml' DOM = 'dom' class IDP_EquipmentScheduleItem: def post_data(self, name=None, name_type=None, name_value=None, ...
scheduled_by=scheduledBy,
<|file_name|>BookMetadataTable.tsx<|end_file_name|><|fim▁begin|>import * as React from "react"; import ReactTable from "react-table"; import * as mobxReact from "mobx-react"; import { StringListCheckbox } from "../../react_components/stringListCheckbox"; import { Label } from "../../react_components/l10nComponents"; im...
<Link className="whatsthis" l10nKey="Common.WhatsThis"
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(old_path)] extern crate sdl2; #[test] fn audio_spec_wav() { let wav = sdl2::audio::AudioSpecWAV::load_wav(&Path::new("./tests/sine.wav")).unwrap();<|fim▁hole|> assert_eq!(wav.freq, 22050); assert_eq!(wav.format, sdl2::audio::AUDIOS16LSB); asse...
<|file_name|>measurables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*-""" # Temperature conversion constants KELVIN_OFFSET = 273.15 FAHRENHEIT_OFFSET = 32.0 FAHRENHEIT_DEGREE_SCALE = 1.8 # Wind speed conversion constants MILES_PER_HOUR_FOR_ONE_METER_PER_SEC = 2.23694 KM_PER_HOUR_FOR_ON...
:raises: *ValueError* when unknown target temperature units are provided
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from time import time from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_delete from django.dispatch import receiver <|fim▁hole|>def upload_path(instance, filename): return 'uploads/user_{0}/{1}_{2}'....
import os
<|file_name|>ThirdPartyMeasurementSettings.java<|end_file_name|><|fim▁begin|>// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licen...
<|file_name|>OAuth2TokenValidationMessageContextTest.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2017, 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...
oAuth2TokenValidationMessageContext.addProperty("testProperty", "testValue"); assertEquals(oAuth2TokenValidationMessageContext.getProperty("testProperty"), "testValue"); }
<|file_name|>dynamictexture.js<|end_file_name|><|fim▁begin|>var THREEx = THREEx || {} ////////////////////////////////////////////////////////////////////////////////// // Constructor // ////////////////////////////////////////////////////////////////////////////////// /** * create a dynamic texture with a un...
var maxText = computeMaxTextLength(text) // update the remaining text text = text.substr(maxText.length)
<|file_name|>stream.rs<|end_file_name|><|fim▁begin|>use unsafe_cell::UnsafeRefCell; use error::{ErrCode, eof}; use core::{IoContext, AsIoContext}; use async::Handler; use streams::Stream; use buffers::StreamBuf; use ssl::*; use ssl::ffi::*; use std::io; use std::ptr; use std::sync::Mutex; use libc::{c_void, c_int, siz...
self.core.engine.set_verify_callback(callback) }
<|file_name|>uint64.js<|end_file_name|><|fim▁begin|>export const plus = (f, l) => { let next = {}; if (typeof l === 'number') { next.low = l; next.high = 0; } else if (typeof l === 'object') { if (l.high && l.low && l.unsigned) { next = l; } else { throw new Error('Not a uint64 data');...
return `${uint64Object.high}${uint64Object.low}`;
<|file_name|>mongo08.js<|end_file_name|><|fim▁begin|>db = connect(mserver);<|fim▁hole|>db.schedev.ensureIndex({expired : 1},{expireAfterSeconds : 120});<|fim▁end|>
db = db.getSiblingDB('kynetx'); db.schedev.ensureIndex({cron_id : 1}); db.schedev.ensureIndex({ken : 1});
<|file_name|>net.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package internal // This file implements a network dialer that limits the number of concurrent connections. // ...
} lc := &limitConn{Conn: conn} runtime.SetFinalizer(lc, (*limitConn).Close) // shouldn't usually be required return lc, nil
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>#coding=utf-8 import os # Basic settings # requests settings TIMEOUT = 5 VERIFY = False # directories might be used LOCATIONS = { 'log': 'log', 'data': 'data', }<|fim▁hole|># stderr is redirected to this file ERR_LOG_FILE = os.path.join(LOCATIONS['log'],...
<|file_name|>ArgumentDeclaration.ts<|end_file_name|><|fim▁begin|>// Copyright (C) 2015, 2017 Simon Mika <simon@mika.se> // // This file is part of SysPL. // // SysPL 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 Foun...
// import { Source } from "./Source"
<|file_name|>xboxdrv_g_controller.cpp<|end_file_name|><|fim▁begin|>/* ** Xbox360 USB Gamepad Userspace Driver ** Copyright (C) 2011 Ingo Ruhnke <grumbel@gmail.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...
} /* EOF */
<|file_name|>rbbirb.cpp<|end_file_name|><|fim▁begin|>// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // file: rbbirb.cpp // // Copyright (C) 2002-2011, International Business Machines Corporation and others. // All Rights Reserved. // // This file ...
} // Remove whitespace from the rules to make it smaller. // The rule parser has already removed comments.
<|file_name|>VirtualScreen.py<|end_file_name|><|fim▁begin|>import math class VirtualScreen: #cet ecran est normal a l'axe Z du Leap def __init__(self,Xoffset=0,Yoffset=50,Zoffset=-50,Zlimit=220,length=350,height=300): #en mm<|fim▁hole|> self.Zoffset = Zoffset; # position du milieu du bord bas de l'ecran par rappor...
self.Xoffset = Xoffset; # position du milieu du bord bas de l'ecran par rapport au centre du Leap self.Yoffset = Yoffset; # position du milieu du bord bas de l'ecran par rapport au centre du Leap
<|file_name|>A.py<|end_file_name|><|fim▁begin|><|fim▁hole|>if T%2==0: print T/2 else: print ((T-1)/2)-T<|fim▁end|>
T = input()
<|file_name|>traffic-control-layer.cc<|end_file_name|><|fim▁begin|>/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2015 Natale Patriciello <natale.patriciello@gmail.com> * 2016 Stefano Avallone <stavallo@unina.it> * * This program is free software; you can redistri...
* published by the Free Software Foundation;
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0<|fim▁hole...
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
<|file_name|>Rc.py<|end_file_name|><|fim▁begin|>from Components.Pixmap import MovingPixmap, MultiPixmap from Tools.Directories import resolveFilename, SCOPE_SKIN from xml.etree.ElementTree import ElementTree from Components.config import config, ConfigInteger from Components.RcModel import rc_model from boxbrandin...
def hideSelectPics(self):
<|file_name|>trivial_client.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import time import argparse import grpc from jaeger_client import Config from grpc_opentracing import open_tracing_client_interceptor from grpc_opentracing.grpcext import intercept_channel import command_line_pb2 def...
run()
<|file_name|>masternodemanager.cpp<|end_file_name|><|fim▁begin|>#include "masternodemanager.h" #include "ui_masternodemanager.h" #include "addeditadrenalinenode.h" #include "adrenalinenodeconfigdialog.h" #include "sync.h" #include "clientmodel.h" #include "walletmodel.h" #include "activemasternode.h" #include "mastern...
{ QString res;
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>""" Tests for utils. """ import collections from datetime import datetime, timedelta from pytz import UTC from django.test import TestCase from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory f...
self._verify_release_date_source(self.sequential, self.chapter)
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "errors" "fmt" "github.com/hyperledger/fabric/core/chaincode/shim" ) // SampleChaincode struct required to implement the shim.Chaincode interface type SampleChaincode struct { } // Init method is called when the chaincode is first deployed o...
if err != nil { fmt.Println("Could not start SampleChaincode")
<|file_name|>test_poisson_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # from __future__ import print_function import warnings import numpy import pytest import sympy from dolfin import ( MPI, Constant, DirichletBC, Expression, FunctionSpace, UnitSquareMesh, errornorm, ...
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
ball2.properties['overlap'] = e
<|file_name|>atomic_386.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go 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 runtime <|fim▁hole|> // The calls to nop are to keep these functions from being inlined. // If t...
import "unsafe"
<|file_name|>submit.py<|end_file_name|><|fim▁begin|># Author: Sungchul Choi, sc82.choi at gachon.ac.kr # Version: 0.1 # Description # 가천대학교 프로그래밍 입문 시간에 활용되는 "숙제 자동 채점 프로그램"의 Client 프로그램입니다. # # HUMAN KNOWLEDGE BELONGS TO THE WORLD. -- From the movie "Antitrust" # Copyright (C) 2015 TeamLab@Gachon University import ar...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms METHOD_CHOICES = ( ("GET", "GET"), ("POST", "POST") ) <|fim▁hole|> method = forms.ChoiceField(choices=METHOD_CHOICES, initial="GET") path = forms.CharField(initial="/api/myself/") data = forms.CharField(widget=forms.Textarea...
class ApiCallForm(forms.Form):
<|file_name|>const.go<|end_file_name|><|fim▁begin|>// Copyright 2019 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // ...
const (
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>Transactional workflow control for Django models. """<|fim▁end|>
"""
<|file_name|>account_config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 Andrea Cometa. # Email: info@andreacometa.it # Web site: http://www.andreacometa.it # Copyright (C) 2012 Agile Business Gr...
_inherit = 'res.company' due_cost_service_id = fields.Many2one('product.product')
<|file_name|>drivers.py<|end_file_name|><|fim▁begin|># coding=utf-8 <|fim▁hole|>import urllib import requests class Driver(object): def __init__(self): self.driver_type = self.__class__.__name__ # Get credentials from conf files for CMDB pass def get_driver_type(self): re...
import pprint import config import json
<|file_name|>features.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 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...
<|file_name|>calibrateCamera2.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Time : 2017/7/27 18:04 # @Author : play4fun # @File : calibrateCamera2.py # @Software: PyCharm """ calibrateCamera2.py: """ import cv2 import numpy as np def draw_axis(img, charuco_corners, charuco_ids, board): vecs ...
def make_grayscale(img):
<|file_name|>sql.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from "@angular/core"; import { SQLComponent } from "./sql.component"; import { sqlRouting } from "./sql.routes"; @NgModule({ imports: [ sqlRouting ], declarations: [ SQLComponent ] }) <|fim▁hole|><|fim▁end|>
export class SQLModule { };
<|file_name|>flat-mesh-intersection.js<|end_file_name|><|fim▁begin|>var _ = require('lodash'); var doFacesIntersect = require('./face-intersection').doFacesIntersect; function flatMeshIntersects(mesh){<|fim▁hole|> }); for (var j = i + 1; j < numFaces; ++j) { var secondFace = _.map(mesh.face...
var numFaces = mesh.faces.length; for (var i = 0; i < numFaces; ++i) { var firstFace = _.map(mesh.faces[i].vertices, function(vertexIndex){ return mesh.vertices[vertexIndex];
<|file_name|>gssapi.py<|end_file_name|><|fim▁begin|># # (C) Copyright 2008 Jelmer Vernooij <jelmer@samba.org> # (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as p...
def __init__(self, password_manager): ClientAuthenticator.__init__(self, password_manager) self.password_manager = password_manager
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in" " the directory containi...
execute_manager(settings)
<|file_name|>nm.go<|end_file_name|><|fim▁begin|>// Copyright 2016 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. package symbolizer import ( "bufio" "bytes" "os/exec" "strconv" ) type Symbol struct { Addr uint64 ...
if sp2 == -1 { continue } sp2 += sp1 + 1
<|file_name|>extract_tokens.rs<|end_file_name|><|fim▁begin|>use super::{ExtractedLexicalGrammar, ExtractedSyntaxGrammar, InternedGrammar}; use crate::generate::grammars::{ExternalToken, Variable, VariableType}; use crate::generate::rules::{MetadataParams, Rule, Symbol, SymbolType}; use anyhow::{anyhow, Result}; use std...
Rule::choice(vec![ // The symbol referencing `rule_1` was replaced by a symbol referencing
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export * from './privacy.component';
<|file_name|>tnetstring.py<|end_file_name|><|fim▁begin|>""" tnetstring: data serialization using typed netstrings ====================================================== This is a custom Python 3 implementation of tnetstrings. Compared to other implementations, the main difference is that this implementation supports ...
<|file_name|>DataInputStream.java<|end_file_name|><|fim▁begin|>/* * This file is part of the LibreOffice project. * * 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/. ...
// creating an input stream to set in XActiveDataSink XInterface oDataInput = (XInterface) xMSF.createInstance(
<|file_name|>test_noninstantiable.py<|end_file_name|><|fim▁begin|>import warnings from apification.utils import Noninstantiable, NoninstantiableMeta def test_noninstantiable(): e, o = None, None try: o = Noninstantiable() except TypeError as e: pass assert o is None assert isinstance(e, ...
__metaclass__ = NoninstantiableMeta def a(self): pass except TypeError as e:
<|file_name|>inputgroup.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import { LabIcon } from '../icon'; import { classes } from '../utils'; /** * InputGroup component properties */ export interface IInputGroupProps extends React.InputHTMLAttributes<HTMLInputElement> { /** * Right icon adornment...
*/ export function InputGroup(props: IInputGroupProps): JSX.Element {
<|file_name|>spineless.js<|end_file_name|><|fim▁begin|>(function() { var Application, PubSub, Request, Router, Spineless; Application = (function() { function Application() { return { controllers: {}, helpers: { _default: function(locals) { return $.extend(true, {},...
<|file_name|>cols.rs<|end_file_name|><|fim▁begin|>use transposed::{Cols, ColsMut}; use {Col, ColMut}; impl<'a, T> DoubleEndedIterator for Cols<'a, T> { fn next_back(&mut self) -> Option<Col<'a, T>> { self.0.next_back().map(|r| Col(r.0)) } } impl<'a, T> Iterator for Cols<'a, T> { type Item = Col<'a...
fn next(&mut self) -> Option<ColMut<'a, T>> { self.0.next().map(|r| ColMut(Col((r.0).0))) }
<|file_name|>standard.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright(C) 2014 Romain Bignon # # This file is part of weboob. # # weboob 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 Foundatio...
return next(g for g in m.groups() if g is not None)
<|file_name|>robotsparser.py<|end_file_name|><|fim▁begin|>import requests import logging from fetcher import fetch from os.path import join from urlobj import URLObj from urllib.parse import urljoin, urlsplit, urlunsplit<|fim▁hole|> def __init__(self, domain): self.domain = domain # Check if the file ev...
class RobotsParser:
<|file_name|>date_ex1.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
var today = new Date(); console.log(today);
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># For building youtube_downloader on windows from distutils.core import setup import py2exe # Define where you want youtube_downloader to be built to below build_dir = data_files = [('',['settings.ini', 'LICENSE',<|fim▁hole|> ('sessio...
'README.md']),
<|file_name|>hy-AM.js<|end_file_name|><|fim▁begin|>(function (global, factory) { if (typeof define === "function" && define.amd) { define('element/locale/hy-AM', ['module', 'exports'], factory); } else if (typeof exports !== "undefined") { factory(module, exports); } else { var mod = { exports: ...
goto: 'Անցնել',
<|file_name|>motor_ina219.py<|end_file_name|><|fim▁begin|># Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
gin_a1 = [
<|file_name|>hud.py<|end_file_name|><|fim▁begin|>## INFO ######################################################################## ## ## ## plastey ## ## ...
<|file_name|>MapsIntent.java<|end_file_name|><|fim▁begin|>package droidkit.app; import android.content.Intent; import android.net.Uri; import android.support.annotation.NonNull; import java.util.Locale;<|fim▁hole|> /** * @author Daniel Serdyukov */ public final class MapsIntent { private static final String MA...
<|file_name|>subscription_manifest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Andrew Kofink <ajkofink@gmail.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 # the Free Software ...
<|file_name|>amp-a4a.js<|end_file_name|><|fim▁begin|>/** * Copyright 2016 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www...
this.tearDownSlot();
<|file_name|>problem_006.py<|end_file_name|><|fim▁begin|>""" Copyright 2012, July 31 Written by Pattarapol (Cheer) Iamngamsup E-mail: IAM.PATTARAPOL@GMAIL.COM Sum square difference Problem 6 The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the s...
def main(): squareOfSum = ( ( ( 1+100 ) * 100 ) / 2)**2 sumOfSquare = 0 for i in range( 1, 101 ):
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export { ChemistryReference20 as default } from "../../";
<|file_name|>marker.go<|end_file_name|><|fim▁begin|>package marker import ( "fmt" "image" "image/color" "image/draw" "image/png" "log" "os" "strconv" )<|fim▁hole|> Code int Size int Division int BlockSize int matrix []int Marker *image.NRGBA Name string } // New returns a Marker wi...
// Marker represents the structure of a fiducial marker type Marker struct {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># from . import *<|fim▁end|>
<|file_name|>xml.py<|end_file_name|><|fim▁begin|># # Copyright (C) 2011 - 2015 Satoru SATOH <ssato @ redhat.com> # License: MIT # # Some XML modules may be missing and Base.{load,dumps}_impl are not overriden: # pylint: disable=import-error """XML files parser backend, should be available always. .. versionchanged:: 0...