text
stringlengths
12
6.59M
# Copyright 2018 Google 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,...
""" Django settings for contentcuration project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Bui...
import pylons from paste.deploy.converters import asbool from pylons.error import template_error_formatters from weberror.evalexception import EvalException from weberror.errormiddleware import ErrorMiddleware media_path = pylons.middleware.media_path report_libs = pylons.middleware.report_libs if 'tg.devtools' not in...
import json, sys # Parse a Lattice pinout CSV file to a JSON file for the database # Usage: parse_pins.py pinout.csv iodb.json def main(): packages = [] pads = [] with open(sys.argv[1], "r") as csvf: for line in csvf: sl = line.replace('"', '') sl = sl.strip() if len(sl) == 0 or sl.startswith('#'): ...
from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.conf import settings from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf.urls.static import static from .views import HomeView from bluebottle...
#!/usr/bin/env python # # $Id$ # import os import unittest import platform import subprocess import signal import time import warnings import atexit import psutil from test_psutil import reap_children, get_test_subprocess, wait_for_pid try: import wmi except ImportError, err: atexit.register(warnings.warn, "...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import json from frappe import _ from .operations import install_fixtures as fixtures, taxes_setup, company_setup, sample_data from fra...
from __future__ import unicode_literals from smartmin.models import SmartModel from django.db import models from django.utils.translation import ugettext_lazy as _ from dash.categories.models import Category from dash.orgs.models import Org class Story(SmartModel): title = models.CharField( max_length=...
#-1 #000 #1111 #22222 #333333 import random #_._______________________________________________________________________ # Random/ tweaks mega_points = [0] def ui_tweak(ui_element): if ui_element == "MegaPoints999": #adjust the ui to fit up to 999, len(23) if mega_points[0] < 10...
import os.path as op import sys import getopt from retrieval.flickrwrapper import FlickrWrapper from analysis import process from analysis import kmeans from display import plothelper from features import sift, extract from runmode import RunMode from dataset.dataset import DataSet class RsBundler: def __init__...
""" Onsager calculator module: Interstitialcy mechanism and Vacancy-mediated mechanism Class to create an Onsager "calculator", which brings two functionalities: 1. determines *what* input is needed to compute the Onsager (mobility, or L) tensors 2. constructs the function that calculates those tensors, given the inpu...
#!/usr/bin/env python # # $Id$ # import os import unittest import platform import subprocess import signal import time import warnings import psutil from test_psutil import reap_children, PYTHON, DEVNULL try: from psutil import wmi except ImportError: warnings.warn("Can't import WMI module; Windows specific ...
# -*- coding: utf-8 -*- """ """ from config import sim_results_path, total_results_path, plot_path # TODO: Make plot_path import work...don't know why it does not from os import path, listdir import matplotlib from matplotlib import pyplot as plt import pandas as pd import os kmean = [] files1 = os.listdir(sim_resul...
import json import requests import datetime from optparse import make_option from django.utils import timezone from django.db import transaction from django.core import serializers from django.core.management.base import BaseCommand from schools.models import School from common.utils import post_to_slack from storie...
""" Onsager calculator module: Interstitialcy mechanism and Vacancy-mediated mechanism Class to create an Onsager "calculator", which brings two functionalities: 1. determines *what* input is needed to compute the Onsager (mobility, or L) tensors 2. constructs the function that calculates those tensors, given the inpu...
# Amara, universalsubtitles.org # # Copyright (C) 2014 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
#!/usr/bin/env python # rssingest.py """ Sample solution for RSS exercise """ ########################################################################## ## Imports ########################################################################## import re import requests import feedparser ################################...
""" The "methods" object holds the list of functions that can be called by remote calls. Add as many methods as needed. Methods can take either positional or named arguments (but not both, this is a limitation of JSON-RPC). """ from typing import Any, Callable, Optional from inspect import signature from .errors im...
# coding: utf-8 import os import six import grpc import json import logging from imp import reload from grpc_health.v1 import health_pb2 from opac_ssm_api import utils logger = logging.getLogger(__name__) HOST_NAME = os.getenv('OPAC_SSM_GRPC_SERVER_HOST', 'localhost') HOST_PORT = os.getenv('OPAC_SSM_GRPC_SERVER_POR...
from __future__ import division from warnings import warn import contextlib import json import numbers from six import add_metaclass from jsonschema import _utils, _validators, _types from jsonschema.compat import ( Sequence, urljoin, urlsplit, urldefrag, unquote, urlopen, str_types, int_types, iteritems, lr...
import sys import os sys.path.append("..") import unittest from block import * from force_optimizer import * from field import * from parsers.vhdl import parse_vhdl as parse from schematic import draw_field from routing import Routing DEBUG = False class ForceAlgorithmUnitTest(unittest.TestCase): # fixture setu...
"""JTS type casting. Patterned on okfn/messy-tables""" # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import re import decimal import datetime import time import json import operator ...
# coding=utf-8 from __future__ import absolute_import, division, print_function __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License" import octoprint.plugin from octoprint.settin...
# Test suite. This code could be in a separate file from shutil import rmtree from os.path import dirname, join from datetime import datetime import unittest, tempfile, json from mimetypes import guess_type from urllib.parse import urlparse, parse_qs from httmock import HTTMock, response from mock import Mock from ....
# -*- coding: utf-8 -*- import copy from django.test.client import RequestFactory from django.utils import translation from elasticsearch_dsl import Search from mock import Mock, patch from rest_framework import serializers from olympia import amo from olympia.amo.tests import TestCase from olympia.constants.categor...
import os import pytest import tempfile import shutil from snakemake.shell import shell from lcdblib.snakemake import aligners @pytest.fixture(scope='session') def sample1_se_fq(tmpdir_factory): fn = 'samples/sample1/sample1_R1.fastq.gz' d = str(tmpdir_factory.mktemp('sample1_se_fq')) url = 'https://github...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
#!/usr/bin/python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Alchemical factory for free energy calculations that operates directly on OpenMM System objects. DESCRIPTION This m...
from cfelpyutils.crystfel_utils import load_crystfel_geometry from copy import copy import numpy as np from scipy.ndimage import affine_transform import warnings def _crystfel_format_vec(vec): """Convert an array of 3 numbers to CrystFEL format like "+1.0x -0.1y" """ s = '{:+}x {:+}y'.format(*vec[:2]) ...
"""PyTest based testing of the FERC & PUDL Database initializations. This module also contains fixtures for returning connections to the databases. These connections can be either to the live databases (for post-ETL testing) or to the test databases, which are created from scratch and dropped after the tests have comp...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2012, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Lice...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # only, as published by the Free Software Foundation. # # OpenQuak...
from neotext.lib.neotext_quote_context.quote import Quote t0 = Quote( citing_quote="""<p>I am sick and tired of watching folks like Boris Johnson, Marine Le Pen, Donald Trump and others appeal to the worst racial instincts of our species, only to be shushed by folks telling me that it&#8217;s not <i>really</i> rac...
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # Feel free to rename the models, but don't rename db_table values or field names. # # Also note: You'll have to ...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # only, as published by the Free Software Foundation. # # OpenQuak...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
import os import shutil import hashlib import re import json import six from git.repo import Repo from lockfile import LockFile from st2actions.runners.pythonrunner import Action ALL_PACKS = '*' PACK_REPO_ROOT = 'packs' MANIFEST_FILE = 'pack.yaml' CONFIG_FILE = 'config.yaml' GITINFO_FILE = '.gitinfo' PACK_RESERVE_CH...
#!/usr/bin/env python # Licensed to the StackStorm, Inc ('StackStorm') 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 "Licens...
from datetime import datetime import json import logging import os from google.appengine.ext import ndb from google.appengine.ext.webapp import template from controllers.base_controller import LoggedInHandler from datafeeds.csv_alliance_selections_parser import CSVAllianceSelectionsParser from datafeeds.csv_teams_par...
#---------------------------------------------------------------------- # Copyright (c) 2012-2013 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
# Orca # # Copyright 2010 Joanmarie Diggs. # Copyright 2014-2015 Igalia, S.L. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) an...
# Orca # # Copyright 2010 Joanmarie Diggs. # Copyright 2014-2015 Igalia, S.L. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) an...
import webapp2 import os import datetime class MainPage(webapp2.RequestHandler): def get(self): """Return a friendly HTTP greeting. lines and teamdates dicts come from the parser, they are created and added manually. """ lines = ['Sat Jun 6, 2015', 'Mon Jun 8, 2015', 'Wed Jun 10, 20...
# Copyright 2009 - Erik Karulf - MIT License - See LICENSE.txt """ A collection of useful decorators. When combined these decorators allow an administartor to setup a failry precise authentication system. These Decorators are designed specifically to work with the access control mechanisms in mod_wsgi. The followin...
# Copyright (C) 2011 Colin Walters <walters@verbum.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # Thi...
# coding=utf-8 """ """ from __future__ import absolute_import, division, print_function, \ unicode_literals from flask import g from six import text_type from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import relationship from sqlalchemy.schema import Column, ForeignKey from whoosh.fields ...
from .utils import gravatar_url from django.conf import settings from django.contrib.gis.db import models from django.core.urlresolvers import reverse from django.utils import timezone from faker import Faker from multiselectfield import MultiSelectField from phonenumber_field.modelfields import PhoneNumberField from s...
from .utils import gravatar_url from django.conf import settings from django.contrib.gis.db import models from django.core.urlresolvers import reverse from django.utils import timezone from faker import Faker from multiselectfield import MultiSelectField from phonenumber_field.modelfields import PhoneNumberField from s...
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import threading try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K from .. import optimizers from .. imp...
#!/usr/bin/python """ Replacement for test-math-dependencies target in Makefile. """ from __future__ import print_function import os import sys import re import glob from collections import defaultdict winsfx = ".exe" testsfx = "_test.cpp" testsfx_no_ext = "_test" def files_in_folder(folder): """Returns a lis...
from __future__ import division import bisect from collections import Iterable, Iterator from datetime import datetime from distutils.version import LooseVersion from functools import wraps import operator from operator import getitem, setitem from pprint import pformat import uuid from toolz import merge, partial, f...
# -*- coding: utf-8 -*- from __future__ import absolute_import import copy import inspect from ..engine import Layer from ..engine import InputSpec from .. import backend as K class Wrapper(Layer): """Abstract wrapper base class. Wrappers take another layer and augment it in various ways. Do not use thi...
import sys try: import cantera as ct except ImportError: print("Cantera must be installed") sys.exit(1) try: import numpy as np except ImportError: print('Numpy must be installed') sys.exit(1) try: import tables except ImportError: print('PyTables must be installed') sys.ex...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # MIT License. See license.txt from __future__ import unicode_literals import webnotes class DocType(): def __init__(self, doc, doclist=[]): self.doc = doc self.doclist = doclist def get_parent_bean(self): if self.doc.contact: parent_doctype = "Conta...
# Copyright 2018 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...
__author__ = 'Daniel Kapellusch' # Necessary imports. Note: this is written in python 2. import sys import findr_lib import astropy.io.fits as fits import os import multiprocessing as mp from ConfigParser import ConfigParser import json def main(argv): if not argv: print "run_findr.py fits_path config_fi...
## Totem D-Bus plugin ## Copyright (C) 2009 Lucky <lucky1.data@gmail.com> ## Copyright (C) 2009 Philip Withnall <philip@tecnocode.co.uk> ## ## 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; eit...
import unittest import nearpy.tests as tests suite = unittest.TestLoader().loadTestsFromModule(tests) unittest.TextTestRunner(verbosity=2).run(suite)
#!/usr/bin/env python3 # Copyright 2012-2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by...
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this...
#!/usr/bin/env python3 # coding: utf-8 # /*########################################################################## # # Copyright (c) 2015-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files...
import pytest from bs4 import BeautifulSoup as BS pytest.main(['--durations', '10', '--cov-report', 'html', '--junit-xml', 'test-reports/results.xml', '--verbose']) url = r'htmlcov/index.html' page = open(url) soup = BS(page.read(), features='html5lib') aggregate_total = soup.find_all('tr', {'class': 'total'}) final...
#!/usr/bin/env python # coding=utf-8 import sys import os import django from django.conf import settings ROOT = os.path.join(os.path.dirname(__file__), 'viewlet/tests') def main(): conf = { 'DEBUG': True, 'TEMPLATE_DEBUG': True, 'INSTALLED_APPS': [ 'django.contrib.auth', ...
# 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, software # distributed under t...
import socket, sys, time, subprocess, threading, signal, fcntl import TorCtl.TorCtl LOGFILE = 'torperf2.log' HIDDEN = 'http://pevf7ega6sg6elzr.onion:9081/' PUBLIC = 'http://torperf.tor2web.org:9081/' HOST = '127.0.0.1' PORT = 10951 shared = dict( torprocess = None, torlock = threading.Lock() ) TORRC = """\ Socks...
# Copyright 2012 Nebula, 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 ...
# BOJ-tier # Copyright (C) 2017 Jeehak Yoon # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program i...
# Copyright 2012 Nebula, 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 ...
from urlparse import urljoin, urlparse, urlunparse import cgi import urllib from batchhttp.client import BatchError import remoteobjects from remoteobjects.dataobject import find_by_name from remoteobjects.promise import PromiseError import typepad from typepad import fields class TypePadObject(remoteobjects.Remote...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import shutil import logging import time import re import requests import ssl import json from distutils.version import StrictVersion from threading import Thread, Event from queue import Queue from flask_cors import CORS from flask_cache_bust import...
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Edgewall Software # Copyright (C) 2003-2007 Jonas Borgström <jonas@edgewall.com> # 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 htt...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import shutil import logging import time # Currently supported pgoapi pgoapi_version = "1.1.6" # Moved here so logger is configured at load time logging.basicConfig(format='%(asctime)s [%(threadName)16s][%(module)14s][%(levelname)8s] %(message)s') log = ...
#!/usr/bin/python """ Date of Creation: 3rd Apr 2010. Description: Classes and functions for manipulating Genomic Intervals Copyright (C) 2010-2014 Philip J. Uren, Authors: Philip J. Uren This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as ...
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2011 Edgewall Software # Copyright (C) 2003-2007 Jonas Borgström <jonas@edgewall.com> # 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 htt...
# -*- coding: utf-8 -*- """ @file @brief Contains the main function to generate the documentation for a module designed the same way as this one, @see fn generate_help_sphinx. """ import os import sys import shutil import importlib import warnings from docutils.parsers.rst import directives from ..loghelper.flog impo...
#-*- coding: utf-8 -*- """ @file @brief Contains the main function to generate the documentation for a module designed the same way as this one, @see fn generate_help_sphinx. """ import os,sys, shutil, datetime, re, importlib from ..loghelper.flog import run_cmd, fLOG from ..loghelper.pyrepo_helper import ...
# ================================================================================================== # Copyright 2013 Foursquare Labs, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
# -*- coding: utf-8 -*- import asyncio import logging import os import socket import time from typing import Tuple, Optional import weakref from fsspec.spec import AbstractBufferedFile from fsspec.utils import infer_storage_options, tokenize from fsspec.asyn import AsyncFileSystem, sync, sync_wrapper import aiobotoco...
#!/usr/bin/env python3 """ SacréBLEU provides hassle-free computation of shareable, comparable, and reproducible BLEU scores. Inspired by Rico Sennrich's `multi-bleu-detok.perl`, it produces the official WMT scores but works with plain text. It also knows all the standard test sets and handles downloading, processing, ...
#!/usr/bin/python # Copyright (c) 2016 Cisco and/or its affiliates. # 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 a...
# -*- coding: utf-8 -*- # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 __author__ = "Andre Merzky" __copyright__ = "Copyright 2012, The SAGA Project" __license__ = "MIT" """ SAGA task interface """ import pprint import time import traceback import Queue import saga.exceptions import saga.attributes imp...
# -*- coding: utf-8 -*- from __future__ import print_function,division,absolute_import import logging log = logging.getLogger(__name__) import numpy as np np.seterr(all='ignore') import inspect import os import collections import glob import pathlib from datastorage import DataStorage from . import utils from . impor...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Jean Ventura (<http://venturasystems.net>). # # This program is free software: you can redistribute it and/or modify # it under...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Jean Ventura (<http://venturasystems.net>). # # This program is free software: you can redistribute it and/or modify # it under...
#!/usr/bin/env python2.7 import SocketServer import socket import os import json import sys import sandbox dev_null = open('/dev/null', 'r') class ThreadingUnixServer(SocketServer.ThreadingMixIn, SocketServer.UnixStreamServer): def server_bind(self): if os.path.exists(self.server_address): os...
import discord import logging import asyncio import os.path import configparser import random class Participant(object): def __init__(self, user, address, ): self.foo = bar #set up discord connection debug logging client_log = logging.getLogger('discord') client_log.setLevel(logging.DEBUG) client_handler ...
# Copyright 2012 Locaweb. # 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 appli...
#! /usr/bin/python import sqlite3 from datetime import * conn = sqlite3.connect("logs/thermostat.db", check_same_thread = False) conn.row_factory = sqlite3.Row c = conn.cursor() def convertStringDate(string): ''' convert string to date or bitmask monday-Sunday = 0-6 return weight, specific d...
#!/usr/bin/env python3 import argparse import json import time import subprocess import fcntl import errno import datetime import os import sys import signal import threading import shlex # CONSTANTS - Scheduler settings SEC_DELAY = 3 PATH = "/tmp/" GPU_INFO_FILE = os.path.join(PATH, "gpu_scheduler_info") DEFAULT_GPU...
from collections import namedtuple """ Scheduling tool for Northwestern IT. Follow the instructions in README.md to make sure that the prefs files are properly configured. This assumes they are located in prefs/ and named monday.txt, tuesday.txt, etc. Definitions: W2W: WhenToWork prefs: On W2W, each employee...
#!/usr/bin/python import re import sys input = "\n".join([l for l in open(sys.argv[1])]) class Node: known_macros = [] def __init__(self, name, args): assert isinstance(args, list) self.name = name self.args = args def tostr(self, indent): indentation = indent * " " result = "" resul...
#!/usr/bin/env python #encoding:utf-8 #author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:unlicense (http://unlicense.org/) """Simple-to-use Python interface to The TVDB's API (thetvdb.com) Example usage: >>> from tvdb_api import Tvdb >>> t = Tvdb() >>> t['Lost'][4][11]['episodename...
import os import sys import time import socket import logging import tempfile import urllib2 import urlparse import datetime import cookielib import robotparser try: import json except ImportError: import simplejson as json try: import httplib2 USE_HTTPLIB2 = True except ImportError: USE_HTTPLIB2 ...
import os import sys import struct import signal import string class StoragePage: def __init__(self): self.offset = 0 self.size = 0 def read_data(self, fmt, data): size = struct.calcsize(fmt) struct_buf = data[:size] data = data[size:] ret = [data] t = struct.unpack(fmt, struct_buf) ret.extend(lis...
#Alex Holcombe alex.holcombe@sydney.edu.au #See the github repository for more information: https://github.com/alexholcombe/twoWords from __future__ import print_function #use python3 style print from psychopy import monitors, visual, event, data, logging, core, sound, gui import psychopy.info import numpy as np from m...
from functools import lru_cache import os import glob import copy from itertools import product import numpy as np from scipy.ndimage import map_coordinates from scipy.interpolate import interp1d,RegularGridInterpolator,\ UnivariateSpline import astropy.units as u from astropy.io import...
#!/usr/local/bin/python # -*- coding: utf-8 -*- import unittest import sys import scipy.io import math import copy import argparse import numpy as np import matplotlib.pyplot as plt import matplotlib from matplotlib.widgets import Slider, Button import traceback import logging logger = logging.get...
#!/usr/local/bin/python # -*- coding: utf-8 -*- import unittest import sys sys.path.append("./src/") # import pdb # pdb.set_trace(); import scipy.io import math import copy import logging logger = logging.getLogger(__name__) import argparse import numpy as np import matplotlib.pyplot as plt imp...