code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
import datetime, re from mod_helper import * debug = True def sesamstrasseShow(): mediaList = ObjectContainer(no_cache=True) if debug == True: Log("Running sesamstrasseShow()...") try: urlMain = "http://www.sesamstrasse.de" content = getURL(urlMain+"/home/homepage1077.html") spl = content.split('<div class=...
realriot/KinderThek.bundle
Contents/Code/mod_sesamstrasse.py
Python
bsd-3-clause
3,151
from code import InteractiveConsole import sys try: import websocket except: print('Please install websocket_client') raise class InteractiveRemoteConsole(InteractiveConsole): def __init__(self, uri=None): if uri is None: uri = 'ws://localhost:44445/' InteractiveConsole.__i...
Macuyiko/jycraft-legacy
remote-client.py
Python
bsd-3-clause
2,707
#--------------------------------- #Joseph Boyd - joseph.boyd@epfl.ch #--------------------------------- from bs4 import BeautifulSoup from urllib2 import urlopen import csv BASE_URL = 'http://www.tutiempo.net' PAGE_1 = '/en/Climate/India/IN.html' PAGE_2 = '/en/Climate/India/IN_2.html' headings = ['Location', 'Year',...
FAB4D/humanitas
data_collection/ts/climate/get_climate_data.py
Python
bsd-3-clause
3,498
import csv, datetime from cStringIO import StringIO # this must match formdata.db_worker_settings : FIELDDIR_LOCATION # the variable is set by the formdata/management/commands/generate_field_name_list.py # the assumption here is that this is being executed from this directory from field_reference import fields # need...
sunlightlabs/read_FEC
fecreader/formdata/utils/write_csv_to_db.py
Python
bsd-3-clause
3,882
# -*- coding: utf-8 -*- # Copyright (c) 2013, Roboterclub Aachen e.V. # All rights reserved. # # The file is part of the xpcc library and is released under the 3-clause BSD # license. See the file `LICENSE` for the full license governing this code. # ---------------------------------------------------------------------...
dergraaf/xpcc
tools/device_file_generator/dfg/merger.py
Python
bsd-3-clause
14,982
__author__ = "Martin Jakomin, Mateja Rojko" """ Classes for boolean operators: - Var - Neg - Or - And - Const Functions: - nnf - simplify - cnf - solve - simplify_cnf """ import itertools # functions def nnf(f): """ Returns negation normal form """ return f.nnf() def simplify(f): """ Simplifies th...
MartinGHub/lvr-sat
SAT/bool.py
Python
bsd-3-clause
6,053
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 7, transform = "Anscombe", sigma = 0.0, exog_count = 100, ar_order = 12);
antoinecarme/pyaf
tests/artificial/transf_Anscombe/trend_ConstantTrend/cycle_7/ar_12/test_artificial_32_Anscombe_ConstantTrend_7_12_100.py
Python
bsd-3-clause
268
from __future__ import annotations import pytest import scitbx.matrix from cctbx import crystal, sgtbx, uctbx from cctbx.sgtbx import bravais_types from dxtbx.model import Crystal from dials.algorithms.indexing import symmetry @pytest.mark.parametrize("space_group_symbol", bravais_types.acentric) def test_Symmetry...
dials/dials
tests/algorithms/indexing/test_symmetry.py
Python
bsd-3-clause
7,130
""" Tests for the following offsets: - BQuarterBegin - BQuarterEnd """ from __future__ import annotations from datetime import datetime import pytest from pandas._libs.tslibs.offsets import QuarterOffset from pandas.tests.tseries.offsets.common import ( Base, assert_is_on_offset, assert_offset_equal, ) ...
pandas-dev/pandas
pandas/tests/tseries/offsets/test_business_quarter.py
Python
bsd-3-clause
12,465
#!/usr/bin/env python # Copyright (c) 2013 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Library for manipulating naclports packages in python. This library can be used to build tools for working with naclports p...
adlr/naclports
build_tools/naclports.py
Python
bsd-3-clause
7,198
# -*- coding: utf-8 -*- from precious import db from datetime import datetime class Build(db.Model): __tablename__ = 'builds' id = db.Column(db.Integer, primary_key=True, unique=True) project_id = db.Column(db.Integer, db.ForeignKey('projects.id')) date = db.Column(db.DateTime) revision = db.Col...
bzyx/precious
precious/models/Build.py
Python
bsd-3-clause
763
""" Needed Tests clip_to_rect() tests -------------------- DONE *. clip_to_rect is inclusive on lower end and exclusive on upper end. DONE *. clip_to_rect behaves intelligently under scaled ctm. DONE *. clip_to_rect intersects input rect with the existing clipping rect. DONE *. ...
tommy-u/enable
kiva/agg/tests/clip_to_rect_test_case.py
Python
bsd-3-clause
12,045
"""Testing for overlap intervals """ import unittest from genda.transcripts.exon_utils import calcOverlap, collideIntervals, \ collapseIntervals class TestOverlapFunctions(unittest.TestCase): def setUp(self): # Simple Overlap self.simple = [(1,10), (6,15)] # One interval enclosed ...
jeffhsu3/genda
tests/exon_utils_tests.py
Python
bsd-3-clause
1,802
#!/usr/bin/env python # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """//testing/scripts wrapper for the network traffic annotation auditor checks. This script is used to run traffic_annotation_auditor_t...
endlessm/chromium-browser
testing/scripts/test_traffic_annotation_auditor.py
Python
bsd-3-clause
2,554
# -*-coding:Utf-8 -* # Copyright (c) 2010 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 # lis...
stormi/tsunami
src/primaires/interpreteur/masque/noeuds/base_noeud.py
Python
bsd-3-clause
2,736
from math import isclose import numpy as np from pytest import fixture from hoomd.box import Box @fixture def box_dict(): return dict(Lx=1, Ly=2, Lz=3, xy=1, xz=2, yz=3) def test_base_constructor(box_dict): box = Box(**box_dict) for key in box_dict: assert getattr(box, key) == box_dict[key] @...
joaander/hoomd-blue
hoomd/pytest/test_box.py
Python
bsd-3-clause
5,889
""" This module provides the Koalix CRM core functionality """
tfroehlich82/koalixcrm
crm_core/__init__.py
Python
bsd-3-clause
64
# Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from jenkinsflow.flow import serial from .framework import api_select prefixed_jobs = """ serial flow: [ job: 'top_quick1' serial flow: [ job: 'top_x_quick2-1' ] ...
lechat/jenkinsflow
test/prefix_test.py
Python
bsd-3-clause
1,965
# -*- coding: utf-8 -*- from django import template from django_users.forms import CreateUserForm #from django.utils.translation import ugettext as _ register = template.Library() @register.inclusion_tag('users/templatetags/registration.html', takes_context = True) def registration_form(context, form=None, *args, **k...
AdrianRibao/django-users
django_users/templatetags/users.py
Python
bsd-3-clause
422
from hiveplotter import HivePlot from networkx import nx import random from unittest import TestCase SEED = 1 NTYPES = ['A', 'B', 'C'] class SimpleCase(TestCase): def make_graph(self): G = nx.fast_gnp_random_graph(30, 0.2, seed=SEED) for node, data in G.nodes_iter(data=True): data[...
clbarnes/hiveplotter
test/simple_tests.py
Python
bsd-3-clause
882
#!/usr/bin/env python import argparse import sys import re import settings import psycopg2 import imp ######################################################################################## class UpdSource(): def __init__(self,in_source,last_update): self.upd_dict=dict() self.source=in_source self.src_handl...
movsesyan1970/pg_repo
db_update.py
Python
bsd-3-clause
5,556
from streamable_archive_tests import * from delivery_collection_tests import *
vegarang/devilry-django
devilry/utils/tests/__init__.py
Python
bsd-3-clause
81
""" This module contains dsolve() and different helper functions that it uses. dsolve() solves ordinary differential equations. See the docstring on the various functions for their uses. Note that partial differential equations support is in pde.py. Note that ode_hint() functions have docstrings describing their vari...
flacjacket/sympy
sympy/solvers/ode.py
Python
bsd-3-clause
125,328
#!/usr/bin/env python ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] tags will be kept. ...
team-vigir/vigir_behaviors
behaviors/vigir_behavior_simple_joint_control_test/src/vigir_behavior_simple_joint_control_test/simple_joint_control_test_sm.py
Python
bsd-3-clause
26,416
import pytest from httpie import ExitStatus from httpie.output.formatters.colors import get_lexer from utils import TestEnvironment, http, HTTP_OK, COLOR, CRLF class TestVerboseFlag: def test_verbose(self, httpbin): r = http('--verbose', 'GET', httpbin.url + '/get', 'test-header:__test__...
Irdroid/httpie
tests/test_output.py
Python
bsd-3-clause
4,467
from django.views.generic import ListView, TemplateView class IndexView(TemplateView): template_name = 'index.html'
fiee/fiee-temporale
demo/views.py
Python
bsd-3-clause
121
########################################################################## # # Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), # its affiliates and/or its licensors. # # Copyright (c) 2010-2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary ...
davidsminor/cortex
python/IECoreHoudini/__init__.py
Python
bsd-3-clause
2,596
import numpy as np import warnings from scipy._lib._util import check_random_state def rvs_ratio_uniforms(pdf, umax, vmin, vmax, size=1, c=0, random_state=None): """ Generate random samples from a probability density function using the ratio-of-uniforms method. Parameters ---------- pdf : cal...
aeklant/scipy
scipy/stats/_rvs_sampling.py
Python
bsd-3-clause
7,080
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-12 07:13 from __future__ import unicode_literals from django.db import migrations import wagtail.core.fields class Migration(migrations.Migration): dependencies = [ ('home', '0004_auto_20160511_0845'), ] operations = [ migra...
evonove/evonove.it
django-website/home/migrations/0005_auto_20160512_0713.py
Python
bsd-3-clause
518
""" Contains base level parents that aren't to be used directly. """ from twisted.internet.defer import inlineCallbacks, returnValue from fuzzywuzzy.process import QRatio from fuzzywuzzy import utils as fuzz_utils from src.daemons.server.ansi import ANSI_HILITE, ANSI_NORMAL from src.daemons.server.objects.exceptions ...
gtaylor/dott
src/game/parents/base_objects/base.py
Python
bsd-3-clause
25,944
# -*- coding: utf-8 -*- # # Copyright (c) 2009 Arthur Furlan <arthur.furlan@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) an...
Kazade/NeHe-Website
public/post_to_twitter.py
Python
bsd-3-clause
2,865
# -*- coding: utf-8 -*- # # hrCMS documentation build configuration file, created by # sphinx-quickstart on Sat Mar 28 20:11:13 2015. # # 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. # # All...
michaelkuty/leonardo-api
docs/source/conf.py
Python
bsd-3-clause
9,452
#!/usr/bin/env python # # Copyright (c) 2018, The OpenThread Authors. # 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 copyright # ...
turon/openthread
tests/toranj/test-011-child-table.py
Python
bsd-3-clause
3,917
from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('', url('^$', 'actionkit_raplet.views.raplet', name='raplet'), )
350dotorg/aktlet
actionkit_raplet/urls.py
Python
bsd-3-clause
170
import datetime import commonware.log import django_tables as tables import jinja2 from django.conf import settings from django.template import Context, loader from django.utils.datastructures import SortedDict from jingo import register from tower import ugettext as _, ugettext_lazy as _lazy, ungettext as ngettext i...
anaran/olympia
apps/editors/helpers.py
Python
bsd-3-clause
31,475
''' Created on May 9, 2014 @author: Jennifer Reiber Kyle ''' from kaggle import Submitter, DataReader from prediction import Preprocessor, Classifier def runPrediction(sourceDirectory,submitDirectory): reader = DataReader(dataDir) p = Preprocessor(*reader.getData()) submitter = Submitter(submitDir) ...
jreiberkyle/Kaggle_Data-Science-London
main.py
Python
bsd-3-clause
900
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name="Ente", version="0.1", description="place finder on commoncrawl dataset", author="László Nagy", author_email="rizsotto@gmail.com", license='LICENSE', url='https://github.com/rizsotto/Ente', long_desc...
rizsotto/Ente
setup.py
Python
bsd-3-clause
383
# -*- coding: utf-8 -*- """Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ from flask import url_for from power_grid_helper.user.models import User from .factories import UserFactory class TestLoggingIn: """Login.""" def test_can_log_in_returns_200(self, user, testapp): ""...
kdheepak89/power-grid-helper
tests/test_functional.py
Python
bsd-3-clause
4,009
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from nose.tools import assert_raises from nose.tools import assert_dict_equal from numpy.testing import assert_array_equal from numpy.testing ...
bnoi/scikit-tracker
sktracker/trajectories/tests/test_trajectories.py
Python
bsd-3-clause
14,672
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import math import random import unittest from measurement_stats import angle from measurement_stats import value from measurement_stats import value2D HALF_SQRT_2 = 0....
sernst/RefinedStatistics
measurement_stats/test/test_value2D.py
Python
mit
2,275
import nose def test_nose_working(): """ Test that the nose runner is working. """ assert True
cwoodall/doppler-gestures-py
tests/test.py
Python
mit
116
default_app_config = 'django_tenants.apps.DjangoTenantsConfig'
tomturner/django-tenants
django_tenants/__init__.py
Python
mit
63
# Example taken from the http://gunicorn.org/configure.html # page. import os def numCPUs(): if not hasattr(os, "sysconf"): raise RuntimeError("No sysconf detected.") return os.sysconf("SC_NPROCESSORS_ONLN") bind = "127.0.0.1:8000" workers = numCPUs() * 2 + 1
ucdavis-agecon/gunicorn-init
tree/etc/gunicorn/py/example.py
Python
mit
272
import os import libxml2 from sfatables.command import Command from sfatables.globals import sfatables_config, target_dir, match_dir class Add(Command): def __init__(self): self.options = [('-A','--add')] self.help = 'Add a rule to a chain' self.matches = True self.targets = True ...
yippeecw/sfa
sfatables/commands/Add.py
Python
mit
2,604
#!/usr/bin/env python # # GrovePi Example for using the Grove Barometer module (http://www.seeedstudio.com/depot/Grove-Barometer-HighAccuracy-p-1865.html) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question abo...
penoud/GrovePi
Software/Python/grove_barometer_sensors/barometric_sensor_bmp085/grove_barometer_example_BMP085.py
Python
mit
1,813
#!/usr/bin/python from sensu_plugin import SensuPluginMetricJSON import requests #import os import json from sh import curl from walrus import * #from redis import * import math #from requests.auth import HTTPBasicAuth import statsd import warnings from requests.packages.urllib3 import exceptions db = Database(host='l...
PicOrb/docker-sensu-server
plugins/aux/check-boundary.py
Python
mit
2,430
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: """ACE -- Automated Coordinate Extraction. """ __all__ = ["config", "database", "datatable", "exporter", "set_logging_level", "scrape", "sources", "tableparser", "tests", "__version__"] import log...
neurosynth/ACE
ace/__init__.py
Python
mit
1,044
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated by generateDS.py. # import sys import getopt import re as re_ import base64 import datetime as datetime_ etree_ = None Verbose_import_ = False ( XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree ) = range(3) XMLParser_impor...
ricksladkey/generateDS
tests/out2_sup.py
Python
mit
153,816
import json from prismriver import util, main class SongJsonEncoder(json.JSONEncoder): def default(self, o): return o.__dict__ def format_output(songs, output_format, txt_template=None): if output_format == 'txt': formatted_songs = [] for song in songs: lyrics_txt = '' ...
anlar/prismriver
prismriver/cli.py
Python
mit
3,443
import cStringIO import os import tarfile import zipfile def test_download(data_builder, file_form, as_admin, api_db): project = data_builder.create_project(label='project1') session = data_builder.create_session(label='session1') session2 = data_builder.create_session(label='session1') session3 = dat...
scitran/core
tests/integration_tests/python/test_download.py
Python
mit
26,062
from __future__ import unicode_literals, division, absolute_import import os from flexget import plugin from flexget.event import event from flexget.utils import json def load_uoccin_data(path): udata = {} ufile = os.path.join(path, 'uoccin.json') if os.path.exists(ufile): try: with o...
antivirtel/Flexget
flexget/plugins/metainfo/uoccin_lookup.py
Python
mit
3,924
from django.test import TestCase from django.contrib.auth import get_user_model from model_mommy import mommy from rolepermissions.roles import RolesManager, AbstractUserRole class RolRole1(AbstractUserRole): available_permissions = { 'permission1': True, 'permission2': True, } class RolRo...
chillbear/django-role-permissions
rolepermissions/tests/test_roles.py
Python
mit
4,326
import argparse import sys # Sieve of Eratosthenes # Code by David Eppstein, UC Irvine, 28 Feb 2002 # http://code.activestate.com/recipes/117119/ def gen_primes(): """ Generate an infinite sequence of prime numbers. """ # Maps composites to primes witnessing their compositeness. # This is memory effic...
everyevery/programming_study
tools/gen_prime.py
Python
mit
2,129
# -*- coding: utf-8 -*- ####################################################################### # Name: test_optional_in_choice # Purpose: Optional matches always succeds but should not stop alternative # probing on failed match. # Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> # Copyright: (c...
leiyangyou/Arpeggio
tests/unit/regressions/issue_20/test_issue_20.py
Python
mit
827
# Copyright (c) 2019, CRS4 # # 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, merge, publish, distribu...
lucalianas/ProMort
promort/clinical_annotations_manager/models.py
Python
mit
10,721
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_lost_aqualish_soldier_female_01.iff" result.attribute_...
anhstudios/swganh
data/scripts/templates/object/mobile/shared_dressed_lost_aqualish_soldier_female_01.py
Python
mit
469
import operator from textwrap import dedent from twisted.trial import unittest from ometa.grammar import OMeta, TermOMeta, TreeTransformerGrammar from ometa.compat import OMeta1 from ometa.runtime import (ParseError, OMetaBase, OMetaGrammarBase, EOFError, expected, TreeTransformerBase) from o...
pde/torbrowser-launcher
lib/Parsley-1.1/ometa/test/test_pymeta.py
Python
mit
48,024
#! /usr/bin/env python #-*- coding: utf-8 -*- # ***** BEGIN LICENSE BLOCK ***** # This file is part of Shelter Database. # Copyright (c) 2016 Luxembourg Institute of Science and Technology. # All rights reserved. # # # # ***** END LICENSE BLOCK ***** __author__ = "Cedric Bonhomme" __version__ = "$Revision: 0.2 $" __d...
rodekruis/shelter-database
src/web/views/session_mgmt.py
Python
mit
5,400
from image_mat_util import * from mat import Mat from vec import Vec import matutil from solver import solve ## Task 1 def move2board(v): ''' Input: - v: a vector with domain {'y1','y2','y3'}, the coordinate representation of a point q. Output: - A {'y1','y2','y3'}-vector z, the coordina...
vvw/linearAlgebra-coursera
assignment 5/perspective_lab/perspective_lab.py
Python
mit
4,055
# -*- coding: utf-8 -*- # Authors: Y. Jia <ytjia.zju@gmail.com> import unittest from common.BinaryTree import BinaryTree from .. import BinaryTreeMaximumPathSum class test_BinaryTreeMaximumPathSum(unittest.TestCase): solution = BinaryTreeMaximumPathSum.Solution() def test_maxPathSum(self): self.as...
ytjia/coding-practice
algorithms/python/leetcode/tests/test_BinaryTreeMaximumPathSum.py
Python
mit
446
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2011,2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permis...
waynechu/PythonProject
dns/wiredata.py
Python
mit
3,751
""" WSGI config for mysite 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", "firstapp.settings") from django.core.w...
nickromano/django-slow-tests
_examples/django17/firstapp/wsgi.py
Python
mit
389
from cupy import elementwise _id = 'out0 = in0' # TODO(okuta): Implement convolve _clip = elementwise.create_ufunc( 'cupy_clip', ('???->?', 'bbb->b', 'BBB->B', 'hhh->h', 'HHH->H', 'iii->i', 'III->I', 'lll->l', 'LLL->L', 'qqq->q', 'QQQ->Q', 'eee->e', 'fff->f', 'ddd->d'), 'out0 = min(in2, max(in1, i...
tscohen/chainer
cupy/math/misc.py
Python
mit
4,772
from common2 import * # NAME IDEA -> pooling/random/sparse/distributed hebbian/horde/crowd/fragment/sample memory # FEATURES: # + boost -- neurons with empty mem slots learn faster # + noise -- # + dropout -- temporal disabling of neurons # + decay -- remove from mem # + negatives -- learning to avoid detecting some...
mobarski/sandbox
rsm/v9le/v5.py
Python
mit
8,419
from setuptools import setup, find_packages version = "6.3.0" with open("requirements.txt", "r") as f: install_requires = f.readlines() setup( name='frappe', version=version, description='Metadata driven, full-stack web framework', author='Frappe Technologies', author_email='info@frappe.io', ...
indictranstech/omnitech-frappe
setup.py
Python
mit
438
#! /usr/bin/env python3 # # importing_modules.py # # Author: Billy Wilson Arante # Created: 2/24/2016 PHT # import fibo def test(): """Test cases.""" print('Example 1:') fibo.fib(1000) print('Example 2:') print(fibo.fib1(1000)) print('Example 3:') print(fibo.__name__) # Assign...
arantebillywilson/python-snippets
py3/py344-tutor/ch06-modules/importing_modules.py
Python
mit
444
import cv2 import os import scipy.misc as misc path = os.getcwd() for x in xrange(15): rgb = cv2.imread(path + '/output/rgb_img_' + str(x) + '.jpg') depth = cv2.imread(path + '/output/depth_img_' + str(x) + '.jpg') depth_inquiry = depth.copy() # depth_inquiry[depth_inquiry > 180] = 0 # Depth thresh...
J0Nreynolds/Spartifai
rgb_depth_exclusion.py
Python
mit
1,140
"""distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summary * options set attributes of a passed-in object """ __...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/distutils/fancy_getopt.py
Python
mit
17,855
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/creature/npc/droid/shared_wed_treadwell_base.iff" result.attribute_template_...
anhstudios/swganh
data/scripts/templates/object/creature/npc/droid/shared_wed_treadwell_base.py
Python
mit
460
from decouple import Csv, config from dj_database_url import parse as db_url from .base import * # noqa DEBUG = False SECRET_KEY = config('SECRET_KEY') DATABASES = { 'default': config('DATABASE_URL', cast=db_url), } DATABASES['default']['ATOMIC_REQUESTS'] = True ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=C...
camilaavilarinho/monitorador-twitter
monitortwitter/settings/production.py
Python
mit
3,261
from setuptools import setup, find_packages DESCRIPTION = """ Send emails based on a Django template See: https://github.com/prestontimmons/django-email-template """ setup( name="django-email-template", version="1.0.2", description="Send emails based on a Django template", long_description=DESCRIPT...
funkybob/django-email-template
setup.py
Python
mit
433
import django_filters from dal import autocomplete from .models import SkosConcept, SkosConceptScheme django_filters.filters.LOOKUP_TYPES = [ ('', '---------'), ('exact', 'Is equal to'), ('iexact', 'Is equal to (case insensitive)'), ('not_exact', 'Is not equal to'), ('lt', 'Lesser than/before'), ...
vanyh/handkeinzungen-app
vocabs/filters.py
Python
mit
1,239
from django.test import override_settings, SimpleTestCase from arcutils.settings import NO_DEFAULT, PrefixedSettings, get_setting @override_settings(ARC={ 'a': 'a', 'b': [0, 1], 'c': [{'c': 'c'}], 'd': 'd', }) class TestGetSettings(SimpleTestCase): def get_setting(self, key, default=NO_DEFAULT):...
PSU-OIT-ARC/django-arcutils
arcutils/tests/test_settings.py
Python
mit
2,723
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "battleground.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
pguridi/pywars
manage.py
Python
mit
255
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Mission() result.template = "object/mission/base/shared_base_mission.iff" result.attribute_template_id = -1 resu...
anhstudios/swganh
data/scripts/templates/object/mission/base/shared_base_mission.py
Python
mit
435
import os from collections import namedtuple from eg import color from eg import config from mock import patch # Some hardcoded real colors. _YELLOW = '\x1b[33m' _MAGENTA = '\x1b[35m' _BLACK = '\x1b[30m' _GREEN = '\x1b[32m' # The flags in the test file marking where substitutions should/can occur. SubFlags = namedt...
scorphus/eg
test/color_test.py
Python
mit
5,718
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/weapon/shared_blacksun_heavy_weapon2_s02.iff" resul...
anhstudios/swganh
data/scripts/templates/object/tangible/ship/attachment/weapon/shared_blacksun_heavy_weapon2_s02.py
Python
mit
474
"""Test kytos.core.buffers module.""" import asyncio from unittest import TestCase from unittest.mock import MagicMock, patch from kytos.core.buffers import KytosBuffers, KytosEventBuffer # pylint: disable=protected-access class TestKytosEventBuffer(TestCase): """KytosEventBuffer tests.""" def setUp(self): ...
kytos/kytos
tests/unit/test_core/test_buffers.py
Python
mit
3,932
import sys import codecs from textblob import Blobber from textblob.wordnet import Synset from textblob.en.np_extractors import ConllExtractor from collections import Counter import re from nltk.corpus import wordnet as wn from nltk.corpus.reader import NOUN import os import string import itertools from nltk.corpus imp...
darenr/MOMA-Art
extract_concepts/concepts.py
Python
mit
2,123
from decimal import Decimal from electrum.util import (format_satoshis, format_fee_satoshis, parse_URI, is_hash256_str, chunks) from . import SequentialTestCase class TestUtil(SequentialTestCase): def test_format_satoshis(self): self.assertEqual("0.00001234", format_satoshis(...
fujicoin/electrum-fjc
electrum/tests/test_util.py
Python
mit
5,385
########################################################### # # Copyright (c) 2010, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
Southpaw-TACTIC/TACTIC
src/tactic/ui/app/system_info_wdg.py
Python
epl-1.0
19,736
# # Copyright (C) 2004 SIPfoundry Inc. # Licensed by SIPfoundry under the GPL license. # # Copyright (C) 2004 SIP Forum # Licensed to SIPfoundry under a Contributor Agreement. # # # This file is part of SIP Forum User Agent Basic Test Suite which # belongs to the SIP Forum Test Framework. # # SIP Forum User Agent Basic...
VoIP-co-uk/sftf
UserAgentBasicTestSuite/case901.py
Python
gpl-2.0
2,768
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
huiyiqun/check_mk
doc/treasures/Event_Console/snmptd_mkevent.py
Python
gpl-2.0
2,674
from cities_light.models import Country, City from django.test import TestCase from django.contrib.auth.models import User from blog.models import Tag, ResourceType, News, Resource from community.models import Community from users.models import SystersUser class TagModelTestCase(TestCase): def test_str(self): ...
payal97/portal
systers_portal/blog/tests/test_models.py
Python
gpl-2.0
2,763
#!/usr/bin/env python # encoding: utf-8 import mistune from pygments import highlight from pygments.lexers import get_lexer_by_name from pygments.formatters import html from flask import current_app, render_template from application.models.system import site from application.services.system import has base_env = { ...
luke0922/MarkdownEditor
application/utils/template.py
Python
gpl-2.0
1,363
# -*- coding: utf-8 -*- """ Created on Thu Nov 6 15:32:36 2014 @author: commun Converts filtered data sets to tx2 format used in Aarhusinv. CHANGELOG: """ #import of needed modules import numpy as np #~ def to_tx2(path_filt, path_tx2, electrode_spacing, ngates=20, pulselength=2): #~ path_filt = '../shiprock...
commun108/dca_testing
single_file_gen/scripts/to_tx2.py
Python
gpl-2.0
4,114
from sqlobject.dbconnection import registerConnection def builder(): import mysqlconnection return mysqlconnection.MySQLConnection def isSupported(): try: import MySQLdb except ImportError: return False return True registerConnection(['mysql'], builder, isSupported)
pacoqueen/bbinn
SQLObject/SQLObject-0.6.1/sqlobject/mysql/__init__.py
Python
gpl-2.0
306
# -*- coding: utf-8 -*- # (C) Copyright 2016 Hewlett Packard Enterprise Development LP # 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.a...
johcheun/ops-pmd
ops-tests/feature/bgp/vtysh_utils.py
Python
gpl-2.0
3,609
import networkx as nx import re def get_graph_info(file_path): def extract_first_two(collection): return [int(collection[0]), int(collection[1])] with open(file_path) as ifs: lines = map(lambda ele: ele.strip(), ifs.readlines()) lines = filter(lambda ele: not ele.startswith('#') and r...
GraphProcessor/CommunityDetectionCodes
Prensentation/metrics/util.py
Python
gpl-2.0
504
# -*- coding: utf-8 -*- """ *************************************************************************** SumLines.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************************...
AsgerPetersen/QGIS
python/plugins/processing/algs/qgis/SumLines.py
Python
gpl-2.0
5,242
import wx class Choice(wx.Choice): def GetValue(self): return self.GetSelection()
onoga/toolib
toolib/wx/controls/Choice.py
Python
gpl-2.0
86
__author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.utilities import blockCombine from scipy import mat, dot, outer from scipy.linalg import inv, cholesky def calcFisherInformation(sigma, invSigma=None, factorSigma=None): """ Compute the exact Fisher Information Matrix of a Gaussian distribution, ...
iut-ibk/Calimero
site-packages/pybrain/tools/fisher.py
Python
gpl-2.0
1,728
class MastermindError(Exception): @property def code(self): return MASTERMIND_ERROR_CODES[type(self)] @staticmethod def make_error(code, msg): if code not in MASTERMIND_ERROR_CLS: raise ValueError('Unknown error code {}'.format(code)) return MASTERMIND_ERROR_CLS[code...
yandex/mastermind
src/python-mastermind/src/mastermind/errors.py
Python
gpl-2.0
508
#!/usr/bin/env python __author__ = "Dulip Withanage" __email__ = "dulip.withanage@gmail.com" import re import string import sys import operator import globals as gv import os import subprocess import shutil #from django.utils.encoding import smart_str class FrontMatterParser: def __init__(self, gv): self.gv =...
MartinPaulEve/meTypeset
bin/frontmatterparser.py
Python
gpl-2.0
3,339
# -*- coding: utf-8 -*- import os import grp import tempfile from django.conf import settings from utilities import encoding import shutil import zipfile gid = None if (settings.USEPRAKTOMATTESTER): gid = grp.getgrnam('praktomat').gr_gid def makedirs(path): if os.path.exists(path): return else: ...
KITPraktomatTeam/Praktomat
src/utilities/file_operations.py
Python
gpl-2.0
3,099
from __future__ import print_function, unicode_literals from datetime import datetime, timedelta import time import unittest from DenyHosts.counter import Counter, CounterRecord class CounterRecordTest(unittest.TestCase): def test_init(self): c = CounterRecord() self.assertEqual(c.get_count(), 0)...
HardLight/denyhosts
tests/test_counter.py
Python
gpl-2.0
4,362
#!/usr/bin/python -u # # # ################################################################################# # Start off by implementing a general purpose event loop for anyones use ################################################################################# import sys import getopt import os import libvirt impor...
utkarshsins/baadal-libvirt-python
examples/event-test.py
Python
gpl-2.0
22,504
#!/usr/bin/env python3 # # # # This file is part of librix-thinclient. # # librix-thinclient 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 ver...
andrevmatos/Librix-ThinClient
src/__init__.py
Python
gpl-2.0
777
# $Id: uas-subscribe-terminated-retry.py 4188 2012-06-29 09:01:17Z nanang $ # import inc_const as const PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost --add-buddy $SIPP_URI"] PJSUA_EXPECTS = [[0, "", "s"], [0, "Subscribe presence of:", "1"], [0, "Presence subscription .* is TERMINATED", "...
AlexanderVangelov/pjsip
tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py
Python
gpl-2.0
374
#---------------------------------------------- # ir_ula.py # # Intermediate representation for the ula (unconventional language) # By Mitch Myburgh (MYBMIT001) # 24 09 2015 #---------------------------------------------- from llvmlite import ir from ctypes import CFUNCTYPE, c_float import llvmlite.binding a...
mitchmyburgh/compilers_assignment
part2/ir_ula.py
Python
gpl-2.0
4,411