text stringlengths 12 6.59M |
|---|
#!/usr/bin/python
#
# Copyright (C) 2007 SIOS Technology, 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 appli... |
# Copyright 2008-2009 Nokia Siemens Networks Oyj
#
# 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... |
"""
Django settings for Homepage project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (homepage/config/... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright 2008-2009 Nokia Siemens Networks Oyj
#
# 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... |
#Copyright (c) 2007, Playful Invention Company
#Copyright (c) 2008-9, Walter Bender
#Copyright (c) 2009, Raul Gutierrez Segales
#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 restricti... |
import logging
from pajbot.managers.connection import ConnectionManager
log = logging.getLogger(__name__)
def do_nothing(_c, _e):
pass
class IRCManager:
def __init__(self, bot):
self.bot = bot
self.channels = []
self.channel = "#" + self.bot.streamer
self.channels.append(... |
# Copyright 2008-2013 Nokia Siemens Networks Oyj
#
# 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... |
__all__ = [
'test',
]
import unittest
import fnmatch
import os
try:
from colour_runner.runner import ColourTextTestRunner as TextTestRunner
except ImportError:
from unittest import TextTestRunner
def test(close=False):
"""
@desc: This is a convienance method to run all of the tests in `PVGeo`.
... |
#Copyright (c) 2007, Playful Invention Company
#Copyright (c) 2008-9, Walter Bender
#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
... |
import re
from emend import Edit
PAGE_SIZE = 10
def get(handler, response):
query = handler.request.get('q')
status = handler.request.get('status')
response.query = query
response.status = status
search_args = dict(status=status)
# default heading
if status == "open":
response.default_heading = "O... |
# Copyright 2015 Mario Graff Guerrero
# 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 wri... |
# pylint: disable=W0231,E1101
import collections
import functools
import warnings
import operator
import weakref
import gc
import json
import numpy as np
import pandas as pd
from pandas._libs import tslib, properties
from pandas.core.dtypes.common import (
_ensure_int64,
_ensure_object,
is_scalar,
is_... |
#Copyright (c) 2007, Playful Invention Company
#Copyright (c) 2008-12, Walter Bender
#Copyright (c) 2009-10 Raul Gutierrez Segales
#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 restri... |
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of co... |
import os
import discord
from discord.ext import commands
from discord.utils import find
from __main__ import send_cmd_help
import random, time, datetime
import aiohttp
import asyncio
import re, operator
import urllib.request
try:
from bs4 import BeautifulSoup
except:
raise RuntimeError("bs4 requir... |
# Orca
#
# Copyright 2004 Sun Microsystems Inc.
#
# 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; either
# version 2 of the License, or (at your option) any later version.
#
# This libra... |
from flask import jsonify
import requests, operator, math, json, csv, os
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeRegressor as DTR
from sklearn.ensemble import RandomForestRegressor as RFR
from sklearn.ensemble import ExtraTreesRegressor as ETR
from sklearn.svm import SVR
from sklearn.ensem... |
# pylint: disable=W0231,E1101
import warnings
import operator
import weakref
import gc
import numpy as np
import pandas.lib as lib
import pandas as pd
from pandas.core.base import PandasObject
from pandas.core.index import (Index, MultiIndex, _ensure_index,
InvalidIndexError)
import pand... |
#!/usr/bin/env python
#Written for Pyhon 2.7.5
#Written by: Adam Walsh
#Written on 7/6/14
#Maintained @ https://github.com/walshie4/Ultimate-Blocklist
import requests
import urllib
from bs4 import BeautifulSoup as mksoup
import gzip
import os
BASE = "https://www.iblocklist.com"
def get_value_from(url):
soup = mk... |
# cython: language_level = 2
#
# Code output module
#
import cython
cython.declare(os=object, re=object, operator=object,
Naming=object, Options=object, StringEncoding=object,
Utils=object, SourceDescriptor=object, StringIOTree=object,
DebugFlags=object, basestring=object... |
import copy
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.db import models
from django.forms.models import modelform_factory
from django.http import Http404
from django.template import loader
from ... |
#! /usr/bin/env python
# ------------------------------------------------------------------------------
# Script which imports portal data.
#
# ------------------------------------------------------------------------------
import os
import sys
import getopt
from cbioportal_common import *
# -------------------------... |
# pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
import itertools
import numpy as np
from pandas.core.series import Series
from pandas.core.frame import DataFrame
from pandas.core.common import notnull, _ensure_platform_int
from pandas.core.groupby import get_group_index
from pandas.core.inde... |
"""
UnbalancedDataset
=================
UnbalancedDataset is a python module offering a number of re-sampling
techniques commonly used in datasets showing strong between-class
imbalance.
Most classification algorithms will only perform optimally when the number of
samples of each class is roughly the same. Highly ske... |
#! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import os, re
from sys import platform as _platform
import collections
import random
import numpy as np
import warnings
from six.moves import xrange
from tensorflow.python.platform import gfile
import re
## Iteration functions
def generate_skip_gram_ba... |
import copy
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.db import models
from django.forms.models import modelform_factory
from django.http import Http404
from django.template import loader
from ... |
from __future__ import division
# pylint: disable-msg=W0402
import random
import re
import string
import sys
import tempfile
import warnings
import inspect
import os
import subprocess
import locale
import unittest
from datetime import datetime
from functools import wraps, partial
from contextlib import contextmanager... |
from collections import defaultdict
from copy import copy
from django.contrib import messages
from django.db import transaction
from django.utils.translation import ugettext as _
from corehq.apps.data_interfaces.models import AutomaticUpdateRule
from corehq.apps.sms.util import get_language_list
from corehq.messaging.... |
import os
import sys
import re
import getopt
import time
import zipfile
from os.path import basename, dirname, join
from indexed_repo.metadata import (data_from_spec, rawspec_from_dist,
write_index, append_dist)
from indexed_repo import Req
def writestr(z, arcname, data):
zinf... |
import copy
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.db import models
from django.forms.models import modelform_factory
from django.http import Http404
from django.template import loader
from ... |
"""
sentry.event_manager
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import math
import six
from datetime import datetime, timedelta
from django.... |
# Here's a probably-not-very-good port of the Adafruit Arduino library for
# this sensor. The Adafruit library is located here:
# https://github.com/adafruit/Adafruit_TCS34725
# This port is for the Beaglebone Black and the Adafruit_BBIO and Adafruit_I2C
# libraries. By AKA MEDIA SYSTEM
from Adafruit_I2C import Adafru... |
#!/usr/bin/env python
from __future__ import print_function
import re
import sys
from functools import partial
from operator import itemgetter, ge
from difflib import SequenceMatcher
import subprocess
def tokenize(phrase, sep='\W+', minlen=1, unique=False):
"""Split string ``phrase`` according to ``sep``, expunge... |
#!/usr/bin/env python
"""
@package coverage_model.test.test_coverage
@file coverage_model/test/test_coverage.py
@author James Case
@brief Test cases for the coverage_model module
"""
import random
import os
import shutil
import tempfile
from pyon.public import log
import numpy as np
from coverage_model import *
from... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
from collections import Mapping, defaultdict
from distutils.version import LooseVersion
from numbers import Number
import sys
import numpy as np
import pandas as pd
from . import ops
from . i... |
##########################################################################
#
# Copyright (c) 2007-2009, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
"""
WoW-style MPQ-based environments
"""
import os
import re
import mpq
class BuildNotFound(Exception):
pass
class LocaleNotFound(Exception):
pass
class Base(object):
"""
A Base is a helper class that points to a base directory for an environment.
In its raw state (without a build), the base only has a raw pat... |
from flask import Flask, Response, jsonify, request, render_template
from barista import messaging
from redis import Redis
import redis_collections as redisC
import numpy as np
import argparse
from caffe import SGDSolver
# Global settings, only set once, when the server is started
redisInstance = None
snapshot_frequen... |
#!/usr/bin/env python
#
# zip up the titanium mobile SDKs into suitable distribution formats
#
import os, types, glob, shutil, sys, platform
import zipfile
cur_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
template_dir = os.path.join(cur_dir,'support')
all_dir = os.path.abspath(os.path.j... |
import codecs
import cPickle
import math
import re
import networkx as nx
from itertools import ifilter
from operator import itemgetter
from pattern.en import parsetree, wordnet
from pattern.search import taxonomy, search
from tmi import WordNetClassifier
taxonomy.classifiers.append(WordNetClassifier(wordnet))
# /... |
"""Tests for functions that uses Distribution functions."""
import numpy as np
import pytest
from astropy import units as u
import scipy.integrate as spint
from ...constants import (m_p, m_e, c, mu0, k_B, e, eps0, pi)
from ..distribution import (Maxwellian_1D,
Maxwellian_speed_1D,
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 by Alex Brandt <alunduil@alunduil.com>
#
# pmort is freely distributable under the terms of an MIT-style license.
# See COPYING or http://www.opensource.org/licenses/mit-license.php.
import logging
import argparse
import copy
import os
import sys
import re
try:
from ... |
import os
import sys
for root, dirs, files in os.walk(os.path.dirname(os.path.abspath(__file__))):
for name in files:
path = os.path.join(root, name)
if name.endswith((".java")):
file = open(path , "r")
lines = file.readlines()
file.close()
file = open... |
# Computes a pairing, i.e. a way to match a group of N people in N pairs,
# where each person belongs to two pairs: one as a teacher and one as a learner
#
# Example:
# Alice teaches Ruby to Bob
# Bob teaches Python to Carol
# Carol teaches Javascript to Alice
#
# To solve this problem we bui... |
from __future__ import print_function
import time
class Timer():
def __init__(self, name, parent=None, start=True):
self._start = -1
self._end = -1
self._t = 0
self._name = name
self._children = []
self._parent = parent
if self._parent:
self._par... |
#! /usr/bin/env python
# Copyright Arvid Norberg 2008. Use, modification and distribution is
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os, sys, time, os
stat = open(sys.argv[1])
line = stat.readline()
while no... |
#! /usr/bin/env python
# Copyright Arvid Norberg 2008. Use, modification and distribution is
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os, sys, time
stat = open(sys.argv[1])
line = stat.readline()
while not 's... |
"""The stressmodels module contains all the stressmodels that available in
Pastas.
Supported Stressmodels
----------------------
The following stressmodels are supported and tested:
- StressModel
- StressModel2
- FactorModel
- StepModel
All other stressmodels are for research purposes only and are not (yet)
fully su... |
import struct
import math
import sys
BITRATE = 16000
TABLE_SIZE = 1024
LENGTH_SECONDS = 10
VBI_COUNT = BITRATE / 50
SONG_STEP_COUNT = 4
US_PER_TICK = 1000000.0 / BITRATE
# 16 bits
# The number of steps per tick
VOICE1_STEPS = 0
VOICE2_STEPS = 0
VOICE3_STEPS = 0
# 12 bits
VOICE1_DUTY = 0
# 8 bits
VOICE1_CONTROL = 0... |
from django.utils.deprecation import MiddlewareMixin
from django.conf import settings
from subdomains.middleware import SubdomainURLRoutingMiddleware
class PatchedSubdomainURLRoutingMiddleware(MiddlewareMixin,
SubdomainURLRoutingMiddleware):
pass
if settings.DEBUG:
... |
import json
import storj
from PyQt4 import QtCore, QtGui
from mainUI import MainUI
from qt_interfaces.storj_login_ui import Ui_Login
from utilities.account_manager import AccountManager
from utilities.log_manager import logger
# Login section
class LoginUI(QtGui.QMainWindow):
def __init__(self, parent=None):
... |
from __future__ import absolute_import
import os
import re
import string
from .pinboard import Pinboard
SAFE_CHARACTERS = (string.ascii_letters + string.digits + "-_.() ")
def export(auth_token, path=None):
pb = Pinboard(auth_token)
bookmarks = pb.bookmarks()
for bookmark in bookmarks:
filena... |
# coding: utf-8
"""A small module for handling some common operations on tutorials."""
from collections import OrderedDict
from itertools import repeat
import io
import subprocess
from pdp.tutorial.models import Tutorial, Part, Chapter, Extract
from pdp.utils.schemas import validate_tutorial
def move(obj, new_pos... |
#!/bin/bash
"""The Emu object esentially wraps the GPy gaussian process code. It handles building, training, and predicting."""
import warnings
from itertools import izip
from collections import OrderedDict
from os import path
import sys
from time import time
import cPickle as pickle
from abc import ABCMeta, abstractm... |
version_base = (4, 1, 0)
version_suffix = None
if version_suffix is None:
__version_info__ = version_base
else:
__version_info__ = version_base + (version_suffix,)
__version__ = '{}.{}'.format(*version_base)
if version_base[2] != 0:
__version__ += '.{}'.format(version_base[2])
if version_suffix is not No... |
import os
import unittest
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.test.utils.tools import TestClient
from nose.plugins.attrib import attr
import platform
from conans.util.files import load
conanfile_py = """
from conans import ConanFile
class HelloConan(ConanFile):
name = ... |
import calendar
import os
import subprocess
import tempfile
import shutil
import stat
import datetime
import time
from collections import defaultdict
from pyquery import PyQuery as pq
from django import http
from django.core.cache import cache
from django.utils.timezone import utc
from django.shortcuts import render, g... |
# TAKES a set of image paths
# OPTIONALLY TAKES alternate IQDB url, acceptable sites ORDERED
# RETURNS a set of 3 tupples of the form:
# {source_url, source_hash, [tags]}
# Make a request to IQDB with the image
# Find the highest res copy of the image, orders ties based on site
# Download image, as well as tags, other... |
"""
This module provides filters.
Inputs are fed to filters via keywords in the ``run`` method.
Outputs are available via the ``out`` attribute.
.. moduleauthor:: Michael Markert <markert.michael@googlemail.com>
:copyright: PenchY Developers 2011-2012, see AUTHORS
:license: MIT License, see LICENSE
"""
import ite... |
"""
This module provides filters.
Inputs are fed to filters via keywords in the ``run`` method.
Outputs are available via the ``out`` attribute.
.. moduleauthor:: Michael Markert <markert.michael@googlemail.com>
:copyright: PenchY Developers 2011-2012, see AUTHORS
:license: MIT License, see LICENSE
"""
import ite... |
"""
This module provides filters.
Inputs are fed to filters via keywords in the ``run`` method.
Outputs are available via the ``out`` attribute.
.. moduleauthor:: Michael Markert <markert.michael@googlemail.com>
:copyright: PenchY Developers 2011-2012, see AUTHORS
:license: MIT License, see LICENSE
"""
import ite... |
from .parsing.exceptions import ParserError
class PendulumException(Exception):
pass
|
# -*- coding: utf-8 -*-
import json
import os
from flask import Response
import requests
from pep8speaks import helpers
def handle_pull_request(request):
# A variable which is set to False whenever a criteria is not met
# Ultimately if this is True, only then the comment is made
PERMITTED_TO_COMMENT = Tr... |
#!/usr/bin/env python
#=========================================================================
# mesh_net.py [options] nrouters injection_rate ncycles
#=========================================================================
#
# -h --help Display this message
# -v --verbose Verbose mode
#
# --ker... |
"""
Provides functionality to see if a petition contains profanities.
Author: Peter Zujko
"""
import csv
import os
import re
def load_words(filename):
"""
Loads words from csv to list
"""
words = []
dirname = os.path.dirname(__file__)
csvfile = open(os.path.join(dirname,filename), 'r')
fo... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import glob
import time
import logging
import argparse
# petrarch.py
##
# Automated event data coder
##
# SYSTEM REQUIREMENTS
# This program has been successfully run under Mac OS 10.10; it is s... |
"""Spawn interface using subprocess.Popen
"""
import os
import threading
import subprocess
import sys
import time
import signal
import shlex
try:
from queue import Queue, Empty # Python 3
except ImportError:
from Queue import Queue, Empty # Python 2
from .spawnbase import SpawnBase, PY3
from .exceptions imp... |
#==============================================================================
# Major TODO
#==============================================================================
# TODO Add support for gdspy.CellArray
# TODO Auto-generate PHIDL geometry documentation
# TODO Allow caching of bbox
#==========================... |
from bigsuds import ServerError
import f5
import f5.util
import re
def enabled_bool(enabled_statuses):
"""Switch from enabled_status to bool"""
bools = []
for es in enabled_statuses:
if es == 'ENABLED_STATUS_ENABLED':
bools.append(True)
elif es == 'ENABLED_STATUS_DISABLED_BY_PARE... |
#!/usr/bin/python2.4
#
# Copyright (c) 2005-2007 rPath, Inc.
#
import testsuite
testsuite.setup()
from mint_rephelp import MintRepositoryHelper
from mint_rephelp import MINT_DOMAIN, MINT_PROJECT_DOMAIN, PFQDN
from mint import database
from mint import server
from mint import users
from mint.projects import LabelMiss... |
import praw
import urllib
INVALID_CODES = [404, 410]
user = raw_input('Username: ')
passwd = raw_input('Password: ')
print 'Running script...'
reddit = praw.Reddit(user_agent='prunejuice')
print 'Logging in...'
reddit.login(user, passwd)
print 'Fetching saved submissions...'
saved = reddit.user.get_saved(limit=Non... |
#!/usr/bin/python
import hashlib
import io
import os
import tempfile
def files_differ(A, B):
'''
Return True if the content of the two files differ, False otherwise.
'''
if os.stat(A).st_size != os.stat(B).st_size: return True
differ_status = False
A_fi = B_fi = None
sz = io.DEFAULT_BUFFE... |
# This file is part of cclib (http://cclib.sf.net), a library for parsing
# and interpreting the results of computational chemistry packages.
#
# Copyright (C) 2006-2014, the cclib development team
#
# The library is free software, distributed under the terms of
# the GNU Lesser General Public version 2.1 or late... |
# -*- coding: utf-8 -*-
""" ==========================================================
File: WakaTime.py
Description: Automatic time tracking for Sublime Text 2 and 3.
Maintainer: WakaTime <support@wakatime.com>
License: BSD, see LICENSE for more details.
Website: https://wakatime.com/
=================... |
# This file is part of cclib (http://cclib.sf.net), a library for parsing
# and interpreting the results of computational chemistry packages.
#
# Copyright (C) 2006-2014, the cclib development team
#
# The library is free software, distributed under the terms of
# the GNU Lesser General Public version 2.1 or late... |
import json
import requests
from pywink.devices import types as device_types
from pywink.devices.factory import build_device
from pywink.devices.sensors import WinkSensorPod, WinkHumiditySensor, WinkBrightnessSensor, WinkSoundPresenceSensor, \
WinkTemperatureSensor, WinkVibrationPresenceSensor
from pywink.devices... |
"""
Configure and define tasks for use with Celery
"""
import codecs
import os
import shutil
import subprocess
import tempfile
import json
from celery import Celery
from . import app
from . import remote
from .models import file as file_mod
from .models.article import get_available_articles_from_api
RETRIES = 5
de... |
""" ==========================================================
File: WakaTime.py
Description: Automatic time tracking for Sublime Text 2 and 3.
Maintainer: WakaTi.me <support@wakatime.com>
Website: https://www.wakati.me/
==========================================================="""
__version__ = '0.3.3'
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# SMC.py: Sequential Monte Carlo module
##
# © 2012 Chris Ferrie (csferrie@gmail.com) and
# Christopher E. Granade (cgranade@gmail.com)
#
# This file is a part of the Qinfer project.
# Licensed under the AGPL version 3.
##
# This program is free software: you can redi... |
"""
Main views of PSKB app
"""
from functools import wraps
from flask import redirect, url_for, session, request, render_template, flash, json, g
from . import app
from . import remote
from . import models
from . import forms
def login_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
... |
import yaml
from pi_gpio import app
from .gpio import BaseGPIO
PINS_YML = './config/pins.yml'
class PinManager(BaseGPIO):
def __init__(self):
super(PinManager, self).__init__()
self.load_yaml()
def load_yaml(self):
with open(PINS_YML) as file_data:
self.pins = yaml.safe... |
#!/usr/bin/python2.4
#
# Copyright (c) 2005-2007 rPath, Inc.
#
import tempfile
import time
import os, sys
import testsuite
testsuite.setup()
from mint_rephelp import MintRepositoryHelper
from mint import userlevels, server
from mint import buildtypes
from mint import mirror
from conary import dbstore
from conary impo... |
# Copyright 2010 Jonathan Kinred <jonathan.kinred@gmail.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
# he Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This p... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
"""
Overview
--------
The functions
- `fromstring()` and `fromfile()` return namedtuples from GeoJSON input
- `tostring()` returns GeoJSON from a namedtuple
- `result_fromstring()` and `result_fromfile()` return namedtuples wrapped as a
GeoJSONResult so that values of a specific types can be safely extracted
Addit... |
import csv
from pipeline.exceptions import IsHeaderException
import xlrd
class Extractor(object):
def __init__(self, connection):
self.connection = connection
self.checksum = None
def process_connection(self):
'''Do any additional processing on a connection to prepare it for reading
... |
import pandas as pd
import os.path
TRANSCRIPT_GTF_FILE = "TRANSCRIPT_GTF_FILE"
GENOME_FASTA_DIR = "GENOME_FASTA_DIR"
SIMULATED_READS = "SIMULATED_READS"
LEFT_SIMULATED_READS = "LEFT_SIMULATED_READS"
RIGHT_SIMULATED_READS = "RIGHT_SIMULATED_READS"
FASTQ_READS = "FASTQ_READS"
QUANTIFIER_DIRECTORY = "QUANTIFIER_DIRECTORY... |
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov
#
# 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,... |
from inspect import isclass
from typing import Any, Dict, List, Tuple
# TODO improve handling of non-string keys
def _assert_isinstance(value, _type):
"""Check if a value conforms to a type (recursively for collections and records)."""
if not isinstance(type(_type), type):
raise ValueError("_type m... |
#Pyjsdl - Python-to-JavaScript Multimedia Framework
#Copyright (c) 2013 James Garnon
#
#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 right... |
#!/usr/bin/python
#This will serve to start the IS command line software, taking care of basic imports etc.
import xmlrpclib
appname=""
apikey=""
allContactFields=["AccountId", "Address1Type", "Address2Street1", "Address2Street2", "Address2Type", "Address3Street1", "Address3Street2", "Address3Type", "Anniversary", ... |
# Import stuff
import numpy as np
#import iso_lib as il
import sklearn as sk
import sklearn.cluster as sk_c
import matplotlib as mpl
import matplotlib.pyplot as plt
import emcee
def emcee_prob(params, star):
A=np.exp(params[4])
dist=pow(10., params[3]/5.+1.)
try:
iso_obj=star.isoch... |
"""
Object oriented wrapper around RPi.GPIO. A work in progress.
(zourtney, August 2013)
"""
import RPi.GPIO as GPIO
class Header(object):
"""Controls initializing and cleaning up GPIO header."""
def __init__(self):
GPIO.setmode(GPIO.BOARD)
def __del__(self):
GPIO.cleanup()
def __enter__(self):
... |
import numpy
_ = numpy.newaxis
__all__ = [
'_',
'numpy',
'element',
'function',
'mesh',
'plot',
'topology',
'util',
'green',
]
|
# Copyright (c) 2016, Ayke van Laethem
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of cond... |
#This file initializes the package for installation and use
|
# Copyright (C) 2017 PyWaves Developers
#
# This file is part of PyWaves.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# propagated, or distributed except according to t... |
# copyright Chad Dombrova chadd@luma-pictures.com
# created at luma pictures www.luma-pictures.com
"""
*******************************
Pymel
*******************************
Pymel makes python scripting in Maya work the way it should. Maya's command module is a direct
translation of MEL commands into ... |
import os
import sys
import marshal
if not hasattr(sys, 'implementation'):
raise ImportError('python >= 3.3 required')
if sys.implementation.cache_tag is None:
raise ImportError('python implementation does not use bytecode')
PY_TAG = sys.implementation.cache_tag
PY_VERSION = sys.hexversion
BUNDLE_DIR ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.