text stringlengths 17 737k |
|---|
import copy
from datetime import datetime
from json import loads
import logging
import socket
import time
from traceback import format_exc
from urllib import urlencode
from urllib2 import HTTPError, urlopen, URLError
from xml.dom import minidom
logger = logging.getLogger(__name__)
stats_logger = logging.getLogger('omg... |
from flask import Flask, render_template, request, redirect, jsonify, make_response, json, request, url_for, send_from_directory, flash
from collections import namedtuple
from werkzeug import secure_filename
import sys
import types
import time
import datetime
import re
import json
import untangle
import uuid
import sql... |
__version__ = '0.2.3'
import os
import sys
import logging
import argparse
from .core import WebCrawler
from .helpers import color_logging
def main():
""" parse command line options and run commands.
"""
parser = argparse.ArgumentParser(
description='A web crawler for testing website links validati... |
import copy
from datetime import timedelta
from textwrap import dedent
import warnings
import numpy as np
from pandas._libs import lib
from pandas._libs.tslibs import NaT, Timestamp
from pandas._libs.tslibs.period import IncompatibleFrequency
import pandas.compat as compat
from pandas.compat.numpy import function as ... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""A wrapper library to access Hadoop HTTP REST API"""
__author__ = 'fabio@fabiosouto.me'
import os
import requests
import logging
try:
import json # Python >= 2.6
except ImportError:
try:
import simplejson as json # Python < 2.6
except ImportError:
... |
# -*- coding: utf-8 -*-
import os
import urllib2
from optparse import make_option
from bs4 import BeautifulSoup
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand, CommandError
from django.core.urlresolvers import reverse
from django.utils... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A wrapper library to access Hadoop HTTP REST API"""
__author__ = 'fabio@fabiosouto.me'
import os
import logging
import json
import requests
CONTEXT_ROOT = '/webhdfs/v1'
OFFSET = 32768 # Default offset in bytes
class WebHDFSException(Exception):
def __init__(se... |
from __future__ import division
import numpy as np
import chainer
from chainer.functions import dropout
from chainer.functions import max_pooling_2d
from chainer.functions import relu
from chainer.functions import softmax
from chainer.initializers import constant
from chainer.initializers import normal
from chainer.... |
#!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 n... |
# ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2011 Contributor
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the EU DataGrid Software License. You should
# have received a copy of the license with... |
import os
from AlphaGo.training.reinforcement_policy_trainer import run_training, log_loss, run_n_games
import unittest
import numpy as np
import numpy.testing as npt
import AlphaGo.go as go
from keras.optimizers import SGD
from AlphaGo.models.policy import CNNPolicy
from AlphaGo.util import sgf_iter_states
import kera... |
# -*- coding: utf-8 -*-
#
# odmltables documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 17 13:22:00 2015.
#
# 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.
#
... |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... |
from scipy.optimize import root
def delta13C_Craig(r45sam, r46sam, d13cstd, r45std, r46std):
"""
Algorithm from Craig 1957; see Brand et al 2010 for more info.
"""
raise NotImplementedError
d18o = -22
d13C = 1.0676 * (r45sam / r45std - 1) - 0.0338 * d18o
return d13C
def delta13C(r45sam, ... |
# coding=utf-8
import logging
from requests.exceptions import HTTPError
from .rest_client import AtlassianRestAPI
log = logging.getLogger(__name__)
class Bamboo(AtlassianRestAPI):
""" Private methods """
def _get_generator(
self,
path,
elements_key="results",
element_key="r... |
"""
Test for lms courseware app, module data (runtime data storage for XBlocks)
"""
import json
from mock import Mock, patch
from nose.plugins.attrib import attr
from functools import partial
from courseware.model_data import DjangoKeyValueStore
from courseware.model_data import InvalidScopeError, FieldDataCache
from ... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
import unittest
from hamcrest import assert_that, equal_to
from mock import MagicMock, call
from mac_os_scripts.enable_restricted_ssh import RestrictedSSHEnabler
from mac_os_scripts_tests.test_common import _NO_OUTPUT
_ETC_PF_CONF_BEFORE = """#
# Default PF configuration file.
#
# This file contains the main ruleset... |
import os
from typing import Any, List, Optional, Sequence, Union
from xml.etree import cElementTree as ET
from packaging.version import Version
from annotypes import Anno, Array, add_call_types
from malcolm.compat import et_to_string
from malcolm.core import (
DEFAULT_TIMEOUT,
APartName,
BadValueError,
... |
# Copyright (c) 2012 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.
from master import master_config
from master.factory import chromium_factory
defaults = {}
helper = master_config.Helper(defaults)
B = helper.Builder
F... |
# 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.
#
# This program is distributed in the hope that it will ... |
#!/usr/bin/env python
"""
This script generates API changes between two different versions of VTK.
The script uses git and ctags to preset a list of classes added/removed, public
methods added/removed when going from one version to the other.
"""
# ctags generated by the command:
# ctags -R --sort=yes --c++-kinds=cf --... |
# Use this module for e-mailing.
from django.conf import settings
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import formatdate
import smtplib
import socket
import time
import random
# Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
# seconds, which... |
from django.core import formfields, validators
from django.core import db
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
import copy, datetime, os, re, sys, types
# The values to use for "blank" in SelectFields. Will be appended to the start of most "choices" lists.
BLANK_CHOICE... |
from os.path import join, normcase, abspath, sep
def safe_join(base, *paths):
"""
Joins one or more path components to the base path component intelligently.
Returns a normalized, absolute version of the final path.
The final path must be located inside of the base path component (otherwise
... |
import datetime
import json
import logging
import time
from django_sse.views import BaseSseView
from django.conf import settings
from django.contrib.syndication.views import Feed
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse
from django.http import Http404, HttpRe... |
''' Classes for read / write of matlab (TM) 5 files
The matfile specification last found here:
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
(as of December 5 2008)
'''
'''
=================================
Note on functions and mat files
=================================
The doc... |
import os
from base64 import b32encode, b32decode
from collections import OrderedDict
from six import BytesIO
from django.views.generic import FormView, ListView, TemplateView
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import load_backend
from django.contrib.auth import views as ... |
# -*- coding: utf-8 -*-
import regex
import phonenumbers
from bs4 import BeautifulSoup
def all_caps_title(s, site):
if regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT)\b").search(s):
return False # common words in non-spam all-caps titles
return bool(regex.compile(ur"^(?=.*\... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
# 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.
# This program is distributed ... |
""" core logic for fetching documents from S3 and queueing them locally before
sending to elastic search in memory-limited batches"""
import os
from datetime import datetime
from enum import Enum
from math import floor
from typing import Dict, List
import boto3
from aws_requests_auth.aws_auth import AWSRequestsAuth
fr... |
# -*- coding: utf-8 -*-
# noinspection PyCompatibility
import sys
import math
from difflib import SequenceMatcher
from urllib.parse import urlparse, unquote_plus
from itertools import chain
from collections import Counter
from datetime import datetime
import time
import os
import os.path as path
import regex
# noinsp... |
# -*- coding: utf-8 -*-
import regex
import phonenumbers
from bs4 import BeautifulSoup
def has_repeated_words(s, site):
words = regex.split(r"[\s.,:;!/\()\[\]+_-]", s)
words = [w for w in words if w != ""]
curr = 0
prev = ""
for w in words:
if w == prev and w.isalpha() and len(w) > 1:
... |
# -*- coding: utf-8 -*-
import regex
import phonenumbers
from bs4 import BeautifulSoup
def has_repeated_words(s):
words = regex.split(r"[\s.,:;!/\()\[\]+_-]", s)
words = [w for w in words if w != ""]
curr = 0
prev = ""
for w in words:
if w == prev and not w.isdigit():
curr += 1... |
#!/usr/bin/env python
# FireMisp - Python script for pushing FireEye json alerts
# into MISP over http
#
# Alexander Jaeger (deralexxx)
#
# The MIT License (MIT) see https://github.com/deralexxx/FireMISP/blob/master/LICENSE
#
# Based on the idea of:
# Please see: https://github.com/spcampbell/firestic
#
from BaseHTT... |
__author__ = "Jason Wolosonovich"
__email__ = "jason@avaland.io"
__license__ = "BSD 3-clause"
__version__ = "0.1.0.dev"
|
import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1, 1)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
raise Imp... |
#!/usr/bin/python
import requests
import json
from pprint import pprint
import random
verbose = False
root_url = 'http://localhost:6541'
prop_name = 'no_more_mosquitos'
def run(request, path, *params):
"""
Executes a request and prints debugging info to stdout if verbose == True.
"""
response = re... |
#!/usr/bin/env python
# - coding: utf-8 -
# Copyright (C) 2010 Toms Bauģis <toms.baugis at gmail.com>
""" guilloches, following. observe how detail grows and your cpu melts.
move mouse horizontally and vertically to change parameters
http://ministryoftype.co.uk/words/article/guilloches/
"""
import gtk
from li... |
# -*- coding: utf-8 -*-
"""
babel.localedata
~~~~~~~~~~~~~~~~
Low-level locale data access.
:note: The `Locale` class, which uses this module under the hood, provides a
more convenient interface for accessing the locale data.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, s... |
import csv
import re
import datetime
from flask import Flask
app = Flask(__name__, static_folder='static', static_url_path='')
def urlify(name):
nameUrl = name.lower()
nameUrl = re.sub(r'\W', '_', nameUrl)
return nameUrl
#converts mm/dd/yyyy to yyyy/mm/dd
def humanDateToMyDate(humanDate):
humanDateTokens = humanD... |
#uses MoleCoor
#argv[1] = input (XYZ) file path
#argv[2] = output (MOL) file name
#argv[3] = molecule name
#argv[4] = tolerance for connectivity perception
#argv[5] = $RMG/source/MoleCoor path
import sys
sys.path.append(sys.argv[5])#add $RMG/source/MoleCoor to the PYTHONPATH so that import statements below work ... |
"""
Copyright (c) 2016 Gianluca Gerard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute... |
#!/usr/bin/env python3
from __future__ import division
from numpy import cos,arcsin,sqrt,radians,degrees
"""
Michael Hirsch
from "Astronomical Algorithms" by Jean Meeus Ch. 16 p. 111 (16.5)
gives angular distance in degrees between two rightAscension,Declination
points in the sky. Neglecting atmospheric effects, of co... |
from argparse import ArgumentParser
import commands
import webbrowser
import httplib2
import sys
import json
import re
import os
import inspect
from subprocess import PIPE, Popen
#I recommend reading this file from the bottom up.
BASE_SERVER = 'http://readthedocs.org'
API_SERVER = '%s/api/v1' % BASE_SERVER
MEDIA_SERV... |
#!/usr/bin/env python3.2
# -*- coding: utf-8 -*-
# encoding: utf-8
"""
The class :py:class:`Reader` has been designed to selectivly extract data
from a mzML file and to expose the data as a python object.
Necessary information are read in and stored in a fast
accesible format.
The reader itself is an iterator, thus loo... |
# Standard library
from collections import OrderedDict
import os
from os.path import abspath, join, split, exists
import time
import sys
# Third-party
from astropy import log as logger
from astropy.io import fits
import astropy.table as tbl
import astropy.coordinates as coord
import astropy.units as u
import h5py
imp... |
b8131a0c-2ead-11e5-b3f7-7831c1d44c14 |
d805ba68-2ead-11e5-adff-7831c1d44c14 |
from constructive_hierarchy import *
_compose = lambda f: lambda g: lambda *a, **k: f(g(*a, **k))
def all_separations(models):
return {(holds, fails): cm for cm, fpair in models.items()
for holds in fpair[0]
for fails in fpair[1]}
@_compose('\n'.join)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Modified LDpair from:
https://github.com/CBIIT/nci-webtools-dceg-linkage/blob/master/LDlink/LDpair.py
"""
import os
import sys
import json
import math
import argparse
import subprocess as _sub
# https://github.com/MikeDacre/dbSNP
import dbSNP
DB_SNP_LOC = '/godot/dbs... |
import json
import logging
import re
logger = logging.getLogger(__name__)
'''
def set_glob_convostarted():
self.conversation_started = True # Needed to modify global copy of globvar
def set_convo_step():
self.convo_step = "A"
'''
'''
set_convo_step();
set_glob_convostarted();
'''
class RtmEventHandler(... |
import json
import logging
import re
logger = logging.getLogger(__name__)
class RtmEventHandler(object):
def __init__(self, slack_clients, msg_writer):
self.clients = slack_clients
self.msg_writer = msg_writer
def handle(self, event):
if 'type' in event:
self._handle_by_... |
"""
.. module:: bottle_utils.html
:synopsis: Functions for use in HTML templates
.. moduleauthor:: Outernet Inc <hello@outernet.is>
"""
from __future__ import unicode_literals
import types
import functools
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
from decimal imp... |
import time
from datetime import date, timedelta, datetime
from sqlalchemy import Column, Integer, String, Enum, ForeignKey, DateTime, \
Date, Text, Boolean
from sqlalchemy.dialects import postgresql
from conditional import db
attendance_enum = Enum('Attended', 'Excused', 'Absent', name='attendance_enum')
class ... |
# -*- coding: utf-8 -*-
"""
textpress.plugins.file_uploads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to upload files into a web visible folder.
:copyright: Copyright 2007 by Armin Ronacher
:license: GNU GPL.
"""
import re
from os import makedirs, remove, sep as pathsep
from os.path import dirname, joi... |
# Copyright 2015 Bracket Computing, Inc. 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.
# A copy of the License is located at
#
# https://github.com/brkt/brkt-sdk-java/blob/master/LICENSE
#
# or in the "license"... |
"""
click-man - Generate man pages for click application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements the core functionality to
generate man pages for entire click applications.
:copyright: (c) 2016 by Timo Furrer.
:license: MIT, see LICENSE for more details.
"""
import os
import clic... |
import time
import json
import uuid
import logging
import paasmaker
from ...testhelpers import TestHelpers
from paasmaker.common.core import constants
from backend import JobBackend
from pubsub import pub
import tornado.testing
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
class Red... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 21 13:23:31 2014
@author: Jens von der Linden
Implements Frobenius expansion around a singularity to determine the "small"
solution and check the Suydam condition.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_... |
from jinja2 import Environment, FileSystemLoader
import markdown
import os
class TemplateRenderer:
def __init__(self, template_folder, beetle_about):
self.beetle_about = beetle_about
self.env = Environment(loader=FileSystemLoader(template_folder))
self.template_folder = template_folder
... |
# coding=utf-8
#
# This file is part of beets.
# Copyright 2009, Adrian Sampson.
#
# Portions Copyright (C) 2006 Lukáš Lalinský
# from the MusicBrainz Picard project.
#
# Beets 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 Soft... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from six.moves import range
import time, _socket, poplib, imaplib, email, email.utils, datetime, chardet, re, hashlib
from email_reply_parser import EmailReplyParser
from email.he... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Phil Adams http://philadams.net
hrpg: commandline interface for http://habitrpg.com
http://github.com/philadams/hrpg
TODO: handle ranges and lists for done/undone (e.g. tasks done 1,2,4-8,11)
TODO: add short-cuts (e.g. `hrpg t a 'a new todo'`)
TODO: figure out cache ... |
import numpy as np
import matplotlib as mpl
import matplotlib.pylab as pl
from matplotlib.gridspec import GridSpec
from peri.mc import sample
class OrthoManipulator(object):
def __init__(self, state, size=8, cmap_abs='bone', cmap_diff='RdBu',
incsize=18.0, orientation=None, vrange_img=1.0, vrange_diff... |
# -*- coding: utf-8 -*-
'''
hsalf.swf
~~~~~~~~~
Provides an object-model to Flash SWF file. The module is used to
read and write SWF tags from or to a file-like object.
An SWF file is opened with a SwfFile object.
>>> fi = swf.SwfFile('example.swf')
The file name can be omitted. In that case, you... |
"""This test checks for correct fork() behavior.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
On some systems (e.g. Solaris without posix threads) we find that all
active threads survive in the child after a fork(); this is an error.
"""
import os, sys, time, thread
LO... |
from test_support import verbose
import warnings
warnings.filterwarnings("ignore", "the regex module is deprecated",
DeprecationWarning, "test_regex")
import regex
from regex_syntax import *
re = 'a+b+c+'
print 'no match:', regex.match(re, 'hello aaaabcccc world')
print 'successful search:', re... |
# Copyright (c) 2014 Red Hat, Inc.
# 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 require... |
import os
from django.conf import settings
ENABLED = getattr(settings, 'SITE_CONTENT_ENABLED', True)
# helper paths
SITE_CONTENT_ROOT = os.path.realpath(os.path.dirname(__file__))
SITE_CONTENT_DOC_ROOT = os.path.join(SITE_CONTENT_ROOT, 'doc')
ENABLE_BUILTIN_MEDIA = getattr(settings, 'LYRICAL_PAGE_ENABLE_BUILTIN_MED... |
import logging
from collections import namedtuple
from .main import special_command, RAW_QUERY
TableInfo = namedtuple("TableInfo", ['checks', 'relkind', 'hasindex',
'hasrules', 'hastriggers', 'hasoids', 'tablespace', 'reloptions', 'reloftype',
'relpersistence'])
log = logging.getLogger(__name__)
@special_command('\... |
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import SetPasswordForm
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.utils import translation
from django import forms
from django.contrib.auth.models import AnonymousUser
from django.conf import settings
from d... |
from imgurpython import ImgurClient
from datetime import datetime
import tweepy
import time
from bs4 import BeautifulSoup
import urllib
import sys, os
import json
'''
TO DO:
-- clean up code
-- make the clock function to execute code at certian time
-- add some more comments
-- fix the issue with the cache... |
# -*- coding: utf-8 -*-
"""
Generating uniformly distributed image window from input image
This can also be considered as a "random cropping" layer of the
input image.
"""
from __future__ import absolute_import, division, print_function
import numpy as np
import tensorflow as tf
from niftynet.contrib.csv_reader.samp... |
from . import util
from . import emoji
import asyncio
import logging
import os.path
import re
import os
import urllib.request
import hashlib
import json
import appdirs
import hangups
import hangups.auth
import requests
from time import time
from slackclient import SlackClient
logger = logging.getLogger(__name__)
TICK... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
from contextlib import contextmanager... |
# -*- coding: utf-8 -*-
"""
Template loading and rendering
:Copyright: 2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from jinja2 import Environment, evalcontextfilter, Markup, PackageLoader, \
StrictUndefined
FILENAME_EXTENSION = '.html'
LOADER = PackageLoader('bombdefusalmanual.pages'... |
from __future__ import print_function, division, absolute_import
import numba
from numba import typeinfer, ir, ir_utils, config
from numba.ir_utils import visit_vars_inner
from numba import types
from numba.typing import signature
from numba.typing.templates import infer_global, AbstractTemplate
from hpat import distr... |
from __future__ import print_function, division, absolute_import
from collections import namedtuple
import pandas as pd
import datetime
import numba
from numba import ir, ir_utils
from numba.ir_utils import require, mk_unique_var
from numba import types
import numba.array_analysis
from numba.typing import signature
f... |
from django.core.management.base import BaseCommand, CommandError
from voty.initproc.models import Initiative
from voty.initproc.globals import STATES, NOTIFICATIONS
from django.template.loader import render_to_string
from django.core.mail import EmailMessage
from django.db.models import Count
from django.conf import s... |
import binascii
import logging.handlers
import mimetypes
import os
import platform
import random
import re
import socket
import string
import subprocess
import sys
import base58
import requests
import simplejson as json
from urllib2 import urlopen
from appdirs import user_data_dir
from datetime import datetime
from de... |
#!/usr/bin/env python
# Copyright (c) 2010 John McFarland
# This program is licensed under the MIT license. See LICENSE.txt
# Author: John McFarland
# This program will parse a selected set of Fortran source files and
# write C++ code to wrap the Fortran derived types in C++ classes
# Run fortwrap.py -h for usage... |
import datetime
import os
import twisted
from bugimporters.tests import (Bug, ReactorManager, TrackerModel,
FakeGetPage, HaskellTrackerModel)
from bugimporters.trac import TracBugImporter, TracBugParser
from mock import Mock
HERE = os.path.dirname(os.path.abspath(__file__))
# Create a global variable that c... |
import pygame
from behaviours.Move import Move
from behaviours.Behaviour import Behaviour
from behaviours.LifeSpan import LifeSpan
from entities.base.Entity import Entity
from src.GameMethods import GameMethods
class Shoot(Behaviour):
def __init__(self, ammo_class, fire_rate=1):
self.ammo_class = ammo_cla... |
"""Search backends used by django-watson."""
from __future__ import unicode_literals
import re, abc
from django.contrib.contenttypes.models import ContentType
from django.db import connection, transaction
from django.db.models import Q
from django.utils.encoding import force_text
from django.utils import six
from w... |
# -*- coding: utf-8 -*-
import os
import pickle
import re
import sys
import unicodedata
from flask import request, session
from lexos.helpers import constants as constants, \
general_functions as general_functions
def handle_special_characters(text):
"""
Replaces encoded characters with their correspond... |
#!/usr/bin/env python
# To use:
# python setup.py install
#
import os, sys, string
# this isn't in scipy_distutils -- need to figure out clean way to do that
from distutils import dep_util
from scipy_distutils.core import Extension
from scipy_distutils.misc_util import get_path, default_config_dict, dot_join
imp... |
from django import forms
from django.forms.widgets import RadioSelect
from django.utils.translation import ugettext_lazy as _
from apps.plea.fields import DSStackedRadioFieldRenderer
SATISFACTION_CHOICES = (
(5, _("very satisfied")),
(4, _("satisfied")),
(3, _("neither satisfied nor dissatisfied")),
(... |
import unittest
from Mariana.layers import *
import Mariana.costs as MC
import theano.tensor as tt
import numpy as N
class MLPTests(unittest.TestCase):
def setUp(self) :
self.xor_ins = [
[0, 0],
[0, 1],
[1, 0],
[1, 1]
]
self.xor_outs = [0, 1, 1, 0]
def tearDown(self) :
pass
def trainMLP_xor... |
from DocXMLRPCServer import DocXMLRPCServer
import httplib
from test import test_support
import threading
import time
import socket
import unittest
import xmlrpclib
PORT = None
def server(evt, numrequests):
serv = DocXMLRPCServer(("localhost", 0), logRequests=False)
try:
global PORT
PORT = se... |
"""
gui/average
~~~~~~~~~~~~~~~~~~~~
Graphical user interface for three-dimensional averaging of particles
:author: Maximilian Strauss, 2017
:copyright: Copyright (c) 2017 Jungmann Lab, Max Planck Institute of Biochemistry
"""
import functools
import multiprocessing
import os.path
import sys
impo... |
#------------------------------------------------------------------------------
# Copyright 2017 Esri
# 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... |
"""
picasso.simulate-gui
~~~~~~~~~~~~~~~~
GUI for Simulate :
Simulate single molcule fluorescence data
:author: Maximilian Thomas Strauss, 2016
:copyright: Copyright (c) 2016 Jungmann Lab, MPI of Biochemistry
"""
import csv
import glob as _glob
import os
import sys
import time
import importli... |
# See the file LICENSE.txt in this directory for license information for the
# Caja Corkboard demo.
"""
Interface for using the cajoling service.
Note that this makes use of the App Engine memcache service, so it will need
changes to work outside of App Engine or if you don't want it to touch memcache.
@author kprei... |
import feedparser
import urllib2
import urlparse
from BeautifulSoup import BeautifulSoup
from django.conf import settings
DEFAULT_HUB_URL = getattr(settings, 'PUSH_DEFAULT_HUB', '')
test_attr = lambda a, v, o: a in o and o[a] == v
def normalize_url(url, base_url):
"""Try to detect relative URLs and convert the... |
"""
Classes for representing differential and difference equations.
@author : David R. Pugh
"""
import collections
import sympy as sym
from . import symbolics
class ModelLike(object):
@property
def dependent_vars(self):
"""
Model dependent variables.
:getter: Return the model dep... |
import asyncio
from ubuntui.utils import Color, Padding
from ubuntui.widgets.buttons import submit_btn
from ubuntui.widgets.hr import HR
from ubuntui.widgets.input import (
IntegerEditor,
PasswordEditor,
SelectorHorizontal,
StringEditor,
YesNo
)
from urwid import Columns, Pile, Text, WidgetWrap
fr... |
import importlib
import inspect
import os
import sys
from rlbot.agents.base_agent import BaseAgent
class ExternalClassWrapper:
"""
Given the absolute path of a python file, this can load the associated module and find a class inside it
that extends the base class. The module in the target file may assume... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Tobias Wegner, tobias.wegner@cern.ch, 2017-2018
# - Alexey An... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.lisp
~~~~~~~~~~~~~~~~~~~~
Lexers for Lispy languages.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, words, default
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.