repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
csnake-org/CSnake
refs/heads/master
tests/data/thirdParty/Four/csnFour.py
4
# Csnake project configuration import csnCilab from csnAll import three four = csnCilab.CilabModuleProject("Four", "third party") four.pathsManager.useFilePath = "%s/Four/UseFour.cmake" % four.GetBuildFolder() four.pathsManager.configFilePath = "%s/Four/FourConfig.cmake" % four.GetBuildFolder() four.AddProjects([three...
zhukite/nikola-install
refs/heads/master
tests/test_command_import_wordpress.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from context import nikola import os import unittest import mock import nikola.plugins.command.import_wordpress class BasicCommandImportWordpress(unittest.TestCase): def setUp(self): self.module = nikola.plugins.command.import_wordpress ...
wilebeast/FireFox-OS
refs/heads/master
B2G/external/gtest/test/gtest_shuffle_test.py
3023
#!/usr/bin/env python # # Copyright 2009 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...
quarkslab/irma
refs/heads/master
frontend/extras/migration/versions/1ea7100d95d0_version_2_0_5.py
1
"""version 2.0.5 Revision ID: 1ea7100d95d0 Revises: 17cafa6e8016 Create Date: 2018-01-17 16:07:54.181133 """ # revision identifiers, used by Alembic. revision = '1ea7100d95d0' down_revision = '17cafa6e8016' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.sql imp...
jeffreylu9/django-cms
refs/heads/wlsite
cms/south_migrations/0005_mptt_added_to_plugins.py
1680
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
aatchison/mycroft-core
refs/heads/master
mycroft/util/log.py
1
# Copyright 2017 Mycroft AI 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 writin...
yuananzhang/myscrapy
refs/heads/master
google_translate/google_translate/items.py
1
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class GoogleTranslateItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() pass
google/grr
refs/heads/master
grr/client/grr_response_client/unprivileged/memory/server.py
1
#!/usr/bin/env python """Functionality to create an unprivileged memory server.""" from typing import List from grr_response_client.unprivileged import communication from grr_response_client.unprivileged import interface_registry from grr_response_client.unprivileged import server def CreateMemoryServer( proces...
stemount/taylettings
refs/heads/master
node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
395
#!/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 MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
nikolay-fedotov/networking-cisco
refs/heads/master
networking_cisco/plugins/cisco/extensions/qos.py
31
# Copyright 2011 Cisco Systems, 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 requi...
youdonghai/intellij-community
refs/heads/master
python/testData/quickFixes/PyMoveAttributeToInitQuickFixTest/propertyNegative.py
83
class FavouriteManager(object): """Favourite manager""" def __init__(self, session): self._session = session @property def _favourite_ids(self): """Get favourites""" try: return map(int, self._session.get('favourite', '').split(',')) except ValueError: ...
JamesMGreene/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/QueueStatusServer/filters/webkit_extras.py
121
# Copyright (C) 2009 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...
trezorg/django
refs/heads/master
django/contrib/sites/models.py
387
from django.db import models from django.utils.translation import ugettext_lazy as _ SITE_CACHE = {} class SiteManager(models.Manager): def get_current(self): """ Returns the current ``Site`` based on the SITE_ID in the project's settings. The ``Site`` object is cached the first ...
ryfeus/lambda-packs
refs/heads/master
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/crf/__init__.py
25
# 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...
ammiranda/CS325
refs/heads/master
week1/code/find_min_max.py
1
def find_min_max(arr): start_index = None comparisons = 0 if len(arr) % 2 == 0: if arr[0] > arr[1]: max_val = arr[0] min_val = arr[1] else: max_val = arr[1] min_val = arr[0] start_index = 2 comparisons += 1 else: max_val = arr[...
projectcalico/calico-nova
refs/heads/calico-readme
nova/tests/unit/api/openstack/compute/contrib/test_tenant_networks.py
7
# Copyright 2014 IBM Corp. # # 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 t...
detiber/ansible-modules-core
refs/heads/devel
files/fetch.py
94
# this is a virtual module that is entirely implemented server side # 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 op...
cernops/rally
refs/heads/master
rally/cli/commands/plugin.py
10
# Copyright 2015: Mirantis 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 b...
inovtec-solutions/OpenERP
refs/heads/branch_openerp
openerp/addons/account/account.py
1
# -*- 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...
apixandru/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/db/backends/spatialite/models.py
403
""" The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. """ from django.db import models from django.contrib.gis.db.backends.base import SpatialRefSysMixin class GeometryColumns(models.Model): """ The 'geometry_columns' table from SpatiaLite. """ f_table_name = models.CharField(ma...
psnj/petl
refs/heads/master
examples/io/json.py
4
from __future__ import division, print_function, absolute_import # fromjson() ############ import petl as etl data = ''' [{"foo": "a", "bar": 1}, {"foo": "b", "bar": 2}, {"foo": "c", "bar": 2}] ''' with open('example.json', 'w') as f: f.write(data) table1 = etl.fromjson('example.json') table1 # fromdicts() ##...
jhona22baz/blog-flask
refs/heads/master
python2.7/lib/python2.7/site-packages/werkzeug/testsuite/contrib/securecookie.py
102
# -*- coding: utf-8 -*- """ werkzeug.testsuite.securecookie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the secure cookie. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.utils import...
braintreeps/moto
refs/heads/master
moto/s3bucket_path/__init__.py
7
from __future__ import unicode_literals from moto import mock_s3 mock_s3bucket_path = mock_s3
ehthiede/EMUS
refs/heads/master
src/emus/usutils.py
1
# -*- coding: utf-8 -*- """Module containing methods useful for analyzing umbrella sampling calculations that do not rely directly on the EMUS estimator. """ from __future__ import absolute_import import numpy as np from ._defaults import DEFAULT_KT, DEFAULT_T, DEFAULT_K_B import numbers def neighbors_harmonic(cent...
w1kke/pylearn2
refs/heads/master
pylearn2/scripts/show_examples.py
44
#!/usr/bin/env python """ .. todo:: WRITEME """ from __future__ import print_function __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" impor...
openSUSE/docmanager
refs/heads/develop
test/test_docmanager_exitcodes.py
1
#!/usr/bin/python3 import pytest import shlex from docmanager.cli import parsecli from docmanager.action import Actions from docmanager.core import ReturnCodes from xml.sax._exceptions import SAXParseException def test_exitcodes_0(tmp_broken_xml): """ call docmanager without params """ try: parser = p...
varunarya10/python-neutronclient
refs/heads/master
neutronclient/tests/unit/test_cli20_subnet.py
4
# Copyright 2012 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 # # Unless requ...
VasuAgrawal/tartanHacks2015
refs/heads/master
site/flask/lib/python2.7/site-packages/pip/commands/completion.py
435
from __future__ import absolute_import import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ CO...
caotianwei/django
refs/heads/master
django/shortcuts.py
129
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ import warnings from django.core import urlresolvers from django.db.models.base import ModelBase from django.db.models.manager imp...
aphexddb/agocontrol
refs/heads/master
devices/webcam/agowebcam.py
2
#!/usr/bin/python # ago client webcam device # # copyright (c) 2013 Harald Klein <hari+ago@vt100.at> # import agoclient import urllib2 import base64 client = agoclient.AgoConnection("webcam") def messageHandler(internalid, content): result = {} result["result"] = -1; if "command" in content: if content['comma...
ZhangXinNan/tensorflow
refs/heads/master
tensorflow/contrib/tensorrt/python/trt_convert.py
3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
sandeepdsouza93/TensorFlow-15712
refs/heads/master
tensorflow/python/framework/tensor_util_test.py
6
# 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...
anastue/netforce
refs/heads/stable-3.1
netforce/netforce/layout.py
2
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
niharathomas/mongodb-tornado-angular
refs/heads/master
utils/generator/create_app.py
2
#!/usr/bin/python import sys, getopt import os from templates.handler import create_handler from templates.controller import create_controller from templates.service import create_service from templates.view import create_view def camel_case(word): return ''.join(x.capitalize() or '_' for x in word.split('_')) ...
anshul313/chibleetestbackend
refs/heads/master
node_modules/node-gyp/gyp/PRESUBMIT.py
1369
# 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
t0mm13b/CAF-Zte-Blade-Android-MSM-2.6.35
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
srvg/ansible
refs/heads/devel
test/integration/targets/script/files/no_shebang.py
35
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys sys.stdout.write("Script with shebang omitted")
arpith/zulip
refs/heads/master
zerver/lib/url_preview/parsers/generic.py
33
from __future__ import absolute_import from typing import Any, Dict from zerver.lib.url_preview.parsers.base import BaseParser class GenericParser(BaseParser): def extract_data(self): # type: () -> Dict return { 'title': self._get_title(), 'description': self._get_descripti...
tinkerinestudio/Tinkerine-Suite
refs/heads/master
TinkerineSuite/pypy/lib-python/2.7/nturl2path.py
228
"""Convert a NT pathname to a file URL and vice versa.""" def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. # ///C|/foo/bar/spam.foo # becomes # C:\foo\bar\spam.foo import string, urlli...
neerja28/Tempest
refs/heads/master
tempest/api/compute/admin/test_live_migration.py
3
# Copyright 2012 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 # # Unless requ...
miaecle/deepchem
refs/heads/master
contrib/tensorflow_models/progressive_multitask.py
5
from __future__ import print_function from __future__ import division from __future__ import unicode_literals import warnings import time import numpy as np import tensorflow as tf from deepchem.utils.save import log from deepchem.metrics import to_one_hot from deepchem.metrics import from_one_hot from deepchem.nn im...
marcsans/cnn-physics-perception
refs/heads/master
phy/lib/python2.7/site-packages/scipy/optimize/tests/test__differential_evolution.py
21
""" Unit tests for the differential global minimization algorithm. """ from scipy.optimize import _differentialevolution from scipy.optimize._differentialevolution import DifferentialEvolutionSolver from scipy.optimize import differential_evolution import numpy as np from scipy.optimize import rosen from numpy.testing ...
diorcety/translate
refs/heads/master
translate/lang/__init__.py
4
# -*- coding: utf-8 -*- # # Copyright 2007 Zuza Software Foundation # # This file is part of translate. # # translate 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 y...
unseenlaser/python-for-android
refs/heads/master
python-modules/twisted/twisted/web/iweb.py
53
# -*- test-case-name: twisted.web.test -*- # Copyright (c) 2008-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Interface definitions for L{twisted.web}. @var UNKNOWN_LENGTH: An opaque object which may be used as the value of L{IBodyProducer.length} to indicate that the length of the entity b...
yalcinozhabes/pythonJDFTx
refs/heads/master
setup.py
1
# adapted from http://wiki.cython.org/PackageHierarchy from __future__ import print_function import sys, os, shutil, site import multiprocessing import subprocess as sb import tempfile as tmp import mpi4py from distutils.core import setup from distutils.extension import Extension from distutils import log from Cytho...
genomoncology/related
refs/heads/master
src/related/validators.py
1
from attr import attr, attributes import re @attributes(repr=False, slots=True) class _CompositeValidator(object): validators = attr() def __call__(self, inst, attr, value): for validator in self.validators: validator(inst, attr, value) def __repr__(self): return ( ...
bmwiedemann/linuxcnc-mirror
refs/heads/master
configs/sim/gmoccapy/gmoccapy_plasma/plasma.py
7
#!/usr/bin/env python # -*- coding:UTF-8 -*- """ This file will control some options of the gmoccapy plasma screen and demonstrats at the same time the possibilities you have introducing your own handler files and functions to that screen, showing the possibilities to modify the layout and behavior ...
magcius/sweettooth
refs/heads/master
sweettooth/ratings/views.py
1
import json from django.core.urlresolvers import reverse from django.contrib import comments from django.contrib.messages import info from django.shortcuts import redirect from django.utils.dateformat import format as format_date from extensions import models from decorators import ajax_view, model_view from utils i...
luosch/leetcode
refs/heads/master
python/Minimum Path Sum.py
1
class Solution(object): def minPathSum(self, grid): m = len(grid) n = len(grid[0]) dp = [[0 for _ in range(n)] for _ in range(m)] dp[0][0] = grid[0][0] for i in range(1, m): dp[i][0] = dp[i - 1][0] + grid[i][0] for i in range(1, n): ...
thecodinghub/news-for-good
refs/heads/master
news/Lib/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py
1777
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
marty331/jakesclock
refs/heads/master
flask/lib/python2.7/site-packages/wtforms/widgets/core.py
93
from __future__ import unicode_literals try: from html import escape except ImportError: from cgi import escape from wtforms.compat import text_type, iteritems __all__ = ( 'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput', 'RadioInput', 'Select', 'SubmitInput', 'TableWidget',...
ponyorm/pony
refs/heads/orm
pony/orm/examples/compositekeys.py
2
from __future__ import absolute_import from datetime import date from pony.orm.core import * db = Database('sqlite', 'complex.sqlite', create_db=True) class Group(db.Entity): dept = Required('Department') year = Required(int) spec = Required(int) students = Set('Student') courses = Set('Course') ...
Mega-DatA-Lab/mxnet
refs/heads/master
tools/bandwidth/test_measure.py
46
# 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...
eaplatanios/tensorflow
refs/heads/master
tensorflow/python/framework/op_def_registry.py
196
# 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...
metglobal/django-exchange
refs/heads/master
exchange/__init__.py
1
__version__ = '0.8.0' __author__ = 'Metglobal' __license__ = 'MIT' __copyright__ = 'Copyright 2013 Metglobal'
Huskerboy/startbootstrap-freelancer
refs/heads/master
freelancer_env/Lib/site-packages/gunicorn/workers/gaiohttp.py
101
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import sys if sys.version_info >= (3, 3): try: import aiohttp # NOQA except ImportError: raise RuntimeError("You need aiohttp installed to use this worker.") else...
jagguli/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/conf/locale/sr/formats.py
655
# -*- 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. F Y.' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_F...
kernc/networkx
refs/heads/master
networkx/algorithms/centrality/__init__.py
45
from .betweenness import * from .betweenness_subset import * from .closeness import * from .communicability_alg import * from .current_flow_closeness import * from .current_flow_betweenness import * from .current_flow_betweenness_subset import * from .degree_alg import * from .dispersion import * from .eigenvector impo...
xcu/conference-central
refs/heads/master
Lesson_2/001_Hello_Endpoints_Solutions/helloworld_api.py
48
"""Hello World API implemented using Google Cloud Endpoints. Contains declarations of endpoint, endpoint methods, as well as the ProtoRPC message class and container required for endpoint method definition. """ import endpoints from protorpc import messages from protorpc import message_types from protorpc import remot...
wpgallih/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/conditional.py
205
def main(request, response): tag = request.GET.first("tag", None) match = request.headers.get("If-None-Match", None) date = request.GET.first("date", "") modified = request.headers.get("If-Modified-Since", None) if tag: response.headers.set("ETag", '"%s"' % tag) elif date: respon...
KitKatXperience/platform_external_chromium_org
refs/heads/kk
tools/PRESUBMIT.py
35
# 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. """Top-level presubmit script for bisect trybot. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmi...
kenlist/chromium_tools_gyp
refs/heads/master
test/rules/src/copy-file.py
600
#!/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. import sys contents = open(sys.argv[1], 'r').read() open(sys.argv[2], 'wb').write(contents) sys.exit(0)
dfang/odoo
refs/heads/10.0
addons/hw_posbox_upgrade/__manifest__.py
22
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'PosBox Software Upgrader', 'category': 'Point of Sale', 'website': 'https://www.odoo.com/page/point-of-sale', 'sequence': 6, 'summary': 'Allows to remotely upgrade the PosBox software', ...
PyCQA/pylint
refs/heads/main
pylint/testutils/lint_module_test.py
1
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/LICENSE import csv import operator import platform import sys from collections import Counter from io import StringIO from typing import Dict, List, Optional, Tuple import pytest...
walnutgeek/slinck
refs/heads/master
scent.py
1
import os from sniffer.api import * @file_validator def js_files(filename): return filename.endswith('.js') or filename.endswith('.yaml') or filename.endswith('.json') @runnable def execute_mocha(*args): import nose if 0 == os.system('cd mocha ; mocha .'): vars = { 's' : 'slinck.js', ...
felliott/osf.io
refs/heads/develop
api_tests/providers/registrations/views/test_registration_provider_licenses.py
14
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import RegistrationProviderFactory from api_tests.providers.mixins import ProviderLicensesViewTestBaseMixin class TestRegistrationProviderLicenses(ProviderLicensesViewTestBaseMixin): provider_class = RegistrationProviderFacto...
isida/4
refs/heads/master
plugins/redirect.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # # # # Plugin for iSida Jabber Bot # # Copyright (C) diSabler <dsy@dsy....
ProyectosVariados/NMFdocuments
refs/heads/master
auxiliar.py
1
#! /usr/bin/python # -*- coding: utf-8 -*- from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import TextConverter from pdfminer.layout import LAParams from pdfminer.pdfpage import PDFPage from cStringIO import StringIO import numpy as np import os import unicodedata def con...
OpenTreeOfLife/germinator
refs/heads/master
trees_report/taxa_in_synthesis.py
1
# Some class and method names borrowed from peyotl/nexson_proxy.py import sys, os from org.opentreeoflife.taxa import Taxonomy def write_ids(tree, dest): with open(dest, 'w') as outfile: for node in tree.taxa(): if node.id != None: outfile.write('%s\n' % node.id) def load_tree...
miloszz/DIRAC
refs/heads/integration
FrameworkSystem/private/monitoring/__init__.py
38
# $HeadURL$ __RCSID__ = "$Id$"
fullmooninu/messy
refs/heads/master
roundrobin2.py
1
'''round robin tournament matches generator''' import random # demo code teams = ["Team1", "Team2", "Team3", "Team4", "Team5"] def fixtures(teams): if len(teams) % 2: teams.append('Day off') # if team number is odd - use 'day off' as fake team rotation = list(teams) # copy the list ...
zhimingxie/grpc
refs/heads/master
tools/distrib/python/submit.py
14
#!/usr/bin/env python2.7 # Copyright 2015 gRPC authors. # # 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 la...
0x90sled/catapult
refs/heads/master
third_party/gsutil/third_party/boto/tests/unit/cloudfront/test_invalidation_list.py
114
#!/usr/bin/env python import random import string from tests.compat import unittest, mock import boto RESPONSE_TEMPLATE = r""" <InvalidationList> <Marker/> <NextMarker>%(next_marker)s</NextMarker> <MaxItems>%(max_items)s</MaxItems> <IsTruncated>%(is_truncated)s</IsTruncated> %(inval_summaries)s </Inva...
pexip/os-foolscap
refs/heads/master
foolscap/api.py
1
# application code should import all names from here instead of from # __init__.py . Use code like this: # # from foolscap.api import Tub # # This will make it easier to rearrange Foolscap's internals in the future. # Anything you might import from outside foolscap.api is subject to movement # in new releases. from ...
pepetreshere/odoo
refs/heads/patch-2
addons/point_of_sale/models/account_journal.py
13
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved from odoo import fields, models, api class AccountJournal(models.Model): _inherit = 'account.journal' pos_payment_method_ids = fie...
Tejal011089/huntercamp_erpnext
refs/heads/develop
erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py
75
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt def execute(filters=None): columns = get_columns(filters) consumed_details = get_cons...
Acehaidrey/incubator-airflow
refs/heads/master
tests/plugins/test_plugins_manager.py
1
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
zjutjsj1004/third
refs/heads/master
boost/tools/build/src/tools/notfile.py
10
# Status: ported. # Base revision: 64429. # # Copyright (c) 2005-2010 Vladimir Prus. # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE_1_0.txt or # http://www.boost.org/LICENSE_1_0.txt) import b2.build.type as type import b2.bu...
hn8841182/20150623-test02
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/_testcapi.py
742
CHAR_MAX = 127 CHAR_MIN = -128 DBL_MAX = 1.7976931348623157e+308 DBL_MIN = 2.2250738585072014e-308 FLT_MAX = 3.4028234663852886e+38 FLT_MIN = 1.1754943508222875e-38 INT_MAX = 2147483647 INT_MIN = -2147483648 LLONG_MAX = 9223372036854775807 LLONG_MIN = -9223372036854775808 LONG_MAX = 2147483647 LONG_MIN = -2...
hgdeoro/py-arduino
refs/heads/master
scripts/github-md2html.py
1
#!/usr/bin/env python # -*- coding: utf-8 import BaseHTTPServer import codecs import markdown import os.path import SimpleHTTPServer import sys class H(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): print self.path if self.path.endswith('.md'): fs_path = self.path[1...
glatard/nipype
refs/heads/master
nipype/interfaces/fsl/tests/test_auto_Randomise.py
9
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.fsl.model import Randomise def test_Randomise_inputs(): input_map = dict(args=dict(argstr='%s', ), base_name=dict(argstr='-o "%s"', position=1, usedefault=True, ), c_thresh=d...
aodag/skype4py
refs/heads/master
Skype4Py/lang/fr.py
23
apiAttachAvailable = u'API disponible' apiAttachNotAvailable = u'Indisponible' apiAttachPendingAuthorization = u'Autorisation en attente' apiAttachRefused = u'Refus\xe9' apiAttachSuccess = u'Connexion r\xe9ussie' apiAttachUnknown = u'Inconnu' budDeletedFriend = u'Supprim\xe9 de la liste d\u2019amis' budFriend = u'Ami' ...
witwall/gyp
refs/heads/master
test/additional-targets/src/dir1/emit.py
337
#!/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. import sys f = open(sys.argv[1], 'wb') f.write('Hello from emit.py\n') f.close()
larrybradley/astropy
refs/heads/remote-tests
astropy/coordinates/tests/test_angular_separation.py
8
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the projected separation stuff """ import pytest import numpy as np from astropy.tests.helper import assert_quantity_allclose as assert_allclose from astropy import units as u from astropy.coordinates.builtin_frame...
zhangpanrobot/myblog
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_stan_builtins.py
292
# -*- coding: utf-8 -*- """ pygments.lexers._stan_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names of functions for Stan used by ``pygments.lexers.math.StanLexer. :copyright: Copyright 2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ KEYWORDS = ['else', 'for', '...
mpharrigan/mdtraj
refs/heads/master
mdtraj/tests/test_arc.py
8
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Lee-Ping Wang # Contributors: Robert McGibbon # # MDTraj is fr...
AdaptiveApplications/carnegie
refs/heads/master
tarc_bus_locator_client/protobuf-2.5.0/gtest/test/gtest_shuffle_test.py
3023
#!/usr/bin/env python # # Copyright 2009 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...
moijes12/oh-mainline
refs/heads/master
vendor/packages/Django/django/contrib/gis/gdal/base.py
224
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _p...
hsorby/fifa_world_cup_2014
refs/heads/master
languages/ro.py
162
# coding: utf8 { '!=': '!=', '!langcode!': 'ro', '!langname!': 'Română', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" (actualizează) este o expresie opțională precum "câmp1=\'valoare_nouă\'". Nu puteți actualiza sau șterge rezultatele unui...
arjunmenon/dokku
refs/heads/master
tests/apps/python-flask/hello.py
236
import os from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'python/flask'
siggame/siggame-vote
refs/heads/master
vote/accounts/urls.py
1
from django.conf.urls.defaults import patterns, url from django.contrib.auth.views import logout from .views import LoginStageOneView, LoginStageTwoView urlpatterns = patterns( '', url('^login/$', LoginStageOneView.as_view(), name="login"), url('^login/next/', LoginStageTwoView.as_view(), name="login2"),...
EndyKaufman/django-postgres-angularjs-blog
refs/heads/master
app/manager/properties/validator.py
1
# -*- coding: utf-8 -*- from project import helpers import resource def create(request): data = request.DATA if data is False: return {'code': 'no_data'}, 404, False data = helpers.set_null_values_if_not_exist(data, resource.get_fields()) if data['name'] is None: return {'code': 'pr...
Buguin/Mandarin
refs/heads/master
toolkit/common/folder_tools.py
1
# -*- codeing:utf-8 -*- # __author__ = 'Buguin' import os def get_folder_size(dir_path): """ According to the param of dir_path, cacullate the size of folder and return it. :param dir_path: The path of folder, like D:\Temp :return: The size of folder """ size = 0 for root, dirs, files in o...
450W16/MODACT
refs/heads/master
src/characters/__init__.py
1
__all__ = ["basic_enemy", "biggie", "enemy", "player", "tracy", "transformed", "directions", "ghost", "monkey", "wolf"]
mou4e/zirconium
refs/heads/master
tools/telemetry/telemetry/core/local_server_unittest.py
21
# 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 BaseHTTPServer import SimpleHTTPServer from telemetry.core import local_server from telemetry.unittest_util import tab_test_case class SimpleLocalSe...
glneo/gnuradio
refs/heads/master
gr-qtgui/examples/pyqt_time_c.py
38
#!/usr/bin/env python # # Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
jisqyv/p2pool
refs/heads/master
p2pool/util/skiplist.py
278
from p2pool.util import math, memoize class SkipList(object): def __init__(self, p=0.5): self.p = p self.skips = {} def forget_item(self, item): self.skips.pop(item, None) @memoize.memoize_with_backing(memoize.LRUDict(5)) def __call__(self, start, *args): ...
Sumith1896/sympy
refs/heads/master
sympy/parsing/__init__.py
135
"""Used for translating a string into a SymPy expression. """
pinkavaj/gnuradio
refs/heads/master
gr-fec/python/fec/qa_depuncture.py
47
#!/usr/bin/env python # # Copyright 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
yeyanchao/calibre
refs/heads/master
src/calibre/gui2/ebook_download.py
5
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' __copyright__ = '2011, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import os import shutil from contextlib import closing from mechanize import MozillaCoo...