repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
dursk/django
refs/heads/master
tests/gis_tests/maps/tests.py
322
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import skipUnless from django.contrib.gis.geos import HAS_GEOS from django.test import SimpleTestCase from django.test.utils import modify_settings, override_settings from django.utils.encoding import force_text GOOGLE_MAPS_API_KEY = 'XXXX...
KernelAnalysisPlatform/KlareDbg
refs/heads/master
tracers/qemu/decaf/roms/seabios/tools/transdump.py
121
#!/usr/bin/env python # This script is useful for taking the output of memdump() and # converting it back into binary output. This can be useful, for # example, when one wants to push that data into other tools like # objdump or hexdump. # # (C) Copyright 2010 Kevin O'Connor <kevin@koconnor.net> # # This file may be ...
kenorb-contrib/BitTorrent
refs/heads/master
twisted/news/test/test_nntp.py
2
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.news import database from twisted.news import nntp from twisted.protocols import loopback ALL_GROUPS = ('alt.test.nntp', 0, 1, 'y'), GROUP = ('0', '1', '0', 'alt.test.nntp', 'group', 'sele...
Simon-Tang/onedrive-d-old
refs/heads/future
onedrive_d/od_pref.py
7
#!/usr/bin/python3 """ Preference guide dispatcher for onedrive-d. """ import sys import argparse def main(): pref_guide = None parser = argparse.ArgumentParser(prog='onedrive-pref', description='Configuration guide for onedrive-d program.', epilog='For technical support, visit http://github.com/xybu/onedriv...
kirbyfan64/shedskin
refs/heads/master
tests/163.py
6
import time time.sleep(1.01) import sys #print 'Python version:', sys.version sys.stdout.flush() a = '\001\00\0boink' print repr('hello, world') print repr('hello\0, world2') print 'hello, world' print repr('hello\0, world2') # XXX no repr! print repr(a), len(a) print repr(chr(0)), len(chr(0)+chr(0)) print repr('\...
prvnkumar/p4factory
refs/heads/master
mininet/swl_ospf.py
4
#!/usr/bin/python # Copyright 2013-present Barefoot Networks, 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 ap...
DiamondLightSource/auto_tomo_calibration-experimental
refs/heads/master
old_code_scripts/lmfit-py/lmfit/ui/basefitter.py
7
import warnings import numpy as np from ..model import Model from ..models import ExponentialModel # arbitrary default from ..asteval import Interpreter from ..astutils import NameFinder from ..parameter import check_ast_errors _COMMON_DOC = """ This an interactive container for fitting models to particular dat...
r0balo/pelisalacarta
refs/heads/develop
python/main-classic/channels/renumbertools.py
2
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta 4 # Copyright 2015 tvalacarta@gmail.com # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # # Distributed under the terms of GNU General Public License v3 (GPLv3) # http://www.gnu.org/licenses/gpl-3.0.html # --...
harwee/electrum-xvg-tor
refs/heads/master
plugins/btchipwallet.py
1
from PyQt4.Qt import QApplication, QMessageBox, QDialog, QVBoxLayout, QLabel, QThread, SIGNAL import PyQt4.QtCore as QtCore from binascii import unhexlify from binascii import hexlify from struct import pack,unpack from sys import stderr from time import sleep from base64 import b64encode, b64decode import electrum_xv...
puttarajubr/commcare-hq
refs/heads/master
custom/ewsghana/handlers/requisition.py
2
from corehq.apps.locations.models import SQLLocation from custom.ewsghana.reminders import NO_SUPPLY_POINT_MESSAGE, REQ_SUBMITTED, \ REQ_NOT_SUBMITTED from custom.ilsgateway.models import RequisitionReport from custom.ilsgateway.tanzania.handlers.keyword import KeywordHandler class RequisitionHandler(KeywordHandl...
amitsaha/compose
refs/heads/master
tests/__init__.py
38
import sys if sys.version_info >= (2, 7): import unittest # NOQA else: import unittest2 as unittest # NOQA try: from unittest import mock except ImportError: import mock # NOQA
dedalusj/PaperChase
refs/heads/master
backend/paperchase/manage/users.py
1
# -*- coding: utf-8 -*- """ paperchase.manage.journals ~~~~~~~~~~~~~~~~~~~~~ jorunals management commands """ import datetime from flask.ext.script import Command, prompt, prompt_pass from werkzeug.datastructures import MultiDict from ..services import users class CreateUser(Command): def run(self)...
cvegaj/ElectriCERT
refs/heads/master
cert-tools/env/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/requirements.py
454
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pkg_resources.extern.pyparsing import string...
xzh86/scikit-learn
refs/heads/master
sklearn/datasets/base.py
196
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import shutil from os import environ from os.pa...
MinFu/youtube-dl
refs/heads/master
youtube_dl/extractor/udemy.py
48
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class UdemyIE(InfoExtractor): IE_NAME = 'udemy' _VALID_URL = r'https?://www\.udemy\.com/(?:[^#]+#/lectu...
easemob/emchat-server-examples
refs/heads/master
emchat-server-python/tests/test_chatfiles.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'Lynch Lee' import unittest import json import emchat.client.emchat_client as rest_client from emchat.utils.types import * from emchat.utils.loggers import Logger class TestEaseMobChatFilesServices(unittest.TestCase): logger = Logger.get_logger('TestEaseMo...
DuCorey/bokeh
refs/heads/master
examples/models/file/image_url.py
5
import numpy as np from bokeh.util.browser import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.models.glyphs import ImageURL from bokeh.models import ColumnDataSource, Range1d, Plot, LinearAxis, Grid from bokeh.resources import INLINE url = "https://bokeh.pydata.org/en/latest/...
DrMeers/django
refs/heads/master
django/utils/feedgenerator.py
78
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
pengwei1024/freeline
refs/heads/master
freeline_core/freeline_build.py
12
# -*- coding:utf8 -*- from __future__ import print_function from command import AbstractCommand from exceptions import NoConfigFoundException from logger import Logger class FreelineBuildCommand(AbstractCommand): def __init__(self, config, task_engine=None): AbstractCommand.__init__(self, command_name='fr...
SteveHNH/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_floating_ip.py
9
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Author: Davide Guerri <davide.guerri@hp.com> # # This module 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 ...
liaoxiangyong/cuda-convnet2
refs/heads/master
initw.py
183
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
StevenVanAcker/mitmproxy
refs/heads/master
mitmproxy/tools/console/keybindings.py
2
import urwid import blinker import textwrap from mitmproxy.tools.console import layoutwidget from mitmproxy.tools.console import signals HELP_HEIGHT = 5 keybinding_focus_change = blinker.Signal() class KeyItem(urwid.WidgetWrap): def __init__(self, walker, binding, focused): self.walker, self.binding, s...
rahul-ramadas/leetcode
refs/heads/master
search-in-rotated-sorted-array/Solution.6828778.py
1
class Solution: def search(self, A, target): lower = 0 upper = len(A) while lower < upper: middle = (upper + lower) / 2 if A[middle] == target: return middle elif A[middle] > target and A[lower] <= target: upper =...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/building/general/shared_lok_nymstheme_pirate_cave.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/general/shared_lok_nymstheme_pirate_cave.iff" result.attribute_temp...
enriquesanchezb/practica_utad_2016
refs/heads/master
venv/lib/python2.7/site-packages/coverage/test_helpers.py
45
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Mixin classes to help make good tests.""" import atexit import collections import contextlib import os import random import shutil import sys import tempfile im...
EricMuller/mywebmarks-backend
refs/heads/master
requirements/twisted/Twisted-17.1.0/src/twisted/words/test/test_xishutil.py
13
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.words.xish.utility """ from __future__ import absolute_import, division from collections import OrderedDict from twisted.trial import unittest from twisted.words.xish import utility from twisted.words.xish.domish imp...
yize/grunt-tps
refs/heads/master
tasks/lib/python/Lib/python2.7/lib2to3/tests/data/fixers/myfixes/fix_last.py
356
from lib2to3.fixer_base import BaseFix class FixLast(BaseFix): run_order = 10 def match(self, node): return False
djsmith42/billiard
refs/heads/master
billiard/_ext.py
12
from __future__ import absolute_import import sys supports_exec = True from .compat import _winapi as win32 # noqa if sys.platform.startswith("java"): _billiard = None else: try: import _billiard # noqa except ImportError: import _multiprocessing as _billi...
cesargtz/YecoraOdoo
refs/heads/master
addons/hw_scanner/__openerp__.py
220
# -*- 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...
ahachete/gpdb
refs/heads/master
gpMgmt/bin/gppylib/operations/test/unit/test_unit_restore.py
4
#!/usr/bin/env python # coding: utf-8 # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # import sys import unittest2 as unittest import tempfile, os, shutil from gppylib.commands.base import CommandResult, Command, ExecutionError from gppylib.operations.backup_utils import * from gppylib.operations.restore ...
hnakamur/django
refs/heads/master
tests/gis_tests/layermap/models.py
235
from django.utils.encoding import python_2_unicode_compatible from ..models import models @python_2_unicode_compatible class NamedModel(models.Model): name = models.CharField(max_length=25) objects = models.GeoManager() class Meta: abstract = True required_db_features = ['gis_enabled'] ...
chil360/chil360-kernel
refs/heads/kitkat
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
samuelchong/libcloud
refs/heads/trunk
libcloud/compute/drivers/linode.py
10
# 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 use ...
brownharryb/erpnext
refs/heads/develop
erpnext/accounts/doctype/accounting_period/test_accounting_period.py
10
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest # class TestAccountingPeriod(unittest.TestCase): # def test_overlap(self): # ap1 = create_accounting_period({"start_date":"2018-04-01"...
luotao1/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_jit_save_load.py
1
# Copyright (c) 2020 PaddlePaddle 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 appli...
4eek/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/course_info/tests.py
76
""" Tests for course_info """ import ddt from django.conf import settings from xmodule.html_module import CourseInfoModule from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.xml_importer import import_course_from_xml from ..testutils import ( ...
hsaputra/tensorflow
refs/heads/master
tensorflow/contrib/factorization/python/ops/kmeans_test.py
13
# 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...
Innovahn/odoo.old
refs/heads/master
addons/lunch/wizard/lunch_validation.py
440
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
gameduell/duell
refs/heads/master
bin/win/python2.7.9/Lib/idlelib/configHandler.py
25
"""Provides access to stored IDLE configuration information. Refer to the comments at the beginning of config-main.def for a description of the available configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults will...
Copypeng/git-repo
refs/heads/master
subcmds/start.py
48
# # Copyright (C) 2008 The Android Open Source Project # # 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...
agry/NGECore2
refs/heads/master
scripts/object/tangible/ship/attachment/weapon/kse_firespray_weapon2_s04.py
85615
import sys def setup(core, object): return
abhattad4/Digi-Menu
refs/heads/master
django/contrib/admin/apps.py
459
from django.apps import AppConfig from django.contrib.admin.checks import check_admin_app from django.core import checks from django.utils.translation import ugettext_lazy as _ class SimpleAdminConfig(AppConfig): """Simple AppConfig which does not do automatic discovery.""" name = 'django.contrib.admin' ...
mKeRix/home-assistant
refs/heads/dev
tests/components/websocket_api/conftest.py
21
"""Fixtures for websocket tests.""" import pytest from homeassistant.components.websocket_api.auth import TYPE_AUTH_REQUIRED from homeassistant.components.websocket_api.http import URL from homeassistant.setup import async_setup_component @pytest.fixture async def websocket_client(hass, hass_ws_client): """Creat...
katoken-0215/FikaNote
refs/heads/master
app/templatetags/filter.py
3
from django import template register = template.Library() @register.filter("mongo_id") def mongo_id(value): return str(value['_id'])
howaboutudance/qweechat
refs/heads/master
src/qweechat/parser.py
1
from network import Network import weechat.protocol as protocol import config class ChatConnection(Network): def __init__(self): ''' intialization of the connection object:''' # creates a debug displays list to be used ot send message self.debug_displays = [] self.__config = config...
BuildingLink/sentry
refs/heads/master
src/sentry/api/endpoints/group_similar_issues.py
3
from __future__ import absolute_import import functools from rest_framework.response import Response from sentry.api.bases.group import GroupEndpoint from sentry.api.serializers import serialize from sentry.models import Group from sentry.similarity import features from sentry.utils.functional import apply_values ...
iabdalkader/micropython
refs/heads/master
tests/misc/print_exception.py
9
try: try: import uio as io import usys as sys except ImportError: import io import sys except ImportError: print("SKIP") raise SystemExit if hasattr(sys, "print_exception"): print_exception = sys.print_exception else: import traceback print_exception = lambd...
dseuss/pycsalgs
refs/heads/master
examples/phase_transition.py
1
# coding: utf-8 import numpy as np import ipyparallel import pandas as pd from os import environ, rename import progressbar as pb from time import time CLUSTER_ID = environ.get('CLUSTER_ID', None) _CLIENTS = ipyparallel.Client(cluster_id=CLUSTER_ID) _VIEW = _CLIENTS.load_balanced_view() print("Kernels available: {}"....
jmuhlich/indra
refs/heads/master
indra/tests/test_cx_assembler.py
1
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from indra.statements import * from indra.assemblers import CxAssembler mek = Agent('MAP2K1', db_refs={'HGNC': '6840'}) erk = Agent('MAPK1', db_refs={'UP': 'P28482'}) dusp = Agent('DUSP4') st_phos = Phosphorylation(...
lucasdavid/numerical-analysis
refs/heads/master
projects/nnum/examples/interpolation/sine.py
2
""" ============================== Interpolating the Sine function. * Interpolating the sine function using Lagrangian and Newton's methods. ============================== """ import matplotlib.pyplot as plt import numpy as np from projects.nnum.interpolation.lagrangian import LagrangianInterpolator print(__doc__) ...
arokem/nipy
refs/heads/master
nipy/labs/spatial_models/tests/test_parcel.py
3
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import numpy as np from nipy.algorithms.graph.field import field_from_coo_matrix_and_data from ..hierarchical_parcellation import hparcel from ...utils.simul_multisubject_fmri_dataset import surrogate_2d_...
jzt5132/scikit-learn
refs/heads/master
sklearn/linear_model/tests/test_sgd.py
68
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
seaotterman/tensorflow
refs/heads/master
tensorflow/contrib/tensor_forest/python/kernel_tests/finished_nodes_op_test.py
80
# 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...
njoyce/pyamf
refs/heads/master
doc/architecture/examples/adapters/mymodule.py
9
# mymodule.py class CustomClass(object): def __iter__(self): return iter([1, 2, 3])
maferelo/saleor
refs/heads/master
saleor/product/migrations/0072_auto_20180925_1048.py
3
# Generated by Django 2.0.8 on 2018-09-25 15:48 from django.db import migrations class Migration(migrations.Migration): dependencies = [("product", "0071_attributechoicevalue_value")] operations = [ migrations.RenameModel(old_name="ProductAttribute", new_name="Attribute"), migrations.Rename...
TheMadCoder1/Spambot
refs/heads/master
commands/status.py
2
from classes import * from helper_functions import * def method(servers_and_threads, arguments): print # Line break # Argument Check if len(arguments) != 0: email = arguments[0] if not helpers_for_commands.email_is_valid(email): print "You did not enter a valid email." ...
apechimp/servo
refs/heads/master
tests/wpt/harness/setup.py
196
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import glob import os import sys import textwrap from setuptools import setup, find_packages here = os.path.split(__fi...
anbangr/trusted-juju
refs/heads/master
juju/lib/tests/test_pick.py
1
from juju.lib.testing import TestCase from juju.lib.pick import pick_key, pick_all_key, pick_attr, pick_all_attr class adict(dict): def __getattr__(self, key): return self[key] def __setattr__(self, key, value): self[key] = value class PickTest(TestCase): def setUp(self): self...
akintoey/django
refs/heads/master
django/conf/locale/ga/formats.py
619
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i' # DATE...
lmesz/compose
refs/heads/master
compose/service.py
3
from __future__ import absolute_import from __future__ import unicode_literals import logging import os import re import sys from collections import namedtuple from operator import attrgetter import enum import six from docker.errors import APIError from docker.utils import create_host_config from docker.utils import...
agoose77/hivesystem
refs/heads/master
dragonfly/pandahive/build_canvasdrone.py
1
import libcontext from libcontext.socketclasses import * from libcontext.pluginclasses import * try: from panda3d.core import NodePath import panda3d except ImportError: panda3d = None def build_canvasdrone(wrappedclass, classname, drawshow, drawshowtype, baseclass): baseklass = baseclass assert ...
pschmitt/home-assistant
refs/heads/dev
homeassistant/components/lutron_caseta/cover.py
7
"""Support for Lutron Caseta shades.""" import logging from homeassistant.components.cover import ( ATTR_POSITION, DOMAIN, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, CoverEntity, ) from . import DOMAIN as CASETA_DOMAIN, LutronCasetaDevice _LOGGER = logging.getLogger(__name__) async ...
aassou/InsuranceCompany
refs/heads/master
assets/jquery-file-upload/server/gae-python/main.py
223
# -*- coding: utf-8 -*- # # jQuery File Upload Plugin GAE Python Example 2.0 # https://github.com/blueimp/jQuery-File-Upload # # Copyright 2011, Sebastian Tschan # https://blueimp.net # # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT # from __future__ import with_statement from google.appeng...
dloghin/bdgpu-src
refs/heads/master
hadoop-1.2.1/contrib/hod/hodlib/Common/types.py
182
#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 use thi...
fpsluozi/youtube-dl
refs/heads/master
youtube_dl/extractor/safari.py
46
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveIE from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, smuggle_url, std_headers, ) class SafariBaseIE(In...
jolyonb/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_draft_modulestore.py
1
from django.test import TestCase from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore class TestDraftModuleStore(TestCase): """ Test the draft modulestore """ def test_get_items_with_course_items(self): store = modulestore() # fix was to allo...
2015fallhw/user9999
refs/heads/master
js/Brython3.2.2-20150927-180218/Lib/sre_constants.py
692
# # Secret Labs' Regular Expression Engine # # various symbols used by the regular expression engine. # run this script to update the _sre include files! # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support modul...
mekkablue/Glyphs-Scripts
refs/heads/master
Font Info/Remove Custom Parameters.py
1
#MenuTitle: Remove Custom Parameters # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Removes all parameters of one kind from Font Info > Font, Masters, Instances. Useful if you have many masters or instances. """ from GlyphsApp import * import vanilla class Remove...
Xperia-Nicki/android_platform_sony_nicki
refs/heads/master
external/webkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py
15
# Copyright (C) 2011 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...
scott1028/django-angular
refs/heads/master
examples/server/__init__.py
14224
# -*- coding: utf-8 -*-
KanchanChauhan/erpnext
refs/heads/develop
erpnext/setup/doctype/territory/test_territory.py
104
# 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 test_records = frappe.get_test_records('Territory')
TheSSJ/zf2_mmkernel
refs/heads/master
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
inspyration/odoo
refs/heads/master
addons/account/report/report_vat.py
28
# -*- 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...
seckcoder/lang-learn
refs/heads/master
python/sklearn/sklearn/cluster/tests/test_dbscan.py
2
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from sklearn.utils.testing import assert_equal from sklearn.cluster.dbscan_ import DBSCAN, dbscan from .common import generate_clustered_data n_clusters = 3 X = generate_clustered_data(n_clusters=n_clu...
dev1972/Satellitecoin
refs/heads/master
qa/rpc-tests/mempool_resurrect_test.py
150
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test resurrection of mined transactions when # the blockchain is re-organized. # from test_framework impo...
revzim/interactive-tutorials
refs/heads/master
suds/umx/encoded.py
211
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
bcorbet/SickRage
refs/heads/master
tornado/test/auth_test.py
60
# These tests do not currently do much to verify the correct implementation # of the openid/oauth protocols, they just exercise the major code paths # and ensure that it doesn't blow up (e.g. with unicode/bytes issues in # python 3) from __future__ import absolute_import, division, print_function, with_statement from...
elevien/mlmc-rdme
refs/heads/master
build/lib/crn_mc/simulation/paths.py
3
from ..mesh import * from ..model import * import inspect import numpy as np from scipy.integrate import ode import copy global Nt Nt = 10e5 # HELPER FUNCTIONS -------------------------------------------------------- def tryexponential(rate): """ Trys to compute exponential. """ try: return np.rand...
syaiful6/django
refs/heads/master
tests/template_tests/filter_tests/test_upper.py
388
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import upper from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class UpperTests(SimpleTestCase): """ The "upper" filter messes up entities (which a...
pmazurek/ansible-modules-extras
refs/heads/devel
network/a10/a10_service_group.py
117
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage A10 Networks slb service-group objects (c) 2014, Mischa Peters <mpeters@a10networks.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 publishe...
AlexChernov/rdo_studio
refs/heads/dev
thirdparty/scintilla/test/XiteWin.py
8
# -*- coding: utf-8 -*- from __future__ import with_statement from __future__ import unicode_literals import os, sys, unittest import ctypes from ctypes import wintypes from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort user32=ctypes.windll.user32 gdi32=ctypes.windll.gdi32 kernel32=ctypes.windll.kernel...
openhumanoids/director
refs/heads/master
src/python/scripts/affordanceServer.py
5
from director import consoleapp from director import lcmobjectcollection from director.timercallback import TimerCallback import datetime def main(): app = consoleapp.ConsoleApp() meshCollection = lcmobjectcollection.LCMObjectCollection('MESH_COLLECTION_COMMAND') affordanceCollection = lcmobjectcollectio...
nuncjo/odoo
refs/heads/8.0
addons/product_extended/__init__.py
374
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
tchellomello/home-assistant
refs/heads/dev
tests/components/geonetnz_volcano/test_init.py
13
"""Define tests for the GeoNet NZ Volcano general setup.""" from homeassistant.components.geonetnz_volcano import DOMAIN, FEED from tests.async_mock import AsyncMock, patch async def test_component_unload_config_entry(hass, config_entry): """Test that loading and unloading of a config entry works.""" config_...
VShangxiao/tornado
refs/heads/master
demos/s3server/s3server.py
98
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
clickpn/data-science-from-scratch
refs/heads/master
code/working_with_data.py
61
from __future__ import division from collections import Counter, defaultdict from functools import partial from linear_algebra import shape, get_row, get_column, make_matrix, \ vector_mean, vector_sum, dot, magnitude, vector_subtract, scalar_multiply from statistics import correlation, standard_deviation, mean from...
michalliu/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/host/lib/python3.4/lib2to3/patcomp.py
21
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Pattern compiler. The grammer is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ __author__ = "Guido van Rossum <guido@python.org>" # Python imports import io imp...
rajibmp/sololearn
refs/heads/master
python/06-types/13-character-count-function.py
1
""" This part of the program shows a function that counts how many times a character occurs in a string. """ def count_char(text, char): count = 0 for c in text: if c == char: count += 1 return count filename = input("Enter a filename: ") with open(filename) as f: text = f.read() print(count_cha...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.5/Lib/encodings/cp1255.py
593
""" Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.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,in...
networkdynamics/zenlib
refs/heads/master
src/zen/control/pplot.py
1
""" This module implements core control profile plotting functionality. The module published two core functions that produce profile plots and heatmaps. .. autofunction:: profile_plot(items,...) .. autofunction:: profile_heatmap(items,...) .. seealso:: J. Ruths and D. Ruths (2014). Control Profiles of Complex Net...
lochiiconnectivity/boto
refs/heads/develop
boto/mturk/connection.py
16
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
yangming85/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/core/mail/__init__.py
229
""" Tools for sending email. """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the int...
zbqf109/goodo
refs/heads/master
openerp/addons/payment/tests/common.py
15
# -*- coding: utf-8 -*- from openerp.tests import common class PaymentAcquirerCommon(common.TransactionCase): def setUp(self): super(PaymentAcquirerCommon, self).setUp() self.payment_acquirer = self.registry('payment.acquirer') self.payment_transaction = self.registry('payment.transactio...
a10networks/a10sdk-python
refs/heads/master
a10sdk/core/ipv6/ipv6_nat_pool.py
2
from a10sdk.common.A10BaseClass import A10BaseClass class Pool(A10BaseClass): """Class Description:: IPv6 pool name. Class pool supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param uuid: {"description": "uuid of the ob...
aperigault/ansible
refs/heads/devel
lib/ansible/modules/commands/command.py
11
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, div...
Weihonghao/ECM
refs/heads/master
Vpy34/lib/python3.5/site-packages/tensorflow/python/framework/errors.py
141
# 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...
japeto/Vigtech-Services
refs/heads/master
Logica/ConsumirServicios.py
1
# coding=utf-8 __author__ = 'andres' import json from urllib2 import urlopen, quote, Request import urllib import procesamientoScopusXml from ConexionBD.adminBD import AdminBD import traceback REPOSITORY_DIR = "/home/vigtech/shared/repository/" # REPOSITORY_DIR = "/home/japeto/shared/repository/" def consumir_scholar(...
lobachevzky/NLP-Project
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py
2761
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
fizyk/pypt
refs/heads/master
{{cookiecutter.project_slug}}/setup.py
1
# -*- coding: utf-8 -*- import os import re from setuptools import setup, find_packages here = os.path.dirname(__file__) with open(os.path.join(here, 'src', '{{cookiecutter.project_slug}}', '__init__.py')) as v_file: package_version = re.compile(r".*__version__ = '(.*?)'", re.S).match(v_file.read()).group(1) de...
earies/ncclient
refs/heads/master
test/unit/operations/test_session.py
2
from ncclient.operations.session import * import unittest try: from unittest.mock import patch # Python 3.4 and later except ImportError: from mock import patch from ncclient import manager import ncclient.manager import ncclient.transport from ncclient.xml_ import * from ncclient.operations import RaiseMode f...