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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from emojibot.utils.response import Response
def test_constructor():
response = Response()
assert isinstance(response, Response)
| gramhagen/emojibot | tests/utils/test_response.py | Python | mit | 164 |
from __future__ import absolute_import
# import jinja2
from jinja2.ext import Extension
from .templatetags.promotions_tags import promo_ballance
class PromotionsExtension(Extension):
def __init__(self, environment):
super(PromotionsExtension, self).__init__(environment)
environment.filters["prom... | phani00/tovp | tovp/promotions/jinja2tags.py | Python | mit | 398 |
# Passability types.
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
# from json import load
from collections import OrderedDict
# from os.path import splitext, dirname, join
from os.path import dirname, join
# locals().update(load(open('%s.json' % ... | theblacklion/joe-danger | data/gfx/passability.py | Python | mit | 873 |
#### 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/mission/quest_item/shared_sayama_edosun_q2_needed.iff"
result.attri... | anhstudios/swganh | data/scripts/templates/object/tangible/mission/quest_item/shared_sayama_edosun_q2_needed.py | Python | mit | 481 |
#### 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 = Building()
result.template = "object/building/poi/shared_dathomir_freedprisonerscamp_large1.iff"
result.attribute... | anhstudios/swganh | data/scripts/templates/object/building/poi/shared_dathomir_freedprisonerscamp_large1.py | Python | mit | 465 |
#
# Copyright (c) 2015 Open-RnD Sp. z o.o.
#
# 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, publ... | open-rnd/ros3d-www | ros3dui/system/__init__.py | Python | mit | 1,104 |
#### 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/furniture/all/shared_frn_all_throwpillow_med_s02.iff"
result.attrib... | anhstudios/swganh | data/scripts/templates/object/tangible/furniture/all/shared_frn_all_throwpillow_med_s02.py | Python | mit | 465 |
#! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
dim = 1
meanPoint = NumericalPoint(dim, 1.0)
meanPoint[0] = 0.5
sigma = NumericalPoint(dim, 1.0)
sigma[0] = 2.0
R = CorrelationMatrix(dim)... | sofianehaddad/ot-svn | python/test/t_BarPlot_std.py | Python | mit | 1,975 |
"""
Constants
"""
TOOL_FREEBAYES = 'freebayes'
TOOL_PINDEL = 'pindel'
TOOL_DELLY = 'delly'
TOOL_LUMPY = 'lumpy'
| woodymit/millstone | genome_designer/pipeline/variant_calling/constants.py | Python | mit | 113 |
def count(S, m, n):
table = [[0 for x in range(m)] for x in range(n+1)]
for i in range(m):
table[0][i] = 1
for i in range(1, n+1):
for j in range(m):
x = table[i - S[j]][j] if i-S[j] >= 0 else 0
y = table[i][j-1] if j >= 1 else 0
table[i][j] ... | Sunhick/hacker_rank | Algorithms/Dynamic Programming/The-Coin-Change-Problem.py | Python | mit | 496 |
import _plotly_utils.basevalidators
class AnnotationsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="annotations", parent_name="layout.scene", **kwargs):
super(AnnotationsValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | plotly/python-api | packages/python/plotly/plotly/validators/layout/scene/_annotations.py | Python | mit | 9,045 |
import unittest
import numpy as np
import pyoptima as opt
class SimulatedAnnealingTest(unittest.TestCase):
def test_with_parabola(self):
""" Test with a simple parabolic function with 2 variables """
def neighbour_func(params):
new_params = params
params['x0'] += np.rando... | samueljackson92/metaopt | python_tests/simulated_annealing_test.py | Python | mit | 1,038 |
from django.contrib import admin
# Register your models here.
from .models import Author, Genre, Book, BookInstance, Language
"""
# Minimal registration of Models.
admin.site.register(Book)
admin.site.register(Author)
admin.site.register(BookInstance)
admin.site.register(Genre)
admin.site.register(Language)
"""
adm... | DarknessSwitch/django-tutorial | catalog/admin.py | Python | cc0-1.0 | 2,208 |
# *****************************************************************************
# Copyright (c) 2014, 2018 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distrib... | ibm-watson-iot/iot-python | src/wiotp/sdk/device/client.py | Python | epl-1.0 | 4,102 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import struct
class BBType(object):
command = 1
command_return = 2
consolemsg = 3
ping = 4
pong = 5
getenv = 6
getenv_return = 7
fs = 8
fs_return = 9
class BBPacket(o... | raphui/barebox | scripts/remote/messages.py | Python | gpl-2.0 | 4,045 |
# -*- coding: utf-8 -*-
##
## This file is part of INSPIRE.
## Copyright (C) 2015 CERN.
##
## INSPIRE 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) a... | ioannistsanaktsidis/inspire-next | inspire/base/format_elements/bfe_inspire_conferences_date.py | Python | gpl-2.0 | 2,924 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('QuickBooking', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='timing',
name='i... | noorelden/QuickBooking | QuickBooking/migrations/0002_auto_20150623_1913.py | Python | gpl-2.0 | 450 |
#!/usr/bin/env python
import os
from app import create_app, db
from app.models import User, Role
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_... | Sarthak30/User-Registration | source/manage.py | Python | gpl-2.0 | 768 |
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 versio... | tfroehlich82/EventGhost | plugins/Mouse/__init__.py | Python | gpl-2.0 | 21,487 |
# -*- coding: utf-8 -*-
'''
script.matchcenter - Football information for Kodi
A program addon that can be mapped to a key on your remote to display football information.
Livescores, Event details, Line-ups, League tables, next and previous matches by team. Follow what
others are saying about the match ... | enen92/script.matchcenter | resources/lib/tweets.py | Python | gpl-2.0 | 4,506 |
"""Subclass of GitView, which is generated by wxFormBuilder."""
import wx
from beatle import tran, model, localpath
from beatle.model import git
from beatle.lib import wxx
from beatle.lib.decorators import classproperty
from beatle.lib.handlers import Identifiers
from beatle.app import resources as rc
from beatle.a... | melviso/phycpp | beatle/activity/git/ui/view/GitView.py | Python | gpl-2.0 | 17,147 |
#!/usr/bin/python3
Card = collections.namedtuple('Card', ['rank', 'suit'])
class FrenchDeck:
ranks = [str(n) for n in range(2, 11)] + list('JQKA')
suits = 'spades diamonds clubs hearts'.split()
def __init__(self):
self._cards = [Card(rank, suit) for suit in self.suits
... | zhuango/python | pythonLearning/oo/FrenchDeck.py | Python | gpl-2.0 | 487 |
##########################################################
# view the person ZODB database in PyForm's FormGui;
# FileDB maps indexing to db root, close does commit;
# caveat 1: FormGui doesn't yet allow mixed class types;
# caveat 2: FormGui has no way to call class methods;
# caveat 3: Persistent subclasses don'... | simontakite/sysadmin | pythonscripts/programmingpython/Dbase/Zodb-2.x/viewzodb.py | Python | gpl-2.0 | 1,196 |
# Copyright (c) 2017 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2017 Tomas Machalek <tomas.machalek@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 publis... | tomachalek/kontext | lib/plugins/abstract/issue_reporting.py | Python | gpl-2.0 | 1,501 |
from django.core.exceptions import PermissionDenied
from core.models import Author, Editor
def copy_author_to_submission(user, book):
author = Author(
first_name=user.first_name,
middle_name=user.profile.middle_name,
last_name=user.last_name,
salutation=user.profile.salutation,
... | ubiquitypress/rua | src/submission/logic.py | Python | gpl-2.0 | 2,061 |
from enigma import iPlayableService, iRdsDecoder
from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap
from Components.ServiceEventTracker import ServiceEventTracker
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.Sources.StaticText import Stati... | kingvuplus/boom | lib/python/Screens/RdsDisplay.py | Python | gpl-2.0 | 10,176 |
#!/usr/bin/python
# *
# * Copyright (C) 2012-2013 Garrett Brown
# * Copyright (C) 2010 j48antialias
# *
# * This Program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License as published by
# * the Free Software Foundation; either version 2, or (at y... | dknlght/dkodi | src/addons_xml_generator3.py | Python | gpl-2.0 | 8,998 |
"""Definitions for output formats."""
import collections
from enum import Enum, unique
__copyright__ = 'Copyright 2021, 3Liz'
__license__ = 'GPL version 3'
__email__ = 'info@3liz.org'
format_output = collections.namedtuple('format', ['label', 'driver_name', 'extension'])
@unique
class Format(Enum):
""" Name o... | 3liz/QgisQuickOSMPlugin | QuickOSM/definitions/format.py | Python | gpl-2.0 | 657 |
import wx
from Gauge import Gauge
class DependencyPanel(wx.Panel):
def __init__(self, parent, text, gaugeColor, textColor, env = 0, mineral = 0, energy = 0, nothing = 0):
wx.Panel.__init__(self, parent, -1)
gaugeBorders = (5, 5, 1, 7)
self.env = Gauge(self, gaugeColor, textColor, gaugeBorders, env)
self.m... | OuterDeepSpace/OuterDeepSpace | techviewer/DependencyPanel.py | Python | gpl-2.0 | 1,962 |
# This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
# by the Free Soft... | gromacs/copernicus | cpc/network/http/http_method_parser.py | Python | gpl-2.0 | 9,130 |
import sys, os, re, string
from autotest_lib.client.bin import utils, fsinfo, fsdev_mgr, partition
from autotest_lib.client.common_lib import error
fd_mgr = fsdev_mgr.FsdevManager()
# For unmounting / formatting file systems we may have to use a device name
# that is different from the real device name that we have ... | ceph/autotest | client/bin/fsdev_disks.py | Python | gpl-2.0 | 19,722 |
# shipBonusSupercarrierC2ShieldResists
#
# Used by:
# Ship: Wyvern
type = "passive"
def handler(fit, src, context):
fit.ship.boostItemAttr("shieldThermalDamageResonance", src.getModifiedItemAttr("shipBonusSupercarrierC2"),
skill="Caldari Carrier")
fit.ship.boostItemAttr("shieldEmDam... | Ebag333/Pyfa | eos/effects/shipbonussupercarrierc2shieldresists.py | Python | gpl-3.0 | 767 |
# -*- coding: utf-8 -*-
from django.views.generic import FormView
class ChangePassword(FormView):
pass
change_password = ChangePassword.as_view() | tokyo-jesus/wampum | user/private_views/_change_password.py | Python | gpl-3.0 | 152 |
../../../../../share/pyshared/papyon/sip/call_manager.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/papyon/sip/call_manager.py | Python | gpl-3.0 | 56 |
from django.conf.urls import url, include, patterns
from . import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
)
| i32baher/practicas-iss | tubeworld/main/urls.py | Python | gpl-3.0 | 289 |
#!/usr/bin/env python
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import absolute_import
from __future__ import unicode_literals
from gnuradio import gr, blocks
from . import fec_swig as fec
from .threaded_enco... | TheWylieStCoyote/gnuradio | gr-fec/python/fec/extended_encoder.py | Python | gpl-3.0 | 2,704 |
# This file is part of jacqq.py
# Copyright (C) 2015 Saman Jirjies - sjirjies(at)asu(dot)edu.
#
# 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 opt... | sjirjies/pyJacqQ | tests/generate_null_dataset.py | Python | gpl-3.0 | 4,011 |
# -*- coding: UTF-8 -*-
import re
def mgo_text_split(query_text):
''' split text to support mongodb $text match on a phrase '''
sep = r'[`\-=~!@#$%^&*()_+\[\]{};\'\\:"|<,./<>?]'
word_lst = re.split(sep, query_text)
text_query = ' '.join('\"{}\"'.format(w) for w in word_lst)
return text_query
# 搜... | ysrc/xunfeng | views/lib/QueryLogic.py | Python | gpl-3.0 | 2,319 |
#!/usr/bin/env python3
# Listentypen:
# 1. Die Liste:
# Eine Liste ist eine beliebig lange Folge von beliebigen Objekten
# Eine Liste wird mit Hilfe von eckigen Klammern definiert.
liste = [0, "foo"] # type: list
print(liste)
# Mit list() lässt sich bspw. ein String in einen Liste verwandeln:
String = "ABCDEFGHIJ... | pythonfoo/pythonfooLite | Level_03/listen.py | Python | gpl-3.0 | 2,306 |
from collections import namedtuple
from math import pi
import pygame
# Size and Weight Constants
TOTAL_MASS = 20 # Made up units
TOTAL_HEIGHT = 350 # Pygame pixels
STARTING_SPEED = 0, 0 # pixels/sec?
BASE_STRENGTH = 1500000
# Mass Fractions #
mass_fractions = {
"head": 0.0826,
"torso": 0.551,
"upper_a... | TheoKanning/Jerry-Learns | jerry/body_config.py | Python | gpl-3.0 | 2,759 |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 opt... | hexpl0it/plugin.video.genesi-ita | resources/lib/resolvers/realvid.py | Python | gpl-3.0 | 1,167 |
from ImageScripter import *
from elan import *
raise ValueError('fff')
Viewer.Start()
Viewer.CloseAndClean()
Configurator.Start()
Configurator.inputoutput.Click()
addNewComDev(ComType = "Standard Connection",HardwareType = "Serial Port",Comport = '0')
addNewDevice(Configurator.genericserialdevices,"Generic Serial De... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/elan/Backup Pools/Repeat_One_Test/1____Serial_Device_Settings_Change_Check.py | Python | gpl-3.0 | 1,335 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_pitchtools_PitchArrayCell_pitches_01():
array = pitchtools.PitchArray([[1, 2, 1], [2, 1, 1]])
array[0].cells[0].pitches.append(NamedPitch(0))
array[0].cells[1].pitches.append(NamedPitch(2))
'''
[c'] [d' ] []
[ ] [] []
'''... | mscuthbert/abjad | abjad/tools/pitchtools/test/test_pitchtools_PitchArrayCell_pitches.py | Python | gpl-3.0 | 756 |
#!/usr/bin/env python
from setuptools import setup, find_packages
from trackma import utils
try:
LONG_DESCRIPTION = open("README.rst").read()
except IOError:
LONG_DESCRIPTION = __doc__
NAME = "Trackma"
REQUIREMENTS = []
EXTRA_REQUIREMENTS = {
'curses': ['urwid'],
'GTK': ['pygobject'],
'Qt': [],
}... | MadeOfMagicAndWires/trackma | setup.py | Python | gpl-3.0 | 1,589 |
# PyDia SQL.py : SQL dump.
# Copy it to /usr/share/dia/python
import dia
# import sys
# import os
import string
import re
import datetime
class SQLRenderer:
def __init__(self):
self.f = None
def begin_render(self, data, filename):
self.f = open(filename, "w")
# name = os.path.spl... | tedlaz/pyted | pymiles/pyMiles2.old/pymiles/sqlite/diasql.py | Python | gpl-3.0 | 5,065 |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | XeCycle/indico | indico/web/menu.py | Python | gpl-3.0 | 7,214 |
# shipBonusMissileLauncherHeavyROFATC1
#
# Used by:
# Ship: Vangel
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Missile Launcher Heavy",
"speed", ship.getModifiedItemAttr("shipBonusATC1"))
| bsmr-eve/Pyfa | eos/effects/shipbonusmissilelauncherheavyrofatc1.py | Python | gpl-3.0 | 300 |
# -*- coding: utf-8 -*-
from test_settings import Settings
class TestCase(Settings):
def test_sidebar(self):
# Ayarlari yapiyor.
self.do_settings()
# Genel'e tikliyor.
self.driver.find_element_by_css_selector(
'li.ng-binding:nth-child(3) > a:nth-child(1) > span:nth-chil... | zetaops/ulakbus | selenium_tests/test_ogrenci_iletisim_bilgileri.py | Python | gpl-3.0 | 1,614 |
# -*- coding: utf-8 -*-
import os
import shutil
from tempfile import mkdtemp
import wx
from outwiker.core.attachment import Attachment
from outwiker.core.tree import WikiDocument
from outwiker.pages.text.textpage import TextPageFactory
from outwiker.core.application import Application
from outwiker.core.attachwatche... | unreal666/outwiker | src/test/core/test_attachwatcher.py | Python | gpl-3.0 | 20,012 |
#====================== BEGIN GPL LICENSE BLOCK ======================
#
# 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 vers... | Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons/rigify/rigs/pitchipoy/limbs/arm.py | Python | gpl-3.0 | 3,863 |
# coding: utf8
# Copyright 2014-2020 CERN. This software is distributed under the
# terms of the GNU General Public Licence version 3 (GPL Version 3),
# copied verbatim in the file LICENCE.md.
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as... | blond-admin/BLonD | blond/toolbox/parameter_scaling.py | Python | gpl-3.0 | 21,008 |
import os
import time
import hashlib
import logging
from base64 import b64encode
from collections import OrderedDict, defaultdict
from twisted.internet.task import LoopingCall
from twisted.internet.defer import Deferred
from dispersy.authentication import MemberAuthentication
from dispersy.candidate import Candidate
... | Tribler/decentralized-mortgage-market | market/community/blockchain/community.py | Python | gpl-3.0 | 30,409 |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.endpoint.introspect
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the OAuth 2.0 `Token Introspection`.
.. _`Token Introspection`: https://tools.ietf.org/html/rfc7662
"""
from __future__ import absolute_import, unicode_literals
import json
import ... | pymedusa/Medusa | ext/oauthlib/oauth2/rfc6749/endpoints/introspect.py | Python | gpl-3.0 | 4,937 |
# versione 0.5
import socket
import threading
import hashlib
import base64
import json
class BadWSRequest(Exception):
pass
class BadWSFrame(Exception):
pass
class BadCmdCall(Exception):
pass
class BadCmdParam(Exception):
pass
class Client(threading.Thread):
_MAGIC_STRING = '258EAFA5-E914-47... | ferdas/ws-rpc | websocket.py | Python | gpl-3.0 | 8,711 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | rbreitenmoser/snapcraft | snapcraft/wiki.py | Python | gpl-3.0 | 2,447 |
"""
This module provides methods that parse variables into
one of the three base level variable types. We map the
variable type names to methods that can handle them. Each
method consumes a Request object 'rq' as the first positional
argument, and does its work by calling one of the variable-setting
methods on rq.
"""
... | Vagab0nd/SiCKRAGE | lib3/beekeeper/variable_handlers.py | Python | gpl-3.0 | 4,051 |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | SickGear/SickGear | lib/simplejson/__init__.py | Python | gpl-3.0 | 24,480 |
from __future__ import print_function
import numpy as np
h, l, c = np.loadtxt('data.csv', delimiter=',', usecols=(4, 5, 6), unpack=True)
N = 5
h = h[-N:]
l = l[-N:]
print("len(h)", len(h), "len(l)", len(l))
print("Close", c)
previousclose = c[-N -1: -1]
print("len(previousclose)", len(previousclose))
print("Previou... | moonbury/notebooks | github/Numpy/Chapter3/atr.py | Python | gpl-3.0 | 599 |
from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from .models import Campaign
class CampaignAdmin(TranslationAdmin):
list_display = ("__str__", "url", "image", "active")
admin.site.register(Campaign, CampaignAdmin)
| erudit/eruditorg | eruditorg/apps/public/campaign/admin.py | Python | gpl-3.0 | 260 |
import kivy
kivy.require('1.9.1')
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.uix.scatter import Scatter
from kivy.app import Builder
from kivy.metrics import dp
from kivy.graphics import Color, Line
from autosportlabs.racecapture.geo.geopoint i... | ddimensia/RaceCapture_App | autosportlabs/uix/track/racetrackview.py | Python | gpl-3.0 | 1,499 |
# Copyright 2012 Lee Verberne <lee@blarg.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 License, or
# (at your option) any later version.
#
# This program is dis... | kafana/ubik | lib/ubik/fab/filemap.py | Python | gpl-3.0 | 3,975 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | tkaitchuck/nupic | examples/prediction/experiments/confidenceTest/2/description.py | Python | gpl-3.0 | 2,040 |
import IMP
import IMP.algebra
import IMP.core
import IMP.atom
import IMP.test
class Tests(IMP.test.TestCase):
"""Tests for SurfaceMover."""
def test_init(self):
"""Test creation of surface mover."""
m = IMP.Model()
surf = IMP.core.Surface.setup_particle(IMP.Particle(m))
surf.... | shanot/imp | modules/core/test/test_surface_mover.py | Python | gpl-3.0 | 2,528 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... | NoctuaNivalis/qutebrowser | qutebrowser/commands/cmdexc.py | Python | gpl-3.0 | 1,545 |
import serial
import serial.tools.list_ports
import copy
import numpy as np
import math
import random
class AsciiSerial:
def __init__(self):
self._graphsChannels = {'graph1': None, 'graph2': None, 'graph3': None, 'graph4': None}
self._enChannels = {'graph1': False, 'graph2': False, 'graph3': Fals... | INTechSenpai/moon-rover | debug_tools/python_debug_console/AsciiSerial.py | Python | gpl-3.0 | 11,638 |
#!/usr/bin/env python
# Copyright 2013-2015 Julian Metzler
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pro... | Mezgrman/TweetPony | setup.py | Python | agpl-3.0 | 1,186 |
# Copyright (c) 2008 Mikeal Rogers
#
# 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 agre... | abo-abo/edx-platform | common/djangoapps/mitxmako/middleware.py | Python | agpl-3.0 | 1,006 |
from bears.natural_language.AlexBear import AlexBear
from tests.LocalBearTestHelper import verify_local_bear
good_file = "Their network looks good."
bad_file = "His network looks good."
AlexBearTest = verify_local_bear(AlexBear,
valid_files=(good_file,),
... | chriscoyfish/coala-bears | tests/natural_language/AlexBearTest.py | Python | agpl-3.0 | 352 |
from amon.apps.alerts.checkers.system import system_alerts
from amon.apps.alerts.checkers.process import process_alerts
from amon.apps.alerts.checkers.plugin import plugin_alerts
from amon.apps.alerts.checkers.healthcheck import healthcheck_alert_checker
from amon.apps.alerts.models import alerts_model
from amon.apps.... | amonapp/amon | amon/apps/alerts/alerter.py | Python | agpl-3.0 | 6,829 |
from lims.browser import BrowserView
from dependencies.dependency import getToolByName
from dependencies.dependency import check as CheckAuthenticator
import json
class ajaxGetInstruments(BrowserView):
""" Returns a json list with the instruments assigned to the method
with the following structure:
... | sciCloud/OLiMS | lims/browser/method.py | Python | agpl-3.0 | 3,775 |
# -*- coding: utf-8 -*-
"""
End-to-end tests for the Account Settings page.
"""
from unittest import skip
from nose.plugins.attrib import attr
from bok_choy.web_app_test import WebAppTest
from ...pages.lms.account_settings import AccountSettingsPage
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.da... | analyseuc3m/ANALYSE-v1 | common/test/acceptance/tests/lms/test_account_settings.py | Python | agpl-3.0 | 17,430 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | yannrouillard/weboob | weboob/applications/handjoob/handjoob.py | Python | agpl-3.0 | 4,944 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | KousikaGanesh/purchaseandInventory | openerp/addons/mrp_operations/mrp_operations.py | Python | agpl-3.0 | 28,224 |
# This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2009, 2010 OpenHatch, Inc.
# Copyright (C) 2010 John Stumpo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Fou... | mzdaniel/oh-mainline | mysite/profile/templatetags/profile_extras.py | Python | agpl-3.0 | 4,899 |
# -*- coding: utf-8 -*-
#
# Author: Joël Grand-Guillaume
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... | jgrandguillaume/vertical-ngo | logistic_budget/wizard/cost_estimate.py | Python | agpl-3.0 | 1,462 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008-2012 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
# General contacts <info@alistek.com>
#
# WARNING: This program as such is intended to be used by professional... | dhp-denero/LibrERP | report_aeroo_ooo/installer.py | Python | agpl-3.0 | 6,702 |
from django.apps import AppConfig
class CheckoutAppConfig(AppConfig):
name = 'ecommerce.extensions.checkout'
verbose_name = 'Checkout'
def ready(self):
super(CheckoutAppConfig, self).ready()
# noinspection PyUnresolvedReferences
import ecommerce.extensions.checkout.signals # pyl... | mferenca/HMS-ecommerce | ecommerce/extensions/checkout/apps.py | Python | agpl-3.0 | 349 |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | tschmorleiz/amcat | amcat/models/coding/codedarticle.py | Python | agpl-3.0 | 12,691 |
from pixelated.adapter.mailstore.searchable_mailstore import SearchableMailStore
from pixelated.adapter.services.mail_service import MailService
from pixelated.adapter.model.mail import InputMail
from pixelated.adapter.services.mail_sender import MailSender
from pixelated.adapter.search import SearchEngine
from pixelat... | rdoh/pixelated-user-agent | service/pixelated/config/services.py | Python | agpl-3.0 | 2,909 |
"""SCons.Platform.win32
Platform-specific initialization for Win32 systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
#
# Permissio... | bilke/OpenSG-1.8 | SConsLocal/scons-local-0.96.1/SCons/Platform/win32.py | Python | lgpl-2.1 | 13,583 |
import os
import unicodedata
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.commons.utils import cmd_utils
from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import log_utils as logger
def sync():
try:
_keep_alive_for = int(NS.con... | Tendrl/node_agent | tendrl/node_agent/node_sync/disk_sync.py | Python | lgpl-2.1 | 18,338 |
import re
# flag that caches the information whether Windows firewall is running or not
fireWallState = None
# this function modifies all necessary run settings to make it possible to hook into
# the application compiled by Creator
def modifyRunSettingsForHookInto(projectName, port):
prepareBuildSettings(1, 0)
... | mornelon/QtCreator_compliments | tests/system/shared/hook_utils.py | Python | lgpl-2.1 | 19,422 |
"""
Current driven domain-wall motion with constant current and spin accumulation.
"""
# Copyright (C) 2011-2015 Claas Abert
#
# This file is part of magnum.fe.
#
# magnum.fe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Fre... | micromagnetics/magnum.fe | examples/current_wall_motion/run.py | Python | lgpl-3.0 | 2,142 |
from django import forms
from . import models
class GroupForm(forms.ModelForm):
class Meta:
model = models.Group
fields = '__all__'
| nerosketch/djing | group_app/forms.py | Python | unlicense | 154 |
from __future__ import absolute_import
import logging
import os
import shlex
import shutil
import sys
import traceback
from flask import current_app
from subprocess import PIPE, Popen, STDOUT
from uuid import uuid1
from freight.exceptions import CommandError
class Workspace(object):
log = logging.getLogger('wo... | klynton/freight | freight/utils/workspace.py | Python | apache-2.0 | 2,839 |
# -*- coding: utf-8 -*-
"""The Virtual File System (VFS) extent."""
class Extent(object):
"""Extent.
Attributes:
extent_type (str): type of the extent, for example EXTENT_TYPE_SPARSE.
offset (int): offset of the extent relative from the start of the file
system in bytes.
size (int): size of t... | joachimmetz/dfvfs | dfvfs/vfs/extent.py | Python | apache-2.0 | 844 |
#!/usr/bin/env python
__author__ = 'greghines'
import numpy as np
import os
import pymongo
import sys
import cPickle as pickle
import bisect
import random
import csv
import matplotlib.pyplot as plt
if os.path.exists("/home/ggdhines"):
base_directory = "/home/ggdhines"
else:
base_directory = "/home/greg"
def i... | camallen/aggregation | experimental/condor/presentation/condor_IBCC.py | Python | apache-2.0 | 9,662 |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | wgrose/leanto | google/appengine/ext/admin/__init__.py | Python | apache-2.0 | 31,441 |
def authorized_to_manage_request(_, request, current_user, pushmaster=False):
if pushmaster or \
request['user'] == current_user or \
(request['watchers'] and current_user in request['watchers'].split(',')):
return True
return False
def sort_pickmes(_, requests, tags_order):
"""Sort ... | YelpArchive/pushmanager | pushmanager/ui_methods.py | Python | apache-2.0 | 1,099 |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | subho007/androguard | tests/test_ins.py | Python | apache-2.0 | 5,377 |
########
# Copyright (c) 2014 GigaSpaces Technologies 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
#
# Unless... | codilime/cloudify-dsl-parser | dsl_parser/interfaces/constants.py | Python | apache-2.0 | 813 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/api_lib/deployment_manager/runtime_configs/__init__.py | Python | apache-2.0 | 657 |
#!/usr/bin/env python3
# (C) Copyright 2014, Google Inc.
# (C) Copyright 2018, James R Barlow
# 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
# Unl... | jbarlow83/tesseract | src/training/tesstrain.py | Python | apache-2.0 | 4,301 |
#! /usr/bin/python
import re
import os
import sys
import time
import pydas.communicator as apiMidas
import pydas.exceptions as pydasException
import uuid
import json
import shutil
from zipfile import ZipFile, ZIP_DEFLATED
from subprocess import Popen, PIPE, STDOUT
from contextlib import closing
# Load configuration fi... | jcfr/Midas | modules/remoteprocessing/remotescript/main.py | Python | apache-2.0 | 6,635 |
# -*- coding: utf-8 -*-
from django.test import TestCase
from zerver.decorator import \
REQ, has_request_variables, RequestVariableMissingError, \
RequestVariableConversionError, JsonableError
from zerver.lib.validator import (
check_string, check_dict, check_bool, check_int, check_list
)
import ujson
cl... | dwrpayne/zulip | zerver/tests/test_decorators.py | Python | apache-2.0 | 5,333 |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import netutil
from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str
from tornado import gen
from tornado.http1connection import HTTP1Connection
from tornado... | mr-ping/tornado | tornado/test/httpserver_test.py | Python | apache-2.0 | 41,934 |
#!/usr/bin/env python
# Load common imports and system envs to build the core object
import sys, os
# Load the Environment:
os.environ["ENV_DEPLOYMENT_TYPE"] = "JustRedis"
from src.common.inits_for_python import *
#####################################################################
#
# Start Arg Processing:
#
act... | jay-johnson/sci-pype | bins/ml/extractors/extract_and_upload_iris_classifier.py | Python | apache-2.0 | 2,955 |
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | calpeyser/google-cloud-python | logging/google/cloud/logging/entries.py | Python | apache-2.0 | 7,721 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack LLC.
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy o... | josephsuh/extra-specs | nova/tests/api/openstack/compute/test_consoles.py | Python | apache-2.0 | 11,446 |
#!/usr/bin/env python
#
# Copyright 2013 CSIR Meraka HLT and Multilingual Speech Technologies (MuST) North-West University
#
# 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
#
# ht... | Mphaya/heasy | heasy/utility_scripts/display_top_prons.py | Python | apache-2.0 | 4,406 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.