src stringlengths 721 1.04M |
|---|
import json
import urlparse
from feat.common import log, defer, error
from feat.web import httpclient, http
class Client(log.Logger, log.LogProxy):
def __init__(self, security_policy=None, logger=None):
log.Logger.__init__(self, logger)
log.LogProxy.__init__(self, logger)
self.security_p... |
import re
class BoothAssertions:
def configFileMissingMyIP(self, config_file=None, lock_file=None):
(pid, ret, stdout, stderr, runner) = \
self.run_booth(config_file=config_file, lock_file=lock_file,
expected_exitcode=1, expected_daemon=False)
expected_error ... |
#!/usr/bin/env python
import os
# variables
colorBlue = "\033[01;34m{0}\033[00m"
##############################################################################################################
runlocally()
os.system("clear")
banner()
print colorBlue.format("RECON")
print
firstName = raw_input("First name: ")
if fi... |
"""
Ragout API interface for ancestral genome reconstruction
"""
import os
import sys
import shutil
import logging
import argparse
from collections import namedtuple
from copy import deepcopy
ragout_root = os.path.dirname(os.path.realpath(__file__))
lib_absolute = os.path.join(ragout_root, "lib")
sys.path.insert(0, l... |
"""
gc.get_referrers() can be used to see objects before they are fully built.
Note that this is only an example. There are many ways to crash Python
by using gc.get_referrers(), as well as many extension modules (even
when they are using perfectly documented patterns to build objects).
Identifying and removing all ... |
#!/usr/bin/env python
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2013 <AUTHOR> <EMAIL>
#########################################################################
# ... |
from __future__ import absolute_import
import decimal
import pytest
import pandas as pd
import ibis
import ibis.expr.datatypes as dt
import os
@pytest.fixture(scope='module')
def df():
return pd.DataFrame({
'plain_int64': list(range(1, 4)),
'plain_strings': list('abc'),
'plain_float64... |
#!/usr/bin/env python
__author__ = "Mark Rushakoff"
__license__ = "MIT"
import sys
import urllib2
import re
import StringIO
import gzip
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
sys.stderr.write("simplejson or json required for operation. Abo... |
"""
Common regular expression stubs for URLconfs.
These are collected in a common module to ensure consistency across
the LASS platform.
"""
# Helper functions #
def relative(partials):
"""
Given a sequence of partial regexes, constructs a full regex that
treats the partial regexes as stages in a direc... |
"""Device pairing and derivation of encryption keys."""
import binascii
import logging
from typing import Optional
from pyatv import conf, exceptions
from pyatv.airplay.auth import AirPlayPairingProcedure
from pyatv.airplay.srp import LegacyCredentials, SRPAuthHandler, new_credentials
from pyatv.const import Protocol... |
#!/usr/bin/env python
import sys
import re
import os
inFilename = sys.argv[1]
if os.path.isfile(inFilename):
namelength = inFilename.rfind(".")
name = inFilename[0:namelength]
exten = inFilename[namelength:]
outFilename = name+"-cachecmp"+exten
print "inFilename:", inFilename
print "outFilename:", outFilename
fpR... |
# Copyright 2002 by Andrew Dalke. All rights reserved.
# Revisions 2007-2014 copyright by Peter Cock. All rights reserved.
# Revisions 2009 copyright by Cymon J. Cox. All rights reserved.
# Revisions 2013-2014 copyright by Tiago Antao. All rights reserved.
# This code is part of the Biopython distribution and gover... |
import ast
from os.path import expanduser
from stevedore import extension
from common import common_functions
from common import fm_logger
from dbmodule.objects import app as app_db
from dbmodule.objects import environment as env_db
from server.server_plugins.gcloud import gcloud_helper
home_dir = expanduser("~")
A... |
#!/usr/bin/env python
#
# Copyright (c) 2011, SmartFile <btimby@smartfile.com>
# All rights reserved.
#
# This file is part of django-webdav.
#
# Foobar 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, e... |
import pandas as pd
def rebalance_contributions(current_balance, target_allocation,
future_contributions):
"""
:param current_balance: Current balances as {"name": amount}
:param target_allocation: Target allocation as {"name": percentage}
:param future_contributions: Futur... |
import unittest
from cryptography import (eratosthenes, euler, extended_gcd, factorization,
gcd, modular_multiplicative_inverse)
from cryptography.ciphers import affine, shift, substitution, vigener
from .context import cryptography
class GcdTestSuite(unittest.TestCase):
"""Basic test ... |
"""
A set of classes for abstracting communication with remote servers. While the
urllib-family of modules provides similar functionality, they not provide for
querying the source for its metadata (size and modification date, in this case)
prior to fetching the resource itself.
All exceptions raised by these types inh... |
#!/usr/bin/python
#Uses all wordlists in a dir to crack a hash.
#
#www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import md5, sys, os, time
def getwords(wordlist):
try:
file = open(wordlist, "r")
words = file.readlines()
file.close()
except(IOError),msg:
words = ""
print "Error:",msg
pass
return wo... |
"""
.. py:module:: fnl.text.token
:synopsis: A tuple structure to hold token metadata.
.. moduleauthor:: Florian Leitner <florian.leitner@gmail.com>
.. License: GNU Affero GPL v3 (http://www.gnu.org/licenses/agpl.html)
"""
from operator import itemgetter, methodcaller
from fn import _
from fn.monad import optionabl... |
# 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 cv2
import numpy as np
im1 = cv2.imread('data/src/lena.jpg')
im2 = cv2.imread('data/src/rocket.jpg')
im_v = cv2.vconcat([im1, im1])
cv2.imwrite('data/dst/opencv_vconcat.jpg', im_v)
# True
im_v_np = np.tile(im1, (2, 1, 1))
cv2.imwrite('data/dst/opencv_vconcat_np.jpg', im_v_np)
# True
def vconcat_resize_min(im... |
# -*- coding: utf-8 -*-
"""
Helper functions used in views.
"""
import csv
from json import dumps
from functools import wraps
from datetime import datetime
from flask import Response
from presence_analyzer.main import app
import logging
log = logging.getLogger(__name__) # pylint: disable=invalid-name
def jsonify... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Cédric Picard
#
# LICENSE
# 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) ... |
import flowio
import os
import sys
if len(sys.argv) > 1:
flow_dir = sys.argv[1]
else:
flow_dir = os.getcwd()
files = os.listdir(flow_dir)
for file in files:
try:
flow_data = flowio.FlowData("/".join([flow_dir,file]))
except:
continue
print file + ':'
for key in sorted(flow_da... |
#!c:/Python27/python.exe
import cgi
import os
import traceback
from mapparser import ParseMap
from gpxparser import ParseGpxFile
from model import Track
from orchestrator import ProcessTrkSegWithProgress
from config import maps_root
from cgiparser import FormParseInt,FormParseStr,FormParseOptions,FormParseBool
from lo... |
import os
from LogInOut import logout
def doctorCommands(cursor, conn, staff_id):
loggedOut = False
while not loggedOut:
os.system("clear")
choice = int(raw_input('''Type integer value of desired task:
1. Get patient chart info.
2. Rec... |
# coding: utf-8
"""
tinycss.token_data
------------------
Shared data for both implementations (Cython and Python) of the tokenizer.
:copyright: (c) 2012 by Simon Sapin.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import functools
import operator
impo... |
# magic function that checks a cell for pep8 compliance
# %%pep8
# a=1
# should give an error about missing spaces
import sys
import tempfile
import io
import logging
from IPython.core.magic import register_cell_magic
def load_ipython_extension(ipython):
# The `ipython` argument is the currently active `Interac... |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import *
from cocos.layer import *
from cocos.scenes import *
from cocos.sprite import *... |
# -*- coding: utf-8 -*-
import itertools
from sre_constants import *
import sre_parse
import string
import random
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver, LocaleRegexURLResolver
from django.utils import translation
from django.core.exceptions import ViewDoesNotExist
from django.contrib.a... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# This file is part of Guadalinex
#
# This software is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, ... |
"""
ModelTree.py (author: Anson Wong / git: ankonzoid)
"""
import numpy as np
from copy import deepcopy
from graphviz import Digraph
class ModelTree(object):
def __init__(self, model, max_depth=5, min_samples_leaf=10,
search_type="greedy", n_search_grid=100):
self.model = model
... |
import unittest
import translate_utils
import os
import shutil
class TestRawData(unittest.TestCase):
def test_translate_text(self):
file = open("dummy_file.txt", 'w')
file.write(" Ram \n")
file.close()
translate_utils.translate_data("dummy_file.txt", "dummy_output.txt")
d... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... |
#!/usr/bin/env python
import numpy as np
import json
import rospy
import scipy.interpolate
import threading
import argparse
from std_msgs.msg import Header
from sub8_msgs.msg import Thrust, ThrusterCmd, ThrusterStatus
from sub8_ros_tools import wait_for_param, thread_lock
from sub8_msgs.srv import ThrusterInfo, Thruste... |
# Copyright 2015 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 topaz.module import ClassDef
from topaz.objects.objectobject import W_Object
from topaz.modules.ffi.pointer import W_PointerObject
from topaz.coerce import Coerce
from rpython.rlib import clibffi
from rpython.rtyper.lltypesystem import rffi
class W_DynamicLibraryObject(W_Object):
classdef = ClassDef('Dynamic... |
# -*- coding: utf-8 -*-
#
# Aldryn Newsblog documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 10 15:42:58 2014.
#
# 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 fil... |
import sys
import os
path = os.path.realpath(__file__)
sys.path.insert(0, path[0: path.rfind('ixnetwork')])
from ixnetwork.IxnHttp import IxnHttp
from ixnetwork.IxnConfigManagement import IxnConfigManagement
from ixnetwork.IxnPortManagement import IxnPortManagement
from ixnetwork.IxnStatManagement import IxnSt... |
# This file is part of the TREZOR project.
#
# Copyright (C) 2012-2016 Marek Palatinus <slush@satoshilabs.com>
# Copyright (C) 2012-2016 Pavol Rusnak <stick@satoshilabs.com>
# Copyright (C) 2016 Jochen Hoenicke <hoenicke@gmail.com>
#
# This library is free software: you can redistribute it and/or modify
# it under... |
# Authors: Rob Zinkov, Mathieu Blondel
# License: BSD 3 clause
from ..utils.validation import _deprecate_positional_args
from ._stochastic_gradient import BaseSGDClassifier
from ._stochastic_gradient import BaseSGDRegressor
from ._stochastic_gradient import DEFAULT_EPSILON
class PassiveAggressiveClassifier(BaseSGDCl... |
# -*- coding: utf-8 -*-
from cms.models.pluginmodel import CMSPlugin
from cms.models.pagemodel import Page
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext as _
from django.utils.timezone import utc
from easy_thumbna... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Maxime Le Coz <lecoz@irit.fr>
# This file is part of TimeSide.
# TimeSide is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# ... |
# update_data_header.py
#
# Copyright 2010 dan collins <danc@badbytes.net>
#
# 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 2 of the License, or
# ... |
# Copyright 2013, Couchbase, 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 required by applicable law... |
from flask import (render_template, flash, redirect, url_for, request,
send_from_directory, make_response)
from iliasCorrector import app, db
from iliasCorrector.models import Exercise, Submission, File
from iliasCorrector import utils
from werkzeug import secure_filename
from sqlalchemy import func
... |
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
BASE_URL = 'http://www.openwatch.net'
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... |
# Make a hash chain with O(1) update and O(log(N)) proof of membership
from hashlib import sha256 as H
from struct import pack
# Some constants
# The initial value of any chain
# https://en.wikipedia.org/wiki/Om
initialH = H("Om").digest()
def pointFingers(seqLen):
""" Returns the indexes for a particular seque... |
# -*- coding: utf-8 -*-
#
# django-real-content documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 14 13:31:41 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... |
#!/usr/bin/env python
# file test_make_otu_table
__author__ = "Rob Knight"
__copyright__ = "Copyright 2011, The QIIME Project" # consider project name
__credits__ = ["Rob Knight", "Justin Kuczynski", "Adam Robbins-Pianka"]
__license__ = "GPL"
__version__ = "1.8.0-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gre... |
__author__ = 'Bohdan Mushkevych'
from odm.document import BaseDocument
from odm.fields import StringField, DictField, ListField
from synergy.scheduler.scheduler_constants import TYPE_MANAGED, TYPE_FREERUN, TYPE_GARBAGE_COLLECTOR, EXCHANGE_UTILS, \
TYPE_DAEMON
PROCESS_NAME = 'process_name'
CLASSNAME = 'classname... |
##
# \namespace cross3d.abstract.abstractscenecamera
#
# \remarks The AbstractSceneObject class provides the base foundation for the 3d Object framework for the cross3d system
# This class will provide a generic overview structure for all manipulations of 3d objects
#
# \author eric
# \author Blur Studio
#... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import str
from builtins import bytes
from future import standard_library
standard_library.install_aliases()
from builtins import object
import requests as r... |
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
# mainframe.py
# Pomodoro
#
# Created by Roman Rader on 22.06.11.
# New BSD License 2011 Antigluk https://github.com/antigluk/Pomodoro
"""
Contains main frame of application.
"""
import wx
from state import PomodoroStateProxy as PomodoroState
from NotificationCente... |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright (C) 2008-2014
# Christian Kohlöffel
# Vinzenz Schulz
#
# This file is part of DXF2GCODE.
#
# DXF2GCODE is free software: you can redistribute it and/or modify
# it under the terms... |
#!/usr/bin/env python
import re
import sys
class ParseError:
def setDefaults(self):
if self.format==None:
self.format='dig'
class RRSet(object):
"""an RRSet contains one or more resource records of the same name,
type and class (and possibly TTL, not sure what to do with that yet."""
def __init__(self, ... |
#The main script for extracting Extrnal CSS links from list of sites. Uses Selenium webdriver
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementE... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... |
def list_by_list(blist, slist):
slist_blocks = []
for block in blist:
if block in slist:
slist_blocks.append(block)
return slist_blocks
def by_image_seq(blocks, image_seq):
seq_blocks = []
for block in blocks:
if blocks[block].ec_hdr.image_seq == image_... |
from __future__ import absolute_import
import sys
import datetime as dt
from collections import OrderedDict, defaultdict, Iterable
try:
import itertools.izip as zip
except ImportError:
pass
import numpy as np
from .dictionary import DictInterface
from .interface import Interface, DataError
from ..dimension ... |
import argparse
import os
import warnings
import numpy as np
import tensorflow as tf
from keras.applications.resnet50 import preprocess_input
from keras.preprocessing.image import ImageDataGenerator
from tensorflow import keras
from tensorflow.keras.applications import MobileNetV2, ResNet50
from tensorflow.keras.model... |
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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,... |
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.views import static
from casepro.backend import get_backend
from casepro.utils.views import PartialTemplate
urlpatterns = [
url(r'', include('casepro.cases.urls')),
... |
# Copyright 2019 Allan Galarza
#
# 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 writi... |
#!/usr/bin/env python
#Copyright IBM Corporation 2015.
#LICENSE: Apache License 2.0 http://opensource.org/licenses/Apache-2.0
import os
import optparse
import logging
from voyage import *
def main():
usage = "usage: python %prog -f <config_file> {--list | --migrate --source <source> --container <container> --tar... |
import wx
import random
from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
def randColor():
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
return (r, g, b)
class TextPanel(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, ... |
import numpy as np
import random
environment = {
0: [('buongiorno',[[1,0,1]]),('un caffè',[[7,0,1]])],
1: [('un caffè',[[2,0,0.8],[12,-2,0.2]])],
2: [('per favore',[[3,0,1]]),('EOS',[[5,-2,0.9],[6,-1,0.1]])],
3: [('EOS',[[4,-1,1]])],
7: [('per favore',[[8,0,1]]),('EOS',[[9,-3,1]])],
8: [('EOS',[[10,-2,0.9],[11,-... |
import unittest
from array import array
import ROOT
from ROOT import SetOwnership, addressof
import numpy as np
class TTreeBranch(unittest.TestCase):
"""
Test for the pythonization of TTree::Branch, which allows to pass proxy
references as arguments from the Python side. Example:
`v = ROOT.std.vector... |
#!/usr/bin/python
import itertools
import os
import fnmatch
import re
import sys
import argparse
import ninja_syntax
import gcc
import msvc
# --- util functions
def flags(*iterables):
return ' '.join(itertools.chain(*iterables))
def get_files(root, pattern):
pattern = fnmatch.translate(pattern)
for dir... |
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from accounts.models import UserProfile
from annoying.functions import get_config
from recaptcha_works.fields import RecaptchaField
class RegisterFo... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorlayer.layers.core import Layer
from tensorlayer import logging
from tensorlayer.decorators import deprecated_alias
__all__ = [
'ExpandDims',
'Tile',
]
class ExpandDims(Layer):
"""
The :class:`ExpandDims` class inserts a... |
#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... |
from __future__ import print_function
import IMP
import IMP.test
import IMP.core
import IMP.algebra
import IMP.atom
import IMP.domino
class Tests(IMP.test.TestCase):
"""Tests for nested RigidBody function"""
def test_nested2(self):
"""Test nested with transformations"""
mdl = IMP.Model()
... |
import pkg_resources
import theano
from theano.sandbox.cuda.type import CudaNdarrayType
from theano.sandbox.cuda import GpuOp
from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable
try:
from theano.sandbox.cuda import cuda_ndarray
dimshuffle = cuda_ndarray.cuda_ndarray.dimshuffle
except ImportErro... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created: Thu Oct 10 19:57:03 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Att... |
#!/usr/bin/python
from datetime import datetime, date, timedelta
from pymc import *
import numpy as np
dates = [ date(1992, 4, 21),
date(1993, 5, 31),
date(1994, 6, 30),
date(1995, 6, 2),
date(1996, 6, 17),
date(1997, 6, 1),
date(1998, 7, 27),
date... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Gitools documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 9 15:18:32 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
# auto... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
# database.py is part of Panopticon.
# Panopticon 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.
# Panopticon is distributed in the ... |
import binascii
import urllib2
import json
from hashlib import sha1
import base64
import datetime
import calendar
import time
__author__ = 'DeStars'
class OmnitureWrapper:
def __init__(self, user_name, secret):
self._user_name = user_name
self._secret = secret
def __create_header(self):
... |
'''
ResultClient tests.
'''
import os
import unittest
import pandas as pd
import time
from mljar.client.project import ProjectClient
from mljar.client.dataset import DatasetClient
from mljar.client.experiment import ExperimentClient
from mljar.client.result import ResultClient
from mljar.exceptions import BadRequestEx... |
import json
from parser import ParserError
from yaml.error import MarkedYAMLError
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, filter, map, zip)
from jsonschema.exceptions import SchemaError
import repoze.lru
from con... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-04 05:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... |
#-*- coding: utf-8 -*-
import os
import time
import socket
import urllib, urlparse
import hashlib
import threading
import Queue
from cStringIO import StringIO
import base64
from defs import *
from protocol import parse_frame, make_frame
from utils import r_select
class Client(object):
def __in... |
#!/usr/bin/env python
import datetime
from common.dbconnect import mongo_connect, find_session
from common.hashmethods import *
import tldextract
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
from collections import OrderedDict
from common.entities import pcapFile
fr... |
#
# Module which deals with pickling of objects.
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
import copyreg
import functools
import io
import os
import pickle
import socket
import sys
__all__ = ['send... |
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from .fields import (
ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField,
DateRangeField, DateTimeRangeField, FloatRangeField, HStoreField,
IntegerRangeField, JSONField, SearchVectorField,
)
clas... |
import base64
import re
import threading
from binascii import hexlify, unhexlify
from functools import partial
from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey,
public_key_to_p2pkh, EncodeBase58Check,
TYPE_ADDRESS, TYPE_SCRIPT,
... |
#!/usr/bin/python
################################################################
#
# Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at... |
#!/usr/bin/env python3
from BasicPID import BasicPID2, VideoPID
from RPIO import PWM
from MiniMu9 import Accelerometer
from MotorControl import MotorControl
import sys
import time
PWM.set_loglevel(PWM.LOG_LEVEL_ERRORS)
servo = PWM.Servo(pulse_incr_us=1)
PWM_MAX = 2000
PWM_MIN = 1000
PWM_RANGE = PWM_MAX - PWM_MIN
... |
import wx
import datetime
from wxbanker.plots import plotfactory
from wxbanker.lib.pubsub import Publisher
try:
try:
from wxbanker.plots import baseplot
except plotfactory.BasePlotImportException:
raise plotfactory.PlotLibraryImportException('cairo', 'python-numpy')
from wxbanker.cairoplot ... |
from ..token import Token
from .node import Node
from .identifier_list import IdentifierList
class WriteStatement(Node):
"""
A write statement.
"""
def __init__(self):
"""
Create the write statement.
"""
self.identifiers = IdentifierList()
@classmethod
def pa... |
"""ui.py - UI definitions for main window.
"""
import gtk
from mcomix import bookmark_menu
from mcomix import openwith_menu
from mcomix import edit_dialog
from mcomix import enhance_dialog
from mcomix import preferences_dialog
from mcomix import recent
from mcomix import dialog_handler
from mcomix import constants
fr... |
from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
import re
from openpyxl.compat import unicode, long
from openpyxl.cell import Cell
from openpyxl.utils import get_column_letter
from openpyxl.utils.datetime import from_excel
from openpyxl.styles import is_date_format
from openpyxl.styles.numb... |
from synergine.core.exception.NotFoundError import NotFoundError
class ConfigurationManager():
"""
Management of dict based configuration data
"""
def __init__(self, config: dict={}):
self._configs = config
def get(self, config_name: "the.config.name", default=None):
inceptions =... |
"""
Generate classes defined in the datamodel.
"""
import collections
from copy import deepcopy
import datetime
import hashlib
import inspect
from uuid import uuid4
import warnings
import weakref
import numpy as np
import tables
import spectroscopy.util
class ResourceIdentifier(object):
"""
Unique identifie... |
#This program takes simple input from the Mio to unlock a complex password string and log in to email
#Further developement would allow it to log into social media accounts/computerss
#A program by Ethan Liang
from __future__ import print_function
import myo as libmyo; libmyo.init()
import time
import sys
import smtp... |
#!/usr/bin/env python
import sys
import time
import swagger_client
from swagger_client.rest import ApiException
from utils.utils import smart_open
import argparse
import pandas as pd
MAX_NUM_CANDLES_BITMEX = 500
def print_file(file_or_stdout, api_instance, bin_size, partial, symbol, reverse, start_time, end_time)... |
import pytest
from pykka import ActorRegistry
pytestmark = pytest.mark.usefixtures("stop_all")
class ActorBase:
received_messages = None
def __init__(self):
super().__init__()
self.received_messages = []
def on_receive(self, message):
self.received_messages.append(message)
@p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.