text stringlengths 12 6.59M |
|---|
"""
MPP Solar Inverter Command Library
reference library of serial commands (and responses) for PIP-4048MS inverters
mppcommand.py
"""
# Backward compatibility to python2
from builtins import bytes
import ctypes
import logging
import random
log = logging.getLogger('MPP-Solar')
def crc(byte_cmd):
"""
Calcul... |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
# -*- coding: utf8 -*-
from ircBase import *
from random import randint
import sys
#Check if a message is requesting room history
def getHistoryQuery(aMessage):
expression = re.compile('(history|hist) (me|ma)(.*)', re.IGNORECASE)
match = expression.match(aMessage.body)
return match
def main(irc):
message = irc.l... |
"""Common logging functions."""
import os
import signal
import subprocess
import sys
import tempfile
from datetime import datetime
import psutil
from . import db, util
DEBUG = 10
INFO = 20
ERROR = 30
FATAL = 40
LEVEL = {
'debug': DEBUG,
'info': INFO,
'error': ERROR,
'fatal': FATAL,
}
class Logger... |
'''View Controller
======================
Displays the preview or live pixel output of the experiment.
'''
import multiprocessing as mp
import numpy as np
import os
import sys
from fractions import Fraction
import traceback
from queue import Empty
import uuid
from typing import Optional, Dict, List
from ... |
#!/usr/bin/env python
import sys
import os
import subprocess
import pysam
import textwrap
import argparse
from uuid import uuid4
def print_header():
print textwrap.dedent("""\
##fileformat=VCFv4.1
##phasing=none
##INDIVIDUAL=TRUTH
##SAMPLE=<ID=TRUTH,Individual="TRUTH",Description="bamsurgeon spik... |
import os
import subprocess
import sys
from pyshark.tshark.tshark import get_tshark_path
from pyshark.tshark.tshark_xml import packet_from_xml_packet, psml_structure_from_xml
class TSharkCrashException(Exception):
pass
class UnknownEncyptionStandardException(Exception):
pass
class Capture(object):
"""
... |
from rest_framework.views import APIView
from rest_framework.renderers import JSONRenderer, JSONPRenderer
from rest_framework.response import Response
import logging
from logical.models import Database
from physical.models import Plan
from django.utils.html import strip_tags
from rest_framework import status
from slugi... |
#!/usr/bin/env python
import sys
import os
import subprocess
import pysam
import textwrap
import argparse
from uuid import uuid4
def print_header():
print textwrap.dedent("""\
##fileformat=VCFv4.1
##phasing=none
##INDIVIDUAL=TRUTH
##SAMPLE=<ID=TRUTH,Individual="TRUTH",Description="bamsurgeon spik... |
from __future__ import division
from __future__ import print_function
import argparse
import gc
import json
import math
import platform
import sys
import time
import traceback
from collections import defaultdict
from datetime import datetime
from distutils.version import StrictVersion
import py
import pytest
from . ... |
from typing import List, Dict, Any, Tuple, Optional
import ast
import os.path
# noinspection PyPackageRequirements
import yaml # from pyyaml
import dectree.propfuncs as propfuncs
CONFIG_NAME_OR_PATTERN = 'or_pattern'
CONFIG_NAME_AND_PATTERN = 'and_pattern'
CONFIG_NAME_NOT_PATTERN = 'not_pattern'
CONFIG_NAME_FUNCTIO... |
#!/usr/bin/env python
# @package sct_nurbs
#
# - python class. Approximate or interpolate a 3D curve with a B-Spline curve from either a set of data points or a set of control points
#
#
# Description about how the function works:
#
# If a set of data points is given, it generates a B-spline that either approximates t... |
from __future__ import division
from __future__ import print_function
import argparse
import gc
import json
import math
import platform
import sys
import time
import traceback
from collections import defaultdict
from datetime import datetime
from distutils.version import StrictVersion
import py
import pytest
from . ... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright (c) 2013-2014, Kevin Greenan (kmgreen2@gmail.com)
# Copyright (c) 2014, Tushar Gohad (tushar.gohad@intel.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:
#
# Redistributions of sou... |
import ConfigParser
import os
class Config(object):
config = None
def __init__(self):
self.read_config()
def read_config(self):
"""Return config object from config file"""
self.cfg = ConfigParser.ConfigParser()
self.cfg.read(os.path.join(os.getenv('CONFROOT'),'salvavida.cf... |
"""
This tests aims to validate the NACA4 airfoil series
class by calculating the values for upper and lower
surfaces, camber, camber gradient and thickness for
the following airfoils:
- NACA 0010
- NACA 2412
- NACA 4424
Any other airfoil can be calculated by adding its
... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
#!/usr/bin/env python
import os
from igf_data.utils.tools.samtools_utils import convert_bam_to_cram
from ehive.runnable.IGFBaseProcess import IGFBaseProcess
from igf_data.utils.analysis_collection_utils import Analysis_collection_utils
from igf_data.utils.tools.reference_genome_utils import Reference_genome_utils
from ... |
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2009 by the FIFE team
# http://www.fifengine.de
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# ... |
# 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
from frappe import _, scrub
from erpnext.stock.utils import get_incoming_rate
from erpnext.controllers.queries import get_match_cond
from ... |
import socket
import redis_commands
SERVER_ADDRESS = ("127.0.0.1", 6379)
BYTES_LENGTH = 1024
def create_socket():
return socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def listen(sock, server_address):
sock.bind(server_address)
sock.listen(1)
return sock
def accept(sock):
conn, client_addr... |
from datetime import date, datetime, timedelta, time
from calendar import month_name
from dimagi.utils.logging import log_exception
from dimagi.utils.parsing import string_to_datetime
from dateutil.rrule import *
def force_to_date(val):
"""Forces a date, string, or datetime to a date."""
if not val: ... |
__version__ = '0.6.0.dev1'
__author__ = 'D-Wave Systems Inc.'
__authoremail__ = 'acondello@dwavesys.com'
__description__ = 'A shared API for binary quadratic model samplers.'
|
# 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 the Li... |
from math import log as _log
from mpmath.libmp import sqrtrem as mpmath_sqrtrem
from .sympify import _sympify
from .cache import cacheit
from .singleton import S
from .expr import Expr
from .evalf import PrecisionExhausted
from .function import (_coeff_isneg, expand_complex, expand_multinomial,
... |
import sys
import rlp
from rlp.sedes import CountableList, binary
from rlp.utils import decode_hex, encode_hex, ascii_chr, str_to_bytes
from ethereum import opcodes
from ethereum import utils
from ethereum import specials
from ethereum import bloom
from ethereum import vm as vm
from ethereum.exceptions import *
from et... |
"""Summarise XFEL data in files or folders
"""
import argparse
import os
import re
import sys
from .reader import H5File, RunHandler
rawcorr_descr = {'RAW': 'Raw', 'CORR': 'Corrected'}
detector_names = {'AGIPD', 'LPD'}
def describe_file(path):
"""Describe a single HDF5 data file"""
basename = os.path.basenam... |
"""
Spawner
The spawner takes input files containing object definitions in
dictionary forms. These use a prototype architecture to define
unique objects without having to make a Typeclass for each.
The main function is `spawn(*prototype)`, where the `prototype`
is a dictionary like this:
```python
GOBLIN = {
"typec... |
"""Blotter is a bingo callback for use from the client side
GETs allow you to check the user's experiment status from within js while
POSTs allow you to score conversions for a given test
"""
import os
import logging
from google.appengine.ext.webapp import RequestHandler
from .gae_bingo import bingo, ab_test
from... |
from mayavi import mlab
import numpy
import re
def mycolor(x):
"""Returns a color vector (a triple of floats) based on x, where x is
in the range [0, 1].
"""
lut = [
[ 0, 0, 0, 255],
[ 1, 0, 0, 255],
[ 2, 0, 0, 255],
[ 4, 0, 0, 255],
[ 5, ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import datetime
import frappe
import googlemaps
from frappe import _
from frappe.model.document import Document
from frappe.utils.user i... |
import numpy as np
from astropy.wcs import WCS
wcs_parameters_to_preserve = ['cel_offset','dateavg','dateobs','equinox',
'latpole', 'lonpole', 'mjdavg', 'mjdobs', 'name',
'obsgeo', 'phi0', 'radesys', 'restfrq',
'restwav', 'specsy... |
from random import randint, choice
from datetime import datetime, timedelta
# This is the way to store special Unicode characters.
# I hate how they break in dumb operating systems.
degrees = chr(0xBA) + "C"
wind_directions = [chr(0x27A1) + chr(0xFE0F), # E
chr(0x2B05) + chr(0xFE0F), # W
... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
import sys; reload(sys)
sys.setdefaultencoding('utf-8') # we always need failsafe utf-8, in some way
import os
import re
import time
import hashlib
import urllib
import difflib
import smtplib
import htmlentitydefs
from email.mime.text import MIMEText
# tag used in ... |
"""
Read test or example data
"""
from __future__ import division, print_function, absolute_import
import sys
import json
from nibabel import load
from os.path import join as pjoin, dirname
import gzip
import numpy as np
from dipy.core.gradients import GradientTable, gradient_table
from dipy.core.sphere import Sphe... |
import io
import logging
import numpy as np
import os
import re
import typing
from typing import Any, Dict, Optional, Text
from rasa_nlu import utils
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.featurizers import Featurizer
from rasa_nlu.training_data import Message, TrainingData
logger = logging.get... |
import pyVmomi
import datetime
from common.methods import set_progress
from resourcehandlers.vmware.pyvmomi_wrapper import get_vm_by_uuid, wait_for_tasks
from resourcehandlers.vmware.models import VsphereResourceHandler
from resourcehandlers.vmware.vmware_41 import TechnologyWrapper
from jobengine.jobmodules.syncvmsjob... |
# 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... |
# 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... |
#!/usr/bin/env python
"""
Download interface for the data stored in coop database (alldata)
This is called from /request/coop/fe.phtml
"""
import cgi
import os
import sys
import datetime
import zipfile
from io import BytesIO
import unittest
import pandas as pd
from pandas.io.sql import read_sql
import psycopg2.extr... |
import py
import pytest
from xdist.slavemanage import SlaveController, unserialize_report
from xdist.remote import serialize_report
import execnet
import marshal
queue = py.builtin._tryimport("queue", "Queue")
WAIT_TIMEOUT = 10.0
def check_marshallable(d):
try:
marshal.dumps(d)
except ValueError:
... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import chainer
import chainer.cuda as cuda
import chainer.functions as F
from chainerrl.agents imp... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
'''Libraries used by the main program
All the libraries that will be used by the
main program will be placed here. For now
it only has a single file that contains a
test program. You want to add your own
libraries here which are meaningful.
''' |
import os
import pickle
import numpy as np
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings")
import django
django.setup()
import jsonpickle
from basicviz.models import Experiment,Document,Feature,FeatureInstance,Mass2Motif,Mass2MotifInstance,DocumentMass2Motif,FeatureMass2MotifInstance... |
"""Celery Tasks for the FOIA application"""
# pylint: disable=too-many-lines
# Django
from celery.exceptions import SoftTimeLimitExceeded
from celery.schedules import crontab
from celery.task import periodic_task, task
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.po... |
#!BPY
"""
Name: 'NetImmerse/Gamebryo (.nif)'
Blender: 245
Group: 'Import'
Tip: 'Import NIF File Format (.nif)'
"""
__author__ = "The NifTools team, http://niftools.sourceforge.net/"
__url__ = ("blender", "elysiun", "http://niftools.sourceforge.net/")
__bpydoc__ = """\
This script imports Netimmerse and Gamebryo .NI... |
# -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# 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, eit... |
from django.shortcuts import get_object_or_404, render_to_response
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest
##from multiuploader.models import MultiuploaderImage
from django.core.files.uploadedfile import UploadedFile
#importing json parser to generate jQuery plugi... |
#!/usr/bin/python
# Copyright (C) 2006 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a full list
# of copyright holders.
#
# Prof. C Pain
# Applied Modelling and Computation Group
# Department of Earth Science and Engineering
# Imperial College... |
#! /usr/bin/python
import roslib; roslib.load_manifest('hai_sandbox')
import rospy
#import hrl_pr2_lib.pr2_kinematics as pk
#import pr2_msgs.msg as pm
#import pr2_gripper_reactive_approach.reactive_grasp as rgr
#import pr2_gripper_reactive_approach.controller_manager as con
#from pr2_gripper_sensor_msgs.msg import PR2... |
import os.path
from decimal import Decimal
from munge import config
from munge.csv_util import import_csv, unicode_csv_reader
from munge.sa_util import results_dict, get_result_fields
DIRECTORY = 'vao'
IMPORTER = 'vao'
VAO_LIST_TABLE = 'vao_list_raw'
VAO_LIST_FILE = 'LIST_2010_MERGED.dta.30Sep2015'
VAO_FILE = 'SMV_... |
import pep8
import re
import os
import sys
import token as token_type
CLASS_NAME_MATCH = re.compile(r'^_*[A-Z][a-zA-Z0-9]*_*$')
FUNCTION_NAME_MATCH = re.compile(r'^(_*|test_)[a-z][a-zA-Z0-9]*_*$')
MEMBER_NAME_MATCH = re.compile(r'^[a-z_][a-z0-9_]*$')
VARIABLE_NAME_MATCH = re.compile(r'^[a-z][a-z0-9_]*$')
# Check the... |
# This file is part of Maker Keeper Framework.
#
# Copyright (C) 2017 reverendus
#
# 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) a... |
#!/usr/bin/env python
#
# Copyright 2014 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 o... |
import os
import logging
import struct
import constants
from MainIndexEntry import MainIndexEntry
from GenreIndexEntry import GenreIndexEntry
from PerformerIndexEntry import PerformerIndexEntry
from AlbumIndexEntry import AlbumIndexEntry
from SubIndexEntry import SubIndexEntry
log = logging.getLogger()
class Kenwood... |
import sublime
import sublime_plugin
class SbpToggleCommentCommand(sublime_plugin.TextCommand):
def run(self, edit, **args):
self.view.run_command("toggle_comment")
self.view.run_command("sbp_cancel_mark")
# Remove any existing marks
#
class SbpCancelMarkCommand(sublime_plugin.TextCommand):
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import re
import functools
from lxml import etree
import logging
import dateutil
from datetime import time
from pytz import timezone
from django.conf import settings
from django.core.validators import URLValidator
from django.core.exceptions impo... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import sys
import marshal
import types as python_types
import warnings
import copy
from six.moves import zip
from keras import backend as K
def to_list(x):
'''... |
from UM.Workspace.WorkspaceReader import WorkspaceReader
from UM.Application import Application
from UM.Logger import Logger
from UM.i18n import i18nCatalog
from UM.Settings.ContainerStack import ContainerStack
from UM.Settings.DefinitionContainer import DefinitionContainer
from UM.Settings.InstanceContainer import In... |
#!/usr/bin/env python
# Program: photon_toa.py
# Authors: Paul S. Ray <paul.ray@nrl.navy.mil>
# Matthew Kerr <matthew.kerr@gmail.com>
# Description:
# Reads a FITS file of photon event times (from NICER or another X-ray mission)
# and generates TOAs from the unbined times using a pulsar timing model
# and an a... |
#!/usr/bin/env python
# Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run layout tests using the test_shell.
This is a port of the existing webkit test script run-webkit-tests.
The TestRunner... |
"""
CRUD manager module.
Functions
---------
- `create_tables` -- Manage construction of tables for a given database.
- `drop_tables` -- Manage destuction of tables for a given database.
- `add_tube` -- Manage addition of tube into a given database.
"""
import configparser
import pathlib
import mysql.connector
imp... |
# -*- coding: utf-8 -*-
from connection import ScrapeBase
import urlparse
import urllib2
import json
import sys, os
class Analysis( ScrapeBase ):
"""
Runs analysis on a website to try to find appropioate tags and code
"""
def __init__(self, mainUrl):
self.url = mainUrl
def loadSoup(self):
print "getti... |
#!/usr/bin/env python
# Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run layout tests using the test_shell.
This is a port of the existing webkit test script run-webkit-tests.
The TestRunner... |
from hdl_toolkit.hdlObjects.typeShortcuts import vecT, vec
from hdl_toolkit.interfaces.std import Handshaked, RegCntrl, VectSignal
from hdl_toolkit.interfaces.utils import addClkRstn, propagateClkRstn, log2ceil
from hdl_toolkit.synthesizer.codeOps import If, In, Concat, connect
from hdl_toolkit.synthesizer.interfaceLev... |
"""
Thermophysical properties of water and humid air.
This module provides a convenient wrapper around specific funtionality of the
`CoolProp package`_. Specifically, the ability to calulate properties at a
given state. A state in this case is defined as the combination of pressure `p`
in Pa, dry bulb temperature `t` ... |
#!/usr/bin/env python
# Reads energy levels from qe output and plots (1d) band structure
# to file "bands.png"
import atk.format.qe as qe
from sys import argv
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pylab as plt
import argparse
# Define command line parser
parser = argparse.Argume... |
#! /usr/bin/python
# Scans the LAN for all hosts and reports some statistics about them
import MySQLdb as mdb
import subprocess as sp
import sys
import syslog
import time
import traceback
# compare the gathered data to what is in the database
def lstvssql(hostlist):
try:
lastseen = time.strftime('%Y-%m-%d %H:%... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from .transform import *
__version__ = '3.20'
def test(*args, **kwargs):
"""
Run py.test unit tests.
"""
import testr
return testr.test(*args, **kwargs)
|
# A somewhat ugly, utilitarian script takes xml data file output from the Tecan Infinite m1000 Pro
# plate reader and allows for the quick visual inspection of raw data.
#
# Usage:
# python quickmodel.py --inputs 'inputs_example'
# or
# python quickmodel.py --inputs 'inputs_spectra_example' --ty... |
#!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo 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... |
#!/usr/bin/env python
"""
Copyright 2013 CRX Markets S.A.
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... |
#!/usr/bin/python
import getpass
from lxml import etree as ET
import optparse
import sys
import urllib
import urllib2
from conary.lib import digestlib
def main():
op = optparse.OptionParser(usage = "%prog [options] xml-stream")
op.add_option('-s', '--server', help = "rBuilder Server Name")
op.add_option(... |
#!/usr/bin/env python
import sys
import argparse
from metasv.main import run_metasv
from metasv.generate_sv_intervals import DEFAULT_MIN_SUPPORT
from metasv._version import __version__
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Merge SVs from multiple tools for accurate SV calling",... |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import scIB
import warnings
warnings.filterwarnings('ignore')
import argparse
from functools import reduce
if __name__=='__main__':
"""
Scale LISI scores in the output of merge_metrics.py
"""
parser = argparse.ArgumentPa... |
'''
This file contains classes and functions for representing, solving, and simulating
agents who must allocate their resources among consumption, saving in a risk-free
asset (with a low return), and saving in a risky asset (with higher average return).
'''
import numpy as np
from scipy.optimize import minimize_scalar
... |
"""
This file contains classes and functions for representing, solving, and simulating
agents who must allocate their resources among consumption, saving in a risk-free
asset (with a low return), and saving in a risky asset (with higher average return).
"""
import numpy as np
from copy import deepcopy
from HARK import ... |
"""
Collection of commonly used functions for general file input and output.
Functions:
check_iris_var -- Check if a variable is in the list of iris standard names
check_time_units -- Check time axis units
check_xarrayDataset -- Check xarray.Dataset for data format compliance
create_outd... |
# -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio 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 versio... |
"""
Collection of commonly used functions for general file input and output.
Functions:
check_iris_var -- Check if a variable is in the list of iris standard names
check_time_units -- Check time axis units
check_wfo_sign -- Check that the wfo variable has correct sign
check_globa... |
# -*- coding: utf-8 -*-
##
##
## This file is part of CDS Indico.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
##
## CDS 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 2 o... |
"""Endpoints integrating with Github, Bitbucket, and other webhooks."""
import hashlib
import hmac
import json
import logging
import re
from django.shortcuts import get_object_or_404
from rest_framework import permissions, status
from rest_framework.exceptions import NotFound, ParseError
from rest_framework.renderers... |
from ..backend import KeyringBackend
class Keyring(KeyringBackend):
"""
Keyring that raises error on every operation.
>>> kr = Keyring()
>>> kr.get_password('svc', 'user')
Traceback (most recent call last):
...
RuntimeError: ...No recommended backend...
"""
priority = 0
def ... |
import logging, os, praw, re, random, time, urlparse, urllib2, sys;
archived = [];
user = os.environ['REDDIT_USER'];
def main():
r = praw.Reddit("Creates snapshots using archive.today", domain="api.reddit.com");
r.login(user, os.environ['REDDIT_PASS']);
logging.info("Logged in and started post archiving."... |
"""
The MIT License (MIT)
Copyright (c) 2015 Colum McGaley <cxm7688@rit.edu>
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, c... |
import requests
from bs4 import BeautifulSoup
import datetime
import re
import warnings
# Fetch the output to a string, `output`.
url = "https://wp.stolaf.edu/reslife/dining-hours/"
output = requests.get(url).text
# Now, parse it.
output = BeautifulSoup(output)
# NOTE(rye): There is no filtering to prevent loading t... |
# 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):
# Create temporary columns
db.add_column('generic_rating', 'object_pk_migrating', self.gf('django.db.model... |
#!/usr/bin/env python3
import sys
sys.path.append(
os.path.dirname(__file__)
)
import logging
import os
import time
import pymongo
from datetime import datetime as dt
from pymongo import MongoClient
from bson.objectid import ObjectId
from backup_logger import LOGGER
DEFAULT_CONFIG_FILE_NAME = 'config.yaml'
DE... |
# -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2013, The Tor Project, Inc.
# (c) 2007-2013, all entities within the AUTHORS file... |
"""Class for Sorting Network Cards resource generator."""
import os.path
from random import sample
from PIL import Image, ImageDraw, ImageFont
from resources.utils.BaseResourceGenerator import BaseResourceGenerator
from django.utils.translation import ugettext as _
from resources.utils.resource_parameters import EnumR... |
from __future__ import print_function, absolute_import, division
import pytest
import itertools
import operator
import numpy as np
from numpy.testing import assert_allclose
from numpy.lib.stride_tricks import as_strided
from astropy.wcs import WCS
from astropy import units as u
from .test_spectral_cube import cube_an... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import sdss
from ...exceptions import TimeoutError
from astropy import coordinates
from astropy.table import Table
from astropy.tests.helper import pytest, remote_data
import requests
import imp
imp.reload(requests)
@remote_data
def test_images_... |
# postgresql/hstore.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re
from .base import ARRAY
from ... import types as sqltypes
from ...sql ... |
## Two chained reservoirs with inflow in one supply two electric loads
#
#Two disconnected electrical loads are fed from two reservoirs linked by a river; the first reservoir has inflow from rain onto a water basin.
#
#Note that the two reservoirs are tightly coupled, meaning there is no time delay between the first on... |
from __future__ import print_function, division, absolute_import
from collections import Iterable, defaultdict
from itertools import count, cycle
import random
import socket
import uuid
from tornado import gen
from tornado.gen import Return
from tornado.ioloop import IOLoop
from tornado.iostream import IOStream, Stre... |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
#!/usr/bin/env python3
"""
Client library generator for SciGraph REST api.
"""
import requests
class State:
def __init__(self, api_url):
self.shebang = "#!/usr/bin/env python3\n"
self.imports = "import requests\n\n"
self.api_url = api_url
self.current_path = self.api_url
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.