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 unittest
import numpy as np
from chaco.array_plot_data import ArrayPlotData
from chaco.plot import Plot
from chaco.tools.range_selection import RangeSelection
from enable.testing import EnableTestAssistant
class RangeSelectionTestCase(EnableTestAssistant, unittest.TestCase):
def test_selecting_mouse_lea... | tommy-u/chaco | chaco/tools/tests/range_selection_test_case.py | Python | bsd-3-clause | 1,955 |
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project fold... | pwhipp/kevin | kevin/kevin/settings/base.py | Python | mit | 7,279 |
from dynaconf import settings
print("EXAMPLE_ prefix")
settings.configure(ENVVAR_PREFIX_FOR_DYNACONF="EXAMPLE")
print(settings.VAR1)
print(settings.VAR2)
print("_ prefix")
settings.configure(ENVVAR_PREFIX_FOR_DYNACONF="")
print(settings.VAR1)
print(settings.VAR2)
print("no prefix at all")
settings.configure(ENVVAR_P... | rochacbruno/dynaconf | example/envvar_prefix/app.py | Python | mit | 548 |
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from auth_app import views, forms
urlpatterns = [
url(r'^join/', views.join, name='join'),
url(r'^login/', auth_views.login, {'template_name' : 'login.html'}, name='login'),
url(r'^logout/', auth_views.logout, {'next_page' : '/a... | lordzuko/DeepEduVision | auth_app/urls.py | Python | mit | 412 |
#!/usr/bin/env python
#
# 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
# "... | grs/amqp_subscriptions | a.py | Python | apache-2.0 | 2,082 |
from collections import defaultdict
from warnings import warn, catch_warnings, simplefilter
from decimal import Decimal
from ast import parse as ast_parse, Name, Or, And, BoolOp
from gzip import GzipFile
from bz2 import BZ2File
from tempfile import NamedTemporaryFile
import re
from six import iteritems, string_types
... | aebrahim/cobrapy | cobra/io/sbml3.py | Python | lgpl-2.1 | 27,753 |
"""Basic entry points."""
__all__ = ["connect", "login"]
from .utils.maas_async import asynchronous
@asynchronous
async def connect(url, *, apikey=None, insecure=False):
"""Connect to MAAS at `url` using a previously obtained API key.
:param url: The URL of MAAS, e.g. http://maas.example.com:5240/MAAS/
... | maas/python-libmaas | maas/client/__init__.py | Python | agpl-3.0 | 1,399 |
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSlider, getConfigListEntry
config.plugins.OSDPositionSetup = ConfigSubsection()
config.plugins.OSDPositionSetup.dst_left = ConfigInteger(default = 0)
config.... | lazaronixon/enigma2 | lib/python/Plugins/SystemPlugins/OSDPositionSetup/plugin.py | Python | gpl-2.0 | 4,975 |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 10 19:59:08 2016
@author: ajaver
"""
import os
import errno
import sys
import fnmatch
from tierpsy.helper.misc import RESERVED_EXT, replace_subdir
from tierpsy.helper.params.tracker_param import valid_options
from tierpsy.helper.params.docs_analysis_points import dflt_ana... | ljschumacher/tierpsy-tracker | tierpsy/processing/helper.py | Python | mit | 3,958 |
import os
from awesome_avatar.settings import config
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.db import models
from awesome_avatar import forms
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from PIL import Image
except ImportE... | steventimberman/masterDebater | venv/lib/python2.7/site-packages/awesome_avatar/fields.py | Python | mit | 1,787 |
from sys import argv
from getopt import getopt
from time import sleep
from os import kill
from signal import SIGTERM
import re
"""
The code in this file allows to kill a bitcoind process when it receives block at a given height by monitoring its
log file.
Usage:
python kill_at_heigh.py -k block_heigh -p pid [-f f... | sr-gi/bitcoin_tools | bitcoin_tools/analysis/status/kill_at_heigh.py | Python | bsd-3-clause | 4,207 |
import os
import sys
import json
import getpass
from tb_website.settings.base import *
SECRET_KEY = 'Nothing'
TB_SHARED_DATAFILE_DIRECTORY = ''
CONF_FILE = os.path.expanduser(os.path.join('~', '.config', 'gentb-db.conf'))
def ask_for(name, slug, default=None, password=False):
"""Return a configuration item, ... | IQSS/gentb-site | tb_website/settings/gentb.py | Python | agpl-3.0 | 2,209 |
"""
Module responsible for scheduling Insights data collection in cron
"""
import os
import logging
from config import CONFIG as config
from constants import InsightsConstants as constants
APP_NAME = constants.app_name
logger = logging.getLogger(__name__)
class InsightsSchedule(object):
def __init__(self, sour... | wcmitchell/insights-core | insights/client/schedule.py | Python | apache-2.0 | 1,286 |
from mrjob.job import MRJob
import mrjob.util
from mrjob.protocol import JSONValueProtocol, PickleProtocol, RawValueProtocol
import sys,json
sys.path.insert(0, '..')
import textproc
def dumps(obj):
return json.dumps(obj, separators= (',', ':'))
def smallify(toktweet_line):
toks, date, geo_s, tweet_s = toktwee... | brendano/twitter_geo_preproc | geo2_pipeline/preproc8/40_smallify/smallify.py | Python | mit | 1,237 |
import yaml
yaml_list = ['apple','blackberry','orange',12, 100]
yaml_list.append('mtu')
yaml_list.append('media')
yaml_list.append({})
yaml_list[-1]['ip_addr'] = '10.10.10.1'
yaml_list[-1]['interfaces'] = range(7)
yaml_dump = yaml.dump(yaml_list, default_flow_style=False)
print yaml_dump
with open("yaml_file.yaml"... | hbenaouich/Learning-Python | class-1/yaml-ex-write.py | Python | apache-2.0 | 356 |
#
# 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 di... | quentinbodinier/custom_gnuradio_blocks | python/__init__.py | Python | gpl-3.0 | 1,615 |
print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print 'Yay! Printing.'
print "I'd much rather you 'not'."
print 'I "said" do not touch this.'
print "Print another line."
#print "This line will not print."
print "But this one will." | duliodenis/learn-python-the-hard-way | exercises/ex01.py | Python | mit | 273 |
#!/usr/bin/env python
# -*- coding: utf-8 -*
import csv
import re
import sys
def sanitise_location(data, loc):
loc = loc.lower().strip()
subtype = ""
loc = re.sub(" \(delay[\s\w]*\)", "", loc)
match = re.match("bathole \((.*)\)", loc)
if match is not None:
loc = match.groups()[0]
mat... | mikebryant/kolmafia-lar-forecasting | util/convert.py | Python | apache-2.0 | 4,227 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as s... | ryfeus/lambda-packs | pytorch/source/caffe2/python/operator_test/lengths_pad_op_test.py | Python | mit | 1,799 |
# -*- mode: python; coding: utf-8 -*-
# All bugs by Oscar Aceña <oscar.acena@gmail.com>
import time
try:
import thread
except ImportError:
import _thread as thread
import unittest
from doublex import ProxySpy, assert_that, called
class Collaborator(object):
def write(self, data):
time.sleep(0... | davidvilla/python-doublex | doublex/test/async_race_condition_tests.py | Python | gpl-3.0 | 896 |
import logging
from atlassian import Jira
logging.basicConfig(level=logging.ERROR)
jira = Jira(url="http://localhost:8080", username="admin", password="admin")
"""That example show how to copy group members into role members"""
def convert_group_into_users_in_role(project_key, role_id, group_name):
users = ji... | MattAgile/atlassian-python-api | examples/jira/jira_convert_group_members_into_user_in_role.py | Python | apache-2.0 | 1,326 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.utils.nestedset import get_root_of
@frappe.whitelist()
def get_items(start, page_length, price_list, item_group, search... | emmuchira/kps_erp | erpnext/selling/page/point_of_sale/point_of_sale.py | Python | gpl-3.0 | 2,765 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import time
import json
import datetime
from PyQt5.QtCore import (QObject, pyqtSignal, pyqtSlot, pyqtProperty, QDir,
QDirIterator, QTimer, QThread, QThreadPool,
QAbstractListModel, Qt, QModelIndex, QVaria... | dragondjf/QMusic | src/controllers/muscimanageworker.py | Python | lgpl-2.1 | 34,669 |
#!/usr/bin/env python
# Thu, 13 Mar 14 (PDT)
# bpf-filter.rb: Create a packet filter,
# use it to print udp records from a trace
# Copyright (C) 2015, Nevil Brownlee, U Auckland | WAND
from plt_testing import *
t = get_example_trace('anon-v4.pcap')
filter = plt.filter('udp port 53') # Only want DNS ... | nevil-brownlee/pypy-libtrace | test/pypy-test-cases/test-bpf-filter.py | Python | gpl-3.0 | 780 |
from django.urls import path
from . import views
urlpatterns = [
path('ticket/', views.TicketListView.as_view(), name='ticket-list'),
path('ticket/new/', views.TicketCreateView.as_view(), name='ticket-new'),
path('ticket/<int:pk>/', views.TicketUpdateView.as_view(), name='ticket-edit'),
path('ticket/<i... | fxer/cujo | apps/ticket/urls.py | Python | mit | 396 |
#! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | gwq5210/litlib | thirdparty/sources/protobuf/python/google/protobuf/internal/_parameterized.py | Python | gpl-3.0 | 15,457 |
import sys, pygame, pygame.mixer
from pygame.locals import *
import random
import time
print("'You must hunt down the beast that has plauged this land, do so using arrow keys or A and D to accelerate or decellerate, use space to fire, take cation in doing so as it will prevent you from speeding up'")
print("(1)easy,(2... | lizerd123/github | motorman/motorcycle.py | Python | mit | 4,068 |
from django.db.models import Model, ManyToManyField, ForeignKey, CharField, TextField, DateTimeField, IntegerField, FileField, BooleanField
from jeevesdb.JeevesModel import JeevesModel as Model
from jeevesdb.JeevesModel import JeevesForeignKey as ForeignKey
from jeevesdb.JeevesModel import label_for
from sourcetrans.... | jonathanmarvens/jeeves | demo/conf/conf/models.py | Python | mit | 8,922 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/extended_is_reachability/neighbors/neighbors_/subTLVs/subTLVs_/ipv6_neighbor_address/__init__.py | Python | apache-2.0 | 12,492 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Galileo Sartor
#
# 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; version 3.
#
# This program is distributed in the hope tha... | ubuntu/ubuntu-make | tests/large/test_java.py | Python | gpl-3.0 | 7,658 |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | antgonza/qiita | qiita_pet/handlers/api_proxy/processing.py | Python | bsd-3-clause | 13,135 |
import pandas as pd
from collections import OrderedDict
from pickle import dump, load
from backend.portfolio_model import PortfolioModels
from backend.robinhood_data import RobinhoodData
from backend.market_data import MarketData
class BackendClass(object):
"""
Backend wrapper class, provides wrappers to donw... | omdv/robinhood-portfolio | backend/backend.py | Python | mit | 17,336 |
from unit import Unit
from sinking_item import SinkingItem
from time import time
class Fish(Unit, SinkingItem):
def __init__(self, constraint, x=0, y=0, direction=(1, 0), size=0):
radius = (size * 15 + 41) / 2
Unit.__init__(self, constraint, x, y, direction, 80, radius)
SinkingItem.__init_... | gvpavlov/Insaniquarium | insaniquarium/core/fish.py | Python | gpl-2.0 | 1,907 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand
from gaeforms.ndb.form import ModelForm
from gaegraph.business_base import UpdateNode
from course_app.model import Course
class CoursePublicForm(ModelForm):
"""
Form ... | gutooliveira/progScript | tekton/backend/apps/course_app/commands.py | Python | mit | 1,880 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import numpy as np
from polyglot.base import Sequence, TextFile, TextFiles
from polyglot.detect import Detector, Language
from polyglot.decorators import cached_property
from polyglot.downloader import Downloader
from polyglot.load import load_embeddings, load... | alantian/polyglot | polyglot/text.py | Python | gpl-3.0 | 17,965 |
# Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
#
# This library 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... | pvagner/orca | src/orca/orca_gui_prefs.py | Python | lgpl-2.1 | 128,261 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_iot_hub_client_enums.py | Python | mit | 4,931 |
# -*- coding: utf-8 -*-
# * Authors:
# * TJEBBES Gaston <g.t@majerti.fr>
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
import os
from pyramid.httpexceptions import HTTPFound
from autonomie.forms.admin import (
ActivityConfigSchema,
)
from autonomie.models.activity import (
... | CroissanceCommune/autonomie | autonomie/views/admin/accompagnement/activities.py | Python | gpl-3.0 | 2,419 |
#
# Author: Travis Oliphant, 2002
#
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.lib.six.moves import xrange
from numpy import pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, \
where, mgrid, cos, sin, exp, place, seterr, issubdtype, extract, \
... | sargas/scipy | scipy/special/basic.py | Python | bsd-3-clause | 29,132 |
from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
from nose.plugins.attrib import attr
class TestCookies(FlexGetBase):
__yaml__ = """
tasks:
test_cookies:
text:
url: http://httpbin.org/cookies
entry:
... | asm0dey/Flexget | tests/test_cookies.py | Python | mit | 628 |
# -*- coding: utf-8 -*-
#
# dk documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 13 18:59:19 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All conf... | thebjorn/dk | docs/conf.py | Python | lgpl-3.0 | 8,139 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class BestmoviesItem(scrapy.Item):
name = scrapy.Field()
year = scrapy.Field()
rating = scrapy.Field()
url = scrapy.Field()
genres =... | feliperuhland/bestmovies | bestmovies/items.py | Python | mit | 393 |
import sys
from snf_django.management import utils
# Use backported unittest functionality if Python < 2.7
try:
import unittest2 as unittest
except ImportError:
if sys.version_info < (2, 7):
raise Exception("The unittest2 package is required for Python < 2.7")
import unittest
class ParseFiltersTe... | allmende/synnefo | snf-django-lib/snf_django/management/tests.py | Python | gpl-3.0 | 977 |
# Copyright 2014-2015 Novartis Institutes for Biomedical Research
# 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 applic... | Novartis/railroadtracks | src/environment.py | Python | apache-2.0 | 7,245 |
from social_core.backends.facebook import FacebookOAuth2
class EdraakFacebookOAuth2(FacebookOAuth2):
REDIRECT_STATE = False
| Edraak/edx-platform | common/djangoapps/edraak_social/backends/facebook.py | Python | agpl-3.0 | 131 |
# Roundware Server is released under the GNU Affero General Public License v3.
# See COPYRIGHT.txt, AUTHORS.txt, and LICENSE.txt in the project root directory.
from __future__ import unicode_literals
from guardian.admin import GuardedModelAdmin
from guardian.shortcuts import get_objects_for_user
from models import *
f... | yangjackascd/roundware-server | roundware/rw/admin.py | Python | agpl-3.0 | 16,149 |
#!/usr/bin/python3
import boto3
import pprint
import re
import socket
import gzip
import json
import tempfile
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from S3Archive import *
def local_get_s3_backupsets(myhostname, bucket, path, mytag="backup"):
"""
return data of ... | gunny26/webstorage | devel/s3list.py | Python | gpl-2.0 | 3,601 |
"""
Extract MADIS METAR QC information to the database
"""
import os
import sys
import datetime
import warnings
import numpy as np
import pytz
from netCDF4 import chartostring
from pyiem.util import get_dbconn, ncopen, convert_value
warnings.filterwarnings("ignore", category=DeprecationWarning)
def figure(val, qcv... | akrherz/iem | scripts/ingestors/madis/extract_metarqc.py | Python | mit | 3,881 |
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | gzamboni/sdnResilience | loxi/of13/common.py | Python | gpl-2.0 | 136,813 |
from __future__ import print_function, division, absolute_import
import json
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from tornado.ioloop import IOLoop, PeriodicCallback
from ..core import rpc
from ..utils import is_kernel, log_errors, key_split
from ..scheduler import Scheduler
from ..... | amosonn/distributed | distributed/bokeh/status_monitor.py | Python | bsd-3-clause | 7,492 |
from sqlalchemy.schema import (
Table,
Column,
MetaData,
ForeignKey)
from sqlalchemy.types import (
Text,
JSON,
DateTime,
Integer,
String)
from collections import defaultdict
from uuid import uuid4
import datetime
class SchemaStore:
def __init__(self):
self.metadata = d... | grahame/ealgis | django/ealgis/dataschema/schema_v1.py | Python | gpl-3.0 | 3,861 |
x = 25
epsilon = 0.01
numGuess = 0
low = 0.0
high = max(1.0, x)
ans = (high + low) / 2.0
while abs(ans ** 2 - x) >= epsilon:
print('low =', low, 'high =', high, 'ans =', ans)
if ans ** 2 < x:
low = ans
else:
high = ans
ans = (high + low) / 2.0
numGuess += 1
print(ans, 'is close to s... | knuu/Introduction_to_Computing_and_Programming_Using_Python | ch03/ex3-3-1.py | Python | mit | 339 |
from django.core.exceptions import PermissionDenied
from core.models import Author, Editor
def copy_author_to_submission(user, book):
author = Author(
first_name=user.first_name,
middle_name=user.profile.middle_name,
last_name=user.last_name,
salutation=user.profile.salutation,
... | ubiquitypress/rua | src/submission/logic.py | Python | gpl-2.0 | 2,061 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-02-07 20:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('consumption', '0003_remove_sqldefaultconsumption_couch_id'),
]
operations = [
migr... | dimagi/commcare-hq | corehq/apps/consumption/migrations/0004_rename_sqldefaultconsumption.py | Python | bsd-3-clause | 556 |
from Services.UserService import UserService
from Services.TrainingService import TrainingService
from Services.LtasService import LtasService
from Services.SpectrumService import SpectrumService
from Repositories.RepositoryProvider import *
user_service = UserService(user_repository, training_repository)
training_... | jorgecasals/VoiceTrainingTool | Services/ServiceProvider.py | Python | gpl-3.0 | 559 |
r"""
Empirical Power Estimation (:mod:`skbio.stats.power`)
=====================================================
.. currentmodule:: skbio.stats.power
The purpose of this module is to provide empirical, post-hoc power estimation
of normally and non-normally distributed data. It also provides support to
subsample data ... | demis001/scikit-bio | skbio/stats/power.py | Python | bsd-3-clause | 51,457 |
#! /usr/bin/env python2.4
# -*- coding: latin-1 -*-
#######################################################################
#
# Author: Malte Helmert (helmert@informatik.uni-freiburg.de)
# (C) Copyright 2003-2004 Malte Helmert
#
# This file is part of LAMA.
#
# LAMA is free software; you can redistribute it and/or
# m... | miquelramirez/aptk | toolkit/tools/lama_adl/instantiate.py | Python | lgpl-3.0 | 3,655 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, 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.
# ------------------------------------------------... | qiime2/qiime2 | qiime2/core/type/__init__.py | Python | bsd-3-clause | 1,660 |
from Foundation import *
from AppKit import *
from robofab.pens.pointPen import AbstractPointPen
import vanilla
from defconAppKit.controls.placardScrollView import PlacardScrollView, PlacardPopUpButton
backgroundColor = NSColor.whiteColor()
metricsColor = NSColor.colorWithCalibratedWhite_alpha_(.4, .5)
metricsTitlesCo... | Ye-Yong-Chi/defconAppKit | Lib/defconAppKit/controls/glyphView.py | Python | mit | 28,882 |
print "Warning: contextTool.projectAwareness has been depreciate, please use reviewTool.projectAwareness"
from reviewTool.projectAwareness import *
# Copyright 2008-2012 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios)
#
# This file is part of anim-studio-tools.
#
# anim-studio-tools is free software: you can... | xxxIsaacPeralxxx/anim-studio-tools | review_tool/code/contextTool/projectAwareness.py | Python | gpl-3.0 | 939 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'GovUnits'
db.create_table(u'usgs_govunits', (
... | garnertb/rogue_geonode | geoshape/usgs/migrations/0001_initial.py | Python | gpl-3.0 | 5,873 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | 0vercl0k/rp | src/third_party/beaengine/tests/0f3a09.py | Python | mit | 3,618 |
#
# Copyright 2011 Thomas Bollmeier
#
# This file is part of GObjectCreator2.
#
# GObjectCreator2 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 late... | ThomasBollmeier/GObjectCreator2 | src/gobjcreator2/output/gobject_writer.py | Python | gpl-3.0 | 54,629 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('feedback', '0003_auto_20140619_0349'),
]
operations = [
migrations.AlterModelOptions(
name='feedbackitem',
... | littleweaver/django-zenaida | zenaida/contrib/feedback/migrations/0004_auto_20140622_1737.py | Python | bsd-3-clause | 383 |
print "hello world"
print "hello world" | lukaszkoczwara/test | test.py | Python | mit | 40 |
from six import with_metaclass
from .properties import BaseProperty
from .query import QueryManager
import inspect
BUILTIN_DOC_ATTRS = ('_id', '_doc_type')
def get_declared_variables(bases, attrs):
properties = {}
f_update = properties.update
attrs_pop = attrs.pop
for variable_name, obj in list(attr... | armicron/kev | kev/document.py | Python | gpl-3.0 | 5,134 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import re
from frappe.website.render import clear_cache
from frappe.utils import add_to_date, now
from frappe import _
@frappe.whitelist()
def add_comment(comment,... | adityahase/frappe | frappe/templates/includes/comments/comments.py | Python | mit | 2,184 |
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='spam',
version='0.3.1',
description='A project and asset manager for 3d animation and VF... | MrPetru/spam | setup.py | Python | gpl-3.0 | 1,927 |
import sys
import unittest
from unittest.mock import MagicMock
from PyQt5 import QtGui, QtCore
from sas.qtgui.Plotting.PlotterData import Data1D
from sas.qtgui.Plotting.PlotterData import Data2D
from UnitTesting.TestUtils import WarningTestNotImplemented
from sasmodels import generate
from sasmodels import modelinf... | SasView/sasview | src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingUtilitiesTest.py | Python | bsd-3-clause | 11,524 |
from unittest.mock import patch
from nose.tools import assert_equal, assert_in
from pyecharts import options as opts
from pyecharts.charts import Grid, Liquid
from pyecharts.commons.utils import JsCode
@patch("pyecharts.render.engine.write_utf8_html_file")
def test_liquid_base(fake_writer):
c = Liquid().add("lq... | chenjiandongx/pyecharts | test/test_liquid.py | Python | mit | 1,286 |
#!/usr/bin/env python
#
# Buildbot CVS Mail
#
# This script was derrived from syncmail,
# Copyright (c) 2002-2006 Barry Warsaw, Fred Drake, and contributors
#
# http://cvs-syncmail.cvs.sourceforge.net
#
# The script was re-written with the sole pupose of providing updates to
# Buildbot master by ... | buildbot/buildbot-contrib | master/contrib/buildbot_cvs_mail.py | Python | gpl-2.0 | 8,180 |
# Copyright (c) 2021 PaddlePaddle 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 appli... | luotao1/Paddle | python/paddle/fluid/tests/unittests/ipu/test_slice_op_ipu.py | Python | apache-2.0 | 5,828 |
import pytest
import os
import struct
import tempfile
import traceback
from mitmproxy import options
from mitmproxy import exceptions
from mitmproxy.http import HTTPFlow
from mitmproxy.websocket import WebSocketFlow
from mitmproxy.net import tcp
from mitmproxy.net import http
from ...net import tservers as net_tserve... | ujjwal96/mitmproxy | test/mitmproxy/proxy/protocol/test_websocket.py | Python | mit | 18,287 |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class PyminerPipeline(object):
def process_item(self, item, spider):
return item
| bl4cklts/pyminer | pyMiner/pipelines.py | Python | gpl-3.0 | 287 |
from django.conf.urls import patterns, url
urlpatterns = patterns(
'idea.views',
url(r'^$', 'list'),
url(r'^add/$', 'add_idea', name='add_idea'),
url(r'^add/(?P<banner_id>\d+)/$', 'add_idea', name='add_idea'),
url(r'^edit/(?P<idea_id>\d+)/$', 'edit_idea', name='edit_idea'),
url(r'^list/$', 'li... | geomapdev/idea-box | src/idea/urls.py | Python | cc0-1.0 | 983 |
# -*- coding: utf-8 -*-
import datetime
source_suffix = '.rst'
master_doc = 'index'
project = u'BabelCache'
copyright = u'%s, webvariants GbR' % (datetime.date.today().year)
version = '2.0'
release = '2.0'
language = 'de'
exclud... | xrstf/babelcache | docs/conf.py | Python | mit | 513 |
# ***************************************************************************
# This file is part of Passphrase:
# A cryptographically secure passphrase and password generator
# Copyright (C) <2017> <Ivan Ariel Barrera Oro>
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | HacKanCuBa/passphrase-py | passphrase/tests/tests_secrets.py | Python | gpl-3.0 | 4,413 |
# Portions Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# hgweb/request.py - An http request from either CGI or the standalone server.
#
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net... | facebookexperimental/eden | eden/scm/edenscm/mercurial/hgweb/request.py | Python | gpl-2.0 | 5,622 |
import codecs
from django.core.management.base import BaseCommand, CommandError
from ._migrate_db import ParseXML
class Command(BaseCommand):
"""
Runs the _migrate_db.py script.
"""
def add_arguments(self, parser):
parser.add_argument(
'--dumpfile',
action='store',
... | carlosp420/VoSeq | public_interface/management/commands/migrate_db.py | Python | bsd-3-clause | 2,067 |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="color", parent_name="histogram2d.marker", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/histogram2d/marker/_color.py | Python | mit | 404 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRoxygen2(RPackage):
"""A 'Doxygen'-like in-source documentation system for Rd, collation,... | rspavel/spack | var/spack/repos/builtin/packages/r-roxygen2/package.py | Python | lgpl-2.1 | 1,826 |
# -*- coding: UTF-8 -*-
# Copyright 2012-2017 Luc Saffre
# License: BSD (see file COPYING for details)
"""
Declaration fields.
"""
from __future__ import unicode_literals
# from django.db import models
# from django.conf import settings
#from django.utils.translation import string_concat
from lino_xl.lib.accounts.ut... | khchine5/xl | lino_xl/lib/bevats/choicelists.py | Python | bsd-2-clause | 2,710 |
#!/usr/bin/python
# Fibonacci numbers module
def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
def fib2(n): # return Fibonacci series up to n
result = []
a, b = 0, 1
while b < n:
result.append(b)
a, b = b, a+b
return... | hhanff/software | python/fibo.py | Python | apache-2.0 | 346 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-17 11:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateM... | obitec/django-factbook | fact_book/migrations/0001_initial.py | Python | apache-2.0 | 3,518 |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
impo... | docusign/docusign-python-client | test/test_oauth.py | Python | mit | 5,587 |
from flask import Flask
# http://flask.pocoo.org/docs/0.10/patterns/appfactories/
def create_app(config_filename):
app = Flask(__name__, static_folder='templates/static')
app.config.from_object(config_filename)
# Init Flask-SQLAlchemy
from app.basemodels import db
db.init_app(app)
from app.... | jking6884/RESTapi | app/__init__.py | Python | mit | 1,115 |
import sys
import weakref
import numpy as np
import chainer
from chainer.backends import cuda
import chainer.function_node
def _is_xp(x):
return isinstance(x, np.ndarray) or isinstance(x, cuda.ndarray)
class ScheduleInfo(object):
"""A callable wrapper for a function in the static schedule.
Args:
... | okuta/chainer | chainer/graph_optimizations/static_graph.py | Python | mit | 67,104 |
# -*- Mode: Python; test-case-name:flumotion.test.test_worker_worker -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modifi... | flumotion-mirror/flumotion | flumotion/worker/medium.py | Python | lgpl-2.1 | 10,291 |
#
# Copyright (c) SAS Institute 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 w... | fedora-conary/conary | conary/repository/netrepos/cache.py | Python | apache-2.0 | 2,648 |
# -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either versio... | ppiotr/Bibedit-some-refactoring | modules/elmsubmit/lib/elmsubmit_EZEmail.py | Python | gpl-2.0 | 71,434 |
from setup.database.etl.data_sources.gene_expression import GeneExpressionDataSource, LineSubsetGeneExpressionDataSource
from setup.database.etl.processors.etl_processor import ETLProcessor
from setup.database.metadata.database import CCLEDatabase
class GeneExpressionETLProcessor(ETLProcessor):
def __init__(self... | jccotou/panther | setup/database/etl/processors/gene_expression.py | Python | gpl-3.0 | 4,295 |
"""
@file coi-services/mi.idk/idk_setup.py
@author Bill French
@brief Setup IDK environment.
The intent is to not use any pyon code so this script can be run
independantly.
"""
import os
import urllib2
import logging
import subprocess
from mi.core.log import get_logger ; log = get_logger()
PYTHON = '/Library/Framew... | janeen666/mi-instrument | mi/idk/idk_setup.py | Python | bsd-2-clause | 8,939 |
# test BLE Scanning software
# jcs 6/8/2014
import confscan
import sys
import bluetooth._bluetooth as bluez
dev_id = 0
try:
sock = bluez.hci_open_dev(dev_id)
# print "ble thread started"
except:
# print "error accessing bluetooth device..."
sys.exit(1)
confscan.hci_le_set_scan_parameters(sock)
confscan.hci... | codycharris/splunk_ibeacon | python/scanbeacons.py | Python | apache-2.0 | 460 |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class TestModel(models.Model):
name = models.CharField(max_length=200)
test = models.ForeignKey(
'self',
null=True,
blank=True,
related_name='related_test_mo... | luzfcb/django-autocomplete-light | test_project/rename_forward/models.py | Python | mit | 672 |
# Easy to use system logging for Python's logging module.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: December 10, 2020
# URL: https://coloredlogs.readthedocs.io
"""
Easy to use UNIX system logging for Python's :mod:`logging` module.
Admittedly system logging has little to do with colored terminal... | xolox/python-coloredlogs | coloredlogs/syslog.py | Python | mit | 11,849 |
"""
Testing for mean shift clustering methods
"""
import numpy as np
import warnings
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.... | vortex-ape/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | Python | bsd-3-clause | 4,861 |
# coding: utf-8
from kpi.serializers import UserSerializer
from kpi.views.v2.user import UserViewSet as UserViewSetV2
class UserViewSet(UserViewSetV2):
"""
## This document is for a deprecated version of kpi's API.
**Please upgrade to latest release `/api/v2/users/`**
This viewset provides only the ... | kobotoolbox/kpi | kpi/views/v1/user.py | Python | agpl-3.0 | 464 |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/hardware/thermorack.py | Python | apache-2.0 | 5,679 |
from stack_with_max import Stack
# @include
class QueueWithMax:
def __init__(self):
self._enqueue = Stack()
self._dequeue = Stack()
def enqueue(self, x):
self._enqueue.push(x)
def dequeue(self):
if self._dequeue.empty():
while not self._enqueue.empty():
... | meisamhe/GPLshared | Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/queue_with_max.py | Python | gpl-3.0 | 2,226 |
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for
# high-level documentation on how this system works.
import copy
import os
import shutil
import sys
import time
from io import StringIO
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from unittest import mock
import ujso... | shubhamdhama/zulip | zerver/tests/test_events.py | Python | apache-2.0 | 163,703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.