text
stringlengths
17
737k
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ This module implements general data operations. """ from __future__ import print_function # start to adapt to Python 3 import numpy as np from scipy.interpolate import interp1d from numpy.lib.recfunctions import append_fields import warnings class MissingLabel(Exce...
import unittest import new from should_dsl import should, should_not from fluidity.machine import StateMachine, event, state from fluidity.machine import InvalidTransition, InvalidConfiguration class FluidityStateMachine(unittest.TestCase): def it_defines_states(self): class MyMachine(StateMachine): ...
#!usr/bin/python # -*- coding: utf-8 -*- import os import logging import subprocess import json import dateutil.parser as dp # External dependencies that must be pip install'ed separately try: import docker except ImportError: docker = None logger = logging.getLogger('crawlutils') def exec_dockerps(): ...
#!/usr/bin/env python # # clcache.py - a compiler cache for Microsoft Visual Studio # # Copyright (c) 2010, froglogic GmbH <raabe@froglogic.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # ...
import itertools import os from collections import defaultdict import dbt.utils import dbt.include import dbt.tracking from dbt.utils import get_materialization, NodeType, is_type from dbt.linker import Linker import dbt.compat import dbt.context.runtime import dbt.contracts.project import dbt.exceptions import dbt....
#!/usr/bin/env python from __future__ import absolute_import from __future__ import unicode_literals import base64 import io from datetime import datetime, timedelta, time import re import json from django.urls import reverse from django.db import transaction from django.http import HttpResponse, HttpResponseRedirect, ...
import numpy as np from copy import copy from copy import deepcopy from itertools import zip_longest import traceback from pycqed.utilities.general import temporary_value from pycqed.measurement.quantum_experiment import QuantumExperiment from pycqed.measurement.waveform_control.circuit_builder import CircuitBuilder fr...
""" Abstract models for atmosphere. NOTE: These models should NEVER be created directly. See the respective sub-classes for complete implementation details. """ import uuid from uuid import uuid4 from django.db import models from django.db.models import Q from django.utils import timezone from core.exceptions i...
from distutils.version import LooseVersion import numpy as np import scipy.ndimage as ndim from scipy.spatial.distance import mahalanobis, cdist import nibabel as nib import dipy import dipy.data as dpd import dipy.tracking.utils as dtu import dipy.tracking.streamline as dts import dipy.tracking.streamlinespeed as d...
from cStringIO import StringIO from pyrsss.gmd.conductivity import parse_conductivity """ USGS ground conductivity models are available at ftp://hazards.cr.usgs.gov/Rigler/Conductivity_Latest/ """ """ Adirondack Mountains - central core. """ AK_1A = """\ * Lines starting with * are just comments. * Text after the ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import subprocess import re from itertools import groupby import pymongo import unicodedata def is_hebrew(string): 'A hacky way to check if our string is in Hebrew - check the 1rst char' if not string: # Support empty strings return Fals...
""" Service Provider model for atmosphere. """ from django.db import models from django.db.models import Q from django.db.models.signals import post_save from django.utils import timezone from django.core.exceptions import ValidationError from rtwo.provider import EucaProvider, OSProvider import uuid from uuid impor...
import cgi import logging import re import types #from openerp.tools.safe_eval import safe_eval as eval import xml # FIXME use lxml import xml.dom.minidom import traceback from openerp.osv import osv, orm _logger = logging.getLogger(__name__) BUILTINS = { 'False': False, 'None': None, 'True': True, ...
# -*- coding: utf-8 -*- from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.utils import timezone as datetime from django.core import mail from courriers.forms import SubscriptionForm, Unsu...
import sys from OpenGL.GL import GL_LESS, GL_TRUE, GL_DEPTH_TEST, GL_STENCIL_TEST from OpenGL.GL import GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TRIANGLES from OpenGL.GL import GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT from OpenGL.GL import GL_UNSIGNED_SHORT, GL_FLOAT, GL_MODELVIEW from OpenGL.GL import GL_CULL_FACE, GL_FRO...
# # Copyright (C) 2014 by Johan De Taeye, frePPLe bvba # # This library 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...
import numpy as np from openpnm.topotools import trim from openpnm.utils import logging from openpnm.io import GenericIO, Pandas from openpnm.network import GenericNetwork from pathlib import Path from pandas import DataFrame logger = logging.getLogger(__name__) class Statoil(GenericIO): r""" The StatOil form...
# -*- coding: utf-8 -*- """ Created on Mon Jan 16 16:18:40 2017 @author: amcc """ import numpy as np polygon1 = np.array([[1,2],[3,6],[1,5]])*20 polygon2 = np.array([[1,1],[3,8],[3,5]])*20 + 80 polygon3 = np.array([[2,1],[3,9],[7,5]])*15 + 80 my_polygons = [polygon1, polygon2] my_polygons2 = [polygon1, polygon2, pol...
import sys import copy import tqdm import numpy from scipy import stats, special from galpy.util import bovy_plot, bovy_coords import matplotlib from matplotlib import cm, pyplot import warnings warnings.filterwarnings('ignore','.*All-NaN.*',) #turn-off All-NaN warnings warnings.filterwarnings('ignore','.*invalid value...
from __future__ import ( absolute_import, division, print_function, unicode_literals) import mock from django.contrib.auth.models import User from django.test import TestCase from django_dynamic_fixture import get from textclassifier.validators import ClassifierValidator from readthedocs.projects.exceptions impor...
# -*- coding: utf-8 -*- import json import mock from django.test import TestCase from django.urls import reverse from readthedocs.builds.constants import BRANCH, STABLE, TAG, LATEST from readthedocs.builds.models import ( RegexAutomationRule, Version, VersionAutomationRule, ) from readthedocs.projects.mo...
"""plistlib.py -- a tool to generate and parse MacOSX .plist files. The PropertList (.plist) file format is a simple XML pickle supporting basic object types, like dictionaries, lists, numbers and strings. Usually the top level object is a dictionary. To write out a plist file, use the writePlist(rootObject, pathOrFi...
# -*- coding: utf-8 -*- """Kwik creator.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os.path as op import numpy as np from h5py import Dataset from ..h5 import open_h5 from ...uti...
#!/usr/bin/env python3 import unittest from test import support from unittest.case import _ExpectedFailure import errno import io import socket import select import tempfile import _testcapi import time import traceback import queue import sys import os import array import platform import contextlib from weakref impo...
import os import shutil import subprocess from warnings import warn import h5py import numpy as np import pandas as pd from scipy import linalg from astropy.io import fits from astropy.table import Table from astropy.wcs import WCS from astropy import units as u from astropy.coordinates import SkyCoord, match_coordi...
import tensorflow as tf from tensor_train_base import TensorTrainBase from tensor_train import TensorTrain from tensor_train_batch import TensorTrainBatch import shapes import utils # TODO: add complexities to the comments. def full(tt): """Converts a TensorTrain into a regular tensor or matrix (tf.Tensor). Ar...
## # Copyright (c) 2006-2013 Apple 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 l...
import collections import os from tempfile import NamedTemporaryFile as tempfile from OpenSSL.crypto import verify, X509, PKey, Error as OpenSSL_crypto_Error from cryptography.hazmat.backends.openssl.backend import backend from cryptography.hazmat.primitives import serialization from utlz import flo from ctutlz.utils...
#!/bin/env python3 import json import sys import argparse import glob import re import itertools #import math from collections import defaultdict from time import gmtime, strftime import numpy def curtimestr(): return strftime("%Y-%m-%d %H:%M:%S", gmtime()) def document_generator(path): with...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # PanLex ToolKit import unicodedata import regex as re from unidecode import unidecode from bs4 import Tag from time import sleep def preprocess(entries): # perform across-the-board preprocessing of things that should !ALWAYS! be done result = [] for entry in...
# chromatic-generator.py import glob, os, argparse from PIL import Image # Decode command line arguments parser = argparse.ArgumentParser(description='Prepares images and creates a JSON file for consumption with chromatic.js') parser.add_argument('inputdir', help='Source directory with the images') parser.add_argumen...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime as dt import time import io import os import json import logging import requests import shutil import tempfile from django.core import serializers from django.core.management.base import BaseCommand from django.contrib.contenttypes.models ...
#!/usr/bin/env python import ujson as json import logging import zmq import cif.hunter from cifsdk.client.zeromq import ZMQ as Client from cif.constants import HUNTER_ADDR, ROUTER_ADDR, HUNTER_SINK_ADDR from csirtg_indicator import Indicator from csirtg_indicator.exceptions import InvalidIndicator import multiprocessi...
IDX = 12 import time # Import class definitions from the class definition file import classDef # Initialize a list of objects sampleList = [] for i in range(IDX): # Initialize an object t = classDef.sample() # Assign the time as the current iteration counter t.time = i*i t.heartRate = i + 140 t....
# Copyright 2015 Intel # 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...
# Copyright 2015 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 a...
# Copyright 2010 OpenStack Foundation # Copyright 2013 NTT corp. # 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/LIC...
"""Module to assemble families from ttfs and diff families""" import os import re import uuid from copy import deepcopy from diffenator.font import DFont from diffenator.diff import DiffFonts from diffenator.dump import dump_glyphs from gfregression import downloadfonts import json current_dir = os.path.dirname(__file...
import jsonfield from datetime import datetime from decimal import Decimal from django.db import models class EmergencyOrderStatusUpdate(models.Model): STATUS_PENDING = 'PENDING' STATUS_RECEIVED = 'RECEIVED' STATUS_REJECTED = 'REJECTED' STATUS_APPROVED = 'APPROVED' STATUS_CANCELLED = 'CANCELLED' ...
"""Unit tests for collections.py.""" import unittest, doctest import inspect from test import support from collections import namedtuple, Counter, OrderedDict from test import mapping_tests import pickle, copy from random import randrange, shuffle import operator from collections import Hashable, Iterable, Iterator fr...
from marshmallow import ( EXCLUDE, fields, Schema, validate, validates, validates_schema, ValidationError, ) from marshmallow.schema import SchemaMeta from geopy.distance import geodesic from APITaxi_models2 import ( Hail, Town, ZUPC, ) from APITaxi_models2.hail import ( IN...
#!/usr/bin/env python """ An unofficial API for pitchfork.com reviews. author: Michal Czaplinski email: mmczaplinski@gmail.com """ import json import re import difflib import sys from bs4 import BeautifulSoup if sys.version_info >= (3, 0): from urllib.parse import urljoin from urllib.request import urlopen...
# -*- coding: utf-8 -*- """ Created on Sat May 30 14:01:10 2015. @author: gtucker """ from __future__ import print_function from landlab import ModelParameterDictionary, Component, FieldError, \ FIXED_VALUE_BOUNDARY from landlab.core.model_parameter_dictionary import MissingKeyError from landlab.c...
# coding: utf-8 from pupa.scrape import Scraper from utils import lxmlize, CanadianLegislator as Legislator import re from urlparse import urljoin COUNCIL_PAGE = 'http://www.calgary.ca/General/Pages/Calgary-City-Council.aspx' MAYOR_PAGE = 'http://calgarymayor.ca/forms_all.php' class CalgaryPersonScraper(Scraper): ...
""" The MIT License (MIT) Copyright (c) Serenity Software, LLC 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, m...
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011, 2012 Isaku Yamahata <yamahata 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 # ...
# -*- coding: utf-8 -*- ''' OpenStack Nova Cloud Module =========================== PLEASE NOTE: This module is currently in early development, and considered to be experimental and unstable. It is not recommended for production use. Unless you are actively developing code in this module, you should use the OpenStack ...
# # Copyright 2015 Horde Software Inc. # import math import json from kraken.ui.Qt import QtWidgets, QtGui, QtCore from port import InputPort, OutputPort, IOPort class NodeTitle(QtWidgets.QGraphicsWidget): __color = QtGui.QColor(25, 25, 25) __font = QtGui.QFont('Decorative', 14) __font.setLetterSpacing...
import os import string import contextlib from subprocess import Popen, PIPE check_output = None def replace_check_output(command_args, **kwargs): kwargs['stdout'] = PIPE return Popen(' '.join(command_args), **kwargs).stdout.read() try: from subprocess import check_output except ImportError: check_out...
# -*- coding: utf-8 -*- ''' Support for Linux LVM2 ''' from __future__ import absolute_import # Import python libs import os.path # Import salt libs import salt.utils import salt.ext.six as six from salt.exceptions import CommandExecutionError # Define the module's virtual name __virtualname__ = 'lvm' def __virtua...
# -*- coding: utf-8 -*- ''' Support for Linux LVM2 ''' from __future__ import absolute_import # Import python libs import os.path # Import salt libs import salt.utils import salt.ext.six as six from salt.exceptions import CommandExecutionError # Define the module's virtual name __virtualname__ = 'lvm' def __virtua...
# -*- coding: utf-8 -*- ''' Module for getting information about syslog-ng :maintainer: Tibor Benke <btibi@sch.bme.hu> :maturity: new :depends: cmd :platform: all This module is capable of managing syslog-ng instances which were installed via a package manager or from source. Users can use a direct...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except i...
#!/usr/bin/env python import os import time import ADC0832 import redis import boto3 import pygame from pygame import mixer #Set AWS details from enviroment varibles #test = os.environ['MAIL'] #print test aws_access_key_id = os.environ['AWS_ACCESS_KEY_ID'], aws_secret_access_key = os.environ['AWS_SECRET_ACCESS_KEY'], ...
from .base import PdoBase, Maps, Map, Variable import logging import collections import itertools import canopen logger = logging.getLogger(__name__) class PDO(PdoBase): """PDO Class for backwards compatibility :param rpdo: RPDO object holding the Receive PDO mappings :param tpdo: TPDO object holding th...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Mathias Colpaert # # 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 Found...
# -*- coding: utf-8 -*- """ Study-agnostic Pipeline functions Author: Scott Burns <sburns AT nmr DOT mgh DOT harvard DOT edu> Copyright 2011 Kuperberg Lab License: BSD,3 clause """ from subprocess import Popen,PIPE import os from os.path import join as pj import smtplib import time import string import pickle from ...
from __future__ import print_function from re import match from os import path from builtins import str, range from past.builtins import basestring import numpy as np import pandas as pd import gspread from oauth2client.client import OAuth2WebServerFlow from oauth2client.file import Storage from oauth2client.tools ...
from flask import Flask, jsonify, render_template, request, redirect from twilio import twiml from twilio.rest import TwilioRestClient import random import os import sendText import re url_params = {} url_params['term'] = 'date' url_params['limit'] = 10 url_params['sort'] = 0 app = Flask(__name__) app.config.from_pyf...
# -*- coding: utf-8 -*- # Copyright 2014–2015 Justin Lardinois # # 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 -*- from collections import namedtuple from datetime import datetime import functools import fnmatch from itertools import groupby import logging from os import path, walk import re import threading import sublime import sublime_plugin DEBUG = True DEFAULT_SETTINGS = { 'result_title': 'PDBs...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import urllib.parse import urllib.request import json dede_user_id="" sess_data="" header = { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Encoding": "utf-8", "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0...
from collections import defaultdict from typing import Dict, List, Set, Callable from copy import copy from vnpy.trader.object import ( TickData, TradeData, OrderData, ContractData, BarData ) from vnpy.trader.constant import Direction, Status, Offset, Interval from vnpy.trader.utility import virtual, floor_to, ce...
import os import re import logging import boto import urllib.request import zipfile import numpy as np import pandas as pd from math import ceil from sqlalchemy.dialects.postgresql import insert from sqlalchemy.exc import IntegrityError from dataactcore.logging import configure_logging from dataactcore.config import...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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...
""" Django settings for stables project. Generated by 'django-admin startproject' using Django 1.8.3. 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/ """ # Build path...
""" The haxby dataset: face vs house in object recognition ======================================================= A significant part of the running time of this example is actually spent in loading the data: we load all the data but only use the face and houses conditions. """ ### Load Haxby dataset ################...
#! /usr/bin/env python # # Builds binary and source RPMs for a CSDMS model or tool. # # Examples: # $ python build.py --help # $ python build.py --version # $ python build.py hydrotrend # $ python build.py babel # $ python build.py cem --tag 0.2 # $ python build.py hydrotrend --local $HOME/rpm_models # $ ...
""" Module for reading and indexing Starbound assets """ # TODO: this file should end up similar to save_file in that it has no external # deps. need to: # - custom exception classes import os, json, re, sqlite3, logging, random from io import BytesIO from PIL import Image import starbound import starbound.btreedb4...
VERSION = '4.1.0'
try: from django.core.exceptions import ImproperlyConfigured except ImportError: ImproperlyConfigured = RuntimeError try: from rest_framework.views import exception_handler as _exception_handler except (ImportError, ImproperlyConfigured): _exception_handler = None def post_exception_handler(exc, cont...
from multiprocessing.pool import ThreadPool from threading import Lock from cloudshell.helpers.scripts import cloudshell_scripts_helpers as helpers from cloudshell.api.cloudshell_api import * from cloudshell.api.common_cloudshell_api import CloudShellAPIError from cloudshell.core.logger import qs_logger from sandbox_...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Kevin Brebanov <https://github.com/kbrebanov> # Based on pacman (Afterburn <http://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>) # and apt (Matthew Williams <matthew@flowroute.com>>) modules. # # This module is free software: you can redistribu...
__version__ = '2.34.5'
import lldb INTEL_ARGS_REGISTERS = [ "rdx", "rcx", "r8", "r9", ] def class_from_reciever(reciever): return reciever.split()[0].strip("<:") def selector_from_register(register): return register.split()[-1].strip('"') def output_for_command(debugger, command): interpreter = debugger.GetCommandInter...
from datetime import datetime from datetime import timedelta from time import sleep import argparse import json import requests import sys import urlparse import yaml DEFAULT_CONF_FILE = '/etc/loadmonitor/config.yml' META_DATA_URL = 'http://169.254.169.254/openstack/latest/meta_data.json' class Config(): def __...
""" Graph node classification using GraphSAGE. Requires a EPGM graph as input. This currently is only tested on the CORA dataset. Example usage: python epgm-example.py -g ../../tests/resources/data/cora/cora.epgm -l 20 20 -s 20 10 -e 20 -d 0.5 -r 0.02 usage: epgm-example.py [-h] [-c [CHECKPOINT]] [-n BATCH_SIZE] [-e ...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# # Copyright (C) 2008 The Android Open Source 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 # # Unless required by applicable la...
""" Pipeline: chain transforms and estimators to build a composite estimator. """ # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Licence: BSD from .base import BaseEstimator class Pipeline(BaseEstimator): """ Pipeline of transforms with a final estimator Sequentialy appl...
import six import json from abc import abstractproperty, abstractmethod from requests.structures import CaseInsensitiveDict class BaseProcessor(object): NAME = None def process_raw(self, raw_doc, **kwargs): pass # pragma: no cover def process_normalized(self, raw_doc, normalized, **kwargs): ...
""" byceps.services.seating.seat_group_service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from typing import Optional, Sequence from ...database import db from ...typing import PartyID from ..ticketing.models.ticket impo...
# -*- coding: utf-8 -*- from .object import Object from .lobby import Lobby class Community(Object): """Represents a Spectrum Community object Supported Operations: +-----------+--------------------------------------------+ | Operation | Description | +====...
# Copyright 2012 Daniel B. Allan # dallan@pha.jhu.edu, daniel.b.allan@gmail.com # http://pha.jhu.edu/~dallan # http://www.danallan.com # # 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 ve...
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
from __future__ import division from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import copy import chainer from chainer import cuda import chainer....
#!/usr/bin/env python import os import glob import subprocess as sp import argparse import sys from collections import defaultdict from itertools import chain import networkx as nx import nose from conda_build.metadata import MetaData PYTHON_VERSIONS = ["27", "34", "35"] os.environ.update({ "CONDA_PERL": "5.22...
# # # Copyright (C) 2010, 2013 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...
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import re import urlparse try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from gunicorn.http.body import ChunkedReader, LengthReader, EOFReader...
#!/usr/bin/env python ################################################################################ # Copyright (c) 2011-2016, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may...
#!/usr/bin/python import os.path class ClusterNode: def __init__(self, spec_string): (self.user, rest) = spec_string.split('@',1) rest = rest.split(':', 1) self.node = rest[0] if (len(rest) > 1): self.reuse_count = int(rest[1]) else: self.reuse_count...
#!/usr/bin/env python import re from itertools import product from cached_property import cached_property from pyclarity_lims.entities import Sample, Container from EPPs.common import StepEPP, get_workflow_stage, InvalidStepError, RestCommunicationEPP class CreateSamples(StepEPP, RestCommunicationEPP): """uses...
#!/usr/bin/env python3 import os, sys, argparse, logging, shutil, asyncio, time, signal import appdirs import hangups from threading import Thread from utils import simple_parse_to_segments, class_from_name from hangups.ui.utils import get_conv_name import config import handlers from sinks.listener import start_lis...
#!/usr/bin/env python3 import zmq import time import pickle import logging logger = logging.getLogger(__name__) class CommandClient(object): """ CommandClient """ def __init__(self, ip_address, port_range): """ Parameters ---------- ip_address: str IP address ...
import os import sys fullname = sys.argv[1] path, name = os.path.split(fullname) if os.name == "posix": node = "node" elif os.path.exists("c:\\program files\\nodejs\\node.exe"): node = "\"c:\\program files\\nodejs\\node\"" else: node = "node" if os.system("{} -q -t js {}".format(os.path.join("bin", "neon...
"""Methods to check and update the database files for sqlite.""" import json import os.path import re from . import cm_table_info, mc class SqliteHandling: """ Database csv table hash info handler. Attributes ---------- cm_csv_path : str or None Path containing the csv data files. If No...
from django import template from django.contrib.contenttypes.models import ContentType from molo.commenting.models import MoloComment # NOTE: heavily inspired by # https://github.com/santiagobasulto/django-comments-utils register = template.Library() def get_molo_comments(parser, token): """ Get a l...
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.shortcuts import render from wagtail.core.models import Page from wagtail.search.models import Query def search(request): search_query = request.GET.get('q', None) page = request.GET.get('page', 1) # Search if searc...
# coding: utf-8 """ Gaia Challenge 2 -- Pal 5 Challenge """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import logging import os import sys # Third-party from astropy import log as logger import matplotlib.pyplot as plt import numpy as np import ...
from datetime import datetime import iso8601 from flask import Blueprint, jsonify, request, current_app from app.config import QueueNames from app.dao.dao_utils import dao_save_object from app.dao.templates_dao import dao_get_template_by_id_and_service_id from app.dao.users_dao import get_user_by_id from app.dao.broad...