src stringlengths 721 1.04M |
|---|
import time
import string
from datetime import datetime
import urllib2
import json
import os
from decimal import Decimal
import operator
import re
try:
Log
except NameError:
class Logger:
def __init__(self):
return
def Debug(self, s):
print(s)
def Info(se... |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... |
import warnings
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from nose.tools import raises
from menpo.testing import is_same_array
from menpo.image import BooleanImage, MaskedImage, Image
@raises(ValueError)
def test_create_1d_error():
Image(np.ones(1))
def test_image_n_elements():... |
from __future__ import unicode_literals
import hmac
import json
from django.db.models import Q
import requests
import uuid
from datetime import timedelta
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Group
from django.db import models
from d... |
# -*- encoding: utf-8 -*-
'''
HubbleStack Pulsar-to-Splunk returner
Deliver HubbleStack Pulsar event data into Splunk using the HTTP
event collector. Required config/pillar settings:
.. code-block:: yaml
hubblestack:
returner:
splunk:
- token: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the zapwallettxes functionality.
- start two pivxd nodes
- create two transactions on node 0 - on... |
import hashlib
from unittest import TestCase
from candybar.CandyBarCode39 import CandyBar39
class TestCandyBar39(TestCase):
def test_generate_barcode_with_contents(self):
self.fail()
@staticmethod
def sha2_check(bs):
m = hashlib.sha224()
for b in bs:
m.update(str(b).en... |
import argparse
import getpass
import cmd
import sys
from pprint import pprint
import textwrap
import rlcompleter
import readline
import logging
import ConfigParser
import urllib2
from texttable import Texttable
import suds
from labmanager import api
from labmanager import config
from labmanager.loghandler import Nul... |
# -*- coding: utf-8 -*-
# Copyright the original 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 ... |
# coding: utf-8
from django.contrib.auth.models import User
from django.db import models
from django.forms import ModelForm
from django.http import HttpResponse
NOMBRE_MAX_LENGTH = 100
class Jugador(models.Model):
user = models.OneToOneField(User, null=True, blank=True)
nombre = models.CharField(max_length =... |
# -*- coding: utf-8 -*-
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2017-2018 Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
from datetime import timedelta
from datetime import datetime
from collectio... |
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.conf import settings
from django.db.models.signals import post_delete
from django.contrib.auth.hashers import make_password
from main ... |
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
class BugzillaError(Exception):
"""
Error raised in the Bugzilla client code.
"""
@staticmethod
def get_bugzilla_error_string(exc):
"""
Helper to return the bugzilla instance er... |
#
# Copyright 2010-2012 Fabric Engine Inc. All rights reserved.
#
import os
import sys
import json
import ctypes
import collections
import atexit
import Queue
import signal
# FIXME Windows
if os.name == 'posix':
_fabric = ctypes.CDLL( os.path.dirname( __file__ ) + '/libFabricPython.so' )
else:
_fabric = ctypes.C... |
#!/usr/bin/pypy
import sys
import utilities
# This file will compute a vector representation
# of each document, based on the words in that document.
def readInput():
if len(sys.argv) < 4:
print "./doc2vec.py <cluster_file> <vector_file> <doc_file> <output_file>"
sys.exit()
clustFileName = s... |
# TODO: fix and check allcommand-line arguments
from util import debug_print
from pygame import image, Rect, Surface
from pygame.locals import KEYDOWN, KEYUP, USEREVENT
import pygame
import sys
import random
import json
import os
from collections import namedtuple
from functools import partial
import argparse
import ... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from .widget import Widget, CallbackDispatcher, register, widget_serialization
from .domwidget import DOMWidget
from .valuewidget import ValueWidget
from .trait_types import Color, Datetime, NumberFormat
from .widget... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com).
# @author Valentin CHEMIERE <valentin.chemiere@akretion.com>
#
# This program is free software: you can redistribute it and/or modi... |
import datetime
import os
import re
from behave import given, when, then, step_matcher
from dateutil import parser
from flask import json
from hamcrest import assert_that, is_, is_not, matches_regexp, has_length, equal_to, \
has_item, has_entries, has_entry
import pytz
from features.support.api_common import ensu... |
"""
Module containing class used for loading config files.
Copyright 2012 Red Hat, Inc.
Licensed under the GNU General Public License, version 2 as
published by the Free Software Foundation; see COPYING for details.
"""
__author__ = """
olichtne@redhat.com (Ondrej Lichtner)
"""
import os
import sys
import re
import ... |
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
import os
import re
import shutil
from lxml import etree, html
from pkg_resources import resource_string
from .parse import rst2xml, SlideMaker
from .position import position_slides
from .template import (
Template,
CSS_RESOURCE,
JS_RESOURCE,
JS_POSITION_HEADER,
JS_POSITION_BODY,
OTHER_RESOURCE... |
#coding=utf-8
"""
该配置文件在__init__.py中读取
"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
"""
:summary:
"""
SCRF_ENABLED = True # 激活跨站点请求伪造保护
# SECRET_KEY配置仅仅当CSRF激活的时候才需要,建立一个加密的令牌用于验证表单。
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
... |
#!/usr/bin/env python3
# Copyright 2019 The Kubeflow 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 applica... |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/bin/sh -
# Copyright 2011-2012 James McCauley
#
# This file is part of POX.
#
# POX 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.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'mr.S'
from kernel.module import Module
from kernel.server import app
from bottle import jinja2_template as template, request
from entities.s_chat import Chat
from entities.s_message import Message
from kernel.validator import Validator
from kernel.socket impor... |
"""
Classes for including text in a figure.
"""
from __future__ import division
import math
import numpy as np
from matplotlib import cbook
from matplotlib import rcParams
import artist
from artist import Artist
from cbook import is_string_like, maxdict
from font_manager import FontProperties
from patches import bbox... |
#! /usr/bin/env python3
import json
import sys
import os
from config import parse_config
from tools import replace_variables_in_string
def update_all_url_entries(data, **kwargs):
data['complete']['url'] = replace_variables_in_string(data['complete']['url'], **kwargs)
for language in data['languages']:
... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import shutil
import argparse
import logging
try:
sys.path.append('../color/')
from color import Color
except ImportError:
print 'Unable to find color module. Please ensure that color.py exists.'
sys.exit(2)
class Window... |
# -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;upnp
The following license agreement remains valid unless any additions or
changes a... |
# -*- coding: utf-8 -*-
#
# Copyright 2020 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 or ag... |
# Copyright 2009 Christopher Czyzewski
# This file is part of Project Mage.
#
# Project Mage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... |
import os
import time
import requests
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
import pytest
from splinter.driver.webdriver import chrome
class WebDriver(chrome.WebDriver):
django_live_server_url = ''
def _resolve_url(self, url, *args, **kwargs):
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Copyright 2017 Ronnasayd Machado <ronnasayd@hotmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.... |
# Copyright (C) 2008-2019 Vicent Mas. All rights reserved
#
# 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) a... |
import unittest
from kdt import *
from kdt import pyCombBLAS as pcb
class DiGraphTests(unittest.TestCase):
def initializeGraph(self, nvert, nedge, i, j, v=1):
"""
Initialize a graph with edge weights equal to one or the input value.
"""
iInd = ParVec(nedge)
jInd = ParVec(ned... |
# Certificator: Certificates that a person has the skills to pay the bills.
# Copyright (C) 2013 C Nelson <cnelsonsic@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foun... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from collections import defaultdict
from decorator import decorator
from operator import attrgetter
import importlib
import io
import logging
import os
import shutil
import tempfile
import zipfile
import re... |
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux platform implementation."""
from __future__ import division
import base64
import errno
import functools
import os
import ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" CMN binViewer
Croatian Meteor Network
Author: Denis Vida, 2014.
"""
version = 1.4
import os
import errno
import glob
import time
import wx
import tkFileDialog
import tkMessageBox
import threading
from shutil import copy2
from Tkinter import Tk, W, E, IntVar, BooleanVar,... |
import requests
class NetshHostsCrawler(object):
def __init__(self, opts):
self.method_get = requests.get
self.url = 'http://serve.netsh.org/pub/hosts.php'
self.params = {
'passcode': '16675',
'validate': '34b8c',
'gs': 'on',
'wk': 'on',
... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shuup Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from datetime import datetime, timedelta
import pytest
from django.utils im... |
####################################################################################################
#
# PySpice - A Spice Package for Python
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... |
# coding=utf-8
"""
The E-commerce Store Cart Lines endpoint API endpoint
Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/ecommerce/stores/carts/lines/
Schema: https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Carts/Lines/Instance.json
"""
from __future__ import unicode_literals
fro... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import time
from module.plugins.internal.Plugin import Plugin
from module.plugins.internal.utils import encode
class Captcha(Plugin):
__name__ = "Captcha"
__type__ = "captcha"
__version__ = "0.47"
__status__ = "stable"
... |
"""
Utility module of the EQcorrscan package to allow for different methods of \
stacking of seismic signal in one place.
:copyright:
EQcorrscan developers.
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import absolute_import
from __f... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
# Author: Marco Trevisan (Treviño)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundati... |
#!/usr/bin/env python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| ... |
# 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 ... |
from scene import *
import esper
##################################
## Here are a couple of Components
##################################
class Renderable(SpriteNode):
def __init__(self, **kwargs):
SpriteNode.__init__(self, **kwargs)
class Velocity:
def __init__(self, x=0.0, y=0.0):
... |
"""File dedicated to test ``dipy.core.rng`` module."""
from scipy.stats import chisquare
from dipy.core import rng
import numpy.testing as npt
def test_wichmann_hill2006():
n_generated = [rng.WichmannHill2006() for i in range(10000)]
# The chi-squared test statistic as result and The p-value of the test
... |
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
#PBS -l nodes=20:ppn=4:opteron4
#PBS -q verylong
#PBS -N amc_n100_conv1
#PBS -m ae
import os
from montecarlo import SurfaceMonteCarloData
from ase.cluster.cubic import FaceCenteredCubic
from ase.cluster import data
from asap3.MonteCarlo.Metropolis import Metropolis
from asap3.MonteCarlo.Moves import SurfaceMove
from as... |
# -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrap... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... |
# Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.
# Example 1:
# Input:
# 5
# / \
# 3 6
# / \ \
# 2 4 7
# Target = 9
# Output: True
# Example 2:
# Input:
# 5
# / \
# 3 6
# / \ \
# 2 ... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
#Importing helper class for RBPRM
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.corbaserver.rbprm.problem_solver import ProblemSolver
from hpp.gepetto import Viewer
#calling script darpa_hyq_path to compute root path
import slalom_hyq_pathKino0... |
from rest_framework import serializers as ser
from rest_framework import exceptions
from rest_framework.exceptions import ValidationError
from modularodm import Q
from modularodm.exceptions import ValidationValueError
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from website.... |
"""
Pyicoteo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY... |
# nnmware(c)2012-2020
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from nnmware.apps.address.models import AbstractLocation, MetaGeo
from nnmware.apps.business.models import AbstractSeller
from nnmware.apps.money.models import MoneyBase
... |
"""
Book: Building RESTful Python Web Services
Chapter 4: Throttling, Filtering, Testing and Deploying an API with Django
Author: Gaston C. Hillar - Twitter.com/gastonhillar
Publisher: Packt Publishing Ltd. - http://www.packtpub.com
"""
"""
Django settings for gamesapi project.
Generated by 'django-admin startproject'... |
# coding=utf-8
# Copyright 2017 The Tensor2Tensor 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... |
#!/usr/bin/env python
################################################################################
# GMTcsh2dos.py
# -------------------------------------------------
# Version: 0.1
# Author: Simon Dreutter
# License: GNU Generic Public License v3.0 / 2015
# -------------------------------------------------
##... |
#!/usr/bin/python3
# create_pim_data.py
import os
import sys
root_fldr = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'rawdata'))
sys.path.insert(1, root_fldr)
import generate
op_fldr = generate.dat_fldr + os.sep
words = generate.get_list_words()
places = generate.get_list_places()
# Dairy
custom_... |
#!/usr/bin/python
import sys
import time
import usb.core
import usb.util
from array import array
# Markham Thomas 2015
# This version is under heavy development
# You can add your test code to the bottom
# below the === end of module statement, or
# externally call the module
#
# ---- This version adds a python cla... |
"""
<Program>
test_onepercentmanyevents_to_onepercentmanyevents.py
<Purpose>
Test out the onepercentmanyevents_to_onepercentmanyevents transition state.
Test to see if the database is updated properly
<Authour>
Monzur Muhammad
monzum@cs.washington.edu
<Started>
Aug 21, 2009
"""
# The clearinghouse test... |
# Copyright 2014 Sardar Yumatov
#
# 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,... |
#!/usr/bin/python
#-*- coding:utf-8 -*-
import os
import sys
import json
# Make sure your gevent version is >= 1.0
import gevent
from gevent.wsgi import WSGIServer
from gevent.queue import Queue
from flask import Flask, Response
from flask import render_template, jsonify
from utils import ServerSentEvent
from api i... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 04 10:26:49 2018
@author: Mostafa Meliani <melimostafa@gmail.com>
Multi-Fidelity co-Kriging: recursive formulation with autoregressive model of
order 1 (AR1)
Adapted on January 2021 by Andres Lopez-Lopera to the new SMT version
"""
from copy import deepcopy
import numpy... |
# Copyright 2015 FUJITSU LIMITED
#
# 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 writ... |
from docker.errors import APIError as DockerAPIError
import logging
import uuid
log = logging.getLogger("harpoon.ship.network")
class NetworkManager(object):
def __init__(self, docker_api):
self.networks = {}
self.docker_api = docker_api
def register(self, conf, container_name):
if no... |
"""
Platform plugins to support the course experience.
This includes any locally defined CourseTools.
"""
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from course_tools import CourseTool
from courseware.courses import get_course_by_id
from views.course_reviews import... |
#!/usr/bin/env python
from __future__ import absolute_import
import binascii
import struct
from rsa import PublicKey, PrivateKey
from Crypto.Math.Numbers import Integer
def import_key(extern_key, passphrase=None):
"""Import an RSA key (public or private half), encoded in standard
form.
:Parameter extern_... |
from moto import mock_ses
from notifications_delivery.clients.email.aws_ses import (AwsSesClient, AwsSesClientException)
@mock_ses
def test_send_email(ses_client):
aws_ses_client = AwsSesClient(region='eu-west-1')
source = "source@notify.gov.uk"
to_address = "random@random.com"
subject = "Email subjec... |
# -*- coding: utf-8 -*-
"""学堂在线"""
import json
from bs4 import BeautifulSoup
from .utils import *
BASE_URL = 'http://www.xuetangx.com'
CANDY = Crawler()
CONFIG = {}
FILES = {}
def get_book(url):
"""获得所有的 PDF 电子书"""
nav_page = CANDY.get(url).text
shelves = set(re.findall(r'/courses/.+/pdfbook/\d/', nav_... |
try:
from Tkinter import *
import tkFont
except ImportError as err:
print ("error: %s. Tkinter library is required for using the GUI.") % err.message
sys.exit(1)
from Automata import *
dotFound = isInstalled("dot")
if dotFound:
try:
import Image, ImageTk
except ImportError as err:
... |
from asciimation import *
class ASCIIPlayback(object):
def __init__(self, asciimation, speed=1):
self.asciimation = asciimation
self.current_frame = 0
self.speed = speed
self._last_speed = speed
def next_frame(self):
if self.current_frame >= len(self.asciimation):
... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import wsme.types
class BadpennyJob(wsme.types.Base):
"""A job is a single occurrence of a task."... |
# predicator (c) 2014-2016, Chris Paxton
#
# based on some code taken from Robotiq's s_model_control package:
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Robotiq, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
#!/usr/bin/python3.3
__author__ = 'Hossein Noroozpour Thany Abady'
from hml.core.HDataEncoderM2 import EncM2
from sklearn.preprocessing import scale
from sklearn.preprocessing import normalize
from sklearn.decomposition import PCA
from sklearn.tree import DecisionTreeClassifier
from sklearn.svm import SVC
from sklearn.... |
import pymongo
from . import MongoDB
class DynamicConfig(MongoDB):
"""DynamicConfig class
"""
def __init__(self):
super(MongoDB, self).__init__()
self._collection = self._db['dynconfs']
self.dynconf_id = None
self.device = None
self.callid = None
def close(s... |
# Copyright (c) 2015.
# Philipp Wagner <bytefish[at]gmx[dot]de> and
# Florian Lier <flier[at]techfak.uni-bielefeld.de> and
# Norman Koester <nkoester[at]techfak.uni-bielefeld.de>
#
#
# Released to public domain under terms of the BSD Simplified license.
#
# Redistribution and use in source and binary forms, with or wit... |
"""
This is the HRL submodule for handling graphics devices and OpenGL. Graphics
devices in HRL instantiate the 'Graphics' abstract class, which defines the
common functions required for displaying greyscale images.
Image presentation in HRL can be understood as a multi step process as follows:
Bitmap (The image ... |
from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import os
import string
import sys
from collections import namedtuple
import six
import yaml
from cached_property import cached_property
from . import types
from .. import const
from ..const import COMPOSEF... |
#!/usr/bin/env python
"""
fasta_rename_by_pos.py
"""
from argparse import ArgumentParser
from mungolite.fasta import FastaFile
from srt.intervals import GenomeIntersector
def get_position(tokens):
for token in tokens:
if "Position" in token:
for delim in ["=", ":", "(", ")"]:
... |
import collections
import re
from rest_framework import serializers as ser
from website.util.sanitize import strip_html
from api.base.utils import absolute_reverse, waterbutler_url_for
def _rapply(d, func, *args, **kwargs):
"""Apply a function to all values in a dictionary, recursively. Handles lists and dicts c... |
from core.himesis import Himesis
class HEDataType(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HEDataType.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HEDataType, self).__init__(name='H... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
'''
Easy integration of DataFrame into pyqt framework
@author: Jev Kuznetsov
'''
# flake8: noqa
# GH9615
import warnings
warnings.warn("The pandas.sandbox.qtpandas module is deprecated and will be "
"removed in a future version. We refer users to the external package "
"here: https://git... |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
from re import compile, escape
from ..scraper import _BasicScraper, _ParserScraper
from ..helpers import bounceStarter, queryNamer, indirectStarter
from ..util import tagre
class ... |
import pytest
from askhome import Smarthome, Appliance
from askhome.exceptions import TargetOfflineError
@pytest.fixture
def discover_response():
return {
'header': {
'messageId': '6d6d6e14-8aee-473e-8c24-0d31ff9c17a2',
'name': 'DiscoverAppliancesResponse',
'namespace'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
# Lars Jørgen Solberg <supersolberg@gmail.com> 2014
#
from distutils.core import setup
import pkg_resources
setup(
name='Shellpic',
version='1.4.1',
author='Lars Jørgen Solberg',
author_email='supersolberg@gmail.com',
packages=['shellpic'],
scr... |
import logging
# ThreadRequestMiddleware isn't used here but is imported so
# commonware.log.ThreadRequestMiddleware works.
from commonware.log.middleware import get_remote_addr, get_username, ThreadRequestMiddleware # noqa
def getLogger(name=None):
"""
Wrap logging.getLogger to return a LoggerAdapter.
... |
from __future__ import division
from math import pi, sin, cos
from diff_drive.encoder import Encoder
from diff_drive.pose import Pose
class Odometry:
"""Keeps track of the current position and velocity of a
robot using differential drive.
"""
def __init__(self):
self.leftEncoder = Encoder()
... |
import os
import pdmt.config
import pdmt.utils.fileops
import pdmt.utils.subproc
'''
In order for this plugin to work you have to make your web folder
be writable by the user running pdmt.
You can do this with:
$ chmod g+w -R /var/www
$ chgrp $USER -R /var/www
'''
class Operation(object):
def __init__(self):
... |
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def plot_all_queries(species, queries, out_dir, out_format,
plot_species, ttot, **kwargs):
'''
Description:
This method creates plots for each species, plotting timeco... |
import os
from django.db import models
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
class RecordTracking(models.Model):
user = models.CharField(
null=True, blank=True,
max_length=64, verbose_name='Usuário')
time = models.DateTimeField(
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.