src stringlengths 721 1.04M |
|---|
# This file is part of Coffee Notes project
#
# Coffee Notes is a crossplatform note-taking application
# inspired by Notational Velocity.
# <https://github.com/dmych/cn>
#
# Copyright (c) Dmitri Brechalov, 2011
#
# Coffee Notes is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# POS Fiscal Printer module for Odoo
# Copyright (C) 2017 Rosen Vladimirov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
from __future__ import absolute_import
import os
import shutil
import tempfile
import unittest
class SetupStack(object):
def __init__(self):
self._on_teardown = []
def add_teardown(self, teardown):
self._on_teardown.append(teardown)
def tear_down(self):
for func in reversed(self.... |
from tkinter import *
from tkinter import ttk
import random
button_width = 17
number_of_characters_per_row = 56
diff_for_answers = 8
color = '#%02x%02x%02x' % (231, 231, 231)
import subprocess # poskusile 5 razlicnih modulov: pyglet, mp3play, sound in se dva pa noben ni delal
# pygame se nama zdi prevelika knjizni... |
import logging
import os
import inspect
import g
def get_logger(logger_name='[PythonService]', dirpath=None):
logger = logging.getLogger(logger_name)
if dirpath is None:
# dirpath = os.path.join(os.path.dirname(__file__), os.path.abspath('..'))
dirpath = os.path.dirname(__file__)... |
'''
File to handle motif/expression regression
'''
__author__='Anthony Soltis'
__email__='asoltis@mit.edu'
import sys,os,pickle,re
from optparse import OptionParser
import numpy as np
from scipy import stats
import fileinput
import matplotlib
matplotlib.use('pdf')
from matplotlib import pyplot as plt
def load_tgm(tg... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# Copyright 2014 Nico Lugil <nico at lugil dot be>
#
# This file is part of Yafa!
#
# Yafa! 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 vers... |
"""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, software
dis... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
#!/usr/bin/env python
LOCALES = ["en-US", "multi"]
# override tag for all repos
TAG = None
#AUS_SERVER = "dev-stage01.build.mozilla.org"
AUS_SERVER = "aus3-staging.mozilla.org"
#FTP_SERVER = "dev-stage01.build.mozilla.org"
FTP_SERVER = "stage.mozilla.org"
AUS_UPLOAD_BASE_DIR = "/opt/aus2/snippets/staging"
AUS_DIR_BASE... |
"""Celery tasks"""
import numpy as np
from celery import Celery
import pymongo
from wax import Configuration
import ebcore
# Specify mongodb host and datababse to connect to
BROKER_URL = 'mongodb://xedaqtest2:27017/jobs'
celery = Celery('EOD_TASKS',
broker=BROKER_URL,
backend=BROKER_U... |
import unittest
import sys
sys.path.append('../src')
from island import *
from service_island import *
from service_player import *
from islandbus import *
from constants import *
from message import *
from cards import *
import sys
from iofactory import *
from playerfactory import *
from tiles import *
class TestPlay... |
import subprocess
import numpy as np
import os
import numpy.ma as ma
import re
from tempfile import mkstemp, mkdtemp
import shutil
import scipy.constants
#########################################
#replace will search through a file for a specific word an then replace that line
def replace(file, pattern, subst):
p... |
# -*- coding: utf8 -*-
#
# Copyright (C) 2015 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... |
""" Class for generate 5 elements compounds """
import os
import sys
import inspect
baseLibDir = os.path.join(os.path.realpath(os.path.dirname(
inspect.getfile(inspect.currentframe()))), '..')
sys.path.append(baseLibDir)
import nmod
from compound import Compound
class FiveElements(Compound):
""" Five... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
from pylab import *
from pprint import pprint
import json
from IPython.display import HTML, display
import traitlets
from ipywidgets import *
from .show_code import show_code
from ..manifolds.torus import Torus
from ..manifolds.landmarks import Landmarks
from ..manifolds.curves import Curve, Curves
from ..models.fr... |
from .plugin_api.urlutils import parse_url
from .exception import FuzzExceptBadInstall
# python 2 and 3
import sys
if sys.version_info >= (3, 0):
from urllib.parse import urljoin
else:
from urlparse import urljoin
class FuzzRequestSoupMixing(object):
def get_soup(self):
try:
from bs4 ... |
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, Frank Scholz <coherence@beebits.net>
from coherence.upnp.services.clients.switch_power_client import SwitchPowerClient
from coherence import log
import coherence.extern.louie as louie
class BinaryLightClient(log.Log... |
"""An object-oriented interface to Prolog."""
from collections import namedtuple
from ctypes import (
POINTER,
byref,
c_char,
c_double,
c_int,
c_int64,
c_size_t,
c_void_p,
)
from swilite.core import (
BUF_DISCARDABLE,
CVT_WRITEQ,
PL_ATOM,
PL_BLOB,
PL_DICT,
PL_FLO... |
# -*- coding: utf-8 -*-
# Django settings for account project
import os.path
import posixpath
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# tells Pinax to serve media through the stat... |
import logging
import redis
import simplejson as json
class RedisFormatter(logging.Formatter):
def format(self, record):
"""
JSON-encode a record for serializing through redis.
Convert date to iso format, and stringify any exceptions.
"""
data = record._raw.copy()
... |
# Copyright (c) 2013 Alan McIntyre
import datetime
import decimal
import common
def getDepth(pair, connection = None):
'''Retrieve the depth for the given pair. Returns a tuple (asks, bids);
each of these is a list of (price, volume) tuples.'''
common.validatePair(pair)
if connection is No... |
############################################
##Author: James T. Bennett
##Objective-C xrefs helper IDApython script
############################################
########################################################################
# Copyright 2019 FireEye
#
# FireEye licenses this file to you under the Apac... |
import time
import datetime
d = datetime.date.today()
dm = d.month
dd = d.day
print ('Welkom bij TheCoiner')
file = 'data/monthday/month.txt'
f = open(file)
file_contents = f.read()
pdm = file_contents
file = 'data/monthday/day.txt'
f = open(file)
file_contents = f.read()
pdd = file_contents ... |
# Copyright (c) 2011 Sam Rushing
#
# key.py - OpenSSL wrapper
#
# This file is modified from python-stardustlib.
#
"""ECC secp256k1 crypto routines
WARNING: This module does not mlock() secrets; your private keys may end up on
disk in swap! Use with caution!
"""
import ctypes
import ctypes.util
import hashlib
import... |
from xml.etree.ElementTree import Element, tostring as element_to_str
import six
from specter import _
from specter.spec import DescribeEvent
from specter.reporting import AbstractParallelReporter, AbstractSerialReporter
class XUnitReporter(AbstractSerialReporter, AbstractParallelReporter):
""" A simple xUnit fo... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Osmo Salomaa
#
# 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, or
# (at your option) any later version.
#
# This pr... |
"""
This file is part of the everest project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Created on Oct 16, 2013.
"""
import pytest
from everest.attributes import get_attribute_cardinality
from everest.attributes import is_terminal_attribute
from everest.constants import CARDINALITY_... |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Google 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:
#
# 1. Redistributions of source code must retain the above ... |
# -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals)
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.db import models
USER_MODEL = settings.AUTH_U... |
import os
from settings import *
from YamJam import yamjam
PROJECT_PATH = os.path.abspath(
os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
CFG = yamjam(os.path.join(PROJECT_PATH, 'etc/yamjam/config.yaml'))['litlong']
DEBUG = True
TEMPLATE_DEBUG = DEBUG
SECRET_KEY = CFG['secret-key']
DATABASES ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utilities to use the QNAP Container Station API
See documentation here: http://qnap-dev.github.io/container-station-api/index.html
"""
import os
import sys
import pickle
import requests
import getpass
import warnings
import contextlib
import logging
logger = loggin... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from contrail_api_cli.command import Command, Option
from contrail_api_cli.resource import Resource
from contrail_api_cli.exceptions import CommandError, ResourceNotFound
from ..utils import ip_type
class Linklocal(Command):
service_nam... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed under the MIT Licence
# spectrum_overload documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 11 23:45:23 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible con... |
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
# To run the docs build directly, generate module index:
# rm -r docs/api ; sphinx-apidoc -f -M -o docs/api smif
# Then build docs:
# rm -r docs/_build ; sphinx-build -b html docs docs/_build/html
# Note tha... |
# -*- coding: utf-8 -*-
import dirtyjson as json
from ..decorators import linter
from ..parsers.base import ParserBase
@linter(
name="shellcheck",
install=[
["cabal", "update"],
["cabal", "install", "shellcheck"],
["apt-get", "install", "shellcheck"],
["dnf", "install", "shel... |
# -*- coding: utf-8 -*-
# account.py
# Copyright (C) 2013-2015 LEAP
#
# 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, or
# (at your option) any later version.
#
... |
"""
Generators for random graphs.
"""
import itertools
import math
import networkx as nx
from networkx.utils import py_random_state
from .classic import empty_graph, path_graph, complete_graph
from .degree_seq import degree_sequence_tree
from collections import defaultdict
__all__ = [
"fast_gnp_random_graph",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
gandi-dyndns
@author: AlessioCasco
"""
from bottle import route, run, request, response
from optparse import OptionParser
import logging as log
import xmlrpclib
import json
import sys
import re
gandi_fqdn_ip = {}
@route('/ping', method=['GET', 'POST'])
def ping():
... |
import pytest
from capybara.exceptions import ModalNotFound
@pytest.mark.requires("modals")
class TestDismissPrompt:
@pytest.fixture(autouse=True)
def setup_session(self, session):
session.visit("/with_js")
def test_dismisses_the_prompt(self, session):
with session.dismiss_prompt():
... |
class StateModule(object):
always_tick = False
def __init__(self, controller):
self.id = self.__class__.__name__
self.controller = controller
def draw(self):
pass
def try_bricklet(self, uid, device_identifier, position):
pass
def navigate(self, direct... |
#!/usr/bin/python3
from gpiozero import Button
from http.server import BaseHTTPRequestHandler, HTTPServer
import time
import threading
hostName = "192.168.1.27"
hostPort = 9000
turns = 0
# HTTP server class.
class MyServer(BaseHTTPRequestHandler):
def do_GET(self):
global turns
s... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import dclab
import wx
import wx.lib.agw.hypertreelist as HT
from dclab.definitions import feature_name2label
from ..settings import SettingsFile
from ..session import conversion
from .polygonselect import LineDrawerWindow
f... |
class Solution(object):
def findDerangement(self, n):
"""
:type n: int
:rtype: int
"""
if n < 2:
return 0
p1, p2 = 1, 2
for i in range(4, n + 1):
if i & 1:
p2 = (i - 1) * (p1 + p2) % 1000000007
else:
... |
"""Save output images local plugin for Ginga."""
from __future__ import absolute_import, division, print_function
from ginga.util.six import itervalues
from ginga.util.six.moves import map
# STDLIB
import os
import shutil
# THIRD-PARTY
from astropy.io import fits
# GINGA
from ginga.GingaPlugin import GlobalPlugin
fr... |
# GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD
#pylint: skip-file
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resource import AviNestedResource... |
import zstackwoodpecker.test_state as ts_header
import zstackwoodpecker.operations.resource_operations as res_ops
import random
import os
TestAction = ts_header.TestAction
class VM(object):
def __init__(self, name=None):
self.name = name
self.cloned_name_list = [self.name + '_cloned_vm%s' % i for ... |
# c_cost.py
# Cost vector for edges in coupled matrix
import numpy as np
__all__ = ["c_cost"]
def c_cost(g, a_coup, a_vertices):
# TODO: think this function is slow. Check for performance increases.
# c_cost
# creates vector of costs for edges
#
# Inputs: g - graph structure
# ... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# 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 appl... |
#!/usr/bin/python
import sys
def get_ranks(hand):
ranks = ['--23456789TJQKA'.index(r) for r, s in hand]
ranks.sort(reverse = True)
if ranks == [14, 5, 4, 3, 2]:
ranks = [5, 4, 3, 2, 1]
return ranks
def expand(counts, ranks):
cards = []
for i in range(len(counts)):
cards.extend((ranks[i], ) * counts[i])
re... |
#!/usr/bin/env python
from pprint import pprint
import os
import urllib
import sys
import zipfile
import tempfile
def get_local_properties_location():
curdir = os.getcwd()
localprops_name= 'local.properties'
location = ''
while curdir and curdir != '/':
location = os.path.join(curdir, localpro... |
from braces.views import LoginRequiredMixin
from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.forms import SetPasswordForm
from django.contrib.auth.models import User
from django.contrib.auth.tokens i... |
'''
Session class - Manages the whole experiment and all other classes
'''
import sys, time, os, yaml
from tkSimpleDialog import askstring, askinteger
from tkMessageBox import showwarning, askquestion
from Tkinter import END
from gui import GUI
from data import Data
from soundlib import SoundLibrary
class Session... |
# -*- coding: utf-8 -*-
# pylint: disable=E1101
# pylint: disable=W0621
import fauxfactory
import uuid
import pytest
import utils.error as error
from cfme import Credential
from cfme.exceptions import FlashMessageException
from cfme.cloud.provider import (discover, EC2Provider, wait_for_a_provider,
Provider, Open... |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Experiment job mapper.
"""
from sqlalchemy.orm import relationship
from everest.repositories.rdb.utils import mapper
from thelma.entities.experiment import ... |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import os, subprocess, sys
prev_rev, current_rev, flags = [x.decode('utf-8')... |
from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
from flask.ext.login import UserMixin, AnonymousUserMixin
from .. import db, login_manager
class P... |
"""Riak protocol buffers client.
Provides a couple interfaces to working with a Riak database.
The first is a lower-level Client object. It has methods for interacting with
the server, buckets, keys and values. The methods are more verbose and return
dense dictionaries of data.
The other interface is via Buckets. Th... |
# -*- coding: utf-8 -*-
from captcha.fields import ReCaptchaField
from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.http import Http... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 CENATIC: Centro Nacional de Referencia de
# Aplicacion de las TIC basadas en Fuentes Abiertas, Spain.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# Redistribution... |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import fields
import stix
from stix.utils import deprecated
from stix.common import InformationSource, StructuredTextList, Profiles
from stix.common.vocabs import VocabField, PackageIntent
from stix.dat... |
# Copyright (C) 2014 Vangelis Tasoulas <vangelis@tasoulas.net>
#
# 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, or
# (at your option) any later version.
#
# Th... |
import logging
import re
import typing
from multiprocessing.managers import SyncManager
from multiprocessing.pool import Pool
from PyQt5 import QtCore
from .backgroundrunner import JobRecord, BackgroundRunner
from ...core.processing.subtractingjob import SubtractingJob
logger=logging.getLogger(__name__)
logger.setLe... |
# -*- coding: utf-8 -*-
# (c) 2019-2020 Andreas Motl <andreas@getkotori.org>
from kotori.daq.decoder.airrohr import AirrohrDecoder
from kotori.daq.decoder.tasmota import TasmotaSensorDecoder, TasmotaStateDecoder
from kotori.daq.decoder.schema import MessageType
class DecoderInfo:
def __init__(self):
self... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from pprint import pprint
from libmozdata.bugzilla import Bugzilla
from auto_nag import logger
class History(object)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import find_packages, setup
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
with open('requirements.txt') as f:
requirements =... |
from pdcglobal import *
from .effect import Effect
from .dv_effects import DazzleEffect
class StunEffect(Effect):
def __init__(self, host, owner):
dur = d(3)
Effect.__init__(self, dur, host, owner)
weaponinfotext = 'Stuns the enemy'
def tick(self):
self.host.timer += se... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import colorfield.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Theme',
fields=[
('i... |
# GNU Mailutils -- a suite of utilities for electronic mail
# Copyright (C) 2009-2012 Free Software Foundation, Inc.
#
# GNU Mailutils 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 ... |
##############################################################################
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 29 13:35:08 2017
@author: clancien
"""
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import os
import pandas
import logging
from logging.handlers import RotatingFileHandler
import sys
class InfoWithHomologene():
def __i... |
#!/usr/bin/env python
# Simple GUI for qmc.py
# FIXME Experimental - doesn't do any check on what is passed as input ;)
#
# Copyright (C) 2011 Marcello Pogliani
#
# 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 ... |
#!/usr/bin/env python
#
# THE KITTI VISION BENCHMARK SUITE: ROAD BENCHMARK
#
# File: simpleExample_transformTestResults2BEV.py
#
# Copyright (C) 2013
# Honda Research Institute Europe GmbH
# Carl-Legien-Str. 30
# 63073 Offenbach/Main
# Germany
#
# UNPUBLISHED PROPRIETARY MATERIAL.
# ALL RIGHTS RESERVED.
#
# A... |
# Copyright 2020, University of Colorado Boulder
#
# @author Jonathan Olson <jonathan.olson@colorado.edu>
import sublime, sublime_plugin, os, re, subprocess, webbrowser, json, threading
from functools import reduce
# Useful URLs:
# https://www.sublimetext.com/docs/3/api_reference.html
# http://www.sublimetext.com/do... |
#!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2017/11/1 ~ 2019/9/1
# @Author : Allen Woo
import base64
import json
import os
from flask import request
from flask_babel import gettext
from flask_login import current_user
from apps.configs.sys_config import APPS_PATH
from apps.modules.user.process.get_or_update_... |
import os
import json
from collections import OrderedDict
from django.conf import settings
from django.template import RequestContext
from django.http import HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.template.response import TemplateResponse
from django.core import serializer... |
# -*- coding: utf-8 -*-
import os
from sys import path
from django.db import models, migrations
from django.core import serializers
fixture_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'fixtures'))
fixture_filename = 'emailtemplate.json'
def deserialize_fixture():
fixture_file = os.path.join(fix... |
# Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
# -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Package: Pikos toolkit
# File: monitors/api.py
# License: LICENSE.TXT
#
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#----------------------------------------------------------------------------
... |
from App.Proxys import *
data = SimBiController(
name = 'Jumping',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 1000.0, kd = 100.0, tauMax = 10000.0, scale = (... |
# -*- encoding: utf-8 -*-
import smtpd
import webbrowser
import asyncore
import threading
import Queue
import re
import email
import wx
from wx import html
from wx._core import EVT_ACTIVATE
import wx.lib.newevent
TRAY_TOOLTIP = 'wxMailServer'
TRAY_ICON = 'icon.png'
messages = Queue.Queue()
def create_menu_item(men... |
from corpus import Corpus
import processing
__author__ = 'bengt'
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('train', help='Path to training corpus.')
parser.add_argument('corpus', help='Path to corpus.')
parser.add_argument('n', help='Tag sentences shorter than... |
# coding=utf-8
# Copyright © 2018 Computational Molecular Biology Group,
# Freie Universität Berlin (GER)
#
# 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 ret... |
# -*- coding: utf-8 -*-
r"""
:mod:`tli` -- Tree level improvement.
=========================================
Calculate tree level improvements for lattice QCD observables in the
spirit of [1]_. Given an observable :math:`{\mathcal O}(a/L)`, one
defines the improved observable
.. math::
{\mathcal O}_\mathrm{I}(a/... |
#! /usr/bin/env python
import sys
import re
if __name__ == "__main__":
no_alnum = re.compile(r'[\W_]+')
with open(sys.argv[2], 'w') as out_file:
with open(sys.argv[1]) as f:
for line in f:
comps = line.strip().split('\t')
pmid = comps[0]
journal = comps[1]
mesh_terms_stri... |
"""
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import numpy as numpy
import clawpack.geoclaw.multilayer.data as multilayer
import clawpack.geoclaw.surge.data as surge
import clawpack.geocla... |
#!/usr/bin/env python
# -*- coding: UTF-8; indent-tabs-mode:nil; tab-width:4 -*-
# This file is part of DITA DTD Generator.
#
# Copyright 2009 Jarno Elovirta <http://www.elovirta.com/>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... |
"""
Module to wrap an integer in bitwise flag/field accessors.
"""
from collections import OrderedDict
from collections.abc import Iterable
from pcapng._compat import namedtuple
class FlagBase(object):
"""\
Base class for flag types to be used in a Flags object.
Handles the bitwise math so subclasses do... |
"""
Downloader, mass file downloader.
"""
import common
import logging, logging.handlers
import os
import os.path
import plistlib
import stat
import sys
import time
from optparse import OptionParser
from yapsy.PluginManager import PluginManager
SCRIPT_FILENAME = os.path.abspath(sys.argv[0])
SCRIPT_DIRECTORY = os.se... |
# import the necessary packages
from __future__ import print_function
from non_max_suppression import non_max_suppression
from myqueue import myqueue
from frames import frames
from object import Object
import numpy as np
import argparse
import datetime
import imutils
import cv2
import time
ap = argparse.ArgumentParser... |
#!/usr/bin/env python3
import argparse
import os
import sys
from ucca.ioutil import get_passages_with_progress_bar, write_passage
desc = """Rename passages by a given mapping of IDs"""
def main(filename, input_filenames, outdir):
os.makedirs(outdir, exist_ok=True)
with open(filename, encoding="utf-8") as f:... |
from pycket.util import snake_case
from rpython.rlib import jit, objectmodel
class Visitable(type):
def __new__(cls, name, bases, dct):
visit_method_name = "visit_" + snake_case(name)
@objectmodel.specialize.argtype(1)
def dispatch_visitor(self, visitor, *args):
return getattr(... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may n... |
import numpy
import xraylib
"""
transfocator_id30b : transfocator for id13b:
It can:
1) guess the lens configuration (number of lenses for each type) for a given photon energy
and target image size. Use transfocator_compute_configuration() for this task
2) for a given tran... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Interfaces to VM/node providers.
"""
# Copyright (C) 2011, 2012 ETH Zurich and University of Zurich. All rights reserved.
#
# Authors:
# Riccardo Murri <riccardo.murri@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... |
"""
Test script for recording a sequence of random actions and playing them back
"""
import os
import h5py
import argparse
import random
import numpy as np
import json
import robosuite
from robosuite.controllers import load_controller_config
def test_playback():
# set seeds
random.seed(0)
np.random.seed(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.