src stringlengths 721 1.04M |
|---|
from netlib.http import cookies
from netlib.tutils import raises
def test_read_token():
tokens = [
[("foo", 0), ("foo", 3)],
[("foo", 1), ("oo", 3)],
[(" foo", 1), ("foo", 4)],
[(" foo;", 1), ("foo", 4)],
[(" foo=", 1), ("foo", 4)],
[(" foo=bar", 1), ("foo", 4)],
... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import time
from lib.core.common import clearConsoleLine
from lib.core.common import dataToStdout
from lib.core.common import filterListValue
from lib.core.common import getF... |
#!/usr/bin/env python
import serial, time
class Arduino(object):
__OUTPUT_PINS = -1
def __init__(self, port, baudrate=9600):
self.serial = serial.Serial(port, baudrate)
def __str__(self):
return "Arduino is on port %s at %d baudrate" %(self.serial.port, self.serial.baudrate)
def ou... |
# Import the future
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
# Import standard library modules
import cgi
import datetime
import logging
import mimetypes
import os
import re
import shutil
# Import Qt modules
from PySide import QtCore, QtGui
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
from PyQt4.QtCore import QRect, Qt, QLine
from PyQt4.QtGui import QStyledItemDelegate, QStyleOptionViewItemV4
from PyQt4.QtGui import qApp, QStyle, QPen, QColor
class MultiRoleDelegate(QStyledItemDelegate):
def __init__(self, *args, **kwargs):
super(MultiRoleDelegate, self).__init__(*args, **kwargs)
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, Anima Istanbul
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import pymel.core as pm
class Curve(object):
def __init__(self, name_in, curve):
self._curveNode = p... |
#!/usr/bin/env python3
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load, get_out
module_name="src.file_extensions"
file_extensions = load(module_name, "file_extensions")
main = load(module_name, "main")
class FileExtensions(unittest.TestCase):
@points('p02-07.1... |
from ackward import (Class,
method,
Namespace,
Property,
TranslationUnit)
def tunit():
return TranslationUnit(
forward_declarations=[('ackward', 'logging', 'class Filter'),
('ackward', 'logging... |
from django.http import HttpResponse
from django.views.generic import View
import json
import urllib2
import config
import utils
import log_rotator
from Maintenance_utils.PeopleDataLoader import PeopleDataLoader
from Maintenance_utils.DueDataLoader import DueDataLoader
from Maintenance_utils.ApartmentAccountUtils imp... |
from django.db import models
from django.utils.timezone import now
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from filtered_contenttypes.fields import FilteredGenericForeignKey
from django_pgjson.fields import JsonBField
from .managers import ActionManager
from . impor... |
#!/usr/bin/env python2
from collections import defaultdict
from datetime import date, datetime
from email.Utils import formatdate
import frontmatter
import jinja2
import markdown
import os
import sys
import time
import yaml
@jinja2.contextfilter
def _render(context, data):
return env.from_string(data['source']).re... |
# Copyright 2012 OpenStack Foundation
#
# 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... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Photo.orientation'
db.add_column(u'blog_photo', 'orientation',
self.gf... |
"""
Copyright 2013 Steven Diamond
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... |
### Aconcagua - Python API ###
# The MIT License (MIT)
# Copyright (c) 2014 Emilio Daniel Gonzalez
# 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 li... |
# Copyright (C) 2015 Walter Bender
# Copyright (C) 2015 Sam Parkinson
#
# 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.
... |
import logging
from flask import (
request, session, g, redirect, url_for, abort, render_template,
flash, current_app, Blueprint
)
from flask_login import login_user, logout_user, current_user, login_required
from marvinbot.models import User
from marvinbot.forms import LoginForm
from marvinbot.utils.net import... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from blinker import Namespace
_signals = Namespace()
booking_created = _signals.signal('booking-create... |
"""Embed Sheet."""
import os.path
from colander import deferred
from deform.widget import TextAreaWidget
from pyramid.interfaces import IRequest
from pyramid.renderers import render
from zope.interface import Interface
from adhocracy_core.interfaces import API_ROUTE_NAME
from adhocracy_core.interfaces import ISheet
f... |
"""
This is adapt from evennia/evennia/players/players.py.
The licence of Evennia can be found in evennia/LICENSE.txt.
Player
The Player represents the game "account" and each login has only one
Player object. A Player is what chats on default channels but has no
other in-game-world existance. Rather the Player puppe... |
# Copyright 2018 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 RPi.GPIO as GPIO
import time
import os
import RPIO
SPICLK = 15
SPIMISO = 13
SPIMOSI = 11
SPICS = 7
IRRX = 15
IRTX = 11
def main():
init()
while True:
print(GPIO.input(IRRX))
## GPIO.output(IRTX, True)
## time.sleep(.000013)
## GPIO.output(IRTX, False)
## time.sleep... |
# methlab - A music library application
# Copyright (C) 2007 Ingmar K. Steen (iksteen@gmail.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at... |
import os
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Util import strxor
from django.conf import settings
from django.contrib.auth.hashers import make_password, check_password
from django.contrib.auth.models import Group, User
from django.contrib.contenttypes.fields import GenericForeign... |
#!/usr/bin/env python
#
# indices used:
#
# use goludalo
# db.<fs>.createIndex({"ts":1, "nid":1})
#
# use ludalo
# db.jobs.createIndex({"start":1})
# db.jobs.createIndex({"end":1})
# db.jobs.createIndex({"jobid":1})
import time,sys
# CONFIG
DBHOST="localhost"
SNAP = 5
PERFDB="goludalo"
JOBDB="ludalo"
JOBCO... |
#!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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
#
# ... |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... |
# coding=utf-8
"""
Behave BDD runner.
See _bdd_utils#get_path_by_env for information how to pass list of features here.
Each feature could be file, folder with feature files or folder with "features" subfolder
Other args are tag expressionsin format (--tags=.. --tags=..).
See https://pythonhosted.org/behave/behave.htm... |
#!/usr/bin/env python
class Check:
""" Will calculate and print the check result
"""
# the status codes
status_codes = {'OK': 0, 'WARNING': 1, 'CRITICAL': 2, 'UNKNOWN': 3}
# The same status sorted from worst to best
status_order = ['CRITICAL', 'WARNING', 'UNKNOWN', 'OK']
#The list of the ... |
"""
This module implements Bayes By Backprop -based sampler for NNs.
http://jmlr.org/proceedings/papers/v37/blundell15.pdf
"""
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation
from keras import backend as K
from keras.engine.topology import Layer
from sampler import Samp... |
"""
Django settings for lochlanandcatherinecom project.
Generated by 'django-admin startproject' using Django 1.8.4.
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/
""... |
# -*- coding: utf-8 -*-
# from django.http import HttpResponse
from django.http import HttpResponseNotFound
from django.conf import settings
from django.views.generic import ListView, View
from django.shortcuts import render
from stellenplan.models import *
from stellenplan.timeline import Timeline, TimelineGroups
f... |
#
# addAccessRule.py
# version 1.0
#
#
# This example demonstrates communication with Check Point Management server using Management API Library in Python.
# The demonstrated commands are:
#
# 1. login
# 2. adding an access rule to the top of Network layer
# 3. publishing the changes
#
# Logout command is called ... |
import logging
from openerp.http import request
import werkzeug
from openerp.addons.web import http
from openerp.addons.website.controllers.main import Website
logger = logging.getLogger(__name__)
class WebsiteMaintenance(Website):
def is_maintenance_mode(self):
is_on = ['on', '1', 'true', 'yes']
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Ejemplo: Teclado Virtual 1 (Api 2.0)
Libreria: pyTelegramBotAPI 2.0 [ok]
Python: 3.5.1
"""
from telebot import types # Importamos el API correspondiente para usar teclados virtuales
import telebot
import sys
TOKEN='AQUÍ EL NUMERO DE VUESTRO TOKEN' # Identificador ... |
# Copyright 2018-2021 The Matrix.org Foundation C.I.C.
#
# 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... |
import string,json,logging
from afs.model.Volume import Volume
from afs.model.ExtendedVolumeAttributes import ExtVolAttr
from afs.service.BaseService import BaseService, task_wrapper
from afs.service.VolumeServiceError import VolumeServiceError
from afs.util import misc
import afs
class VolumeService (BaseService):
... |
# coding: utf-8
from __future__ import with_statement
import os
import codecs
from operator import itemgetter
from datetime import datetime
from urlparse import urljoin
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from markdown import Markdown
import dateutil.parse... |
from datetime import datetime, timedelta
from flask import render_template, request
from flask.ext.login import login_required
from .views import frontend
from ybk.models import Exchange, Collection
from ybk.settings import get_conf
@frontend.route('/analysis/')
@login_required
def analysis():
nav = 'analysis'... |
#!/usr/bin/env python
import sys, tty, termios
import rospy
from fault_injector.msg import InjectFault
class Commands(object):
InjectFault = 1
RepairSensor = 2
RepairAllSensors = 3
Quit = 4
Unknown = 5
class FaultTypes(object):
Permanent = 1
Transient = 2
Unknown = 3
class FaultInjec... |
"""
This module provides all the functionality required to control a
Filter Flipper (MFF101, MFF102).
"""
from ctypes import byref, c_int64
from msl.equipment.resources import register
from msl.equipment.resources.utils import WORD, DWORD
from msl.equipment.resources.thorlabs.kinesis.motion_control import MotionContro... |
'''
Compares the rendererings of serialized SkPictures to expected images.
Launch with --help to see more information.
Copyright 2012 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
# common Python modules
import os
import optparse
import sys
import ... |
"""
December 12, 2014.
"""
import os
from sys import stderr
from collections import OrderedDict
from warnings import warn
from bisect import bisect_right as bisect
from cPickle import HIGHEST_PROTOCOL, d... |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... |
"""Views that know how to generate non-HTML documents.
To prevent confusion, we keep special views like this separate from the
template-driven bread-and-butter views over in views.py.
"""
import os
from decimal import Decimal
from django.http import Http404, HttpResponse
from pyPdf import PdfFileWriter, PdfFileReader... |
import numpy as np
import paraBEM
from paraBEM.pan2d import DirichletDoublet1Case2 as Case
from paraBEM.utils import check_path
from paraBEM.vtk_export import VtkWriter
# geometry
numpoints = 100
phi = np.linspace(0, 2 * np.pi, numpoints + 1)
x = np.cos(phi)[:-1]
y = np.sin(phi)[:-1]
xy = np.transpose(np.array([x, y])... |
# -*- coding: utf-8 -*-
# Copyright 2016-2020 Juca Crispim <juca@poraodojuca.net>
# This file is part of toxicbuild.
# toxicbuild 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 t... |
from . import action
from .parser import NOUN_TOKEN, HELD_TOKEN, MULTI_TOKEN, MULTIHELD_TOKEN, MULTIEXCEPT_TOKEN, MULTIINSIDE_TOKEN, TOPIC_TOKEN, CREATURE_TOKEN
from .debug import log
class Verb:
def __init__(self, grammar, verb_tokens):
self.grammar = grammar
self.verb_tokens = verb_tokens
... |
#!/usr/env/python3
import subprocess
import tinydb
from tinydb.storages import MemoryStorage
import tkinter as tk
## who knows if this is working or not?
def keypress(event):
if event.keysym == 'Escape':
root.destroy()
x = event.char
if x == "Ctrl-Z":
print('c z')
elif x == "Ctrl-X":
... |
def generate_header(src, dst, version_dst):
from compat import byte_to_str
with open(dst, 'w') as header:
header.write('/* THIS FILE IS GENERATED DO NOT EDIT */\n')
header.write('#ifndef CS_COMPRESSED_H\n')
header.write('#define CS_COMPRESSED_H\n\n')
header.write('#ifdef TOOLS_... |
#!/usr/bin/env python
#
# 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 require... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... |
from braces.views import GroupRequiredMixin
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render
from django.views.generic import DetailView
from django_filters.views import FilterV... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010 Guilherme Gondim and contributors
#
# This file is part of Django Hashtags.
#
# Django Hashtags is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README for copying condit... |
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the current di... |
"""SCons.Tool.swig
Tool-specific initialization for swig.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission ... |
r"""
Empirical Power Estimation (:mod:`skbio.stats.power`)
=====================================================
.. currentmodule:: skbio.stats.power
The purpose of this module is to provide empirical, post-hoc power estimation
of normally and non-normally distributed data. It also provides support to
subsample data ... |
from ..utils.functools import unidec, pluck, separate, pick, omit, truthful, avg
from .base import SimpleTestCase, IsOkTestCase
class UnidecTestCase(IsOkTestCase):
def test_default_behaviour(self):
self.assertOk(
unidec(lambda fn, a: fn(a) + 'k') \
(lambda a: a[1:])('oo'))
def... |
#!/usr/bin/env python
#
# Copyright 2007 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... |
#!/usr/bin/python
# Copyright 2019 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 ... |
from __future__ import absolute_import
import math
import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import _cpu
from chainer.backends import cuda
from chainer import configuration
from chainer import testing
from chainer import utils
from chainer import variable... |
import pickle
import pygame
from pygame.surface import Surface
from Menu.StartMenu.StartMenuItems.StartMenuItem import StartMenuItem
from Vector2 import Vector2
class SaveGameButton(StartMenuItem):
def __init__(self, offset: Vector2, image: Surface = None, hover: Surface = None, rect=None, newState=None):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# Copyright Kitware 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 t... |
import os
import datetime
import config
import pickle
from jinja2 import Environment, FileSystemLoader
pwd = os.path.dirname(os.path.abspath(__file__))
templates = Environment(loader=FileSystemLoader(os.path.join(pwd, 'templates')))
def createIndex(games,
platforms,
platformsOrder,
... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append('../../code')
import ld as LD
from hidespines import *
''' compares difference between Sn and moment equations as cell width --> 0 '''
if (len(sys.argv) > 1):
outfile = sys.argv[1]
else:
outfile = None
de... |
import time
import base64
import pytest
import responses
from oic.oic import AuthorizationResponse, AccessTokenResponse, TokenErrorResponse, OpenIDSchema, \
AuthorizationErrorResponse
from urllib.parse import parse_qsl, urlparse
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata... |
import re
from django.db import models
from shrubbery.utils.text import camel_case
def no_related_name(hidden=False):
no_related_name._next += 1
name = "_no_related_name_%%(class)s_%s" % (no_related_name._next)
if hidden:
name += '+'
return name
no_related_name._next = 0
def _remove_related_a... |
#! /usr/bin/env python
import csv
import os
import sys
from collections import defaultdict
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
# Load the spouse dictionary for distant supervision
spouses = defaultdict(lambda: None)
with open (BASE_DIR + "/../data/spouses.csv") as csvfile:
reader = csv.reader(cs... |
"""
Model fields for the gender app.
"""
from django.db import models
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from .constants import (GENDER_CHOICES,
GENDER_UNKNOWN)
class GenderFieldBase(models.CharField):
"""
This database model field ca... |
# 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, ... |
from numpy import (
# array handling
asarray, zeros, zeros_like, empty, newaxis, floating,
# array operations
dot, linspace, mean, std, arange, any,
# core math
pi, nan, sin, cos, log, sqrt, exp, sinh, isnan,
)
from pylab import (
# plotting
plot, figure, clf, subplot, semilogy, axis,
title, xlab... |
#!/usr/bin/python
# Copyright (c) Citrix Systems 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 l... |
# coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... |
import Tkinter as Tk
__all__ = ["vw_entry", "vw_info", "vw_plots", "vw_state"]
class vw_Base(Tk.Frame):
PIXELS_PER_X = 30
PIXELS_PER_Y = 40
def __init__(self, master, units_x=8, units_y=1):
Tk.Frame.__init__(self, master, padx=2, pady=2, bd=1)
width = units_x * self.PIXELS_PE... |
"""Define a real covariance function.
Author:
Ilias Bilionis
Date:
11/20/2012
"""
__all__ = ['RealCovarianceFunction']
import numpy as np
from . import CovarianceFunction
class RealCovarianceFunction(CovarianceFunction):
"""Define a real covariance function.
A real covariance function is a co... |
from game import falldown
import Q_network
from collections import deque
import random
import numpy as np
from keras.optimizers import Adam
import os.path
import pickle
#from PIL import Image as im
# initialize the neural network
if os.path.isfile("model.h5"):
model = Q_network.construct_model()
model.load_wei... |
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from keywords.forms import KeywordCreateForm
from keywords.models import Keyword
def keyword_list(request):
"""
This is a view that will show all the keywords.
This view should also show the number of datasets for each key... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-21 16:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('judge', '0050_merge'),
]
operations = [
migrations.AlterModelOptions(
... |
#! /usr/bin/env python
act2_spice = """\
* Lab 1, Act 2, BJT {bjt}, Part {part}, Plot Num {qn}
Vs Vi1 0 {wave}
Vcc Vi2 0 DC 5
RC1 Vi2 Vo1 {rc}
RB1 Vi1 Vb {rb}
Q1 Vo1 Vb 0 {bjt}
{extra}
* Model for 2N3904 NPN BJT (from Eval library in Pspice)
.model 2N3904 NPN(Is=6.734f Xti=3 Eg=1.11 Vaf=74.03 Bf=416.4 Ne... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from elections.models import Candidate
import uuid
from picklefield.fields import PickledObjectField
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from votai_utils.send_ma... |
import json
from os import path
from django import forms
from django.core.exceptions import ValidationError
from .widgets import AddressWidget
basepath = path.dirname(__file__)
filepath = path.abspath(path.join(basepath, "static", "addressfield.min.json"))
with open(filepath, encoding='utf8') as address_data:
c... |
#!/usr/bin/env python
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COP... |
# EFILTER Forensic Query Language
#
# Copyright 2015 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
#
# Un... |
'''
Created on Jul 9, 2012
Copyright © 2013
The Board of Trustees of The Leland Stanford Junior University.
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.apac... |
# Glumol - An adventure game creator
# Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour
# This file is part of Glumol.
# Glumol 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 th... |
# -*- coding: utf-8 -*-
#
# Copyright 2014-2021 BigML
#
# 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 ... |
# -*- coding: utf-8 -*-
import access
import util
@auth.requires_login()
def index():
"""Produces a list of the feedback obtained for a given venue,
or for all venues."""
venue_id = request.args(0)
if venue_id == 'all':
q = (db.submission.user == get_user_email())
else:
q = ((db.su... |
# *****************************************************************************
#
# Copyright (c) 2016, EPAM SYSTEMS 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.apac... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Fabio Falcinelli, Maximilian Hils
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
""" A setuptools based setup module.
Adapted from:
https://packaging.python.org/en/latest/distributing.html
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
import glob
here = path.abspath(path.dirname(__file__))
try:
long_description = open('README.md').read()
... |
#!/usr/bin/python
import os
import sys
import argparse
from log import Log
from chat import Trend
from chat import plot_trend as pl
from settings import *
def parse_args():
"""
Parsing shell command arguments, and override appropriate params
from setting module
:return: None
"""
parser = arg... |
import datetime
from django.db import models
# Create your models here.
class Job(models.Model):
jmojobid = models.CharField(db_column='jmoJobID', max_length=20)
jmojobassemblyid = models.IntegerField(db_column='jmoJobAssemblyID')
jmojoboperationid = models.IntegerField(db_column='jmoJobOperationID')
... |
import numpy as np
import pandas as pd
from catalyst.data.session_bars import SessionBarReader
class ContinuousFutureSessionBarReader(SessionBarReader):
def __init__(self, bar_reader, roll_finders):
self._bar_reader = bar_reader
self._roll_finders = roll_finders
def load_raw_arrays(self, col... |
"""
The MIT License (MIT)
Copyright (c) 2015 Robert Hodgen
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... |
# http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
'''SAC IO library for Python'''
from __future__ import absolute_import
import struct
import logging
import math
import numpy as num
from calendar import timegm
from time import gmtime
from pyrocko import trac... |
# control the motors of the robot
# also contains code for connecting to SpiNNaker
import nengo
spinnaker = False
import nengo_pushbot
import numpy as np
model = nengo.Network(label='pushbot')
with model:
input = nengo.Node([0,0], label='keyboard')
#a = nengo.Ensemble(500, dimensions=2, label='a')
if... |
#
# $LicenseInfo:firstyear=2010&license=mit$
#
# Copyright (c) 2010, Linden Research, 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 limitatio... |
import math
import logging
import warnings
from pymoku._instrument import to_reg_unsigned
from pymoku._instrument import from_reg_unsigned
from pymoku._instrument import to_reg_signed
from pymoku._instrument import from_reg_signed
from pymoku._instrument import deprecated
from pymoku._instrument import MokuInstrument... |
import pyopencl as cl # Import the OpenCL GPU computing API
print('\n' + '=' * 60 + '\nOpenCL Platforms and Devices')
for platform in cl.get_platforms(): # Print each platform on this computer
print('=' * 60)
print('Platform - Name: ' + platform.name)
print('Platform - Vendor: ' + platform.vendor)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.