repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
kongseokhwan/kulcloud-prism-chromecast-agent | refs/heads/master | pychromecast/error.py | 6 | """
Errors to be used by PyChromecast.
"""
class PyChromecastError(Exception):
""" Base error for PyChromecast. """
pass
class NoChromecastFoundError(PyChromecastError):
"""
When a command has to auto-discover a Chromecast and cannot find one.
"""
pass
class MultipleChromecastsFoundError(P... |
mahak/neutron | refs/heads/master | neutron/db/dns_db.py | 2 | # Copyright (c) 2016 IBM
# 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 appli... |
ericchang/incubator-toree | refs/heads/master | etc/pip_install/toree/_version.py | 1 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
scrollback/kuma | refs/heads/master | vendor/packages/pylint/test/input/func_method_could_be_function.py | 6 | # pylint: disable-msg=R0903,R0922,W0232
"""test detection of method which could be a function"""
__revision__ = None
class Toto(object):
"""bla bal abl"""
def __init__(self):
self.aaa = 2
def regular_method(self):
"""this method is a real method since it access to self"""
... |
nuagenetworks/vspk-python | refs/heads/master | vspk/v5_0/fetchers/nuwirelessports_fetcher.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... |
DataDog/gunicorn | refs/heads/master | examples/frameworks/django/djangotest/testing/views.py | 7 | # Create your views here.
import csv
import os
from django import forms
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
import tempfile
class MsgForm(forms.Form):
subject = forms.CharField(max_length=100)
message = forms.CharField... |
ARMmbed/yotta_osx_installer | refs/heads/master | workspace/lib/python2.7/site-packages/cryptography/x509/name.py | 6 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import six
from cryptography import utils
from cryptography.x509.oid imp... |
0Chencc/CTFCrackTools | refs/heads/master | Lib/Lib/weakref.py | 17 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Changed for Jython to use MapMaker in Google Collections
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name colli... |
leohahn/TIM | refs/heads/master | TIM/urls.py | 1 | """TIM URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... |
romankagan/DDBWorkbench | refs/heads/master | python/testData/inspections/AddCallSuper_after.py | 9 | class A:
def __init__(self, c, a = 5, *arg, **kwargs):
pass
class B(A):
def __init__(self, r, c, b=6, *args, **kwargs):
A.__init__(self, c, *args, **kwargs)
print "Constructor B was called"
|
towerjoo/mindsbook | refs/heads/master | django/core/cache/backends/base.py | 15 | "Base Cache class."
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRuntimeWarning):
pass
# Memcached does not accept keys longer than this.
MEMCACHE_MAX_KEY_LENGTH = 250
cl... |
UnbDroid/robomagellan | refs/heads/master | Codigos/Raspberry/ROS/catkin_Leticia/build/catkin_generated/installspace/_setup_util.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistrib... |
the-adrian/KernotekV2.0 | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/testsuite/contrib/cache.py | 94 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.cache
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the cache system
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import unittest
import tempfile
import shutil
from werkzeug.testsuite import Werkzeug... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/scatterpolar/textfont/_size.py | 1 | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="scatterpolar.textfont", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... |
Pirata-Repository/Pirata | refs/heads/master | plugin.program.addoninstaller/t0mm0_common_addon.py | 37 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
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.
Th... |
ccpgames/eve-metrics | refs/heads/master | web2py/applications/admin/controllers/appadmin.py | 1 | # -*- coding: utf-8 -*-
# ##########################################################
# ## make sure administrator is on localhost
# ###########################################################
import os
import socket
import datetime
import copy
import gluon.contenttype
import gluon.fileutils
try:
im... |
dudepare/django | refs/heads/master | tests/resolve_url/urls.py | 357 | from django.conf.urls import url
from django.contrib.auth import views
urlpatterns = [
url(r'^accounts/logout/$', views.logout, name='logout'),
]
|
HorusCMF/Shop | refs/heads/master | py/botIRC.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import irclib
help(irclib.ServerConnection)
|
stackArmor/security_monkey | refs/heads/develop | security_monkey/common/jinja.py | 2 | # Copyright 2014 Netflix, 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... |
fpohtmeh/loki | refs/heads/master | plugins/currency/__init__.py | 1 | import urllib.request
from bs4 import BeautifulSoup
from algo.speech_synthesizer import SpeechSynthesizer
from devices.console import Console
from devices.speakers import Speakers
from plugins.plugin import Plugin
class Currency(Plugin):
def __init__(self, parent=None):
super().__init__(parent)
s... |
heri/openaccess | refs/heads/master | mitro-core/tools/nuke_identity.py | 23 | #!/usr/bin/env python
'''Deletes an identity and all related information.'''
import random
import sys
import time
import psycopg2
def group_by_column0(rows):
output = {}
for row in rows:
l = output.get(row[0], [])
l.append(row)
output[row[0]] = l
return output
_AUDIT_ACTION_DEL... |
igemsoftware/SYSU-Software2013 | refs/heads/master | project/Python27_32/Lib/test/test_pydoc.py | 13 | import sys
import os
import os.path
import difflib
import subprocess
import re
import pydoc
import inspect
import keyword
import unittest
import xml.etree
import test.test_support
from contextlib import contextmanager
from collections import namedtuple
from test.test_support import (
TESTFN, forget, rmtree, Environ... |
simberaj/interactions | refs/heads/master | modeling.py | 1 | # Modeling library - contains functions
import math, operator, common
from numpy import array
try:
from scipy.optimize import fsolve, fmin
except ImportError:
raise ImportError, 'modeling tools require an installed SCIPY package'
## INTERACTION CLASS - used in optimization - abstract superclass
class Optimizable... |
jesseditson/rethinkdb | refs/heads/next | test/interface/shard_balancing.py | 4 | #!/usr/bin/env python
# Copyright 2014 RethinkDB, all rights reserved.
"""The `interface.shard_balancing` test checks that RethinkDB generates balanced shards in a variety of scenarios."""
from __future__ import print_function
import pprint, os, sys, time
startTime = time.time()
sys.path.append(os.path.abspath(os.... |
giocalitri/django-guardian | refs/heads/devel | guardian/testapp/models.py | 14 | from __future__ import unicode_literals
from datetime import datetime
import django
from django.db import models
from django.contrib.admin.models import LogEntry
from guardian.mixins import GuardianUserMixin
from guardian.models import UserObjectPermissionBase
from guardian.models import GroupObjectPermissionBase
c... |
benjaminjkraft/django | refs/heads/master | django/conf/locale/id/formats.py | 504 | # -*- 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 = 'j N Y'
DATETIME_FORMAT = "j N Y, ... |
tangp3/gpdb | refs/heads/master | gpMgmt/bin/gppylib/test/behave/mgmt_utils/steps/logger.py | 19 | import os
import glob
from gppylib.test.behave_utils.utils import execute_sql_singleton
master_data_dir = os.environ.get('MASTER_DATA_DIRECTORY')
if master_data_dir is None:
raise Exception('Please set MASTER_DATA_DIRECTORY in environment')
def gp_fts_log_in_master_log_count(mdd):
return gp_in_master_log_cou... |
louisLouL/pair_trading | refs/heads/master | capstone_env/lib/python3.6/site-packages/setuptools/command/install_scripts.py | 454 | from distutils import log
import distutils.command.install_scripts as orig
import os
import sys
from pkg_resources import Distribution, PathMetadata, ensure_directory
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
... |
danicampora/micropython | refs/heads/master | tests/basics/setattr1.py | 69 | class A:
var = 132
def __init__(self):
self.var2 = 34
a = A()
setattr(a, "var", 123)
setattr(a, "var2", 56)
print(a.var)
print(a.var2)
try:
setattr(a, b'var3', 1)
except TypeError:
print('TypeError')
|
bregman-arie/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/_nxos_ip_interface.py | 16 | #!/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... |
cryptobanana/ansible | refs/heads/devel | lib/ansible/plugins/lookup/keyring.py | 82 | # (c) 2016, Samuel Boucher <boucher.samuel.c@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: keyring
author:
... |
837468220/python-for-android | refs/heads/master | python-modules/pybluez/bluetooth/__init__.py | 66 | import sys
import os
from btcommon import *
__version__ = 0.19
def _dbg(*args):
return
sys.stderr.write(*args)
sys.stderr.write("\n")
if sys.platform == "win32":
_dbg("trying widcomm")
have_widcomm = False
dll = "wbtapi.dll"
sysroot = os.getenv ("SystemRoot")
if os.path.exists (dll) o... |
betamos/apitools | refs/heads/master | samples/fusiontables_sample/__init__.py | 216 | # Copyright 2016 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 or agreed to in writing, ... |
Learningtribes/edx-platform | refs/heads/master | openedx/core/djangoapps/site_configuration/templatetags/configuration.py | 46 | """
Template tags and helper functions for displaying breadcrumbs in page titles
based on the current site.
"""
from django import template
from django.conf import settings
from django.templatetags.static import static
from django.contrib.staticfiles.storage import staticfiles_storage
from openedx.core.djangoapps.them... |
rajiteh/taiga-back | refs/heads/master | taiga/feedback/migrations/0001_initial.py | 29 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='FeedbackEntry',
fields=[
('id', models.AutoFiel... |
QinerTech/QinerApps | refs/heads/master | openerp/addons/analytic/wizard/__init__.py | 43 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import account_analytic_chart
|
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | toontown/town/TownBattleSOSPanelNEW.py | 1 | from panda3d.core import *
from toontown.toonbase.ToontownGlobals import *
from direct.gui.DirectGui import *
from direct.showbase import DirectObject
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import StateData
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocaliz... |
toofar/qutebrowser | refs/heads/master | tests/end2end/features/test_private_bdd.py | 5 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2017-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... |
benjamin9999/python-stix | refs/heads/master | stix/bindings/incident.py | 1 | # Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Thu Apr 11 15:06:24 2013 by generateDS.py version 2.9a.
#
import sys
import getopt
import re as re_
import cybox.bindings.cybox_core as cybox_core_bindi... |
grossws/ansible-modules-core | refs/heads/devel | web_infrastructure/django_manage.py | 36 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Scott Anderson <scottanderson42@gmail.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 o... |
mgogoulos/libcloud | refs/heads/trunk | docs/examples/container/ecs/instantiate_driver.py | 30 | from libcloud.container.types import Provider
from libcloud.container.providers import get_driver
cls = get_driver(Provider.ECS)
conn = cls(access_id='SDHFISJDIFJSIDFJ',
secret='THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H',
region='ap-southeast-2')
for container in conn.list_containers():
print(con... |
tedye/leetcode | refs/heads/master | tools/leetcode.076.Minimum Window Substring/leetcode.076.Minimum Window Substring.submission7.py | 2 | class Solution:
# @param {string} s
# @param {string} t
# @return {string}
def minWindow(self, s, t):
if not s: return ''
d = {}
book = set()
for i in t:
if i not in d:
d[i] = 1
book.add(i)
else:
... |
minhphung171093/GreenERP_V9 | refs/heads/master | openerp/addons/website_gengo/controllers/__init__.py | 7372 | import main
|
mhcrnl/PmwTkEx | refs/heads/master | java2s/bestway.py | 1 | import Tkinter as tk
from alarm import Alarm
class Demo1:
def __init__(self, master):
self.master= master
self.frame= tk.Frame(self.master)
self.button1=tk.Button(self.frame, text="new WIndow", width=25,
command=self.new_window)
self.button1.pack()
... |
balloob/home-assistant | refs/heads/dev | tests/util/test_ruamel_yaml.py | 21 | """Test Home Assistant ruamel.yaml loader."""
import os
from tempfile import mkdtemp
import pytest
from ruamel.yaml import YAML
from homeassistant.exceptions import HomeAssistantError
import homeassistant.util.ruamel_yaml as util_yaml
TEST_YAML_A = """\
title: My Awesome Home
# Include external resources
resources:
... |
RexFuzzle/sfepy | refs/heads/master | examples/linear_elasticity/prestress_fibres.py | 1 | r"""
Linear elasticity with a given prestress in one subdomain and a (pre)strain
fibre reinforcement in the other.
Find :math:`\ul{u}` such that:
.. math::
\int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u})
+ \int_{\Omega_1} \sigma_{ij} e_{ij}(\ul{v})
+ \int_{\Omega_2} D^f_{ijkl} e_{ij}(\ul{v}) \left(d... |
WASPACDC/hmdsm.repository | refs/heads/master | plugin.video.acdcIPTV/CustomPlayer.py | 88 | # -*- coding: utf-8 -*-
import xbmc
class MyXBMCPlayer(xbmc.Player):
def __init__( self, *args, **kwargs ):
self.is_active = True
self.urlplayed = False
self.pdialogue=None
print "#XBMCPlayer#"
#def play(self, url, listitem):
# print 'Now im playing... %s' % url
... |
xinst/NoahGameFrame | refs/heads/master | Dependencies/protobuf/gtest/test/gtest_output_test.py | 1733 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
trezorg/django | refs/heads/master | django/contrib/gis/maps/google/overlays.py | 405 | from django.utils.safestring import mark_safe
from django.contrib.gis.geos import fromstr, Point, LineString, LinearRing, Polygon
class GEvent(object):
"""
A Python wrapper for the Google GEvent object.
Events can be attached to any object derived from GOverlayBase with the
add_event() call.
For ... |
jenalgit/django | refs/heads/master | tests/view_tests/default_urls.py | 405 | from django.conf.urls import url
from django.contrib import admin
urlpatterns = [
# This is the same as in the default project template
url(r'^admin/', admin.site.urls),
]
|
spthaolt/VTK | refs/heads/5.10.1_vs2013 | Examples/Modelling/Python/faultLines.py | 42 | #!/usr/bin/env python
# Create a constrained Delaunay triangulation following fault lines. The
# fault lines serve as constraint edges in the Delaunay triangulation.
import vtk
from vtk.util.misc import vtkGetDataRoot
from vtk.util.colors import *
VTK_DATA_ROOT = vtkGetDataRoot()
# Generate some points by reading a ... |
mawimawi/datadjables | refs/heads/master | datadjables/datadjable_testing/tests/__init__.py | 12133432 | |
shinvdu/SmartQQBot | refs/heads/master | old_QQBot.py | 13 | # -*- coding: utf-8 -*-
# Code by Yinzo: https://github.com/Yinzo
# Origin repository: https://github.com/Yinzo/SmartQQBot
import re
import random
import json
import os
import sys
import datetime
import time
import threading
import logging
import ConfigParser
from HttpClient import HttpClient
reload(sys)
s... |
Suwings/Suwings.github.io | refs/heads/master | mine/parallel time/PapaProject/PythonGet/note/pyquery_save.py | 1 | import os
import time
from urllib.parse import urlparse
import pymysql
from pyquery import PyQuery as pquery
import requests
# 类似的表
# 标题 text 不可空
# 链接 text 不可空
# 时间 time
# 爬取时间 time
# 网站标题
# 网站编码
# 简介 text(24)
# 内容指针 int
# try:
# BD_coon = pymysql.connect(
# host='127.0.0.1', user='root', passwd='toortoo... |
hzwjava/mongo-connector | refs/heads/master | mongo_connector/locking_dict.py | 99 | import threading
class LockingDict():
def __init__(self):
self.dict = {}
self.lock = threading.Lock()
def __enter__(self):
self.acquire_lock()
return self
def __exit__(self, type, value, traceback):
self.release_lock()
def get_dict(self):
return sel... |
PearsonIOKI/compose-forum | refs/heads/master | askbot/migrations/0040_delete_old_tag_filter_strategies.py | 20 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from askbot import const
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model country fields to the model auth_user
db.delete_column(u'auth_... |
nullishzero/Portage | refs/heads/master | pym/_emerge/Task.py | 16 | # Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.util.SlotObject import SlotObject
class Task(SlotObject):
__slots__ = ("_hash_key", "_hash_value")
def __eq__(self, other):
try:
return self._hash_key == other._hash_key
except AttributeEr... |
eSedano/hoplite | refs/heads/master | 1.0/lib/metis.py | 1 | #
# --------------------------------------------------------------------------------------------------
# __ ______ ____ __ ________________
# / / / / __ \/ __ \/ / / _/_ __/ ____/
# / /_/ / / / / /_/ / / / / / / / __/
# / __ / /_/ / ____/ /____/ / / / / /___
# /_/ /_/\____/_/ /_____/___/ /_/... |
jjlee9/openthread | refs/heads/master | tests/scripts/thread-cert/Cert_5_3_04_AddressMapCache.py | 5 | #!/usr/bin/python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# not... |
eleonrk/SickRage | refs/heads/master | lib/pbr/options.py | 99 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
cschnei3/forseti-security | refs/heads/master | google/cloud/security/common/data_access/sql_queries/create_tables.py | 2 | # Copyright 2017 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 or agreed to in writing, s... |
alexhersh/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes-master/hooks/setup.py | 149 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/ipykernel/tests/test_jsonutil.py | 8 | # coding: utf-8
"""Test suite for our JSON utilities."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import sys
if sys.version_info < (3,):
from base64 import decodestring as decodebytes
else:
from base64 import decodebytes
from datetime i... |
gnieboer/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/monitors.py | 14 | # 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... |
jinluyuan/osf.io | refs/heads/develop | website/addons/wiki/tests/config.py | 66 | EXAMPLE_DOCS = [ # Collection stored as "docs"
{
"_data": "one two",
"_type": "http://sharejs.org/types/textv1",
"_v": 8,
"_m": {
"mtime": 1415654366808,
"ctime": 1415654358668
},
"_id": "26aabd89-541b-5c02-9e6a-ad332ba43118"
},
{
... |
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-59/files/myvenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langthaimodel.py | 2929 | ######################## 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 R... |
has2k1/numpy | refs/heads/master | numpy/distutils/command/build_src.py | 141 | """ Build swig, f2py, pyrex sources.
"""
from __future__ import division, absolute_import, print_function
import os
import re
import sys
import shlex
import copy
from distutils.command import build_ext
from distutils.dep_util import newer_group, newer
from distutils.util import get_platform
from distutils.errors impo... |
aam-at/tensorflow | refs/heads/master | tensorflow/python/lib/io/file_io.py | 3 | # 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... |
sserrot/champion_relationships | refs/heads/master | venv/Lib/site-packages/nbconvert/tests/test_nbconvertapp.py | 1 | # -*- coding: utf-8 -*-
"""Test NbConvertApp"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import io
from .base import TestsBase
from ..postprocessors import PostProcessorBase
from ..tests.utils import onlyif_cmds_exist
from nbconvert import nbconve... |
DDShadoww/grab | refs/heads/master | grab/response.py | 12 | # Back-ward compatibility
from grab.document import * # noqa
from grab.document import Document as Response # noqa
|
gojira/tensorflow | refs/heads/master | tensorflow/contrib/deprecated/__init__.py | 67 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
vitan/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex_multi_apps/__init__.py | 12133432 | |
dhermes/google-cloud-python | refs/heads/master | redis/google/cloud/redis_v1beta1/gapic/__init__.py | 12133432 | |
mcldev/geonode | refs/heads/master | geonode/layers/migrations/__init__.py | 12133432 | |
piquadrat/django | refs/heads/master | django/core/management/base.py | 21 | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
import os
import sys
from argparse import ArgumentParser
from io import TextIOBase
import django
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
... |
SerCeMan/intellij-community | refs/heads/master | python/testData/wrap/WrapInArgumentList.py | 83 | def foo(abracadabra1, abracadabra2, abracadabra3, abracadabra4, abracadabra5<caret> |
denis-pitul/django | refs/heads/master | django/contrib/auth/__init__.py | 387 | 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... |
sergio-incaser/odoo | refs/heads/8.0 | openerp/report/print_xml.py | 338 | # -*- 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... |
droidroidz/USCC_R970_kernel | refs/heads/master | scripts/rt-tester/rt-tester.py | 11005 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... |
sjsucohort6/openstack | refs/heads/master | python/venv/lib/python2.7/site-packages/openstack/tests/unit/orchestration/v1/test_stack.py | 3 | # 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... |
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/cloud/azure/azure_rm_mysqlserver_facts.py | 13 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# 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',
... |
austinzheng/swift | refs/heads/master | utils/swift_build_support/swift_build_support/xcrun.py | 47 | # swift_build_support/xcrun.py - Invoke xcrun from Python -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for ... |
conejoninja/plugin.video.pelisalacarta | refs/heads/master | pelisalacarta/channels/pordede.py | 3 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para pordede
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core imp... |
sdgdsffdsfff/Cmdb_Puppet | refs/heads/master | cmdb/manage.py | 2 | #!/usr/local/python/bin/python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "simplecmdb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
dkarakats/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_error_module.py | 22 | """
Tests for ErrorModule and NonStaffErrorModule
"""
import unittest
from xmodule.tests import get_test_system
from xmodule.error_module import ErrorDescriptor, ErrorModule, NonStaffErrorDescriptor
from xmodule.modulestore.xml import CourseLocationManager
from opaque_keys.edx.locations import SlashSeparatedCourseKey, ... |
Xero-Hige/Magus | refs/heads/magus-master | src/libs/string_generalizer.py | 1 | # Based on: https://gist.github.com/topicus/4611549
# Updated on 13/11/2017 with ñ skip
import sys
import unicodedata
def strip_accents(s):
stripped = [c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn']
try:
for i in range(len(stripped)):
if s[i] == 'Ñ' or s[i]... |
bd339/servo | refs/heads/master | tests/wpt/web-platform-tests/old-tests/webdriver/user_input/click_test.py | 141 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions, wait
class ClickTest(base_tes... |
adw0rd/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/modeltests/custom_columns/__init__.py | 12133432 | |
throwable-one/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/modeltests/reverse_lookup/__init__.py | 12133432 | |
dahlstrom-g/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddImportQuickFixTest/existingImportsAlwaysSuggestedFirstEvenIfLonger/long/pkg/__init__.py | 12133432 | |
Coelhon/MasterRepo.repository | refs/heads/master | plugin.video.ZemTV-shani/websocket/_socket.py | 52 | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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, ... |
camisatx/pySecMaster | refs/heads/master | pySecMaster/query_database.py | 1 | import pandas as pd
import psycopg2
import time
__author__ = 'Josh Schertz'
__copyright__ = 'Copyright (C) 2018 Josh Schertz'
__description__ = 'An automated system to store and maintain financial data.'
__email__ = 'josh[AT]joshschertz[DOT]com'
__license__ = 'GNU AGPLv3'
__maintainer__ = 'Josh Schertz'
__status__ = '... |
pudquick/lightblue-0.4 | refs/heads/master | build/lib/lightblue/_macutil.py | 68 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... |
haxwithaxe/supybot | refs/heads/master | plugins/Format/config.py | 15 | ###
# Copyright (c) 2004, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... |
nvoron23/paragraph2vec | refs/heads/master | gensim/parsing/porter.py | 86 | #!/usr/bin/env python
"""Porter Stemming Algorithm
This is the Porter stemming algorithm, ported to Python from the
version coded up in ANSI C by the author. It may be be regarded
as canonical, in that it follows the algorithm presented in
Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
no. 3, pp 1... |
voidcc/PCTRL | refs/heads/master | pox/proto/__init__.py | 44 | # Copyright 2013 James McCauley
#
# 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 writi... |
soulmachine/scikit-learn | refs/heads/master | sklearn/neighbors/kde.py | 4 | """
Kernel Density Estimation
-------------------------
"""
# Author: Jake Vanderplas <jakevdp@cs.washington.edu>
import numpy as np
from scipy.special import gammainc
from ..base import BaseEstimator
from ..utils import check_array, check_random_state
from ..utils.extmath import row_norms
from .ball_tree import BallT... |
CognitionGuidedSurgery/msml | refs/heads/release_cand_1.0 | src/msml/model/alphabet/operator/python.py | 1 | from .base import *
__author__ = 'Alexander Weigl'
from .... import log
from ....log import error
from ...sequence import executeOperatorSequence
class PythonOperator(Operator):
"""Operator for Python functions.
"""
def __init__(self, name, input=None, output=None, parameters=None, runtime=None, meta=N... |
diegosarmentero/mydownloads | refs/heads/master | mydownloads_web/mydownloads_web/settings.py | 1 | # Django settings for mydownloads_web project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', ... |
apixandru/intellij-community | refs/heads/master | python/testData/resolve/multiFile/fromNamespacePackageImportModule/p1/m1.py | 819 | def foo():
pass |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.