repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
beeverycreative/BEEweb
refs/heads/master
src/octoprint/server/util/connection_util.py
1
# coding=utf-8 import logging import threading from time import sleep from beedriver.connection import Conn as BeePrinterConn from octoprint.settings import settings class ConnectionMonitorThread(threading.Thread): def __init__(self, connection_callback): """ Thread class to check if a BVC printer was connected ...
bmya/odoo-argentina
refs/heads/11.0
l10n_ar_account/report/account_ar_vat_line.py
1
from odoo import tools, models, fields, api, _ # from ast import literal_eval class AccountArVatLine(models.Model): """ Modelo base para nuevos reportes argentinos de iva. La idea es que estas lineas tenga todos los datos necesarios y que frente a cambios en odoo, los mismos sean abosrvidos por este c...
plotly/plotly.py
refs/heads/master
packages/python/plotly/plotly/validators/scattergeo/marker/line/_colorscale.py
1
import _plotly_utils.basevalidators class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator): def __init__( self, plotly_name="colorscale", parent_name="scattergeo.marker.line", **kwargs ): super(ColorscaleValidator, self).__init__( plotly_name=plotly_name, ...
sergio-incaser/odoo
refs/heads/8.0
addons/association/__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...
Feshchenkostanislav/drupal7
refs/heads/master
sites/all/themes/myomega/node_modules/node-gyp/gyp/buildbot/buildbot_run.py
1467
#!/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. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess import sys BUILDBOT_DIR = os....
darren-wang/gl
refs/heads/master
glance/db/sqlalchemy/metadef_api/namespace.py
6
# 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...
andymckay/zamboni
refs/heads/master
migrations/654-award-theme-points.py
113
#!/usr/bin/env python def run(): return
oandrew/home-assistant
refs/heads/dev
tests/components/camera/test_generic.py
13
"""The tests for generic camera component.""" import asyncio from unittest import mock from homeassistant.bootstrap import setup_component @asyncio.coroutine def test_fetching_url(aioclient_mock, hass, test_client): """Test that it fetches the given url.""" aioclient_mock.get('http://example.com', text='hell...
RuiShu/bcde
refs/heads/master
config.py
1
import argparse import sys parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) # General settings parser.add_argument("--run", type=int, default=0, help="Run index. Use 0 if first run.") parser.add_argument("--n-save", type=int, default=50, hel...
masayukig/tempest
refs/heads/master
tempest/api/identity/admin/v2/test_roles.py
3
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
axbaretto/beam
refs/heads/master
sdks/python/apache_beam/utils/interactive_utils.py
5
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
mumax/1
refs/heads/release
test/excitation/pointwise.py
1
# Micromagnetic standard problem 4 from mumax import * # material msat(800e3) aexch(1.3e-11) alpha(2) # geometry nx = 64 ny = 64 gridsize(nx, ny, 1) partsize(500e-9, 500e-9, 50e-9) # initial magnetization uniform(1, 1, 0) # run autosave("table", "ascii", 1e-12) applypointwise('field', 1e-9, 1e-3, 0,...
Etwigg/Examples
refs/heads/master
Group Project Website/venv/Lib/site-packages/pip/commands/show.py
344
from __future__ import absolute_import from email.parser import FeedParser import logging import os from pip.basecommand import Command from pip.status_codes import SUCCESS, ERROR from pip._vendor import pkg_resources from pip._vendor.packaging.utils import canonicalize_name logger = logging.getLogger(__name__) c...
Skryptex/SKX-EDIT
refs/heads/master
share/qt/extract_strings_qt.py
2945
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
StratoDem/sd-data-table
refs/heads/master
sd_data_table/__init__.py
1
import os as _os import dash as _dash import sys as _sys from .version import __version__ _current_path = _os.path.dirname(_os.path.abspath(__file__)) _components = _dash.development.component_loader.load_components( _os.path.join(_current_path, 'metadata.json'), 'sd_data_table' ) _this_module = _sys.modules...
bentilly/heroes
refs/heads/development
lib/werkzeug/contrib/sessions.py
295
# -*- coding: utf-8 -*- r""" werkzeug.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains some helper classes that help one to add session support to a python WSGI application. For full client-side session storage see :mod:`~werkzeug.contrib.securecookie` which implements a secure,...
reddraggone9/youtube-dl
refs/heads/master
youtube_dl/extractor/ruhd.py
149
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor class RUHDIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?ruhd\.ru/play\.php\?vid=(?P<id>\d+)' _TEST = { 'url': 'http://www.ruhd.ru/play.php?vid=207', 'md5': 'd1a9ec4edf8598e3fbd92bb16072ba83'...
MoritzS/django
refs/heads/master
tests/utils_tests/test_termcolors.py
134
import unittest from django.utils.termcolors import ( DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES, colorize, parse_color_setting, ) class TermColorTests(unittest.TestCase): def test_empty_string(self): self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.6/Lib/plat-os2emx/SOCKET.py
134
# Generated by h2py from f:/emx/include/sys/socket.h # Included from sys/types.h FD_SETSIZE = 256 # Included from sys/uio.h FREAD = 1 FWRITE = 2 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 SOCK_RDM = 4 SOCK_SEQPACKET = 5 SO_DEBUG = 0x0001 SO_ACCEPTCONN = 0x0002 SO_REUSEADDR = 0x0004 SO_KEEPALIVE = 0x0008 SO_DONTROUTE...
youdonghai/intellij-community
refs/heads/master
python/testData/inspections/PyMethodMayBeStaticInspection/abc.py
488
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" import types from _weakrefset import WeakSet # Instance of old-style class class _C: pass _InstanceType = type(_C()) def abstractmethod(funcobj): """A d...
ondras/TeaJS
refs/heads/master
deps/v8/build/gyp/test/include_dirs/gyptest-all.py
261
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies use of include_dirs when using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('...
YongseopKim/crosswalk-test-suite
refs/heads/master
webapi/webapi-nfc-w3c-tests/inst.wgt.py
294
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
qbit/node-gyp
refs/heads/master
gyp/pylib/gyp/generator/ninja_test.py
260
#!/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 ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
root-mirror/root
refs/heads/master
tutorials/roofit/rf707_kernelestimation.py
11
## \file ## \ingroup tutorial_roofit ## \notebook ## Special pdf's: using non-parametric (multi-dimensional) kernel estimation pdfs ## ## \macro_code ## ## \date February 2018 ## \authors Clemens Lange, Wouter Verkerke (C++ version) import ROOT # Create low stats 1D dataset # ----------------------------------------...
fx2003/tensorflow-study
refs/heads/master
TensorFlow实战/4-2multilayer_perceptron.py
1
from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf mnist = input_data.read_data_sets("MNIST_data/", one_hot = True) sess = tf.InteractiveSession() in_units = 784 h1_units = 300 W1 = tf.Variable(tf.truncated_normal([in_units, h1_units], stddev = 0.1)) b1 = tf.Variable(tf.zeros([h1_units]...
fidomason/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py
3126
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
adit-chandra/tensorflow
refs/heads/master
tensorflow/python/util/deprecation.py
12
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
fangxingli/hue
refs/heads/master
desktop/core/ext-py/guppy-0.1.10/guppy/etc/__init__.py
37
#._cv_part guppy.etc class _GLUECLAMP_: def _get_iterpermute(self): return self.IterPermute.iterpermute def _get_unpack(self): return self.Unpack.unpack
ktok07b6/polyphony
refs/heads/master
tests/error/seq_capacity01.py
1
#Sequence capacity is overflowing from polyphony import testbench from polyphony.typing import List, bit def seq_capacity01(xs:List[bit][4]): return xs[7] @testbench def test(): data = [0, 1, 1, 0, 1] # type: List[bit][4] seq_capacity01(data) test()
bwasti/caffe2
refs/heads/master
caffe2/python/predictor/mobile_exporter_test.py
1
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python.test_util import TestCase from caffe2.python import workspace, brew from caffe2.python.model_helper import ModelHelper from caffe2.python.predictor impo...
HP-Scale-out-Storage/libstoragemgmt
refs/heads/master
python_binding/lsm/_pluginrunner.py
2
# Copyright (C) 2011-2013 Red Hat, Inc. # 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 any later version. # # This library is distributed in the h...
adrianholovaty/django
refs/heads/master
tests/regressiontests/fixtures_regress/models.py
33
from __future__ import absolute_import from django.contrib.auth.models import User from django.db import models class Animal(models.Model): name = models.CharField(max_length=150) latin_name = models.CharField(max_length=150) count = models.IntegerField() weight = models.FloatField() # use a non...
AICP/kernel_lge_msm8974
refs/heads/mm6.0
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gonboy/sl4a
refs/heads/master
python/src/Lib/test/test_stringprep.py
58
# To fully test this module, we would need a copy of the stringprep tables. # Since we don't have them, this test checks only a few codepoints. import unittest from test import test_support from stringprep import * class StringprepTests(unittest.TestCase): def test(self): self.failUnless(in_table_a1(u"\u...
surhudm/scipy
refs/heads/master
scipy/optimize/tests/test_hungarian.py
48
# Author: Brian M. Clapper, G. Varoquaux, Lars Buitinck # License: BSD from numpy.testing import assert_array_equal, assert_raises import numpy as np from scipy.optimize import linear_sum_assignment def test_linear_sum_assignment(): for cost_matrix, expected_cost in [ # Square ([[400, 150, 400]...
emanuelvianna/microcelery
refs/heads/master
microcelery/microcelery.py
2
# coding: utf8 from redis import Redis import settings from task import Task class MicroCelery(object): def __init__(self): self._tasks = {} self.rds = Redis() def task(self, func): task = Task(self, func) self._tasks[func.__name__] = task return task def add_t...
KublaikhanGeek/scrapy
refs/heads/master
scrapy/utils/request.py
44
""" This module provides some useful functions for working with scrapy.http.Request objects """ from __future__ import print_function import hashlib import weakref from six.moves.urllib.parse import urlunparse from w3lib.http import basic_auth_header from scrapy.utils.python import to_bytes, to_native_str from scrap...
krisys/django
refs/heads/master
django/contrib/gis/db/models/sql/__init__.py
476
from django.contrib.gis.db.models.sql.conversion import ( AreaField, DistanceField, GeomField, GMLField, ) __all__ = [ 'AreaField', 'DistanceField', 'GeomField', 'GMLField' ]
fernandoacorreia/DjangoWAWSLogging
refs/heads/master
DjangoWAWSLogging/env/Lib/site-packages/django/utils/dateformat.py
82
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print df.format('jS F Y H:i') 7th October 2003 11:39 >>> """ import re import time import calendar import datetime from django.utils.dates import M...
ondra-novak/chromium.src
refs/heads/nw
chrome/common/extensions/docs/server2/availability_finder.py
6
# Copyright 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 posixpath from api_models import GetNodeCategories from api_schema_graph import APISchemaGraph from branch_utility import BranchUtility, ChannelInfo ...
DirtyUnicorns/android_external_chromium-org
refs/heads/kitkat
third_party/bintrees/bintrees/__init__.py
156
#!/usr/bin/env python #coding:utf-8 # Author: mozman # Purpose: binary trees package # Created: 03.05.2010 # Copyright (c) 2010-2013 by Manfred Moitzi # License: MIT License from __future__ import absolute_import __doc__ = """ Binary Tree Package =================== Python Trees ------------ Balanced and unbalance...
lavvy/osmc
refs/heads/master
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x003.py
246
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
baharev/sdopt-tearing
refs/heads/master
ilp_tear.py
1
# Copyright (C) 2014, 2015 University of Vienna # All rights reserved. # BSD license. # Author: Ali Baharev <ali.baharev@gmail.com> from __future__ import division, print_function from contextlib import contextmanager from time import time from six import iteritems, itervalues from gurobipy import LinExpr, GRB, Model, ...
nozuono/calibre-webserver
refs/heads/master
src/html5lib/treebuilders/etree_lxml.py
1724
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
vmware/pyvmomi-tools
refs/heads/master
pyvmomi_tools/cli/cursor.py
4
# Copyright (c) 2014 VMware, Inc. 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 applicable law...
andrius-preimantas/odoo
refs/heads/master
addons/hr_timesheet_invoice/report/report_analytic.py
299
# -*- 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...
uclouvain/osis
refs/heads/dev
base/migrations/0028_auto_20160412_1219.py
3
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-04-12 10:19 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0027_auto_20160406_1706'), ] operations = [ migrations.AlterField( ...
marqueedev/django
refs/heads/master
tests/template_tests/filter_tests/test_time.py
326
from datetime import time from django.template.defaultfilters import time as time_filter from django.test import SimpleTestCase from django.utils import timezone from ..utils import setup from .timezone_utils import TimezoneTestCase class TimeTests(TimezoneTestCase): """ #20693: Timezone support for the tim...
smajda/django-nopassword
refs/heads/master
docs/conf.py
3
# -*- coding: utf-8 -*- # # django_nopassword documentation build configuration file, created by # sphinx-quickstart on Thu Feb 27 20:16:47 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated f...
hethapu/python-twitter
refs/heads/master
setup.py
17
#!/usr/bin/env python # # Copyright 2007-2014 The Python-Twitter Developers # # 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 ...
lokirius/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/base/service.py
166
#!/usr/bin/python # # Copyright (C) 2006 Google 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 ...
sogelink/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_snmp_host.py
10
#!/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...
cuckoobox/cuckoo
refs/heads/master
tests/test_resultserver.py
1
# Copyright (C) 2017 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import mock import pytest import tempfile from cuckoo.common.exceptions import CuckooOperationalError from cuckoo.core.log import task_log_s...
kwailamchan/programming-languages
refs/heads/master
cpp/deeplearning/caffe/scripts/copy_notebook.py
75
#!/usr/bin/env python """ Takes as arguments: 1. the path to a JSON file (such as an IPython notebook). 2. the path to output file If 'metadata' dict in the JSON file contains 'include_in_docs': true, then copies the file to output file, appending the 'metadata' property as YAML front-matter, adding the field 'categor...
TeamLovely/django-migrations-plus
refs/heads/master
migrations_plus/tests.py
1
from django.db import connection from django.db import router, DEFAULT_DB_ALIAS from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.migrations.migration import Migration from django.db.migrations.state import ProjectState from django.test import TestCase from unittest.mock import patch im...
canvasnetworks/canvas
refs/heads/master
website/canvas/migrations/0147_auto__add_field_commentsticker_epic_message.py
2
# encoding: 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 'CommentSticker.epic_message' db.add_column('canvas_commentsticker', 'epic_message', self.g...
rosihorrorshow/askbot-devel
refs/heads/master
askbot/migrations/0002_auto__add_field_answer_text__chg_field_answer_html__add_field_question.py
20
# encoding: utf-8 import os 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 'Answer.text' db.add_column(u'answer', 'text', self.gf('django.db.models.fiel...
hjhhh3000/FirstBlood
refs/heads/master
ChWSeg/PreTreatment/SentenceSeg.py
1
''' File: SentenceSeg.py ''' ''' Hydrogenium 12/14/2014 ''' ''' Chinese Sentence Segmentation v0.51 Update date: 12/19/2014 ''' #-*- coding:utf-8 -*- def SentenceSeg(Origin): ''' This function turns the original input into a list of sentences. ''' def IsAWord(Left,Right): ''' Judge ...
audoe/ztq
refs/heads/master
ztq_core/ztq_core/async.py
3
# -*- encoding:utf-8 -*- import types from task import register, push_task, has_task, gen_task, push_buffer_task import transaction use_transaction = False def _setup_callback(kw): callback = kw.pop('ztq_callback', None) if callback is not None: callback_func, callback_args, callback_kw = callback ...
icloudrnd/automation_tools
refs/heads/master
openstack_dashboard/dashboards/router/nexus1000v/forms.py
35
# 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 # d...
rlutz/xorn
refs/heads/master
tests/python/snippets/xml_writer.py
1
# Copyright (C) 2013-2019 Roland Lutz # # 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. # # This program is distributed ...
rpavlik/chromium
refs/heads/cmake-fixing
crserverlib/server_simpleget.py
4
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys sys.path.append( "../glapi_parser" ) import apiutil apiutil.CopyrightC() print """#include "cr_spu.h" #include "chromium.h" #include "cr_error.h" #include "cr_me...
zadgroup/edx-platform
refs/heads/master
common/lib/capa/capa/safe_exec/lazymod.py
193
"""A module proxy for delayed importing of modules. From http://barnesc.blogspot.com/2006/06/automatic-python-imports-with-autoimp.html, in the public domain. """ import sys class LazyModule(object): """A lazy module proxy.""" def __init__(self, modname): self.__dict__['__name__'] = modname ...
popeye123/ytcc
refs/heads/master
ytcc/exceptions.py
1
# ytcc - The YouTube channel checker # Copyright (C) 2019 Wolfgang Popp # # This file is part of ytcc. # # ytcc 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...
Hubert51/AutoGrading
refs/heads/master
learning/web_Haotian/venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py
356
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName, Attrs from genshi.core import START, END, TEXT, COMMENT, DOCTYPE def to_genshi(walker): text = [] for token in walker: type = token["type"] if type in ("Characters", "SpaceCharacters"): ...
neuropoly/spinalcordtoolbox
refs/heads/master
spinalcordtoolbox/image.py
1
#!/usr/bin/env python ######################################################################################### # # SCT Image API # # --------------------------------------------------------------------------------------- # Copyright (c) 2018 Polytechnique Montreal <www.neuro.polymtl.ca> # # About the license: see the ...
sahildua2305/nlp1-norvig
refs/heads/master
norvig-script.py
1
import re, collections def words(text): return re.findall('[a-z]+', text.lower()) def train(features): model = collections.defaultdict(lambda: 1) for f in features: model[f] += 1 return model NWORDS = train(words(file('big.txt').read())) alphabet = 'abcdefghijklmnopqrstuvwxyz' def edits1(word)...
kustodian/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/aws_batch_job_definition.py
5
#!/usr/bin/python # Copyright (c) 2017 Jon Meran <jonathan.meran@sonos.com> # 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', ...
was4444/chromium.src
refs/heads/nw15
tools/android/loading/page_track_unittest.py
15
# Copyright 2016 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 unittest import devtools_monitor from page_track import PageTrack class MockDevToolsConnection(object): def __init__(self): self.stop_has_been...
kotky/smart-apps
refs/heads/master
smartapps/urls.py
1
from django.conf.urls import include, url from django.contrib import admin admin.autodiscover() import multimeter.views # Examples: # url(r'^$', 'smartapps.views.home', name='home'), # url(r'^blog/', include('blog.urls')), urlpatterns = [ url(r'^$', multimeter.views.index, name='index'), url(r'^db', multime...
Ffreasy/crazyflie-clients-python
refs/heads/develop
lib/cfzmq.py
7
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright ...
t794104/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint_info.py
12
#!/usr/bin/python # 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', 'status': ['preview'], 'supported...
IKholopov/HackUPC2017
refs/heads/master
hackupc/env/lib/python3.5/site-packages/django/contrib/auth/migrations/0003_alter_user_email_max_length.py
586
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0002_alter_permission_name_max_length'), ] operations = [ migrations.AlterField( model_name='user', ...
navycrow/Sick-Beard
refs/heads/development
lib/hachoir_metadata/program.py
90
from lib.hachoir_metadata.metadata import RootMetadata, registerExtractor from lib.hachoir_parser.program import ExeFile from lib.hachoir_metadata.safe import fault_tolerant, getValue class ExeMetadata(RootMetadata): KEY_TO_ATTR = { u"ProductName": "title", u"LegalCopyright": "copyright", u...
kant/inasafe
refs/heads/develop
safe/impact_functions/inundation/flood_vector_building_impact/test/__init__.py
20
__author__ = 'lucernae' __project_name__ = 'inasafe' __filename__ = '__init__.py' __date__ = '18/03/15' __copyright__ = 'lana.pcfre@gmail.com'
Imaginashion/cloud-vision
refs/heads/master
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/wheel/util.py
345
"""Utility functions.""" import sys import os import base64 import json import hashlib try: from collections import OrderedDict except ImportError: OrderedDict = dict __all__ = ['urlsafe_b64encode', 'urlsafe_b64decode', 'utf8', 'to_json', 'from_json', 'matches_requirement'] def urlsafe_b64encode(d...
cmvelo/ansible-modules-extras
refs/heads/devel
cloud/amazon/route53_health_check.py
10
#!/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 distributed...
fabianlee/blogcode
refs/heads/master
py-zabbix/ZabbixGetMetrics.py
1
#!/usr/bin/python import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) import time from zabbix.api import ZabbixAPI # argument check if len(sys.argv)<5: print "USAGE: zabbixURL user pass host itemName" print "EXAMPLE: http://127.0.0.1/zabbix Admin zabbix myhost mystr1" sys.exit...
grap/OCB
refs/heads/7.0
openerp/tests/addons/test_uninstall/models.py
94
# -*- coding: utf-8 -*- import openerp from openerp.osv import fields from openerp.osv.orm import Model class test_uninstall_model(Model): """ This model uses different types of columns to make it possible to test the uninstall feature of OpenERP. """ _name = 'test_uninstall.model' _columns = ...
jkern/bigcouch
refs/heads/master
couchjs/scons/scons-local-2.0.1/SCons/Tool/mslink.py
61
"""SCons.Tool.mslink Tool-specific initialization for the Microsoft linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SC...
lampsbr/grimorio
refs/heads/master
vendor/psy/psysh/test/tools/vis.py
710
""" vis.py ====== Ctypes based module to access libbsd's strvis & strunvis functions. The `vis` function is the equivalent of strvis. The `unvis` function is the equivalent of strunvis. All functions accept unicode string as input and return a unicode string. Constants: ---------- * to select alternate encoding for...
gaoning777/YCSB-C-DTranx
refs/heads/master
Test/UnitTest/gtest/test/gtest_shuffle_test.py
3023
#!/usr/bin/env python # # Copyright 2009 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
Tendrl/commons
refs/heads/master
tendrl/commons/objects/node/flows/stop_services/__init__.py
1
from tendrl.commons import flows from tendrl.commons.flows.exceptions import FlowExecutionFailedError from tendrl.commons.utils import cmd_utils from tendrl.commons.utils import log_utils as logger class StopServices(flows.BaseFlow): def __init__(self, *args, **kwargs): super(StopServices, self).__init__(...
jiangzhuo/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_fnmatch.py
173
"""Test cases for the fnmatch module.""" from test import support import unittest from fnmatch import fnmatch, fnmatchcase, translate, filter class FnmatchTestCase(unittest.TestCase): def check_match(self, filename, pattern, should_match=1, fn=fnmatch): if should_match: self.assertTrue(fn(fi...
JimCircadian/ansible
refs/heads/devel
lib/ansible/modules/windows/win_toast.py
24
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in th...
saukrIppl/seahub
refs/heads/master
thirdpart/Django-1.8.10-py2.7.egg/django/contrib/gis/gdal/__init__.py
130
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-su...
RunningLight/machinekit
refs/heads/master
lib/python/gladevcp/hal_pyngcgui.py
26
#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright: 2013 # Author: Dewey Garrett <dgarrett@panix.com> # # 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 F...
palashahuja/pgmpy
refs/heads/dev
pgmpy/base/UndirectedGraph.py
2
#!/usr/bin/env python3 import itertools import networkx as nx class UndirectedGraph(nx.Graph): """ Base class for all the Undirected Graphical models. UndirectedGraph assumes that all the nodes in graph are either random variables, factors or cliques of random variables and edges in the graphs ...
rentalita/django-layoutdemo
refs/heads/master
src/python/layoutdemo/default/tasks.py
22
# -*- coding: utf-8 -*- # Local Variables: # indent-tabs-mode: nil # End: # vim: ai et sw=4 ts=4
the-adrian/KernotekV2.0
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py
3132
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
KellyChan/python-examples
refs/heads/master
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/conf/locale/mk/formats.py
251
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_F...
sinbazhou/odoo
refs/heads/8.0
addons/payment_ogone/tests/test_ogone.py
430
# -*- coding: utf-8 -*- from lxml import objectify import time import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_ogone.controllers.main import OgoneController from openerp.tools i...
azureplus/hue
refs/heads/master
desktop/libs/libzookeeper/setup.py
30
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
wesleybowman/UTide
refs/heads/master
tests/test_harmonics.py
1
""" Test for FUV in harmonics.py. The test data are generated using octave with a slight modification of ut_FUV extracted from ut_solv.m. The data-generating script is make_FUV_data.py. """ import os from numpy.testing import assert_array_almost_equal from utide._ut_constants import _base_dir from utide.harmonics ...
aminhp93/learning_python
refs/heads/master
src/tags/apps.py
13
from django.apps import AppConfig class TagsConfig(AppConfig): name = 'tags'
mdaniel/intellij-community
refs/heads/master
python/testData/inspections/NumpyDocStringRemoveCombinedVarargParam_after.py
52
def f(): """ Parameters ========== x, **kwargs no one writes like that """
pra85/calibre
refs/heads/master
src/html5lib/filters/optionaltags.py
129
import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2 = previous1 previous1 = token yield previous2, previous...
lthurlow/Network-Grapher
refs/heads/master
proj/external/matplotlib-1.2.1/lib/mpl_examples/api/sankey_demo_rankine.py
6
"""Demonstrate the Sankey class with a practicle example of a Rankine power cycle. """ import numpy as np import matplotlib.pyplot as plt from matplotlib.sankey import Sankey fig = plt.figure(figsize=(8, 12)) ax = fig.add_subplot(1, 1, 1, xticks=[], yticks=[], title="Rankine Power Cycle: Example ...
bcarroll/authmgr
refs/heads/master
python-3.6.2-Win64/Lib/site-packages/alembic/testing/fixtures.py
39
# coding: utf-8 import io import re from sqlalchemy import create_engine, text, MetaData import alembic from ..util.compat import configparser from .. import util from ..util.compat import string_types, text_type from ..migration import MigrationContext from ..environment import EnvironmentContext from ..operations i...
fernandog/Medusa
refs/heads/optimized
ext/js2py/translators/translator.py
1
import pyjsparser import pyjsparser.parser from . import translating_nodes import hashlib import re # Enable Js2Py exceptions and pyimport in parser pyjsparser.parser.ENABLE_PYIMPORT = True # the re below is how we'll recognise numeric constants. # it finds any 'simple numeric that is not preceded with an alphanume...