prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>home.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { ServiceProvider} from "../../providers/service/service"; import { ControlUserApp } from '../../control/ControlUserApp'; import { UserApp } from '../../model/UserApp'; @Co...
console.log('RETORNO DO SERVIDOR : ' +response); console.log('RETORNO DO SERVIDOR : ' +response._body); const objeto_retorno = JSON.parse(response._body);
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages <|fim▁hole|>setup( name='django-test-html-form', version='0.1', description="Make your Django HTML form tests more explicit and concise.", long_description=open('README.rst').read(), keywords='django test ...
<|file_name|>ConversationListView.java<|end_file_name|><|fim▁begin|>package org.telegram.android.views.dialog; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Handler; import androi...
private TextPaint timeDivPaint; private Drawable serviceDrawable;
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|>import { ShrinkScreenFilled20 } from "../../"; <|fim▁hole|><|fim▁end|>
export = ShrinkScreenFilled20;
<|file_name|>pack.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import hashlib import math import struct import base64 import json import zlib import binascii from Crypto.Cipher import AES from Crypto import Random salt ='__E3S$hH%&*KL:"II<UG=_!@fc9}021jFJ|KDI.si81&^&%%^*(del?%)))+__' fingerprint_len =4 i...
return {} input =input[fingerprint_len:] randomiv =input[0:randomiv_len]
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""linter_test_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL...
]
<|file_name|>test_diff.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 import unittest import os.path as p, sys; sys.path.append(p.join(p.dirname(__file__), "..")) from _diff import diff, guess_edit from geometry import Position def transform(a, cmds): buf = a.split("\n") for cmd i...
b = 'hallo Blah mitte=sdfdsfsd\nhallo b mittekjshdkfhkhsdfdsf' wanted = (
<|file_name|>file.go<|end_file_name|><|fim▁begin|>package clang // #include <stdlib.h> // #include "go-clang.h" import "C" import ( "time" ) // A particular source file that is part of a translation unit. type File struct { c C.CXFile } // Name retrieves the complete file and path name of the given file. func (c ...
// ModTime retrieves the last modification time of the given file.
<|file_name|>FullAddressJsonHandler.java<|end_file_name|><|fim▁begin|>package com.dranawhite.mybatis.handler; import com.alibaba.fastjson.JSON; import com.dranawhite.mybatis.model.Address; import com.dranawhite.mybatis.model.FullAddress; import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcT...
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
dot -Tpng D:\GitHub\mappyfile\mapfile_classes.dot -o outfile.png outfile.png For Entity Relationship diagrams:
<|file_name|>server.js<|end_file_name|><|fim▁begin|>const Koa = require('koa'); const http = require('http'); const destroyable = require('server-destroy'); const bodyParser = require('koa-bodyparser'); const session = require('koa-session'); const passport = require('koa-passport'); const serve = require('koa-static')...
}); passport.deserializeUser(async (twitterId, done) => { const user = await User.findOne({ twitterId });
<|file_name|>CTMC.py<|end_file_name|><|fim▁begin|>"""Code for constructing CTMCs and computing transition probabilities in them.""" from numpy import zeros from scipy import matrix from scipy.linalg import expm class CTMC(object): """Class representing the CTMC for the back-in-time coalescent.""" def __init...
<|file_name|>fromAddressbar.js<|end_file_name|><|fim▁begin|>import { toArray, exists, stringToBoolean } from '../../../utils/utils' import { head } from 'ramda' export default function intent (addressbar, params) { const setAppMode$ = addressbar.get('appMode') .map(d => d.pop()) // what mode is the app in ? ("ed...
.map(data => head(data)) .filter(exists) .map(stringToBoolean)
<|file_name|>ObjectToImageTest.py<|end_file_name|><|fim▁begin|>########################################################################## # # Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pro...
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Configuration options for Inve...
For example if you don't want to create aliases
<|file_name|>singleton.py<|end_file_name|><|fim▁begin|># Taken from here: https://stackoverflow.com/questions/50566934/why-is-this-singleton-implementation-not-thread-safe import functools import threading lock = threading.Lock() def synchronized(lock): """ Synchronization decorator """ def wrapper(f): ...
def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._locked_call(*args, **kwargs) return cls._instances[cls]
<|file_name|>wechat2.server.routes.js<|end_file_name|><|fim▁begin|>/** * Created by Wayne on 16/3/16. */ 'use strict'; var tender = require('../controllers/tender'), cardContr = require('../controllers/card'), cardFilter = require('../../../libraries/filters/card'), truckFileter = require('../../../libraries/...
// app.route('/tender/driver/card/bindTruck').post(driverFilter.requireDriver, cardFilter.requireById, truckFileter.requireById, cardContr.bindTruck); };
<|file_name|>meta_family.py<|end_file_name|><|fim▁begin|>"""Family module for Meta Wiki.""" # # (C) Pywikibot team, 2005-2020 # # Distributed under the terms of the MIT license. # from pywikibot import family # The Wikimedia Meta-Wiki family class Family(family.WikimediaOrgFamily):<|fim▁hole|> """Family class for ...
<|file_name|>replay_helper.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2003 - 2017 by David White <dave@whitevine.net> Part of the Battle for Wesnoth Project http://www.wesnoth.org/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licen...
return config(); }
<|file_name|>memcached_storage.py<|end_file_name|><|fim▁begin|>import time from aiohttp import web import asyncio import aiomcache from aiohttp_session import setup, get_session from aiohttp_session.memcached_storage import MemcachedStorage async def handler(request: web.Request) -> web.Response: session = await...
session['last_visit'] = time.time() text = 'Last visited: {}'.format(last_visit) return web.Response(text=text)
<|file_name|>Router.js<|end_file_name|><|fim▁begin|>var page = require('page'), csp = require('js-csp'); class Router { constructor(routes){ this.routes = routes; this.chan = csp.chan(); this.nextTransition = null; this.nextEl = null; // Setup channel listening ...
this.listenToRoute(r); // Start listening page();
<|file_name|>problem4.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Mon Sep 29 21:25:13 2014 @author: 27182_000 """ # A palindromic number reads the same both ways. The largest palindrome made <|fim▁hole|># Find the largest palindrome made from the product of two 3-digit numbers. import sys ...
# from the product of two 2-digit numbers is 9009 = 91 × 99.
<|file_name|>SimpleRuleClustererTest.java<|end_file_name|><|fim▁begin|>/* * AC - A source-code copy detector * * For more information please visit: http://github.com/manuel-freire/ac2 * * **************************************************************************** * * This file is part of AC, version 2.x * ...
<|file_name|>ast.rs<|end_file_name|><|fim▁begin|>use std::fmt; use serde::{Serialize};<|fim▁hole|>#[derive(Debug, PartialEq, Serialize, Clone)] pub struct Location { pub start: usize, pub end: usize, } impl Location { pub fn new(start: usize, end: usize) -> Location { Location { start, end } ...
<|file_name|>test_user_model.py<|end_file_name|><|fim▁begin|>import unittest import time from datetime import datetime from app import create_app, db from app.models import User, AnonymousUser, Role, Permission class UserModelTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') ...
token = u2.generate_email_change_token('john@example.com') self.assertFalse(u2.change_email(token)) self.assertTrue(u2.email == 'susan@example.org')
<|file_name|>system.py<|end_file_name|><|fim▁begin|>import datetime from ...place import Place from ...spec import Spec from .planet import Planet from .dwarfplanet import DwarfPlanet <|fim▁hole|>class System(Place): """Systems exist within galaxies, and can contain planets... Attributes allowedChildEntities En...
<|file_name|>cog.py<|end_file_name|><|fim▁begin|>import datetime import time from random import choice import discord import lifesaver from discord.ext import commands from lifesaver.bot.storage import AsyncJSONStorage from lifesaver.utils import ( ListPaginator, clean_mentions, human_delta, pluralize,...
tag_names, ctx.author,
<|file_name|>message.py<|end_file_name|><|fim▁begin|>from persistence.models import Agent, BaseModel from peewee import * class Message(BaseModel): """description of class""" correlationid = CharField() category = IntegerField() body = CharField(null=True) sender = ForeignKeyField(Agent, related_...
# computed
<|file_name|>PatientRepository.java<|end_file_name|><|fim▁begin|>package org.coursera.androidcapstone.symptomchecker.repository; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Query; import org.springf...
@Query("From Patient p where :doctor member p.doctors AND UPPER(fullName)=:fullName") public List<Patient> findByDoctorAndFullName(@Param("doctor") Doctor doctor, @Param("fullName") String fullName);
<|file_name|>dicom.py<|end_file_name|><|fim▁begin|># vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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....
def _from_scala(tc, scala_dicom): """creates a python dicom for the given scala dicom"""
<|file_name|>script_thread.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/. */ //! The script thread is the thread that owns the DOM i...
pub fn handle_serviceworker_registration(&self,
<|file_name|>parser.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************\ * This file is part of CaSPER. * * * * Copyright: ...
{ std::vector<std::string> elements; boost::split(elements, *it, boost::is_any_of(" \t\r\n")); std::transform(elements.begin(),elements.end(),&r[c],StrToInt());
<|file_name|>Details.tsx<|end_file_name|><|fim▁begin|>import { Link, Text, LinkProps, useThemeConfig, TextVariant, } from "@artsy/palette" import { Details_artwork } from "v2/__generated__/Details_artwork.graphql" import * as React from "react"; import { createFragmentContainer, graphql } from "react-relay" ...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// ================================================================= // // * WARNING * // // This file is generated! //<|fim▁hole|>// // ================================================================= #![doc( html_logo_u...
// Changes made to this file will be overwritten. If changes are // required to the generated code, the service_crategen project // must be updated to generate the changes.
<|file_name|>Fonts.java<|end_file_name|><|fim▁begin|>/* * This file is part of JGCGen. * * JGCGen 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 3 of the License, or * (at your option) an...
if(file.isFile()) {
<|file_name|>0310_auto__add_field_savedsearch_owner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): ...
to=orm['sentry.User'], null=True
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>extern crate nanomsg; use std::thread; use std::time::Duration; use std::sync::mpsc::*; use super::media_player; use super::protocol; use self::nanomsg::{Socket, Protocol, Error}; pub fn run(rx_quit: Receiver<bool>, tx_state: Sender<media_player::State>) { let mu...
<|file_name|>test_cew.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond ...
except ImportError: pass gf.delete_file(handler, output_file_path)
<|file_name|>dynamic_import.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from exam.exceptions import ModelDoesNotExist, InvalidParameter def create_specific_exam(name_class): try: app_name = name_class.lower() module = __import__(app_name + '.models', fromlist=[name_class]) cl...
<|file_name|>IGrid.java<|end_file_name|><|fim▁begin|>package com.fpliu.newton.ui.list; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.GridView; /** * @author 792793182@qq.com 2017-06-30. */ public interface IGrid<T, V extends GridView> extends IComm...
}
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>var utils = exports; var uglify = require('uglify-js'); utils.extend = function extend(target, source) { Object.keys(source).forEach(function (key) { target[key] = source[key]; }); }; utils.beautify = function beautify(code) { var ast = uglify.parser.parse...
<|file_name|>practicelevelviews.py<|end_file_name|><|fim▁begin|>from csacompendium.csa_practice.models import PracticeLevel from csacompendium.utils.pagination import APILimitOffsetPagination from csacompendium.utils.permissions import IsOwnerOrReadOnly from csacompendium.utils.viewsutils import DetailViewUpdateDelete,...
queryset = PracticeLevel.objects.all() serializer_class = practice_level_serializer['PracticeLevelDetailSerializer'] permission_classes = [IsAuthenticated]
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export * from './user.effect';
<|file_name|>mpm.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import argparse import six parser = argparse.ArgumentParser(description="Minecraft Package Manager") sub = parser.add_subparsers(help="command help") <|fim▁hole|> description="Synchronize local mod archive.", ...
# package commands sync_parser = sub.add_parser("sync",
<|file_name|>SecureScoreControlDefinitionsClient.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.security.fluent; import com.azure.core.annota...
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
<|file_name|>build_op_expr.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Serulian 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 dombuilder import ( "fmt" "github.com/serulian/compiler/compilergraph" "github.com...
<|file_name|>test_ujson.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|> import simplejson as json import math import pytz import pytest import time import datetime import calendar import re import decimal import dateutil from functools import partial from pandas.compat import range, zip, StringIO...
try: import json except ImportError:
<|file_name|>inline.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/. */ #![deny(unsafe_code)] use ServoArc; use app_units::{Au, MIN_A...
/// Line fragments also contain some metadata used during line breaking. The /// green zone is the area that the line can expand to before it collides /// with a float or a horizontal wall of the containing block. The block-start
<|file_name|>gpu_channel_host.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 "content/common/gpu/client/gpu_channel_host.h" #include <algorithm> #include ...
bool GpuChannelHost::MessageFilter::IsLost() const {
<|file_name|>image.py<|end_file_name|><|fim▁begin|>from glob import glob import os try: from skimage.io import imread as sk_imread except ImportError: pass from .core import Array from ..base import tokenize def add_leading_dimension(x): return x[None, ...] def imread(filename, imread=None, preprocess=...
for filename in filenames]
<|file_name|>bitcoin_cy.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="cy" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About PumpGroupCoin</source> <translation type="unfin...
<|file_name|>routeConfig.js<|end_file_name|><|fim▁begin|>import App from '../containers/App'; import { PageNotFound } from '../components'; import homeRoute from '../features/home/route'; import taggrRoute from '../features/taggr/route'; const routes = [{ path: '/', component: App, childRoutes: [ homeRoute,...
if (process.env.NODE_ENV === 'dev' && route.indexRoute) {
<|file_name|>scope.py<|end_file_name|><|fim▁begin|>""" Python expresses functional and modular scope for variables. """ # Global to the module, not global in the builtin sense. x = 5 def f1():<|fim▁hole|> """If not local, reference global. """ return x def f2(): """Local references global. """ ...
<|file_name|>test_turbulent_realisation.py<|end_file_name|><|fim▁begin|>from ionotomo import * import numpy as np import pylab as plt def test_turbulent_realisation(plot=True): xvec = np.linspace(-100,100,100) zvec = np.linspace(0,1000,1000) M = np.zeros([100,100,1000]) TCI = TriCubic(xvec,xvec,zvec,M)...
plt.colorbar(im) ax = f.add_subplot(3,3,6)
<|file_name|>router.module.js<|end_file_name|><|fim▁begin|>import register from '../../utils/register' import routeHelperConfig from './route-helper.provider' import routeHelper from './route-helper.factory' let registerApp = new register('blocks.router', [ 'ngRoute'<|fim▁hole|><|fim▁end|>
]) registerApp .provider('routeHelperConfig', routeHelperConfig) .factory('routeHelper', routeHelper)
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var goods = [ { GoodId: 1, Name: '玫瑰', Price: 100, Total: 100, SellCount: 0 }, { GoodId: 2, Name: '康乃馨', Price: 200, Total: 50, SellCount: 0 }, { GoodId: 3, Name: '满天星', Price: 100, Total: 50, SellCount: 0 }, { GoodId: 4, Name: '百合', Price: 500, Total: ...
chart.tooltipContent(function (key) {
<|file_name|>BroadleafAdminTimeZoneResolver.java<|end_file_name|><|fim▁begin|>/* * #%L * BroadleafCommerce Open Admin Platform * %% * Copyright (C) 2009 - 2013 Broadleaf Commerce * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Licen...
<|file_name|>1093.cpp<|end_file_name|><|fim▁begin|>#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; const double EPS = 1e-9; inline char DBLCMP(double d) { if (fabs(d) < EPS) return 0; return d>0 ? 1 : -1; } struct spoint { double x, y, z; spoint() {} spoint(double...
} if (DBLCMP(t1) > 0)
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use self::parse::{Parser, RawChunk}; use super::{Graph, Node}; use anyhow::{bail, Error}; use std::fmt; mod parse; enum Chunk { Raw(String), Package, License, Repository, Features, } pub struct Pattern(Vec<Chunk>); impl Pattern { pub fn new(fo...
write!(fmt, " (command-line)")?; }
<|file_name|>api.js<|end_file_name|><|fim▁begin|>'use strict'; var request = require('request'); var querystring = require('querystring'); var FirebaseError = require('./error'); var RSVP = require('rsvp'); var _ = require('lodash'); var logger = require('./logger'); var utils = require('./utils'); var responseToError...
response: response,
<|file_name|>pad_test.go<|end_file_name|><|fim▁begin|>package common import ( "testing" "github.com/stretchr/testify/assert" )<|fim▁hole|> received := Pad_PKCS7(input, 4) expected := []byte("YELLOW SUBMARINE\x04\x04\x04\x04") assert.Equal(t, expected, received) }<|fim▁end|>
// Matasano 2.1 func Test_Pad_PKCS7(t *testing.T) { input := []byte("YELLOW SUBMARINE")
<|file_name|>ComplexUpdateTest.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Ecl...
getExecutor().setSession(getSession().acquireUnitOfWork()); } this.workingCopy = ((UnitOfWork)getSession()).registerObject(this.objectToBeWritten); } else {
<|file_name|>popup-admin.js<|end_file_name|><|fim▁begin|>/*! PopUp Free - v4.7.11 * https://wordpress.org/plugins/wordpress-popup/ * Copyright (c) 2015; * Licensed GPLv2+ */ /*global window:false */ /*global document:false */ /*global wp:false */ /*global wpmUi:false */ /*global ace:false */ /** * Admin Javascript ...
jQuery(function init_admin() {
<|file_name|>del_name.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
del x
<|file_name|>webrender_helpers.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/. */ // TODO(gw): This contains helper traits and implem...
<|file_name|>block-iter-2.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://www.apache.org/li...
}); }); error!("{:?}", sum); assert_eq!(sum, 225);
<|file_name|>lowLevelLibrary.py<|end_file_name|><|fim▁begin|>from Adafruit_ADS1x15 import ADS1x15 as A2DObject from functools import partial # create AI channel objects class aiChannel: def __init__(self,confDict): #open connection on physicalChannel self.name = confDict['labelText'] self....
if self.mapStyle == 'poly':
<|file_name|>ttk.py<|end_file_name|><|fim▁begin|>"""Ttk wrapper. This module provides classes to allow using Tk themed widget set. Ttk is based on a revised and enhanced version of TIP #48 (http://tip.tcl.tk/48) specified style engine. Its basic idea is to separate, to the extent possible, the code implementing a wi...
it = iter(nval)
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" Django REST Framework serializers for the User API Accounts sub-application """ import json import logging from rest_framework import serializers from django.contrib.auth.models import User from django.conf import settings from django.core.exceptions import ...
super(UserReadOnlySerializer, self).__init__(*args, **kwargs)
<|file_name|>ProfilerTest.java<|end_file_name|><|fim▁begin|>// Copyright 2015 The Bazel 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.a...
}
<|file_name|>trie_node.rs<|end_file_name|><|fim▁begin|>use {TrieNode, KeyValue, NibbleVec, BRANCH_FACTOR}; use keys::*; macro_rules! no_children { () => ([ None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None ]) } impl<K, V> TrieNode<K,...
// Check that all non-root key vector's have length > 1. if !is_root && self.key.len() == 0 {
<|file_name|>InflectTest.hh<|end_file_name|><|fim▁begin|><?hh namespace Titon\Utility; use Titon\Test\TestCase; class InflectTest extends TestCase { public function testCamelCase(): void { $camelCase = [ 'foo Bar', 'fOo Bar', 'foo_Bar', ' foo-_--_BAR', 'foo-BAR', 'FOO-BAR', 'foo ...
$this->assertEquals('dashes', Inflect::variable('dash-es')); $this->assertEquals('_123numbers', Inflect::variable('123 numbers')); $this->assertEquals('withEXTxml', Inflect::variable('with EXT.xml'));
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! MongoDB server set topology and asynchronous monitoring. pub mod server; pub mod monitor; use {Client, Result}; use Error::{self, ArgumentError, OperationError}; use bson::oid; use common::{ReadPreference, ReadMode}; use connstring::{ConnectionString, Host}; use p...
if server.description.read()?.server_type == ServerType::Unknown { continue; }
<|file_name|>package.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A module with functions for working with GRR packages.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import importlib import inspect import logging import os import sys im...
Returns: A path to the resource or `None` if the resource cannot be found. """ # If we are running a pyinstaller-built binary we rely on the sys.prefix
<|file_name|>test_static_finders.py<|end_file_name|><|fim▁begin|>import os import unittest from tethys_apps.static_finders import TethysStaticFinder class TestTethysStaticFinder(unittest.TestCase): def setUp(self): self.src_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))...
def test_find_all(self): tethys_static_finder = TethysStaticFinder() path = 'test_app/css/main.css'
<|file_name|>yahoo.py<|end_file_name|><|fim▁begin|># coding: utf-8 <|fim▁hole|> import flask import auth import model import util from main import app yahoo_config = dict( access_token_url='https://api.login.yahoo.com/oauth/v2/get_token', authorize_url='https://api.login.yahoo.com/oauth/v2/request_auth', base_...
from __future__ import absolute_import
<|file_name|>prog4.py<|end_file_name|><|fim▁begin|>a = 1100087778366101931 b = 7540113804746346429 while (not(a <= b and b <= a)): if (b <= a):<|fim▁hole|><|fim▁end|>
a = a - b else: b = b - a print(a)
<|file_name|>SignIn.tsx<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2012-2022 Online-Go.com * * 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 * License,...
.catch(errorAlerter); }) .catch(ignore);
<|file_name|>localTransport.js<|end_file_name|><|fim▁begin|>module.exports = LocalTransport; function LocalTransport(incoming, options) { options = options || {};<|fim▁hole|> setImmediate(incoming(destination, message, callback)); //to make function async, just like other transports? //incoming(destination, mes...
this.name = "local"; this.outgoing = function(destination, message, sender, callback) {
<|file_name|>qtgui_time_sink_x.block.yml.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import math import re EVERYTHING_BEFORE_PARAMS = """id: qtgui_time_sink_x label: QT GUI Time Sink parameters: - id: type label: Type dtype: enum default: complex options: [complex, float, msg_complex, msg...
line_params_1, line_params_n, EVERYTHING_AFTER_PARAMS, ))
<|file_name|>_available_endpoint_services_operations.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 i...
class AvailableEndpointServicesOperations: """AvailableEndpointServicesOperations async operations.
<|file_name|>SidePanel.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; /** * @ngdoc react * @name SidePanel * @description SidePanel Component used usually for Advanced Search panels */ export const SidePanel: React.StatelessCompo...
shadowRight: false,
<|file_name|>AbstractLdapHystrixCommand.java<|end_file_name|><|fim▁begin|>/* Copyright 2014 Red Hat, Inc. and/or its affiliates. This file is part of lightblue. 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 Softw...
import com.netflix.hystrix.HystrixCommand; import com.netflix.hystrix.HystrixCommandGroupKey;
<|file_name|>quote.js<|end_file_name|><|fim▁begin|>"use strict"; const express = require('express'); const router = express.Router(); const quoteCtrl = require('../controllers/quote.js');<|fim▁hole|> //returns an array of stocks that potentially match the query string //no result will return an empty string router.get...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian // Licensed under the MIT License <LICENSE.md> extern crate build;<|fim▁hole|><|fim▁end|>
fn main() { build::link("wmcodecdspuuid", true) }
<|file_name|>util.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division, absolute_import # Copyright (c) 2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including t...
from rhsmlib.dbus import exceptions
<|file_name|>logistic_company.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 ...
# (at your option) any later version. #
<|file_name|>env.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LI...
<|file_name|>smtp.go<|end_file_name|><|fim▁begin|>package smtp import ( "net/smtp"<|fim▁hole|> // Exports is the export table of this module. // var Exports = map[string]interface{}{ "_name": "net/smtp", "sendMail": smtp.SendMail, "CRAMMD5Auth": smtp.CRAMMD5Auth, "plainAuth": smtp.PlainAuth, "Client": q...
qlang "qlang.io/spec" )
<|file_name|>custom-type.js<|end_file_name|><|fim▁begin|>var inspector = require('../'); // Custom type schema var personValidation = { type: 'object', properties: { firstname: { type: 'string', minLength: 1 }, lastname: { type: 'string', minLength: 1 }, age: { type: 'integer', gt: 0, lte: 120 }<|fim▁hole|> } ...
<|file_name|>inline.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/. */ #![deny(unsafe_code)] use app_units::Au; use block::AbsoluteA...
} else {
<|file_name|>064_raw_template_predecessor.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 # # ...
def upgrade_sqlite(migrate_engine): meta = sqlalchemy.MetaData()
<|file_name|>functions_68.js<|end_file_name|><|fim▁begin|>var searchData= [ ['handle',['HANDLE',['../wglew_8h.html#aa1efb7b85228601549d183556de19dfc',1,'wglew.h']]], ['hdc',['HDC',['../wglew_8h.html#a7b84f5391331438359747d138a86ffe3',1,'wglew.h']]], ['hglrc',['HGLRC',['../wglew_8h.html#a79abb55a8f5ce093fad0358132...
['hpbufferarb',['HPBUFFERARB',['../wglew_8h.html#a90ca6f3efc25075502afda6d38df143b',1,'wglew.h']]], ['hpbufferext',['HPBUFFEREXT',['../wglew_8h.html#a9a3e24dd9ba635197a508013c122d1d1',1,'wglew.h']]] ];
<|file_name|>DistributedNPCTailorAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * from pandac.PandaModules import * from DistributedNPCToonBaseAI import * import ToonDNA from direct.task.Task import Task from toontown.ai import DatabaseObject from toontown.estate import ClosetGlobals class Distribu...
def getTailor(self):
<|file_name|>bankmaintenance.route.js<|end_file_name|><|fim▁begin|>(function () { 'use strict'; angular.module('app.bankmaintenance').run(appRun); /* @ngInject */ function appRun(routerHelper) { routerHelper.configureStates(getStates()); } function getStates() { return [ ...
{ state: 'app.addBank',
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># # File that determines what each URL points to. This uses _Python_ regular # expressions, not Perl's. #<|fim▁hole|># from django.conf import settings from django.conf.urls.defaults import * from django.contrib import admin from django.views.generic import RedirectVie...
# See: # http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from . import basedatamodel<|fim▁end|>
from . import statuscodes from .exceptions import *
<|file_name|>eventTimeSpanFilterEnSpec.js<|end_file_name|><|fim▁begin|>/* * This file is part of MystudiesMyteaching application. * * MystudiesMyteaching application 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 Fo...
<|file_name|>bookizip.py<|end_file_name|><|fim▁begin|># This file is part of Booktype. # Copyright (c) 2012 Douglas Bagnall # # Booktype 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 ...