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 __future__ import unicode_literals
import copy
import inspect
import sys
import warnings
from django.apps import apps
from django.apps.config import MODELS_MODULE_NAME
from django.conf import settings
from django.core import checks
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObjectsReturn... | helenst/django | django/db/models/base.py | Python | bsd-3-clause | 66,310 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | mistercrunch/airflow | airflow/providers/google/cloud/transfers/local_to_gcs.py | Python | apache-2.0 | 5,668 |
#!/usr/bin/env python
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# misc.py
# Python module for osinstaller.
#
# Copyright (C) 2010 Ylmf, Inc.
#
#
# Ylmf Author(s): wkt <weikting@gmail.com>
#
#
import sys
import os
import traceback
import socket
import glib
import gtk
im... | huangzx/installer | src/misc.py | Python | gpl-2.0 | 40,155 |
from pyrat import pyrat_help
help = pyrat_help(__name__, "\n Data import")
from .Rat import *
from .HDF5 import *
from .Pixmap import *
from .Binary_GDAL import *
| birgander2/PyRAT | pyrat/save/__init__.py | Python | mpl-2.0 | 167 |
from django.conf.urls import url
from profiles import views
urlpatterns = [
url(
regex=r"^edit/$",
view=views.ProfileEditUpdateView.as_view(),
name="profile_edit"
),
url(
regex="^confirm_role/(?P<membership_id>[-\w]+)/(?P<action>verify|deny)/$",
view=views.profile_c... | noisy/steemprojects.com | profiles/urls.py | Python | mit | 1,096 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
specification = {}
specification = {
2:
{
"equation_ids":(1,2),
"constant":(0, "act_2_2"),
"c750":("c750_2_1", 0),
"di":("di_2_1", 0),
"dloc":("dloc_2_1", 0),
... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/biocomplexity/examples/estimation_lccm_specification_ub95to99.py | Python | gpl-2.0 | 6,006 |
# -*- coding: utf-8 -*-
"""
Created on Mon May 26 23:42:03 2014
@author: Administrator
"""
from support import *
import hashlib
import io
import xml.dom.minidom
import random
import math
import os
import sys
default_encoding = 'utf-8'
if sys.getdefaultencoding() != default_encoding:
reload(sys)
sys.setdefau... | Vespa314/bilibili-api | GetDanmuAss/spview danmaku/GetAssDanmaku.py | Python | mit | 19,496 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | eliasdesousa/indico | indico/modules/events/agreements/placeholders.py | Python | gpl-3.0 | 1,540 |
###############################################################################
##
## Copyright (c) Crossbar.io Technologies GmbH
##
## 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... | crossbario/autobahn-testsuite | autobahntestsuite/autobahntestsuite/case/case9_4_3.py | Python | apache-2.0 | 1,271 |
# Status: ported.
# Base revision: 45462.
# Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its ... | gwq5210/litlib | thirdparty/sources/boost_1_60_0/tools/build/src/build/type.py | Python | gpl-3.0 | 13,802 |
#!/usr/bin/env python
import sys
import data_api2.data_api2Client
url=sys.argv[1]
p=data_api2.data_api2Client.data_api2(url=url)
obj_name="ReferenceGenomeAnnotations/kb|g.140057"
feature='kb|g.140057.CDS.2901'
gene='kb|g.140057.locus.2922'
mrna='kb|g.140057.mRNA.2840'
taxon= u'1779/523209/1'
assembly='1837/56/1'
pr... | scanon/data_api2 | test.py | Python | mit | 461 |
# Copyright (C) 2011 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import fields, models
from odoo.addons.l10n_br_fiscal.constants.fiscal import (
NFE_IND_PRES,
NFE_IND_PRES_DEFAULT,
)
class SaleReport(models.Model):
_inherit = 'sale.report'
fisc... | kmee/l10n-brazil | l10n_br_sale/report/sale_report.py | Python | agpl-3.0 | 1,486 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | jiangxb1987/spark | python/pyspark/pandas/base.py | Python | apache-2.0 | 55,596 |
##########################################################################
#
# Copyright (c) 2021, Cinesite VFX Ltd. 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 ... | hradec/gaffer | python/GafferDispatchUITest/NodeUITest.py | Python | bsd-3-clause | 2,059 |
import numpy as np
from scipy import stats
from six.moves import range
import numpy.testing as npt
from numpy.testing import assert_array_equal
import nose.tools
from nose.tools import assert_equal, raises
from .. import algorithms as algo
rs = np.random.RandomState(sum(map(ord, "test_algorithms")))
a_norm = rs.rand... | yarikoptic/seaborn | seaborn/tests/test_algorithms.py | Python | bsd-3-clause | 6,588 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011-2015 Slack
#
# 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
... | Slack06/yadg | descgen/mixins.py | Python | mit | 5,992 |
#!/usr/bin/env python
# This file is part of dxdiff.
#
# dxdiff 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.
#
# ... | rjferrier/fluidity | libspud/dxdiff/dxdiff/utils.py | Python | lgpl-2.1 | 4,909 |
STATUS_ICONS = { "success": ""
, "warning": ""
, "failure": ""
, "feature": ""
}
REVIEW_MAP = { 'approved': 'success'
, 'unreviewed': 'warning'
, 'rejected': 'failure'
, 'featured': 'feat... | gratipay/gratipay.com | gratipay/utils/icons.py | Python | mit | 341 |
# Author: David Harrison
# This is unicode interface to the platform module.
from BitTorrent import platform
from BTL.platform import efs2
#get_filesystem_encoding = platform.get_filesystem_encoding
#encode_for_filesystem = platform.encode_for_filesystem
#decode_from_filesystem = platform.decode_from_fil... | epsylon3/torrentflux | html/bin/clients/mainline/BitTorrent/uplatform.py | Python | gpl-2.0 | 2,853 |
from odmanalysis.odmstudio import odmstudio_lib as lib
from odmanalysis.odmstudio import odmstudio_framework as framework
import pandas as pd
import numpy as np
import cv2
@framework.RegisterSourceReader("Video files", extensions=('avi','mpg'), maxNumberOfFiles=1)
class VideoReader(lib.SourceReader):
def __init__... | jkokorian/ODMAnalysis | odmanalysis/odmstudio/plugins/sourcereaders/videofilereading.py | Python | gpl-3.0 | 1,750 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import tempfile
from datetime import datetime
from os.path import ab... | scorphus/thumbor | tests/result_storages/test_file_storage.py | Python | mit | 4,325 |
"""
Read in dynamic surface temperature data and contour plot it.
"""
import iris
import iris.plot as iplt
import iris.coord_categorisation as icat
import matplotlib.pyplot as plt
import matplotlib.path as mpath
from cartopy import config
import cartopy.crs as ccrs
import math
import numpy as np
from spawnCommand impo... | jprb-walton/make-temperature-movie | plotAnomalies.py | Python | lgpl-3.0 | 4,208 |
"""
This is the test suite for trade.py.
"""
import copy
from unittest import TestCase, main
# from indra.agent import Agent
from capital.trade_utils import endow, get_rand_good, is_depleted, AMT_AVAILABLE, transfer
from capital.trade_utils import rand_dist, equal_dist, GOODS
import capital.money as mn
import capital.t... | gcallah/Indra | capital/tests/test_money.py | Python | gpl-3.0 | 1,450 |
#!/usr/bin/env python
"""This script solves the Project Euler problem "Path sum: three ways". The
problem is: Find the minimal path sum, in matrix.txt, a 31K text file
containing a 80 by 80 matrix, from the left column to the right column.
"""
import argparse
import csv
try:
from urllib.request import urlopen
exc... | iansealy/projecteuler | 82.py | Python | gpl-3.0 | 1,592 |
from task import Task
from list import List
from user import User
| FroeMic/CDTM-Backend-Workshop-WT2016 | solutions/server/server-15-crud-collaborator/server/models/__init__.py | Python | mit | 66 |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | xsteadfastx/beets | test/test_mb.py | Python | mit | 18,698 |
# 项目:标准库函数
# 模块:协程模块
# 作者:黄涛
# License:GPL
# Email:huangtao.sh@icloud.com
# 创建:2016-12-26 13:34
'''
对asyncio库进行进一步封装,主要功能如下:
1. 执行一个或并行运行多个协程:
start(coro1,coro2,...)
2. 中断协程,并等待另一个协程的运行结果:
result=await coro()
3. 在协程中,并发多个协程:
await wait(*coros)
'''
import asyncio
__all__ = 'start', 'wait', 'wait_for', 'sl... | huangtao-sh/orange | orange/coroutine.py | Python | gpl-2.0 | 1,224 |
from rest_framework import permissions
# TODO Permissions not used at this time
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
# Staff users can view user list
return view.action == "retrieve" or request.user.is_staff
def has_object_permission(... | praekelt/django-admin-api | adminapi/api/permissions.py | Python | bsd-3-clause | 501 |
#! /usr/bin/env jython
"""
Code for managing images.
"""
import path_fix # hack for nathan's box
import os
import sys
from java.awt import *
from javax.swing import * # Just for main routine.
from util import AttributeMap
path = './images'
imageCache = None # The global reference.
def getImageCache():
global ... | zooko/ogresvpixies | Images.py | Python | gpl-2.0 | 1,580 |
#!/usr/bin/env python
import os, sys
from tkinter import Tk
from tkinter.filedialog import askdirectory
from tkinter import messagebox
from pipeline import run_pipeline
do_step = [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1]
main_data_directory = ''
if __name__ == '__main__':
Tk().withdraw()
main_data_directory = ... | FBK-NILab/APSS-Tractography | apss-pipeline.app/Contents/MacOS/apss_pipeline_gui.py | Python | lgpl-3.0 | 561 |
"""Config flow for Environment Canada integration."""
import logging
import xml.etree.ElementTree as et
import aiohttp
from env_canada import ECWeather, ec_exc
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.helpers imp... | jawilson/home-assistant | homeassistant/components/environment_canada/config_flow.py | Python | apache-2.0 | 3,581 |
# 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.
import logging
import re
import os
from pylib import constants
from pylib import pexpect
from pylib.android_commands import errors
from pylib.base.test... | nacl-webkit/chrome_deps | build/android/pylib/gtest/test_package.py | Python | bsd-3-clause | 6,409 |
__all__ = ['SetupPy']
import os
import re
import sys
from numpy.distutils.exec_command import exec_command
from numpy.distutils.misc_util import yellow_text, red_text, cyan_text
from base import Component
from utils import FileSource
def write_files(container):
s = ['creating files and directories:']
for fil... | pemryan/f2py | extgen/setup_py.py | Python | bsd-3-clause | 5,956 |
#!/usr/bin/env python
import sys, os, optparse
import chpl_arch, chpl_comm, chpl_comm_segment, chpl_compiler, chpl_platform
from utils import memoize
@memoize
def get(flag='host'):
if flag == 'host':
mem_val = 'cstdlib'
elif flag == 'target':
mem_val = os.environ.get('CHPL_MEM')
if not... | CoryMcCartan/chapel | util/chplenv/chpl_mem.py | Python | apache-2.0 | 1,853 |
#!/usr/bin/env python
# We have to import the minecraft api module to do anything in the minecraft world
from mcpi.minecraft import *
import sys
# this means that the file can be imported without executing anything in this code block
if __name__ == "__main__":
"""
First thing you do is create a connection t... | hashbangstudio/Python-Minecraft-Examples | 06-setPositionFromArgs.py | Python | bsd-3-clause | 1,767 |
import logging
from typing import Any
from decimal import Decimal
import flask
from flask import Blueprint, Response, render_template, request,\
url_for, redirect
from flask_babel import gettext, lazy_gettext
from flask_login import login_required, current_user
from waitlist.base import db
from waitlist.permissions... | SpeedProg/eve-inc-waitlist | waitlist/blueprints/settings/ship_assignment.py | Python | mit | 9,400 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'backGroundC.ui'
#
# Created: Sat Jun 21 13:16:32 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from PyQt4 import QtCore
import urllib
import os
import... | mnhkahn/python_code | bing.py | Python | gpl-2.0 | 5,311 |
import sys
from PyQt4 import QtCore, QtGui, uic
ui_file = "ui_testplot.ui"
Ui_Widget, QtBaseClass = uic.loadUiType(ui_file)
class MyApp(QtGui.QWidget, Ui_Widget):
def __init__(self):
QtGui.QWidget.__init__(self)
Ui_Widget.__init__(self)
self.setupUi(self)
#self.printOutButton.clic... | manashmndl/LearningPyQt | TestPlot/TestPlot/TestPlot.py | Python | mit | 605 |
#Made by Sangpil Kim
#June 2016
import os
import csv
import argparse as arg
import requests as re
from bs4 import BeautifulSoup as bs4
def getInfo(num):
url = 'http://www.bloomberg.com/bcom/sitemaps/people-'+str(num)+'.html'
req = re.get(url)
soup = bs4(req.text, 'html.parser')
names = so... | spk921/scrapers | bloomberg/scrapeBloombergPeopleCode.py | Python | mit | 2,640 |
'''
Created on Feb 18, 2017
@author: julien
'''
from genericpath import isfile
from os.path import join
import tempfile
import unittest
from minos.experiment.experiment import ExperimentParameters, Experiment
from minos.experiment.training import Training, EpochStoppingCondition
from minos.model.design import create_... | guybedo/minos | tests/train/multidevice_model_train_test.py | Python | apache-2.0 | 2,770 |
r'''
This example uses the crease pattern in the constraint on
developability.
The obtained result show that the crease pattern configuration
at hand satisfies the developability condition.
Further, the derivatives of the condition with
respect to the node displacement can be easily verified
by checking if a node dis... | simvisage/oricreate | docs/howtos/ex06_gu_components/gu_developability.py | Python | gpl-3.0 | 880 |
#!/bin/python
# usage:
# cat clAmdBlas.h | $0
import sys, re;
from common import remove_comments, getTokens, getParameters, postProcessParameters
try:
if len(sys.argv) > 1:
f = open(sys.argv[1], "r")
else:
f = sys.stdin
except:
sys.exit("ERROR. Can't open input file")
fns = []
while ... | grace-/opencv-3.0.0-cvpr | opencv/modules/ocl/src/cl_runtime/generator/parser_clamdblas.py | Python | bsd-3-clause | 2,892 |
"""CAS authentication middleware"""
from urllib import urlencode
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth import logout as do_logout
from django.contrib.auth.views import login, logout
from django.core.urlresolvers import reverse
from django.http im... | BioComputing/django_bcf_cas | bcf_cas/middleware.py | Python | bsd-3-clause | 3,224 |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This librar... | plq/spyne | spyne/util/etreeconv.py | Python | lgpl-2.1 | 4,170 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 NTT Innovation Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | r-icarus/openstack_microserver | openstack_dashboard/dashboards/project/network_topology/routers/tables.py | Python | apache-2.0 | 1,155 |
#!/usr/bin/env python
"""Create a release.
Usage:
release.py [<branch>]
"""
from __future__ import print_function
import datetime, docopt, fileinput, json, os, re, requests, shutil, sys, tempfile
from docutils import nodes, writers, core
from subprocess import check_call
class MDWriter(writers.Writer):
"""Git... | MHeasell/TA3D | src/libs/fmt-3.0.1/support/release.py | Python | gpl-2.0 | 5,773 |
"""Here we describe and implement the measurement setups, eg Coldhoead..."""
__copyright__ = "Copyright 2015 - 2017, Justin Scholz"
__author__ = "Justin Scholz"
from abc import ABCMeta, abstractmethod
from MeasurementHardware import MeasurementDeviceController
import visa
import UserInput
class MeasurementSetup(meta... | JMoVS/JUMP | MeasurementSetups.py | Python | mit | 25,183 |
"""
Name: layers
Purpose: Provides functions for accessing and modifying layer values.
Description:
These property getters and setters use the bmesh from the global dict that gets
updated by the scene update handler found in init.
Creating bmeshes in the panels is bad practice as it causes unexpected
behavior.
"""... | Yethiel/re-volt-addon | io_revolt/layers.py | Python | gpl-3.0 | 9,560 |
from nose.tools import eq_, ok_, raises, assert_true
from wtforms import fields, validators
from flask_admin import form
from flask_admin._compat import as_unicode
from flask_admin._compat import iteritems
from flask_admin.contrib.sqla import ModelView, filters
from flask_babelex import Babel
from sqlalchemy.ext.hyb... | sfpprxy/py-reminder | libs/tests/sqla/test_basic.py | Python | bsd-3-clause | 61,693 |
# Copyright (c) 2017 Ansible, Inc.
# All Rights Reserved.
from uuid import uuid4
from django.conf import LazySettings
from django.core.cache.backends.locmem import LocMemCache
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
from rest_framework.fields imp... | GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awx/conf/tests/unit/test_registry.py | Python | apache-2.0 | 7,972 |
from model.u_net import get_unet_128, get_unet_256, get_unet_512, get_unet_1024, get_unet_1024_hq, get_unet_1024_heng
import cv2
### These parameters might be changed ###
input_size = 1024
max_epochs = 150
threshold = 0.49
downscale = cv2.INTER_CUBIC
upscale = cv2.INTER_AREA
### These parameters might be changed ###
... | sergeyshilin/Kaggle-Carvana-Image-Masking-Challenge | params.py | Python | mit | 749 |
import copy
import os
import sys
from collections import OrderedDict
from coalib.collecting.Collectors import collect_registered_bears_dirs
from coalib.misc.Decorators import enforce_signature, generate_repr
from coalib.misc.DictUtilities import update_ordered_dict_key
from coalib.settings.Setting import Setting, glob... | rresol/coala | coalib/settings/Section.py | Python | agpl-3.0 | 8,661 |
from collections import OrderedDict
import numpy as np
import theano
from dagbldr.datasets import fetch_mnist, minibatch_iterator
from dagbldr.optimizers import sgd
from dagbldr.utils import add_datasets_to_graph, get_params_and_grads
from dagbldr.utils import get_weights_from_graph
from dagbldr.utils import convert_t... | kastnerkyle/dagbldr | examples/deprecated/mnist_classifier/logistic_sgd.py | Python | bsd-3-clause | 2,273 |
from django.conf.urls import patterns, include, url
import forms_builder.forms.urls
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'sunstreet.views.home', name='home'),
# url(r'^sunstreet/', incl... | dcarrot2/DjangoSunstreet | sunstreet/urls.py | Python | gpl-2.0 | 930 |
#!/usr/bin/env python3
"""
A random walk in n-dimensions eventually returns to the origin
with probability 100% for n = 1, 2. For n > 2 it's proven that
the probability is less than 100%.
"""
from random import randint
dim = 3
loc = [0] * dim
while True:
loc[randint(0, dim-1)] += [-1, 1][randint(0, 1)]
prin... | Foggalong/scraps | files/maths/rwalk.py | Python | gpl-2.0 | 366 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | vinodkc/spark | python/pyspark/rdd.py | Python | apache-2.0 | 126,212 |
# Copyright 2016 Tesora, 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 ... | Tesora-Release/tesora-trove | trove/guestagent/module/driver_manager.py | Python | apache-2.0 | 3,600 |
import AddFunctionToModule # ourselves
# do something
AddFunctionToModule.frob(1)
def frob(param):
return None | asedunov/intellij-community | python/testData/inspections/AddFunctionToModule_after.py | Python | apache-2.0 | 118 |
#!/usr/bin/env python
import urllib
import urllib2
import urlparse
import json
import os
PUSHOVER_API = "https://api.pushover.net/1/"
class PushoverError(Exception): pass
def pushover(**kwargs):
assert 'message' in kwargs
if not 'token' in kwargs:
kwargs['token'] = os.environ['PUSHOVER_TOKEN']
... | abelboldu/nagpy-pushover | nagpy/util/pushover.py | Python | epl-1.0 | 690 |
import unittest
from PyFoam.Basics.PlyParser import PlyParser
theSuite=unittest.TestSuite()
| Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam | unittests/Basics/test_PlyParser.py | Python | gpl-2.0 | 94 |
# Copyright 2012 OpenStack Foundation
#
# 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 a... | HybridF5/jacket | jacket/tests/storage/unit/api/contrib/test_volume_host_attribute.py | Python | apache-2.0 | 5,376 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Daniel Estevez <daniel@destevez.net>
#
# This file is part of gr-satellites
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
'''
gr-satellites deframer components
The deframers transform soft symbols into frames, detecting packet
boundaries and performin... | daniestevez/gr-satellites | python/components/deframers/__init__.py | Python | gpl-3.0 | 2,225 |
'''
Copyright 2015, 2016 University College London.
This file is part of PyORACC.
PyORACC 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.
... | oracc/pyoracc | pyoracc/model/composite.py | Python | gpl-3.0 | 759 |
#!/usr/bin/python3
#+
# Inkscape plugin to generate shapes highlighting the margins that
# should be left empty for video overscan. Copy this to your Inkscape
# extensions folder, restart Inkscape, and you should see "Overscan"
# appear in the "Video" submenu under the "Extensions" menu. Select this,
# enter percentage... | ldo/dvd_menu_animator | overscan_margins.py | Python | gpl-3.0 | 3,708 |
"GoogleTranslateModule init"
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Lucien Loiseau
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation,... | vicnet/weboob | modules/googletranslate/__init__.py | Python | lgpl-3.0 | 886 |
from functions import global_functions
def debug_step_here():
"""
Creates a Breakpoint when executed in debug-mode
:return:
"""
if global_functions.get_config_key("debug"):
try:
input("Press any key to continue")
except SyntaxError:
pass
def print_out_var... | Fahrenholz/maat-analyzer | functions/debugging_functions.py | Python | gpl-3.0 | 537 |
"""empty message
Revision ID: 8c8a09830b
Revises: 257210b3be18
Create Date: 2014-10-25 14:56:28.967350
"""
# revision identifiers, used by Alembic.
revision = '8c8a09830b'
down_revision = '257210b3be18'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - plea... | ralmn/CMAsk | migrations/versions/8c8a09830b_.py | Python | unlicense | 595 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# setup.py sdist
# setup.py bdist_wheel
# twine upload dist/*
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.... | FSalema/pylatconverter | setup.py | Python | mit | 1,698 |
import numpy as np
from mcerp import *
from uncertainties.core import AffineScalarFunc
class RiskFunction(object):
def get_risk(self, bar, p):
""" Computes risk for perf array w.r.t. bar.
Args:
bar: reference performance bar.
perfs: performance array-like.
Returns:... | UCSBarchlab/Archrisk | models/risk_functions.py | Python | bsd-3-clause | 3,033 |
# -*- coding: utf-8 -*-
# © 2004-2011 Pexego Sistemas Informáticos. (http://pexego.es)
# © 2004-2011 Zikzakmedia S.L. (http://zikzakmedia.com)
# Jordi Esteve <jesteve@zikzakmedia.com>
# © 2014-2015 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0... | Domatix/account-financial-tools | account_invoice_currency/__init__.py | Python | agpl-3.0 | 398 |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class AuthRequestConfig(AppConfig):
name = 'auth_request'
verbose_name = _("Auth Request")
| Xaroth/django-auth-request-ldap | django_auth_request_ldap/auth_request/apps.py | Python | mit | 191 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | AustinRoy7/Pomodoro-timer | venv/Lib/site-packages/pyglet/libs/darwin/constants.py | Python | mit | 18,393 |
# -*- coding: utf-8 -*-
"""
A management command which deletes expired accounts (e.g.,
accounts which signed up but never activated) from the database.
Calls ``Account.objects.delete_expired_accounts()'',
which contains the actual logic for determining which
accounts are deleted.
"""
from django.core.management.base... | liweitianux/97dev | 97suifangqa/apps/sfaccount/management/commands/cleanupaccounts.py | Python | bsd-2-clause | 558 |
"""
WSGI config for Open Hardware Repository 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 ``WS... | gipi/OHR | ohr/config/wsgi.py | Python | bsd-3-clause | 1,227 |
""" Package for tesseract art renders. """
from .all_on import AllOn
from .one_voxel_scan import OneVoxelScan
from .game_of_life_2d import GameOfLife2D
from .game_of_life_3d import GameOfLife3D
from .worm_simulator import WormSimulator
from .test_corners import TestCorners
from .dot_rise_fall import DotRiseFall
ART =... | decoydavid/tesseract | ract/art/__init__.py | Python | gpl-3.0 | 443 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("UserInfo", "0002_auto_20161208_1712"),
]
operations = [
migrations.AlterModelOptions(
name="pledgeclass",
... | sigmapi-gammaiota/sigmapi-web | sigmapiweb/apps/UserInfo/migrations/0003_auto_20170204_1342.py | Python | mit | 520 |
#
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import _sre
import sre_parse
from sre_constants import *
... | FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/sre_compile.py | Python | gpl-2.0 | 26,872 |
#!/usr/bin/env python
'''
simple shortcut for running nosetests via python
replacement for *.bat or *.sh wrappers
'''
import os
import sys
from os.path import dirname, join, pardir
import nose
# django settings module
DJANGO_SETTINGS_MODULE = 'unit_project.settings'
# pythonpath dirs
PYTHONPATH = [
join( dirna... | ella/esus | tests/unit_project/run_tests.py | Python | bsd-3-clause | 747 |
from .GlobalBoard import GlobalBoard
from .bots.Bot import Bot
class Game(object):
def __init__(self, player1, player2):
"""
Game objects represent a game played between two opponents. Zero, one, or both of the opponents can be bots
:param player1: Player or Bot object corresponding to th... | zachdj/ultimate-tic-tac-toe | models/game/Game.py | Python | mit | 3,051 |
"Utilities for loading models and the modules that contain them."
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
import sys
import os
import threading
__all__ = ('g... | greggian/TapdIn | django/db/models/loading.py | Python | apache-2.0 | 7,323 |
# This file was automatically created by FeynRules $Revision: 634 $
# Mathematica version: 8.0 for Mac OS X x86 (64-bit) (November 6, 2010)
# Date: Tue 19 Jul 2011 18:23:49
from object_library import all_orders, CouplingOrder
QCD = CouplingOrder(name = 'QCD',
expansion_order = -1,
... | wavewave/madgraph-auto-model | modelrepo/ADMXUDD112degen/coupling_orders.py | Python | bsd-2-clause | 566 |
import sys
import ipaddress
# pylint: skip-file
if sys.version_info[0] == 2:
def compat_ip_address(address):
if isinstance(address, bytes):
address = address.decode()
return ipaddress.ip_address(address)
int_from_byte = ord
FileNotFoundError = IOError
def int_from_byte... | m-lab/mlab-ns | server/mlabns/third_party/geoip2/maxminddb/compat.py | Python | apache-2.0 | 820 |
# Copyright 2014 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... | LockScreen/Backend | venv/lib/python2.7/site-packages/boto3/resources/factory.py | Python | mit | 19,952 |
from honux import easy
def main():
print(easy.randMax(100))
print(easy.doubleRandom())
if __name__ == '__main__':
main()
| honux77/practice | python/module-ex/test.py | Python | mit | 134 |
__metaclass__=type
import random
import csv
#define a class called 'Customer'
class Customer:
def __init__(self,arrival_date,service_start_date,service_time):
self.arrival_date=arrival_date
self.service_start_date=service_start_date
self.service_time=service_time
self.service_end_date=self.service_start_date+... | AlejandroHCruz/VideoServerNURXSimulation | references/Simulating_Queues-master/MM1Q.py | Python | mit | 2,806 |
"""Sensor to indicate whether the current day is a workday."""
import logging
from datetime import datetime, timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, WEEKDAYS
from homeassistant.components.binary_sensor import BinarySenso... | MartinHjelmare/home-assistant | homeassistant/components/workday/binary_sensor.py | Python | apache-2.0 | 6,415 |
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.views import generic
from django.views.decorators.csrf import csrf_exempt
from rest_framework.renderers import JSONRenderer
fr... | javiexfiliana7/submodulo-javi | polls/views.py | Python | gpl-2.0 | 3,482 |
#!/usr/bin/env python
# This script is intended to be used a a git hook and will prepend the ticket
# number to a commit message in the correct format for Github/Gitlab to parse.
#
# To use, create a shortcut to this file in .git/hooks called
# 'prepare-commit-msg' e.g. from top folder of your project:
# cd .git/h... | omni4d/model | utils/prepare-commit-msg.py | Python | mit | 1,330 |
"""
WSGI config for memes_reposter project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | vaniakosmos/memes-reposter | memes_reposter/wsgi.py | Python | mit | 405 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import taiga.base.db.models.fields
class Migration(migrations.Migration):
dependencies = [
('projects', '0015_auto_20141230_1212'),
]
operations = [
migrations.CreateModel(
... | taigaio/taiga-back | taiga/webhooks/migrations/0001_initial.py | Python | agpl-3.0 | 1,572 |
from __future__ import unicode_literals
from django.contrib import admin
from django.template.defaultfilters import truncatechars
from django.utils.translation import ugettext_lazy as _
from reviewboard.reviews.forms import DefaultReviewerForm, GroupForm
from reviewboard.reviews.models import (Comment, DefaultReviewe... | 1tush/reviewboard | reviewboard/reviews/admin.py | Python | mit | 9,563 |
#Python Workshop Lesson:Automation02
#http://www.designalyze.com/automateGHwithRhinoScript_02
import rhinoscriptsyntax as rs
import Rhino
import time
#Load Grasshopper plugin as gh
gh = Rhino.RhinoApp.GetPlugInObject("Grasshopper")
#SetSliderValue("GUID",Number)
rs.EnableRedraw(True)
for i in range(0,3,1):
... | designalyze/automating-grasshopper | automation files/automation02.py | Python | mit | 496 |
from pytak.call import REST
class GetInformationAboutYourself(REST):
def fill_call_data(self):
self.uri = "/api/muad/rest/users/@me[?query_parameters]"
| zlatozar/pytak | pytak/tests/fakeapi/GetInformationAboutYourself.py | Python | bsd-3-clause | 166 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | varunarya10/ironic | ironic/tests/drivers/test_ssh.py | Python | apache-2.0 | 40,145 |
# -*- coding: utf-8 -*-
# © 2015 Elico corp (www.elico-corp.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Contact Form CAPTCHA',
'version': '8.0.1.0.0',
'category': 'Website',
'depends': [
'website_crm',
'website_captcha_nogoogle',
],
'autho... | Elico-Corp/odoo-addons | website_captcha_nogoogle_crm/__openerp__.py | Python | agpl-3.0 | 517 |
from __future__ import division
def gcd(a, b):
if b == 0: return a
return gcd(b, a%b)
ans = 0
for d in xrange(5, 12001):
n = int(d/2-0.000000001)
while n/d > 1/3:
if gcd(d, n) == 1:
ans += 1
n -= 1
print ans
| huangshenno1/algo | project_euler/73.py | Python | mit | 222 |
from django import forms
from municipios.widgets import SelectMunicipioWidget
from haystack.forms import SearchForm
class FormEndereco(forms.Form):
municipio = forms.IntegerField(label=u"UF - Municipio", widget=SelectMunicipioWidget)
class DateRangeSearchForm(SearchForm):
start_date = forms.DateF... | duartejc/addendum | common/forms.py | Python | gpl-2.0 | 387 |
import red_score
time_signatures = 5 * [(3, 4)]
rh_divisions = []
rh_divisions.extend(4 * [(2, 8)])
rh_divisions.extend(4 * [(2, 16)])
rh_divisions.extend(4 * [(3, 8)])
rh_divisions.extend(4 * [(3, 16)])
lh_divisions = []
lh_divisions.extend(4 * [(3, 8)])
lh_divisions.extend(4 * [(3, 16)])
lh_divisions.extend(4 * [(2,... | Abjad/ide | scores/red_score/red_score/segments/02/definition.py | Python | gpl-2.0 | 561 |
# 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
# distributed under t... | stackforge/python-openstacksdk | openstack/tests/unit/block_storage/v2/test_proxy.py | Python | apache-2.0 | 6,727 |
# -*- coding: utf-8 -*-
from orator.migrations import Migrator, DatabaseMigrationRepository
from .base_command import BaseCommand
class StatusCommand(BaseCommand):
"""
Show a list of migrations up/down.
migrate:status
{--d|database= : The database connection to use.}
{--p|path= : The pat... | sdispater/orator | orator/commands/migrations/status_command.py | Python | mit | 1,642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.