repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
cecep-edu/edx-platform
refs/heads/eucalyptus.2
common/lib/xmodule/xmodule/tests/test_conditional.py
131
import json import unittest from fs.memoryfs import MemoryFS from mock import Mock, patch from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.error_module import NonStaffErrorDescriptor from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location from xmodule.modules...
40423112/2016fallcadp_ag6
refs/heads/gh-pages
plugin/render_math/__init__.py
371
from .math import *
SebastianBoyd/sebastianboyd.com
refs/heads/master
fish_lights/fish_lights.py
2
#!/usr/bin/env python import RPi.GPIO as GPIO import time import json GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.OUT) def _decode_list(data): rv = [] for item in data: if isinstance(item, unicode): item = item.encode('utf-8') elif isinstance(item, list): item = _decode_l...
nylas/flanker
refs/heads/master
flanker/mime/message/errors.py
3
class MimeError(Exception): pass class DecodingError(MimeError): """Thrown when there is an encoding error.""" def __str__(self): return self.message[:256] class EncodingError(MimeError): """Thrown when there is an decoding error.""" def __str__(self): return self.message[:256]...
mpasternak/michaldtz-fixes-518-522
refs/heads/master
tools/genmpkg/bdist_mpkg_pyglet/cmd_bdist_mpkg.py
26
"""bdist_mpkg.cmd_bdist_mpkg Implements the Distutils 'bdist_mpkg' command (create an OS X "mpkg" binary distribution).""" import os import sys import zipfile from setuptools import Command from distutils.util import get_platform, byte_compile from distutils.dir_util import remove_tree, mkpath from distutils.errors...
fitermay/intellij-community
refs/heads/master
python/testData/quickFixes/PyMoveAttributeToInitQuickFixTest/addSuperCallOldStyle.py
83
__author__ = 'ktisha' class Base: def __init__(self): self.param = 2 class Child(Base): def f(self): self.<caret>my = 2
Saevon/webdnd
refs/heads/master
dnd/constants/items/weapons.py
1
WEAPON_TYPES = ( ("bow", "Bow"), ("xbow", "Crossbow"), ("thrw", "Thrown"), ("slng", "Sling"), ("swrd", "Sword"), ("axe", "Axe"), ("mace", "Mace"), ("plrm", "Polearm"), ) WEAPON_CLASSES = ( ("light", "Light"), ("hlfhd", "Half-handed"), ("twohd", "Two-handed"), ("onehd", "...
apocalypsebg/odoo
refs/heads/8.0
openerp/addons/base/module/wizard/base_module_update.py
392
# -*- coding: utf-8 -*- from openerp import models, fields, api class base_module_update(models.TransientModel): _name = "base.module.update" _description = "Update Module" updated = fields.Integer('Number of modules updated', readonly=True) added = fields.Integer('Number of modules added', readonly=...
barbuza/django
refs/heads/master
django/contrib/admin/forms.py
472
from __future__ import unicode_literals from django import forms from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm from django.utils.translation import ugettext_lazy as _ class AdminAuthenticationForm(AuthenticationForm): """ A custom authentication form used in the admin app. ...
liyao001/BioQueue
refs/heads/master
BioQueue/settings-example.py
1
""" Django settings for BioQueue project. Generated by 'django-admin startproject' using Django 2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os # ...
andela-ifageyinbo/django
refs/heads/master
tests/test_client_regress/models.py
513
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.db import models class CustomUser(AbstractBaseUser): email = models.EmailField(verbose_name='email address', max_length=255, unique=True) custom_objects = BaseUserManager() USERNAME_FIELD = 'email' class Meta: ...
peterbe/peekaboo
refs/heads/master
vendor-local/lib/python/requests/packages/charade/langbulgarianmodel.py
172
######################## 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 Ri...
agry/NGECore2
refs/heads/master
scripts/object/ship/tieadvanced_tier10.py
85615
import sys def setup(core, object): return
cokelaer/bioconda-recipes
refs/heads/master
recipes/fiji/20151222/hello.py
83
#!/usr/bin/env python print "Hello Bjoern"
wangyou/XX-Net
refs/heads/master
code/default/python27/1.0/lib/collections.py
23
__all__ = ['Counter', 'deque', 'defaultdict', 'namedtuple', 'OrderedDict'] # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. # They should however be considered an integral part of collections.py. from _abcoll import * import _abcoll __all__ += _abcoll.__all__ from _collections import deque, ...
hemstreet/Spruce-Sign
refs/heads/master
node_modules/rpi-ws281x-native/src/rpi2_ws281x/python/setup.py
27
# Python wrapper for the rpi_ws281x library. # Author: Tony DiCola (tony@tonydicola.com) from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Extension setup(name = 'rpi_ws281x', version = '1.0.0', author = 'Jeremy Garff', ...
txm/make-good
refs/heads/master
django/conf/locale/ru/formats.py
232
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y г.' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'j E Y г. G:i:s' YEAR_M...
sentient-energy/emsw-bitbake-mirror
refs/heads/master
lib/bb/ui/knotty.py
2
# # BitBake (No)TTY UI Implementation # # Handling output to TTYs or files (no TTY) # # Copyright (C) 2006-2012 Richard Purdie # # 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. # # Thi...
gangadhar-kadam/prjapp
refs/heads/master
accounts/doctype/fiscal_year/fiscal_year.py
29
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import msgprint, _ from webnotes.utils import getdate class DocType: def __init__(self, d, dl): self.doc, self.docl...
msherry/PyXB-1.1.4
refs/heads/master
pyxb_114/bundles/wssplat/wsdlx.py
1
from pyxb_114.bundles.wssplat.raw.wsdlx import *
capelini314/repository.mateus.kodi
refs/heads/master
plugin.video.funvideos/lib/ninegag.py
6
# -*- coding: UTF-8 -*- # by Mafarricos # email: MafaStudios@gmail.com # This program is free software: GNU General Public License import os,json,re import basic def grab(url,prettyname,id,cachePath,site9gagfile,cacheE): jsondata = [] list = [] line = basic.readoneline(site9gagfile) idpage = re.findall('::'+id+'...
anih/django-getpaid
refs/heads/master
getpaid/backends/skrill/__init__.py
1
import datetime from decimal import Decimal from django.contrib.sites.models import Site from django.urls import reverse import hashlib import logging import urllib import urllib2 from xml.dom.minidom import parseString, Node from django.core.exceptions import ImproperlyConfigured from django.template.base import Templ...
andres-root/AIND
refs/heads/master
Therm1/ASL-Recognizer/my_recognizer.py
1
import warnings from asl_data import SinglesData def recognize(models: dict, test_set: SinglesData): """ Recognize test word sequences from word models set :param models: dict of trained models {'SOMEWORD': GaussianHMM model object, 'SOMEOTHERWORD': GaussianHMM model object, ...} :param test_set: Si...
azverkan/scons
refs/heads/master
test/packaging/convenience-functions.py
2
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/static/item/shared_item_katana.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/item/shared_item_katana.iff" result.attribute_template_id = -1 result....
isotoma/django-cms
refs/heads/master
cms/management/commands/subcommands/copy_lang.py
18
# -*- coding: utf-8 -*- from django.conf import settings from django.core.management.base import BaseCommand, CommandError from cms.api import copy_plugins_to_language from cms.models import Page, StaticPlaceholder, EmptyTitle from cms.utils.copy_plugins import copy_plugins_to from cms.utils.i18n import get_language_...
xuewei4d/scikit-learn
refs/heads/master
sklearn/decomposition/tests/test_online_lda.py
11
import sys import numpy as np from scipy.linalg import block_diag from scipy.sparse import csr_matrix from scipy.special import psi import pytest from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._lda import (_dirichlet_expectation_1d, _dir...
iSevenDays/ESP8266_core
refs/heads/master
Sources/PC/PCServer.py
1
import socketserver from Sources.PC.PCSocketConnection import PCSocketConnection from Sources.PC.Observers.observable import Observable from Sources.Shared.Logger import Logger class PCServer(Observable): HOST, PORT = '', 9999 def __init__(self): super().__init__() self.logger = Logger.Logge...
henryfjordan/django
refs/heads/master
django/contrib/admin/forms.py
472
from __future__ import unicode_literals from django import forms from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm from django.utils.translation import ugettext_lazy as _ class AdminAuthenticationForm(AuthenticationForm): """ A custom authentication form used in the admin app. ...
sshaileshk/Polycode
refs/heads/master
Bindings/Scripts/create_lua_library/CppHeaderParser.py
10
#!/usr/bin/python # # Author: Jashua R. Cloutier (contact via https://bitbucket.org/senex) # Project: http://senexcanis.com/open-source/cppheaderparser/ # # Copyright (C) 2011, Jashua R. Cloutier # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
flowersteam/naminggamesal
refs/heads/master
naminggamesal/nginter/omniscient.py
1
#!/usr/bin/python from . import Interaction,get_interaction from ..ngagent.ngmem import get_memory import random import copy import numpy as np ########## class OmniscientOld(Interaction): def interact(self, speaker, hearer, pop, current_game_info,simulated=False): if not simulated: speaker.warn(role='speaker')...
Lh4cKg/sl4a
refs/heads/master
python/src/Lib/ctypes/util.py
47
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys, os # find_library(name) returns the pathname of a library, or None. if os.name == "nt": d...
aldariz/Sick-Beard
refs/heads/torrent_1080_subtitles
lib/cherrypy/lib/gctools.py
9
import gc import inspect import os import sys import time try: import objgraph except ImportError: objgraph = None import cherrypy from cherrypy import _cprequest, _cpwsgi from cherrypy.process.plugins import SimplePlugin class ReferrerTree(object): """An object which gathers all referrers of an object...
smesdaghi/geonode
refs/heads/master
geonode/contrib/slack/enumerations.py
22
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 versio...
thdtjsdn/FreeCAD
refs/heads/master
src/Mod/Web/Init.py
42
# FreeCAD init script of the Web module # (c) 2001 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* This f...
maoy/zknova
refs/heads/zk-servicegroup
nova/api/openstack/compute/contrib/certificates.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
thejinchao/moboair_mosquitto
refs/heads/master
test/broker/08-ssl-connect-cert-auth.py
19
#!/usr/bin/env python # Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. import subprocess import socket import ssl import sys import time if sys.version < '2.7': print("WARNING: SSL not supported on Python 2.6") exit(0) import inspect, os, sys # From http://stacko...
kbrebanov/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_snmptrapprofile.py
3
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # # 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...
AlexMax/odamex
refs/heads/master
libraries/portmidi/pm_python/pyportmidi/__init__.py
90
from .midi import *
sunzuolei/youtube-dl
refs/heads/master
test/test_write_annotations.py
78
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import get_params, try_rm import io import xml.etree.ElementTree import youtu...
KaranToor/MA450
refs/heads/master
google-cloud-sdk/lib/googlecloudsdk/api_lib/app/ext_runtimes/__init__.py
107
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bmorris3/numpy
refs/heads/master
numpy/f2py/tests/test_array_from_pyobj.py
63
from __future__ import division, absolute_import, print_function import unittest import os import sys import copy import nose from numpy import ( array, alltrue, ndarray, zeros, dtype, intp, clongdouble ) from numpy.testing import ( run_module_suite, assert_, assert_equal ) from numpy.core.multiarray import ...
akesandgren/easybuild-framework
refs/heads/main
easybuild/scripts/clean_gists.py
4
#!/usr/bin/env python ## # Copyright 2014 Ward Poelmans # # https://github.com/easybuilders/easybuild # # EasyBuild 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 v2. # # EasyBuild is distributed in the hope t...
djbaldey/django
refs/heads/master
django/contrib/auth/apps.py
472
from django.apps import AppConfig from django.contrib.auth.checks import check_user_model from django.core import checks from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ from .management import create_permissions class AuthConfig(AppConfig): name = 'django...
LukeC92/iris
refs/heads/latest
lib/iris/tests/unit/analysis/test_Linear.py
16
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
aqfaridi/Code-Online-Judge
refs/heads/master
build/web/env/Main1183/Main1183.py
7
gfhghf
grilo/ansible-1
refs/heads/devel
lib/ansible/modules/system/getent.py
26
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Brian Coca <brian.coca+dev@gmail.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....
tangyiyong/odoo
refs/heads/8.0
addons/event_sale/__init__.py
428
# -*- 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...
feroda/django
refs/heads/master
django/conf/locale/ga/formats.py
619
# -*- 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 F Y' TIME_FORMAT = 'H:i' # DATE...
Jeff-Tian/mybnb
refs/heads/master
Python27/Lib/test/test_codeccallbacks.py
2
import test.test_support, unittest import sys, codecs, htmlentitydefs, unicodedata class PosReturn: # this can be used for configurable callbacks def __init__(self): self.pos = 0 def handle(self, exc): oldpos = self.pos realpos = oldpos if realpos<0: ...
cheif/django-rest-framework
refs/heads/master
rest_framework/status.py
110
""" Descriptive HTTP status codes, for code readability. See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html And RFC 6585 - http://tools.ietf.org/html/rfc6585 """ from __future__ import unicode_literals def is_informational(code): return code >= 100 and code <= 199 def is_success(code): r...
hoseking/node-gyp
refs/heads/master
gyp/pylib/gyp/generator/msvs_test.py
2687
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the msvs.py file. """ import gyp.generator.msvs as msvs import unittest import StringIO class TestSequenceFunctions(uni...
ykim362/mxnet
refs/heads/master
example/gluon/style_transfer/dataset/download_dataset.py
35
# 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 u...
gliblr/research
refs/heads/master
collector32 3.py
3
import math import datetime import sys from decimal import * __author__="galibaler" __date__ =str(datetime.datetime.now()) title = '***************************************\n PDB 32 Way DOT File Combiner\n version 3\n ' + __date__ + '\n***************************************\n' print title inputp...
jtriley/StarCluster
refs/heads/develop
starcluster/plugins/ipcluster.py
18
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later ...
laiqiqi886/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/setuptools/compat.py
331
import sys import itertools if sys.version_info[0] < 3: PY3 = False basestring = basestring import __builtin__ as builtins import ConfigParser from StringIO import StringIO BytesIO = StringIO execfile = execfile func_code = lambda o: o.func_code func_globals = lambda o: o.func_glob...
ravibhure/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_gir.py
19
#!/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...
ilo10/scikit-learn
refs/heads/master
examples/model_selection/plot_learning_curve.py
250
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
xinjiguaike/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/hidden_module.py
114
from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor class HiddenModule(XModule): HIDDEN = True def get_html(self): if self.system.user_is_staff: return u"ERROR: This module is unknown--students will not see it at all" else: return u"" c...
qpython-android/QPypi-numpy
refs/heads/master
numpy/doc/misc.py
5
""" ============= Miscellaneous ============= IEEE 754 Floating Point Special Values: ----------------------------------------------- Special values defined in numpy: nan, inf, NaNs can be used as a poor-man's mask (if you don't care what the original value was) Note: cannot use equality to test NaNs. E.g.: :: >>...
demonshreder/pirate
refs/heads/master
files/migrations/0004_auto_20160112_2259.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0002_auto_20160112_2259'), ('files', '0003_remove_searches_logged_in'), ] operations = [ migrations.AddField...
Guitar-Machine-Learning-Group/guitar-transcriber
refs/heads/master
outputmidi.py
1
from __future__ import division import os from pretty_midi import PrettyMIDI, Instrument import fmeasure from midiio import MidiIO import numpy as np from optimize import optimizer #from fextract import FeatureExtractor from scoreevent import Note #Creates a midi file given a valid binary file and file pa...
HeH-Projects/team-agozzino
refs/heads/master
frontend/node_modules/node-forge/tests/forge_ssl/setup.py
171
#!/usr/bin/env python from distutils.core import setup, Extension ssl = Extension('_forge_ssl', sources = ['forge/_ssl.c']) setup (name = 'Forge SSL', version = '1.0', description = 'Python SSL with session cache support.', ext_modules = [ssl], py_modules = ['forge.ssl'])
gagnonlg/IFT6266-project
refs/heads/master
good_models/model_03.py
1
import logging import os import subprocess import h5py as h5 import PIL.Image import numpy as np import dataset import network fmt = '[%(asctime)s] %(name)s %(levelname)s %(message)s' logging.basicConfig(level='INFO', format=fmt) log = logging.getLogger('test_project') ##############################################...
Sam-son/P21e3-Merge-Split-Tools
refs/heads/master
STEPMerge/STEPMerge.py
1
from __future__ import print_function import os,sys,subprocess,shutil argv = sys.argv if len(argv) != 2: print("Usage: STEPMerge.py Directory_to_parse") sys.exit(1) dir=argv[1] mydir=os.getcwd() +'\\' def dirswitch(dir): try: os.chdir(dir) except: print("Couldn't open directory.") sys.exit(1) dirsw...
vinco/django-socialregistration
refs/heads/master
socialregistration/contrib/foursquare/admin.py
10
from django.contrib import admin from socialregistration.contrib.foursquare.models import FoursquareProfile admin.site.register(FoursquareProfile)
mpasternak/pyglet-fix-issue-552
refs/heads/master
pyglet/libs/win32/dinput.py
39
import ctypes from pyglet import com lib = ctypes.oledll.dinput8 LPVOID = ctypes.c_void_p WORD = ctypes.c_uint16 DWORD = ctypes.c_uint32 LPDWORD = ctypes.POINTER(DWORD) BOOL = ctypes.c_int WCHAR = ctypes.c_wchar UINT = ctypes.c_uint HWND = ctypes.c_uint32 HANDLE = LPVOID MAX_PATH = 260 DIENUM_STOP ...
needle-wang/vim-jumptoview
refs/heads/master
plugin/tests.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # #2016年 04月 15日 星期五 22:43:07 CST import os.path as p import unittest import mock from jumptoview import get_view_from_url class JumptoviewTestCase(unittest.TestCase): def setUp(self): self.settings = {} self.settings['open'] = "tabnew" self.settings['grep'...
thomashaw/SecGen
refs/heads/master
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/Queue.py
188
"""A multi-producer, multi-consumer queue.""" from time import time as _time try: import threading as _threading except ImportError: import dummy_threading as _threading from collections import deque import heapq __all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue'] class Empty(Exception): "...
SRabbelier/Melange
refs/heads/master
thirdparty/google_appengine/lib/django_1_2/django/contrib/contenttypes/generic.py
44
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import signals from django.db import models, router from django.db.models.fields.related import RelatedField, Field, ManyTo...
benni0815/root
refs/heads/master
tutorials/pyroot/test.py
28
from cmath import exp from cmath import tanh class test: def value(self,index,in0,in1,in2): self.input0 = (in0 - 0.459987)/0.0509152 self.input1 = (in1 - 0.188581)/0.0656804 self.input2 = (in2 - 134.719)/16.5033 if index==0: return ((self.neuron0xad38cb8()*1)+0); return 0. def neuron0xad37278(self): ret...
olafhauk/mne-python
refs/heads/master
mne/__main__.py
14
# Authors: Eric Larson <larson.eric.d@gmail.com> # License: BSD Style. from .commands.utils import main if __name__ == '__main__': main()
mith1979/ansible_automation
refs/heads/master
applied_python/applied_python/lib/python2.7/site-packages/dns/renderer.py
50
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
doduytrung/odoo-8.0
refs/heads/master
addons/account/wizard/account_change_currency.py
385
# -*- encoding: 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 G...
rbirger/OxfordHCVNonSpatial
refs/heads/master
KeelingRohani_tauleap.py
1
#!/usr/bin/env python #################################################################### ### This is the PYTHON version of program 6.4 from page 203 of # ### "Modeling Infectious Disease in humans and animals" # ### by Keeling & Rohani. # ### # ### It is the SIR model (in...
cchanrhiza/python-pptx
refs/heads/master
pptx/shapes/shapetree.py
2
# encoding: utf-8 """ The shape tree, the structure that holds a slide's shapes. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from .autoshape import AutoShapeType from ..enum.shapes import PP_PLACEHOLDER from .factory import BaseShapeFactory, SlideShapeFactory from ....
Distrotech/pygtk
refs/heads/distrotech-pygtk
tests/test_conversion.py
7
# -*- Mode: Python -*- import unittest from common import gtk, gobject class Tests(unittest.TestCase): def testUnicharArg(self): """ Test unichar values when used as arguments. """ entry = gtk.Entry() for valid_value in ['a', u'b', u'\ufff0', u'\ufff0'.encode()]: entry.set_i...
focusexplorer/focusexplorer.github.io
refs/heads/master
z_language/web/web_socket/server.py
1
log_file_path='''F:\\udp_game\\pc\\Cache\\apollo.log''' ###################################################################################### import socket import time import select import datetime import json from threading import Thread import Queue import re from collections import deque from SimpleWebSocketServer...
garwon/blog
refs/heads/master
api.py
1
from app import api from models import Comment api.create_api(Comment, methods=['GET', 'POST'])
hrishioa/Aviato
refs/heads/master
flask/Lib/site-packages/nltk/downloader.py
2
# Natural Language Toolkit: Corpus & Model Downloader # # Copyright (C) 2001-2015 NLTK Project # Author: Edward Loper <edloper@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ The NLTK corpus and module downloader. This module defines several interfaces which can be used to download...
wakamori/luigi
refs/heads/master
test/scheduler_test.py
45
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apolikamixitos/hubcommander
refs/heads/master
config.py
3
ONLY_LISTEN = [ #"SLACKROOM_ID_HERE" ] IGNORE_ROOMS = [ #"SLACKROOM_ID_HERE" ] # For using AWS KMS for credential management: # KMS_REGION = "us-west-2" # KMS_CIPHERTEXT = "CTXTHERE"
rossgoodwin/musapaedia
refs/heads/master
musapaedia/muse/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py
253
import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .exceptions import LocationValue...
benrudolph/commcare-hq
refs/heads/master
custom/_legacy/pact/lib/quicksect.py
3
""" Interval tree library data structure. Given a set of data that represents data that spans some time interval, create an object in memory that given a query with a datetime timestamp, return the relevant data back whose time interval matches that. Intersects ... faster. Suports GenomicInterval datatype and multi...
larsmans/scikit-learn
refs/heads/master
sklearn/covariance/robust_covariance.py
17
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
msarahan/bokeh
refs/heads/master
bokeh/sampledata/degrees.py
15
''' This module provides a table of data regarding bachelors degrees earned by women, broken down by field for any given year. It exposes an attribute 'data' which is a pandas dataframe with the following fields: Year Agriculture Architecture Art and Performance Biology Business Communicati...
mindnervestech/mnrp
refs/heads/master
addons/sale/sales_team.py
61
# -*- coding: utf-8 -*- import calendar from datetime import date from dateutil import relativedelta import json from openerp import tools from openerp.osv import fields, osv class crm_case_section(osv.osv): _inherit = 'crm.case.section' def _get_sale_orders_data(self, cr, uid, ids, field_name, arg, contex...
extremewaysback/django
refs/heads/master
tests/model_inheritance_regress/models.py
243
from __future__ import unicode_literals import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Meta: ...
djvoleur/V_925R4_BOF7
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...
friebsch/example-code
refs/heads/master
04-text-byte/ola.py
8
# coding: cp1252 print('Olá, Mundo!')
3liz/QgisLayerBoardPlugin
refs/heads/master
layer_board.py
1
""" /*************************************************************************** LayerBoard A QGIS plugin This plugin displays tables with all the project layers and lets the user change some properties directly. I also aims to be a board showing usefull information on all layers, and...
moreati/pandashells
refs/heads/master
pandashells/bin/p_facet_grid.py
7
#! /usr/bin/env python # standard library imports import argparse import sys # NOQA just use this for patching in tests import textwrap from pandashells.lib import module_checker_lib, arg_lib, io_lib, plot_lib # import required dependencies module_checker_lib.check_for_modules( ['pandas', 'numpy', 'matplotlib',...
tomchristie/django
refs/heads/master
tests/template_tests/syntax_tests/i18n/test_get_language_info_list.py
55
from django.test import SimpleTestCase from django.utils import translation from ...utils import setup class GetLanguageInfoListTests(SimpleTestCase): libraries = { 'custom': 'template_tests.templatetags.custom', 'i18n': 'django.templatetags.i18n', } @setup({'i18n30': '{% load i18n %}' ...
nagyistoce/odoo-dev-odoo
refs/heads/8.0
addons/im_chat/__init__.py
349
import im_chat
tai271828/courses
refs/heads/master
software-development/udacity/cs253-web-development/code/lesson2/hello/hello.py
4
import webapp2 class MainPage(webapp2.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.write('Hello, World') app = webapp2.WSGIApplication([ ('/', MainPage), ], debug=True)
Br3nda/witmproxy
refs/heads/master
test/test_console_contentview.py
1
import sys import libmproxy.console.contentview as cv from libmproxy import utils, flow, encoding import tutils class TestContentView: def test_trailer(self): txt = [] cv.trailer(5, txt, 1000) assert not txt cv.trailer(cv.VIEW_CUTOFF + 10, txt, cv.VIEW_CUTOFF) assert txt ...
isnnn/Sick-Beard-TPB
refs/heads/ThePirateBay
lib/guessit/transfo/guess_filetype.py
50
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
bitcity/django
refs/heads/master
tests/managers_regress/models.py
245
""" Various edge-cases for model managers. """ from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import force_text, python_2_unicode_compatible class OnlyFred(mo...
aayush2911/Fibonaccio
refs/heads/master
web2py/gluon/contrib/rss2.py
44
""" PyRSS2Gen - A Python library for generating RSS 2.0 feeds. (This is the BSD license, based on the template at http://www.opensource.org/licenses/bsd-license.php ) Copyright (c) 2003, Dalke Scientific Software, LLC All rights reserved. Redistribution and use in source and binary forms, with or without modific...
tsabi/Odoo-tsabi-fixes
refs/heads/master
addons/analytic/report/analytic_balance.py
23
# -*- 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...