code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under th... | xpansa/stock-logistics-tracking | stock_tracking_state/__init__.py | Python | agpl-3.0 | 1,067 |
# Copyright (c) 2013 Mirantis 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 writ... | rnirmal/savanna | savanna/service/validations/images.py | Python | apache-2.0 | 1,251 |
from . import importer
importer.install()
try:
from django.core.wsgi import get_wsgi_application
except ImportError: # pragma: no cover
from django.core.handlers.wsgi import WSGIHandler
def get_wsgi_application(): # noqa
return WSGIHandler()
# this is just for the crazy ones
application = get_... | agconti/njode | env/lib/python2.7/site-packages/configurations/wsgi.py | Python | bsd-3-clause | 339 |
from twisted.internet import utils, reactor
def printTrueValue(val):
print "/bin/true exits with rc=%d" % val
output = utils.getProcessValue('/bin/false')
output.addCallback(printFalseValue)
def printFalseValue(val):
print "/bin/false exits with rc=%d" % val
reactor.stop()
output = utils.getProce... | mzdaniel/oh-mainline | vendor/packages/twisted/doc/core/howto/listings/process/trueandfalse.py | Python | agpl-3.0 | 390 |
#!/usr/bin/env python
# Copyright 2008, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | libkml/libkml | tests/swig/kmlbase_test.py | Python | bsd-3-clause | 5,485 |
from collections import Iterable, OrderedDict
def inverse_dicts(*dicts):
"""
Inverts the dicts, e.g. {1: 2, 3: 4} and {2: 3, 4: 4} will be inverted
{2: [1, 2], 4: [3, 4]}. This also handles dictionaries with Iterable items
as values e.g. {1: [1, 2, 3], 2: [3, 4, 5]} and
{2: [1], 3: [2], 4: [3, 4]}... | NalinG/coala | coalib/misc/DictUtilities.py | Python | agpl-3.0 | 1,355 |
# Copyright 2013 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.
"""A module for the Action plugin base class."""
import cr
class Action(cr.Plugin):
"""Base class for cr actions.
This provides the standard interfac... | androidarmv6/android_external_chromium_org | tools/cr/cr/actions/action.py | Python | bsd-3-clause | 1,510 |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is dis... | alexlo03/ansible | test/units/modules/network/routeros/routeros_module.py | Python | gpl-3.0 | 2,511 |
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.environments import EpisodicTask
class MinimizeTask(EpisodicTask):
def __init__(self, environment):
EpisodicTask.__init__(self, environment)
self.N = 15
self.t = 0
self.state = [0.0] * environment.dim
se... | tmeits/pybrain | pybrain/rl/environments/simple/tasks.py | Python | bsd-3-clause | 1,027 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.roboconf
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Roboconf DSL.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, words, re
from pygments.token import Text, O... | wandb/client | wandb/vendor/pygments/lexers/roboconf.py | Python | mit | 2,070 |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/network/cloudengine/ce_link_status.py | Python | bsd-3-clause | 22,114 |
from allauth.socialaccount import providers
from allauth.socialaccount.providers.persona.provider import PersonaProvider
class KumaPersonaProvider(PersonaProvider):
package = 'kuma.users.providers.persona'
providers.registry.register(KumaPersonaProvider)
| biswajitsahu/kuma | kuma/users/providers/persona/provider.py | Python | mpl-2.0 | 264 |
from django.db import models
# Create your models here.
class Message(models.Model):
name = models.CharField(max_length = 20)
context = models.CharField(max_length = 200)
vote_date = models.DateTimeField(auto_now_add = True)
def __unicode__(self):
return self.context
| EricSekyere/python | zentst/0023/messageboard/models.py | Python | mit | 300 |
import os
import json
import errno
from httpie import __version__
from httpie.compat import is_windows
DEFAULT_CONFIG_DIR = os.environ.get(
'HTTPIE_CONFIG_DIR',
os.path.expanduser('~/.httpie') if not is_windows else
os.path.expandvars(r'%APPDATA%\\httpie')
)
class BaseConfigDict(dict):
name = None... | alfcrisci/httpie | httpie/config.py | Python | bsd-3-clause | 2,470 |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is dis... | alxgu/ansible | test/units/modules/network/nxos/test_nxos_nxapi.py | Python | gpl-3.0 | 3,057 |
import time
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
... | pdx1989/nw.js | test/remoting/nw/capture_page/test.py | Python | mit | 702 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Audio latency performance test.
Benchmark measuring how fast we can continuously repeat a short sound
clip, while another clip ... | plxaye/chromium | src/chrome/test/functional/media/mixed_audio_latency_perf.py | Python | apache-2.0 | 1,554 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | diogocs1/comps | web/addons/event/res_partner.py | Python | apache-2.0 | 1,228 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible 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
#... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/ovirt/ovirt_users_facts.py | Python | bsd-3-clause | 3,377 |
class A(object):
def __init__(self):
pass
class B(A):
def <warning descr="Call to __init__ of super class is missed">__in<caret>it__</warning>(self, **kwargs):
pass | siosio/intellij-community | python/testData/quickFixes/PyAddCallSuperQuickFixTest/kwargs.py | Python | apache-2.0 | 189 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
test_records = frappe.get_test_records('Warranty Claim')
class TestWarrantyClaim(unittest.TestCase):
pass
| mahabuber/erpnext | erpnext/support/doctype/warranty_claim/test_warranty_claim.py | Python | agpl-3.0 | 284 |
# Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/gs/connection.py | Python | gpl-3.0 | 5,478 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | diogocs1/comps | web/addons/portal_sale/__init__.py | Python | apache-2.0 | 1,016 |
"""Extensions to the 'distutils' for large or complex distributions"""
import os
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
import setuptools.version
from setuptools.extension import Extension
f... | svanschalkwyk/datafari | windows/python/Lib/site-packages/setuptools/__init__.py | Python | apache-2.0 | 5,033 |
import pytest
import porekit
test_data_path = "tests/data/"
def test_gather_metadata():
df1 = porekit.gather_metadata(test_data_path)
df2 = porekit.gather_metadata(test_data_path, workers=4)
assert df1.shape == df2.shape
| akloster/porekit-python | tests/test_dataframe.py | Python | isc | 235 |
"""ietf-yang-metadata plugin
Verifies metadata YANG statements as defined in RFC 7952
"""
import re
import pyang
from pyang import plugin
from pyang import syntax
from pyang import grammar
from pyang import statements
from pyang import error
from pyang.error import err_add
md_module_name = 'ietf-yang-metadata'
cla... | vkosuri/pyang | pyang/plugins/metadata.py | Python | isc | 1,414 |
# coding=utf8
# Copyright (c) 2010, individual contributors (see AUTHORS file)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PR... | natestedman/Observatory | observatory/dashboard/feeds.py | Python | isc | 5,778 |
import os
import codecs
def get_fixture(name):
filename = os.path.join(os.path.dirname(__file__), 'fixtures', name)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()
| EnTeQuAk/printful | src/printful/tests/helpers.py | Python | isc | 203 |
from typing import List, TYPE_CHECKING
from mitmproxy import connection
from mitmproxy.options import Options
if TYPE_CHECKING:
import mitmproxy.proxy.layer
class Context:
"""
The context object provided to each `mitmproxy.proxy.layer.Layer` by its parent layer.
"""
client: connection.Client
... | mhils/mitmproxy | mitmproxy/proxy/context.py | Python | mit | 1,199 |
# coding=utf-8
import ast
import json
import re
from random import randrange
from urllib.request import urlopen
import requests
import login
signUrl = 'https://ru.wikipedia.org/?curid=1006803&action=raw§ion=1'
signUrlMentors = 'https://ru.wikipedia.org/?curid=8409309&action=raw§ion=1'
# Список подписей и чё... | SiarheiGribov/pyBot | welcome.py | Python | mit | 6,839 |
def LevenshteinDistance(first, second):
"""Find the Levenshtein distance between two strings."""
if len(first) > len(second):
first, second = second, first
if len(second) == 0:
return len(first)
first_length = len(first) + 1
second_length = len(second) + 1
distance_matrix = [[0]... | will7200/Yugioh-bot | bot/utils/algo.py | Python | mit | 965 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
import adyen.api as adyen_api
from .backends import get_backend
from .models import Payment, Result, Notification
def create_payment(order_number, *args, **kwargs):
mer... | machtfit/adyen | django_adyen/api.py | Python | mit | 2,086 |
# Copyright © 2016-2018 Jakub Wilk <jwilk@jwilk.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the “Software”), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... | jwilk/mwic | lib/extdict.py | Python | mit | 3,430 |
if __name__ == '__main__':
if __package__ is None:
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from Agent import *
from Stream import *
from ListOperators import split
from PrintFunctions import print_streams_recent
def example_1... | zatricion/Streams | ExamplesElementaryOperations/ExamplesSplitNoState.py | Python | mit | 1,473 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from pexif import ExifSegment
from thumbor.engines import BaseEngine
__version__ = '1.0.1'
logger = logging.getLogger(__name__)
try:
from opencv_engine.engine_cv3 import Engine # NOQA
except ImportError:
logging.exception('Could not import ope... | dronedeploy/opencv-engine | opencv_engine/__init__.py | Python | mit | 1,592 |
from __future__ import absolute_import
from django.utils import six
if six.PY2:
import unicodecsv as csv
else:
import csv
from ..processor import Processor
from ..manager import manager
from ...translation import gettext_lazy as _
@manager.register('processor')
class CsvProcessor(Processor):
file_forma... | mtrgroup/django-mtr-sync | mtr/sync/lib/processors/csv.py | Python | mit | 2,056 |
import astroplan
from astroplan import Observer, FixedTarget, ObservingBlock
from astroplan.constraints import AtNightConstraint, AirmassConstraint,\
TimeConstraint
from astroplan.scheduling import Transitioner, SequentialScheduler, Schedule,\
PriorityScheduler
from astropy.coord... | boada/planckClusters | observing/mkObservingPlan.py | Python | mit | 4,272 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ride', '0003_ride_deleted'),
]
operations = [
migrations.AlterField(
model_name='ride',
name='initia... | cmpe-295/project-backend | safe_ride/ride/migrations/0004_auto_20161018_0045.py | Python | mit | 405 |
#!/usr/bin/env python
from matplotlib import use, rc
use('Agg') #suppress graphical rendering
from pylab import rc, gcf, xlim, ylim, xticks, yticks, sqrt, text, clip, gca, \
array, dot, ravel, draw, show, savefig
from fancy_arrow import arrow
"""Draws arrow plots representing rate matrices.
Note: currently requir... | sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/cogent/draw/arrow_rates.py | Python | mit | 9,507 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0003_auto_20160331_1313'),
]
operations = [
migrations.AddField(
model_name='invite',
name='u... | topa51/eis | api/migrations/0004_auto_20160331_1505.py | Python | mit | 1,580 |
# -*- encoding: utf-8 -*-
import os
SECRET_KEY = 'p23jof024jf5-94j3f023jf230=fj234fp34fijo'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEST_DATA_DIR = os.path.join(BASE_DIR, 'tests', 'test_data')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... | vinaypost/multiuploader | tests/test_settings.py | Python | mit | 1,057 |
from distutils.core import setup
setup(
name='sql_interp',
version='0.1.0',
author='Michael Hampton',
author_email='mirhampt@gmail.com',
packages=['sql_interp'],
url='http://bitbucket.org/mirhampt/sql_interp/',
license='MIT',
description='Interpolate Python variables into SQL statements... | mirhampt/sql_interp | setup.py | Python | mit | 417 |
from django.db import models
from django.contrib.auth.models import User
from tagging.fields import TagField
from tagging.models import Tag
from tagging_autocomplete.models import TagAutocompleteField
from timezones.zones import PRETTY_TIMEZONE_CHOICES
from timezones.fields import TimeZoneField
class Profile(models.M... | apenwarr/hnofficehours | apps/profiles/models.py | Python | mit | 1,360 |
#!/usr/bin/python3
"""
The set S originally contains numbers from 1 to n. But unfortunately, due to the
data error, one of the numbers in the set got duplicated to another number in
the set, which results in repetition of one number and loss of another number.
Given an array nums representing the data status of this s... | algorhythms/LeetCode | 645 Set Mismatch.py | Python | mit | 1,687 |
#!/usr/bin/python3
"""Generate a class containing all resources from a given directory.
Usage:
makeresfile [-v --verbose] <directory> [--ext=<ext>] [-o --output=<output>]
makeresfile -h | --help
makeresfile --version
Arguments:
<directory> Directory containing your resources.
Options:
... | Kynarth/ryrycipe | src/main/scripts/makeresfile.py | Python | mit | 2,461 |
from .UserAverage.algorithm.views import runUserAverage
import logging
logger = logging.getLogger(__name__)
def runRecommenders(songSetLimit):
logger.info("[Start Recommenders]")
runUserAverage(songSetLimit=songSetLimit)
logger.info("[Finish Recommenders]")
| DiegoCorrea/ouvidoMusical | apps/recommenders/views.py | Python | mit | 272 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-26 17:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0004_comment'),
]
operations = [
migrations.AddField(
... | meiordac/ecommerce | catalog/migrations/0005_comment_stars.py | Python | mit | 437 |
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.gen
import os
import signal
class mainhandler(tornado.web.RequestHandler):
'''
When a user goes first goes to /wgsi, the browser sends a GET HTTP
request to the server which in turn calls the 'get' method.
When the... | jeevers/hyperlapsemb_example | boilerplate.py | Python | mit | 2,131 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of tornado_angular.
# https://github.com/heynemann/tornado-angular
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2014 Bernardo Heynemann heynemann@gmail.com
try:
from ujson import loads, dumps
excep... | heynemann/tornado-angular | tornado_angular/serialize.py | Python | mit | 369 |
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.permissions import IsAdminUser
from .models import Item, ItemInventory, ItemImage
from .serializers import (
ItemSerializer, ItemCreateSerializer, Ite... | mikaelm1/ecommerce-api | src/items/views.py | Python | mit | 4,425 |
import sys
from mpf.tests.MpfBcpTestCase import MpfBcpTestCase
from unittest.mock import create_autospec, patch, MagicMock
class TestServiceCli(MpfBcpTestCase):
def get_config_file(self):
return 'config.yaml'
def get_machine_path(self):
return 'tests/machine_files/service_mode/'
def _t... | missionpinball/mpf | mpf/tests/test_ServiceCli.py | Python | mit | 5,184 |
from __future__ import print_function
import json
from time import sleep
import threading
import signal
import pdb
import os
import sys
import logging
sys.excepthook = lambda *args: pdb.pm()
logging.basicConfig(stream = sys.stdout, level=logging.INFO)
logging.info("Importing modules")
from step_manager import StepM... | CRImier/escaperoom | main.py | Python | mit | 2,945 |
from rpg_api.serializers import CampaignSerializer
from rpg_base.models import Campaign
from rest_framework import viewsets
class CampaignViewSet(viewsets.ModelViewSet):
queryset = Campaign.objects.all()
serializer_class = CampaignSerializer
filter_fields = ('name',)
| ncphillips/django_rpg | rpg_api/views/campaign.py | Python | mit | 281 |
#coding:utf-8
import Image
import requests,StringIO,hashlib,glob,gc
import os
def cacl_like(char_image,each_row_image):
each_row_image2 = each_row_image.load()
char_image2=char_image.temp
#计算图片的匹配度
total=0.00
white_point=0
for x in range(char_image.size[0]):
black_line=0
f... | beordle/jnu.fm | jnu-api-server/jwckit/det.py | Python | mit | 3,744 |
class BitGrid(object):
"""
Grid for tracking bits, used for the BitMappedLedMatrix
"""
def __init__(self,width=8,height=8):
"""
Construct the grid
width is number of columns, defaulting to 8 (assume 8 high)
"""
if height > 32 or width < 1 or height < 1:
raise "Height must be between 1 and 32, width ... | Seekatar/GpioPlayground | BAM/RPiPy/BitGrid.py | Python | mit | 1,775 |
# -*- coding: utf-8 -*-
from flask import Blueprint, send_from_directory
import knowledgebase
import os
blueprint = Blueprint('web-ui', __name__)
@blueprint.route('/', defaults={'collection': None, 'resource': 'index.html'})
@blueprint.route('/index.html', defaults={'resource': None})
@blueprint.route('/<string:co... | linkdd/knowledgebase | knowledgebase/blueprints/www.py | Python | mit | 793 |
# -*- coding:utf-8 -*-
# __author__ = itsneo1990
import sanic
admin_bp = sanic.Blueprint("admin_blueprint", url_prefix='admin')
| itsneo1990/sanic_blog | apps/admin/__init__.py | Python | mit | 129 |
# ---------------------------------------------------------------------
#
# Copyright (c) 2012 University of Oxford
#
# 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, incl... | dataflow/DataStage | test/FileShare/tests/TestFileUserAPublic.py | Python | mit | 11,291 |
# -*- coding: utf-8 -*-
import unittest
import os
import sys
RootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(RootDir)
from pyirt import irt
# from pyirt.dao import mongoDAO, mongoDb
import numpy as np
class TestDataSrc(unittest.TestCase):
def setUp(self):
self.data_sr... | 17zuoye/pyirt | tests/test_dao.py | Python | mit | 2,232 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/compute_data_disk_fragment.py | Python | mit | 1,556 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import executor_manager
def sendMail(subject, body):
print 'Sending subject "%s" with body "%s"' % (subject, body)
def mergeEmails(emailList):
"""
The email bodies are merged
"""
assert len(emailList) > 0
subject = emailList[0][0]
bodies = [bod... | bacchilu/QueueMail | sample.py | Python | mit | 742 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-05 14:56
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contrib', '0004_auto_20170426_1559'),
]
operations = [
migrations.RemoveField(
... | bruecksen/isimip | isi_mip/contrib/migrations/0005_remove_userprofile_role.py | Python | mit | 396 |
from setuptools import setup
setup(
name="WetterKassel",
version="0.0.2",
url="https://github.com/jakobbbb/wetterkassel",
author="jakobbb",
author_email="jakobbbb@users.noreply.github.com",
packages = ["WetterKassel"],
description = "A twitter bot that tweets out forecasts",
license = "... | jakobbbb/wetterkassel | setup.py | Python | mit | 399 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et
# Author: Tamas Gal <tgal@km3net.de>
# License: MIT
"""
==========
MSG reader
==========
This application demonstrates how to access MSGs from Ligier.
"""
import io
import km3pipe as kp
__author__ = "Tamas Gal"
__email__ = "tgal@km3net.de"
def prin... | tamasgal/km3pipe | examples/monitoring/msg.py | Python | mit | 518 |
import unittest
from random import choice
import requests
from semantic_version import Version
import frappe
from frappe.utils import get_site_url
def maintain_state(f):
def wrapper(*args, **kwargs):
frappe.db.rollback()
r = f(*args, **kwargs)
frappe.db.commit()
return r
return wrapper
class TestResour... | mhbu50/frappe | frappe/tests/test_api.py | Python | mit | 5,708 |
import kindred
from kindred.datageneration import generateData,generateTestData
def test_candidatebuilder_simple():
text = '<drug id="1">Erlotinib</drug> is a common treatment for <cancer id="2">NSCLC</cancer>. <drug id="3">Aspirin</drug> is the main cause of <disease id="4">boneitis</disease>. <relation type="trea... | jakelever/kindred | tests/test_candidatebuilder.py | Python | mit | 4,774 |
# Copyright (c) Timur Iskhakov.
# Distributed under the terms of the MIT License.
from . import metadata
__version__ = metadata.version
__author__ = metadata.authors_string
__license__ = metadata.license
__copyright__ = metadata.copyright
| cs-hse-projects/profanity-filter | profanity_filter/__init__.py | Python | mit | 242 |
import psychic_disco.api_gateway_config as agc
from psychic_disco.rest_resource import RestResource
class RestApi(object):
""" Model of an AWS API Gateway Rest API object. """
apis_by_name = dict()
""" Cache of API objects to ensure that there is
a singleton for each actual API by name """
def _... | robertdfrench/psychic-disco | psychic_disco/rest_api.py | Python | mit | 2,616 |
#!/usr/bin/env python
__author__ = "Alok Kumar"
from setuptools import setup, find_packages
setup(
name="wc14",
version="0.2",
author="Alok Kumar",
author_email="rajalokan@gmail.com",
url="https://github.com/rajalokan/wc14",
download_url="https://github.com/rajalokan/wc14/archive/0.1.tar.gz",... | rajalokan/wc14 | setup.py | Python | mit | 624 |
# Generated by ../generate_parser.py
"""
# Grammar definition:
```
import textwrap
```
ignored Space = /[ \\t]+/
ignored Comment = /#[^\\r\\n]*/
Newline = /[\\r\\n][\\s]*/
LineSep = Some(Newline | ";")
Name = /[_a-zA-Z][_a-zA-Z0-9]*/
Comma = wrap(",")
wrap(x) => Skip(Newline) >> x << Skip(Newline)
# Parse a full wo... | jvs/sourcer | sourcer/parser.py | Python | mit | 140,056 |
"""
Django settings for example project.
Quick-start development settings - unsuitable for production
"""
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
DEBUG = True
TEMPLATE_DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.... | Gr1N/django-debug-informer | example/settings.py | Python | mit | 1,332 |
# Django development settings for sikteeri project.
from os import environ
import json
import django.conf.global_settings as DEFAULT_SETTINGS
import dj_database_url
import locale
import logging
import sys
logger = logging.getLogger(__name__)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | joneskoo/sikteeri | sikteeri/settings.py | Python | mit | 12,895 |
#!/usr/bin/env python
"""
Parse the XML format SMS and MMS messages generated by Microsoft's Windows
Phone "contacts+message backup" application, formatting them into MIME emails,
before uploading them to GMail.
"""
import datetime
import email
import email.encoders
import email.mime.base
import email.mime.multipart
... | dw/scratch | gmail-archive-sms-backup/gmail-archive-sms-backup.py | Python | mit | 8,154 |
from setuptools import setup, find_packages
import os.path
setup(
name = 'scribes.file.quick-open-fix',
version = '0.2.3',
author = 'Anton Bobrov',
author_email = 'bobrov@vl.ru',
description = 'Scribes plugin. Adds project support to stock quick open plugin',
zip_safe = False,
data... | baverman/scribes-goodies | plugins/FixedQuickOpen/setup.py | Python | mit | 458 |
import collections
from eth_utils import (
big_endian_to_int,
int_to_big_endian,
is_bytes,
)
from rlp.exceptions import EncodingError, DecodingError
from rlp.sedes.binary import Binary as BinaryClass
from rlp.sedes import big_endian_int, binary, boolean, text
from rlp.sedes.lists import List, is_sedes, i... | ethereum/pyrlp | rlp/codec.py | Python | mit | 12,446 |
# -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use sendgrid to send emails
- Use MEMCACHIER on Heroku
'''
from configurations import values
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings... | hotsyk/uapython | uapython/config/production.py | Python | mit | 4,645 |
from nengo_spinnaker.utils import itertools as nsitertools
def test_flatten():
"""Test flattening of nested iterables."""
assert list(nsitertools.flatten([1, 2, [3, 4, 5, [[6]]]])) == \
[1, 2, 3, 4, 5, 6]
| project-rig/nengo_spinnaker | tests/utils/test_itertools.py | Python | mit | 223 |
#!/usr/bin/env python
# coding:utf-8
import re
import os
import sys
from urllib.parse import urlparse
import requests
import werkzeug
from parsel import Selector
import urllib.parse
from collections import OrderedDict as odict
# adding current dir to path (makes lookups easier)
dirname = os.path.abspath(os.path.dirna... | italomaia/mangafox | mangafox.py | Python | mit | 11,259 |
from datetime import datetime
cday=datetime.strptime('2016-8-11 13:29', '%Y-%m-%d %H:%M')
print(cday) | JuneDeng2014/working_notes | python-web/test/str-time.py | Python | mit | 102 |
from flask import Flask, json
from flask_webapi import WebAPI, route
from flask_webapi.exceptions import APIException, UnsupportedMediaType, ValidationError
from unittest import TestCase
from werkzeug.exceptions import BadRequest
class TestAPIException(TestCase):
def test_default_message(self):
self.asser... | viniciuschiele/flask-webapi | tests/test_exceptions.py | Python | mit | 5,739 |
#!/usr/bin/env python3
from tkinter import *
from tkinter import ttk
from random import randint
from collections import defaultdict
import polygongeometry as pg
PHI = (1 + 5**0.5) / 2
canvas_height = 500
# A list of points the user placed on the canvas
points = list()
last_line = None
# A frame list for converting ... | moyamo/polygon2square | polygon2square.py | Python | mit | 5,521 |
#!/usr/bin/python3
import configparser, getpass, os, re, sys
bindir = os.path.abspath(os.path.dirname(sys.argv[0]))
libdir = bindir + "/../lib"
sys.path.append(libdir)
import lacuna
import lacuna.exceptions as err
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')
def check_for_existing_confi... | tmtowtdi/MontyLacuna | bin/create_config_file.py | Python | mit | 6,614 |
""" Simulate a GE scan
GE scanners store reconstructed slice images as individual DICOM files within
a certain directory on the scanner console. This script will simulate that
directory and copy in individual slice DICOM images.
Usage:
------
python GE_sim.py inputDir [--outputDir] [--TR]
You must specify a loca... | jeffmacinnes/pyneal | pyneal_scanner/simulation/scannerSimulators/GE_sim.py | Python | mit | 6,461 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-31 17:10
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('anonymized_activity_log', '0001_initial'),
]
op... | dave-leblanc/django-anonymized-activity-log | anonymized_activity_log/migrations/0002_auto_20161031_1710.py | Python | mit | 566 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "simple_web_scraper.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| fcv/simple-web-scraper | manage.py | Python | mit | 261 |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import User, Department, Examination, Question, Answer, UserExamination,\
UserExaminationQuestionLog, UserExaminationAnswerLog, Scheduler
class UserAdmin(admin.ModelAdmin):
list_display = ('email', ... | telminov/personnel-testing | core/admin.py | Python | mit | 1,673 |
# -*- coding: utf-8 -*-
#
# django_reportes documentation build configuration file, created by
# sphinx-quickstart.
#
# 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 configuration value... | chrisRubiano/django_reportes | docs/conf.py | Python | mit | 7,946 |
from settings import *
DEBUG = False
TEMPLATE_DEBUG = False
INSTALLED_APPS += (
"redis_cache",
)
from bundle_config import config
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '%s:%s' % (config['redis']['host'], config['redis']['port']),
'OPTIONS': {
... | ulope/eve_skill_tree | eve_skill_tree/production_settings.py | Python | mit | 387 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-16 14:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wiki', '0001_initial'),
]
operations = [
migrations.AlterField(
... | graycarl/iamhhb | wiki/migrations/0002_auto_20170816_2207.py | Python | mit | 451 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url, include
from django.contrib import admin
from pages.views import PageView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^slideshows/', include('jssor.urls')),
]
if s... | synw/django-jssor | example/jssor_example/urls.py | Python | mit | 567 |
print "one more test"
| jrgreenberg/jrgreenberg_PyNet | onemoretest.py | Python | mit | 22 |
from mahjong.hand_calculating.yaku import Yaku
from mahjong.utils import is_pon_or_kan
class Suuankou(Yaku):
"""
Four closed pon sets
"""
def __init__(self, yaku_id=None):
super(Suuankou, self).__init__(yaku_id)
def set_attributes(self):
self.tenhou_id = 41
self.name = "... | MahjongRepository/mahjong | mahjong/hand_calculating/yaku_list/yakuman/suuankou.py | Python | mit | 879 |
from .opengraph import OpenGraph # NOQA
| HenrikOssipoff/python-opengraph | opengraph/__init__.py | Python | mit | 41 |
class Switch(object) :
def __init__(self, name = "sw0", size = 1024):
self.name = name
self.flowTableSize=size
self.neighbours = []
self.isMappedFlag = False
# Used for routing.
self.parent = None
def addLink(self, dst, bw) :
self.neighbours.append(dst)
def getName(self) :
return self.name
def g... | sskausik08/poxvine | VNSTopology.py | Python | mit | 15,062 |
class Solution(object):
def lengthOfLastWord(self, s):
"""
:type s: str
:rtype: int
"""
begin = 0
end = 0
for i in reversed(range(len(s) + 1)):
if i < len(s) and ' ' != s[i] and (0 == i or ' ' == s[i - 1]):
begin = i
... | FeiZhan/Algo-Collection | answers/leetcode/Length of Last Word/Length of Last Word.py | Python | mit | 456 |
"""
Django settings for ecommerce2 project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... | dizzy54/ecommerce | src/ecommerce2/settings/base.py | Python | mit | 3,715 |
# coding:utf-8
import os
# Return CPU temperature as a character string
def getCPUtemperature():
res = os.popen('vcgencmd measure_temp').readline()
return (res.replace("temp=", "").replace("'C\n", ""))
# Return RAM information (unit=kb) in a list
# Index 0: total RAM
# Index 1: used RAM
# Index 2: free RAM
... | dabing1022/darling | raspberry/raspberry_status_report.py | Python | mit | 2,035 |
from __future__ import unicode_literals, print_function
import argparse
import fnmatch
import imp
import os
import re
import sys
from jinja2 import Environment, FileSystemLoader, StrictUndefined, defaults
try:
from colorama import init, Fore, Style
init(autoreset=True)
using_colorama = True
style_JIN... | filwaitman/jinja2-standalone-compiler | jinja2_standalone_compiler/__init__.py | Python | mit | 8,857 |
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Thermodynamic ensemble utilities.
DESCRIPTION
This module provides a utilities for simulating physical t... | choderalab/perses | perses/samplers/thermodynamics.py | Python | mit | 18,765 |
LOCATIONS_URL = "https://api.getyourguide.com/1/locations"
LOCATION_URL = "https://api.getyourguide.com/1/locations/{}"
TOURS_URL = "https://api.getyourguide.com/1/tours"
TOUR_URL = "https://api.getyourguide.com/1/tours/{}"
#TODO picture format
import requests
import json
import datetime
class GetYourGuide(object):
... | fukac99/python_gyg | python_gyg/GetYourGuide.py | Python | mit | 8,000 |