code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
import sys
import json
from bottle import Bottle, request, response, abort
import const
from module import mailer, rsaer, hasher
from orm import dbsess, TmpAnimt
class TmpAnimtApp(Bottle):
def __init__(self):
super(TmpAnimtApp, self).__init__()
self._init_route()
de... | authurlan/amdfin | server/app/tmp_animation.py | Python | gpl-2.0 | 2,171 |
"""
sphinxcontrib.jinjadomain
~~~~~~~~~~~~~~~~~~~~~~~~
The jinja domain for documenting jinja templates.
:copyright: Copyright 2012 by Jaka Hudoklin
:license: BSD, see LICENSE for details.
"""
import re
import os
from sphinx import addnodes
from sphinx.domains import Domain, ObjType, Index
from... | DLR-SC/F2x | doc/contrib/ext/sphinxcontrib_ext/jinjadomain.py | Python | apache-2.0 | 3,435 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | drpngx/tensorflow | tensorflow/python/eager/graph_callable.py | Python | apache-2.0 | 17,077 |
from enum import Enum
from collections import deque
from math import floor
import numpy
class SHETVersion(Enum):
"""
The available versions of the algorithm
"""
Index = 0
Dict = 1
Hybrid = 2
PrunedTree = 3
ConnectedNodes = 4
class SimpleGraph(object):
"""
A class repre... | Antreasgr/Random-Graphs | Python/subtrees.py | Python | mit | 8,166 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 0x0all/nupic | examples/opf/experiments/spatial_classification/base/description.py | Python | gpl-3.0 | 14,982 |
__author__ = 'princek'
| kyrelos/bauth | core/management/commands/__init__.py | Python | gpl-2.0 | 23 |
#File
fname = '5D13-test.gcode'
f=open(fname,'w')
#Laser Parameters
laserPower = 17.5 #% max power
dwellTime = 7 #ms
x_start = 398
y_start = 343
z_start = 122.10 #mm above home
pauseTime = 500 #ms; time paused after movement before ablation
feedRate = 500 #movement speed
# Rec... | Team02-TeamGuinness/BIOE421_RoboHand | ablation-GUI/CONFIG/2014-November-03/10-59-50 AM 5D13-test-CONFIG.py | Python | gpl-2.0 | 586 |
import copy
import os
import tempfile
import unittest
from io import BytesIO
import gridfs
import pytest
from mongoengine import *
from mongoengine.connection import get_db
try:
from PIL import Image # noqa: F401
HAS_PIL = True
except ImportError:
HAS_PIL = False
from tests.utils import MongoDBTestCas... | MongoEngine/mongoengine | tests/fields/test_file_field.py | Python | mit | 16,996 |
SECRET_KEY = 'psst'
SITE_ID = 1
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
ROOT_URLCONF = 'allauth.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.... | pztrick/django-allauth | test_settings.py | Python | mit | 5,254 |
from astrobin_apps_equipment.api.serializers.equipment_item_edit_proposal_serializer import \
EquipmentItemEditProposalSerializer
from astrobin_apps_equipment.models import Telescope
from astrobin_apps_equipment.models.telescope_edit_proposal import TelescopeEditProposal
class TelescopeEditProposalSerializer(Equi... | astrobin/astrobin | astrobin_apps_equipment/api/serializers/telescope_edit_proposal_serializer.py | Python | agpl-3.0 | 813 |
# moduleBonusAssaultDamageControl
#
# Used by:
# Variations of module: Assault Damage Control I (5 of 5)
type = "active"
runTime = "early"
def handler(fit, src, context):
for layer, attrPrefix in (('shield', 'shield'), ('armor', 'armor'), ('hull', '')):
for damageType in ('Kinetic', 'Thermal', 'Explosive'... | bsmr-eve/Pyfa | eos/effects/modulebonusassaultdamagecontrol.py | Python | gpl-3.0 | 612 |
from sqlalchemy import Column, Integer, String, Boolean
from got import db
class CharacterDeaths(db.Model):
id = Column(Integer, primary_key=True)
name = Column(String)
allegiances = Column(String)
death_year = Column(Integer)
book_of_death = Column(Integer)
death_chapter = Column(Integer)
book_intro_chapter = ... | pdiogenes/got_listing | got/models/character_deaths.py | Python | mit | 997 |
"""Tests for Oscapcontent
:Requirement: Oscapcontent
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: SCAPPlugin
:Assignee: jpathan
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import os
import pytest
from robottelo.config import robottelo_tmp_dir
from robottelo.config import... | rplevka/robottelo | tests/foreman/ui/test_oscapcontent.py | Python | gpl-3.0 | 3,786 |
from unittest.mock import Mock, patch
from django.test import SimpleTestCase
from corehq.apps.domain.exceptions import DomainDoesNotExist
from corehq.apps.linked_domain.exceptions import (
DomainLinkAlreadyExists,
DomainLinkError,
DomainLinkNotAllowed,
)
from corehq.apps.linked_domain.views import link_do... | dimagi/commcare-hq | corehq/apps/linked_domain/tests/test_views.py | Python | bsd-3-clause | 3,062 |
#!c:\users\fredqian\appdata\local\programs\python\python36-32\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'esptool==2.3.1','console_scripts','esptool.py'
__requires__ = 'esptool==2.3.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.ex... | xbed/Mixly_Arduino | mixly_arduino/mpBuild/common/esptool.py-script.py | Python | apache-2.0 | 442 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | jakereps/q2cli | q2cli/util.py | Python | bsd-3-clause | 6,379 |
from ..authentication.twitter import twitter
from ..database import User
from flask import (Blueprint, current_app, flash, g, redirect, render_template,
request, session, url_for)
users = Blueprint('users', __name__, template_folder='templates/')
@twitter.tokengetter
def get_twitter_token(token=Non... | andpe/minos | minos/blueprints/users.py | Python | bsd-3-clause | 2,275 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... | techaddict/spark | python/pyspark/ml/tests/test_param.py | Python | apache-2.0 | 14,894 |
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkVertexGlyphFilter(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
... | chrisidefix/devide | modules/vtk_basic/vtkVertexGlyphFilter.py | Python | bsd-3-clause | 495 |
#!/usr/bin/env python
# this works but seems highly inefficient ... my system runs 80% w/ 2 cores
# just displaying a static web page
# although this might be the page --- canvas and two.js???
# for the webserver
from __future__ import print_function
from __future__ import division
from BaseHTTPServer import HTTPServ... | walchko/pygecko | retired/old_version/original/bin/webserver.py | Python | mit | 1,990 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from river.models.base_model import BaseModel
from river.models.state import State
from river.services.config import RiverConfig
__author__ = 'ahmetdal'
BACKWARD = 0
FORWARD = 1
DIRECTIONS = [
(BACKWARD, _("Backward")),
(FO... | sigma-geosistemas/django-river | river/models/transition.py | Python | gpl-3.0 | 1,121 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 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... | ProtractorNinja/qutebrowser | qutebrowser/mainwindow/statusbar/command.py | Python | gpl-3.0 | 8,351 |
# import os
# import time
from datetime import datetime
# import atexit
from flask import Flask, request, Response, render_template
# from apscheduler.schedulers.background import BackgroundScheduler
# from apscheduler.triggers.interval import IntervalTrigger
from modules import sheets, excel
app = Flask(__name__)
... | NilsJPWerner/scgbot | server.py | Python | mit | 3,121 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0040_auto_20150824_2013'),
]
operations = [
migrations.AlterModelOptions(
name='comment',
... | xasos/crowdsource-platform | crowdsourcing/migrations/0041_auto_20150825_0240.py | Python | mit | 1,146 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import numpy as np
def ocean_double_sigma_coordinate(sigma, depth, z1, z2, a, href, k_c):
"""
Creates a dimensioned version of ocean double sigma.
Definition:
for k <= k_c
z(k,j,i)= sigma(k)*f(j,i)
... | ioos/odvc | odvc/formulas.py | Python | bsd-3-clause | 3,362 |
# ##### 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 version.
#
# This program is distrib... | elfnor/sverchok | nodes/modifier_make/wireframe.py | Python | gpl-3.0 | 4,574 |
from .app import console_app, run_app
| janpipek/hlava | hlava/cli/__init__.py | Python | mit | 39 |
from src.camera.BoundingBox import BoundingBox
def get_bounding_box(camera_settings, screen, level, target):
block_size = float(camera_settings["blocksize"])
x = level.get_x(float(camera_settings["x"]), camera_settings["x-unit"])
y = level.get_y(float(camera_settings["y"]), camera_settings["y-unit"])
... | cthit/CodeIT | src/camera/modes/Static.py | Python | mit | 530 |
#!/usr/bin/env python
"""
Nest data sets in hadoop.
"""
from __future__ import print_function, division
import argparse
import glob
import os
import operator
import subprocess32 as sub
def main(args):
"""
Main function for loading data into Hadoop
and creating nested datasets.
"""
# Load files int... | stharrold/bench_mapr | wordcount/hadoop_streaming/big_data/nest_datasets.py | Python | mit | 5,977 |
"""
Your job is to write a function which increments a string, to create a new string. If the string already ends with a number, the number should be incremented by 1. If the string does not end with a number the number 1 should be appended to the new string.
Examples:
foo -> foo1
foobar23 -> foobar24
foo0042 -> fo... | aadithpm/code-a-day | py/String Incrementer.py | Python | unlicense | 744 |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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.o... | nhynes/neon | neon/backends/tests/test_tensor.py | Python | apache-2.0 | 3,575 |
import logging
import requests
from pastehunter.common import parse_config
logger = logging.getLogger('pastehunter')
config = parse_config()
class SlackOutput():
def __init__(self):
self.valid = True
self.webhook_url = config['outputs']['slack_output']['webhook_url']
self.accepted_rules ... | kevthehermit/PasteHunter | pastehunter/outputs/slack_output.py | Python | gpl-3.0 | 1,752 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 b... | efe-mumoglu/suds-jurko-patched | suds/client.py | Python | lgpl-3.0 | 28,994 |
from distutils.core import setup
import os.path, sys
nes_c_lib = 'nes_python_interface/libfceux.so'
if not os.path.isfile(nes_c_lib):
print('ERROR: Unable to find required library: %s. Please ensure you\'ve '\
'built the FCEUX Learning Environment using scons.'%(nes_c_lib))
sys.exit()
setup(name = 'nes_python... | ehrenbrav/FCEUX_Learning_Environment | setup.py | Python | gpl-2.0 | 730 |
import os
import threading
import time
import traceback
from lib.FileManager.FM import REQUEST_DELAY
from lib.FileManager.workers.baseWorkerCustomer import BaseWorkerCustomer
from lib.FileManager.workers.progress_helper import update_progress
class MoveFromFtpToSftp(BaseWorkerCustomer):
def __init__(self, source... | LTD-Beget/sprutio-rpc | lib/FileManager/workers/ftp/moveFromFtpToSftp.py | Python | gpl-3.0 | 9,009 |
from funtests import transport
class test_beanstalk(transport.TransportCase):
transport = "beanstalk"
prefix = "beanstalk"
event_loop_max = 10
message_size_limit = 47662
def after_connect(self, connection):
connection.channel().client
| mzdaniel/oh-mainline | vendor/packages/kombu/funtests/tests/test_beanstalk.py | Python | agpl-3.0 | 266 |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | madgik/exareme | Exareme-Docker/src/exareme/exareme-tools/madis/src/lib/chardet/sjisprober.py | Python | mit | 3,518 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from django.conf import settings
from django.utils.timezone import now
from six import raise_from
from messaging.messages.factory import get_message_type... | ngageoint/scale | scale/messaging/manager.py | Python | apache-2.0 | 5,915 |
"""
Student Views
"""
import datetime
import logging
import uuid
import json
import warnings
from collections import defaultdict
from urlparse import urljoin, urlsplit, parse_qs, urlunsplit
from django.views.generic import TemplateView
from pytz import UTC
from requests import HTTPError
from ipware.ip import get_ip
i... | longmen21/edx-platform | common/djangoapps/student/views.py | Python | agpl-3.0 | 104,661 |
import re
fin = open('in.txt', 'r')
fout = open('out.txt', 'w')
# '2013-08-26 15:00:00'
for line in fin:
if line.startswith('INSERT') and line.find('EXPENSES') != -1:
line = re.sub(r"'(....)-(..)-(..)'", r'\1\2\3', line)
print(line)
fout.write(line)
fin.close()
fout.close() | Lastiritas/Software-Engineering | Tools/date_correct.py | Python | unlicense | 284 |
# supplies the 'copr' command.
#
# Copyright (C) 2014-2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dis... | mineo/dnf-plugins-core | plugins/copr.py | Python | gpl-2.0 | 14,955 |
from sympy.core import S, Add
from sympy.assumptions import Q, ask
from sympy.core.logic import fuzzy_not
def refine(expr, assumptions=True):
"""
Simplify an expression using assumptions.
Gives the form of expr that would be obtained if symbols
in it were replaced by explicit numerical expressions sa... | amitjamadagni/sympy | sympy/assumptions/refine.py | Python | bsd-3-clause | 5,031 |
#!/usr/bin/python
import numpy as np
import scipy.special
import scipy.optimize
import Histogram
import Binning
#import matplotlib.pyplot as p
def TestHistogram():
print("Testing Histogram.Histogram...")
data = np.concatenate((np.linspace(0.0,10,20),np.linspace(0.0,10.0,5)))
bins = np.linspace(0,10,7)
... | dwferrer/loom | Test.py | Python | mit | 2,092 |
from elan import *
#Set_Location_And_Weather_By_Country_City.py
Configurator.Start()
Configurator.Wait()
sleep(3)
Configurator.media.Click()
Configurator.interfacetemplates.Click()
for i in range(100):
try:
Configurator.ComboBox.Select(0,1)
break
except:
sleep(2)
print("Try a... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/elan/onHoldScripts/1_SetIRTemplatesToManual.py | Python | gpl-3.0 | 383 |
# Copyright 2014 LinkedIn Corp.
#
# This file 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; either
# version 2.1 of the License, or (at your option) any later
# version.
#
# This file is distr... | pubnub/Zopkio | zopkio/remote_host_helper.py | Python | apache-2.0 | 6,888 |
#! /usr/bin/env python3
from flask import Flask, request
from flask_restful import Resource, Api
import os
## Import our API components
from routes.history import HistorianView
app = Flask(__name__)
api = Api(app)
## List all the routes we want here:
api.add_resource(HistorianView, '/history')
port = os.getenv('POR... | ckuzma/apartment-internet-heater | heater-backend/server.py | Python | apache-2.0 | 454 |
# This dummy django settings file is used by sphinx while loading
# eulcore.django.* to examine it for autodoc generation.
FEDORA_ROOT = 'dummy root' # NOTE: there are documentation errors without this
| emory-libraries/eulcommon | doc/doc_djangosettings.py | Python | apache-2.0 | 203 |
# Copyright 2014 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.
import os
import unittest
from telemetry import decorators
from telemetry.core import util
from telemetry.core.platform import linux_platform_backend
class... | mohamed--abdel-maksoud/chromium.src | tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py | Python | bsd-3-clause | 1,851 |
import urllib, urllib2
try:
import simplejson as json
except ImportError:
import json
class Zemanta(object):
api_key = None
url = 'http://api.zemanta.com/services/rest/0.0/'
def __init__(self, api_key, relevance):
self.api_key = api_key
self.relevance = relevance
def analyze(... | collective/collective.taghelper | collective/taghelper/zemanta.py | Python | gpl-2.0 | 930 |
from __future__ import print_function
import os
import sys
import csv
from pprint import pprint
from collections import deque
# trace.hpp
REGION_FLAG_IMPL_MASK = 15 << 16;
REGION_FLAG_IMPL_IPP = 1 << 16;
REGION_FLAG_IMPL_OPENCL = 2 << 16;
DEBUG = False
if DEBUG:
dprint = print
dpprint = pprint
else:
def... | zzjkf2009/Midterm_Astar | opencv/modules/ts/misc/trace_profiler.py | Python | mit | 17,326 |
#!/usr/bin/python
"""This script lists classes and optionally attributes from UML model created
with Gaphor."""
import optparse
import sys
from gaphor import UML
from gaphor.application import Session
# Setup command line options.
usage = "usage: %prog [options] file.gaphor"
def main():
parser = optparse.Opti... | amolenaar/gaphor | examples/list_classes.py | Python | lgpl-2.1 | 1,239 |
"""
A few bits of helper functions for comment views.
"""
import textwrap
try:
from urllib.parse import urlencode
except ImportError: # Python 2
from urllib import urlencode
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, resolve_url
from django.template impor... | goldhand/onegreek | onegreek/django_comments/views/utils.py | Python | bsd-3-clause | 2,030 |
from codebase.server.db.db_connection import Database
from codebase.utils.singleton import Singleton
class Model(Database, metaclass=Singleton):
def __init__(self):
self.result = None
super().__init__()
def execute(self, query):
self.cur.execute(query)
self.result = self.cur
... | Kras4ooo/skypy | skypy/codebase/server/db/models.py | Python | mit | 2,684 |
#!/usr/bin/env python3
"""PyBluez simple example asyncronous-inquiry.py
Demonstration of how to do asynchronous device discovery by subclassing
the DeviceDiscoverer class
Linux only (5/5/2006)
Author: Albert Huang <albert@csail.mit.edu>
$Id: asynchronous-inquiry.py 405 2006-05-06 00:39:50Z albert $
"""
import select... | pybluez/pybluez | examples/simple/asynchronous-inquiry.py | Python | gpl-2.0 | 2,044 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L.
# All Rights Reserved.
# http://www.NaN-tic.com
#
# WARNING: This program as such is intended to be used by profe... | mikelarre/odoomrp-wip-1 | quality_control/__openerp__.py | Python | agpl-3.0 | 2,267 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | owlabs/incubator-airflow | tests/contrib/operators/test_gcp_speech_operator_system.py | Python | apache-2.0 | 2,052 |
"""
Khan Academy OAuth backend, docs at:
https://github.com/Khan/khan-api/wiki/Khan-Academy-API-Authentication
"""
import six
from oauthlib.oauth1 import SIGNATURE_HMAC, SIGNATURE_TYPE_QUERY
from requests_oauthlib import OAuth1
from social.backends.oauth import BaseOAuth1
from social.p3 import urlencode
class B... | frankier/python-social-auth | social/backends/khanacademy.py | Python | bsd-3-clause | 4,996 |
import signal
from twisted.internet import reactor, defer
from scrapy.xlib.pydispatch import dispatcher
from scrapy.core.engine import ExecutionEngine
from scrapy.resolver import CachingThreadedResolver
from scrapy.extension import ExtensionManager
from scrapy.utils.ossignal import install_shutdown_handlers, signal_n... | mzdaniel/oh-mainline | vendor/packages/scrapy/scrapy/crawler.py | Python | agpl-3.0 | 3,485 |
"""
Contains the TestInterval class
"""
__all__ = ['TestInterval']
from panda3d.core import *
from panda3d.direct import *
from direct.directnotify.DirectNotifyGlobal import directNotify
from .Interval import Interval
class TestInterval(Interval):
# Name counter
particleNum = 1
# create ParticleInterval... | grimfang/panda3d | direct/src/interval/TestInterval.py | Python | bsd-3-clause | 3,006 |
from lasagne.layers import Layer, InputLayer, DropoutLayer, DenseLayer, NonlinearityLayer, ElemwiseMergeLayer, SliceLayer, ConcatLayer, get_output, get_all_params
from lasagne.objectives import categorical_crossentropy, squared_error, aggregate
from lasagne.nonlinearities import softmax, rectify, sigmoid
from lasagne.u... | SkidanovAlex/ShallowNeuralDecisionForest | src/neuralforestlayer.py | Python | mit | 4,084 |
# -*- coding: utf-8 -*-
#
# biweeklybudget documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 6 16:12:56 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... | jantman/biweeklybudget | docs/source/conf.py | Python | agpl-3.0 | 11,280 |
# 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 program is distributed in the hope that it will be usefu... | joyxu/kernelci-backend | app/handlers/test_case.py | Python | agpl-3.0 | 4,928 |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | amitdeutsch/oppia | core/platform/search/gae_search_services.py | Python | apache-2.0 | 12,354 |
# -*- coding: utf-8 -*-
"""
screensaver.praiaspt
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.
... | cmvac/demagorgon.repository | screensaver.praiaspt/resources/lib/offline.py | Python | gpl-2.0 | 1,902 |
# TO DO - remove sleep when BZ 1496233 is fixed
import time
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic.widget import Text, Select
from widgetastic_patternfly import Input, Button
from cfme.base.ssui import SSUIBaseLoggedInPage
from cfme.common.vm import VM
from cfme.utils.appliance ... | akarol/cfme_tests | cfme/services/myservice/ssui.py | Python | gpl-2.0 | 10,141 |
# -*- coding: UTF-8 -*-
#! /usr/bin/python
import matplotlib.pyplot as plt
import numpy as np
from time import time
from pigasus.fem.basicPDE import basicPDE
from caid.cad_geometry import cad_geometry, cad_nurbs
from caid.cad_geometry import square as patch
from caid.core.bspline import bsp
from scip... | ratnania/pigasus | python/fit/surfit.py | Python | mit | 16,761 |
'''
Example 32: Construct World and 2 Populations from scratch (Example 31
is constructing 1 population from scratch).
In this simulation,
- construct world
- construct 1 population of 5 organisms with different genome
for each organism
- 100 generations to be simulated
'''
# needed to run this examp... | mauriceling/dose | examples/32_construct_simulation.py | Python | gpl-3.0 | 9,213 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 7, transform = "Fisher", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Fisher/trend_Lag1Trend/cycle_7/ar_12/test_artificial_1024_Fisher_Lag1Trend_7_12_0.py | Python | bsd-3-clause | 262 |
from django.contrib import admin
from v1.models import *
@admin.register(Choice)
class ChoiceAdmin(admin.ModelAdmin):
pass
@admin.register(Poll)
class PollAdmin(admin.ModelAdmin):
pass
| szborows/simplestv | backend/v1/admin.py | Python | mit | 196 |
# Factory to parse source from different sources and give source objects back.
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your optio... | jkonecny12/anaconda | pyanaconda/payload/source/factory.py | Python | gpl-2.0 | 4,246 |
import os
from celery.schedules import crontab
from getconf import ConfigGetter
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
config = ConfigGetter('backbone')
SECRET_KEY = config.get('django.secret_key', 'secret')
DEBUG = config.getbool('django.debug', True)
ALLOWED_HOSTS = config.getlist('django.allowe... | xavierdutreilh/robots.midgar.fr | services/backbone/backbone/settings.py | Python | mit | 4,449 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Abilities',
fields=[
('id', models.AutoField(ve... | locolan/pokepy | pokepy/migrations/0001_initial.py | Python | mit | 1,312 |
from django.contrib import admin
# Register your models here.
from .models import Recipe, RecipeCollection, Tag
class RecipeAdmin(admin.ModelAdmin):
list_display = ('title', 'url')
admin.site.register(Recipe, RecipeAdmin)
admin.site.register(RecipeCollection)
admin.site.register(Tag)
| agnethesoraa/recipemaster | recipemaster/recipes/admin.py | Python | mit | 294 |
from core.himesis import Himesis
import uuid
class HState2CProcDef(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule State2CProcDef.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HState2CProcDef, self).__init__(name='HState2CProcDef', num_... | levilucio/SyVOLT | UMLRT2Kiltera_MM/transformation/from_MPS/HState2CProcDef.py | Python | mit | 9,116 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Akretion (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the... | damdam-s/OpenUpgrade | addons/account/migrations/8.0.1.1/pre-migration.py | Python | agpl-3.0 | 2,404 |
"""
Tests for generate_course_blocks management command.
"""
from django.core.management.base import CommandError
from mock import patch
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ... | solashirai/edx-platform | lms/djangoapps/course_blocks/management/commands/tests/test_generate_course_blocks.py | Python | agpl-3.0 | 3,370 |
from __future__ import absolute_import, unicode_literals
from .premailer import Premailer, transform
__version__ = '2.9.4'
| industrydive/premailer | premailer/__init__.py | Python | bsd-3-clause | 124 |
from django.db import models
from articles.models import Article
# Class representation of a database table
class Comment(models.Model):
article = models.ForeignKey(Article)
content = models.TextField()
created_by = models.CharField(max_length=20)
created_at = models.DateField(auto_now_add=True)
... | Jpadilla1/django-workshop | Day_2/comments/models.py | Python | mit | 372 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from django.conf import settings
from exam import fixture
from sentry.models import Project
from sentry.testutils import TestCase
from sentry.utils.http import (
is_same_domain, is_valid_origin, get_origins, absolute_uri)
class Absolut... | boneyao/sentry | tests/sentry/utils/http/tests.py | Python | bsd-3-clause | 6,998 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2013 IBM Corp
#
# Author: Tong Li <litong01@us.ibm.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | NeCTAR-RC/ceilometer | ceilometer/tests/dispatcher/test_db.py | Python | apache-2.0 | 3,847 |
import re
import asyncio
import requests
from bs4 import BeautifulSoup
from cloudbot import hook
from cloudbot.util import web, formatting
class SCPError(Exception):
pass
SCP_SEARCH = "http://www.scp-wiki.net/search:site/q/{}"
NAME_LISTS = ["http://www.scp-wiki.net/joke-scps", "http://www.scp-wiki.net/archived... | CloudBotIRC/Plugins | scp.py | Python | gpl-3.0 | 4,201 |
import pytz
from django.apps import apps
from django.db.models import Exists, F, OuterRef, Q
from api.addons.views import AddonSettingsMixin
from api.base import permissions as base_permissions
from api.base.exceptions import Conflict, UserGone
from api.base.filters import ListFilterMixin, PreprintFilterMixin
from ap... | caseyrollins/osf.io | api/users/views.py | Python | apache-2.0 | 33,006 |
import smtplib, sys, json
def read_in():
lines = sys.stdin.readlines()
#Since our input would only be having one line, parse our JSON data from that
return json.loads(lines[0])
def send_email(user, pwd, recipient, subject, body):
gmail_user = user
gmail_pwd = pwd
FROM = user
TO = recipient... | ZelAk312/SelfBot | python/emails.py | Python | apache-2.0 | 1,075 |
"""
Test the publish code (mostly testing that publishing doesn't result in orphans)
"""
from nose.plugins.attrib import attr
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.tests.test_split_w_old_mongo import SplitWMongoCourseBoostr... | olexiim/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_publish.py | Python | agpl-3.0 | 7,471 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Chaoliang Zhong'
' url handlers '
import re, time, json, logging, hashlib, base64, asyncio, datetime, random
from datetime import timedelta
from aiohttp import web
from coroweb import get, post
from apis import APIValueError, APIResourceNotFoundError, API... | charliezon/stock | www/handlers.py | Python | mit | 101,491 |
SECRET_KEY = "some value so that django>1.5 won't fail when this is empty"
| jaysonsantos/django-bmemcached | tests/settings.py | Python | mit | 75 |
# -*- coding: utf-8 -*-
"""
Custom extensions to Series/GeoSeries and DataFrame/GeoDataFrame from pandas/geopandas.
"""
from __future__ import unicode_literals
import datetime as dt
import collections
from types import NoneType
import pandas as pd
import geopandas as gp
import numpy as np
import shapely.geometry
imp... | hsr-ba-fs15-dat/opendatahub | src/main/python/hub/structures/frame.py | Python | mit | 15,314 |
# © 2016 Lorenzo Battistini - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Pickings back to draft",
"summary": "Reopen cancelled pickings",
"version": "14.0.1.0.0",
"category": "Warehouse Management",
"website": "https://github.com/OCA/stock-logisti... | OCA/stock-logistics-workflow | stock_picking_back2draft/__manifest__.py | Python | agpl-3.0 | 589 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 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) any later... | Panos512/inspire-next | inspirehep/modules/records/serializers/cvformattext_serializer.py | Python | gpl-2.0 | 2,308 |
from setuptools import setup
setup(
name="logstash2csv",
version="0.1",
install_requires=["elasticsearch"])
| KIWIKIGMBH/logstash2csv | setup.py | Python | mpl-2.0 | 122 |
"""Options for the JSON API plugin"""
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals
import oz
oz.option("allow_jsonp", type=bool, default=True, help="Whether to allow for JSONP requests")
| dailymuse/oz | oz/json_api/options.py | Python | bsd-3-clause | 243 |
# OpenShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas
#
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
#
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | XXLRay/libreshot | libreshot/blender/scripts/lens_flare.py | Python | gpl-3.0 | 7,662 |
""" Views for a student's profile information. """
from badges.utils import badges_enabled
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.exceptions import ObjectDoesNotExist
from django.urls... | ahmedaljazzar/edx-platform | openedx/features/learner_profile/views/learner_profile.py | Python | agpl-3.0 | 6,948 |
from math import cos, sin
from ..geometry.orientation import Orientation
from ..geometry.vec3 import XAxis
class Spinner(object):
def __init__(self, speed=1.0):
self.speed = speed
self.orientation = Orientation(XAxis)
def __call__(self, time, dt):
self.orientation.pitch(sin(time.cu... | tartley/flyinghigh-opengl-from-python | flyinghigh/component/spinner.py | Python | bsd-3-clause | 462 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
import logging
from google.appengine.api import urlfetch
from config.template_middleware import TemplateResponse
from gaebusiness.business import CommandParallel
from gaebusiness.gaeutil import UrlFetchCommand
from gaecookie.de... | renzon/appengineepython | backend/appengine/routes/github.py | Python | mit | 1,335 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-10-16 05:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ContestAnalyzerOnline', '0008_post'),
]
operations = [
migrations.AddField(... | rogercaminal/HamToolsManager | ContestAnalyzerOnline/utils/migrations/0009_post_title.py | Python | mit | 459 |
import itertools
def topological_order(graph):
global current_label
current_label = len(graph)
global label_offset
label_offset = -1
global ordered_graph
ordered_graph = {}
explored_nodes = []
for node in graph:
if node not in explored_nodes:
explored_nodes.extend(df... | Preston4tw/elearning | coursera/algo-pt1/week4/graph_primitives.py | Python | mit | 3,909 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | karllessard/tensorflow | tensorflow/python/kernel_tests/random/random_ops_test.py | Python | apache-2.0 | 17,192 |
from frappe import _
def get_data():
return {
'fieldname': 'prevdoc_docname',
'non_standard_fieldnames': {
'Auto Repeat': 'reference_document',
},
'transactions': [
{
'label': _('Sales Order'),
'items': ['Sales Order']
},
{
'label': _('Subscription'),
'items': ['Auto Repeat']
},... | ESS-LLP/erpnext-medical | erpnext/selling/doctype/quotation/quotation_dashboard.py | Python | gpl-3.0 | 327 |
from flask import url_for, current_app, render_template
import mandrill
from itsdangerous import URLSafeTimedSerializer
from datetime import datetime
from dmutils.formats import DATETIME_FORMAT
from .. import main
def send_password_email(user_id, email_address, locked):
try:
mandrill_client = mandrill.Ma... | mtekel/digitalmarketplace-supplier-frontend | app/main/helpers/email.py | Python | mit | 2,664 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.