content string |
|---|
XXXXXXXXX XXXXX
XXXXXX
XXXXXX
XXXXX XXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXX X XXX XXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX... |
class BaseDriver:
dbapi = None
schema_class = None
def __init__(self, config):
self.config = config
self._conn = None
@property
def schema(self):
if self.schema_class is None:
return
return self.schema_class(self)
def get_connect_params(self):
... |
"""Module defining the YAMLRepositoryManager class."""
from dc.repository_manager import RepositoryManager
from dc import exceptions
from model import exceptions as mod_exceptions
from model.functions import *
class YAMLRepositoryManager(RepositoryManager):
"""Repository manager for YAML."""
def record_mod... |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
from module.common.json_layer import json_loads
class TurbobitNetFolder(SimpleCrypter):
__name__ = "TurbobitNetFolder"
__type__ = "crypter"
__version__ = "0.05"
__pattern__ = r'ht... |
"""
The EditAttribute module provides the AttributeEditor class. This provides a
mechanism for the user to edit attribute information.
"""
#-------------------------------------------------------------------------
#
# Python modules
#
#-------------------------------------------------------------------------
from gram... |
# tests command line execution of scripts
import importlib
import importlib.machinery
import zipimport
import unittest
import sys
import os
import os.path
import py_compile
import textwrap
from test import support
from test.script_helper import (
make_pkg, make_script, make_zip_pkg, make_zip_script,
assert_py... |
from random import choice
def wippyfy(name='This project'):
"""
Generate a random Work In Progress message similar to one used on the
the Rust Language website (http://www.rust-lang.org)
"""
verbs = ['adopting', 'annoying', 'attacking', 'beating', 'boiling',
'bumping', 'burying', '... |
"""
Modplug metadata inserted into module files.
Doc:
- http://modplug.svn.sourceforge.net/viewvc/modplug/trunk/modplug/soundlib/
Author: Christophe GISQUET <<EMAIL>>
Creation: 10th February 2007
"""
from resources.lib.externals.hachoir.hachoir_core.field import (FieldSet,
UInt32, UInt16, UInt8, Int8, Float32,
... |
from os.path import exists
from xml.dom.minidom import parseString
from urllib import quote, unquote
class Error(Exception):
pass
class Settings( object ):
"""
A class to store/retrieve data to/from an XML file
"""
#Increment this number when the xml settings file
#changes format
XML_VERS... |
from qgis_mobility.generator.builder import Builder
import distutils.dir_util
import os
import glob
import shutil
from qgis_mobility.generator.python_builder import PythonBuilder
from qgis_mobility.generator.qgis_builder import QGisBuilder
from qgis_mobility.generator.pyqt_builder import PyQtBuilder
class RuntimeBuil... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from os import path
import io
here = path.abspath(path.dirname(__file__))
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportErr... |
from setuptools import setup, find_packages
setup(
name = "hadoop",
version = "2.5.0",
url = 'http://github.com/cloudera/hue',
description = "Hadoop Libraries",
# Note that we're cheating by installing gen-py
# in hadoop's __init__.py.
packages = find_packages('src'),
pa... |
from __future__ import print_function
from __future__ import unicode_literals
import utilities
import datetime
import logging
import codecs
def query_all(collection, lt_date, gt_date, sources, write_file=False):
"""
Function to query the MongoDB instance and obtain results for the desired
date range. The ... |
# -*- coding: utf-8 -*-
"""
Created on July 2017
@author: JulienWuthrich
"""
import logging
from mozinor.preprocess.settings import logger
from mozinor.preprocess.reader.read import readFile, GetX_Y
from mozinor.preprocess.transformer.regex import formatCols
from mozinor.preprocess.transformer.fill import FillNaN
fro... |
from restafari import output
import json
import sys
def compareResult(req, expect, conf):
db = conf['db']
if 'data' not in req:
print("There is not expect.data from URL.")
sys.exit(1)
data = req['data']
for key in expect.keys():
# check value, if it has $, we are dealing with... |
from random import randint
def encrypt(text, key):
if key == "":
for char in range(16):
key += chr(randint(0, 127))
print("Your key is " + key)
if len(text) != len(key):
oldKey = key
key = ""
for char in range(len(text)):
key += oldKey[... |
from unittest import TestCase
from unittest.mock import MagicMock, patch
from sys import modules
class TestLiveSync(TestCase):
@patch('nativescript-plugin.toggle_livesync_command.ToggleLiveSyncNsCommand.on_finished', side_effect=lambda succeded: None)
def test_toggle_livesync_command_when_project_is_none_shou... |
from nepi.execution.attribute import Attribute, Flags, Types
from nepi.execution.trace import Trace, TraceAttr
from nepi.execution.resource import ResourceManager, clsinit_copy, \
ResourceState
from nepi.resources.ns3.ns3application import NS3BaseApplication
@clsinit_copy
class NS3UdpTraceClient(NS3BaseApplic... |
"""View decorators to integrate with checkmate's API."""
from checkmatelib import CheckmateException
from h_vialib.exceptions import TokenException
from h_vialib.secure.url import ViaSecureURL
from pyramid.httpexceptions import HTTPTemporaryRedirect, HTTPUnauthorized
def checkmate_block(view):
"""Intended to be u... |
"""Small library that points to the flowers data set.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from inception.dataset import Dataset
class DkData(Dataset):
"""Flowers data set."""
def __init__(self, subset):
super(DkData, self).__init... |
from collections import namedtuple
SpeciesAmount = namedtuple('SpeciesAmount', ('name', 'index', 'molar_amount'))
ReaktoroCase = namedtuple('ReaktoroCase', ('pressure_in_Pa', 'temperature_in_K', 'species_amounts'))
def get_reaktoro_case():
return ReaktoroCase(
pressure_in_Pa=13660337.317389656,
t... |
from interviewcake.merge_lists import *
def test_no_elements():
list1 = []
list2 = []
assert merge_lists(list1, list2) == []
def test_no_elements1():
list1 = []
list2 = [1, 2]
assert merge_lists(list1, list2) == [1, 2]
def test_no_elements2():
list1 = [1, 9]
list2 = []
assert me... |
import sys
all = []
# Refer: http://code.activestate.com/recipes/577058/
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
... |
from re import compile, escape, IGNORECASE
from ..scraper import _BasicScraper
from ..util import tagre
from ..helpers import indirectStarter
class WapsiSquare(_BasicScraper):
url = 'http://wapsisquare.com/'
rurl = escape(url)
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % '09092001'
ima... |
#!/usr/bin/env python
'''
Project: Geothon (https://github.com/MBoustani/Geothon)
File: Data Management Tools /netcdf_info.py
Description: This code gives geotiff information.
Author: Maziyar Boustani (github.com/MBoustani)
'''
from netCDF4 import Dataset
NETCDF_FILE = "../static_files/netcd... |
import oyaml as yaml
import sys
import configargparse
parser = configargparse.ArgumentParser(auto_env_var_prefix="INIT_")
parser.add_argument("--config-path", help="path to the configuration.yml file", default="/opt/opencga/conf/configuration.yml")
parser.add_argument("--client-config-path", help="path to the client-c... |
# this file is deprecated and will soon be folded into all.py
from collections import namedtuple
from pycoin.serialize import h2b
NetworkValues = namedtuple('NetworkValues',
('network_name', 'subnet_name', 'code', 'wif', 'address',
'pay_to_script', 'prv32', 'pu... |
from typing import Dict, List
from .compat import dataclass
@dataclass
class CompressionType:
name: str
file_extension: str
mime_type: str
mime_subtypes: List[str]
is_supported: bool
CompressionTypes = {
"GZIP": CompressionType(
name="GZIP",
file_extension=".gz",
mim... |
"""The AccuWeather component."""
import asyncio
from datetime import timedelta
import logging
from accuweather import AccuWeather, ApiError, InvalidApiKeyError, RequestsExceededError
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import timeout
from homeassistant.const import CONF_API_K... |
import torch
import torch.nn
import torch.nn.functional as nn
import torch.autograd as autograd
import torch.optim as optim
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
from torch.autograd import Variable
from tensorflow.examples.tutorials.mnist import input_data
... |
import ckan
from ckan.controllers.feed import FeedController
from ckan.common import c, _, json
from pylons import config
import logging
log = logging.getLogger(__name__)
class Apicatalog_FeedPlugin(ckan.plugins.SingletonPlugin):
ckan.plugins.implements(ckan.plugins.IRoutes, inherit=True)
# IRoutes
def... |
import unittest
import socket
import ssl
import os
class BaseTestCase(unittest.TestCase):
"""
Class provides basic interface for all tests.
This includes:
* unwrapped sockets
* ssl-wrapped sockets
"""
def __init__(self):
super(BaseTestCase, self).__init__()
BASE_PATH = ... |
from random import randint
# variables
# gamers name
players_name = ['Bryant', 'Kalyna', 'Nadine', 'Alison', 'Rachel', 'Alysa', 'Natalie', 'Dion', 'Walt', 'Sage']
players = []
suits = ['heart', 'diamond', 'club', 'spade']
faces = [('two', 2), ('three', 3), ('four', 4), ('five', 5), ('six', 6), ('seven', 7), ('eight', ... |
"""
We import HDT result from matlab for python port
"""
import scipy.io as sio
import os
import json
import glob
import h5py
if False:
seqs = os.listdir('results/HDT_cvpr2016')
for seq in seqs:
mat =sio.loadmat('results/HDT_cvpr2016/'+seq)
dict = {}
dict['seqName'] = seq[:-8]
d... |
import w2b.settings
import hashlib
from sqlalchemy import MetaData,create_engine,Table,Column,String,Integer,Binary,ForeignKey
#We fetch the database connection string from the config file. (See server/defaulfs.conf)
#Passing the 3rd parameter of __name__ enables overrideing the key for this file alone,
# allowing di... |
''' Provide a set of decorators useful for repeatedly updating a
a function parameter in a specified way each time the function is
called.
These decorators can be especially useful in conjunction with periodic
callbacks in a Bokeh server application.
Example:
As an example, consider the ``bounce`` forcing functi... |
from random import randint, choice
from datetime import datetime, timedelta
from decimal import Decimal
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from faker import Factory
from core.models import Client, Entry, Project, Task
class Command(BaseCommand):
help... |
from locale import gettext as _
import logging
logger = logging.getLogger('unity_launcher_folders')
from unity_launcher_folders_lib.AboutDialog import AboutDialog
# See unity_launcher_folders_lib.AboutDialog.py for more details about how this class works.
class AboutUnityLauncherFoldersDialog(AboutDialog):
__gty... |
import mock
from oslo_config import cfg
from oslo_messaging.rpc import dispatcher as rpc
from oslo_utils import uuidutils
import six
from senlin.common import exception as exc
from senlin.db.sqlalchemy import api as db_api
from senlin.engine import environment
from senlin.engine import service
from senlin.policies imp... |
import re
from django.middleware.locale import LocaleMiddleware
from django.utils import translation
from django.conf import settings
from utilities.models import UserLanguageProfile
from django.core.exceptions import ObjectDoesNotExist
class AdminLocaleMiddleware(LocaleMiddleware):
def process_request(self, re... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterpolar"
_path_str = "scatterpolar.stream"
_valid_props = {"maxpoints", "token"}
#... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test how we handle #includes of dangling symlinks.
"""
import os
import TestSCons
test = TestSCons.TestSCons()
if not hasattr(os, 'symlink'):
print "No os.symlink() method, no symlinks to test."
test.no_result(1)
foo_obj = 'foo' + TestSCons... |
import sys
import math
__author__ = 'Eric Torstenson'
__version__ = "0.9.1"
__copyright__ = "Copyright (C) 2015 Todd Edwards, Chun Li and Eric Torstenson"
__license__ = "GPL3.0"
# This file is part of MVtest.
#
# MVtest is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
import blaconst
# FIXME: this module will get imported even if we won't finish the startup,
# e.g. blaplay is already running.
try:
import pygst
try:
pygst.require(blaconst.GST_REQUIRED_VERSION)
except pygst.RequiredVersionError:
raise ImportError
from gst import *
import gs... |
from gi.repository import Gtk, GObject
def build_Pairing_Window(MyFp, DeviceFp):
pairing = PairingWindow(MyFp, DeviceFp)
choice = pairing.start()
return choice
class PairingWindow(Gtk.Window):
def __init__(self, myfp, devicefp):
Gtk.Window.__init__(self, title="Pairing")
self.set_res... |
'''Read the CSVs and collate them into queryable database'''
import argparse
import csv
import json
import os.path
import random
import re
import requests
import shelve
import glob
HIGHLIGHTS = [
'highlights_top.csv',
'highlights_top_02.csv',
'highlights_top_03.csv',
'highlights_top_04.csv'
]
FLV_... |
import os.path
import random
import torchvision.transforms as transforms
import torch
from data.base_dataset import BaseDataset
from data.image_folder import make_dataset
from PIL import Image
class AlignedDataset(BaseDataset):
def initialize(self, opt):
self.opt = opt
self.root = opt.dataroot
... |
"""Match wildcard filenames.
"""
# Adapted from https://hg.python.org/cpython/file/2.7/Lib/fnmatch.py
from __future__ import unicode_literals, print_function
import re
import typing
from functools import partial
from .lrucache import LRUCache
if typing.TYPE_CHECKING:
from typing import Callable, Iterable, Text,... |
#! /usr/bin/python
import time
import _inotify
import errno
def on_write(event):
print('write')
def on_read(event):
print("read")
def on_attrib(event):
print("attribute change")
def on_move(event):
print("move")
def on_open(event):
print("open")
def on_close(event):
print("close")
def on... |
"""Tests for zendesk_proxy views."""
from copy import deepcopy
import json
import ddt
from django.urls import reverse
from django.test.utils import override_settings
from mock import MagicMock, patch
import six
from six.moves import range
from common.djangoapps.student.tests.factories import UserFactory
from opened... |
"""rename 'activity' with 'workout'
Revision ID: 4e8597c50064
Revises: 3243cd25eca7
Create Date: 2021-01-09 19:41:26.589237
"""
import os
import sqlalchemy as sa
from alembic import op
from flask import current_app
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '4e859... |
"""
Utility functions for
- building and importing modules on test time, using a temporary location
- detecting if compilers are present
"""
from __future__ import division, absolute_import, print_function
import atexit
import os
import re
import shutil
import subprocess
import sys
import tempfile
import textwrap
f... |
from otree.api import Currency as c, currency_range
from . import pages
from ._builtin import Bot
from .models import Constants
import random
class PlayerBot(Bot):
def play_round(self):
if (self.player.treatment == Constants.c_treatments[0]) & (self.subsession.round_number == 1):
yield(pages.... |
"""Parse, validate and reformat standard numbers and codes.
This library offers functions for parsing, validating and reformatting
standard numbers and codes in various formats.
Currently this package supports the following formats:
* al.nipt: NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT number... |
#!/usr/bin/env python
from setuptools import setup
from CSSOnDiet import cod
try:
from pypandoc import convert
long_description = convert('README.md','rst')
except:
long_description = open('README.md', 'r').read()
setup(
name="CSSOnDiet",
version=cod.VERSION,
description="A preprocessor for designers",
... |
# -*- coding: utf-8 -*-
###############################################################################
# (C) 2010 Oliver Gutiérrez <<EMAIL>>
# LOTROAssist quest items plugin
###############################################################################
# Python Imports
import re
# GTK Imports
import gtk
# EVOGTK I... |
try:
from icu import Transliterator, UTransDirection
except ImportError, e:
pass
import sys, lucene, unittest
from BaseTokenStreamTestCase import BaseTokenStreamTestCase
from java.io import StringReader
from org.apache.lucene.util import Version
from org.apache.lucene.analysis.core import KeywordTokenizer
fro... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.contrib.learn.python.learn as learn
import csv
import json
import math
import random
random.seed()
def read_data(path):
df = pd.read_csv('data/type-inference+vars.csv')
label_names = [c for c in df... |
from .base import SOLAR, EARTH, WATER, FIRE, AIR, LUNAR, Spell
from .. import effects
from .. import targetarea
from .. import enchantments
from .. import animobs
from .. import stats
from .. import invocations
from .. import context
# CIRCLE ONE
FIRE_BOLT = Spell( "Fire Bolt",
"This attack does 1d8 fire damage t... |
import pytest
from messages.exceptions import ForbiddenTopic, DoesNotExist
def test_publish_and_deliver(router, message):
# alfa -[test.01]-> beta -[test.02]-> gama
router.add_message('alfa', 'test.01', message)
received_messages = router.deliver_to_peer('beta', 1)
assert len(received_messages) == 1... |
"""
Generate tables for converting ISO-8859 to Unicode.
The input arguments should be one or more text files from here:
http://www.unicode.org/Public/MAPPINGS/ISO8859/
The output (on stdout) will be a C-formatted table that gives the 96
special characters for each of the input tables, e.g. if the inputs are
8859-2.... |
"""
Calculate prior probabilities of attaching rules to tree nodes.
"""
import numpy as np
from scipy.stats import gamma
from .utilities import subtree_lengths
def node_priors(tree, a_L, b_L_scale, normalize_lengths=True):
""" Calculate a gamma-PDF-based prior for attachment to each node.
If normalize_lengt... |
import re
import sys
from nltk.corpus import stopwords
from nltk import word_tokenize
from nltk.stem import WordNetLemmatizer
import nltk.data
from collections import Counter
import numpy as np
import polyglot
from polyglot.text import Text, Word
import codecs
from collections import Counter
CONFIG_DIR = "../config/"
... |
"""SVN to GIT mapping for the public Chromium repositories."""
import re
GIT_HOST = 'https://chromium.googlesource.com/'
BLINK_TRUNK = 'http://src.chromium.org/blink/trunk'
# Used by deps2git.ConvertDepsToGit() as overrides for SVN DEPS. Each entry
# maps a DEPS path to a DEPS variable identifying the Git hash fo... |
import io
import json
import os
import tarfile
import urllib
class Endpoint:
def __init__(self, host, port):
self.__http = httplib2.Http()
self.__endpoint = "http://{}:{}".format(host, port)
def __ref_str(self, ref):
if ref.version is None:
return "{}:latest".format(ref.name)
else:
return "{}:{... |
"""
Copyright 2017 Oliver Smith
This file is part of pmbootstrap.
pmbootstrap 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 version.
pmbootstrap ... |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Herald HTTP beans definition
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.2
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you... |
"""
This code was originally published by the following individuals for use with
Scilab:
Copyright (C) 2012 - 2013 - Michael Baudin
Copyright (C) 2012 - Maria Christopoulou
Copyright (C) 2010 - 2011 - INRIA - Michael Baudin
Copyright (C) 2009 - Yann Collette
Copyright (C) 2009 - CEA - Jean-Marc Mart... |
from unittest import mock
from oslo_utils import uuidutils
from taskflow.types import failure
from octavia.common import constants
from octavia.common import data_models
from octavia.common import exceptions
from octavia.controller.worker.v2.tasks import database_tasks
import octavia.tests.unit.base as base
class T... |
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
... |
#!/usr/bin/etc python
import nltk
from collections import defaultdict
from gensim import models, corpora
def AddWeight(tag_list, rules, stop_dict,isAlltag, tfidfvalues=None):
result = []
#print str(tag_list)
if not tfidfvalues == None:
for k in tfidfvalues.keys():
print ... |
from openerp.osv import fields, orm
from datetime import datetime
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
class hr_payslip(orm.Model):
_inherit = 'hr.payslip'
_columns = {
'seniority_rate': fields.function(lambda self, *args, **kwargs:
self._calculate_senio... |
# -*- coding: utf-8 -*-
"""Event testing fixture.
The idea of this fixture is to pass some "expected" events to
:py:class:`utils.events.EventListener` and check whether all expected events are received
at the test end.
register_event fixture accepts attributes for one expected event
simple example:
register_even... |
#!/usr/bin/env python
from gnuradio import gr
from gnuradio import qtgui
from PyQt4 import QtGui, QtCore
import sys, sip
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
QtGui.QWidget.__init__(self, None)
self.setWindowTitle('PyQt Test GUI')
self.boxlayout = QtGui.QB... |
"""Adds docstrings to Storage functions"""
import torch._C
from torch._C import _add_docstr as add_docstr
storage_classes = [
'DoubleStorageBase',
'FloatStorageBase',
'LongStorageBase',
'IntStorageBase',
'ShortStorageBase',
'CharStorageBase',
'ByteStorageBase',
]
def add_docstr_all(meth... |
import itertools
import random
import pytest
import numpy as np
import moldesign as mdt
from moldesign import units as u
from . import helpers
registered_types = {}
def typedfixture(*types, **kwargs):
"""This is a decorator that lets us associate fixtures with one or more arbitrary types.
We'll later use... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import simplejson as json
import requests
import datetime
from requests.auth import HTTPBasicAuth
user = 'elastic'
passwd = 'changeme'
url = 'http://localhost:9200/tweet_user_timeline/sports/_search?scroll=1m&pretty'
SIZE = 1000
body = {
"size": SIZE,
"qu... |
import graphene
import graphene_django_optimizer as gql_optimizer
from django_countries.fields import Country
from graphene import relay
from ...payment import models
from ..account.types import Address
from ..core.connection import CountableDjangoObjectType
from ..core.types import Money
from .enums import OrderActio... |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... |
import matplotlib
matplotlib.use("QT4Agg")
import sys
from PyQt4 import QtGui,QtCore
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import UI
import os
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
... |
import os
import datetime
from collections import defaultdict
from django.db import models
from django.db.models import F, Q
from core.models import PlCoreBase,User,Controller
from core.models import Controller,ControllerLinkManager,ControllerLinkDeletionManager
class ControllerUser(PlCoreBase):
objects = Controll... |
"""
Tests for language manipulations.
"""
from django.test import TestCase
from weblate.lang.models import Language, get_plural_type
from weblate.lang import data
from django.core.management import call_command
import os.path
import gettext
class LanguagesTest(TestCase):
TEST_LANGUAGES = (
(
... |
import pytest
import moldesign as mdt
from .molecule_fixtures import *
registered_types = {}
def typedfixture(*types, **kwargs):
"""This is a decorator that lets us associate fixtures with one or more arbitrary types.
We'll later use this type to determine what tests to run on the result"""
def fixtur... |
"""
Test function :func:`iris.fileformats._nc_load_rules.helpers.\
build_lambert_azimuthal_equal_area_coordinate_system`.
"""
# import iris tests first so that some things can be initialised before
# importing anything else
import iris.tests as tests # isort:skip
from unittest import mock
import iris
from iris.coo... |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 30 11:37:59 2016
@author: AF
"""
import ode as solving_ode
import math
import matplotlib.pyplot as plt
def correct(string,y_t): ##### delete all the data of (x,y) where y<0
x_record = string[0][-1]
y_record = y_t
while True:
if (string[1][-... |
from __future__ import print_function, division
import numpy as np
class check_bounds(object):
"""
Decorator to add standard interpolation bounds checking.
This decorator incurs an overhead of 30-50 percent on the runtime of
the interpolation routine.
"""
def __init__(self, f):
self... |
from __future__ import print_function
import os
import sys
import stat
import subprocess
import tempfile
from .core import rd_debug
if sys.hexversion > 0x03000000: #Python3
python3 = True
else:
python3 = False
def read_stdout(cmd, capture_stderr=False):
'''
Execute given command and return stdout a... |
import time, sys, signal, atexit
import pyupm_hp20x as barometerObj
## Exit handlers ##
# This stops python from printing a stacktrace when you hit control-C
def SIGINTHandler(signum, frame):
raise SystemExit
# This function lets you run code on exit,
# including functions from ringCoder
def exitHandler():
print "E... |
MODEL_PARAMS = {
# Type of model that the rest of these parameters apply to.
'model': "CLA",
# Version that specifies the format of the config.
'version': 1,
# Intermediate variables used to compute fields in modelParams and also
# referenced from the control section.
'predictAheadTime': N... |
__author__ = 'noe'
from .maximum_likelihood_msm import MaximumLikelihoodMSM
from .oom_reweighted_msm import OOMReweightedMSM
from .augmented_msm import AugmentedMarkovModel
from .bayesian_msm import BayesianMSM
from .maximum_likelihood_hmsm import MaximumLikelihoodHMSM
from .bayesian_hmsm import BayesianHMSM
from .imp... |
"""
create list, get all lists, get specific list
"""
import requests
import json
import datetime
headers = {'content-type': 'application/json'}
url = 'http://127.0.0.1:5000'
login_user_route='/user/login'
create_list_route='/list/create'
get_lists_route='/lists'
add_user_to_list_route='/list/adduser'
remove_user_fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, Image
'''
"IOError: decoder zip not available" workaround for osx Yosemite:
sudo pip uninstall PIL
brew install zlib
brew link --force zlib
sudo pip install PIL --allow-external PIL --allow-unverified PIL
sudo pip install pillow
'''
RES_100 = 'ipadhd'
R... |
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
"""
Korean Address Provider
=======================
Korea has two address and postal code system.
Address
-------
- Address based on land parcel numbers
... |
# -*- coding: utf-8 -*-
# Scrapy settings for apod project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/to... |
from pyrepl.console import Event
from pyrepl.tests.infrastructure import ReaderTestCase, EA, run_testcase
class SimpleTestCase(ReaderTestCase):
def test_basic(self):
self.run_test([(('self-insert', 'a'), ['a']),
( 'accept', ['a'])])
def test_repeat(self):
sel... |
"""
Defines balacing area components for the SWITCH-Pyomo model.
SYNOPSIS
>>> from switch_mod.utilities import define_AbstractModel
>>> model = define_AbstractModel(
... 'timescales', 'load_zones', 'balancing_areas')
>>> instance = model.load_inputs(inputs_dir='test_dat')
"""
import os
from pyomo.environ import *... |
# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
import unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_contact(unittest.TestCase):
def setUp(self):
self.wd = WebDriver()
... |
from argparse import ArgumentParser
import pandas as pd
def main():
args = get_args()
df = pd.read_csv(filepath_or_buffer=args.STRs,
sep="\t",
header=0)
df["identifier"] = df["chrom"] + ":" + df["start"].astype(str) + "-" + df["repeatunit"]
pivot = df.pivot(in... |
#-- GAUDI jobOptions generated on Fri Jul 17 16:32:13 2015
#-- Contains event types :
#-- 11104002 - 64 files - 1010900 events - 219.99 GBytes
#-- Extra information about the data processing phases:
#-- Processing Pass Step-124834
#-- StepId : 124834
#-- StepName : Reco14a for MC
#-- ApplicationName : B... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as weight_init
import math
class Bottleneck(nn.Module):
def __init__(self, nChannels, growthRate, dropout=False):
super(Bottleneck, self).__init__()
interChannels = 4*growthRate
self.bn1 = nn.BatchNorm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.