repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
rohitwaghchaure/New_Theme_Erp
refs/heads/develop
erpnext/hr/doctype/salary_slip/salary_slip.py
1
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, rounded from frappe.model.naming import make_autoname from frap...
mkeilman/sirepo
refs/heads/master
sirepo/template/srw_fixup.py
2
# -*- coding: utf-8 -*- u"""SRW template fixups :copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkcollections from pykern.pkdebug import pkdc, pkdexc, pk...
koyuawsmbrtn/eclock
refs/heads/master
windows/kivy/examples/widgets/label_with_markup.py
20
from kivy.app import App from kivy.lang import Builder root = Builder.load_string(''' Label: text: ('[b]Hello[/b] [color=ff0099]World[/color]\\n' '[color=ff0099]Hello[/color] [b]World[/b]\\n' '[b]Hello[/b] [color=ff0099]World[/color]') markup: True font_size: '64pt' ''') class Labe...
lad1337/Sick-Beard
refs/heads/anime
lib/hachoir_core/field/generic_field_set.py
90
from lib.hachoir_core.field import (MissingField, BasicFieldSet, Field, ParserError, createRawField, createNullField, createPaddingField, FakeArray) from lib.hachoir_core.dict import Dict, UniqKeyError from lib.hachoir_core.error import HACHOIR_ERRORS from lib.hachoir_core.tools import lowerBound import lib.hachoir...
spartonia/django-oscar
refs/heads/master
src/oscar/apps/search/views.py
15
from haystack import views from oscar.core.loading import get_class, get_model from . import signals Product = get_model('catalogue', 'Product') FacetMunger = get_class('search.facets', 'FacetMunger') class FacetedSearchView(views.FacetedSearchView): """ A modified version of Haystack's FacetedSearchView ...
repotvsupertuga/tvsupertuga.repository
refs/heads/master
plugin.video.loganaddon/resources/lib/libraries/cleandate.py
33
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 3 of the License, or (at your option) any l...
SerCeMan/intellij-community
refs/heads/master
python/lib/Lib/distutils/dir_util.py
82
"""distutils.dir_util Utility functions for manipulating directories and directory trees.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: dir_util.py 39416 2005-08-26 15:20:46Z tim_one $" import os, sys from types import * from distutils.errors import DistutilsFileError, DistutilsIn...
knkinnard/kkinnard-byte3
refs/heads/master
lib/flask/testsuite/test_apps/importerror.py
614
# NoImportsTestCase raise NotImplementedError
CarbonROM/android_kernel_asus_fugu
refs/heads/lp5.1.1
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
DinoCow/airflow
refs/heads/master
tests/utils/test_net.py
7
# # 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...
tdsimao/tt
refs/heads/master
django/contrib/gis/geos/prototypes/threadsafe.py
513
import threading from django.contrib.gis.geos.libgeos import lgeos, notice_h, error_h, CONTEXT_PTR class GEOSContextHandle(object): """ Python object representing a GEOS context handle. """ def __init__(self): # Initializing the context handler for this thread with # the notice and erro...
waseem18/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/internet/test/test_udp.py
18
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorUDP}. """ __metaclass__ = type from socket import SOCK_DGRAM from zope.interface.verify import verifyObject from twisted.internet.test.reactormixins import ReactorBuilder from twisted.internet.interfa...
DailyActie/Surrogate-Model
refs/heads/master
01-codes/OpenMDAO-Framework-dev/examples/openmdao.examples.enginedesign/openmdao/examples/enginedesign/vehicle_singlesim.py
1
""" Model that simulates the 0-60 acceleration time of a Vehicle. """ from openmdao.examples.enginedesign.driving_sim import SimAcceleration from openmdao.examples.enginedesign.vehicle import Vehicle from openmdao.main.api import Assembly class VehicleSim(Assembly): """Optimization of a Vehicle.""" def ...
pstratem/python-bitcoinlib
refs/heads/master
bitcoin/tests/test_core.py
16
# Copyright (C) 2013-2015 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified, # propagated, or dist...
nathanborror/django-basic-apps
refs/heads/master
basic/comments/urls.py
9
from django.conf.urls.defaults import * from django.contrib.comments.urls import urlpatterns urlpatterns += patterns('basic.comments.views', url(r'^(?P<object_id>\d+)/edit/$', view='comment_edit', name='comments-edit'), url(r'^(?P<object_id>\d+)/remove/$', view='comment_remove', ...
msassmann/texcavator
refs/heads/develop
query/management/commands/add_stopwords.py
2
"""Reads in a default set of stopwords from a text file for all current users and all queries. """ import os from django.core.management.base import BaseCommand, CommandError from query.models import StopWord class Command(BaseCommand): args = '<stopword_list...>' help = 'Reads in specified lists of (defaul...
zhoulingjun/django
refs/heads/master
tests/i18n/project_dir/app_no_locale/models.py
449
from django.utils.translation import ugettext as _ string = _("This app has no locale directory")
sarakha63/persomov
refs/heads/master
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/folketinget.py
22
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_parse_qs from ..utils import ( int_or_none, parse_duration, parse_iso8601, xpath_text, ) class FolketingetIE(InfoExtractor): IE_DESC = 'Folketinget (ft.dk; Danish parliame...
freelancer/freelancer-sdk-python
refs/heads/master
freelancersdk/resources/users/__init__.py
1
users_endpoint = 'api/users/0.1' from freelancersdk.resources.users.helpers import * from freelancersdk.resources.users.users import *
alexanderfefelov/nav
refs/heads/master
tools/hgdescribe/__init__.py
1
VERSION = (0, 1, 0) __version__ = VERSION __versionstr__ = '.'.join(map(str, VERSION)) # for now, propagate API from hgdescribe.describe import *
fengzhyuan/scikit-learn
refs/heads/master
sklearn/metrics/cluster/tests/test_supervised.py
206
import numpy as np from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import homogeneity_score from sklearn.metrics.cluster import completeness_score from sklearn.metrics.cluster import v_measure_score from sklearn.metrics.cluster import homogeneity_completeness_v_measure from sklearn...
gaapt/opencog
refs/heads/master
opencog/python/learning/bayesian_learning/network.py
34
from learning.bayesian_learning.util import subsets_of, subsets_of_len_two __author__ = 'keyvan' class Link(list): repr_separator_symbol = '--' def __init__(self, first_node=None, second_node=None): self.first_node = first_node self.second_node = second_node def __hash__(self): ...
cprogrammer1994/ModernGL
refs/heads/master
examples/loading_obj_files.py
1
from pyrr import Matrix44 import moderngl from ported._example import Example class LoadingOBJ(Example): title = "Loading OBJ" gl_version = (3, 3) def __init__(self, **kwargs): super().__init__(**kwargs) self.obj = self.load_scene('sitting_dummy.obj') self.texture = self.load_te...
cbrucks/keystone_ldap
refs/heads/essex-eol-ldap
keystone/identity/backends/pam.py
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # 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...
YinongLong/scikit-learn
refs/heads/master
examples/linear_model/plot_sgd_separating_hyperplane.py
84
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
yize/grunt-tps
refs/heads/master
tasks/lib/python/Lib/python2.7/plat-mac/lib-scriptpackages/Finder/Enumerations.py
81
"""Suite Enumerations: Enumerations for the Finder Level 1, version 1 Generated from /System/Library/CoreServices/Finder.app AETE/AEUT resource version 0/144, language 0, script 0 """ import aetools import MacOS _code = 'tpnm' from StdSuites.Type_Names_Suite import * class Enumerations_Events(Type_Names_Suite_Event...
tyagiarpit/servo
refs/heads/master
tests/wpt/harness/wptrunner/executors/__init__.py
196
# 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/. from base import (executor_kwargs, testharness_result_converter, reftest_result_conv...
AlexanderplUs/kazoo
refs/heads/master
kazoo/tests/test_exceptions.py
50
from unittest import TestCase class ExceptionsTestCase(TestCase): def _get(self): from kazoo import exceptions return exceptions def test_backwards_alias(self): module = self._get() self.assertTrue(getattr(module, 'NoNodeException')) self.assertTrue(module.NoNodeExcep...
Overkiz/webiopi
refs/heads/master
python/webiopi/protocols/coap.py
4
# Copyright 2012-2013 Eric Ptak - trouch.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
ivmech/iviny-scope
refs/heads/master
lib/xlsxwriter/test/comparison/test_chart_format01.py
1
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest import os from ...workbook import Workbook from ..helperfunctions import _compare_xlsx_files class TestCompareXLSXFiles(unittest.TestC...
jimmycallin/master-thesis
refs/heads/master
architectures/conll16st-hd-sdp/conll16_datautilities.py
1
import sys from pandas import json import codecs from Common_Utilities import CommonUtilities class Conll2016DataUtilities(object): @staticmethod # Read relations data from pdtb file - relations.json # http://nbviewer.jupyter.org/github/attapol/conll16st/blob/master/tutorial/tutorial.ipynb#relations.json-...
koorukuroo/networkx_for_unicode
refs/heads/master
build/lib/networkx/exception.py
41
# -*- coding: utf-8 -*- """ ********** Exceptions ********** Base exceptions and errors for NetworkX. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)\nLoïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg...
Distrotech/intellij-community
refs/heads/master
python/testData/inspections/PyCompatibilityInspection/importElement.py
45
import <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not have module Bastion">Bastion</warning>
nimbis/django-allauth
refs/heads/master
allauth/socialaccount/providers/weixin/views.py
3
import requests from django.core.urlresolvers import reverse from allauth.utils import build_absolute_uri from allauth.account import app_settings from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, ...
fcopantoja/sips
refs/heads/master
sips/asuntos/apps.py
1
from __future__ import unicode_literals from django.apps import AppConfig class AsuntosConfig(AppConfig): name = 'asuntos'
r-praveen-jain/paparazzi
refs/heads/mpc_master
sw/ground_segment/python/redundant_link/link_combiner.py
21
#!/usr/bin/env python # This file is part of paparazzi. # paparazzi 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, or (at your option) # any later version. # paparazzi is distributed in t...
SpiderNight/Aeos
refs/heads/master
UniChan/commands.py
1
import discord import asyncio import urllib.request #importing modules used import json import re import random fp_osuapikey = open("apikey.txt", "r") osuapikey = fp_osuapikey.read() #reading personal osu apikey from apikey.txt fp_osuapikey.close() @asyncio.coroutine def runComm(msg, client): if msg.content....
mzdaniel/oh-mainline
refs/heads/master
vendor/packages/Django/tests/regressiontests/requests/__init__.py
272
""" Tests for Django's various Request objects. """
nvbn/thefuck
refs/heads/master
tests/rules/test_git_merge_unrelated.py
3
import pytest from thefuck.rules.git_merge_unrelated import match, get_new_command from thefuck.types import Command output = 'fatal: refusing to merge unrelated histories' def test_match(): assert match(Command('git merge test', output)) assert not match(Command('git merge master', '')) assert not matc...
tmcdonnell87/bananas
refs/heads/master
bananas/apps/message/models.py
1
import datetime from django.core.exceptions import ValidationError from django.db import models from django.utils import timezone from bananas.apps.message import SEND_EVENTS from bananas.apps.message import SEND_AFTER_RESTRICTED_EVENTS from bananas.utils.model_mixins import BaseModel class MessageTemplate(BaseMode...
fabiobatalha/analytics
refs/heads/master
analytics/views_website.py
1
#coding: utf-8 import requests from datetime import datetime from pyramid.view import view_config from dogpile.cache import make_region from citedby.custom_query import journal_titles from scielojcr import jcrindicators from analytics.control_manager import base_data_manager cache_region = make_region(name='views_we...
neumerance/cloudloon2
refs/heads/master
.venv/lib/python2.7/site-packages/setuptools/extension.py
284
import sys import distutils.core import distutils.extension from setuptools.dist import _get_unpatched _Extension = _get_unpatched(distutils.core.Extension) def have_pyrex(): """ Return True if Cython or Pyrex can be imported. """ pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext...
TeamTwisted/external_chromium_org
refs/heads/opti-5.1
tools/telemetry/telemetry/core/backends/chrome/inspector_network_unittest.py
34
# 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 telemetry.core.backends.chrome import inspector_network from telemetry.timeline import recording_options from telemetry.unittest import tab_test_case c...
Serg09/socorro
refs/heads/master
webapp-django/crashstats/symbols/utils.py
13
import zipfile import gzip import tarfile from cStringIO import StringIO class _ZipMember(object): def __init__(self, member, container): self.name = member.filename self.size = member.file_size self.container = container def extractor(self): return self.container.open(self.n...
Beauhurst/django
refs/heads/master
django/db/backends/base/operations.py
7
import datetime import decimal from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends import utils from django.utils import timezone from django.utils.dateparse import parse_duration from django.utils.encoding import force_te...
zhouzhenghui/python-for-android
refs/heads/master
python-modules/twisted/twisted/words/test/test_jabberjid.py
54
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.protocols.jabber.jid}. """ from twisted.trial import unittest from twisted.words.protocols.jabber import jid class JIDParsingTest(unittest.TestCase): def test_parse(self): """ Test dif...
phuonglm/node-gyp
refs/heads/master
gyp/pylib/gyp/MSVSSettings_test.py
778
#!/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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
hiankun/qb_test
refs/heads/master
qb_controller.py
1
import contextlib import time import numpy as np import Adafruit_BBIO.GPIO as GPIO import Adafruit_BBIO.PWM as PWM import Adafruit_BBIO.ADC as ADC def setup_motor(): # Initialize GPIO pins GPIO.setup(left_motor1, GPIO.OUT) GPIO.setup(left_motor2, GPIO.OUT) GPIO.setup(right_motor1, GPIO.OUT) GPIO....
harterj/moose
refs/heads/devel
python/mms/test/mms_spatial.py
12
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
stackforge/senlin
refs/heads/master
senlin/tests/unit/objects/test_notification.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 unde...
bhargav2408/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/tracedmodules/__init__.py
326
"""This package contains modules that help testing the trace.py module. Note that the exact location of functions in these modules is important, as trace.py takes the real line numbers into account. """
maaydogmus/bone101
refs/heads/master
examples/PyBBIO/serial_server.py
5
# serial_server.py - Alexander Hiam - 4/15/12 # # Creates a simple web interface to the Serial2 port. # # Serial2 TX = pin 21 on P9 header # Serial2 RX = pin 22 on P9 header # # Run this program and navigate to http://your_beaglebone_ip:8000 # in your web brower. # # See BBIOServer tutorial: # https://github.com/alex...
samdowd/drumm-farm
refs/heads/master
drumm_env/lib/python2.7/site-packages/tinymce/widgets.py
2
# Copyright (c) 2008 Joost Cassee # Licensed under the terms of the MIT License (see LICENSE.txt) """ This TinyMCE widget was copied and extended from this code by John D'Agostino: http://code.djangoproject.com/wiki/CustomWidgetsTinyMCE """ from __future__ import unicode_literals import tinymce.settings from django i...
followyourheart/SFrame
refs/heads/master
cxxtest/python/python3/cxxtest/cxx_parser.py
55
#------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v3 # For more information, see the COPYING file in the top CxxTest directory. # Under the terms of ...
fancasy/final
refs/heads/master
lib/flask/json.py
4
# -*- coding: utf-8 -*- """ flask.jsonimpl ~~~~~~~~~~~~~~ Implementation helpers for the JSON support in Flask. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import io import uuid from datetime import datetime from .globals import current_app...
CapOM/ChromiumGStreamerBackend
refs/heads/master
native_client_sdk/src/build_tools/update_nacl_manifest.py
20
#!/usr/bin/env python # Copyright (c) 2012 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. """Script that reads omahaproxy and gsutil to determine version of SDK to put in manifest. """ # pylint is convinced the email mod...
frostburn/frostsynth
refs/heads/master
frostsynth/filters/__init__.py
1
from frostsynth.filters.base import * from frostsynth.filters.delay import * from frostsynth.filters.basic import * from frostsynth.filters.advanced import *
nathanaevitas/odoo
refs/heads/master
openerp/tools/float_utils.py
312
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
UIKit0/friture
refs/heads/master
friture/levels.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009 Timoth?Lecomte # This file is part of Friture. # # Friture is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # Friture is distribu...
916253/Kurisu
refs/heads/master
addons/assistance.py
1
import discord from discord.ext import commands from addons.checks import check_staff from inspect import cleandoc class Assistance: """ Commands that will mostly be used in #help-and-questions. """ def __init__(self, bot): self.bot = bot self.systems = ("3ds", "wiiu", "switch", "nx", "...
wolfgangz2013/rt-thread
refs/heads/master
bsp/imxrt/imxrt1050-ArchMix/rtconfig.py
9
import os # toolchains options ARCH='arm' CPU='cortex-m7' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC...
clinc/models
refs/heads/master
im2txt/im2txt/inference_utils/vocabulary.py
31
# 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...
Gagaro/django
refs/heads/master
django/conf/locale/eo/formats.py
504
# -*- 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 = r'j\-\a \d\e F Y' # '26-a ...
jamesblunt/kaggle-galaxies
refs/heads/master
predict_augmented_npy_8433n_maxout2048.py
7
""" Load an analysis file and redo the predictions on the validation set / test set, this time with augmented data and averaging. Store them as numpy files. """ import numpy as np # import pandas as pd import theano import theano.tensor as T import layers import cc_layers import custom import load_data import realtime...
nightjean/Deep-Learning
refs/heads/master
tensorflow/contrib/solvers/python/kernel_tests/linear_equations_test.py
107
# 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...
asedunov/intellij-community
refs/heads/master
python/testData/paramInfo/SimpleFunction.py
83
def foo(a, b, c): pass foo(<arg1>1, <arg2>2, <arg3>3)
jerbob92/CouchPotatoServer
refs/heads/master
libs/chardet/hebrewprober.py
215
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
zbqf109/goodo
refs/heads/master
openerp/addons/mail/tests/common.py
16
# -*- coding: utf-8 -*- from openerp.tests import common class TestMail(common.SavepointCase): @classmethod def _init_mock_build_email(cls): cls._mails_args = [] cls._mails = [] def format_and_process(self, template, to='groups@example.com, other@gmail.com', subject='Frogs', ...
n0max/servo
refs/heads/master
tests/wpt/web-platform-tests/service-workers/service-worker/resources/notification_icon.py
80
import urlparse def main(req, res): qs_cookie_val = urlparse.parse_qs(req.url_parts.query).get('set-cookie-notification') if qs_cookie_val: res.set_cookie('notification', qs_cookie_val[0]) return 'not really an icon'
hugochan/KATE
refs/heads/master
autoencoder/preprocessing/preprocessing.py
1
''' Created on Dec, 2016 @author: hugo ''' from __future__ import absolute_import import os import re import string import codecs import numpy as np from collections import defaultdict from nltk.tokenize import wordpunct_tokenize from nltk.stem.porter import PorterStemmer as EnglishStemmer # from nltk.tokenize import...
beblount/Steer-Clear-Backend-Web
refs/heads/web
env/Lib/site-packages/wtforms/widgets/html5.py
153
""" Widgets for various HTML5 input types. """ from .core import Input __all__ = ( 'ColorInput', 'DateInput', 'DateTimeInput', 'DateTimeLocalInput', 'EmailInput', 'MonthInput', 'NumberInput', 'RangeInput', 'SearchInput', 'TelInput', 'TimeInput', 'URLInput', 'WeekInput', ) class SearchInput(Input): "...
moshele/networking-mlnx-master
refs/heads/master
neutron/plugins/mlnx/common/config.py
10
# Copyright 2013 Mellanox Technologies, Ltd # # 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...
unnikrishnankgs/va
refs/heads/master
venv/lib/python3.5/site-packages/numpy/core/_methods.py
35
""" Array methods which are called by both the C-code for the method and the Python code for the NumPy-namespace function """ from __future__ import division, absolute_import, print_function import warnings from numpy.core import multiarray as mu from numpy.core import umath as um from numpy.core.numeric import asan...
wagavulin/arrow
refs/heads/master
python/benchmarks/convert_builtins.py
14
# 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...
jrmuizel/kemufuzzer
refs/heads/master
gdb.py
3
# This file is part of KEmuFuzzer. # # KEmuFuzzer 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. # # KEmuFuzzer is distributed in th...
jamesmaxwell/gfwlist2pac
refs/heads/master
gfwlist2pac/main.py
5
#!/usr/bin/python # -*- coding: utf-8 -*- import pkgutil import urlparse import json import logging import urllib2 from argparse import ArgumentParser __all__ = ['main'] gfwlist_url = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt' def parse_args(): parser = ArgumentParser() parser.add_ar...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/lib/rsa/common.py
216
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Unl...
Mtax/explainshell
refs/heads/master
explainshell/util.py
8
import itertools from operator import itemgetter def consecutive(l, fn): '''yield consecutive items from l that fn returns True for them >>> even = lambda x: x % 2 == 0 >>> list(consecutive([], even)) [] >>> list(consecutive([1], even)) [[1]] >>> list(consecutive([1, 2], even)) [[1], [...
bbansalWolfPack/servo
refs/heads/master
tests/wpt/web-platform-tests/websockets/handlers/echo-query_wsh.py
266
#!/usr/bin/python from mod_pywebsocket import msgutil, util def web_socket_do_extra_handshake(request): pass # Always accept. def web_socket_transfer_data(request): msgutil.send_message(request, request.unparsed_uri.split('?', 1)[1] or '')
itsmemattchung/speedcurve.py
refs/heads/master
speedcurve/deployments.py
1
from .models import SpeedCurveCore class Deployment(SpeedCurveCore): """Deployment class.""" def _update_attributes(self, json): self.id = json.get('deploy_id') self.tests_completed = json.get('tests-completed') self.status = json.get('status') self.site_id = json.get('site_id...
Vixionar/django
refs/heads/master
django/db/backends/base/operations.py
192
import datetime import decimal import warnings from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends import utils from django.utils import six, timezone from django.utils.dateparse import parse_duration from django.utils.dep...
rakeshmi/tempest
refs/heads/master
tempest/common/accounts.py
2
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 re...
misli/python3-openid
refs/heads/master
openid/extension.py
13
import warnings from openid import message as message_module class Extension(object): """An interface for OpenID extensions. @ivar ns_uri: The namespace to which to add the arguments for this extension """ ns_uri = None ns_alias = None def getExtensionArgs(self): """Get the ...
fingi/csipsimple
refs/heads/master
jni/pjsip/sources/tests/pjsua/scripts-recvfrom/301_timer_good_retry_after_422.py
57
# $Id: 301_timer_good_retry_after_422.py 3287 2010-08-18 14:30:17Z nanang $ import inc_sip as sip import inc_sdp as sdp # Session timers retry after 422 pjsua = "--null-audio sip:127.0.0.1:$PORT --timer-min-se 100 --timer-se 1000" # First INVITE with timer rejected with 422 req1 = sip.RecvfromTransaction("INVITE wi...
minixalpha/SourceLearning
refs/heads/master
webpy/sample/googlemodules/src/config_example.py
3
# Author: Alex Ksikes import web from app.helpers import utils from app.helpers import formatting # connect to database db = web.database(dbn='mysql', db='dbname', user='user', passwd='passwd', charset=None) # in development debug error messages and reloader web.config.debug = True # in develpment template caching...
svenstaro/OpenShadingLanguage
refs/heads/master
testsuite/component-range/run.py
227
#!/usr/bin/env python command = testshade("test")
abought/osf.io
refs/heads/develop
website/files/models/s3.py
39
from website.files.models.base import File, Folder, FileNode __all__ = ('S3File', 'S3Folder', 'S3FileNode') class S3FileNode(FileNode): provider = 's3' class S3Folder(S3FileNode, Folder): pass class S3File(S3FileNode, File): version_identifier = 'version'
fujimisakari/django-actionlog
refs/heads/master
django_actionlog/actionlog.py
1
# -*- coding: utf-8 -*- try: from django.conf import settings ACTION_LOG_SETTING = settings.ACTION_LOG_SETTING except AttributeError: ACTION_LOG_SETTING = {'handler_type': 'null', 'logfile': '/tmp/django_action.log'} from .handler import handler_manager class ActionLog(object): def __init__(self, c...
scalyr/scalyr-agent-2
refs/heads/master
scalyr_agent/third_party/pysnmp/hlapi/asyncore/sync/ntforg.py
2
from pysnmp.hlapi.asyncore import ntforg __all__ = ['sendNotification'] def sendNotification(snmpEngine, authData, transportTarget, contextData, notifyType, varBinds, **options): """Creates a generator to send one or more SNMP notifications. On each iteration, new SNMP TRAP or INFORM not...
nhicher/ansible
refs/heads/devel
test/units/plugins/filter/test_ipaddr.py
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. # # Ansible is distributed in the hope that ...
pipermerriam/ethereum-abi-utils
refs/heads/master
tests/test_packed/test_is_encodable_packed.py
1
from hypothesis import ( given, settings, ) import pytest from eth_abi.packed import ( is_encodable_packed, ) from tests.common.strategies import ( single_strs_values, tuple_strs_values, ) from tests.common.unit import ( CORRECT_SINGLE_ENCODINGS, NOT_ENCODABLE, ) @pytest.mark.parametrize(...
redlink-gmbh/redlink-python-sdk
refs/heads/master
redlink/data.py
1
# -*- coding: utf8 -*- # 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, softwar...
openstack/designate
refs/heads/master
designate/storage/impl_sqlalchemy/migrate_repo/versions/083_change_managed_column_types.py
2
# Copyright 2016 Hewlett Packard Enterprise Development Company LP # # Author: Federico Ceratto <federico.ceratto@hpe.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
plotly/plotly.py
refs/heads/master
packages/python/plotly/plotly/validators/ohlc/stream/_token.py
1
import _plotly_utils.basevalidators class TokenValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="token", parent_name="ohlc.stream", **kwargs): super(TokenValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
jacobbridges/veggiecron-server
refs/heads/master
src/scheduler/parser.py
1
""" src/scheduler/parser.py Parse job schedule strings into date of next job execution. """ from datetime import timedelta from ..utils.dates import utc_to_date schedule_string_syntax = """ Schedule string must be one of the following formats: * "every hour" * "every 2 hours" * "every 2 minutes" * "every 1...
Prithiviksit/I-Start-To-Learn-Python
refs/heads/master
2048game.py
1
```python import random n=int(input("the scale of your matric:")) end=int(input("your goal:")) a=[[0 for col in range(n)] for row in range(n)] def move_left(x): for i in range(n): for j in range(n): if j>0: if x[i][j-1]==0: xyg=0 for k in...
tempbottle/ssdb-rocks
refs/heads/master
deps/cpy/antlr3/exceptions.py
118
"""ANTLR3 exception hierarchy""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source c...
rubyinhell/brython
refs/heads/master
www/src/Lib/test/test_pep3151.py
34
import builtins import os import select import socket import sys import unittest import errno from errno import EEXIST from test import support class SubOSError(OSError): pass class SubOSErrorWithInit(OSError): def __init__(self, message, bar): self.bar = bar super().__init__(message) class ...
xiaopeng163/getting-started-with-wsgi
refs/heads/master
code/cgi/environ.py
1
#!/usr/bin/env python import os print "Content-Type: text/html" print print "<html>\n" for i in os.environ: print '<h3>%s => %s</h3>' % (i, os.environ[i]) print '</body>' print '</html>'
jjscarafia/odoo
refs/heads/master
addons/stock/procurement.py
17
# -*- 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...