repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
inveniosoftware/invenio-demosite
refs/heads/master
invenio_demosite/testsuite/regression/test_bibconvert.py
7
# -*- coding: utf-8 -*- # # This file is part of Invenio Demosite. # Copyright (C) 2007, 2008, 2010, 2011, 2012, 2013 CERN. # # Invenio Demosite 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...
mheap/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_snmp_traps.py
43
#!/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...
ahamilton55/ansible
refs/heads/devel
lib/ansible/modules/windows/win_region.py
46
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
SotolitoLabs/cockpit
refs/heads/master
test/verify/files/mock-faf-server.py
2
#!/usr/bin/python3 # export uReport_URL="http://localhost:12345" import cgi import json import sys from http.server import HTTPServer, BaseHTTPRequestHandler class Handler(BaseHTTPRequestHandler): def do_POST(self): form = cgi.FieldStorage( fp=self.rfile, headers=self.headers, ...
crodjer/qotr
refs/heads/master
qotr/tests/test_chat_handler.py
4
import json from tornado import websocket, testing, gen from qotr.channels import Channels from qotr.exceptions import ChannelDoesNotExist from .base_async_test import BaseAsyncTest from .utils import m def send(client, obj): return client.write_message(json.dumps(obj)) # This test uses coroutine style. class T...
linkedin/Zopkio
refs/heads/master
examples/server_client/server_client_multiple_iter_parallel.py
4
# Copyright 2015 LinkedIn Corp. # # 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....
09zwcbupt/ryu
refs/heads/master
ryu/tests/integrated/tester.py
63
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
iulian787/spack
refs/heads/develop
var/spack/repos/builtin/packages/julia/package.py
2
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import os class Julia(Package): """The Julia Language: A fresh approach to technical computing"...
FujiMakoto/makoto-rivescript
refs/heads/master
__init__.py
5
from rivescript import RiveScript
yongshengwang/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/template_tests/templatetags/subpackage/echo_invalid.py
156
import nonexistent.module
rfaga/deloslib
refs/heads/master
deloslib/__init__.py
1
#!/usr/bin/env python # coding: UTF-8 from django.core.exceptions import SuspiciousOperation import os def skip_suspicious_operations(record): if record.exc_info: exc_value = record.exc_info[1] if isinstance(exc_value, SuspiciousOperation): return False return True def get_base_s...
madhukar01/coala-bears
refs/heads/master
tests/general/InvalidLinkBearTest.py
5
import io import logging from queue import Queue import requests import requests_mock import unittest import unittest.mock from bears.general.InvalidLinkBear import InvalidLinkBear from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY from coalib.settings.Section import Section def custom_matcher(request): ...
smmribeiro/intellij-community
refs/heads/master
python/testData/inspections/PyArgumentListInspection/InitializingImportedDataclass/dataclasses.py
67
def dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False): pass
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filters_operations.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
iproduct/course-social-robotics
refs/heads/master
09-image-recognition-opencv-dnn/cv2_caffe_face_detection.py
1
import numpy as np import argparse import cv2 as cv try: import cv2 as cv except ImportError: raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, ' 'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "...
poulpito/Flexget
refs/heads/develop
flexget/plugins/metainfo/imdb_url.py
9
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import re import logging from flexget import plugin from flexget.event import event from flexget.utils.imdb import extract_id, make_url log = logging.getLogger('metainfo_...
espadrine/opera
refs/heads/master
chromium/src/third_party/python_26/Lib/site-packages/win32comext/bits/test/test_bits.py
17
from win32com.server.util import wrap import pythoncom, sys, os, time, win32api, win32event, tempfile from win32com.bits import bits TIMEOUT = 200 # ms StopEvent = win32event.CreateEvent(None, 0, 0, None) job_name = 'bits-pywin32-test' states = dict([(val, (name[13:])) for name, val in vars(bits).ite...
digitalfox/pysql
refs/heads/master
src/pysql/pysqlfunctions.py
1
# -*- coding: utf-8 -*- """ This module defines all high level functions of pysql @author: Sébastien Renard (sebastien.renard@digitalfox.org) @author: Sébastien Delcros (Sebastien.Delcros@gmail.com) @license: GNU GPL V3 """ # pylint: disable-msg=E1101 # Python imports: import re from os import getenv, unlink from di...
40223220/worktogether
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/imp.py
637
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
w1ll1am23/home-assistant
refs/heads/dev
tests/components/homekit/test_type_cameras.py
5
"""Test different accessory types: Camera.""" from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch from uuid import UUID from pyhap.accessory_driver import AccessoryDriver import pytest from homeassistant.components import camera, ffmpeg from homeassistant.components.homekit.accessories import HomeBri...
rhinstaller/blivet
refs/heads/2.1-devel
blivet/fcoe.py
1
# # fcoe.py - fcoe class # # Copyright (C) 2009 Red Hat, Inc. All rights reserved. # # 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 your option) any ...
GbalsaC/bitnamiP
refs/heads/master
edx-ora2/openassessment/assessment/migrations/0016_auto__add_field_aiclassifierset_course_id__add_field_aiclassifierset_i.py
7
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'AIClassifierSet.course_id' db.add_column('assessment_aiclassifierset', 'course_id', ...
pyjs/pyjs
refs/heads/master
examples/gcharttestapp/GChartExample03.py
6
from pyjamas.chart.GChart import GChart from pyjamas.chart import SymbolType from pyjamas.chart.GChartConsts import Y_AXIS, Y2_AXIS """* * Defines a chart with a scatterplot on one y-axis, and a * barchart on the other. """ class GChartExample03(GChart): def __init__(self): GChart.__init__(self) ...
ryra/Personal
refs/heads/master
2.pysifer/Older/immutable.py
1
#!/usr/bin/env python # Sifer Aseph """Immutable objects.""" def main(): """This is the only way to make a variable immutable. Python doesn't have constant so you can't really "protect" your variables.""" test = 123 example = (test,) example[0] = example[0] + 1 if __name__ == "__main__": main(...
Red-M/CloudBot-legacy
refs/heads/develop
util/http.py
7
# convenience wrapper for urllib2 & friends import cookielib import json import urllib import urllib2 import urlparse from urllib import quote, quote_plus as _quote_plus from lxml import etree, html from bs4 import BeautifulSoup # used in plugins that import this from urllib2 import URLError, HTTPError ua_cloudbot...
Kloudless/kloudless-python
refs/heads/master
tests/integration/management_api/test_webhook.py
1
import unittest import os import base64 import time # Add parent dir to path to import utils import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from test_cases import utils import sdk class WebHook(unittest.TestCase): def setUp(self): name = base64.b...
luheng/deep_srl
refs/heads/master
python/neural_srl/shared/io_utils.py
1
from google.protobuf.internal import encoder _EncodeVarint = encoder._VarintEncoder() def write_delimited_to(out_file, message): msg_size = message.ByteSize() pieces = [] _EncodeVarint(pieces.append, msg_size) out_file.write(b"".join(pieces)) out_file.write(message.SerializeToString()) def read_gold_props...
mammique/django
refs/heads/tp_alpha
django/contrib/messages/tests/fallback.py
199
from django.contrib.messages import constants from django.contrib.messages.storage.fallback import (FallbackStorage, CookieStorage) from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.tests.cookie import (set_cookie_data, stored_cookie_messages_count) from django.contrib.message...
rolandwz/pymisc
refs/heads/master
utrader/vote.py
2
# -*- coding: utf-8 -*- import datetime, time, csv, os, shutil import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import MultiCursor from utils.db import SqliteDB from utils.rwlogging import log import dataloader from indicator import ma, macd, bolling, rsi, kdj from voters import l1voter, l2vot...
enkripsi/gyp
refs/heads/master
test/variables/filelist/gyptest-filelist.py
227
#!/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. """ Test variable expansion of '<|(list.txt ...)' syntax commands. """ import os import sys import TestGyp test = TestGyp.TestGyp() CHDI...
onecue/pybbm
refs/heads/master
pybb/markup/markdown.py
6
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from markdown import Markdown from django.forms import Textarea from django.template import Context from django.template.loader import get_template from pybb.markup.base import smile_it, BaseParser class MarkdownWidget(Textarea): cl...
GuessWhoSamFoo/pandas
refs/heads/master
pandas/tests/extension/base/base.py
6
import pandas.util.testing as tm class BaseExtensionTests(object): assert_equal = staticmethod(tm.assert_equal) assert_series_equal = staticmethod(tm.assert_series_equal) assert_frame_equal = staticmethod(tm.assert_frame_equal) assert_extension_array_equal = staticmethod( tm.assert_extension_a...
trujunzhang/djzhang-targets
refs/heads/master
cwfuqs/cwfuqs/main.py
1
from scrapy import cmdline import os class Utils: ## get input ## filename = "results.json" def prepare(self): ## delete only if file exists ## if os.path.exists(self.filename): os.remove(self.filename) else: print("Sorry, I can not remove %s file." % self....
erkanay/django
refs/heads/master
tests/forms_tests/tests/test_util.py
20
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.forms.utils import flatatt, ErrorDict, ErrorList from django.test import TestCase from django.utils.safestring import mark_safe from django.utils import six from django.utils.translation impor...
scenarios/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/utils/gc.py
66
# 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...
omerpalaz/openbmp-mrt2bmp
refs/heads/master
src/site-packages/openbmp/mrt2bmp/CollectorSender.py
1
# -*- coding: utf-8 -*- """OpenBMP mrt2bmp Copyright (c) 2013-2015 Cisco Systems, Inc. and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse....
devekko/openoutreach
refs/heads/master
profiles/openoutreach/libraries/openlayers/tools/closure_library_jscompiler.py
285
# Copyright 2010 The Closure Library 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 a...
rpetit3/darkstar
refs/heads/master
migrations/migrate.py
33
import MySQLdb import re import spell_blobs_to_spell_table credentials = {} db = None cur = None def connect(): print("Loading conf/map_darkstar.conf") # Grab mysql credentials filename = "../conf/map_darkstar.conf" global credentials global db global cur with open(filename) as f: ...
ryano144/intellij-community
refs/heads/master
python/lib/Lib/cookielib.py
92
"""HTTP cookie handling for web clients. This module has (now fairly distant) origins in Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Pyth...
mheap/ansible
refs/heads/devel
lib/ansible/modules/system/openwrt_init.py
78
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Andrew Gaffney <andrew@agaffney.org> # 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', ...
linglung/ytdl
refs/heads/master
youtube_dl/extractor/gameone.py
208
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( xpath_with_ns, parse_iso8601, float_or_none, int_or_none, ) NAMESPACE_MAP = { 'media': 'http://search.yahoo.com/mrss/', } # URL prefix to download the mp4 files directly inst...
yoelk/kivy
refs/heads/master
kivy/uix/gridlayout.py
8
''' Grid Layout =========== .. only:: html .. image:: images/gridlayout.gif :align: right .. only:: latex .. image:: images/gridlayout.png :align: right .. versionadded:: 1.0.4 The :class:`GridLayout` arranges children in a matrix. It takes the available space and divides it into columns a...
orekyuu/intellij-community
refs/heads/master
python/testData/intentions/afterReturnTypeInNewGoogleDocString.py
5
def f(x): """ Returns: object: """ return 42
eaobservatory/hedwig
refs/heads/master
test/test_web_app.py
1
# Copyright (C) 2016-2017 East Asian Observatory # All Rights Reserved. # # 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 your option) any later # version...
drxaero/calibre
refs/heads/master
src/calibre/ebooks/metadata/pdb.py
24
# -*- coding: utf-8 -*- ''' Read meta information from pdb files. ''' __license__ = 'GPL v3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import re from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.pdb.header import PdbHeaderReader from c...
cc13ny/algo
refs/heads/master
leetcode/046-Permutations/Perm_003.py
5
class Solution: # @param {integer[]} nums # @return {integer[][]} def permute(self, nums): if len(nums) == 1: return [nums] res = [] for i in range(len(nums)): tmp = nums[:] head = tmp.pop(i) tail = self.permute(tmp) ...
TwilioDevEd/appointment-reminders-django
refs/heads/dependabot/pip/arrow-1.1.1
reminders/views.py
1
from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse_lazy from django.views.generic import DetailView from django.views.generic.edit import CreateView from django.views.generic.edit import DeleteView from django.views.generic.edit import UpdateView from django.views.generic.list...
da1z/intellij-community
refs/heads/master
python/testData/quickdoc/NumPyOnesDoc/numpy/core/multiarray.py
103
class ndarray(object): """ ndarray(shape, dtype=float, buffer=None, offset=0, strides=None, order=None) An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array...
zhuzhezhe/weibobash
refs/heads/master
env/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/__init__.py
962
from textwrap import dedent try: from .file_cache import FileCache except ImportError: notice = dedent(''' NOTE: In order to use the FileCache you must have lockfile installed. You can install it via pip: pip install lockfile ''') print(notice) try: import redis from .redis_cach...
grivescorbett/heroku-buildpack-python
refs/heads/master
vendor/pip-pop/pip/_vendor/requests/packages/urllib3/response.py
478
try: import http.client as httplib except ImportError: import httplib import zlib import io from socket import timeout as SocketTimeout from ._collections import HTTPHeaderDict from .exceptions import ( ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked ) from .packages.six import string_type...
chb/indivo_server
refs/heads/master
indivo/models/messaging.py
3
""" Indivo Model for Messaging """ from django.db import models from django.conf import settings from base import Object, Principal, INDIVO_APP_LABEL class Message(Object): account = models.ForeignKey('Account') # about which record is this message? about_record = models.ForeignKey('Record', null = True...
conanwhf/Rpi-envMonitor
refs/heads/master
test.py
1
#!/usr/bin/python3 #-*- coding:utf-8 -*- import sys,time from RpiState import RpiNetWork from RpiState import RpiSystem from AirQuality import AirQuality #from DHT11 import DHT11 from PCF8591 import PCF8591 from GpioPower import * import Adafruit_DHT class sysState: def __init__(self): self.sys = RpiSystem() # 系...
siutanwong/scikit-learn
refs/heads/master
examples/model_selection/plot_roc.py
146
""" ======================================= Receiver Operating Characteristic (ROC) ======================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality. ROC curves typically feature true positive rate on the Y axis, and false positive rate on the X a...
atztogo/phonopy
refs/heads/master
phonopy/interface/phonopy_yaml.py
1
# Copyright (C) 2018 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # 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 # notic...
fbradyirl/home-assistant
refs/heads/dev
tests/components/heos/test_services.py
1
"""Tests for the services module.""" from pyheos import CommandError, const from homeassistant.components.heos.const import ( ATTR_PASSWORD, ATTR_USERNAME, DOMAIN, SERVICE_SIGN_IN, SERVICE_SIGN_OUT, ) from homeassistant.setup import async_setup_component async def setup_component(hass, config_ent...
JohanComparat/pySU
refs/heads/master
spm/bin/create_summary_tables_write_scripts.py
1
import glob import os from os.path import join import numpy as n def writeScript(rootName, plate, env): f=open(rootName+".sh",'w') f.write("#!/bin/bash \n") f.write("#PBS -l walltime=40:00:00 \n") f.write("#PBS -o "+plate+".o.$PBS_JOBID \n") f.write("#PBS -e "+plate+".e$PBS_JOBID \n") f.write("#PBS -M comparat@m...
Antiun/odoo
refs/heads/8.0
addons/event_sale/__openerp__.py
306
# -*- 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...
18F/regulations-site
refs/heads/master
regulations/tests/views_preamble_tests.py
2
# -*- coding: utf-8 -*- from mock import patch from unittest import TestCase from datetime import date, timedelta from django.http import Http404 from django.test import RequestFactory, override_settings from fr_notices.navigation import make_preamble_nav from regulations.generator.layers import diff_applier from re...
pkainz/pylearn2
refs/heads/master
pylearn2/gui/tangent_plot.py
44
""" Code for plotting curves with tangent lines. """ __author__ = "Ian Goodfellow" try: from matplotlib import pyplot except Exception: pyplot = None from theano.compat.six.moves import xrange def tangent_plot(x, y, s): """ Plots a curve with tangent lines. Parameters ---------- x : lis...
kittiu/odoo
refs/heads/8.0
addons/hr_holidays/wizard/hr_holidays_summary_employees.py
337
# -*- 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...
mapr/hue
refs/heads/hue-3.9.0-mapr
desktop/core/ext-py/cx_Oracle-5.1.2/test/IntervalVar.py
33
"""Module for testing interval variables.""" import datetime class TestIntervalVar(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.rawData = [] self.dataByKey = {} for i in range(1, 11): delta = datetime.timedelta(days = i, hours = i, minutes = i * 2, ...
mhnatiuk/phd_sociology_of_religion
refs/heads/master
scrapper/build/Twisted/twisted/words/test/test_jabbersasl.py
40
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from zope.interface import implements from twisted.internet import defer from twisted.trial import unittest from twisted.words.protocols.jabber import sasl, sasl_mechanisms, xmlstream, jid from twisted.words.xish import domish NS_XMPP_SASL = 'urn...
poljeff/odoo
refs/heads/8.0
addons/website_crm_partner_assign/__init__.py
3964
import controllers import models
bjorand/python-social-auth
refs/heads/master
social/strategies/webpy_strategy.py
77
import web from social.strategies.base import BaseStrategy, BaseTemplateStrategy class WebpyTemplateStrategy(BaseTemplateStrategy): def render_template(self, tpl, context): return web.template.render(tpl)(**context) def render_string(self, html, context): return web.template.Template(html)(*...
DrDub/icsisumm
refs/heads/master
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/dependency/tag2tab.py
9
""" Utilities for converting chunked treebank into format that can be input to Nivre's MaltParser. """ from nltk.corpora import get_basedir from nltk import tokenize from itertools import islice import os def tag2tab(s, sep='/'): loc = s.rfind(sep) if loc >= 0: word = s[:loc] tag = s[l...
ecolitan/fatics
refs/heads/master
venv/lib/python2.7/site-packages/netaddr/ip/nmap.py
9
#----------------------------------------------------------------------------- # Copyright (c) 2008-2012, David P. D. Moss. All rights reserved. # # Released under the BSD license. See the LICENSE file for details. #----------------------------------------------------------------------------- """ Routines for deali...
browseinfo/odoo_saas3_nicolas
refs/heads/master
addons/account_accountant/__openerp__.py
124
# -*- 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...
QuLogic/python-future
refs/heads/master
src/libfuturize/fixes/fix_absolute_import.py
62
""" Fixer for import statements, with a __future__ import line. Based on lib2to3/fixes/fix_import.py, but extended slightly so it also supports Cython modules. If spam is being imported from the local directory, this import: from spam import eggs becomes: from __future__ import absolute_import from .spam ...
bskinn/opan
refs/heads/master
opan/test/opan_utils_base.py
1
#------------------------------------------------------------------------------- # Name: opan_utils_base # Purpose: Test objects for opan.utils.base # # Author: Brian Skinn # bskinn@alum.mit.edu # # Created: 28 Feb 2016 # Copyright: (c) Brian Skinn 2016 # License: The MIT Licens...
indevgr/django
refs/heads/master
tests/utils_tests/test_datetime_safe.py
161
import unittest from datetime import ( date as original_date, datetime as original_datetime, time as original_time, ) from django.utils.datetime_safe import date, datetime, time class DatetimeTests(unittest.TestCase): def setUp(self): self.just_safe = (1900, 1, 1) self.just_unsafe = (189...
auduny/home-assistant
refs/heads/dev
homeassistant/components/deutsche_bahn/sensor.py
6
"""Support for information about the German train system.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity import homeassistant.util...
sander76/home-assistant
refs/heads/dev
tests/components/scene/common.py
24
"""Collection of helper methods. All containing methods are legacy helpers that should not be used by new components. Instead call the service directly. """ from homeassistant.components.scene import DOMAIN from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_ON from homeassistant.loader impo...
VladimirVystupkin/AMRParsing1.x
refs/heads/master
stanfordnlp/unidecode/x09f.py
252
data = ( 'Cu ', # 0x00 'Qu ', # 0x01 'Chao ', # 0x02 'Wa ', # 0x03 'Zhu ', # 0x04 'Zhi ', # 0x05 'Mang ', # 0x06 'Ao ', # 0x07 'Bie ', # 0x08 'Tuo ', # 0x09 'Bi ', # 0x0a 'Yuan ', # 0x0b 'Chao ', # 0x0c 'Tuo ', # 0x0d 'Ding ', # 0x0e 'Mi ', # 0x0f 'Nai ', # 0x10 'Ding ...
jcoady9/youtube-dl
refs/heads/master
youtube_dl/extractor/kankan.py
91
from __future__ import unicode_literals import re import hashlib from .common import InfoExtractor _md5 = lambda s: hashlib.md5(s.encode('utf-8')).hexdigest() class KankanIE(InfoExtractor): _VALID_URL = r'https?://(?:.*?\.)?kankan\.com/.+?/(?P<id>\d+)\.shtml' _TEST = { 'url': 'http://yinyue.kankan...
kadhikari/navitia
refs/heads/dev
source/jormungandr/jormungandr/modules/__init__.py
53
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
ischwabacher/seaborn
refs/heads/master
examples/paired_pointplots.py
7
""" Paired discrete plots ===================== """ import seaborn as sns sns.set(style="whitegrid") titanic = sns.load_dataset("titanic") g = sns.PairGrid(titanic, y_vars="survived", x_vars=["class", "sex", "who", "alone"], size=5, aspect=.5) g.map(sns.pointplot, color=sns.xkcd_rgb...
rezoo/chainer
refs/heads/master
tests/chainer_tests/functions_tests/array_tests/test_spatial_transformer_grid.py
11
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'dtype': [numpy.float16, numpy.float32, numpy.float64], 'use_cu...
XiaosongWei/chromium-crosswalk
refs/heads/master
tools/telemetry/telemetry/internal/backends/chrome/oobe.py
10
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from functools import partial import logging from telemetry.core import exceptions from telemetry.core import util from telemetry.internal.browser import we...
mollyklecompte/receipt
refs/heads/master
sites/all/themes/receiptzen/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
# Copyright (c) 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
ZhangXinNan/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/learn_io/__init__.py
42
# 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...
ArtsiomCh/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/distribution_test.py
96
# 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...
alexsavio/scikit-learn
refs/heads/master
sklearn/utils/sparsetools/setup.py
20
import numpy def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('sparsetools', parent_package, top_path) config.add_extension('_traversal', sources=['_traversal.c'], include_dir...
AdeshAtole/coala
refs/heads/master
coalib/parsing/ConfParser.py
21
import os from collections import OrderedDict from coalib.misc import Constants from coalib.parsing.LineParser import LineParser from coalib.settings.Section import Section from coalib.settings.Setting import Setting class ConfParser: def __init__(self, key_value_delimiters=('=',), ...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_operation_results_operations.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
xapi-project/sm
refs/heads/master
tests/test_ISOSR.py
1
import mock import nfs import ISOSR import unittest import xs_errors import util import SR import errno import testlib class FakeISOSR(ISOSR.ISOSR): uuid = None sr_ref = None session = None srcmd = None def __init__(self, srcmd, none): self.dconf = srcmd.dconf self.srcmd = srcmd ...
joxer/Baka-No-Voltron
refs/heads/master
tmp/android.dist/private/renpy/curry.py
1
# Copyright 2004-2015 Tom Rothamel <pytom@bishoujo.us> # # 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, m...
polyaxon/polyaxon
refs/heads/master
examples/in_cluster/horovod/pytorch/mnist.py
1
from __future__ import print_function import argparse import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms import torch.utils.data.distributed import horovod.torch as hvd # Polyaxon from polyaxon.tracking import Run # Training settings parser =...
GbalsaC/bitnamiP
refs/heads/master
cms/envs/dev.py
29
""" This config file runs the simplest dev environment""" # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from .common import * from openedx.core.lib.logsettings import get_logger_config...
drmatthews/recipebox
refs/heads/master
recipebox/wines/urls.py
1
from __future__ import absolute_import from django.conf.urls import url from django.contrib.auth.views import login, logout from . import views urlpatterns = [ url(r'^$', views.wine_list, name='wines'), url(r'^new-note/$', views.wine_create, name='new_wine'), url(r'^edit-note/(?P<wine_id>[0-9]+)/$', view...
jhseu/tensorflow
refs/heads/master
tensorflow/python/data/experimental/ops/parsing_ops.py
5
# Copyright 2018 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...
Split-Screen/android_kernel_htc_flounder
refs/heads/pac-5.0
tools/perf/scripts/python/net_dropmonitor.py
2669
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
Anaphory/p4-phylogeny
refs/heads/master
share/Examples/B_readData/C_checkForDuplicateSequences/sSim.py
3
nTax = 10 taxNames = list(string.uppercase[:nTax]) a = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=96) d = Data([a]) t = func.randomTree(taxNames=taxNames) t.data = d t.newComp(free=0, spec='specified', val=[0.1, 0.2, 0.3]) t.newRMatrix(free=0, spec='specified', val=[2., 3., 4., 5., 6., 7.]) t.setN...
himleyb85/django
refs/heads/master
tests/i18n/patterns/urls/path_unused.py
452
from django.conf.urls import url from django.views.generic import TemplateView view = TemplateView.as_view(template_name='dummy.html') urlpatterns = [ url(r'^nl/foo/', view, name='not-translated'), ]
domesticduck/MenuConciergeServer
refs/heads/master
vendor/bundle/ruby/2.0.0/gems/libv8-3.16.14.3/vendor/v8/tools/testrunner/server/local_handler.py
123
# Copyright 2012 the V8 project authors. 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 conditi...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/draft_schematic/droid/shared_droid_dz70.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 = Intangible() result.template = "object/draft_schematic/droid/shared_droid_dz70.iff" result.attribute_template_id ...
SDX2000/scons
refs/heads/master
engine/SCons/Tool/sunar.py
21
"""engine.SCons.Tool.sunar Tool-specific initialization for Solaris (Forte) ar (library archive). If CC exists, static libraries should be built with it, so that template instantians can be resolved. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic S...
TieWei/nova
refs/heads/enhanced/havana
nova/tests/fake_ldap.py
12
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
zahanm/foodpedia
refs/heads/master
django/contrib/gis/db/models/fields.py
400
from django.db.models.fields import Field from django.db.models.sql.expressions import SQLEvaluator from django.utils.translation import ugettext_lazy as _ from django.contrib.gis import forms from django.contrib.gis.db.models.proxy import GeometryProxy from django.contrib.gis.geometry.backend import Geometry, Geometry...
Wingszero/scrapy-redis
refs/heads/master
scrapy_redis/scheduler.py
17
from scrapy.utils.misc import load_object from . import connection from .dupefilter import RFPDupeFilter # default values SCHEDULER_PERSIST = False QUEUE_KEY = '%(spider)s:requests' QUEUE_CLASS = 'scrapy_redis.queue.SpiderPriorityQueue' DUPEFILTER_KEY = '%(spider)s:dupefilter' IDLE_BEFORE_CLOSE = 0 class Scheduler...
jn0/fb2utils
refs/heads/master
unidecode/x60.py
250
data = ( 'Huai ', # 0x00 'Tai ', # 0x01 'Song ', # 0x02 'Wu ', # 0x03 'Ou ', # 0x04 'Chang ', # 0x05 'Chuang ', # 0x06 'Ju ', # 0x07 'Yi ', # 0x08 'Bao ', # 0x09 'Chao ', # 0x0a 'Min ', # 0x0b 'Pei ', # 0x0c 'Zuo ', # 0x0d 'Zen ', # 0x0e 'Yang ', # 0x0f 'Kou ', # 0x10 ...