repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
neumerance/deploy
refs/heads/master
.venv/lib/python2.7/site-packages/django/core/context_processors.py
232
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from __future__ i...
makinacorpus/odoo
refs/heads/8.0
addons/sale_service/__openerp__.py
260
# -*- 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...
NeovaHealth/odoo
refs/heads/8.0
addons/sale_crm/wizard/crm_make_sale.py
223
# -*- 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...
Vogeltak/pauselan
refs/heads/master
lib/python3.4/site-packages/sqlalchemy/orm/evaluator.py
60
# orm/evaluator.py # Copyright (C) 2005-2015 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 import operator from ..sql import operators class UnevaluatableError(Exception): ...
NeCTAR-RC/murano
refs/heads/master
murano/api/v1/services.py
3
# Copyright (c) 2013 Mirantis, 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...
epssy/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/contrib/sites/managers.py
118
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
jasonwee/asus-rt-n14uhp-mrtg
refs/heads/master
tmp/ve_asus-rt-n14uhp-mrtg/lib/python3.4/site-packages/django/contrib/gis/geos/error.py
508
class GEOSException(Exception): "The base GEOS exception, indicates a GEOS-related error." pass
tdautc19841202/micropython
refs/heads/master
tests/basics/set_binop.py
22
sets = [set(), {1}, {1, 2}, {1, 2, 3}, {2, 3}, {2, 3, 5}, {5}, {7}] for s in sets: for t in sets: print(sorted(s), '|', sorted(t), '=', sorted(s | t)) print(sorted(s), '^', sorted(t), '=', sorted(s ^ t)) print(sorted(s), '&', sorted(t), '=', sorted(s & t)) print(sorted(s), '-', sorte...
michigraber/scikit-learn
refs/heads/master
sklearn/externals/joblib/func_inspect.py
239
""" My own variation on function-specific inspect-like features. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from itertools import islice import inspect import warnings import re import os from ._compat import _basestrin...
rch/flask-extdirect
refs/heads/master
flask_sencha/touch.py
12133432
meletakis/collato
refs/heads/master
lib/python2.7/site-packages/django/contrib/sessions/__init__.py
12133432
atopuzov/nitro-python
refs/heads/master
nssrc/com/citrix/netscaler/nitro/resource/config/network/vlan_interface_binding.py
3
# # Copyright (c) 2008-2015 Citrix Systems, 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...
jordiclariana/ansible
refs/heads/devel
hacking/get_library.py
216
#!/usr/bin/env python # (c) 2014, Will Thames <will@thames.id.au> # # 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 op...
coder-han/hugula
refs/heads/master
Client/tools/site-packages/xlwt/Cell.py
87
# -*- coding: windows-1252 -*- from struct import unpack, pack import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = sst...
miniconfig/python-plexapi
refs/heads/master
plexapi/myplex.py
5
""" PlexAPI MyPlex """ import plexapi, requests from plexapi import TIMEOUT, log from plexapi.exceptions import BadRequest, NotFound, Unauthorized from plexapi.utils import cast, toDatetime from requests.status_codes import _codes as codes from threading import Thread from xml.etree import ElementTree class MyPlexUse...
paulmartel/voltdb
refs/heads/master
tests/testrunner-ng/testsupport/runner.py
1
# This file is part of VoltDB. # Copyright (C) 2008-2016 VoltDB Inc. # # 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, c...
youdonghai/intellij-community
refs/heads/master
python/testData/formatter/blanksBetweenImportsPreservedWithoutOptimizeImports_after.py
86
import os import uuid from django.db import models from django.utils.translation import ugettext_lazy as _ from project import something print(something, _, models, os, uuid)
dionysius07/flame-detection
refs/heads/master
flameDetect3.py
1
from picamera import PiCamera from picamera.array import PiRGBArray from time import sleep import cv2 import numpy as np # Camera Setup: cam = PiCamera() cam.resolution = (320,240) cam.framerate = 32 raw = PiRGBArray(cam) # Camera Warmup: sleep(0.1) for frame in cam.capture_continuous(raw,format='bgr'...
scanon/narrative
refs/heads/master
src/biokbase/narrative/common/util.py
4
""" Utility functions for dealing with KBase services, etc. """ __author__ = 'Dan Gunter <dkgunter@lbl.gov>' __date__ = '1/6/14' import json import os import re import requests from setuptools import Command import time from .kvp import KVP_EXPR, parse_kvp from biokbase.workspace.client import Workspace as WS2 from bi...
scottpurdy/nupic
refs/heads/master
examples/opf/experiments/spatial_classification/category_1/description.py
10
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
sojo21/ToughRADIUS
refs/heads/master
toughradius/tools/__init__.py
12133432
hpcloud-mon/tempest
refs/heads/master
tempest/stress/actions/__init__.py
12133432
bdelliott/wordgame
refs/heads/master
web/django/conf/locale/id/__init__.py
12133432
zzzeek/sqlalchemy
refs/heads/master
lib/sqlalchemy/ext/instrumentation.py
3
"""Extensible class instrumentation. The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate systems of class instrumentation within the ORM. Class instrumentation refers to how the ORM places attributes on the class which maintain data and track changes to that data, as well as event hooks installed...
Maximilian-Reuter/SickRage
refs/heads/master
lib/tornado/test/resolve_test_helper.py
188
from __future__ import absolute_import, division, print_function, with_statement from tornado.ioloop import IOLoop from tornado.netutil import ThreadedResolver from tornado.util import u # When this module is imported, it runs getaddrinfo on a thread. Since # the hostname is unicode, getaddrinfo attempts to import enc...
eahneahn/free
refs/heads/master
lib/python2.7/site-packages/django/contrib/formtools/wizard/views.py
30
import re from django import forms from django.shortcuts import redirect from django.core.urlresolvers import reverse from django.forms import formsets, ValidationError from django.views.generic import TemplateView from django.utils.datastructures import SortedDict from django.utils.decorators import classonlymethod f...
vmindru/ansible
refs/heads/devel
test/units/cli/test_playbook.py
29
# (c) 2016, Adrian Likins <alikins@redhat.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 later vers...
suutari-ai/shoop
refs/heads/master
shuup_tests/xtheme/test_theme_selection.py
3
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from contextlib import contextmanager import pytest from django....
naousse/odoo
refs/heads/8.0
addons/account_bank_statement_extensions/report/__init__.py
415
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # i...
ZLLab-Mooc/edx-platform
refs/heads/named-release/dogwood.rc
common/lib/xmodule/xmodule/contentstore/__init__.py
12133432
Petrole/MaturePyRobots
refs/heads/master
WebPyRobot/backend/__init__.py
12133432
rohinkumar/galsurveystudy
refs/heads/master
APTest/setupaptestdt.py
2
from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension setup(name="APzdtheta", ext_modules=cythonize('aptestmetricdt.pyx'),) #ext_modules=[Extension("demo",sources=["demo.pyx"],libraries=["m"] # Unix-like specific)] #setup( name = "Demos",ext_modules = cythonize(...
larrybradley/astropy
refs/heads/remote-tests
astropy/timeseries/periodograms/lombscargle/implementations/tests/test_utils.py
5
import pytest import numpy as np from numpy.testing import assert_allclose, assert_equal from astropy.timeseries.periodograms.lombscargle.implementations.utils import extirpolate, bitceil, trig_sum @pytest.mark.parametrize('N', 2 ** np.arange(1, 12)) @pytest.mark.parametrize('offset', [-1, 0, 1]) def test_bitceil(N...
espenhgn/iCSD
refs/heads/master
test_icsd.py
1
# -*- coding: utf-8 -*- '''icsd testing suite''' import os import numpy as np import numpy.testing as nt import quantities as pq import scipy.integrate as si from scipy.interpolate import interp1d import icsd import unittest #patch quantities with the SI unit Siemens if it does not exist for symbol, prefix, definitio...
leorochael/odoo
refs/heads/8.0
addons/crm_helpdesk/__init__.py
442
# -*- 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...
smarter-travel-media/warthog
refs/heads/master
test/test_cli.py
1
# -*- coding: utf-8 -*- from click.testing import CliRunner import pytest import click import requests import warthog.cli import warthog.exceptions def test_main_no_command(): runner = CliRunner() result = runner.invoke(warthog.cli.main) assert 0 == result.exit_code, "Expected zero exit code" def te...
jayme-github/headphones
refs/heads/master
lib/cherrypy/_cpserver.py
58
"""Manage HTTP servers with CherryPy.""" import warnings import cherrypy from cherrypy.lib import attributes from cherrypy._cpcompat import basestring, py3k # We import * because we want to export check_port # et al as attributes of this module. from cherrypy.process.servers import * class Server(ServerAdapter): ...
msumit/qds-sdk-py
refs/heads/master
tests/test_role.py
6
import sys import os if sys.version_info > (2, 7, 0): import unittest else: import unittest2 as unittest from mock import * sys.path.append(os.path.join(os.path.dirname(__file__), '../bin')) import qds from qds_sdk.connection import Connection from test_base import print_command from test_base import QdsCliTe...
michalliu/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/host/lib/python3.4/test/test_bz2.py
8
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO import os import pickle import random import subprocess import sys from test.support import unlink try: import threading except ImportError: threading = None # Skip tests if the bz2 module doesn't exist. ...
huaxz1986/git_book
refs/heads/master
chapters/PreProcessing/onehot_encode.py
1
# -*- coding: utf-8 -*- """ 数据预处理 ~~~~~~~~~~~~~~~~ 独热码编码 :copyright: (c) 2016 by the huaxz1986. :license: lgpl-3.0, see LICENSE for more details. """ from sklearn.preprocessing import OneHotEncoder def test_OneHotEncoder(): ''' 测试 OneHotEncoder 的用法 :return: None ''' X=[ [1,...
yongshengwang/builthue
refs/heads/master
desktop/core/ext-py/Pygments-1.3.1/pygments/__init__.py
56
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
SuperDARNCanada/placeholderOS
refs/heads/master
experiments/testing_archive/test_txbw_not_divisible.py
2
#!/usr/bin/python # write an experiment that raises an exception import sys import os BOREALISPATH = os.environ['BOREALISPATH'] sys.path.append(BOREALISPATH) import experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype from utils.experiment_options.expe...
djbaldey/django
refs/heads/master
tests/utils_tests/test_autoreload.py
139
import os import tempfile from importlib import import_module from django import conf from django.contrib import admin from django.test import SimpleTestCase, override_settings from django.test.utils import extend_sys_path from django.utils._os import npath, upath from django.utils.autoreload import gen_filenames LOC...
wemanuel/smry
refs/heads/master
server-auth/ls/google-cloud-sdk/lib/requests/sessions.py
156
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
was4444/chromium.src
refs/heads/nw15
content/test/gpu/gpu_tests/webgl_conformance_expectations.py
1
# Copyright (c) 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. import os from gpu_tests.gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class WebGLConformance...
richardtran415/pymatgen
refs/heads/master
pymatgen/core/tests/test_trajectory.py
4
import os import numpy as np from pymatgen.core.lattice import Lattice from pymatgen.core.structure import Structure from pymatgen.core.trajectory import Trajectory from pymatgen.io.vasp.inputs import Poscar from pymatgen.io.vasp.outputs import Xdatcar from pymatgen.util.testing import PymatgenTest class Trajectory...
aidanlister/django
refs/heads/master
django/conf/locale/ml/__init__.py
12133432
zigdon/evelink
refs/heads/master
tests/__init__.py
12133432
guidosarducci/plugin.video.youtube
refs/heads/master
resources/lib/kodion/simple_requests/__init__.py
35
__author__ = 'bromix' __ALL__ = ['get', 'post', 'put', 'delete', 'head', 'codes'] from .constants import codes from api import get, post, put, delete, head
luhn/AutobahnPython
refs/heads/master
examples/twisted/wamp/basic/rpc/slowsquare/frontend.py
3
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
enoposix/mpv
refs/heads/master
waftools/dependencies.py
13
from waflib.Errors import ConfigurationError, WafError from waflib.Configure import conf from waflib.Build import BuildContext from waflib.Logs import pprint import inflector class DependencyError(Exception): pass class Dependency(object): def __init__(self, ctx, known_deps, satisfied_deps, dependency): ...
meghana1995/sympy
refs/heads/master
sympy/liealgebras/root_system.py
4
# -*- coding: utf-8 -*- from .cartan_type import CartanType from sympy.core import Basic from sympy.core.compatibility import range class RootSystem(Basic): """ Every simple Lie algebra has a unique root system. To find the root system, we first consider the Cartan subalgebra of g, which is the maxim...
benschneider/dephasing_ringdown_sim
refs/heads/master
fit_to_data.py
1
""" Created on Tue May 6 17:54:15 2014 @author: benschneider structure of this code: 1st. load simulated data with the fixed Qs and different Qrs. (simulated data set needs to have the same time/point ratio as the measured data) load measured data with known Qs and unknown Qr 2nd. for each (Qr) in simulated data a...
double-y/django
refs/heads/master
tests/forms_tests/tests/tests.py
61
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass from d...
xtmhm2000/scrapy-0.22
refs/heads/master
scrapy/contrib/memdebug.py
11
""" MemoryDebugger extension See documentation in docs/topics/extensions.rst """ import gc from scrapy import signals from scrapy.exceptions import NotConfigured from scrapy.utils.trackref import live_refs class MemoryDebugger(object): def __init__(self, stats): self.stats = stats @classmethod ...
rtucker-mozilla/mozpackager
refs/heads/master
vendor-local/lib/python/amqp/basic_message.py
12
"""Messages for AMQP""" # Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option)...
mirokuratczyk/psiphon-tunnel-core
refs/heads/master
vendor/github.com/redjack/marionette/third_party/re2/re2/testing/unicode_test.py
325
#!/usr/bin/python2.4 # # Copyright 2008 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Unittest for the util/regexp/re2/unicode.py module.""" import os import StringIO from google3.pyglib import flags from google3.testing...
michaelmior/cassandra
refs/heads/cassandra-2.2
pylib/cqlshlib/test/run_cqlsh.py
84
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
leoliujie/odoo
refs/heads/8.0
addons/website_mail_group/models/mail_group.py
321
# -*- coding: utf-8 -*- from openerp.osv import osv from openerp import tools from openerp.tools.translate import _ from openerp.tools.safe_eval import safe_eval as eval from openerp.addons.website.models.website import slug class MailGroup(osv.Model): _inherit = 'mail.group' def message_get_email_values(sel...
rishirajsinghjhelumi/Entity-Mining
refs/heads/master
lastfm/mixin/_propertyadder.py
2
#!/usr/bin/env python __author__ = "Abhinav Sarkar <abhinav@abhinavsarkar.net>" __version__ = "0.2" __license__ = "GNU Lesser General Public License" __package__ = "lastfm.mixin" def property_adder(cls): for p in cls.Meta.properties: if not hasattr(cls, p): def wrapper(): q = p...
djbaldey/django
refs/heads/master
tests/view_tests/regression_21530_urls.py
487
from django.conf.urls import url from . import views urlpatterns = [ url(r'^index/$', views.index_page, name='index'), ]
zooba/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32com/makegw/__init__.py
46
# indicates a python package.
lbjay/cds-invenio
refs/heads/master
modules/elmsubmit/lib/elmsubmit_field_validation.py
4
# -*- coding: utf-8 -*- ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 versio...
Taiiwo/gittorrent
refs/heads/master
test.py
1
import util util.get_infohash("9c14ecc29ea476350cd58668dab080fa20b48b1e", "master")
DarioGT/OMS-PluginXML
refs/heads/master
org.modelsphere.sms/lib/jython-2.2.1/Lib/email/base64MIME.py
1
# Copyright (C) 2002 Python Software Foundation # Author: che@debian.org (Ben Gertzfield) """Base64 content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit characters enco...
google/llvm-propeller
refs/heads/bb-clusters
lldb/test/API/get_darwin_real_python.py
8
# On macOS, system python binaries like /usr/bin/python and $(xcrun -f python3) # are shims. They do some light validation work and then spawn the "real" python # binary. Find the "real" python by asking dyld -- sys.executable reports the # wrong thing more often than not. This is also useful when we're running under #...
pdellaert/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_gallery_info.py
11
#!/usr/bin/python # # Copyright (c) 2019 Liu Qingyi, (@smile37773) # # 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', 's...
CalvinHsu1223/LinuxCNC-EtherCAT-HAL-Driver
refs/heads/master
lib/python/gladevcp/hal_meter.py
39
# vim: sts=4 sw=4 et # GladeVcp Widgets # # Copyright (c) 2010 Pavel Shramov <shramov@mexmat.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at you...
mkhutornenko/incubator-aurora
refs/heads/master
src/main/python/apache/aurora/client/cli/bridge.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 ...
kmoocdev2/edx-platform
refs/heads/real_2019
cms/djangoapps/api/urls.py
20
from django.conf.urls import include, url urlpatterns = [ url(r'^v1/', include('cms.djangoapps.api.v1.urls', namespace='v1')), ]
ecoal95/servo
refs/heads/master
tests/wpt/web-platform-tests/service-workers/service-worker/resources/trickle.py
31
import time def main(request, response): delay = float(request.GET.first("ms", 500)) / 1E3 count = int(request.GET.first("count", 50)) # Read request body request.body time.sleep(delay) response.headers.set("Content-type", "text/plain") response.write_status_headers() time.sleep(delay);...
theicfire/djangofun
refs/heads/master
django/http/multipartparser.py
87
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ import cgi from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.datastructures import MultiValueDict fro...
leibowitz/perfmonitor
refs/heads/master
bin/tasks.py
1
from celery import Celery from subprocess import check_output, CalledProcessError import os import json from pymongo import MongoClient NETSNIFF_UTIL = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'tools', 'netsniff.js') celery = Celery('tasks') celery.config_from_object('celeryconfig') @celery.task def...
fluxw42/youtube-dl
refs/heads/master
youtube_dl/postprocessor/ffmpeg.py
6
from __future__ import unicode_literals import io import os import subprocess import time from .common import AudioConversionError, PostProcessor from ..compat import ( compat_subprocess_get_DEVNULL, ) from ..utils import ( encodeArgument, encodeFilename, get_exe_version, is_outdated_version, ...
nmrao/robotframework
refs/heads/master
src/robot/utils/frange.py
18
# Copyright 2008-2015 Nokia Solutions and Networks # # 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...
stableShip/python_learn
refs/heads/master
fileTest.py
1
# coding=utf-8 # 读取文件方式一 a_file = open("./fileTest.py") text = a_file.read() # 显示调用close a_file.close() print ("文件类型: %s, 第一行内容: %s" % (type(text), text[0:15])) # 读取文件方式二 with open('./fileTest.py', 'r') as f: print("第一行内容: %s" % f.readline()) # 写文件 with open('./test.txt', 'w') as f: f.write('Hello, world!')
shurihell/testasia
refs/heads/test1
common/djangoapps/auth_exchange/tests/test_forms.py
113
# pylint: disable=no-member """ Tests for OAuth token exchange forms """ import unittest from django.conf import settings from django.contrib.sessions.middleware import SessionMiddleware from django.test import TestCase from django.test.client import RequestFactory import httpretty from provider import scope import so...
scragg0x/FFXI-Scraper
refs/heads/master
ffxiscraper/scrapemark.py
1
import re import unicodedata import urllib, urllib2 import urlparse import cgi import cookielib from htmlentitydefs import name2codepoint verbose = False user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3' # todo: throw invalid arguments error if neither html nor ...
IndonesiaX/edx-platform
refs/heads/master
common/djangoapps/status/models.py
103
""" Store status messages in the database. """ from django.db import models from django.contrib import admin from django.core.cache import cache from xmodule_django.models import CourseKeyField from config_models.models import ConfigurationModel from config_models.admin import ConfigurationModelAdmin class GlobalS...
kennedyshead/home-assistant
refs/heads/dev
homeassistant/components/hive/binary_sensor.py
5
"""Support for the Hive binary sensors.""" from datetime import timedelta from homeassistant.components.binary_sensor import ( DEVICE_CLASS_CONNECTIVITY, DEVICE_CLASS_MOTION, DEVICE_CLASS_OPENING, DEVICE_CLASS_SMOKE, DEVICE_CLASS_SOUND, BinarySensorEntity, ) from . import HiveEntity from .cons...
louiscarrese/lc-formations
refs/heads/master
node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/tools/graphviz.py
2679
#!/usr/bin/env python # Copyright (c) 2011 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
UPDDI/mps-database-server
refs/heads/master
drugtrials/migrations/0010.py
1
# Generated by Django 2.1.11 on 2019-08-12 19:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('drugtrials', '0009'), ] operations = [ migrations.AlterField( model_name='drugtrial', name='locked', fi...
nemesisdesign/django
refs/heads/master
tests/view_tests/generic_urls.py
28
# -*- coding:utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from django.contrib.auth import views as auth_views from django.views.generic import RedirectView from . import views from .models import Article, DateArticle date_based_info_dict = { 'queryset': Article.objects.all()...
jroyal/plexpy
refs/heads/master
lib/mutagen/oggspeex.py
31
# -*- coding: utf-8 -*- # Copyright 2006 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Read and write Ogg Speex comments. This module handles Speex files wrappe...
IllusionRom-deprecated/android_platform_external_chromium_org
refs/heads/illusion-4.4
native_client_sdk/src/build_tools/sdk_tools/third_party/fancy_urllib/__init__.py
155
#!/usr/bin/env python # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software # Foundation; All Rights Reserved """A HTTPSConnection/Handler with additional proxy and cert validation features. In particular, monkey patches in Python r74203 to provide support for CONNECT proxies and adds SSL cert va...
yjmade/odoo
refs/heads/8.0
addons/account/wizard/account_journal_select.py
385
# -*- 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...
solome/jyp
refs/heads/master
misc/virtenv/lib/python2.7/site-packages/pip/_vendor/requests/structures.py
279
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
srimai/odoo
refs/heads/8.0
openerp/addons/base/tests/test_xmlrpc.py
200
# -*- coding: utf-8 -*- import openerp.tests.common class test_xmlrpc(openerp.tests.common.HttpCase): at_install = False post_install = True def test_01_xmlrpc_login(self): """ Try to login on the common service. """ db_name = openerp.tests.common.get_db_name() uid = self.xmlrpc_c...
vnsofthe/odoo
refs/heads/8.0
openerp/tools/pdf_utils.py
456
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
minhphung171093/GreenERP_V7
refs/heads/master
openerp/addons/base/ir/ir_needaction.py
455
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
adaur/SickRage
refs/heads/master
lib/unidecode/x00c.py
252
data = ( '[?]', # 0x00 'N', # 0x01 'N', # 0x02 'H', # 0x03 '[?]', # 0x04 'a', # 0x05 'aa', # 0x06 'i', # 0x07 'ii', # 0x08 'u', # 0x09 'uu', # 0x0a 'R', # 0x0b 'L', # 0x0c '[?]', # 0x0d 'e', # 0x0e 'ee', # 0x0f 'ai', # 0x10 '[?]', # 0x11 'o', # 0x12 'oo', # 0x...
WSDC-NITWarangal/django
refs/heads/master
django/db/migrations/operations/base.py
356
from __future__ import unicode_literals from django.db import router class Operation(object): """ Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as actually performing it agains...
Wizmann/codeforces-cdn
refs/heads/master
BAE/cf-cdn-refresh/qiniu/httplib_chunk.py
2
""" Modified from standard httplib 1. HTTPConnection can send trunked data. 2. Remove httplib's automatic Content-Length insertion when data is a file-like object. """ # -*- coding: utf-8 -*- import httplib from httplib import _CS_REQ_STARTED, _CS_REQ_SENT, CannotSendHeader, NotConnected import string import os from...
asfin/electrum
refs/heads/master
electrum/gui/kivy/uix/drawer.py
33
'''Drawer Widget to hold the main window and the menu/hidden section that can be swiped in from the left. This Menu would be only hidden in phone mode and visible in Tablet Mode. This class is specifically in lined to save on start up speed(minimize i/o). ''' from kivy.app import App from kivy.factory import Factory ...
botify-labs/simpleflow
refs/heads/continue_as_new
simpleflow/swf/process/worker/__init__.py
1
from . import command # NOQA
alshedivat/tensorflow
refs/heads/master
tensorflow/contrib/lookup/__init__.py
78
# 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...
tysonclugg/django
refs/heads/master
django/middleware/common.py
30
import re import warnings from urllib.parse import urlparse from django.conf import settings from django.core.exceptions import PermissionDenied from django.core.mail import mail_managers from django.http import HttpResponsePermanentRedirect from django.urls import is_valid_path from django.utils.cache import ( cc...
marmyshev/item_title
refs/heads/master
openlp/plugins/images/lib/__init__.py
2
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
mheap/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_cloudproperties.py
41
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
JakeColtman/bartpy
refs/heads/master
bartpy/data.py
1
from operator import gt, le from typing import Any, List, Optional, Union import numpy as np import pandas as pd from bartpy.errors import NoSplittableVariableException from bartpy.splitcondition import SplitCondition def is_not_constant(series: np.ndarray) -> bool: """ Quickly identify whether a series con...