src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# Contact: PySide Team (pyside@openbossa.org)
#
# This file is part of the examples of PySide: Python for Qt.
#
# You may use this file under the terms of the BSD license as follows:
#
# "Redistribution and... |
# Copyright 2014 TWO SIGMA OPEN SOURCE, 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 agre... |
"""turnex URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... |
from __pyjamas__ import JS
# a dictionary of module override names (platform-specific)
overrides = None # to be updated by app, on compile
# the remote path for loading modules
loadpath = None
stacktrace = None
appname = None
def setloadpath(lp):
global loadpath
loadpath = lp
def setappname(an):
glob... |
from __future__ import division, print_function, unicode_literals
class Simplifier(object):
_ignored = (
'action_marker',
'transition_marker',
)
_omit_tag = (
'action',
'list_replicator',
'range_replicator',
'transition',
)
_ignored_attrib... |
import json
import scrapy
from six.moves.urllib.parse import urlencode
import re
from locations.items import GeojsonPointItem
DAYS = {
'1': 'Mo', '2': 'Tu', '3': 'We', '4': 'Th',
'5': 'Fr', '6': 'Sa', '7': 'Su'
}
class JambaJuiceSpider(scrapy.Spider):
name = "jambajuice"
allowed_doma... |
from planar import Vec2
from typing import List
class UnknownPlayerIdException(Exception):
def __init__(self, player_id):
super().__init__("Unknown Player ID %d" % player_id)
class Game:
RANKED_GAME_ID = -1
def __init__(self, id_: int, tick: int, time_left: float, player_id: int, players: List[... |
# geom.py
#
# Copyright 2010 Alex Dumitrache <alex@cimr.pub.ro>
#
# 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 Licens... |
import gtk
import gtk.glade
import os
import pynotify
if os.path.dirname(__file__):
root_path=os.path.dirname(__file__)+"/"
else:
root_path=""
def init_notifier():
pynotify.init('pinna song notification')
notifier=pynotify.Notification('testtickles')
notifier.set_urgency(pynotify.URGENCY_LOW)
notifier.set... |
#!/usr/bin/env python3
"""This script downloads rss feeds and stores them in a maildir"""
# Copyright(C) 2015 Edgar Thier
#
# 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 t... |
# Copyright 2018 The TensorFlow 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 applicable law or agreed to ... |
# encoding: 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):
# Changing field 'Task.time_created'
db.alter_column('Listigain_task', 'time_created', self.gf('django... |
# coverage: ignore
"""
Implement the H2-experiment with OpenFermion and OpenFermion-Cirq
"""
# Numerical Imports
import numpy
import scipy
import os
from openfermion.ops import general_basis_change
from openfermioncirq.experiments.hfvqe.molecular_data.molecular_data_construction import (h6_linear_molecule,
... |
from collections import OrderedDict
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.forms.models import (
BaseInlineFormSet,
BaseModelFormSet,
ModelForm,
inlineformset_factory,
m... |
# Author: OMKAR PATHAK
# This program illustrates a simple example for encrypting/ decrypting your text
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
LETTERS = LETTERS.lower()
def encrypt(message, key):
''' This function lets you to encrypt your message based on a key '''
encrypted = ''
for chars in message:
... |
#!/usr/bin/python
'''
Study Common Emitter Characteristics of NPN transistors.
Saturation currents, and their dependence on base current
can be easily visualized.
'''
from __future__ import print_function
import time,sys,os
from SEEL_Apps.utilitiesClass import utilitiesClass
from templates import ui_transistor as t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
# from __future__ import unicode_literals
from lycheesync.lycheesyncer import LycheeSyncer
from lycheesync.update_scripts import inf_to_lychee_2_6_2
import logging.config
import click
import os
import sys
import pwd
import grp
from lychee... |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Python 3.x
#
# ppctl_cadnetwork v0.1
# * Displays information about the network setup to the PiFaceCAD
# * Requires:
# * ifconfig (for subnet mask)
# * grep (for subnet mask)
# * awk (for subnet mask)
# * ip (for default gw)
#
# Changelog
# * v0.1
# * Initial Release
#... |
# coding=utf-8
# Copyright 2021 The Trax 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 applicable law or a... |
import os
import pickle
from Tkinter import *
from PIL import ImageTk, Image
import tkMessageBox
import tkFileDialog
from ttk import Frame, Button, Label, Style
from random import randint
from PIL import Image
import mosaic
class MainFrame(Frame):
def __init__(self, parent):
Frame.__init__(self, par... |
from django.contrib.auth.tokens import default_token_generator
from django.core import mail
from django.templatetags.static import static
from django.urls import reverse
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode
from templated_email import send_templated_mail
fro... |
#!/usr/bin/env python3
import subprocess
import sys
import time
import json
POLARIS_PDNS_FILE = '/opt/polaris/bin/polaris-pdns'
def pretty_json(s):
d = json.loads(s)
return json.dumps(d, indent=4, separators=(',', ': '))
class TestPolarisPDNS:
def __init__(self, polaris_pdns_file):
sel... |
from decimal import Decimal
from unittest import TestCase
from graphql.lexer import GraphQLLexer
from graphql.exceptions import LexerError
class GraphQLLexerTest(TestCase):
lexer = GraphQLLexer()
def assert_output(self, lexer, expected):
actual = list(lexer)
len_actual = len(actual)
... |
import os
import shutil
import unittest
import pytest
from pyontutils import obo_io as oio
from .common import temp_path
obo_test_string = """format-version: 1.2
ontology: uberon/core
subsetdef: cumbo "CUMBO"
treat-xrefs-as-has-subclass: EV
import: http://purl.obolibrary.org/obo/uberon/chebi_import.owl
treat-xrefs-as-... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... |
import autograd.numpy as np
from autograd import value_and_grad
from autograd.scipy.special import gammaln
from scipy.optimize import minimize
from pybasicbayes.distributions import Regression
from pybasicbayes.util.text import progprint_xrange
class PoissonRegression(Regression):
"""
Poisson regression wit... |
# -*- coding: utf-8 -*-
# This file is part of gameoflife.
# Copyright 2015, wlof.
#
# 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 r... |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
# Based on NeoPixel library and strandtest example by Tony DiCola (tony@tonydicola.com)
# To be used with a 12x1 NeoPixel LED stripe.
# Place the LEDs in a circle an watch the time go by ...
# red = hours
# blue = minutes 1-5
# green = seconds
# (To run the program permanently and with autostart use systemd.)
import t... |
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
bwa_base_repository_name = 'bwa_base_repository_0100'
bwa_base_repository_description = "BWA Base"
bwa_base_repository_long_description = "BWA tool that depends on bwa 0.5.9, with a complex repository dependency pointing at package_bwa_0_5_9_0100"
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
freeseer - vga/presentation capture software
Copyright (C) 2013 Free and Open Source Software Learning Centre
http://fosslc.org
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 ... |
import sys
sys.path.append("backend/command/")
import time
from GPIOHandler import GPIOHandler
import RPi.GPIO as gpio
from utils import Parameter
from pprint import pprint
class MotionSensor(object):
"""docstring for MotionSensor"""
def __init__(self, config):
super(MotionSensor, self).__init__()
self.active =... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# =========================================================================
#
# Copyright © 2016 BIREME/PAHO/WHO
#
# This file is part of API-NLM.
#
# API-NLM is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pu... |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
# 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 may ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import os
import glob
import json
import matplotlib
import matplotlib.pyplot as plt
import nibabel as nib
import run00_common as comm
#############################################
if __name__ == '__main__':
wdir = '../../experimental_data/resize-256x256... |
"""Test for PauliX, PauliY, PauliZ"""
from sympy import I
import pytest
from qnet import (
PauliX, PauliY, PauliZ, LocalSigma, LocalSpace, LocalProjector, SpinSpace)
def test_fock_pauli_matrices():
"""Test correctness of Pauli matrices on a Fock space"""
assert PauliX(1) == LocalSigma(0, 1, hs=1) + Loca... |
# Copyright 2012 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... |
#!/usr/bin/env python3
"""Systemd init script for one or more vanilla Minecraft servers.
Usage:
minecraft [options] (start | stop | kill | restart | status | backup) [<world>...]
minecraft [options] (update | revert) [<world> [snapshot <snapshot-id> | <version>]]
minecraft [options] saves (on | off) [<world>...... |
# coding: utf-8
import pygame
import os
import sys
import gettext
from functions import *
from color import *
from pygame.locals import *
from game import Application
from Sound import Sound
from Text import Text
from Buttons import Button
from listOfCards import *
from Card import Card
pygame.init()
class Menu(pyga... |
import argparse
from ctypes import c_int
from datetime import datetime
def dga(date, magic, tlds):
# tlds = ["eu", "biz", "se", "info", "com", "net", "org", "ru", "in",
# "name"]
for i in range(10):
for tld in tlds:
seed_string = '.'.join([str(s) for s in
[ma... |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 31 12:27:52 2017
@author: Shashwat Pathak
"""
#==============================================================================
# Chapter 1: Import Modules
#==============================================================================
#Document Object
from bokeh.io import... |
#!/usr/bin/env python
"""cssutils - CSS Cascading Style Sheets library for Python
Copyright (C) 2004-2010 Christof Hoeke
cssutils 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 ver... |
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.txt.
from django.utils.encoding import force_unicode
from django.contrib.admin.models import LogEntry
from lizard_history import utils
OBJECT_ATTRIBUTE = '_lizard_history_hash'
REQUEST_ATTRIBUTE = 'lizard_history'
PRE_COPY_KEY = 'pre_copy'
INSTANCE_KEY = 'instance'... |
import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlsplit
It exposes the following attributes:
... |
import os
import Image
from time import time
from django.conf import settings
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext as _
from fo... |
# -*- coding: utf-8 -*-
"""A collection of util functions related to networkx
.. moduleauthor:: Jiwen Xin <kevinxin@scripps.edu>
"""
from collections import defaultdict
def load_res_to_networkx(_res, G, labels, id_mapping, output_id_types):
"""Load restructured API response into a networkx MultiDiGraph.
... |
#!/usr/bin/python
import human_curl as requests
import serial
import platform
import sys
import getopt
import socket
import json
import time
_WINDOWS = (platform.system() == 'Windows')
_AJAXURL = 'http://localhost/arduino/comet-router.php?action=%(action)s'
#_AJAXURL = 'http://themousepotatowebsite.co.za/experiments/... |
"""
Module that implements a retry decorator.
You can, for example, do this:
@retry(5)
def my_function():
...
And 'my_function', upon an exception, will be retried 4 more times until
a final exception is raised. 'retry' will wait a little bit longer after each
failure before retrying.
Very useful fo... |
# -*- coding: utf-8 -*-
from lxml import etree
from slugify import slugify
class Entry(object):
def __init__(self, title="", paragraphs=[], themes=[], **kwargs):
self.title = title
self.paragraphs = paragraphs
self.themes = themes
self.header_wrapper = kwargs.get("header_wrapper", ... |
from PySide import QtGui, QtCore
import sys, os
class ImageView(QtGui.QWidget):
def __init__(self,imagelist,parent = None):
super(ImageView,self).__init__(parent)
self.imagesize = None
self.mode = ''
self.imageList = imagelist[0]
self.index = imagelist[1]
self.title_label = QtGui.QLabel(self)
self.image... |
import os
import pytest
from mock import MagicMock
from datadog_checks.base.errors import CheckException
from datadog_checks.lighthouse import LighthouseCheck
HERE = os.path.dirname(os.path.abspath(__file__))
def mock_get_lighthouse_report(cmd, lgr, re=False):
if "https" not in cmd[1]:
return "", "erro... |
import time
import zmq
import threading
context = zmq.Context()
class PublishCallback(object):
def __init__(self, port, topic, message_callback):
self.port = port
self.topic = topic
self.message_callback = message_callback
self.socket = context.socket(zmq.PUB)... |
# This file is adapted from python code released by WellDone International
# under the terms of the LGPLv3. WellDone International's contact information is
# info@welldone.org
# http://welldone.org
#
# Modifications to this file from the original created at WellDone International
# are copyright Arch Systems Inc.
# C... |
#! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator().SetSeed(0)
try :
# We create a numerical math function */
myFunction = NumericalMathFunction("poutre")
dim = myFunction.getInputDimension()
# We create a normal distribution point of dimension dim
myDistribution = ... |
from django.db import IntegrityError
from django.urls import reverse
from fiscal.forms import MemberForm
from workshops.models import Member, MemberRole, Membership
from workshops.tests.base import TestBase
class MembershipTestMixin:
def setUpMembership(self, consortium: bool):
self.membership = Membersh... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 NOEL-BARON Léo
# 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
#... |
# Generated by Django 2.0.8 on 2018-09-28 11:23
from django.db import migrations, models
import django.db.models.deletion
import falmer.content.blocks
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0040_page_draft_title'),
... |
# -*- coding: utf-8 -*-
import unittest
from esculator import npv, escp
from openprocurement.api.utils import get_now
from openprocurement.tender.esco.tests.base import (
test_bids, test_features_tender_data,
BaseESCOContentWebTest, NBU_DISCOUNT_RATE
)
from openprocurement.tender.belowthreshold.tests.base impo... |
#!/usr/bin/env python
"""
This script is used to build "official" universal installers on Mac OS X.
It requires at least Mac OS X 10.5, Xcode 3, and the 10.4u SDK for
32-bit builds. 64-bit or four-way universal builds require at least
OS X 10.5 and the 10.5 SDK.
Please ensure that this script keeps working with Pytho... |
# -*- coding: utf-8 -*-
from pysped.xml_sped import *
from pysped.cte.leiaute import ESQUEMA_ATUAL_VERSAO_300 as ESQUEMA_ATUAL
import os
from .cte_300 import CTe
DIRNAME = os.path.dirname(__file__)
class ConsReciCTe(XMLNFe):
def __init__(self):
super(ConsReciCTe, self).__init__()
self.versao = ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... |
import pickle
from TM1py.Services import *
class TM1Service:
""" All features of TM1py are exposed through this service
Can be saved and restored from File, to avoid multiple authentication with TM1.
"""
def __init__(self, **kwargs):
self._tm1_rest = RESTService(**kwargs)
# inst... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import zipfile
import os
from lxml import etree
def get_the_book(start_dir):
"""
at first we have to take the book from directory, than we have to get some
info from it and than to put it to the right place.
So get_the_book recursevly gets each book from d... |
from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
from django.core.urlresolvers import reverse
from django.db.models import Sum
from communityfund.apps.home.templatetags.custom_tags import currency_filter
class DatedModel(models.Model):
created_on = models.Date... |
from datetime import timedelta
import htmls
from django import test
from django.conf import settings
from cradmin_legacy import cradmin_testhelpers
from cradmin_legacy import crapp
from cradmin_legacy.crinstance import reverse_cradmin_url
from model_bakery import baker
from devilry.apps.core.baker_recipes import ACTI... |
import time, types, os.path, re, sys
from PyQt4 import QtGui, QtCore
import acq4.pyqtgraph as pg
from acq4.pyqtgraph import SignalProxy, Point
import acq4.pyqtgraph.dockarea as dockarea
import acq4.util.ptime as ptime
from acq4.util.Mutex import Mutex
import numpy as np
import scipy.ndimage
from acq4.util.debug import ... |
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called.
The randomization include swing_offset, extension_offset of all legs that mimics
bent legs, desired_pitch from user input, battery voltage and motor damping.
"""
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(in... |
import datetime
import os.path
from sickchill import logger
from sickchill.helper.common import episode_num
from sickchill.oldbeard import common, db, helpers
MIN_DB_VERSION = 44
MAX_DB_VERSION = 44
class MainSanityCheck(db.DBSanityCheck):
def check(self):
self.fix_missing_table_indexes()
self.f... |
from tkinter import *
from tkinter import ttk
import func
class Icon:
def __init__(self, main, icon):
# Affiche les icon sur le tab
self.main = main
self.master = self.main.cache["CurrentTabID"]
self.icon = icon
if self.icon[1][1] == None:
self.icon_label()
else:
self.icon_image()
... |
"""
This file is part of pynadc
https://github.com/rmvanhees/pynadc
Routines to convert Sciamachy house-keeping data from raw counts
to physical units.
Copyright (c) 2018 SRON - Netherlands Institute for Space Research
All Rights Reserved
License: BSD-3-Clause
"""
from datetime import timedelta
import numpy as... |
import base64
import os
import time
import unittest
from mangopay.resources import Dispute, PayIn, DisputeDocument, SettlementTransfer, DisputeDocumentPage
from mangopay.utils import Money
from tests.test_base import BaseTestLive
# Comment following line to run DisputeTest
@unittest.skip('Skip dispute tests because ... |
from pathlib import Path
import aiohttp_jinja2
import jinja2
from aiohttp_jinja2 import APP_KEY as JINJA2_APP_KEY
from sn_agent_web.settings import WebSettings
THIS_DIR = Path(__file__).parent
BASE_DIR = THIS_DIR.parent
settings = WebSettings()
@jinja2.contextfilter
def reverse_url(context, name, **parts):
"""... |
from errbot import BotPlugin, botcmd, arg_botcmd, webhook
class Example(BotPlugin):
"""
Just an example
"""
def activate(self):
"""
Triggers on plugin activation
You should delete it if you're not using it to override any default behaviour
"""
super(Example, s... |
import urllib
import urllib2
import zope.app.appsetup.product
import zope.interface
import zope.component
import zeit.content.quiz.interfaces
class Updater(object):
zope.component.adapts(zeit.content.quiz.interfaces.IQuiz)
zope.interface.implements(zeit.content.quiz.interfaces.IQuizUpdater)
def __init_... |
from sympy import symbols
import pytest
from qnet.algebra.core.abstract_algebra import substitute
from qnet.algebra.core.exceptions import BasisNotSetError
from qnet.algebra.core.matrix_algebra import Matrix
from qnet.algebra.core.operator_algebra import (
IdentityOperator, II, OperatorSymbol)
from qnet.algebra.li... |
# Copyright 2016 Google LLC 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 ag... |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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 applica... |
from django.urls import path
from extras.views import ObjectChangeLogView, ImageAttachmentEditView
from ipam.views import ServiceCreateView
from secrets.views import secret_add
from . import views
from .models import (
Cable, ConsolePort, ConsoleServerPort, Device, DeviceRole, DeviceType, FrontPort, Interface, Man... |
#!/usr/bin/env pmpython
#
# Copyright (C) 2016 Sitaram Shelke.
#
# 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.
#
# Thi... |
import mimetypes
import os
import random
import time
from email import Charset, Encoders
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils import formatdate, getaddresses, formataddr
from django.conf im... |
# -*- coding: utf-8 -*-
"""
A VTK RenderWindowInteractor widget for wxPython.
Find wxPython info at http://wxPython.org
Created by Prabhu Ramachandran, April 2002
Based on wxVTKRenderWindow.py
Fixes and updates by Charl P. Botha 2003-2008
Updated to new wx namespace and some cleaning up by Andrea Gavana,
December 2... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... |
class AbstractDataType(object):
def __init__(self, name):
self.name = name
self.fixedSize = True
def parse(self, cursor):
"""Should return Value structure"""
raise NotImplementedError()
class Integer(AbstractDataType):
def __init__(self, binary_format, signed=True):
... |
# -*- coding: utf-8 -*-
###############################################################################
#
# RetrieveEntries
# Returns the feed for a user's diabetes measurements.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ... |
"""
Compute ICA object based on filtered and downsampled data.
Identify ECG and EOG artifacts using MLICA and compare
results to correlation & ctps analysis.
Apply ICA object to filtered and unfiltered data.
Ahmad Hasasneh, Nikolas Kampel, Praveen Sripad, N. Jon Shah, and Juergen Dammers
"Deep Learning Approach for A... |
#!/usr/bin/env python3
"""
Reports best match
* : best matching allele is not precise match
-nLV : best matching ST is n-locus variant
If an annotation column is provided (such as clonal complex) in the final column of the profiles
file, this annotation will be reported in column 2 of the output table.
Copyright... |
import logging
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, redirect
from django_cas.views import _service_url, _login_url
from models import CredentialsModel, Event
from... |
# 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 ... |
from django.db import models
from redactor.fields import RedactorField
from jsonfield import JSONField
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.text import slugify
import datetime
from os.path import basename, splitext
class Dataset(models.Model):
name = model... |
from sent_classification_module import *
from class_roc import Roc
if __name__ == '__main__':
sent = SentClassifiers('dataset-portuguese')
nv_roc = Roc()
svm_roc = Roc()
dt_roc = Roc()
rf_roc = Roc()
gd_roc = Roc()
rl_roc = Roc()
cm_roc = Roc()
fpr = []
tpr = []
auc = []
acuracias = []
nv_ac,_,nv_p,n... |
#!/usr/bin/env python
__copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu"
__license__ = "MIT"
import sys
import radical.pilot as rp
""" DESCRIPTION: Tutorial 3: Coupled Tasks
For every task A1 and B1 a C1 is started.
"""
# READ: The RADICAL-Pilot documentation:
# http://radicalpilot.readthedocs.... |
#!/usr/bin/python
##############################################################################################
# Copyright (C) 2014 Pier Luigi Ventre - (Consortium GARR and University of Rome "Tor Vergata")
# Copyright (C) 2014 Giuseppe Siracusano, Stefano Salsano - (CNIT and University of Rome "Tor Vergata")
# www.... |
"""
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
The solution set must not contain duplicate triplets.
"""
from typing import Dict, List
class Solution:
def threeSum(self, nums... |
#!/usr/bin/python
import sys, math
fill_paths = [
("23", "soldermask.path"), # soldermask front
# ("21", "silkscreen.path"),
# ("15", "copper_top.path"),
("15", "copper_top_x.path"),
("0", "copper_bottom.path"),
("0", "battery_holder.path"),
("22", "battery_holder_mask.path"),
("21", "ispmark.path"),
("0", "... |
#!/usr/bin/python
# Modify the solute geometry and charges in Gromacs .gro and .top files
# Use with 5 arguments:
# 1 (read): generic system file
# 2 (read): .top file
# 3 (read): .gro file
# 4 (write): modified .top file
# 5 (write): modified .gro file
import sys
import re
import math
import copy
#===========... |
# Prevent logging of Elasticsearch queries
import logging
import pytest
logging.disable(logging.CRITICAL)
import collections
from django.db.models import Q
from qcat.tests import TestCase
from questionnaire.models import Questionnaire
from questionnaire.utils import get_list_values
from search.search import advanc... |
#!/usr/bin/env python
"""
Config access class
@contact: Debian FTPMaster <ftpmaster@debian.org>
@copyright: 2008 Mark Hymers <mhy@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pub... |
def load_description():
"""Load description of a flow in a network
from a file named description.txt.
"""
with open('description.txt') as description:
return [line.strip() for line in description]
def parse_description(description):
"""Parse a description of a flow.
Parameters
---... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.