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
import sensor, time, pyb led_r = pyb.LED(1) led_g = pyb.LED(2) led_b = pyb.LED(3) #sensor.reset() sensor.set_contrast(2) sensor.set_framesize(sensor.QCIF) sensor.set_pixformat(sensor.RGB565) clock = time.clock() while (True): clock.tick() # Take snapshot image = sensor.snapshot() # Threshold image w...
SmartArduino/openmv
usr/examples/blob_detection.py
Python
mit
916
try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup setup(name='antk', version=0.3, description='Automated Neural-graph Toolkit: A Tensorflow wrapper for ' 'common deep learning tasks and rapid development of innovative' ...
aarontuor/antk
setup.py
Python
mit
1,606
import cocos from cocos.actions import * from Main import Main from cocos.director import director from pyglet.window import key as keys import pyglet import random class Hero(cocos.sprite.Sprite): baseSpriteAbstractImage = None leftStepImage1 = None leftStepImage2 = None rightStepIma...
hutsi/marmotte_gameoftheyear
Game.py
Python
gpl-2.0
7,488
from __future__ import unicode_literals import json from simple_graph import Node, SimpleGraph from simple_graph import spt_Dijkstra, spt_AStar def extract_data_from_json(file): """Extract only the needed data from json file.""" with open(file) as json_data: data = json.load(json_data) new_data = [...
Bl41r/code-katas
flight_paths.py
Python
mit
3,353
__author__ = 'Jan Pecinovsky' import datetime as dt from copy import copy import forecastio import geopy import numpy as np import pandas as pd from dateutil import rrule class Weather(): """ Object that contains Weather Data from Forecast.io for multiple days as a Pandas Dataframe. NOTE: Foreca...
MatteusDeloge/opengrid
opengrid/library/forecastwrapper.py
Python
apache-2.0
13,954
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2020, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
mrcslws/nupic.research
projects/archive/continuous_learning/multihead/train_model.py
Python
agpl-3.0
2,507
# The MIT License (MIT) # # Copyright (c) 2014 Steve Milner # # 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, modi...
pombredanne/flagon
test/test_backend_db_django.py
Python
mit
3,643
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
webu/pybbm
test/test_project/manage.py
Python
bsd-2-clause
319
import logging from django.conf import settings from django.db import models from mkt.extensions.models import Extension from mkt.site.mail import send_mail from mkt.site.models import ModelBase from mkt.users.models import UserProfile from mkt.webapps.models import Webapp from mkt.websites.models import Website lo...
washort/zamboni
mkt/abuse/models.py
Python
bsd-3-clause
2,640
# -*- coding: utf-8 -*- class BaseWeChatPayAPI: """ WeChat Pay API base class """ def __init__(self, client=None): self._client = client def _get(self, url, **kwargs): if getattr(self, "API_BASE_URL", None): kwargs["api_base_url"] = self.API_BASE_URL return self._clie...
jxtech/wechatpy
wechatpy/pay/api/base.py
Python
mit
830
# 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 the Li...
alex/warehouse
tests/unit/test_forms.py
Python
apache-2.0
6,604
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import sys from datetime import date # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it abs...
inonit/drf-haystack
docs/conf.py
Python
mit
5,773
# Copyright 2012 Nebula, 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 agree...
CiscoSystems/avos
openstack_dashboard/dashboards/admin/volumes/tests.py
Python
apache-2.0
4,970
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import time from...
eternity-group/eternity
qa/rpc-tests/p2p-acceptblock.py
Python
mit
12,336
# -*- coding: utf-8 -*- from jpnetkit.wordnet import Wordnet class TestWordnet: """Test Wordnet""" def test_can_complete_kanji(self): """Test that we can complete kanji""" words = Wordnet().complete(u'始') assert len(words) >= 10 example_words = [u'始まり', u'始める', u'始動'] ...
Xifax/jp-net-kit
jpnetkit/test/wordnet_test.py
Python
bsd-2-clause
824
from authtools.forms import AuthenticationForm from django.contrib.auth import authenticate from django.forms import forms class LoginForm(AuthenticationForm): def clean(self): username = self.cleaned_data.get('username') password = self.cleaned_data.get('password') if username and passwo...
andree1320z/deport-upao-web
deport_upao/extensions/authtools/forms.py
Python
mit
835
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/copy.py
Python
mit
9,870
from . import order_requirement_line_add from . import order_requirement_line_add_match
iw3hxn/LibrERP
sale_order_requirement/wizard/__init__.py
Python
agpl-3.0
88
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
iot-factory/synapse
synapse/federation/transport/client.py
Python
apache-2.0
10,565
# *************************************************************************** # * * # * Copyright (c) 2013 - Juergen Riegel <[email protected]> * # * * # * Th...
chrisjaquet/FreeCAD
src/Mod/Fem/_TaskPanelMechanicalMaterial.py
Python
lgpl-2.1
15,130
# coding: utf-8 from __future__ import unicode_literals import itertools import json import os.path import random import re import time import traceback from .common import InfoExtractor, SearchInfoExtractor from ..jsinterp import JSInterpreter from ..swfinterp import SWFInterpreter from ..compat import ( compa...
rrooij/youtube-dl
youtube_dl/extractor/youtube.py
Python
unlicense
137,741
try: from django.conf.urls import patterns, include, url except: from django.conf.urls.defaults import patterns, include, url from cacheops.views import cacheops_stats urlpatterns = patterns( '', url('^cacheops/stats/$', cacheops_stats, name='cacheops_stats'), )
Tapo4ek/django-cacheops
cacheops/urls.py
Python
bsd-3-clause
281
t = range(100) r = [] for i in t: if i>5: r.append(i) r = [i for i in t if i > 30 and i%2!=0] print(r)
MortalViews/python-notes
example2.py
Python
apache-2.0
133
data = [ { "name": "test_signin", "url": "/api/users/signin/", "method": "post", "payload": { "account": "admin", "password": "admin" }, "response_status": 200, "response_data": { "msg": {"isADMIN": True, "isLOGIN": True, "a...
Tocknicsu/nctuoj_contest
test/api/user/signin.py
Python
apache-2.0
1,200
''' WARNING NEED TO SET A TEMP DIRECTORY!!!!!! (dirname line 21) RUN WITH : mpiexec -n 4 python test_hier_GMM_mpi.py Created on Sep 17, 2014 @author: jonaswallin mpiexec -n 4 python test_hier_GMM.py ''' import unittest import BayesFlow as bm import numpy as np import scipy.linalg as spl from BayesFlow.PurePython.dis...
JonasWallin/BayesFlow
tests/test_hier_GMM_mpi.py
Python
gpl-2.0
2,960
# Flexlay - A Generic 2D Game Editor # Copyright (C) 2014 Ingo Ruhnke <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
SuperTux/flexlay
flexlay/wip/bitmap_layer.py
Python
gpl-3.0
2,798
# Copyright (c) 2014 Stefano Palazzo <[email protected]> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # Thi...
sfstpala/hello
hello/__main__.py
Python
gpl-3.0
1,225
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six import warnings from . import config from .table import Table # Module API def infer(source, headers=1, limit=100, confidence=0.75, ...
datapackages/jsontableschema-py
tableschema/infer.py
Python
mit
1,788
# SPDX-License-Identifier: MIT """ Interface for fields parsers. Parsers are basic modules used for extracting data. They are responsible for parsing invoice text using specified settings. Depending on a parser and settings it may be e.g.: 1. Looking for a single value 2. Grouping multiple occurences (e.g. summing up...
manuelRiel/invoice2data
src/invoice2data/extract/parsers/__interface__.py
Python
mit
690
# 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 u...
Laurawly/tvm-1
python/tvm/micro/transport.py
Python
apache-2.0
9,424
# Copyright 2009-2010 10gen, 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 writing,...
couchbaselabs/litmus
lib/pymongo/database.py
Python
apache-2.0
28,121
#!/usr/bin/env python # # # This file is part of do_x3dna # # Author: Rajendra Kumar # Copyright (C) 2014-2018 Rajendra Kumar # # do_x3dna uses 3DNA package (http://x3dna.org). # Please cite the original publication of the 3DNA package: # Xiang-Jun Lu & Wilma K. Olson (2003) # 3DNA: a software package for the analysis...
rjdkmr/do_x3dna
dnaMD/dnaMD/commands/histogram.py
Python
gpl-3.0
10,643
""" Support for reading and writing genomic intervals from delimited text files. """ import sys from itertools import * from bx.tabular.io import * from bx.bitset import * class MissingFieldError( ParseError ): pass class FieldFormatError( ParseError ): def __init__( self, *args, **kwargs): ParseErro...
uhjish/bx-python
lib/bx/intervals/io.py
Python
mit
5,494
import os from django import template from django.template import Template, TemplateSyntaxError, TemplateDoesNotExist from django.template.loader_tags import ExtendsNode from django.template.loader import find_template_loader register = template.Library() class OverExtendsNode(ExtendsNode): """ Allows the...
wlanslovenija/django-overextends
overextends/templatetags/overextends_tags.py
Python
bsd-2-clause
5,740
class GameMenu(object): def __init__(self, menu_name, **options): self.menu_name = menu_name self.options = options
Jazende/Jaztroids
gamemenu.py
Python
gpl-3.0
156
class Dynamics: """ a convenience class containing some dynamics """ ppppp = 10 pppp = 20 ppp = 30 pp = 40 p = 60 mp = 80 mf = 90 f = 100 ff = 110 fff = 120 ffff = 127 @classmethod def from_string(cls, thestring): """ :param thestring: a ...
shimpe/expremigen
expremigen/musicalmappings/dynamics.py
Python
gpl-3.0
904
# Copyright (C) 2011-2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but...
nuxeh/morph
morphlib/app.py
Python
gpl-2.0
18,786
from redisdeploy import reddeploy
drptbl/nosqlpot
redispot/__init__.py
Python
gpl-2.0
34
#!/bin/python from datetime import timedelta import json from sqlalchemy.sql import func import Monstr.Core.Utils as Utils import Monstr.Core.DB as DB import Monstr.Core.BaseModule as BaseModule from Monstr.Core.DB import Column, BigInteger, Integer, String, DateTime import pytz class PhedexTransfers(BaseModule.Bas...
tier-one-monitoring/monstr
Monstr/Modules/PhedexTransfers/PhedexTransfers.py
Python
apache-2.0
7,245
""" WSGI config for lemur 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/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTING...
vvk-me/LEMuR
lemur/wsgi.py
Python
gpl-2.0
387
from unittest import TestCase from mock import patch from pulp.server.db.migrate.models import _import_all_the_way PATH_TO_MODULE = 'pulp_puppet.plugins.migrations.0004_standard_storage_path' migration = _import_all_the_way(PATH_TO_MODULE) class TestMigrate(TestCase): """ Test migration 0004. """ ...
ammaritiz/pulp_puppet
pulp_puppet_plugins/test/unit/plugins/migrations/test_0004_standard_storage_path.py
Python
gpl-2.0
1,392
# -*- coding: utf-8 -*- from django.conf import settings from django.utils.timezone import utc from hellosign import HelloSigner, HelloDoc from hellosign import (HelloSignSignature, HelloSignEmbeddedDocumentSignature, HelloSignEmbeddedDocumentSigningUrl, ...
rosscdh/django-hello_sign
hello_sign/services.py
Python
mit
8,892
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from setuptools import setup import sys # Python version if sys.version_info[:2] < (3, 3): print('PyFR requires Python 3.3 or newer') sys.exit(-1) # PyFR version vfile = open('pyfr/_version.py').read() vsrch = re.search(r"^__version__ = ['\"]([^'\"]*)[...
Aerojspark/PyFR
setup.py
Python
bsd-3-clause
3,986
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [email protected], All rights reserved. # LLNL-CODE-64...
EmreAtes/spack
var/spack/repos/builtin/packages/r-mlinterfaces/package.py
Python
lgpl-2.1
2,486
"""sapl URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based ...
cmjatai/cmj
sapl/urls.py
Python
gpl-3.0
2,737
import os from configurations import Configuration BASE_DIR = os.path.dirname(os.path.dirname(__file__)) class Common(Configuration): DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Jon Payne', '[email protected]'), ('PK Shiu', '[email protected]'), ) MANAGERS = ADMINS DEFAULT...
ayseyo/oclapi
django-nonrel/ocl/oclapi/settings/common.py
Python
mpl-2.0
10,523
#-*- coding:utf-8 -*- """ This file is part of openexp. openexp 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. openexp is distributed in ...
amazinger2013/OpenSesame
openexp/sampler.py
Python
gpl-3.0
1,933
# # NEPI, a framework to manage network experiments # Copyright (C) 2014 INRIA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
phiros/nepi
src/nepi/resources/ns3/ns3simulation.py
Python
gpl-3.0
1,716
from twilio.twiml.voice_response import Connect, VoiceResponse, Room response = VoiceResponse() connect = Connect() connect.autopilot('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') response.append(connect) print(response)
TwilioDevEd/api-snippets
twiml/voice/connect/autopilot/connect-1.6.x.py
Python
mit
215
# Copyright (C) 2018 The Photogal Team. # # This file is part of Photogal. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
jsamarziya/photogal
src/photogal/__init__.py
Python
gpl-3.0
3,235
#! /usr/bin/env python # -*- coding: UTF-8 -*- """ Crawler ========= Give an APP-CATEGORY, it should try crawling the app store for similar applications in the category and compile the links of the applications into a text file, that can then be used in the Scraper.py script for extracting the requisite features. app...
seekshreyas/obidroid
crawler.py
Python
mit
2,889
# Power functions for Systems Management Ultra Thin Layer # # Copyright 2017 IBM Corp. # # 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/LICE...
mfcloud/python-zvm-sdk
smtLayer/powerVM.py
Python
apache-2.0
31,081
import logging import importlib def convert_to_common_format(entry): format_fn = get_formatter(entry) return format_fn(entry) def get_formatter(entry): module_name = get_module_name(entry.metadata) logging.debug("module_name = %s" % module_name) module = importlib.import_module(module_name) ...
joshzarrabi/e-mission-server
emission/net/usercache/formatters/formatter.py
Python
bsd-3-clause
536
# -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2016 Ivo Tzvetkov # # 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 ri...
ivotkv/udplogger
udplogger/__init__.py
Python
mit
1,207
__author__ = 'mk' import matplotlib.pyplot as plt import sys import math import numpy as np dataDir = sys.argv[1] resDir = sys.argv[2] plt.figure(figsize=(8,4)) algLabel=['naive','cou','zigzag','pingpong','MK','LL'] for i in range(0,6,1): filePath = dataDir + str(i) + '_overhead.dat' file = open(filePath) ...
bombehub/SEconsistent
diagrams/overhead_savePDF.py
Python
gpl-3.0
699
from Tkinter import * from classes import Helpers from time import time import Queue import tkFileDialog import datetime class GUI: def __init__(self, tk, threadedTasks): self.tk = tk self.threadedTasks = threadedTasks self.keepCheckingWirelessStrength = False self.goFrameBuilt = F...
alexdevmotion/UnifiedEegLogger
classes/Gui.py
Python
apache-2.0
11,269
from models.team import Team from models.tournament import Tournament from models.tree import ProbableTournamentTree import unittest import pdb class TestTeam(unittest.TestCase): def setUp(self): self.tournament = Tournament() self.teams = self.tournament.teams self.usa = Team.get_for_coun...
steinbachr/world-cup-challenge
tests/test_models.py
Python
mit
3,657
from django.db import models from django.contrib.auth.models import User # TODO: Want user model with pk=username for /api/users/{pk}/ detail-route class Comment(models.Model): user = models.ForeignKey(User, related_name='comments') text = models.CharField(max_length=255) created = models.DateTimeField(au...
ssalka/django-node
django/core/models.py
Python
mit
347
# -*- coding: utf-8 -*- # © 2016 Antiun Ingenieria S.L. - Javier Iniesta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models
Endika/manufacture
mrp_sale_info/__init__.py
Python
agpl-3.0
165
# Copyright (C) 2009 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
Debian/openjfx
modules/web/src/main/native/Tools/Scripts/webkitpy/common/config/committers_unittest.py
Python
gpl-2.0
20,071
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext from frappe.utils import flt from frappe.utils.make_random import get_random from erpnext.projects.doctype.timesheet.test_timesh...
ESS-LLP/erpnext-healthcare
erpnext/demo/user/projects.py
Python
gpl-3.0
3,509
import tensorflow as tf """tf.squared_difference(x,y,name=None) 功能:计算(x-y)(x-y)。 输入:x为张量,可以为`half`,`float32`, `float64`类型。""" x = tf.constant([[-1, 0, 2]], tf.float64) y = tf.constant([[2, 3, 4, ]], tf.float64) z = tf.squared_difference(x, y) sess = tf.Session() print(sess.run(z)) sess.close() # z==>[[9. 9. 4.]]
Asurada2015/TFAPI_translation
math_ops_basicoperation/tf_squared_difference.py
Python
apache-2.0
355
from django.urls import path from .views import moderation_view urlpatterns = [ path("", moderation_view, name="problem-moderation"), ]
fin/froide
froide/problem/moderation_urls.py
Python
mit
143
# encoding: utf8 import unittest import time import logging from henet.workers import MemoryWorkers from henet import logger def boom(): raise Exception('ok') class TestMemoryWorkers(unittest.TestCase): def setUp(self): self.workers = MemoryWorkers(size=1) logger.setLevel(logging.CRITICAL) ...
AcrDijon/henet
henet/tests/test_workers.py
Python
apache-2.0
1,320
#!/usr/bin/env python # # 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 requir...
googleads/googleads-python-lib
examples/adwords/v201809/advanced_operations/add_ad_customizer.py
Python
apache-2.0
8,193
from zipfile import ZipFile, ZIP_DEFLATED from tempfile import NamedTemporaryFile from pydap.handlers.hdf5 import HDF5Handler from webob.request import Request from webob.exc import HTTPBadRequest import numpy as np import numpy.testing import pytest from pydap.model import GridType, BaseType, DatasetType from pydap...
pacificclimate/pydap.responses.aaigrid
tests/test_stuff.py
Python
gpl-3.0
4,927
# Copyright 2016-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
kapilt/cloud-custodian
tests/test_iam.py
Python
apache-2.0
57,562
from markdown.util import etree import logging log = logging.getLogger(__name__) import MooseDocs from markdown.inlinepatterns import Pattern from MooseCommonExtension import MooseCommonExtension class MoosePackageParser(MooseCommonExtension, Pattern): """ Markdown extension for extracting package arch and versio...
paulthulstrup/moose
python/MooseDocs/extensions/MoosePackageParser.py
Python
lgpl-2.1
1,625
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # 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.apach...
eltonkevani/tempest_el_env
tempest/api/volume/admin/test_volume_types_extra_specs.py
Python
apache-2.0
3,701
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2015-2016 Nervana Systems 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 #...
Jokeren/neon
examples/rnn_copy.py
Python
apache-2.0
2,625
from __future__ import absolute_import, unicode_literals from six import add_metaclass, text_type from .event_encoder import Parameter, EventEncoder @add_metaclass(EventEncoder) class Event(object): hit = Parameter('t', text_type, required=True) category = Parameter('ec', text_type, required=True) acti...
enthought/python-analytics
python_analytics/events.py
Python
bsd-3-clause
583
class NestedCheckpointError(RuntimeError): pass class CheckpointNeeded(RuntimeError): pass class InvalidTaskwarriorConfiguration(RuntimeError): pass class TrelloObjectRecentlyModified(RuntimeError): pass
coddingtonbear/inthe.am
inthe_am/taskmanager/exceptions.py
Python
agpl-3.0
226
import collections from sets import Set from Drawer import Drawer class Cultivar(): def __init__(self, id, name, year): self.id = id self.name = name self.year = year self.parent1 = None self.parent2 = None # row index starts from 0 self.row = 0 # column index starts from 0 self...
lindenquan/draw-pedigree
Generator.py
Python
mit
6,647
from navmazing import NavigateToAttribute, NavigateToSibling from widgetastic.utils import Parameter, VersionPick, Version from widgetastic.widget import ParametrizedView, Table, Text, View from widgetastic_patternfly import Input, BootstrapSelect, Dropdown, Button, CandidateNotFound, Tab from cfme.base.login import B...
quarckster/cfme_tests
cfme/services/myservice/ui.py
Python
gpl-2.0
13,488
import datetime from django.db import models from shops.models import Shop from django.utils.translation import ugettext_lazy as _ class AuctionSession(models.Model): shop = models.ForeignKey(Shop) title = models.CharField(max_length=60) description = models.TextField() start = models.DateTimeField()...
StephenPower/CollectorCity-Market-Place
stores/apps/auctions/models.py
Python
apache-2.0
1,205
__author__ = 'makarenok' from model.contact import Contact import random def test_delete_some_contact(app, db, check_ui): if len(db.get_contact_list()) == 0: app.contact.create(Contact(firstname="testFirstName", lastname="testLastName")) old_contacts = db.get_contact_list() contact = random.choic...
ek-makarenok/my_homework_1_1
test/test_del_contact.py
Python
apache-2.0
694
#!/usr/bin/env python import argparse import eutils if __name__ == '__main__': parser = argparse.ArgumentParser(description='EInfo', epilog='') parser.add_argument('--db', help='Database to use') parser.add_argument('--user_email', help="User email") parser.add_argument('--admin_email', help="Admin e...
yhoogstrate/tools-iuc
tools/ncbi_entrez_eutils/einfo.py
Python
mit
579
#!/usr/bin/env python import struct def _round2(n): k = 1 while k < n: k <<= 1 return k >> 1 def _leaf_hash(hash_fn, leaf): return hash_fn(b'\x00' + leaf).digest() def _pair_hash(hash_fn, left, right): return hash_fn(b'\x01' + left + right).digest() class InclusionProof: """ Rep...
Yukarumya/Yukarum-Redfoxes
testing/mozharness/mozharness/mozilla/merkle.py
Python
mpl-2.0
6,058
from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty,\ ObjectProperty from kivy.vector import Vector from kivy.clock import Clock from random import randrange class PongPaddle(Widget): score = NumericProperty(0) def bounce_ball(self, ball):...
triump0870/Kivy_Python
Pong/main.py
Python
mpl-2.0
2,204
import dson import pytest from dson._compact import xrange class DSONTestObject(object): pass def test_listrecursion(): x = [] x.append(x) pytest.raises(ValueError, dson.dumps, x) x = [] y = [x] x.append(y) pytest.raises(ValueError, dson.dumps, x) y = [] x = [y, y] # en...
soasme/dogeon
tests/test_recursion.py
Python
mit
2,529
#!/usr/bin/python # Copyright: (c) 2017, Dag Wieers (@dagwieers) <[email protected]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
dlazz/ansible
lib/ansible/modules/cloud/vmware/vcenter_license.py
Python
gpl-3.0
5,363
# =============================================================================== # Copyright (c) 2014 Geoscience Australia # 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...
alex-ip/agdc
api/source/main/python/datacube/api/__init__.py
Python
bsd-3-clause
6,195
""" https://leetcode.com/explore/interview/card/top-interview-questions-hard/116/array-and-strings/827/ """ from unittest import TestCase from kevin.leet.product_except_self import Solution, SolutionOptimized class TestProductExceptSelf(TestCase): def _base_test_product_except_self(self, nums, expected): ...
kalyons11/kevin
kevin/tests/leet/test_product_except_self.py
Python
mit
678
#/bin/python3 # -*- coding: utf-8 -*- from namedtuplewithdefaults import namedtuple_with_defaults from score import selectBestWithFlag def dictFromArgs(**kwargs): return kwargs def _noneOrInt(val): if val is None: return None return int(val) def _noneOrInt10(val): if val is None: ret...
endlisnis/weather-records
daydata.py
Python
gpl-3.0
4,847
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2019-05-06 16:17 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('indicators', '0056_merge_20190429_0955'), ('indicators', '0056_add_verbose_names_to_indicato...
mercycorps/TolaActivity
indicators/migrations/0057_merge_20190506_0917.py
Python
apache-2.0
364
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-11 22:01 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0011_dropoff_locations_pickup_locations'), ] operations = [ migrations.RenameF...
NiJeLorg/paratransit_api
paratransit/api/migrations/0012_auto_20170511_2201.py
Python
mit
893
# Generated by Django 2.0.7 on 2018-07-15 10:40 from django.db import migrations class GroupNotificationType(object): WEEKLY_SUMMARY = 'weekly_summary' DAILY_ACTIVITY_NOTIFICATION = 'daily_activity_notification' NEW_APPLICATION = 'new_application' def enable_new_application_notifications(apps, schema_e...
yunity/foodsaving-backend
karrot/groups/migrations/0031_add_default_notification_20180715_1040.py
Python
agpl-3.0
940
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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, either version 3 of the...
InakiZabala/odoomrp-wip
sale_mrp_project_link/__openerp__.py
Python
agpl-3.0
1,389
#Ex4-6 Copyright Yifei #Check whether the number is a prime number or not. n=input("Enter a number: ") prime=False if n<=1: prime=False for i in range(2,n-1): if n%i==0: prime=False break else: i=i+1 prime=True if prime: print n," is a prime number" else: print n," is...
Lesaria/Interview
Intro2Program4.py
Python
gpl-3.0
341
# Copyright (c) 2011-2013 Andreas Sembrant # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # - Redistributions of source code must retain the above copyright # notice, this list of conditi...
uart/scarphase
pyscarphase/plot/color.py
Python
bsd-3-clause
1,885
import os import torch from torch import distributed as dist from torch import multiprocessing as mp import distributed as dist_fn def find_free_port(): import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(("", 0)) port = sock.getsockname()[1] sock.close() retu...
ECP-CANDLE/Benchmarks
examples/histogen/distributed/launch.py
Python
mit
2,506
# -*- coding: iso-8859-1 -*- # mosq.py # Implementation of the square-law MOS transistor model # Copyright 2012 Giuseppe Venturini # # This file is part of the ahkab simulator. # # Ahkab is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
leojohnthomas/ahkab
mosq.py
Python
gpl-2.0
18,308
""" Objects imported here will live in the `pycollocation.solvers` namespace """ from . over_identified import LeastSquaresSolver from . solvers import Solver, SolverLike from . solutions import SolutionLike, Solution __all__ = ["LeastSquaresSolver", "Solver", "Solution", "SolutionLike", "SolverLike"]
davidrpugh/pyCollocation
pycollocation/solvers/__init__.py
Python
mit
316
import re import click import six from httpie.context import Environment from httpie.core import main as httpie_main from parsimonious.exceptions import ParseError, VisitationError from parsimonious.grammar import Grammar from parsimonious.nodes import NodeVisitor from six import BytesIO from six.moves.urllib.parse i...
Yegorov/http-prompt
http_prompt/execution.py
Python
mit
11,589
import argparse from pdbfetcher import PDBFetcher def main(args): fetcher = PDBFetcher(temp_dir=args.temp_dir) pdb = fetcher.get('1hv4') return pdb def entry_point(): parser = argparse.ArgumentParser() parser.add_argument('-d', dest='temp_dir', default=None, help='temporary directory t...
schwancr/pdbfetcher
scripts/get_pdb.py
Python
mit
454
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging from ...
digwanderlust/pants
tests/python/pants_test/backend/jvm/tasks/test_scalastyle.py
Python
apache-2.0
10,123
import os import sys # Set PYBLISH_SAFE to enable verbose checks os.environ['PYBLISH_SAFE'] = "1" # Expose pyblish-rpc to PYTHONPATH test_path = os.path.realpath(__file__) repo_dir = os.path.dirname(test_path) package_path = os.path.join(repo_dir, "pyblish_rpc") sys.path.insert(0, package_path) import pyblish_rpc py...
BigRoy/pyblish-rpc
run_testsuite.py
Python
lgpl-3.0
581
import os from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.bcrypt import Bcrypt from flask_sockets import Sockets app = Flask(__name__, static_folder="../static/dist", template_folder="../static") if os.environ.get('PRODUCTION'): app.config.from_object('config.ProductionConfig')...
mortbauer/webapp
application/__init__.py
Python
mit
444
# -*- coding: utf-8 -*- # $Id$ # # Copyright (c) 2013 Otto-von-Guericke University Magdeburg # # This file is part of ECSpooler. # """ Created on 28.03.2013 @author: amelung """ import os import sys import time DEFAULT_HOST = '0.0.0.0' RESTART_WAIT_TIME = 3 class ServiceControl(object): """ """ @sta...
collective/ECSpooler
lib/util/servicecontrol.py
Python
gpl-2.0
3,293
import piece from random import choice class GameOver(BaseException): pass class Board(object): def __init__(self): self.rows = tuple(tuple('#' for j in xrange(10)) for j in xrange(20)) self.rows_ = self.rows self.current = None self.tick_no = 0 def tick(self): t...
stestagg/gitdojo
tetris/board.py
Python
mit
1,404