src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
# Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope th... |
# Copyright 2016 NOKIA
#
# 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... |
# -*-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
# ... |
"""
creation.py
--------------
Create meshes from primitives, or with operations.
"""
from .base import Trimesh
from .constants import log, tol
from .geometry import faces_to_edges, align_vectors, plane_transform
from . import util
from . import grouping
from . import triangles
from . import transformations as tf
i... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HM2_then1_CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HM2_then1_CompleteLHS.
"""
# Fla... |
#-*- encoding:utf-8 -*-
# tonic.py - Tonic vowel finding using the algorithm described in Silva [2011].
# Copyright (C) 2014 Alessandro Bokan
#
# 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, e... |
from unittest import suite
class DeferrableSuite(suite.TestSuite):
r'''Deferrable test suite.
Run method is basically a copy from suite.TestSuite, but it is a
generator. If a generator is returned by a test, there is entered
a consumer loop and for each step there is done a step here.
'''
d... |
# 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 ... |
# -*- coding: utf-8 -*-
from odoo.tests.common import TransactionCase
from odoo import exceptions
class TestExpenseAccount(TransactionCase):
"""This class extends the base TransactionCase, test ToproERP_Expense
"""
post_install = True
at_install = False
def setUp(self):
super(TestExpense... |
# Copyright 2012 Nebula, 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 agree... |
# -*- coding: ascii -*-
#
# Copyright 2007 - 2017
# Andr\xe9 Malo or his licensors, as applicable
#
# 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/LICENS... |
#!/usr/bin/env python
""" file_certs.py: File-based Trust Metric Profiles (example code)
Copyright (C) 2001 Luke Kenneth Casson Leighton <lkcl@samba-tng.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free S... |
import hashlib, json, os
from pyna.base.Settings import Settings
from pyna.core.Packager import Packager
from pyna.core.NodeList import NodeList
from pyna.ui.PynaDisplay import PynaDisplay
class Manager(Settings):
'''
Manages all things related to other nodes and configuration settings
'''
def __init__(self, alia... |
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils import simplejson as json
from django.utils.hashcompat import sha_constructor
import hmac
from formwizard import storage
sha_hmac = sha_constructor
class CookieStorage(storage.BaseStorage):
encoder = json.... |
'''
Contains various utility functions and classes for Sierra API project
code.
'''
from __future__ import unicode_literals
import operator
import re
from django.db.models import Q
def reduce_filter_kwargs(filters):
'''
Given a list of filter_kwargs, where each list should be 'ORed'
with each other, thi... |
from bge import logic as g
from bge import texture
from mathutils import *
from math import *
import bgl
cont = g.getCurrentController()
own = cont.owner
scene = g.getCurrentScene()
objlist = scene.objects
reflsize = 512 #reflection tex dimensions
refrsize = 512 #refraction tex dimensions
offset = 200.0 #geometry cli... |
from matplotlib.pyplot import *
from scipy import *
from numpy import *
# a simple Runge-Kutta integrator for multiple dependent variables and one independent variable
def rungekutta4(yprime, time, y0):
# yprime is a list of functions, y0 is a list of initial values of y
# time is a list of t-values at which ... |
"""
This file contains the class of the addon
Settings for this addon:
w_movies
'true', 'false': save watched state of movies
w_episodes
'true', 'false': save watched state of movies
autostart
delay
delay after startup in minutes: '0', '5', '10', ...
starttype
'0' = No autostart
'1' = One Execution... |
#todo:
#get rid of *info* field
#close selecor box after downloads
#show "waiting" window
#show "done" windo when finished
#write Error file
#clean up/ delete temp files if "cleanup", even when crashing
import tkinter as tk
import configparser
from tkinter import filedialog
from tkinter import messagebox
from tkinte... |
import gi
gi.require_version('Gtk', '3.0')
import threading
import time
from gi.repository import Gtk, Gdk
from gi.repository import GObject as GObject
from src.view import LyricsDisplayer
GObject.threads_init()
insta = LyricsDisplayer.LyricsDisplayer()
#w = Gtk.Window()
w = insta.lyrics_window()
#l = Gtk.Label()
#w... |
from piece import piece
class fou(piece):
def move(self, pos_x, pos_y, tableau, array):
curColor = tableau.getPion(pos_x, pos_y).getColor()
curX = pos_x + 1
curY = pos_y + 1
while (tableau.getPion(curX, curY) == None and curX <= 7 and curY <= 7):
tableau.setPossible(curX,... |
#coding:utf-8
from yuming import ifRegged
import sys
import time,random
dicType = []
dic = {}
dtFile = open('domainType','r').readlines()
for t in dtFile[1:-1]:
dicType.append(t[:-1])
#print dicType
times = [1,2,3,4]
for t in times:
dic[t] = []
totalDic = []
pinyinFile = open('pinyin','r').readlines()
fo... |
# import os
# # delete jobs on westgrid
# command = 'qdel '
# for i in range(16878874, 16880029):
# print command + str(i) + '.b0'
# # os.system(command + str(i) + '.b0')
# file_list = os.listdir('F:/results')
# for file in file_list:
# print 'java Friedman F:/results/'+file +' > F:/results/' + file[:-4]+'... |
import csv
import datetime
import re
from Structs import AulaDataRaw
from Structs import AulaDataSripped
def openFile(filePath):
return open(filePath)
def csvIntoRawArray(csvFile):
# Array of arrays(lines) with data
filereader = csv.reader(csvFile)
# We will be returning an array of AulaDataRaw
... |
# -*- coding: utf-8 -*-
# Notes:
#
# - this plug-in uses LRCache.jar from export_flow_datasets/lib.
# - this plug-in requires Jython version 2.7 (for json module)
'''
Aggregation plug-in to generate FCS plots.
The first time a scatterplot is generated for an FCS file, the data is read
and stored in a CSV file that i... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User, Group
from django.contrib.sites.models import Site
from taggit.managers import TaggableManager
from samklang_utils import markdown, slugify
from samklang_utils.managers import PermissionMan... |
from hwt.hdl.constants import READ, WRITE, READ_WRITE
from hwt.interfaces.agents.handshaked import HandshakedAgent
from hwt.interfaces.agents.vldSynced import VldSyncedAgent
from hwt.interfaces.std import VectSignal, Signal
from hwt.simulator.agentBase import SyncAgentBase
from hwt.synthesizer.interface import Interfac... |
from __future__ import print_function, division
from abc import ABCMeta, abstractmethod
import numpy as np
from ciabatta.meta import make_repr_str
from ahoy.ring_buffer import CylinderBuffer
from ahoy import measurers, c_measurers
def get_K(t, dt, t_rot_0):
A = 0.5
ts = np.arange(0.0, t, dt)
gs = ts / t_r... |
# -*- coding: utf-8 -*-
#
# arclib documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 18 14:25:46 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.
#
# Al... |
#!/usr/bin/env python
import os, subprocess, multiprocessing, time, sys, argparse
nbCores = int( os.environ['WM_NCOMPPROCS'] )
parser = argparse.ArgumentParser( description='Run the test suite' )
parser.add_argument('testsuite', help='which testsuite: testsuite-dealii, testsuite-rbf, testsuite-spacemapping, testsuit... |
#!/usr/bin/env python
import os
import platform
import subprocess
def make(src_args):
#--input="input-standard-files-dir"
#--output="output-dir"
#--standard // generate standarts
#--use-system-fonts="0/1/false/true"
#--font-dirs="C:\\Windows\\Fonts;/usr/share/fonts;"
#--cores=4
work_dir = os.path.dirnam... |
# -*- coding: utf-8 -*-
# grimm
#
# grimm 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, version 3.
#
# grimm is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the im... |
"""This demo illustrates how to set boundary conditions for meshes
that include boundary indicators. The mesh used in this demo was
generated with VMTK (http://www.vmtk.org/)."""
# Copyright (C) 2008-2012 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# ... |
#!/usr/bin/env python
#
# Copyright 2019 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import os
import subprocess
import sys
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
INFRA_BOTS_DIR = os.path.... |
# coding: utf-8
# Copyright (C) zhongjie luo <l.zhjie@qq.com>
import redis
from db_bench import DbConnection, multi_process_bench, Options
class StrictRedis(DbConnection):
def __init__(self, options):
super(StrictRedis, self).__init__(options)
self.__db = 0
self.__client = None... |
# File name: toolbox.py
import kivy
kivy.require('1.8.0')
import math
from kivy.uix.togglebutton import ToggleButton
from kivy.graphics import Line
from dnd import StickMan, DraggableWidget
class ToolButton(ToggleButton):
def on_touch_down(self, touch):
ds = self.parent.drawing_space
if self.state ... |
import os
import json
import re
from antelope_catalog.providers.ecospold2 import EcospoldV2Archive
from antelope_catalog.providers.ilcd import grab_flow_name, IlcdLcia
from antelope_catalog.providers.xml_widgets import find_tag, find_tags, find_common, find_ns
from lcatools.flowdb.synlist import Flowables, Inconsisten... |
#!/usr/bin/env python
def isCommand(command, args):
index = 0
for arg in args:
if isinstance(arg, list):
for ar in arg:
if isinstance(ar, list):
for a in ar:
if isinstance(a, list):
index-=1
... |
"""Tests for the isort import placement module"""
from functools import partial
from isort import place, sections
from isort.settings import Config
def test_module(src_path):
place_tester = partial(place.module, config=Config(src_paths=[src_path]))
assert place_tester("isort") == sections.FIRSTPARTY
asse... |
# flake8: noqa
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
no_dry_run = True
def forwards(self, orm):
# Adding field 'NewsEntry.author_user'
... |
# encoding=utf8
import sys
from nltk.corpus import wordnet as wn
from os import listdir
from os.path import isfile, join,isdir
from nltk.stem import WordNetLemmatizer
import nltk
import os
#reload(sys)
sys.setdefaultencoding('utf8')
wordnet_lemmatizer = WordNetLemmatizer()
print(wordnet_lemmatizer.lemmatize('dogs'))
... |
# import sys
from twisted.trial import unittest
from twisted.internet import defer
# from twisted.python import log
import trex
from trex import redis
from .mixins import REDIS_HOST, REDIS_PORT
# log.startLogging(sys.stdout)
class InspectableTransport(object):
def __init__(self, transport):
self.orig... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Phase.start_date'
db.add_column('challenges_phase', 'start_date', self.gf('django.db.model... |
import requests
import lob
import json
import resource
from lob import error
from version import VERSION
def _is_file_like(obj):
"""
Checks if an object is file-like enough to be sent to requests.
In particular, file, StringIO and cStringIO objects are file-like.
Refs http://stackoverflow.com/question... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Image.reviewed'
db.add_column(u'articles_image', 'reviewed',
self.gf('... |
'''
Tests for student activation and login
'''
import json
import unittest
from unittest import skip
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers i... |
"""
This example:
1. Connects to the current model
2. Resets it
3. Deploys a charm and prints its config and constraints
"""
import logging
from juju.model import Model
from juju import loop
log = logging.getLogger(__name__)
MB = 1
async def main():
model = Model()
# connect to current model with current... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import os
from django.conf import settings
from django.utils.trans... |
import asynchat
import re
import string
import sys
import time
from lib.log import debug, info, warning, exception
from lib.msgs import insert_silences, encode_msg
import res
from serverroom import Anonymous, InTheLobby, OrganizingAGame, WaitingForTheGameToStart, Game
class ConnectionToClient(asynchat.async_chat):
... |
# global imports
import pygame
# local imports
import resource
from definitions import terrain, action
from square import Square
from realbot import Realbot
from dumbbot import Dumbbot
class Battle():
def __init__(self):
# Load terrain tiles
self.terrainImages = {}
self.terrainImages[ter... |
#!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... |
#! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... |
#!/usr/bin/python
#
# Copyright (c) 2011 Rime Project.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... |
# 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 writing, software
# distributed under the... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 2 22:08:22 2014
@author: remi
"""
#trying to order points by octree with python
from numpy import random, sqrt
from sklearn import preprocessing
import matplotlib.pyplot as plt
#defining a dummy entry :a random 3D pointcloud
pointcloud = random.rand(16*16,2);
index =... |
import numpy, sys
import scipy.linalg, scipy.special
'''
VBLinRegARD: Linear basis regression with automatic relevance priors
using Variational Bayes.
For more details on the algorithm see Apprendix of
Roberts, McQuillan, Reece & Aigrain, 2013, MNRAS, 354, 3639.
History:
2011: Translated by Thomas Evans from origina... |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django_dynamic_fixture import get, new
from readthedocs.builds.constants import (
BRANCH,
LATEST,
STABLE,
TAG,
EXTERNAL,
)
from readthedocs.builds.models import Version
from readthedocs.projects.constants import REPO_TYPE_GIT, REPO_TYPE_... |
'''
This module gets the number of users who access each navigation tab. For each
course, you will have to get the event_type for each navigation tab and hardcode
them in the NAVIGATION_TABS dictionary below. The only exception, currently, is
courseware and discussion tabs because there are may event types that include... |
__author__ = 'treww'
import json
import MySQLdb as mysql
import http.client
import tornado.ioloop
import tornado.web
class _DatabaseRows:
_cursor = None
def __init__(self, cursor):
self._cursor = cursor
def __iter__(self):
return self
def __next__(self):
row = self._cursor... |
from typing import Optional # noqa
from typing import Union
from mitmproxy import exceptions
from mitmproxy.net import tls as net_tls
from mitmproxy.proxy.protocol import base
# taken from https://testssl.sh/openssl-rfc.mapping.html
CIPHER_ID_NAME_MAP = {
0x00: 'NULL-MD5',
0x01: 'NULL-MD5',
0x02: 'NULL-S... |
from django.conf import settings
# Number of messages to display per page.
MESSAGES_PER_PAGE = getattr(settings,'ROSETTA_MESSAGES_PER_PAGE',20)
# Enable Google translation suggestions
ENABLE_TRANSLATION_SUGGESTIONS = getattr(settings,'ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS',True)
# Displays this language beside the... |
import collections
import json as jsonlib
import os
import random
import re
from operator import attrgetter
from urlparse import urljoin
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.forms import CheckboxInput
from django.utils import translation
from django.utils.e... |
#------------------------------------------------------------------------------
# Reynolds-Blender | The Blender add-on for Reynolds, an OpenFoam toolbox.
#------------------------------------------------------------------------------
# Copyright|
#-----------------------------------------------------------------------... |
# #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
# Пример 3.15
Б.Я.Советов, Моделирование систем. Практикум: Учеб пособие для вузов/Б.Я. Советов, С.А. Яковлев.- 2-е изд., перераб. и доп.-М.:Высш. шк., 2003.-295 с.: ил.
Поток заявок поступает в накопитель с допустимой ёмкостью, равной 3 единицам, равномерно каждые 5+/... |
# -*- coding: utf-8 -*-
from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
class RehostTo(MultiHoster):
__name__ = "RehostTo"
__version__ = "0.41"
__type__ = "hook"
__config__ = [("activated", "bool", "Activated", "False")]
__description_... |
""" This file contains various utility functions that are useful but not core to SHAP.
"""
def clone_keras_layers(model, start_layer, stop_layer):
""" Clones the keras layers between the start and stop layer as a new model.
"""
import tensorflow as tf
if type(start_layer) is int:
... |
import logging
from unittest import TestCase
from unittest.mock import Mock, MagicMock
from tornado.httpserver import HTTPServer
from pcs.daemon import http_server
from pcs.test.tools.misc import create_setup_patch_mixin
from pcs.daemon.ssl import PcsdSSL
PORT = 1234
BIND_ADDRESSES = ["addr1", "addr2"]
def addr2sock... |
# Utility functions used for guest installation
#
import libvirt
from libvirt import VIR_DOMAIN_XML_SECURE
from network.IPy import IP
import re
import time
import libxml2
from datetime import datetime
import string
def get_xml_path(xml, path=None, func=None):
"""
Return the content from the passed xml xpath,... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... |
import torch
from torch.utils.data import Dataset
import json
import os
from PIL import Image
from utils import transform
class PascalVOCDataset(Dataset):
"""
A PyTorch Dataset class to be used in a PyTorch DataLoader to create batches.
"""
def __init__(self, data_folder, split, keep_difficult=False)... |
"""
Functions concerned with solving for decoders or full weight matrices.
Many of the solvers in this file can solve for decoders or weight matrices,
depending on whether the post-population encoders `E` are provided (see below).
Solvers that are only intended to solve for either decoders or weights can
remove the `E... |
"""Add separate MITS showcase scheduling column.
Revision ID: b574c0577253
Revises: 6c5cf22429e2
Create Date: 2018-09-26 19:29:40.149653
"""
# revision identifiers, used by Alembic.
revision = 'b574c0577253'
down_revision = '6c5cf22429e2'
branch_labels = None
depends_on = None
from alembic import op
import sqlalch... |
# © 2011 Sylvain Garancher <sylvain.garancher@syleam.fr>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import sys
import traceback
from odoo import models, api, fields, exceptions
from odoo import _
import logging
logger = logging.getLogger('stock_scanner')
class ScannerScenarioTransition(mod... |
# Copyright 2020, The TensorFlow Federated 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 applicable law o... |
from gnu_health_fhir.adapters import (
Patient,
Condition,
Procedure,
Practitioner,
Observation,
DiagnosticReport,
Immunization,
FamilyMemberHistory,
MedicationStatement,
Encounter,
ClinicalImpression,
Coverage,
)
from proteus import config, Model
import pytest
config = ... |
#!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# A TTS module using the espeak library.
# Copyright (C) 2012 Josiah Gordon <josiahg@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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
#
# ... |
# -*- coding: utf-8 -*-
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/convert/txt_input.ui'
#
# Created: Thu Jul 19 23:32:30 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_f... |
#!/usr/bin/env python
#
# This file is part of Flap.
#
# Flap 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.
#
# Flap is distributed ... |
import string
import sys
import argparse
import csv
import random
# import scipy
# import scipy.stats
# from scipy.stats import rv_discrete
from collections import defaultdict
# locations = ['chicago', 'dallas', 'denver', 'jacksonville', 'lasvegas', 'losangeles', 'miami', 'minneapolis', 'newyork', 'oklahomacity', 'pro... |
#!/usr/bin/env python
"""
tools for expression and count based tasks
"""
import os,sys,csv,gc,re
import numpy as np
def read_RSEM_counts_files(geneFilePath,isoformFilePath):
"""
read the RSEM counts files into a matrix
"""
if not os.path.exists(geneFilePath):
raise Exception("Cannot find ge... |
import os
from setuptools import find_packages
from setuptools import setup
version = '0.9.11'
install_requires = [
"cryptacular",
"zope.sqlalchemy",
"velruse>=1.0.3",
"pyramid>=1.5.1",
'pyramid_mako',
"pyramid_mailer",
"requests",
"wtforms",
"wtforms-recaptcha",
]
tests_require ... |
from ems.qt import QtWidgets, QtGui, QtCore
QSlider = QtWidgets.QSlider
pyqtSignal = QtCore.pyqtSignal
pyqtProperty = QtCore.pyqtProperty
pyqtSlot = QtCore.pyqtSlot
class OneOfAListSlider(QSlider):
listValueChanged = pyqtSignal(int)
valueListChanged = pyqtSignal(tuple)
def __init__(self, parent=None):... |
from contrib.rfc3315.constants import *
from contrib.rfc3633.dhcpv6_pd import DHCPv6PDHelper
from scapy.all import *
from veripy.assertions import *
class RenewMessageTestCase(DHCPv6PDHelper):
"""
Requesting Router Initiated: Renew Message
Verify that a device can properly interoperate while using DHCPv6... |
from direct.directnotify import DirectNotifyGlobal
from toontown.battle import BattlePlace
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.showbase import BulletinBoardWatcher
from pandac.PandaModules import *
from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAv... |
"""Manages dvc remotes that user can use with push/pull/status commands."""
import logging
from dvc.config import NoRemoteError
from dvc.remote import Remote
logger = logging.getLogger(__name__)
class DataCloud:
"""Class that manages dvc remotes.
Args:
repo (dvc.repo.Repo): repo instance that belo... |
# coding: utf8
from __future__ import print_function
import codecs
import json
import os
import pyprind
from stst import utils
from stst.data.sent_pair import SentPair
def load_data(train_file):
"""
Return list of dataset given train_file and gs_file
Value: [(sa:str, sb:str, score:float)]
"""
w... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a dialog to enter data for the Mercurial import command.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot, QDateTime
from PyQt5.QtWidgets import QDialog, QDialogButt... |
#!/usr/bin/env python
import urllib
import urllib2
import time
import getopt
import sys
import os
import timeit
import platform
import subprocess
import re
REFERENCE_URL = 'http://stash.osgconnect.net/+sthapa/100MB_ref'
WSGI_URL = 'http://web-dev.ci-connect.net/~sthapa/record_network_test.wsgi'
def download_file():
... |
#!/usr/bin/python3
import pandas as pd
from venus.stock_base import StockEventBase
class markov_stratagy(StockEventBase):
# def __init__(self, header):
# super(StockEventBase, markov_stratagy).__init__(header)
def run(self):
import matplotlib.pyplot as plt
stock_list = self.get_all_sto... |
#!/usr/bin/env python3
from tkinter import Tk, Frame, Label, Button, OptionMenu, StringVar, TOP, BOTH, N, E, S, W
from Crypt0 import *
from Strings import *
from Arithmetic import *
from Convert import *
from Other import *
import os
class MainController(Tk):
def __init__(self, *args, **kwargs):
Tk.__in... |
# Copyright (c) 2013 Florian Pelgrim <florian.pelgrim@craneworks.de>
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
# See the COPYRIGHT file for more information
import os
import time
import fnmatch
import sshoney.modules.config.defaults as get
A_NAME, \
A_TYPE, \
A_UID, \
A_GID, \
A_SIZE, \
... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... |
"""
Django settings for ncc4roma project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... |
#!/usr/bin/python -u
#
# generate python wrappers from the XML API description
#
functions = {}
lxc_functions = {}
qemu_functions = {}
enums = {} # { enumType: { enumConstant: enumValue } }
lxc_enums = {} # { enumType: { enumConstant: enumValue } }
qemu_enums = {} # { enumType: { enumConstant: enumValue } }
import os... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# 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 Licens... |
#!/usr/bin/python
import os
import sys
import pwd
import uuid
import struct
import socket
import logging
import base64
import urlparse
import time
import datetime
import json
import grp, pwd
import libauthn
from M2Crypto import EVP, EC, util
logger = logging.getLogger("libauthz")
def assert_authz(qstr, authn_cer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.