src stringlengths 721 1.04M |
|---|
from django import forms
from django.utils import six
from webcommands import utils as webcommands_utils
def field_for_option(option):
if option.type == 'string':
field = forms.CharField(label=str(option), max_length='255')
elif option.type == 'int':
field = forms.IntegerField(label=str(optio... |
from yaml.composer import Composer
from yaml.nodes import MappingNode
class AnsibleComposer(Composer):
def __init__(self):
self.__mapping_starts = []
super(Composer, self).__init__()
def compose_node(self, parent, index):
# the line number where the previous token has ended (plus empty ... |
import collections
import mpi4py
import numpy
import chainer.cuda
import chainer.utils
from chainermn.communicators import _communication_utility
from chainermn.communicators._communication_utility import chunked_bcast_obj
from chainermn.communicators import _memory_utility
from chainermn.communicators import communi... |
# dnfpayload.py
# DNF/rpm software payload management.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# ... |
from .network.TcpClient import TcpClient
from .network.Msg import Msg, MsgType
from .network.TcpServer import P_TcpServer, T_TcpServer, TcpServer
from .network.Reports import NetareaReport, MonitorReport
from .AVL import *
from time import sleep
from threading import Thread, RLock, Event
from multiprocessing import P... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
# Copyright 2016 Capital One Services, 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 agreed to in... |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import subprocess, os, sys, plistlib
from contextlib import contextmanager
fr... |
# Copyright 2015-2017 Capital One Services, 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 agreed ... |
class panel:
def 瞿志豪(Michel):
Natsdaq
def vicent:
b84 華楊、悠遊卡董事
def Bruce:
EMBA95 矽谷創業,開曼控股
def 司徒嘉恆(Seetoo):
b84,台大經濟->國外法律,創拓法律事務
新創集資等等,到IPO或是併購階段從後端來探討
web 1.0時代,大學畢業做網路媒體,失敗跟當時的法律因素也有關
def 詹德弘(Joseph):
b80, Giga media,華威、之初、台式架構/美式架構,大... |
# Copyright (c) 2013 Red Hat, 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 ... |
from flask import Blueprint
from flask import jsonify, request
import math
import logging
from flask_cors import cross_origin
def construct_project_view_blueprint(name, engine):
blueprint = Blueprint(name, __name__, url_prefix='/api')
@blueprint.route('/wmata/<nlihc_id>', methods=['GET'])
@cross_orig... |
# -*- coding: utf-8 -*-
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields
from openerp.tests import common
class TestCrmLeadToEventRegistration(common.TransactionCase):
def setUp(self):
super(TestCrmLeadToEventR... |
import json
import logging
import re
from api.api_samples.python_client.api_client import CloudBoltAPIClient
from api.api_samples.python_client.samples.api_helpers import wait_for_order_completion
from common.methods import set_progress
from servicecatalog.models import ServiceBlueprint
from utilities.exceptions impor... |
import json
from decimal import Decimal
from collections import Counter
from django.conf import settings
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from accounts.models import UserProfile
from shapes.models import Shape, Materi... |
import simuvex
from simuvex.s_type import SimTypeString, SimTypeLength, SimTypeInt
import logging
l = logging.getLogger("simuvex.procedures.libc.strncmp")
class strncmp(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, a_addr, b_addr, limit, a_len=None, b_len=None): #pylint:disable=argume... |
# plotter_mayavi.py
# Copyright (C) 2016 David Mehringer
#
# 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 versi... |
#!/usr/bin/env python2
import subprocess
import time
import string
import os
import re
def do(uuid,callback):
dir_path = os.path.dirname(os.path.realpath(__file__))
p = subprocess.Popen([dir_path + '/transcode.sh', uuid])
progress = 1
noprogress = 0
preprog = -1
print("Starting transcoding of ... |
from kraken.core.maths import Vec3, Quat, Xfo
from kraken.core.objects.rig import Rig
from kraken_components.generic.mainSrt_component import MainSrtComponentRig
from kraken_components.biped.head_component import HeadComponentRig
from kraken_components.biped.clavicle_component import ClavicleComponentGuide, ClavicleC... |
#### Json Map ###
# beta
# @author Rolf Chen
# This module will "transform" one JSON object to another through the use of JSON Mapper Schema
# @license
#
# MIT License
#
# Copyright (c) 2016 Rolf Chen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docume... |
from collections import defaultdict
from typing import Dict, List, Set
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models, transact... |
#!/usr/bin/env python
import argparse
import numpy as np
import numpy.ma as ma
import h5py
import qusp
import matplotlib.pyplot as plt
import scipy.interpolate
import fitsio
class DeltaLOS(object):
def __init__(self, thing_id):
path = '/data/lya/deltas/delta-%d.fits' % thing_id
hdulist = fitsio.... |
# -*- encoding: utf-8 -*-
from shapely.wkt import loads as wkt_loads
import dsl
from . import FixtureTest
class RestAreaServices(FixtureTest):
def test_rest_area_node(self):
self.generate_fixtures(dsl.way(159773030, wkt_loads('POINT (-76.73912905210828 40.99079246918038)'), {u'source': u'openstreetmap.org... |
from selenium import webdriver
from pandas import *
import csv
import time
import sys
import getopt
# load test data
inputfile = str(sys.argv[1])
with open(inputfile, 'rb') as f:
#with open('web_test_cat.csv', 'rb') as f:
#with open('web_test_src.csv', 'rb') as f:
#with open('web_test_funnel.csv', 'rb') as f:
#with o... |
# 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 applicabl... |
import sys
import vaex
import vaex.ui.qt as dialogs
from vaex.ui.qt import *
import logging
from vaex.ui.icons import iconfile
logger = logging.getLogger("vaex.ui.variables")
class VariablesTableModel(QtCore.QAbstractTableModel):
def __init__(self, dataset, parent=None, *args):
"""
:type dataset:... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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... |
from setuptools import setup, find_packages
from emitcalc import __version__
test_requirements = []
with open('requirements-test.txt') as f:
test_requirements = [r for r in f.read().splitlines()]
setup(
name='emitcalc',
version=__version__,
license='GPLv3+',
author='Joel Dubowy',
author_email... |
"""Search (Chapters 3-4)
The way to use this code is to subclass Problem to create a class of problems,
then create problem instances and solve them with calls to the various search
functions."""
from utils import (
is_in, argmin, argmax, argmax_random_tie, probability,
weighted_sample_with_replacement, memoi... |
# Copyright 2021 The Magenta 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 in ... |
from setuptools import setup, find_packages
__title__ = 'footynews'
__author__ = 'Usman Ehtesham Gul'
__email__ = 'uehtesham90@gmail.com'
__license__ = 'Apache v2.0'
__version__ = '0.0.1'
__url__ = 'https://github.com/footynews/fn_backend'
with open('requirements.txt') as f:
requires = f.read().splitlines()
with... |
"""Snippets from linear algebra class"""
from numpy import dot, array, sqrt, matrix
# TODO: many of these may be part of numpy now. Check and cull
def proj(M,x):
"""
>>> A = array([[1, 2], [2, 1]])
>>> x = array([[1], [2]])
>>> proj(A, x)
matrix([[ 1.],
[ 2.]])
"""
# proj_w(x... |
# Copyright (c) Corporation for National Research Initiatives
"""Usage: jythonc [options] [module]*
where options include:
--ignore-warning
-i
silence the jythonc deprecation warning
--package package
-p package
put all compiled code into the named Java package
--jar jarfile
... |
import re
import six
try:
from PIL import Image, ImageChops, ImageFilter
except ImportError:
import Image
import ImageChops
import ImageFilter
from easy_thumbnails import utils
def _compare_entropy(start_slice, end_slice, slice, difference):
"""
Calculate the entropy of two slices (from the s... |
# (C) British Crown Copyright 2010 - 2018, Met Office
#
# This file is part of Iris.
#
# Iris 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) any l... |
from django import forms
from django.core.exceptions import PermissionDenied
from django.db import router
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.template.response import TemplateResponse
# from django.utils.datastructures import SortedDict
from collecti... |
import maya.cmds as cmds
from P4 import P4,P4Exception
import os, cPickle
from functools import partial
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
def p4_getLatestRevision(fileName, *args):
fileArg = fileName
#try to connect
p4 = P4()
try:
... |
"""
Copyright 2014 VoterChat
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
distr... |
from __future__ import absolute_import, print_function, division
import logging
import numpy
from six.moves import xrange
import theano
from theano.tensor import as_tensor_variable
from theano.gof import Op, Apply
from theano.gradient import DisconnectedType
from theano.tensor import basic as tensor
logger = loggin... |
# encoding: utf-8
# module gtk.gdk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/pynotify/_pynotify.so
# by generator 1.135
# no doc
# imports
from exceptions import Warning
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
import pango as __pango
import pangocairo as __p... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2012,2013,2015,2016,2017,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... |
# -*- coding: utf-8 -*-
import os, sys, xbmc, xbmcaddon
DISABLE_PATH = os.path.join(xbmc.translatePath('special://profile').decode('utf-8'), 'addon_data', 'service.xbmc.tts', 'DISABLED')
ENABLE_PATH = os.path.join(xbmc.translatePath('special://profile').decode('utf-8'), 'addon_data', 'service.xbmc.tts', 'ENABLED')
de... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
"""Implements basics of Capa, including class CapaModule."""
import json
import logging
import sys
import re
from lxml import etree
from pkg_resources import resource_string
import dogstats_wrapper as dog_stats_api
from .capa_base import CapaMixin, CapaFields, ComplexEncoder
from capa import responsetypes
from .progr... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-fsm-log',
version='1.7.0dev',
description='Logging for django-fsm',
author='Gizmag',
author_email='tech@gizmag.com',
url='https://github.com/gizmag/django-fsm-log',
license='MIT',
packages=find_packag... |
class Solution(object):
def coinChange(self, coins, amount):
"""
:type coins: List[int]
:type amount: int
:rtype: int
"""
if amount < 1:
return 0
return self.helper(coins, amount, [0] * amount)
def helper(self, coins, target, cache):
#... |
from cStringIO import StringIO
import calendar
import functools
import logging
import re
import time
from urllib import urlencode
import urllib2
from xml.etree import ElementTree
_log = logging.getLogger('evelink.api')
try:
import requests
_has_requests = True
except ImportError:
_log.info('`requests` not... |
#!/usr/bin/python
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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 ... |
# Copyright 2020 The Cirq Developers
#
# 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 ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 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/LIC... |
# -*- coding: utf-8 -*-
import unicodedata
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from haystack.forms import SearchForm
from haystack.inputs import AltParser
from haystack.inputs import AutoQuery
from colab.super_archives.models import Mailin... |
# -*- coding: utf-8 -*-
from django.conf.urls import re_path, include
from ..core.conf import settings
import spirit.comment.bookmark.urls
import spirit.comment.flag.urls
import spirit.comment.history.urls
import spirit.comment.like.urls
import spirit.comment.poll.urls
from . import views
app_name = 'comment'
urlpa... |
__package__ = 'archivebox.extractors'
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Optional
import json
from ..index.schema import Link, ArchiveResult, ArchiveError
from ..system import run, atomic_write
from ..util import (
enforce_types,
download_url,
is_static_fi... |
import pandas as pd
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout,
QVBoxLayout, QPushButton, QSlider,
QComboBox)
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.bac... |
from django.utils import timezone
from django.test.testcases import TransactionTestCase
from getresults_patient.tests.factories import PatientFactory
from getresults_patient.models import Patient
from ..views import ReceiveView
from ..forms import BatchItemForm
from ..models import Batch, BatchItem
class TestBatch... |
import datetime
from django.conf import settings
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from ...models import CorporateMember
from home.tasks import mail_task
class Command(BaseCommand):
def handle(self, *args, **options):
thirty_days_fro... |
# -*- coding: utf-8 -*-
from pCore.module.queue.messages.Message import Message
__author__ = u"Tomas Holub"
__email__ = u"tomas.holub@olc.cz"
class Queue(object):
u""" Class implementing FIFO principle """
def __init__(self, pDriver):
u""" Class constructor """
self.__aDriver = pDriver
... |
import copy
import datetime as dt
from django.utils import timezone
from framework.auth import Auth
from osf.utils import permissions
from osf.models import RegistrationSchema
from tests.base import OsfTestCase
from osf_tests.factories import AuthUserFactory, ProjectFactory, DraftRegistrationFactory
class Registra... |
import click
import subprocess
import os
import logging
from .builder import Builder
logger = logging.getLogger(__name__)
@click.group()
def main():
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s [%(levelname)s] %(name)s: %(message)s',
)
@main.command()
@click.option(
'-... |
from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from modeltranslation.admin import TranslationAdmin
from pagedown.widgets import AdminPagedownWidget
f... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 The HyperSpyUI developers
#
# This file is part of HyperSpyUI.
#
# HyperSpyUI 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
#... |
# coding: utf-8
#
# softmax.py
#
# Author: Huang Anbu
# Date: 2017.3
#
# Description: Implementation of softmax classification
#
# Copyright©2017. All Rights Reserved.
# ===============================================================================================
from __future__ import print_function, division
fro... |
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
MultiIndex,
Series,
)
import pandas._testing as tm
from pandas.core.indexing import IndexingError
# ----------------------------------------------------------------------------
# test indexing of Series with multi-level Index
# --... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... |
from sys import exc_info, argv
import pandas as pd
from pybtex.database.input import bibtex as bibtex_in
import textwrap
bibparser = bibtex_in.Parser()
d=[]
for bibfile in argv[1:]:
#bib=bibparser.parse_file(bibfile)
with open(bibfile) as f:
raw = f.read()
f.close()
bib=bibparser.parse_str... |
"""Snippets for translation
This module holds various snippets, to be used by translator
unittests.
We define argument types as default arguments to the snippet
functions.
"""
numtype = (int, float)
anytype = (int, float, str)
seqtype = (list, tuple)
def if_then_else(cond=anytype, x=anytype, y=anytype):
if cond... |
###################################################################################
## MODULE : spell.utils.getch
## DATE : Mar 18, 2011
## PROJECT : SPELL
## DESCRIPTION: Getchar implementation
## --------------------------------------------------------------------------------
##
## Copyright (C) 2008, ... |
#!/usr/bin/env python
# GSDView - Geo-Spatial Data Viewer
# Copyright (C) 2008-2021 Antonio Valentino <antonio.valentino@tiscali.it>
#
# This module is free software you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation either versio... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
#!/usr/bin/python3
# Updates the configuration in the json to the database
# Can run without argument for using standard file
# Or specify the file by passing it as a argument
import json
import sqlite3
import sys
if len(sys.argv) > 1:
if str(sys.argv[1]) == 'ASPire':
filename = 'config_ASPire.json'
... |
from rhizome.api.resources.base_model import BaseModelResource
from rhizome.models.document_models import SourceSubmission
class SourceSubmissionResource(BaseModelResource):
'''
**GET Request** Returns all SourceSubmissions unless an optional parameter is specified
- *Optional Parameters:*
... |
from util import http_util
import webapp2
import webapp2_extras
from webapp2_extras import sessions
webapp2_extras.sessions.default_config['secret_key'] = 'asdfasdf'
webapp2_extras.sessions.default_config['cookie_name'] = 'underdogs'
APP_JSON = "application/json"
class RequestHandlerMixin(object):
def write(self... |
##########################################################################
#
# 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 the following conditions are
# met:
#
# * Redistribu... |
from os.path import expanduser
import csv
import pandas as pd
import matplotlib.pyplot as plt
from oemof.core import energy_system as es
from oemof.solph.predefined_objectives import minimize_cost
from oemof.outputlib import to_pandas as tpd
from oemof import db
import helper_BBB as hlsb
def create_es(solver, timeste... |
import sys
from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QMenu, QAction
from PyQt5.QtGui import QGuiApplication, QIcon
from paramiko import SSHClient
from scp import SCPClient
import paramiko
from datetime import date
import time
import configparser
class Screenshoter:
def __init__(self):
conf... |
###########################################################
#
# Copyright (c) 2009, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
# 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... |
"""
Native iFlow Tools (NiFTy) package
This package provides tools to be used in iFlow.
You are welcome to add your functions native to iFlow to the package. Please respect the following guidelines:
- Make your tool as general as possible. Particularly allow as much generality in the number and order of dimensions.
- ... |
#!/usr/bin/python3
import random as r
def pick_random(value):
return value[r.randint(0, len(value)-1)]
abbreviation = ["TCP", "HTTP", "SDD", "RAM", "GB",
"CSS", "SSL", "AGP", "SQL", "FTP",
"PCI", "AI", "ADP", "RSS", "XML",
"EXE", "COM", "HDD", "THX", "SMTP",
"SMS",... |
""" Quickstart guide 3: Timing"""
from oort import *
control_rate(15000)
print_off()
# Oort offers an alternative, wait-based approach to timing inspired by,
# but departing from languages like ChucK and Common Music. Oort's schedule
# module uses a system of threads and locks which reorganizes the operation
# of... |
"""
LEGO PowerFunctions I2C Server
File: main.py
Author: Xander Maas <xander@xjmaas.nl>
Date: 10 oct 2014
LICENSE INFO:
AS FOR NOW THIS SOFTWARE IS NOT TO BE PUBLISHED WITHOUT MY EXPLICIT
WRITTEN PERMISSION ONLY.
Copyright (c) Xander Maas, 2014
This programm will create a tcp b... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
from time import sleep
from PySide2.QtGui import QStandardItemModel, QStandardItem
from PySide2.QtCore import Slot, QDir, QAbstractListModel, Qt, QFile
from PySide2.QtWidgets import QWidget, QApplication, QHBoxLayout, QDialog, QListView, QListWidget, QPu... |
# File: genetic.py
# Del capítulo 3 de _Algoritmos Genéticos con Python_
#
# Author: Clinton Sheppard <fluentcoder@gmail.com>
# Copyright (c) 2017 Clinton Sheppard
#
# 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... |
#
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 -*-
"""
Created on Wed Jan 20 16:08:56 2016
@author: Thibault
"""
import pandas as pd
import numpy as np
# Loading the data
data_dir = '../data'
# training and validation sets
train_file = data_dir + '/blocking1114.csv'
# Opening the blocking data
TrainFile = pd.read_csv(train_file, header=None... |
# 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... |
"""
@name: PyHouse/src/Modules/Computer/Web/_test/test_web_utils.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com>
@copyright: (c) 2014-2017 by D. Brian Kimmel
@license: MIT License
@note: Created on Jun 29, 2013
@Summary: Test web utilities module
Passed all 7 tests - DBK - 2017-01-12
... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
#!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
# Work around some new quirk in Gecko that causes this test to fail if
# run via the test harness rather than manually.
sequence.append(KeyComboAction("<Con... |
# encoding.py
# Copyright (C) 2011-2014 Andrew Svetlov
# andrew.svetlov@gmail.com
#
# This module is part of BloggerTool and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
from docutils import core
from docutils.writers import html4css1
... |
import tensorflow as tf
import numpy as np
import scipy.misc
from tensorboardX.src.summary_pb2 import Summary
from tensorboardX import SummaryWriter
try:
from StringIO import StringIO
except ImportError:
from io import BytesIO
class Logger(object):
def __init__(self, log_dir):
'''
Create... |
"""All tests for URLs."""
from django.test import TestCase
from django.core.urlresolvers import reverse, resolve
from ..views import (
IndexPage,
AllDataImportsPage,
AddDataImportPage,
SingleDataImportPage,
DataImportCreateCategoryPage,
DataImportAssignFieldsPage,
DataImportAllDataFeatures... |
#!/usr/bin/env python
# encoding: utf-8
import six
import sys
import pfp
import pfp.utils
import unittest
import contextlib
class PfpTestMeta(type):
def __init__(cls, name, bases, dict_):
for attr_name, attr_val in six.iteritems(dict_):
if not attr_name.startswith("test_"):
co... |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
import os
import sys
import argparse
sys.path.insert(0, os.getcwd())
from barbican.model.migration import commands
from barbican.openstack.common import log
class DatabaseManager:
"""
Builds and executes a CLI parser to manage the Barbican d... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio 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) a... |
# Copyright (c) 2014 Katsuya Noguchi
#
# 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... |
# -*- coding: utf-8 -*-
from django.test import TestCase
from osb.billing.models import Accounts, Services
# from osb.billing.Services.AccountsService import AccountsService
from osb.billing.Services.AccountsService import AccountsService
from osb.billing.Services.ServiceService import *
class AccountsServiceTest(Tes... |
#!/usr/bin/env python3
# simple script to get a vehicle fingerprint.
# Instructions:
# - connect to a Panda
# - run selfdrive/boardd/boardd
# - launching this script
# - turn on the car in STOCK MODE (set giraffe switches properly).
# Note: it's very important that the car is in stock mode, in order to collect a co... |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... |
"""Mass apk helper functions module."""
import functools
import logging
import os
import platform
from enum import Enum, unique
from timeit import default_timer as timer
__all__ = ["Platform", "detect_platform", "human_time", "elapsed_time", "MB"]
log = logging.getLogger(__name__)
MB = 1024 * 1024
@unique
class P... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.