repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
MuckRock/muckrock
refs/heads/master
muckrock/foia/migrations/0008_foiacommunication_autogenerated.py
1
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('foia', '0007_auto_20150924_1123'), ] operations = [ migrations.AddField( model_name='foiacommunication', name='autogenerated', ...
bak1an/django
refs/heads/master
tests/context_processors/views.py
175
from django.shortcuts import render from .models import DebugObject def request_processor(request): return render(request, 'context_processors/request_attrs.html') def debug_processor(request): context = { 'debug_objects': DebugObject.objects, 'other_debug_objects': DebugObject.objects.usin...
mtanski/samba
refs/heads/master
lib/subunit/setup.py
12
#!/usr/bin/env python try: # If the user has setuptools / distribute installed, use it from setuptools import setup except ImportError: # Otherwise, fall back to distutils. from distutils.core import setup extra = {} else: extra = { 'install_requires': [ 'testtools>=0.9.23', ...
python-ivi/python-ivi
refs/heads/master
ivi/agilent/agilentDSA91204A.py
2
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2017 Alex Forencich 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...
ingadhoc/odoo
refs/heads/8.0
addons/mrp/report/price.py
238
# -*- 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...
chernals/georges
refs/heads/master
georges/__init__.py
1
__version__ = "2020.1" try: from georges_core import ureg, Q_ except ModuleNotFoundError: # TODO error handling # Manipulation of physical quantities (with units, etc.) # https://pint.readthedocs.io/en/latest/ from pint import UnitRegistry ureg = UnitRegistry() _Q = ureg.Quantity ureg.d...
nyaruka/motome
refs/heads/master
motome/locales/models.py
1
from django.db import models from django.core.validators import RegexValidator, MinValueValidator, MaxValueValidator from smartmin.models import SmartModel from decimal import Decimal, ROUND_HALF_UP from django.conf import settings def comma_formatted(value, has_decimals): """ Returns the passed in Decimal as ...
paolodedios/tensorflow
refs/heads/master
tensorflow/compiler/mlir/tfr/python/test_utils.py
10
# Copyright 2020 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...
UpSea/midProjects
refs/heads/master
BasicOperations/01_01_PyQt4/progressBar.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- #http://blog.csdn.net/Kai_gai/article/details/49590323 import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): # 创建进度条 self.pbar = Q...
saeschdivara/Twisted-Mail-Server
refs/heads/master
twistedmail/server.py
1
import StringIO import sys from OpenSSL.SSL import TLSv1_METHOD from arangodb.api import Client from arangodb.models import CollectionModel from twisted.python import log from twisted.mail.smtp import ESMTPSenderFactory from twisted.internet.ssl import ClientContextFactory from twisted.internet.defer import Deferred...
Si-elegans/Web-based_GUI_Tools
refs/heads/master
spirit/managers/topic_unread.py
2
#-*- coding: utf-8 -*- from django.db.models import Manager class TopicUnreadManager(Manager): def for_user(self, user): return self.filter(user=user, is_read=False, is_removed=False) def read(self, user, topic): # returns updated rows count (int) return self.filter(user=user, topic...
Allow2CEO/browser-ios
refs/heads/master
brave/node_modules/hashset-cpp/vendor/depot_tools/third_party/boto/mashups/order.py
101
# 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...
JonatanS/cleanHackathonStarter
refs/heads/master
docqr_hackathonstarter1/node_modules/node-sass-middleware/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
lu-ci/apex-sigma-plugins
refs/heads/master
moderation/punishments/ban.py
3
import arrow import discord from sigma.core.utilities.data_processing import user_avatar from sigma.core.utilities.permission_processing import hierarchy_permit from sigma.core.utilities.server_bound_logging import log_event def generate_log_embed(message, target, reason): log_response = discord.Embed(color=0x6...
gregorianzhang/bbcnews
refs/heads/master
requests/packages/chardet/mbcharsetprober.py
2923
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
BeyondTheClouds/nova
refs/heads/disco/mitaka
nova/api/openstack/compute/multinic.py
27
# 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...
eranroz/revscoring
refs/heads/master
revscoring/datasources/diff.py
1
from deltas import segment_matcher from deltas.tokenizers import wikitext_split from . import parent_revision, revision from .datasource import Datasource from .util import WORD_RE def process_operations(parent_revision_text, revision_text): parent_revision_text = parent_revision_text or '' revision_text = r...
play113/swer
refs/heads/master
opencamlib-read-only/scripts/zigzag_1.py
7
import ocl import camvtk import time import vtk import datetime import math def DrawLoops(myscreen, loops): # draw the loops nloop=0 for lop in loops: n = 0 N = len(lop) first_point=ocl.Point(-1,-1,5) previous=ocl.Point(-1,-1,5) for p in lop: if n==0: # d...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/multiprocessing/reduction.py
217
# # Module to allow connection and socket objects to be transferred # between processes # # multiprocessing/reduction.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditio...
suncycheng/intellij-community
refs/heads/master
python/testData/refactoring/extractsuperclass/importMultiFile/source_module.after.py
320
from dest_module import NewParent class MyClass(NewParent): pass
HoECoder/Sprinkler
refs/heads/master
application/settings.py
1
import os import os.path import glob import ConfigParser import json from copy import deepcopy from collections import OrderedDict from core_config import * from settings_keys import * #from programs import * from utility import find_key_gap from clock import pretty_now boolean_conf_keys = [RAIN_SENSOR_KEY, ...
rohitwaghchaure/frappe_smart
refs/heads/develop
frappe/core/page/applications/applications.py
36
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.installer from frappe import _ @frappe.whitelist() def get_app_list(): out = {} installed = frappe.get_installed_apps() for app in frappe.get_al...
qgis/QGIS
refs/heads/master
python/plugins/processing/gui/ConfigDialog.py
26
# -*- coding: utf-8 -*- """ *************************************************************************** ConfigDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
simonwydooghe/ansible
refs/heads/devel
lib/ansible/modules/network/ios/ios_command.py
6
#!/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...
ULHPC/easybuild-framework
refs/heads/master
test/framework/__init__.py
3
## # Copyright 2012-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
modulexcite/catapult
refs/heads/master
dashboard/dashboard/find_step_test.py
8
# Copyright 2015 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 math import unittest from dashboard import find_step from dashboard import math_utils # Sample data where there is a small-ish step upwards around r...
gilbertpilz/solum
refs/heads/camp/item-1
solum/api/controllers/camp/camp_v1_1_endpoint.py
1
# # 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...
pamfilos/data.cern.ch
refs/heads/update-docs
tests/integration/test_cms_api.py
1
# -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2017 CERN. # # CERN Analysis Preservation Framework 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...
eagleamon/home-assistant
refs/heads/dev
homeassistant/helpers/location.py
41
"""Location helpers for Home Assistant.""" from typing import Sequence from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE from homeassistant.core import State from homeassistant.util import location as loc_util def has_location(state: State) -> bool: """Test if state contains a valid location. A...
hultberg/ppinnlevering
refs/heads/master
core/migrations/0012_remove_bidragfile_type.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0011_bidragfile_type'), ] operations = [ migrations.RemoveField( model_name='bidragfile', na...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/mobile/shared_dressed_nym_pirate_strong_hum_m.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 = Creature() result.template = "object/mobile/shared_dressed_nym_pirate_strong_hum_m.iff" result.attribute_template...
agry/NGECore2
refs/heads/master
scripts/object/tangible/dungeon/mustafar/valley_battlefield/power_generator.py
85615
import sys def setup(core, object): return
Bogon/httpie
refs/heads/master
httpie/models.py
48
from httpie.compat import urlsplit, str class HTTPMessage(object): """Abstract class for HTTP messages.""" def __init__(self, orig): self._orig = orig def iter_body(self, chunk_size): """Return an iterator over the body.""" raise NotImplementedError() def iter_lines(self, ch...
anand-c-goog/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/inverse_gamma_test.py
12
# 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...
DeNeutoy/deep_qa
refs/heads/master
deep_qa/layers/entailment_models/word_alignment.py
4
''' Word alignment entailment models operate on word level representations, and define alignment as a function of how well the words in the premise align with those in the hypothesis. These are different from the encoded sentence entailment models where both the premise and hypothesis are encoded as single vectors and ...
spnow/grr
refs/heads/master
lib/flows/__init__.py
1305
#!/usr/bin/env python
kmonsoor/pyglet
refs/heads/master
tools/license.py
29
#!/usr/bin/python # $Id:$ '''Rewrite the license header of source files. Usage: license.py file.py file.py dir/ dir/ ... ''' import optparse import os import sys license = '''# pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary ...
Warprobot/diplom
refs/heads/master
project/application/entities/students/views.py
1
# -*- coding: utf-8 -*- from flask import request, jsonify, g, url_for, Blueprint, render_template, redirect, flash from flask.ext.login import login_required, current_user from wtforms import ValidationError from project.application.entities import db, auth from project.application.entities.students.forms import Crea...
uni-peter-zheng/virt-test
refs/heads/master
virttest/qemu_qtree_unittest.py
17
#!/usr/bin/python """ This is a unittest for qemu_qtree library. :author: Lukas Doktor <ldoktor@redhat.com> :copyright: 2012 Red Hat, Inc. """ __author__ = """Lukas Doktor (ldoktor@redhat.com)""" import unittest import common from autotest.client.shared.test_utils import mock import qemu_qtree OFFSET_PER_LEVEL = qe...
neumerance/deploy
refs/heads/master
openstack_dashboard/dashboards/router/nexus1000v/panel.py
11
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
Brocade-OpenSource/OpenStack-DNRM-Nova
refs/heads/master
nova/api/openstack/compute/contrib/coverage_ext.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
Distrotech/scons
refs/heads/distrotech-scons
test/MSVC/batch.py
3
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
rtfd/readthedocs.org
refs/heads/master
readthedocs/proxito/tests/test_middleware.py
1
# Copied from test_middleware.py import pytest from django.http import HttpRequest from django.test import TestCase from django.test.utils import override_settings from django_dynamic_fixture import get from readthedocs.builds.models import Version from readthedocs.projects.constants import PUBLIC from readthedocs.pr...
Tithen-Firion/youtube-dl
refs/heads/master
youtube_dl/extractor/melonvod.py
64
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, urljoin, ) class MelonVODIE(InfoExtractor): _VALID_URL = r'https?://vod\.melon\.com/video/detail2\.html?\?.*?mvId=(?P<id>[0-9]+)' _TEST = { 'url': 'http://vod.melon.com...
lukeiwanski/tensorflow-opencl
refs/heads/master
tensorflow/contrib/learn/python/learn/learn_io/io_test.py
18
# 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...
LeagueForHacker/Python-Prototypes-Demo
refs/heads/master
model/anova_demo.py
1
# -*- coding: UTF-8 -*- """ Description: Author: Wallace Huang Date: 2019/8/14 Version: 1.0 """ import os import warnings import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import kstest from statsmodels.formula.api import ols from statsmodels.stats.anova import anova_lm if __nam...
Hasimir/pyjs
refs/heads/master
setup.py
6
from setuptools import setup import os.path import setup_pyjstools import setup_pyjswidgets __VERSION__='0.8.2' packages=setup_pyjstools.packages+setup_pyjswidgets.packages package_data=dict(setup_pyjstools.package_data.items()) package_data.update(dict(setup_pyjswidgets.package_data.items())) entry_points=dict(setup...
theyaa/Impala
refs/heads/cdh5-trunk
thirdparty/hive-1.1.0-cdh5.7.0-SNAPSHOT/lib/py/hive_service/constants.py
263
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import *
fgbs/metrics
refs/heads/master
lib/requests/packages/urllib3/request.py
853
try: from urllib.parse import urlencode except ImportError: from urllib import urlencode from .filepost import encode_multipart_formdata __all__ = ['RequestMethods'] class RequestMethods(object): """ Convenience mixin for classes who implement a :meth:`urlopen` method, such as :class:`~urllib3....
adaxi/couchpotato
refs/heads/master
libs/requests/packages/chardet/codingstatemachine.py
2930
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
dinglight/pomelo
refs/heads/master
gen_ldb_i18n.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- # #----------------------------------------------------------- # gen_ldb_international.py # Author: Liang Ding <liang.ding@samsung.com> # Description: generate the linguistic binary file for international language # Usage: gen_ldb_international.py langid raw_file ldb_file...
hostmaster/ansible-modules-extras
refs/heads/devel
monitoring/boundary_meter.py
57
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add boundary meters. (c) 2013, curtis <curtis@serverascode.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 Foundati...
rdeheele/odoo
refs/heads/master
addons/crm_project_issue/project_issue.py
380
from openerp.osv import osv, fields class crm_lead_to_project_issue_wizard(osv.TransientModel): """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ _name = "crm.lead2projectissue.wizard" _inherit = 'crm.partner.binding' _columns = { "lead_id": fields.many2one("crm....
werthen/django-rest-framework
refs/heads/master
tests/test_throttling.py
82
""" Tests for the throttling implementations in the permissions module. """ from __future__ import unicode_literals from django.contrib.auth.models import User from django.core.cache import cache from django.test import TestCase from rest_framework.response import Response from rest_framework.settings import api_sett...
agry/NGECore2
refs/heads/master
scripts/object/building/poi/player_camp_crafting_clothing.py
85615
import sys def setup(core, object): return
Lanceolata/code-problems
refs/heads/master
python/leetcode/Question_191_Number_of_1_Bits.py
1
#!/usr/bin/python # coding: utf-8 class Solution(object): def hammingWeight(self, n): """ :type n: int :rtype: int """ sum = 0 while n != 0: sum += 1 n &= n - 1 return sum
jcalazan/youtube-audio-dl
refs/heads/master
youtubeadl/settings/base.py
1
""" Django settings for youtubeadl project. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
wevoice/wesub
refs/heads/staging
apps/webdriver_testing/check_teams/test_unpublish.py
5
import os import time from caching.tests.utils import assert_invalidates_model_cache from django.core import management from utils.factories import * from webdriver_testing.webdriver_base import WebdriverTestCase from webdriver_testing.pages.site_pages import video_page from webdriver_testing.pages.site_pages import vi...
xhat/micropython
refs/heads/master
tests/basics/string_cr_conversion.py
113
# this file has CR line endings to test lexer's conversion of them to LF # in triple quoted strings print(repr("""abc def"""))
dcifuen/cloudbday
refs/heads/master
src/lib/dateutil/tzwin.py
304
# This code was originally contributed by Jeffrey Harris. import datetime import struct import _winreg __author__ = "Jeffrey Harris & Gustavo Niemeyer <gustavo@niemeyer.net>" __all__ = ["tzwin", "tzwinlocal"] ONEWEEK = datetime.timedelta(7) TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" TZ...
Luthaf/Chemharp-python
refs/heads/master
chemfiles/utils.py
2
# -*- coding=utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import sys from ctypes import create_string_buffer, c_uint64 from .clib import _get_c_library from .misc import ChemfilesError, _last_error if sys.version_info >= (3, 0): string_type = str else: string_type = base...
paxapy/zulip
refs/heads/master
zerver/migrations/0019_preregistrationuser_realm_creation.py
41
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('zerver', '0018_realm_emoji_message'), ] operations = [ migrations.AddField( model_name='preregistrationuser', ...
adrianicn/IguanaTrip
refs/heads/master
vendor/psy/psysh/test/tools/gen_unvis_fixtures.py
536
#! /usr/bin/env python3 import sys from os.path import abspath, expanduser, dirname, join from itertools import chain import json import argparse from vis import vis, unvis, VIS_WHITE __dir__ = dirname(abspath(__file__)) OUTPUT_FILE = join(__dir__, '..', 'fixtures', 'unvis_fixtures.json') # Add custom fixtures her...
rimbalinux/MSISDNArea
refs/heads/master
django/db/models/sql/where.py
12
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import datetime from itertools import repeat from django.utils import tree from django.db.models.fields import Field from django.db.models.query_utils import QueryWrapper from datastructures import EmptyResultSet, FullResultSet #...
fxtentacle/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/editchangelog.py
130
# Copyright (C) 2010 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 th...
VigTech/Vigtech-Services
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py
1005
#------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, free of charge, to any person # obtaining a copy ...
batmancn/MyLife
refs/heads/master
learn/demos/python_demo/core_python_programming_code/ch23/word.py
6
#!/usr/bin/env python from Tkinter import Tk from time import sleep from tkMessageBox import showwarning import win32com.client as win32 warn = lambda app: showwarning(app, 'Exit?') RANGE = range(3, 8) def word(): app = 'Word' word = win32.gencache.EnsureDispatch('%s.Application' % app) doc = word.Docume...
ess/dd-agent
refs/heads/master
checks.d/system_swap.py
34
# 3p import psutil # project from checks import AgentCheck class SystemSwap(AgentCheck): def check(self, instance): swap_mem = psutil.swap_memory() self.rate('system.swap.swapped_in', swap_mem.sin) self.rate('system.swap.swapped_out', swap_mem.sout)
jayme-github/CouchPotatoServer
refs/heads/master
libs/migrate/versioning/repository.py
62
""" SQLAlchemy migrate repository management. """ import os import shutil import string import logging from pkg_resources import resource_filename from tempita import Template as TempitaTemplate from migrate import exceptions from migrate.versioning import version, pathed, cfgparse from migrate.versioning.template...
thundernet8/WRGameVideos-API
refs/heads/master
venv/lib/python2.7/site-packages/httpie/input.py
6
"""Parsing and processing of CLI input (args, auth credentials, files, stdin). """ import os import sys import re import errno import mimetypes import getpass from io import BytesIO from collections import namedtuple, Iterable # noinspection PyCompatibility from argparse import ArgumentParser, ArgumentTypeError, Argum...
maginatics/swift
refs/heads/master
swift/common/middleware/list_endpoints.py
29
# Copyright (c) 2012 OpenStack Foundation # # 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 ...
proyectosdeley/proyectos_de_ley
refs/heads/master
proyectos_de_ley/pdl_scraper/spiders/expediente_spider.py
1
# -*- coding: utf-8 -*- import scrapy from pdl_scraper.items import ExpedienteItem from pdl_scraper.models import db_connect from pdl_scraper import settings class ExpedienteSpider(scrapy.Spider): name = "expediente" allowed_domains = ["www2.congreso.gob.pe"] def __init__(self, category=None, *args, **k...
franekp/ankidict
refs/heads/master
ankidict/thirdparty/io.py
17
"""The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no separation between reading and writing to streams; impl...
jasco/authomatic
refs/heads/master
tests/functional_tests/expected_values/windowslive.py
3
# -*- coding: utf-8 -*- import datetime import fixtures import constants from authomatic.providers import oauth2 conf = fixtures.get_configuration('windowslive') PICTURE = 'https://apis.live.net/v5.0/{0}/picture'.format(conf.user_id) CONFIG = { 'login_xpath': '//*[@id="i0116"]', 'password_xpath': '//*[@id=...
lukemerrett/BadgerNote
refs/heads/master
tests/__init__.py
1
__author__ = "Luke Merrett"
apporc/nova
refs/heads/master
nova/tests/unit/virt/xenapi/client/test_objects.py
80
# Copyright (c) 2014 Rackspace Hosting # 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 req...
PythonNut/servo
refs/heads/master
tests/wpt/mozilla/tests/mozilla/resources/no_mime_type.py
149
# 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/. def main(request, response): headers = [] if 'Content-Type' in request.GET: headers += [('Content-Type'...
flgiordano/netcash
refs/heads/master
+/google-cloud-sdk/lib/third_party/dns/rdtypes/__init__.py
250
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
yanheven/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/280_add_nullable_false_to_keypairs_name.py
4
# Copyright 2015 Intel Corporation # 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...
hydratk/hydratk
refs/heads/master
src/hydratk/translation/core/cs/__init__.py
242
from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
towerjoo/mindsbook
refs/heads/master
django/contrib/admin/options.py
12
from django import forms, template from django.forms.formsets import all_valid from django.forms.models import modelform_factory, modelformset_factory, inlineformset_factory from django.forms.models import BaseInlineFormSet from django.contrib.contenttypes.models import ContentType from django.contrib.admin import widg...
hantonov/ansible-modules-core
refs/heads/devel
cloud/vmware/vsphere_guest.py
34
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gwpy/gwpy.github.io
refs/heads/master
docs/0.7.5/api/gwpy-frequencyseries-FrequencySeries-1.py
78
x = np.array([-1.2, 1.2]) np.absolute(x) # array([ 1.2, 1.2]) np.absolute(1.2 + 1j) # 1.5620499351813308 # Plot the function over ``[-10, 10]``: import matplotlib.pyplot as plt x = np.linspace(start=-10, stop=10, num=101) plt.plot(x, np.absolute(x)) plt.show() # Plot the function over the complex plane: xx = x + ...
anguslees/kubernetes
refs/heads/master
examples/celery-rabbitmq/celery-app-add/run_tasks.py
31
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
thopiekar/Uranium
refs/heads/master
UM/FileHandler/ReadFileJob.py
1
# Copyright (c) 2016 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. from UM.Job import Job from UM.Application import Application from UM.Message import Message from UM.Math.Vector import Vector from UM.Preferences import Preferences from UM.Logger import Logger from UM.Mesh.MeshReader i...
metasoarous/csvkit
refs/heads/master
csvkit/utilities/csvclean.py
4
#!/usr/bin/env python from os.path import splitext from csvkit import CSVKitReader, CSVKitWriter from csvkit.cli import CSVKitUtility from csvkit.cleanup import RowChecker class CSVClean(CSVKitUtility): description = 'Fix common errors in a CSV file.' override_flags = ['H'] def add_arguments(self): ...
Mhynlo/SickRage
refs/heads/master
lib/unidecode/x0fb.py
252
data = ( 'ff', # 0x00 'fi', # 0x01 'fl', # 0x02 'ffi', # 0x03 'ffl', # 0x04 'st', # 0x05 'st', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]', ...
katharosada/bus-shaming
refs/heads/master
busshaming/migrations/0031_routedate_num_trips.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-01-21 11:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('busshaming', '0030_auto_20180121_1129'), ] operations = [ migrations.AddFie...
stormi/tsunami
refs/heads/master
src/primaires/interpreteur/masque/noeuds/embranchement.py
1
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # 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 # lis...
tempbottle/restcommander
refs/heads/master
play-1.2.4/python/Lib/struct.py
62
from _struct import * from _struct import _clearcache
chanchett/ds3_python_sdk_
refs/heads/master
tests/clientTests.py
1
# Copyright 2014-2015 Spectra Logic Corporation. 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. A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" ...
ruibarreira/linuxtrail
refs/heads/master
usr/lib/python2.7/wsgiref/handlers.py
137
"""Base classes for server/gateway implementations""" from types import StringType from util import FileWrapper, guess_scheme, is_hop_by_hop from headers import Headers import sys, os, time __all__ = ['BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler'] try: dict except NameError: def dict(items)...
AltSchool/django-allauth
refs/heads/master
allauth/account/__init__.py
14
default_app_config = 'allauth.account.apps.AccountConfig'
semonte/intellij-community
refs/heads/master
python/testData/refactoring/introduceVariable/suggestKeywordArgumentName.py
83
def foo(**kwargs): pass foo(extra_context=<caret>{'a': 1})
pepeportela/edx-platform
refs/heads/master
lms/djangoapps/branding/tests/test_page.py
1
""" Tests for branding page """ import datetime import ddt from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.test.client import RequestFactory from django.test.utils import override...
ojengwa/talk
refs/heads/master
venv/lib/python2.7/site-packages/pip/utils/__init__.py
61
from __future__ import absolute_import import contextlib import locale import logging import re import os import posixpath import shutil import stat import subprocess import sys import tarfile import zipfile from pip.exceptions import InstallationError, BadCommand from pip.compat import console_to_str, stdlib_pkgs fr...
tomtor/QGIS
refs/heads/master
python/plugins/processing/algs/gdal/polygonize.py
16
# -*- coding: utf-8 -*- """ *************************************************************************** polygonize.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************************...
amitsaha/python-web-app-recipes
refs/heads/master
middleware/flask/app4.py
1
# This is an example of implementing middleware via # decorators that Flask framework exposes namely: # # app.before_first_request # app.before_request # app.after_request # There are blueprint specific decorators as well, such as: # http://flask.pocoo.org/docs/0.12/api/#flask.Blueprint.before_request # which are usefu...
ixc/python-edtf
refs/heads/master
edtf/parser/__init__.py
2
from edtf.parser.grammar import parse_edtf from edtf.parser.parser_classes import *
hellotomfan/v8-coroutine
refs/heads/master
build/gyp/test/win/gyptest-macro-vcinstalldir.py
344
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure macro expansion of $(VCInstallDir) is handled, and specifically always / terminated for compatibility. """ import TestGyp im...