repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Vijaysai005/KProject
refs/heads/master
vijay/DBSCAN/generate_alert.py
1
# usr/bin/env python # -*- coding: utf-8 -*- """ Created on Thu Jul 20 13:15:05 2017 @author: Vijayasai S """ # Use python3 from pymongo import MongoClient from datetime import datetime from operator import itemgetter def TimeInMinutes(hours, minutes, seconds): return 60*int(hours) + int(minutes) + (int(seconds) /...
modulexcite/nbgrader
refs/heads/master
docs/source/user_guide/jupyterhub/nbgrader_config.py
3
c = get_config() c.NbGraderConfig.course_id = "example_course" c.FormgradeApp.ip = "127.0.0.1" c.FormgradeApp.port = 9000 c.FormgradeApp.authenticator_class = "nbgrader.auth.hubauth.HubAuth" # Change this to be the path to the user guide folder in your clone of # nbgrader, or just wherever you have your class files....
Kloenk/GarrysModserver
refs/heads/master
main.py
1
#!/usr/bin/env python3 #TODO Kommentare einfügen if __name__ == '__main__': print("programm running") print("sending start email") import GModServer.SendStartMail GModServer.SendStartMail.StartServer(debug=True) #Send Start Mail and start Server
duydb2/ZTC
refs/heads/master
atc/django-atc-profile-storage/atc_profile_storage/views.py
1
from atc_profile_storage.models import Profile from atc_profile_storage.serializers import ProfileSerializer from functools import wraps from rest_framework.exceptions import APIException from rest_framework.exceptions import ParseError from rest_framework.response import Response from rest_framework.views import APIV...
nanditav/15712-TensorFlow
refs/heads/master
tensorflow/python/summary/impl/reservoir_test.py
12
# 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.org/licenses/LICENSE-2.0 # # Unless required by applica...
ftranschel/evoMPS
refs/heads/master
evoMPS/mps_gen.py
1
# -*- coding: utf-8 -*- """ Created on Thu Oct 13 17:29:27 2011 @author: Ashley Milsted """ import scipy as sp import scipy.linalg as la import matmul as m import tdvp_common as tm import copy import logging log = logging.getLogger(__name__) class EvoMPS_MPS_Generic(object): def __init__(self, N, D, q): ...
s-m-i-t-a/flask-musers
refs/heads/master
tests/test_user_model.py
1
import six import pytest from mock import patch, call, MagicMock, Mock from blinker import signal from bson.objectid import ObjectId from mongoengine.errors import NotUniqueError from flask_musers.models import ( User, UserError, is_allowed, NotAllowedError, EmailNotFound, InvalidPassword, ...
nkgilley/home-assistant
refs/heads/dev
tests/components/tado/test_config_flow.py
6
"""Test the Tado config flow.""" import requests from homeassistant import config_entries, setup from homeassistant.components.tado.const import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from tests.async_mock import MagicMock, patch from tests.common import MockConfigEntry def _get_mock_ta...
MediaKraken/MediaKraken_Deployment
refs/heads/master
source/castpy/cast.py
1
#!/usr/bin/python # Generate a simple web slideshow # for use with a Chromecast. # # Copyright (c) 2014 by Jim Lawless # See MIT/X11 license at # http://www.mailsend-online.com/license2014.php # import os import string import SimpleHTTPServer import SocketServer delay_millis = "10000" images = os.lis...
Distrotech/intellij-community
refs/heads/master
python/testData/refactoring/rename/renameGlobal_after.py
83
bar = [] def f1(): global bar bar = [1, 2, 3] def f2(x): global bar bar = bar + [x] if 1 in bar: return bar def f3(x): return bar + [x] def f4(x): global bar return bar + [x] def f5(foo): return foo
acsone/server-tools
refs/heads/8.0
profiler/controllers/__init__.py
7
# coding: utf-8 # License AGPL-3 or later (http://www.gnu.org/licenses/lgpl). # Copyright 2014 Anybox <http://anybox.fr> # Copyright 2016 Vauxoo (https://www.vauxoo.com) <info@vauxoo.com> from . import main
PegasusWang/whirlwind
refs/heads/master
whirlwind/util/__init__.py
2
import re class Util(object): @staticmethod def normalize(username): if not username : return None #allow legal email address name = username.strip().lower() name = re.sub(r'[^a-z0-9\\.\\@_\\-~#]+', '', name) name = re.sub('\\s+', '_',name) ...
Tastalian/pymanoid
refs/heads/master
doc/src/conf.py
3
# -*- coding: utf-8 -*- # # pymanoid documentation build configuration file, created by # sphinx-quickstart on Fri Jan 13 14:41:18 2017. import os import sys sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('../../examples')) sys.path.insert(0, os.path.abspath('../../examples/contact_st...
joodo/davanoffi
refs/heads/master
board/migrations/0001_initial.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Post', fields=[ ('id', models.AutoField(verbose...
damdam-s/stock-logistics-workflow
refs/heads/8.0
stock_ownership_availability_rules/model/product.py
19
# -*- coding: utf-8 -*- # Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # 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 # License, or...
eLBati/odoo
refs/heads/master
addons/website_blog/models/website_blog.py
4
# -*- coding: utf-8 -*- from datetime import datetime import difflib import lxml import random from openerp import tools from openerp import SUPERUSER_ID from openerp.osv import osv, fields from openerp.tools.translate import _ class Blog(osv.Model): _name = 'blog.blog' _description = 'Blogs' _inherit =...
SmartInfrastructures/neutron
refs/heads/master
neutron/db/migration/alembic_migrations/versions/28c0ffb8ebbd_remove_mlnx_plugin.py
47
# Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
zaccoz/odoo
refs/heads/8.0
addons/account_budget/account_budget.py
194
# -*- 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...
Soya93/Extract-Refactoring
refs/heads/master
python/testData/intentions/splitIf_after.py
83
def foo(): if a + 2 > 3: if b < 4: #comment a = a and b b = 4 elif a > 20: pass elif b > 20: b = a + 2 foo() else: b = a and b a = 4 elif a > 20: pass elif b > 20: b = ...
codasus/django-blogages
refs/heads/master
blogages/django/contrib/auth/forms.py
96
from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.models import get_current_site from django.template import Context, loader from django import forms from django.utils.translation import ugett...
CTSRD-SOAAP/chromium-42.0.2311.135
refs/heads/master
net/tools/testserver/testserver.py
1
#!/usr/bin/env python # Copyright 2013 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 is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for testing Chrome. It supports several test URLs, as spec...
ppwwyyxx/tensorflow
refs/heads/master
tensorflow/compiler/tests/nullary_ops_test.py
24
# Copyright 2017 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...
Stargrazer82301/CAAPR
refs/heads/master
CAAPR/CAAPR_AstroMagic/PTS/pts/do/core/add_paper.py
1
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
WillGuan105/django
refs/heads/master
django/contrib/auth/__init__.py
69
import inspect import re from django.apps import apps as django_apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.middleware.csrf import rotate_token from django.utils.crypto import constant_time_compare from django.utils.module_loading import i...
freedomtan/tensorflow
refs/heads/master
tensorflow/lite/tools/pip_package/setup.py
9
# Copyright 2018 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...
glouppe/scikit-learn
refs/heads/master
examples/plot_multioutput_face_completion.py
330
""" ============================================== Face completion with a multi-output estimators ============================================== This example shows the use of multi-output estimator to complete images. The goal is to predict the lower half of a face given its upper half. The first column of images sho...
mrquim/repository.mrquim
refs/heads/master
script.module.youtube.dl/lib/youtube_dl/extractor/amcnetworks.py
24
# coding: utf-8 from __future__ import unicode_literals from .theplatform import ThePlatformIE from ..utils import ( update_url_query, parse_age_limit, int_or_none, ) class AMCNetworksIE(ThePlatformIE): _VALID_URL = r'https?://(?:www\.)?(?:amc|bbcamerica|ifc|wetv)\.com/(?:movies|shows(?:/[^/]+)+)/(?P...
strahlex/machinetalk-protobuf
refs/heads/master
python/machinetalk/protobuf/firmware_pb2.py
9
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: machinetalk/protobuf/firmware.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 impor...
klebercode/rhape
refs/heads/master
rha/core/views.py
1
# coding: utf-8 from django.shortcuts import render, redirect from forms import ContactForm, SubscribeForm from models import (Enterprise, Contact, Team, Cost, Partner, Gallery, Course, Objective, Public, Step) def home(request): context = {} context['enterprises'] = Enterprise.objects.al...
jesobreira/gwrite
refs/heads/master
gwrite/gtklatex.py
4
#!/usr/bin/python # -*- coding: UTF-8 -*- '''Gtk LaTex @author: U{Jiahua Huang <jhuangjiahua@gmail.com>} @license: LGPLv3+ ''' from gi.repository import Gtk from gi.repository import GLib from gi.repository import GObject from gi.repository import Gdk from gi.repository import GdkPixbuf import thread import time impo...
tafaRU/odoo
refs/heads/8.0
addons/sale_journal/__openerp__.py
52
# -*- 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...
Matt-Stammers/Python-Foundations
refs/heads/master
Simple Functions/String_Replacement(Dots).py
1
# simply done by escaping the . in a regex import re def replace_dots(str): return re.sub(r"\.", "-", str) # or you can use .replace() def replace_dots(str_): if "." in str_: return str_.replace(".", "-") elif str_ is "": return "" else: return "no dots" # or you c...
mcella/django
refs/heads/master
tests/admin_views/forms.py
339
from django import forms from django.contrib.admin.forms import AdminAuthenticationForm class CustomAdminAuthenticationForm(AdminAuthenticationForm): class Media: css = {'all': ('path/to/media.css',)} def clean_username(self): username = self.cleaned_data.get('username') if username ...
Aptitudetech/ERPNext
refs/heads/master
erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py
44
import frappe def execute(): frappe.reload_doctype('Supplier Quotation Item') for data in frappe.db.sql(""" select prevdoc_docname, prevdoc_detail_docname, name from `tabSupplier Quotation Item` where prevdoc_docname is not null""", as_dict=True): frappe.db.set_value("Supplier Quotation Item", data.name, "materi...
Sawed0ff/g3_kernel
refs/heads/lp5.1
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
simartin/servo
refs/heads/master
tests/wpt/webgl/tests/py/lint/lint.py
47
#! /usr/bin/env python import os import subprocess import re import sys import fnmatch import commands from collections import defaultdict from optparse import OptionParser lint_root = os.path.dirname(os.path.abspath(__file__)) repo_root = os.path.dirname(os.path.dirname(lint_root)) def git(command, *args): arg...
jhgoebbert/cvl-fabric-launcher
refs/heads/master
wsgidav/dav_provider.py
4
# (c) 2009-2011 Martin Wendt and contributors; see WsgiDAV http://wsgidav.googlecode.com/ # Original PyFileServer (c) 2005 Ho Chun Wei. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Abstract base class for DAV resource providers. This module serves these purposes: ...
hantek/fuel
refs/heads/master
tests/test_adult.py
16
import numpy from numpy.testing import assert_raises, assert_equal, assert_allclose from fuel.datasets import Adult from tests import skip_if_not_available def test_adult_test(): skip_if_not_available(datasets=['adult.hdf5']) dataset = Adult(('test',), load_in_memory=False) handle = dataset.open() ...
B-MOOC/edx-platform
refs/heads/master
common/lib/capa/capa/tests/test_answer_pool.py
196
""" Tests the logic of the "answer-pool" attribute, e.g. <choicegroup answer-pool="4"> """ import unittest import textwrap from . import test_capa_system, new_loncapa_problem from capa.responsetypes import LoncapaProblemError class CapaAnswerPoolTest(unittest.TestCase): """Capa Answer Pool Test""" def setU...
kaushik94/boto
refs/heads/develop
boto/cloudfront/logging.py
219
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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...
home-assistant/home-assistant
refs/heads/dev
tests/components/ecobee/test_util.py
9
"""Tests for the ecobee.util module.""" import pytest import voluptuous as vol from homeassistant.components.ecobee.util import ecobee_date, ecobee_time async def test_ecobee_date_with_valid_input(): """Test that the date function returns the expected result.""" test_input = "2019-09-27" assert ecobee_d...
muntasirsyed/intellij-community
refs/heads/master
python/testData/highlighting/returnWithArgumentsInGenerator.py
32
def <info descr="null">f</info>(): yield 42 <error descr="Python versions < 3.3 do not allow 'return' with argument inside generator.">return 28</error>
juliarizza/script-amigo-secreto
refs/heads/master
amigo_secreto.py
1
# -*- coding: utf-8 -*- import os from sys import platform from random import randint ## Inicializa a lista de amigos que vão participar do sorteio amigos = [] ## Preenche a lista de amigos que vão participar do sorteio qtd_amigos = int(input("Quantos amigos seu grupo possui? ")) for i in range(qtd_amigos): amigo...
bionoid/kivy
refs/heads/master
kivy/tests/test_window_info.py
8
from kivy.tests.common import GraphicUnitTest from kivy import setupconfig class WindowInfoTest(GraphicUnitTest): def test_window_info_nonzero(self): from kivy.core.window import Window window_info = Window.get_window_info() if window_info is None: return if setupconfi...
badlogicmanpreet/nupic
refs/heads/master
examples/opf/clients/hotgym/anomaly/one_gym/remove_tuesdays.py
15
import csv import shutil import datetime ORIGINAL = "rec-center-hourly.csv" BACKUP = "rec-center-hourly-backup.csv" DATE_FORMAT = "%m/%d/%y %H:%M" def isTuesday(date): return date.weekday() is 1 def withinOctober(date): return datetime.datetime(2010, 10, 1) <= date < datetime.datetime(2010, 11, 1) def run(...
gskywolf/Firefly-RK3288-Kernel
refs/heads/master
tools/perf/scripts/python/net_dropmonitor.py
2669
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
martinling/imusim
refs/heads/master
imusim/utilities/trees.py
3
""" Support for basic tree structures. """ # Copyright (C) 2009-2011 University of Edinburgh # # This file is part of IMUSim. # # IMUSim 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 ...
wendellpbarreto/gastroprocto
refs/heads/master
gastroprocto/apps/accounts/models.py
10644
from django.db import models # Create your models here.
RayMick/SFrame
refs/heads/master
cxxtest/admin/virtualenv_1.7.py
77
#!/usr/bin/env python """Create a "virtual" Python installation """ # If you change the version here, change it in setup.py # and docs/conf.py as well. virtualenv_version = "1.7" import base64 import sys import os import optparse import re import shutil import logging import tempfile import zlib import errno import d...
GoogleCloudPlatform/python-compat-runtime
refs/heads/master
appengine-compat/exported_appengine_sdk/google/appengine/_internal/__init__.py
1333
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
PisiLinuxNew/pisido
refs/heads/master
resources/files/actions_template_perl.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # # Licensed under the GNU General Public License, version 3. # See the file https://www.gnu.org/licenses/gpl-3.0.txt from pisi.actionsapi import perlmodules from pisi.actionsapi import pisitools def setup(): perlmodules.configure() def build(): perlmodules.make() d...
HesselTjeerdsma/Cyber-Physical-Pacman-Game
refs/heads/master
test programs/test/test/lib/python2.7/site-packages/wheel/pkginfo.py
96
"""Tools for reading and writing PKG-INFO / METADATA without caring about the encoding.""" from email.parser import Parser try: unicode _PY3 = False except NameError: _PY3 = True if not _PY3: from email.generator import Generator def read_pkg_info_bytes(bytestr): return Parser().parsestr...
fossoult/odoo
refs/heads/8.0
addons/l10n_bo/__init__.py
2120
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
xingwu1/autorest
refs/heads/master
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py
8
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
Dziolas/invenio
refs/heads/scoap3
modules/bibformat/lib/elements/bfe_fulltext_mini.py
10
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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 ## Licens...
stuti-rastogi/leetcodesolutions
refs/heads/master
001_twoSum.py
1
class Solution: def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ # Brute-force solution, accepted # n = len(nums) # for i in range(n): # for j in range(i+1, n): # if nums[i] +...
nagyistoce/odoo-dev-odoo
refs/heads/8.0
addons/email_template/__openerp__.py
260
# -*- 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 ...
mbayon/TFG-MachineLearning
refs/heads/master
vbig/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py
28
""" SQL functions reference lists: https://web.archive.org/web/20130407175746/https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re import sys from django.contrib.gis.db.backends.base.operations import ( BaseSpatialOperations, ) from d...
ronaldahmed/SLAM-for-ugv
refs/heads/master
neural-navigation-with-lstm/MARCO/Robot/Plastk.py
2
""" A simple gridworld demo. This demo instantiates a gridworld and an agent that will learn to get to the goal in the world using reinforcement learning. $Id;$ """ import pdb # We may need the debugger ######################################################################## # Import what we need from PLASTK: the ...
kenglishhi/gae-django-sandbox
refs/heads/master
django/contrib/auth/tests/__init__.py
12
from django.contrib.auth.tests.auth_backends import BackendTest, RowlevelBackendTest, AnonymousUserBackendTest, NoAnonymousUserBackendTest from django.contrib.auth.tests.basic import BASIC_TESTS from django.contrib.auth.tests.decorators import LoginRequiredTestCase from django.contrib.auth.tests.forms import FORM_TESTS...
stueken/flasky
refs/heads/master
app/auth/views.py
48
from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\ ...
onitake/ansible
refs/heads/devel
lib/ansible/modules/storage/netapp/netapp_e_storage_system.py
21
#!/usr/bin/python # (c) 2016, 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'], ...
newerthcom/savagerebirth
refs/heads/master
libs/python-2.72/Stackless/unittests/test_pickle.py
1
import sys import types import unittest import cPickle as pickle import gc from stackless import schedule, tasklet, stackless from support import StacklessTestCase #because test runner instances in the testsuite contain copies of the old stdin/stdout thingies, #we need to make it appear that pickling them is ok, ot...
leoliujie/odoo
refs/heads/8.0
openerp/addons/base/res/res_config.py
243
# -*- coding: 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 the GNU...
alexsanjoseph/duolingo-save-streak
refs/heads/master
requests/exceptions.py
93
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. """ ...
cwmat/flasky
refs/heads/master
config.py
79
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string' SSL_DISABLE = False SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_RECORD_QUERIES = True MAIL_SERVER = 'smtp.googlemail.com' MAIL_PORT = 587 MAI...
jhona22baz/blog-flask
refs/heads/master
python2.7/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/zxjdbc.py
34
# mysql/zxjdbc.py # Copyright (C) 2005-2012 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 """Support for the MySQL database via Jython's zxjdbc JDBC connector. JDBC Driver ---...
eerwitt/tensorflow
refs/heads/master
tensorflow/python/layers/base.py
5
# 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.org/licenses/LICENSE-2.0 # # Unless required by applica...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_entity_action_py3.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
centricular/gstreamer
refs/heads/meson-1.8
scripts/gst-plot-timeline.py
24
#!/usr/bin/env python # # based on plot-timeline.py by Federico Mena-Quintero <federico at ximian dotcom> # example: # GST_DEBUG_COLOR_MODE=off GST_DEBUG="*:3" gst-launch-1.0 2>debug.log audiotestsrc num-buffers=10 ! audioconvert ! alsasink # gst-plot-timeline.py debug.log --output=debug.png import math import opt...
rdhyee/osf.io
refs/heads/develop
website/addons/wiki/views.py
1
# -*- coding: utf-8 -*- import httplib as http import logging from bs4 import BeautifulSoup from flask import request from framework.mongo.utils import to_mongo_key from framework.exceptions import HTTPError from framework.auth.utils import privacy_info_handle from framework.auth.decorators import must_be_logged_in ...
jmighion/ansible
refs/heads/devel
lib/ansible/plugins/lookup/cartesian.py
141
# (c) 2013, Bradley Young <young.bradley@gmail.com> # (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 DOCUMENTATION = """ lookup: cartesian version_added...
invisiblek/python-for-android
refs/heads/master
python-modules/zope/zope/interface/declarations.py
50
############################################################################## # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTW...
rchillyard/INFO6205
refs/heads/master
Python/test/test_bqs/test_linkedlist.py
1
import unittest from bqs.linkedlist_elements import LinkedListElements class TestBagArray(unittest.TestCase): def test_linkedlist1(self): _list = LinkedListElements() self.assertTrue(_list.is_empty()) _list.add(1) self.assertEqual(1, _list.get_head()) self.assertFalse(_li...
detrout/telepathy-python
refs/heads/master
src/interfaces.py
9
# telepathy-python - Base classes defining the interfaces of the Telepathy framework # # Copyright (C) 2005, 2006 Collabora Limited # Copyright (C) 2005, 2006 Nokia Corporation # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as pub...
apophys/freeipa
refs/heads/master
ipatests/pytest_plugins/integration/env_config.py
1
# Authors: # Petr Viktorin <pviktori@redhat.com> # Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # 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 # t...
tbinjiayou/Odoo
refs/heads/master
addons/project_issue/__openerp__.py
52
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
jarvys/django-1.7-jdb
refs/heads/master
django/contrib/gis/geometry/backend/geos.py
114
from django.contrib.gis.geos import ( GEOSGeometry as Geometry, GEOSException as GeometryException) __all__ = ['Geometry', 'GeometryException']
jbedorf/tensorflow
refs/heads/master
tensorflow/python/framework/errors_impl.py
5
# 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.org/licenses/LICENSE-2.0 # # Unless required by applica...
tejasnikumbh/AllSAT
refs/heads/master
lib/python2.7/site-packages/numpy/core/tests/test_getlimits.py
70
""" Test functions for limits module. """ from __future__ import division, absolute_import, print_function from numpy.testing import * from numpy.core import finfo, iinfo from numpy import half, single, double, longdouble import numpy as np ################################################## class TestPythonFloat(T...
abhimm/Face-attractiveness-classification
refs/heads/master
knn_classifier_with_cv.py
1
__author__ = 'root' import scipy.io from k_0_100_nn_classifier import classify_knn import numpy # K = no of nearest neighbors, n = n-fold cross validation def classify_knn_with_cv(train_data, train_labels, K, n): no_instance_in_fold = int(len(train_labels)/n) i = 0 cv_result = list() for j in range(n...
egoid/baytree
refs/heads/master
lib/python2.7/site-packages/django/utils/encoding.py
64
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import codecs import datetime import locale from decimal import Decimal from django.utils import six from django.utils.functional import Promise from django.utils.six.moves.urllib.parse import quote, unquote if six.PY3: from urllib.parse import un...
grembo/buildbot
refs/heads/master
master/buildbot/test/unit/test_fake_httpclientservice.py
10
# 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...
slisson/intellij-community
refs/heads/master
python/testData/completion/classPrivateNotPublic.py
53
class Foo: __BOO = 1 z = Foo.__B<caret>
Onager/plaso
refs/heads/master
plaso/parsers/plist_plugins/airport.py
2
# -*- coding: utf-8 -*- """Plist parser plugin for Airport plist files.""" from dfdatetime import semantic_time as dfdatetime_semantic_time from dfdatetime import time_elements as dfdatetime_time_elements from plaso.containers import plist_event from plaso.containers import time_events from plaso.lib import definitio...
bitcf/bitcf
refs/heads/master
share/qt/extract_strings_qt.py
1294
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
jonalter/WhereTo
refs/heads/master
plugins/ti.alloy/plugin.py
16
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6...
kushal124/gensim
refs/heads/develop
gensim/test/test_phrases.py
52
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import sys from gensim import utils from gensim.models.phrases impo...
robovm/robovm-studio
refs/heads/master
python/testData/refactoring/pushdown/simple.before.py
166
class Foo: def foo(self): print("a") class Boo(Foo): def boo(self): print "rrrrr"
gnuhub/intellij-community
refs/heads/master
python/testData/inspections/PyMissingConstructorInspection/deepInheritance.py
83
class A(object): def __init__(self): print ("Constructor A was called") class B(A): pass class C(B): def <warning descr="Call to __init__ of super class is missed">__init__</warning>(self): print ("Constructor C was called")
carsongee/edx-platform
refs/heads/master
lms/djangoapps/instructor/tests/test_api.py
8
# -*- coding: utf-8 -*- """ Unit tests for instructor.api methods. """ # pylint: disable=E1111 import unittest import json import requests import datetime import ddt import random from urllib import quote from django.test import TestCase from nose.tools import raises from mock import Mock, patch from django.conf import...
Didacti/elixir
refs/heads/master
tests/test_autoload.py
1
""" test autoloaded entities """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six from sqlalchemy import Table, Column, ForeignKey from elixir import * import elixir def setup_entity_raise(cls): try: ...
mantidproject/mantid
refs/heads/master
Testing/PerformanceTests/reporters.py
6
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
hittu123/ruhive
refs/heads/master
src/profiles/admin.py
75
from __future__ import unicode_literals from django.contrib import admin from authtools.admin import NamedUserAdmin from .models import Profile from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse User = get_user_model() class UserProfileInline(admin.StackedInline): model =...
Tejal011089/medsyn2_lib
refs/heads/master
webnotes/app.py
30
import sys, os import json sys.path.insert(0, '.') sys.path.insert(0, 'app') sys.path.insert(0, 'lib') from werkzeug.wrappers import Request, Response from werkzeug.local import LocalManager from webnotes.middlewares import StaticDataMiddleware from werkzeug.exceptions import HTTPException, NotFound from werkzeug.con...
pigeonflight/strider-plone
refs/heads/master
docker/appengine/google/appengine/tools/devappserver2/python/pdb_sandbox.py
14
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.4/tests/regressiontests/fixtures_regress/tests.py
29
# -*- coding: utf-8 -*- # Unittests for fixtures. from __future__ import absolute_import import os import re try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core import management from django.core.management.base import CommandError from django.core.management...
ktnyt/chainer
refs/heads/master
chainer/functions/math/hyperbolic.py
2
from chainer import backend from chainer import function_node from chainer import utils from chainer.utils import type_check class Cosh(function_node.FunctionNode): @property def label(self): return 'cosh' def check_type_forward(self, in_types): type_check._argname(in_types, ('x',)) ...
Jc2k/libcloud
refs/heads/trunk
libcloud/test/dns/test_linode.py
3
# 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 use ...
brunetton/dia
refs/heads/master
samples/gobj-parse.py
7
''' Parses class definitions out of GObject based headers ToDo: - better parser aproach ;) - respect /*< public,protected,private >*/ - parse *.c ''' # Copyright (c) 2006, Hans Breuer <hans@breuer.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GN...