repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
johnardavies/scrapy
refs/heads/master
tests/test_utils_conf.py
105
import unittest from scrapy.utils.conf import build_component_list, arglist_to_dict class BuildComponentListTest(unittest.TestCase): def test_build_dict(self): base = {'one': 1, 'two': 2, 'three': 3, 'five': 5, 'six': None} custom = {'two': None, 'three': 8, 'four': 4} self.assertEqual(b...
gregdek/ansible-modules-core
refs/heads/devel
cloud/linode/linode.py
142
#!/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...
xq262144/hue
refs/heads/master
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Cipher/test_XOR.py
119
# -*- coding: utf-8 -*- # # SelfTest/Cipher/XOR.py: Self-test for the XOR "cipher" # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to ...
StackStorm/st2
refs/heads/master
tools/migrate_rules_to_include_pack.py
3
#!/usr/bin/env python # Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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/L...
petewarden/tensorflow
refs/heads/master
tensorflow/python/saved_model/model_utils/export_utils.py
2
# Copyright 2017 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...
litchfield/django
refs/heads/master
tests/flatpages_tests/test_views.py
290
from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from .settings import FLATPAGES_TEMPLATES class TestDataMixin(object): ...
gsaslis/chef
refs/heads/master
lib/chef/provider/package/yum-dump.py
63
# # Author:: Matthew Kent (<mkent@magoazul.com>) # Copyright:: Copyright (c) 2009, 2011 Matthew Kent # License:: Apache License, Version 2.0 # # 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 # ...
jtorrents/networkx
refs/heads/master
networkx/algorithms/approximation/dominating_set.py
33
# -*- coding: utf-8 -*- """ ************************************** Minimum Vertex and Edge Dominating Set ************************************** A dominating set for a graph G = (V, E) is a subset D of V such that every vertex not in D is joined to at least one member of D by some edge. The domination number gamma(G)...
jaywreddy/django
refs/heads/master
tests/sites_framework/migrations/0001_initial.py
281
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='CustomArticle', fields=[ ...
ValyrianTech/BitcoinSpellbook-v0.3
refs/heads/master
integrationtests/integration_test_trigger_conditions_HTTPPostRequestTrigger.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import requests import simplejson from helpers.setupscripthelpers import spellbook_call, clean_up_triggers from helpers.configurationhelpers import get_host, get_port print('Starting Spellbook integration test: HTTP POST request trigger conditions') print('---...
rosmo/ansible
refs/heads/devel
lib/ansible/modules/windows/win_find.py
15
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, 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 the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
dermoth/gramps
refs/heads/master
gramps/gen/simple/_simpletable.py
10
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Donald N. Allingham # Copyright (C) 2009 Douglas S. Blank # Copyright (C) 2011 Tim G L Lyons # # 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 # ...
cfelton/minnesota
refs/heads/master
mn/cores/fifo/ramp/__init__.py
1
from _fifo_ramp import m_fifo_ramp from _regfile_def import regfile
expectocode/Telethon
refs/heads/master
telethon_examples/print_updates.py
2
#!/usr/bin/env python3 # A simple script to print all updates received. # Import modules to access environment, sleep, write to stderr import os import sys import time # Import the client from telethon import TelegramClient # This is a helper method to access environment variables or # prompt the user to type them i...
agry/NGECore2
refs/heads/master
scripts/object/draft_schematic/food/component/ingredient_ball_of_dough.py
85615
import sys def setup(core, object): return
ksachs/invenio
refs/heads/prod
modules/bibsword/lib/bibsword_client_tester.py
17
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your opt...
ydsakyclguozi/elasticsearch
refs/heads/master
dev-tools/get-bwc-version.py
83
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
AlexanderFabisch/scikit-learn
refs/heads/master
examples/linear_model/plot_sgd_loss_functions.py
73
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
ShaningSoul/pi-qmc
refs/heads/master
python/pitools/setup.py
1
#!/usr/bin/env python2.4 from distutils.core import setup setup(name="pitools", version="0.1.0", description="Data analysis utilities for pi-qmc", author="John B. Shumway, Jr.", author_email="john.shumwayjr@google.com", url="http://code.google.com/p/pi-qmc/", packages=['pitools'], ...
clalancette/oz
refs/heads/master
setup.py
2
from distutils.core import setup, Command from distutils.command.sdist import sdist as _sdist import subprocess import time VERSION = '0.18.0' RELEASE = '0' datafiles = [('share/man/man1', ['man/oz-install.1', 'man/oz-generate-icicle.1', 'man/oz-customize.1', 'man/oz-examples.1', ...
phalt/django
refs/heads/master
tests/m2m_through/tests.py
13
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from django.test import TestCase, skipUnlessDBFeature from .models import ( CustomMembership, Employee, Event, Friendship, Group, Ingredient, Invitation, Membership, Person, PersonSelfRefM2M, Recipe, RecipeI...
eLBati/odoo
refs/heads/master
addons/account/wizard/account_tax_chart.py
385
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
frouty/odoogoeen
refs/heads/prod
addons/mail/report/__init__.py
438
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
leki75/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/ansible_tower/tower_organization.py
36
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # # This module 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 opti...
resmo/ansible
refs/heads/devel
lib/ansible/modules/monitoring/logentries.py
122
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Ivan Vanderbyl <ivan@app.io> # 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', ...
drx/archfinch
refs/heads/master
links/feeds.py
1
from django.contrib.syndication.views import FeedDoesNotExist from django.shortcuts import get_object_or_404 from django.contrib.syndication.views import Feed from archfinch.main.views import recommend from django.conf import settings from django.core.urlresolvers import reverse link_prefix = 'http://%s' % settings.DO...
yavalvas/yav_com
refs/heads/master
build/matplotlib/lib/mpl_examples/event_handling/pong_gtk.py
6
#!/usr/bin/env python from __future__ import print_function # For detailed comments on animation and the techniques used here, see # the wiki entry # http://www.scipy.org/wikis/topical_software/MatplotlibAnimation import time import gtk, gobject import matplotlib matplotlib.use('GTKAgg') import matplotlib.pyplot a...
resmo/ansible
refs/heads/devel
lib/ansible/modules/crypto/luks_device.py
8
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # 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': ['pre...
newerthcom/savagerebirth
refs/heads/master
libs/python-2.72/Stackless/unittests/test_exception.py
1
import unittest from support import StacklessTestCase class TestException(StacklessTestCase): def testTaskletExitCode(self): # Tasklet exit was defined as the wrong kind of exception. # When its code attribute was accessed the runtime would # crash. This has been fixed. exc = Tas...
yhoshino11/GuestBook
refs/heads/master
.venv/lib/python2.7/site-packages/pip/_vendor/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...
Boussadia/weboob
refs/heads/master
weboob/capabilities/file.py
2
# -*- coding: utf-8 -*- # Copyright(C) 2013 Pierre Mazière # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
llvmpy/llvmpy
refs/heads/master
llvmpy/src/JITMemoryManager.py
1
from binding import * from .namespace import llvm @llvm.Class() class JITMemoryManager: pass
tectronics/pychess
refs/heads/master
lib/pychess/Savers/chessalpha2.py
20
# -*- coding: utf-8 -*- from __future__ import print_function from pychess.compat import unichr, entitydefs from pychess.Utils.Move import toFAN from pychess.Utils.const import * group = lambda l, s: [l[i:i+s] for i in range(0,len(l),s)] __label__ = _("Chess Alpha 2 Diagram") __ending__ = "html" __append__ = True ...
PaddlePaddle/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_smooth_l1_loss.py
2
# Copyright (c) 2020 PaddlePaddle 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 appli...
nihlaeth/pyVhost
refs/heads/master
pyvhost.py
1
#!/usr/bin/python """Virtual host creation in python.""" import string from random import choice import subprocess import crypt import getpass import sys import os import errno import random from colorlog import log import MySQLdb as db import gnupg from email.mime.text import MIMEText import argparse from crontab im...
oomlout/oomlout-OOMP
refs/heads/master
OOMPpart_MCUU_QFN32_X_K16U2_01.py
1
import OOMP newPart = OOMP.oompItem(9152) newPart.addTag("oompType", "MCUU") newPart.addTag("oompSize", "QFN32") newPart.addTag("oompColor", "X") newPart.addTag("oompDesc", "K16U2") newPart.addTag("oompIndex", "01") OOMP.parts.append(newPart)
CSC301H-Fall2013/JuakStore
refs/heads/master
Storefront/juakstore/juakregister/__init__.py
50
VERSION = (1, 0, 0, 'final', 0) def get_version(): "Returns a PEP 386-compliant version number from VERSION." assert len(VERSION) == 5 assert VERSION[3] in ('alpha', 'beta', 'rc', 'final') # Now build the two parts of the version number: # main = X.Y[.Z] # sub = .devN - for pre-alpha releases...
LeuX/osm4routing
refs/heads/master
osm4routing.py
1
from osm4routing_xml import * import os import bz2, gzip import sys from optparse import OptionParser from sqlalchemy import Table, Column, MetaData, Integer, String, Float, SmallInteger, create_engine from sqlalchemy.orm import mapper, sessionmaker from geoalchemy import * class Node(object): def __init__(self, i...
GoogleCloudPlatform/professional-services
refs/heads/main
tools/pubsub2inbox/filters/strings.py
1
# Copyright 2021 Google 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 required by applicable law or agreed to i...
madflojo/automatron
refs/heads/master
plugins/discovery/roster/__init__.py
1
''' Roster file discovery plugin ''' import time import json import requests from core.discover import BaseDiscover import core.logs class Discover(BaseDiscover): ''' Main Discover Class ''' def start(self): ''' Start Discovery ''' logs = core.logs.Logger(config=self.config, proc_name="discov...
i-rabot/tractogithub
refs/heads/master
tracformatter/trac/prefs/api.py
1
# -*- coding: utf-8 -*- # # Copyright (C)2006-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This softwa...
manahl/arctic
refs/heads/master
benchmarks/fast_serializable_check.py
1
import time import arctic.serialization.numpy_records as anr from tests.unit.serialization.serialization_test_data import _mixed_test_data as input_test_data df_serializer = anr.DataFrameSerializer() def _bench(rounds, input_df, fast): fast = bool(fast) anr.set_fast_check_df_serializable(fast) start = t...
minhphung171093/GreenERP_V8
refs/heads/master
openerp/report/__init__.py
380
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
chuan9/chromium-crosswalk
refs/heads/master
third_party/cython/src/Cython/Compiler/PyrexTypes.py
87
# # Cython/Python language types # from Code import UtilityCode, LazyUtilityCode, TempitaUtilityCode import StringEncoding import Naming import copy from Errors import error class BaseType(object): # # Base class for all Cython types including pseudo-types. # List of attribute names of any subtypes ...
stefanwebb/tensorflow-models
refs/heads/master
tensorflow_models/trainers/gan.py
1
# MIT License # # Copyright (c) 2017, Stefan Webb. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
lanceculnane/electricity-conservation
refs/heads/master
code/diag_corr_matrix.py
1
from string import letters import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set(style="white") # Generate a large random dataset # rs = np.random.RandomState(23) # d = pd.DataFrame(data=rs.normal(size=(100, 26)), # columns=list(letters[:26])) all_data ...
liqianggao/libvpx
refs/heads/master
tools/diff.py
83
#!/usr/bin/env python ## Copyright (c) 2012 The WebM project authors. All Rights Reserved. ## ## Use of this source code is governed by a BSD-style license ## that can be found in the LICENSE file in the root of the source ## tree. An additional intellectual property rights grant can be found ## in the file PATENT...
nderituedwin/django-user-accounts
refs/heads/master
account/fields.py
10
from __future__ import unicode_literals from django.db import models from django.utils import six from account.conf import settings class TimeZoneField(six.with_metaclass(models.SubfieldBase, models.CharField)): def __init__(self, *args, **kwargs): defaults = { "max_length": 100, ...
marcinkwiatkowski/buck
refs/heads/master
third-party/py/unittest2/unittest2/test/test_result.py
122
import sys import textwrap from StringIO import StringIO import unittest2 class Test_TestResult(unittest2.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because these only have meanin...
unho/translate
refs/heads/master
translate/storage/placeables/strelem.py
1
# -*- coding: utf-8 -*- # # Copyright 2009 Zuza Software Foundation # Copyright 2013-2014 F Wolff # # This file is part of the Translate Toolkit. # # 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...
bospetersen/h2o-3
refs/heads/master
py2/testdir_hosts/test_parse_manyfile_hack.py
21
import unittest, sys sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_import as h2i from h2o_test import find_file, dump_json, verboseprint print "Do a hack to import files individually, then parse, to avoid Frames.json on unused files" class Basic(unittest.TestCase): def tearDown(...
mindnervestech/mnrp
refs/heads/master
addons/board/board.py
70
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
Conjuror/fxos-certsuite
refs/heads/master
mcts/web-platform-tests/tests/webdriver/navigation/forwardToNothing.py
7
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test class ForwardToNothingTest(base_test.WebDriverBaseTest): # Get a static page that must be the same upon refresh def test_forwardToNothing(self): self.driver.get(self.webserver.wh...
goodwinnk/intellij-community
refs/heads/master
python/testData/resolve/multiFile/dontResolveToMissingNameInDynamicDunderAll/DontResolveToMissingNameInDynamicDunderAll.py
31
from m1 import * print(internal_name) # <ref>
ssanderson/numpy
refs/heads/master
numpy/core/tests/test_abc.py
168
from __future__ import division, absolute_import, print_function from numpy.testing import TestCase, assert_, run_module_suite import numbers from numpy.core.numerictypes import sctypes class ABC(TestCase): def test_floats(self): for t in sctypes['float']: assert_(isinstance(t(), numbers.Real...
zheli/simple-expense
refs/heads/master
expense_track/wsgi.py
1
""" WSGI config for expense_track project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "expense_track.settings") from d...
StrellaGroup/erpnext
refs/heads/develop
erpnext/patches/v7_0/po_status_issue_for_pr_return.py
51
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): parent_list = [] count = 0 for data in frappe.db.sql(""" select `tabPurchase Receipt Item`.purchase_order, `tabP...
bravominski/PennApps2015-HeartMates
refs/heads/master
venv/lib/python2.7/site-packages/markupsafe/_compat.py
864
# -*- coding: utf-8 -*- """ markupsafe._compat ~~~~~~~~~~~~~~~~~~ Compatibility module for different Python versions. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY2 = sys.version_info[0] == 2 if not PY2: text_type = str string_type...
adam111316/SickGear
refs/heads/master
lib/chardet/euctwprober.py
4
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. ...
kusl/linux
refs/heads/master
tools/perf/python/twatch.py
625
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
photoncoin/photoncoin
refs/heads/master
contrib/testgen/gen_base58_test_vectors.py
1000
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
JakeLowey/HackRPI2
refs/heads/master
django/contrib/contenttypes/generic.py
86
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from collections import defaultdict from functools import partial from operator import attrgetter from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import signals from djan...
hernad/frappe
refs/heads/develop
frappe/patches/v4_1/file_manager_fix.py
25
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import os from frappe.utils.file_manager import get_content_hash, get_file, get_file_name from frappe.utils import get_files_path, get_site_path # The files missed...
brownian/frescobaldi
refs/heads/master
frescobaldi_app/pitch/pitch.py
3
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2011 - 2014 by Wilbert Berendsen # # 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 ...
DoubleNegativeVisualEffects/gaffer
refs/heads/master
python/GafferUI/Viewer.py
3
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
crossbridge-community/avmplus
refs/heads/master
gtest/gtest-1.6.0/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...
Alexander-M-Waldman/local_currency_site
refs/heads/master
lib/python2.7/site-packages/allauth/socialaccount/providers/odnoklassniki/provider.py
5
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class OdnoklassnikiAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('link') de...
SEL-Columbia/commcare-hq
refs/heads/master
custom/_legacy/pathfinder/models.py
2
from couchdbkit.ext.django.schema import Document from corehq.apps.reports.standard import CustomProjectReport from corehq.apps.reports.dont_use.fields import ReportField from datetime import date from pathfinder.views import retrieve_patient_group, get_patients_by_provider from django.http import Http404 from dimagi.u...
snnn/tensorflow
refs/heads/master
tensorflow/tools/docs/py_guide_parser_test.py
142
# Copyright 2017 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...
qedi-r/home-assistant
refs/heads/dev
homeassistant/components/uk_transport/__init__.py
36
"""The uk_transport component."""
amith01994/intellij-community
refs/heads/master
python/helpers/pydev/pydev_console_utils.py
28
from pydev_imports import xmlrpclib, _queue, Exec import sys from pydevd_constants import IS_JYTHON from _pydev_imps import _pydev_thread as thread import pydevd_xml import pydevd_vars from pydevd_utils import * # @UnusedWildImport import traceback #====================================================================...
Kiiv/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/rtp.py
22
# coding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import js_to_json class RTPIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rtp\.pt/play/p(?P<program_id>[0-9]+)/(?P<id>[^/?#]+)/?' _TESTS = [{ 'url': 'http://www.rtp.pt/play/p405/e...
mattrobenolt/django
refs/heads/master
django/contrib/gis/db/models/__init__.py
110
from django.core.exceptions import ImproperlyConfigured # Want to get everything from the 'normal' models package. from django.db.models import * # NOQA from django.utils.version import get_docs_version from django.contrib.gis.geos import HAS_GEOS if not HAS_GEOS: raise ImproperlyConfigured( "GEOS is re...
bixbydev/Bixby
refs/heads/master
google/gdata-2.0.18/samples/blogger/BloggerExample.py
128
#!/usr/bin/python # # Copyright (C) 2009 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 ...
NcLang/vimrc
refs/heads/master
sources_non_forked/ultisnips/pythonx/UltiSnips/snippet/parsing/_lexer.py
29
#!/usr/bin/env python # encoding: utf-8 """Not really a lexer in the classical sense, but code to convert snippet definitions into logical units called Tokens.""" import string import re from UltiSnips.compatibility import as_unicode from UltiSnips.position import Position from UltiSnips.text import unescape class...
elkingtonmcb/django
refs/heads/master
tests/managers_regress/models.py
245
""" Various edge-cases for model managers. """ from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import force_text, python_2_unicode_compatible class OnlyFred(mo...
yannickcr/Sick-Beard
refs/heads/development
lib/requests/packages/oauthlib/oauth1/__init__.py
186
# -*- coding: utf-8 -*- from __future__ import absolute_import """ oauthlib.oauth1 ~~~~~~~~~~~~~~ This module is a wrapper for the most recent implementation of OAuth 1.0 Client and Server classes. """ from .rfc5849 import Client, Server
jjmleiro/hue
refs/heads/master
desktop/core/src/desktop/lib/metrics/urls.py
29
#!/usr/bin/env python # 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 ma...
umitproject/tease-o-matic
refs/heads/master
django/contrib/auth/management/commands/createsuperuser.py
154
""" Management utility to create superusers. """ import getpass import re import sys from optparse import make_option from django.contrib.auth.models import User from django.core import exceptions from django.core.management.base import BaseCommand, CommandError from django.utils.translation import ugettext as _ RE_V...
mboersma/docker-registry
refs/heads/master
depends/docker-registry-core/docker_registry/core/boto.py
27
# -*- coding: utf-8 -*- # Copyright (c) 2014 Docker. # # 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...
scotwk/cloud-custodian
refs/heads/master
c7n/resources/ml.py
3
# Copyright 2015-2017 Capital One Services, 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 required by applicable law or agreed ...
darrencheng0817/AlgorithmLearning
refs/heads/master
Python/leetcode/RemoveDuplicatesFromSortedArray.py
1
''' Created on 1.12.2016 @author: Darren '''''' Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory. For example, Given input ar...
teochenglim/ansible-modules-extras
refs/heads/devel
cloud/amazon/lambda.py
13
#!/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...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/lib/Lib/site-packages/django/contrib/sitemaps/tests/urls.py
233
from datetime import datetime from django.conf.urls.defaults import * from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap from django.contrib.auth.models import User class SimpleSitemap(Sitemap): changefreq = "never" priority = 0.5 location = '/location/' lastmod = datetime.now...
qinyushuang/robotframework-selenium2library
refs/heads/master
src/Selenium2Library/keywords/_tableelement.py
64
import os import sys from robot.variables import GLOBAL_VARIABLES from robot.api import logger from Selenium2Library.locators import TableElementFinder from keywordgroup import KeywordGroup class _TableElementKeywords(KeywordGroup): def __init__(self): self._table_element_finder = TableElementFinder() ...
cjlee112/socraticqs2
refs/heads/master
mysite/ct/fsm_plugin/live.py
2
from fsm.models import ActivityLog FSM_NAMES_TO_RESET_ON_RECYCLE = ['live_chat'] def quit_edge(self, edge, fsmStack, request, **kwargs): """ Edge method that terminates this live-session. """ for studentState in fsmStack.state.linkChildren.all(): studentState.linkState = None # detach from o...
SectorLabs/pytest-benchmark
refs/heads/master
src/pytest_benchmark/session.py
2
from __future__ import division from __future__ import print_function import pytest from .fixture import statistics from .fixture import statistics_error from .logger import Logger from .table import TableResults from .utils import NAME_FORMATTERS from .utils import SecondsDecimal from .utils import cached_property f...
mekinney/transparica
refs/heads/master
data/metrics/orig/spectrum orig.py
1
#!/usr/bin/env python # Imports spectrum metric information downloaded from govtrack.us # Sample header from the XML file. There are multiple representative lines. # <?xml version="1.0" ?> # <?xml-stylesheet href="stylesheet.xml" type="text/xsl" ?> # <spectrum key='Spectrum' mean='0.171324550317622' stddev='1.06912...
gale320/binwalk
refs/heads/master
src/binwalk/plugins/arcadyan.py
24
import os import binwalk.core.common import binwalk.core.plugin class ArcadyanDeobfuscator(binwalk.core.plugin.Plugin): ''' Deobfuscator for known Arcadyan firmware obfuscation(s). ''' MODULES = ['Signature'] OBFUSCATION_MAGIC_SIZE = 4 MAX_IMAGE_SIZE = 0x1B0000 BLOCK_SIZE ...
foodszhang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/ntpath.py
93
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import sys import stat import genericpath from genericpath import * __all__ = ["normcase","is...
paran0ids0ul/infernal-twin
refs/heads/master
build/reportlab/src/reportlab/lib/rl_accel.py
34
#this is the interface module that imports all from the C extension _rl_accel _c_funcs = {} _py_funcs = {} ### NOTE! FP_STR SHOULD PROBABLY ALWAYS DO A PYTHON STR() CONVERSION ON ARGS ### IN CASE THEY ARE "LAZY OBJECTS". ACCELLERATOR DOESN'T DO THIS (YET) __all__ = list(filter(None,''' fp_str unicode2...
fluentpython/example-code
refs/heads/master
attic/sequences/metro_areas.py
7
FILENAME = 'metro_areas.txt' class MetroArea: def __init__(self, name, country, pop, pop_change, area): self.name = name self.country = country self.pop = pop self.pop_change = pop_change self.area = area def __repr__(self): return '{0.name}, {0.country} ({0.po...
koniiiik/django
refs/heads/master
tests/migrations/migrations_test_apps/migrated_app/migrations/0001_initial.py
2995
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ("name",...
jmakov/ggrc-core
refs/heads/develop
src/ggrc_basic_permissions/migrations/versions/20130923130503_3148b80be376_role_scopes_for_ui_h.py
5
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com """Role scopes for UI hinting. Revision ID: 3148b80be376 Revises: 5b33357784a C...
darkryder/django
refs/heads/master
tests/forms_tests/field_tests/test_datefield.py
33
# -*- coding: utf-8 -*- from datetime import date, datetime from django.forms import ( DateField, Form, HiddenInput, SelectDateWidget, ValidationError, ) from django.test import SimpleTestCase, override_settings from django.utils import translation class GetDate(Form): mydate = DateField(widget=SelectDateWid...
hubsaysnuaa/odoo
refs/heads/8.0
addons/account_payment/wizard/account_payment_populate_statement.py
274
# -*- 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...
ferabra/edx-platform
refs/heads/master
lms/djangoapps/branding/admin.py
147
"""Django admin pages for branding configuration. """ from django.contrib import admin from config_models.admin import ConfigurationModelAdmin from .models import BrandingInfoConfig, BrandingApiConfig admin.site.register(BrandingInfoConfig, ConfigurationModelAdmin) admin.site.register(BrandingApiConfig, Configuration...
goodwinnk/intellij-community
refs/heads/master
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_operator.py
326
"""Fixer for operator functions. operator.isCallable(obj) -> hasattr(obj, '__call__') operator.sequenceIncludes(obj) -> operator.contains(obj) operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence) operator.isMappingType(obj) -> isinstance(obj, collections.Mapping) operator.isNumberType(obj) ...
cfossace/crits
refs/heads/master
crits/core/management/commands/upgrade.py
10
import sys from django.core.management.base import BaseCommand from django.conf import settings from optparse import make_option from crits.actors.actor import Actor from crits.backdoors.backdoor import Backdoor from crits.campaigns.campaign import Campaign from crits.certificates.certificate import Certificate from ...
googleapis/googleapis-gen
refs/heads/master
google/container/v1beta1/container-v1beta1-py/google/container_v1beta1/services/cluster_manager/transports/base.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google 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 required by applicable law or...