code stringlengths 1 199k |
|---|
import ui.gui
import gettext
if __name__ == '__main__':
gettext.install('ppam')
ui.gui.main() |
import sys
import os
from os.path import join
import re
import time
import shutil
import collections
stat_names = ['pct-lat', 'avg-lat', 'min-lat', 'max-lat', 'call-rate']
directions = ['MBps-read', 'MBps-written']
min_lat_infinity = 1.0e24
pbench_graphs = True
if os.getenv('SKIP_PBENCH_GRAPHING'): pbench_graphs = Fals... |
my_list = ['Pizza', 'index_1', 'index_2', 'index_3', 'index_4', 'index_5',
'1', '2', '3', 'Bannana']
squares = [1, 4, 9, 16]
print('a: ' + str(my_list))
for element in my_list:
print(element)
sum = 0
for num in squares:
sum += num # same es sum = sum + num
print('sum: ' + str(sum))
if 'Pizza' in... |
from __future__ import division
from sys import argv,exit,stderr
from subprocess import Popen,PIPE
from random import choice
from re import search
def intron_length(region1,region2,pos1,pos2):
c1,st1_sp1,sd1 = region1.split(':')
c2,st2_sp2,sd2 = region2.split(':')
st1,sp1 = map(int,st1_sp1.split('-'))
st2,sp2 = map... |
"""
* Copyright (C) 2010-2014 Loïc BLOT, CNRS <http://www.unix-experience.fr/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later ... |
import sys
try:
import os
import socket
import threading
except ImportError as err:
print("[!] Something has gone wrong while trying to import necessary libraries.")
print("[!]", err)
sys.exit(1)
except Exception as e:
print("[!] An unexpected error has occured.")
print("[!]", e)
sys.exit(1)
RECV_MAX = 4096
BI... |
import contextlib
from typing import Any, Callable, Iterator, Optional, Union
import astroid
from astroid import nodes
from astroid.manager import AstroidManager
from astroid.nodes.node_classes import AssignAttr, Name
from pylint.checkers import stdlib
from pylint.testutils import CheckerTestCase
@contextlib.contextman... |
"""Basic core types and utilities."""
import os
import time
import functools
import pathlib
import dataclasses
from collections import namedtuple
from typing import Optional
from . import LOCAL_FS_ENCODING
from .utils.log import getLogger
log = getLogger(__name__)
AUDIO_NONE = 0
AUDIO_MP3 = 1
AUDIO_TYPES = (AUDIO_NONE,... |
from PyQt4 import QtDesigner
from camelot.view.plugins import CamelotEditorPlugin
class DateEditorPlugin(QtDesigner.QPyDesignerCustomWidgetPlugin, CamelotEditorPlugin):
def __init__(self, parent = None):
QtDesigner.QPyDesignerCustomWidgetPlugin.__init__(self)
from camelot.view.controls.editors impor... |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import sys, os, httplib, json, tempfile, urllib
from Utils import *
from resources import *
from numericmarkers import *
from ImageDialog import *
class Elevation:
def __init__(self, iface):
# Save reference to the QGIS interface
self.ifa... |
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 M2M table for field maintainers on 'Herd'
db.create_table('djeuscan_herd_maintainers', (
('id', models.AutoField(v... |
from django.contrib import admin
from django.db.models import Count
from models import EbuildModel, PackageModel, LicenseModel, CategoryModel, \
UseFlagModel, RepositoryModel, HomepageModel, MaintainerModel, \
Keyword, ArchesModel, UseFlagDescriptionModel, HerdsModel, \
... |
GRID_SIZE = (160, 120)
GRID_SQUARE_SIZE = (4, 4)
ant_image_filename = "ant.png"
ITERATIONS = 10
import pygame
from pygame.locals import *
class AntGrid(object):
def __init__(self, width, height):
self.width = width
self.height = height
self.clear()
def clear(self):
self.rows = []... |
"""
***************************************************************************
ProcessingToolbox.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************************************... |
"""
test_broot
----------------------------------
Tests for `broot` module.
"""
import unittest
from broot import broot
class TestBroot(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
if __name__ == '__main__':
unittest.main() |
"""
Class for IQ Data
GNU Radio simple binary format reader
Xaratustrah Aug-2018
"""
import numpy as np
import time
import os
from iqtools.iqbase import IQBase
class GRData(IQBase):
def __init__(self, filename, fs, center=0, date_time=""):
super().__init__(filename)
# Additional fields in this subcl... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Software',
fields=[
('ID', models.CharField(max_length=50, serialize=False, ... |
from pyqtgraph import functions as fn
from lib.flowchart.nodes.generalNode import NodeWithCtrlWidget, NodeCtrlWidget
class pipeNode(NodeWithCtrlWidget):
"""Transmits the data further without processing"""
nodeName = "Pipe"
uiTemplate = [
{'title': 'Close Pipe', 'name': 'closed', 'type': 'bool', ... |
from __future__ import absolute_import
import ctypes
import getpass
import os
import sys
from bindings import tracing
from edenscm.mercurial import blackbox, encoding, json, progress, pycompat, util
from edenscm.mercurial.node import hex
from .. import pywatchman
from ..pywatchman import compat
def createclientforrepo(... |
"""The application toolbar, and its specialised widgets"""
from __future__ import division, print_function
import os
from gettext import gettext as _
from lib.gibindings import Gtk
from . import widgets
FRAMEWORK_XML = 'toolbar.xml'
MERGEABLE_XML = [
("toolbar1_file", 'toolbar-file.xml', _("File handling")),
("... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('releng', '0001_squashed_0005_auto_20180616_0947'),
]
operations = [
migrations.AlterField(
model_name='release',
name='last_modified',
field=models.DateTimeF... |
import paho.mqtt.client as mqtt
MQTT_SERVER = "iot.eclipse.org"
MQTT_PORT = 1883
MQTT_NAME_TOPIC = "spooplights"
MQTT_HEX_TOPIC = MQTT_NAME_TOPIC + "RGB"
def on_connect(client, userdata, rc):
print("Connected with result code "+str(rc))
client.subscribe(MQTT_NAME_TOPIC)
client.subscribe(MQTT_HEX_TOPIC)
def ... |
'''
Python mapping for the InputMethodKit framework.
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import sys
import objc
import Foundation
from InputMethodKit import _metadata
from InputMethodKit._InputMethodKit impo... |
import os
import re
from MenuList import MenuList
from Components.Harddisk import harddiskmanager
from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename, fileExists, pathExists
from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, \
eServiceReference, eServiceCenter, gFont, getDesktop
from Tools.Loa... |
import os
import ycm_core
flags = [
'-Wall',
'-Wextra',
'-std=c99',
'-x',
'c',
'-DVGO_linux',
'-DVGA_amd64',
'-isystem',
'../BoostParts',
'-isystem',
'/System/Library/Frameworks/Python.framework/Headers',
'-isystem',
'../llvm/include',
'-isystem',
'../llvm/tools/clang/include',
'-I','.',
'-I','..',
'-I','../include',
'... |
import random as rand
import rts_rm as rm
import rts_edf as edf
def rts_gen_task_set(n, U):
"""
Use the unifast algo to generate the task set given the total
number of tasks and total utilization
"""
task_set = [] # The task set will be populated by the function
time_period_min = 2
time_pe... |
from Components.MenuList import MenuList
from Components.Label import Label
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Pixmap import Pixmap
from Components.FileList import FileList
from Screens.ChoiceBox import ChoiceBox
f... |
from django.dispatch import Signal, receiver
from misago.core import serializer
from misago.core.signals import secret_key_changed
from misago.users.signals import username_changed
from .models import Category, CategoryRole
delete_category_content = Signal()
move_category_content = Signal(providing_args=["new_category"... |
register_rulegroup("activechecks",
_("Active checks (HTTP, TCP, etc.)"),
_("Configure active networking checks like HTTP and TCP"))
group = "activechecks"
register_rule(group,
"active_checks:dns",
Tuple(
title = _("Check DNS service"),
help = _("Check optain an IP address for a host or d... |
import sys
print "Argumento 0: "+sys.argv[0]
print "Argumento 1: "+sys.argv[1] |
""" This module contains all context menus needed to be displayed in different sections. Basically any menu that is bigger than 2 menu items should be here."""
from __future__ import unicode_literals
import wx
class postMenu(wx.Menu):
""" Display a menu with actions related to posts in the news feed or walls. """
... |
"""
@summary: Module containing information about providers
@author: CJ Grady
@version: 1.0
@status: alpha
@license: gpl2
@copyright: Copyright (C) 2014, University of Kansas Center for Research
Lifemapper Project, lifemapper [at] ku [dot] edu,
Biodiversity Institute,
1345 Jayhawk Boulevar... |
"""
Copyright (C) 2008 Krzysztof Kosyl <krzysztof.kosyl@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program... |
from django.db import models
from django.utils.translation import gettext_lazy as _
from japos.discounts.models import Discount
class Group(models.Model):
sku = models.CharField(max_length = 15, unique = True, null = True, verbose_name = _("SKU"))
name = models.CharField(max_length = 45, null = True, unique = T... |
from kivy.core.window import Window
from kivy.animation import Animation
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.label import Label
from kivy.graphics ... |
'''
Covenant Add-on
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 h... |
"""
This module provides access to the Unix shadow password database.
It is available on various Unix versions.
Shadow password database entries are reported as 9-tuples of type struct_spwd,
containing the following items from the password database (see `<shadow.h>'):
sp_namp, sp_pwdp, sp_lstchg, sp_min, sp_max, sp_war... |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
from filebrowser.sites import site
from related.api.resources import RelatedResource
from related.api.resources import PostsResource
related_resource = RelatedResource()
posts_resource = PostsResource()... |
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from datetime import datetime, timedelta
from traceback import format_tb
import logging
import sys
from lib.pytz import utc
from lib.six import six
from lib.apscheduler.events import JobExecutionEvent, EVENT_JOB_MISSED, EVENT_JOB_ERROR, EVENT_J... |
""" Todo - Docstring
""" |
"""Base class for directed graphs."""
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph
from networkx.exception import NetworkXError
import networkx.convert as convert
__author__ = """\n""".join(['Aric Hagberg (hagberg@lanl.gov)',
'Pieter Swart (swart@l... |
from pytest import XFAIL
from wxgeometrie.geolib import Point, Fonction, Interpolation_polynomiale_par_morceaux, \
Glisseur_courbe, Interpolation_lineaire, Courbe
def test_Courbe():
f = Fonction('1/(x+3)')
c1 = Courbe(f)
assert isinstance(c1, Courbe)
A = Point(0, 0)
B... |
"""QGIS Unit tests for QgsActionManager.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author__ = 'Nyall Dawso... |
__all__ = ["_", "N_"]
import gettext
_ = lambda x: gettext.ldgettext("kdump-anaconda-addon", x)
N_ = lambda x: x |
import sys
import os
import seq
import math
import networkx as nx
from clint.textui import colored
from shutil import copyfile,move
import platform
plat = platform.platform()
from logger import Logger
from conf import tempname
from conf import dosamp
from conf import nthread
from conf import length_limit,evalue_limit,p... |
"""Check format
"""
__revision__ = ''
notpreceded= 1
notfollowed =1
notfollowed <=1
correct = 1
correct >= 1
def func(arg, arg2):
"""test named argument
"""
func(arg=arg+1,
arg2=arg2-arg)
aaaa,bbbb = 1,2
aaaa |= bbbb
aaaa &= bbbb
if aaaa: pass
else:
aaaa,bbbb = 1,2
aaaa,bbbb = bbbb,aaaa
bbb... |
import urllib
import re
import requests
import json
from bs4 import BeautifulSoup
class LeaderSkill(object):
_name = ""
_desc = ""
_subDesc = ""
_monsterList = []
_monsterNum = 0
def __init__(self, _name = "", _desc = "", _subDesc = "", _monsterList = [], _monsterNum = 0):
self._name = _name
self._desc = _des... |
import os
os.system('ffmpeg -f lavfi -i color=red -frames:v 16 -r 24 red_24.mp4')
os.system('ffmpeg -f lavfi -i color=red -frames:v 16 -r 30 red_30.mp4') |
from django.test import TestCase
from .models import Route
class RouteModelTestCase(TestCase):
def create_objects(self, objects):
"""
Creates list of dict()s as Route objects
Assumes Route.order as Route.pk
"""
for route in objects:
route['order'] = route['pk']
... |
__author__ = "Martin Blais <blais@furius.ca>"
import unittest
from beancount.core import flags
class TestFlags(unittest.TestCase):
ALLOW_NOT_UNIQUE = {'FLAG_IMPORT'}
def test_unique_flags(self):
names = set()
values = set()
for name, value in flags.__dict__.items():
# pylint:... |
from askapdev.rbuild.builders import Setuptools as Builder
builder = Builder()
builder.remote_archive = "APLpy-0.9.5.tar.gz"
builder.build() |
"""
@org: GAE-CMS.COM
@description: Python-based CMS designed for Google App Engine
@(c): gae-cms.com 2012
@author: Imran Somji
@license: GNU GPL v2
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; eit... |
'''
Generate a random number between 1 and 9 (including 1 and 9).
Ask the user to guess the number, then tell them whether they guessed too low, too high, or exactly right. (Hint: remember to use the user input lessons from the very first exercise)
Extras:
Keep the game going until the user types "exit"
Keep tr... |
"""Burnin program
"""
import sys
import optparse
import time
import socket
import urllib
from itertools import izip, islice, cycle
from cStringIO import StringIO
from ganeti import opcodes
from ganeti import constants
from ganeti import cli
from ganeti import errors
from ganeti import utils
from ganeti import hyperviso... |
"""Test connection to weather station.
This is a simple utility to test communication with the weather
station. If this doesn't work, then there's a problem that needs to be
sorted out before trying any of the other programs. Likely problems
include not properly installing `libusb
<http://libusb.wiki.sourceforge.net/>`... |
import subprocess
import hashlib, os, re
import datetime
import licensesapi
from xml.dom.minidom import parseString
CACHING = False
TIMESTAMP = re.compile("Date:\s+([0-9]+)\s")
def get(cmd, cacheable=True):
if cacheable and CACHING:
h = hashlib.md5(cmd).hexdigest()
if h in os.listdir('licenses/cache... |
import pygame
import daemon
import time
import pynotify
import os
import argparse
def main():
parser = argparse.ArgumentParser(description='JoyVol: control audio (or anything else really) based on joystick buttons')
parser.add_argument('--js', dest='joystick_id', action='store_const',
co... |
import os,sys
if not os.environ.has_key('AUTOOAM_HOME'):
os.environ['AUTOOAM_HOME'] = os.getcwd()
import autooam.testlib.vagboxes as vagboxes
import emtools.common.logutils as logutils
Log = logutils.getLogger(__name__)
def list_boxes():
boxes = []
h = os.popen('vagrant box list')
for line in h.readline... |
from django.apps import apps
from django.test import TestCase
from misago.core import threadstore
from .. import migrationutils
from ..models import SettingsGroup
class DBConfMigrationUtilsTests(TestCase):
def setUp(self):
self.test_group = {
'key': 'test_group',
'name': "Test settin... |
import MFI_Getter
import pandas as pd
import timeit
start = timeit.default_timer()
symbolfile = open("symbols.txt")
symbolslistR = symbolfile.read()
symbolslist = symbolslistR.split('\n')
dfF = MFI_Getter.getMFI('KING')
for s in symbolslist:
try:
df = MFI_Getter.getMFI(s)
dfF = dfF.append(df)
ex... |
"""
WSGI config for opcon project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "opcon.settings")
from django.core.wsgi impo... |
from django.db import models
from cardndice.games.models import Game
from cardndice.players.models import Player
class Match(models.Model):
game = models.ForeignKey(Game, core=True)
def __str__(self):
return self.game.name
class Meta:
ordering = ["id"]
class Admin:
pass
class Res... |
import math
from colorsys import *
from animations.AbstractAnimation import AbstractAnimation
from animations.inputs.AudioInput import AudioInput
SIN_CHANGE_PER_TIME = 0.5
SIN_CHANGE_PER_PX = 3.0
SIN_SIZE_PER_STRIP = 20.0
EVENT_THRESHOLD = 1.5
EVENT_BRIGHTNESS = 1.33
class AudioRainbow(AbstractAnimation):
def __... |
import sys
import os
import shutil
sys.path.append( '../pymod' )
sys.path.append( '../gcore' )
from osgeo import gdal
import gdaltest
import test_cli_utilities
import tiff_ovr
def test_gdaladdo_1():
if test_cli_utilities.get_gdaladdo_path() is None:
return 'skip'
shutil.copy('../gcore/data/mfloat32.vrt'... |
import sys
import os
import os.path
from .sixext import PY3
from .sixext.moves import configparser
import locale
import pwd
import stat
import re
from .codes import *
from . import logger
from . import os_utils
from .sixext import to_unicode
if PY3:
QString = type("")
def cmp(a, b):
return (a > b) - (a ... |
def incOrSet(dicName,keyName,incBy,initVal):
if keyName in dicName:
dicName[keyName]+=incBy
else:
dicName[keyName]=initVal |
"""
Slovenian-specific definitions of relationships
"""
from gramps.gen.lib import Person
import gramps.gen.relationship
_ancestors = [ u"", u"starš", u"stari starš", u"prastari starš" ]
_fathers = [ u"", u"oče", u"ded", u"praded", u"prapraded" ]
_mothers = [ u"", u"mati", u"babica", u"prababica", u"praprababica" ]
_de... |
import json
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
import traceback
import subprocess
import os
from itertools import groupby
from motion_app.process import get_motion_config
from motion_app.models import EventFile
from bson import... |
"""Common initialization core for woo.
This file is executed when anything is imported from woo for the first time.
It loads woo plugins and injects c++ class constructors to the __builtins__
(that might change in the future, though) namespace, making them available
everywhere.
"""
from wooMain import options as wooOpt... |
import os
import numpy as np
import matplotlib.pyplot as plt
import pylibconfig2
from ergoPack import ergoPlot
configFile = '../cfg/transferCZ.cfg'
cfg = pylibconfig2.Config()
cfg.read_file(configFile)
fileFormat = cfg.general.fileFormat
second_to_year = 1 / (60 * 60 * 24 * 365)
time_dim = cfg.units.L / cfg.units.c0 * ... |
"""`main` is the top level module for the Flask application."""
import json
from experiment_datastore_google import AdminDatastore, ClientDatastore, IteratedClientDatastore
from custom_exceptions import DuplicateEntryError, ResourceError, DataFormatError
cfg_file = open('server.cfg')
cfg = json.load(cfg_file)
cfg_file.... |
'''Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License... |
import pytest
import sys
import os
DOSSIER_COURANT = os.path.dirname(os.path.abspath(__file__))
DOSSIER_PARENT = os.path.dirname(DOSSIER_COURANT)
sys.path.append(DOSSIER_PARENT)
from vespa.ho import HO
from vespa.ho_ph import HO_PH
@pytest.fixture(scope='module')
def ho_ph_instance():
v = HO_PH('testnode', "127.0.0... |
"""
WSGI config for buttsworth project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
buttsworth : a django chatterbot for David Buttsworth
Copyright (C) 2015 Gregory Martin
@yro 12.2015
... |
from pandas import DataFrame, read_csv
from sklearn import linear_model
from math import exp
data = read_csv('Illumina_normalized_scaled.txt', header = 0, index_col = 0, sep = '\t')
data = data.T
oligos = ['ILMN_2154115', 'ILMN_1755115', 'ILMN_1661537', 'ILMN_1711516', 'ILMN_1767281', 'ILMN_1779813', 'ILMN_1699100', 'I... |
"""
.. inheritance-diagram:: pyopus.parallel.base
:parts: 1
**Base classes for virtual machines (PyOPUS subsystem name: VM)**
A **spawner task** is a task that can spawn new tasks on hosts in the virtual
machine. All other tasks are **worker tasks**.
**Mirroring and local storage**
Often tasks in the virtual machin... |
from base import BaseParser
from libs.torrent import Torrent
from defusedxml import lxml
from lxml import html
from StringIO import StringIO
import datetime
import requests
class Parser(BaseParser):
"""Parser for HDCity torrent list"""
def __init__(self, config=None, logger=None, name=""):
super(Parser,... |
import getopt, datetime, os, subprocess, sys
os.chdir('../')
def main(argv):
try:
opts, args = getopt.getopt(argv, "m:", ["message="])
except getopt.GetoptError:
sys.exit(2)
for opt, arg in opts:
if opt in ("-m", "--message"):
message = arg
major_v = 0
minor_v = 2... |
"""
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 hope that it will be useful,
but WITHOUT ... |
__author__ = 'davide'
import numpy as np
from numpy.lib.stride_tricks import as_strided
def _sum_sq_diff(input_image, template, valid_mask):
"""This function performs template matching. The metric used is Sum of
Squared Difference (SSD). The input taken is the template who's match is
to be found in image.
... |
'''
setup board.h for chibios
'''
import argparse, sys, fnmatch, os, dma_resolver, shlex, pickle, re
import shutil
parser = argparse.ArgumentParser("chibios_pins.py")
parser.add_argument(
'-D', '--outdir', type=str, default=None, help='Output directory')
parser.add_argument(
'--bootloader', action='store_true',... |
'''
Name of the Task : Messy Folder
KIITFEST ID : KF36723
Operating System : MacOS Sierra
Programming Language used: Python
External modules used (if any) : os,sys
Additional instructions to use the program (if any) : The files to be organized must exist in current working directory.
'''
import os
import sys
path1 = os... |
import sys, os
extensions = ['sphinx.ext.pngmath', 'sphinx.ext.ifconfig']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Ginkgo'
copyright = u'2010, Jeet Sukumaran and Mark T. Holder'
version = '3.9'
release = '3.9.0'
exclude_trees = []
pygments_style = 'sphinx'
html_theme = 'de... |
"""twistd plugin for XMPP net."""
"""
Kontalk XMPP server
Copyright (C) 2014 Kontalk Devteam <devteam@kontalk.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the Licens... |
import abc
import datetime
import re
from itertools import zip_longest
from .utils import (DoesntMatchException, EMPTY_CELL, ConfigurationError,
instantiate_if_class_lst)
class ResultContext(object):
'''An object that is passed through match methods to store the
result. Implement emit in a c... |
from .main.main import main
main() |
"""
Created on Sun Aug 14 14:53:28 2016
@author: Luciano Masullo, Federico Barabas
"""
import os
import numpy as np
import math
import configparser
from scipy.ndimage.measurements import center_of_mass
from skimage.feature import peak_local_max
try:
import skimage.filters as filters
except ImportError:
import s... |
# Lemiere Yves
# Juillet 2017
import matplotlib.pyplot as plt
import random
def bunch_of_random_real(param_min,param_max,number_of_sample):
tmp_list = []
for i in range(number_of_sample):
tmp_list.append(random.uniform(param_min,param_max))
return tmp_list
def bunch_of_gauss_random(param_mu,param_... |
from __future__ import unicode_literals
import locale
import logging
import requests
from photini.configstore import key_store
from photini.photinimap import GeocoderBase, PhotiniMap
from photini.pyqt import Busy, catch_all, Qt, QtCore, QtWidgets, scale_font
logger = logging.getLogger(__name__)
translate = QtCore.QCore... |
from phystricks import *
def PVRFoobvAzpZTq():
pspict,fig = SinglePicture("PVRFoobvAzpZTq")
pspict.dilatation(0.5)
D=Point(0,0)
E=Point(8,0)
c1=Circle(D,12)
c2=Circle(E,6)
F=Intersection(c1,c2)[1]
triangle=Polygon(D,E,F)
S=triangle.edges[2].midpoint()
T=triangle.edges[1].midpoint... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, nowdate, get_url
from erpnext.accounts.party import get_party_account, get_party_bank_account
from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.... |
import unittest as ut
import unittest_decorators as utx
import espressomd
import numpy as np
@utx.skipIfMissingFeatures("ROTATION")
class Rotation(ut.TestCase):
s = espressomd.System(box_l=[1.0, 1.0, 1.0])
s.cell_system.skin = 0
s.time_step = 0.01
def test_langevin(self):
"""Applies langevin the... |
"""Functions for editing general objects in seeddb.
(Not netboxes and services).
"""
import logging
from socket import gethostbyaddr, gethostbyname, error as SocketError
from IPy import IP
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.db.models ... |
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.core.serializers.json
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('materia', '0072_auto_20200427_1021'),
]
operations = [
migrations.AddFiel... |
from pyspace.planet import PlanetArray
from pyspace.simulator import BarnesSimulator
import numpy
x, y, z = numpy.mgrid[0:500:5j, 0:500:5j, 0:500:5j]
x = x.ravel(); y = y.ravel(); z = z.ravel()
pa = PlanetArray(x, y, z)
sim =BarnesSimulator(pa, 1, 1, 0, sim_name = "square_grid")
sim.simulate(1000, dump_output = True) |
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.db.models import Sum
from django.utils import timezone
from django.db import models
class Category(models.Model):
title = models.CharField(max_length=55, default="Unknown")
level = models.IntegerField(default=0)
... |
import numpy.testing as npt
import numpy as np
from pyhdf.SD import SD, SDC
from utilities import learning_data as ld
class Test:
def test_get_unique_variable_prefixes(self):
variable_names = ['penguin0', 'penguin1']
npt.assert_array_equal(ld.get_unique_variable_prefixes(variable_names), ['penguin']... |
import random
from logs import *
class Card(object):
"""Creates the card objects used in game"""
def __init__(self, name, attack, money, cost, name_padding=15, num_padding=2):
self.name = name
self.cost = cost
self.attack = attack
self.money = money
self.name_padding = na... |
from pyramid.request import Request
from pyramid.interfaces import IRequestExtensions
from pytest import fixture, mark
import pylf.icons
MIMETYPES = [
("text", "plain", "text-plain.png"),
("image", "jpeg", "image-jpeg.png"),
("inode", "directory", "inode-directory.png"),
("audio", "x-generic", "audio-x-... |
from base import Encoder
import datetime
from scalar import ScalarEncoder
import numpy
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
class DateEncoder(Encoder):
"""A date encoder encodes a date according to encoding parameters
specified in its constructor.
The input to a date encoder is a datetime.dateti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.