src stringlengths 721 1.04M |
|---|
from random import randint
from tests.sharepoint_case import SPTestCase
from office365.sharepoint.list_creation_information import ListCreationInformation
from office365.sharepoint.list_template_type import ListTemplateType
class TestSPList(SPTestCase):
target_list_id = None
target_list_title = "Tasks" + st... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Standard Library
from os import path
# Third Party Stuff
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
def send_email(to, context, template_dir):
"""Re... |
from django.utils import timezone
from django.conf import settings
from . import config
from datetime import datetime, timedelta
def now():
return timezone.localtime()
def get_times(site):
time_now = now()
start_time_begin = config.get("start_time_begin", site=site)
if start_time_begin is not None:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
PARTICIPLE = 1024
IMPERATIVE = 512
INDICATIVE = 256
PASSIVE = 16
ING = 8
FUTURE = 4
PAST = 2
PERFECT = 1
INDICATIVE_ACTIVE_PRESENT = INDICATIVE #| PRESENT
INDICATIVE_ACTIVE_IMPERFECT = INDICATIVE ... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
#!usr/bin/python
# -*- coding: utf-8-*-
# 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 3, or (at your option) any later
# version.
#
# This program is distributed in the hope tha... |
import sys
import os
import unittest
import platform
import subprocess
from test import support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
def test_architecture_via_symlink(self): # issue3762
def get... |
from collections import OrderedDict
from .. import utils
__all__ = [
"Layer",
"MergeLayer",
]
# Layer base class
class Layer(object):
"""
The :class:`Layer` class represents a single layer of a neural network. It
should be subclassed when implementing new types of layers.
Because each lay... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import nltk
%matplotlib inline
# <codecell>
import os
from nltk.corpus.reader.plaintext import PlaintextCorpusReader
corpusdir = 'data/texts/' # Directory of corpus.
corpus0 = PlaintextCorpusReader(corpusdir, '.*')
corpus = nltk.Text(corpus0.words(... |
# Converted from AWS WAF Sample located at:
# https://s3.amazonaws.com/cloudformation-examples/community/common-attacks.json
from troposphere import (
Template,
Parameter,
Join,
Ref
)
from troposphere.waf import (
Rule,
SqlInjectionMatchSet,
WebACL,
SizeConstraintSet,
IPSet,
Xss... |
class Solution(object):
def maxArea(self, height):
if len(height) == 2:
return min(height)
lenght = len(height)
f_index = 0
b_index = lenght - 1
max_v = 0
h_list = height
while (f_index < b_index):
value = self.cal_value(f_index, b... |
# -*- coding: utf-8 -*-
import pytest
import time
import datetime
from codecs import open
from sqlalchemy import event, Table
from sqlalchemy.ext.declarative.api import DeclarativeMeta
from sqlalchemy.exc import IntegrityError, OperationalError, ProgrammingError
from sqlalchemy.orm.util import object_state
from colle... |
"""Defines the class that manages reconciling tasks"""
from __future__ import unicode_literals
import datetime
import logging
import threading
from django.utils.timezone import now
COUNT_WARNING_THRESHOLD = 1000 # If the total list count hits this threshold, log a warning
FULL_RECON_THRESHOLD = datetime.timedelta(m... |
#!/usr/bin/env python
#
#This is a set of wrappers designed to use methods of obtaining linear
#quantities of interest from outputs of actual programs taht do the
#calculations, like CAMB with the help of utilities for specific programs.
#
#USEFUL ROUTINES:
#
#powerspectrum: obtains the linear power spectrum of vario... |
#
# THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
# THE 'COPYING' FILE FOR DETAILS
#
# Globals.py
#
# This module contains variable definitions that can be used across the code
# base and also includes methods for reading and writing these settings to
# the Jokosher configuration in JOKOSHE... |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... |
import pickle
from django.db import models
from django.template import Context, loader
from base64 import b64encode, b64decode
from datetime import datetime
from restclients.exceptions import InvalidCanvasIndependentStudyCourse
from restclients.exceptions import InvalidCanvasSection
from restclients.util.date_formator ... |
import os
import time
import stat
import signal
import logging
import threading
from autotest.client.shared import error
from autotest.client.shared import utils
from virttest import libvirt_storage
from virttest import utils_selinux
from virttest import qemu_storage
from virttest import libvirt_vm
from virttest import... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015 Metaswitch Networks
# 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/licens... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
def identity_function(x):
return x
def step_function(x):
return np.array(x > 0, dtype=np.int)
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_grad(x):
return (1.0 - sigmoid(x)) * sigmoid(x)
def relu(x):
return np.maximum(0, ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpResponseForbidden
from djangorestframework_camel_case.render import CamelCaseJSONRenderer
from rest_f... |
import unittest
from compliance_checker.suite import CheckSuite
from compliance_checker.runner import ComplianceChecker
import os
import httpretty
# TODO: Use inheritance to eliminate redundant code in test setup, etc
class TestIOOSSOSGetCapabilities(unittest.TestCase):
def setUp(self):
with open(os.path... |
# -*- coding: utf-8 -*-
##############################################################################
# references
##############################################################################
# www.udemy.com/machinelearning/ - I really enjoyed this course. Take it!
# original data/code at www.superdatascience.com/... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
#!/bin/python2
from __future__ import division
import subprocess
from time import sleep
import os
# for generating sound files
import numpy as np
import matplotlib.pyplot as plt
import scipy.io.wavfile
import scipy.signal as sig
import scipy.stats as stats
master_volume = 1
sounds = {
'A':{'filename':'tick1.wa... |
#!/usr/bin/python
'''
Simple script to interact with fusion level 02 challenge network daemon,
#!/usr/bin/python
mkocbayi@gmail.com
'''
from pwn import *
import sys
#Use this hexdump lib because pwntools hexdump is too slow
from hexdump import *
def doMode(mode): # Either E or Q
print 'Sending mode call: {}'.forma... |
from brown.core.multi_staff_object import MultiStaffObject
from brown.core.music_font import MusicFontGlyphNotFoundError
from brown.core.music_text import MusicText
from brown.core.staff_object import StaffObject
from brown.utils.point import Point
from brown.utils.units import GraphicUnit
class Brace(MultiStaffObjec... |
# -*- coding: iso-8859-1 -*-
#
# Author: $AUTHOR <$EMAIL>
# Date: $DATE
#
# This program 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, or
# (at your option) any later version.
#
# T... |
import json
from os import environ
from datetime import datetime
# Set the import timestamp
timestamp_string = datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
# Set the path variable
path = environ["TMP_DIR"] + "/" + environ["TRACKER"]
# Generate Lookup Table for planning folders and import timestamp to planning folder... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Auxiliary script for paper, DGTS conference.
Draw speedup graph
"""
import json
import time
import matplotlib
import matplotlib.pyplot as plt
from common import RESULTS_PATH
SPEEDUP_FILE = RESULTS_PATH + '/dgts/speedup.json'
OUTPUT_FILE = RESULTS_PATH + '/d... |
# Copyright (c) 2012 Johan Rydberg
# Copyright (c) 2009 Donovan Preston
#
# 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... |
"""
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classif... |
"""
Module for building a complete dataset from local directory with csv files.
"""
import os
import sys
from logbook import Logger, StreamHandler
from numpy import empty
from pandas import DataFrame, read_csv, Index, Timedelta, NaT
from trading_calendars import register_calendar_alias
from zipline.utils.cli import m... |
import os
import pocketsphinx as ps
modeldir = "C:/Python36-64/Lib/site-packages/pocketsphinx/model/"
# datadir = "C:/Python36-64/Lib/site-packages/pocketsphinx/data/"
# Create a decoder with certain model
config = ps.Decoder.default_config()
config.set_string('-hmm', os.path.join(modeldir, 'en-us'))
config.set_strin... |
#!/usr/bin/python2.7
# Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
#!/usr/bin/env python
# encoding: utf-8
"""Contains the SnippetManager facade used by all Vim Functions."""
from collections import defaultdict
from functools import wraps
import os
import platform
import traceback
import sys
import vim
import re
from contextlib import contextmanager
from UltiSnips import _vim
from ... |
import os
import inspect
import a2uic
import a2ahk
import a2ctrl
import a2core
import a2util
import a2ctrl.connect
from a2widget.a2hotkey import hotkey_common
from a2qt import QtGui, QtCore, QtWidgets
log = a2core.get_logger('keyboard_base')
BASE_MODIFIERS = ['alt', 'ctrl', 'shift', 'win']
SIDES = 'lr'
DB_KEY_MOUS... |
from __main__ import vtk, qt, ctk, slicer
import numpy as np
from collections import OrderedDict
class ParenchymalVolume:
def __init__(self, parenchymaLabelmapArray, sphereWithoutTumorLabelmapArray, spacing, keysToAnalyze=None):
""" Parenchymal volume study.
Compare each ones of the different label... |
#-*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from users.forms import ConnexionForm
from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.core.urlresolvers import reverse
from auth_remember import remem... |
import os
import Document as Doc
class FileHandler():
def makeLog(self, myFile, msg):
logDir = "logs/"
os.chdir(logDir)
fo = open(myFile, 'a')
fo.write(msg + "\n")
fo.close()
def loadDirs(self, myDir, labelled = False):
docs = []
basepat... |
# ===========
# pysap - Python library for crafting SAP's network protocols packets
#
# SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved.
#
# The library was designed and developed by Martin Gallo from
# the SecureAuth's Innovation Labs team.
#
# This program is free software; you can red... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Document'
db.delete_table(u'Overlay_document')
... |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
# Copyright (c) <2016> <GUANGHAN NING>. 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... |
# -*- coding: utf-8 -*-
"""Verify sphinxcontrib.chapeldomain.ChapelDomain."""
from __future__ import print_function, unicode_literals
import docutils.nodes as nodes
import mock
import sys
import unittest
# For python 2.6 and lower, use unittest2.
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
import u... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 GNS3 Technologies 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.
... |
"""
===================================================
Lasso model selection: Cross-Validation / AIC / BIC
===================================================
Use the Akaike information criterion (AIC), the Bayes Information
criterion (BIC) and cross-validation to select an optimal value
of the regularization paramet... |
#!/usr/bin/python
from optparse import OptionParser
import os
import sys
import time
import termios
import fcntl
import motor
parser = OptionParser()
parser.add_option("-a", "--action", dest="action", help="reset/manual")
(options, args) = parser.parse_args()
m = motor.Motor(0)
if options.action == "reset":
m.res... |
# pytest -s stereo.py -k [name]
from unrealcv import client
import math, random
from conftest import checker, ver
import pytest
class Vec3:
def __init__(self, data):
if isinstance(data, str):
self.vec = [float(v) for v in data.split(' ')]
if isinstance(data, list):
self.vec ... |
#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# ... |
from chess.core.query import destinations
from chess.core.models import Piece, Coordinate
from chess.core.utils import empty_board, set_at
from chess.core.game import Game
def test_white_pawn_can_double_step():
game = Game()
game.board = empty_board()
for c in range(8):
pawn_coordinate = Coordinat... |
import json
import os
import re
from typing import Callable, Iterator, List, Optional, Union
import scrapy
from scrapy.http import Request, Response
from scrapy.linkextractors import IGNORED_EXTENSIONS
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
from scrapy.spidermiddlewares.httperror import HttpError... |
# -*- coding: utf-8 -*-
""" Jinja extension which provides "require" statement
The `require` statement will `include` a template only if it has not been
previously required (aka, "include once"). Unlike the jinja `import`
statement, `require` allows the included template to contain content, not
just macros. We use thi... |
import argparse
from redis import StrictRedis
from pyrau.commands import Command
def delete(args, command):
""" Execute the delete command """
command.delete(args.pattern)
def keys(args, command):
""" Execute the keys command """
details = args.details | args.sorted
command.keys(args.pattern, de... |
from operator import attrgetter
from django.core.urlresolvers import reverse
from django.db.models import Min
import commonware.log
from elasticsearch_dsl import F
from elasticsearch_dsl.filter import Bool
import mkt
from mkt.constants import APP_FEATURES
from mkt.constants.applications import DEVICE_GAIA
from mkt.p... |
#! /usr/bin/python
import sys
import os
import json
import grpc
import time
import subprocess
from google.oauth2 import service_account
import google.oauth2.credentials
import google.auth.transport.requests
import google.auth.transport.grpc
from google.firestore.v1beta1 import firestore_pb2
from google.firestore.v1be... |
from 語料庫.models import 語料狀況表
from 語料庫.models import 語料表
from 語料庫.管理.校對 import 校對表管理
from django.utils.timezone import now
from 語料庫.widgets.目標音檔欄 import 目標音檔欄
class 檢查表(語料表):
class Meta:
proxy = True
verbose_name = "檢查表"
verbose_name_plural = verbose_name
def save(self, *args, **kwarg... |
"""Update INSPIRE publication information."""
import datetime
import math
from hepdata.modules.records.utils.doi_minter import generate_dois_for_submission
from hepdata.modules.submission.api import get_latest_hepsubmission
from hepdata.modules.submission.models import DataSubmission
from hepdata.modules.records.util... |
"""Calls, conferences.
"""
__docformat__ = 'restructuredtext en'
from .utils import *
from .enums import *
class DeviceMixin(object):
def _Device(self, Name, DeviceType=None, Set=type(None)):
args = args2dict(self._Property(Name, Cache=False))
if Set is type(None):
for dev, value in ... |
import unittest
from astropy import constants as astroconst
from astropy import units as u
from astropy.time import Time
from CelestialMechanics.kepler import constants
from CelestialMechanics.orbits import ellipse
from CelestialMechanics.orbits.ellipse import delta_t_t0_aeangle
class MyTestCase(unittest.TestCase):... |
#!/usr/bin/env python
import os
import argparse
import numpy as np
_save = True
_here = os.path.abspath(os.path.dirname(__file__))
_Exp, _Cls, _name = os.path.split(__file__)[1].split('_')[:3]
assert not any([any([ss in s for ss in ['Notes','.']])
for s in [_Exp, _Cls, _name]])
def get_notes():
... |
import argparse
import os
import sys
from six.moves import shlex_quote
parser = argparse.ArgumentParser(description="Run commands")
parser.add_argument('-w', '--num-workers', default=1, type=int,
help="Number of workers")
parser.add_argument('-r', '--remotes', default=None,
help... |
import os, re
import shutil
import csv
import datetime
# Main
thepath = os.getcwd()
ipynb_path = os.path.join(thepath, 'ipynb')
yaml_csv_path = os.path.join(ipynb_path, r'_post_head.csv')
today = datetime.datetime.today()
today = '{}-{:0>2d}-{:0>2d}'.format(today.year, today.month, today.day)
# Read head string from... |
'''
Created on Nov 21, 2013
@author: david
'''
from thing import Thing, Player
import grammar
import parser
import action
import glk
class Story:
def __init__(self, name, headline, delegate):
self.name = name
self.headline = headline
self.release = 1
self.serial = 81001
s... |
import re
from Bio import pairwise2
from Bio.Seq import Seq
from collections import defaultdict
from mirtop.mirna.mintplates import convert
import mirtop.libs.logger as mylog
logger = mylog.getLogger(__name__)
class hits:
""""Class with alignment information."""
def __init__(self):
self.sequence = ... |
from typing import Optional, Type
from ray.rllib.agents.trainer import with_common_config
from ray.rllib.agents.trainer_template import build_trainer
from ray.rllib.agents.marwil.marwil_tf_policy import MARWILTFPolicy
from ray.rllib.execution.replay_ops import Replay, StoreToReplayBuffer
from ray.rllib.execution.repla... |
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-fcm',
versio... |
import logging
import os
import shutil
import subprocess
import tempfile
from intexration.tools import create_dir, cd
from intexration.build import Identifier, Build
from intexration.document import Document
from intexration.parser import BuildParser
class Task():
def run(self):
pass
class CloneTask(Ta... |
# -*- coding: utf-8 -*-
#
# This file is part of pybliographer
#
# Copyright (C) 1998-2004 Frederic GOBRY
# Email : gobry@pybliographer.org
#
# 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... |
from idautils import *
from idaapi import *
def get_string(addr):
out = ""
while True:
if Byte(addr) != 0:
out += chr(Byte(addr))
else:
break
addr += 1
return out
def get_string_from_head(head):
refs = DataRefsFrom(head)
for ref in refs:
refs2 = DataRefsFrom(ref)
for ref2 in refs2:
stringval... |
"""
Server Density Nagios plugin
"""
import sys
import re
import logging
import json
import time
import subprocess
METRICS = [
'Total Services',
'Services Checked',
'Services Scheduled',
'Services Actively Checked',
'Services Passively Checked',
'Services Flapping',
'Services In Downtime',... |
# coding=utf-8
# Foris - web administration interface
# Copyright (C) 2018 CZ.NIC, z.s.p.o. <http://www.nic.cz>
#
# 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 3 of the License... |
"""Forward facing lyman tools with information about ecosystem."""
import os
import os.path as op
import tempfile
import re
import sys
import imp
import shutil
from textwrap import dedent
import yaml
import numpy as np
import nipype
from traits.api import (HasTraits, Str, Bool, Float, Int,
Tup... |
""" Utility functions for helping compute GLMNET models
"""
import numpy as np
def mse_path(X, y, coefs, intercepts):
""" Return mean squared error for sets of estimated coefficients
Args:
X (np.ndarray): 2D (n_obs x n_features) design matrix
y (np.ndarray): 1D dependent variable
coef... |
#
# Copyright (C) 2011 - 2013 Satoru SATOH <ssato at redhat.com>
#
import os
import unittest
import jinja2_cli.render as TT # Stands for Test Target module.
import jinja2_cli.compat
import jinja2_cli.tests.common as C
class Test_00_pure_functions(unittest.TestCase):
def test_00_mk_template_paths__wo_paths(self... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
import pprint
from cromulent.model import * # imports models
from cromulent.vocab import * # imports model subcomponents
from utils.aat_labels import aat_labels
from utils.aat_label_fetcher import get_or_fetch
from utils.data_parsing import find_values
from utils.crom_helpers import props, toJSON, toString, printStr... |
import mock
from nose.tools import assert_equals, raises
from scrapebrewtoad import Brewtoad
user = "me"
password = "password"
session = mock.Mock()
session.post.return_value.url = "http://dummyurl.com/blah/12345/"
@mock.patch("pyquery.PyQuery")
def test_init_stores_params_and_calls_login(PyQuery):
toad = Brewt... |
#Environment related constants
ENV_PRODUCTION = 'PRODUCTION'
#Staging is used for testing by replicating the same production remote env
ENV_STAGING = 'STAGING'
#Development local env
ENV_DEVELOPMENT = 'DEV'
#Automated tests local env
ENV_TESTING = 'TEST'
ENVIRONMENT_CHOICES = [
ENV_PRODUCTION,
ENV_STAGING,
... |
"""
Gas fluid particles
===================
Use the ``TAMOC`` ``DBM`` to specify a natural gas bubble that can dissolve
and calculate all of its properties in deepwater conditions.
In particular, this script demonstrates the methods:
* `dbm.FluidParticle.mass_frac`
* `dbm.FluidParticle.density`
* `dbm.FluidParticle... |
import pymel.core as pymel
import collections
from omtk import constants
from omtk.core.classModule import Module
from omtk.core.classCtrl import BaseCtrl
from omtk.core.utils import decorator_uiexpose
from omtk.modules import rigIK
from omtk.modules import rigFK
from omtk.modules import rigTwistbone
from omtk.libs imp... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""
transform percent identify matrix from clustal into other forms
"""
import os
import sys
def read_pim(pim_f):
lines = pim_f.readlines()
lines = [line.rstrip('\r\n') for line in lines]
lines = [line for line in lines if len(line) > 0]
scores = []
ids = []
ids = [line.split()[1] for line ... |
from parsl.providers import AWSProvider
from parsl.config import Config
from parsl.executors import HighThroughputExecutor
# If you are a developer running tests, make sure to update parsl/tests/configs/user_opts.py
# If you are a user copying-and-pasting this as an example, make sure to either
# 1) create a lo... |
#!/usr/bin/env python3
# eval.py: instrinsic evaluation for forced alignment using Praat TextGrids
# Kyle Gorman <gormanky@ohsu.edu>
from __future__ import division
from aligner import TextGrid
from sys import argv, stderr
from collections import namedtuple
from argparse import ArgumentParser
CLOSE_ENOUGH = 20
TIE... |
"""
Copyright (c) 2012-2013, Austin Noto-Moniz (metalnut4@netscape.net)
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND... |
import xbmc
import xbmcvfs
import Folder
import urllib
import urlparse
NAME_QUERY = 'fileName'
FOLDER_NAME_QUERY = 'folderName'
FOLDER_PATH_QUERY = 'folderPath'
class File(object):
def __init__(self, name, folder):
self.name = name
self.folder = folder
self.path = folder.fullpath
... |
from .gd.base import *
from .gd.lev_marq import *
from .gd.quasi_newton import *
from .gd.conjgrad import *
from .gd.hessian import *
from .gd.hessdiag import *
from .gd.rprop import *
from .gd.quickprop import *
from .gd.momentum import *
from .gd.adadelta import *
from .gd.adagrad import *
from .gd.rmsprop import *
f... |
#Models.py, for defining all data models
from google.appengine.ext import ndb
import logging
#CTUser
#profile
# - user : Google User object
# - photo -- coming later
# - displayname : unique
# - ID = key
class CTUser(ndb.Model):
'''Models an individual Guestbook entry with content and date.'''
google_user = ndb... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... |
def log(f):
"Logs each call to f(*a, **kw)."
if hasattr(f, "func_name"):
name = f.func_name
elif hasattr(obj, "im_class"):
name = "%s.%s" % getattrs(obj, "im_class", "__name__")
else:
name = str(obj)
@wraps(f)
def wrapper(*a, **kw):
argstr = ", ".join([str(x) fo... |
from utils.log import logger
import os
import time
from utils.path import results_path
from utils.ssh import SSHClient
from utils.smem_memory_monitor import test_ts
import glob
import pytest
def find_nth_pos(string, substring, n):
"""helper-method used in getting version info"""
start = string.find(substring)... |
# Copyright 2018 SAS Project Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Gramps
#
# 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 late... |
""" Solution to the second puzzle of Day 7 on adventofcode.com
"""
import os
PARTS = {}
CACHE = {}
def compute(value):
""" Recursion is dumb.
"""
if value in CACHE:
return CACHE[value]
if value.isdigit():
return int(value)
value = PARTS[value]
if 'NOT' in value:
val... |
import errno
import os
import platform
import shutil
import string
import subprocess
import sys
import tarfile
import zipfile
from contextlib import contextmanager
def get_platform():
_platform = dict()
_platform["system"] = platform.system().lower()
machine = platform.machine().lower()
if machine =... |
# -*- coding: utf-8 -*-
#
# This file is part of Cookiecutter - Invenio Module Template
# Copyright (C) 2016, 2017 CERN
#
# Cookiecutter - Invenio Module Template 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.