code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from django.conf.urls import url
from . import views
from app_dir.wallet_transactions.views import DebitMandates, \
CreateDebitMandates
from app_dir.bill_management.views import CreateBillPaymentByMsisdn
urlpatterns = [
url(r'^$',
views.CustomerWalletViewSet.as_view(),
name="list_customer_walle... | kyrelos/vitelco-mobile-money-wallet | app_dir/customer_wallet_management/urls.py | Python | gpl-3.0 | 3,112 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... | jetskijoe/SickGear | sickbeard/config.py | Python | gpl-3.0 | 31,704 |
"""
hmmlearn
========
``hmmlearn`` is a set of algorithms for learning and inference of
Hidden Markov Models.
"""
try:
import setuptools_scm
__version__ = setuptools_scm.get_version( # xref setup.py
root="../..", relative_to=__file__,
version_scheme="post-release", local_scheme="node-and-date... | hmmlearn/hmmlearn | lib/hmmlearn/__init__.py | Python | bsd-3-clause | 457 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import codecs
import fnmatch
import inspect
import io
import locale
import logging
import os
import re
import tarfile
import tempfile
import threading
from collections import defaultdict
from datetime import datetime
from... | richard-willowit/odoo | odoo/tools/translate.py | Python | gpl-3.0 | 47,446 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014 windpro
Author : windpro
E-mail : windprog@gmail.com
Date : 15/1/30
Desc :
"""
from bson.dbref import DBRef
import pymongo
print "pymongo version:", pymongo.version
def get_test_coll(con):
db = con["test"]
coll_t1 = db["t1"]
... | windprog/pymongo-dbref | example.py | Python | mit | 1,092 |
from libs.chat.chat import *
from core.union import route
# import asyncio
route('GET', '/online', online, 'online' )
# chat_task()
route('GET', '/chat', ws, 'w_s' )
route('GET', '/wsh', ws_handler, 'ws_h' )
asyncio.ensure_future( ping_chat_task() )
asyncio.ensure_future( check_online_task() )... | alikzao/tao1 | tao1/libs/chat/routes.py | Python | mit | 615 |
## Plots figures
## command line : python3 plot_figures.py 1000 10 0 text_files/Initial_Conditions_Callisto.txt
## this command plots 1000 particules that were simulated on 10 jobs using script_ID = 0
# using the argument "all" instead of 1000 will plot all particles in the initial conditions file
from math imp... | jackhdf/juice_it_up | plot_figures.py | Python | gpl-3.0 | 31,232 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
To run the test, run this in the root of repo:
python -m unittest discover
"""
import unittest
from deepdiff import DeepDiff
class DeepDiffTestCase(unittest.TestCase):
def test_same_objects(self):
t1 = {1: 1, 2: 2, 3: 3}
t2 = t... | andrewyoung1991/deepdiff | tests/tests.py | Python | mit | 8,348 |
import os
import json
import shutil
import tempfile
from cloudify.workflows import ctx
from cloudify.manager import get_rest_client
from cloudify.constants import FILE_SERVER_SNAPSHOTS_FOLDER
from cloudify.zip_utils import make_zip64_archive
from . import constants, networks, utils
from .agents import Agents
from .po... | cloudify-cosmo/cloudify-manager | workflows/cloudify_system_workflows/snapshots/snapshot_create.py | Python | apache-2.0 | 5,735 |
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = patterns("",
url(r"^admin/", include(admin.site.urls)),
url(r"^account/", include("account.urls")),
url(r"^profiles/", include("fo... | mach273/drunken-wookie | forums/urls.py | Python | bsd-3-clause | 460 |
#-*- coding:utf-8 -*-
# Copyright (c) 2010-2012 OpenStack, 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 applic... | orion/swift-config | test/unit/obj/test_server.py | Python | apache-2.0 | 116,745 |
from django.http import HttpResponse
from django_mongoengine.forms.fields import DictField
from django_mongoengine.views import (CreateView, UpdateView,
DeleteView, ListView,
EmbeddedDetailView, View)
from tumblelog.models import Post, BlogPo... | seraphlnWu/django-mongoengine | example/tumblelog/tumblelog/views.py | Python | bsd-3-clause | 2,227 |
import sys
sys.path.insert(1, "../../")
import h2o
def pyunit_model_params(ip,port):
pros = h2o.import_file(h2o.locate("smalldata/prostate/prostate.csv"))
m = h2o.kmeans(pros,k=4)
print m.params
print m.full_parameters
if __name__ == "__main__":
h2o.run_test(sys.argv, pyunit_model_params)
| PawarPawan/h2o-v3 | h2o-py/tests/testdir_misc/pyunit_model_params.py | Python | apache-2.0 | 305 |
#!/Users/Honza/Work/mama/volunteer-organiser/bin/python3.4
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| BroukPytlik/volunteer-organiser | bin/django-admin.py | Python | gpl-3.0 | 165 |
from codeschool import models
class QuestionPage(models.CodeschoolPage):
"""
A page that displays a list of all questions registered in this course.
"""
def add_question(self, question, copy=True):
"""
Register a new question to the course.
If `copy=True` (default), register ... | jonnatas/codeschool | src/cs_questions/models/question_page.py | Python | gpl-3.0 | 729 |
# -*- coding: utf-8 -*-
"""
celery.worker.job
~~~~~~~~~~~~~~~~~
This module defines the :class:`TaskRequest` class,
which specifies how tasks are executed.
:copyright: (c) 2009 - 2011 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import... | waseem18/oh-mainline | vendor/packages/celery/celery/worker/job.py | Python | agpl-3.0 | 20,350 |
# Copyright 2016 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 by applicable law or ... | GirlsCodePy/girlscode-coursebuilder | modules/analytics/filters.py | Python | gpl-3.0 | 15,453 |
#!/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.
#
# This script takes libcmt.lib for VS2005/08/10/12/13 and removes the allocation
# related functions from it.
#
# Usage: prep_lib... | wubenqi/zutils | zutils/base/allocator/prep_libc.py | Python | apache-2.0 | 2,582 |
"""Add support for the Xiaomi TVs."""
import logging
import voluptuous as vol
import pymitv
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
SUPPORT_TURN_OFF,
SUPPORT_TURN_ON,
SUPPORT_VOLUME_STEP,
)
from homeassi... | joopert/home-assistant | homeassistant/components/xiaomi_tv/media_player.py | Python | apache-2.0 | 3,138 |
"""
Tests for Discussion API serializers
"""
import itertools
from urlparse import urlparse
import ddt
import httpretty
import mock
from django.test.client import RequestFactory
from nose.plugins.attrib import attr
from discussion_api.serializers import CommentSerializer, ThreadSerializer, get_context
from discussion... | pepeportela/edx-platform | lms/djangoapps/discussion_api/tests/test_serializers.py | Python | agpl-3.0 | 34,095 |
../../../../../../share/pyshared/twisted/trial/test/test_plugins.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/twisted/trial/test/test_plugins.py | Python | gpl-3.0 | 67 |
"""Utilities needed to emulate Python's interactive interpreter.
"""
# Inspired by similar code by Jeff Epler and Fredrik Lundh.
import sys
import traceback
#START --------------------------- from codeop import CommandCompiler, compile_command
#START --------------------------- from codeop import CommandCom... | siosio/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevconsole_code_for_ironpython.py | Python | apache-2.0 | 17,215 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | Micronaet/micronaet-sql | sql_goods_layout/__openerp__.py | Python | agpl-3.0 | 1,574 |
# Copyright 2017 Mycroft AI 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 writi... | Dark5ide/mycroft-core | mycroft/configuration/config.py | Python | apache-2.0 | 8,223 |
#! /usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright 2012 TestLink-API-Python-client developers
#
# 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/license... | mytliulei/DCNRobot | src/tools/testlink/__init__.py | Python | apache-2.0 | 877 |
# proxy module
from __future__ import absolute_import
from enable.radio_group import *
| enthought/etsproxy | enthought/enable/radio_group.py | Python | bsd-3-clause | 87 |
class AstWalker:
def walk(self, node, attributes, nodes):
if isinstance(attributes, dict):
self._walk_with_attrs(node, attributes, nodes)
else:
self._walk_with_list_of_attrs(node, attributes, nodes)
def _walk_with_attrs(self, node, attributes, nodes):
if self._ch... | melonproject/oyente | oyente/ast_walker.py | Python | gpl-3.0 | 1,572 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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/l... | hasegaw/IkaLog | ikalog/scenes/game/inklings_tracker.py | Python | apache-2.0 | 14,708 |
from unittest import TestCase, main
from preconditions import PreconditionError, preconditions
class PreconditionTestBase (TestCase):
def assertPreconditionFails(self, target, *args, **kw):
self.assertRaises(PreconditionError, target, *args, **kw)
def assertPreconditionFailsRegexp(self, rgx, target,... | nejucomo/preconditions | tests.py | Python | mit | 7,012 |
__all__ = ['personcontroller'] | rjarv/contact-web-api | src/controllers/__init__.py | Python | mit | 30 |
"""A convenient API to access the GPIO pins of the Raspberry Pi.
"""
import os
import subprocess
from contextlib import contextmanager
from quick2wire.board_revision import revision
from quick2wire.selector import EDGE
def gpio_admin(subcommand, pin, pull=None):
if pull:
subprocess.check_call(["gpio-adm... | rgharris/477grp3 | rpi/quick2wire-python-api/quick2wire/gpio.py | Python | gpl-3.0 | 7,921 |
"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/suna_common.py
@author Emily Hahn
@brief Contains code common to parsing SUNA instruments
"""
__author__ = 'Emily Hahn'
__license__ = 'Apache 2.0'
import binascii
import datetime
import calendar
import ntplib
import struct
from mi.core.log im... | oceanobservatories/mi-instrument | mi/dataset/parser/suna_common.py | Python | bsd-2-clause | 10,862 |
import abc
from flask import Flask
from . import settings
class Environment(metaclass=abc.ABCMeta):
instance = None
def __init__(self, name):
if self.instance is not None:
raise RuntimeError('The environment %s is already running. '
'Only one instance is a... | lucasdavid/grapher | grapher/environment.py | Python | mit | 638 |
"""Module for calculation of Wind chill.
Wind-chill or windchill (popularly wind chill factor) is the lowering of
body temperature due to the passing-flow of lower-temperature air.
Wind chill numbers are always lower than the air temperature for values
where the formula is valid.
When the apparent temperature is high... | malexer/meteocalc | meteocalc/windchill.py | Python | mit | 1,625 |
# -*- coding: utf-8 -*-
#
# assert-c documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 8 21:14:57 2016.
#
# 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.
#
# ... | tibabit/assert | docs/conf.py | Python | mit | 9,308 |
# -*- coding: utf-8 -*-s
from django.views.decorators.csrf import ensure_csrf_cookie
from ..home.helpers import render_index
from django.utils.translation import ugettext
@ensure_csrf_cookie
def index(request):
"""Index page"""
return render_index(request, {
'site_title': [ugettext('Contact us')],
... | EndyKaufman/django-postgres-angularjs-blog | app/contact/views.py | Python | mit | 418 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Signal and noise histograms per channel
import numpy as np
import pandas as pd
import os
from os.path import expanduser
import datapipe
from datapipe.io import geometry_converter
from datapipe.io.images import image_generator
from datapipe.io.images import plot_ctapi... | jdhp-sap/data-pipeline-standalone-scripts | utils/signal_and_noise_histograms_loglog_individual_pixel_spectrum_per_channel_after_integration.py | Python | mit | 3,055 |
__version__ = "0.1.0"
def private(function):
"""
Marks given function as private
(which'll be not accessible outside of this module)
"""
if not getattr(function, "private", False):
function.private = True
return function
def is_private(function):
"""
Returns true if given fun... | kyoto-project/kyoto | kyoto/__init__.py | Python | mit | 853 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
Initialize the rating task from an existing qualitative description task.
"""
from django.core.management.base import BaseCommand, CommandError
from cc.models import *
from django.db import transaction
from django.utils.html import escape
import ipdb
import random
... | arunchaganty/contextual-comparatives | applesoranges/cc/management/commands/rate_initialize.py | Python | mit | 2,413 |
#!/usr/bin/env python3.7
"""No Idea: Jerod Gawne, 2019.02.18 <https://github.com/jerodg>"""
from sys import exc_info
from traceback import print_exception
from typing import NoReturn
def main() -> NoReturn:
_ = input()
n = input().split()
a = set(input().split())
b = set(input().split())
print(su... | jerodg/hackerrank-python | python/03.Sets/13.NoIdea/solution2.py | Python | mit | 484 |
import sys
import csv
import warnings
from gridsim.decorators import accepts, returns
class Reader(object):
def __init__(self):
"""
__init__(self)
This class is the based class of all readers/loaders.
"""
super(Reader, self).__init__()
def clear(self):
"""
... | gridsim/gridsim | gridsim/iodata/input.py | Python | gpl-3.0 | 6,548 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | muff1nman/duplicity | duplicity/__init__.py | Python | gpl-2.0 | 966 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.templates
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for various template engines' markup.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexers.html import HtmlLexer, XmlLex... | amaozhao/blogular | pygments/lexers/templates.py | Python | bsd-3-clause | 69,857 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | sutartmelson/girder | girder/models/model_base.py | Python | apache-2.0 | 58,545 |
#!/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 distributed... | haad/ansible-modules-extras | cloud/profitbricks/profitbricks.py | Python | gpl-3.0 | 21,799 |
from ppadb.plugins.device import batterystats_section as section_module
from ppadb.plugins import Plugin
from ppadb.utils.logger import AdbLogging
logger = AdbLogging.get_logger(__name__)
class BatteryStats(Plugin):
def get_battery_level(self):
battery = self.shell("dumpsys battery")
for line in... | Swind/pure-python-adb | ppadb/plugins/device/batterystats.py | Python | mit | 1,296 |
#!/usr/bin/env python
import os
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# The current directory must be writeable.
#
try:
channel = open("mni-surface-mesh-binary.obj", "wb")
channel.close()
ren1 = vtk.vtkRenderer()
... | timkrentz/SunTracker | IMU/VTK-6.2.0/IO/MINC/Testing/Python/TestMNIObjects.py | Python | mit | 4,808 |
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | noslenfa/tdjangorest | uw/lib/python2.7/site-packages/paramiko/dsskey.py | Python | apache-2.0 | 6,726 |
'''
this script is used to create a sqlite databse for all the book pages we collected. It reads from book_info.txt and writes the data to the book_attribute table in amazon.db. It also creates an edgelist table in the database.
c1 to c10 are copurchases with the book.
'''
import sqlite3 as lite
import re
rPrice=re.co... | dtattersall/BookSocialGraph | amazon_db.py | Python | mit | 5,605 |
from django import template
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.test import TestCase
from django.utils.hashcompat import md5_constructor
from urlr.models import bitly, LinkShortenedItem
from urlr.tests.models import UrlrTestModel
def _short_url(url):
... | adamfast/django-urlr | urlr/tests/tests.py | Python | bsd-3-clause | 2,612 |
# Django settings for wikibloks project.
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SITE_DIR = os.path.dirname(os.path.realpath(__file__))
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_... | Apreche/Wikibloks | settings.py | Python | mit | 4,204 |
#
# Copyright (C) 2018 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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... | robocomp/robocomp-robolab | components/detection/emotionrecognition2/src/emotionrecognitionI.py | Python | gpl-3.0 | 2,369 |
# pip install sqlalchemy tableschema-sql
import sqlalchemy as sa
from tableschema import Table
# Create SQL database
db = sa.create_engine('sqlite://')
# Data from WEB, schema from MEMORY
SOURCE = 'https://raw.githubusercontent.com/frictionlessdata/tableschema-py/master/data/data_infer.csv'
SCHEMA = {'fields': [{'nam... | okfn/jsontableschema-py | examples/table_sql.py | Python | mit | 998 |
from plugins.SHomePlugin import SHomePlugin
__author__ = 'cirreth'
import logging
class MockPlugin(SHomePlugin):
def call(self, reference, values={}):
logging.debug('MockPlugin call with '+reference)
return reference
def list(self, reference=''):
return 'Any value' | Cirreth/shome | plugins/mock/MockPlugin.py | Python | mit | 317 |
from lib.common import helpers
class Stager:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'pth-wmis',
'Author': ['@harmj0y'],
'Description': ('Generates a pth-wmis launcher for Empire.'),
'Comments': [
''
]
... | pierce403/EmpirePanel | lib/stagers/pth_wmis.py | Python | bsd-3-clause | 4,310 |
'''
Analyses the clusters and returns the similar values in vars
Author : Diviyan Kalainathan
Date : 28/06/2016
'''
import csv
def var_similarity(data_folder,num_clusters, num_vars, list_vars):
"""
:param data_folder: Folder where the clustering output is(String)
:param num_clusters: Number of clusters(in... | Diviyan-Kalainathan/causal-humans | ClusterAnalysis/Similarity_analysis.py | Python | mit | 2,045 |
import tornado
class BaseRequestHandler(tornado.web.RequestHandler):
def require_argument(self, name, expected_value=None):
value = self.get_argument(name, None)
self.validate_argument(name, value, expected_value)
return value
def validate_argument(self, name, value, expected_value):
... | globocom/oauth2u | oauth2u/server/handlers/base.py | Python | mit | 2,787 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 19:19:45 2021
Author: Josef Perktold
Author: Pamphile Roy
License: BSD-3
"""
import numpy as np
from scipy import stats
# scipy compat:
from statsmodels.compat.scipy import multivariate_t
from statsmodels.distributions.copula.copulas import Copula
class EllipticalC... | bashtage/statsmodels | statsmodels/distributions/copula/elliptical.py | Python | bsd-3-clause | 8,894 |
'''
GAVIP Example AVIS: Multiple Pipeline AVI
Django models used by the AVI pipelines
'''
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from pipeline.models import AviJob
class NoisySpectraJob(AviJob):
"""
Model to be used for recording Ulysses parame... | parameterspace-ie/example-avis | multiple_pipelines_avi/avi/models.py | Python | lgpl-3.0 | 2,268 |
# -*- coding: utf-8 -*-
#
# 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 writing, software
... | sdiazb/airflow | airflow/contrib/auth/backends/password_auth.py | Python | apache-2.0 | 4,386 |
#!/usr/bin/python
#
# Copyright (c) 2014 NEC Corporation
# All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this
# distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
#
import requests... | opendaylight/vtn | coordinator/test/vtn_ft/vtn_flowfilter_audit.py | Python | epl-1.0 | 9,683 |
#
# Copyright (c) 2017 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
default_app_config = 'pdc.apps.componentbranch.apps.ComponentBranchConfig'
| release-engineering/product-definition-center | pdc/apps/componentbranch/__init__.py | Python | mit | 185 |
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QMenu, QVBoxLayout, QSizePolicy, QMessageBox, QWidget, QPushButton
from PyQt5.QtGui import QIcon
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
im... | miltonsarria/dsp-python | examples/10-pyplot_ion.py | Python | mit | 4,117 |
import sys
import math
import string
def read_file(filename):
d = {}
for l in open(filename):
# remove punctation
l = l.translate(string.maketrans("", ""), string.punctuation)
for w in l.lower().rsplit():
d[w] = d.get(w, 0) + 1
return d
doc_A = sys.argv[1]
doc_B = sys.... | scampion/mit_courses | 6-006-introduction-to-algorithms-spring-2008/L1/distance.py | Python | gpl-3.0 | 843 |
#!/usr/bin/env python
# encoding: utf-8
"""
nim-game.py
Created by Shuailong on 2015-12-21.
https://leetcode.com/problems/nim-game/.
"""
class Solution1(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
'''Too time consuming'''
win1 = True
... | Shuailong/Leetcode | solutions/nim-game.py | Python | mit | 920 |
from model.group import Group
def test_group_list(app, db):
ui_list = app.group.get_group_list()
def clean(group):
return Group(id=group.id, name=group.name.strip())
db_list = map(clean, db.get_group_list())
assert sorted(ui_list, key=Group.id_gr_max) == sorted(db_list, key = Group.id_gr_max) | Atush/py_learning | test/test_db_matches_ui.py | Python | apache-2.0 | 318 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/autobahn/asyncio/__init__.py | Python | gpl-3.0 | 2,055 |
#################################################################
# Example "model" which shows how to use Wiggly
#
# The model consists of a mixture of shapes and non-shape
# parameters, both probabilistic and fuzzy.
#################################################################
import optparse
import sys
import w... | zoidy/wiggly | examples/test_model/test_model.py | Python | lgpl-3.0 | 4,311 |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from flexmock import flexmock
from osbs.exceptions import OsbsException, OsbsValidationException
from... | projectatomic/osbs-client | tests/test_repo_utils.py | Python | bsd-3-clause | 16,992 |
from fireplace.enums import CardType, GameTag
# Missing buffs
GVG_003e = {
GameTag.CARDNAME: "Unstable Portal Buff",
GameTag.CARDTYPE: CardType.ENCHANTMENT,
GameTag.COST: -3,
}
GVG_017e = {
GameTag.CARDNAME: "Call Pet Buff",
GameTag.CARDTYPE: CardType.ENCHANTMENT,
GameTag.COST: -4,
}
EX1_144e = {
GameTag.CA... | oftc-ftw/fireplace | fireplace/cards/data/missing_cards.py | Python | agpl-3.0 | 504 |
from sympy.assumptions.satask import satask
from sympy import symbols, Q, assuming, Implies, MatrixSymbol, I, pi, Rational
from sympy.utilities.pytest import raises, XFAIL
x, y, z = symbols('x y z')
def test_satask():
# No relevant facts
assert satask(Q.real(x), Q.real(x)) is True
assert satask(Q.real... | kaichogami/sympy | sympy/assumptions/tests/test_satask.py | Python | bsd-3-clause | 10,394 |
from .views import omim_bp
| Clinical-Genomics/scout | scout/server/blueprints/diagnoses/__init__.py | Python | bsd-3-clause | 27 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | elijah513/ice | python/test/Ice/slicing/exceptions/ServerAMD.py | Python | gpl-2.0 | 6,422 |
# -*- coding: utf-8 -*-
'''
flask_login.config
------------------
This module provides default configuration values.
'''
from datetime import timedelta
#: The default name of the "remember me" cookie (``remember_token``)
COOKIE_NAME = 'remember_token'
#: The default time before the "remember me" cookie... | alanhamlett/flask-login | flask_login/config.py | Python | mit | 1,965 |
#nhap vao chuc nang thoat chuong trinh
print '''
nhap vao mot so
doan binh phuong cua no
** an q or Q neu ban muon thoat khoi chuong trinh **
'''
for i in range(10):
a = raw_input("nhap vao mot so : ")
if (a=='q' or a=='Q'):
print "ban da thoat chuong trinh !"
break
else:
b = input("nhap so b... | pythonvietnam/pbc082015 | thaitrungtan/tanchuot6.py | Python | gpl-2.0 | 468 |
# -*- coding: utf-8 -*-
"""Subclass of InteractiveShell for terminal based frontends."""
#-----------------------------------------------------------------------------
# Copyright (C) 2001 Janko Hauser <jhauser@zscout.de>
# Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu>
# Copyright (C) 2008-2011 The... | noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py | Python | apache-2.0 | 26,635 |
#!/usr/bin/env python
"""
Artificial Intelligence for Humans
Volume 2: Nature-Inspired Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2014 by Jeff Heaton
Licensed under the Apache License, Versi... | PeterLauris/aifh | vol2/vol2-python-examples/examples/capstone_titanic/run_milestone2.py | Python | apache-2.0 | 1,812 |
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from article.models import Document
from article.forms import DocumentForm
# Create your views here.
from django.http import HttpResponse
from djang... | rajmohanperiyasamy/pollapp | article/views.py | Python | mit | 11,268 |
f = open('test.txt','w')
import random
rm = 2**14
for i in range(1):
for j in range(4):
for k in range(4):
for l in range(4):
a = i*(rm) + random.randint(0,rm)
b = j*(rm) + random.randint(0,rm)
c = k*(rm) + random.ran... | ymahajan456/HighLevelSynthesis | Version_1.0/Testing/test_gen.py | Python | gpl-3.0 | 1,514 |
#
# DrTransformer.py -- co-transcriptional folding.
#
# written by Stefan Badelt (stef@tbi.univie.ac.at)
#
from __future__ import absolute_import, division, print_function #, unicode_literals
from builtins import map
from builtins import zip
from builtins import str
from builtins import range
import os
import sys
im... | bad-ants-fleet/ribolands | scripts/DrTransformer.py | Python | mit | 29,196 |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ... | sebrandon1/neutron | neutron/tests/unit/db/test_l3_db.py | Python | apache-2.0 | 13,467 |
#$Id: Comm.py,v 1.1 2005/05/26 05:33:58 shawns Exp $
# "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement
# is hereby granted... | ekiwi/tinyos-1.x | contrib/nestfe/python/pytos/Comm.py | Python | bsd-3-clause | 3,828 |
#
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
import logging
import dns.name
import re
try:
from xml.etree import cElementTree as etree
except ImportError:
from xml.etree import ElementTree as etree
from ipapython import ipa_log_manager, ipautil
from ipaserver.dnssec.opendnssec impor... | encukou/freeipa | ipaserver/dnssec/odsmgr.py | Python | gpl-3.0 | 8,827 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Gabriel F. Araujo
# 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.
# Thi... | gabrielaraujof/voxforge2sphinxPtBr | setupam/speaker.py | Python | gpl-2.0 | 6,602 |
import zipfile
import tempfile
import shutil
import os
import os.path
import hashlib
import base64
import json
import logging
import subprocess
import re
import botocore
import tasks.name_constructor as name_constructor
import tasks.bototools as bototools
from tasks.Task import Task
class Lambda(Task):
"""Create a ... | Travelport-Czech/apila | tasks/Lambda.py | Python | mit | 8,808 |
# -*- coding: utf-8 -*-
# Scrapy settings for tutorial1 project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/late... | lmee/exercise1 | tutorial/tutorial/tutorial/settings.py | Python | apache-2.0 | 3,043 |
from django.utils.translation import ugettext_lazy as _
def register_usercp_extension(request):
return (('usercp_options', _('Forum Options')),)
| Maronato/aosalunos | misago/apps/usercp/options/usercp.py | Python | gpl-2.0 | 150 |
import collections
import numpy as np
import numpy.ma as ma
import glob
import logging
import os
import shutil
import time
import timeit
from contextlib import contextmanager
import mot
from mdt.__version__ import __version__
from mdt.lib.nifti import get_all_nifti_data
from mdt.lib.components import get_model
from mdt... | cbclab/MDT | mdt/lib/processing/model_fitting.py | Python | lgpl-3.0 | 21,867 |
"""Tests for update records."""
from __future__ import unicode_literals
import unittest
from dbdiff.fixture import Fixture
from .base import TestImportBase, FixtureDir
class TestUpdate(TestImportBase):
"""Tests update procedure."""
def test_update_fields(self):
"""Test all fields are updated."""
... | max-arnold/django-cities-light | cities_light/tests/test_update.py | Python | mit | 4,566 |
import requests
from flask import render_template, redirect, url_for, abort, flash, request,\
current_app, make_response
from flask.ext.login import login_required, current_user, login_user, logout_user
from flask.ext.sqlalchemy import get_debug_queries
from sqlalchemy import func, desc
from . import main
# from ... | kronosapiens/thena | thena/app/main/views.py | Python | gpl-2.0 | 11,635 |
#!/bin/env python2.7
"""
http://en.wikipedia.org/wiki/Intel_HEX
"""
class IntelHexRecord(object):
def __init__(self, line):
self.parse(line)
def hasValidStartCode(self, line):
return line[0] == ':'
def getByteCount(self, line):
byteCoun... | amishHammer/tnc1-python-config | IntelHexRecord.py | Python | apache-2.0 | 3,391 |
#
# Alternating Inference Chain (AIC) Loop strategy module
#
from logger import *
from playbook import *
from sudoku import *
from chain import *
class Loop(Chain):
"""
AIC is a directional loop of nodes. A link in AIC takes the following
form.
((A, B, ...), hint)
A node list is used to suppo... | pengdai2/sudoku | strategy/aic.py | Python | apache-2.0 | 15,676 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libwebp(AutotoolsPackage):
"""WebP is a modern image format that provides superior lossles... | LLNL/spack | var/spack/repos/builtin/packages/libwebp/package.py | Python | lgpl-2.1 | 2,341 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright: Slobodni programi d.o.o., Zagreb
# Contributions:
#... | addition-it-solutions/project-all | addons/l10n_hr/__openerp__.py | Python | agpl-3.0 | 2,662 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis_louvain | reference/models/enums/education_institution_type.py | Python | agpl-3.0 | 1,538 |
#!/usr/bin/env python3
# 作者:hosiet
import os
import sys
import sqlite3
import config
import requests
import urllib
| hosiet/ustcbbs-archiver | exec.py | Python | mit | 125 |
import os
import shelve
# @todo: use config.json instead?
class Configuration:
default_port = 8080
log_conf_path = "project/configuration/logging.conf"
log_file_path = "logging.log"
log_view_n_lines = 100
template_folder_path = "project/templates/"
# trap settings
trap_depth_max_depth =... | WebMole/crawler-benchmark | project/configuration/__init__.py | Python | gpl-2.0 | 7,784 |
#encoding:utf-8
subreddit = 'theydidthemath'
t_channel = '@TheyDidTheMath'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| Fillll/reddit2telegram | reddit2telegram/channels/~inactive/theydidthemath/app.py | Python | mit | 149 |
#coding: utf-8
import json
from django.test import TestCase
from django.test.client import Client
class ClientTestCase(TestCase):
def setUp(self):
self.client = Client(HTTP_USER_AGENT='Mozilla/5.0')
self.before_each()
def tearDown(self):
self.after_each()
def before_each(self):... | haandol/assemblyapi | main/tests.py | Python | apache-2.0 | 1,851 |
#!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | alibaba/weex | weex_core/test/third_party/googletest/googlemock/scripts/generator/cpp/ast.py | Python | apache-2.0 | 62,925 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.