repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
showell/zulip
refs/heads/master
zerver/management/commands/deactivate_user.py
3
from argparse import ArgumentParser from typing import Any from zerver.lib.actions import do_deactivate_user from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.sessions import user_sessions from zerver.models import UserProfile class Command(ZulipBaseCommand): help = "Deactivate a u...
tchellomello/home-assistant
refs/heads/dev
tests/components/logger/test_init.py
10
"""The tests for the Logger component.""" from collections import defaultdict import logging import pytest from homeassistant.components import logger from homeassistant.components.logger import LOGSEVERITY from homeassistant.setup import async_setup_component from tests.async_mock import Mock, patch HASS_NS = "unu...
didrocks/snapcraft
refs/heads/master
snapcraft/tests/test_sources.py
1
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015, 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in...
CFDEMproject/LIGGGHTS-3-beta-PUBLIC
refs/heads/master
tools/eff/lmp2radii.py
54
#!/usr/local/bin/python-2.5/bin/python Info=""" Module name: lmp2radii.py Author: (c) Andres Jaramillo-Botero California Institute of Technology ajaramil@wag.caltech.edu Project: pEFF Version: August 2009 Extracts the electron radii from a lammps trajectory dump of style custom: dump 1 all custom period dump_fi...
w1ll1am23/home-assistant
refs/heads/dev
tests/components/gdacs/__init__.py
9
"""Tests for the GDACS component.""" from unittest.mock import MagicMock def _generate_mock_feed_entry( external_id, title, distance_to_home, coordinates, attribution=None, alert_level=None, country=None, duration_in_week=None, event_name=None, event_type_short=None, event_...
izapolsk/integration_tests
refs/heads/master
cfme/tests/cloud/test_stack.py
4
import pytest from cfme import test_requirements from cfme.cloud.provider.ec2 import EC2Provider from cfme.cloud.stack import StackOutputsDetails from cfme.exceptions import CandidateNotFound from cfme.utils.appliance.implementations.ui import navigate_to pytestmark = [ pytest.mark.ignore_stream("upstream"), ...
mdanielwork/intellij-community
refs/heads/master
python/testData/formatter/spaceWithinDeclarationParentheses_after.py
30
def foo( x, y ): pass def empty(): pass
maestro-hybrid-cloud/keystone
refs/heads/master
keystone/common/sql/migrate_repo/versions/061_add_parent_project.py
11
# 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 writing, software # distributed under t...
megaserg/pants
refs/heads/master
src/python/pants/backend/android/targets/android_binary.py
14
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.a...
zenoss/ZenPacks.community.DellM1000e
refs/heads/master
ZenPacks/community/DellM1000e/tests/__init__.py
309
# ########################################################################## # # This program is part of Zenoss Core, an open source monitoring platform. # Copyright (C) 2008, Zenoss Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License vers...
maohongyuan/kbengine
refs/heads/master
kbe/src/lib/python/Lib/lib2to3/fixes/fix_has_key.py
164
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for has_key(). Calls to .has_key() methods are expressed in terms of the 'in' operator: d.has_key(k) -> k in d CAVEATS: 1) While the primary target of this fixer is dict.has_key(), the fixer will chan...
lucafavatella/intellij-community
refs/heads/cli-wip
python/helpers/pydev/third_party/wrapped_for_pydev/ctypes/wintypes.py
106
#@PydevCodeAnalysisIgnore # XXX This module needs cleanup. from ctypes import * DWORD = c_ulong WORD = c_ushort BYTE = c_byte ULONG = c_ulong LONG = c_long LARGE_INTEGER = c_longlong ULARGE_INTEGER = c_ulonglong HANDLE = c_ulong # in the header files: void * HWND = HANDLE HDC = HANDLE HMODULE = HANDLE HINSTANCE ...
osm-fr/osmose-backend
refs/heads/master
analysers/analyser_merge_public_transport_FR_stif.py
4
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Frédéric Rodrigo 2016 ## ## ...
sgricci/dewdrop
refs/heads/master
config.py
4
#!/usr/bin/env python import simplejson as json import os import sys class Config: def __init__(self): # Check if file exists path = os.path.expanduser("~/.dewdrop/") if not os.path.exists(path): # Create Path os.makedirs(path) self.path = ("%s%s" % (path, "config")) self.data = {} if os.path.exis...
vmturbo/nova
refs/heads/master
nova/api/openstack/compute/multinic.py
6
# Copyright 2011 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...
TeamExodus/kernel_xiaomi_cancro
refs/heads/EXODUS-5.1
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...
etothemanders/GoingPostal
refs/heads/master
packagetrack/tests/test_tracking_info.py
1
from datetime import datetime, date from unittest import TestCase import unittest from packagetrack.data import TrackingInfo class TestTrackingInfo(TestCase): def test_repr(self): now = datetime.now() today = date.today() info = TrackingInfo(delivery_date=today, ...
gundal/nobleltehk
refs/heads/master
Documentation/target/tcm_mod_builder.py
2358
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
razzius/PyClassLessons
refs/heads/master
instructors/lessons/intro_flask/examples/single_mod/config_and_views.py
3
from os.path import dirname, abspath, join from flask import Flask, render_template, request from flask.ext.sqlalchemy import SQLAlchemy from forms import PersonForm _cwd = dirname(abspath(__file__)) SECRET_KEY = 'securekey' SQLALCHEMY_DATABASE_URI = 'sqlite:///' + join(_cwd, 'flask_temp.db') SQLALCHEMY_ECHO = Tru...
pymango/pymango
refs/heads/master
misc/python/mango/imageTest/_DiscreteGaussianDownsampleTest.py
1
#!/usr/bin/env python import logging import sys import unittest import scipy as sp import numpy as np import mango.mpi as mpi import mango.image import mango.io logger, rootLogger = mpi.getLoggers(__name__) class DiscreteGaussianDownsampleTest(unittest.TestCase): def setUp(self): subdShape = sp.array((32,...
fbrundu/pymrmr
refs/heads/master
tests/__init__.py
14224
# -*- coding: utf-8 -*-
andymckay/django
refs/heads/master
tests/regressiontests/utils/crypto.py
41
import math import timeit import hashlib from django.utils import unittest from django.utils.crypto import pbkdf2 class TestUtilsCryptoPBKDF2(unittest.TestCase): # http://tools.ietf.org/html/draft-josefsson-pbkdf2-test-vectors-06 rfc_vectors = [ { "args": { "password": "...
nwjs/chromium.src
refs/heads/nw45-log
third_party/pylint/pylint/checkers/base.py
56
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # Copyright (c) 2009-2010 Arista Networks, 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 ...
samuelmaudo/wand
refs/heads/master
wand/resource.py
5
""":mod:`wand.resource` --- Global resource management ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There is the global resource to manage in MagickWand API. This module implements automatic global resource management through reference counting. """ import contextlib import ctypes import warnings from .api...
Jorge-Rodriguez/ansible-modules-core
refs/heads/devel
cloud/rackspace/rax_dns.py
51
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
sachingupta006/Mezzanine
refs/heads/master
mezzanine/generic/migrations/0003_auto__add_rating.py
12
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Rating' db.create_table('generic_rating', ( ('object_pk', self.gf('django....
Sumith1896/sympy
refs/heads/master
sympy/functions/special/tests/test_error_functions.py
6
from sympy import ( symbols, expand, expand_func, nan, oo, Float, conjugate, diff, re, im, Abs, O, exp_polar, polar_lift, gruntz, limit, Symbol, I, integrate, S, sqrt, sin, cos, sinh, cosh, exp, log, pi, EulerGamma, erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv, gamma, uppergamma, Ei, expi...
tkremenek/swift
refs/heads/master
benchmark/scripts/test_utils.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # ===--- test_utils.py ---------------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library...
akloster/bokeh
refs/heads/master
bokeh/sampledata/unemployment1948.py
45
''' This module provides the US Unemployment rate data by year, from 1948 to 20013 ''' from __future__ import absolute_import from os.path import dirname, join try: import pandas as pd except ImportError as e: raise RuntimeError("unemployment1948 data requires pandas (http://pandas.pydata.org) to be installe...
antoinecarme/pyaf
refs/heads/master
tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_Lag1Trend_Seasonal_DayOfMonth_AR.py
1
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['Lag1Trend'] , ['Seasonal_DayOfMonth'] , ['AR'] );
matthew-robertson/vore-tracker
refs/heads/master
commands/timercommand.py
1
from commands.command import Command from utils.time import format_time class TimerCommand(Command): def get_banned_word_text(self, ban, current_time): time_lasted = format_time(current_time, ban.infracted_at) return "'{}': {}.".format(ban.banned_word, time_lasted) def execute(self, current_server, current_time...
surgebiswas/poker
refs/heads/master
PokerBots_2017/Johnny/scipy/special/_spherical_bessel.py
45
from __future__ import division, print_function, absolute_import from ._ufuncs import (_spherical_jn, _spherical_yn, _spherical_in, _spherical_kn, _spherical_jn_d, _spherical_yn_d, _spherical_in_d, _spherical_kn_d) def spherical_jn(n, z, derivative=False): r"""Spherical...
RachellCalhoun/lightandleadership
refs/heads/master
spanish_content/admin.py
1
from django.contrib import admin from .models import ( OurStory, OurTeam, EduProgram, EthicalPost, VolunteerPeru, VolunteerOpenPosition, VolunteerAbout, CustomPage, Home, FooterInfo, DonateSection, Menu, SubMenu, HomeLink, Apply ) from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin from ...
kazemakase/scikit-learn
refs/heads/master
examples/semi_supervised/plot_label_propagation_digits.py
268
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
alvations/Paddle
refs/heads/master
demo/sequence_tagging/linear_crf.py
2
# Copyright (c) 2016 Baidu, 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 o...
windxixi/kernel_ef39s_ics
refs/heads/master
scripts/gcc-wrapper.py
484
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011, Code Aurora Forum. 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 ...
nyancoin/NyanCoin
refs/heads/master
contrib/qt_translations.py
4110
#!/usr/bin/env python # Helpful little script that spits out a comma-separated list of # language codes for Qt icons that should be included # in binary bitcoin distributions import glob import os import re import sys if len(sys.argv) != 3: sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg...
mitya57/django
refs/heads/master
tests/test_client/views.py
26
from urllib.parse import urlencode from xml.dom.minidom import parseString from django.contrib.auth.decorators import login_required, permission_required from django.core import mail from django.forms import fields from django.forms.forms import Form, ValidationError from django.forms.formsets import BaseFormSet, form...
malmiron/incubator-airflow
refs/heads/master
airflow/contrib/operators/s3_copy_object_operator.py
8
# -*- coding: utf-8 -*- # # 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 #...
makinacorpus/odoo
refs/heads/8.0
addons/website_mail/models/mail_thread.py
338
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
heke123/chromium-crosswalk
refs/heads/master
mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
23
# 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 imp import os.path import sys import unittest def _GetDirAbove(dirname): """Returns the directory "above" this file containing |dirname| (which mus...
maxisacson/sml-project
refs/heads/master
Henrik_Project/rutil.py
1
import ROOT from uuid import uuid4 def init_atlas_style(): ROOT.gROOT.Reset() ROOT.gStyle.SetOptTitle(1) ROOT.gStyle.SetOptStat(0) ROOT.gStyle.SetOptFit(1) ROOT.gStyle.SetPadLeftMargin(0.15) ROOT.gStyle.SetPadBottomMargin(0.15) #ROOT.gStyle.SetTitleXOffset(1.4) #ROOT.gStyle.SetTitleYOff...
bratsche/Neutron-Drive
refs/heads/master
neutron-drive/django/utils/simplejson/decoder.py
409
"""Implementation of JSONDecoder """ import re import sys import struct from django.utils.simplejson.scanner import make_scanner c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys...
akerl/python-gnupg
refs/heads/master
gnupg/test/test_gnupg.py
4
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of python-gnupg, a Python interface to GnuPG. # Copyright © 2013 Isis Lovecruft, <isis@leap.se> 0xA3ADB67A2CDB8B35 # © 2013 Andrej B. # © 2013 LEAP Encryption Access Project # © 2008-2012 Vinay Sajip # © 2005 Ste...
uwosh/uwosh.libraryguides
refs/heads/master
uwosh/libraryguides/tests/test_integration_unit.py
1
"""This is an integration "unit" test. It uses PloneTestCase, but does not use doctest syntax. You will find lots of examples of this type of test in CMFPlone/tests, for example. """ import unittest from uwosh.libraryguides.tests.base import TestCase from Products.CMFCore.utils import getToolByName class...
pietern/caffe2
refs/heads/master
caffe2/contrib/prof/htrace_to_chrome.py
4
# Copyright (c) 2016-present, Facebook, 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...
HellTech/NAG_IoE_2016
refs/heads/master
30_HellTech_1602_1/10_ultrasonic_sensor_HC-SR04/RPi_I2C_driver.py
1
# -*- coding: utf-8 -*- """ Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic Made available under GNU GENERAL PUBLIC LICENSE # Modified Python I2C library for Raspberry Pi # as found on http://www.recantha.co.uk/blog/?p=4849 # Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library # add...
zsiciarz/django
refs/heads/master
tests/template_tests/test_base.py
36
from django.template.base import VariableDoesNotExist from django.test import SimpleTestCase class VariableDoesNotExistTests(SimpleTestCase): def test_str(self): exc = VariableDoesNotExist(msg='Failed lookup in %r', params=({'foo': 'bar'},)) self.assertEqual(str(exc), "Failed lookup in {'foo': 'ba...
openstack/watcher
refs/heads/master
watcher/decision_engine/datasources/manager.py
2
# -*- encoding: utf-8 -*- # Copyright 2017 NEC Corporation # # 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...
brunogamacatao/portalsaladeaula
refs/heads/master
django/contrib/auth/admin.py
1
from django import template from django.db import transaction from django.conf import settings from django.contrib import admin from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AdminPasswordChangeForm from django.contrib.auth.models import User, Group from django.contrib import messages from djan...
chandlercr/aima-python
refs/heads/master
rl.py
23
"""Reinforcement Learning (Chapter 21) """ from collections import defaultdict from utils import argmax from mdp import MDP, policy_evaluation import random class PassiveADPAgent: """Passive (non-learning) agent that uses adaptive dynamic programming on a given MDP and policy. [Figure 21.2]""" class M...
nickwallen/incubator-metron
refs/heads/master
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_client.py
4
""" 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 this ...
odoo-brazil/odoo-brazil-banking
refs/heads/10.0
l10n_br_cnab400_import/models/l10n_br_cnab_move.py
3
# -*- coding: utf-8 -*- # ############################################################################# # # # Copyright (C) 2012 KMEE (http://www.kmee.com.br) # @author Fernando Marcato Rodrigues # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
GoogleCloudPlatform/training-data-analyst
refs/heads/master
courses/machine_learning/deepdive2/end_to_end_ml/labs/serving/application/lib/oauth2client/client.py
26
# 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 ...
cytec/SickRage
refs/heads/master
lib/babelfish/converters/name.py
88
# -*- coding: utf-8 -*- # # Copyright (c) 2013 the BabelFish authors. All rights reserved. # Use of this source code is governed by the 3-clause BSD license # that can be found in the LICENSE file. # from __future__ import unicode_literals from . import LanguageEquivalenceConverter from ..language import LANGUAGE_MATRI...
hansey/youtube-dl
refs/heads/master
youtube_dl/extractor/tutv.py
94
from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..compat import compat_parse_qs class TutvIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tu\.tv/videos/(?P<id>[^/?]+)' _TEST = { 'url': 'http://tu.tv/videos/robots-futbolistas', 'md5': '627c7c1...
JosmanPS/scikit-learn
refs/heads/master
sklearn/utils/arpack.py
265
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
sunzuolei/youtube-dl
refs/heads/master
youtube_dl/extractor/swrmediathek.py
165
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_duration class SWRMediathekIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?swrmediathek\.de/(?:content/)?player\.htm\?show=(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}...
initNirvana/Easyphotos
refs/heads/master
env/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py
2374
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 Benjamin Peterson #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 l...
NeuralEnsemble/neuroConstruct
refs/heads/master
lib/jython/Lib/macpath.py
191
"""Pathname and path-related operations for the Macintosh.""" import os import warnings from stat import * import genericpath from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getc...
fnouama/intellij-community
refs/heads/master
python/testData/formatter/spaceWithinBraces.py
83
dict = {1: 'a', 2: 'b', 3: 'c'}
saltstar/spark
refs/heads/master
python/pyspark/statcounter.py
130
# # 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 us...
artefactory/artefact.connectors
refs/heads/develop
artefact/connectors/bluekai/api/client.py
2
import requests import hashlib import hmac import base64 import urlparse import copy from urllib import quote_plus import services import logging class Client(object): def __init__(self, key, secret): self.key = str(key) self.secret = str(secret) def get(self, endpoint, path, query_paramet...
fzimmermann89/pyload
refs/heads/stable
module/lib/thrift/transport/TZlibTransport.py
67
# # 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...
allotria/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/UnusedUnresolvedNameImportedSeveralTimes/my_module.py
240
def my_func(): pass
reminisce/mxnet
refs/heads/master
python/mxnet/ndarray/image.py
26
# 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...
GdZ/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_4/tests/regressiontests/admin_changelist/admin.py
28
from __future__ import absolute_import from django.contrib import admin from django.core.paginator import Paginator from .models import (Child, Parent, Genre, Band, Musician, Group, Quartet, Membership, ChordsMusician, ChordsBand, Invitation, Swallow) site = admin.AdminSite(name="admin") class CustomPaginator(...
canihavesomecoffee/sample-platform
refs/heads/master
tests/test_upload/TestControllers.py
1
from importlib import reload from io import BytesIO from unittest import mock from flask import g, url_for from mod_auth.models import Role from mod_sample.models import Issue, Sample from mod_upload.models import QueuedSample from tests.base import BaseTestCase, mock_api_request_github, mock_decorator class TestCo...
BorisJeremic/Real-ESSI-Examples
refs/heads/master
analytic_solution/test_cases/4NodeANDES/cantilever_different_Poisson/NumberOfDivision4/PoissonRatio0.00/extract_numerical_solution.py
441
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
chanyoonzhu/eatquik
refs/heads/master
pkg_resources/extern/__init__.py
245
import sys class VendorImporter: """ A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. """ def __init__(self, root_name, vendored_names=(), vendor_pkg=None): self.root_name = root_name self.vendored_names = set(v...
alexmorozov/django
refs/heads/master
tests/auth_tests/test_models.py
30
import datetime from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth import get_user_model from django.contrib.auth.hashers import get_hasher from django.contrib.auth.models import ( AbstractUser, Group, Permission, User, UserManager, ) from django.contrib.contenttypes.models import Co...
yingyl12/yilin-b1-a5-github
refs/heads/master
lib/werkzeug/security.py
302
# -*- coding: utf-8 -*- """ werkzeug.security ~~~~~~~~~~~~~~~~~ Security related helpers such as secure password hashing tools. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import hmac import hashlib import posi...
choco81/0E_kernel
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
CMU-Robotics-Club/roboticsclub.org
refs/heads/master
gallery/views.py
6445
from django.shortcuts import render # Create your views here.
danylaksono/inasafe
refs/heads/master
safe/messaging/item/abstract_list.py
1
""" InaSAFE Disaster risk assessment tool developed by AusAid - **Abstract List** Contact : ole.moller.nielsen@gmail.com .. note:: 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 ve...
yokose-ks/edx-platform
refs/heads/gacco3/master
common/lib/xmodule/xmodule/conditional_module.py
10
"""Conditional module is the xmodule, which you can use for disabling some xmodules by conditions. """ import json import logging from lazy import lazy from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.modulestore import Location from xmodule.seq_module...
wuhengzhi/chromium-crosswalk
refs/heads/master
tools/android/loading/xvfb_helper.py
10
# Copyright 2016 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 os import subprocess def LaunchXvfb(): """Launches Xvfb for running Chrome in headless mode, and returns the subprocess.""" xvfb_cmd = ['Xvfb'...
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/iris_sinclair.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/tangible/collection/rebel_marine_helmet.py
85615
import sys def setup(core, object): return
zenweasel/fabric-bolt
refs/heads/master
projects/migrations/0016_auto__add_field_deployment_configuration.py
18
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Deployment.configuration' db.add_column(u'projects_deployment', 'configuration', ...
wfxiang08/django190
refs/heads/master
tests/model_forms/tests.py
85
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless from django import forms from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ) from django.core.files.uploadedfile import SimpleUploadedFile from djang...
pratikmallya/python-swiftclient
refs/heads/master
tests/unit/test_utils.py
2
# Copyright (c) 2010-2013 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
gylian/sickrage
refs/heads/master
lib/github/tests/RawData.py
39
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # # ...
hasgeek/funnel
refs/heads/master
migrations/versions/22fb4e1e3139_add_ticket_client.py
1
"""Add ticket client. Revision ID: 22fb4e1e3139 Revises: 40c4ad7c0909 Create Date: 2015-05-13 16:51:14.399678 """ revision = '22fb4e1e3139' down_revision = '40c4ad7c0909' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table( 'ticket_client', sa.Column('id', sa.Integer(...
ljnutal6/media-recommend
refs/heads/master
app/virtualenvs/recommedia/lib/python2.7/site-packages/jinja2/optimizer.py
1401
# -*- coding: utf-8 -*- """ jinja2.optimizer ~~~~~~~~~~~~~~~~ The jinja optimizer is currently trying to constant fold a few expressions and modify the AST in place so that it should be easier to evaluate it. Because the AST does not contain all the scoping information and the compiler has to ...
thomasboyt/zulip
refs/heads/master
bots/summarize_stream.py
116
# This is hacky code to analyze data on our support stream. The main # reusable bits are get_recent_messages and get_words. import zulip import re import collections def get_recent_messages(client, narrow, count=100): narrow = [word.split(':') for word in narrow.split()] req = { 'narrow': narrow, ...
JetBrains/intellij-community
refs/heads/master
python/helpers/six.py
878
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
repotvsupertuga/repo
refs/heads/master
script.module.media3d/resources/control.py
4
# -*- coding: utf-8 -*- ''' TVsupertuga Add-on Copyright (C) 2016 TVsupertuga 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 opt...
draem0507/rietveld
refs/heads/master
codereview/middleware.py
22
# Copyright 2008 Google 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 writing, ...
adelton/django
refs/heads/master
tests/template_tests/filter_tests/test_title.py
388
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import title from django.test import SimpleTestCase from ..utils import setup class TitleTests(SimpleTestCase): @setup({'title1': '{{ a|title }}'}) def test_title1(self): output = self.engine.render_...
hgiemza/DIRAC
refs/heads/integration
DataManagementSystem/Client/FTS3Job.py
2
__RCSID__ = "$Id $" import datetime # Requires at least version 3.3.3 import fts3.rest.client.easy as fts3 from fts3.rest.client.exceptions import FTS3ClientException from DIRAC.Resources.Storage.StorageElement import StorageElement from DIRAC.DataManagementSystem.Client.FTS3File import FTS3File from DIRAC.Framew...
lasko/pyvcloud
refs/heads/master
pyvcloud/__init__.py
4
import tempfile import logging import requests import httplib _logger = None def _get_logger(): global _logger if _logger is not None: return _logger _logger = logging.getLogger("pyvcloud") _logger.setLevel(logging.DEBUG) handler = logging.FileHandler("%s/pyvcloud.log" % tempfile.gettempd...
bastianh/swampdragon
refs/heads/master
tests/test_model_serializer_serialize_m2m.py
13
from swampdragon.serializers.model_serializer import ModelSerializer from swampdragon.testing.dragon_testcase import DragonTestCase from .models import SDModel from django.db import models class Address(SDModel): name = models.CharField(max_length=100) class AddressBook(SDModel): owner = models.CharField(ma...
cycotech/WAR-app
refs/heads/master
env/lib/python3.5/site-packages/pip/_vendor/distlib/locators.py
328
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
brianjgeiger/osf.io
refs/heads/develop
api/metaschemas/urls.py
14
from django.conf.urls import url from api.metaschemas import views app_name = 'osf' urlpatterns = [ url(r'^$', views.DeprecatedMetaSchemasList.as_view(), name=views.DeprecatedMetaSchemasList.view_name), url(r'^registrations/$', views.DeprecatedRegistrationMetaSchemaList.as_view(), name=views.DeprecatedRegist...
DavidMikeSimon/ansible
refs/heads/devel
lib/ansible/plugins/action/async.py
89
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
vitaly-krugl/nupic
refs/heads/master
examples/opf/experiments/spatial_classification/run_exp_generator.py
10
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
embaldridge/hydrobide
refs/heads/master
models/BoneYard/BideProcesses/bide.py
1
from __future__ import division import sys import numpy as np from random import randrange import math import random def get_maxUptake(maxUptake_dict, prop, mean, std, system): maxUptake = mean #if system != 'ideal': # uncomment to make 'ideal' systems ne...
imply/chuu
refs/heads/master
chrome/test/pyautolib/pyauto_utils.py
67
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utilities for PyAuto.""" import httplib import logging import os import shutil import socket import sys import tempfile import unittest import urlpar...
pshen/ansible
refs/heads/devel
lib/ansible/plugins/strategy/__init__.py
5
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...