text stringlengths 12 6.59M |
|---|
from __future__ import absolute_import
import logging
try:
import simplejson as json
_ = json # pyflakes
except ImportError:
import json
from .storm import SimpleBolt
log = logging.getLogger(__name__)
class JSONFieldsBolt(SimpleBolt):
def extract_fields(self, json_dict):
"""Implement in a... |
"""Utility functions available for use by Controllers
``etag_cache``, ``redirect_to``, and ``abort``.
"""
import logging
import mimetypes
import warnings
import paste.httpexceptions as httpexceptions
from routes import url_for
from webob import Request as WebObRequest
from webob import Response as WebObResponse
from ... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module define a WulffShape class to generate the Wulff shape from
a lattice, a list of indices and their corresponding surface energies,
and the total area and volume of the wulff shape,the weighted su... |
#!/usr/bin/env python
"""
This module provides classes used to define a structure, such as
Site, PeriodicSite, Structure, and Composition.
"""
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__e... |
#!/usr/bin/env python
"""
This module provides classes used to define a non-periodic molecule and a
periodic structure.
"""
from __future__ import division
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "2.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mi... |
import time
import lib.xbox as xbox
import pigpio
import RPi.GPIO as GPIO
MIN = 1000
MAX = 2500
SPEED = 1000
STEP = 100
SLEEP_TIME = 0.5
esc1 = 6
esc2 = 13
esc3 = 19
esc4 = 26
def setSpeed(value):
pi.set_servo_pulsewidth(esc1, value)
pi.set_servo_pulsewidth(esc2, value)
pi.set_servo_pulsewidth(esc3, val... |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2016 PyMeasure Developers
#
# 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 limit... |
"""
Defines common types and type related utilities: Singleton, etc.
These types can be shared by other utils modules and imported into util main namespace for use by other pymel modules
"""
import inspect, types, operator, sys, warnings
class Singleton(type):
""" Metaclass for Singleton classes.
>>> cl... |
# Copyright 2009-2012 10gen, 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 writing,... |
# pyOCD debugger
# Copyright (c) 2015-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
# pyOCD debugger
# Copyright (c) 2018 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# ... |
from .baseapi import BaseAPI
from pypaystack import utils
class Transaction(BaseAPI):
def getall(self, pagination=10):
"""
Gets all your transactions
args:
pagination -- Count of data to return per call
"""
url = self._url("/transaction/?perPage="+str(pa... |
import os
import glob
import shutil
import sys
import math
import datetime as dt
import subprocess as sp
import numpy as np
import warnings
import xml.etree.ElementTree as ET
from astropy import __version__ as astropy_version
from astropy import wcs
from astropy.io import fits, votable
from astropy.table import Table, ... |
"""
This file is part of the pyquaternion python module
Author: Kieran Wynn
Website: https://github.com/KieranWynn/pyquaternion
Documentation: http://kieranwynn.github.io/pyquaternion/
Version: 1.0.0
License: The MIT License (MIT)
Copyright (c) 2015 Kieran Wynn
Permission is hereby g... |
__author__ = 'Sudipta Basak'
__date_created__ = '4/02/16'
import PyAPS as pa
import numpy as np
import sys
import os
from pyrate.scripts import run_pyrate
from pyrate.tests.common import sydney_data_setup
from pyrate.tests.common import SYD_TEST_DEM_UNW
import re
PTN = re.compile(r'\d{6}')
PYRATEPATH = os.environ['PYR... |
#! /usr/bin/python2.4
# vim:sw=8:ts=8:et:nowrap
import sys
import urllib
import urllib2
import urlparse
import re
import os.path
import xml.sax
import time
import tempfile
import string
import miscfuncs
import shutil
import mx.DateTime
toppath = miscfuncs.toppath
pwcmdirs = miscfuncs.pwcmdirs
tempfilename = miscfuncs... |
"""
Classes used to describe instructions that combine together to make a protocol.
Notes
-----
.. [1] https://www.transcriptic.com/platform/#instr_storage
"""
from pyscriptic.storage import STORAGE_LOCATIONS
from pyscriptic.measures import check_volume, check_duration, check_speed, \
check_length, check_tempera... |
# ******************************************************************************
# pysimm.apps.random_walk module
# ******************************************************************************
#
# psuedo random walk algorithm written using pysimm tools
#
# *************************************************************... |
#
# 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 us... |
# -*- coding: utf-8 -*-
"""
Syllable tools
"""
import re
from pythainlp import thai_consonants
spelling_class = {
"กง": list("ง"),
"กม": list("ม"),
"เกย": list("ย"),
"เกอว": list("ว"),
"กน": list("นญณรลฬ"),
"กก": list("กขคฆ"),
"กด": list("ดจชซฎฏฐฑฒตถทธศษส"),
"กบ": list("บปภพฟ")
}
thai_... |
#!/usr/bin/python3
# Author: Joseph Bull ("***Curren*cy*tsea***")
# Email: joetbull@gmail.com (alternate: jtbull@uw.edu)
# # # # Do not redistribute without permission # # # #
__author__ = "Joseph 'currentsea' Bull"
__copyright__ = "Copyright 2016, seclorum"
import os
import sys
import json
import uuid
import pyt... |
#!/usr/bin/env python
import ROOT as r
import tutils as tu
import numpy as np
from cStringIO import StringIO
import dlist
import sys
import pyutils as ut
import IPython
from string import atof,atoi
def read_data(fn = None):
f = sys.stdin
if fn != None:
f = open(fn)
lines = f.read()
if f != sys.stdin:
f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name:
# Purpose: This .py file extracts adjacency lists and detects communities
# from the corresponding timeslots.
#
# Required libs: python-dateutil,pyparsing,numpy,ma... |
import os
import sys
import scipy as sp
import math
def default_settings():
CFG = dict()
### import necessary paths
CFG['paths'] = []
if 'SPLADDER_SRC_PATH' in os.environ:
CFG['paths'].append(os.environ['SPLADDER_SRC_PATH'])
CFG['paths'].append('%s/utils' % os.environ['SPLADDER_SRC_P... |
import collections
import itertools
import logging
import os
import sys
import time
import html
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Generic,
Iterable,
Iterator,
List,
Type,
Optional,
Tuple,
Union,
)
from uuid import uuid4
import warnings
import numpy... |
__version__ = '1.3.3'
import argparse
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import itertools
import functools
import h5py
import numpy as np
import os
from libscrappy import ffi, lib
ftype = np.float32
size_ftype = np.dtype(ftype).itemsize
vsize = 4 # SSE vector length
def _none_i... |
__version__ = '1.3.3'
import argparse
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import itertools
import functools
import h5py
import numpy as np
import os
from libscrappy import ffi, lib
ftype = np.float32
size_ftype = np.dtype(ftype).itemsize
vsize = 4 # SSE vector length
def _none_i... |
"""
A set of functions that can be used for the latter part of the reduction
of Subaru SuprimeCam data.
Note that the current approach is to use Subaru's SDFRED pipeline for the
following steps:
File renaming: namechange.csh
Overscan subtraction: overscansub.csh
Flat-field creation: mask_mkflat_HA.c... |
class Tape:
def __init__(self, runtime, loss=None):
self.calls = []
self.entered = False
self.gradient_evaluated = False
self.runtime = runtime
self.eval_on_exit = loss is not None
def __enter__(self):
self.runtime.target_tape = self
assert self.entered == False, "Tape can be entered ... |
# Copyright 2010 ITA Software, 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... |
VERSION = "0.2.4"
|
#
#
# This source file is part of ELINA (ETH LIbrary for Numerical Analysis).
# ELINA is Copyright © 2019 Department of Computer Science, ETH Zurich
# This software is distributed under GNU Lesser General Public License Version 3.0.
# For more information, see the ELINA project website at:
# http://elina.ethz.ch
#... |
# -*- coding: utf-8 -*-
"""
Provides the PythonKC Meetup.com API client implementation.
"""
from pythonkc_meetups.exceptions import PythonKCMeetupsBadJson
from pythonkc_meetups.exceptions import PythonKCMeetupsBadResponse
from pythonkc_meetups.exceptions import PythonKCMeetupsMeetupDown
from pythonkc_meetups.excepti... |
# -*- coding: utf-8 -*-
import os
import re
import glob
import tempfile
from tempfile import mkdtemp
import subprocess
import sys
import shutil
def pythonrouge(peer_sentence, model_sentence, ROUGE_path, data_path):
temp_dir = tempfile.mkdtemp()
summary_dir = os.path.join(temp_dir, "model")
reference_dir = ... |
from __future__ import unicode_literals, print_function
import six
import os
__all__ = (
'has_command_handler',
'call_command_handler',
)
COMMANDS_TO_HANDLERS = {} # Global mapping Vi commands to their handler.
COMMANDS_TAKING_LOCATIONS = set() # Name of commands that accept locations.
SET_COMMANDS = {} #... |
# GUI Application automation and testing library
# Copyright (C) 2006-2017 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... |
import os
import glob
import shutil
import itertools
import logging
from nipype.pipeline import engine as pe
from nipype.interfaces.utility import (IdentityInterface, Function)
from nipype.interfaces.dcmstack import DcmStack
import qixnat
from ..interfaces import (Gate, FixDicom, Compress, XNATFind, XNATUpload)
from .w... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
#!/usr/bin/env python
__author__ = "Gao Wang"
__copyright__ = "Copyright 2016, Stephens lab"
__email__ = "gaow@uchicago.edu"
__license__ = "MIT"
'''
Test rpy2 installation:
python -m 'rpy2.tests'
'''
def load_mpk(mpk_files, jobs = 2):
import msgpack, collections
from multiprocessing import Process, Manager
... |
import copy
import itertools
from collections import defaultdict, deque
from operator import mul
from abc import abstractmethod
from raco import algebra, expression, rules
from raco.catalog import Catalog
from raco.language import Language
from raco.utility import emit
from raco.expression import (accessed_columns, to... |
import raco.myrial.groupby as groupby
import raco.myrial.multiway as multiway
import raco.algebra
import raco.expression
import raco.catalog
import raco.scheme
from raco.language import MyriaAlgebra
from raco.algebra import LogicalAlgebra
from raco.myrialang import compile_to_json
from raco.compile import optimize
from... |
# Copyright 2013: Mirantis 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 b... |
'''
High-level functions and classes for solving a wide variety of economic models.
The "core" of HARK is a framework for "microeconomic" and "macroeconomic"
models. A micro model concerns the dynamic optimization problem for some type
of agents, where agents take the inputs to their problem as exogenous. A macro
mod... |
"""
Module for handling Fekete points approximations.
"""
from math import pi, sin
from numpy import empty, arange, array, ndarray
from numpy.linalg import solve
from gauss_lobatto_points import points
def get_x_phys(x_ref, a, b):
return (a+b)/2. + x_ref*(b-a)/2.;
class Mesh1D(object):
def __init__(self, ... |
from flask import Flask, request, make_response
import requests
import settings
import random
import urllib
app = Flask(__name__, static_url_path='/\x00\x00\x00\x00\x00\x00\x00\x00/') # do not serve static
def setup_google_connection():
from requests.packages.urllib3.util import connection
from google_conn... |
# Spirit of Ryuu
# 2017/9/3
# Kevin
# Spirit of Ryuu
# 2017/8/31
# Kevin
# Spirit of Ryuu
# 2017/8/15
# Kevin
import os, time, select, signal
import tensorflow as tf
import numpy as np
from abc import ABCMeta, abstractmethod
import tensorflow.contrib.data as tdata
from convert_to_tfrecords import parse_function_make... |
#!/usr/bin/env python
__usage__ = '''
Filters filenames and commit messages from `cvs log` command
to stdout.
Usage:
cvs log -d">2004/04/15" | /path/to/cvs_log_cleanup.py
'''
import sys
import re
line = 1
working_file = re.compile(r'Working file: (?P<filename>.*)').match
descr_start = re.compile(r'----------------... |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import logging as log
import threading
from signal import SIGINT, SIGTERM, signal
from Launcher import LauncherError
from StatusPrinter import get_status_printer
from Time... |
#!/usr/bin/env python3
#
# Copyright (c) 2014, 2016 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implem... |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import logging as log
from collections import OrderedDict
from enum import Enum
from reggen.validate import check_keys
# For the reference
# val_types = {
# 'd': ["int... |
# Analyze reflectance signal data in an index
import os
import cv2
import numpy as np
import pandas as pd
from plantcv.plantcv import params
from plantcv.plantcv import outputs
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import fatal_error
from plotnine import gg... |
"""
Utility methods for choosing bam samples to display for a particular ExAC variant.
"""
from collections import OrderedDict
def _is_hemizygous_segment(chrom, pos):
"""Utility method that takes a chromosome (eg. '1', '2', 'X'..) and a position integer and returns True if the
it's on the X or Y chromosome a... |
import os
from datetime import datetime
import jinja2
import markupsafe
from bs4 import BeautifulSoup
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django_comments_xtd.templatetags.comments_xtd import XtdComment
from django_jinja import library
@library.global_funct... |
"""Universal Language Codes
This library aims to provide an [en/de]coding utility for language codes.
To get a "universal" language code you create a LanguageCode object, giving it
the code and the standard it should use to look up that code.
>>> lc = LanguageCode('en', 'iso-639-1')
Internally the code is store... |
#!/usr/bin/python3
# This file is part of AEJS (http://aejs.org/).
#
# AEJS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... |
# -*- coding: utf-8 -*-
from .base import Base as Settings
class Testing(Settings):
# Database Configuration.
# --------------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
... |
#!/usr/bin/env python
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import sys
import logging
logging.basicConfig()
sys.path.append("..")
from lib.cuckoo.core.processor import Processor
... |
# coding=utf-8
# Copyright 2020 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
#!/usr/bin/env python
#
# Copyright (c) 2005-2008 Dustin Sallings <dustin@spy.net>
#
# 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 rig... |
#!/usr/bin/python
import math
import optparse
import sys
from utils.helpers import *
from utils.commandhelp import hist
def calc_bins(n, min_val, max_val, h=None):
"calculate number of bins for the histogram"
if not h:
h = max(10, math.log(n + 1, 2))
bin_width = (max_val - min_val) / h
for b in... |
#! /usr/bin/env python
#
# Copyright 2014-2022 Bas C. Jansen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an... |
__version__ = '0.14.0'
|
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
def urlsplit(url):
""" Splits a URL like "https://example.com/a/b?c=d&e#f" into a tuple:
("https", ["example", "com"], ["a", "b"], ["... |
#! /usr/bin/env python
from datetime import datetime
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from scipy.interpolate import interp1d
import scipy.optimize
from scipy.optimize import curve_fit
from Tkinter import *
import base64
import collections
import glob
import iterto... |
# This file is part of beets.
# Copyright 2016, Fabrice Laporte
#
# 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, ... |
""" Path utilities for benchbuild. """
import os
def list_to_path(pathlist):
"""Convert a list of path elements to a path string."""
return os.path.pathsep.join(pathlist)
def path_to_list(pathstr):
"""Conver a path string to a list of path elements."""
return [elem for elem in pathstr.split(os.path.... |
# This file is part of LiSE, a framework for life simulation games.
# Copyright (c) 2013-2014 Zachary Spector, zacharyspector@gmail.com
""" The fundamental unit of game logic, the Rule, and structures to
store and organize them in.
A Rule is three lists of functions: triggers, prereqs, and actions.
The actions do som... |
# BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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 Lic... |
# This file is part of LiSE, a framework for life simulation games.
# Copyright (c) 2013 Zachary Spector, zacharyspector@gmail.com
"""Common utility functions and data structures.
"""
from collections import Mapping
from copy import deepcopy
from gorm.xjson import JSONReWrapper, JSONListReWrapper, json_deepcopy
from ... |
# ----------------------------------------------------------------------------
# Copyright (c) 2015--, The WGS-HGT Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -------------------------------------------... |
#!/usr/bin/env python
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserv... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 03 09:46:30 2015
LineGroup at its core is simply a list of lines and the operations we can perform
on them. It keeps track of various characteristics of the lines as the are entered
so they do not need to be calculated when called.
This module stores the
@author: lvanh... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... |
import webbrowser
from bibliopixel.drivers.SimPixel import DriverSimPixel
from bibliopixel import LEDCircle, LEDMatrix, layout
HELP = """
Run a demo. For the list of possible demos, type
$ bibliopixel demo list
"""
SIMPIXEL_URL = 'http://beta.simpixel.io'
IMPORT_ERROR_TEXT = """
Please install the BiblioPixelAn... |
#!/usr/bin/python
# By Anton Gustafsson
# 2014-04-05
import os
import sys
import subprocess
from time import sleep
import time
import mosquitto
import thread
PORT = '/dev/ttyUSB0'
PREFIX = "rfxcom"
MQTT_HOST = "localhost"
TOPIC = "#"
class MQTTstage(mosquitto.Mosquitto):
def __init__(self,path,ip = "localhost"... |
#!/usr/bin/env python
###
# Copyright (c) 2002, Jeremiah Fincher
# 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,
# ... |
#!/usr/bin/env python
###
# Copyright (c) 2002, Jeremiah Fincher
# 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,
# ... |
#!/usr/bin/env python
#
# RnaChipIntegrator.py: analyse genomic features with peak data
# Copyright (C) University of Manchester 2011-15 Peter Briggs, Leo Zeef
# & Ian Donaldson
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the Artistic License 2.0 (se... |
from DB import *
import appconfig
import datetime
from flask import session
from werkzeug.security import generate_password_hash, check_password_hash
from werkzeug import secure_filename
import os
import time
UPLOAD_FOLDER = 'static/files/'
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
class ... |
"""
Markov chain Monte Carlo (MCMC) simulation, implementing an adaptive form of random walk Metropolis-Hastings sampling.
"""
# Import system functions
import sys, time, pdb
# Import numpy functions
from numpy import random, linalg
# Generalized inverse
inverse = linalg.pinv
from numpy import absolute, any, arange, ... |
#!/usr/bin/env python
import argparse, os,sys
from numpy import *
import numpy as np
from scipy.special import gamma
from scipy.special import beta as f_beta
import scipy.special
import random as rand
import platform, time
import multiprocessing, thread
import multiprocessing.pool
import os, csv, glob
from scipy.speci... |
from flask import Flask, request
import base64
import hashlib
import hmac
import json
#import requests
app = Flask(__name__)
access_token = 'qgdntcUqQibpcFZwTLOarjqCmPtXS/d5E8zovhoZS/Rd7e1Ue0JLVMzSGLwQB6r4+rDpddQcEBRILXlWXA4X80ZNWRToRf1ex1oi2RqR/jXjb/iNQbHjlZmxnqLfgKDnnlSa1KWeGtWqxptHoD0dGgdB04t89/1O/w1cDnyilFU='
... |
#!/usr/bin/env python
# encoding: utf-8
"""
Manage default email client and display help.
Usage:
mailto.py <action> [<path>|<query>]
Possible actions:
client [<query>]
Show/choose email client
set <path>
Set the email client to use to application at <path>.
Called when an option in the above call i... |
import chainer
import chainer.functions as F
import numpy as np
from common import mst, nn
"""
NOTE: Weight Initialization comparison
- A. This Implementation
- URL: https://github.com/chantera/biaffineparser
- Framework: Chainer (v5.2)
- Initialization:
- Embeddings (word): zero + pretrained (no... |
#!/usr/bin/python
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GstNet, GObject
GObject.threads_init()
Gst.init(None)
class Player(object):
def __init__(self, filepath):
self._filepath = filepath
self.player = self.get_pipeline()
self.bus = self.player.get_bu... |
#!/usr/bin/python
import sys
import zmq
import random
import time
import os
import datetime
import json
import getopt
import socket
import happybase
import hashlib
import struct
import traceback
import re
# adjust to match your $PREFIX if you specified one
# default PREFIX = /usr/local
sys.path.append('/usr/local/li... |
'''
Copyright 2015, Institute e-Austria, Timisoara, Romania
http://www.ieat.ro/
Developers:
* Gabriel Iuhasz, iuhasz.gabriel@info.uvt.ro
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:
ht... |
# Echo client program
import socket
import sys
import xml
import time
SSDP_ADDR = "239.255.255.250" # The remote host
SSDP_PORT = 1900 # The same port as used by the server
SSDP_MX = 1
SSDP_ST = "urn:schemas-sony-com:service:ScalarWebAPI:1"
SSDP_TIMEOUT = 10000 #msec
PACKET_BUFFER_SIZE = 1024
# I don't know how ... |
# Echo client program
import socket
import sys
import xml
import time
import re
import collections
import json
import comp_urllib
SSDP_ADDR = "239.255.255.250" # The remote host
SSDP_PORT = 1900 # The same port as used by the server
SSDP_MX = 1
SSDP_ST = "urn:schemas-sony-com:service:ScalarWebAPI:1"
SSDP_TIMEOUT =... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
# routes.py
# Python Flask main application. Handles form processing and routing.
# To run this application, type "python routes.py" at the command line.
# Created by Jasmine Jones
# Last modified by Abigail Franz on 1/29/2018
import requests
from flask import Flask, json, redirect, render_template, request, url_for
i... |
import chess
import data_handler as dh
class Search:
"""
Implements game tree search.
"""
def __init__(self, eval_fn, max_depth=3, search_mode="recipromax"):
# Evaluation function must yield a score between 0 and 1.
# Search options
self.search_opts = {"recipromax": self.recip... |
import os
import calendar
from datetime import datetime, timedelta
from itertools import groupby
from collections import Counter
from functools import wraps
from tools.failures import SETA_WINDOW
from src import jobtypes
import MySQLdb
from flask import Flask, request, json, Response, abort
SCRIPT_DIR = os.path.abspa... |
from flask import Flask, render_template, send_from_directory, request, jsonify
from flask_webpack import Webpack
from gevent.wsgi import WSGIServer
import os
from elasticsearch import Elasticsearch
from search import build_search_query, build_es_search_body_request, \
build_es_aggregation_body_request, format_s... |
#!/usr/bin/python2.7
import struct, socket, sys, time,argparse
from EncryptedBlockDevice import *
from DiskDrivers import *
from EncryptionDrivers import *
import logging
import hashlib
from Crypto.Hash import MD5
from nbd_server import NBDServer
from getpass import getpass
parser = argparse.ArgumentParser(description... |
'''
Individual stages of the pipeline implemented as functions from
input files to output files.
The run_stage function knows everything about submitting jobs and, given
the state parameter, has full access to the state of the pipeline, such
as config, options, DRMAA and the logger.
'''
from utils import safe_make_di... |
import sys
import os
from settings import Settings
from clarifai_client import Clarifai
from gcvision_client import GCVision
import xmlexporter
EXTENSIONS = ['jpg', 'bmp', 'png', 'tiff', 'jpe', 'jpeg']
HELPSTRING = '''Установщик тегов на изображения с помощью сервиса ClarifAI
Использование: передать через аргументы ... |
from pycoin.key.BIP32Node import *
from . import config
from .interfaces.counterwalletseed import mnemonicToEntropy
import time
import json
import os
NETCODES = {"mainnet": "BTC", "testnet": "XTN"}
#To Do: enable autosweep, privkey_mode only
#sweep address function
#sweep branch function
class PyPayWallet(BIP32Node):... |
#!/usr/bin/env python
"""
Minimal backend for an mcash powered store with unlimited supplies.
Our main persona is a friendly pizza shop at the corner.
"""
import functools
import os
import json
import uuid
import time
import md5
import urlparse
import logging
import requests
import tornado.ioloop
import torna... |
"""srcharness.py - Tool to run source integration of first order results
Author: Ian Huston
Given the filename of a first order model's results, this tool will calculate
the source term integral for the second order equation of motion. See cosmomodels.py
and harness.py for first order models and a program to run them.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.