text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
"""Invalid Python comment test."""
// invalid python comment # noqa -- tell linters to ignore the intentional syntax error
| duynguyen/incubator-openwhisk | tests/dat/actions/malformed.py | Python | apache-2.0 | 124 | 0 |
###
# Copyright (c) 2013, Nicolas Coevoet
# 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 conditio... | ncoevoet/ChanReg | test.py | Python | mit | 1,737 | 0.000576 |
# Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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 la... | ging/horizon | openstack_dashboard/dashboards/idm/home/views.py | Python | apache-2.0 | 3,184 | 0.000942 |
#-------------------------------------------------------------------------------
# Name: Largest Product in a Series
# Purpose: The four adjacent digits in the 1000-digit number (provided in
# textfile 'q008.txt') that have the greatest product are
# 9 x 9 x 8 x 9 = 5832. Find the... | alexadusei/ProjectEuler | q008.py | Python | mit | 1,143 | 0.006999 |
from flask_pymongo import PyMongo
from flask_cors import CORS
mongo = PyMongo()
cors = CORS() | TornikeNatsvlishvili/skivri.ge | backend/backend/extensions.py | Python | mit | 94 | 0.010638 |
import os
import sys
import logging
from functools import wraps
import celery
from celery.signals import celeryd_after_setup
from kombu import Queue
from django.conf import settings
from munch.core.utils import get_worker_types
log = logging.getLogger('munch')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'munch.... | crunchmail/munch-core | src/munch/core/celery.py | Python | agpl-3.0 | 4,888 | 0 |
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
from iris import db
from iris.role_lookup import IrisRoleLookupException
import logging
logger = logging.getLogger(__name__)
class mailing_list(object):
d... | dwang159/iris-api | src/iris/role_lookup/mailing_list.py | Python | bsd-2-clause | 2,203 | 0.002724 |
#! /usr/bin/python2.7
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import requests
from requests_oauthlib import OAuth1
from urlparse import parse_qs
REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token"
AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize?oauth_token="
ACCESS_TOKE... | teampopong/crawlers | twitter/setup.py | Python | agpl-3.0 | 1,997 | 0.002504 |
#!/usr/bin/env python
from setuptools import setup
setup(
name='MCP',
version='0.2',
author='Keegan Carruthers-Smith',
author_email='keegan.csmith@gmail.com',
url='https://github.com/keegancsmith/MCP',
license='BSD',
py_modules=['mcp'],
description='A program to orchestrate Entellect C... | keegancsmith/MCP | setup.py | Python | bsd-2-clause | 772 | 0 |
# returns the current PeopleSoft semester code, as of today
# if today is between semesters, returns the next semester code
import cx_Oracle
def getCurrentOrNextSemesterCX (self):
file = open('/opt/Plone-2.5.5/zeocluster/client1/Extensions/Oracle_Database_Connection_NGUYEN_PRD.txt', 'r')
for line in file.read... | uwosh/Campus_Directory_web_service | getCurrentOrNextSemesterCX.py | Python | gpl-2.0 | 1,292 | 0.006192 |
#!/usr/bin/env python
import warnings
# Dropping a table inexplicably produces a warning despite
# the "IF EXISTS" clause. Squelch these warnings.
warnings.simplefilter('ignore')
import logging
import unittest
import environment
import tablet
import utils
use_mysqlctld = True
tablet_master = tablet.Tablet(use_mysq... | yaoshengzhe/vitess | test/backup.py | Python | bsd-3-clause | 5,848 | 0.007011 |
from __future__ import unicode_literals
import ctypes
import json
import random
from binascii import a2b_hex, b2a_hex
from io import BytesIO
from unittest import skipUnless
from django.contrib.gis import gdal
from django.contrib.gis.geos import (
HAS_GEOS, GeometryCollection, GEOSException, GEOSGeometry, LinearRi... | kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/gis_tests/geos_tests/test_geos.py | Python | apache-2.0 | 54,041 | 0.001129 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | sasha-gitg/python-aiplatform | google/cloud/aiplatform_v1/types/dataset_service.py | Python | apache-2.0 | 14,664 | 0.00075 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import event_event
from . import event_registration
from . import event_type
from . import website
from . import website_event_menu
from . import website_menu
from . import website_visitor
| rven/odoo | addons/website_event/models/__init__.py | Python | agpl-3.0 | 296 | 0 |
from django.conf.urls.defaults import patterns
urlpatterns = patterns("jimi.catalog.views",
(r"^/?$", "all_categories"),
(r"^(?P<slug>[-\w]+)/$", "node", {}, "node"),
)
| bhell/jimi | jimi/jimi/catalog/urls.py | Python | bsd-3-clause | 178 | 0.005618 |
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import payment_mode
from . import res_company
from . import res_partner
from . import account_tax_template
from . import account_tax
from . import res_currency
from . import account_invoice_integration
from . import account_invoice_integratio... | factorlibre/l10n-spain | l10n_es_facturae/models/__init__.py | Python | agpl-3.0 | 405 | 0 |
class save_and_reraise_exception(object):
def __init__(self):
self.reraise = True
def __enter__(self):
self.type_, self.value, self.tb, = sys.exc_info()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
if exc_type is not None:
logging.error(_('Origin... | windskyer/mvpn | mvpn/openstack/common/excutils.py | Python | gpl-2.0 | 655 | 0.001527 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-02-21 01:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clients', '0002_contact'),
]
operations = [
migrations.AlterField(
... | fernandolobato/balarco | clients/migrations/0003_auto_20170221_0107.py | Python | mit | 804 | 0 |
##############################################################################################
# Copyright 2014-2015 Cloud Media Sdn. Bhd.
#
# This file is part of Xuan Application Development SDK.
#
# Xuan Application Development SDK is free software: you can redistribute it and/or modify
# it under the terms of... | TheStackBox/xuansdk | SDKLibrary/com/cloudMedia/theKuroBox/sdk/paramTypes/kbxHSBColor.py | Python | gpl-3.0 | 2,217 | 0.00406 |
# $HeadURL: $
''' CacheFeederAgent
This agent feeds the Cache tables with the outputs of the cache commands.
'''
from DIRAC import S_OK#, S_ERROR, gConfig
from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient
from DIRAC.Core.Base.... | calancha/DIRAC | ResourceStatusSystem/Agent/CacheFeederAgent.py | Python | gpl-3.0 | 6,141 | 0.033708 |
import logging
from xml.dom.minidom import *
from jinja2 import Environment, Template
from edge.dateutility import DateUtility
from edge.opensearch.response import Response
class TemplateResponse(Response):
def __init__(self):
super(TemplateResponse, self).__init__()
self.env = Environment()
... | dataplumber/edge | src/main/python/libraries/edge/opensearch/templateresponse.py | Python | apache-2.0 | 1,202 | 0.00416 |
import os
import unittest
from vsg.rules import generate
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_015_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sTestDir,... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/generate/test_rule_015.py | Python | gpl-3.0 | 1,158 | 0.004318 |
from setuptools import find_packages, setup
setup(
name='blns',
version='0.1.7',
url='https://github.com/danggrianto/big-list-of-naughty-strings',
license='MIT',
author='Daniel Anggrianto',
author_email='daniel@anggrianto.com',
description='Big List of Naughty String. Forked from https://gi... | danggrianto/big-list-of-naughty-strings | setup.py | Python | mit | 458 | 0.002183 |
#coding: utf-8
#!/usr/bin/env python3
#Initial test code for MiSynth Wave Generator
#Opens Wave Files And Cuts And Plays Them As The FPGA will
#Synth plays back 2048 samples at frequency of note
#Effective sample rate is 901,120Hz @ 440Hz
#CURRENTLY A DRAWING LOOP TO BE SOLVED, THANKS WX/PYTHON FOR YOUR
#COMPLETE LACK... | magicmilo/MiSynth-Wavetable-Generator | main.py | Python | apache-2.0 | 9,015 | 0.003439 |
import setuptools
setuptools.setup(name='txyoga',
version='0',
description='REST toolkit for Twisted',
url='https://github.com/lvh/txyoga',
author='Laurens Van Houtven',
author_email='_@lvh.cc',
packages = setuptools.find_packages(),
requires=['twisted'],
license='IS... | lvh/txyoga | setup.py | Python | isc | 528 | 0.017045 |
import chainer
import chainer.functions as F
import chainer.links as L
class Cifar10(chainer.Chain):
def __init__(self, n_class, in_ch):
super().__init__(
conv1=L.Convolution2D(in_ch, 32, 5, pad=2),
conv2=L.Convolution2D(32, 32, 5, pad=2),
conv3=L.Convolution2D(32, 64,... | 0shimax/DL-vision | src/net/cifar10.py | Python | mit | 1,111 | 0 |
from fastapi import FastAPI
app = FastAPI(swagger_ui_parameters={"syntaxHighlight": False})
@app.get("/users/{username}")
async def read_user(username: str):
return {"message": f"Hello {username}"}
| tiangolo/fastapi | docs_src/extending_openapi/tutorial003.py | Python | mit | 205 | 0 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from collections import defaultdict
# from pprint import pprint
import argparse # Note: python 2.7+
import datetime
import json
import logging
import os
import sys
impor... | nens/githubinfo | githubinfo/commits.py | Python | gpl-3.0 | 11,594 | 0.000086 |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
import sys
from glob import glob
from setuptools import setup
NAME = "pycopia3-process"
VERSION = "1.0"
if sys.platform not in ("win32", "cli"):
DATA_FILES = [
('/etc/pycopia', glob("etc/*")),
]
else:
DATA_FILES = []
setup(n... | kdart/pycopia3 | process/setup.py | Python | apache-2.0 | 1,057 | 0 |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file accompa... | boto/s3transfer | tests/unit/test_subscribers.py | Python | apache-2.0 | 3,197 | 0 |
from interval import interval, inf, imath, fpu
from complexinterval import ComplexInterval, _one, _zero
from complexpolynomial import ComplexPolynomial
class Newton:
def __init__(self, start, poly):
self.start = start
self.poly = poly
self.iterates = 0
self.deriv = poly.derive()
self.step = start
def ite... | yuanagain/seniorthesis | src/intervals/newton.py | Python | mit | 4,396 | 0.036624 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-03-08 07:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gardens', '0025_auto_20180216_1951'),
]
operations = [
migrations.AlterMode... | bengosney/rhgd3 | gardens/migrations/0026_auto_20180308_0720.py | Python | gpl-3.0 | 653 | 0.001531 |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from phd/calc_serviceRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class calc_serviceRequest(genpy.Message):
_md5sum = "504533770c671b8893346f8f23298fee"
_t... | mikewrock/phd_backup_full | devel/lib/python2.7/dist-packages/phd/srv/_calc_service.py | Python | apache-2.0 | 19,928 | 0.018567 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-21 16:16
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
import picklefield.fields
class Migration(migrations.Migration):
dependencies = [
('essauth', '0015_proxypermission'),
]
operatio... | ESSolutions/ESSArch_Core | ESSArch_Core/auth/migrations/0016_auto_20181221_1716.py | Python | gpl-3.0 | 505 | 0 |
import google.appengine.ext.ndb as ndb
import json
import logging
import datetime
from flask import Blueprint
from flask import Response
from natsort import natsorted
from sparkprs import cache, app
from sparkprs.models import Issue, JIRAIssue
prs = Blueprint('prs', __name__)
@prs.route('/search-open-prs')
@cache... | databricks/spark-pr-dashboard | sparkprs/controllers/prs.py | Python | apache-2.0 | 3,838 | 0.002866 |
from . import keyboards
| chancegrissom/qmk_firmware | lib/python/qmk/cli/list/__init__.py | Python | gpl-2.0 | 24 | 0 |
"""This component provides HA sensor support for Ring Door Bell/Chimes."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.const import (
ATTR_ATTRIBUTION, CONF_ENTITY_NAMESPACE,... | jnewland/home-assistant | homeassistant/components/ring/binary_sensor.py | Python | apache-2.0 | 3,663 | 0 |
#!/usr/bin/env python
#
# Copyright 2008 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... | elliotf/appenginewiki | wiki.py | Python | lgpl-2.1 | 9,987 | 0.003304 |
"""
WSGI config for p1 project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setti... | pablo-the-programmer/Registration | conference/conference/wsgi.py | Python | mit | 1,415 | 0.000707 |
"""
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
from __future__ import division, absolute_import, print_function
import datetime
import sys
import operator
import warnings
import pytest
import shutil
import tempfile
import n... | MSeifert04/numpy | numpy/core/tests/test_deprecations.py | Python | bsd-3-clause | 24,541 | 0.001222 |
import unittest
from mahjong.models import Table, ALL_WINDS, WIND_EAST, WIND_NORTH, WIND_SOUTH
import mahjong.services.stone
class MahjongTabelModelTestCase(unittest.TestCase):
def setUp(self):
self.table = Table(stones=mahjong.services.stone.get_all_shuffled())
self.table.wall_wind = WIND_EAST... | Peter-Slump/mahjong | tests/mahjong/models/test_tabel.py | Python | mit | 1,613 | 0 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | savi-dev/horizon | horizon/dashboards/syspanel/projects/forms.py | Python | apache-2.0 | 5,991 | 0.001335 |
#!/usr/bin/env python
import sys
import gobject
import dbus.mainloop.glib
dbus.mainloop.glib.DBusGMainLoop(set_as_default = True)
import telepathy
DBUS_PROPERTIES = 'org.freedesktop.DBus.Properties'
def get_registry():
reg = telepathy.client.ManagerRegistry()
reg.LoadManagers()
return reg
def get_connection... | epage/telepathy-bluewire | hand_tests/generic.py | Python | lgpl-2.1 | 17,072 | 0.034149 |
# -*- encoding: utf-8 -*-
##############################################################################
# Copyright (c) 2015 - Present All Rights Reserved
# Author: Cesar Lage <kaerdsar@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | ITPS/odoo-saas-tools | saas_portal_demo/controllers/__init__.py | Python | gpl-3.0 | 924 | 0 |
# authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip('\n') for x in keys]
# Connect
api = twitter.Api(consumer_key = keys[0],
... | dankolbman/MarketCents | twitter_feed.py | Python | mit | 920 | 0.018478 |
# -*- coding: utf-8 -*-
from django.http import HttpResponse, Http404
from django.template import Context
from django.contrib.sites.models import Site
from listings.syndication.models import Feed
from listings.models import POSTING_ACTIVE
def display_feed(request, feed_url):
site = Site.objects.get_current()
... | wtrevino/django-listings | listings/syndication/views.py | Python | mit | 619 | 0.001616 |
#!/usr/bin/env python
# _*_ coding:utf-8 _*
from commands import StartCommand
from commands import StopCommand
from commands import TwitterCommand
from handlers.ExceptionHandler import ExceptionHandler
COMMANDS = {
'/start': StartCommand.process_message,
'/stop': StopCommand.process_message,
'/tweet': Tw... | CorunaDevelopers/teleTweetBot | teleTweetBot/handlers/TelegramMessageHandler.py | Python | gpl-3.0 | 632 | 0 |
#!/usr/bin/python2.4
#
# Copyright 2011 Google Inc. 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 ... | boxed/CMi | web_frontend/gdata/apps/organization/client.py | Python | mit | 20,094 | 0.003583 |
from matplotlib import pyplot as plt
from matplotlib import cm
from os import path
import numpy as np
import cv2
import pandas as pd
from math import exp, pi, sqrt
import mahotas as mh
from numbapro import vectorize
def show_images(images,titles=None, scale=1.3):
"""Display a list of images"""
n_ims = len(im... | fierval/retina | DiabeticRetinopathy/Refactoring/kobra/imaging.py | Python | mit | 6,612 | 0.013313 |
"""
General Character commands usually availabe to all characters
"""
from django.conf import settings
from evennia.utils import utils, prettytable
from evennia.commands.default.muxcommand import MuxCommand
# limit symbol import for API
__all__ = ("CmdHome", "CmdLook", "CmdNick",
"CmdInventory", "CmdGet", ... | mrkulk/text-world | evennia/commands/default/general.py | Python | bsd-3-clause | 13,667 | 0.001537 |
from battlePy.utils import docprop
(UP, DOWN, LEFT, RIGHT) = SHIP_ORIENTATIONS = range(4)
VECTOR_DICT = {UP: (0, 1), DOWN: (0, -1), LEFT: (-1, 0), RIGHT: (1, 0)}
class Ship(object):
name = docprop('name', 'Name of the ship')
size = docprop('size', 'Size of the ship')
hits = docprop('hits', 'Set of curren... | kyokley/BattlePyEngine | src/battlePy/ship.py | Python | mit | 1,526 | 0 |
# Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# 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 program... | tycho/yubioath-desktop | yubioath/gui/messages.py | Python | gpl-3.0 | 5,696 | 0.000351 |
import re
from models.contact import Contact
def test_all_contacts_on_homepage(app, db):
if app.contact.count() == 0:
app.contact.add(Contact(first_name="Mister", last_name="Muster", mobile_phone="123", email_1="test@test.com"))
contacts_from_homepage = sorted(app.contact.get_contact_list(), key = Cont... | rgurevych/python_for_testers | tests/test_contacts_data_compliance.py | Python | apache-2.0 | 3,163 | 0.007272 |
# Generated by Django 2.2 on 2019-04-22 16:27
from django.db import migrations
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('schedules', '0008_auto_20180208_1946'),
]
operations = [
migrations.AlterField(
model_name='shiftslotdayrule',
... | KSG-IT/ksg-nett | schedules/migrations/0009_auto_20190422_1627.py | Python | gpl-3.0 | 489 | 0.002045 |
"""Tests for base extension."""
import unittest
from grow.extensions import base_extension
class BaseExtensionTestCase(unittest.TestCase):
"""Test the base extension."""
def test_config_disabled(self):
"""Uses the disabled config."""
ext = base_extension.BaseExtension(None, {
'di... | grow/pygrow | grow/extensions/base_extension_test.py | Python | mit | 844 | 0 |
import sys
import logging
import urllib
import urllib2
import json
from lxml import etree
class GGeocode():
""" Wrapper for Google Geocode API v3.
https://developers.google.com/maps/documentation/geocoding/
"""
def __init__(self, method='http',
output='json',
sensor='false',
address='',
... | leeclemmer/ggeocode | ggeocode/ggeocode.py | Python | mit | 3,893 | 0.041613 |
from __future__ import unicode_literals
from django.db import models
from django_evolution.mutations import AddField
MUTATIONS = [
AddField('ReviewRequest', 'changedescs', models.ManyToManyField,
related_model='changedescs.ChangeDescription'),
AddField('ReviewRequestDraft', 'changedesc', models.... | chipx86/reviewboard | reviewboard/reviews/evolutions/change_descriptions.py | Python | mit | 432 | 0 |
import operator
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
allows_group_by_pk = True
related_fields_match_type = True
# MySQL doesn't support sliced subq... | theo-l/django | django/db/backends/mysql/features.py | Python | bsd-3-clause | 6,495 | 0.002002 |
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
#####################... | CompassionCH/compassion-modules | partner_communication/wizards/pdf_wizard.py | Python | agpl-3.0 | 2,115 | 0.001891 |
from flask_example.models import user
from social.apps.flask_app import models
| nvbn/python-social-auth | examples/flask_example/models/__init__.py | Python | bsd-3-clause | 79 | 0 |
import os
import shutil
import unittest
from parameterized.parameterized import parameterized
import six
from conans.client import defs_to_string
from conans.client.build.meson import Meson
from conans.client.conf import default_settings_yml
from conans.client.tools import args_to_string
from conans.errors import Con... | memsharded/conan | conans/test/unittests/client/build/meson_test.py | Python | mit | 9,218 | 0.003688 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin, Page
from django.conf import settings
class InheritPagePlaceholder(CMSPlugin):
"""
Provides the ability to inherit plugins for a certain placeholder from an associated "parent" page instance
... | hzlf/openbroadcast | website/cms/plugins/inherit/models.py | Python | gpl-3.0 | 681 | 0.005874 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gtdweb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| lanbing510/GTDWeb | manage.py | Python | gpl-2.0 | 249 | 0 |
'''
RP_extract: Rhythm Patterns Audio Feature Extractor
@author: 2014-2015 Alexander Schindler, Thomas Lidy
Re-implementation by Alexander Schindler of RP_extract for Matlab
Matlab version originally by Thomas Lidy, based on Musik Analysis Toolbox by Elias Pampalk
( see http://ifs.tuwien.ac.at/mir/downloads.html )
... | bastustrump/genimpro | rp_extract.py | Python | mit | 39,383 | 0.013737 |
#!/usr/bin/env python
# -*- coding: ISO-8859-1 -*-
# generated by wxGlade 0.3.5.1 on Sat Jun 04 00:11:24 2005
import wx
class FilenameViewModuleMixinFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: FilenameViewModuleMixinFrame.__init__
kwds["style"] = wx.CAPTION|wx.MINIMIZE_BOX... | chrisidefix/devide | resources/python/filename_view_module_mixin_frame.py | Python | bsd-3-clause | 2,169 | 0.005533 |
#! /usr/bin/env python
# encoding: utf-8
"""
Force the execution output to be synchronized
May deadlock with a lot of output (subprocess limitation)
"""
import sys
from waflib.Build import BuildContext
from waflib import Utils, Logs
def exec_command(self, cmd, **kw):
subprocess = Utils.subprocess
kw['shell'] = isi... | Gnomescroll/Gnomescroll | server/waflib/extras/sync_exec.py | Python | gpl-3.0 | 777 | 0.023166 |
# SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from .common import _ParserScraper
class NamirDeiter(_ParserScraper):
imageSearch = '//img[contains(@src, "comics/")]'
prevSearch = ('//a[@rel="prev"]',
'//a[./img[contains(@src... | webcomics/dosage | dosagelib/plugins/namirdeiter.py | Python | mit | 2,179 | 0.001377 |
from utils.header import MagicField, Field
from load_command import LoadCommandHeader, LoadCommandCommand
class PrebindCksumCommand(LoadCommandHeader):
ENDIAN = None
FIELDS = (
MagicField('cmd', 'I', {LoadCommandCommand.COMMANDS['LC_DYSYMTAB']: 'LC_DYSYMTAB'}),
Field('cmdsize', 'I'),
F... | hkkwok/MachOTool | mach_o/headers/prebind_cksum_command.py | Python | apache-2.0 | 488 | 0.002049 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflow/tensorflow | tensorflow/python/framework/subscribe.py | Python | apache-2.0 | 12,914 | 0.006814 |
"""
Django settings for dnd_tracker project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impor... | MariusLauge/dnd_tracker | dnd_tracker/settings.py | Python | gpl-3.0 | 3,300 | 0.001818 |
"""
https://github.com/renskiy/fabricio/blob/master/examples/hello_world
"""
from fabricio import tasks, docker
from fabricio.misc import AvailableVagrantHosts
app = tasks.DockerTasks(
service=docker.Container(
name='app',
image='nginx:stable-alpine',
options={
# `docker run` o... | renskiy/fabricio | examples/hello_world/fabfile.py | Python | mit | 901 | 0.00111 |
"""Adds a simulated sensor."""
from datetime import datetime
import math
from random import Random
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity impor... | sdague/home-assistant | homeassistant/components/simulated/sensor.py | Python | apache-2.0 | 4,535 | 0.000441 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 15:45
from __future__ import unicode_literals
from django.db import migrations
import share.robot
class Migration(migrations.Migration):
dependencies = [
('share', '0001_initial'),
('djcelery', '0001_initial'),
]
operatio... | zamattiac/SHARE | providers/org/biorxiv/migrations/0001_initial.py | Python | apache-2.0 | 658 | 0 |
"""
__init__.py
ist303-miye
Copyright (C) 2017
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... | morpheby/ist303-miye | client/__init__.py | Python | gpl-3.0 | 755 | 0.005298 |
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
datas = collect_data_files('vispy')
| informatics-isi-edu/synspy | hook-vispy.py | Python | bsd-3-clause | 111 | 0 |
# -*- coding: utf-8 -*-
import os
import csv
from bs4 import BeautifulSoup
INFO = {'download_path': 'download/docs',
'doc_base_url':
'https://facebook.github.io/react-native/releases/0.40/docs{}',
'out_file': 'output.txt'}
HOME_LINK= 'http://facebook.github.io/react-native/docs/getting-started.ht... | rasikapohankar/zeroclickinfo-fathead | lib/fathead/react_native/parse.py | Python | apache-2.0 | 15,135 | 0.004361 |
__author__ = 'canderson'
import os
import webapp2
import jinja2
from google.appengine.ext import db
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir),
autoescape=True)
class Handler(webapp2.RequestHandle... | W0mpRat/WebDev03 | UdacityFrameWork.py | Python | unlicense | 781 | 0.002561 |
"""The tests for the Template switch platform."""
from homeassistant.core import callback
from homeassistant import setup
import homeassistant.components as core
from homeassistant.const import STATE_ON, STATE_OFF
from tests.common import (
get_test_home_assistant, assert_setup_component)
class TestTemplateSwit... | persandstrom/home-assistant | tests/components/switch/test_template.py | Python | apache-2.0 | 16,305 | 0 |
from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'komsukomsuhuu.settings')
from django.conf import settings
app = Celery('komsukomsuhuu',
broker='amqp://',
... | fabteam1/komsukomsuhuhu | komsukomsuhuu/komsukomsuhuu/celery.py | Python | mit | 655 | 0.003053 |
#!/usr/bin/python
# the sum of two elements defines the next
a, b = 0, 1
while b < 10:
print b
a, b = b, a + b | Bodidze/21v-python | unit_01/15.py | Python | mit | 114 | 0.026316 |
# coding=utf-8
# Author: CristianBB
# Greetings to Mr. Pine-apple
# URL: https://sick-rage.github.io
#
# 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, either versi... | Arcanemagus/SickRage | sickbeard/providers/newpct.py | Python | gpl-3.0 | 10,924 | 0.00403 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
from odoo.tools import pycompat
class Board(models.AbstractModel):
_name = 'board.board'
_description = "Board"
_auto = False
@api.model
def create(self, vals):
... | Aravinthu/odoo | addons/board/models/board.py | Python | agpl-3.0 | 1,665 | 0.002402 |
import numpy
import pandas
import statsmodels.api as sm
'''
In this exercise, we will perform some rudimentary practices similar to those of
an actual data scientist.
Part of a data scientist's job is to use her or his intuition and insight to
write algorithms and heuristics. A data... | rmhyman/DataScience | Lesson1/titanic_data_heuristic1.py | Python | mit | 2,937 | 0.007831 |
NAME = 'logcrypto'
CFLAGS = []
LDFLAGS = []
LIBS = []
GCC_LIST = ['logcrypto']
| goal/uwsgi | plugins/logcrypto/uwsgiplugin.py | Python | gpl-2.0 | 80 | 0 |
# sde_solvers.py - Collection of numerical methods to solve (vector-valued) SDEs
#
# Author: Stefan Fuertinger [stefan.fuertinger@esi-frankfurt.de]
# Created: February 19 2014
# Last modified: <2017-09-15 11:31:25>
from __future__ import division
import numpy as np
from scipy.stats import norm
def rk_1(func,x0,tstep... | pantaray/Analytic-Tools | sde_solvers.py | Python | gpl-3.0 | 29,346 | 0.015743 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import hypothesis.strategies as st
from caffe2.python import core, workspace
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import numpy a... | ryfeus/lambda-packs | pytorch/source/caffe2/python/operator_test/ngram_ops_test.py | Python | mit | 2,472 | 0.000405 |
#!/usr/bin/env python
"""
Custom test runner
If args or options, we run the testsuite as quickly as possible.
If args but no options, we default to using the spec plugin and aborting on
first error/failure.
If options, we ignore defaults and pass options onto Nose.
Examples:
Run all tests (as fast as possible)
$ .... | kapt/django-oscar | runtests.py | Python | bsd-3-clause | 3,114 | 0.000321 |
"""Application specific storage."""
import wx
from sound_lib.output import Output
from gmusicapi import Mobileclient
name = 'GMP3'
__version__ = '4.3.0'
db_version = 1
url = 'https://github.com/chrisnorman7/gmp3'
app = wx.App(False)
app.SetAppName(name)
paths = wx.StandardPaths.Get()
output = Outpu... | chrisnorman7/gmp3 | application.py | Python | mpl-2.0 | 686 | 0 |
from decimal import Decimal
import ddt
from babel.numbers import format_currency
from django.conf import settings
from django.utils.translation import get_language, to_locale
from oscar.core.loading import get_model
from oscar.test.factories import * # pylint:disable=wildcard-import,unused-wildcard-import
from ecom... | mferenca/HMS-ecommerce | ecommerce/extensions/offer/tests/test_utils.py | Python | agpl-3.0 | 2,446 | 0.004088 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: group
v... | indrajitr/ansible | lib/ansible/modules/group.py | Python | gpl-3.0 | 19,765 | 0.001164 |
import pathlib
import meshio
import numpy as np
import pytest
import meshplex
this_dir = pathlib.Path(__file__).resolve().parent
@pytest.mark.parametrize(
"points,cells,ref",
[
# line
([[0.0], [0.35]], [[0, 1]], [0.35]),
([[0.0], [0.35]], [[1, 0]], [-0.35]),
# triangle
... | nschloe/voropy | tests/test_signed_area.py | Python | mit | 1,654 | 0.002418 |
import json, codecs, re
from abc import ABCMeta, abstractmethod
from PIL import Image, ExifTags
from witica.util import throw, sstr, suni
#regular expressions regarding item ids
RE_METAFILE = r'^meta\/[^\n]+$'
RE_FIRST_ITEMID = r'(?!meta\/)[^\n?@.]+'
RE_ITEMFILE_EXTENSION = r'[^\n?@\/]+'
RE_ITEMID = r'^' + RE_FIRST_... | bitsteller/witica | witica/metadata/extractor.py | Python | mit | 7,072 | 0.035209 |
#!/usr/bin/env python
import os, sys
SCRIPTDIR = os.path.dirname(__file__)
ENGINDIR = os.path.join(SCRIPTDIR, '..', '..', 'engines')
sys.path.append(os.path.abspath(ENGINDIR))
from fpsl_cvxpy import map_inference
PROBLEMDIR = os.path.join(SCRIPTDIR, '..', '..', 'problems', 'paper_review')
sys.path.append(os.path.abs... | gfarnadi/FairPSL | debug/compare_map/run_fpsl_cvxpy.py | Python | mit | 1,367 | 0.010241 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('printy', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='PostItModel',
fields=[
... | jdsolucoes/Ppostit | printy/migrations/0002_auto_20150921_2215.py | Python | apache-2.0 | 967 | 0.002068 |
from discuss.discuss.settings import *
##########################################################################
#
# Server settings
#
##########################################################################
ALLOWED_HOSTS = ["localhost"]
WSGI_APPLICATION = 'discuss.discuss.wsgi_production.application'
#########... | siggame/discuss | discuss/discuss/production.py | Python | bsd-3-clause | 642 | 0 |
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
# Copyright (c) 2013 Bob Tolbert <bob@tolbert.org>
#
# 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 wit... | paultag/hy | hy/errors.py | Python | mit | 4,271 | 0 |
# -*- coding: utf-8 -*-
"""
Doctest runner for 'birdhousebuilder.recipe.adagucserver'.
"""
__docformat__ = 'restructuredtext'
import os
import sys
import unittest
import zc.buildout.tests
import zc.buildout.testing
from zope.testing import doctest, renormalizing
optionflags = (doctest.ELLIPSIS |
doc... | bird-house/birdhousebuilder.recipe.adagucserver | birdhousebuilder/recipe/adagucserver/tests/test_docs.py | Python | bsd-3-clause | 1,620 | 0.003086 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v10/errors/types/time_zone_error.py | Python | apache-2.0 | 1,124 | 0.00089 |
from django_mongoengine.admin.options import *
from django_mongoengine.admin.sites import site
from django.conf import settings
if getattr(settings, 'DJANGO_MONGOENGINE_OVERRIDE_ADMIN', False):
import django.contrib.admin
# copy already registered model admins
# without that the already registered models
... | seraphlnWu/django-mongoengine | django_mongoengine/admin/__init__.py | Python | bsd-3-clause | 451 | 0.002217 |
from base import Input
from wapiti import get_json
class GoogleNews(Input):
prefix = 'gn'
def fetch(self):
return get_json('http://ajax.googleapis.com/ajax/services/search/news?v=1.0&q=' + self.page_title)
def process(self, f_res):
if f_res['responseStatus'] == 403 or not f_res.get('resp... | slaporte/qualityvis | inputs/google.py | Python | gpl-3.0 | 1,054 | 0.004744 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.