src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python3
# James Livulpi
# October 19th 2013
# Triangle program with functions
# SELF EVALUATION
# PROGRAM PRESENTATION
# The header comment at the top contains
# * Your name:yes
# * Date:yes
# * Short specification of the program:
# The comments have correct spelling, gra... |
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project fold... |
"""
A wrapper script for ln.exe to make it look like the MKLINK utility
found from Windows Vista onwards. To fully utilise this, you should
also have a batch script that should look something like this:
@ECHO OFF
python %~dp0mklink.py %*
Name the file "mklink.cmd" and put it in PATH. Now you can use the
fake ... |
import contextlib
import threading
import io
from concur import KamiSemaphore
class A(threading.Thread):
def __init__(self, semA, semB, mutex):
threading.Thread.__init__(self)
self.setName("A")
self.semA = semA
self.semB = semB
self.mutex = mutex
def run(self):
... |
#!/usr/bin/python2.7
from __future__ import print_function
from rosalind.utils.orf_utils import read_multi_fasta
import argparse
# Create the CLI
cli_parser = argparse.ArgumentParser(description=
'Compute the Hamming distance matrix of '
'given ... |
import codecs
import json
import os
import random
import asyncio
import re
from cloudbot import hook
from cloudbot.util import textgen
nick_re = re.compile("^[A-Za-z0-9_|.\-\]\[]*$", re.I)
def is_valid(target):
""" Checks if a string is a valid IRC nick. """
if nick_re.match(target):
return True
... |
'''
Created on Mar 22, 2014
@author: Vincent
'''
import json
import math
from pprint import pprint
from chatUs.models import Event, City
from utils.geo import getLatFromStrPoint, getLonFromStrPoint, getDistanceBetween, getLatLonFromAddr
#from utils import geo
from operator import itemgetter
def AddEvents(events... |
import click
import os
import subprocess
import webbrowser
@click.command()
@click.argument('commit_sha1', 'The commit sha1 to be cherry-picked')
@click.argument('branches', 'The branches to backport to', nargs=-1)
def cherry_pick(commit_sha1, branches):
if not os.path.exists('./pyconfig.h.in'):
os.chdir(... |
# Sort of an experiment in thread programming. This script locates all
# ASCEND files in the ASCENDLIBRARY path, then for any that contain 'self_test'
# methods, it loads them and solves them and runs the self test. It's not
# very good at checking the results just yet: probably there needs to be a
# 'TestReporter' hoo... |
#!/usr/bin/env python
#
# bgp_default-originate_route-map.py
# Part of NetDEF Topology Tests
#
# Copyright (c) 2019 by
# Donatas Abraitis <donatas.abraitis@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above ... |
"""
Text-Machine Lab: CliRel
File Name : model.py
Creation Date : 10-10-2016
Created By : Renan Campos
Purpose : Defines an svm with a custom kernel.
Kernels defined below.
This module defines a composite kernel consisting of an entity
kernel and a convolution tree kernel.
... |
#from TypeExtensions import Ndarray
from gfuncs import processArgs
from mynumpy import pi, dot, cos, sin, exp #ones, complex, sin, linspace, exp, pi, dot, angle
import mynumpy as np
#from pylab import plot, subplot, xlabel, ylabel, grid, show, figure, ion, ioff
class Window(np.Ndarray):
def __new__(self, type='r... |
# -*- coding: utf-8 -*-
import scrapy
from scrapy.http import Request, FormRequest
from scrapy.spiders import CrawlSpider
from alexscrapper.items import *
from datetime import datetime
from scrapy.conf import settings
import urllib
import csv
import json
import re
from datetime import datetime, timedelta
from dateutil... |
# -*- coding: utf-8 -*-
import cfscrape
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
def print_supported_exchanges():
print('Supported exchanges:')
print(', '.join(ccxt.exchanges))
try:... |
from zeit.cms.checkout.interfaces import ILocalContent
from zeit.content.article.i18n import MessageFactory as _
import gocept.form.grouped
import uuid
import zeit.cms.browser.form
import zeit.cms.content.browser.form
import zeit.cms.interfaces
import zeit.cms.settings.interfaces
import zeit.content.article.interfaces
... |
'''
Created on Nov 19, 2013
@author: fli
'''
import re
from weibonews.utils.format import dict2PropertyTable
_CONN_RE = re.compile(r"(?P<hosts>(?P<host>[A-Z0-9_.-]+)(?P<portpart>:(?P<port>\d+))?(?P<repls>(?P<repl>,[A-Z0-9_.-]+(:\d+)?)*))/(?P<db>\w+)", re.IGNORECASE)
def parse_conn_string(conn_str):
''' parse a ... |
# -*- coding: utf-8 -*-
#
# glos-qartod documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 8 13:29:16 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... |
# -*- coding: utf-8 -*-
"""This module contains REST API specific tests."""
import random
import pytest
import fauxfactory
from cfme import test_requirements
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.rest.gen_data impo... |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free software... |
from lasagne import *
__all__ = [
'conv', 'conv1x1',
'deconv', 'deconv1x1',
'upscale',
'max_pool', 'mean_pool', 'floating_maxpool', 'floating_meanpool',
'global_pool',
'upconv', 'downconv'
]
get_conv_nonlinearity = lambda f=None: nonlinearities.LeakyRectify(0.05) if f is None else f
get_companion_nonline... |
import math
import torch
from torch import nn
from torch.nn import Parameter, functional as F
k1 = 0.63576
k2 = 1.87320
k3 = 1.48695
class DropoutLinear(nn.Linear):
def __init__(self, in_features, out_features, bias=True, p=1e-8,
level='layer', var_penalty=0., adaptive=False,
s... |
#!/usr/bin/env python
import json
# comment.
# Convenience function for using template get_node
def correct_method_name(method_list):
for method in method_list:
if method["name"] == "get_node":
method["name"] = "get_node_internal"
classes = []
def generate_bindings(path, use_template_get_n... |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
#!/usr/bin/env python
# vim: et ts=4 sw=4 sts=4
import unittest
import logging
import glob
log = logging.info
def dd(N, count=100):
from sh import dd
dd("if=/dev/zero", "of=/var/tmp/%s.bin" % N, "bs=1M",
"count=%d" % count)
def trial(num_bins=1, size_bin=500, after_rm=None, max_delta=0.05):
fr... |
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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
#
# ... |
"""3GPP usage guidelines plugin
See 3GPP TS 32.160 clause 6.2
Copyright Ericsson 2020
Author balazs.lengyel@ericsson.com
Revision 2020-11-25
Checks implemented
6.2.1.2 Module name starts with _3gpp-
6.2.1.3 namespace pattern urn:3gpp:sa5:<module-name>
6.2.1.4-a prefix ends with 3gpp
6.2.1.4-b prefix.lengt... |
## Administrator interface for Bibcirculation
##
## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation;... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.contrib.auth.models import Permission
from django.conf import settings
from documents.models import Document
from annotationsets.models import ConceptSet
from django.dispatch import receiver
from django.db... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests NODE_NETWORK_LIMITED.
Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED corre... |
# -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
from flask import url_for
from op_mon.user.models import User
from .factories import UserFactory
class TestLoggingIn:
"""Login."""
def test_can_log_in_returns_200(self, user, testapp):
"""Login succ... |
from rest_framework import views, permissions, parsers
from rest_framework.exceptions import ValidationError
from rest_framework.response import Response
from .handlers import get_handler, query
from .result import AbacusAsyncResult
from .security import validate_signature
class StartView(views.APIView):
permiss... |
from rest_framework.decorators import api_view
from rest_framework.response import Response
import view_utils as utils
from django.db.models import Q
from frontend.models import PCT, Practice
@api_view(['GET'])
def org_codes(request, format=None):
org_codes = utils.param_to_list(request.query_params.get('q', None)... |
#!/usr/bin/env python
__version__ = "1.13.2010.21:00"
__author__ = "Bryan Chapman <bryanwchapman@gmail.com>"
'''
This is the installer file for airdrop-ng. It first checks for
different dependancies, such as make, svn, etc.
'''
import os, sys
from shutil import rmtree
if os.geteuid() != 0:
print "Installer must b... |
'''
Created on Sep 4, 2015
@author: andrei
'''
from kombu import Connection
import time
from Queue import Empty
import ConfigParser
import tools.auxiliary as auxiliary
import logging
import netifaces as ni
supported_apps = ['grok', 'enkf']
msg_args = {
'retrieve_cli_output': ['app_id'],
... |
# -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields
from openerp import tools
class LapKitePemakaianBahanBakuSubkon(models.Model):
_name = "l10n_id.lap_kite_pemakaian_bahan_baku_subkon"
_description ... |
import requests
import time
import sys
import datetime
import csv
import random
import re
import json
import traceback
import os
import telegram
import gc
import signal
from threading import Thread
import builtins #I'm so sorry
from pydblite import Base #The PyDbLite stuff
import src.atbCommands as ... |
import abc
import sys
import logging
from future.utils import with_metaclass
import openpathsampling as paths
from openpathsampling.netcdfplus import StorableNamedObject, StorableObject
from ..ops_logging import initialization_logging
logger = logging.getLogger(__name__)
init_log = logging.getLogger('openpathsampli... |
"""
============
astronomy.py
============
Useful functions for astronomy & astrophysics
"""
from functools import update_wrapper
import numpy as np
from scipy import integrate
from . import constants as cs
class ReadOnlyConstants:
"""Callable class for attaching constants as read-only property to a function... |
"""HTTP Executor tests."""
import sys
import socket
from functools import partial
from http.client import HTTPConnection, OK
from typing import Dict, Any, Union
from unittest.mock import patch
import pytest
from mirakuru import HTTPExecutor, TCPExecutor
from mirakuru import TimeoutExpired, AlreadyRunning
from tests i... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
TauDEMUtils.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot 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... |
from select import select
from threading import Event, Thread
from scapy.config import conf
from scapy.data import ETH_P_ALL, MTU
class SnifferThread(Thread):
"""A thread which runs a scapy sniff, and can be stopped"""
def __init__(self, prn, filterexp, iface):
Thread.__init__(self) #make this a gree... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from shutil import make_archive
from tempfile import mkdtemp
from django.template.loader import render_to_string
def tinc_gateway_conf(gateway):
return render_to_string(
'vpn/tinc/gateway_tinc.conf', {
'gateway': gatew... |
import math
from multiprocessing import Queue, Process
import multiprocessing
def factorize_naive(n):
""" A naive factorization method. Take integer 'n', return list of
factors.
"""
if n < 2:
return []
factors = []
p = 2
while True:
if n == 1:
return factors... |
class CSVBuffer(object):
"""Class which stores data for values.CSV"""
def __init__(self, my_path):
self.working_dir = my_path
self.max_resnum = -1
self.min_resnum = 100000
self.csv_data = []
def add_data(self, data):
self.csv_data.append(data)
def write_csv(sel... |
import json
import logging
import os
import re
from datetime import datetime
from dateutil import parser
from hashlib import md5
import pytz
from sqlalchemy import or_
from sqlalchemy.orm import joinedload, subqueryload
from typing import Dict
from werkzeug.exceptions import BadRequest
from rdr_service.lib_fhir.fhircl... |
# -*- coding: utf-8 -*-
"""
Deployment settings
All settings which are typically edited for a deployment should be done here
Deployers shouldn't typically need to edit any other files.
"""
# Remind admin to edit this file
FINISHED_EDITING_CONFIG_FILE = True # change to True after you finish editing this f... |
from shakedown import *
def test_run_command():
exit_status, output = run_command(master_ip(), 'cat /etc/motd')
assert exit_status
def test_run_command_on_master():
exit_status, output = run_command_on_master('uname -a')
assert exit_status
assert output.startswith('Linux')
def test_run_command_o... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Thu Jun 15 11:48:26 2017
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.sta... |
import logging
from flask import Flask
import mock
import unittest2
from crane import app, config, app_util, exceptions, search
from crane.search import GSA
from crane.views import v1
from . import demo_data
@mock.patch('os.environ.get', spec_set=True, return_value=demo_data.demo_config_path)
class TestCreateApp(un... |
# nafsdm webinterface
# nafsdm_web.py
# main file for the database connection
# (c) Vilhelm Prytz 2018
# https://github.com/mrkakisen/nafsdm
import sqlite3
# general db connection
def dbConnection():
try:
connection = sqlite3.connect("/home/master-nafsdm/data/domains.sql")
except Exception:
# ... |
import os
import unittest
import hbml
def _file_content(path):
with open(path, 'r') as f:
content = f.read()
return content
DIRPATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'templates'
)
class TemplateTestCase(unittest.TestCase):
def _test_file(self, filename):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tiapp parser
#
import os, types, uuid
import codecs, time, sys
from xml.dom.minidom import parseString
from StringIO import StringIO
def getText(nodelist):
rc = ""
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc
class T... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# py parlai/chat_service/tasks/overworld_demo/run.py --debug --verbose
from parlai.core.worlds import World
from parla... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(
regex=r'^$',
view=views.OrderSoaView.as_view(),
name='order'
),
url(
regex=r'^create-order/$',
view=views.OrderSoaCreateView.as_view(),
name='create_order'
),
url(
... |
import os
import numpy as np
from skimage import color
import matplotlib.pylab as plt
def remove_files(files):
"""
Remove files from disk
args: files (str or list) remove all files in 'files'
"""
if isinstance(files, (list, tuple)):
for f in files:
if os.path.isfile(os.path.e... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Tintri, Inc.
#
# 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 withou... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-05 16:38
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migratio... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import binascii
from core.alert import error
from core.compatible import version
def shellcoder(shellcode):
n = 0
xshellcode = '\\x'
for w in shellcode:
n += 1
xshellcode += str(w)
if n == 2:
n = 0
xshellcode +=... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
# --------------------------------------------------------
# R*CNN
# Wri... |
#!/usr/bin/env python
"""Tests for logging classes."""
import logging
import time
from werkzeug import wrappers as werkzeug_wrappers
from grr.gui import wsgiapp
from grr.lib import flags
from grr.lib import log
from grr.lib import stats
from grr.lib import test_lib
from grr.lib import utils
from grr.proto import j... |
# #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011> Gabriel Falcão <gabriel@nacaolivre.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 ... |
"""
Notification utility.
"""
import logging
from gi.repository import GLib
from .async_ import run_bg
from .common import exc_message, DaemonBase, format_exc
from .mount import DeviceActions
from .locale import _
__all__ = ['Notify']
class Notify(DaemonBase):
"""
Notification tool.
Can be connecte... |
# -*- encoding: utf-8 -*-
"""
opensearch python sdk client.
"""
from opensearchsdk.apiclient import api_base
from opensearchsdk.v2 import app
from opensearchsdk.v2 import data
from opensearchsdk.v2 import search
from opensearchsdk.v2 import suggest
from opensearchsdk.v2 import index
from opensearchsdk.v2 import quota
f... |
# This file is the implementation of the algorithm 1 and includes the main function
# One can use this file if the training and test files are separated.
# Inputs can be tuned in the corresponding area
# The accuracy rates and all function parameters are printed to the console as output
# Dataset can be in csv or arff... |
# -*- coding: UTF-8 -*-
# Back In Time
# Copyright (C) 2008-2021 Oprea Dan, Bart de Koning, Richard Bailey, Germar Reitze
#
# 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 ... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... |
# coding: utf-8
# # Antibody Response Pulse
# https://github.com/blab/antibody-response-pulse
#
# ### B-cells evolution --- cross-reactive antibody response after influenza virus infection or vaccination
# ### Adaptive immune response for repeated infection
# In[1]:
'''
author: Alvason Zhenhua Li
date: 04/09/201... |
# -*- coding: utf-8 -*-
# Test links (random.bin):
# http://ryushare.com/cl0jy8ric2js/random.bin
import re
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
from module.plugins.internal.CaptchaService import SolveMedia
class RyushareCom(XFileSharingPro):
__name__ = "RyushareCom"... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2014 The Crashpad 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/LICEN... |
#=======================================================================
#=======================================================================
__version__ = '''0.1.00'''
__sub_version__ = '''20040223152229'''
__copyright__ = '''(c) Alex A. Naanou 2003'''
#----------------------------------------------------------... |
# -*- coding: utf-8 -*-
import os
import re
import sys
import time
import json
import ingrex
import logging
import inspect
import telegram
from selenium import webdriver
from pymongo import MongoClient
bot = None
BOT_TOKEN = ''
CHANNEL_NAME = ''
Email = ''
Passwd = ''
PhantomJSPath = ''
DBName =... |
exports = {
"name": "Water",
"aspects": {
"amulets": [
{
"item": "sailor",
"effect": "health",
"description": "By knowing the tides, your way home will be "
"easier and faster."
},
{
... |
#!/usr/bin/env python
# encoding: utf-8
# Willem-Hendrik Thiart, 2014
from waflib.Configure import conf
import simplejson as json
import os
import itertools
# TODO
# Add exception for instances where there are multiple packages with same name
class PackageNotFoundException(Exception):
pass
class ClibPackage... |
#!/usr/bin/env python
# coding:utf-8
'''
Author: Steven C. Howell --<steven.howell@nist.gov>
Purpose: calculating the Guinier fit
Created: 12/21/2016
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789012345678901234567890123456789012345678901234567890123456789012345... |
import shutil
import os
import json
import zipfile
def in_installed_packages(src, dst, action="install", ignore_dirs=""):
if os.path.exists(dst):
os.remove(dst)
if action == "install":
zipf = zipfile.ZipFile(dst, 'w', compression=zipfile.ZIP_DEFLATED)
abs_path = os.path.absp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np
import pandas as pd
__author__ = 'Yuji Ikeda'
__version__ = '0.1.0'
def create_statistical_functions():
return [
('sum', np.sum),
... |
#!/usr/bin/env python
from setuptools import setup
install_requires = [
'six>=1.9.0',
'pytimeparse>=1.1.5',
'parsedatetime>=2.1',
'Babel>=2.0',
'isodate>=0.5.4',
'python-slugify>=1.2.1',
'leather>=0.3.2',
'PyICU>=2.4.2',
]
setup(
name='agate',
version='1.6.2',
description=... |
from fonction_py.tools import *
from fonction_py.preprocess import *
from sklearn import linear_model
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import cross_validation
from sklearn.linear_model import LogisticRegression
from sklearn import tree
from sklearn import svm
from skle... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file analyze_teleports.py
@author Jakob Erdmann
@date 2012-11-20
@version $Id: analyze_teleports.py 13811 2013-05-01 20:31:43Z behrisch $
Extract statistics from the warning outputs of a simulation run for plotting.
SUMO, Simulation of Urban MObility; see http... |
#!/usr/bin/env python
"""
Generate an MC data file and calculate the required Pattern Recognition
momentum corrections required for the track reconstruction.
This will simulate MICE spills through the entirety of MICE using Geant4, then
digitize and reconstruct tracker hits to space points. Finally a
reducer is used... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... |
# -*- coding: utf-8 -*-
import argparse
import logging
import sys
from docker_scripts import squash, layers
from docker_scripts.version import version
class MyParser(argparse.ArgumentParser):
def error(self, message):
self.print_help()
sys.stderr.write('\nError: %s\n' % message)
sys.exi... |
#!/usr/bin/env python
#
# History.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; w... |
data_sets = {
'3k_Disordered' : ('3k_run10_10us.35fs-DPPC.10-DOPC.70-CHOL.20.dir', 'ece75b704ec63ac9c39afd74b63497dc'),
'3k_Ordered' : ('3k_run32_10us.35fs-DPPC.50-DOPC.10-CHOL.40.dir', '211e1bcf46a3f19a978e4af63f067ce0'),
'3k_Ordered_and_gel' : ('3k_run43_10us.35fs-DPPC.70-DOPC.10-CHOL.20.dir', '87032ff78e4d0173... |
#
# Copyright 2013 A.Crosby
# See LICENSE for license information
#
import subprocess, os
def subs(cmd):
p = subprocess.Popen(cmd, shell=True,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
out = p.communicate()
if len(out[1])>0:
raise ValueErr... |
from django.test import SimpleTestCase
from corehq.apps.userreports.models import ReportConfiguration
from corehq.apps.userreports.exceptions import BadSpecError
from corehq.apps.userreports.reports.factory import ChartFactory
from corehq.apps.userreports.reports.specs import PieChartSpec, MultibarChartSpec, MultibarAg... |
import time
from collections import defaultdict
from datetime import datetime, timedelta
import psycopg2
from psycopg2.errors import UntranslatableCharacter
import sqlalchemy
import logging
from brainzutils import cache
from listenbrainz.utils import init_cache
from listenbrainz import db
from listenbrainz.db import t... |
# Copyright 2013 IBM Corp.
# 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 app... |
# 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 ... |
"""
Assign attribute names to tuple indices
"""
import struct
from operator import itemgetter
from . import CacheAttr, NameSpace, NameList, Meta
class TupleDict(dict):
"""
MetaTuple namespace
"""
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.__names__ = ()
def __m... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
This file contains a mapping from the labels found in the html
templates to translatable strings.
'''
label_dict = {
"label_Container": _("Container"),
"label_Rep_Division": _("Rep Division"),
#taxa
"label_Species_General_Comments": _("Comments"),
"label_Species_Ge... |
"""
Code associated with the left-hand tree view for tests
"""
import gtk, gobject, pango, guiutils, plugins, logging
from ordereddict import OrderedDict
class TestColumnGUI(guiutils.SubGUI):
def __init__(self, dynamic, testCount):
guiutils.SubGUI.__init__(self)
self.addedCount = 0
self.... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\Sebastian\Mis documentos\Programacion\Proyectos\IA2013TPIRL\gui\qt\IA2013TPIRLGUI\codetailsdialog.ui'
#
# Created: Tue Jul 09 15:27:46 2013
# by: PyQt4 UI code generator 4.10.2
#
# WARNING! All changes made in this file will be lost!... |
#!/usr/bin/python3
"""
CBC mode is a block cipher mode that allows us to encrypt irregularly-
sized messages, despite the fact that a block cipher natively only
transforms individual blocks.
In CBC mode, each ciphertext block is added to the next plaintext block
before the next call to the cipher core.
The first... |
import unittest
from itertools import imap
from operator import add
NO_CLIFF=1
HAS_CLIFF=2
class TestBuildCliff(unittest.TestCase):
def setUp(self):
pass
def testBuild_Cliff(self):
altitudes={(10,10):2,(10,11):4,(11,11):4,(11,10):2,(12,10):2,(12,11):4}
key=(10,10)
start_cliff=1... |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. 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 requir... |
# Generated by Django 2.1.3 on 2018-11-08 23:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contest', '0044_auto_20181106_1212'),
]
operations = [
migrations.AddField(
model_name='contestproblem',
name='ac_co... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 DAVY Guillaume
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.