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
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 = "LinearTrend", cycle_length = 12, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_Quantization/trend_LinearTrend/cycle_12/ar_/test_artificial_32_Quantization_LinearTrend_12__20.py
Python
bsd-3-clause
269
""" WSGI config for roombox 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
speedlight/roombox
roombox/wsgi.py
Python
gpl-3.0
391
# -*- coding: utf-8 -*- from PySide import QtCore, QtGui import rcc_rc from core import * class View(object): def setupUi(self, mainForm): mainForm.setObjectName("mainForm") mainForm.resize(714, 675) mainForm.setMinimumSize(QtCore.QSize(714, 675)) mainForm.setMaximum...
bodik10/Combinatorics
view.py
Python
gpl-3.0
25,063
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
adaitche/luigi
luigi/scheduler.py
Python
apache-2.0
66,533
""" Test for contentstore signals receiver """ import mock from nose.plugins.attrib import attr from django.test import TestCase from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore, SignalHandler @attr(shard=2) class CCXConSignalTestCase(TestCase): """ The only test...
louyihua/edx-platform
openedx/core/djangoapps/ccxcon/tests/test_signals.py
Python
agpl-3.0
1,121
from django.conf.urls import url from django.contrib.admindocs import views urlpatterns = [ url('^$', views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'), name='django-admindocs-docroot'), url('^bookmarklets/$', views.BookmarkletsView.as_view(), name='django-ad...
BitWriters/Zenith_project
zango/lib/python3.5/site-packages/django/contrib/admindocs/urls.py
Python
mit
1,183
class Solution(object): def containsNearbyAlmostDuplicate(self, nums, k, t): """ :type nums: List[int] :type k: int :type t: int :rtype: bool """ if k < 1 or t < 0: return False dic = {} t += 1 for i in range(len(nums)): ...
rx2130/Leetcode
python/220 Contains Duplicate III.py
Python
apache-2.0
777
import logging import sys import os import signal from pyramid.scripts.common import parse_vars from pyramid.paster import get_appsettings, setup_logging from sqlalchemy import engine_from_config from c2corg_api.models import Base, DBSession from c2corg_api.jobs import configure_scheduler_from_config log = logging....
c2corg/v6_api
c2corg_api/scripts/jobs/scheduler.py
Python
agpl-3.0
991
# gcompris - play_rhythm.py # # Copyright (C) 2012 Beth Hadley # # 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...
bdoin/GCompris
src/play_rhythm-activity/play_rhythm.py
Python
gpl-3.0
18,316
from algorithms.hiding import * from algorithms.reading import * from iooperations import * from tkinter import * from tkinter import ttk from tkinter.filedialog import askopenfilename, asksaveasfile from PIL import Image, ImageTk import os.path class MainWindow(Frame): def __init__(self): Frame.__init__...
AdvenamTacet/Smuggler
src/gui.py
Python
mit
7,692
# -*- coding: utf-8 -*- #= DESCRIZIONE ================================================================= # - Dai un pesce alla gatta e lei in tutta risposta ti vomita una palla di pelo # e alla fine si mangia il pesce che le hai portato. # - Se però ciò che le dai è qualcosa che ha a che fare con gli agrumi ti #...
Onirik79/aaritmud
data/proto_mobs/villaggio-zingaro/villaggio-zingaro_mob_gattaccio-grizabella.py
Python
gpl-2.0
5,626
# -*- coding: utf-8 -*- """ =========== mtplottools =========== Contains helper functions and classes for plotting @author: jpeacock-pr """ #============================================================================== import numpy as np import os import mtpy.core.edi as mtedi import mtpy.core.z as mtz import mtp...
geophysics/mtpy
mtpy/imaging/mtplottools.py
Python
gpl-3.0
86,444
from particle import Particle # A subclass of Particle class CrazyParticle(Particle): # Just adding one variable to a CrazyParticle. # It inherits all other fields from "Particle", and we don't have to # retype them! # The CrazyParticle constructor can call the parent class (super class) # c...
kantel/processingpy
sketches/modes/PythonMode/examples/Topics/Simulate/MultipleParticleSystems/crazy_particle.py
Python
mit
1,368
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2009-2015 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' This file contains a few convenience functions that are used throughout the code. ''' import string, re, subprocess, sys from xml.dom ...
armijnhemel/binaryanalysis
src/bat/extractor.py
Python
apache-2.0
6,987
# # Copyright 2008,2009 Free Software Foundation, Inc. # # This application 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, or (at your option) # any later version. # # This application is ...
ckuethe/gr-chancoding
python/__init__.py
Python
gpl-3.0
1,701
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2017 damian <damian@damian-work> # from functools import wraps from djangoCeleryRabbitMQRedis.celeryconf import app from .models import Job # decorator to avoid code duplication def update_job(fn): """Decorator that will update J...
xmementoit/practiseSamples
django/djangoCeleryRabbitMQRedisApp/djangoCeleryRabbitMQRedis/djangoCeleryRabbitMQRedis/tasks.py
Python
apache-2.0
1,451
# Copyright (c) 2014 Katsuya Noguchi # # 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, dis...
DavidHHShao/slack
slack/chat.py
Python
mit
1,614
from models import User from google.appengine.ext import ndb from datetime import timedelta, datetime import logging import urllib import urllib2 import socket import os import json import config from shared import config import socket isDevEnv = True if 'localhost' in socket.gethostname() else False # Get AT from ca...
dstrockis/outlook-autocategories
shared/auth.py
Python
apache-2.0
5,109
import datetime from django.contrib.auth.models import User from django.db import models class SavedSearchManager(models.Manager): def most_recent(self, user=None, search_key=None, collapsed=True, threshold=1): """ Returns the most recently seen queries. By default, only shows col...
django-haystack/saved_searches
saved_searches/models.py
Python
bsd-3-clause
3,376
""" This module allows one to use SWIG2 (SWIG version >= 1.3) wrapped objects from Weave. SWIG-1.3 wraps objects differently from SWIG-1.1. This module is a template for a SWIG2 wrapped converter. To wrap any special code that uses SWIG the user simply needs to override the defaults in the swig2_converter class. Th...
sargas/scipy
scipy/weave/swig2_spec.py
Python
bsd-3-clause
14,254
from django import template register = template.Library() @register.inclusion_tag('user/user_list.html', takes_context=True) def user_list(context, users, title): info = {'users': users, 'title': title} if 'event' in context: info['object'] = context['event'] return info @register.inclusion_tag...
internship2016/sovolo
app/user/templatetags/user_tags.py
Python
mit
902
import sublime, sublime_plugin from subprocess import call import os, sys, re from operator import attrgetter from datetime import datetime, date from collections import namedtuple, Counter from .lib import trollop from .lib import sublime_requests as requests from .models import Task, Section, Statistics, DaySlot, hu...
pedrokost/STProjectPlanner
ProjectPlannerTrello.py
Python
gpl-2.0
17,850
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsFileUtils. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __au...
mhugo/QGIS
tests/src/python/test_qgsfileutils.py
Python
gpl-2.0
5,968
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright © 2012 eNovance <licensing@enovance.com> # # Author: Julien Danjou <julien@danjou.info> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the Lice...
citrix-openstack-build/ceilometer
tests/test_service.py
Python
apache-2.0
5,711
# -*- encoding: utf-8 -*- from django import forms class UploadDataForm(forms.Form): name = forms.CharField(required=True) description = forms.CharField(required=True, widget=forms.Textarea) data_set_file = forms.FileField(required=True)
ssoto/hack4medAND
lisa_graph/lisa_search/forms.py
Python
gpl-2.0
251
#!/usr/bin/env python import token from grammar import Grammar from translator import Translator import special from tokens import * # vim: et sw=4 sts=4
jaredly/codetalker
codetalker/pgm/__init__.py
Python
mit
156
# -*- coding: utf-8; -*- # # Copyright (c) 2016 Álan Crístoffer # # 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, ...
acristoffers/moirai
moirai/hardware/pid.py
Python
mit
6,572
from django.shortcuts import render, redirect, get_object_or_404 from django.core.exceptions import PermissionDenied from django.contrib.auth import logout, login, authenticate from django.contrib.auth.decorators import login_required, user_passes_test from django.http import HttpResponse, Http404 from .form_utilities ...
harlanhaskins/QuoteMaker
QuoteMaker/quote/views.py
Python
mit
7,022
# Copyright (c) 2008 Resolver Systems Ltd # # 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,...
mzdaniel/oh-mainline
vendor/packages/sessionprofile/sessionprofile/models.py
Python
agpl-3.0
2,146
import unittest from ddby import Money class TestMoney(unittest.TestCase): def test_adding_two_monies(self): m1 = Money(500, 'USD') m2 = Money(200, 'USD') actual = m1 + m2 expected = Money(700, 'USD') assert actual == expected def test_subtracting_two_monies(self): ...
btoconnor/ddby
tests/test_math.py
Python
mit
2,038
#!/usr/bin/env python3 import math def comm_tfidf(topicList,idfDict,topWordsNum): scores = {word: tfidf(word, topicList, idfDict) for word in topicList} word_ranking = sorted(scores.items(), key=lambda x: x[1], reverse=True) myDict=word_ranking[:topWordsNum] return myDict def tf(word, topicList): ...
dinos66/commRankingMine
tfidf.py
Python
apache-2.0
580
#!/usr/bin/env python3 # Demo that makes one Crazyflie take off 30cm above the first controller found # Using the controller trigger it is then possible to 'grab' the Crazyflie # and to make it move. # If the Crazyflie has a ledring attached, the touchpad of the controller can # be used to change the color of the led-r...
bitcraze/crazyflie-lib-python
examples/lighthouse/lighthouse_openvr_grab_color.py
Python
gpl-2.0
6,812
#Author: Pradeep Ravilla from pprint import pprint from time import time import sys from collections import defaultdict categories = defaultdict(int) with open("categorycount.pickle") as picklefile: categories = pickle.load(picklefile) sortedList = sorted(categories.items(), key = lambda x:x[1], reverse=True) for c...
njetty/Yelp-Review-Analysis
Task1/SortCategories.py
Python
mit
349
"""module containing some general language-related functions""" import sys import os def warn(options, message): if options.NOWARN: return print "[warn] %s" % message def list2human_str(the_list, final_seperator = "and"): """convert a python list instance to english""" if not the_list: return "" if len(th...
mulllhausen/btc-inquisitor
lang_grunt.py
Python
gpl-2.0
684
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # # 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; eith...
pmghalvorsen/gramps_branch
gramps/gen/filters/rules/place/_hascitation.py
Python
gpl-2.0
1,924
from test_methods import TestBaseFeedlyClass
pedroma/python-feedly
tests/__init__.py
Python
lgpl-3.0
44
# Copyright 2013 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 list of conditions and t...
vasiliykochergin/euca2ools
euca2ools/commands/autoscaling/describenotificationconfigurations.py
Python
bsd-2-clause
2,629
# -*- coding: utf-8 -*- ############################################################################### import logging import xbmc import xbmcaddon import PlexFunctions as PF import embydb_functions as embydb from utils import window, settings, dialog, language as lang, kodiSQL from dialogs import context ########...
troych/PlexKodiConnect
resources/lib/context_entry.py
Python
gpl-2.0
7,233
""" Copyright 2015 BlazeMeter 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, software...
itaymendel/taurus
bzt/modules/shellexec.py
Python
apache-2.0
6,923
#! /bin/env/python from gi.repository import GLib import subprocess import dbus import datetime import threading import time from dbus.mainloop.glib import DBusGMainLoop messages = [] messages_map = {} counter = 1 cco = 1 def curTime(): ts = datetime.datetime.timestamp(datetime.datetime.now()) return ts d...
davidrlunu/dots-and-dashes
conky_OPSAT_v1.10/dbus-mon.py
Python
gpl-3.0
2,464
# galene # # Copyright (c) 2012-2013 Vita Smid <http://ze.phyr.us> class Output: ''' Single-point output filter with configurable verbosity levels. ''' ERR = 1 # error WARN = 2 # warning NOTICE = 3 DEBUG = 4 def __init__(self, level, stream = None): self.level = level if stream is None: import sys ...
ze-phyr-us/galene
utils/Output.py
Python
mit
580
from invoke import task, Context from fabric import Connection @task def build(c): pass @task def deploy(c): pass @task def basic_run(c): c.run("nope") @task def expect_vanilla_Context(c): assert isinstance(c, Context) assert not isinstance(c, Connection) @task def expect_from_env(c): ...
fabric/fabric
tests/_support/fabfile.py
Python
bsd-2-clause
1,217
import optparse, math parser = optparse.OptionParser() parser.add_option('-W', '--width', dest='width', type=int, help='Width of the canvas.') parser.add_option('-H', '--height', dest='height', type=int, help='Height of the canvas.') parser.add_option('-b', '--bpp', dest='bpp', default=0.5, type=float, help='Bytes per...
COSI-Lab/place
make_bitmap.py
Python
agpl-3.0
573
import unittest import numpy import chainer from chainer.backends import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.with_requires('theano') class TheanoFunctionTestBase(object): fo...
aonotas/chainer
tests/chainer_tests/links_tests/theano_tests/test_theano_function.py
Python
mit
5,778
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Utilities module.""" def parse_ignore_file(filename, dirname): """ Parse the ignore file and return a list of ignore patterns. Each pattern has the complete file path so we can take into account ignore at different levels. :param filename: The name of...
varunagrawal/nuke
nuke/utils.py
Python
mit
1,334
# # Copyright 2015 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 writi...
google/strabo
client/python/setup.py
Python
apache-2.0
1,044
"""empty message Revision ID: 0061 orders txn_id unique Revises: 0060 set all show_banner_text Create Date: 2021-11-13 01:20:44.784284 """ # revision identifiers, used by Alembic. revision = '0061 orders txn_id unique' down_revision = '0060 set all show_banner_text' from alembic import op import sqlalchemy as sa ...
NewAcropolis/api
migrations/versions/0061.py
Python
mit
1,306
# coding: utf-8 import re import os from fabkit import api, run, sudo, filer, env, user from fablib import git from fablib.base import SimpleBase class Python(SimpleBase): def __init__(self, prefix='/usr'): self.prefix = prefix self.packages = { 'CentOS Linux 7.*': [ '...
fabrickit-fablib/python
__init__.py
Python
mit
5,162
from django.core.management.base import BaseCommand from core.editor.tasks import _handle_issue_submission_archival_and_files_deletion class Command(BaseCommand): def handle(self, *args, **options): _handle_issue_submission_archival_and_files_deletion()
erudit/zenon
eruditorg/core/editor/management/commands/handle_issue_submission_archival_and_files_deletion.py
Python
gpl-3.0
269
from django.shortcuts import render_to_response, get_object_or_404 from django.views.decorators.http import require_POST from django.http import HttpResponseRedirect from django.apps import apps from django.core.urlresolvers import reverse from django.utils.translation import ugettext, ugettext_lazy as _ from django.te...
leotrubach/django-attachments
attachments/views.py
Python
bsd-3-clause
2,042
# Copyright 2021 Google LLC. # # 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, ...
google-research/pathdreamer
models/point_cloud_models.py
Python
apache-2.0
13,213
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-31 14:32 from __future__ import unicode_literals from django.db import migrations import select_multiple_field.models class Migration(migrations.Migration): dependencies = [ ('survey', '0015_auto_20160531_1422'), ] operations = [ ...
simonspa/django-datacollect
datacollect/survey/migrations/0016_auto_20160531_1632.py
Python
gpl-3.0
1,319
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
gochist/horizon
horizon/test/urls.py
Python
apache-2.0
1,635
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap class drake_passage_map(object): """ a class that represents the Drake Passage Basemap object """ def __init__( self, lonmin=-75, lonmax=-50, latmin=-67, latmax=-50, ...
crocha700/dp_spectra
src/dp_map.py
Python
mit
1,801
from collections import OrderedDict from roam.editorwidgets.core.editorwidgetbase import EditorWidget from roam.editorwidgets.core.largeeditorwidgetbase import LargeEditorWidget from roam.editorwidgets.core.exceptions import EditorWidgetException, RejectedException widgets = OrderedDict() def registerwidgets(*widge...
DMS-Aus/Roam
src/roam/editorwidgets/core/__init__.py
Python
gpl-2.0
2,230
# # 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 "License"); you may not us...
manuzhang/beam
sdks/python/apache_beam/runners/worker/sdk_worker_test.py
Python
apache-2.0
6,537
#!/usr/bin/env python #from distutils.core import setup from setuptools import setup import subprocess import os import platform import re def get_pi_version(): pi_versions = { "0002" : "Model B Revision 1.0", "0003" : "Model B Revision 1.0", "0004" : "Model B Revision 2.0", "0005" : "Model B Revision 2.0", ...
EmbeditElectronics/Python_for_PSoC
API_Python/setup.py
Python
mit
3,289
""" Defines actions such as MoveTo or FadeOut which incrementally perform small changes in intervals over a period of time. """ from Action import * from InstantAction import * from Geometry import * from Color import * from ListenedObject import * import math # TODO: Make the Animate class, fix up Sprite to handle ...
jeremyflores/cocosCairo
cocosCairo/IntervalAction.py
Python
mit
29,030
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
SUSE/azure-sdk-for-python
azure-batch/azure/batch/models/account_list_node_agent_skus_options.py
Python
mit
2,070
from __future__ import print_function import numpy as np import scipy.sparse as sp import warnings from abc import ABCMeta, abstractmethod from . import libsvm, liblinear from . import libsvm_sparse from ..base import BaseEstimator, ClassifierMixin from ..preprocessing import LabelEncoder from ..utils.multiclass impo...
meduz/scikit-learn
sklearn/svm/base.py
Python
bsd-3-clause
34,587
class Singleton(type): """ Make class singleton when this class set as metaclass http://stackoverflow.com/questions/6760685/creating-a-singleton-in-python """ _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(Single...
colajam93/aurpackager
lib/singleton.py
Python
mit
391
""" Extensions called during training to generate samples and diagnostic plots and printouts. """ import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import numpy as np import os import theano.tensor as T import theano from blocks.extensions import SimpleExtension import viz import sampler clas...
Sohl-Dickstein/Diffusion-Probabilistic-Models
extensions.py
Python
mit
9,752
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy import time import pypot.primitive class QuestionBehave(pypot.primitive.Primitive): def run(self): poppy = self.robot for m in poppy.arms : m.compliant = False """ poppy.r_shoulder_y.moving_speed = abs(-20 - p...
jerome-guichard/primitiveWS
cherry/primitives/question.py
Python
gpl-3.0
1,848
# import libraries import pandas as pd import matplotlib.pyplot as plt import random as rd import numpy as np # take a url of the csv or can read the csv locally into a pandas data frame data = pd.read_csv("/robot_data.csv") # eventually get the data from the csv into robot objects # maybe get rid of this and ju...
cougarTech2228/Scouting-2016
notebooks/robo_0.py
Python
mit
752
import json from requests import post import logging as log import configparser from os.path import join, dirname # read configuration config = configparser.ConfigParser() config.read(join(dirname(__file__),'../config/disambiguation.conf')) def spotlight(tokenized): # mapping character offset to token offset ...
valeriobasile/learningbyreading
src/spotlight.py
Python
gpl-2.0
1,579
# fMBT, free Model Based Testing tool # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distribut...
01org/fMBT
utils/fmbtpng.py
Python
lgpl-2.1
6,813
from .rarity import RarityStrategy
vtemian/university_projects
data_structures/bitorrent/client/strategies/__init__.py
Python
apache-2.0
35
# -*- coding: utf-8 -*- import os from django.conf import settings as django_settings THUMBNAIL_PATH = os.path.join(django_settings.MEDIA_ROOT, 'thumbnails-cache') THUMBNAIL_URL = django_settings.MEDIA_URL + 'thumbnails-cache' THUMBNAIL_CACHE_BACKEND = 'thumbnails.cache_backends.DjangoCacheBackend' THUMBNAIL_STORAGE_...
python-thumbnails/python-thumbnails
thumbnails/conf/defaults_django.py
Python
mit
381
#!/usr/bin/env python import sys import numpy as np import struct if len(sys.argv) != 3: print >> sys.stderr, "usage: %s <tap_index> <offset_list>" % sys.argv[0] print >> sys.stderr, " <offset_list> should be a file with offsets into the memory dump, one per line" sys.exit(1) f = open(sys.argv[1], 'rb')...
KernelAnalysisPlatform/kvalgrind
scripts/idxmap.py
Python
gpl-3.0
719
l = input() s = input().split() i = int(s[0]) c = s[1] print(s[ : i] + c + s[i + 1 : ])
ehouarn-perret/EhouarnPerret.Python.HackerRank
HackerRank/6 - Python/Strings/3 - Mutations.py
Python
mit
87
from google.appengine.api import apiproxy_stub_map import os have_appserver = bool(apiproxy_stub_map.apiproxy.GetStub('datastore_v3')) if have_appserver: appid = os.environ.get('APPLICATION_ID') else: try: from google.appengine.tools import dev_appserver from .boot import PROJECT_DIR #...
texcaltech/windmilltownhomes-old
djangoappengine/utils.py
Python
bsd-3-clause
761
# Driver for a StepMotor to rotate a phase shifter # @KIT 2018 TW # # 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. # # ...
qkitgroup/qkit
qkit/drivers/StepMotor.py
Python
gpl-2.0
5,735
# -*- coding: utf-8 -*- import datetime import calendar import operator from math import copysign from six import integer_types from warnings import warn from ._common import weekday MO, TU, WE, TH, FR, SA, SU = weekdays = tuple([weekday(x) for x in range(7)]) __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "F...
amisrs/one-eighty
venv2/lib/python2.7/site-packages/dateutil/relativedelta.py
Python
mit
21,986
# -*- coding: utf-8 -*- # This file is part of Dyko # Copyright © 2008-2010 Kozea # # This library 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 lat...
Kozea/Dyko
kalamar/access_point/xml/rest.py
Python
gpl-3.0
5,053
# Copyright (C) 2016 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe 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) ...
NcLang/vimrc
sources_non_forked/YouCompleteMe/python/ycm/tests/youcompleteme_test.py
Python
mit
1,289
from django.conf.urls.defaults import * urlpatterns = patterns( 'lava_markitup.views', url('^markdown/$', 'preview_markdown', name='lava.markitup.markdown'), )
OSSystems/lava-server
lava_markitup/urls.py
Python
agpl-3.0
170
from ase import Atoms from ase.calculators.emt import EMT atom = Atoms('N', calculator=EMT()) e_atom = atom.get_potential_energy() d = 1.1 molecule = Atoms('2N', [(0., 0., 0.), (0., 0., d)]) molecule.set_calculator(EMT()) e_molecule = molecule.get_potential_energy() e_atomization = e_molecule - 2 * e_atom print('Ni...
misdoro/python-ase
doc/tutorials/N2.py
Python
gpl-2.0
472
# -*- coding: utf-8 -*- # (c) 2017, Brian Coca <bcoca@ansible.com> # (c) 2017, Adam Miller <admiller@redhat.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ...
ansible/ansible
lib/ansible/modules/sysvinit.py
Python
gpl-3.0
13,798
import time import unittest from pypipeline.components.source.Timer import Timer from pypipeline.core.Destination import Destination from pypipeline.core.DslPipelineBuilder import DslPipelineBuilder from pypipeline.core.Plumber import Plumber from pypipeline.core.Property import Property class DynamicRouterTest(unit...
vaibhav-sinha/pypipeline
pypipeline/test/eip/DynamicRouterTest.py
Python
gpl-3.0
1,102
# -*- coding: utf-8 -*- from model.group import Group def test_add_group(app): app.session.login(username="admin", password="secret") app.group.create(Group(name="test1", header="test1", footer="test1")) app.session.logout() def test_add_empty_group(app): app.session.login(username="admin", passwor...
alexzoo/python
selenium_tests/test/test_add_group.py
Python
apache-2.0
416
# -- coding: utf-8 -- ########################################################################### # # # WebText # # ...
lutcheti/webtext
src/request/backends/BackendWiki.py
Python
gpl-3.0
9,114
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations CREATE_PROPOSAL_SCHEMA = """ CREATE FUNCTION proposals_tutorialproposal_id_generator(OUT result bigint) AS $$ DECLARE -- 2015-08-19T00:00:00Z. This is arbitrarily chosen; anything is ...
pycontw/pycontw2016
src/postgres/migrations/0003_rename_proposal_generated_id.py
Python
mit
1,873
# -*- coding: utf-8 -*- from django.test import TestCase from dj_oydiv.config import config class DefaultConfigTests(TestCase): def test_overrides(self): """Ensure that settings are overriden in the config object when the user has defined the corresponding variable in settings.py ...
ajenta/dj-oydiv
tests/test_config.py
Python
bsd-3-clause
529
"""This file has list of various build rules to be tested.""" SKIPPED_BUILD_COUNT = 74 # Regression tests. REG_BUILD_RULES = [ 'mool.croot.samples.PersonJavaProto', 'mool.jroot.src.main.java.some.work.DriverFromMavenSpec', 'mool.jroot.src.main.java.some.work.DriverWithReducedDeps', 'mool.jroot.src.mai...
jkumarrf/mool
build_tool/mool_test_drivers/tests_config.py
Python
bsd-3-clause
11,028
# -*- coding: utf-8 -*- # © 2009 Pexego/Comunitea # © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0). from openerp import api, fields, models, _ _VALUE_FORMULA_HELP = ( """Value calculation formula: Depending on this formula the final value is calculated as follows: ...
RamonGuiuGou/l10n-spain
account_balance_reporting/models/account_balance_reporting_template.py
Python
agpl-3.0
7,101
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __date__ = '18 February 2010' __copyright__ = 'Copyright (c) 2010 Viktor Kerkez' from PyQt4 import QtCore, QtGui from PyQt4.QtCore import Qt from tea.logger import * class Model(QtCore.QAbstractItemModel): def __init__(self, parent, headers_func): ...
alefnula/perart
src/tea/qt/modelview.py
Python
gpl-3.0
5,240
__author__ = 'DownGoat' from pyfeedreader.forms.directoryforms import NewDirForm, AddFeedDirForm from pyfeedreader.models.category import Category from pyfeedreader.models.category_entry import CategoryEntry from pyfeedreader.models.userfeeds import UserFeeds from flask import * from pyfeedreader.database import db_se...
DownGoat/PyFeedReader
pyfeedreader/views/directory.py
Python
gpl-3.0
2,207
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Time-lapse with Rasberry Pi controlled camera - Main method VER 5.0 for Python 3.9+ Copyright (C) 2016-2021 Istvan Z. Kovacs This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published b...
istvanzk/rpicampy
rpicam_sch.py
Python
gpl-3.0
18,552
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011-2017 QUIVAL, S.A. All Rights Reserved # $Pedro Gómez Campos$ <pegomez@elnogal.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
ELNOGAL/CMNT_00040_2016_ELN_addons
eln_reports/report/stock_picking/stock_picking_out_std_report_parser_2x.py
Python
agpl-3.0
1,337
# # 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 # "License"); you may not...
Teino1978-Corp/Teino1978-Corp-helix
contributors/py-helix-admin/helix/participant.py
Python
apache-2.0
3,017
#!/usr/bin/env python3 # Copyright 2019 The Kubeflow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
kubeflow/pipelines
samples/core/xgboost_training_cm/xgboost_training_cm.py
Python
apache-2.0
10,091
"""The scene tests for the myq platform.""" from homeassistant.const import STATE_CLOSED from .util import async_init_integration async def test_create_covers(hass): """Test creation of covers.""" await async_init_integration(hass) state = hass.states.get("cover.large_garage_door") assert state.st...
jawilson/home-assistant
tests/components/myq/test_cover.py
Python
apache-2.0
1,603
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import sys from nose.plugins.skip import SkipTest i...
ATIX-AG/ansible
test/units/modules/network/f5/test_bigip_virtual_address.py
Python
gpl-3.0
7,408
import threading import unittest import dbkit from tests import fakedb, utils class TestPool(unittest.TestCase): def setUp(self): self.pool = dbkit.create_pool(fakedb, 1, fakedb.INVALID_CURSOR) def test_check_pool(self): self.assertTrue(isinstance(self.pool, dbkit.Pool)) self.assert...
kgaughan/dbkit
tests/test_pool.py
Python
mit
4,589
import numpy from pybrain.structure import FeedForwardNetwork from pybrain.structure import RecurrentNetwork from pybrain.structure import LinearLayer, SigmoidLayer from pybrain.structure import FullConnection from pybrain.structure import IdentityConnection from pybrain.datasets import SupervisedDataSet from pybrain...
CDSFinance/zipline
pybrain/network.py
Python
apache-2.0
1,687
import numpy from .mask import Mask class Segmentation(Mask): """ Represent a full segmentation of the 2D array. The segmentation should be immutable. Maybe a special handling for index 0 would be nice?!? """ class Child(Mask): """A proxy object that implements the mask interface but is ...
samuroi/SamuROI
samuroi/masks/segmentation.py
Python
mit
2,412
# -*- coding: utf-8 -*- """ # pkgdb2 - a python module to query the Fedora package database v2 # # Copyright (C) 2014-2015 Red Hat Inc # Copyright (C) 2013 Pierre-Yves Chibon # Author: Pierre-Yves Chibon <pingou@pingoured.fr> # # This program is free software; you can redistribute it and/or modify # it under the terms...
fedora-infra/packagedb-cli
pkgdb2client/__init__.py
Python
gpl-2.0
38,678
from pygame import Surface from thorpy.elements.element import Element from thorpy.painting import pilgraphics from thorpy.painting.painters.imageframe import ImageFrame from thorpy.miscgui import constants SHADOW_RADIUS = 10 BLACK = 255 ALPHA_FACTOR = 0.85 DECAY_MODE = "linear" CAPTURE_STATE_STATIC = constants.STAT...
YannThorimbert/Thorpy-1.4
thorpy/elements/_makeuputils/_halo.py
Python
mit
2,244
from roboplexx import rpx_util, devices, rpx_prop __author__ = 'ajb' import serial # @rpx_util.rpx_device class PololuSimpleMotorController(devices.McBasic): def __init__(self, device_id): devices.McBasic.__init__(self, device_id) self._connection_string = "/dev/ttyACM0" self._connection...
devalbo/roboplexx
roboplexx/drivers/drvr_pololu_simple_motor_controller.py
Python
agpl-3.0
2,332
#! /usr/bin/env python3 # -*- coding: utf-8 -*- #Bamboodl - a cultural archival tool #Copyright Daniel Tadeuszow #2015-05-15 #License: AGPL3+ ## #Python STD ## from os import path from threading import Lock from pathlib import Path from urllib import request from threading import BoundedSemaphore ## #Bamboodl ## fr...
Xenmen/Bamboodl
bamboovar.py
Python
agpl-3.0
10,018