repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Fat-Zer/FreeCAD_sf_master
refs/heads/master
src/Mod/Draft/draftguitools/gui_fillets.py
5
# *************************************************************************** # * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
gaddman/ansible
refs/heads/devel
test/units/modules/network/junos/junos_module.py
73
# (c) 2017 Red Hat 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 option) any later version. # # Ansible is dis...
brianv0/sqlalchemy
refs/heads/master
test/engine/test_transaction.py
23
from sqlalchemy.testing import eq_, assert_raises, \ assert_raises_message, ne_, expect_warnings import sys from sqlalchemy import event from sqlalchemy.testing.engines import testing_engine from sqlalchemy import create_engine, MetaData, INT, VARCHAR, Sequence, \ select, Integer, String, func, text, exc from s...
hieupham007/Titanium_Mobile
refs/heads/master
support/common/mako/parsetree.py
40
# parsetree.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """defines the parse tree components for Mako templates.""" from mako import exceptions, ast, util, filters...
mpharrigan/msmbuilder
refs/heads/master
Tutorial/PlotDihedrals.py
2
#!/usr/bin/env python # This file is part of MSMBuilder. # # Copyright 2011 Stanford University # # MSMBuilder 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 opt...
mrquim/mrquimrepo
refs/heads/master
repo/script.module.schism.common/lib/requests/packages/chardet/mbcsgroupprober.py
2768
######################## 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...
philippbosch/django-sirtrevor
refs/heads/master
sirtrevor/views.py
3
import importlib import json import os from django.conf import settings from django.core.files.storage import default_storage from django.http import HttpResponse from django.utils.text import slugify from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django....
xieyanhao/xunlei-lixian
refs/heads/master
lixian_plugins/commands/decode_url.py
14
from lixian_plugins.api import command @command(usage='convert thunder:// (and more) to normal url') def decode_url(args): ''' usage: lx decode-url thunder://... ''' from lixian_url import url_unmask for x in args: print url_unmask(x)
weissercn/learningml
refs/heads/master
learningml/GoF/optimisation_and_evaluation/automatisation_sin/optimisation10000/svm/classifier_eval_wrapper.py
1
import os import signal import numpy as np import math import sys sys.path.insert(0,os.environ["learningml"]+"/GoF") import os import classifier_eval from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.svm import SVC from keras.wrappers.scikit_learn im...
chirilo/remo
refs/heads/master
vendor-local/lib/python/rest_framework/utils/encoders.py
13
""" Helper classes for parsers. """ from __future__ import unicode_literals from django.db.models.query import QuerySet from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.functional import Promise from rest_framework.compat import total_seconds import datetime import d...
gmarek/perf-tests
refs/heads/master
clusterloader/vendor/k8s.io/kubernetes/hack/boilerplate/test/pass.py
766
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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...
dayatz/taiga-back
refs/heads/stable
taiga/projects/votes/migrations/0001_initial.py
28
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_initial'), ] ...
mKeRix/home-assistant
refs/heads/dev
homeassistant/components/comed_hourly_pricing/sensor.py
23
"""Support for ComEd Hourly Pricing data.""" import asyncio from datetime import timedelta import json import logging import aiohttp import async_timeout import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME, CONF_OFFSET from h...
asdofindia/kitsune
refs/heads/master
kitsune/search/management/commands/esverify.py
23
from django.core.management.base import BaseCommand from kitsune.search.es_utils import es_verify_cmd from kitsune.search.utils import FakeLogger class Command(BaseCommand): help = 'Verifies correctness of all things verifyable.' def handle(self, *args, **options): es_verify_cmd(FakeLogger(self.stdo...
pridemusvaire/youtube-dl
refs/heads/master
youtube_dl/extractor/everyonesmixtape.py
128
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, ) from ..utils import ( ExtractorError, ) class EveryonesMixtapeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?everyonesmixtape\.com/#/mix/(?P<id>[0-9a-zA-Z]+)(?:/(?P<s...
amjames/psi4
refs/heads/master
psi4/driver/molutil.py
1
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2018 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
strongme/shadowsocks
refs/heads/master
shadowsocks/crypto/rc4_md5.py
1042
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
taw/python_koans
refs/heads/master
python2/runner/mountain.py
106
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import sys import path_to_enlightenment from sensei import Sensei from writeln_decorator import WritelnDecorator class Mountain: def __init__(self): self.stream = WritelnDecorator(sys.stdout) self.tests = path_to_enlightenment.koans() ...
lgarren/spack
refs/heads/develop
var/spack/repos/builtin.mock/packages/dt-diamond/package.py
3
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/wearables/robe/robe_jedi_dark_s03.py
2
import sys def setup(core, object): object.setStfFilename('static_item_n') object.setStfName('item_jedi_robe_dark_03_03') object.setDetailFilename('static_item_d') object.setDetailName('item_jedi_robe_dark_03_03') object.setStringAttribute('protection_level', 'Luminous') object.setStringAttribute('class_requir...
kenhancoder/just
refs/heads/master
just/__init__.py
87
"""Main application package."""
nielsvanoch/django
refs/heads/master
tests/migrations/migrations_test_apps/unmigrated_app/models.py
46
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models class SillyModel(models.Model): silly_field = models.BooleanField(default=False) silly_tribble = models.ForeignKey("migrations.Tribble") is_trouble = models.BooleanField(default=True)
aman-tugnawat/namebench
refs/heads/master
libnamebench/benchmark_test.py
175
#!/usr/bin/env python # Copyright 2009 Google 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...
allisony/aplpy
refs/heads/master
aplpy/tests/test_subplot.py
6
import pytest import numpy as np from .. import FITSFigure def test_subplot_grid(): f = FITSFigure(np.zeros((10, 10)), subplot=(2, 2, 1)) f.show_grayscale() f.close() def test_subplot_box(): f = FITSFigure(np.zeros((10, 10)), subplot=[0.1, 0.1, 0.8, 0.8]) f.show_grayscale() f.close() @pyt...
OCA/manufacture-reporting
refs/heads/12.0
mrp_bom_current_stock/tests/__init__.py
1
from . import test_mrp_bom_current_stock
ScottWales/LdapPlugin
refs/heads/master
ldapplugin/__init__.py
1
# Ldap Plugin python package from ldapplugin.api import *
eduNEXT/edx-platform
refs/heads/master
lms/djangoapps/course_api/tests/test_forms.py
4
""" Tests for Course API forms. """ from itertools import product from urllib.parse import urlencode import ddt from django.contrib.auth.models import AnonymousUser from django.http import QueryDict from common.djangoapps.student.tests.factories import UserFactory from openedx.core.djangoapps.util.test_forms import ...
pigmej/uwsgi_no_pp
refs/heads/master
plugins/router_xmldir/uwsgiplugin.py
21
NAME = 'router_xmldir' CFLAGS = [] LDFLAGS = [] LIBS = [] GCC_LIST = ['router_xmldir']
danakj/chromium
refs/heads/master
tools/grit/grit/format/android_xml.py
34
#!/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. """Produces localized strings.xml files for Android. In cases where an "android" type output file is requested in a grd, the class...
martinohanlon/pyjokes
refs/heads/master
tests/test_get_joke.py
3
import pytest from pyjokes import get_joke from pyjokes.pyjokes import LanguageNotFoundError, CategoryNotFoundError languages = ['en', 'de', 'es'] categories = ['neutral', 'adult', 'all'] test_data = ['', 'abc', '123'] def test_get_joke(): assert get_joke() for language in languages: assert get_jok...
hfp/tensorflow-xsmm
refs/heads/master
tensorflow/contrib/slim/python/slim/nets/inception_v2_test.py
25
# 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...
jshufelt/privacyidea
refs/heads/master
privacyidea/api/token.py
1
# -*- coding: utf-8 -*- # # http://www.privacyidea.org # (c) cornelius kölbel, privacyidea.org # # 2015-05-19 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add setting validity period # # 2015-03-14 Cornelius Kölbel, <cornelius@privacyidea.org> # Add get_serial_by_otp # 2014-12-08 Cornelius...
viongpanzi/ns-3-dev-git
refs/heads/master
bindings/python/ns3modulegen_core_customizations.py
41
from __future__ import print_function import sys import re from pybindgen.typehandlers import base as typehandlers from pybindgen import ReturnValue, Parameter from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper from pybindgen.typehandlers.codesink import MemoryCodeSink from pybindgen.t...
dwhickox/NCHS-Programming-1-Python-Programs
refs/heads/master
Chap 4/MarkUpProj.py
1
""" #David Hickox #Mar 14 17 #Mark Up Program #This will calculate the markup for some toys #variables # ARRAY just creates the table, column 1 week, column 2 gallons column 3 - miles, column 4 mpg """ import locale #imports date time and curency handeling (this takes the place of #$%.2f"%) locale.setlocale(locale.L...
baidubce/bce-sdk-python
refs/heads/master
test/vpc/test_nat_client.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 Baidu.com, 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/LICE...
bcgov/ckanext-bcgov
refs/heads/dev
ckanext/bcgov/logic/action.py
1
# Copyright 2015, Province of British Columbia # License: https://github.com/bcgov/ckanext-bcgov/blob/master/license import ckan.plugins.toolkit as toolkit import logging import datetime import sqlalchemy import ckan.logic as logic import ckan.plugins as plugins import smtplib from time import time import ckan.lib...
kinsamanka/machinekit
refs/heads/master
lib/python/machinekit/nosetests/realtime.py
25
import subprocess import os DEBUG="5" def setup_module(): e=os.environ.copy() e["DEBUG"] = DEBUG subprocess.call("realtime restart", shell=True,stderr=subprocess.STDOUT,env=e) def teardown_module(): e=os.environ.copy() e["DEBUG"] = DEBUG subprocess.call("realtime stop", shell=True,stderr=subpr...
trivoldus28/pulsarch-verilog
refs/heads/master
tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/imputil.py
3
""" Import utilities Exported classes: ImportManager Manage the import process Importer Base class for replacing standard import functions BuiltinImporter Emulate the import mechanism for builtin and frozen modules DynLoadSuffixImporter """ # note: avoid importing non-builtin modules import...
Qalthos/ansible
refs/heads/devel
test/integration/targets/module_utils/other_mu_dir/json_utils.py
294
data = 'overridden json_utils'
coberger/DIRAC
refs/heads/integration
Interfaces/scripts/dirac-dms-replicate-lfn.py
15
#!/usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-dms-replicate-lfn # Author : Stuart Paterson ######################################################################## """ Replicate an existing LFN to another Storage Element """ __RCSID__ = "...
SEL-Columbia/commcare-hq
refs/heads/master
corehq/apps/reports/standard/cases/data_sources.py
1
from couchdbkit import ResourceNotFound import dateutil from django.core import cache from django.core.urlresolvers import reverse, NoReverseMatch from django.template.defaultfilters import yesno from django.utils import html from django.utils.translation import ugettext as _ import simplejson from casexml.apps.case.mo...
asimshankar/tensorflow
refs/heads/master
tensorflow/contrib/proto/python/ops/decode_proto_op.py
37
# ============================================================================= # 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 #...
kuiwei/edx-platform
refs/heads/master
common/test/data/uploads/python_lib_zip/number_helpers.py
215
def seventeen(): return 17 def fortytwo(x): return 42 + x
lowfatcomputing/pacman
refs/heads/master
test/pacman/tests/clean003.py
27
self.description = "CleanMethod = KeepInstalled with IgnorePkg (FS#22653)" sp = pmpkg("dummy", "2.0-1") self.addpkg2db("sync", sp) lp = pmpkg("dummy", "1.0-1") self.addpkg2db("local", lp) self.args = "-Sc" self.option['CleanMethod'] = ['KeepInstalled'] self.option['IgnorePkg'] = ['dummy'] self.createlocalpkgs = True...
tghw/gotr-bowl
refs/heads/master
libs/flask/testsuite/appctx.py
558
# -*- coding: utf-8 -*- """ flask.testsuite.appctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the application context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase class AppContextTestCase(Flask...
pidydx/grr
refs/heads/master
grr/client/components/chipsec_support/actions/grr_chipsec.py
2
#!/usr/bin/env python """Execute a Chipsec plugin on the client.""" __author__ = "tweksteen@gmail.com (Thiebaud Weksteen)" import logging from logging import handlers import os import platform import StringIO # Import Chipsec configuration first so we can hook onto its internal path # resolution. from chipsec impor...
google-code-export/django-hotclub
refs/heads/master
libs/external_libs/Pygments-0.11.1/pygments/styles/perldoc.py
24
# -*- coding: utf-8 -*- """ pygments.styles.perldoc ~~~~~~~~~~~~~~~~~~~~~~~ Style similar to the style used in the `perldoc`_ code blocks. .. _perldoc: http://perldoc.perl.org/ :copyright: 2006-2007 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from pygments.style impor...
qwcode/pip
refs/heads/develop
pip/_vendor/requests/sessions.py
12
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .compat import cookielib, OrderedDict, urljoin, urlparse, urlu...
TRUFIL/erpnext
refs/heads/develop
erpnext/patches/v8_0/__init__.py
37694
from __future__ import unicode_literals
golismero/golismero-devel
refs/heads/master
golismero/api/data/vulnerability/information_disclosure/url_disclosure.py
8
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__= """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of ...
jeasoft/odoo
refs/heads/marcos-8.0
comunity_modules/base_report_to_printer/printing.py
5
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com> # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) # ...
KokareIITP/django
refs/heads/master
django/core/management/commands/flush.py
181
from __future__ import unicode_literals import sys from importlib import import_module from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.core.management.color import no_style from django.core.management.sql import emit_post_migrate_signal, sql_flush from django...
encbladexp/ansible
refs/heads/devel
test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/bad.py
35
#!/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 DOCUMENTATION = ''' module: bad short_description: Bad test module description: Bad test module. author: - Ansible Core...
dev-enthusiast/MuseScore
refs/heads/master
share/instruments/generateTs.py
18
import xml.etree.ElementTree as ET def addMessage(f, text, comment=''): if (comment): f.write("//: " + comment.encode('utf8') + "\n") f.write('QT_TRANSLATE_NOOP("InstrumentsXML", "' + text.encode('utf8') + '"),\n') f = open('instrumentsxml.h','w') tree = ET.parse('instruments.xml') root = tr...
felixbuenemann/sentry
refs/heads/master
src/sentry/api/endpoints/team_groups_new.py
35
from __future__ import absolute_import from datetime import timedelta from django.utils import timezone from rest_framework.response import Response from sentry.api.bases.team import TeamEndpoint from sentry.api.serializers import serialize from sentry.models import Group, GroupStatus, Project class TeamGroupsNewEn...
topfs2/xbmc
refs/heads/master
tools/EventClients/Clients/PS3 Sixaxis Controller/ps3d.py
168
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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) ...
cgstudiomap/cgstudiomap
refs/heads/develop
main/parts/odoo/addons/product/wizard/product_price.py
380
# -*- 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...
amarco90/thug-cucumber
refs/heads/master
backend/vision_api.py
1
#!/usr/bin/env python import base64 import json import logging import os import re import sys import time import httplib2 from collections import namedtuple import bleach from googleapiclient import discovery, errors from oauth2client.client import GoogleCredentials DISCOVERY_URL = 'https://{api}.googleapis.com/$di...
mindnervestech/mnrp
refs/heads/master
addons/account_payment/wizard/account_payment_populate_statement.py
64
# -*- 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...
kevintaw/django
refs/heads/master
django/http/request.py
29
from __future__ import unicode_literals import copy import re import sys from io import BytesIO from itertools import chain from pprint import pformat from django.conf import settings from django.core import signing from django.core.exceptions import DisallowedHost, ImproperlyConfigured from django.core.files import ...
halvertoluke/edx-platform
refs/heads/default_branch
openedx/core/djangoapps/theming/test_util.py
20
""" Test helpers for Comprehensive Theming. """ from functools import wraps import os import os.path from mock import patch from django.conf import settings from django.test.utils import override_settings import edxmako from .core import comprehensive_theme_changes def with_comprehensive_theme(theme_dir): ""...
lenghonglin/LU6200_Android_JB_LU620186_00_Kernel
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
bealdav/OpenUpgrade
refs/heads/8.0
addons/product_email_template/models/invoice.py
37
# -*- coding: utf-8 -*- from openerp.osv import osv class account_invoice(osv.Model): _inherit = 'account.invoice' def invoice_validate_send_email(self, cr, uid, ids, context=None): Composer = self.pool['mail.compose.message'] for invoice in self.browse(cr, uid, ids, context=context): ...
benob/icsisumm
refs/heads/master
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/parse/sr.py
9
# Natural Language Toolkit: Shift-Reduce Parser # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT from nltk import tokenize, cfg from nltk.t...
srsman/odoo
refs/heads/8.0
addons/analytic_contract_hr_expense/__openerp__.py
312
# -*- 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...
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/grizzled/grizzled/test/TestProxy.py
19
# Nose program for testing grizzled.proxy class. from __future__ import absolute_import # --------------------------------------------------------------------------- # Imports # --------------------------------------------------------------------------- from grizzled.proxy import Forwarder import tempfile from grizz...
jereze/scikit-learn
refs/heads/master
sklearn/linear_model/coordinate_descent.py
59
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
apixandru/intellij-community
refs/heads/master
python/testData/psi/ComprehensionErrors.py
83
[for in if]
reinout/django
refs/heads/master
tests/properties/models.py
542
""" Using properties on models Use properties on models just like on any other Python object. """ from django.db import models class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) def _get_full_name(self): return "%s %s" % (self.fi...
SaschaMester/delicium
refs/heads/master
third_party/typ/typ/tests/test_case_test.py
84
# Copyright 2014 Dirk Pranke. 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 or a...
lawsie/guizero
refs/heads/master
examples/colour_example.py
1
from guizero import * def set_color(value): try: rgb = '#%02x%02x%02x' % (red.value, green.value, blue.value) coloured_text.value = rgb coloured_text.text_color = rgb except: print("Something went wrong with setting colours") app = App() title = Text(app, "Laura's awesome colour chooser", size=20, grid=[...
ramsateesh/designate
refs/heads/master
designate/backend/agent_backend/__init__.py
8
# Copyright 2014 Rackspace Inc. # # Author: Tim Simmons <tim.simmons@rackspace.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 # # Unl...
swartn/sam-vs-jet-paper
refs/heads/master
analysis_plotting/plot_rean_vs_marshall_slp.py
1
""" Plots timeseries of SLP at 40 and 60S and the SAM index, all computed at the Marshall station locations, and for various reanalyses and CMIP5. .. moduleauthor:: Neil Swart <neil.swart@ec.gc.ca> """ import cmipdata as cd import trend_ts from datetime import datetime from dateutil.relativedelta import relativedelta ...
tonibagur/kivy-ios
refs/heads/master
tools/external/cookiecutter/vcs.py
4
#!/usr/bin/env python # -*- coding: utf-8 -*- """ cookiecutter.vcs ---------------- Helper functions for working with version control systems. """ from __future__ import unicode_literals import logging import os import subprocess import sys from .compat import which from .exceptions import UnknownRepoType, VCSNotIn...
ArthurGarnier/SickRage
refs/heads/master
tests/torrent_tests.py
8
# coding=UTF-8 # Author: Dennis Lutter <lad1337@gmail.com> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 ...
XandyWang/PythonDemo
refs/heads/master
net/Wifi.py
1
#!/usr/bin/python #http://cn.python-requests.org/en/latest/user/quickstart.html #-*- coding: utf-8 -*- import requests import traceback url_base = 'http://192.168.' s = requests.session() for i in range(1,256,1): for j in range(1,256,1): try : url = "http://192.168.%s.%s/" % (i , j) ...
mmbtba/odoo
refs/heads/8.0
addons/crm/calendar_event.py
375
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
rismalrv/edx-platform
refs/heads/master
lms/djangoapps/verify_student/tests/test_models.py
33
# -*- coding: utf-8 -*- from datetime import timedelta, datetime import ddt import json import requests.exceptions import pytz from django.conf import settings from django.db.utils import IntegrityError from django.test import TestCase from mock import patch from nose.tools import assert_is_none, assert_equals, assert...
SorenOlegnowicz/tracker
refs/heads/master
tracker/beacon/migrations/0007_auto_20150804_1529.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('beacon', '0006_auto_20150802_2027'), ] operations = [ migrations.CreateModel( name='Status', fields=...
mustafat/odoo-1
refs/heads/8.0
addons/mrp/wizard/__init__.py
374
# -*- 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...
gi11es/thumbor
refs/heads/master
tests/filters/test_focal.py
4
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from preggy import expect from tornado.testing import gen_test fro...
primoz-k/parilis
refs/heads/master
manage.py
307
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
spaceninja/mltshp
refs/heads/master
handlers/developers.py
2
import tornado.web from base import BaseHandler from models import App class NewAppHandler(BaseHandler): @tornado.web.authenticated def get(self): return self.render("developers/new-api-application.html", title='', description='', redirect_url='') @tornado.web.authenticated def post(self): ...
mistercrunch/airflow
refs/heads/master
airflow/contrib/sensors/qubole_sensor.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...
jansohn/pyload
refs/heads/stable
module/plugins/crypter/FilecryptCc.py
1
# -*- coding: utf-8 -*- # # Test links: # http://filecrypt.cc/Container/64E039F859.html import binascii import re import urlparse from Crypto.Cipher import AES from module.plugins.internal.Crypter import Crypter from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.captcha.SolveMedia import So...
FR4NK-W/osourced-scion
refs/heads/master
python/test/lib/thread_test.py
3
# Copyright 2015 ETH Zurich # # 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, sof...
ifosch/pyzmq-workshop
refs/heads/master
seeker.py
2
#!/usr/bin/env python import argparse parser = argparse.ArgumentParser() parser.add_argument('-b', '--broker', default='tcp://127.0.0.1:5555')
SSG-DRD-IOT/commercial-iot-security-system
refs/heads/master
opencv/experiments_raw/videoStreaming/fromSO.py
1
import cv2 import urllib import numpy as np stream=urllib.urlopen('http://174.51.161.11/mjpg/1/video.mjpg?camera=1') bytes='' while True: bytes+=stream.read(1024) a = bytes.find('\xff\xd8') b = bytes.find('\xff\xd9') if a!=-1 and b!=-1: jpg = bytes[a:b+2] bytes= bytes[b+2:] i = ...
SteveViss/readthedocs.org
refs/heads/master
readthedocs/core/middleware.py
2
import logging from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.http import Http404 from readthedocs.projects.models import Project, Domain log = logg...
spring-week-topos/nova-week
refs/heads/spring-week
nova/tests/consoleauth/test_consoleauth.py
16
# Copyright 2012 OpenStack Foundation # 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 compliance with the License. You may obtain # a copy of the License at # #...
neumerance/cloudloon2
refs/heads/master
.venv/lib/python2.7/site-packages/eventlet/green/ftplib.py
28
from eventlet import patcher # *NOTE: there might be some funny business with the "SOCKS" module # if it even still exists from eventlet.green import socket patcher.inject('ftplib', globals(), ('socket', socket)) del patcher # Run test program when run as a script if __name__ == '__main__': test()
dispel/jak
refs/heads/master
jak/__init__.py
1
""" Jak --- Jak is a tool for making it dead simple to encrypt and decrypt files. About versioning ---------------- Past, current and future versions. 0.X Troubled Toddler <-- CURRENT 1.X Young Whippersnapper 2.X Teenage Wasteland 3.X Highschool Sweetheart 4.X Wannabee Scientist 5.X Jaded Hipster 6.X Midlife M...
aneeshdash/ALL
refs/heads/master
main.py
1
import re,assemble,link,loader,machine files=[] print 'Enter file names(in descending order of execution):' while True: print 'File Name:', fname=raw_input() if fname is '': break; files.append(fname) print 'Enter Offset:', offset=int(raw_input()) main=files[-1].split('.')[0]+'.asm' symbols=assemble.assemble(file...
aurelijusb/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/iso8859_9.py
593
""" Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
navrasio/mxnet
refs/heads/master
python/mxnet/gluon/data/vision/__init__.py
32
# 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...
40223226/2015cdbg80420
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/queue.py
818
'''A multi-producer, multi-consumer queue.''' try: import threading except ImportError: import dummy_threading as threading from collections import deque from heapq import heappush, heappop try: from time import monotonic as time except ImportError: from time import time __all__ = ['Empty', 'Full', 'Q...
dgoedkoop/QGIS
refs/heads/master
ms-windows/mxe/deploy.py
32
#! /usr/bin/env python3 """pyWindeployqt This is a wrapper for mingw32 objdump replacing windeployqt which is missing from MXE I don't know why they disabled it, but here it is. Example: ./deploy.py --build=~/ClionProjects/project/build/ \ --objdump=/home/user/mxe/usr/bin/i686-w64-mingw32.shared-objdump \ ~/ClionPro...
gorjuce/odoo
refs/heads/8.0
addons/sale_analytic_plans/__init__.py
443
# -*- 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...
wpgallih/servo
refs/heads/master
tests/wpt/harness/wptrunner/browsers/webdriver.py
194
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import errno import socket import time import traceback import urlparse import mozprocess from .base import get_free_p...
weberwang/WeRoBot
refs/heads/develop
tests/test_utils.py
1
# -*- coding: utf-8 -*- import six from werobot.utils import generate_token, check_token, to_text, to_binary from werobot.utils import pay_sign_dict def test_token_generator(): assert not check_token('AA C') assert check_token(generate_token()) def test_to_text(): assert to_text(6) == six.text_type(6)...