repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
pztrick/django-allauth
refs/heads/master
allauth/socialaccount/providers/mailru/urls.py
12
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import MailRuProvider urlpatterns = default_urlpatterns(MailRuProvider)
Sweetgrassbuffalo/ReactionSweeGrass-v2
refs/heads/master
.meteor/local/dev_bundle/python/Lib/json/tests/test_pass3.py
145
from json.tests import PyTest, CTest # from http://json.org/JSON_checker/test/pass3.json JSON = r''' { "JSON Test Pattern pass3": { "The outermost value": "must be an object or array.", "In this test": "It is an object." } } ''' class TestPass3(object): def test_parse(self): # te...
apollo13/ansible
refs/heads/devel
test/units/module_utils/common/validation/test_check_mutually_exclusive.py
44
# -*- coding: utf-8 -*- # Copyright (c) 2019 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 import pytest from ansible.module_utils._text import to_native from ansible.m...
tobbad/micropython
refs/heads/master
drivers/nrf24l01/nrf24l01.py
15
"""NRF24L01 driver for MicroPython """ from micropython import const import utime # nRF24L01+ registers CONFIG = const(0x00) EN_RXADDR = const(0x02) SETUP_AW = const(0x03) SETUP_RETR = const(0x04) RF_CH = const(0x05) RF_SETUP = const(0x06) STATUS = const(0x07) RX_ADDR_P0 = const(0x0A) TX_ADDR = const(0x10) RX_PW_P0 =...
orchidinfosys/odoo
refs/heads/master
openerp-wsgi.py
52
# WSGI Handler sample configuration file. # # Change the appropriate settings below, in order to provide the parameters # that would normally be passed in the command-line. # (at least conf['addons_path']) # # For generic wsgi handlers a global application is defined. # For uwsgi this should work: # $ uwsgi_python --...
40223250/40223250test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/SDL.py
603
from browser import document SDL_INIT_VIDEO=0 SDL_GL_DOUBLEBUFFER=1 SDL_GL_DEPTH_SIZE=2 SDL_DOUBLEBUF=3 SDL_ANYFORMAT=4 SDL_ACTIVEEVENT=5 SDL_ALLEVENTS=5 SDL_KEYDOWN=6 SDL_KEYUP=7 SDL_MOUSEMOTION=8 SDL_MOUSEBUTTONDOWN=9 SDL_MOUSEBUTTONUP=10 SDL_JOYAXISMOTION=11 SDL_JOYBALLMOTION=12 SDL_JOYHATMOTION=13 SDL_JOYBUTTON...
hoehnp/navit_test
refs/heads/master
lib/python2.7/site-packages/setuptools/py33compat.py
127
import dis import array import collections from setuptools.extern import six OpArg = collections.namedtuple('OpArg', 'opcode arg') class Bytecode_compat(object): def __init__(self, code): self.code = code def __iter__(self): """Yield '(op,arg)' pair for each operation in code object 'code'...
andrewerrington/fuscus
refs/heads/master
fuscus/lcd.py
2
#!/usr/bin/env python3 # # Copyright 2015 Andrew Errington # # This file is part of BrewPi. # # BrewPi 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) a...
elky/django
refs/heads/master
tests/m2m_multiple/models.py
133
""" Multiple many-to-many relationships between the same two tables In this example, an ``Article`` can have many "primary" ``Category`` objects and many "secondary" ``Category`` objects. Set ``related_name`` to designate what the reverse relationship is called. """ from django.db import models class Category(mode...
yewang15215/django
refs/heads/master
tests/utils_tests/test_tree.py
429
import copy import unittest from django.utils.tree import Node class NodeTests(unittest.TestCase): def setUp(self): self.node1_children = [('a', 1), ('b', 2)] self.node1 = Node(self.node1_children) self.node2 = Node() def test_str(self): self.assertEqual(str(self.node1), "(DE...
CameronLonsdale/sec-tools
refs/heads/master
python2/bin/activate_this.py
1076
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
wujuguang/scrapy
refs/heads/master
scrapy/robotstxt.py
1
import sys import logging from abc import ABCMeta, abstractmethod from six import with_metaclass from scrapy.utils.python import to_native_str, to_unicode logger = logging.getLogger(__name__) class RobotParser(with_metaclass(ABCMeta)): @classmethod @abstractmethod def from_crawler(cls, crawler, robotstx...
daverstephens/The-SOC-Shop
refs/heads/master
Threat_Intel/Google_Search.py
1
#!/usr/bin/env python # cyberfive.co.uk import sys from google import google # >= Google-Search-API 1.1.13 query_string = "filetype:{0} inurl:{1} inurl:{2}".format(sys.argv[1], sys.argv[2], sys.argv[3]) num_page = 10 search_results = google.search(query_string, num_page) for item in search_results: print(item....
yinquan529/platform-external-chromium_org
refs/heads/master
third_party/protobuf/python/google/protobuf/internal/text_format_test.py
162
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
JohnDenker/brython
refs/heads/master
www/src/Lib/test/test_userstring.py
25
#!/usr/bin/env python3 # UserString is a wrapper around the native builtin string type. # UserString instances should behave similar to builtin string objects. import string import unittest from test import support, string_tests from collections import UserString class UserStringTest( string_tests.CommonTest, ...
kapy2010/treeherder
refs/heads/master
treeherder/credentials/forms.py
12
from django.forms import (ModelForm, Textarea, TextInput) from .models import Credentials class CredentialsForm(ModelForm): class Meta: model = Credentials fields = ('client_id', 'description') widgets = { 'client_id': TextI...
40223101/2015final2
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/unittest/test/testmock/testmagicmethods.py
737
import unittest import inspect import sys from unittest.mock import Mock, MagicMock, _magics class TestMockingMagicMethods(unittest.TestCase): def test_deleting_magic_methods(self): mock = Mock() self.assertFalse(hasattr(mock, '__getitem__')) mock.__getitem__ = Mock() self.asser...
canzerapple/orz
refs/heads/master
cleanup.py
1
import sys from os.path import dirname from os.path import join from os import listdir from os.path import isdir from os.path import splitext from os.path import basename import os root = dirname( sys.argv[0] ) deletes = ['.user', '.log', '.ncb' , '.obj', '.idb','.lik','.pch','.ilk','.suo','.ipch', ...
baslr/ArangoDB
refs/heads/3.1-silent
3rdParty/boost/1.62.0/libs/mpl/doc/src/docutils/setup.py
59
#!/usr/bin/env python # Copyright Aleksey Gurtovoy 2007-2009 # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import sys, os from distutils.core import setup setup( name="html_refdoc", version=".1", ...
rdipietro/tensorflow
refs/heads/master
tensorflow/python/training/server_lib.py
40
# Copyright 2015 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...
leschzinerlab/AWS
refs/heads/master
aws/list_instances.py
2
#!/usr/bin/env python import subprocess import os import sys import linecache clusterlist=False onlyinstances=False onlyvols=False onlysnaps=False if sys.argv[-1] == '-c': clusterlist=True if sys.argv[-1] == '-i': onlyinstances=True if sys.argv[-1] == '-v': onlyvols=True if sys.argv[-1] == '-s': o...
fxfitz/ansible
refs/heads/devel
lib/ansible/modules/network/aireos/aireos_config.py
34
#!/usr/bin/python # # Copyright: Ansible Team # 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'], ...
GustavoHennig/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcdns_zone.py
70
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2015 CallFire Inc. # # This file is part of Ansible. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License...
gilestrolab/sleepysnail
refs/heads/master
prototypes/snaketracking/prototype.py
1
__author__ = 'quentin' import cv2 import cv from sleepysnail.acquisition.video_capture import VideoDirCapture from acwe import MorphACWE import numpy as np from sleepysnail.utils.figure_maker import FigureMaker R = 1.4 FILE = "./test.avi" def filter_blobs( blobs, min_length=30, max_length=200, min_ar=1, max_ar=3)...
tectronics/mythbox
refs/heads/master
resources/lib/IMDbPY/imdb/_exceptions.py
15
""" _exceptions module (imdb package). This module provides the exception hierarchy used by the imdb package. Copyright 2004-2009 Davide Alberani <da@erlug.linux.it> 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 Soft...
IronManMark20/pyside2
refs/heads/master
tests/QtWidgets/qgraphicsscene_test.py
3
'''Basic test cases for QGraphicsScene''' import unittest import gc from PySide2.QtCore import QPointF from PySide2.QtGui import QPolygonF, QPixmap, QPainterPath from PySide2.QtWidgets import QApplication, QPushButton from PySide2.QtWidgets import QGraphicsScene from PySide2.QtWidgets import QGraphicsEllipseItem, QG...
jgeskens/django
refs/heads/master
django/contrib/gis/tests/geoapp/feeds.py
308
from __future__ import absolute_import from django.contrib.gis import feeds from .models import City class TestGeoRSS1(feeds.Feed): link = '/city/' title = 'Test GeoDjango Cities' def items(self): return City.objects.all() def item_link(self, item): return '/city/%s/' % item.pk ...
michaelgallacher/intellij-community
refs/heads/master
python/helpers/profiler/thriftpy/protocol/exc.py
46
# -*- coding: utf-8 -*- from __future__ import absolute_import from ..thrift import TException class TProtocolException(TException): """Custom Protocol Exception class""" UNKNOWN = 0 INVALID_DATA = 1 NEGATIVE_SIZE = 2 SIZE_LIMIT = 3 BAD_VERSION = 4 def __init__(self, type=UNKNOWN, mess...
shawncaojob/LC
refs/heads/master
PY/100_same_tree.py
1
# 100. Same Tree My Submissions QuestionEditorial Solution # Total Accepted: 131037 Total Submissions: 301443 Difficulty: Easy # Given two binary trees, write a function to check if they are equal or not. # # Two binary trees are considered equal if they are structurally identical and the nodes have the same value. # ...
windofthesky/ansible
refs/heads/devel
test/units/playbook/test_block.py
228
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
ryokochang/Slab-GCS
refs/heads/master
packages/IronPython.StdLib.2.7.5-beta1/content/Lib/copy.py
253
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
elk941/CPB
refs/heads/master
Test/fixBadUtf.py
1
import unicodedata def fix_bad_unicode(text): if not isinstance(text, unicode): raise TypeError("This isn't even decoded into Unicode yet. " "Decode it first.") if len(text) == 0: return text maxord = max(ord(char) for char in text) tried_fixing = [] if ma...
vforgione/logging2
refs/heads/master
logging2/handlers/sockets.py
1
import socket import syslog from typing import Optional from logging2.handlers.abc import Handler from logging2.levels import LogLevel class SocketHandler(Handler): """A generic ``Handler`` for writing messages to sockets. """ def __init__( self, name: Optional[str] = None, level: Optional[LogLe...
hmcmooc/muddx-platform
refs/heads/master
common/djangoapps/track/migrations/0001_initial.py
189
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TrackingLog' db.create_table('track_trackinglog', ( ('id', self.gf('django.db.mo...
edxnercel/edx-platform
refs/heads/master
common/djangoapps/student/management/commands/assigngroups.py
170
from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student.models import UserTestGroup import random import sys import datetime from textwrap import dedent import json from pytz import UTC def group_from_value(groups, v): ''' Given group: (('a',0.3),('b',0.4),(...
rocket-league-replays/rocket-league-replays
refs/heads/master
rocket_league/apps/replays/migrations/0028_auto_20160307_1923.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import social.apps.django_app.default.fields class Migration(migrations.Migration): dependencies = [ ('replays', '0027_auto_20160306_2044'), ] operations = [ migrations.AddField( ...
kovach/libswiftnav-python
refs/heads/master
setup.py
1
#!/usr/bin/env python """ ============ Installation ============ Requirements ============ libswiftnav-python has the following requirements, they must be installed before building and installing libswiftnav-python: - `Python <http://www.python.org/>`_ 2.6 or 2.7 - `Numpy <http://www.numpy.org/>`_ 1.6 or later - ...
home-assistant/home-assistant
refs/heads/dev
homeassistant/components/tado/sensor.py
4
"""Support for Tado sensors for each zone.""" import logging from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, PERCENTAGE, TEMP_CELSIUS, ) from homeassistant.co...
mjtamlyn/django
refs/heads/master
django/contrib/messages/views.py
131
from django.contrib import messages class SuccessMessageMixin: """ Add a success message on successful form submission. """ success_message = '' def form_valid(self, form): response = super().form_valid(form) success_message = self.get_success_message(form.cleaned_data) if...
cbmoore/statsmodels
refs/heads/master
statsmodels/stats/tests/test_gof.py
34
# -*- coding: utf-8 -*- """ Created on Thu Feb 28 13:24:59 2013 Author: Josef Perktold """ from statsmodels.compat.python import itervalues import numpy as np from numpy.testing import assert_almost_equal, assert_equal from statsmodels.stats.gof import (chisquare, chisquare_power, ...
ioram7/keystone-federado-pgid2013
refs/heads/master
build/eventlet/build/lib.linux-x86_64-2.7/eventlet/green/__init__.py
28
# this package contains modules from the standard library converted to use eventlet
hkchenhongyi/django
refs/heads/master
django/contrib/admin/templatetags/log.py
499
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
PrimeAnalytics/syncalot
refs/heads/master
SyncAlot/migrations/0005_auto_20160522_1310.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-22 13:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('SyncAlot', '0004_auto_20160522_1300'), ] operations = [ migrations.RemoveFie...
vicky2135/lucious
refs/heads/master
oscar/lib/python2.7/site-packages/requests/packages/chardet/universaldetector.py
1775
######################## 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...
CyanogenMod/android_external_chromium_org
refs/heads/cm-12.0
tools/json_to_struct/element_generator.py
115
# 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. import json import struct_generator def _JSONToCString16(json_string_literal): """Converts a JSON string literal to a C++ UTF-16 string literal. This ...
grilo/ansible-1
refs/heads/devel
lib/ansible/plugins/connection/network_cli.py
8
# # (c) 2016 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 d...
40223244/cdb-2
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_socket.py
742
"""Implementation module for socket operations. See the socket module for documentation.""" AF_APPLETALK = 16 AF_DECnet = 12 AF_INET = 2 AF_INET6 = 23 AF_IPX = 6 AF_IRDA = 26 AF_SNA = 11 AF_UNSPEC = 0 AI_ADDRCONFIG = 1024 AI_ALL = 256 AI_CANONNAME = 2 AI_NUMERICHOST = 4 AI_NUMERICSERV = 8 AI_PASSIVE = 1...
eckucukoglu/arm-linux-gnueabihf
refs/heads/master
arm-linux-gnueabihf/libc/usr/lib/python2.7/test/test_binop.py
127
"""Tests for binary operators on subtypes of built-in types.""" import unittest from test import test_support def gcd(a, b): """Greatest common divisor using Euclid's algorithm.""" while a: a, b = b%a, a return b def isint(x): """Test whether an object is an instance of int or long.""" re...
mscherer/ansible
refs/heads/devel
lib/ansible/playbook/__init__.py
62
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
googleapis/gapic-generator-python
refs/heads/master
tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py
2
# -*- 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...
aldian/tensorflow
refs/heads/master
tensorflow/contrib/layers/python/layers/initializers_test.py
111
# Copyright 2015 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...
slvnperron/kubernetes
refs/heads/master
cluster/juju/charms/trusty/kubernetes-master/unit_tests/kubernetes_installer_test.py
52
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
stevenewey/django
refs/heads/master
django/contrib/auth/checks.py
374
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.core import checks def check_user_model(**kwargs): errors = [] cls = apps.get_model(settings.AUTH_USER_MODEL) # Check that REQUIRED_FIELDS is a list if not isins...
jmrozanec/white-bkg-classification
refs/heads/master
scripts/dl-histograms/04-architecture-02b.py
1
#TFLearn bug regarding image loading: https://github.com/tflearn/tflearn/issues/180 #Monochromes img-magick: https://poizan.dk/blog/2014/02/28/monochrome-images-in-imagemagick/ #How to persist a model: https://github.com/tflearn/tflearn/blob/master/examples/basics/weights_persistence.py from __future__ import division,...
mantidproject/mantid
refs/heads/master
Framework/PythonInterface/test/python/mantid/api/PythonAlgorithmTraitsTest.py
3
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + """D...
ARM-software/lisa
refs/heads/master
external/workload-automation/wa/workloads/googlephotos/__init__.py
3
# Copyright 2014-2018 ARM Limited # # 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 w...
atmark-techno/atmark-dist
refs/heads/master
user/python/Demo/sgi/al/listen.py
3
# Listen to the input on host argv[1]. import sys, al, AL, posix BUFSIZE = 2000 QSIZE = 4000 def main(): if len(sys.argv) <> 2: sys.stderr.write('usage: ' + sys.argv[0] + ' hostname\n') sys.exit(2) hostname = sys.argv[1] cmd = 'exec rsh </dev/null ' + hostname + \ ' "cd /ufs/guido/mm/demo/audio; ' + \ 'ex...
viraptor/cryptography
refs/heads/master
cryptography/hazmat/bindings/commoncrypto/common_cryptor.py
5
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
jmighion/ansible
refs/heads/devel
lib/ansible/modules/packaging/language/pip.py
3
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Matt Wright <matt@nobien.net> # 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....
vandenheuvel/tribler
refs/heads/master
TriblerGUI/widgets/channelpage.py
2
from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QWidget from TriblerGUI.widgets.channel_torrent_list_item import ChannelTorrentListItem from TriblerGUI.widgets.loading_list_item import LoadingListItem from TriblerGUI.widgets.playlist_list_item import PlaylistListItem from TriblerGUI.widgets.text_list_item im...
blueboxgroup/horizon
refs/heads/master
openstack_dashboard/dashboards/project/containers/utils.py
65
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
fgallegosalido/Algorithms
refs/heads/master
Hackerrank/ProjecEuler/26__Reciprocal_cycles.py
1
########################################################################################## ## Project Euler #26: Reciprocal cycles ## ## ## ## Link: https://www.hackerrank.com/contests/p...
dhalperi/beam
refs/heads/master
sdks/python/apache_beam/runners/dataflow/internal/clients/dataflow/dataflow_v1b3_messages.py
9
# # 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...
ghchinoy/tensorflow
refs/heads/master
tensorflow/python/autograph/converters/lists.py
30
# 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...
realzzt/BitCoin2013
refs/heads/master
qa/rpc-tests/bip68-112-113-p2p.py
1
#!/usr/bin/env python3 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * fro...
janusnic/django-allauth
refs/heads/master
allauth/socialaccount/providers/flickr/tests.py
69
# -*- coding: utf-8 -*- from allauth.socialaccount.tests import create_oauth_tests from allauth.tests import MockedResponse from allauth.socialaccount.providers import registry from .provider import FlickrProvider class FlickrTests(create_oauth_tests(registry.by_id(FlickrProvider.id))): def get_mocked_response(s...
sarvex/django
refs/heads/master
tests/generic_views/forms.py
453
from __future__ import unicode_literals from django import forms from .models import Author class AuthorForm(forms.ModelForm): name = forms.CharField() slug = forms.SlugField() class Meta: model = Author fields = ['name', 'slug'] class ContactForm(forms.Form): name = forms.CharFie...
Djabbz/wakatime
refs/heads/master
wakatime/packages/pygments_py3/pygments/lexers/dotnet.py
29
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
dwcaraway/homeschoolring
refs/heads/master
hes/contrib/sites/migrations/0001_initial.py
348
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.sites.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Site', fields=[ ...
cuilishen/cuilishenMissionPlanner
refs/heads/master
Lib/site-packages/scipy/optimize/minpack.py
53
import warnings import _minpack from numpy import atleast_1d, dot, take, triu, shape, eye, \ transpose, zeros, product, greater, array, \ all, where, isscalar, asarray, inf, abs error = _minpack.error __all__ = ['fsolve', 'leastsq', 'fixed_point', 'curve_fit'] def _check_func(che...
dhpollack/spokenlanguages
refs/heads/master
test/model.py
1
import unittest import time import torch import torch.nn as nn from torch.autograd import Variable import models.resnet import models.squeezenet import torchaudio.transforms as tat import torchvision.transforms as tvt import spl_transforms from v2_data_fetch import * def print_running_time(start): elapsed = time.t...
Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86
refs/heads/master
usr/pkg/lib/python2.7/site-packages/setuptools/command/setopt.py
167
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, local, global, or per-user co...
rlugojr/django
refs/heads/master
tests/select_related/models.py
27
""" Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ from dj...
StephenKing/summerschool-2015-ryu
refs/heads/summerschool-step2-complete
ryu/tests/run_tests.py
44
#!/usr/bin/env python import os import sys from nose import config from nose import core sys.path.append(os.getcwd()) sys.path.append(os.path.dirname(__file__)) import ryu.tests.unit from ryu.tests.test_lib import run_tests if __name__ == '__main__': exit_status = False # if a single test case was spec...
sekikn/ambari
refs/heads/trunk
ambari-server/src/test/python/TestServerClassPath.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 use this ...
tonybaloney/st2
refs/heads/master
st2common/st2common/persistence/action.py
13
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
beznogno/pyicqt
refs/heads/master
src/disco.py
4
# Copyright 2004-2006 Daniel Henninger <jadestorm@nc.rr.com> # Licensed for distribution under the GPL version 2, check COPYING for details import utils from twisted.words.xish.domish import Element from twisted.words.protocols.jabber.jid import internJID from twisted.internet.defer import Deferred from twisted.intern...
jbzdak/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/social_facebook/models.py
1644
""" A models.py is required to make this an app (until we move to Django 1.7) """
daemonmaker/pylearn2
refs/heads/master
pylearn2/datasets/binarized_mnist.py
35
""" Binarized, unlabeled version of the MNIST dataset, used in On the Quantitative Analysis of Deep Belief Networks Salakhutdinov and Murray http://www.cs.toronto.edu/~rsalakhu/papers/dbn_ais.pdf The MNIST database of handwritten digits LeCun and Cortes http://yann.lecun.com/exdb/mnist/ """ __a...
LockScreen/Backend
refs/heads/master
venv/bin/rst2xml.py
1
#!/Users/Varun/Documents/GitHub/LockScreen/venv/bin/python # $Id: rst2xml.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ A minimal front end to the Docutils Publisher, producing Docutils XML. """ try: import l...
Notgnoshi/starithmetic
refs/heads/master
star/star.py
1
import turtle from math import sin, cos, pi, gcd from itertools import cycle, islice, chain def lcm(a, b): return (a * b) // gcd(a, b) class Star(object): def __init__(self, skips=2, points=5): """Construct a star defined by: `points` - the number of vertices of the star ...
JT5D/scikit-learn
refs/heads/master
sklearn/neighbors/classification.py
6
"""Nearest Neighbor Classification""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output support by ...
marcelocure/django
refs/heads/master
tests/test_client_regress/context_processors.py
530
def special(request): return {'path': request.special_path}
dzbarsky/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/infinite-redirects.py
228
def main(request, response): location = "%s://%s:%s/%s" % (request.url_parts.scheme, request.url_parts.netloc, request.url_parts.port, request.url_parts.path) page = "alternate"; type = 302; mix = 0; ...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/field_defaults/tests.py
405
from datetime import datetime from django.test import TestCase from django.utils import six from .models import Article class DefaultTests(TestCase): def test_field_defaults(self): a = Article() now = datetime.now() a.save() self.assertIsInstance(a.id, six.integer_types) ...
romain-dartigues/ansible
refs/heads/devel
lib/ansible/modules/remote_management/manageiq/manageiq_provider.py
53
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Daniel Korn <korndaniel1@gmail.com> # (c) 2017, Yaacov Zamir <yzamir@redhat.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 ANS...
alefnula/panda
refs/heads/master
src/panda/panda.py
1
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __contact__ = 'alefnula@gmail.com' __date__ = '21 October 2010' __copyright__ = 'Copyright (c) 2010 Viktor Kerkez' import re import sys import optparse import traceback try: import readline except ImportError: pass import primitives #@UnusedImport fr...
ericlink/adms-server
refs/heads/master
playframework-dist/1.1-src/python/Lib/ctypes/macholib/dyld.py
2
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ dyld emulation """ import os from framework import framework_info from dylib import dylib_inf...
hybrid-storage-dev/cinder-client-fs-111t-hybrid-cherry
refs/heads/master
v1/volume_snapshots.py
6
# Copyright 2011 Denali Systems, 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 requ...
demon-ru/iml-crm
refs/heads/master
addons/im_livechat/__openerp__.py
27
{ 'name' : 'Live Support', 'author': 'OpenERP SA', 'version': '1.0', 'summary': 'Live Chat with Visitors/Customers', 'category': 'Tools', 'complexity': 'easy', 'description': """ Live Chat Support ================= Allow to drop instant messaging widgets on any web page that will co...
cloudnull/ansible
refs/heads/devel
lib/ansible/playbook/play.py
13
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
dhanunjaya/neutron
refs/heads/master
neutron/objects/qos/rule_type.py
23
# 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...
jungle90/Openstack-Swift-I-O-throttler
refs/heads/master
build/lib.linux-x86_64-2.7/swift/common/middleware/list_endpoints.py
29
# Copyright (c) 2012 OpenStack Foundation # # 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 ...
museumsvictoria/nodel-recipes
refs/heads/master
(retired)/scheduler/apscheduler/triggers/cron/fields.py
115
""" Fields represent CronTrigger options which map to :class:`~datetime.datetime` fields. """ from calendar import monthrange from apscheduler.triggers.cron.expressions import * __all__ = ('MIN_VALUES', 'MAX_VALUES', 'DEFAULT_VALUES', 'BaseField', 'WeekField', 'DayOfMonthField', 'DayOfWeekField') MIN_VA...
emersonsoftware/ansiblefork
refs/heads/devel
test/integration/targets/module_utils/module_utils/spam8/ham/__init__.py
298
eggs = 'spam8:eggs'
risicle/django
refs/heads/master
django/utils/archive.py
562
""" Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/ Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors. 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 So...
wuga214/Django-Wuga
refs/heads/master
env/lib/python2.7/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...
ahmedaljazzar/edx-platform
refs/heads/master
openedx/core/djangoapps/ace_common/__init__.py
24
""" ace_common is a Django App that provides common utilities and templates for edx-platform applications that use ACE as their messaging framework. """ default_app_config = 'openedx.core.djangoapps.ace_common.apps.AceCommonConfig' # pylint: disable=invalid-name
ProfessorX/Config
refs/heads/master
.PyCharm30/system/python_stubs/-1247972723/atk/Component.py
1
# encoding: utf-8 # module atk # from /usr/lib/python2.7/dist-packages/gtk-2.0/atk.so # by generator 1.135 # no doc # imports import gobject as __gobject import gobject._gobject as __gobject__gobject import __main__ as ____main__ class Component(__gobject.GInterface): # no doc def contains(self, *args, **kwa...
cristiandima/highlights
refs/heads/master
setup.py
1
from setuptools import setup, find_packages setup( name='highlights', # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html version='0.1.1', descrip...