repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
GunoH/intellij-community
refs/heads/master
python/testData/formatter/indentAfterBackslash_after.py
79
foo = bar \ if bar is not None else None
40223142/2015cad0623
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/multiprocessing/util.py
696
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
omtinez/micropython
refs/heads/master
tools/gendoc.py
101
""" Generate documentation for pyboard API from C files. """ import os import argparse import re import markdown # given a list of (name,regex) pairs, find the first one that matches the given line def re_match_first(regexs, line): for name, regex in regexs: match = re.match(regex, line) if match:...
jayme-github/CouchPotatoServer
refs/heads/master
libs/sqlalchemy/dialects/maxdb/base.py
15
# maxdb/base.py # Copyright (C) 2005-2012 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 """Support for the MaxDB database. This dialect is *not* ported to SQLAlchemy 0.6 or 0....
cappatar/knesset-data-pipelines
refs/heads/master
datapackage_pipelines_knesset/committees/processors/parse_committee_meeting_protocols.py
4
from datapackage_pipelines_knesset.common.processors.base_processor import BaseProcessor from knesset_data.protocols.committee import CommitteeMeetingProtocol from knesset_data.protocols.exceptions import AntiwordException import os, csv, json, subprocess, logging, shutil, tempfile from datapackage_pipelines_knesset.co...
fangxingli/hue
refs/heads/master
desktop/core/ext-py/markdown/markdown/extensions/legacy.py
49
""" Legacy Extension for Python-Markdown ==================================== Replaces the core parser with the old one. """ import markdown, re from markdown import etree """Basic and reusable regular expressions.""" def wrapRe(raw_re) : return re.compile("^%s$" % raw_re, re.DOTALL) CORE_RE = { 'header': ...
Nicolas570/chris_db
refs/heads/master
components/faker/faker/providers/company/it_IT/__init__.py
19
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( '{{last_name}} {{company_suffix}}', '{{last_name}}-{{last_name}} {{company_suffix}}', '{{last_name}}, {{last_name}} e {{last_name}} {{company_suffi...
stenskjaer/scrapy
refs/heads/master
scrapy/core/__init__.py
216
""" Scrapy core library classes and functions. """
shaurz/ome
refs/heads/master
ome/emit.py
1
# ome - Object Message Expressions # Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk> import io from contextlib import contextmanager class CodeEmitter(object): def __init__(self, indent=' ' * 4, indent_level=0): self._output = [] self._indent = indent self._indent_level = indent...
goliveirab/odoo
refs/heads/8.0
addons/project_issue/res_config.py
441
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
FlavienCollomb/calligraphr-php
refs/heads/master
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
#Copyright (c) 2010 Fabien Potencier # #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, distrib...
Brocade-OpenSource/OpenStack-DNRM-Nova
refs/heads/master
nova/tests/cert/test_rpcapi.py
6
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Red Hat, 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 # ...
shubhamgupta123/erpnext
refs/heads/master
erpnext/support/doctype/issue/issue.py
2
# 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 import json from frappe import _ from frappe.model.document import Document from frappe.utils import now from frappe.utils.user import is...
majintao0131/yaml-cpp.core
refs/heads/master
test/create-emitter-tests.py
87
import sys import yaml import hashlib DEFINE = 'YAML_GEN_TESTS' EVENT_COUNT = 5 def encode_stream(line): for c in line: if c == '\n': yield '\\n' elif c == '"': yield '\\"' elif c == '\t': yield '\\t' elif ord(c) < 0x20: yield '\\x' +...
xiechaopeng/tifi
refs/heads/master
dejavu/wavio.py
20
# wavio.py # Author: Warren Weckesser # License: BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) # Synopsis: A Python module for reading and writing 24 bit WAV files. # Github: github.com/WarrenWeckesser/wavio import wave as _wave import numpy as _np def _wav2array(nchannels, sampwidth, data): """data...
RyanSkraba/beam
refs/heads/master
sdks/python/apache_beam/runners/runner_test.py
1
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
vgonisanz/wpm
refs/heads/master
examples/buymenu_sample.py
1
import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src')) sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src/widgets')) import curses # Todo remove chaning own variables from curses import wrapper # Use my own wrapper from wpm import Wpm from menu import Menu ...
tiborsimon/projects
refs/heads/master
projects/gui/gui.py
1
import pydoc import urwid from projects.gui import doc_generator from projects.gui.project_selector import ProjectSelector def select_project(project_list, path_callback): max_width = len(max(project_list, key=len)) f = ProjectSelector(project_list, 'normal', 'highlighted', 'selected') def refresh_list...
wimac/home
refs/heads/master
Dropbox/skel/bin/sick-beard/lib/hachoir_parser/misc/pdf.py
90
""" Adobe Portable Document Format (PDF) parser. Author: Christophe Gisquet <christophe.gisquet@free.fr> """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import ( Field, FieldSet, ParserError, GenericVector, UInt8, UInt16, UInt32, String, RawBytes) from lib.hachoir_core.en...
hpcloud/docker-registry
refs/heads/master
lib/storage/swift.py
8
import cache_lru import swiftclient from . import Storage class SwiftStorage(Storage): def __init__(self, config): self._swift_connection = self._create_swift_connection(config) self._swift_container = config.swift_container self._root_path = config.get('storage_path', '/') def _cr...
PongPi/isl-odoo
refs/heads/8.0
addons/document/content_index.py
430
# -*- 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...
structRecomputation/computations
refs/heads/master
_modules/auxiliary_monte.py
1
import numpy as np def write_monte(spec, rslt): """ Write out results to table. """ num_evals = rslt['num_evals'] num_steps = rslt['num_steps'] points = rslt['points'] stat = rslt['rmse'] # Write out information. fname = 'table_4.' + str(spec + 1) + '.txt' with open(fname, 'w') as...
emadehsan/ieighteen
refs/heads/master
translate.py
1
''' @author Emad Ehsan 1. Picks up a line from sourceLang file, e.g. './en/strings.txt' 2. Request google to translate the query 3. Creates a file for targetLang, e.g. './ur/strings.txt' 4. Places translation at exact line number to targetLang file ''' from html.parser import HTMLParser import req...
bytor99999/vertx-web
refs/heads/master
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/setuptools/tests/test_resources.py
345
#!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove import os import sys import tempfile import shutil from unittest import TestCase import pkg_resources from pkg_resources import (parse_requirements, VersionConflict, parse_version, Distribution...
edisonlz/fruit
refs/heads/master
web_project/base/site-packages/django/db/backends/sqlite3/introspection.py
114
import re from django.db.backends import BaseDatabaseIntrospection, FieldInfo field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$') def get_field_size(name): """ Extract the size number from a "varchar(11)" type name """ m = field_size_re.search(name) return int(m.group(1)) if m else None ...
Edu-Glez/Bank_sentiment_analysis
refs/heads/master
env/lib/python3.6/site-packages/pip/_vendor/webencodings/x_user_defined.py
341
# coding: utf8 """ webencodings.x_user_defined ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the x-user-defined encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals import codecs ### Codec APIs class Codec...
shhui/nova
refs/heads/master
nova/tests/scheduler/test_filter_scheduler.py
2
# 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...
feigames/Odoo
refs/heads/master
addons/web/tests/__init__.py
54
# -*- coding: utf-8 -*- import test_js # import test_menu import test_serving_base
DepthDeluxe/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/jboss.py
21
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be> # # 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 th...
teemulehtinen/a-plus
refs/heads/master
selenium_test/test/teacher_feedback_test.py
3
import unittest from test_initializer import TestInitializer from page_objects import LoginPage, FileUploadGrader, AssessmentPage, SubmissionPage, HomePage, StudentFeedbackPage class TeacherFeedbackTest(unittest.TestCase): def setUp(self): self.driver = TestInitializer().getDefaultDriver() TestIn...
gregdek/ansible
refs/heads/devel
lib/ansible/modules/system/mksysb.py
52
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Kairo Araujo <kairo@kairo.eti.br> # 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...
Lilywei123/tempest
refs/heads/master
tempest/tests/test_wrappers.py
11
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
danilito19/django
refs/heads/master
tests/test_utils/views.py
481
from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.template import Context, Template from .models import Person def get_person(request, pk): person = get_object_or_404(Person, pk=pk) return HttpResponse(person.name) def no_template_used(request): template = ...
shubhdev/edx-platform
refs/heads/master
common/test/acceptance/pages/studio/video/video.py
58
""" CMS Video """ import time import os import requests from bok_choy.promise import EmptyPromise, Promise from bok_choy.javascript import wait_for_js, js_defined from ....tests.helpers import YouTubeStubConfig from ...lms.video.video import VideoPage from selenium.webdriver.common.keys import Keys from ..utils import ...
Shao-Feng/crosswalk-test-suite
refs/heads/master
webapi/tct-csp-w3c-tests/csp-py/csp_script-src_unsafe-inline_unsafe-eval.py
30
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "script-src 'self' 'un...
ContinuumIO/odo
refs/heads/master
odo/backends/tests/test_ssh.py
4
from __future__ import absolute_import, division, print_function import pytest paramiko = pytest.importorskip('paramiko') import pandas as pd import numpy as np import re import os import sys from odo.utils import tmpfile, filetext from odo.directory import _Directory, Directory from odo.backends.ssh import SSH, res...
anfedorov/atom-script
refs/heads/master
examples/version_info.py
18
#!/usr/bin/env python2.7 import sys print(sys.version_info)
damonkohler/sl4a
refs/heads/master
python/gdata/src/gdata/tlslite/utils/OpenSSL_TripleDES.py
359
"""OpenSSL/M2Crypto 3DES implementation.""" from cryptomath import * from TripleDES import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_TripleDES(key, mode, IV) class OpenSSL_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mo...
bigswitch/neutron
refs/heads/master
neutron/tests/unit/agent/metadata/test_agent.py
1
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
pixelrebel/st2
refs/heads/master
st2common/tests/unit/test_util_mistral_dsl_transform.py
7
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
Davideddu/kivy-forkedtouch
refs/heads/master
kivy/core/video/video_null.py
81
''' VideoNull: empty implementation of VideoBase for the no provider case ''' from kivy.core.video import VideoBase class VideoNull(VideoBase): '''VideoBase implementation when there is no provider. ''' pass
LUTAN/tensorflow
refs/heads/master
tensorflow/contrib/bayesflow/python/ops/stochastic_tensor.py
81
# 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...
jsilhan/dnf
refs/heads/master
dnf/cli/commands/upgrade.py
1
# upgrade.py # Upgrade CLI command. # # Copyright (C) 2014-2016 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is...
willprice/weboob
refs/heads/master
modules/ilmatieteenlaitos/pages.py
5
# -*- coding: utf-8 -*- # Copyright(C) 2015 Matthieu Weber # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
dkodnik/Ant
refs/heads/master
addons/account_analytic_analysis/res_config.py
426
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
Sodki/ansible-modules-extras
refs/heads/devel
monitoring/pagerduty.py
132
#!/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. ...
margaritis/iTerm2
refs/heads/master
tools/ply/ply-3.4/test/lex_rule2.py
174
# lex_rule2.py # # Rule function with incorrect number of arguments import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.lex as lex tokens = [ "PLUS", "MINUS", "NUMBER", ] t_PLUS = r'\+' t_MINUS = r'-' def t_NUMBER(): r'\d+' return t def t_error(t): pass lex.lex() ...
JamesClough/networkx
refs/heads/inverse_line_graph
networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py
7
#!/usr/bin/env python from nose.tools import * from nose import SkipTest import networkx as nx from nose.plugins.attrib import attr from networkx import edge_current_flow_betweenness_centrality \ as edge_current_flow from networkx import edge_current_flow_betweenness_centrality_subset \ as edge_current_flow_s...
numba/numba
refs/heads/master
numba/misc/help/inspector.py
4
""" This file contains `__main__` so that it can be run as a commandline tool. This file contains functions to inspect Numba's support for a given Python module or a Python package. """ import argparse import pkgutil import warnings import types as pytypes from numba.core import errors from numba._version import get...
hydralabs/pyamf
refs/heads/master
doc/tutorials/examples/gateways/appengine/demo/simplejson/__init__.py
10
r""" A simple, fast, extensible JSON encoder and decoder JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. simplejson exposes an API familiar to uses of the standard library marshal and pickle modules. Encoding b...
z2care/sample-code-in-the-cloud
refs/heads/master
secure-chat/tchat.py
1
import webapp2 from google.appengine.api import users from google.appengine.ext import db import datetime import os from google.appengine.ext.webapp import template #START: ChatMessage class ChatMessage(db.Model): user = db.StringProperty(required=True) timestamp = db.DateTimeProperty(auto_now_add=True) m...
ericpre/hyperspy
refs/heads/RELEASE_next_minor
hyperspy/tests/io/test_bruker.py
2
import json import os import numpy as np import pytest from hyperspy import signals from hyperspy.io import load from hyperspy.misc.test_utils import assert_deep_almost_equal test_files = ['30x30_instructively_packed_16bit_compressed.bcf', '16x16_12bit_packed_8bit.bcf', 'P45_the_default_j...
ksrajkumar/openerp-6.1
refs/heads/master
openerp/pychart/afm/Courier_Oblique.py
15
# -*- coding: utf-8 -*- # AFM font Courier-Oblique (path: /usr/share/fonts/afms/adobe/pcrro8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. import dir dir.afm["Courier-Oblique"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 50...
40223246/0622W17test2
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/browser/indexed_db.py
632
class EventListener: def __init__(self, events=[]): self._events=events def append(self, event): self._events.append(event) def fire(self, e): for _event in self._events: _event(e) class IndexedDB: def __init__(self): if not __BRYTHON__.has_indexedDB: raise NotImple...
jruiperezv/ANALYSE
refs/heads/master
common/djangoapps/enrollment/urls.py
8
""" URLs for the Enrollment API """ from django.conf import settings from django.conf.urls import patterns, url from .views import get_course_enrollment, list_student_enrollments urlpatterns = [] if settings.FEATURES.get('ENABLE_COMBINED_LOGIN_REGISTRATION'): urlpatterns += patterns( 'enrollment.views',...
NobleNoob/buildpack
refs/heads/master
lib/build_pack_utils/cloudfoundry.py
12
import os import sys import json import tempfile import shutil import utils import logging from urlparse import urlparse from zips import UnzipUtil from hashes import HashUtil from cache import DirectoryCacheManager from downloads import Downloader from downloads import CurlDownloader from utils import safe_makedirs ...
brendangregg/bcc
refs/heads/master
tools/tcpsubnet.py
4
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # tcpsubnet Summarize TCP bytes sent to different subnets. # For Linux, uses BCC, eBPF. Embedded C. # # USAGE: tcpsubnet [-h] [-v] [-J] [-f FORMAT] [-i INTERVAL] [subnets] # # This uses dynamic tracing of kernel functions, and will need to b...
postlund/home-assistant
refs/heads/dev
homeassistant/components/opentherm_gw/__init__.py
3
"""Support for OpenTherm Gateway devices.""" import asyncio from datetime import date, datetime import logging import pyotgw import pyotgw.vars as gw_vars import voluptuous as vol from homeassistant.components.binary_sensor import DOMAIN as COMP_BINARY_SENSOR from homeassistant.components.climate import DOMAIN as COM...
sunlianqiang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/leakers/test_selftype.py
195
# Reference cycles involving only the ob_type field are rather uncommon # but possible. Inspired by SF bug 1469629. import gc def leak(): class T(type): pass class U(type, metaclass=T): pass U.__class__ = U del U gc.collect(); gc.collect(); gc.collect()
Grogdor/CouchPotatoServer
refs/heads/master
libs/dateutil/__init__.py
147
# -*- coding: utf-8 -*- """ Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard Python datetime module. """ __author__ = "Tomi Pieviläinen <tomi.pievilainen@iki.fi>" __license__ = "Simplified BSD" __version__ = "2.1"
collmot/ardupilot
refs/heads/master
Tools/scripts/build_binaries_history.py
18
#!/usr/bin/env python from __future__ import print_function import os import sqlite3 class BuildBinariesHistory(): def __init__(self, db_filepath): self.db_filepath = db_filepath self.assure_db_present() def progress(self, msg): print("BBHIST: %s" % msg) def conn(self): ...
gerv/bedrock
refs/heads/master
tests/functional/firefox/desktop/test_all.py
1
# 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 pytest from pages.firefox.desktop.all import FirefoxDesktopBasePage @pytest.mark.skip_if_firefox(reason='Downl...
kerr-huang/SL4A
refs/heads/master
python/src/Lib/glob.py
173
"""Filename globbing utility.""" import sys import os import re import fnmatch __all__ = ["glob", "iglob"] def glob(pathname): """Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. """ return list(iglob(pathname)) def iglob(pathna...
rasata/ansible
refs/heads/devel
lib/ansible/executor/task_queue_manager.py
9
# (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...
yumaokao/gdrv
refs/heads/master
gdrv/commands/command_base.py
1
#!/usr/bin/python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai import os import sys import logging import fnmatch import httplib2 from apiclient import errors from apiclient.discovery import build from oauth2client.file import Storage lg = logging.getLogger("BASE") # lg.setLevel(logging.INFO) class DriveComman...
Ahn1/Clinq
refs/heads/master
web/clinq/management/commands/updateindex.py
1
import os import clinq.models as model from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.conf import settings import clinq.management.commands.tagHandler as handler class Command(BaseCommand): #option_list = BaseCommand.option_list + ( # make_option('--...
bqbn/addons-server
refs/heads/master
src/olympia/addons/api_urls.py
1
from django.conf.urls import include, url from rest_framework.routers import SimpleRouter from rest_framework_nested.routers import NestedSimpleRouter from olympia.activity.views import VersionReviewNotesViewSet from .views import ( AddonAutoCompleteSearchView, AddonFeaturedView, AddonRecommendationView, Add...
Dubrzr/django-push-notifications
refs/heads/master
tests/test_models.py
14
import json import mock from django.test import TestCase from django.utils import timezone from push_notifications.models import GCMDevice, APNSDevice from tests.mock_responses import GCM_PLAIN_RESPONSE, \ GCM_MULTIPLE_JSON_RESPONSE, GCM_PLAIN_RESPONSE_ERROR, \ GCM_JSON_RESPONSE_ERROR, GCM_PLAIN_RESPONSE_ERROR_...
kthordarson/youtube-dl-ruv
refs/heads/master
youtube_dl/extractor/comedycentral.py
3
from __future__ import unicode_literals import re from .common import InfoExtractor from .mtv import MTVServicesInfoExtractor from ..utils import ( compat_str, compat_urllib_parse, ExtractorError, float_or_none, unified_strdate, ) class ComedyCentralIE(MTVServicesInfoExtractor): _VALID_URL =...
MaizerGomes/youtube-dl
refs/heads/master
youtube_dl/extractor/collegerama.py
111
from __future__ import unicode_literals import json from .common import InfoExtractor from ..compat import compat_urllib_request from ..utils import ( float_or_none, int_or_none, ) class CollegeRamaIE(InfoExtractor): _VALID_URL = r'https?://collegerama\.tudelft\.nl/Mediasite/Play/(?P<id>[\da-f]+)' _...
DVSBA/ajenti
refs/heads/master
ajenti/feedback.py
17
""" Module for sending usage statistics to ajenti.org """ __all__ = ['send_stats', 'check_uid'] import os import base64 import random from ajenti.utils import * from ajenti import version global uid uid = '' def send_stats(server, plugins, addplugin=None, delplugin=None): """ Sends usage statistics to th...
tshirtman/zine_ad_sense
refs/heads/master
__init__.py
1
# -*- coding: utf-8 -*- """ zine.plugins.ad_sense ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by gabriel pettier :license: GPL, see LICENSE for more details. """ from os.path import dirname, join from random import choice from zine.api import * from zine.views.admin import render_admin_response fr...
jonyroda97/redbot-amigosprovaveis
refs/heads/develop
lib/pip/_vendor/urllib3/contrib/socks.py
65
# -*- coding: utf-8 -*- """ This module contains provisional support for SOCKS proxies from within urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and SOCKS5. To enable its functionality, either install PySocks or install this module with the ``socks`` extra. The SOCKS implementation supports t...
acshan/odoo
refs/heads/8.0
addons/google_calendar/google_calendar.py
59
# -*- coding: utf-8 -*- import operator import simplejson import urllib2 import openerp from openerp import tools from openerp import SUPERUSER_ID from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, exception_to_unicode from openerp.tools.translate import _ from openerp.http import ...
dfalt974/SickRage
refs/heads/master
lib/html5lib/_trie/_base.py
79
from __future__ import absolute_import, division, unicode_literals from collections import Mapping class Trie(Mapping): """Abstract base class for tries""" def keys(self, prefix=None): # pylint:disable=arguments-differ keys = super(Trie, self).keys() if prefix is None: r...
edisonlz/fruit
refs/heads/master
web_project/base/site-packages/grappelli/__init__.py
1
VERSION = '2.3.6'
ULHPC/modules
refs/heads/devel
easybuild/easybuild-easyblocks/easybuild/easyblocks/m/metavelvet.py
12
## # This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild # # Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste # License:: MIT/GPL # $Id$ # # This work implements a part of the HPCBIOS project ...
igorg1312/googlepythonsskeleton
refs/heads/master
lib/jinja2/loaders.py
333
# -*- coding: utf-8 -*- """ jinja2.loaders ~~~~~~~~~~~~~~ Jinja loader classes. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import weakref from types import ModuleType from os import path from hashlib import sha1 from jinja2.excepti...
ArduPilot/MAVProxy
refs/heads/master
MAVProxy/modules/mavproxy_mode.py
3
#!/usr/bin/env python '''mode command handling''' import time, os from pymavlink import mavutil from MAVProxy.modules.lib import mp_module class ModeModule(mp_module.MPModule): def __init__(self, mpstate): super(ModeModule, self).__init__(mpstate, "mode", public=True) self.add_command('mode', sel...
drxos/python-social-auth
refs/heads/master
social/tests/test_utils.py
73
import sys import unittest2 as unittest from mock import Mock from social.utils import sanitize_redirect, user_is_authenticated, \ user_is_active, slugify, build_absolute_uri, \ partial_pipeline_data PY3 = sys.version_info[0] == 3 class SanitizeRedirectTest(unitte...
kstrauser/ansible
refs/heads/devel
lib/ansible/plugins/shell/__init__.py
7690
# (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...
MungoRae/home-assistant
refs/heads/dev
homeassistant/components/remote/itach.py
3
""" Support for iTach IR Devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/remote.itach/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv import homeassistant.components.remote as remote from homea...
Yichuans/ccv
refs/heads/master
languages/hu.py
162
# coding: utf8 { '!langcode!': 'hu', '!langname!': 'Magyar', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%s %%{row} deleted': '%s s...
sjerdo/letsencrypt
refs/heads/master
letsencrypt/plugins/webroot_test.py
2
"""Tests for letsencrypt.plugins.webroot.""" import os import shutil import tempfile import unittest import mock from acme import challenges from acme import jose from letsencrypt import achallenges from letsencrypt import errors from letsencrypt.tests import acme_util from letsencrypt.tests import test_util KEY ...
ddepaoli3/magnum
refs/heads/master
magnum/__init__.py
19
# 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...
chvalean/lis-test
refs/heads/master
WS2012R2/lisa/tools/middleware_bench/utils/setup.py
7
""" Linux on Hyper-V and Azure Test Code, ver. 1.0.0 Copyright (c) Microsoft 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/LICEN...
jalavik/inspire-next
refs/heads/master
inspire/testsuite/test_export.py
2
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2015 CERN. # # INSPIRE 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...
p0psicles/SickRage
refs/heads/master
lib/feedparser/util.py
36
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistrib...
VielSoft/odoo
refs/heads/8.0
addons/l10n_ar/__openerp__.py
260
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agiliq/django
refs/heads/master
django/conf/locale/fr/formats.py
116
# -*- 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' DATETI...
sonium0/pymatgen
refs/heads/master
pymatgen/alchemy/materials.py
1
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals """ This module provides various representations of transformed structures. A TransformedStructure is a structure that has been modified by undergoing a series of transf...
openiitbombayx/edx-platform
refs/heads/master
lms/djangoapps/lms_xblock/admin.py
173
""" Django admin dashboard configuration for LMS XBlock infrastructure. """ from django.contrib import admin from config_models.admin import ConfigurationModelAdmin from lms.djangoapps.lms_xblock.models import XBlockAsidesConfig admin.site.register(XBlockAsidesConfig, ConfigurationModelAdmin)
cw0100/cwse
refs/heads/master
nodejs/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
899
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
lexyan/SickBeard
refs/heads/master
lib/hachoir_core/field/timestamp.py
90
from lib.hachoir_core.tools import (humanDatetime, humanDuration, timestampUNIX, timestampMac32, timestampUUID60, timestampWin64, durationWin64) from lib.hachoir_core.field import Bits, FieldSet from datetime import datetime class GenericTimestamp(Bits): def __init__(self, parent, name, size, description=N...
frouty/odoo_oph
refs/heads/dev_70
addons/web_hello/__openerp__.py
69
{ 'name': 'Hello', 'category': 'Hidden', 'description':""" OpenERP Web example module. =========================== """, 'version': '2.0', 'depends': [], 'js': ['static/*/*.js', 'static/*/js/*.js'], 'css': [], 'auto_install': False, 'web_preload': False, }
zdary/intellij-community
refs/heads/master
python/testData/copyPaste/singleLine/Indent12.dst.py
664
class C: def foo(self): <caret> y = 2
acabey/acabey.github.io
refs/heads/master
projects/demos/engineering.purdue.edu/scriptingwithobjects/swocode/chap10/KeyError.py
1
#!/usr/local/bin/python # KeyError.py x = {'a' : 1, 'b' : 2} #(A) print x['a'] # 1 #(B) print x['b'] # 2 #(C) print x['c'] # KeyError: 'c' ...
psav/cfme_tests
refs/heads/master
cfme/utils/net.py
2
from collections import defaultdict import socket import os import re from cfme.fixtures.pytest_store import store from cfme.utils.log import logger _ports = defaultdict(dict) _dns_cache = {} ip_address = re.compile( r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}" r"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")...
NewPresident1/kitsune
refs/heads/master
kitsune/questions/tests/test_utils.py
16
from nose.tools import eq_ from kitsune.questions.models import Question, Answer from kitsune.questions.tests import question, answer from kitsune.questions.utils import ( num_questions, num_answers, num_solutions, mark_content_as_spam) from kitsune.sumo.tests import TestCase from kitsune.users.tests import user ...
brainelectronics/towerdefense
refs/heads/master
examples/pyglet/image/codecs/quicktime.py
43
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...