src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import shutil
import re
import glob
import socket
from subprocess import call, check_output
from collections import OrderedDict
from optparse import OptionParser
# Command line parsing
parser = OptionParser()
parser.add_option('-j', '--... |
from sop_embed.da import DenoisingAutoencoder
from sop_embed.tools import NonLinearity
from sop_embed.tools import CostType
from sop_embed.tools import ModelMLP
from sop_embed.tools import train_one_epoch_chuncks
from sop_embed.tools import theano_fns
from sop_embed.tools import sharedX_value
from sop_embed.tools impor... |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from error import TweepError
from utils import parse_datetime, parse_html_value, parse_a_href, parse_search_datetime, unescape_html
class ResultSet(list):
"""A list like object that holds results from a Twitter API query."""
class Model(... |
# Copyright (c) 2014 Scopely, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distrib... |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
############### is proportional in parse!
import gevent
from gevent import monkey
import itertools
from urllib.parse import urljoin
from utils import flatten, get_json, get_xpath, parse_cell, sanitize, split
monkey.patch_all()
class BaseCrawler(object):
url_image_ba... |
'''
#################
Plot (``owplot``)
#################
.. autoclass:: OrangeWidgets.plot.OWPlot
'''
from AnyQt.QtWidgets import \
QGraphicsView, QGraphicsScene, QGraphicsRectItem, QGraphicsTextItem,\
QToolTip, QApplication
from AnyQt.QtGui import QPen, QBrush, QColor, QPainter, QTransform, QPolygonF
fro... |
from shadowcraft.core import exceptions
class InvalidBuffException(exceptions.InvalidInputException):
pass
class Buffs(object):
allowed_buffs = frozenset([
'short_term_haste_buff', # Heroism/Blood Lust, Time Warp
#'stat_multiplier_buff', # Mark of the Wild, Blessing of Ki... |
#!/home/mworden/uframes/ooi/uframe-1.0/python/bin/python
__author__ = 'mworden'
from mi.core.log import get_logger
log = get_logger()
from mi.idk.config import Config
import unittest
import os
from mi.dataset.driver.cg_dcl_eng.dcl.cg_dcl_eng_dcl_recovered_driver import parse
from mi.dataset.dataset_driver import P... |
"""
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from registration import signals
from registration.forms import RegistrationForm
from registration.models import RegistrationProfile
class DefaultBackend(object):
"""
A registration backend which follows a simple wor... |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
## This file is part of the test suite of the Qt Toolkit.
##
## $QT_BEG... |
"""
git_remote_hg.test: testcases for git_remote_hg
================================================
Actually there are no "tests" as such just yet. This is simply here out of
habit, since I use it to sync the main docstring with README.rst.
"""
import os
import unittest
import git_remote_hg
class TestDocstrin... |
import logging
import foomodules.Base as Base
logger = logging.getLogger(__name__)
xmlns = "http://hub.sotecware.net/xmpp/git-post-update"
class GitLog(Base.XMPPObject):
REPOSITORY_NODE = "{{{0}}}repository".format(xmlns)
REF_NODE = "{{{0}}}ref".format(xmlns)
def __init__(self, pubsub_node, pubsub_host=... |
from django.template import RequestContext, TemplateDoesNotExist
from django.template.loader import get_template
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove
import ast
import logging
from django.http.request import HttpRequest
logger = logging.getLogger(__name__)
class TemplateResponse(object):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# todo:
# - writing html
# - pruning of dstats to match running time
# - when comparing benchmarks; use 1 color for all plots from 1 benchmark
# - if no latency info is found; print warning
# - when not a lot of data points, them time issues in gnuplot (use WORKER_PERFORMA... |
"""Various utility functions."""
from inspect import getframeinfo
from inspect import signature as _signature
from sys import _getframe
CONFIG_STACK = []
def get_args(func):
"""Get a list of argument names for a function.
:param func: The function to inspect.
:return: A list of argument names.
:rt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""gedit-flake8 : A plugin for gedit
to display error and warning from flake8."""
__author__ = "Benoît HERVIER"
__copyright__ = "Copyright 2012 " + __author__
__license__ = "GPLv3"
__version__ = "0.7.0"
__maintainer__ = "Benoît HERVIER"
__email__ = "khertan@khertan.net... |
"""
This is the main example script to execute, it is meant as an example
of how the riptimize.py module is to be used, and effectivey acts as
the driver of the module with rudimentary console UI + CSV report
generation and S3 upload. It's job is to demonstrate the functionality
of riptimize and it is not meant to... |
# -*- coding: utf-8 -*-
import sys
import os
import urllib
import urlparse
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
if sys.version_info < (2, 7):
import simplejson
else:
import json as simplejson
# Import the common settings
from resources.lib.settings import Settings
from resources.lib.s... |
"""Export and import textured meshes."""
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright © 2005-2015, NIF File Format Library and Tools contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# ar... |
# -*- coding: utf-8 -*-
#
# EdgeDB documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 3 17:58:14 2016.
#
# 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.
#
# Al... |
"""
The :mod:`builtins` module contains the builtin Python
and ARTIQ types, such as int or float.
"""
from collections import OrderedDict
from . import types
# Types
class TNone(types.TMono):
def __init__(self):
super().__init__("NoneType")
class TBool(types.TMono):
def __init__(self):
super... |
"""
OAuth backend for Orcid
"""
import json
import requests
import logging
from urllib.parse import urljoin
from oic.utils.authn.authn_context import UNSPECIFIED
from oic.oauth2.consumer import stateID
from oic.oauth2.message import AuthorizationResponse
from satosa.backends.oauth import _OAuthBackend
from ..internal... |
from six import BytesIO, StringIO, text_type, string_types
from django.http import HttpResponse
from django.contrib.contenttypes.models import ContentType
from django.db.models.fields.related import ReverseManyRelatedObjectsDescriptor
from django.db.models import Avg, Count, Sum, Max, Min
from openpyxl.workbook import... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""SpineML Bundle Module
This modual will form a convience class to bundle together related SpineML
objects into a single standard object which can be easily passed between
programs. The bundle will be able to interact with premade spineML objects
through the other suppor... |
# (C) British Crown Copyright 2012 - 2014, 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... |
#!/usr/bin/env python
# -*- 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
# au... |
#!/usr/bin/env python3
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (c) 2015, Colorado State University.
#
# This file is part of ndn-atmos.
#
# ndn-atmos is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as publish... |
import pytest
import numpy as np
from numpy.random import seed
from numpy.testing import assert_allclose
from scipy.linalg.lapack import _compute_lwork
from scipy.stats import ortho_group, unitary_group
from scipy.linalg import cossin, get_lapack_funcs
REAL_DTYPES = (np.float32, np.float64)
COMPLEX_DTYPES = (np.compl... |
from flask import current_app
from flask_login import AnonymousUserMixin, UserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from itsdangerous import BadSignature, SignatureExpired
from werkzeug.security import check_password_hash, generate_password_hash
from app import db, login_manager
... |
"""Draw a calendar poster."""
# Copyright 2016-2021 Florian Pigorsch & Contributors. All rights reserved.
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import calendar
import datetime
import svgwrite # type: ignore
from gpxtrackposter import utils
from gpxtr... |
#!/usr/bin/python
"""
Wrapper that executes a program with its arguments but reports standard error
messages only if the program exit status was not 0. This is useful to prevent
Galaxy to interpret that there was an error if something was printed on stderr,
e.g. if this was simply a warning.
Example: ./stderr_wrapper.... |
import os
from easyprocess import EasyProcess
from pyscreenshot.util import platform_is_linux, platform_is_osx, platform_is_win
def display_size_x():
# http://www.cyberciti.biz/faq/how-do-i-find-out-screen-resolution-of-my-linux-desktop/
# xdpyinfo | grep 'dimensions:'
screen_width, screen_height = 0, ... |
import datetime
import xlwt
from opensoar.utilities.helper_functions import add_times
def ss2hhmmss(time_ss, colon=True):
if time_ss is None:
return None
seconds = (time_ss % 3600) % 60
minutes = ((time_ss % 3600) - seconds) / 60
hours = (time_ss - (time_ss % 3600)) / 3600
if colon:
... |
from slackclient import SlackClient
from slack_screen import SlackTerminal
import os
import json
import threading
import time
class SlackLine(object):
_name_to_ids = None
_ids_to_names = None
_user_id = None
_commands = ("lc", "sc", "exit", "quit", "is_online")
def __init__(self, slack_name, ... |
"""Copyright 2008 Orbitz WorldWide
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... |
# import numpy as np
import cv2 as cv
faceCascade = cv.CascadeClassifier(cv.data.haarcascades + 'haarcascade_frontalface_default.xml')
eyeCascade = cv.CascadeClassifier(cv.data.haarcascades + 'haarcascade_eye.xml')
# img = cv.imread('sachin.jpg')
video_capture = cv.VideoCapture(0)
while True:
# Capture... |
import time
from nose.tools import raises
from vmail.error import DomainNotFoundError
from vmail.error import ForwardNotFoundError
from vmail.error import UserNotFoundError
from vmail.error import VmailCoreError
from vmail.tests import test
class TestCoreSMTP(test.DaemonUnitTest):
def test_authenticate(self):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import cv2
import threading
import time
import subprocess
import os
import signal
from datetime import datetime
from modules import tracker, calendar, alarm, wolfram, music
class Brain:
def __init__(self):
self.tracker = tracker.Tracker()
self.alarm = alarm.... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import logging
import logging.config
import ConfigParser
import csv
import numpy as np
import datetime
import talib
import arrow
from gmsdk import *
'''
##人气指标(AR)介绍
人气指标是以当天开市价为基础,即以当天市价分别比较当天最高、最低价,通过一定时期内开市价在股价中的地位,反映市场买卖人气。
其计算公式如下:
AR=N日内(当日最... |
#!/usr/bin/env python
""" Simple Twitter tools
Expects to find a file, ../../../secrets.txt, with a row containing twitter,overcognition,keys
where keys is from Twitter:
consumer_key,consumer_secret,oauth_token,oauth_token_secret
Lots learnt from http://nbviewer.ipython.org/github/chdoig/Mining-the-Social-Web-2nd-E... |
__author__ = 'dstrohl'
import unittest
import logging
from testfixtures import LogCapture
from python_log_indenter.pli import IndentedLoggerAdapter
from testfixtures import compare
class TestIndentedLogging(unittest.TestCase):
def test_passthrough_logging(self):
with LogCapture() as l:
log = ... |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name, too-many-arguments, too-many-branches,
# pylint: disable=too-many-locals, too-many-instance-attributes, too-many-lines
"""
This module implements the linear Kalman filter in both an object
oriented and procedural form. The KalmanFilter class implements
the filter... |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Tarek Galal <tare2.galal@gmail.com>
#
# This file is part of Gajim-OMEMO plugin.
#
# The Gajim-OMEMO plugin 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 ver... |
from javaproperties import __version__
project = "javaproperties"
author = "John T. Wodder II"
copyright = "2016-2020 John T. Wodder II"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx_copybutton",
]
autodoc_default_options = {
... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Updates enums in histograms.xml file with values read from provided C++ enum.
If the file was pretty-printed, the updated version is pretty-printed too.
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) Enrique J. Hernández 2014
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any l... |
"""
Plugin for UrlResolver
Copyright (C) 2020 gujal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 17 12:35:28 2017
@author: ning
"""
#import mne
import numpy as np
import pandas as pd
import os
from time import time
#import networkx as nx
from collections import Counter
os.chdir('D:\\NING - spindle\\Spindle_by_Graphical_Features')
channelList = ['F3','F4','C3','C4','... |
from forte.core import flog
from forte.solvers.solver import Feature, Solver
from forte.forte import ForteOptions
from forte import to_state_nroots_map
from forte import forte_options
from forte.forte import make_active_space_ints, make_active_space_solver
class ActiveSpaceSolver(Solver):
"""
A class to dia... |
# This file is part of the Minecraft Overviewer.
#
# Minecraft Overviewer 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... |
from itertools import islice
from typing import ClassVar, Dict, Iterable, Tuple
from permuta.patterns.perm import Perm
class InsertionEncodablePerms:
"""A static container of functions fortesting
if a basis has a regular insertion encoding.
"""
_ALL_PROPERTIES: ClassVar[int] = 15
_CACHE: ClassVa... |
from jno.util import interpret_configs
from jno.util import run_arduino_process
from jno.util import create_build_directory
from jno.util import get_common_parameters
from jno.util import JnoException
from jno.util import verify_arduino_dir
from jno.commands.command import Command
import getopt
class Build(Command):
... |
import os
import tarfile
from flyingpigeon.subset import clipping
from flyingpigeon.subset import _CONTINENTS_
from pywps.Process import WPSProcess
from flyingpigeon.log import init_process_logger
import logging
logger = logging.getLogger(__name__)
class subset_continentsProcess(WPSProcess):
def __init__(self)... |
from scipy import array
from pybrain.rl.learners.blackboxoptimizers.evolution.ga import GA
import collections
__author__ = 'Justin Bayer, Tom Schaul, {justin,tom}@idsia.ch'
# TODO: not very elegant, because of the conversions between tuples and arrays all the time...
class MultiObjectiveGA(GA):
""" Multi-objecti... |
#!/usr/bin/python2
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
import sys
import textwrap
from subprocess import Popen, PIPE
_OBJDUMP = 'arm-linux-gnueabi-objdump'
def _objdump(binary, ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.osv import expression
class MassMailingContactListRel(models.Model):
""" Intermediate model between mass mailing list and mass mailing contact
Indicates if a c... |
""" trees v0.2
procedurally generated foliage
(implicitly happy)
agrippa kellum : june 2013
"""
__all__ = ['Branch', 'Trunk']
import sys, random, math, time, visual as v, numpy as np
class Branch(object):
def __init__(self,inc,az,parent,origin):
self.parent = parent
self.size = 1
self.c... |
import unittest
import networkx as nx
import sdfpy.core as core
class TestLoadJSON(unittest.TestCase):
def test_tiny_csdf(self):
try:
g = core.load_sdf('tests/graphs/csdfg-tiny.json')
q = g.repetition_vector()
s = g.normalisation_vector()
m = g.modulus()
... |
# -*- coding: utf-8 -*-
## @package setup
# Setup file used to build the Installers
from distutils.core import setup
from gmapcatcher.mapConst import *
import os
if os.name == "posix":
ico = "images/map.png"
setup(
name = NAME,
description = 'Offline Map Viewer',
version = VERSION,
... |
# -*- coding: utf-8 -*-
import re
import urlparse
from module.plugins.internal.SimpleHoster import SimpleHoster
class UloziskoSk(SimpleHoster):
__name__ = "UloziskoSk"
__type__ = "hoster"
__version__ = "0.29"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?ulozisko\.sk/.+'
__config_... |
import sys
from io import TextIOWrapper
def pprint_table(table: list,
header_labels: list,
blank_line_after_header: bool = True,
out: TextIOWrapper = sys.stdout):
"""Prints out a table of data, padded for alignment
@param table: The table to print. A list of ... |
# 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 u... |
import unittest
import transaction
from pyramid import testing
from .models import DBSession
class TestMyViewSuccessCondition(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
from sqlalchemy import create_engine
engine = create_engine('sqlite://')
from .models i... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Course.course_code'
db.alter_column('tafe_course', 'course_code', self.gf('django.db.mode... |
from skimage.feature import CENSURE
from skimage.color import rgb2gray
import matplotlib.pyplot as plt
import numpy as np
import cv2
import sys
from PIL import Image, ImageDraw
def draw_keypoints(img, kp, scale):
draw = ImageDraw.Draw(img)
# Draw a maximum of 300 keypoints
for i in range(min(len(scale),300... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.tree import DecisionTreeClassifier
from sklearn.externals.six import StringIO # doctest: +SKIP
from sklearn.tree import export_graphviz
from scipy.misc import imread
from scipy import ndimage
import os
import re
... |
#!/usr/bin/env python
import numpy as np
import sys
if len(sys.argv) < 2:
print("{} filename".format(sys.argv[0]))
exit()
filename = str(sys.argv[1])
f = open(filename, "r")
SMASH_table = f.read().split("\n")
f.close()
pdg_list = []
mass_list = []
header_list = []
decay_list = []
iline = 0
while iline ... |
#!/usr/bin/env python
# coding=utf8
import inspect
import logging
import pprint
import time
import warnings
from collections import namedtuple
from uuid import uuid1
import pendulum
import streamz
import tqdm
from numpy import isclose
from . import schemes
from ..plugins.container import TriflowContainer
logging.ge... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 eNovance <licensing@enovance.com>
# Copyright © 2012 Red Hat, Inc
#
# Author: Julien Danjou <julien@danjou.info>
# Author: Eoghan Glynn <eglynn@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance ... |
# 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 agreed to in... |
import unittest
from SDA import *
import numpy
class WaypoinHolderTestCase(unittest.TestCase):
def setUp(self):
self.waypoints = numpy.array([[1,2,3],[4,5,6]]) #Must remain a 2D array
def test_add_waypoint(self):
single_waypoint = numpy.array([7,8,9])
test_waypoint_holder = WaypointHo... |
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
# ProcHelper: Process execution helper class.
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
import errno
import subprocess
import os
import os.path
import SublimeHaskell.sublime_haskell_common as Common
i... |
# -*- coding: utf-8 -*-
from zope.interface import Interface
from functools import wraps
from fnmatch import fnmatch
class IModule(Interface):
def actions():
"""
Returns the list of actions this module hooks into.
Actions are defined as a tuple with the following values:
(action_n... |
"""
reference root service.
Revision ID: a395ef9d3fe6
Revises: ae1a3c8c7860
Create Date: 2018-06-04 11:38:31.296950
"""
import sqlalchemy as sa
from alembic import op
from alembic.context import get_context # noqa: F401
from sqlalchemy.dialects.postgresql.base import PGDialect
from sqlalchemy.orm.session import sess... |
#!c:\Python27\python
import vxi11Device as vxi11
#import numpy
import os,sys, time
# FSW
#['Rohde&Schwarz', 'FSW-50', '1312.8000K50/100970', '2.10\n']
#inst = rm.open_resource('TCPIP::10.0.0.160::INSTR')
#SMW200A
#['Rohde&Schwarz', 'SMW200A', '1412.0000K02/101575', '3.1.18.2-3.01.086.171_SP2\n']
#inst... |
# ---------------------------------------------------------------------------
# Copyright (C) 2017 Frank Jargstorff
#
# This file is part of the AcousticBEM library.
# AcousticBEM 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 So... |
#
# Copyright (c) 2018 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... |
"""
Similar to the memory subsystem, this is a unified way to
access information about objects which contain registers
"""
import envi.bits as e_bits
from envi.const import *
class InvalidRegisterName(Exception):
pass
class RegisterContext:
def __init__(self, regdef=(), metas=(), pcindex=None, spindex=None,... |
"""Script for translating given sequence."""
from translate_dicts import translation_code
import regex as re
def translate_handler(sequence, start=False, Frame='all', code='translation_code', reverse=True)
if reverse == True:
return translate(sequence, start=start, Frame=Frame, code=code),
... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# "Nhomar Hernandez <nhomar@vauxoo.com>"
#
# This program is free software: you ca... |
from pygame.event import post, Event
from thorpy.elements.pressable import Pressable
from thorpy.elements.hoverable import Hoverable
from thorpy.miscgui.constants import STATE_NORMAL, STATE_PRESSED, EVENT_PRESS, THORPY_EVENT
class Clickable(Pressable, Hoverable):
"""Clickable Element (Pressable and hoverable)"""... |
#!/usr/bin/python
# This file is part of Morse.
#
# Morse 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.
#
# Morse ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from collections import namedtuple
import sip
from PyQt5.QtWebKitWidgets import QWebPage, QWebView
from PyQt5.QtCore import QByteArray
from twisted.python import log
import six
from splash.har_builder import HarBuilder
RenderErrorInfo = namedtuple('Rende... |
# -*- encoding: utf-8 -*-
from abjad.tools import stringtools
from abjad.tools.abctools import AbjadValueObject
class Scheme(AbjadValueObject):
r'''Abjad model of Scheme code.
.. container:: example
**Example 1.** A Scheme boolean value:
::
>>> scheme = schemetools.Scheme(True... |
# 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 ... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# streamondemand - XBMC Plugin
# Conector para ucaster
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impo... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011-2012 Daniel (Avanzosc) <http://www.avanzosc.com>
# 28/03/2012
#
# This program is free software: you can redistribute it and/or modify
# ... |
from colors import *
class Level( object ):
pass
class LevelLens( Level ):
speed = 0.5
blocks = [ Colors.LENS ]
lines = 10
prob = 0.07
class LevelScale( Level ):
speed = 0.5
blocks = [ Colors.SCALE ]
lines = 10
prob = 0.07
class LevelLiquid( Level ):
speed =... |
# coding: utf-8
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for coverage.templite."""
import re
from coverage.templite import Templite, TempliteSyntaxError, TempliteValueError
from tests.coveraget... |
import requests
from .. import db
from ..netrunner.models import Cycle, Pack, Identity, Faction, Side
from requests.exceptions import HTTPError
cycle_api_url = ''
pack_api_url = 'http://netrunnerdb.com/api/sets/'
cards_api_url = 'http://netrunnerdb.com/api/cards/'
def get_api_data(url):
try:
data = reque... |
class Patient(object):
def __init__(self, name, age, phone, code):
self.name = name
self.age = age
self.phone = phone
self.code = code
def breath(self):
print("I breath 12-18 times per minute")
def walk(self, walkRate):
print("I walk at {}km per hour".forma... |
#!/usr/bin/env python3
import math
import sys
from typing import Any, Dict
import numpy as np
from selfdrive.locationd.models.constants import ObservationKind
from selfdrive.swaglog import cloudlog
from rednose.helpers.kalmanfilter import KalmanFilter
if __name__ == '__main__': # Generating sympy
import sympy as... |
# Copyright (c) 2014 Mirantis, 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... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania 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 Licen... |
# Developer : Hamdy Abou El Anein
import os
import sys
from easygui import *
print("IMPORTANT\n\nThis software work only if google_speech is installed on the system. To install it go to this link please : https://pypi.python.org/pypi/google_speech/\n\n")
def language():
global lang
msg = "What's the langu... |
import os
import csv
import requests
from datetime import datetime
import simplejson as json
import platform
import base64
import ohmysportsfeedspy
# API class for dealing with v1.0 of the API
class API_v1_0(object):
# Constructor
def __init__(self, verbose, store_type=None, store_location=None):
se... |
# Copyright 2018 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... |
"""
"""
from abc import ABCMeta, abstractmethod
import six
from jiracli.cli import colorfunc
from jiracli.errors import UsageError, UsageWarning
from jiracli.utils import get_text_from_editor, print_output
@six.add_metaclass(ABCMeta)
class Command(object):
def __init__(self, jira, args):
self.args = ar... |
import urllib
from oauth2 import Request as OAuthRequest, SignatureMethod_HMAC_SHA1
try:
import json as simplejson
except ImportError:
try:
import simplejson
except ImportError:
from django.utils import simplejson
from social_auth.backends import ConsumerBasedOAuth, OAuthBackend, BaseOAut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.