repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
dandanvidi/capacity-usage
refs/heads/master
scripts/MFA_constrained_pFBA.py
3
# -*- coding: utf-8 -*- """ Created on Sat Jun 25 13:20:57 2016 @author: dan """ import pandas as pd import numpy as np from cobra.io.sbml import create_cobra_model_from_sbml_file from cobra.flux_analysis.parsimonious import optimize_minimal_flux from cobra.manipulation.modify import convert_to_irreversible conditio...
ivancrneto/django-magic-album
refs/heads/master
magicalbum/utils.py
1
""" Utilitary functions module """ from django.core.mail import EmailMessage def send_album_email(sender, instance, **kwargs): """ sends email showing the album number of pictures when it has multiple of 100 pictures and less then 501 pictures """ num_pics = len(instance.pictures) if num_pics an...
MapStory/geonode
refs/heads/master
geonode/upload/signals.py
32
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 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 ...
mariansoban/ardupilot
refs/heads/Copter-4.0.x-sobi-phl-8m
Tools/autotest/pysim/util.py
5
from __future__ import print_function import atexit import math import os import random import re import shlex import signal import subprocess import sys import tempfile import time from math import acos, atan2, cos, pi, sqrt import pexpect from . rotmat import Matrix3, Vector3 if (sys.version_info[0] >= 3): EN...
jeromewu/bitcoin-opennet
refs/heads/master
share/qt/make_spinner.py
563
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload.png' TMPDIR='../../src/qt/res/movies/' TMPNAME='spinner-%03i.png' NUMFRAMES=35 FRAMERA...
dougluce/ansible-modules-core
refs/heads/devel
utilities/logic/async_wrapper.py
189
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
mrquim/repository.mrquim
refs/heads/master
plugin.video.castaway/resources/lib/modules/cache.py
7
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda 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 ...
karim-omran/openerp-addons
refs/heads/master
hr_simplify/__init__.py
4
#-*- coding:utf-8 -*- # # # Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation,...
MoamerEncsConcordiaCa/tensorflow
refs/heads/master
tensorflow/contrib/layers/python/layers/encoders_test.py
111
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tlatzko/spmcluster
refs/heads/master
.tox/2.6-nocov/lib/python2.6/site-packages/wheel/pkginfo.py
565
"""Tools for reading and writing PKG-INFO / METADATA without caring about the encoding.""" from email.parser import Parser try: unicode _PY3 = False except NameError: _PY3 = True if not _PY3: from email.generator import Generator def read_pkg_info_bytes(bytestr): return Parser().pars...
meteora9479/deep-visualization-toolbox
refs/heads/master
__init__.py
12133432
dompuiu/puzzles
refs/heads/master
mafia-problem/src/__init__.py
12133432
manikishan/fosswebsite
refs/heads/master
clubManagement/templatetags/__init__.py
12133432
taoger/titanium_mobile
refs/heads/master
support/common/markdown/inlinepatterns.py
107
""" INLINE PATTERNS ============================================================================= Inline patterns such as *emphasis* are handled by means of auxiliary objects, one per pattern. Pattern objects must be instances of classes that extend markdown.Pattern. Each pattern object uses a single regular express...
mavenlin/tensorflow
refs/heads/master
tensorflow/contrib/keras/python/keras/utils/layer_utils.py
9
# 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...
wlamond/scikit-learn
refs/heads/master
sklearn/metrics/pairwise.py
28
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
simplegeo/clusto-sgext
refs/heads/pending
setup.py
1
from setuptools import setup, find_packages __version__ = file('VERSION', 'r').read().strip('\r\n\t ') setup(name='clusto-sgext', version=__version__, packages=find_packages(), install_requires=[ 'IPy', 'PyYAML', 'boto', 'clusto', 'decorator', 'eventle...
menren/openshift-ansible
refs/heads/master
bin/openshift_ansible/utils.py
45
#!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 ''' The purpose of this module is to contain small utility functions. ''' import re def normalize_dnsname(name, padding=10): ''' The purpose of this function is to return a dns name with zero padding, so that it sorts properly (as a human woul...
drawks/ansible
refs/heads/devel
test/integration/targets/inventory_cloudscale/filter_plugins/group_name.py
24
from ansible.inventory.group import to_safe_group_name def safe_group_name(name): return to_safe_group_name(name) class FilterModule(object): filter_map = { 'safe_group_name': safe_group_name } def filters(self): return self.filter_map
pridemusvaire/yowsup
refs/heads/master
yowsup/env/test_env_s40.py
64
import unittest from yowsup.env import S40YowsupEnv class S40YowsupEnvTest(unittest.TestCase): def test_tokengen(self): phone = "1234567" S40YowsupEnv._TOKEN_STRING = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1425519315543{phone}" env = S40YowsupEnv() token = env.getToken(phone) ...
Diegojnb/JdeRobot
refs/heads/master
src/tools/scratch2jderobot/src/tests/test_kurt_write.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import kurt import os # get current working directory path = os.getcwd() path = path[:path.rfind('src')] + 'data/' # load the scratch project p = kurt.Project.load(path + 'test_scratch2.sb2') # show the blocks included for scriptable in p.sprites + [p.stage]: for sc...
martinlunde/RealBack
refs/heads/dev
realback_api/migrations/__init__.py
12133432
automl/HPOlib2
refs/heads/master
hpolib/container/benchmarks/__init__.py
12133432
ccn-2m/django
refs/heads/master
tests/modeltests/delete/__init__.py
12133432
xrmx/django
refs/heads/master
tests/view_tests/app0/__init__.py
12133432
fredkingham/blog-of-fred
refs/heads/master
registration/tests/default_backend.py
1
import datetime from django.conf import settings from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core import mail from django.core.urlresolvers import reverse from django.test import TestCase from registration import signals from registration.admin import Registrat...
JFriel/honours_project
refs/heads/master
networkx/networkx/algorithms/assortativity/tests/test_neighbor_degree.py
99
#!/usr/bin/env python from nose.tools import * import networkx as nx class TestAverageNeighbor(object): def test_degree_p4(self): G=nx.path_graph(4) answer={0:2,1:1.5,2:1.5,3:2} nd = nx.average_neighbor_degree(G) assert_equal(nd,answer) D=G.to_directed() nd...
GaetanCambier/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/izlesene.py
26
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, float_or_none, get_element_by_id, int_or_none, parse_iso8601, str_to_int, ) class IzleseneIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:...
jhol/libsigrokdecode
refs/heads/public
decoders/can/__init__.py
2
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.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 2 of the Li...
antljones/physics
refs/heads/master
velocity_and_distance_from_rest.py
1
import sys import argparse import math heavenly_body = {'mercury' : 3.7, 'venus' : 8.87, 'earth' : 9.8, 'mars' : 3.71, 'jupiter' : 24.79, 'saturn' : 10.44, 'uranus' : 8.87, 'neptune' : 11.15, 'moon' : 1.624 } #Set the argument parser and comm...
wagtail/wagtail
refs/heads/stable/2.13.x
wagtail/contrib/simple_translation/tests/test_forms.py
4
from django.forms import CheckboxInput, HiddenInput from django.test import TestCase, override_settings from wagtail.contrib.simple_translation.forms import SubmitTranslationForm from wagtail.core.models import Locale, Page from wagtail.tests.i18n.models import TestPage from wagtail.tests.utils import WagtailTestUtils...
Vamshi99/coala-bears
refs/heads/master
bears/general/FilenameBear.py
8
import os.path from coalib.bears.LocalBear import LocalBear from coalib.results.Diff import Diff from coalib.results.Result import Result from coalib.bearlib.naming_conventions import ( to_camelcase, to_kebabcase, to_pascalcase, to_snakecase, to_spacecase) class FilenameBear(LocalBear): LANGUAGES = {'All'} ...
Vixionar/django
refs/heads/master
tests/template_tests/filter_tests/test_timeuntil.py
207
from __future__ import unicode_literals from datetime import datetime, timedelta from django.template.defaultfilters import timeuntil_filter from django.test import SimpleTestCase from django.test.utils import requires_tz_support from ..utils import setup from .timezone_utils import TimezoneTestCase class Timeunti...
UnderGreen/ansible-modules-extras
refs/heads/devel
windows/win_timezone.py
71
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Phil Schwartz <schwartzmx@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 ...
Krossom/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/unittest/test/test_break.py
785
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if threa...
gh0std4ncer/doit
refs/heads/master
doc/tutorial/doit_config.py
10
DOIT_CONFIG = {'default_tasks': ['my_task_1', 'my_task_2'], 'continue': True, 'reporter': 'json'}
lsinfo/odoo
refs/heads/8.0
addons/l10n_be_intrastat/__openerp__.py
257
# -*- encoding: utf-8 -*- ############################################################################## # # Odoo, Open Source Business Applications # Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
defance/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/mongo/__init__.py
268
""" Provide names as exported by older mongo.py module """ from xmodule.modulestore.mongo.base import MongoModuleStore, MongoKeyValueStore # Backwards compatibility for prod systems that refererence # xmodule.modulestore.mongo.DraftMongoModuleStore from xmodule.modulestore.mongo.draft import DraftModuleStore as Draft...
pjdelport/pip
refs/heads/develop
pip/commands/unzip.py
122
from __future__ import absolute_import from pip.commands.zip import ZipCommand class UnzipCommand(ZipCommand): """Unzip individual packages.""" name = 'unzip' summary = 'DEPRECATED. Unzip individual packages.'
jhh/puka
refs/heads/main
bookmarks/admin.py
1
from django.contrib import admin from .models import Bookmark @admin.register(Bookmark) class BookmarkAdmin(admin.ModelAdmin): list_display = ( "id", "title", "url", "tags", "created_at", ) list_filter = ("created_at",) date_hierarchy = "created_at" exclude...
oVirt/ovirt-node-ng
refs/heads/master
src/nodectl/banner.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # # nodectl # # Copyright (C) 2016 Red Hat, Inc. # # 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, or # (at your optio...
dfdx2/django
refs/heads/master
django/views/generic/dates.py
16
import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.http import Http404 from django.utils import timezone from django.utils.functional import cached_property from django.utils.translation import gettext as _ from django.views...
kvnvelasco/aposi
refs/heads/master
src/app_/forms.py
2
from flask.ext.wtf import Form from wtforms import StringField, TextAreaField, SelectField, FileField, SubmitField from wtforms.validators import DataRequired from flask_wtf.file import FileField, FileAllowed, FileRequired class sendForm(Form): fullName = StringField('name', validators=[DataRequired()]) email = St...
harris-helios/helios-sdk-python
refs/heads/master
helios/utilities/json_utils.py
1
"""Helper functions for JSON objects.""" import json def read_json_file(json_file, **kwargs): """ Read a json file. Args: json_file (str): Full path to JSON file. **kwargs: Any keyword argument from the json.load method. Returns: dict: JSON formatted dictionary. """ w...
tima/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/__init__.py
12133432
lmallin/coverage_test
refs/heads/master
python_venv/lib/python2.7/site-packages/pandas/tests/indexes/timedeltas/__init__.py
12133432
aruizramon/alec_erpnext
refs/heads/master
erpnext/patches/v4_2/__init__.py
12133432
swdream/neutron
refs/heads/master
neutron/agent/l3/config.py
12
# Copyright (c) 2015 OpenStack Foundation. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
electrumalt/electrum-doge
refs/heads/master
lib/transaction.py
1
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
evangeline97/localwiki-backend-server
refs/heads/master
localwiki/tags/admin.py
4
from django.contrib import admin from guardian.admin import GuardedModelAdmin from models import Tag class TagAdmin(GuardedModelAdmin): pass admin.site.register(Tag, TagAdmin)
teoliphant/scipy
refs/heads/master
scipy/weave/examples/wx_speed.py
12
""" Implements a fast replacement for calling DrawLines with an array as an argument. It uses weave, so you'll need that installed. Copyright: Space Telescope Science Institute License: BSD Style Designed by: Enthought, Inc. Author: Eric Jones eric@enthought.com I wrote this becaus...
carlos-ferras/Sequence-ToolKit
refs/heads/master
pyqtgraph/widgets/GradientWidget.py
50
# -*- coding: utf-8 -*- from ..Qt import QtGui, QtCore from .GraphicsView import GraphicsView from ..graphicsItems.GradientEditorItem import GradientEditorItem import weakref import numpy as np __all__ = ['GradientWidget'] class GradientWidget(GraphicsView): """ Widget displaying an editable color gradient. ...
jomyhuang/sdwle
refs/heads/master
SDWLE/cards_copy/weapons/rogue.py
2
from SDWLE.cards.base import WeaponCard from SDWLE.game_objects import Weapon from SDWLE.tags.action import Damage from SDWLE.tags.base import Battlecry, Buff from SDWLE.tags.condition import GreaterThan, IsType from SDWLE.tags.selector import CharacterSelector, UserPicker, Count, MinionSelector from SDWLE.tags.status ...
yawnosnorous/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_future.py
57
# Test various flavors of legal and illegal future statements import unittest from test import support import re rx = re.compile('\((\S+).py, line (\d+)') def get_error_location(msg): mo = rx.search(str(msg)) return mo.group(1, 2) class FutureTest(unittest.TestCase): def test_future1(self): sup...
daodaoliang/python-phonenumbers
refs/heads/dev
python/phonenumbers/data/region_GW.py
7
"""Auto-generated file, do not edit by hand. GW metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_GW = PhoneMetadata(id='GW', country_code=245, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[3-79]\\d{6}', possible_number_pattern='...
dhruvagarwal/django
refs/heads/master
django/contrib/gis/db/backends/postgis/const.py
528
""" PostGIS to GDAL conversion constant definitions """ # Lookup to convert pixel type values from GDAL to PostGIS GDAL_TO_POSTGIS = [None, 4, 6, 5, 8, 7, 10, 11, None, None, None, None] # Lookup to convert pixel type values from PostGIS to GDAL POSTGIS_TO_GDAL = [1, 1, 1, 3, 1, 3, 2, 5, 4, None, 6, 7, None, None] # ...
kingvuplus/gui_test2
refs/heads/master
lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/__init__.py
12133432
makemytrip/dataShark
refs/heads/master
plugins/output/__init__.py
12133432
evildmp/django-cms
refs/heads/master
cms/test_utils/project/pluginapp/plugins/__init__.py
12133432
russelmahmud/mess-account
refs/heads/master
django/db/backends/dummy/__init__.py
12133432
mdibaiee/servo
refs/heads/master
tests/wpt/web-platform-tests/webdriver/modal/__init__.py
12133432
dims/oslo.messaging
refs/heads/master
oslo_messaging/_drivers/zmq_driver/client/__init__.py
12133432
landryb/QGIS
refs/heads/master
python/plugins/processing/ProcessingPlugin.py
4
# -*- coding: utf-8 -*- """ *************************************************************************** ProcessingPlugin.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
dgoedkoop/QGIS
refs/heads/master
scripts/qgis_fixes/fix_methodattrs.py
77
from lib2to3.fixes.fix_methodattrs import FixMethodattrs
TakeshiTseng/ryu
refs/heads/master
ryu/lib/packet/bfd.py
12
# Copyright (C) 2014 Xinguard, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
MattDevo/edk2
refs/heads/master
AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_dummy_thread.py
12
"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import dummy_thread as _thread import time import Queue import random import unittest fr...
marmyshev/item_title
refs/heads/master
openlp/plugins/media/lib/mediaitem.py
1
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
d3banjan/polyamide
refs/heads/master
webdev/lib/python2.7/site-packages/django/conf/locale/ga/__init__.py
12133432
iclosure/jcoolkits
refs/heads/master
src/jplot3d-py/com/__init__.py
12133432
jazkarta/edx-platform
refs/heads/master
common/djangoapps/track/contexts.py
126
"""Generates common contexts""" import logging from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from util.request import COURSE_REGEX log = logging.getLogger(__name__) def course_context_from_url(url): """ Extrac...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/tests/unit/ec2/elb/test_loadbalancer.py
114
#!/usr/bin/env python from tests.unit import unittest from tests.compat import mock from boto.ec2.elb import ELBConnection from boto.ec2.elb import LoadBalancer DISABLE_RESPONSE = b"""<?xml version="1.0" encoding="UTF-8"?> <DisableAvailabilityZonesForLoadBalancerResult xmlns="http://ec2.amazonaws.com/doc/2013-02-01/...
fniephaus/alfred-gmail
refs/heads/master
src/gmail_launcher.py
1
import os import subprocess import sys import json import httplib2 import base64 from email.mime.text import MIMEText from googleapiclient.discovery import build from googleapiclient import errors from oauth2client.client import flow_from_clientsecrets, OAuth2Credentials from oauth2client.tools import run_flow from w...
hellhovnd/django
refs/heads/master
tests/db_typecasts/__init__.py
12133432
dnozay/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/defer_regress/__init__.py
12133432
polojacky/ehfpi
refs/heads/master
ehf/magic/__init__.py
12133432
abhishekgahlot/compbio
refs/heads/master
test/compbio/test_birthdeath.py
3
from math import exp import unittest from compbio import birthdeath from rasmus.testing import eq_sample_pmf #============================================================================= # test coalescence times (normal, censored, bounded) def rannala1996_prob_birth_death1(n, t, birth, death): ert = exp(-(b...
johnseekins/graphite-web
refs/heads/master
webapp/graphite/views.py
39
import traceback from django.http import HttpResponseServerError from django.template import Context, loader def server_error(request, template_name='500.html'): template = loader.get_template(template_name) context = Context({ 'stacktrace' : traceback.format_exc() }) return HttpResponseServerError( templ...
kdagley/midas_pr
refs/heads/master
config/settings/production.py
1
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis on Heroku ''' from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django.utils...
odicraig/kodi2odi
refs/heads/master
addons/plugin.video.roggerstream-3.0.7/mechanize/_beautifulsoup.py
5
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" v2.1.1 http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses arbitrarily invalid XML- or HTML-like substance into a tree representation. It provides methods and Pythonic idioms that make it easy to search and modify the tree. A w...
SimonTheCoder/server_monitor
refs/heads/master
auto_swap.py
1
#!/usr/bin/python import sys import subprocess import threading import monitor import json import time class Looper: def __init__(self,exec_path, config_path, duration, host_list): self.exec_path = exec_path self.config_path = config_path self.duration = duration self.host_list...
github4ry/pysentiment
refs/heads/master
pysentiment/__init__.py
3
from pysentiment.hiv4 import HIV4 from pysentiment.lm import LM
thiagorcdl/AdventOfCode
refs/heads/master
2015/adv7.py
1
#!/usr/bin/python2 import sys f = open('./input7.txt', 'r') var = {} def AND(a, b): return val(a) & val(b) def OR(a, b): return val(a) | val(b) def LSHIFT(a, n): return val(a) * (2 ** int(n)) def RSHIFT(a, n): return val(a) / (2 ** int(n)) def val(key): try: return int(key) ex...
Matt-Deacalion/Rasa-Django
refs/heads/master
website/apps/core/views.py
1
from django.views.generic import TemplateView class HomeView(TemplateView): template_name = 'base.html'
untitaker/pytest
refs/heads/master
testing/test_unittest.py
9
import pytest def test_simple_unittest(testdir): testpath = testdir.makepyfile(""" import unittest class MyTestCase(unittest.TestCase): def testpassing(self): self.assertEquals('foo', 'foo') def test_failing(self): self.assertEquals('foo', 'ba...
vabs22/zulip
refs/heads/master
zerver/views/messages.py
1
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.utils.timezone import now as timezone_now from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.db import connection from django.http import...
sodo13/openpli-gls
refs/heads/master
lib/python/Tools/BoundFunction.py
120
class boundFunction: def __init__(self, fnc, *args, **kwargs): self.fnc = fnc self.args = args self.kwargs = kwargs def __call__(self, *args, **kwargs): newkwargs = self.kwargs newkwargs.update(kwargs) return self.fnc(*self.args + args, **newkwargs)
jamtot/HackerEarth
refs/heads/master
Problems/My Fibonacci/myfib.py
1
def myfib(A,B,N): for i in xrange(N-1): A,B=B,A+B return A if __name__ == "__main__": ABN = map(int,raw_input().split()) print myfib(ABN[0],ABN[1],ABN[2])
hybrideagle/django
refs/heads/master
django/contrib/contenttypes/migrations/0001_initial.py
585
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.contenttypes.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ContentType', fields=...
Adai0808/scrapy-1
refs/heads/master
tests/test_utils_misc/test_walk_modules/mod/__init__.py
12133432
lsaffre/lino_book
refs/heads/master
lino_book/projects/myroles/myroles.py
3
from lino_xl.lib.xl.user_types import * from lino.api import dd, rt from lino_xl.lib.polls.roles import PollsUser AllPolls = rt.models.polls.AllPolls AllPolls.required_roles = dd.login_required(PollsUser)
bjko/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/pulseaudio_sanitizer.py
122
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyrigth (C) 2012 Intel Corporation # # 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 # n...
rockfruit/bika.lims
refs/heads/master
bika/lims/content/contact.py
1
# -*- coding: utf-8 -*- # # This file is part of Bika LIMS # # Copyright 2011-2016 by it's authors. # Some rights reserved. See LICENSE.txt, AUTHORS.txt. """The contact person at an organisation. """ import types from Acquisition import aq_base from Acquisition import aq_inner from Acquisition import aq_parent from ...
geekboxzone/lollipop_external_chromium_org
refs/heads/geekbox
tools/python/google/path_utils.py
191
# Copyright (c) 2011 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. """Some utility methods for getting and manipulating paths.""" # TODO(pamg): Have the buildbot use these, too. import errno import os import sys clas...
saaros/kafka-python
refs/heads/master
test/test_util.py
15
# -*- coding: utf-8 -*- import struct import six from . import unittest import kafka.common import kafka.util class UtilTest(unittest.TestCase): @unittest.skip("Unwritten") def test_relative_unpack(self): pass def test_write_int_string(self): self.assertEqual( kafka.util.wri...
Mj258/weiboapi
refs/heads/master
srapyDemo/tutorial/tutorial/settings.py
14
# -*- coding: utf-8 -*- # Scrapy settings for tutorial project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/lates...
sn1k/app_mundial
refs/heads/master
lib/python2.7/site-packages/django/contrib/comments/views/moderation.py
54
from django import template from django.conf import settings from django.contrib import comments from django.contrib.auth.decorators import login_required, permission_required from django.contrib.comments import signals from django.contrib.comments.views.utils import next_redirect, confirmation_view from django.shortcu...
stylianos-kampakis/scikit-learn
refs/heads/master
examples/applications/svm_gui.py
287
""" ========== Libsvm GUI ========== A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create data points by point and click and visualize the decision region induced by different kernels and parameter settings. To create positive examples click the left mouse button; to create neg...
olivierverdier/pydflatex
refs/heads/master
test/__init__.py
12133432
mdanielwork/intellij-community
refs/heads/master
python/testData/completion/relativeFromImportInNamespacePackage/nspkg1/nspkg2/foo.py
12133432
mjirayu/sit_academy
refs/heads/master
common/djangoapps/heartbeat/__init__.py
12133432