repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
guillochon/MOSFiT
refs/heads/master
mosfit/modules/energetics/__init__.py
5
"""Initilization procedure for `Energetic` modules.""" import inspect import os import sys path = os.path.dirname(os.path.abspath(__file__)) __all__ = [] for py in [ f[:-3] for f in os.listdir(path) if f.endswith('.py') and f != '__init__.py' ]: mod = __import__('.'.join([__name__, py]), fromlist=...
jmhsi/justin_tinker
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py
2762
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
sabi0/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/test/utils.py
185
import sys import time import os import warnings from django.conf import settings from django.core import mail from django.core.mail.backends import locmem from django.test import signals from django.template import Template from django.utils.translation import deactivate __all__ = ('Approximate', 'ContextList', 'setu...
cernops/ceilometer
refs/heads/master
ceilometer/tests/unit/network/statistics/test_table.py
10
# # Copyright 2014 NEC Corporation. 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...
BT-rmartin/odoo
refs/heads/BT_2900
addons/gamification/models/res_users.py
386
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
ArcherCraftStore/ArcherVMPeridot
refs/heads/master
Python/Lib/test/test_ntpath.py
9
import ntpath import os import sys import unittest import warnings from test.support import TestFailed from test import support, test_genericpath from tempfile import TemporaryFile def tester(fn, wantResult): fn = fn.replace("\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: raise Test...
mlavin/django
refs/heads/master
tests/model_inheritance_regress/tests.py
27
""" Regression tests for Model inheritance behavior. """ import datetime from operator import attrgetter from unittest import expectedFailure from django import forms from django.test import TestCase from .models import ( ArticleWithAuthor, BachelorParty, BirthdayParty, BusStation, Child, DerivedM, InternalCe...
largelymfs/w2vtools
refs/heads/master
build/scipy/scipy/signal/tests/test_signaltools.py
4
from __future__ import division, print_function, absolute_import from decimal import Decimal from numpy.testing import (TestCase, run_module_suite, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises, assert_allclose, assert_, dec) import scipy.signal as signal fro...
googlemaps/google-maps-services-python
refs/heads/master
googlemaps/geolocation.py
1
# # Copyright 2017 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 ...
saimn/glue
refs/heads/master
glue/utils/qt/__init__.py
1
from __future__ import absolute_import, division, print_function from .autocomplete_widget import * from .qmessagebox_widget import * from .dialogs import * from .colors import * from .decorators import * from .helpers import * from .mixins import * from .mime import * from .python_list_model import * from .threading ...
CenterForOpenScience/lookit-api
refs/heads/develop
studies/migrations/0002_auto_20170607_1800.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-07 18:00 from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("accounts", "0003_auto_20170607_1800"), ("studies", ...
niwinz/Green-Mine
refs/heads/master
src/greenmine/scrum/views/milestone.py
1
# -*- coding: utf-8 -*- from django.conf import settings from django.http import HttpResponseRedirect, HttpResponse, HttpResponseBadRequest, Http404 from django.core.cache import cache from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.core.urlresolvers import reverse from django.core.mail...
sujoykroy/motion-picture
refs/heads/master
editor/MotionPicture/commons/misc.py
1
import cairo, re, numpy from gi.repository import Gtk class Keyboard(object): SHIFT_KEY_CODES = (65505, 65506) CTRL_KEY_CODES = (65507, 65508) def __init__(self): self.shift_key_pressed = False self.control_key_pressed = False def set_keypress(self, keyval, pressed): if keyval...
MKLab-ITI/reveal-graph-embedding
refs/heads/master
reveal_graph_embedding/experiments/demo.py
1
__author__ = 'Georgios Rizos (georgerizos@iti.gr)' import numpy as np from reveal_graph_embedding.common import get_threads_number from reveal_graph_embedding.experiments.utility import run_experiment ####################################################################################################################...
waustin/django-project-template
refs/heads/master
project_name/views.py
4
# Project specific views go here
MoisesTedeschi/python
refs/heads/master
Scripts-Python/Modulos-Diversos/deteccao-de-faces-com-python-e-opencv/Lib/encodings/mac_greek.py
272
""" Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.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_table) def decode(self,input,err...
justajeffy/arsenalsuite
refs/heads/master
cpp/lib/PyQt4/examples/widgets/digitalclock.py
20
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
mne-tools/mne-tools.github.io
refs/heads/main
0.14/_downloads/plot_objects_from_arrays.py
3
""" ===================================== Creating MNE objects from data arrays ===================================== In this simple example, the creation of MNE objects from numpy arrays is demonstrated. In the last example case, a NEO file format is used as a source for the data. """ # Author: Jaakko Leppakangas <ja...
pixelrebel/st2
refs/heads/master
st2actions/st2actions/container/service.py
11
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
janusnic/21v-python
refs/heads/master
unit_20/matplotlib/custom_cmap.py
2
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap """ Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use: cdict = {'red': ...
halk/recowise
refs/heads/master
worker/event.py
1
import os, sys from worker import celery, logger from config import config @celery.task(name='worker.event.process_event', ignore_result=True) def process_event(name, body): if name not in config.get_events(): logger.error('Unknown event name %s' % name) return False observers = config.get_eve...
GoogleChrome/big-rig
refs/heads/master
app/src/thirdparty/telemetry/web_perf/metrics/smoothness.py
8
# 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 logging from telemetry.util import perf_tests_helper from telemetry.util import statistics from telemetry.value import list_of_scalar_values from tel...
rstreif/rvi_backend
refs/heads/master
web/sota/urls.py
7
""" Copyright (C) 2015, Jaguar Land Rover This program is licensed under the terms and conditions of the Mozilla Public License, version 2.0. The full text of the Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ Barbara Harmon (bharmon@jaguarlandrover.com) """ from django.conf.urls import patterns, u...
DGA-MI-SSI/YaCo
refs/heads/master
deps/swig-3.0.7/Tools/obs-buildlogs.py
4
#!/usr/bin/env python import os import subprocess import argparse import glob def remove_old_files(): files = glob.glob("*.log") for file in files: os.remove(file) def download(): repos = subprocess.Popen(['osc', 'repositories'], stdout=subprocess.PIPE) for line in repos.stdout: command = ['osc', 'bu...
mkaluza/external_chromium_org
refs/heads/kk44
tools/json_schema_compiler/highlighters/pygments_highlighter.py
179
# Copyright (c) 2012 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 sys try: import pygments from pygments.lexers import CppLexer from pygments.formatters import HtmlFormatter PYGMENTS_IMPORTED = True excep...
alshedivat/tensorflow
refs/heads/master
tensorflow/python/training/checkpoint_ops.py
46
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
django-bmf/django-bmf
refs/heads/develop
djangobmf/contrib/address/models.py
2
#!/usr/bin/python # ex:set fileencoding=utf-8: from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from djangobmf.conf import settings from djangobmf.models import BMFModel from djan...
Khan/pyobjc-framework-Cocoa
refs/heads/master
PyObjCTest/test_nssegmentedcell.py
3
from PyObjCTools.TestSupport import * from AppKit import * class TestNSSegmentedCell (TestCase): def testConstants(self): self.assertEqual(NSSegmentSwitchTrackingSelectOne, 0) self.assertEqual(NSSegmentSwitchTrackingSelectAny, 1) self.assertEqual(NSSegmentSwitchTrackingMomentary, 2) d...
stopfer/opengm
refs/heads/master
src/interfaces/python/opengm/_inf_param.py
14
class _MetaInfParam(object): def __init__(self): pass class InfParam(_MetaInfParam) : def __init__(self,*args,**kwargs): super(InfParam,self).__init__() if len(args)!=0: raise RuntimeError("Inference parameter does only suppoty keyword arguments") #self.args=args self.kwargs...
jyotikamboj/container
refs/heads/master
django/contrib/gis/management/commands/ogrinspect.py
111
import argparse import inspect from django.contrib.gis import gdal from django.core.management.base import BaseCommand, CommandError class LayerOptionAction(argparse.Action): """ Custom argparse action for the `ogrinspect` `layer_key` keyword option which may be an integer or a string. """ def __...
hoxmark/TDT4501-Specialization-Project
refs/heads/master
reinforcement/datasets/mnist/model.py
1
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable import time from utils import pairwise_distances, batchify from config import opt, data, loaders class SimpleClassifier(nn.Module): def __init__(self): super(SimpleClassifier,...
koalalorenzo/python-digitalocean
refs/heads/master
digitalocean/baseapi.py
1
# -*- coding: utf-8 -*- import os import json import logging import requests from . import __name__, __version__ try: import urlparse except ImportError: from urllib import parse as urlparse GET = 'GET' POST = 'POST' DELETE = 'DELETE' PUT = 'PUT' PATCH = 'PATCH' REQUEST_TIMEOUT_ENV_VAR = 'PYTHON_DIGITALOCEAN_...
boostbob/zerorpc-python
refs/heads/master
zerorpc/gevent_zmq.py
7
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
moxon6/chemlab
refs/heads/master
build/lib/chemlab/mviewer/representations/obsarray.py
6
import numpy as np from ..events import BoundEvent class obsarray(object): def __init__(self, arr): self._arr = arr self.changed = BoundEvent(self, 'changed') self._callbacks = {} def __setitem__(self, key, val): self._arr[key] = val self.changed.emit() ...
asedunov/intellij-community
refs/heads/master
python/helpers/py2only/docutils/writers/manpage.py
113
# -*- coding: utf-8 -*- # $Id: manpage.py 7628 2013-03-09 10:19:35Z grubert $ # Author: Engelbert Gruber <grubert@users.sourceforge.net> # Copyright: This module is put into the public domain. """ Simple man page writer for reStructuredText. Man pages (short for "manual pages") contain system documentation on unix-li...
lukaszpiotr/pylama_with_gjslint
refs/heads/master
pylama/checkers/closure_linter/error_check.py
27
#!/usr/bin/env python # # Copyright 2011 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
moijes12/oh-mainline
refs/heads/master
vendor/packages/PyYaml/lib3/yaml/__init__.py
96
from .error import * from .tokens import * from .events import * from .nodes import * from .loader import * from .dumper import * __version__ = '3.10' try: from .cyaml import * __with_libyaml__ = True except ImportError: __with_libyaml__ = False import io def scan(stream, Loader=Loader): """ S...
Dandandan/wikiprogramming
refs/heads/master
jsrepl/build/extern/python/unclosured/lib/python2.7/unittest/loader.py
152
"""Loading unittests.""" import os import re import sys import traceback import types from functools import cmp_to_key as _CmpToKey from fnmatch import fnmatch from . import case, suite __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '....
drexly/tonginBlobStore
refs/heads/master
lib/django/contrib/admin/templatetags/log.py
499
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
leafclick/intellij-community
refs/heads/master
python/testData/inspections/PyCallingNonCallableInspection/tupleNonCallable.py
83
<warning descr="'(int, int)' object is not callable">(1,2)()</warning>
samthor/intellij-community
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/RightOperators.py
53
class C(object): pass def test_right_operators(): o = C() xs = [ <warning descr="Expected type 'Integral', got 'C' instead">o</warning> * [], ]
google/deepvariant
refs/heads/r1.1
deeptrio/make_examples.py
1
# Copyright 2020 Google LLC. # # 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 notice, # this list of conditions and the following disclaimer. # #...
arviz-devs/arviz
refs/heads/main
arviz/tests/base_tests/test_rcparams.py
1
# pylint: disable=redefined-outer-name import os import numpy as np import pytest from xarray.core.indexing import MemoryCachedArray from ...data import datasets, load_arviz_data from ...rcparams import ( _make_validate_choice, _make_validate_choice_regex, _validate_float_or_none, _validate_positive_i...
jhseu/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/edit_distance_op_test.py
37
# 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...
aljscott/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
139
# Copyright 2012, 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 of conditions and the f...
fieldhawker/upm
refs/heads/master
examples/python/si114x.py
16
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
duthchao/kaggle-burn-cpu
refs/heads/master
load_data.py
2
import pandas as pd from sklearn.preprocessing import StandardScaler as Scaler input_file = 'data/train_num.csv' data = pd.read_csv( input_file ) train = data[0:93170] test = data[93170:] x_train = train[[ c for c in train.columns if c != 'cpu_01_busy' ]] x_test = test[[ c for c in train.columns if c != 'cpu_01_bus...
yeatmanlab/BrainTools
refs/heads/master
experiments/r21/test_r21_ssvep.py
1
""" ========================== Display images for MEG ========================== """ import numpy as np from expyfun import visual, ExperimentController from expyfun.io import write_hdf5 import time from PIL import Image import os from os import path as op import glob # background color testing = False test_trig = [15...
sarvex/django
refs/heads/master
tests/gis_tests/geoapp/tests.py
17
from __future__ import unicode_literals import re import tempfile from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon, fromstr, ) from django.core.man...
creafz/python-addthis
refs/heads/master
addthis/__init__.py
1
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from addthis.api import Addthis from addthis.exceptions import AddthisError, AddthisValidationError __author__ = 'Alex Parinov' __email__ = 'creafz@gmail.com' __license__ = 'MIT' __version__ = '0.1.2' __all__ = [ '__author__', ...
matthiasdiener/spack
refs/heads/develop
var/spack/repos/builtin/packages/id3lib/package.py
5
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
liamgh/liamgreenhughes-sl4a-tf101
refs/heads/master
python/src/Lib/ctypes/test/test_refcounts.py
68
import unittest import ctypes import gc MyCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int) OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong) import _ctypes_test dll = ctypes.CDLL(_ctypes_test.__file__) class RefcountTestCase(unittest.TestCase): def test_1(self): fro...
mhbu50/erpnext
refs/heads/develop
erpnext/hr/doctype/training_program/training_program.py
25
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals from frappe.model.document import Document class TrainingProgram(Document): pass
edisonlz/fruit
refs/heads/master
web_project/base/site-packages/grappelli/dashboard/modules.py
2
""" Module where grappelli dashboard modules classes are defined. """ # DJANGO IMPORTS from django.utils.text import capfirst from django.core.urlresolvers import reverse from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_lazy as _ from django.utils.itercompat impo...
hassancode/cognizant_test
refs/heads/master
CustomerManager/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/setup.py
2462
#!/usr/bin/env python # Copyright (c) 2009 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. from setuptools import setup setup( name='gyp', version='0.1', description='Generate Your Projects', author='Chromium Authors', a...
fodma1/translocatome_old
refs/heads/master
tests/conftest.py
5
# This file contains pytest 'fixtures'. # If a test functions specifies the name of a fixture function as a parameter, # the fixture function is called and its result is passed to the test function. # # Copyright 2014 SolidBuilds.com. All rights reserved # # Authors: Ling Thio <ling.thio@gmail.com> import pytest from ...
devrishik/mapquest_test
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # everetail documentation build configuration file, created by # sphinx-quickstart on Sun Feb 17 11:46:20 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
KokareIITP/django
refs/heads/master
django/utils/functional.py
234
import copy import operator from functools import total_ordering, wraps from django.utils import six from django.utils.six.moves import copyreg # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools.partial (on # CPython) is a type a...
mac389/epidemiology
refs/heads/master
epidemiology/twitter/stream.py
1
import json, datetime, os from TwitterAPI import TwitterAPI TWITTER_PATH = os.path.join('..','data','twitter') directory = json.load(open(os.path.join('..','data','credentials.json'),'rb')) keys = directory['twitter'] timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') api = TwitterAPI(keys['consumer_ke...
damiansoriano/odoo
refs/heads/master
addons/website_forum/models/forum.py
12
# -*- coding: utf-8 -*- from datetime import datetime import openerp from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.osv import osv, fields from openerp.tools import html2plaintext from openerp.tools.translate import _ class KarmaError(V...
abulte/python-influxdb-alerts
refs/heads/master
monitor.py
1
"""Monitoring CLI""" from importlib import import_module import click from config import CONFIG, read_config def setup(config): read_config(config) hosts = str(CONFIG.get('general', 'HOSTS')).split(',') indicator_module = import_module('indicators') indicator_classes = str(CONFIG.get('general', '...
ddico/odoo
refs/heads/master
odoo/addons/base/models/ir_qweb.py
1
# -*- coding: utf-8 -*- from __future__ import print_function import ast import copy import json import logging from collections import OrderedDict from time import time from lxml import html from lxml import etree from werkzeug import urls from odoo import api, models, tools from odoo.tools.safe_eval import assert_v...
afieldio/FishFish
refs/heads/master
ff/receivers.py
43
from django.dispatch import receiver from account.signals import password_changed from account.signals import user_sign_up_attempt, user_signed_up from account.signals import user_login_attempt, user_logged_in from pinax.eventlog.models import log @receiver(user_logged_in) def handle_user_logged_in(sender, **kwargs...
INNUENDOWEB/INNUca
refs/heads/master
src/SPAdes-3.11.0-Linux/share/spades/pyyaml2/constructor.py
392
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor', 'ConstructorError'] from error import * from nodes import * import datetime import binascii, re, sys, types class ConstructorError(MarkedYAMLError): pass class BaseConstructor(object): yaml_constructors = {} yaml_multi_constructors =...
ricket1978/ggplot
refs/heads/master
ggplot/components/linetypes.py
12
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from .legend import get_labels # Matplolib is not consistent. Sometimes it does not # accept abbreviations # LINETYPES = [ # '-', #solid # '--', #dashed # '-.', #dash-dot # ...
orekyuu/intellij-community
refs/heads/master
python/testData/inspections/AugmentAssignment1.py
83
exp = 2 <weak_warning descr="Assignment can be replaced with augmented assignment">value = value <caret>/ (10**exp) #comment</weak_warning>
yosukesuzuki/deep-link-app
refs/heads/master
project/core/tests/__init__.py
1
# -*- coding: utf-8 -*- from google.appengine.api import memcache from kay.ext.testutils.gae_test_base import GAETestBase from core.models import ShortURL, ShortURLID, ShortURLUser, create_api_key, validate_api_key, abort_api_key class PutShortURLTest(GAETestBase): CLEANUP_USED_KIND = True USE_PRODUCTION_ST...
laborautonomo/youtube-dl
refs/heads/master
youtube_dl/extractor/howcast.py
19
from __future__ import unicode_literals import re from .common import InfoExtractor class HowcastIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?howcast\.com/videos/(?P<id>\d+)' _TEST = { 'url': 'http://www.howcast.com/videos/390161-How-to-Tie-a-Square-Knot-Properly', 'md5': '8b743df908...
ahupowerdns/weakforced
refs/heads/master
report_api/wforce/gunicorn_config.py
3
# Config file for the gunicorn HTTP server # See: http://docs.gunicorn.org/en/stable/settings.html # # import multiprocessing import os import sys # WARNING: Use /etc/wforce/gunicorn_overrides.py to override these bind = ['127.0.0.1:8448'] #bind = ['0.0.0.0:8448'] workers = min(multiprocessing.cpu_count() * 2, 32) thr...
tianyi33/simple_blog
refs/heads/master
django/contrib/gis/gdal/feature.py
219
# The GDAL C library, OGR exception, and the Field object from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException, OGRIndexError from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType # ctypes function pro...
BitPuffin/boo
refs/heads/master
lib/antlr-2.7.5/examples/python/multiParser/multiparser.py
21
import sys import traceback import antlr import SimpleLexer import SimpleParser import SimpleParser2 lexer = None parser = None parser2 = None class Main: global lexer, parser, parser2 def __init__(self): try: lexer = SimpleLexer.Lexer(sys.stdin); # Invoke first parser ...
orablu/heroku-buildpack
refs/heads/master
test/django-1.4-skeleton/haystack/urls.py
128
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'haystack.views.home', name='home'), # url(r'^haystack/', include('haystack.foo.urls')), ...
BatOnBots-ML/batonbots-ml
refs/heads/master
interface/CommandsBox.py
1
""" Copyright (C) 2013 BatOnBots-ML. 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. This pro...
swim-fish/SQA_WEB
refs/heads/master
steam_user/migrations/0003_auto__add_field_steamuseronlinetoken_updated.py
1
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'SteamUserOnlineToken.updated' db.add_column('steam_user_s...
bcorbet/SickRage
refs/heads/master
lib/github/tests/Github_.py
39
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
repotvsupertuga/repo
refs/heads/master
plugin.video.jami/RijndaelManaged.py
112
import base64,binascii def RijndaelManaged_encrypt(plan_text , key, iv ='\0'*16): if len(key)<32: key=key+chr(0)*(32-len(key)) from pkcs7 import PKCS7Encoder encoder = PKCS7Encoder() plan_text=encoder.encode(plan_text) import pyaes decryptor = pyaes.new(key, pyaes.MODE_CBC, IV=iv) ...
SuicSoft/stk-code
refs/heads/master
tools/ibl.py
26
import Image as img import numpy as np import pylab as pl n = 3 GridI, GridJ = np.meshgrid(np.linspace(-1, 1, n), np.linspace(-1, 1, n)) img = np.ones((n,n)) # constant factor of Ylm c00 = 0.282095 c1minus1 = 0.488603 c10 = 0.488603 c11 = 0.488603 c2minus2 = 1.092548 c2minus1 = 1.092548 c21 = 1.092548 c20 = 0.315392 ...
leotrubach/sourceforge-allura
refs/heads/dev
Allura/allura/controllers/base.py
1
from tg import expose from webob import exc class BaseController(object): @expose() def _lookup(self, name, *remainder): """Provide explicit default lookup to avoid dispatching backtracking and possible loops.""" raise exc.HTTPNotFound, name
squidsoup/snapcraft
refs/heads/master
integration_tests/test_rpm_source.py
5
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Neal Gompa # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope...
anve8004/trading-with-python
refs/heads/master
lib/yahooFinance.py
76
# -*- coding: utf-8 -*- # Author: Jev Kuznetsov <jev.kuznetsov@gmail.com> # License: BSD """ Toolset working with yahoo finance data This module includes functions for easy access to YahooFinance data Functions ---------- - `getHistoricData` get historic data for a single symbol - `getQuote` get cur...
dantebarba/docker-media-server
refs/heads/master
plex/Sub-Zero.bundle/Contents/Libraries/Shared/js2py/internals/constructors/jsmath.py
4
from __future__ import unicode_literals from ..conversions import * from ..func_utils import * import math import random CONSTANTS = { 'E': 2.7182818284590452354, 'LN10': 2.302585092994046, 'LN2': 0.6931471805599453, 'LOG2E': 1.4426950408889634, 'LOG10E': 0.4342944819032518, 'PI': 3.141592653...
fingeronthebutton/robotframework
refs/heads/master
atest/testdata/keywords/resources/MyLibrary2.py
22
from robot.libraries.BuiltIn import BuiltIn, register_run_keyword class MyLibrary2: def keyword_only_in_library_2(self): print "Keyword from library 2" def keyword_in_both_libraries(self): print "Keyword from library 2" def keyword_in_all_resources_and_libraries(self): print "Ke...
deepakselvaraj/federated-horizon
refs/heads/master
openstack_dashboard/dashboards/project/networks/forms.py
11
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
bocaaust/FreshLife
refs/heads/master
django_project/env/lib/python2.7/site-packages/django/contrib/messages/tests/base.py
63
from django import http from django.conf import settings, global_settings from django.contrib.messages import constants, utils, get_level, set_level from django.contrib.messages.api import MessageFailure from django.contrib.messages.storage import default_storage, base from django.contrib.messages.storage.base import M...
Fusselwurm/ACE3
refs/heads/master
tools/setup.py
21
#!/usr/bin/env python3 ####################### # ACE3 Setup Script # ####################### import os import sys import shutil import platform import subprocess import winreg ######## GLOBALS ######### MAINDIR = "z" PROJECTDIR = "ace" CBA = "P:\\x\\cba" ########################## def main(): FULLDIR = "{}\\{...
rnestler/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executormarionette.py
5
import os import socket import threading import traceback import urlparse import uuid errors = None marionette = None pytestrunner = None here = os.path.join(os.path.split(__file__)[0]) from .base import (ExecutorException, Protocol, RefTestExecutor, RefTestIm...
guilhermechapiewski/simple-db-migrate
refs/heads/master
simple_db_migrate/mysql.py
1
import re from .core import Migration from .core.exceptions import MigrationException from .helpers import Utils class MySQL(object): __re_objects = re.compile("(?ims)(?P<pre>.*?)(?P<main>create[ \n\t\r]*(definer[ \n\t\r]*=[ \n\t\r]*[^ \n\t\r]*[ \n\t\r]*)?(trigger|function|procedure).*?)\n[ \n\t\r]*/([ \n\t\r]+(?P...
Damnever/2L
refs/heads/master
app/libs/statsd.py
1
# -*- coding: utf-8 -*- """ Reference: pystatsd.statsd Just for numbers of code line, O(∩_∩)O~, I am a genius... """ from __future__ import print_function, division, absolute_import import socket import time import random class Client(object): def __init__(self, host='localhost', port=8125, prefix='2L'): ...
beni55/django-userena
refs/heads/master
userena/contrib/umessages/fields.py
16
from django import forms from django.forms import widgets from django.utils.translation import ugettext_lazy as _ from userena.utils import get_user_model class CommaSeparatedUserInput(widgets.Input): input_type = 'text' def render(self, name, value, attrs=None): if value is None: value =...
igemsoftware/SYSU-Software2013
refs/heads/master
project/Python27_32/Lib/lib2to3/fixes/fix_idioms.py
327
"""Adjust some old Python 2 idioms to their modern counterparts. * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while True:"....
ivar1234/babu.repo
refs/heads/devel
test/units/playbook/test_taggable.py
293
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
asposepdf/Aspose_Pdf_Cloud
refs/heads/master
Examples/Python/Examples/DeletePageFromPDF.py
4
import asposepdfcloud from asposepdfcloud.PdfApi import PdfApi from asposepdfcloud.PdfApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi from asposestoragecloud.StorageApi import ResponseMessage apiKey = "XXXXX" #sepcify App Key appSid = "XXXXX" #sepcify App SID api...
0jpq0/kbengine
refs/heads/master
kbe/src/lib/python/Lib/distutils/tests/test_build_scripts.py
118
"""Tests for distutils.command.build_scripts.""" import os import unittest from distutils.command.build_scripts import build_scripts from distutils.core import Distribution from distutils import sysconfig from distutils.tests import support from test.support import run_unittest class BuildScriptsTestCase(support.T...
BBN-Q/QGL
refs/heads/develop
tests/test_Config.py
1
# -*- coding: UTF-8 -*- ''' Created on August 2, 2017 @author: dan.ellard@raytheon.com Copyright 2017 Raytheon BBN Technologies 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.apach...
Wingless-Archangel/bokken
refs/heads/master
ui/statusbar.py
1
# statusbar.py # # Copyright 2011 Hugo Teso <hugo.teso@gmail.com> # # 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 2 of the License, o...
m11s/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/ma/core.py
53
""" numpy.ma : a package to handle missing or invalid values. This package was initially written for numarray by Paul F. Dubois at Lawrence Livermore National Laboratory. In 2006, the package was completely rewritten by Pierre Gerard-Marchant (University of Georgia) to make the MaskedArray class a subclass of ndarray,...
DuCorey/bokeh
refs/heads/master
tests/plugins/upload_to_s3.py
6
import boto from boto.s3.key import Key as S3Key from boto.exception import NoAuthHandlerFound from os.path import join from .constants import job_id, __version__ from .utils import trace, ok, fail import logging logging.getLogger('boto').setLevel(logging.INFO) S3_BUCKET = "bokeh-travis" S3_URL = "https://s3.amazon...
tchernomax/ansible
refs/heads/devel
test/units/modules/cloud/amazon/test_aws_s3.py
67
import pytest import unittest try: import ansible.modules.cloud.amazon.aws_s3 as s3 except ImportError: pytestmark = pytest.mark.skip("This test requires the s3 Python libraries") from ansible.module_utils.six.moves.urllib.parse import urlparse boto3 = pytest.importorskip("boto3") class TestUrlparse(unitt...
TEAM-Gummy/platform_external_chromium_org
refs/heads/kk4.4
build/android/lint/suppress.py
27
#!/usr/bin/env python # # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Add all generated lint_result.xml files to suppressions.xml""" import collections import optparse import os import sys from ...
berendkleinhaneveld/VTK
refs/heads/master
Examples/DataManipulation/Python/Arrays.py
27
#!/usr/bin/env python # This example demonstrates the use of VTK data arrays as attribute # data as well as field data. It creates geometry (vtkPolyData) as # well as attribute data explicitly. import vtk # Create a float array which represents the points. pcoords = vtk.vtkFloatArray() # Note that by default, an arr...