code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
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='QSTK',
version='0.1',
description='Python toolkit for stocks',
author='Tucker Balch',
author_email='tuck... | hughdbrown/QSTK-nohist | setup.py | Python | bsd-3-clause | 1,047 |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.utils.text import slugify
from django.contrib.auth.models import User
ROOM_TYPE = (
(1, u'Privado'),
(2, u'Grupo'),
)
class Room(models.Model):
name = models.TextField(... | nicolaszein/chat | chat/models.py | Python | bsd-3-clause | 2,028 |
# Copyright The IETF Trust 2007, All Rights Reserved
# Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | wpjesus/codematch | ietf/utils/test_runner.py | Python | bsd-3-clause | 23,631 |
from django.contrib import admin
from django.contrib.contenttypes.generic import GenericStackedInline
from reversion.admin import VersionAdmin
from test_project.test_app.models import ChildModel, RelatedModel, GenericRelatedModel, ProxyModel
class RelatedModelInline(admin.StackedInline):
model = RelatedMo... | empty/django-reversion | test_project/test_app/admin.py | Python | bsd-3-clause | 780 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'ProjectMember', fields ['project', 'user']
db.delete_unique('sentry_projectmember... | rdio/sentry | src/sentry/migrations/0053_auto__del_projectmember__del_unique_projectmember_project_user.py | Python | bsd-3-clause | 19,934 |
# -*- coding: utf-8 -*-
import copy
from functools import wraps
import json
import sys
import django
from django.contrib.admin.helpers import AdminForm
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.models import LogEntry, CHANGE
f... | donce/django-cms | cms/admin/pageadmin.py | Python | bsd-3-clause | 67,669 |
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from .models import Document
from .forms import DocumentForm
def list(request):
# Handle file upload
if request.method == 'POST'... | dadisigursveinn/VEF-Lokaverkefni | photos/views.py | Python | bsd-3-clause | 991 |
# -*-coding:Utf-8 -*
# Copyright (c) 2014 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/familier/masques/nom_familier/__init__.py | Python | bsd-3-clause | 3,922 |
import sqlite3
import jukebox
from song_metadata import SongMetadata
from file_metadata import FileMetadata
class JukeboxDB:
def __init__(self, metadata_db_file_path=None, debug_print=False):
self.debug_print = debug_print
self.db_connection = None
if metadata_db_file_path is not None and... | pauldardeau/cloud-jukebox | jukebox_db.py | Python | bsd-3-clause | 18,366 |
"""
raven.contrib.django.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Acts as an implicit hook for Django installs.
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from h... | gregorynicholas/raven-python | raven/contrib/django/models.py | Python | bsd-3-clause | 7,782 |
def extractHutnovelBlogspotCom(item):
'''
Parser for 'hutnovel.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('True Star', 'True Star', ... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractHutnovelBlogspotCom.py | Python | bsd-3-clause | 745 |
# -*- coding: utf-8 -*-
"""
sleepy.models.user
~~~~~~~~~~~~~~~~~~
User model.
"""
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
pass
| YouNeedToSleep/sleepy | src/sleepy/models/user.py | Python | bsd-3-clause | 184 |
#! /usr/bin/env python
import re
import math
import collections
import numpy as np
import time
import operator
from scipy.io import mmread, mmwrite
from random import randint
from sklearn import cross_validation
from sklearn import linear_model
from sklearn.grid_search import GridSearchCV
from sklearn import preproces... | Goodideax/CS249 | new.py | Python | bsd-3-clause | 14,678 |
#!/usr/bin/env vpython
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper for adding logdog streaming support to swarming tasks."""
import argparse
import contextlib
import logging
import os
impor... | youtube/cobalt | build/android/test_wrapper/logdog_wrapper.py | Python | bsd-3-clause | 4,633 |
import sys
sys.path = ['..'] + sys.path
import zope
from twisted.internet import reactor
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.transport import TTwisted
from thrift.protocol import TBinaryProtocol
from lib.genpy.snowflake import Snowflake
from lib.genpy.snowflake.tt... | michaelmontano/snowflakepy | src/snowflakeserver.py | Python | bsd-3-clause | 1,494 |
# Copyright 2012 the V8 project authors. 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 list of conditi... | CTSRD-SOAAP/chromium-42.0.2311.135 | v8/PRESUBMIT.py | Python | bsd-3-clause | 10,311 |
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""build_target_lib tests."""
from __future__ import print_function
import os
from chromite.lib.build_target_lib import BuildTa... | endlessm/chromium-browser | third_party/chromite/lib/build_target_lib_unittest.py | Python | bsd-3-clause | 1,720 |
#!/usr/bin/env vpython3
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import datetime
import os
import sys
import tempfile
import unittest
if sys.version_info[0] =... | ric2b/Vivaldi-browser | chromium/testing/unexpected_passes_common/expectations_unittest.py | Python | bsd-3-clause | 21,813 |
#pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from numpy.testing import assert_almost_equal
from matplotlib.figure import Figure
from glue.core.data import CategoricalComponent
from mock import MagicMock
from ..... | JudoWill/glue | glue/core/tests/test_roi.py | Python | bsd-3-clause | 29,076 |
from django.http import HttpResponseNotAllowed
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
from wagtail.admin import messages
from wagtail.admin.forms import S... | takeflight/wagtailvideos | wagtailvideos/views/videos.py | Python | bsd-3-clause | 6,698 |
from models import *
from forms import CategoryImageForm
from django.contrib import admin
class CategoryImageInline(admin.TabularInline):
model = CategoryImage
form = CategoryImageForm
class CategoryOptions(admin.ModelAdmin):
prepopulated_fields = {'slug': ('name',)}
list_display = ['name', 'slug', 'p... | howiworkdaily/scofield-project | scofield/category/admin.py | Python | bsd-3-clause | 898 |
# -*- coding: utf-8 -*-
#
# Python musiXmatch documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 28 22:28:39 2011.
#
# 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 f... | monkeython/loremipsum | docs/conf.py | Python | bsd-3-clause | 6,020 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.db.models import Q
from machina.conf import settings as machina_settings
from machina.core.db.models import get_model
ForumPermission = get_model('forum_permission', 'ForumPermission')
GroupFor... | reinbach/django-machina | machina/apps/forum_permission/checker.py | Python | bsd-3-clause | 6,359 |
"""
===============================
Multiple subjects pipeline demo
===============================
A basic multiple subjects pipeline. CBF maps are normalized to
the reference MNI template.
"""
import matplotlib.pylab as plt
import nipype.interfaces.spm as spm
from nipype.caching import Memory
from nilearn import pl... | test-organization-tmp/test-repo | examples/pipelines/multiple_subjects.py | Python | bsd-3-clause | 4,182 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import oscar.models.fields.autoslugfield
import django.db.models.deletion
import oscar.models.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
("partner... | thelabnyc/django-oscar-cybersource | sandbox/order/migrations/0001_initial.py | Python | isc | 40,289 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | KhronosGroup/COLLADA-CTS | StandardDataSets/collada/library_lights/_reference/_reference_directional_white/_reference_directional_white.py | Python | mit | 3,987 |
from flask import Flask, render_template, redirect, session, request
import random
app = Flask(__name__)
app.secret_key ="Felipe"
@app.route('/')
def index():
if not 'number_to_guess' in session:
session['hidebutton'] = 'hide'
session['number_to_guess'] = random.randrange(0,101)
print session['number_to_guess']... | jiobert/python | Velez_Felipe/Asignments/Great Number Game/server.py | Python | mit | 1,419 |
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.domain.definitions.abstract_payment_method_specific_input import AbstractPaymentMethodSpecificInput
from ingenico.connect.sdk.domain.payment.de... | Ingenico-ePayments/connect-sdk-python2 | ingenico/connect/sdk/domain/payment/definitions/non_sepa_direct_debit_payment_method_specific_input.py | Python | mit | 8,060 |
#### 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 = Intangible()
result.template = "object/draft_schematic/community_crafting/component/shared_lightweight_turret_hard... | obi-two/Rebelion | data/scripts/templates/object/draft_schematic/community_crafting/component/shared_lightweight_turret_hardware.py | Python | mit | 485 |
from . import models
from google.appengine.ext import ndb
class Domain(models.Model):
domain = ndb.StringProperty()
| grow/airdrive | app/domains.py | Python | mit | 120 |
__author__ = 'anicca'
# core
import math
import sys
from itertools import izip
# 3rd party
from PIL import Image, ImageChops
import argh
def dhash(image, hash_size=8):
# Grayscale and shrink the image in one step.
image = image.convert('L').resize(
(hash_size + 1, hash_size),
Image.ANTIALIAS... | metaperl/clickmob | src/dhash.py | Python | mit | 2,158 |
#!/usr/bin/python3
"""
A script to get the public ip address from http://checkip.dyndns.org
"""
import urllib.error
import urllib.request
import re
import time
def contact_server():
"""
Try to get public ip address
"""
ipv4_address_pattern=re.compile(r'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
ip_addresses... | Bolt64/my_code | twitter_bot/get_ip.py | Python | mit | 881 |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Domain(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.scene"
_path_str = "layout.scene.domain"
_valid_props = {"column", "row", "x", "y"... | plotly/python-api | packages/python/plotly/plotly/graph_objs/layout/scene/_domain.py | Python | mit | 5,784 |
#forces : A fast customized optimization solver.
#
#Copyright (C) 2013-2016 EMBOTECH GMBH [info@embotech.com]. All rights reserved.
#
#
#This software is intended for simulation and testing purposes only.
#Use of this software for any commercial purpose is prohibited.
#
#This program is distributed in the hope that it... | embotech/forcesnlp-examples | robot/acado/export_MPC/forces/interface/forces_build.py | Python | mit | 2,126 |
"""Browser instance getter tests."""
import pytest
@pytest.fixture(scope='session')
def splinter_session_scoped_browser():
"""Override to default to test getter twice."""
return True
def test_browser_instance_getter(request, browser_instance_getter):
"""Test browser_instance_getter fixture.
Test th... | miohtama/pytest-splinter | tests/mocked_browser/test_getter.py | Python | mit | 1,009 |
"""SCons.Tool.zip
Tool-specific initialization for zip.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCon... | Distrotech/scons | build/scons/engine/SCons/Tool/zip.py | Python | mit | 3,328 |
"Core exceptions raised by the Redis client"
class RedisError(Exception):
pass
class ConnectionError(RedisError):
pass
class TimeoutError(RedisError):
pass
class AuthenticationError(ConnectionError):
pass
class AuthorizationError(ConnectionError):
pass
class BusyLoadingError(ConnectionEr... | mozillazg/redis-py-doc | redis/exceptions.py | Python | mit | 4,645 |
from typing_extensions import Protocol
# noinspection PyPropertyDefinition
class UserLike(Protocol):
@property
def is_active(self) -> bool: ...
@property
def is_authenticated(self) -> bool: ...
@property
def is_anonymous(self) -> bool: ...
| MarauderXtreme/sipa | sipa/backends/types.py | Python | mit | 268 |
##########################################################################
# Copyright (c) 2009-2016 ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Universitaetstr 6, CH... | razvan9310/barrelfish | tools/grader/subprocess_timeout.py | Python | mit | 894 |
"""
Sources:
- Viking Language 1 by Jessie L. Byock 2013
Unicode: 16A0–16FF
"""
from enum import Enum, auto
__author__ = ["Clément Besnier <clemsciences@aol.com>", ]
POINT = "᛫"
SEMI_COLUMN = "\u16EC"
class AutoName(Enum):
def _generate_next_value_(name, a, b, d):
return name
class RunicAlphabetNa... | LBenzahia/cltk | cltk/corpus/old_norse/runes.py | Python | mit | 8,337 |
from django.db import models
class BranchManager(models.Manager):
def get_branch(self, user, project):
try:
return self.get(user=user, project=project, active=True)
except:
return self.create(user=user, project=project, active=True)
class Branch(models.Model):
user = ... | alex/readthedocs.org | readthedocs/editor/models.py | Python | mit | 726 |
def main():
s=raw_input()
if s.isdigit():
print "True"
else:
print "False"
main()
| kumarisneha/practice_repo | techgig/techgig_isnumeric.py | Python | mit | 117 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import collections
import abc
import numpy as np
from pymatgen.core.spectrum import Spectrum
from pymatgen.util.plotting import add_fig_kwargs
"""
This module implements core classes for calculation of diff... | fraricci/pymatgen | pymatgen/analysis/diffraction/core.py | Python | mit | 7,522 |
#!/usr/bin/env python
import unittest
from test import test_support
import socket
import urllib
import sys
import os
import mimetools
class URLTimeoutTest(unittest.TestCase):
TIMEOUT = 10.0
def setUp(self):
socket.setdefaulttimeout(self.TIMEOUT)
def tearDown(self):
socket.setdefaulttim... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.3/Lib/test/test_urllibnet.py | Python | mit | 5,447 |
import logging
import random
import urllib.parse
import collections
import aiohttp
import discord
import motor.motor_asyncio
from discord.ext import commands
from .common import Cog
log = logging.getLogger(__name__)
class BooruError(Exception):
pass
class BooruProvider:
url = ''
@classmethod
def... | lnmds/jose | ext/nsfw.py | Python | mit | 7,881 |
"""
Settings for REST framework are all namespaced in the REST_FRAMEWORK setting.
For example your project's `settings.py` file might look like this:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.YAMLRenderer',
)
'DEFAULT... | DeltaEpsilon-HackFMI2/FMICalendar-REST | venv/lib/python2.7/site-packages/rest_framework/settings.py | Python | mit | 6,264 |
import path
import logging
import shutil
import os
log = logging
START_ID = "automatically created attributes start"
END_ID = "automatically created attributes end"
START_STATIC_ID = "automatically created static attributes start"
END_STATIC_ID = "automatically created static attributes end"
START_NODE_ID = 0x0011E... | haggi/OpenMaya | src/common/python/Renderer/textureCreator.py | Python | mit | 17,166 |
# $Id: TestAll.py 1047 2009-01-15 14:48:58Z graham $
#
# Unit testing for WebBrick library functions (Functions.py)
# See http://pyunit.sourceforge.net/pyunit.html
#
import sys, unittest, logging, zipfile, re, StringIO, os, logging, cgi
from os.path import normpath, abspath
from rdflib import URIRef
sys.path.append("..... | bhavanaananda/DataStage | src/SubmitDatasetHandler/tests/TestGetDatasetMetadataHandler.py | Python | mit | 2,943 |
# Base exception classes
class PGError(Exception):
"""
Base class for all exceptions explicitly raised in PolyglotDB.
"""
def __init__(self, value):
self.value = value
def __repr__(self):
return '{}: {}'.format(type(self).__name__, self.value)
def __str__(self):
ret... | MontrealCorpusTools/PolyglotDB | polyglotdb/exceptions.py | Python | mit | 6,861 |
'''
This script analyzes the Boston housing dataset available via scikit-learn. It
generates a textual report and a set of plot images into the 'report' directory.
'''
import logging
import matplotlib
# non-interactive plotting - just outputs the images and doesn't open the window
matplotlib.use('Agg')
import matplotl... | bzamecnik/ml-playground | ml-playground/boston_dataset_exploration/data_analysis.py | Python | mit | 6,084 |
import numpy as np
scores = np.array([0,1])
nScores = len(scores)
nClasses = 2
inputFile = "./data/crowdlabels_table_mixed.csv"
tableFormat = True
outputFile = "./data/test.out"
confMatFile = "./data/test_ibcc.mat"
goldFile = "./data/goldmat_mixed.csv"
nu0 = np.array([50,50])
alpha0 = np.array([[2, 1], [1, 2]])
| CitizenScienceInAstronomyWorkshop/pyIBCC | python/tests/config/table_shortgoldmat.py | Python | mit | 313 |
import unittest
import sys
from linguine.ops.remove_stopwords import RemoveStopwords
class RemoveStopwordsTest(unittest.TestCase):
def setUp(self):
self.op = RemoveStopwords()
def test_run(self):
self.op = RemoveStopwords()
self.test_data = []
self.assertEqual(self.op.run(sel... | kmp3325/linguine-python | test/remove_stopwords_test.py | Python | mit | 446 |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe Technologies and contributors
# License: MIT. See LICENSE
# import frappe
from frappe.model.document import Document
class UserDocumentType(Document):
pass
| frappe/frappe | frappe/core/doctype/user_document_type/user_document_type.py | Python | mit | 212 |
# -*- coding: utf-8 -*-
from data_utils import get_file
import string
import random
import cPickle
def make_reuters_dataset(path='datasets/temp/reuters21578/', min_samples_per_topic=15):
import os
import re
from preprocessing.text import Tokenizer
wire_topics = []
topic_counts = {}
wire_bodies... | wavelets/keras | keras/datasets/reuters.py | Python | mit | 3,237 |
def reverse(array, i, j):
while i < j:
array[i], array[j] = array[j], array[i]
i += 1
j -= 1
def reverse_words(string):
arr = string.strip().split() # arr is list of words
n = len(arr)
reverse(arr, 0, n-1)
return " ".join(arr)
if __name__ == "__main__":
test = "I a... | keon/algorithms | algorithms/strings/reverse_words.py | Python | mit | 396 |
import unittest
from mock import patch
from nose.tools import assert_equal
from tests.tools import create_mock_json
from twilio.rest.resources.pricing.messaging_countries import (
MessagingCountries
)
AUTH = ("AC123", "token")
BASE_URI = "https://pricing.twilio.com/v1"
class MessagingCountriesTest(unittest.TestC... | kramwens/order_bot | venv/lib/python2.7/site-packages/tests/pricing/test_messaging_countries.py | Python | mit | 3,318 |
"""
Get the stem of a word, given a declined form and its gender.
TODO: Check this logic with von Soden's Grundriss der akkadischen Grammatik.
TODO: Deal with j/y issue.
"""
__author__ = ['M. Willis Monroe <willismonroe@gmail.com>']
__license__ = 'MIT License. See LICENSE.'
ENDINGS = {
'm': {
'singular':... | LBenzahia/cltk | cltk/stem/akkadian/stem.py | Python | mit | 2,502 |
import pytest
from thefuck.types import Command
from thefuck.rules.git_push_without_commits import (
fix,
get_new_command,
match,
)
command = 'git push -u origin master'
expected_error = '''
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:User/repo.git'
'''... | SimenB/thefuck | tests/rules/test_git_push_without_commits.py | Python | mit | 659 |
import unittest
from series import slices
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
class SeriesTest(unittest.TestCase):
def test_slices_of_one_from_one(self):
self.assertEqual(slices("1", 1), ["1"])
def test_slices_of_one_from_two(self):
self.assertEqual(s... | TGITS/programming-workouts | exercism/python/series/series_test.py | Python | mit | 1,747 |
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from config import config
def send_mail(message,receivers=config['smtp_receivers']):
"""
Module that sends emails.
Message should be a dictionary containing the following keys:
... | rajaram1990/GetNSEStockPrice | GetNSEStockPrice/email_base.py | Python | mit | 1,041 |
#### 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 = Intangible()
result.template = "object/draft_schematic/scout/shared_item_camp_multi.iff"
result.attribute_templat... | anhstudios/swganh | data/scripts/templates/object/draft_schematic/scout/shared_item_camp_multi.py | Python | mit | 450 |
import pytest
def test_inheritance(msg):
from pybind11_tests import Pet, Dog, Rabbit, Hamster, dog_bark, pet_name_species
roger = Rabbit('Rabbit')
assert roger.name() + " is a " + roger.species() == "Rabbit is a parrot"
assert pet_name_species(roger) == "Rabbit is a parrot"
polly = Pet('Polly', ... | fevangelista/pyWicked | external/pybind11/tests/test_inheritance.py | Python | mit | 1,876 |
from dal import autocomplete
from django.conf.urls import url
from tagging.models import Tag
urlpatterns = [
url(
'test-autocomplete/$',
autocomplete.Select2QuerySetView.as_view(
queryset=Tag.objects.all(),
),
name='select2_tagging',
),
]
| luzfcb/django-autocomplete-light | test_project/select2_tagging/urls.py | Python | mit | 295 |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# 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 limi... | danielreed/python-hpOneView | tests/unit/resources/storage/test_storage_systems.py | Python | mit | 10,807 |
from flask_restful import Api
from . import api_blueprint
from ..api_1_0.resources.users import UserAPI, UserListAPI
from ..api_1_0.resources.authentication import (TokenRefresh, UserLogin,
UserLogoutAccess, UserLogoutRefresh)
from ..api_1_0.resources.machines import MachineAPI, MachineListAPI, \
UserMachineLis... | rivalrockets/rivalrockets-api | app/api_1_0/app.py | Python | mit | 3,161 |
"""
KeepalivePlugin is a pretty cool guy. Eh reflects keep alive packets and doesnt
afraid of anything.
"""
from spockbot.plugins.base import PluginBase
class KeepalivePlugin(PluginBase):
requires = 'Net'
events = {
'PLAY<Keep Alive': 'handle_keep_alive',
}
# Keep Alive - Reflects data back ... | gamingrobot/SpockBot | spockbot/plugins/helpers/keepalive.py | Python | mit | 451 |
import unittest
import tests.integration.init_utils as init_utils
from ingenico.connect.sdk.request_header import RequestHeader
from tests.integration.init_utils import MERCHANT_ID
from ingenico.connect.sdk.merchant.products.directory_params import DirectoryParams
from ingenico.connect.sdk.factory import Factory
from i... | Ingenico-ePayments/connect-sdk-python2 | tests/integration/test_multiline_header.py | Python | mit | 1,483 |
#!/usr/bin/python
# 11.py is
str2 = "interpreter the output"
st1 = "123456"
st2 = "Abcd"
st4 = "ABC"
st3 = " "
print(st1.isalnum())
print(st2.isalpha())
print(str2.isdigit())
print(str2.islower())
print(st1.isspace())
print(st3.isspace())
print(st2.isupper())
print(st4.isupper()) | Bodidze/21v-python | unit_02/11.py | Python | mit | 285 |
"""
-----------------------------------------------------------------------------
Copyright (c) 2009-2019, Shotgun Software Inc.
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 re... | cpenv/autocpenv | packages/cpenv/vendor/shotgun_api3/lib/sgsix.py | Python | mit | 3,822 |
#### 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 = Static()
result.template = "object/static/structure/naboo/shared_bridge_stairs_s03.iff"
result.attribute_template... | anhstudios/swganh | data/scripts/templates/object/static/structure/naboo/shared_bridge_stairs_s03.py | Python | mit | 453 |
import logging
import time
import json
import oauth2 as oauth
import httplib2
import urllib
import twitter_settings
class TwitterError(Exception):
def __init__(self, status_code, content):
self.status_code = status_code
self.content = content
def __str__(self):
return "Twitter retur... | Ethernyan/EbookBot | twitter.py | Python | mit | 3,814 |
#!/usr/local/sci/bin/python
# PYTHON2.7
# import TestLeap
# TestVal = TestLeap.TestLeap(year)
import numpy as np
def TestLeap(year):
'''function to test if a year is a leap year'''
'''returns 0.0 if it is a leap year'''
'''returns a non-zero number if it is not a leap year'''
'''ONLY WORKS WITH SCAL... | Kate-Willett/HadISDH_Build | TestLeap.py | Python | cc0-1.0 | 632 |
from hashlib import md5, sha1
import cherrypy
from cherrypy._cpcompat import ntob
from cherrypy.lib import httpauth
from cherrypy.test import helper
class HTTPAuthTest(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
@cherrypy.expose
def index(self):
... | Southpaw-TACTIC/TACTIC | 3rd_party/python2/site-packages/cherrypy/test/test_httpauth.py | Python | epl-1.0 | 6,303 |
# Twisted, the Framework of Your Internet
# Copyright (C) 2001-2003 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed i... | fxia22/ASM_xf | PythonD/site_python/twisted/im/tocsupport.py | Python | gpl-2.0 | 8,589 |
#!/usr/bin/python
import os
import requests
from requests.exceptions import HTTPError
import hashlib
import json
from optparse import OptionParser
from glob import glob
from msilib import *
CHUNK_SIZE = 1048576 # 1 Mb chunk size
class MsiUploader():
def __init__(self, url, user, password):
self.base_url ... | lsjostro/pulp_win | test/upload_msi.py | Python | gpl-2.0 | 6,243 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2016 bromix (plugin.video.youtube)
Copyright (C) 2016-2018 plugin.video.youtube
SPDX-License-Identifier: GPL-2.0-only
See LICENSES/GPL-2.0-only for more information.
"""
from . import const_settings as setting
from . import const_localize as localize
fro... | jdf76/plugin.video.youtube | resources/lib/youtube_plugin/kodion/constants/__init__.py | Python | gpl-2.0 | 526 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
import numpy as np
from processing.molusce.algorithms.models.crosstabs.model import CrossTable
class CrossTabManagerError(Exception):
'''Base class for exceptions in this module.'''
def __init__(self, msg):
self.msg = msg
cla... | adwiputra/LUMENS-repo | processing/molusce/algorithms/models/crosstabs/manager.py | Python | gpl-2.0 | 3,527 |
# Copyright (C) 2006-2011 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... | Distrotech/bzr | bzrlib/tests/test_bzrdir.py | Python | gpl-2.0 | 68,233 |
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | beav/pulp | server/test/unit/test_content_catalog_manager.py | Python | gpl-2.0 | 8,951 |
# -*- coding: utf-8 -*-
"""
Moisture Plugin
Copyright (C) 2013 Olaf Lüke <olaf@tinkerforge.com>
__init__.py: package initialization
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
o... | Tinkerforge/brickv | src/brickv/plugin_system/plugins/moisture/__init__.py | Python | gpl-2.0 | 909 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009,
# 2010, 2011, 2012, 2013, 2014, 2015 CERN.
#
# 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 Sof... | SDSG-Invenio/invenio | invenio/legacy/bibindex/engine.py | Python | gpl-2.0 | 101,575 |
#!/usr/bin/env python
from __future__ import absolute_import
import urllib2
from pytomo import lib_youtube_download
from pytomo import start_pytomo
start_pytomo.configure_log_file('http_test')
ip_address_uri = ("http://173.194.5.107/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor... | Jamlum/pytomo | test_http_server.py | Python | gpl-2.0 | 1,820 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2017-02-21 17:04
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('index', '0012_cartridgeitemname_manufacturer'),
]
o... | sfcl/ancon | index/migrations/0013_auto_20170221_2204.py | Python | gpl-2.0 | 578 |
# jhbuild - a build script for GNOME 1.x and 2.x
# Copyright (C) 2007 Alberto Ruiz <aruiz@gnome.org>
#
# unpack.py: helper functions for unpacking compressed packages
#
# 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 ... | rpavlik/jhbuild-vrjuggler | jhbuild/utils/unpack.py | Python | gpl-2.0 | 5,855 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | bobmyhill/burnman | docs/conf.py | Python | gpl-2.0 | 8,235 |
# Functions for finding random points and orientations.
#
# Written by: Konrad Hinsen
# Last revision: 2000-8-9
#
"""This module defines various random quantities that are useful in
molecular simulations. For obtaining random numbers, it tries to use
the RNG module, which is part of the LLNL package distribution, whi... | fxia22/ASM_xf | PythonD/site_python/MMTK/Random.py | Python | gpl-2.0 | 5,293 |
# This file is part of Buildbot. Buildbot 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 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/www/avatar.py | Python | gpl-2.0 | 9,042 |
# Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
from django.conf import settings
URL_TYPES = ('path_prefix', 'domain_component', 'domain')
URL_TYPE = getattr(settings, 'LOCALE_URL_TYPE', 'path_prefix')
assert URL_TYPE in URL_TYPES, \
"LOCALE_URL_TYPE must be o... | pombredanne/SmartNotes | submodules/django-localeurl-read-only/localeurl/settings.py | Python | gpl-3.0 | 1,050 |
# Copyright (C) 2010 Canonical
#
# Authors:
# Gary Lasker
# Michael Vogt
#
# 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 that it will b... | armikhael/software-center | softwarecenter/backend/channel.py | Python | gpl-3.0 | 12,773 |
#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licens... | nijel/weblate | weblate/addons/autotranslate.py | Python | gpl-3.0 | 2,345 |
#!/usr/bin/python2.7
#
# This file is part of drizzle-ci
#
# Copyright (c) 2013 Sharan Kumar M
#
# drizzle-ci 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
... | pcrews/drizzle-ci-salt | test-install.py | Python | gpl-3.0 | 3,724 |
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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 th... | ezequielpereira/Time-Line | timelinelib/wxgui/components/filechooser.py | Python | gpl-3.0 | 2,868 |
# Author: Idan Gutman
# Modified by jkaberg, https://github.com/jkaberg for SceneAccess
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage 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... | SiCKRAGETV/SickRage | sickrage/providers/torrent/hdtorrents.py | Python | gpl-3.0 | 6,494 |
import json
from copy import deepcopy
class Message(object):
stub = {}
def __init__(self, gisc_name, timestamp):
self.data = {
'wmo_wis_monitoring': '1.1',
'centre': gisc_name,
'timestamp': timestamp
}
self.data.update(self.stub)
def serialize(... | ywang-bom/wismon | wismon/templates.py | Python | gpl-3.0 | 6,366 |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2017 SML
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... | Dino0631/RedRain-Bot | cogs/notinusecogs/react.py | Python | gpl-3.0 | 19,223 |
# Copyright (C) 2007-2010 Richard Lincoln
#
# PYPOWER 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.
#
# PYPOWER is distributed in the... | rwl/pyreto | pyreto/continuous/task.py | Python | gpl-3.0 | 6,830 |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ardrone_autonomy/navdata_time.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class navdata_time(genpy.Message):
_md5sum = "8642a5656fdcc931093... | aslab/rct | mrt/src/tum_simulator_ws/devel/lib/python2.7/dist-packages/ardrone_autonomy/msg/_navdata_time.py | Python | gpl-3.0 | 6,555 |
"""
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | schakrava/rockstor-core | src/rockstor/scripts/pwreset.py | Python | gpl-3.0 | 2,030 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import re
from django import template
from django.conf import settings as django_settings
from django.contrib.contenttypes.models import ContentType
from django.db.models import Model
from django.forms import BaseForm
from django.templat... | NablaWebkom/django-wiki | wiki/templatetags/wiki_tags.py | Python | gpl-3.0 | 5,449 |
import logging
import json
import textwrap
from json.encoder import JSONEncoder
from logging import StreamHandler, Formatter, FileHandler
from ethereum.utils import bcolors, is_numeric
DEFAULT_LOGLEVEL = 'INFO'
JSON_FORMAT = '%(message)s'
PRINT_FORMAT = '%(levelname)s:%(name)s\t%(message)s'
FILE_PREFIX = '%(asctime... | nirenzang/Serpent-Pyethereum-Tutorial | pyethereum/ethereum/slogging.py | Python | gpl-3.0 | 10,541 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.