text stringlengths 17 737k |
|---|
# websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
Support for "sessions" spanning multiple WebSocket connections.
In some (or many) cases, multiple WebSocket connections to the same URL are
(mostly) interchangeable. This module caters for that case by p... |
import os
import sys
import shutil
real_path = os.path.realpath(__file__)
real_path = real_path[:real_path.find('install.py')]
RESET_PATH = real_path
def check_os():
'''Check operating system'''
if sys.platform.lower() == 'darwin':
return 'macos'
elif sys.platform.lower() == 'win32':
retur... |
#!/usr/bin/env python
# dotfiles
# Kashev Dalmia | @kashev | kashev.dalmia@gmail.com
# README.md
import argparse
import getpass
import os
HOME_DIR = os.path.join("/home", getpass.getuser())
DOT_INSTALL_FOLDERS = ["git"]
def delete_and_link(source, dest, force=False):
"""Delete the destination file if it exists... |
print("Taichi Installer v0.1")
import os
import pwd
import sys
import platform
import argparse
from os import environ
# Utils
def get_shell_name():
return environ['SHELL'].split('/')[-1]
def get_shell_rc_name():
shell = get_shell_name()
if shell == 'bash':
return '~/.bashrc'
elif shell == 'zsh':
ret... |
#!/usr/bin/python3
import os
import sys
import subprocess
PARENT = os.path.abspath(os.path.dirname(__file__))
def install_file(name, dest_dir = os.path.expanduser('~'), dot = True):
if not os.path.isdir(dest_dir):
os.makedirs(dest_dir)
if dot:
dest = os.path.join(dest_dir, '.' + name)
else:
dest = ... |
import time
import logging
from bndl.util.lifecycle import Lifecycle
from bndl.execute.worker import current_worker
logger = logging.getLogger(__name__)
class ExecutionContext(Lifecycle):
def __init__(self, driver, conf=None):
super().__init__()
self._driver = driver
self._node = driver... |
#!/usr/bin/env python
import os, socket, sys
# Creates directories for temporary application files.
def make_cache_dirs():
cache_dir = os.path.expanduser("~/.cache")
app_names = ["gdb", "less", "stoken", "zsh"]
for app_name in app_names:
app_cache_dir = os.path.join(cache_dir, app_name)
os.makedirs(app... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright 2011 Aaron Steele, John Wieczorek, Gaurav Vaidya
#
# 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.... |
# 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... |
import re
class APIError(Exception):
"""
If description is passed, messages would be ignored
"""
def __init__(self, messages=None, description=None, code=None, status_code=None):
self.messages = messages
self.description = str(description)
self.code = code
self.status_c... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def _previsit(v, previsit_d, clock):
clock[0] += 1
previsit_d[v] = clock[0]
def _postvisit(v, postvisit_d, clock):
clock[0] += 1
postvisit_d[v] = clock[0]
def _dfs_recur_visit(v, graph_adj_... |
#!/usr/bin/env python
__author__ = "Eric Allen Youngson"
__email__ = "eric@scneco.com"
__copyright__ = "Copyright 2015, Succession Ecological Services"
__license__ = "GNU Affero (GPLv3)"
""" This module provides functions for requesting results from the DeltaMeter
Services API * deltameterservices.com * """
... |
# ApplePy - an Apple ][ emulator in Python
# James Tauber / http://jtauber.com/
# originally written 2001, updated 2011
import curses
def signed(x):
if x > 0x7F:
x = x - 0x100
return x
class Memory:
def __init__(self, size):
self.__mem = [0x00] * size
def load(self, filename, o... |
#!/usr/bin/env python3
try:
from systemd import journal
systemd = True
except:
systemd = False
from urllib.request import urlopen
from geojson import Feature, Point, FeatureCollection, dumps
try:
from geojsonio import to_geojsonio
except:
print("""==> Warning: You need to 'pip install github3.py' a... |
# -*- coding: utf-8 -*-
import base64
import hmac
from hashlib import sha1 as sha
py3k = False
try:
from urlparse import urlparse
except:
py3k = True
from urllib.parse import urlparse
from email.utils import formatdate
from requests.auth import AuthBase
class S3Auth(AuthBase):
"""Attaches AWS Authe... |
import os
def page():
page_id = request.args[0]
check_page_id(page_id)
page = get_page(page_id)
boxes_on_pages = page.boxes.select()
extra_box_info = {}
child_boxes = []
for box in boxes_on_pages:
extra_box_info[box.id] = box_content_info(box)
if box.content_type == 'box':
child_boxes.append(box.content_... |
###############################################################################
#
# ChartScatter - A class for writing the Excel XLSX Scatter charts.
#
# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org
#
from . import chart
class ChartScatter(chart.Chart):
"""
A class for writing the Excel XLSX Scatte... |
"""
Helper functions to run with OpenMM, these function could be methods of the
MDSimulation class however because of limitations imposed by the
multiprocessing they need to be functions
"""
from __future__ import absolute_import, division, print_function
import os
import sys
import time
import functools
import traceb... |
#! /usr/bin/python -u
# Note -u forces stdout to be unbuffered.
import argparse
import subprocess
import traceback
import sys
import time
from operator import itemgetter
from biokbase.workspace.client import Workspace
from biokbase.workspaceService.Client import workspaceService as oldWorkspace
from biokbase.fbaModel... |
"""Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... |
from glob import iglob
import ROOT
import rootpy
from rootpy.tree import Cut
from root_numpy import tree2rec
def expander(
dtype='cf',
tree='rrqDir/calibzip1',
base='/tera2/data3/cdmsbatsProd/R133/dataReleases/Prodv5-3_June2013/merged/',
data='all',
productions=['all'],
... |
# coding=utf-8
from common.exception import ConfigNotExist
from flask import current_app
import redis
__author__ = 'GaoJie'
redis_map = {}
def get(name='default'):
connect_name = '%s_%s' % (current_app.import_name, name)
if connect_name in redis_map:
return redis_map[connect_name]
config_map = c... |
# Author: Ian Burke
# Module: Emerging Technologies
# Date: September, 2017
# Problem Sheet: https://emerging-technologies.github.io/problems/python-fundamentals.html
import math
def factorial(n):
fact = math.factorial(n) # importing a function that calculates the factorial of n
print("Factorial of ", n... |
#!/usr/bin/env python
import os
import re
import glob
from copy import copy
import multiprocessing
import numpy as np
from numpy.core.defchararray import add as char_add
import fitsio
from astropy.table import Table
from bokpipe import bokpl,bokobsdb
from bokpipe import __version__ as pipeVersion
def set_rm_defaults... |
import numpy as np
np.set_printoptions(threshold='nan')
from sifra.modelling.structural import Element
from sifra.modelling.component_graph import ComponentGraph
from sifra.modelling.structural import Base
from sifra.modelling.iodict import IODict
class InfrastructureFactory(object):
@staticmethod
def creat... |
from django.views.generic import TemplateView
class ListPollsView(TemplateView):
template_name = "polls/list_polls.html"
from datetime import datetime
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required... |
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.db.models import Q, F, ExpressionWrapper, IntegerField, Count
from django.db.models import CharField, TextField, Value as V
from django.d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
u"""
===============================
Shimehari.crypt
~~~~~~~~~~~~~~~~~
セキュアアアア
===============================
"""
import uuid
from hashlib import sha1
import datetime
import time
import hmac
from werkzeug.exceptions import abort
from werkzeug.routing import ... |
import os
import os.path
import sys
import stat
import glob
import ConfigParser
import subprocess
import collections
import difflib
import filecmp
import shlex
import time
from tarantool_silverbox_server import TarantoolSilverboxServer
from tarantool_connection import AdminConnection, DataConnection
import tarantool_pr... |
#!/usr/bin/env python3
# pylint: disable=duplicate-code,too-many-locals,too-many-arguments
import copy
import datetime
import pytz
import tzlocal
import singer
from singer import metadata
from singer import utils
from singer.schema import Schema
import pymysql.connections
import pymysql.err
import tap_mysql.sync_st... |
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2011, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
import json
from compiler.js import split_name, escape_id, get_package
from compiler.js.component import component_generator
root_type = 'core.CoreObject'
class generator(object):
def __init__(self, ns):
self.ns = ns
self.components = {}
self.used_packages = set()
self.used_components = set()
self.imports ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unles... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from formtools.wizard.views import normalize_name
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.forms import fields
from django.utils.encoding import force_text
from django.utils.safestring ... |
import numpy as np
import math
import random
import sys
import time
from joblib import Parallel, delayed
#Prints a progress bar which updates while running a computational loop
def printProgress(iteration, total, prefix='', suffix='', decimals=1, barLength=100):
"""
Call in a loop to create terminal progress ... |
import sys
from copy import deepcopy
class SokoMap:
def __init__(self):
self.sm = []
# Values of map pieces
self.goal = '.'
self.player = '@'
self.block = '$'
self.space = ' '
self.wall = '#'
self.blockOnGoal = '*'
self.playerOnGoal = '!'
... |
# coding: utf-8
from __future__ import unicode_literals
import itertools
import random
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
parse_duration,
try_get,
urljoin,
url_or_none,
)
class NRKB... |
"""The Synology DSM component."""
import asyncio
from datetime import timedelta
import logging
from typing import Dict
import async_timeout
from synology_dsm import SynologyDSM
from synology_dsm.api.core.security import SynoCoreSecurity
from synology_dsm.api.core.system import SynoCoreSystem
from synology_dsm.api.core... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
smuggle_url,
)
class TVAIE(InfoExtractor):
_VALID_URL = r'https?://videos\.tva\.ca/details/_(?P<id>\d+)'
_TEST = {
'url': 'https://videos.tva.ca/details/_559681147000... |
import hoomd
import pytest
from itertools import permutations
_directions = list(permutations(['X', 'Y', 'Z'], 2))
@pytest.mark.parametrize("slab_direction, flow_direction", _directions)
def test_before_attaching(slab_direction, flow_direction):
filt = hoomd.filter.All()
ramp = hoomd.variant.Ramp(0.0, 0.1e8,... |
import os
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import exceptions
{%- from "horizon/map.jinja" import server with context %}
{%- set app = salt['pillar.get']('horizon:server:app:'+app_name) %}
{% include "horizon/files/horizon_settings/_local_settings.py" %}
{% include "hori... |
# Copyright (C) 2013,2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013,2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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
#
... |
import math
from datetime import timedelta as delta
from glob import glob
from os import path
import numpy as np
import pytest
import dask
from parcels import AdvectionRK4
from parcels import Field
from parcels import FieldSet
from parcels import JITParticle
from parcels import ParticleFile
from parcels import Partic... |
import datetime
import graphene
import operator
from django.db.models import Q
from graphene import relay
from graphene_django import DjangoObjectType
from graphene_django.debug import DjangoDebug
from ..product.models import (AttributeChoiceValue, Category, Product,
ProductAttribute, Pr... |
#!/bin/env python
"""
News module for polybar that fetch news title
from various websites and put them on polybar
"""
import random
import time
import os
from pprint import pprint as p
from threading import Thread
import requests
from bs4 import BeautifulSoup as soup
def color_string(string, color_envron_var):
"""... |
# -*- coding: utf-8 -*-
'''
The match module allows for match routines to be run and determine target specs
'''
from __future__ import absolute_import
# Import python libs
import inspect
import logging
import sys
# Import salt libs
import salt.minion
import salt.utils
from salt.defaults import DEFAULT_TARGET_DELIM
fr... |
"""
Created on 22.09.2009
@author: alen
Inspired by:
http://github.com/leah/python-oauth/blob/master/oauth/example/client.py
http://github.com/facebook/tornado/blob/master/tornado/auth.py
"""
import time
import base64
import urllib
import urllib2
from oauth import oauth
from openid.consumer import consumer as... |
from ngrams import jaccard, NGramSpace
import numpy
class SymmetricMatrix(object):
def __init__(self, n):
self.values = numpy.zeros((n, n))
self.mask = None
def submatrix(self, ids):
sub = SymmetricMatrix(0)
sub.values = self
sub.mask = ids
return sub
... |
import argparse
import os
from os import path
import commands
import sys
import time
# garbage collector
import gc
import numpy as np
from scipy import signal
from matplotlib import pyplot as plt
import GPy
import classes as cls
import utilities as util
from utilities import bcolors
import rpy2.robjects as ro
from... |
# -*- coding: utf-8 -*-
r'''
Execution of Salt modules from within states
============================================
These states allow individual execution module calls to be made via states. To
call a single module function use a :mod:`module.run <salt.states.module.run>`
state:
.. code-block:: yaml
mine.sen... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Version: Fri 28 Mar 2014
# Initial build.
#
import os
import time
import numpy as np
import pandas as pd
import yaml
# ... : ted
# from ... import msg
from ... import env
# from ... import TEDError
from ... import Namespace
# . : ted.sdss.cutouts
from . import load_... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
salt.utils.parsers
~~~~~~~~~~~~~~~~~~
This is where all the black magic happens on all of salt's CLI tools.
'''
from __future__ import absolute_import
# Import python libs
from __future__ import print_function
impo... |
############################################################################
# Copyright 2016 Albin Severinson #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may no... |
# The MIT License (MIT)
# Copyright (c) 2016 Massachusetts Institute of Technology
#
# Authors: Victor Pankratius, Justin Li, Cody Rude
# This software has been created in projects supported by the US National
# Science Foundation and NASA (PI: Pankratius)
#
# Permission is hereby granted, free of charge, to any person... |
# -*- coding: utf-8 -*-
"""
A Theil-Sen Estimator for Multiple Linear Regression Model
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
#
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import warnings
from itertools import combinations
import numpy as np
from scipy... |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
# -*- coding: utf-8 -*-
"""
==============================================================================
SWNT bundle structure class (:mod:`sknano.structures._swnt_bundle`)
==============================================================================
.. currentmodule:: sknano.structures._swnt_bundle
"""
from __fut... |
import json
import requests
from pprint import pprint
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from wit import Wit
from django.views import generic
from django.http.response import HttpResponse
from django.template.cont... |
from collections import defaultdict
try:
from ipysankeywidget import SankeyWidget
from ipywidgets import Layout
except ImportError:
SankeyWidget = None
try:
import graphviz
except ImportError:
graphviz = None
from .utils import pairwise
from .sankey_view import sankey_view
from .augment_view_grap... |
import logging
import time
from datetime import datetime
import types
from .micromodels.fields import ModelCollectionField
from . import SlickConnection, SlickCommunicationError, Release, Build, BuildReference, Component, ComponentReference, \
Project, Testplan, Testrun, Testcase, RunStatus, Result, ResultStatus, ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import division, print_function
import copy
import time
import math
from collections import OrderedDict
import warnings
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline as Spline1d
from astropy.extern import s... |
import threading
from scadasim.utils import parse_yml, build_simulation
import sys
import logging
logging.basicConfig()
log = logging.getLogger('scadasim')
log.setLevel(logging.WARN)
class Simulator(object):
def __init__(self, dbus=False, debug=0):
self.dbus = dbus
if debug == 1:
log... |
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import object
from io import StringIO, IOBase
import requests
import csv
import json
import logging
import re
import os
from .constants import DEFAULT_API_PREFIX, OLD_API_PREFIX
class Socrata... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals, \
with_statement
import calendar
from datetime import datetime
import json
import logging
import time
import types
import urllib
import urllib2
import urlparse
import pytz
SOLR_ADD_BATCH = 200 # Number of do... |
#!/usr/bin/env python3
#import serial
import asyncio, json, copy
import datetime
import sys
from collections import Callable
@asyncio.coroutine
def simulator(reader, writer):
while True:
data = yield from reader.read(100)
print('data: ',data.decode())
ack_received = 'ok\r\n'.encode()
ack_ready = '{"stat":0... |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... |
import os
import json
import time
import uuid
import asyncio
import hashlib
from stevedore import driver
from waterbutler.core import utils
from waterbutler.core import signing
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.provider... |
import requests
import nose
_HOST_UNDER_TEST = ""
def setup_module():
f = open('test_url.cfg', 'r')
global _HOST_UNDER_TEST
_HOST_UNDER_TEST = f.readline().strip()
f.close()
class TestPremium:
def test_region1_age40(self):
payload = {'lat': '39.68', 'long': '-122.48', 'age': 40}
... |
from __future__ import absolute_import
from __future__ import unicode_literals
import uuid
from datetime import datetime
from django.test import TestCase
from sqlalchemy import Date, Integer, SmallInteger, UnicodeText
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.tests.util import delete_all_c... |
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import datetime
import json
import logging
import six
from django.http import HttpResponse
from django.utils.decorators import method_decorator, classonlymethod
from django.views.generic import View
from elasticsearch.exceptions... |
# Copyright 2012 Google 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 or ... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
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... |
# Copyright (c) 2008 Chris Moyer http://coredumped.org/
#
# 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, ... |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
import logging, logging.handlers
log = logging.getLogger(__name__)
import os
import os.path
import resource
import sys
import yaml
import botologist.bot
root_dir = os.getcwd()
config_path = os.path.join(root_dir, 'config.yml')
if len(sys.argv) > 1:
config_path = sys.argv[1]
if not config_path.startswith('/'):
c... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TopTag.date_updated'
db.add_column('radio_toptag', 'date_updated', self.gf('django.db.models.field... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 applicab... |
# -*- coding: utf-8 -*-
"""
@author: Sebi
File: bftools.py
Date: 17.04.2017
Version. 2.2.1
"""
from __future__ import print_function
import javabridge as jv
import bioformats
import numpy as np
import czitools as czt
import os
import pandas as pd
from lxml import etree as etl
import sys
import re
from collections imp... |
import sys
import datetime as dt
import json
import logging
import os
from dataset import DataSet
from mep.genetics.population import Population
if __name__ == "__main__":
if len(sys.argv) != 3:
print("ERROR: Expected usage 'python -m mep.main DATA_SET_NAME PYTHON_FILE_NAME'\n" +
" DATA_S... |
import numpy
from collections import deque
from nupic.bindings.math import GetNTAReal
from transit.transit_types import Keyword
def getBitStates(model):
spRegion = model._getSPRegion().getSelf()
spOutput = spRegion._spatialPoolerOutput
tp = model._getTPRegion().getSelf()._tfdr
npPredictedCells = tp.get... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from contextlib import contextmanager
from unittest import skip
from corehq.apps.fixtures.models import FixtureDataType, FixtureTypeField... |
import re
import datetime
import time
import sys
from decimal import Decimal
from cymysql.constants import FIELD_TYPE, FLAG
try:
from cymysql.charsetx import charset_by_id
except ImportError:
from cymysql.charset import charset_by_id
PYTHON3 = sys.version_info[0] > 2
ESCAPE_REGEX = re.compile(r"[\0\n\r\032\'... |
#
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... |
#!/usr/bin/env python
import glob
import os
import re
import shutil
import subprocess
import sys
import stat
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
get_target_arch, get_chromedriver_version, \
get_zip_name
from lib.util import scoped_cwd, ... |
# Author: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import os.path as op
from nose.tools import assert_true
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_raises
import numpy as np
from scipy import linalg
import warnings
from mne.cov import regu... |
# -*- coding: utf-8 -*-
# accdb - account database using human-editable flat files as storage
from __future__ import print_function
import os
import re
import subprocess
import sys
import time
import uuid
from collections import OrderedDict
from io import TextIOWrapper
from nullroute.core import Core
from .changeset ... |
import pymongo
import json
import traceback
import os
from stateHelper import stateNameToAbbrev, stateName, stateIcpsr
from searchParties import partyName, noun, partyColor, shortName
#from searchMeta import metaLookup
client = pymongo.MongoClient()
try:
dbConf = json.load(open("./model/db.json","r"))
nicknames = jso... |
import argparse
import os
import math
import time
import servo_process as sp
class Arm:
def __init__(self):
self.init_servos()
# 'scooping', ''
self.spoon_status = ''
self.status = ''
def init_servos(self):
self.sp = sp.ServoProcess()
self.sp.start()
def ru... |
#!/usr/bin/env python
"""
plots the intermediate metric values of each slice registration
Usage:
plot_metric_values_and_differences values_dir [slice]
"""
from os.path import *
from os import listdir
from sys import argv
from numpy import genfromtxt
from metric_values import MetricValues
metric_values_dir = argv[1]
... |
from itertools import count
from toolz import merge, accumulate, unique
from operator import getitem, setitem
import pandas as pd
import numpy as np
from .core import Frame, get
from ..compatibility import unicode
tokens = ('-%d' % i for i in count(1))
store_names = ('store-%d' % i for i in count(1))
sort_names = ('... |
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
from __future__ import absolute_import, division, print_function # // , unicode_literals
#
# Georges Toth (c) 2013-2014 <georges@trypill.org>
# GOVCERT.LU (c) 2013-2017 <info@govcert.etat.lu>
#
# This program is free software: you can redistribute it and/or modi... |
__author__ = 'Jordi Vilaplana'
import tweepy
import pymongo
from pymongo import MongoClient
import json
import logging
import time
import datetime
logging.basicConfig(filename='emovix_twitter_search.log',level=logging.WARNING)
# Configuration parameters
access_token = ""
access_token_secret = ""
consumer_key = ""
co... |
# Copyright 2015 Intel Corporation.
#
# 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 writ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Rowland circle geometry
=======================
Units here:
angular [deg]
spatial [mm]
energy [eV]
Table of variables and conventions
| description | here | XRT | RT4XES | SHADOW3 |
|------------------------+---------+--------+---------+-------... |
from flask import Flask, request
import bs4 as bs
import requests
import json
import os
import datetime
import time
import pytz
app = Flask(__name__)
debug_print_on = True
######################### Global Variables #########################
myjsonUrl = 'https://api.myjson.com/bins/'+str(os.environ.get('myjsonId'))
db... |
'''
Setup script.
To install snipper:
[sudo] python setup.py install
'''
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# Dynamically calculate the version based on snipper.VERSION.
setup(
name='snipper',
version=__import__('sni... |
#!/usr/bin/env python
from gensim import corpora, models, similarities
import logging
import sys
import os
import glob
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',
level=logging.INFO)
logger = logging.getLogger()
# Check command line args
if len(sys.argv) != 4:
sys... |
#
#
# Copyright (C) 2006, 2007 Google Inc.
#
# 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
# (at your option) any later version.
#
# This program is distri... |
from __future__ import unicode_literals
import uuid
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext as _
from django.template.defaultfilters import slugify
from localflavor.us.models import USStateField, USZipCodeField
from custom_user.models import EmailUser as... |
import numpy as np
from .. import initializers
from .. import regularizers
from .. import constraints
from keras.engine import Layer
from keras.engine import InputSpec
from .. import backend as K
from keras.utils.generic_utils import get_custom_objects
class PELU(Layer):
"""Parametric Exponential Linear Unit.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.