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
titienmiami/mmc.repository
plugin.video.tvalacarta/lib/pyamf/codec.py
27
13848
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Provides basic functionality for all pyamf.amf?.[De|E]ncoder classes. """ import types import datetime import pyamf from pyamf import util, python, xml __all__ = [ 'IndexedCollection', 'Context', 'Decoder', 'Encoder' ] try: u...
gpl-2.0
tectronics/princess-alist
home/xiaogaozi/Documents/Sphinx/FooCommunication/conf.py
2
6334
# -*- coding: utf-8 -*- # # FooCommunication documentation build configuration file, created by # sphinx-quickstart on Mon Jun 21 11:04:15 2010. # # 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...
gpl-3.0
brain-tec/partner-contact
partner_firstname/models/res_users.py
2
1205
# -*- coding: utf-8 -*- # © 2013 Nicolas Bessi (Camptocamp SA) # © 2014 Agile Business Group (<http://www.agilebg.com>) # © 2015 Grupo ESOC (<http://www.grupoesoc.es>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import logging from odoo import api, models _logger = logging.getLogger(__name__)...
agpl-3.0
sentinelleader/python-etcd
src/etcd/tests/unit/test_client.py
8
3058
import unittest import etcd class TestClient(unittest.TestCase): def test_instantiate(self): """ client can be instantiated""" client = etcd.Client() assert client is not None def test_default_host(self): """ default host is 127.0.0.1""" client = etcd.Client() ...
mit
eludom/trigger
tests/data/settings.py
6
1161
import os # Owners to use in testing... VALID_OWNERS = ('Data Center',) # Database stuff DATABASE_ENGINE = 'sqlite3' # The prefix is... ME! (Abs path to the current file) PREFIX = os.path.dirname(os.path.abspath(__file__)) # .tacacsrc Stuff DEFAULT_REALM = 'aol' TACACSRC_KEYFILE = os.getenv('TACACSRC_KEYFILE', os.p...
bsd-3-clause
DannyArends/genenetwork2
wqflask/maintenance/geno_to_json.py
1
6888
#!/usr/bin/python """ Convert .geno files to json This file goes through all of the genofiles in the genofile directory (.geno) and converts them to json files that are used when running the marker regression code """ from __future__ import print_function, division, absolute_import import sys sys.path.append("..") ...
agpl-3.0
bmander/dancecontraption
django/contrib/formtools/tests/__init__.py
7
15228
import os from django import forms, http from django.conf import settings from django.contrib.formtools import preview, wizard, utils from django.test import TestCase from django.utils import unittest success_string = "Done was called!" class TestFormPreview(preview.FormPreview): def get_context(self, request, ...
bsd-3-clause
ongwilliam/video_streaming_project
ServerWorker.py
1
4172
from random import randint import sys, traceback, threading, socket from VideoStream import VideoStream from RtpPacket import RtpPacket class ServerWorker: SETUP = 'SETUP' PLAY = 'PLAY' PAUSE = 'PAUSE' TEARDOWN = 'TEARDOWN' INIT = 0 READY = 1 PLAYING = 2 state = INIT OK_200 = 0 FILE_NOT_FOUND_404 = 1 CO...
gpl-3.0
barbagroup/cuIBM
external/snake-0.3/snake/petibm/simulation.py
2
9944
""" Implementation of the class `PetIBMSimulation`. """ import os import sys import struct import numpy try: sys.path.append(os.path.join(os.environ['PETSC_DIR'], 'bin')) import PetscBinaryIO except: pass from ..barbaGroupSimulation import BarbaGroupSimulation from ..field import Field from ..force import For...
mit
nfco/netforce
netforce_ecom/netforce_ecom/models/ecom_cart_line.py
4
5247
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
pilou-/ansible
lib/ansible/modules/cloud/amazon/elb_instance.py
54
13700
#!/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
chouseknecht/ansible
lib/ansible/module_utils/network/nxos/facts/lacp/lacp.py
18
2936
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The nxos lacp fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based on the conf...
gpl-3.0
RaoUmer/django
django/conf/locale/ml/formats.py
341
1635
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'N j, Y' TIME_FORMAT = 'P' DATETIME_FORMAT = 'N j, Y, P' YEAR_MONTH_FORMAT...
bsd-3-clause
graik/biskit
archive_biskit2/scripts/Mod/model.py
1
7535
#!/usr/bin/env python ## ## Biskit, a toolkit for the manipulation of macromolecular structures ## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner ## ## 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 Softwar...
gpl-3.0
googleinterns/hw-fuzzing
experiment_scripts/exp003_lock_cocotb_afl_runtimes.py
1
3794
#!/usr/bin/python3 # Copyright 2020 Google 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 agr...
apache-2.0
rgom/Pydev
plugins/org.python.pydev.jython/Lib/distutils/command/upload.py
176
7002
"""distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).""" import os import socket import platform from urllib2 import urlopen, Request, HTTPError from base64 import standard_b64encode import urlparse import cStringIO as StringIO from hashlib import md5 from distutils.errors...
epl-1.0
pcu4dros/pandora-core
workspace/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/lint.py
328
3365
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from . import base from ..constants import namespaces, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class Filter(base.Filter): def __init__(self, source, r...
mit
wlach/routez
src/routez/create-markers.py
1
1476
#!/usr/bin/python import os from optparse import OptionParser import logging # Manually import django sys.path.append(os.path.join(os.getcwd(), os.pardir)) os.environ['DJANGO_SETTINGS_MODULE'] = "routez.settings" from routez.travel.models import Route usage = "usage: %prog [options] <base path> <generated path>" pa...
agpl-3.0
ChameleonCloud/horizon
openstack_dashboard/test/unit/api/rest/test_network.py
3
4597
# Copyright 2015, Hewlett-Packard Development Company, L.P. # Copyright 2016 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/LICENSE-2.0 # # Un...
apache-2.0
ramitalat/odoo
addons/account/account_analytic_line.py
304
7914
# -*- 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
ticklemepierce/osf.io
website/addons/s3/views/config.py
13
4693
import httplib from flask import request from framework.exceptions import HTTPError from framework.auth.decorators import must_be_logged_in from website.addons.s3 import utils from website.project.decorators import must_have_addon from website.project.decorators import must_have_permission from website.project.decor...
apache-2.0
andaag/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
rohitsm/TCSA
Code/login/test_routes.py
1
6886
# Imports # Python import cgi import os import json import urllib2 # App from login import app from login import login_manager # Flask from flask import render_template, flash, redirect, request, url_for from flask import session, abort from flask.ext.login import login_user, logout_user, login_required, current_us...
mit
alinbalutoiu/tempest
tempest/manager.py
26
2954
# 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
jxta/cc
vendor/Twisted-10.0.0/twisted/words/xish/xpath.py
54
9300
# -*- test-case-name: twisted.words.test.test_xpath -*- # # Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. """ XPath query support. This module provides L{XPathQuery} to match L{domish.Element<twisted.words.xish.domish.Element>} instances against XPath-like expressions. """ try: ...
apache-2.0
brainelectronics/towerdefense
pyglet/gl/wgl_info.py
38
2789
# ---------------------------------------------------------------------------- # 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...
bsd-3-clause
nuncjo/odoo
addons/auth_crypt/__init__.py
435
1050
############################################################################## # # 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 the GNU Affero General Publ...
agpl-3.0
gangadharkadam/verveerp
erpnext/setup/doctype/backup_manager/backup_dropbox.py
6
4773
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # SETUP: # install pip install --upgrade dropbox # # Create new Dropbox App # # in conf.py, set oauth2 settings # dropbox_access_key # dropbox_access_secret from __future__ import unicode_lit...
agpl-3.0
bucricket/projectMAS
pydisalexi/processData.py
1
25703
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Jan 6 11:30:05 2017 @author: mschull """ from .landsatTools import landsat_metadata,GeoTIFF import os from datetime import datetime import subprocess import numpy as np import utm import shutil from .utils import writeArray2Tiff,warp,interpOverpassHour...
bsd-3-clause
asankah/closure-linter
closure_linter/testutil.py
109
2574
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 #...
apache-2.0
kishori82/MetaPathways_Python.3.0
utilities/generate_run_stats.py
1
7567
#!/usr/bin/python # File created on 27 Jan 2012. from __future__ import division __author__ = "Kishori M Konwar" __copyright__ = "Copyright 2013, MetaPathways" __credits__ = ["r"] __version__ = "1.0" __maintainer__ = "Kishori M Konwar" __status__ = "Release" try: import os, re from os import makedirs, sys, ...
mit
treejames/viewfinder
backend/www/test/allocate_ids_test.py
13
2043
# Copyright 2013 Viewfinder Inc. All Rights Reserved. """Test allocating asset ids from the server. """ __author__ = ['matt@emailscrubbed.com (Matt Tracy)'] from viewfinder.backend.base import util from viewfinder.backend.db.user import User from viewfinder.backend.www.test import service_base_test class AllocateId...
apache-2.0
ixc/django-forms-builder
forms_builder/forms/south_migrations/0002_auto__add_field_field_order.py
11
4807
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Field.order' db.add_column('forms_field', 'order', self.gf('django.db.models.fields.Intege...
bsd-2-clause
lshain-android-source/external-chromium_org-tools-gyp
pylib/gyp/__init__.py
13
21898
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
bsd-3-clause
madscatt/zazzie
src/sassie/interface/extract_utilities/extract_utilities_filter.py
2
17642
''' SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D. 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. ...
gpl-3.0
HiroIshikawa/21playground
microblog/flask/lib/python3.5/site-packages/migrate/versioning/migrate_repository.py
33
3114
""" Script to migrate repository from sqlalchemy <= 0.4.4 to the new repository schema. This shouldn't use any other migrate modules, so that it can work in any version. """ import os import sys import logging log = logging.getLogger(__name__) def usage(): """Gives usage information.""" print("Usag...
mit
deepmind/deepmind-research
ogb_lsc/mag/csr_builder.py
1
4710
# Copyright 2021 DeepMind Technologies Limited. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
samuelchong/libcloud
docs/examples/storage/publish_static_website_on_cf.py
58
1117
from StringIO import StringIO from libcloud.storage.types import Provider from libcloud.storage.providers import get_driver CloudFiles = get_driver(Provider.CLOUDFILES_US) driver = CloudFiles('username', 'api key') container = driver.create_container(container_name='my_website') iterator1 = StringIO('<p>Hello Worl...
apache-2.0
ahealy19/F-IDE-2016
benchexec/tools/esbmcdepthk.py
1
3165
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer 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 ...
apache-2.0
Thraxis/pymedusa
lib/tornado/websocket.py
11
40820
"""Implementation of the WebSocket protocol. `WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional communication between the browser and server. WebSockets are supported in the current versions of all major browsers, although older versions that do not support WebSockets are still in use (refer ...
gpl-3.0
nesdis/djongo
tests/django_tests/tests/v22/tests/gis_tests/geoapp/test_expressions.py
59
2938
from unittest import skipUnless from django.contrib.gis.db.models import F, GeometryField, Value, functions from django.contrib.gis.geos import Point, Polygon from django.db import connection from django.db.models import Count, Min from django.test import TestCase, skipUnlessDBFeature from ..utils import postgis from...
agpl-3.0
idrmhyprbls/PyroChess
pyrochess/piece.py
1
6826
#!/usr/bin/env python # -*- coding: utf-8 -*- """Piece classes""" from __future__ import absolute_import, division import logging from pyrochess.config import SETTINGS from pyrochess.square import Square from pyrochess.metadata import PROGRAM LOG = logging.getLogger(PROGRAM) class Piece(object): point = 0. ...
bsd-3-clause
rruebner/odoo
addons/note_pad/__openerp__.py
120
1678
# -*- 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
saurabh6790/med_new_lib
webnotes/install_lib/setup_public_folder.py
34
1160
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # make public folders from __future__ import unicode_literals import os import webnotes def make(site=None): """make public folder symlinks if missing""" from webnotes.utils import get_site_base_path, get_base_pa...
mit
amikey/SCFF-DirectShow-Filter
tools/scripts/dllexports2def.py
1
1632
# dllexports2def.py # from http://takumakei.blogspot.jp/2009/04/dlldef.html #====================================================================== def dllexports2def(path): from sys import stderr from os.path import exists if not exists(path): print >>stderr, 'dllexports2def: %s is not fou...
lgpl-3.0
PW-Sat2/PWSat2OBC
integration_tests/emulator/antenna.py
1
3567
import wx from wx import xrc from .base import ModuleBase, bind class AntennaModule(ModuleBase): def __init__(self, name, pos, antenna_controller): self._antenna_controller = antenna_controller self._panel = None self.title = 'Antenna ({})'.format(name) self.grid_pos = ...
agpl-3.0
rosmo/ansible
lib/ansible/modules/network/vyos/vyos_user.py
56
10850
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
shanethehat/skype4py
unittests/skype4pytest.py
18
4514
import sys import os import unittest import logging import threading # Add the parent directory to the top of the search paths list so the # distribution copy of the Skype4Py module can be imported instead of # the installed one. sys.path.insert(0, os.path.abspath('..')) import Skype4Py from Skype4Py.skype import * f...
bsd-3-clause
kobejean/tensorflow
tensorflow/python/kernel_tests/duplicate_op_test.py
10
1478
# 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
shanemcd/ansible
test/units/module_utils/facts/test_timeout.py
118
3859
# -*- coding: utf-8 -*- # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.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 published by # the Free Software Foundation, either version 3 of the License, or # (a...
gpl-3.0
40223211/w16b_test
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/image.py
603
19603
#!/usr/bin/env python '''Pygame module for image transfer. The image module contains functions for loading and saving pictures, as well as transferring Surfaces to formats usable by other packages. Note that there is no Image class; an image is loaded as a Surface object. The Surface class allows manipulation (drawi...
agpl-3.0
Balachan27/django
tests/template_tests/filter_tests/test_length.py
521
1900
from django.template.defaultfilters import length from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LengthTests(SimpleTestCase): @setup({'length01': '{{ list|length }}'}) def test_length01(self): output = self.engine.render_to_string...
bsd-3-clause
ApolloAuto/apollo
modules/tools/mapshow/libs/subplot_st_main.py
3
4625
#!/usr/bin/env python3 ############################################################################### # Copyright 2017 The Apollo 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...
apache-2.0
klooer/rvi_backend
web/dblog/handlers.py
7
2684
""" Copyright (C) 2014, Jaguar Land Rover This program is licensed under the terms and conditions of the Mozilla Public License, version 2.0. The full text of the Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ Maintainer: Rudolf Streif (rstreif@jaguarlandrover.com) """ from logging import Handler f...
mpl-2.0
rooper/bigbyte
bigbyte/node_modules/cordova/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py
2779
1665
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
mit
mavenlin/tensorflow
tensorflow/python/lib/io/file_io_test.py
4
18533
# This Python file uses the following encoding: utf-8 # Copyright 2015 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.o...
apache-2.0
Mirantis/mos-horizon
openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/views.py
12
5127
# 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
paralax/ColossalOpera
book/epub-process.py
1
1106
#!/usr/bin/env python import re import sys MINTEDOPS = r""" [ framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, breaklines, linenos ] """ MINTLANGMAPS={r'F\#': 'ocaml', 'Fsharp': 'ocaml', 'Scala': 'javascript', 'Go': 'go'} def main(): ...
artistic-2.0
bksim/chinese-translation
lib/werkzeug/routing.py
313
62520
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
apache-2.0
jjtoharia/KaggleOutbrain
pySpark/temp_spark.py
1
32616
# -*- coding: utf-8 -*- """ Editor de Spyder Este es un archivo temporal """ # # Esto en [pyspark | GoogleCloud] NO hace falta (ya hay una seasión de spark lanzada y un sparkContext creado): # C:\Archivos de programa\Google\Cloud SDK>gcloud compute instances start cluster-jjtzapata-m cluster-jjtzapata-...
mit
PSU-CAPSTONE-BEEEEEES/Tellagence
test/jshamcrest/fabfile.py
1
4556
#-*- coding:utf-8 -*- """JsHamcrest build script. """ import re import cStringIO as StringIO from fabric.api import * # Project env.project = 'jshamcrest' env.version = '0.6.7' env.full_name = '%s-%s' % (env.project, env.version) # Build output env.build_dir = 'build' env.dist_dir = 'dist' env.rev_in...
mit
mayankjohri/LetsExplorePython
Section 2 - Advance Python/Chapter S2.04 - Database/code/sqlalchemy/many2one/many2one_3_3.py
2
3517
# -*- coding: utf-8 -*- """ Created on 30 Apr 2017 @author: Mayank Johri Description: In the below example we will be create a sample for Many to one relationship using sqlalchemy and then use back_populates feature Tip: ----- - backref: Add it two one relationship and another is not needed anymore. """ ...
gpl-3.0
vovanbo/django-oscar
src/oscar/apps/promotions/migrations/0001_initial.py
49
10922
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import oscar.models.fields class Migration(migrations.Migration): dependencies = [ ('catalogue', '0001_initial'), ('contenttypes', '0001_initial'), ] operations = [ migration...
bsd-3-clause
Mellthas/quodlibet
quodlibet/quodlibet/ext/events/waveformseekbar.py
1
27061
# Copyright 2016 0x1777 # 2016-17 Nick Boultbee # 2017 Didier Villevalois # 2017 Muges # 2017 Eyenseo # 2018 Joschua Gandert # 2018 Blimmo # 2018 Olli Helin # # This program is free software; you can redistribute it and/or modify # it under the terms of...
gpl-2.0
openiitbombayx/edx-platform
openedx/core/djangoapps/user_api/serializers.py
2
2212
from django.contrib.auth.models import User from rest_framework import serializers #IITBombayX added Mooc_state from student.models import UserProfile,Mooc_state from .models import UserPreference class UserSerializer(serializers.HyperlinkedModelSerializer): name = serializers.SerializerMethodField("get_name") ...
agpl-3.0
sserrot/champion_relationships
venv/Lib/site-packages/networkx/algorithms/smetric.py
1
1195
import networkx as nx #from networkx.generators.smax import li_smax_graph def s_metric(G, normalized=True): """Returns the s-metric of graph. The s-metric is defined as the sum of the products deg(u)*deg(v) for every edge (u,v) in G. If norm is provided construct the s-max graph and compute it's s_me...
mit
kmonsoor/python-for-android
python-build/python-libs/python-twitter/simplejson/encoder.py
138
15836
"""Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from simplejson._speedups import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ...
apache-2.0
davidsandberg/facenet
tmp/vggverydeep19.py
4
4024
"""Load the VGG imagenet model into TensorFlow. Download the model from http://www.robots.ox.ac.uk/~vgg/research/very_deep/ and point to the file 'imagenet-vgg-verydeep-19.mat' """ import numpy as np from scipy import io import tensorflow as tf def load(filename, images): vgg19 = io.loadmat(filename) vgg19Laye...
mit
40223117cda/2015cd_midterm
static/Brython3.1.0-20150301-090019/Lib/pydoc_data/topics.py
694
385454
# -*- coding: utf-8 -*- # Autogenerated by Sphinx on Sat Mar 23 15:42:31 2013 topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form,...
gpl-3.0
parente/clique
apps/firefox.py
1
10135
''' Firefox 2 @author: Peter Parente <parente@cs.unc.edu> @copyright: Copyright (c) 2008 Peter Parente @license: BSD License All rights reserved. This program and the accompanying materials are made available under the terms of The BSD License which accompanies this distribution, and is available at U{http://www.open...
bsd-3-clause
larsmans/scikit-learn
examples/model_selection/plot_train_error_vs_test_error.py
349
2577
""" ========================= Train error vs Test error ========================= Illustration of how the performance of an estimator on unseen data (test data) is not the same as the performance on training data. As the regularization increases the performance on train decreases while the performance on test is optim...
bsd-3-clause
pxsdirac/tushare
tushare/datayes/IV.py
10
3423
# -*- coding:utf-8 -*- """ 通联数据 Created on 2015/10/12 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ from pandas.compat import StringIO import pandas as pd from tushare.util import vars as vs from tushare.util.common import Client from tushare.util import upass as up class IV(): def __ini...
bsd-3-clause
aavanian/bokeh
examples/plotting/file/airports_map.py
8
1782
from __future__ import print_function from bokeh.layouts import row from bokeh.models import ( Range1d, WMTSTileSource, ColumnDataSource, HoverTool, ) from bokeh.plotting import figure, show, output_file from bokeh.sampledata.airports import data as airports from bokeh.tile_providers import CARTODBPOSITRON points...
bsd-3-clause
caio2k/RIDE
src/robotide/lib/robot/utils/importer.py
11
10545
# Copyright 2008-2015 Nokia Solutions and Networks # # 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
RafaelTorrealba/odoo
openerp/addons/test_impex/tests/test_export.py
211
19105
# -*- coding: utf-8 -*- import itertools import openerp.modules.registry import openerp from openerp.tests import common class CreatorCase(common.TransactionCase): model_name = False def __init__(self, *args, **kwargs): super(CreatorCase, self).__init__(*args, **kwargs) self.model = None ...
agpl-3.0
Designist/sympy
sympy/physics/quantum/tests/test_spin.py
80
320440
from __future__ import division from sympy import cos, exp, expand, I, Matrix, pi, S, sin, sqrt, Sum, symbols from sympy.abc import alpha, beta, gamma, j, m from sympy.physics.quantum import hbar, represent, Commutator, InnerProduct from sympy.physics.quantum.qapply import qapply from sympy.physics.quantum.tensorproduc...
bsd-3-clause
MSusik/invenio
invenio/legacy/webaccess/web/admin/webaccessadmin.py
4
14225
## This file is part of Invenio. ## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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, ...
gpl-2.0
rcanepa/cs-fundamentals
python/interview_questions/finding_unique_substrings.py
1
1674
"""Find the number of unique substrings from a string.""" import sys import time def lcp(s1, s2): """Return the length of the longest common prefix between strings `s1` and `s2`.""" comp = 0 for i in range(min(len(s1), len(s2))): if s1[i] != s2[i]: break comp += 1 retu...
mit
DepthDeluxe/ansible
lib/ansible/modules/network/cloudengine/ce_ospf.py
46
35013
#!/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
shavera/Davidian
Astrolabe/client/Orbital_pb2.py
1
13934
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: Orbital.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _refle...
gpl-2.0
datamade/large-lots
lots/settings.py
1
2239
import os from django.utils import timezone from datetime import datetime BASE_DIR = os.path.dirname(os.path.dirname(__file__)) from .local_settings import * INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.m...
mit
BNIA/tidydate
src/frontend/views.py
2
2853
#!/usr/bin/env python # -*- coding: utf-8 -*- """views This file contains the endpoints for rendering the interface and implementing the backend modules """ from os import path from flask import jsonify, render_template, request from werkzeug import secure_filename from .config import allowed_file, app, UPLOAD_FOL...
mit
qdev-dk/Majorana
customised_instruments.py
1
8807
# -*- coding: utf-8 -*- """ Customised instruments with extra features such as voltage dividers and derived parameters for use with T10 """ import numpy as np from qcodes.instrument_drivers.QDev.QDac_channels import QDac from qcodes.instrument_drivers.stanford_research.SR830 import SR830 from qcodes.instrument_drivers...
gpl-3.0
luvit/gyp
pylib/gyp/generator/make.py
19
90986
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
bsd-3-clause
sunlianqiang/kbengine
kbe/src/lib/python/Lib/pipes.py
172
8916
"""Conversion pipeline templates. The problem: ------------ Suppose you have some data that you want to convert to another format, such as from GIF image format to PPM image format. Maybe the conversion involves several steps (e.g. piping it through compress or uuencode). Some of the conversion steps may require th...
lgpl-3.0
moijes12/oh-mainline
vendor/packages/twisted/twisted/words/topfiles/setup.py
22
2108
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import sys try: from twisted.python import dist except ImportError: raise SystemExit("twisted.python.dist module not found. Make sure you " "have installed the Twisted core package before " "atte...
agpl-3.0
ataylor32/django
django/conf/locale/eo/formats.py
504
2335
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a ...
bsd-3-clause
birocorneliu/youtube-dl
setup.py
107
3233
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os.path import warnings import sys try: from setuptools import setup setuptools_available = True except ImportError: from distutils.core import setup setuptools_available = False try: # This will create an...
unlicense
Adai0808/scikit-learn
sklearn/covariance/tests/test_graph_lasso.py
272
5245
""" Test the graph_lasso module. """ import sys import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_less from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV, empirical_...
bsd-3-clause
chromium/chromium
third_party/wpt_tools/wpt/tools/third_party/websockets/performance/mem_client.py
17
1311
#!/usr/bin/env python import asyncio import statistics import tracemalloc import websockets from websockets.extensions import permessage_deflate CLIENTS = 10 INTERVAL = 1 / 10 # seconds MEM_SIZE = [] async def mem_client(client): # Space out connections to make them sequential. await asyncio.sleep(clien...
bsd-3-clause
cherry-hyx/divio-django-cms
cms/test_utils/project/emailuserapp/migrations/0001_initial.py
23
2448
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( name='EmailUser', ...
bsd-3-clause
CourseTalk/edx-platform
openedx/core/djangoapps/ccxcon/tests/test_signals.py
11
1069
""" Test for contentstore signals receiver """ import mock from django.test import TestCase from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore, SignalHandler class CCXConSignalTestCase(TestCase): """ The only tests currently implemented are for verifying that t...
agpl-3.0
simonwydooghe/ansible
lib/ansible/module_utils/network/iosxr/argspec/lacp_interfaces/lacp_interfaces.py
23
2160
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is auto generated by ...
gpl-3.0
lisitsyn/shogun
applications/asp/seqdict.py
38
1518
import string class predictions(object): def __init__(self, positions=None, scores=None): self.positions=positions self.scores=scores def set_positions(self, positions): self.positions=positions; def get_positions(self): return self.positions def set_scores(self, scores): self.scores=scores def get_sc...
bsd-3-clause
protatremy/buildbot
master/buildbot/test/integration/test_URLs.py
4
2314
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
cosurgi/trunk
examples/PeriodicBoundaries/periodicSandPile.py
1
1801
#!/usr/bin/python # -*- coding: utf-8 -*- # © 2012 Bruno Chareyre <bruno.chareyre@grenoble-inp.fr> """Script showing how large bodies can be combined with periodic boundary conditions using InsertioSortCollider::allowBiggerThanPeriod=True (1).""" from __future__ import print_function from yade import pack from pylab i...
gpl-2.0
blueskycoco/rtt
bsp/lpc43xx/M0/rtconfig.py
27
3667
import os # core to be use USE_CORE = 'CORE_M0' # toolchains options ARCH='arm' CPU = 'cortex-m0' CROSS_TOOL='keil' # get setting from environment. if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, Code...
gpl-2.0
xiangel/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/grammar.py
56
193388
# -*- coding: utf-8 -*- # Copyright (C) 2006-2010 Søren Roug, European Environment Agency # # 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 you...
apache-2.0
akshayaurora/kivy
doc/sources/sphinxext/autodoc.py
73
1130
# -*- coding: utf-8 -*- from sphinx.ext.autodoc import Documenter, ClassDocumenter from sphinx.ext.autodoc import setup as core_setup from sphinx.locale import _ class KivyClassDocumenter(ClassDocumenter): def add_directive_header(self, sig): if self.doc_as_attr: self.directivetype = 'attribut...
mit
kgilmo/penning_artiq
examples/master/repository/mandelbrot.py
1
1029
import sys from artiq import * class Mandelbrot(EnvExperiment): """Mandelbrot set demo""" def build(self): self.setattr_device("core") def col(self, i): sys.stdout.write(" .,-:;i+hHM$*#@ "[i]) def row(self): print("") # based on: http://warp.povusers.org/MandScripts/py...
gpl-3.0