repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
sgerhart/ansible
refs/heads/maintenance_policy_module
lib/ansible/modules/storage/netapp/na_ontap_job_schedule.py
9
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
technicalpickles/zulip
refs/heads/master
zerver/management/commands/realm_alias.py
114
from __future__ import absolute_import from django.core.management.base import BaseCommand from zerver.models import Realm, RealmAlias, get_realm from zerver.lib.actions import realm_aliases import sys class Command(BaseCommand): help = """Manage aliases for the specified realm""" def add_arguments(self, par...
Lh4cKg/sl4a
refs/heads/master
python/src/Lib/test/test_largefile.py
58
"""Test largefile support on system where this makes sense. """ import os import stat import sys import unittest from test.test_support import run_unittest, TESTFN, verbose, requires, \ TestSkipped, unlink try: import signal # The default handler for SIGXFSZ is to abort the proce...
zedr/django
refs/heads/master
django/contrib/gis/maps/google/overlays.py
6
from __future__ import unicode_literals from django.contrib.gis.geos import fromstr, Point, LineString, LinearRing, Polygon from django.utils.functional import total_ordering from django.utils.safestring import mark_safe from django.utils import six from django.utils.encoding import python_2_unicode_compatible @pyth...
rcomer/iris
refs/heads/placeholder
lib/iris/tests/unit/merge/__init__.py
6
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris._merge` module."""
FusionSP/android_external_chromium_org
refs/heads/lp5.1
build/android/pylib/utils/json_results_generator_unittest.py
87
# 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. # # Most of this file was ported over from Blink's # webkitpy/layout_tests/layout_package/json_results_generator_unittest.py # import unittest import json ...
cycotech/WAR-app
refs/heads/master
env/lib/python3.5/site-packages/pip/_vendor/cachecontrol/_cmd.py
488
import logging from pip._vendor import requests from pip._vendor.cachecontrol.adapter import CacheControlAdapter from pip._vendor.cachecontrol.cache import DictCache from pip._vendor.cachecontrol.controller import logger from argparse import ArgumentParser def setup_logging(): logger.setLevel(logging.DEBUG) ...
ioannistsanaktsidis/invenio
refs/heads/prod
modules/bibsched/lib/bibsched_webapi.py
16
## This file is part of Invenio. ## Copyright (C) 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ...
christi3k/zulip
refs/heads/master
tools/lib/gitlint-rules.py
5
from typing import Text, List import gitlint from gitlint.rules import LineRule, RuleViolation, CommitMessageTitle # Word list from https://github.com/m1foley/fit-commit # Copyright (c) 2015 Mike Foley # License: MIT # Ref: fit_commit/validators/tense.rb WORD_SET = { 'adds', 'adding', 'added', 'allows', 'allo...
prymatex/qtermwidget
refs/heads/master
pyqt4/test.py
5
#!/usr/bin/env python # -*- coding: utf-8 -*- # PyQt4 bindings for th QTermWidget project. # # Copyright (C) 2009 Piotr "Riklaunim" Maliński <riklaunim@gmail.com>, # Alexander Slesarev <alex.slesarev@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the t...
zzeleznick/zDjango
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/admin/sites.py
91
from functools import update_wrapper from django.http import Http404, HttpResponseRedirect from django.contrib.admin import ModelAdmin, actions from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth import logout as auth_logout, REDIRECT_FIELD_NAME from django.contrib.contenttypes impor...
opensvn/python
refs/heads/master
cpp/ch16/tsTservSS.py
3
#!/usr/bin/env python from SocketServer import (TCPServer as TCP, StreamRequestHandler as SRH) from time import ctime HOST = '' PORT = 21567 ADDR = (HOST, PORT) class MyRequestHandler(SRH): def handle(self): print '...connected from:', self.client_address self.wfile.write('[%s] %s' % (ctime()...
Haynie-Research-and-Development/jarvis
refs/heads/master
deps/lib/python3.4/site-packages/sqlalchemy/util/queue.py
33
# util/queue.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """An adaptation of Py2.3/2.4's Queue module which supports reentrant behavior, using ...
nfletton/bvspca
refs/heads/master
bvspca/animals/tests/test_animal_counts.py
1
import pytest from bvspca.animals.management.commands.sync_petpoint_data import Command from bvspca.animals.models import AnimalCountSettings @pytest.mark.django_db def test_decrement_animal_count(): animal_settings = AnimalCountSettings.objects.get(pk=1) animal_settings.cats_adopted = 22 animal_settings...
wuhengzhi/chromium-crosswalk
refs/heads/master
tools/cr/cr/auto/__init__.py
138
# Copyright 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. """A root package for all the automatically loaded modules. There are no built in packages below this, it holds a set of packages that have their search pat...
timoschwarzer/blendworks
refs/heads/master
BlendWorks Server/python/Lib/site-packages/pip/_vendor/distlib/compat.py
357
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO stri...
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.4/django/core/files/uploadedfile.py
402
""" Classes representing uploaded files. """ import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.conf import settings from django.core.files.base import File from django.core.files import temp as tempfile from django.utils.encoding import smart_str __al...
danielsokolowski/django-guardian
refs/heads/monkeypatch_admin_integration
benchmarks/settings.py
86
import os import sys abspath = lambda *p: os.path.abspath(os.path.join(*p)) THIS_DIR = abspath(os.path.dirname(__file__)) ROOT_DIR = abspath(THIS_DIR, '..') # so the preferred guardian module is one within this repo and # not system-wide sys.path.insert(0, ROOT_DIR) INSTALLED_APPS = ( 'django.contrib.auth', ...
ingadhoc/odoo
refs/heads/8.0
addons/auth_oauth/__openerp__.py
300
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
alaxa27/competitive
refs/heads/master
answer_to_the_universe.py
1
import sys tab = [] while True: try: tab.append(input()) except: break for i in range(0, len(tab)): if int(tab[i]) == 42: break print tab[i]
huguesv/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/urllib3/_collections.py
63
from __future__ import absolute_import try: from collections.abc import Mapping, MutableMapping except ImportError: from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): ...
u9621071/kernel-uek-UEK3
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...
deKupini/erp
refs/heads/master
addons/marketing_campaign/__init__.py
7
# -*- 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...
vortex-ape/scikit-learn
refs/heads/master
examples/semi_supervised/plot_label_propagation_digits_active_learning.py
33
""" ======================================== Label Propagation digits active learning ======================================== Demonstrates an active learning technique to learn handwritten digits using label propagation. We start by training a label propagation model with only 10 labeled points, then we select the t...
odoobgorg/odoo
refs/heads/9.0
addons/point_of_sale/wizard/pos_payment.py
44
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp.osv import osv, fields from openerp.tools.translate import _ class account_journal(osv.osv): _inherit = 'account.journal' def search(self, cr, uid, args, offset=0, limit=None, order=N...
AkademieOlympia/sympy
refs/heads/master
sympy/printing/tests/test_fcode.py
58
from sympy import sin, cos, atan2, log, exp, gamma, conjugate, sqrt, \ factorial, Integral, Piecewise, Add, diff, symbols, S, Float, Dummy, Eq from sympy import Catalan, EulerGamma, E, GoldenRatio, I, pi from sympy import Function, Rational, Integer, Lambda from sympy.core.relational import Relational from sympy.l...
qwhelan/asv
refs/heads/master
test/test_check.py
3
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import re import pytest from asv import util from . import tools from .test_dev import basic_conf def test_check(cap...
rahuldhote/odoo
refs/heads/8.0
addons/web_view_editor/__init__.py
14224
# -*- coding: utf-8 -*-
geokrety/geokrety-api
refs/heads/master
app/api/news_subscriptions.py
2
from flask_jwt import current_identity from flask_rest_jsonapi import (ResourceDetail, ResourceList, ResourceRelationship) from app.api.bootstrap import api from app.api.helpers.exceptions import ForbiddenException from app.api.helpers.permission_manager import has_access from app.api.s...
dexter93/kernel_htc_msm8660
refs/heads/kk4.4
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
JeffRoy/mi-dataset
refs/heads/master
mi/dataset/driver/parad_j/cspp/parad_j_cspp_telemetered_driver.py
1
""" @package mi.dataset.driver.parad_j.cssp @file mi-dataset/mi/dataset/driver/parad_j/cspp/parad_j_cspp_telemetered_driver.py @author Joe Padula @brief Telemetered driver for the parad_j_cspp instrument Release notes: Initial Release """ __author__ = 'jpadula' from mi.dataset.dataset_driver import SimpleDatasetDri...
BaichuanWu/Blog_on_django
refs/heads/master
site-packages/django/conf/locale/de/formats.py
82
# -*- 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:s' DAT...
brson/gyp
refs/heads/master
test/msvs/external_builder/msbuild_rule.py
260
# Copyright (c) 2013 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, os.path sys.argv[1] = os.path.basename(sys.argv[1]) with open('msbuild_rule.out', 'w') as f: f.write(' '.join(sys.argv))
OVERLOADROBOTICA/OVERLOADROBOTICA.github.io
refs/heads/master
mail/formspree-master/formspree/routes.py
1
import forms import users import static_pages def configure_routes(app): app.add_url_rule('/', 'index', view_func=static_pages.views.default, methods=['GET']) app.add_url_rule('/favicon.ico', view_func=static_pages.views.favicon) app.add_url_rule('/formspree-verify.txt', view_func=static_pages.views.formsp...
Rdbaker/rovu-api
refs/heads/master
rovu/database.py
2
# -*- coding: utf-8 -*- """Database module, including the SQLAlchemy database object and DB-related utilities.""" from sqlalchemy.orm import relationship from .compat import basestring from .extensions import db # Alias common SQLAlchemy names Column = db.Column relationship = relationship class CRUDMixin(object): ...
dieface/erpnext
refs/heads/develop
erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py
96
# 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 getdate, cint import calendar def execute(filters=None): # key yyyy-mm new_customers_in =...
Poles/Poles
refs/heads/master
platforms/linux/JsonCpp/scons-local-2.3.0/SCons/PathList.py
11
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # 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, incl...
chjw8016/GreenOdoo7-haibao
refs/heads/master
openerp/addons/project_issue/project_issue.py
5
#-*- 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...
joereynolds/Mr-Figs
refs/heads/master
src/minigames/hunt/collectible.py
1
import pygame from src.entity import Entity class Collectible(Entity): def __init__( self, x: int, y: int, width: int, height: int, image=None ): Entity.__init__(self, x, y, width, height, image)
hgrimelid/feincms
refs/heads/master
feincms/module/extensions/featured.py
2
""" Add a "featured" field to objects so admins can better direct top content. """ from django.db import models from django.utils.translation import ugettext_lazy as _ def register(cls, admin_cls): cls.add_to_class('featured', models.BooleanField(_('featured'))) if hasattr(cls, 'cache_key_components'): ...
tst-eclamar/earthenterprise
refs/heads/master
earth_enterprise/src/fusion/portableglobe/tools/explode.py
5
#!/usr/bin/env python2.7 # # Copyright 2017 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 l...
cloudius-systems/dpdk
refs/heads/master
app/test/autotest_data.py
19
#!/usr/bin/python # BSD LICENSE # # Copyright(c) 2010-2014 Intel Corporation. All rights reserved. # 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 sourc...
powerjg/gem5-ci-test
refs/heads/master
ext/ply/test/yacc_nodoc.py
174
# ----------------------------------------------------------------------------- # yacc_nodoc.py # # Rule with a missing doc-string # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tok...
gregdek/ansible
refs/heads/devel
lib/ansible/plugins/cliconf/asa.py
18
# # (c) 2017 Red Hat Inc. # # 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 d...
amol-/depot
refs/heads/master
examples/flask/app.py
4
from flask import Flask, request, redirect, url_for, render_template app = Flask(__name__) # This is just an horrible way to keep around # uploaded files, but in the end we just wanted # to showcase how to setup DEPOT, not how to upload files. UPLOADED_FILES = [] @app.route("/", methods=['GET', 'POST']) def index()...
Orav/kbengine
refs/heads/master
kbe/src/lib/python/Lib/crypt.py
2
"""Wrapper to the POSIX crypt library call and associated functionality.""" import _crypt import string as _string from random import SystemRandom as _SystemRandom from collections import namedtuple as _namedtuple _saltchars = _string.ascii_letters + _string.digits + './' _sr = _SystemRandom() class _M...
bellacoin/bellacoin
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...
saukrIppl/seahub
refs/heads/master
thirdpart/openpyxl-2.3.0-py2.7.egg/openpyxl/drawing/effect.py
13
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, String, Set, Bool, Integer, NoneSet, Float,) from .colors import ColorChoice class TintEffect(Serialisable): ...
s0undt3ch/Deluge
refs/heads/master
deluge/ui/console/commands/resume.py
14
# # resume.py # # Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com> # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free Software # Foundation; either ...
M4sse/chromium.src
refs/heads/nw12
third_party/tlslite/tlslite/api.py
54
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. __version__ = "0.4.6" from .constants import AlertLevel, AlertDescription, ClientCertificateType, \ Fault from .errors import * from .checker import Checker from .handshakesettings import HandshakeSe...
hostmaster/ansible-modules-extras
refs/heads/devel
notification/slack.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Ramon de la Fuente <ramon@delafuente.nl> # # 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 ...
BytecodeMe/vanquish
refs/heads/cm-10.1
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...
impromptuartist/impromptuartist.github.io
refs/heads/master
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatters/terminal256.py
362
# -*- coding: utf-8 -*- """ pygments.formatters.terminal256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for 256-color terminal output with ANSI sequences. RGB-to-XTERM color conversion routines adapted from xterm256-conv tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2) by Wolfg...
UnrememberMe/pants
refs/heads/master
src/python/pants/backend/graph_info/register.py
2
# 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.g...
dxc/people_finder_chile
refs/heads/master
app/admin.py
7
#!/usr/bin/python2.7 # Copyright 2011 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 ...
etzhou/edx-platform
refs/heads/master
openedx/core/djangoapps/course_groups/models.py
55
""" Django models related to course groups functionality. """ import json import logging from django.contrib.auth.models import User from django.db import models from xmodule_django.models import CourseKeyField log = logging.getLogger(__name__) class CourseUserGroup(models.Model): """ This model represents...
tastyminerals/fish_ladder
refs/heads/master
fish_ladder.py
1
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Pull data from www.fishbattle.net/rank_ladder, format it and pretty-print. """ from __future__ import division import argparse import codecs import json import re import os import sys import ttk import Tkinter as tk import webbrowser try: import requests impo...
rosmo/ansible
refs/heads/devel
lib/ansible/modules/network/eos/eos_user.py
58
#!/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 distribut...
kod3r/deepdive
refs/heads/master
examples/table/udf/extract_table_cells.py
15
#! /usr/bin/env python import fileinput import json import os import glob import sys import json from table_cell import TableCell def debug(str): sys.stderr.write("%s\n" % str) BASE_FOLDER = os.path.split(os.path.realpath(__file__))[0] BASE_FOLDER = BASE_FOLDER + "/.." OUTPUT_DIR = BASE_FOLDER + "/pdf_rawtables" T...
TileHalo/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/test/test_http_header_util.py
496
#!/usr/bin/env python # # Copyright 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...
femmerling/DirMaker
refs/heads/master
box/lib/python2.7/site-packages/sqlalchemy/dialects/sybase/pysybase.py
18
# sybase/pysybase.py # Copyright (C) 2010-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: sybase+pysybase :name: Python-Sybase :dbapi: Sybase :c...
AlperSaltabas/OR_Tools_Google_API
refs/heads/master
examples/python/nonogram_table2.py
34
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
ict-felix/stack
refs/heads/master
modules/resource/manager/stitching-entity/src/server/flask/flaskserver.py
2
from flask import Flask, g, request, request_started, request_finished from flask.ext.pymongo import PyMongo from core.config import ConfParser from core import log logger=log.getLogger("flaskserver") from server.flask.views import ro_flask_views from werkzeug import serving from OpenSSL import SSL, crypto import as...
uwosh/uwosh.libraryguides
refs/heads/master
uwosh/libraryguides/tests/base.py
1
"""Test setup for integration and functional tests. When we import PloneTestCase and then call setupPloneSite(), all of Plone's products are loaded, and a Plone site will be created. This happens at module level, which makes it faster to run each test, but slows down test runner startup. """ from Products.Five import...
LouisePaulDelvaux/openfisca-france-data
refs/heads/master
openfisca_france_data/scripts/sas_import.py
1
# -*- coding: utf-8 -*- """ Created on Tue May 6 15:13:59 2014 @author: pacificoadrien """ from sas7bdat import SAS7BDAT import pandas as pd import os import sys def extract_from_sas(file_to_import): f = SAS7BDAT(file_to_import) outFile = ("/Users/pacificoadrien/Downloads/help.csv") def convertFile(...
Sapphirine/Predict-Survival-on-the-Titanic
refs/heads/master
data_preprocessing.py
2
df = pd.read_csv("/Users/liqi/Downloads/titanic/data/train.csv") df = df.drop(['Ticket','Cabin'], axis=1) # Remove NaN values df = df.dropna() fig = plt.figure(figsize=(18,12), dpi=1600) a = 0.65 # Step 1 ax1 = fig.add_subplot(341) df.Survived.value_counts().plot(kind='bar', color="blue", alpha=a) ax1.set_xlim(-1, le...
SPKian/Testing
refs/heads/master
erpnext/patches/v5_0/reclculate_planned_operating_cost_in_production_order.py
97
# 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 def execute(): for po in frappe.db.sql("""select name from `tabProduction Order` where docstatus < 2""", as_dict=1): prod_order =...
qtekfun/htcDesire820Kernel
refs/heads/master
external/chromium_org/build/android/gyp/generate_v14_compatible_resources.py
27
#!/usr/bin/env python # # Copyright 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. """Convert Android xml resources to API 14 compatible. There are two reasons that we cannot just use API 17 attributes, so we are ge...
CYBAI/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/manifest/tests/test_utils.py
19
import os import subprocess import mock from .. import utils def test_git_for_path_no_git(): this_dir = os.path.dirname(__file__) with mock.patch( "subprocess.check_output", side_effect=subprocess.CalledProcessError(1, "foo")): assert utils.git(this_dir) is None
waheedahmed/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/tests/utils.py
51
""" Helper classes and methods for running modulestore tests without Django. """ import random from contextlib import contextmanager, nested from importlib import import_module from opaque_keys.edx.keys import UsageKey from path import Path as path from shutil import rmtree from tempfile import mkdtemp from unittest i...
stephanehenry27/Sickbeard-anime
refs/heads/master
lib/hachoir_parser/program/prc.py
90
""" PRC (Palm resource) parser. Author: Sebastien Ponce Creation date: 29 october 2008 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, UInt16, UInt32, TimestampMac32, String, RawBytes) from lib.hachoir_core.endian import BIG_ENDIAN class PRCHeader(FieldSet): static...
aokolnychyi/spark
refs/heads/master
python/pyspark/traceback_utils.py
160
# # 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...
hsoft/DjangoBB
refs/heads/master
djangobb_forum/feeds.py
9
from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.utils.feedgenerator import Atom1Feed from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.db.models import Q from django.http import Http404 from djangobb_forum.models import Post...
tharkunn/stages
refs/heads/master
search/migrations/0005_auto_20151118_1042.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('search', '0004_auto_20151020_1748'), ] operations = [ migrations.AlterField( model_name='recherche', ...
zouyapeng/horizon_change
refs/heads/juno
openstack_dashboard/dashboards/monitor/network_monitor/views.py
2
from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import tabs from horizon import forms from horizon import tables from horizon import messages from openstack_dashboard.dashboards.monitor import monitor from openstack_dashboard.dashboards.monitor.ne...
arpruss/plucker
refs/heads/master
plucker_desktop/installer/osx/application_bundle_files/Resources/parser/python/vm/PIL/ImageTransform.py
1
# # The Python Imaging Library. # $Id: ImageTransform.py,v 1.1 2007/06/17 14:12:15 robertoconnor Exp $ # # transform wrappers # # History: # 2002-04-08 fl Created # # Copyright (c) 2002 by Secret Labs AB # Copyright (c) 2002 by Fredrik Lundh # # See the README file for information on usage and redistribut...
HackerTool/vivisect
refs/heads/master
vstruct/defs/windows/win_6_2_i386/win32k.py
12
# Version: 6.2 # Architecture: i386 import vstruct from vstruct.primitives import *
weebygames/boto
refs/heads/develop
boto/emr/instance_group.py
179
# # 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, publish, dis- # tribute, sublicense, and/or sell ...
PythonRails/pythonrails
refs/heads/master
rails/router.py
2
from __future__ import absolute_import import os import sys import traceback from webob.exc import HTTPNotFound, HTTPInternalServerError from .config import Config from .config import get_config from .request import Request from .response import Response from .exceptions import PageNotFound from .tools import import_mo...
orgito/ansible
refs/heads/devel
lib/ansible/parsing/quoting.py
241
# (c) 2014 James Cammarata, <jcammarata@ansible.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) any late...
fluidware/fluidsurveys-python
refs/heads/master
fluidsurveys/http_client.py
1
import json import os import sys import textwrap import warnings from fluidsurveys import exceptions, util, compat from fluidsurveys import AccessInfo # - Requests is the preferred HTTP library # - Google App Engine has urlfetch # - Use Pycurl if it's there (at least it verifies SSL certs) # - Fall back to urllib2 wi...
hzlf/openbroadcast
refs/heads/master
website/cms/tests/menu_utils.py
6
from cms.test_utils.testcases import CMSTestCase from cms.test_utils.util.mock import AttributeObject from django.http import HttpResponse from menus.templatetags.menu_tags import PageLanguageUrl from menus.utils import (simple_language_changer, find_selected, language_changer_decorator) class DumbPageLanguageUr...
bigbiff/android_kernel_samsung_sm900t
refs/heads/jb
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. ...
anntzer/numpy
refs/heads/master
numpy/tests/test_public_api.py
2
import sys import subprocess import pkgutil import types import importlib import warnings import numpy as np import numpy import pytest try: import ctypes except ImportError: ctypes = None def check_dir(module, module_name=None): """Returns a mapping of all objects with the wrong __module__ attribute.""...
dagnir/servo
refs/heads/master
tests/wpt/harness/wptrunner/wptmanifest/backends/conditional.py
188
# 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 operator from ..node import NodeVisitor, DataNode, ConditionalNode, KeyValueNode, ListNode, ValueNode from ..par...
agry/NGECore2
refs/heads/master
scripts/object/static/item/item_ammo_rocket.py
85615
import sys def setup(core, object): return
toshywoshy/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_compute_https_health_check_info.py
13
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
mail-apps/pootle
refs/heads/master
pootle/apps/pootle_app/__init__.py
19
default_app_config = "pootle_app.apps.PootleConfig"
AgnieszkaZadlo/QRS-detection
refs/heads/master
Mathematical Morphology/C++ source code/eigen-eigen-f562a193118d/debug/gdb/printers.py
119
# -*- coding: utf-8 -*- # This file is part of Eigen, a lightweight C++ template library # for linear algebra. # # Copyright (C) 2009 Benjamin Schindler <bschindler@inf.ethz.ch> # # 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 ...
shahankhatch/scikit-learn
refs/heads/master
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
petertodd/replace-by-fee-tools
refs/heads/master
lib/python-bitcoinlib/bitcoin/rpc.py
1
# Copyright (C) 2007 Jan-Klaas Kollhof # Copyright (C) 2011-2015 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be ...
solidsnack/v2
refs/heads/master
v2/__main__.py
1
import pkg_resources from magiclog import log def main(): log.configure() data = pkg_resources.resource_stream(__package__, '__init__.py') log.info('Writing local copy of v2 to v2.py...') with open('v2.py', 'wb') as h: h.write(data.read()) log.info('Appending v2.py and VERSION to MANIFEST...
ShangShungFoundation/capo
refs/heads/master
capo/actions/email.py
1
from django.core.mail import send_mail from django.conf import settings from action import Action class send(Action): """ {"to": ["xxx.xxx"], "from": "xxx.xxx", "subject": "bbb", "message": "ggg"} {"to": ["%(to)s"], "from": "%(from)s", "subject": "%(subject)s", "message": "%(messsage)s"} """ expe...
PandaWei/avocado-vt
refs/heads/master
selftests/unit/test_virsh.py
8
#!/usr/bin/python import unittest import logging import os import sys from avocado.utils import process # simple magic for using scripts within a source tree basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if os.path.isdir(os.path.join(basedir, 'virttest')): sys.path.append(basedir) def p...
vladnicoara/SDLive-Blog
refs/heads/master
plugins/superdesk-source/superdesk/source/impl/source.py
2
''' Created on May 3, 2012 @package: superdesk source @copyright: 2012 Sourcefabric o.p.s. @license: http://www.gnu.org/licenses/gpl-3.0.txt @author: Gabriel Nistor Contains the SQL alchemy implementation for source API. ''' from ..api.source import ISourceService, QSource from ..meta.source import SourceMapped from...
raymondxyang/tensorflow
refs/heads/master
tensorflow/contrib/nccl/__init__.py
56
# 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...
frishberg/django
refs/heads/master
django/contrib/postgres/forms/jsonb.py
51
import json from django import forms from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['JSONField'] class InvalidJSONInput(six.text_type): pass class JSONString(six.text_type): pass class JSONField(forms.CharField): default_error_messages = { 'in...
ucoin-io/cutecoin
refs/heads/master
src/sakia/gui/navigation/graphs/wot/scene.py
3
import networkx from PyQt5.QtCore import QPoint, pyqtSignal from PyQt5.QtWidgets import QGraphicsScene from .edge import WotEdge from .node import WotNode from sakia.helpers import dpi_ratio from ..base.scene import BaseScene class WotScene(BaseScene): def __init__(self, parent=None): """ Create...
bjmorgan/bsym
refs/heads/master
tests/unit_tests/test_symmetry_group.py
2
import unittest from bsym import SymmetryGroup, SymmetryOperation from unittest.mock import Mock, patch, call import numpy as np class SymmetryGroupTestCase( unittest.TestCase ): """Tests for SymmetryGroup class""" def test_symmetry_group_is_initialised( self ): s0, s1 = Mock( spec=SymmetryOperation )...
LiJingkang/PyQt5
refs/heads/master
Learn/高级特性/PyQt5_布局管理_箱布局.py
1
import sys from PyQt5.QtWidgets import (QWidget, QPushButton, QHBoxLayout, QVBoxLayout, # 两个布局管理类 QApplication) # 主窗口 class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): # 创建了两个按钮 ...