prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>exploit_overflow-1.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This exploit template was generated via:
# $ pwn template ./vuln
from pwn import *
# Set up pwntools for the correct architecture
exe = context.binary = ELF('./vuln')
def start(argv=[], *a, **kw):
'''Start the exploit agains... |
io = start()
payload = cyclic(76) |
<|file_name|>rediswrapper.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 kingsoft
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "hiredis/adapters/libuv.h"
#include "hiredis/hiredis.h"
#include "hiredis/async.h"
#include "./rediswrapper.h"
#ifndef see_here
#define see_here dba_err("check ... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
#from urllib.parse import urlparse, urlunparse
from builtins import str
from builtins import range
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib.auth import (
RE... | |
<|file_name|>import_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from youtrack import YouTrackException
def utf8encode(source):
if isinstance(source, str):
source = source.encode('utf-8')
return source
def _create_custom_field_prototype(connection, cf_type, cf_name, auto_attached=F... | |
<|file_name|>setup.py<|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/.
from setuptools import setup
PACKAGE_NAME = 'mozdevice'
PACKAGE_VERS... | 'moznetwork >= 0.24', |
<|file_name|>searcher.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/licens... | let t = open("nonexistent terminal that hopefully does not exist");
assert!(t.is_err()); |
<|file_name|>txn.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Cockroach 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-... | // We check only when txn.Proto.ID has been initialized after an initial successful send. |
<|file_name|>test_hoursbalance_model.py<|end_file_name|><|fim▁begin|>import datetime
import pytz
from django.utils import timezone
from django.contrib.auth.models import User
from django.test import TestCase
from gerencex.core.models import HoursBalance, Timing, Office
from gerencex.core.time_calculations import DateD... | r2 = HoursBalance.objects.get(pk=2) |
<|file_name|>query.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2017-2021 w-gao
#
import argparse
import logging
import struct
import sys
import socket
from contextlib import contextmanager
from random import randint
from typing import Generator
logger = logging.getLogger(__name__)
logging.basicConfig(level=logg... | self.whitelist = None |
<|file_name|>Logger.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml... | // A simple data structure class that stores information for and about
// a logged event. Objects of this type are created automatically when
|
<|file_name|>statgrabber_test.go<|end_file_name|><|fim▁begin|>package gostatgrabber
import (
"bytes"
"fmt"
"net"
"testing"
"time"
)
func TestCounter(t *testing.T) {
receiveChan, err := statReceiver(t)
if err != nil {
t.Fatalf("statReceiver() %s", err)
}
<-receiveChan
s, err := NewStatGrabber()
if err !=... | |
<|file_name|>get_bus_pullups.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
================================================
ABElectronics IO Pi Tests | test get_bus_pullups function
Requires python smbus to be installed
For Python 2 install with: sudo apt-get install python-smbus
For Python 3 install with... | |
<|file_name|>response_failure.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Red Hat, Inc.
#
# 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
# of... | |
<|file_name|>fragment.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 `Fragment` type, which represents the leaves of the ... |
fn scanned_text(scanned_text_fragment_info: &mut ScannedTextFragmentInfo,
border_box: &mut LogicalRect<Au>) |
<|file_name|>getcoins.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import argparse
import io
import requests
import su... | |
<|file_name|>context.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without... | |
<|file_name|>inherited_text.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 parsing::parse;
use style::values::generics::text:... | assert_eq!(result, parse_longhand!(line_height, "0px")); |
<|file_name|>interpreter.js<|end_file_name|><|fim▁begin|>import * as Error from '../error';
import * as Ast from './ast';
import * as ScopeHandler from './scopeHandler';
import * as TypeSystem from './typeSystem';
const evaluateBlock = (scope, ast) => {
return ast.map((expr) => {
return e... | };
const handleMap = (scope, map) => { |
<|file_name|>video.ts<|end_file_name|><|fim▁begin|>/*{# Copyright (c) 2012 Turbulenz Limited #}*/
/*
* @title: Video playback
* @description:
* This sample shows how to play a video into a texture.
*/
/*{{ javascript("jslib/observer.js") }}*/
/*{{ javascript("jslib/requesthandler.js") }}*/
/*{{ javascript("jslib/u... | var x, y;
if (aspectRatio < videoAspectRatio)
{
x = 1; |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-<|fim▁hole|>from dr import app
if __name__ == '__main__':
app.run()<|fim▁end|> | |
<|file_name|>UserListModalEntry.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import FollowButton from "../FollowButton";
import SimilarityScore from "../SimilarityScore";
import { SimilarUsersModalProps } from "./SimilarUsersModal";
export type UserListModalEntryProps = {
mode: "follow-following"... | user: ListenBrainzUser, |
<|file_name|>NormalSwaptionExpiryStrikeVolatilities.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.pricer.swaption;
import java.io.Serializable;
import java.time.Loca... | //-----------------------------------------------------------------------
@Override
public boolean equals(Object obj) { |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime
from decimal import Decimal
import types
import six
def is_protected_type(obj):
"""Determine if the object instance is of a protected type.
Objects of protected types are preserved as-is when passed to
force_unicode(strings_only=True).... | |
<|file_name|>Massdot.py<|end_file_name|><|fim▁begin|>"""Fetch Massacheusetts Department of Transportation feeds.
MassDOT supplies the feeds for MA not covered by MBTA (Boston's transit authority).
http://www.massdot.state.ma.us/DevelopersData.aspx
"""
import logging
from FeedSource import FeedSource
BASE_URL = 'http... | peter_pan_url = '%speter_pan_google_transit.zip' % BASE_URL
plymouth_brockton_railway_url = '%sPB_google_transit.zip' % BASE_URL
yankee_url = '%syankee_google_transit.zip' % BASE_URL
|
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>use std::ffi::CString;
use std::os::raw::c_char;
#[macro_export]
macro_rules! take_until_and_consume (
( $i:expr, $needle:expr ) => (
{
let input: &[u8] = $i;
let (rem, res) = ::nom::take_until!(input, $needle)?;
let (rem, _) = ::nom::take!(re... | ///
/// # Safety
/// |
<|file_name|>dynlib.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////
// Name: src/common/dynlib.cpp
// Purpose: Dynamic library management
// Author: Guilhem Lavaux
// Modified by:
// Created: 20/07/98
// Copyright: (c) 1998 Guilhem Lav... | // under Unix the library names usually start with "lib" prefix, add it
#if defined(__UNIX__)
switch ( cat ) |
<|file_name|>authcodes.js<|end_file_name|><|fim▁begin|>module.exports = function(app) {
var _env = app.get('env');
var _log = app.lib.logger;
var _mongoose = app.core.mongo.mongoose;
var _group = 'MODEL:oauth.authcodes';
var Schema = {
authCode : {type: String, required: true,... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>describe("BASIC CRUD SCENARIOS", function() {
require("./basic");
});
describe("VALIDATE CRUD SCENARIOS", function() {
require("./validation");
});
describe("REPORT SCENARIOS", function() {
require("./report");<|fim▁hole|><|fim▁end|> | }); |
<|file_name|>ping_working_public.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# @author: wtie
import subprocess
import sys
import time
import argparse
DIFF = False
FIRST = []
def get_floating_ips():
sql = """SELECT fip.floating_ip_address
FROM neutron.floatingips AS fip
JOIN neutron.ports... | FROM neutron.ports AS p
JOIN neutron.ipallocations AS ipa
JOIN neutron.securitygroupportbindings AS sgb
JOIN neutron.securitygrouprules AS sgr |
<|file_name|>factories.py<|end_file_name|><|fim▁begin|>import factory
from dominion.games.models import Game
<|fim▁hole|> class Meta:
model = Game<|fim▁end|> |
class GameFactory(factory.django.DjangoModelFactory): |
<|file_name|>contacts.interface.ts<|end_file_name|><|fim▁begin|>export interface IContact {
id?: number;
email: string;<|fim▁hole|><|fim▁end|> | listName: string;
name: string;
} |
<|file_name|>inspector.py<|end_file_name|><|fim▁begin|>import sys
from arrowhead.core import Step
from arrowhead.core import ErrorArrow
from arrowhead.core import NormalArrow
from arrowhead.core import ValueArrow
def print_flow_state(flow, active_step_name=None, file=sys.stdout):
"""
Display the state of a g... |
:param flow:
A Flow, instance or class
:param active_step_name: |
<|file_name|>tsd.d.ts<|end_file_name|><|fim▁begin|>/// <reference path="empower/empower.d.ts" />
/// <reference path="mocha/mocha.d.ts" />
/// <reference path="power-assert-formatter/power-assert-formatter.d.ts" />
/// <reference path="power-assert/power-assert.d.ts" />
/// <reference path="node/node.d.ts" /><|fim▁hole... | /// <reference path="virtual-dom/virtual-dom.d.ts" /> |
<|file_name|>callbacks.js<|end_file_name|><|fim▁begin|>function alertThanks (post) {
alert("Thanks for submitting a post!");
return post;
}<|fim▁hole|><|fim▁end|> |
Telescope.callbacks.add("postSubmitClient", alertThanks); |
<|file_name|>test_dbcore.py<|end_file_name|><|fim▁begin|># This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction,... | q = ''
r = (None, '', dbcore.query.SubstringQuery)
self.assertEqual(self.pqp(q), r)
|
<|file_name|>dnsaaaarecordnotfoundexception.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
from ...errors.httpbadrequestexception import HttpBadRequestException
import saklient
# module saklient.cloud.errors.dnsaaaarecordnotfoundexception<|fim▁hole|>
## @param {int} status
# @param {str} code=None... |
class DnsAaaaRecordNotFoundException(HttpBadRequestException):
## 不適切な要求です。対応するAAAAレコードが見つかりません。 |
<|file_name|>bibclassify_microtests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Module for running microtests on how well the extraction works -
this module is STANDALONE safe"""
import ConfigParser
import glob
import traceback
import codecs
import bibclassify_config as bconfig
import bibclassify_eng... | elif (len(sys.argv) > 1):
for p in sys.argv[1:]:
if p[0] == os.path.sep: # absolute path |
<|file_name|>connection.rs<|end_file_name|><|fim▁begin|>use std::{
fmt::Display,
io::{self, BufRead, BufReader, Write},
net::ToSocketAddrs,
time::Duration,
};
use super::{ClientCodec, NetworkStream, TlsParameters};
use crate::{
address::Envelope,
transport::smtp::{
authentication::{Cred... | pub fn send(&mut self, envelope: &Envelope, email: &[u8]) -> Result<Response, Error> {
// Mail
let mut mail_options = vec![]; |
<|file_name|>utility.py<|end_file_name|><|fim▁begin|>"""
Basic utility functions
"""
import redislite
from .server import RDB_FILE
def header(message, width=80):
header_message = '## ' + message + ' '<|fim▁hole|>
def connect_to_redis():
return redislite.Redis(dbfilename=RDB_FILE)
host = read_rc_config()["... | end_chars = width - (len(message) + 4)
header_message += '#'*end_chars
print(header_message) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws... | """
return binascii.hexlify(os.urandom(int(num_chars / 2))).decode('ascii') |
<|file_name|>debug_store_hash_fn_imps.hpp<|end_file_name|><|fim▁begin|>// -*- C++ -*-<|fim▁hole|>// 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, or (at your option) any later
// version.
// Thi... |
// Copyright (C) 2005-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free |
<|file_name|>water_thief.py<|end_file_name|><|fim▁begin|>import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addT... | |
<|file_name|>get-propuestas-electorales-v5.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as published by
the Free Software Foundation.
This program is... | answ = answer
if 'desconocido' in answer:
answer = answer.split('_') |
<|file_name|>.ycm_extra_conf.py<|end_file_name|><|fim▁begin|># Generated by YCM Generator at 2019-06-21 11:57:11.711058
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into ... | |
<|file_name|>ty.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | enum_variants(cx, id).iter().map(|variant_info| {
let substd_args = variant_info.args.iter() |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext' : build_ext},
ext_modules=[Extension("_snaphu",
sources=["_snaphu.pyx",
"../src/snaphu.c",
"..... | |
<|file_name|>n_queens.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
"""
n_queens.py
Created by Shengwei on 2014-07-23.
"""
# https://oj.leetcode.com/problems/n-queens/
# tags: medim / hard, matrix, bit manipulation, generator, dfs, edge cases, bitmap
"""
The n-queens puzzle is the problem o... | availables -= pos # remove current pos from availables
index = int(math.log(pos, 2)) # comput the index where to put queen
# note: remember the recursive call is an iterater and yield again |
<|file_name|>verify_numbers.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate mynumber;
extern crate test;
#[bench]
fn bench_verify_individual_number(b: &mut test::Bencher) {
b.iter(|| {
let number = "123456789018";
assert!(mynumber::individual::verify(number).is_ok());<|fim▁hole|>
#[... | });
} |
<|file_name|>serverList.py<|end_file_name|><|fim▁begin|>#| This file is part of pyCAF. |
#| |
#| pyCAF is free software: you can redistribute it and/or modify |
#| it under the terms of th... | """
# print self.label_interface_list()
for identityNb, server in self.dict.items(): |
<|file_name|>metadata.go<|end_file_name|><|fim▁begin|>// Copyright 2015 CoreOS, 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
/... | return data, scanner.Err()
} |
<|file_name|>definitions.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {AST, TmplAstBoundAttribute, TmplAstBoundEvent, TmplA... | break;
case SymbolKind.Expression:
definitions.push(...this.getTypeDefinitionsForSymbols(symbol));
break; |
<|file_name|>actions.py<|end_file_name|><|fim▁begin|># Copyright 2014 - Mirantis, Inc.
# Copyright 2015 - StackStorm, 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
#
# ... | def get_input(self):
return self._input |
<|file_name|>Exporter.java<|end_file_name|><|fim▁begin|>package com.deleidos.dp.export;
<|fim▁hole|>import com.deleidos.dp.exceptions.H2DataAccessException;
import com.deleidos.dp.exceptions.SchemaNotFoundException;
public interface Exporter {
public abstract String generateExport(Schema schema);
public abstract ... | import com.deleidos.dp.beans.Schema; |
<|file_name|>process_payment_parameters.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
package account
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.... | var () |
<|file_name|>params_parser.js<|end_file_name|><|fim▁begin|>function parse(req) {
var arreglo_parametros = [], parametros = {};<|fim▁hole|> var arreglo_parametros = url_data[1].split("&");
}
for (var i = arreglo_parametros.length - 1; i >= 0; i--) {
var parametro = arreglo_parametros[i]
var param_data = par... |
if (req.url.indexOf("?") > 0 ){
var url_data = req.url.split("?"); |
<|file_name|>EmailResponse.java<|end_file_name|><|fim▁begin|>package org.hisp.dhis.email;
/*
* Copyright (c) 2004-2018, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* ... | this.responseMessage = responseMessage; |
<|file_name|>const-param-elided-lifetime.rs<|end_file_name|><|fim▁begin|>// Elided lifetimes within the type of a const generic parameters is disallowed. This matches the
// behaviour of trait bounds where `fn foo<T: Ord<&u8>>() {}` is illegal. Though we could change
// elided lifetimes within the type of a const gener... | fn foo<const M: &u8>(&self) {}
//~^ ERROR `&` without an explicit lifetime name cannot be used here
//[min]~^^ ERROR `&'static u8` is forbidden |
<|file_name|>File_7z.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//-------------------------------------------------------... | {
// Minimum buffer size
if (Buffer_Size<6)
return false; // Must wait for more data |
<|file_name|>AdminPrefix_Resourcer_v1.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#Adam Breznicky - TxDOT TPP - Mapping Group
#
#This is an independent script which requires a single parameter designating a directory.
#The script will walk through each subfolder and file within the designated directory, identifying the... | #
#
#March 2014 |
<|file_name|>formatter.rs<|end_file_name|><|fim▁begin|>use ansi_term::Colour::Green;
use ansi_term::Colour::Yellow;
use app::machine::Machine;
fn get_empty_line() -> String {
String::from("")
}
fn get_header() -> String {
let o = format!("{0: ^10} | {1: ^10} | {2: ^10} | {3: ^10}",<|fim▁hole|> ... | "Number",
"Name", |
<|file_name|>test_sgd.py<|end_file_name|><|fim▁begin|>import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.tes... | else: # XXX the sparse test gets a different X2 (?)
assert_equal(np.argmin(d, axis=1), np.argmin(p, axis=1)) |
<|file_name|>upload_training_data.py<|end_file_name|><|fim▁begin|>import json
import os
import glob
import sys
import logging
from watson_developer_cloud import WatsonException
if '__file__' in globals():
sys.path.insert(0, os.path.join(os.path.abspath(__file__), 'scripts'))
else:
sys.path.insert(0, os.path.jo... | files = glob.glob(os.path.join(training_directory, '*.json'))
total_files = len(files)
print("Number of files to process: %d" % total_files)
|
<|file_name|>424f18f4c1df_.py<|end_file_name|><|fim▁begin|>"""empty message
Revision ID: 424f18f4c1df
Revises: 106e3631fe9
Create Date: 2015-06-23 11:31:08.548661
"""
# revision identifiers, used by Alembic.
revision = '424f18f4c1df'
down_revision = '106e3631fe9'
from alembic import op
import sqlalchemy as sa
from ... | sa.PrimaryKeyConstraint('id')
)
### end Alembic commands ###
|
<|file_name|>database_cleanup.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import os
import sys
import json
import re
import uuid
import base64
import models
from models.movie_trailer_model import Base, MovieTrailerModel
<|fim▁hole|>
print("%d rows were d... | rows = models.delete_movie_trailers() |
<|file_name|>animations.js<|end_file_name|><|fim▁begin|>import Chaffle from "chaffle";
const scrambleAuthor = () => {
const elements = document.querySelectorAll("[data-chaffle]");
elements.forEach(el => {
const chaffle = new Chaffle(el, {
speed: 10,<|fim▁hole|> chaffle.init();
... | delay: 20,
});
el.addEventListener("mouseover", () => { |
<|file_name|>driver.py<|end_file_name|><|fim▁begin|># Copyright 2016 Nuage Netowrks USA 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/license... | |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
//basePath: '../src/',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in ... | {type: 'text-summary'}
] |
<|file_name|>loc_fr_FR.js<|end_file_name|><|fim▁begin|>/*
* \brief localization strings for fr_FR
*
* \file loc_fr_FR.js
*
* Copyright (C) 2006-2009 Jedox AG
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as published
... | "No Color": "Pas de couleur",
"More Colors": "Plus de couleurs", |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
setup(
name='nspawn-api',
packages=['nspawn'],
include_package_data=True,
install_requires=[
'gunicorn',<|fim▁hole|> 'nsenter',
'flask',
'pydbus',
'supervisor'
],
)<|fim▁end|> | |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use rocket::local::Client;
use rocket::http::{Status, ContentType};
<|fim▁hole|>use std::io::Read;
use std::fs::{self, File};
const UPLOAD_CONTENTS: &str = "Hey! I'm going to be uploaded. :D Yay!";
#[test]
fn test_index() {
let client = Client::new(super::rocket(... | |
<|file_name|>ThugOpts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# ThugOpts.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hop... | |
<|file_name|>test_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from abc import ABCMeta, abstractmethod
from pathlib import PurePath
from textwrap import dedent
from typing import List, Tuple, Type... |
# TODO(#9141): replace this with a proper util to create `GoalSubsystem`s
class MockOptions:
def __init__(self, **values): |
<|file_name|>ssh.rs<|end_file_name|><|fim▁begin|>use libc::{c_char, execvp};
use std::io::prelude::*;
use std::ffi::CString;
use std::ptr;
macro_rules! c_ptr {
($x:expr) => {{ CString::new($x).unwrap().as_ptr() }};
}
fn exec_ssh(ip: &str, command: &str, verbose: bool) {
let user_host: &str = &format!("rightsc... | fn user_and_command() {
assert_eq!("sudo -u \"sean\" -- sh -cl \"cd / && /bin/bash\"".to_string(),
ssh_command_arg(Some("sean".to_string()), Some("cd / && /bin/bash".to_string())));
} |
<|file_name|>scholarship.js<|end_file_name|><|fim▁begin|>var View = require('ampersand-view');
var templates = require('../templates');
module.exports = View.extend({
template: templates.includes.scholarship,
bindings: {
'model.field': '[role=field]',
'model.slots': '[role=slots]',
'mod... | 'model.scholarshipIdUpperCase': '[role=link]',
'model.releaseDateFormated': '[role=release-date]',
'model.closeDateFormated': '[role=close-date]' |
<|file_name|>radio-button.js<|end_file_name|><|fim▁begin|>HB.RadioButtonComponent = Ember.Component.extend({
tagName: 'input',
type: 'radio',
attributeBindings: ['type', 'htmlChecked:checked', 'value', 'name'],
htmlChecked: function(){
return this.get('value') === this.get('checked');
}.property('value',... |
change: function(){
this.set('checked', this.get('value'));
} |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for goska project.<|fim▁hole|>https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "goska.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_applicat... |
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see |
<|file_name|>LoginPresenter.java<|end_file_name|><|fim▁begin|>package com.riteshakya.subs.views.screens.login;
<|fim▁hole|>import com.google.android.gms.common.api.GoogleApiClient;
import com.riteshakya.subs.mvp.FlowListener;
import com.riteshakya.subs.mvp.IPresenter;
import com.riteshakya.subs.mvp.IView;
import com.r... | import android.content.Intent;
import android.support.v4.app.FragmentActivity; |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import os
from flask import Flask, g, session, redirect, request, url_for, jsonify
from requests_oauthlib import OAuth2Session
OAUTH2_CLIENT_ID = os.environ['OAUTH2_CLIENT_ID']
OAUTH2_CLIENT_SECRET = os.environ['OAUTH2_CLIENT_SECRET']<|fim▁hole|>
API_BASE_URL = os.envir... | OAUTH2_REDIRECT_URI = 'http://localhost:5000/callback' |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include "Card.h"
#include "Game.h"
#include <iostream>
#include <array>
#include <string>
#include <vector>
#include <algorithm>
#include <random>
#include <cstdlib>
#include <ctime>
using namespace std;
using namespace zks::game::card;
int test_deck() {
CardDec... | |
<|file_name|>buttons-input.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2018 Boucher, Antoni <bouanto@zoho.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restrictio... | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
<|file_name|>ControllerType.java<|end_file_name|><|fim▁begin|>package com.raoulvdberge.refinedstorage.block.enums;
import net.minecraft.util.IStringSerializable;
public enum ControllerType implements IStringSerializable {
NORMAL(0, "normal"),
CREATIVE(1, "creative");
private int id;
private String na... |
@Override
public String getName() {
return name; |
<|file_name|>mobile.js<|end_file_name|><|fim▁begin|>toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": true,
"positionClass": "toast-bottom-full-width",
"preventDuplicates": false,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "10... | var tabIndex = $.attr( element, "tabindex" ),
isTabIndexNaN = isNaN( tabIndex );
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); |
<|file_name|>crossepg_main.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import absolute_import
from enigma import *
from Screens.MessageBox import MessageBox
from Screens.Standby import TryQuitMainloop
from . crossepglib import *
from . crossepg_downloader import CrossEPG_Down... | CrossEPG_Auto.instance.lock = True
session.openWithCallback(self.setupCallback, CrossEPG_Menu) |
<|file_name|>db.go<|end_file_name|><|fim▁begin|>// Copyright © 2016-2021 Genome Research Limited
// Author: Sendu Bala <sb10@sanger.ac.uk>.
//
// This file is part of wr.
//
// wr is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
//... | // value may come from the cache, avoiding db access. |
<|file_name|>mti880.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# Copyright (C) 2012 Club Capra - capra.etsmtl.ca
#
# This file is part of CapraVision.
#
# CapraVision is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | self.accumulate.append(area) |
<|file_name|>Field.java<|end_file_name|><|fim▁begin|>package org.real2space.neumann.evaris.core.structure;
/**
* Project Neumann
*<|fim▁hole|> * @version 0
*
* created 2016/11/01
* added "extends Ring<F>" 2016/11/9
*/
public interface Field<F> extends Ring<F> {
/*
* Multiply this member by an inverse... | * @author RealTwo-Space |
<|file_name|>renderer.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Write};
use std::ops::Range;
use termcolor::{ColorSpec, WriteColor};
use crate::diagnostic::{LabelStyle, Severity};
use crate::files::{Error, Location};
use crate::term::{Chars, Config, Styles};
/// The 'location focus' of a source code snippet... | |
<|file_name|>NotificationEvents.java<|end_file_name|><|fim▁begin|>package org.wordpress.android.ui.notifications;
import com.android.volley.VolleyError;
import org.wordpress.android.models.Note;
import java.util.List;
public class NotificationEvents {
public static class NotificationsChanged {
final pub... | public static class NoteLikeStatusChanged {
final String noteId;
public NoteLikeStatusChanged(String noteId) { |
<|file_name|>vyatta-filechooser.js<|end_file_name|><|fim▁begin|>var FileChooser = function(config)
{
// Setup a variable for the current directory
this.current_directory;
/* ---- Begin side_navbar tree --- */
this.tree = new Ext.tree.TreePanel(
{
region: 'west',
width: 150,... | maxSize: 250,
animate: true,
loader: new Ext.tree.TreeLoader({dataUrl: 'tree_data.json.php' }),
|
<|file_name|>Message.cpp<|end_file_name|><|fim▁begin|>#include "Common.h"
#include "Core.h"
#include "Event.h"
#include "Message.h"
#include "ProfilerServer.h"
#include "EventDescriptionBoard.h"
namespace Brofiler
{
/////////////////////////////////////////////////////////////////////////////////////////////... | Core::Get().Activate(true);
if (EventDescriptionBoard::Get().HasSamplingEvents())
{
|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from .models import *
class ProductAdmin(admin.ModelAdmin):
list_display = ('id', 'prd_process_id', 'prd_name',
'prd_display_name', 'prd_owner', 'prd_product_id', 'prd_date',
'prd_class', '... | |
<|file_name|>pycrypto_aes.py<|end_file_name|><|fim▁begin|># Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""PyCrypto AES implementation."""
from .cryptomath import *
from .aes import *
if pycryptoLoaded:
import Crypto.Cipher.AES
def new(key, mode,... | plaintext = bytes(plaintext)
return bytearray(self.context.encrypt(plaintext))
|
<|file_name|>GemfireVerboseMarkerFilterAcceptIntegrationTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF l... | import java.net.URL;
|
<|file_name|>nls.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
# 2011 ~ 2012 Hou Shaohui
#
# Author: Hou Shaohui <houshao55@gmail.com>
# Maintainer: Hou Shaohui <houshao55@gmail.com>
#
# This program is free software: you can... | level -= 1 |
<|file_name|>server.ts<|end_file_name|><|fim▁begin|>const restify = require('restify');
const random = require('random-js')();
const Promise = require("bluebird");
// import * as restify from 'restify';
const assert = require('assert');
const clients = require('restify-clients');
const CBuffer = require('CBuffer');
co... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# 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/lice... | # See the License for the specific language governing permissions and
# limitations under the License. |
<|file_name|>memory_arena.rs<|end_file_name|><|fim▁begin|>//! 32-bits Memory arena for types implementing `Copy`.
//! This Memory arena has been implemented to fit the use of tantivy's indexer
//! and has *twisted specifications*.
//!
//! - It works on stable rust.
//! - One can get an accurate figure of the memory usa... | |
<|file_name|>test_task_exceptions.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from PyProjManCore.task import Task
class TestTaskOperationsExceptions(TestCase):
"""Test Exceptions for Task operations"""
def test_append_duplicate_prereq(self):
"""Test appending duplicate prerequisites... | self.assertNotEqual(2, len(root.dependants)) |
<|file_name|>style.ts<|end_file_name|><|fim▁begin|>import styled, { css } from 'styled-components';
import { ITheme } from '~/interfaces';
export const EmptySection = styled.div`
margin-top: 16px;
padding: 8px 0px 8px 0px;
overflow: hidden;
border-radius: 8px;
<|fim▁hole|> ${({ theme }: { theme?: ITheme }) =>... | &:first-child {
margin-top: 0;
}
|
<|file_name|>summary.go<|end_file_name|><|fim▁begin|>package lib
import (
"io"
"strings"
"github.com/improbable-io/go-junit-report/parser"
"io/ioutil"
)
type Results map[string][]*Test
const (
PASS = "pass"
FAIL = "fail"
SKIP = "skip"
)
var jsonTestKeys = map[parser.Result]string{
parser.PASS: PASS,
pars... | jsonTest := &Test{
PackageName: pkg.Name, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.