text stringlengths 17 737k |
|---|
import os
import sys
import time
from threading import Thread
from vlcclient import VLCClient
from ezlogger import ezLogger
print ("#######################################################")
print ("# _____ _ _ ___ #")
print ("# | __ \ | | (_) |__ \ #... |
# -*- coding: utf-8 -*-
# Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
#
# 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 Foundation, either version 3 of... |
"""
Class for reading data created by IGOR Pro
(WaveMetrics, Inc., Portland, OR, USA)
Depends on: igor (https://pypi.python.org/pypi/igor/)
Supported: Read
Author: Andrew Davison
Also contributing: Rick Gerkin
"""
from warnings import warn
import pathlib
import quantities as pq
from neo.io.baseio import BaseIO
fro... |
#!/usr/bin/env python2
import numpy as np
import matplotlib.pyplot as plt
import argparse
import sys
import os
import tf.transformations as tf
def quat2RPY(qx, qy, qz, qw):
N = len(qx)
rpy_out = np.empty((N, 3))
for i in range(N):
ypr = tf.euler_from_quaternion(
np.array([qx[i], qy[i],... |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
import os
import pandas as pd
import re
import nltk
import pickle
from nltk.stem.porter import *
from nltk.stem.snowball import SnowballStemmer
from unidecode import unidecode
def fixtypos(training_data):
# traing_data to be given when called... |
""" This file configures python logging for the pytest framework
integration tests
Note: pytest must be invoked with this file in the working directory
E.G. py.test frameworks/<your-frameworks>/tests
"""
import json
import logging
import os
import os.path
import re
import retrying
import shutil
import sys
import time
... |
#!/usr/bin/python
#
# Copyright (c) 2011 rPath, Inc.
#
# All rights reserved.
#
from django.db.models import Q
from django.db.models.query import EmptyQuerySet
from django.db import connection, transaction
from mint.django_rest import timeutils
from mint.django_rest.rbuilder import modellib
from mint.django_rest.rbui... |
##
# This module implements the client-side of the Geni API. Stubs are provided
# that convert the supplied parameters to the necessary format and send them
# via XMLRPC to a Geni Server.
#
# TODO: Investigate ways to combine this with existing PLC API?
##
import xmlrpclib
from gid import *
from credential import *
f... |
import param
import numpy as np
from cartopy import crs as ccrs
from cartopy.feature import Feature as cFeature
from cartopy.io.img_tiles import GoogleTiles
from cartopy.io.shapereader import Reader
from holoviews.core import Element2D, Dimension, Dataset as HvDataset, NdOverlay
from holoviews.core.util import (basestr... |
import os
import sqlite3
try:
sqlite3.enable_callback_tracebacks(True)
except AttributeError:
pass
from peewee import *
from peewee import print_
from playhouse.sqlite_ext import *
from playhouse.tests.base import database_initializer
from playhouse.tests.base import ModelTestCase
from playhouse.tests.base imp... |
from numpy import zeros, Float
from odict import odict
from attributes import attribute, readonly
from neuroimaging import reorder, reverse, hasattrs
from neuroimaging.reference import axis
##############################################################################
class CoordinateSystem(odict):
"A simple cl... |
import unittest
from geoscript import geom, proj, feature
class LayerTest(unittest.TestCase):
def testCount(self):
self.assertEqual(49, self.l.count())
def testCRS(self):
cs = self.l.crs
self.assert_(cs)
self.assertEqual('EPSG:4326', proj.srs(cs))
def testBounds(self):
b = self.l.bounds()
... |
#
# Copyright 2013 Quantopian, 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 in wr... |
#!/usr/bin/env python
"""
@package mi.dataset.parser.ctdpf_ckl_wfp_sio_mule
@file marine-integrations/mi/dataset/parser/ctdpf_ckl_wfp_sio_mule.py
@author cgoodrich
@brief Parser for the ctdpf_ckl_wfp_sio_mule dataset driver
Release notes:
Initial Release
"""
__author__ = 'cgoodrich'
__license__ = 'Apach... |
#!/bin/env python3
# first three octet identify organization
# organizationally unique identifier(OUI)
# following three(MAC-48 and EUI-48) or
# five (EUI-64) octets are assigned by that
# organization - arbitrarily
# locally administered addresses do not contain OUI's
# difference of universal/local, setting the se... |
#!/usr/bin/python
from __future__ import print_function
import logging
import os
import sqlite3 as sq3
from time import gmtime, strftime
from dwarf import exception
from dwarf.common import config
LOG = logging.getLogger(__name__)
CONF = config.CONFIG
_DB_COLS = ['created_at', 'updated_at', 'deleted_at', 'delete... |
"""Image masks.
Classes Mask and Mask3D represent image masks. They can be used to select
regions, or groups of voxels from images. Class Mask3D contains a multi-slice
boolean array that is set to True in those voxels that are selected. Class Mask
contains a single-slice 2D array and a number denoting the slice index.... |
# apis_v1/test_position_list_for_voter.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.urls import reverse
from django.test import TestCase
import json
class WeVoteAPIsV1TestsPositionListForVoter(TestCase):
databases = ["default", "readonly"]
def setUp(self):
self.generat... |
# -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... |
from braces.views import CsrfExemptMixin, LoginRequiredMixin
import datetime
from ipware.ip import get_real_ip
import pytz
from django.http import HttpResponse, HttpResponseBadRequest
from django.contrib.auth import decorators
from django.views.generic import TemplateView, View
from django.core import serializers
fro... |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... |
"""
Test that redundant calls to SetPresence don't cause anything to happen.
"""
import dbus
from servicetest import EventPattern
from gabbletest import exec_test
import constants as cs
from invisible_helper import Xep0186XmlStream, ValidInvisibleListStream
def test_presence(q, bus, conn, stream):
conn.Connect(... |
"""
unit tests for the libvirt_events engine
"""
import salt.engines.libvirt_events as libvirt_events
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class EngineLibvirtEventTestCase(TestCase, LoaderModuleMockMixin):
"... |
"""Automatically generate tests names.
This script updates all tests stored JSON files in the examples/ directory by
replacing the current test name by a new one, generated based on the structure
of the tests. It takes into account field types, operators being used,
parameters etc.
"""
import collections
import json
... |
from .base import FunctionalTest
class CountPageViewTest(FunctionalTest):
def test_count_view_of_post(self):
self.browser.get(self.live_server_url)
self.move_to_default_board()
# 혜선이는 'grape'에 대한 게시글을 작성한다
self.add_post('grape', 'purple\nsweet')
# 글 목록을 보니 조회 수가 0으로 표시되어 ... |
# -*- coding: utf-8 -*-
'''
All salt configuration loading and defaults should be in this module
'''
from __future__ import absolute_import, generators
# Import python libs
import os
import re
import sys
import glob
import time
import codecs
import logging
from copy import deepcopy
import types
# Import third party ... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# Copyright 2017, National University of Ireland and The James Hutton Insitute
# Author: Nicholas Waters
#
# This code is part of the riboSeed package, and is governed by its licence.
# Please see the LICENSE file that should have been included as part of
# this package.
"... |
from __future__ import print_function
from csv_parser import *
import os
import sys
import csv
import socket
import platform
import subprocess
import tkPopup
try:
# python 3
from tkinter import filedialog, messagebox
import tkinter as tk
import configparser
from tkinter.font import F... |
"""
msg.py - MIDI messages
http://www.midi.org/techspecs/midimessages.php
New messages are created with mido.new() or mido.Message(),
which both return a message object.
"""
from __future__ import print_function
from collections import namedtuple
# Pitchwheel is a 14 bit signed integer
PITCHWHEEL_MIN = -8192
PITCH... |
#!/usr/bin/python
from datetime import datetime
from elasticsearch import Elasticsearch
import pprint
import time
import sys
total = len(sys.argv)
cmdargs = str(sys.argv)
index="*";
limit=100;
oldestDate="now";
earlietDate="now-1d";
defaultField="message";
for i in xrange(total):
opt = str (sys.argv[i]);
if ( ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
from watchdog.tricks import Trick
from itertools import cycle
from timeit import default_timer as timer
from signal import SIGTERM
from utile import get_pid_list, process_name
from threading import Thread
from Queue import Queue
from urllib import urlopen
import logging.config
import os
import errno
import time
DEFAU... |
# -*- coding: utf-8 -*-
## $Id$
## Comments and reviews for records.
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
##
## CDS 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 Fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pyfiscan is free web-application vulnerability and version scanner and can be
used to locate out-dated versions of common web-applications in Linux-servers.
Example use case is hosting-providers keeping eye on their users installations
to keep up with security-updates.... |
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# Copyright (C) 2019 - TODAY Raphaël Valyi - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
from odoo.addons.l10n_br_fiscal.constants.fiscal import (
TAX_FRAMEWORK,
FISCAL_IN_OUT,
)
# These fie... |
# -*- coding: utf-8 -*-
# Configuring kivy
import kivy
kivy.require('1.7.2')
# window size's and position
WIDTH_LOGIN = 400
HEIGHT_LOGIN = 600
WIDTH_SYNC = 1200
HEIGHT_SYNC = 700
POSITION_TOP = 200
POSITION_LEFT = 200
from kivy.config import Config
Config.set('kivy', 'desktop', 1)
Config.set('input', 'mouse', 'mouse,... |
import re
import os
import sys
import shutil
import tarfile
import zipfile
import tempfile
import urlparse
import ConfigParser
import pkg_resources
from pkgtools.pypi import PyPIJson
from pkgtools.pkg import SDist
from pyg.core import *
from pyg.web import ReqManager, request
from pyg.req import Requirement
from pyg.... |
import sys, json, random, asyncio
import hangups
from hangups.ui.utils import get_conv_name
from utils import text_to_segments
class CommandDispatcher(object):
"""Register commands and run them"""
def __init__(self):
self.commands = {}
self.unknown_command = None
@asyncio.coroutine
... |
"""Core views."""
# Copyright 2015 Solinea, 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 ag... |
import logging, shlex, unicodedata, asyncio
import hangups
import re, time
from commands import command
from random import randint
from hangups.ui.utils import get_conv_name
class MessageHandler(object):
"""Handle Hangups conversation events"""
def __init__(self, bot, bot_command='/bot'):
self.bot... |
#coding: utf-8
import calendar
from datetime import datetime, timedelta
import hashlib
from thumbor.result_storages import BaseStorage
from thumbor.utils import logger
from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.s3.key import Key
from dateutil.parser import parse as parse_... |
"""Performs requests to the Google Maps Elevation API."""
from googlemaps import common
from googlemaps import convert
def elevation(ctx, locations):
"""
Provides elevation data for locations provided on the surface of the
earth, including depth locations on the ocean floor (which return negative
value... |
"""
This module contains a class `sqrt_lasso`_ that implements
post selection for the square root lasso.
Code based on algorithms described in http://arxiv.org/abs/1504.08031.
"""
from copy import copy
import numpy as np, warnings
from scipy.stats import norm as ndist, chi as chidist
from scipy.interpolate import i... |
#!/usr/bin/env python
#-----------------------------------------------------------------------------------------------------------------------
# INFO:
#-----------------------------------------------------------------------------------------------------------------------
"""
Authors: Evan Hubinger, Fred Buchanan
Lice... |
"""The higher-level objects API."""
import datetime
from collections import OrderedDict
from decimal import Decimal
from typing import TYPE_CHECKING, Callable, ClassVar, Iterable, List, Optional
from typing import OrderedDict as OrderedDictType
from typing import TypeVar, Union, cast
import attr
from attrs.validators... |
from io import BytesIO
import pandas as pd
try:
from pandas.io.common import ZipFile
except ImportError:
from zipfile import ZipFile
def get_movielens_data(local_file=None, get_ratings=True, get_genres=False,
split_genres=True, mdb_mapping=False):
'''Downloads movielens data and st... |
from functools import total_ordering
from hashids import Hashids
def _is_uint(candidate):
"""Returns whether a value is an unsigned integer."""
return isinstance(candidate, int) and candidate >= 0
def _is_str(candidate):
"""Returns whether a value is a string."""
return isinstance(candidate, str)
... |
# -*- coding: utf-8 -*-
'''
Management of Block Devices
===================================
A state module to manage blockdevices
.. code-block:: yaml
/dev/sda:
blockdev.tuned:
- read-only: True
master-data:
blockdev:
- tuned:
- name : /dev/vg/master-data
- read-... |
import commentjson as json
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Compare two JSON graphs')
parser.add_argument('--modelA', required=True, type=str, dest='modelFilenameA',
help='Filename of the json model description')
parser.add_arg... |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""remote.Provider reads configs from a remote config service."""
import base64
import datetime
import logging
import zlib
from six.moves import... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#=======================================================================================================================
#
# MKBRUTUS.py v1.0.2 - Password bruteforcer for MikroTik devices or boxes running RouterOS
#
# AUTHORS:
# Ramiro Caire - email: ramiro.caire@gmail.c... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... |
from collections import namedtuple
import os
import re
import jedi
from .structures import *
from .util import normalize
def _debug_print_tree(node, indent=0, func=repr):
""" Print visual representation of Jedi AST. """
ret = "\t" * indent + func(node) + "\n"
children = getattr(node, "children", None)
... |
# Copyright 2012-2015 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... |
# -*- coding: utf-8 -*-
'''
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
#!/usr/bin/python3
# Eloipool - Python Bitcoin pool server
# Copyright (C) 2011-2012 Luke Dashjr <luke-jr+eloipool@utopios.org>
#
# 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 Foundation, either v... |
##
#
# Copyright 2013 Jessica Tallon, Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen 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 la... |
# -*- coding: utf-8 -*-
'''
Manage VPCs
=================
.. versionadded:: 2015.8.0
Create and destroy VPCs. Be aware that this interacts with Amazon's services,
and so may incur charges.
This module uses ``boto``, which can be installed via package, or pip.
This module accepts explicit vpc credentials but can als... |
##########################################################################
# Copyright (c) 2009, 2016, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Universitaetstr 6, ... |
# Copyright (c) 2015, Facebook, Inc. All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
from sparts.tests.base import Mu... |
# -*- coding: utf-8 -*-
"""
test/test_connection
~~~~~~~~~~~~~~~~~~~~~
Tests for the SPDYConnection object.
"""
import spdypy
import spdypy.connection
from .test_stream import MockConnection
from unittest.mock import MagicMock
class TestSPDYConnection(object):
def test_can_create_connection(self):
conn =... |
"""
Provides a class for the storing and management of
race data.
"""
from hashlib import md5
import json
import os.path
from glob import glob
from natsort import natsorted
from tqdm import tqdm
from AdditionalParticipantPacket import AdditionalParticipantPacket
from REParticipantPacket import REParticipantPacket \
... |
"""
The BaseCase class is the main gateway for using The SeleniumBase Framework.
It inherits Python's unittest.TestCase class, and runs with Pytest or Nose.
All tests using BaseCase automatically launch WebDriver browsers for tests.
Usage:
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
... |
from debug import logger
withMessagingMenu = False
try:
from gi.repository import MessagingMenu
from gi.repository import Notify
withMessagingMenu = True
except ImportError:
MessagingMenu = None
try:
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import *
from PyQt4.QtGui import *
excep... |
import json
from base64 import b64decode
from datetime import datetime
from email.utils import mktime_tz, parsedate_tz
from email.mime.base import MIMEBase
from email.encoders import encode_base64
__version__ = '1.1.0'
# Version synonym
VERSION = __version__
class PostmarkInbound(object):
def __init__(self, *... |
# encoding: utf-8
from __future__ import unicode_literals
from datetime import datetime
from bson import ObjectId
from common import FieldExam
from marrow.mongo.field import Date
class TestDateField(FieldExam):
__field__ = Date
def test_date_like_oid(self, Sample):
oid = ObjectId('586846800000000000000000')
... |
#!/usr/bin/env python
# coding=utf-8
"""
translate.py - Willie Translation Module
Copyright 2008, Sean B. Palmer, inamidst.com
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
"""
import re
import web
from time import sleep
import urllib2, json
import random
mangle_lines = {}
def setup(willie):
... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Probability and Statistics
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (additions)
# Trevor Cohn <tacohn@cs.mu.oz.au> (additions)
# Peter Ljunglöf <pete... |
#!/usr/bin/python
import os
import sys
import uuid
from stat import *
import zmq
import netifaces
import avahi
import dbus
import thread
import time
import ConfigParser
import linuxcnc
from message_pb2 import Container
from config_pb2 import *
from types_pb2 import *
from status_pb2 import *
from preview_pb2 import *... |
from beets.plugins import BeetsPlugin
from beets.ui import Subcommand, print_obj
from beets.library import Item
####################
# Helper Functions #
####################
def force_unicode(s):
"""Forces returned string to be unicode
"""
if isinstance(s, str):
return s.decode("utf8")
retur... |
import os
import time
from converter import Converter
from extensions import valid_input_extensions, valid_output_extensions, bad_subtitle_codecs, valid_subtitle_extensions
from qtfaststart import processor, exceptions
class MkvtoMp4:
def __init__(self, file, FFMPEG_PATH="FFMPEG.exe", FFPROBE_PATH="FFPROBE.exe", ... |
"""
Author: Justin Cappos, Armon Dadgar
Start Date: 27 June 2008
V.2 Start Date: January 14th 2009
Description:
This is a collection of functions, etc. that need to be emulated in order
to provide the programmer with a reasonable environment. This is used
by repy.py to provide a highly restric... |
from datetime import timedelta
from unittest import skipIf
from django.test import TestCase
from django.conf import settings
from restclients_core.models import MockHTTP
from restclients_core.exceptions import DataFailureException
from uw_sws.dao import SWS_DAO
from uw_sws.util import fdao_sws_override
from myuw.util.c... |
# Copyright 2014 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 agreed to in writing, s... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... |
"""
Django settings for mojodemo 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, ...)
i... |
import argparse
def problem1():
"""
If we list all the natural numbers below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
"""
total = 0
for n in xrange(1000):
if (n % 3 == 0) or (n %... |
# -*- coding:utf-8 -*-
__author__ = 'Chengyu'
import hashlib
def user_key_gen(uid, region_num, phone_num, datetime):
key = str(uid) + str(region_num) + str(phone_num) + str(datetime)
key = hashlib.new("md5", key).hexdigest()
return key
def message_key_gen(sender_uid, receiver_uid, datetime):
key = s... |
"""module for stopping and starting stacks but keeping their state, hence without destroying them.
The primary reason for doing this is to save on costs."""
from datetime import datetime
import logging
from fabric.contrib import files
import fabric.exceptions as fabric_exceptions
from . import config
from .core impor... |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import unittest
import sys
import os
from oscrypto import asymmetric, errors
from ._unittest_compat import patch
patch()
if sys.platform not in set(['darwin', 'win32']):
from oscrypto._openssl._libcrypto import l... |
__version__='1.9.13'
# import geo
# import graphics
# import gui
# import util
def get_version():
return __version__ |
#!/usr/bin/python
"""
Detect which x86 CPU extension instructions the given scipy install uses.
This file can be used in the release process to check that the nosse installer
does not contain SSE instructions. This has happened before, see for example
ticket #1170.
Is meant to be run on OS X with Wine. Make sure objdu... |
from ctypeslib.codegen import typedesc
def typedef_def(tp):
if not isinstance(tp.typ, typedesc.PointerType):
return "typedef %s %s" % (tp.typ.name, tp.name)
else:
return "typedef %s" % (pointer_decl(tp.typ) % tp.name)
def pointer_decl(tp):
if isinstance(tp.typ, typedesc.FunctionType):
... |
import os
import warnings
from tempfile import mkstemp, NamedTemporaryFile
import numpy as np
import numpy.testing as nptest
from neuroimaging.testing import *
from neuroimaging.core.image import image
from neuroimaging.utils.tests.data import repository
from neuroimaging.io.api import load_image, save_image
from ne... |
#!/usr/bin/env python
# Copyright (C) 2015 Peter Magnusson
# For NodeMCU version 0.9.4 build 2014-12-30 and newer.
import os
import serial
import sys
import argparse
import time
import logging
log = logging.getLogger(__name__)
def minify(script):
return ' '.join([line.strip() for line in script.split('\n')])
s... |
import re
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from hematite.compat import BytestringHelper, make_sentinel
from hematite.raw import datastructures
from hematite.raw import core
from hematite.url import URL, _ABS_PATH_RE
from hematite.constants import CODE_REASONS
from hematite.raw... |
from __future__ import print_function
import sys
import os
from collections import Counter, OrderedDict
import time
import datetime as dt
from argparse import ArgumentParser
import random
import numpy as np
import pylab as plt
from load_settings import settings
from results import StormtracksResultsManager, ResultNo... |
# -*- coding: utf-8 -*-
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
__docformat__ = 'reStructuredText'
import re
import sys
import os
from os.path import join, abspath, dirname
import pprint
import string
from types import StringType
from urlparse import *
from copy import copy
from cgi import escape
import l... |
import os
import warnings
from tempfile import mkstemp, NamedTemporaryFile
import numpy as np
import numpy.testing as nptest
from neuroimaging.testing import *
from neuroimaging.core.image import image
from neuroimaging.utils.tests.data import repository
from neuroimaging.io.api import load_image, save_image
from ne... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from .. import models
from ...coordinates import Angle
from .. i... |
''' Creates a windows executable with cx_freeze. Run with "python cx_setup build". The package is fairly massive
right now (~80 MB), partially because it includes extra libraries that are unnecessary, like QT, but one
must be very careful when removing libraries, as it can cause the whole package to fail. Conse... |
import darmtbl
import itertools
import sys
import textwrap
def instruction_name(x):
return x.split('{')[0].split('<')[0].split()[0]
def instruction_names(arr):
"""List of all unique instruction names."""
return ['INVLD'] + sorted(set(instruction_name(x) for x in arr))
def enum_table(name, arr):
""... |
# -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
__docformat__ = 'reStructuredText'
import sys
import os
import tempfile
import re
from os.path import abspath, dirname, expanduser, join
from urlparse import urljoin, urlparse, urlunparse
from copy impor... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 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
# lis... |
import os, sys, PyQt4, getopt
from PyQt4 import QtCore, QtGui
import vtk
import time
class ExodusResult:
def __init__(self, render_widget, plane):
self.render_widget = render_widget
self.plane = plane
self.current_actors = []
def setFileName(self, file_name):
self.currently_has_actor = Tru... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2016 开阖软件(<http://osbzr.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero ... |
#!/usr/bin/env python3
import tensorflow as tf
import numpy as np
"""Basic usage of tensorflow"""
if __name__ == '__main__':
""" learn an equation y = ax
y and x is know, use alot of y and x to learn out a
"""
a = np.array([[2, 1], [3, 1]])
W = tf.Variable(tf.zeros([2, 2]))
b = tf.Variable(... |
#!/usr/bin/env python3.1
# -*- coding: utf-8 -*-
#
# Copyright © 2009 Michael Lenzen <m.lenzen@gmail.com>
#
""" multiset - Also known as a bag or unordered tuple.
This module provides three classes:
basemultiset - The superclass of multiset and frozen multiset. It is both immutable
and unhashable.
multiset - A mu... |
from __future__ import unicode_literals
import sys
import threading
if sys.version_info < (2, 7):
# We need the skip decorators from unittest2 on Python 2.6.
import unittest2 as unittest
else:
import unittest
from prometheus_client import Gauge, Counter, Summary, Histogram, Metric
from prometheus_client ... |
"""
nose_json.plugin
~~~~~~~~~~~~~~~~
:copyright: 2012 DISQUS.
:license: BSD
"""
import codecs
import os
import simplejson
import traceback
from time import time
from nose.exc import SkipTest
from nose.plugins import Plugin
from nose.plugins.xunit import id_split, nice_classname, exc_message
class JsonReportPlugin(P... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.