text stringlengths 2 6.14k |
|---|
import json
import tornado.web
import tornado.gen
from common.sentry import sentry
from common.web import requestsManager
from constants import exceptions
from helpers import chatHelper
from objects import glob
class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@sen... |
<?php
/** ______________________________________________
* o O | |
* ((((( o < JDom Class - Cook Self Service library |
* ( o o ) |___________________________________... |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Completion;
using Microsof... |
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// ass... |
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { MessagesComponent } from './messages.component';
import { MessageService } from '../message.service';
describe('MessagesComponent', () => {
let component: MessagesComponent;
let fixture: ComponentFixture<MessagesComponent>;
... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import json
import collections
# See setTranslationData.py
with open(os.path.join(os.path.dirname(__file__), 'json/translationInfo.json'), 'r') as f:
d = json.JSONDecoder(object_pairs_hook = collections.OrderedDict)
translationInfo = d.decode(f.read())
def ... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='coinor.grumpy',
version='0.95.1',
description='Graphics for Understanding Mathematical Programming (GrUMPy)',
long_description='''GrUMPy is a class for visualizing various algorithm used in solving discrete optimization pr... |
import * as avalon from 'avalon2';
import 'mmRouter';
import { menu as menuStore } from './stores';
import * as navConfig from './nav.config.js';
var bootbox = require('bootbox');
function getPage(component) {
const html = `<xmp is="${component}" :widget="{id:'${component.replace(/\-/g, '_')}'}"></xmp>`;
retu... |
#! /usr/bin/env python
"""
This demonstrates a basic LEAP app that writes a string to a file.
Read the code, run the code (./run.py), then check leap/output for the output.
This app demonstrates:
* An App is a class that inherits from leap_app.App.
Being a child of leap_app.App automatically gives the app s... |
/**
* Copyright (C) 2009-2012 Kenneth Prugh
*
* 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 3 of the License, or
* (at your option) any later version.
*/
package irc;
im... |
import os,re
import pandas as pd
#qtypes = ['which', 'what', 'why', 'when', 'where', 'how']
'''
add binary columns of iswhich, iswhat ... ishow.
to indicate which type of question it is
'''
def parse_questions(ques_type, df):
df['is' + ques_type] = df.apply(lambda x : 1 if re.sub('[^a-zA-Z]+', ' ', x['question'... |
/*
Copyright (C) 2012 - 2015 Evan Teran
evan.teran@gmail.com
Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Lic... |
#!/usr/bin/env python
"""
ConfigFiles.py $Id: ConfigFiles.py,v 1.9 2002/05/18 10:28:24 nordstrom Exp $
Defines easy access to the various .ini config files for PyPlucker.
Copyright 2000 by Holger Duerer <holly@starship.python.net>
Distributable under the GNU General Public License Version 2 or newer.
""... |
/****************************************************************************
*
* Copyright (C) 2012-2019 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redi... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BLEU_TURQUIN = "rgb(66, 91, 138)";
exports.BLANC = "rgb(255, 255, 255)";
exports.NOIR = "rgb(0,0,0)";
exports.FOND_NOIR = "rgb(17, 17, 17)";
exports.GRIS_NOIR = "rgb(50, 50, 50)";
exports.ROUGE = "rgb(255, 0, 0)";
exports.JAUNE = "rgb(... |
# Standard lib imports
# None
# Third party imports
# None
# Project level imports
# None
class ProtectionDomain(object):
def __init__(self, connection):
"""
Initialize a new instance
"""
self.conn = connection
@property
def get(self):
"""
Return... |
#!/usr/bin/env python
# --!-- coding: utf8 --!--
# The loadSave file calls the proper functions to load and save file
# trying to detect the proper file format if it comes from an older version
import os
import zipfile
import manuskript.load_save.version_0 as v0
import manuskript.load_save.version_1 as v1
import log... |
/**
* Copyright (c) Andrew Swan 2008
*/
package com.andrewswan.lostcities.domain;
import junit.framework.TestCase;
/**
* Unit test of the {@link Expedition} class.
*
* @author Andrew
*/
public class ExpeditionTest extends TestCase {
// Constants
private static final Suit SUIT = Suit.GREEN; // arbitrary
//... |
from struct import pack, unpack
"""
This module contains functions for reading and writing the special data types
that a midi file contains.
"""
"""
nibbles are four bits. A byte consists of two nibles.
hiBits==0xF0, loBits==0x0F Especially used for setting
channel and event in 1. byte of musical midi event... |
<?php
$currentAppLang = Yii::app()->getLanguage();
if (!$this->positionHasData(1, "sideColumn")) {
$news = new ArticlesListData(array('news'), 0, 6);
$news->addColumn('publish_date');
$news->addOrder('publish_date desc');
$news->generate();
$newsList = $news->getItems();
$this->setPositionData(1... |
from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
from api import views
urlpatterns = format_suffix_patterns([
# swagger documentation url
url(r'^docs/', include('rest_framework_swag... |
# coding: utf-8
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: hjelp@mailmojo.no
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import mailmojo_sdk
from mailmojo_sdk.api.ac... |
<?php
/**
* The contents of this file was generated using the WSDLs as provided by eBay.
*
* DO NOT EDIT THIS FILE!
*/
namespace DTS\eBaySDK\Trading\Types;
/**
*
*/
class BidGroupArrayType extends \DTS\eBaySDK\Types\BaseType
{
/**
* @var array Properties belonging to objects of this class.
*/
... |
/*******************************************************************************
* Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1... |
"""
Copyright (C) <2010> Autin L.
This file ePMV_git/demo/renderMaya.py is part of ePMV.
ePMV 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... |
sofia.resources['jw'] = {
"translation": {
"name": "Javanese",
"menu": {
"search": {
"placeholder": "Panelusuran"
},
"config": {
"font": "Font",
"settings": "Setelan",
"tools": "Pribadi"
},
"reset": "ngreset",
"themes": {
"default": "Normal",
"sepia": "Sepia",
"dark": ... |
"""
Example of a Beta distribution
------------------------------
Figure 3.17.
This shows an example of a beta distribution with various parameters.
We'll generate the distribution using::
dist = scipy.stats.beta(...)
Where ... should be filled in with the desired distribution parameters
Once we have defined the... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import sys
import time
import telepot
import telepot.namedtuple
from telepot.loop import MessageLoop
"""
$ python2.7 emodi.py <token>
Emodi: An Emoji Unicode Decoder - You send it some emoji, it tells you the unicodes.
Caution: Python's treatment of unicode characters longer than 2 bytes (which
most emojis are) vari... |
#include "NativeFeatureIncludes.h"
#if _RAKNET_SUPPORT_NatTypeDetectionClient==1
#include "NatTypeDetectionClient.h"
#include "RakNetSocket.h"
#include "RakNetSmartPtr.h"
#include "BitStream.h"
#include "SocketIncludes.h"
#include "RakString.h"
#include "RakPeerInterface.h"
#include "MessageIdentifiers.h"
#... |
namespace Microsoft.Protocols.TestSuites.MS_OXWSSYNC
{
using System.Xml.XPath;
using Microsoft.Protocols.TestSuites.Common;
using Microsoft.Protocols.TestTools;
/// <summary>
/// The adapter interface which provides methods CreateItem, DeleteItem, GetItem and UpdateItem defined in MS-OXWSCOR... |
# Functions that already have the correct syntax or miscellaneous functions
__all__ = ['sort', 'copy_reg', 'clip', 'rank',
'sign', 'shape', 'types', 'allclose', 'size',
'choose', 'swapaxes', 'array_str',
'pi', 'math', 'concatenate', 'putmask', 'put',
'around', 'vdot', 'tran... |
#!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or module 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) any ... |
<!-- Copyright 2008 Lubomir Bourdev and Hailin Jin
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)
-->
<!--
Copyright 2005-2007 Adobe Systems Incorporated
Distributed under the MIT Lice... |
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... |
// Increase Tracking for text layer or Duplicate and Nudge Right (alt →)
@import 'js/utilities.js'
var onRun = function(context) {
var doc = context.document;
var selection = context.selection;
for(var i=0; i < [selection count]; i++){
if (isText(selection[i])) { // tracking part
var layer = selecti... |
--TEST--
MongoDB\BSON\Regex initialization will alphabetize flags
--FILE--
<?php
$regex = new MongoDB\BSON\Regex('regexp', 'xusmli');
var_dump($regex);
?>
--EXPECTF--
object(MongoDB\BSON\Regex)#%d (%d) {
["pattern"]=>
string(6) "regexp"
["flags"]=>
string(6) "ilmsux"
}
|
#
# Copyright (c) SAS Institute 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
#
# Unless required by applicable law or agreed to in w... |
/*
* Kuali Coeus, a comprehensive research administration system for higher education.
*
* Copyright 2005-2016 Kuali, Inc.
*
* 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, eithe... |
"""
# Majic
# Copyright (C) 2014 CEH
#
# 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 the License, or
# (at your option) any later version.
#
# This pr... |
/** @jsx React.DOM */
var React = require('react');
var MallFilter = require('./MallFilter');
var SaleSection = require('./SaleSection');
var GlugrApp = React.createClass({
getInitialState: function () {
return { mallId: 1 };
},
filterSales: function (mallId) {
this.setState({
mallId: mallId
});
},
ren... |
"""
"""
__author__ = 'gavinhackeling@gmail.com'
################# Sample 1 #################
"""
>>> import numpy as np
>>> print np.linalg.eig(np.array([[3, 2], [1, 2]]))[0]
[ 4. 1.]
"""
import numpy as np
print np.linalg.eig(np.array([[3, 2], [1, 2]]))[0]
W, V = np.linalg.eig(np.array([[3, 2], [1, 2]]))
#######... |
<?php
/* flaminuxmioBundle:Default:dammiUnNome.html.twig */
class __TwigTemplate_10f2f55dd7105d82d79882c0b8c2b2d3 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
... |
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
def linearPowerLimitedRocket_dist( t, F, ve=10000, m0=1.0 ):
A = m0*ve
B = np.log( F*t - A )
return F*ve*( t/F + A*B/F**2 ) - t*ve*B
def getAccFT( F=None, ve=10000, P=1e+9, m0=1.0, fmass=0.1 ):
if F is None:
F = P/ve ... |
package com.bytegames.prevent;
import com.bytegames.prevent.MathHelper;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
/**
* A 2D entity to display.
*
* @author byte
*/
public class Sprite {
private BufferedImage _image;
private double _angle;
/**
... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
#!/usr/bin/env python
import argparse
import boto
import datetime
import json
import os
import sys
import time
# Set timeout, for retry
#if not boto.config.has_section('Boto'):
# boto.config.add_section('Boto')
#boto.config.set('Boto','http_socket_timeout','30')
################################
# Parse command li... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 18 14:26:20 2013
@author: rarossi
"""
#!/usr/bin/python
# File: sum_primes.py
# Author: VItalii Vanovschi
# Desc: This program demonstrates parallel computations with pp module
# It calculates the sum of prime numbers below a given integer in parallel
# Parallel Python S... |
/// <reference path='fourslash.ts'/>
////class G<T> { // Introduce type parameter T
//// self: G<T>; // Use T as type argument to form instance type
//// f() {
//// this./*1*/self = /*2*/this; // self and this are both of type G<T>
//// }
////}
goTo.marker('1');
ver... |
'use strict';
const chai = require('chai'),
expect = chai.expect,
Support = require(__dirname + '/../support'),
DataTypes = require(__dirname + '/../../../lib/data-types'),
Sequelize = require('../../../index');
describe(Support.getTestDialectTeaser('associations'), () => {
describe('Test options.foreignKey... |
/* EEPROM based configuration data storage structure
Whole flight controller configuration is being stored inside an CONFIG structure
that can be accesed as data union (which is required for easy manipulation with
the configuration data over serial and easy way of storing this data in EEPROM).
Th... |
#!/usr/bin/env python
"""This tests the performance of the AFF4 subsystem."""
from grr.lib import aff4
from grr.lib import data_store
from grr.lib import test_lib
from grr.lib.rdfvalues import client as rdf_client
class AFF4Benchmark(test_lib.AverageMicroBenchmarks):
"""Test performance of the AFF4 subsystem."""... |
#!/usr/bin/env python
################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
... |
#!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
StringIO # work... |
from django.forms import ModelForm
from django import forms
from incidents.models import IncidentCategory, Incident, Comments, BusinessLine
# forms ===============================================================
class IncidentForm(ModelForm):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop('f... |
# The Hazard Library
# Copyright (C) 2012-2014, GEM Foundation
#
# 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, or (at your option) any later version.
... |
#pragma once
#include <Sweet.h>
#include <node\Node.h>
#include <typeinfo>
#include <Texture.h>
#include <Game.h>
#include <MY_ResourceManager.h>
#include <Log.h>
#include <ctime>
#include <NumberUtils.h>
#include <MY_Game.h>
#ifdef _DEBUG
// memory leak debugging
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#i... |
from chiplotle.hpgl.pen import Pen as HPGLPen
from chiplotle.core.interfaces.formatdecorator import FormatDecorator
class Pen(FormatDecorator):
'''The Pen wraps HPGL Pen properties around a given Shape.
- `pen` is the pen number to use.
- `sticky` boolean; set to False to set plotter back to default values
... |
from __future__ import division, absolute_import, print_function
import os
from numpy.distutils.fcompiler.gnu import GnuFCompiler
compilers = ['VastFCompiler']
class VastFCompiler(GnuFCompiler):
compiler_type = 'vast'
compiler_aliases = ()
description = 'Pacific-Sierra Research Fortran 90 Compiler'
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Dipl.Tzt. Enno Deimel <ennodotvetatgmxdotnet>
#
# This file is part of gnuvet, published under the GNU General Public License
# version 3 or later (GPLv3+ in short). See the file LICENSE for information.
# Initially created: Sun Feb 8 13:57:36 2015 by: PyQt4 UI code gene... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
from django.conf import settings
from django.contrib.sessions.models import Session
from django.contrib.sessions.backends.base import SessionBase
from django.core.exceptions import SuspiciousOperation
import datetime
class SessionStore(SessionBase):
"""
Implements database session store
"""
def __init_... |
/***************************************************************************
qgsglobetilesource.h
---------------------
begin : August 2010
copyright : (C) 2010 by Pirmin Kalberer
(C) 2015 Sandro Mani
email : pka at sourcepole dot c... |
"""
Django settings for django_workflow project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Bu... |
export function hmget(key: string, ...fields: Array<any>) {
const hash = this.data.get(key);
return fields.map((field) => {
if (!hash || hash[field] === undefined) {
return null;
}
return hash[field];
});
}
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
import { filter, propType } from 'graphql-anywhere';
import { gql } from 'react-apollo';
import graphql from '../util/graphql';
import UserPreview from '../components/UserPreview';
const Users = ({ data: { allUsers } }) => (
<div className="wrapper">
<style jsx>{`
.wrapper {
display: flex;
... |
<?php
/*
* This file is part of the prooph/event-store.
* (c) 2014 - 2015 prooph software GmbH <contact@prooph.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Date: 10/09/15 - 07:20 PM
*/
namespace Prooph\EventStore\Snapshot... |
#!/usr/bin/env python
'''Light submodule for dGraph scene description module
David Dunn
Jan 2017 - created by splitting off from dGraph
ALL UNITS ARE IN METRIC
ie 1 cm = .01
www.qenops.com
'''
__author__ = ('David Dunn')
__version__ = '1.6'
__all__ = ["Light", "PointLight", "DirectionLight"]
from dGraph impor... |
from core import GoogleService
import apiclient
class DriveService(GoogleService):
def __init__(self, credentials):
"""
"""
super(DriveService, self).__init__('drive', 'v3', credentials)
def list_files(self, page_size=10):
"""
"""
list_service = self.service.... |
using System;
using System.ComponentModel.DataAnnotations;
using KebabManager.Common.Enums;
using Pizza.Contracts.Default;
namespace KebabManager.Contracts.ViewModels.Customers
{
public sealed class CustomerDetailsModel : DetailsModelBase
{
[Display(Name = "Login")]
public string Login { get; s... |
/*
* Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditio... |
from OpenGL.GLU import *
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.arrays import vbo
from OpenGL.GL import shaders
from OpenGL.GL.ARB.color_buffer_float import *
from OpenGL.raw.GL.ARB.color_buffer_float import *
import numpy as np
import random
from PIL import Image
import random
class Texture:
... |
import numpy as np
import math
import ctypes
import rnn.kernel as algo
class SoftmaxCrossEntropy(object):
def __init__(self):
self.Y = None
self.dX = None
def __getstate__(self):
return True
def __setstate__(self, x):
self.Y = None
self.dX = None
def weights... |
#!/usr/bin/python
# license:BSD-3-Clause
# copyright-holders:Olivier Galibert
import sys
import re
# Initial state
state = 1
text = ""
dispatch_to_states = { "MAIN" : 0 }
states_to_dispatch = { 0 : "MAIN" }
def load_file(fname, lines):
path = fname.rpartition('/')[0]
if path != "":
path += '/'
try:
f = open(f... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Rgaa30 Test.4-1-3 NMI 01</title>
... |
#!/usr/bin/env python
# fixpax - fix ownership in bdist_mpkg output
#
# Copyright 2015 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# MIT license (http://opensource.org/licenses/MIT)
"""Set file ownership to 0 in an Archive.pax.gz.
Suitable for fixing files... |
'''
Created on Jan 5, 2016
@author: Dmitry
'''
import os
import sys
from twisted.python import filepath
def spawnProcess(proto, sibling, *args, **kw):
"""
Launch a child Python process and communicate with it using the
given ProcessProtocol.
@param proto: A L{ProcessProtocol} instance... |
@extends('Layouts.master')
@section('head')
<title>Scholarship Interface Reset Password</title>
<link rel="stylesheet" type="text/css" href="{{asset('/css/Global/ResetPassword/cellphone.css') }}">
@parent
@stop
@section('content')
<div id="cellPhoneTokenInput">
{{ Form::open(array('url' => route('password.reset.... |
using GraphQLParser.AST;
namespace GraphQLParser.Visitors;
/// <summary>
/// Context used by <see cref="SDLPrinter{TContext}"/> and <see cref="StructurePrinter{TContext}"/>.
/// </summary>
public interface IPrintContext : IASTVisitorContext
{
/// <summary>
/// A text writer to print document.
/// </summar... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core bus... |
# -*- coding: utf-8 -*-
#pickle用于进程或者网络间传输程序状态的数据
#简单来说就是把对象序列化成一串字符,然后传输,然后由这么一段字符再还原成原来的状态
import pickle
d = dict(name = 'bob',age = 20,score = 90)
p = pickle.dumps(d)
print('下面是序列化之后的内容')
print(p)
#这里通过dumps来将dict对象进行序列化
print('下面是序列化之还原后的内容')
print(pickle.loads(p))
#这里通过loads来进行还原
f = open('dump.txt','wb')
pickle.... |
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* 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 the License, or
* (at your o... |
/*
* This file is part of CasADi.
*
* CasADi -- A symbolic framework for dynamic optimization.
* Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved.
*
* CasADi is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Pu... |
// Copyright (C) 2008, 2009, 2011, 2012, 2013 EPITA Research and
// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena 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, version 2 of th... |
# coding=utf-8
"""
.NET (CLR) specific functions
"""
__author__ = 'Ilya.Kazakevich'
def get_namespace_by_name(object_name):
"""
Gets namespace for full object name. Sometimes last element of name is module while it may be class.
For System.Console returns System, for System.Web returns System.Web.
Be ... |
import common
# create admin account
try:
admin_id = common.users.add('hat@headquarters.com', 'adminpass', name='Admin', groups="admin", email_confirmed='1')
except KeyError:
admin = common.users.get('hat@headquarters.com', 'adminpass')
admin_id = admin.id
# create app owner account
try:
boss_id = comm... |
'''This module contains some glue code encapsulating a "main" process.
The code here wraps the most common tasks involved in creating and, especially,
training a neural network model.
'''
import climate
import os
from . import graph
logging = climate.get_logger(__name__)
class Experiment:
'''This class encaps... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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
#
# Unless required by appl... |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>windows::basic_handle::basic_handle</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../bo... |
# -*- encoding: utf-8 -*-
import os
import click
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from strephit.web_sources_corpus.preprocess_corpus import preprocess_corpus
from strephit.web_sources_corpus import run_all, archive_org
@click.command()
@click.argument('... |
"""Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... |
<?php
/*
* (c) Jean-François Lépine <https://twitter.com/Halleck45>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Hal\MaintenabilityIndex;
/**
* Calculates Maintenability Index
*
* According to Wikipedia, "Main... |
# 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 applicable law or agreed to in writing, software
# distributed under t... |
#!/usr/bin/env python
# encoding: utf-8
"""
test.py
Created by Maximillian Dornseif on 2010-10-24.
Copyright (c) 2010 HUDORA. All rights reserved.
"""
import unittest
from huTools.http import fetch
class testTests(unittest.TestCase):
def test_fetch_get_basic(self):
status, header, body = fetch('http:/... |
/*
* Copyright (c) 2021, Peter Abeles. All Rights Reserved.
*
* This file is part of Efficient Java Matrix Library (EJML).
*
* 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:... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Joe H. Rahme <joe.hakim.rahme@enovance.com>
#
# 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 o... |
package com.android.intro.movieslist.adpater;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import uk.co.s... |
# -*- coding: utf-8 -*-
from mock import Mock
from django.utils import unittest
from django.conf import settings
from transifex.resources.formats.registry import registry, _FormatsRegistry
from transifex.resources.formats.pofile import POHandler, POTHandler
from transifex.txcommon.tests.base import BaseTestCase
clas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.