repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
rdhyee/osf.io
refs/heads/develop
api/base/api_globals.py
76
"""Global variables related to Django requests Made available in a separate file so as to be importable by Flask code, before (or in the absence of) Django """ import threading api_globals = threading.local() # Store a reference to the current Django request. Threads may be reused; empty after request. api_globals.r...
bratsche/Neutron-Drive
refs/heads/master
google_appengine/lib/django_1_2/django/utils/synch.py
376
""" Synchronization primitives: - reader-writer lock (preference to writers) (Contributed to Django by eugene@lazutkin.com) """ try: import threading except ImportError: import dummy_threading as threading class RWLock: """ Classic implementation of reader-writer lock with preference to writers....
ybellavance/python-for-android
refs/heads/master
python-modules/twisted/twisted/application/__init__.py
81
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """ Configuration objects for Twisted Applications """
yousifAkbar/projectAkbar
refs/heads/master
projectAkbar/blog/models.py
1
from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.core.urlresolvers import reverse class PublishedManager(models.Manager): def get_queryset(self): return super(PublishedManager, self).get_queryset().filter(status='published') class Pos...
marc-sensenich/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_facts.py
9
#!/usr/bin/python # # Copyright (c) 2018 # Gustavo Muniz do Carmo <gustavo@esign.com.br> # 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 ANSIB...
OneBitSoftware/jwtSample
refs/heads/master
src/Spa/env1/Lib/site-packages/jinja2/nodes.py
342
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
MapStory/geonode
refs/heads/master
geonode/base/management/commands/migrate_notifications.py
12
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
diofant/diofant
refs/heads/master
diofant/utilities/codegen.py
1
""" module for generating C, C++, Fortran77, Fortran90 and Octave/Matlab routines that evaluate diofant expressions. This module is work in progress. Only the milestones with a '+' character in the list below have been completed. --- How is diofant.utilities.codegen different from diofant.printing.ccode? --- We con...
liberatorqjw/scikit-learn
refs/heads/master
sklearn/cluster/tests/test_dbscan.py
16
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from numpy.testing import assert_raises from scipy.spatial import distance from sklearn.utils.testing import assert_equal from sklearn.cluster.dbscan_ import DBSCAN, dbscan from .common import generate_clustered_data from sklearn.metrics...
navcat/wechatpy
refs/heads/master
wechatpy/client/api/template.py
7
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from wechatpy.client.api.base import BaseWeChatAPI class WeChatTemplate(BaseWeChatAPI): def set_industry(self, industry_id1, industry_id2): """ 设置所属行业 详情请参考 http://mp.weixin.qq.com/wiki/17/304c1885ea...
robin-lai/scikit-learn
refs/heads/master
sklearn/linear_model/tests/test_sgd.py
68
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
gao-feng/auditns
refs/heads/master
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...
landlab/landlab
refs/heads/master
tests/components/species_evolution/test_species_evolver.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- """SpeciesEvolver tests.""" from collections import Counter import numpy as np import pandas as pd import pytest from landlab import RasterModelGrid from landlab.components import SpeciesEvolver from landlab.components.species_evolution.base_taxon import Taxon class Tes...
suselrd/django-wflow
refs/heads/master
workflows/admin.py
2
# coding=utf-8 from django.contrib import admin from .models import State from .models import StateInheritanceBlock from .models import StatePermissionRelation from .models import StateObjectRelation from .models import Transition from .models import Workflow from .models import WorkflowObjectRelation from .models impo...
ghchinoy/tensorflow
refs/heads/master
tensorflow/contrib/feature_column/python/feature_column/sequence_feature_column_integration_test.py
14
# 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...
behzadnouri/scipy
refs/heads/master
scipy/optimize/_trustregion_ncg.py
135
"""Newton-CG trust-region optimization.""" from __future__ import division, print_function, absolute_import import math import numpy as np import scipy.linalg from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem) __all__ = [] def _minimize_trust_ncg(fun, x0, args=(), jac=None, hess=None, hess...
zheguang/voltdb
refs/heads/master
tools/cf-generator.py
2
#!/usr/bin/env python # This Python script generates AWS CloudFormation templates to start a VoltDB # cluster. Run the program without any arguments to see usage. # # For details on the CloudFormation template, you can check out the doc page at # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.ht...
darkleons/BE
refs/heads/master
addons/product_margin/__init__.py
444
# -*- 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...
bikong2/django
refs/heads/master
tests/sites_framework/models.py
281
from django.contrib.sites.managers import CurrentSiteManager from django.contrib.sites.models import Site from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class AbstractArticle(models.Model): title = models.CharField(max_length=50) object...
hbhzwj/SADIT
refs/heads/master
Configure/MVAnomaly.py
1
from __future__ import print_function, division, absolute_import from .MarkovAnomaly import MarkovAnomaly class MVAnomaly(MarkovAnomaly): @property def joint_dist(self): return self.ano_desc['change']['joint_dist'] def del_mod(self, node, m_id, mod): del node.modulator[m_id] for row in mod...
PongPi/isl-odoo
refs/heads/8.0
addons/hw_scanner/__init__.py
1894
# -*- 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...
GunoH/intellij-community
refs/heads/master
python/testData/refactoring/changeSignature/nonStandardSelfParameterName.before.py
10
class MyClass: def me<caret>thod(s, x, y): pass MyClass().method(1, 2)
uclouvain/OSIS-Louvain
refs/heads/master
base/models/certificate_aim.py
2
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
janezkranjc/clowdflows
refs/heads/master
workflows/noise/settings.py
95
import os # === STANDARD PACKAGE SETTINGS === PACKAGE_ROOT = os.path.dirname(__file__) # === AUTO IMPORT OPTIONS === #If auto_import_package_data is true then given data file is automatically imported when ClowdFlows project is newly deployed or refreshed from git AUTO_IMPORT_DB = True #For auto_import_packag...
Mushirahmed/gnuradio
refs/heads/master
gr-filter/examples/fmtest.py
12
#!/usr/bin/env python # # Copyright 2009,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
TheWardoctor/Wardoctors-repo
refs/heads/master
plugin.video.saltsrd.lite/scrapers/twoddl_scraper.py
6
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
chvrga/outdoor-explorer
refs/heads/master
java/play-1.4.4/python/Lib/sets.py
4
"""Classes to represent arbitrary sets (including sets of sets). This module implements sets using dictionaries whose values are ignored. The usual operations (union, intersection, deletion, etc.) are provided as both methods and operators. Important: sets are not sequences! While they support 'x in s', 'len...
guardicore/monkey
refs/heads/develop
monkey/monkey_island/cc/services/remote_run_aws.py
1
import logging from common.cloud.aws.aws_instance import AwsInstance from common.cloud.aws.aws_service import AwsService from common.cmd.aws.aws_cmd_runner import AwsCmdRunner from common.cmd.cmd import Cmd from common.cmd.cmd_runner import CmdRunner __author__ = "itay.mizeretz" logger = logging.getLogger(__name__) ...
sumanthha/kannadaflix
refs/heads/master
django/contrib/gis/db/backends/mysql/creation.py
613
from django.db.backends.mysql.creation import DatabaseCreation class MySQLCreation(DatabaseCreation): def sql_indexes_for_field(self, model, f, style): from django.contrib.gis.db.models.fields import GeometryField output = super(MySQLCreation, self).sql_indexes_for_field(model, f, style) ...
ant9000/yowsup
refs/heads/master
yowsup/layers/protocol_iq/protocolentities/iq_result_pong.py
70
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .iq_result import ResultIqProtocolEntity class PongResultIqProtocolEntity(ResultIqProtocolEntity): ''' <iq type="result" xmlns="w:p" to="self.domain" id="1416174955-ping"> </iq> ''' def __init__(self, to, _id = None): super(Po...
astex/amazing
refs/heads/master
amazing/models/user.py
1
from amazing.lib.database import db class User(db.Model): __tablename__ = 'user' id_ = db.Column('id', db.Integer, primary_key=True) name = db.Column(db.Unicode(length=255), nullable=False)
noironetworks/heat
refs/heads/master
heat/tests/engine/test_check_resource.py
1
# Copyright (c) 2016 Hewlett-Packard Development Company, L.P. # # 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...
Justin-Yuan/Image2Music-Generator
refs/heads/master
library/jython2.5.3/Lib/UserDict.py
117
"""A more or less complete user-defined wrapper around dictionary objects.""" class UserDict: def __init__(self, dict=None, **kwargs): self.data = {} if dict is not None: self.update(dict) if len(kwargs): self.update(kwargs) def __repr__(self): return repr(self.d...
Glasgow2015/team-10
refs/heads/master
env/lib/python2.7/site-packages/classytags/compat.py
12
# -*- coding: utf-8 -*- try: # pragma: no cover compat_basestring = basestring except NameError: compat_basestring = str try: compat_next = next except NameError: # pragma: no cover def compat_next(it): return it.next()
michalliu/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/imghdr.py
64
"""Recognize image file formats based on their first few bytes.""" __all__ = ["what"] #-------------------------# # Recognize image headers # #-------------------------# def what(file, h=None): f = None try: if h is None: if isinstance(file, basestring): f = open(file, 'rb...
minorua/QGIS
refs/heads/master
tests/src/python/test_authmanager_pki_postgres.py
11
# -*- coding: utf-8 -*- """ Tests for auth manager PKI access to postgres. This is an integration test for QGIS Desktop Auth Manager postgres provider that checks if QGIS can use a stored auth manager auth configuration to access a PKI protected postgres. Configuration from the environment: * QGIS_POSTGRES_SERVE...
Hubert51/AutoGrading
refs/heads/master
learning/web_Haotian/venv/Lib/encodings/cp866.py
272
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
FrenchSoup/Clever
refs/heads/master
tools/disassembler.py
1
# # Emulator engine main class # def dhex(number: int) -> str: return "0x{:04x}".format(number) def x0000(opcode): # Clear screen if opcode == 0x00E0: return "CLS" # Return if opcode == 0x00EE: return "RET" # 1XXX => Jump(XXX) def x1000(opcode): return "JP " + dhex(opcode & ...
Jgarcia-IAS/SITE
refs/heads/master
addons/stock/wizard/__init__.py
323
# -*- 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...
iglpdc/nipype
refs/heads/master
nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py
12
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..preprocess import MRTransform def test_MRTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), debug=dict(argstr='-debug', position=1, ), environ=dict(nohash=True, usedefault=True, ...
chevah/python-cffi
refs/heads/master
testing/cffi0/snippets/distutils_module/setup.py
6
from distutils.core import setup import snip_basic_verify setup( py_modules=['snip_basic_verify'], ext_modules=[snip_basic_verify.ffi.verifier.get_extension()])
cloakedcode/CouchPotatoServer
refs/heads/master
libs/html5lib/tokenizer.py
100
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset try: from collections import deque except ImportError: from utils import deque from constants import spaceCharacters from constants import ent...
Dudy/google-appengine-wx-launcher
refs/heads/master
setup.py
28
#!/usr/bin/env python # # Copyright 2008 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...
yagweb/pythonnet
refs/heads/master
src/tests/test_method.py
1
# -*- coding: utf-8 -*- """Test CLR method support.""" import System import pytest from Python.Test import MethodTest from ._compat import PY2, long, unichr def test_instance_method_descriptor(): """Test instance method descriptor behavior.""" with pytest.raises(AttributeError): MethodTest().Publi...
cltk/cltk
refs/heads/master
src/cltk/stops/gmh.py
4
""" Middle High German: "Eleftheria Chatziargyriou <ele.hatzy@gmail.com>" using TFIDF method. Source of texts: http://www.gutenberg.org/files/22636/22636-h/22636-h.htm , http://texte.mediaevum.de/12mhd.htm """ STOPS = [ "abe", "aber", "al", "alle", "allen", "aller", "alleȥ", "als", "...
nickcdryan/rep
refs/heads/master
rep/test/test_notebooks.py
4
from __future__ import division, print_function, absolute_import import os import re from IPython import nbformat from IPython.kernel import manager try: from Queue import Empty except ImportError: # python 3, so that file at least executable from queue import Empty # Ignore these files IGNORE = re.compil...
HesselTjeerdsma/Cyber-Physical-Pacman-Game
refs/heads/master
Algor/flask/lib/python2.7/site-packages/unidecode/x096.py
252
data = ( 'Fa ', # 0x00 'Ge ', # 0x01 'He ', # 0x02 'Kun ', # 0x03 'Jiu ', # 0x04 'Yue ', # 0x05 'Lang ', # 0x06 'Du ', # 0x07 'Yu ', # 0x08 'Yan ', # 0x09 'Chang ', # 0x0a 'Xi ', # 0x0b 'Wen ', # 0x0c 'Hun ', # 0x0d 'Yan ', # 0x0e 'E ', # 0x0f 'Chan ', # 0x10 'Lan ', ...
codeforamerica/skillcamp
refs/heads/master
ENV/lib/python2.7/site-packages/psycopg2/extras.py
16
"""Miscellaneous goodies for psycopg2 This module is a generic place used to hold little helper functions and classes until a better place in the distribution is found. """ # psycopg/extras.py - miscellaneous extra goodies for psycopg # # Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 is f...
hookehu/utility
refs/heads/master
editors/studio/act_editor/act_editor.py
1
#-*- coding:utf-8 -*- import wx class act_editor(wx.Panel): def __init__(self, parent): wx.Frame.__init__(self, parent, size = (500, 500)) self.control = wx.TextCtrl(self, value='act', style=wx.TE_MULTILINE) self.Show(True) def init(parent): frame = act_editor(parent) return frame if __name...
CTSRD-SOAAP/chromium-42.0.2311.135
refs/heads/master
chrome/browser/resources/chromeos/chromevox/tools/check_chromevox.py
18
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Uses the closure compiler to check the ChromeVox javascript files. With no arguments, checks all ChromeVox scripts. If any argume...
shipci/sympy
refs/heads/master
sympy/physics/unitsystems/tests/test_dimensionsystem.py
92
# -*- coding: utf-8 -*- from sympy import Matrix, eye from sympy.physics.unitsystems.dimensions import Dimension, DimensionSystem from sympy.utilities.pytest import raises length = Dimension(name="length", symbol="L", length=1) mass = Dimension(name="mass", symbol="M", mass=1) time = Dimension(name="time", symbol="T"...
patriciolobos/desa8
refs/heads/master
openerp/addons/web/controllers/main.py
5
# -*- coding: utf-8 -*- import ast import base64 import csv import functools import glob import itertools import jinja2 import logging import operator import datetime import hashlib import os import re import simplejson import sys import time import urllib2 import zlib from xml.etree import ElementTree from cStringIO ...
mediatum/mediatum
refs/heads/master
web/common/sort.py
1
""" mediatum - a multimedia content repository Copyright (C) 2019 Kerstin Lahr <Kerstin.Lahr@ub.tum.de> 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 ...
PersonifyInc/omaha-server
refs/heads/master
uncensor_proxy_manage.py
1
from twisted.web import resource from db_helper import DbHelper from config import Config import urllib import pycountry class UncensorProxyManageResource(resource.Resource): isLeaf = True pathFromRoot = '/service/admin/uncensorp' def render_GET(self, request): macdb = DbHelper() res = macdb.uncensorp_f...
hlin117/statsmodels
refs/heads/master
statsmodels/sandbox/tsa/diffusion2.py
38
""" Diffusion 2: jump diffusion, stochastic volatility, stochastic time Created on Tue Dec 08 15:03:49 2009 Author: josef-pktd following Meucci License: BSD contains: CIRSubordinatedBrownian Heston IG JumpDiffusionKou JumpDiffusionMerton NIG VG References ---------- Attilio Meucci, Review of Discrete and Contin...
VigTech/Vigtech-Services
refs/heads/master
env/lib/python2.7/site-packages/django/contrib/postgres/fields/array.py
86
import json from django.contrib.postgres import lookups from django.contrib.postgres.forms import SimpleArrayField from django.contrib.postgres.validators import ArrayMaxLengthValidator from django.core import checks, exceptions from django.db.models import Field, IntegerField, Transform from django.utils import six f...
devs4v/devs4v-information-retrieval15
refs/heads/master
project/venv/lib/python2.7/site-packages/psycopg2/tests/test_psycopg2_dbapi20.py
71
#!/usr/bin/env python # test_psycopg2_dbapi20.py - DB API conformance test for psycopg2 # # Copyright (C) 2006-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 Softwa...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Source/Python/Lib/python27/multiprocessing/forking.py
45
# # Module for starting a process object using os.fork() or CreateProcess() # # multiprocessing/forking.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: ...
zkraime/osf.io
refs/heads/develop
website/identifiers/model.py
58
# -*- coding: utf-8 -*- from bson import ObjectId from modularodm import Q from modularodm import fields from modularodm.storage.base import KeyExistsException from framework.mongo import StoredObject from framework.mongo.utils import unique_on @unique_on(['referent.0', 'referent.1', 'category']) class Identifier(...
mKeRix/home-assistant
refs/heads/dev
homeassistant/components/neato/sensor.py
3
"""Support for Neato sensors.""" from datetime import timedelta import logging from pybotvac.exceptions import NeatoRobotException from homeassistant.components.sensor import DEVICE_CLASS_BATTERY from homeassistant.const import UNIT_PERCENTAGE from homeassistant.helpers.entity import Entity from .const import NEATO_...
sss/calibre-at-bzr
refs/heads/upstream/master
src/calibre/utils/rss_gen.py
24
"""PyRSS2Gen - A Python library for generating RSS 2.0 feeds.""" __name__ = "PyRSS2Gen" __version__ = (1, 0, 0) __author__ = "Andrew Dalke <dalke@dalkescientific.com>" _generator_name = __name__ + "-" + ".".join(map(str, __version__)) import datetime # Could make this the base class; will need to add 'publish' clas...
oudalab/fajita
refs/heads/master
pythonAPI/flask/lib/python3.5/site-packages/chardet/charsetprober.py
289
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
cfriedt/gnuradio
refs/heads/master
gr-digital/python/digital/qa_crc32_bb.py
31
#!/usr/bin/env python # Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
cognitiveclass/edx-platform
refs/heads/master
common/test/acceptance/pages/lms/teams.py
29
# -*- coding: utf-8 -*- """ Teams pages. """ from .course_page import CoursePage from .discussion import InlineDiscussionPage from ..common.paging import PaginatedUIMixin from ...pages.common.utils import confirm_prompt from .fields import FieldsMixin TOPIC_CARD_CSS = 'div.wrapper-card-core' CARD_TITLE_CSS = 'h3.ca...
godbyk/vrjuggler-upstream-old
refs/heads/master
modules/vrjuggler/samples/OSG/simple/osgNav/remotenav/Viewer/MainWindowBase.py
7
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'MainWindowBase.ui' # # Created: Thu Nov 27 02:34:21 2003 # by: The PyQt User Interface Compiler (pyuic) 3.8.1 # # WARNING! All changes made in this file will be lost! import sys from qt import * image0_data = [ "72 72 309 2", "Qt c N...
lonewolf07/coala
refs/heads/master
coalib/tests/misc/DecoratorsTest.py
16
import unittest from coalib.misc.Decorators import ( arguments_to_lists, enforce_signature, generate_eq, generate_ordering, generate_repr, yield_once) class YieldOnceTest(unittest.TestCase): def test_yield_once(self): @yield_once def iterate_over_list(arg_list): for arg in ar...
a25kk/lra
refs/heads/master
src/lra.sitecontent/lra/sitecontent/upgrades.py
1
# -*- coding: utf-8 -*- # Module providing version specific upgrade steps import logging from zope.globalrequest import getRequest from plone import api from plone.app.upgrade.utils import cleanUpSkinsTool default_profile = 'profile-lra.sitecontent:default' log = logging.getLogger(__name__) def remove_ploneformgen(...
jcoenencom/raspVMC
refs/heads/master
VMC.py
1
import binascii import socket import time import re class AutoVivification(dict): """Implementation of perl's autovivification feature.""" def __getitem__(self, item): try: return dict.__getitem__(self, item) except KeyError: value = self[item] = type(self)() ...
opendatateam/udata
refs/heads/master
udata/api/oauth2.py
2
''' OAuth 2 serveur implementation based on Authlib. See the documentatiosn here: - https://docs.authlib.org/en/latest/flask/oauth2.html - https://docs.authlib.org/en/latest/spec/rfc6749.html - https://docs.authlib.org/en/latest/spec/rfc6750.html - https://docs.authlib.org/en/latest/spec/rfc7009.html Authlib prov...
sajuptpm/manila
refs/heads/master
manila/quota.py
3
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
Sharecare/cyclops
refs/heads/master
lib/passlib/utils/__init__.py
21
"""passlib.utils -- helpers for writing password hashes""" #============================================================================= # imports #============================================================================= from passlib.utils.compat import PYPY, JYTHON # core from base64 import b64encode, b64decode ...
xfournet/intellij-community
refs/heads/master
python/testData/refactoring/move/moveNamespacePackage1/after/src/b.py
79
import nssubpkg.a print(nssubpkg.a.VAR)
HeraldStudio/APN_py
refs/heads/master
main.py
1
# -*- coding: utf-8 -*- from flask import * import config import db app = Flask(__name__) @app.route('/') def index(): abort(404) @app.route('/apn/reg', methods=['POST']) def apn_reg(): token = request.form['token'] try: length = len(token) if (length == 64): db.set_token(token) return ("success", 2...
ryano144/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/core/management/commands/startproject.py
322
from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module import os import re from random import choice class Command(LabelCommand): help = "Creates a Django project directory structure for the given project name in the current directory." ...
charanpald/sandbox
refs/heads/master
sandbox/predictors/ABC.py
1
""" A class to perform Approximate Bayesian Computation which simulates observations from a posterior distribution without the use of liklihoods. """ import os import logging import numpy import multiprocessing from datetime import datetime class ABC(multiprocessing.Process): def __init__(self, args, epsilon, Sp...
mogeiwang/nest
refs/heads/master
extras/ConnPlotter/examples/complex.py
13
# -*- coding: utf-8 -*- # # complex.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (...
ddki/my_study_project
refs/heads/master
language/python/frameworks/flask/venv/lib/python2.7/site-packages/pkg_resources/extern/__init__.py
245
import sys class VendorImporter: """ A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. """ def __init__(self, root_name, vendored_names=(), vendor_pkg=None): self.root_name = root_name self.vendored_names = set(v...
mitsuhiko/django
refs/heads/master
django/contrib/localflavor/za/za_provinces.py
544
from django.utils.translation import gettext_lazy as _ PROVINCE_CHOICES = ( ('EC', _('Eastern Cape')), ('FS', _('Free State')), ('GP', _('Gauteng')), ('KN', _('KwaZulu-Natal')), ('LP', _('Limpopo')), ('MP', _('Mpumalanga')), ('NC', _('Northern Cape')), ('NW', _('North West')), ('WC'...
balanced/frl
refs/heads/master
frl/client.py
1
from __future__ import unicode_literals import json from . import RequestLogger class ClientRequestLogger(RequestLogger): """ Used for implementing a request logger on the client side (e.g. in a remote client for an API) using the requests library. Example ```python logger = frl.client.Cli...
campbe13/openhatch
refs/heads/master
vendor/packages/kombu/examples/simple_send.py
31
""" Example that sends a single message and exits using the simple interface. You can use `simple_receive.py` (or `complete_receive.py`) to receive the message sent. """ from kombu import Connection #: Create connection #: If hostname, userid, password and virtual_host is not specified #: the values below are the d...
wbc2010/django1.2.5
refs/heads/master
django/contrib/gis/db/backends/oracle/adapter.py
624
from cx_Oracle import CLOB from django.contrib.gis.db.backends.adapter import WKTAdapter class OracleSpatialAdapter(WKTAdapter): input_size = CLOB
ryfeus/lambda-packs
refs/heads/master
Selenium_PhantomJS/source/pyasn1/type/__init__.py
3653
# This file is necessary to make this directory a package.
mumblejumble/is210-week-06-warmup
refs/heads/master
tests/test_task_03.py
19
#!/usr/bin/env python # -*- coding: utf-8 -*- """Task 03""" # Import Python libs import unittest # Import user libs import task_03 import data class Task03TestCase(unittest.TestCase): """Test cases for Task 03""" def test_directions(self): """Tests that DIRECTIONS has the correct values""" ...
kochbeck/icsisumm
refs/heads/master
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/__init__.py
9
# Natural Language Toolkit (NLTK) # # Copyright (C) 2001-2008 University of Pennsylvania # Authors: Steven Bird <sb@csse.unimelb.edu.au> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: http://nltk.org/ # For license information, see LICENSE.TXT """ NLTK -- the Natural Language Toolkit -- is a suite...
msbeta/apollo
refs/heads/master
modules/tools/prediction/multiple_gpu_estimator/mlp_data.py
3
############################################################################### # Modification Copyright 2018 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 of the Lic...
vyscond/django-igniter
refs/heads/master
cfg/wsgi.py
1
""" WSGI config for cfg project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_...
uclouvain/OSIS-Louvain
refs/heads/master
base/models/enums/diploma_printing_orientation.py
2
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
onlywade/mitmproxy
refs/heads/master
test/scripts/stream_modify.py
16
def modify(chunks): for prefix, content, suffix in chunks: yield prefix, content.replace("foo", "bar"), suffix def responseheaders(context, flow): flow.response.stream = modify
mancoast/CPythonPyc_test
refs/heads/master
cpython/212_test_global.py
15
"""Verify that warnings are issued for global statements following use.""" from test_support import check_syntax import warnings warnings.filterwarnings("error", module="<test code>") def compile_and_check(text, should_fail=1): try: compile(text, "<test code>", "exec") except SyntaxError, msg: ...
AnderEnder/ansible-modules-extras
refs/heads/devel
messaging/rabbitmq_queue.py
29
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <manuel.sousa@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 of the...
Just-D/chromium-1
refs/heads/master
tools/clang/blink_gc_plugin/process-graph.py
130
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse, os, sys, json, subprocess, pickle, StringIO parser = argparse.ArgumentParser( description = "Process the Blink ...
andresgz/django
refs/heads/master
tests/forms_tests/tests/tests.py
89
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass from d...
HydrelioxGitHub/home-assistant
refs/heads/dev
tests/helpers/test_entity_values.py
43
"""Test the entity values helper.""" from collections import OrderedDict from homeassistant.helpers.entity_values import EntityValues as EV ent = 'test.test' def test_override_single_value(): """Test values with exact match.""" store = EV({ent: {'key': 'value'}}) assert store.get(ent) == {'key': 'value'}...
smartczm/python-learn
refs/heads/master
Old-day01-10/s13-day8/类成员/__init__.py
89
#!/usr/bin/env python3.5 # -*- coding: utf-8 -*- # Author: ChenLiang
keyboard-k/youtube-dl-pet
refs/heads/master
youtube_dl/extractor/sharesix.py
18
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse from ..utils import ( parse_duration, sanitized_Request, ) class ShareSixIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?sharesix\.com/(?:f/)?(?P<id>[0-9a-zA-...
galfaroi/trading-with-python
refs/heads/master
lib/extra.py
77
''' Created on Apr 28, 2013 Copyright: Jev Kuznetsov License: BSD ''' from __future__ import print_function import sys import urllib import os import xlrd # module for excel file reading import pandas as pd class ProgressBar: def __init__(self, iterations): self.iterations = iterations ...
shangwuhencc/scikit-learn
refs/heads/master
examples/neighbors/plot_regression.py
349
""" ============================ Nearest Neighbors regression ============================ Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpolation of the target using both barycenter and constant weights. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@...
kathryncrouch/Axelrod
refs/heads/master
axelrod/strategies/defector.py
3
from axelrod import Player class Defector(Player): """A player who only ever defects.""" name = 'Defector' classifier = { 'memory_depth': 0, 'stochastic': False, 'inspects_source': False, 'manipulates_source': False, 'manipulates_state': False } @staticmet...
jfpla/odoo
refs/heads/8.0
addons/mail/update.py
58
# -*- coding: utf-8 -*- from ast import literal_eval import datetime from functools import partial import logging import werkzeug.urls import urllib2 from openerp import release, SUPERUSER_ID from openerp.models import AbstractModel from openerp.osv import osv from openerp.tools.translate import _ from openerp.tools.c...
Refefer/pylearn2
refs/heads/master
pylearn2/linear/matrixmul.py
1
""" .. todo:: WRITEME """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import theano from theano.compat.six.moves import xrange from thea...