repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
carlcarl/rcard
waterfall_wall/models.py
1
1158
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free ...
mit
ccellis/WHACK2016
flask/lib/python2.7/site-packages/sqlalchemy/orm/deprecated_interfaces.py
55
18254
# orm/deprecated_interfaces.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .. import event, util from .interfaces import EXT_CONTINUE @util...
bsd-3-clause
rghe/ansible
lib/ansible/modules/cloud/amazon/ecs_service_facts.py
43
8729
#!/usr/bin/python # Copyright: Ansible Project # 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', 'status': ['preview'], ...
gpl-3.0
cngo-github/nupic
tests/unit/nupic/research/connections_test.py
25
7608
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
16
12394
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals from ..grant_types import OpenIDConnectAuthCode from ..tokens import BearerTo...
apache-2.0
highweb-project/highweb-webcl-html5spec
third_party/cython/python_flags.py
53
1266
# Copyright 2014 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 argparse import os import sys import sysconfig def main(): """Command line utility to retrieve compilation options for python modules' """ pars...
bsd-3-clause
Intel-Corporation/tensorflow
tensorflow/python/keras/metrics_test.py
2
80501
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
sjotterman/python_koans
python2/koans/about_lists.py
54
2995
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutArrays in the Ruby Koans # from runner.koan import * class AboutLists(Koan): def test_creating_lists(self): empty_list = list() self.assertEqual(list, type(empty_list)) self.assertEqual(__, len(empty_list)) def test_lis...
mit
abhishekgahlot/scikit-learn
examples/exercises/plot_iris_exercise.py
323
1602
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
bsd-3-clause
berendkleinhaneveld/VTK
ThirdParty/Twisted/twisted/test/test_plugin.py
41
24635
# Copyright (c) 2005 Divmod, Inc. # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for Twisted plugin system. """ import sys, errno, os, time import compileall from zope.interface import Interface from twisted.trial import unittest from twisted.python.log import textFromEventDict, a...
bsd-3-clause
suyashphadtare/vestasi-erp-final
erpnext/buying/doctype/quality_inspection/quality_inspection.py
37
1831
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class QualityInspection(Document): def get_item_specification_details(self): self.set...
agpl-3.0
guangyue/sslyze
utils/ServersConnectivityTester.py
6
8391
#!/usr/bin/env python #------------------------------------------------------------------------------- # Name: ServersConnectivityTester.py # Purpose: Initial checks to figure out which servers supplied by the # user are actually reachable. # # Author: alban # # Copyright: 2013 SSLyz...
gpl-2.0
BT-rmartin/odoo
addons/email_template/wizard/__init__.py
446
1130
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
dvitme/odoomrp-wip
procurement_sale_forecast/wizard/make_procurement.py
24
1517
# -*- 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...
agpl-3.0
Asana/boto
boto/swf/layer2.py
130
13056
"""Object-oriented interface to SWF wrapping boto.swf.layer1.Layer1""" import time from functools import wraps from boto.swf.layer1 import Layer1 from boto.swf.layer1_decisions import Layer1Decisions DEFAULT_CREDENTIALS = { 'aws_access_key_id': None, 'aws_secret_access_key': None } def set_default_credential...
mit
stuartarchibald/numba
numba/tests/test_threadsafety.py
7
2787
""" Test threadsafety for compiler. These tests will cause segfault if fail. """ import threading import random import numpy as np from numba import jit, vectorize, guvectorize from numba.tests.support import temp_directory, override_config from numba.core import config import unittest def foo(n, v): return np...
bsd-2-clause
tboyce1/home-assistant
homeassistant/components/sensor/mqtt_room.py
7
5170
""" Support for MQTT room presence detection. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.mqtt_room/ """ import asyncio import logging import json from datetime import timedelta import voluptuous as vol import homeassistant.components.mqtt as...
apache-2.0
BT-ojossen/odoo
addons/resource/resource.py
3
42967
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP SA (http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
opbeat/django-oauth2-provider
tests/settings.py
15
1878
# Django settings for example project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Tester', 'test@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'N...
mit
kawasaki2013/python-for-android-x86
python-build/python-libs/gdata/src/gdata/Crypto/Util/test.py
228
18297
# # test.py : Functions used for testing the modules # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitn...
apache-2.0
kanagasabapathi/python-for-android
python3-alpha/python3-src/Tools/scripts/nm2def.py
97
2451
#! /usr/bin/env python3 """nm2def.py Helpers to extract symbols from Unix libs and auto-generate Windows definition files from them. Depends on nm(1). Tested on Linux and Solaris only (-p option to nm is for Solaris only). By Marc-Andre Lemburg, Aug 1998. Additional notes: the output of nm is supposed to look like t...
apache-2.0
sighingnow/Spider-Utils
zhihu-topic-tree/spider-zhihu.py
1
2395
#! /usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'He Tao' ''' Zhihu Spider. ''' import gzip import json import re from http.client import HTTPConnection from html.parser import HTMLParser ## http://www.zhihu.com/topic/19776749 spider = { ## config. 'host': 'www.zhihu.com', ...
mit
irvind/hyper
hyper/http11/connection.py
5
12243
# -*- coding: utf-8 -*- """ hyper/http11/connection ~~~~~~~~~~~~~~~~~~~~~~~ Objects that build hyper's connection-level HTTP/1.1 abstraction. """ import logging import os import socket import base64 from collections import Iterable, Mapping from .response import HTTP11Response from ..tls import wrap_socket, H2C_PROT...
mit
mustafat/odoo-1
openerp/addons/base/tests/test_orm.py
51
18257
from collections import defaultdict from openerp.tools import mute_logger from openerp.tests import common UID = common.ADMIN_USER_ID class TestORM(common.TransactionCase): """ test special behaviors of ORM CRUD functions TODO: use real Exceptions types instead of Exception """ def setUp(self):...
agpl-3.0
blueboxgroup/neutron
neutron/tests/unit/bigswitch/test_base.py
8
3414
# Copyright 2013 Big Switch Networks, 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 appl...
apache-2.0
ppwwyyxx/tensorflow
tensorflow/lite/testing/op_tests/mirror_pad.py
4
3626
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
rgommers/statsmodels
statsmodels/stats/tests/results/results_proportion.py
34
3568
# -*- coding: utf-8 -*- """ Created on Fri Mar 01 14:48:59 2013 Author: Josef Perktold """ import collections import numpy as np class Holder(object): pass # numbers from R package `pwr` pwr.chisq.test res_binom = collections.defaultdict(Holder) res_binom_methods = ["agresti-coull", "asymptotic", "bayes", "c...
bsd-3-clause
havard024/prego
venv/lib/python2.7/site-packages/django/contrib/auth/tests/views.py
19
22818
import os import re from django.conf import global_settings, settings from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.core import mail from django.core.exceptions import SuspiciousOperation from django.core.urlresolvers import reverse, NoReverseMatch fr...
mit
rhertzog/django
django/core/cache/backends/db.py
480
8628
"Database cache backend." import base64 from datetime import datetime from django.conf import settings from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.db import DatabaseError, connections, models, router, transaction from django.utils import six, timezone from django.utils.encoding i...
bsd-3-clause
scylladb/scylla-cluster-tests
sdcm/utils/docker_remote.py
1
3898
import logging from sdcm.cluster import BaseNode LOGGER = logging.getLogger(__name__) class RemoteDocker(BaseNode): def __init__(self, node, image_name, ports=None, command_line="tail -f /dev/null", extra_docker_opts=""): # pylint: disable=too-many-arguments self.node = node self._internal_ip_ad...
agpl-3.0
tobspr/panda3d
direct/src/leveleditor/CurveEditor.py
6
5908
""" This is the module for curve edit """ from pandac.PandaModules import * from direct.wxwidgets.WxPandaShell import * from direct.showbase.DirectObject import * from direct.directtools.DirectSelection import SelectionRay from direct.showutil.Rope import Rope from .ActionMgr import * from direct.task import Task cl...
bsd-3-clause
daviewales/wollondillyanglican
deployconf.py
1
1208
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'Wollondilly Anglican Parish' SITENAME = 'Wollondilly Anglican Churches' SITEURL = 'http://www.wollondillyanglican.tk' PATH = 'content' STATIC_PATHS = ['images', 'extra/CNAME'] EXTRA_PATH_METADATA = {'extra/CNAME': {'pat...
apache-2.0
pabloest/piradio
lcd_i2c_class.py
1
6150
#!/usr/bin/env python # # LCD test program for the lcd_i2c_class.py class # $Id: lcd_i2c_class.py,v 1.2 2014/10/05 08:38:31 bob Exp $ # Use this program to test I2C Backpack LCD wiring # Adapted from RpiLcdBackpack from Paul Knox-Kennedy # at Adafruit Industries # # Author : Bob Rathbone # Site : http://www.bobrathbon...
gpl-3.0
scollis/iris
lib/iris/tests/runner/_runner.py
1
3987
# (C) British Crown Copyright 2010 - 2014, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
gpl-3.0
caphrim007/ansible
docs/bin/dump_keywords.py
52
3103
#!/usr/bin/env python import optparse import re from distutils.version import LooseVersion import jinja2 import yaml from jinja2 import Environment, FileSystemLoader from ansible.module_utils._text import to_bytes from ansible.playbook import Play from ansible.playbook.block import Block from ansible.playbook.role i...
gpl-3.0
mmagnus/rna-pdb-tools
rna_tools/tools/clarna_play/ClaRNAlib/fabfile.py
2
98501
import re,os,sys,time,itertools,tempfile from datetime import datetime from xml.dom import minidom from fabric.api import * from fabric.contrib import files import hashlib import imp # sys.path.append('../clarna') from utils import PDBObject,FileNamesObject # env['hosts']=['twalen@rnacontacts-vm'] # zgodnie z http://...
gpl-3.0
suzp1984/django-tutorial
tryDjango/tryDjango/urls.py
1
1065
"""tryDjango 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-b...
apache-2.0
shipci/boto
tests/unit/vpc/test_subnet.py
113
5485
from tests.compat import OrderedDict from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, Subnet class TestDescribeSubnets(AWSMockServiceTestCase): connection_class = VPCConnection def default_body(self): return b""" <Describe...
mit
abhikumar22/MYBLOG
blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py
582
1168
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_legacy_name(apps, schema_editor): ContentType = apps.get_model('contenttypes', 'ContentType') for ct in ContentType.objects.all(): try: ct.name = apps.get_model(ct.app_label, c...
gpl-3.0
adedayo/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/kernel32.py
102
164818
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
apache-2.0
lucasea777/python-gsmmodem
docs/conf.py
11
8062
# -*- coding: utf-8 -*- # # python-gsmmodem documentation build configuration file, created by # sphinx-quickstart on Sun Aug 11 20:50:25 2013. # # 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....
lgpl-3.0
shashwatak/SatPIC
sat_math_utils.py
1
16970
from math import sin, cos, asin, atan2, modf, pi, sqrt # Sidereal Time def current_GMST(now): # Method from TS Kelso's paper "Orbital Coordinate Systems Part II" # http://celestrak.com/columns/v02n02/ # Also, this page: http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html # theta_g(tau) = theta_g(0h...
mit
prculley/gramps
gramps/gui/merge/mergefamily.py
5
9988
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Michiel D. Nauta # # 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...
gpl-2.0
romanchyla/pylucene-trunk
samples/LuceneInAction/lia/analysis/synonym/SynonymAnalyzer.py
2
1421
# ==================================================================== # 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 re...
apache-2.0
Lujeni/ansible
lib/ansible/modules/network/panos/_panos_restart.py
41
2976
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.com> # # 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 publish...
gpl-3.0
damianavila/nikola
nikola/plugins/command/__init__.py
3
1141
# -*- coding: utf-8 -*- # Copyright © 2012-2013 Roberto Alsina and others. # 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 t...
mit
DDEFISHER/servo
components/script/dom/bindings/codegen/parser/tests/test_usvstring.py
142
1388
# -*- coding: UTF-8 -*- import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestUSVString { attribute USVString svs; }; """) results = parser.finish(); harness.check(len(results), 1, "Should be one production") harness.ok(isinstance(results[0], Web...
mpl-2.0
gundalow/ansible-modules-extras
monitoring/zabbix_host.py
10
22624
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
gpl-3.0
ATIX-AG/ansible
lib/ansible/modules/storage/netapp/na_cdot_svm.py
72
8258
#!/usr/bin/python # (c) 2017, NetApp, Inc # 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', 'status': ['preview'], ...
gpl-3.0
citrix-openstack-build/trove
trove/tests/unittests/guestagent/test_manager.py
2
8507
# 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 l...
apache-2.0
Innovahn/odoo.old
addons/note/note.py
153
8900
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
OpenWinCon/OpenWinNet
web-gui/myvenv/lib/python3.4/site-packages/django/db/models/sql/constants.py
633
1039
""" Constants specific to the SQL storage portion of the ORM. """ import re # Valid query types (a set is used for speedy lookups). These are (currently) # considered SQL-specific; other storage systems may choose to use different # lookup types. QUERY_TERMS = { 'exact', 'iexact', 'contains', 'icontains', 'gt', '...
apache-2.0
stefanv/aandete
app/lib/paste/auth/cookie.py
50
16379
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ Cookie "Saved" Authentication This authentication middleware saves the curren...
bsd-3-clause
elshobaky/MeX-LMS
gui/bookedit.py
1
13797
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'gui/bookedit.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(...
gpl-3.0
rajadhva/servo
tests/wpt/update.py
144
1048
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import sys from wptrunner import wptcommandline here = os.path.split(__file__)[0] def wpt_path(*args): ...
mpl-2.0
CaseyNord/Treehouse
Python Collections/dungeon_game_first_attempt.py
1
2790
import random # check for win/loss # clear screen and redraw grid CELLS = [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (0, 2), (1, 2), (2, 2), (3, 2), (4, 2), (0, 3), (1, 3), (2, 3), (3, 3), (4, 3), (0, 4), (1, 4), (2, 4), (3, 4), (4, 4)...
mit
dq922/PerfKitExplorer
server/perfkit/explorer/model/settings.py
2
1391
"""Copyright 2014 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 agreed to in ...
apache-2.0
mangelajo/python-neutronclient
neutronclient/tests/unit/test_utils.py
5
4368
# Copyright (C) 2013 Yahoo! 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 ...
apache-2.0
elventear/ansible
lib/ansible/modules/network/junos/junos_rpc.py
10
4539
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
ArcEye/machinekit-testing
src/hal/user_comps/hal_temp_ads7828.py
12
3854
#!/usr/bin/python # encoding: utf-8 """ Temperature.py Created by Alexander Rössler on 2014-03-24. """ from drivers.ADS7828 import ADS7828 from fdm.r2temp import R2Temp import argparse import time import sys import hal class Pin: def __init__(self): self.pin = 0 self.r2temp = None self...
lgpl-2.1
HiroIshikawa/21playground
thumblelog/myproject/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
mit
minrk/nbgrader
nbgrader/preprocessors/saveautogrades.py
2
2726
from .. import utils from ..api import Gradebook from . import NbGraderPreprocessor class SaveAutoGrades(NbGraderPreprocessor): """Preprocessor for saving out the autograder grades into a database""" def preprocess(self, nb, resources): # pull information from the resources self.notebook_id =...
bsd-3-clause
lowiki-org/localwiki-backend-server
localwiki/maps/tests/test_api.py
3
13785
import json from rest_framework import status from guardian.shortcuts import assign_perm, remove_perm from django.contrib.auth.models import User, Group from django.conf import settings from django.contrib.gis.geos import GEOSGeometry from main.api.test import APITestCase from regions.models import Region, BannedFro...
gpl-2.0
Vincentyao1995/Globalink2017-UBC
David_Zhu/test4.py
1
18688
import pandas as pd import numpy as np import tensorflow as tf import matplotlib.pylab as plt from scipy.interpolate import interp1d from scipy import signal from scipy import optimize ''' the LRTable is the different windows of the spectrum from the library. ''' ComplexLRTable = [ [[22, 72, 138, 219, 298, 432, 47...
mit
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/django/conf/locale/mk/formats.py
35
1677
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMA...
apache-2.0
nwjs/chromium.src
ppapi/cpp/documentation/doxy_cleanup.py
10
4494
#!/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 utility cleans up the html files as emitted by doxygen so that they are suitable for publication on a Google documentation ...
bsd-3-clause
trac-ja/trac-ja
trac/tests/functional/__init__.py
4
6096
#!/usr/bin/python """functional_tests While unittests work well for testing facets of an implementation, they fail to provide assurances that the user-visible functions work in practice. Here, we complement the unittests with functional tests that drive the system as a user would to verify user visible functionality....
bsd-3-clause
marc-sensenich/ansible
lib/ansible/modules/cloud/amazon/cloudformation.py
7
34388
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # 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', 'status': ['st...
gpl-3.0
sgerhart/ansible
lib/ansible/modules/windows/win_whoami.py
52
5530
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
mit
akshayaurora/kivy
kivy/uix/sandbox.py
19
5695
''' Sandbox ======= .. versionadded:: 1.8.0 .. warning:: This is experimental and subject to change as long as this warning notice is present. This is a widget that runs itself and all of its children in a Sandbox. That means if a child raises an Exception, it will be caught. The Sandbox itself runs its own...
mit
1stvamp/pip
pip/basecommand.py
1
7024
"""Base Command class, and related routines""" import os import sys import tempfile import traceback import time import optparse from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.log import logger from pip.download import PipSession from pip.exceptions import (BadCommand, Installa...
mit
pepetreshere/odoo
addons/sale_management/models/res_config_settings.py
4
1169
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models, api class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' group_sale_order_template = fields.Boolean( "Quotation Templates", implied_group='s...
agpl-3.0
abendleiter/Django-facebook
docs/docs_env/Lib/encodings/iso2022_jp_2004.py
816
1073
# # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class I...
bsd-3-clause
Flyingfox646/flyingfox
src/stats/sql.py
1
3837
from django.conf import settings from django.db import connection from django.utils import timezone INACTIVE_PLAYER_DAYS = settings.INACTIVE_PLAYER_DAYS SQUAD_MEMBERS_MINIMUM = settings.SQUAD_MEMBERS_MINIMUM def get_squad_position_by_field(squad, field): field_value = getattr(squad, field) params = {'field'...
mit
bastibl/gnuradio
gr-digital/python/digital/test_soft_decisions.py
7
5089
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
JorgeCoock/django
tests/sites_framework/migrations/0001_initial.py
281
1672
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='CustomArticle', fields=[ ...
bsd-3-clause
wvengen/ndg_oauth_server
ndg/oauth/server/lib/register/scopeutil.py
3
1669
"""OAuth 2.0 WSGI server middleware - utilities for handling scope strings and lists """ __author__ = "R B Wilkinson" __date__ = "28/03/12" __copyright__ = "(C) 2012 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revis...
bsd-3-clause
andyvand/flare-ida-1
plugins/struct_typer_plugin.py
9
1668
#!/usr/bin/env python # Jay Smith # jay.smith@fireeye.com # ######################################################################## # Copyright 2013 Mandiant # Copyright 2014 FireEye # # Mandiant licenses this file to you under the Apache License, Version # 2.0 (the "License"); you may not use this file except in com...
apache-2.0
bennettp123/CouchPotatoServer
libs/sqlalchemy/util/queue.py
18
7472
# util/queue.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """An adaptation of Py2.3/2.4's Queue module which supports reentrant behavior, using RL...
gpl-3.0
cstipkovic/spidermonkey-research
testing/marionette/harness/marionette/tests/unit/test_simpletest_sanity.py
1
5285
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from marionette import MarionetteTestCase class SimpletestSanityTest(MarionetteTestCase): callFinish = "return fini...
mpl-2.0
feigames/Odoo
addons/decimal_precision/__init__.py
450
1128
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
mgeplf/NeuroM
examples/end_to_end_distance.py
5
4395
#!/usr/bin/env python # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
bsd-3-clause
halsafar/PokemonGo-Bot
pokemongo_bot/cell_workers/random_pause.py
13
4771
from datetime import datetime as dt, timedelta from time import sleep from random import uniform from pokemongo_bot.base_task import BaseTask class RandomPause(BaseTask): """Pauses the execution of the bot at a random time for a random duration Simulates the user doing "something random" for some time. ...
mit
bjornaa/ladim
examples/line/plot_holoviews.py
1
1481
# Use holoviews to plot the particle distribution at given time from pathlib import Path import numpy as np import xarray as xr import holoviews as hv from postladim import ParticleFile hv.extension("bokeh") # --- Settings --- tstep = 40 # Time step to show # Output file (and type) output_file = "line_hv.png" #out...
mit
rwth-ti/gr-ofdm
python/ofdm/qa_accumulator_ff.py
1
1277
#!/usr/bin/env python # # Copyright 2014 Institute for Theoretical Information Technology, # RWTH Aachen University # www.ti.rwth-aachen.de # # This 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 S...
gpl-3.0
wangxuan007/flasky
venv/lib/python2.7/site-packages/sqlalchemy/types.py
34
1650
# types.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Compatibility namespace for sqlalchemy.sql.types. """ __all__ = ['TypeEngine', 'TypeDe...
gpl-3.0
Chilledheart/chromium
tools/chrome_proxy/common/network_metrics_unittest.py
37
6491
# Copyright 2014 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 base64 import unittest from common import network_metrics from telemetry.testing import test_page_test_results from telemetry.timeline import event ...
bsd-3-clause
kynikos/qtile
libqtile/layout/tree.py
2
21897
# -*- coding:utf-8 -*- # Copyright (c) 2011 Mounier Florian # Copyright (c) 2011 Paul Colomiets # Copyright (c) 2012 roger # Copyright (c) 2012-2014 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2013 Arnas Udovicius # Copyright (c) 2014 ramnes # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 Nathan ...
mit
xinwu/horizon
openstack_dashboard/dashboards/project/loadbalancers/panel.py
32
1629
# 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...
apache-2.0
niltmt/arm-linux-androideabi-4.8
share/gdb/python/gdb/prompt.py
107
4217
# Extended prompt utilities. # Copyright (C) 2011-2012 Free Software Foundation, Inc. # 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 ...
gpl-2.0
fyffyt/pylearn2
pylearn2/datasets/npy_npz.py
44
3384
"""Objects for datasets serialized in the NumPy native format (.npy/.npz).""" import functools import numpy from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix class NpyDataset(DenseDesignMatrix): """A dense dataset based on a single array stored as a .npy file.""" def __init__(self, file, m...
bsd-3-clause
ak2703/edx-platform
lms/lib/courseware_search/lms_filter_generator.py
58
5634
""" This file contains implementation override of SearchFilterGenerator which will allow * Filter by all courses in which the user is enrolled in """ from microsite_configuration import microsite from student.models import CourseEnrollment from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import Co...
agpl-3.0
thelazier/dash
qa/rpc-tests/test_framework/key.py
168
7366
# Copyright (c) 2011 Sam Rushing # # key.py - OpenSSL wrapper # # This file is modified from python-bitcoinlib. # """ECC secp256k1 crypto routines WARNING: This module does not mlock() secrets; your private keys may end up on disk in swap! Use with caution! """ import ctypes import ctypes.util import hashlib import ...
mit
TangHao1987/intellij-community
python/lib/Lib/site-packages/django/core/management/commands/startproject.py
322
1680
from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module import os import re from random import choice class Command(LabelCommand): help = "Creates a Django project directory structure for the given project name in the current directory." ...
apache-2.0
dc3-plaso/dfvfs
dfvfs/lib/glob2regex.py
1
2189
# -*- coding: utf-8 -*- """Glob to regular expression conversion. Also see: https://en.wikipedia.org/wiki/Glob_(programming) """ import re def Glob2Regex(glob_pattern): """Converts a glob pattern to a regular expression. This function supports basic glob patterns that consist of: * matches everything ...
apache-2.0
mcclurmc/juju
juju/providers/ec2/files.py
1
3622
""" Ec2 Provider File Storage on S3 """ from base64 import b64encode import hmac import sha import urllib import time from cStringIO import StringIO from twisted.internet.defer import fail from twisted.web.error import Error from txaws.s3.client import URLContext from juju.errors import FileNotFound _FILENOTFOUND...
agpl-3.0
hanicker/odoo
addons/l10n_pl/__openerp__.py
277
2158
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 - now Grzegorz Grzelak grzegorz.grzelak@openglobe.pl # All Rights Reserved # $Id$ # # This program is free software: you can redistrib...
agpl-3.0
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/importlib/__init__.py
14
6037
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches', 'reload'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirect...
apache-2.0
rghe/ansible
lib/ansible/modules/network/meraki/meraki_vlan.py
17
13516
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net> # 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 = { ...
gpl-3.0
mahak/cinder
cinder/backup/driver.py
2
17810
# Copyright (C) 2013 Deutsche Telekom AG # 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 r...
apache-2.0