code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
import threading from collections import defaultdict from funcy import once, decorator from django.db import DEFAULT_DB_ALIAS, DatabaseError from django.db.backends.utils import CursorWrapper from django.db.transaction import Atomic, get_connection, on_commit from .utils import monkey_mix __all__ = ('queue_when_in...
Suor/django-cacheops
cacheops/transaction.py
Python
bsd-3-clause
4,124
# -*- coding: utf-8 -*- """ flaskbb.management.views ~~~~~~~~~~~~~~~~~~~~~~~~ This module handles the management views. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ import sys from flask import (Blueprint, current_app, request, redirect, url_for, flas...
realityone/flaskbb
flaskbb/management/views.py
Python
bsd-3-clause
24,085
# -*- coding: utf-8 -*- """ Display current network and ip address for newer Huwei modems. It is tested for Huawei E3276 (usb-id 12d1:1506) aka Telekom Speed Stick LTE III but may work on other devices, too. DEPENDENCIES: - netifaces - pyserial Configuration parameters: - baudrate : There sh...
hburg1234/py3status
py3status/modules/wwan_status.py
Python
bsd-3-clause
7,301
"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted p...
djds23/pygotham-1
pygotham/schedule/models.py
Python
bsd-3-clause
7,610
# proxy module from apptools.logger.util import *
enthought/etsproxy
enthought/logger/util.py
Python
bsd-3-clause
50
import re from django import template from django.core.urlresolvers import NoReverseMatch from django.core.urlresolvers import reverse register = template.Library() @register.simple_tag(takes_context=True) def active(context, name): try: pattern = reverse(name) except NoReverseMatch: return...
jbittel/django-signage
signage/templatetags/active.py
Python
bsd-3-clause
413
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['LinearTrend'] , ['Seasonal_Hour'] , ['NoAR'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_LinearTrend_Seasonal_Hour_NoAR.py
Python
bsd-3-clause
160
# -*- coding: utf-8 -*- # Generated by Django 1.11.28 on 2020-05-03 02:00 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('commtrack', '0005_populate_config_models'), ] operations = [ migrations.RemoveFiel...
dimagi/commcare-hq
corehq/apps/commtrack/migrations/0006_remove_sqlcommtrackconfig_couch_id.py
Python
bsd-3-clause
414
#!/usr/bin/env python ''' isobands_matplotlib.py is a script for creating isobands. Works in a similar way as gdal_contour, but creating polygons instead of polylines This version requires matplotlib, but there is another one, isobands_gdal.py that uses only GDAL python Originally created by Roger Veciana i Rovira, m...
PatSunter/pyOTPA
Isochrones/isobands_matplotlib.py
Python
bsd-3-clause
5,552
from __future__ import division from direct.showbase.ShowBase import ShowBase from direct.actor.Actor import ActorNode from panda3d.core import WindowProperties, NodePath, LVector3 from panda3d.core import LineSegs, OrthographicLens, CardMaker from inputs import Inputs from sys import path import square try: path.i...
codedragon/color_world
color_world.py
Python
bsd-3-clause
15,178
#!/usr/bin/env python ''' #from sc2casts_parser import * from sc2casts_client import * import json from pprint import * parser = SC2CastsParser() client = SC2CastsClient() TEST_DATA_DIR = 'data' # test cases: def test_titles(): pass # test cases: def test_casts(): with open(TEST_DATA_DIR + '/all', 'r') as...
thmttch/sc2castsclient
tests/tests.py
Python
bsd-3-clause
2,367
#!/bin/env python #Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/formatters.py __all__=('Formatter','DecimalFormatter') __version__=''' $Id: formatters.py 3959 2012-09-27 14:39:39Z robin $ ''' _...
nakagami/reportlab
src/reportlab/lib/formatters.py
Python
bsd-3-clause
3,887
from datetime import datetime, timedelta, tzinfo import unittest import pytz import re #noinspection PyUnresolvedReferences from nose.tools import assert_equal, assert_raises # you need it for tests in form of continuations import six from flask_restful import inputs def test_reverse_rfc822_datetime(): dates =...
flask-restful/flask-restful
tests/test_inputs.py
Python
bsd-3-clause
12,433
# Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Justin Quick', 'justquick@gmail.com'), ) ENGINE = os.environ.get('DATABASE_ENGINE', 'django.db.ba...
hiepthai/django-activity-stream
actstream/runtests/settings.py
Python
bsd-3-clause
3,999
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("DecisionTreeClassifier" , "BinaryClass_10" , "db2")
antoinecarme/sklearn2sql_heroku
tests/classification/BinaryClass_10/ws_BinaryClass_10_DecisionTreeClassifier_db2_code_gen.py
Python
bsd-3-clause
149
# orm/dependency.py # Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Bridge the ``PropertyLoader`` (i.e. a ``relation()``) and the ``UOWTransaction`` togeth...
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.5-py2.5.egg/sqlalchemy/orm/dependency.py
Python
bsd-3-clause
26,274
import numpy as np import pandas as pd import gen_fns import math import re import csv import correlation_matrix as co # # reformat_raw_data # # Takes compiled data on historical proliferation contributers from xlsx # spreadsheet (final_hist_data.xlsx) and reformats. xlsx file has a single # row for each country with...
mbmcgarry/historical_prolif
hist_bench.py
Python
bsd-3-clause
27,370
from __future__ import division import abc import numpy as n import scipy.linalg as linalg import scipy.optimize as opt import scipy.spatial.distance as dist class Feature(object): ''' Abstract class that represents a feature to be used with :py:class:`pyransac.ransac.RansacFeature` ''' __metaclass...
rubendibattista/python-ransac-library
pyransac/features.py
Python
bsd-3-clause
6,919
"""Klamp't visualization routines. See Python/demos/vistemplate.py for an example of how to run this module. The visualization module lets you draw most Klamp't objects in a 3D world using a simple interface. It also lets you customize the GUI using Qt widgets, OpenGL drawing, and keyboard/mouse intercept routines...
hpbader42/Klampt
Python/klampt/vis/visualization.py
Python
bsd-3-clause
123,948
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
lidakanari/NeuroM
neurom/view/view.py
Python
bsd-3-clause
14,676
# Copyright 2017 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. def CheckChangeOnCommit(input_api, output_api): tests = input_api.canned_checks.GetUnitTestsInDirectory( input_api, output_api, '.', files_to_check...
youtube/cobalt
third_party/v8/tools/release/PRESUBMIT.py
Python
bsd-3-clause
378
##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = models.CharField(max_length=100) params = models...
ohmini/thaifoodapi
thaifood/models.py
Python
bsd-3-clause
6,666
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_128_None_LinearTrend_12__20.py
Python
bsd-3-clause
262
"""A generic class to build line-oriented command interpreters. Interpreters constructed with this class obey the following conventions: 1. End of file on input is processed as the command 'EOF'. 2. A command is parsed out of each line by collecting the prefix composed of characters in the identchars member. 3. A ...
mark-nicholson/python-editline
examples/elCmd.py
Python
bsd-3-clause
15,015
from pymacy.db import get_db from bson.json_util import dumps db = get_db() results = [] count = 0 for i in db.benchmark.find({"element": "Ni"}): count += 1 if count > 100: break results.append(i) print(results[0]) with open("Ni.json", 'w') as f: file = dumps(results) f.write(file)
czhengsci/veidt
veidt/potential/tests/name/get_data.py
Python
bsd-3-clause
312
""" Generic, configurable scatterplot """ import collections import warnings import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import seaborn as sns class PlottingAttribute(object): __slots__ = 'groupby', 'title', 'palette', 'group_to_attribute' def __init__(se...
olgabot/cupcake
cupcake/scatter.py
Python
bsd-3-clause
16,979
import os from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.core.exceptions import ImproperlyConfigured from cacheops.simple import file_cache, FILE_CACHE_DIR class Command(BaseCommand): help = 'Clean filebased cache' def handle(self, **options):...
dpetzold/django-cacheops
cacheops/management/commands/cleanfilecache.py
Python
bsd-3-clause
407
#!/usr/bin/python2.4 # # Copyright 2010 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...
MapofLife/MOL
earthengine/google-api-python-client/tests/test_model.py
Python
bsd-3-clause
2,180
# -*- coding: utf-8 -*- """ jinja2.filters ~~~~~~~~~~~~~~ Bundled jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import math from random import choice from operator import itemgetter from itertools import groupby from jinja2.utils...
dstufft/jinja2
jinja2/filters.py
Python
bsd-3-clause
29,972
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('formbuilder', '0005_auto_20150826_1600'), ] operations = [ migrations.RemoveField( model_name='choiceanswer', ...
Kvoti/ditto
ditto/formbuilder/migrations/0006_auto_20150827_1019.py
Python
bsd-3-clause
918
""" extend TiddlyWiki serialization to optionally use beta or externalized releases and add the UniversalBackstage. activated via "twrelease=beta" URL parameter or ServerSettings, see build_config_var """ import logging from tiddlyweb.util import read_utf8_file from tiddlywebwiki.serialization import Serialization...
TiddlySpace/tiddlyspace
tiddlywebplugins/tiddlyspace/betaserialization.py
Python
bsd-3-clause
3,007
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['RelativeDifference'] , ['ConstantTrend'] , ['NoCycle'] , ['LSTM'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_RelativeDifference/model_control_one_enabled_RelativeDifference_ConstantTrend_NoCycle_LSTM.py
Python
bsd-3-clause
164
""" Django settings for example_site project. Generated by 'django-admin startproject' using Django 1.8.dev20150302062936. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settin...
furious-luke/django-address
example_site/example_site/settings.py
Python
bsd-3-clause
3,436
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Implements rotations, including spherical rotations as defined in WCS Paper II [1]_ `RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in WCS Paper II to rotate to/from a native sphere and the celestial sphere. The implement...
MSeifert04/astropy
astropy/modeling/rotations.py
Python
bsd-3-clause
16,505
# -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # lis...
stormi/tsunami
src/secondaires/navigation/commandes/matelot/liste.py
Python
bsd-3-clause
3,827
import time, copy import os, os.path import sys import numpy from PyQt4.QtCore import * from PyQt4.QtGui import * from scipy import optimize from echem_plate_ui import * from echem_plate_math import * import pickle p1='C:/Users/Gregoire/Documents/CaltechWork/echemdrop/2012-9_FeCoNiTi/results/echemplots/2012-9_FeCoNiT...
johnmgregoire/JCAPdatavis
echem_paperplots.py
Python
bsd-3-clause
3,052
""" Documentation package """ import neuroptikon import wx, wx.html import os.path, sys, urllib _sharedFrame = None def baseURL(): if neuroptikon.runningFromSource: basePath = os.path.join(neuroptikon.rootDir, 'documentation', 'build', 'Documentation') else: basePath = os.path.join(neuropti...
JaneliaSciComp/Neuroptikon
Source/documentation/__init__.py
Python
bsd-3-clause
747
# -*- coding: utf-8 -*- # Copyright (c) 2014 Simon Jagoe and Enthought Ltd. # All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE.txt file for details. from __future__ import absolute_import, unicode_literals import logging import os f...
sjagoe/usagi
usagi/discoverer.py
Python
bsd-3-clause
4,383
from __future__ import unicode_literals from django.forms import ValidationError from django.core.exceptions import NON_FIELD_ERRORS from django.forms.formsets import TOTAL_FORM_COUNT from django.forms.models import ( BaseModelFormSet, modelformset_factory, ModelForm, _get_foreign_key, ModelFormMetaclass, Mode...
torchbox/django-modelcluster
modelcluster/forms.py
Python
bsd-3-clause
16,632
""" See http://pbpython.com/advanced-excel-workbooks.html for details on this script """ from __future__ import print_function import pandas as pd from xlsxwriter.utility import xl_rowcol_to_cell def format_excel(writer, df_size): """ Add Excel specific formatting to the workbook df_size is a tuple represent...
chris1610/pbpython
code/advanced_excel.py
Python
bsd-3-clause
2,204
# !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import glClear import pyglet.window import pygl...
bitcraft/pyglet
contrib/scene2d/tests/scene2d/SPRITE_OVERLAP.py
Python
bsd-3-clause
2,162
import os from subprocess import call, Popen, PIPE import sys from . import Command from . import utils class OpenSequenceInRV(Command): """%prog [options] [paths] Open the latest version for each given entity. """ def run(self, sgfs, opts, args): # Parse them all....
westernx/sgfs
sgfs/commands/rv.py
Python
bsd-3-clause
2,458
""" External serialization for testing remote module loading. """ from tiddlyweb.serializations import SerializationInterface class Serialization(SerializationInterface): def list_recipes(self, recipes): print recipes def list_bags(self, bags): print bags def recipe_as(self, recipe): ...
funkyeah/tiddlyweb
test/other/tiddlyweb/serializations/debug.py
Python
bsd-3-clause
701
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common...
mistydemeo/gyp
pylib/gyp/xcode_emulation.py
Python
bsd-3-clause
55,087
# -*- coding: utf-8 -*- from unittest import TestCase from scrapy.settings import Settings from scrapy_tracker.storage.memory import MemoryStorage from scrapy_tracker.storage.redis import RedisStorage from scrapy_tracker.storage.sqlalchemy import SqlAlchemyStorage from tests import TEST_KEY, TEST_CHECKSUM, mock cla...
vkastyniuk/scrapy-tracker
tests/test_storage.py
Python
bsd-3-clause
2,541
#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig import pygccxml from pygccxml.utils import * from pygccxml.parse...
avaitla/Haskell-to-C---Bridge
pygccxml-1.0.0/unittests/call_invocation_tester.py
Python
bsd-3-clause
4,057
""" Ludolph: Monitoring Jabber Bot Copyright (C) 2012-2017 Erigones, s. r. o. This file is part of Ludolph. See the LICENSE file for copying permission. """ import os import re import sys import signal import logging from collections import namedtuple try: # noinspection PyCompatibility,PyUnresolvedReferences ...
erigones/Ludolph
ludolph/main.py
Python
bsd-3-clause
8,916
from django_nose.tools import assert_false, assert_true from pontoon.base.tests import TestCase from pontoon.base.utils import extension_in class UtilsTests(TestCase): def test_extension_in(self): assert_true(extension_in('filename.txt', ['bat', 'txt'])) assert_true(extension_in('filename.biff', ...
yfdyh000/pontoon
pontoon/base/tests/test_utils.py
Python
bsd-3-clause
644
import os import tempfile from pkg_resources import Requirement from infi.unittest import parameters from .test_cases import ForgeTest from pydeploy.environment import Environment from pydeploy.environment_utils import EnvironmentUtils from pydeploy.checkout_cache import CheckoutCache from pydeploy.installer import Ins...
vmalloc/pydeploy
tests/test__sources.py
Python
bsd-3-clause
10,265
from django.conf.urls import patterns, include, url from django.views.generic import TemplateView home = TemplateView.as_view(template_name='home.html') urlpatterns = patterns( '', url(r'^filter/', include('demoproject.filter.urls')), # An informative homepage. url(r'', home, name='home') )
jgsogo/django-generic-filters
demo/demoproject/urls.py
Python
bsd-3-clause
312
import datetime import time from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models import Q from django.db.models.signals import pre_save from django.contrib.contenttypes.fields import GenericRelation from django.contrib.auth.models import User from tidings.models imp...
anushbmx/kitsune
kitsune/forums/models.py
Python
bsd-3-clause
13,732
#!/usr/bin/env python import dockci.commands from dockci.server import APP, app_init, MANAGER if __name__ == "__main__": app_init() MANAGER.run()
sprucedev/DockCI
manage.py
Python
isc
157
import os, logging from PIL import Image from sqlalchemy.orm.session import object_session from sqlalchemy.orm.util import identity_key from iktomi.unstable.utils.image_resizers import ResizeFit from iktomi.utils import cached_property from ..files import TransientFile, PersistentFile from .files import FileEventHandle...
Lehych/iktomi
iktomi/unstable/db/sqla/images.py
Python
mit
5,666
t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for i in range(1,100000): fn[i] = fn[i-1] * i fn[i] %...
ManrajGrover/CodeSprint_India_2014
Qualification_Round_2/Editorials/array_simp_2.py
Python
mit
683
#### 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/lok/shared_mining_cave_01.iff" result.attribute_template_id = -1 r...
obi-two/Rebelion
data/scripts/templates/object/building/lok/shared_mining_cave_01.py
Python
mit
440
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_rebel_brigadier_general_sullustan_male.iff" result.att...
anhstudios/swganh
data/scripts/templates/object/mobile/shared_dressed_rebel_brigadier_general_sullustan_male.py
Python
mit
475
from __future__ import absolute_import from jinja2 import Markup from rstblog.programs import RSTProgram import typogrify class TypogrifyRSTProgram(RSTProgram): def get_fragments(self): if self._fragment_cache is not None: return self._fragment_cache with self.context.open_source_fil...
ericam/sidesaddle
modules/typogrify.py
Python
mit
620
from datetime import datetime, timedelta from time import sleep from random import uniform class SleepSchedule(object): """Pauses the execution of the bot every day for some time Simulates the user going to sleep every day for some time, the sleep time and the duration is changed every day by a random of...
bbiiggppiigg/PokemonGo-Bot
pokemongo_bot/sleep_schedule.py
Python
mit
7,614
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/creature/npc/droid/crafted/shared_cll_8_binary_load_lifter_advanced.iff" res...
anhstudios/swganh
data/scripts/templates/object/creature/npc/droid/crafted/shared_cll_8_binary_load_lifter_advanced.py
Python
mit
506
import operator import mock import pytest from okcupyd import User from okcupyd import magicnumbers from okcupyd.magicnumbers import maps from okcupyd.profile import Profile from okcupyd.json_search import SearchFetchable, search from okcupyd.location import LocationQueryCache from okcupyd.session import Session fro...
IvanMalison/okcupyd
tests/search_test.py
Python
mit
7,482
from .base import DerivedType from categorical import CategoricalComparator from .categorical_type import CategoricalType class ExistsType(CategoricalType) : type = "Exists" _predicate_functions = [] def __init__(self, definition) : super(CategoricalType, self ).__init__(definition) ...
tfmorris/dedupe
dedupe/variables/exists.py
Python
mit
1,117
import sys, os import pickle import nltk import paths from utils import * def words_to_dict(words): return dict(zip(words, range(0, len(words)))) nltk.data.path.append(paths.nltk_data_path) use_wordnet = True if use_wordnet: stemmer = nltk.stem.wordnet.WordNetLemmatizer() stem = stemmer.lemmatize else...
mgree/tmpl
www/backend/infer.py
Python
mit
3,314
"""calibrated_image.py was written by Ryan Petersburg for use with fiber characterization on the EXtreme PREcision Spectrograph """ import numpy as np from .base_image import BaseImage from .numpy_array_handler import filter_image, subframe_image class CalibratedImage(BaseImage): """Fiber face image analys...
rpetersburg/fiber_properties
fiber_properties/calibrated_image.py
Python
mit
11,258
from collections.abc import Iterable from django import template from django.db.models import Model register = template.Library() @register.filter def get_type(value): # inspired by: https://stackoverflow.com/a/12028864 return type(value) @register.filter def is_model(value): return isinstance(value, ...
pbanaszkiewicz/amy
amy/autoemails/templatetags/type_extras.py
Python
mit
555
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wagtaildocs', '0003_add_verbose_names'), ('articles', '0075_auto_20151015_2022'), ] operati...
CIGIHub/greyjay
greyjay/articles/migrations/0076_articlepage_video_document.py
Python
mit
598
from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convolutional layers LEARNING_RATE = .003 # ini...
wrongu/AlphaGo
AlphaGo/models/value.py
Python
mit
1,711
#!/usr/bin/env python # # Created by Samvel Khalatyan on Mar 23, 2014 # Copyright (c) 2014 Samvel Khalatyan. All rights reserved # # Use of this source code is governed by a license that can be found in # the LICENSE file. import random import unittest from lib import unigraph class UnigraphExtra(unigraph.Unigraph)...
ksamdev/algorithms_old
ch4/python/ch4_ex4.1.4.py
Python
mit
1,523
from django import template from django.utils.safestring import mark_safe from django.utils.html import escape from django.utils.translation import ugettext as _ from django.contrib.admin.views.main import PAGE_VAR, ALL_VAR from django.conf import settings from django.contrib.sites.models import Site from BeautifulSou...
quinode/django-admintools-bootstrap
admintools_bootstrap/templatetags/admintools_bootstrap.py
Python
mit
6,117
# -*- coding: utf-8 -*- """ Written by Daniel M. Aukes and CONTRIBUTORS Email: danaukes<at>asu.edu. Please see LICENSE for full license. """ import sys import popupcad import qt.QtCore as qc import qt.QtGui as qg if __name__=='__main__': app = qg.QApplication(sys.argv[0]) filename_from = 'C:/Users/d...
danaukes/popupcad
api_examples/switch_subdesign.py
Python
mit
1,814
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-07-10 18:33 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0006_auto_20160616_1640'), ] operations = [ migrations.AlterField( ...
xfxf/veyepar
dj/main/migrations/0007_auto_20160710_1833.py
Python
mit
560
# @author Avtandil Kikabidze # @copyright Copyright (c) 2008-2015, Avtandil Kikabidze aka LONGMAN (akalongman@gmail.com) # @link http://longman.me # @license The MIT License (MIT) import os import sys import sublime import sublime_plugin st_version = 2 if sublime.version() == '...
crlang/sublime-text---front-end-config
Data/Packages/CodeFormatter/CodeFormatter.py
Python
mit
6,068
# -*- coding:utf-8 -*- """ # Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today) # Created Time : Fri Feb 20 21:38:57 2015 # File Name: wechatService.py # Description: # :copyright: (c) 2015 by Pegasus Wang. # :license: MIT, see LICENSE for more details. """ import json import time import urllib import ...
PegasusWang/WeiPython
wechat/wechatService.py
Python
mit
4,478
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Sharing.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
XDSETeamA/XD_SE_TeamA
team9/1/Sharing/manage.py
Python
mit
250
#!/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...
rev2004/android2cloud.app-engine
google_appengine/google/appengine/ext/db/__init__.py
Python
mit
101,475
# Generated by Django 3.2 on 2021-05-11 13:43 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('stock', '0062_auto_20210511_2151'), ] operations = [ migrations.RemoveField( model_name='stockitemtracking', name='link', ...
inventree/InvenTree
InvenTree/stock/migrations/0063_auto_20210511_2343.py
Python
mit
676
def linear_search(lst,size,value): i = 0 while i < size: if lst[i] == value: return i i = i + 1 return -1 def main(): lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782] size = len(lst) original_list = "" value = int(input("\nInput a value to search for: ")) print...
EverythingAbout/Python
Searches/linear_search.py
Python
mit
775
# Analyze Color of Object import os import cv2 import numpy as np from . import print_image from . import plot_image from . import fatal_error from . import plot_colorbar def _pseudocolored_image(device, histogram, bins, img, mask, background, channel, filename, resolution, analysis_images, ...
AntonSax/plantcv
plantcv/analyze_color.py
Python
mit
11,048
class Solution: # @param {integer[]} height # @return {integer} def largestRectangleArea(self, height): n = len(height) ma = 0 stack = [-1] for i in xrange(n): while(stack[-1] > -1): if height[i]<height[stack[-1]]: top = stack....
saai/codingbitch
DP/largestRectangleArea.py
Python
mit
597
''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command line will cause smsd stop for a while ''' def ...
lubao/UjU_Windows
src/GammuSender.py
Python
mit
1,013
from __future__ import absolute_import # Copyright (c) 2010-2017 openpyxl from .cell import Cell, WriteOnlyCell from .read_only import ReadOnlyCell
171121130/SWI
venv/Lib/site-packages/openpyxl/cell/__init__.py
Python
mit
149
from Robinhood import Robinhood #Setup my_trader = Robinhood(username="YOUR_USERNAME", password="YOUR_PASSWORD"); #Get stock information #Note: Sometimes more than one instrument may be returned for a given stock symbol stock_instrument = my_trader.instruments("GEVO")[0] #Get a stock's quote my_trader.print_quot...
itsff/Robinhood
example.py
Python
mit
826
#!/usr/bin/env python3 from multiprocessing import Process, Pool import os, time def proc(name): print(time.asctime(), 'child process(name: %s) id %s. ppid %s' % (name, os.getpid(), os.getppid())) time.sleep(3) print(time.asctime(), 'child process end') if __name__ == '__main__': p = Proce...
JShadowMan/package
python/multi-process-thread/multiprocess.py
Python
mit
660
dimensions(8,8) wall((2,0),(2,4)) wall((2,4),(4,4)) wall((2,6),(6,6)) wall((6,6),(6,0)) wall((6,2),(4,2)) initialRobotLoc(1.0, 1.0)
Cynary/distro6.01
arch/6.01Soft/lib601-F13-4/soar/worlds/bigFrustrationWorld.py
Python
mit
133
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals # import frappe import unittest class TestBlogSettings(unittest.TestCase): pass
adityahase/frappe
frappe/website/doctype/blog_settings/test_blog_settings.py
Python
mit
224
#!/usr/bin/env python import sys,os import textwrap def print_header(): print textwrap.dedent("""\ ##fileformat=VCFv4.1 ##phasing=none ##INDIVIDUAL=TRUTH ##SAMPLE=<ID=TRUTH,Individual="TRUTH",Description="bamsurgeon spike-in"> ##INFO=<ID=CIPOS,Number=2,Type=Integer,Description="Confidence inte...
MischaLundberg/bamsurgeon
scripts/makevcf.py
Python
mit
2,120
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Utility methods, for compatibility between Python version :author: Thomas Calmant :copyright: Copyright 2017, Thomas Calmant :license: Apache License 2.0 :version: 0.3.1 .. Copyright 2017 Thomas Calmant Licensed under the Apache License, Version 2.0 (the...
CloudI/CloudI
src/service_api/python/jsonrpclib/jsonrpclib/utils.py
Python
mit
3,412
from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import camera import time class Display(object): # Inheritrance convinience functions def init(self): pass def close(self): pass def mouse(self, mouseButton, buttonState, x, y): pass def mouseMotion(self, x, y, dx, dy): pass def pa...
Alex4913/PyOpenGL-Boilerplate
src/display.py
Python
mit
3,803
import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a set of setting (with values), environment variables ...
birsoyo/conan
conans/model/profile.py
Python
mit
3,409
__author__ = 'sei' DEFAULT_SERIAL = '/dev/ttyUSB0' DEFAULT_BAUDRATE = 57600
sdickreuter/python-pistage
build/lib/PIStage/_defines.py
Python
mit
77
#!/usr/bin/env python # -*- coding: utf-8 -*- patterns = [r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_center)/?.*?/(\d{9}(.*?))\.(.*?)$', r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_anchor)/?.*?/(\d{9}(.*?))\.(.*?)$', r'^.*?/bfly_jpg_makerDrop/(crop_fullsize_center)/?.*?/(\d{9}(.*?))\.(.*?)$', ...
relic7/prodimages
python/regex_matcherator_naturectr.py
Python
mit
1,999
#### 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/scout/trap/shared_trap_webber.iff" result.attribute_template_id = -...
anhstudios/swganh
data/scripts/templates/object/tangible/scout/trap/shared_trap_webber.py
Python
mit
444
#### 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/wearables/ithorian/shared_ith_shirt_s09.iff" result.attribute_templ...
anhstudios/swganh
data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_shirt_s09.py
Python
mit
464
"""Extension to execute code outside the Python shell window. This adds the following commands: - Check module does a full syntax check of the current module. It also runs the tabnanny to catch any inconsistent tabs. - Run module executes the module's code in the __main__ namespace. The window must have...
babyliynfg/cross
tools/project-creator/Python2.6.6/Lib/idlelib/ScriptBinding.py
Python
mit
7,992
# -*- coding:utf8 -*- from fabric.api import task, run, local, cd, hosts, env import time from oozappa.config import get_config, procure_common_functions _settings = get_config() procure_common_functions() import sys from common_multiple_fabric_environment import _deploy_template_sample_a test_host = ('192.168.0.1...
frkwy/oozappa
sample/ops/staging/fabfile/__init__.py
Python
mit
1,594
KEY_UP = "up" KEY_DOWN = "down" KEY_RIGHT = "right" KEY_LEFT = "left" KEY_INSERT = "insert" KEY_HOME = "home" KEY_END = "end" KEY_PAGEUP = "pageup" KEY_PAGEDOWN = "pagedown" KEY_BACKSPACE ...
FichteFoll/CSScheme
my_sublime_lib/constants.py
Python
mit
2,230
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE import frappe import json from frappe.model.document import Document from frappe.utils import get_fullname, parse_addr exclude_from_linked_with = True class ToDo(Document): DocType = 'ToDo' def validate(self): self...
frappe/frappe
frappe/desk/doctype/todo/todo.py
Python
mit
4,119
''' Created on Mar 4, 2017 @author: preiniger ''' def __validate_alliance(alliance_color, teams, official_sr): team1sr = None team2sr = None team3sr = None # TODO: there has to be a better way... but I'd rather not touch the DB for sr in teams[0].scoreresult_set.all(): if sr.match.matchN...
ArcticWarriors/scouting-app
ScoutingWebsite/Scouting2011/model/validate_match.py
Python
mit
2,608
import json import requests import key API_key = key.getAPIkey() #load all champion pictures def load_champion_pictures(champion_json): print len(champion_json['data']) version = champion_json['version'] print "version: " + version for champion in champion_json['data']: print champion r = requests.get('http:...
dzhang55/riftwatch
static_images.py
Python
mit
1,397
#!/usr/bin/env python from util import nodeenv_delegate from setup import setup if __name__ == "__main__": setup(skip_dependencies=True) nodeenv_delegate("npx")
outoftime/learnpad
tools/npx.py
Python
mit
171
# -*- coding: utf-8 -*- from math import floor from typing import ( Tuple, Any ) from PyQt5.QtCore import ( QPointF, QRectF, Qt ) from PyQt5.QtGui import ( QBrush, QPen, QPainterPath, QPolygonF, QMouseEvent, QPainter ) from PyQt5.QtWidgets import ( qApp, QGraphicsIte...
scholer/cadnano2.5
cadnano/views/pathview/strand/endpointitem.py
Python
mit
22,478