src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
from flask import request, jsonify, g, url_for, Blueprint, render_template, redirect, flash
from flask.ext.login import login_required, current_user
from project.application.entities import db, auth
from project.application.entities.lessons.forms import CreateLessonForm, UpdateLessonForm, Visit... |
# Copyright 2019, Couchbase, 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... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2014 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole re... |
# -*- coding: utf-8 -*-
""""
Script which contains all class definition related to COUCHDB database
"""
from manage_db import *
from mongoengine import *
from utils import *
class Connection(ManageConnection):
"""
Manage connection to database
"""
def __init__(self,db_server):
self.db_ser... |
# Copyright 2012, 2013 by the Micromagnum authors.
#
# This file is part of MicroMagnum.
#
# MicroMagnum 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) a... |
import sublime
import sublime_plugin
from HTML.html_completions import HtmlTagCompletions
from .src import command_list, completions, events, utils, _plugin_loaded
for command in command_list:
globals()[command.__name__] = command
def plugin_loaded():
_plugin_loaded()
class CfmlEventListener(sublime_plugin... |
import random
from maze_builder.sewer import Choice
EXCLAMATIONS = Choice({
('What', '?.'): 1,
('Well', '!.'): 1,
('Hmm', '.!?'): 1,
('Yikes', '!'): 1,
('Nope', '.!?'): 1,
('Bleh', '.'): 1,
('Super', '!.'): 1,
('Geez', '!.'): 1,
('What on earth', '.?!'): 1,
('Gah', '.!'): 1,
... |
# coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import telestream_cloud_qc
from telestream_cl... |
#!/usr/bin/env python
# encoding: utf-8
"""
Texture.py
Created by Olivier Le Floch on 2009-03-17.
Program written by Thomas Deniau and Olivier Le Floch.
Copyright (c) 2009. All rights reserved.
Portions of this code have been adapted from pygarrayimage :
http://pypi.python.org/pypi/pygarrayimage/0.0.5
http://code... |
import herkulex
import time
import thread
import RPi.GPIO as gpio
import sensory as sn
herkulex.connect("/dev/ttyAMA0", 115200)
FR = herkulex.servo(0xfd)
FL = herkulex.servo(16)
BR = herkulex.servo(10)
BL = herkulex.servo(20)
DROP = herkulex.servo(50)
ALL = herkulex.servo(0xfe)
ALL.torque_on()
def align(to... |
import random
n = 10
print("strategy 1")
s1_points = 0
for i in range(100000):
num1 = random.randint(1,n)
num2 = num1
while num2==num1:
num2 = random.randint(1,n)
choice = random.randint(1,2)
if choice == 1:
if num1 > num2:
s1_points = s1_points +1
if choice... |
from mathml.pmathml.element import *
from mathml.pmathml.mtoken import MToken
import xml.sax.handler
class MathMLHandler(xml.sax.handler.ContentHandler):
class Elem(object):
__slots__ = ('parent', 'name', 'attributes', 'text', 'children')
def __init__(self, plotter):
self.plotter = plotter
self.current ... |
# https://www.tutorialspoint.com/python/python_variable_types.htm
# Python variables do not need explicit declaration to reserve memory space.
# The declaration happens automatically when you assign a value to a variable.
# The equal sign (=) is used to assign values to variables.
number = 5
weight = 58.9
name = 'pyth... |
# vim: set fileencoding=utf-8 sw=2 ts=2 et :
from __future__ import absolute_import
from systems.dsl import resource, transition
from systems.registry import get_registry
from systems.typesystem import AttrType, ResourceType, EResource
from systems.util.templates import build_and_render
class A2Mod(EResource):
"""... |
# -*- coding: utf-8 -*-
#
# 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
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# by TR
from sito import Events
from sito.data import IPOC
from obspy.core import UTCDateTime as UTC
import matplotlib.pyplot as plt
import logging
logging.basicConfig()
lat_Toc = -22.170
lon_Toc = -69.971
#events = Events.load(min_datetime="2007-01-01", max_datetime="20... |
import asyncio
from async_task_processor.primitives.base_task import BaseTask
class TarantoolTask(BaseTask):
conn_max_retries = None
conn_retries = None
conn_retry_countdown = None
ack = True # Using to prevent tarantool ack task
connection = None
data = None
queue_name = None
_task ... |
#!/usr/bin/env python3
# -*- 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 as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dist... |
import os
import unittest
from PyAnalysisTools.base import Utilities, InvalidInputError
# from pyfakefs.fake_filesystem_unittest import TestCase
cwd = os.path.dirname(__file__)
class TestUtilities(unittest.TestCase):
def setUp(self):
pass
# self.setUpPyfakefs()
def tearDown(self):
pa... |
# dockerpty.
#
# Copyright 2014 Chris Corbyn <chris@w3style.co.uk>
#
# 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 ap... |
from logging import warning
from math import ceil, log
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, bias_init_with_prob
from mmcv.ops import CornerPool, batched_nms
from mmcv.runner import BaseModule
from mmdet.core import multi_apply
from ..builder import HEADS, build_loss
from ..utils import ... |
################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.MatthieuBouthors.pfSense"
VERSION = "0.7.0"
AUTHOR = "Matthieu Bouthors"
LICENSE = "GPL v2"
NAMESPACE_PACKAGES = ['ZenPac... |
#!/usr/bin/env python
'''
This is the main executable file
that runs application in development server or wsgi mode
'''
import os
import sys
import web
from config import config
from urls import urls
from template import render
# Add current directory to path
sys.path.append(os.path.abspath(os.path.dirname(__file__)... |
from django.contrib import admin
from crate.web.packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI
from crate.web.packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI, ChangeLog
from crate.web.packages.models import DownloadDelta, ReadTheDocsPackageSlug
cl... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
# This file is part of GlusterFS.
#
# This file is licensed to you under your choice of the GNU Lesser
# General Public License, version 3 or any later version (LGPLv3 or
# later), or the GNU General Public License, version 2 (GPL... |
"""Models for the ``object_events`` app."""
from django.conf import settings
from django.contrib.auth.models import SiteProfileNotAvailable
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.signals import post_sa... |
import re
from django.apps import apps
from modularodm import Q as MQ
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import PermissionDenied, ValidationError, NotFound, MethodNotAllowed, NotAuthenticated
from rest_framework.response import Response
from rest_framewor... |
# Copyright (c) 2013 Rackspace, 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... |
#!/usr/bin/env python
#
# Copyright 2014 Institute for Theoretical Information Technology,
# RWTH Aachen University
# www.ti.rwth-aachen.de
#
# This 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 S... |
#!/usr/bin/env python
#
#
#
# $Header: /opt/cvs/python/packages/share1.5/AutoDockTools/Utilities24/prepare_gpf4.py,v 1.10.4.3 2009/03/23 21:54:28 rhuey Exp $
#
import string
import os.path
import glob
from MolKit import Read
from AutoDockTools.GridParameters import GridParameters, grid_parameter_list4
from AutoDockTo... |
import re
from os import urandom
from random import choice
from StringIO import StringIO
from string import ascii_letters, punctuation
from fabric.api import *
def _check_sudo():
with settings(warn_only=True):
result = sudo('pwd')
if result.failed:
print "Trying to install sudo. Must b... |
# Copyright (c) 2014 Carlos Valiente
#
# 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 limitation the rights
# to use, copy, modify, merge, publish, dis... |
# ==============================================================================
# Copyright 2019 - Philip Paquette
#
# NOTICE: 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 rest... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pyeds documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 17 23:46:06 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... |
'''
Copyright (c) 2013 Sekou Remy
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 limitation the rights
to use, copy, modify, merge, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Provides a kNN classier.
"""
import numpy as np
__author__ = ["Karen Ullrich"]
__email__ = "karen.ullrich@ofai.at"
__version__ = "Dec 2014"
def kNN(data, k):
'''
Performs kNN. Computes LOOCV accuracy.
k ...neighborhood size
D ...distance matr... |
# 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 sys, getopt
import io
import datetime
import requests
import json
apikey = sys.argv[1]
eventId = 9846
def pushToWilco(sample):
sample.pop('id', None)
sample.pop('paramId', None)
sample.pop('minScale', None)
sample.pop('maxScale', None)
sample.pop('minOK', None)
sample.pop('maxOK' , Non... |
import ocl
import math
from nc.nc import *
import tempfile
def STLSurfFromFile(filepath):
s = ocl.STLSurf()
ocl.STLReader(filepath, s)
return s
def cut_path(path, dcf, z1, mat_allowance, mm, units, rapid_to, incremental_rapid_to):
dcf.setPath(path)
dcf.setSampling(0.1) # FIXME: this should be adju... |
#!/usr/bin/env python
# Basic version handling
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
from tkinter.ttk import Combobox
from tkinter import messagebox
# Small utility that adds dot notation access to dictionary attributes
class dotdict(dict):
__getat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
bokzuyXMPPbot: Your dummy XMPP bot for Bokzuy.com
Copyright (C) 2012 Pablo Ruiz Múzquiz
See the file LICENSE for copying permission.
"""
import sys
import logging
import getpass
import json
import sleekxmpp
import requests
from optparse import OptionPar... |
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2020 CS GROUP - France
# License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
"""
Ce module contient la classe de base pour un serveur Vigilo: L{Server}.
"""
from __future__ import absolute_import
import os
import shutil
import glob
import re
from vigilo.common.... |
# coding: utf-8
from unittest import TestCase
import os
from grab import Grab, GrabMisuseError
from .util import (GRAB_TRANSPORT, TMP_DIR,
ignore_transport, only_transport)
from .tornado_util import SERVER
from grab.extension import register_extensions
class GrabSimpleTestCase(TestCase):
def s... |
#!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
'stat... |
#!/usr/bin/env python
"""Module for setting up statistical models"""
from __future__ import division
import numpy as np
import pymc as mc
import evac_flow_occupants_graphics as graphics
import data_evac
def linear():
"""
PyMC configuration with a linear model.
This is an example of the Bayes MCMC mode... |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Mads Chr. Olesen <mchro@cs.aau.dk>
#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 ... |
'''
Version: MRT v3.0
Type: module
Location: C:\MRT3.0\module
Author: Chintan Patel
Email: chintanlike@gmail.com
Bollinger Based Trading
'''
import pandas as pd
import numpy as np
#import math
import copy
import module.qsdateutil as du
import datetime as dt
import module.DataAccess as da
#import mo... |
# Copyright 2016 PerfKitBenchmarker 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import json
import string
import uuid
from collections import defaultdict
from copy import copy
from datetime import datetime
from django.apps import apps
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.functional import cached_property
from django.uti... |
# -*- coding: UTF-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... |
from django import template
from django.core.urlresolvers import reverse
register = template.Library()
"""
urlbuilder is a template tag that takes a TableRowURL object
and an object to get data from, like a Participant or Connector.
It builds a list of arguments from the args parameter as found in
TableRowURL. For e... |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... |
# progress.py show progress bars for some actions
#
# Copyright (C) 2010 Augie Fackler <durin42@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""show progress bars for some actions
This extension uses the progress in... |
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import six
from django.utils.crypto import get_random_string
from shuup.core.models impor... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from __future__ import division
import os
from functools import partial
import log as logger
import core
import gui_graphs
from PyQt4.QtGui import *
defaultParams = {
'Dataset' : 'Iris',
'Number of generations' : 100,
'Population size': 20,
'Max clusters' : 5,
... |
# -*- coding: utf-8 -*-
# #############################################################################
#
# Brazillian Carrier Correios Sigep WEB
# Copyright (C) 2015 KMEE (http://www.kmee.com.br)
# @author: Michell Stuttgart <michell.stuttgart@kmee.com.br>
#
# Sponsored by Europestar www.europestar.com.br
... |
import collections
def generate_mdp(resolution='CG', output_filename = 'alchembed.mdp', b = 2, steps = 1000, delta_lambda = 0.001, alpha = 0.1, dt = 0.01):
'''Produce custom alchembed / GROMACS .mdp file based on Phil F's github tutorial: https://github.com/philipwfowler/alchembed-tutorial
b can be either 1 or... |
''' Provides a Server which instantiates Application instances as clients connect
'''
from __future__ import absolute_import, print_function
import atexit
import logging
log = logging.getLogger(__name__)
import signal
import tornado
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tor... |
#! /usr/bin/env python
import vcsn
from test import *
# check complete algorithm
# ------------------------
def check(i, o):
if isinstance(i, str):
i = vcsn.automaton(i)
CHECK(not i.is_complete())
o = vcsn.automaton(o)
CHECK(o.is_complete())
CHECK_EQ(o, i.complete())
# Idempotence.
... |
import time
import httpretty
from remoteconfig import config, RemoteConfig
class TestRemoteConfig(object):
@httpretty.activate
def test_read(self):
config_url = 'http://test-remoteconfig.com/config.ini'
config_content = '[section]\n\nkey = value\n'
httpretty.register_uri(httpretty.G... |
# -*- coding: utf-8 -*-
import webapp2
import SMZDMscaner as sz
import FetchRSS as fr
import urllib2 as ureq
import Keywords
import json
import smtp2
# rss_url = 'http://feed.smzdm.com' # 优惠精选
# opener = ureq.build_opener()
# opener.addheaders = [('User-agent', 'Mozilla/5.0 (Macintosh Intel Mac OS X 10_10_2) \
# Appl... |
# -*- coding: utf-8 -*-
#
# Combined microbiome and host profiling in a mouse model of colitis suggests host immune activity drives changes in the gut micro-environment that influence both community structure and gene expression documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 20 13:43:... |
#!/usr/bin/python
from plot_settings import *
import numpy as np
import sip_formats.convert as SC
def plot_specs(ax, result_dir, specs):
# load data
f = np.loadtxt(result_dir + '/frequencies.dat')
response = np.loadtxt(result_dir + '/f.dat')
data = np.loadtxt(result_dir + '/data.dat')
data_format ... |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.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 of the License at
#
# http://www.apache.org/licenses/L... |
"""Check if the sender is a valid zenoss admin. For access control"""
from Jabber.Plugins import Plugin
from Jabber.ZenAdapter import ZenAdapter
from Jabber.Options import Options
from optparse import OptionError
import transaction
class SetJid(Plugin):
name = 'mapuser'
capabilities = ['setjid', 'mapuser', ... |
# coding=<utf-8>
from urllib import parse
import base64
import binascii
class Coder:
@staticmethod
def base64_decode(string):
try:
string = base64.b64decode(string)
string = string.decode('utf-8')
except ValueError:
string = ("ValueError: The input string c... |
#!/usr/bin/python3
import random
from tkinter import *
import threading
import queue
class Evolver( threading.Thread ):
""" this thread calculate next status
The result is maid available to the shower trough a queue """
def __init__(self, queue):
threading.Thread.__init__(self)
self.queue = queue
... |
# -*- coding: latin1 -*-
################################################################################################
import datetime, sys, time, json, os, os.path, shutil, time
reload(sys)
sys.setdefaultencoding('utf-8')
############################################################################################... |
import sys
import serial
import time
import os
import requests
import json
import pickle
import thread
#block_list = []
block_dict = dict()
machine_name = "lee_raspi"
if not os.path.exists("data"):
os.makedirs("data")
# remove old block
#if os.path.exists(os.path.join('data', "block.blk")):
# os.remove(os.pa... |
import json
import numpy as np
import pca
import process_object as po
from flask import Flask, request, jsonify, render_template, url_for
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/supernova')
def supernova():
return render_template('supernova.html'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2016, Mario Vilas
# 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... |
"""
Test shapefile stuff
"""
import sys
import os
if sys.version_info[0] == 3:
if sys.version_info[1] < 4:
from imp import reload # python < 3.4
else:
from importlib import reload
# python2 (reload in default namespace)
sys.path.insert(0, '..')
import shutil
import numpy as np
import flopy
fro... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
#######################################
# ### Raúl Caro Pastorino ### #
## ## ## ##
### # https://github.com/fryntiz/ # ###
## ## ## ##
# ### www.fryntiz.es ### #
###################################... |
"""
Demo implementation of the media player.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from homeassistant.components.media_player import (
MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE, SUPPO... |
"""
ORM definitions for mapping tracks data stored in PostgreSQL database
"""
from sqlalchemy import create_engine, Column, Integer, Float, String
from sqlalchemy.dialects.postgresql import INTERVAL, TIMESTAMP
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_ba... |
#! /usr/bin/python
# -*- coding: utf8 -*-
#
# Copyright (c) 2016 Linux Documentation Project
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import os
import time
import errno
import codecs
import hashlib
import subprocess
import functools
from functools import... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from RPLCD.gpio import CharLCD
from RPLCD import Alignment, CursorMode, ShiftMode
from RPLCD import cursor, cleared
from RPLCD import BacklightMode
try:
input = raw_input
except NameErr... |
# Copyright 2016 The TensorFlow 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
import json
import os
from django.core.urlresolvers import reverse
from seahub.test_utils import BaseTestCase
class DirTest(BaseTestCase):
def setUp(self):
self.login_as(self.user)
self.endpoint = reverse('DirView', args=[self.repo.id])
self.folder_name = os.path.basename(self.folder)
... |
'''
xls2txtISA.NANO.archive.py
***********************
The research leading to the development of this program has received funding from the European Union Seventh Framework Programme (FP7/2007-2013) under grant agreement number 309837 (NanoPUZZLES project).
http://wwww.nanopuzzles.eu
************************
######... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.conf.global_settings import PASSWORD_HASHERS
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
check_password, make_password, PBKDF2PasswordHasher, PBKDF2SHA1PasswordHasher,
... |
import sys, os, time
from threading import Thread
import requests
PSMOVEAPI_BUILD_DIR = os.environ.get('PSMOVEAPI_BUILD_DIR')
if PSMOVEAPI_BUILD_DIR:
sys.path.insert(0, os.environ['PSMOVEAPI_BUILD_DIR'])
import psmove
class Controller(object):
_active = False
_loop_thread = None
controller = No... |
# encoding: utf-8
"""Gherkin step implementations for chart axis features."""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from behave import given, then, when
from pptx import Presentation
from pptx.enum.chart import XL_AXIS_CROSSES, XL_CATEGORY_TYPE
from helpers impo... |
################################################################################
# Copyright (c) 2013, AMERICAN INSTITUTES FOR RESEARCH
# 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. Redistribut... |
import re
import sys
r = re.compile('([a-zA-Z0-9_*_ ]*\\[\\]) *')
r = re.compile('\\(([a-zA-Z0-9_*_ ]*)\\[\\]\\)')
def scan_stmt_starts(text):
starts = []
next_line_stmt = False
beginning_decl = False
nested_decls = set()
depth = 0
for n in range(len(text)):
c = text[n]
if c == '{':
if beginning_decl:
... |
# Import the rebound module
import rebound
# Set variables (defaults are G=1, t=0, dt=0.01)
k = 0.01720209895 # Gaussian constant
rebound.G = k*k # Gravitational constant
# Setup particles (data taken from NASA Horizons)
# This could also be easily read in from a file.
rebound.add( m=1.00000597682, x=-... |
# Copyright 2011 OpenStack Foundation
# 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 requ... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# l... |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 11 23:06:06 2016
@author: DIP
"""
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
def build_feature_matrix(documents, feature_type='frequency',
ngram_range=(1, 1), min_df=0.0, max_df=1.0):
feature_type = featur... |
import logging
log=logging.getLogger('xr_utils')
from collections import OrderedDict
import xarray as xr
import six
import numpy as np
def gradient(ds,varname,coord):
# rather than assume that consecutive data points are valid,
# fit a line to the data values per water column
daC,daz = xr.broadcast(ds[va... |
#! /usr/bin/env python
# Written by Vasaant S/O Krishnan Friday, 19 May 2017
# Run without arguments for instructions.
import sys
usrFile = sys.argv[1:]
if len(usrFile) == 0:
print ""
print "# Script to read in file of the CODA format and perform some basic"
print "# statistical computations. An index.tx... |
#!/usr/bin/python
#
# Perforce Defect Tracking Integration Project
# <http://www.ravenbrook.com/project/p4dti/>
#
# COVERAGE.PY -- COVERAGE TESTING
#
# Gareth Rees, Ravenbrook Limited, 2001-12-04
#
#
# 1. INTRODUCTION
#
# This module provides coverage testing for P... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-12 18:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... |
#-------------------------------------------------------------------------------
#
# Test the DockWindow.
#
# Written by: David C. Morrill
#
# Date: 10/20/2005
#
# (c) Copyright 2005 by Enthought, Inc.
#
#-------------------------------------------------------------------------------
#-----------------------------... |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class GetCharactersCharacterIdKillmailsRecent200Ok(object):
... |
# -*- coding: utf-8 -*-
"""This file contains the interface for analysis plugins."""
import abc
import calendar
import collections
import time
from plaso.analysis import definitions as analysis_definitions
from plaso.analysis import logger
from plaso.containers import events
from plaso.containers import reports
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.