repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
xzmagic/folly
refs/heads/master
folly/build/generate_format_tables.py
61
#!/usr/bin/env python # # Generate Format tables import os from optparse import OptionParser OUTPUT_FILE = "FormatTables.cpp" def generate_table(f, type_name, name, map): f.write("extern const {0} {1}[] = {{".format(type_name, name)) for i in range(0, 256): if i % 2 == 0: f.write("\n ")...
bwrsandman/OpenUpgrade
refs/heads/8.0
addons/website_event_sale/controllers/main.py
233
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
linuxwhatelse/plugin.audio.linuxwhatelse.gmusic
refs/heads/master
resources/libs/lib/google/protobuf/internal/test_util.py
38
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
cloudtools/awacs
refs/heads/main
awacs/aws_marketplace.py
1
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from .aws import Action as BaseAction from .aws import BaseARN service_name = "AWS Marketplace" prefix = "aws-marketplace" class Action(BaseAction): def __init__(self, action: str = None) -> None: ...
maljac/odoomrp-utils
refs/heads/8.0
base_report_auto_create_qweb/wizard/__init__.py
31
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from . import report_duplicate
ForensicTools/GRREAT-475_2141-Chaigon-Failey-Siebert
refs/heads/master
server/data_server/errors.py
15
#!/usr/bin/env python """Exceptions for the distributed data servers.""" class DataServerError(Exception): """Raised when some error condition happens in a data server.""" pass
datosgobar/pydatajson
refs/heads/master
tests/test_validators.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals, with_statement import json import os.path import unittest import requests_mock from requests import Timeout, ConnectionError from pydatajson.validators \ .consistent_distribution_fields_validator \ import C...
dbbhattacharya/kitsune
refs/heads/master
kitsune/postcrash/models.py
23
from django.db import models from kitsune.sumo.models import ModelBase from kitsune.wiki.models import Document class Signature(ModelBase): signature = models.CharField(max_length=255, db_index=True, unique=True) document = models.ForeignKey(Document) def __unicode__(self): return u'<%s> %s' % (...
mlosev/python-daemon
refs/heads/master
daemon/version/version_info.py
1
#!/usr/bin/env python """This file is automatically generated by generate_version_info It uses the current working tree to determine the revision. So don't edit it. :) """ version_info = {'branch_nick': u'python-daemon.devel', 'build_date': '2009-05-22 19:50:06 +1000', 'clean': None, 'date': '2009-05-22 19:47:30 +1...
tudorbarascu/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/Orthogonalize.py
6
# -*- coding: utf-8 -*- """ *************************************************************************** Orthogonalize.py ---------------- Date : December 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at gmail dot com *******************...
roselleebarle04/opencog
refs/heads/master
opencog/nlp/anaphora/agents/hobbs.py
18
from __future__ import print_function from pprint import pprint from opencog.cogserver import MindAgent from opencog.atomspace import types, AtomSpace, TruthValue from opencog.scheme_wrapper import load_scm,scheme_eval_h,scheme_eval, __init__ from opencog import logger import Queue import time __author__ = 'Hujie Wa...
kenshay/ImageScripter
refs/heads/master
Script_Runner/PYTHON/Lib/encodings/mac_greek.py
272
""" Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.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,err...
cccfran/sympy
refs/heads/master
sympy/physics/unitsystems/tests/test_quantities.py
92
# -*- coding: utf-8 -*- from __future__ import division from sympy.physics.unitsystems.quantities import Quantity from sympy.physics.unitsystems.units import Unit from sympy.physics.unitsystems.prefixes import PREFIXES from sympy.physics.unitsystems.systems import mks from sympy.utilities.pytest import raises m, s, ...
log2timeline/plaso
refs/heads/main
tests/cli/helpers/storage_format.py
2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage format CLI arguments helper.""" import argparse import unittest from plaso.cli import tools from plaso.cli.helpers import storage_format from plaso.lib import errors from tests.cli import test_lib as cli_test_lib class StorageFormatArgumentsHe...
retomerz/intellij-community
refs/heads/master
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_standarderror.py
327
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for StandardError -> Exception.""" # Local imports from .. import fixer_base from ..fixer_util import Name class FixStandarderror(fixer_base.BaseFix): BM_compatible = True PATTERN = """ ...
hybrideagle/django
refs/heads/master
django/conf/project_template/project_name/wsgi.py
680
""" WSGI config for {{ project_name }} 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/{{ docs_version }}/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.enviro...
codeaudit/bosen
refs/heads/release_1.1
app/sparsecoding/script/launch.py
28
#!/usr/bin/env python import os from os.path import dirname, join import time hostfile_name = "machinefiles/localserver" app_dir = dirname(dirname(os.path.realpath(__file__))) proj_dir = dirname(dirname(app_dir)) hostfile = join(proj_dir, hostfile_name) ssh_cmd = ( "ssh " "-o StrictHostKeyChecking=no " ...
freezmeinster/teh-manis
refs/heads/master
django/utils/encoding.py
71
import types import urllib import locale import datetime import codecs from decimal import Decimal from django.utils.functional import Promise class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): self.obj = obj UnicodeDecodeError.__init__(self, *args) def __str_...
cdsi/elrond
refs/heads/master
src/python/elrond/backends/__init__.py
6
from __future__ import division from __future__ import with_statement # $Id:$ # # Local Variables: # indent-tabs-mode: nil # python-continuation-offset: 2 # python-indent: 8 # End: # vim: ai et si sw=8 ts=8
Spleen64/Sick-Beard
refs/heads/master
lib/subliminal/videos.py
36
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
mzdaniel/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/manhole/service.py
20
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """L{twisted.manhole} L{PB<twisted.spread.pb>} service implementation. """ # twisted imports from twisted import copyright from twisted.spread import pb from twisted.python import log, failure from twisted.cred import portal from twisted.applic...
moondrop-entertainment/django-nonrel-drawp
refs/heads/master
django/core/mail/backends/console.py
308
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream', sys.stdout) self._loc...
davidyezsetz/kuma
refs/heads/master
vendor/packages/sqlalchemy/test/orm/test_subquery_relations.py
6
from sqlalchemy.test.testing import eq_, is_, is_not_ from sqlalchemy.test import testing from sqlalchemy.test.schema import Table, Column from sqlalchemy import Integer, String, ForeignKey, bindparam from sqlalchemy.orm import backref, subqueryload, subqueryload_all, \ mapper, relationship, clear_mappers, create_s...
caseyrollins/osf.io
refs/heads/develop
website/files/utils.py
2
def copy_files(src, target_node, parent=None, name=None): """Copy the files from src to the target node :param Folder src: The source to copy children from :param Node target_node: The node to copy files to :param Folder parent: The parent of to attach the clone of src to, if applicable """ ass...
indico/indico-plugins
refs/heads/master
payment_paypal/tests/controllers_test.py
1
# This file is part of the Indico plugins. # Copyright (C) 2002 - 2021 CERN # # The Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; # see the LICENSE file for more details. from unittest.mock import MagicMock import pytest from flask import request ...
spirrello/spirrello-pynet-work
refs/heads/master
applied_python/lib/python2.7/site-packages/setuptools/tests/test_packageindex.py
132
import sys import distutils.errors from setuptools.compat import httplib, HTTPError, unicode, pathname2url import pkg_resources import setuptools.package_index from setuptools.tests.server import IndexServer class TestPackageIndex: def test_bad_url_bad_port(self): index = setuptools.package_index.Packa...
a40223217/2015cdb_g6team3
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/encodings/aliases.py
726
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
tenterlexperience/MarmotteQCM
refs/heads/master
Script/django_mathjax_integration.py
1
import json from django import template from django.conf import settings from django.templatetags.static import static from django.utils.safestring import mark_safe register = template.Library() MATHJAX_CONFIG_DATA = { "tex2jax": { "inlineMath": [ ['$', '$'], ['\\(', '\\)'...
ifduyue/sentry
refs/heads/master
src/sentry/api/bases/group.py
2
from __future__ import absolute_import import logging from sentry.api.base import Endpoint from sentry.api.bases.project import ProjectPermission from sentry.api.exceptions import ResourceDoesNotExist from sentry.app import raven from sentry.models import Group, GroupStatus, get_group_with_redirect logger = logging....
ric03uec/boto
refs/heads/develop
boto/sns/connection.py
14
# Copyright (c) 2010-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 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 wit...
laiqiqi886/kbengine
refs/heads/master
kbe/src/lib/python/Lib/uuid.py
63
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
carsongee/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/open_ended_grading_classes/__init__.py
248
__author__ = 'vik'
blitzmann/Pyfa
refs/heads/master
service/conversions/skinnedShips.py
4
""" Conversion pack for skinned ships to their base hull. Unlike other conversion packs, the name of this file is important as it is used in service.market to flag as unpublished See GH issue #67 on why this is needed """ CONVERSIONS = { "Miasmos Amastris Edition": "Miasmos Quafe Ultra Edition", "Miasmos Quaf...
markmcclain/astara
refs/heads/master
akanda/rug/openstack/common/threadgroup.py
2
# Copyright 2014 DreamHost, LLC # # Author: DreamHost, 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 applicabl...
tklaus/ansible
refs/heads/devel
lib/ansible/plugins/lookup/subelements.py
103
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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)...
pbanaszkiewicz/amy
refs/heads/develop
amy/extrequests/migrations/0010_auto_20190818_0740.py
2
# Generated by Django 2.1.7 on 2019-08-18 07:40 from django.db import migrations, models def migrate_workshop_format(apps, schema_editor): """Migrate options previously with no contents (displayed as "Other:") to a new contents ("other").""" SelfOrganizedSubmission = apps.get_model('extrequests', ...
vv1133/home_web
refs/heads/master
build/lib.linux-armv6l-2.7/django/utils/xmlutils.py
734
""" Utilities for XML generation/parsing. """ from xml.sax.saxutils import XMLGenerator class SimplerXMLGenerator(XMLGenerator): def addQuickElement(self, name, contents=None, attrs=None): "Convenience method for adding an element with no children" if attrs is None: attrs = {} self.startEl...
sloanyang/depends
refs/heads/master
third_party/boto/manage/task.py
70
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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 use, copy, modi...
logxen/Fritzing
refs/heads/master
part-gen-scripts/misc_scripts/version4.py
3
# usage: # copper1fzp.py -d [fzp folder] # add or update a <version> element. import getopt, sys, os, os.path, re, xml.dom.minidom, xml.dom def usage(): print """ usage: version.py -d [fzp folder] add or update a <version> element. """ def main():...
pyupio/pyup
refs/heads/master
tests/test_config.py
1
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from unittest import TestCase from pyup.config import Config, RequirementConfig, CompileConfig, GitlabConfig import yaml class ConfigTestCase(TestCase): def test_generate_config(self): config = {"update": "ins...
aaltinisik/OCBAltinkaya
refs/heads/8.0
openerp/conf/deprecation.py
380
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
MathiasGarnier/Python-Test
refs/heads/master
test_0007.py
1
def damage(lostHeart, heart): """ For the damage ! :param lostHeart: When player lose heart ! :param heart: Player heart ! :return: """ while lostHeart < player.heart: heart -= 1 def player(heart): """ For the player in him :param heart: Player heart ! :retur...
Dziolas/invenio
refs/heads/scoap3
modules/miscutil/lib/solrutils_config.py
28
## 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 option) any later version. ## ...
btabibian/scikit-learn
refs/heads/master
sklearn/ensemble/partial_dependence.py
33
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
incaser/server-tools
refs/heads/8.0
users_ldap_push/__openerp__.py
15
# -*- coding: utf-8 -*- ############################################################################## # # This module copyright (C) 2015 Therp BV <http://therp.nl>. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
7yl4r/eventsEngine
refs/heads/master
EventsEngine/EventsEngine.py
1
''' This class defines the object which holds all game information. Think of it like a giant game container in which everything goes. ''' from Event import Event from Action import Action from Trigger import Trigger from Story import Story class EventsEngine(object): def __init__(self, eventList=None): i...
OptimusGitEtna/RestSymf
refs/heads/master
Python-3.4.2/Tools/demo/eiffel.py
60
#!/usr/bin/env python3 """ Support Eiffel-style preconditions and postconditions for functions. An example for Python metaclasses. """ import unittest from types import FunctionType as function class EiffelBaseMetaClass(type): def __new__(meta, name, bases, dict): meta.convert_methods(dict) ret...
dblia/nosql-ganeti
refs/heads/couch
lib/http/__init__.py
5
# # # Copyright (C) 2007, 2008, 2010, 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This progr...
JustJokerX/PaperCrawler
refs/heads/master
NIPS/NIPS2012.py
1
# coding=utf-8 """ This file is used to make a crawl """ import __init__ import os import re import urllib from utility import prgbar def get_html(url): """Get the html """ page = urllib.urlopen(url) html = page.read() return html def get_pdf(html): """ xxx""" reg = r...
sunlightlabs/openstates
refs/heads/master
scrapers/pr/committees.py
2
# -*- coding: utf-8 -*- import re from openstates.scrape import Scraper, Organization from utils import LXMLMixin class PRCommitteeScraper(Scraper, LXMLMixin): def _match_title(self, member): # Regexes should capture both gendered forms. title_regex = { "chairman": r", President.*$", ...
gugu/django-social-auth-1
refs/heads/master
social_auth/backends/contrib/fitbit.py
6
""" Fitbit OAuth support. This contribution adds support for Fitbit OAuth service. The settings FITBIT_CONSUMER_KEY and FITBIT_CONSUMER_SECRET must be defined with the values given by Fitbit application registration process. By default account id, username and token expiration time are stored in extra_data field, che...
wfxiang08/django197
refs/heads/master
django/contrib/sessions/backends/cache.py
227
from django.conf import settings from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.cache import caches from django.utils.six.moves import range KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
chidea/GoPythonDLLWrapper
refs/heads/master
bin/lib/sqlite3/test/types.py
12
#-*- coding: iso-8859-1 -*- # pysqlite2/test/types.py: tests for type conversion and detection # # Copyright (C) 2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any ...
clumsy/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/tests/distapp/models.py
406
from django.contrib.gis.db import models class SouthTexasCity(models.Model): "City model on projected coordinate system for South Texas." name = models.CharField(max_length=30) point = models.PointField(srid=32140) objects = models.GeoManager() def __unicode__(self): return self.name class SouthTe...
6WIND/scapy
refs/heads/master
scapy/contrib/ife.py
3
# scapy.contrib.description = ForCES Inter-FE LFB type (IFE) # scapy.contrib.status = loads """ IFE - ForCES Inter-FE LFB type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :author: Alexander Aring, aring@mojatatu.com :license: GPLv2 This module is free software; you can redistribute it and/or ...
xaviercobain88/framework-python
refs/heads/master
build/lib.linux-i686-2.7/openerp/addons/edi/models/edi.py
33
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
erikr/django
refs/heads/master
django/contrib/admindocs/middleware.py
106
from django import http from django.conf import settings from django.utils.deprecation import MiddlewareMixin class XViewMiddleware(MiddlewareMixin): """ Adds an X-View header to internal HEAD requests -- used by the documentation system. """ def process_view(self, request, view_func, view_args, view_...
WoLpH/CouchPotatoServer
refs/heads/master
libs/sqlalchemy/util/compat.py
18
# util/compat.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Handle Python version/platform incompatibilities.""" import sys try: import t...
pangzhenjia/pysc2-source
refs/heads/master
setup.py
1
# Copyright 2017 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 by applicable law or ...
ryanrdetzel/pjsip
refs/heads/master
pjsip-apps/src/pygui/chat.py
1
# $Id: chat.py 4757 2014-02-21 07:53:31Z nanang $ # # pjsua Python GUI Demo # # Copyright (C)2013 Teluu Inc. (http://www.teluu.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eith...
xncbf/authome
refs/heads/master
manage.py
1
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "authome.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
density215/d215-miniblog
refs/heads/master
unidecode/x0b7.py
253
data = ( 'ddwim', # 0x00 'ddwib', # 0x01 'ddwibs', # 0x02 'ddwis', # 0x03 'ddwiss', # 0x04 'ddwing', # 0x05 'ddwij', # 0x06 'ddwic', # 0x07 'ddwik', # 0x08 'ddwit', # 0x09 'ddwip', # 0x0a 'ddwih', # 0x0b 'ddyu', # 0x0c 'ddyug', # 0x0d 'ddyugg', # 0x0e 'ddyugs', # 0x0f 'dd...
cntnboys/410Lab6
refs/heads/master
v1/lib/python2.7/site-packages/django/contrib/messages/tests/urls.py
68
from django.conf.urls import patterns, url from django.contrib import messages from django.core.urlresolvers import reverse from django import forms from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext, Template from django.template.response import TemplateResponse from ...
emintham/pyswip
refs/heads/master
examples/coins/coins.py
10
# -*- coding: utf-8 -*- # pyswip -- Python SWI-Prolog bridge # Copyright (c) 2007-2012 Yüce Tekol # # 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 ...
sixty-north/segpy
refs/heads/master
test/test_revisions.py
2
from hypothesis import given, assume from hypothesis.strategies import integers from pytest import raises from segpy.revisions import canonicalize_revision, SegYRevision, SegYRevisionError class TestCanonicalizeRevision: def test_correct_revision_zero(self): assert canonicalize_revision(0x0000) == SegYR...
reachedu14/traininginstitute
refs/heads/master
coursebuilder/tests/functional/controllers_review.py
4
# coding: utf-8 # Copyright 2013 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 by ap...
Antiun/c2c-rd-addons
refs/heads/8.0
project_task_dependencies/__init__.py
4
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Davide Corio # (<http://www.davidecorio.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License ...
zdary/intellij-community
refs/heads/master
python/testData/copyPaste/multiLine/IndentMulti41.src.py
249
class C: def foo(self): <selection>x = 1 y = 2 </selection>
wenghengcong/MQTTExplore
refs/heads/master
lib/mosquitto-1.4.4/test/broker/07-will-null-helper.py
25
#!/usr/bin/env python # Connect a client with a will, then disconnect without DISCONNECT. import struct import subprocess import socket import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.jo...
ABaldwinHunter/curio-clone-classic
refs/heads/master
curio/test/__main__.py
2
from .sync import * from .queue import * from .kernel import * from .socket import * from .subprocess import * from .workers import * from .network import * if __name__ == '__main__': import unittest unittest.main()
yantrabuddhi/FreeCAD
refs/heads/master
src/Mod/Plot/plotPositions/TaskPanel.py
26
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
sunny94/temp
refs/heads/iss8501_parsing
sympy/combinatorics/__init__.py
123
from sympy.combinatorics.permutations import Permutation, Cycle from sympy.combinatorics.prufer import Prufer from sympy.combinatorics.generators import cyclic, alternating, symmetric, dihedral from sympy.combinatorics.subsets import Subset from sympy.combinatorics.partitions import (Partition, IntegerPartition, RG...
Chilledheart/seahub
refs/heads/master
seahub/profile/forms.py
6
# encoding: utf-8 from django import forms from django.utils.translation import ugettext_lazy as _ from seahub.profile.models import Profile, DetailedProfile class ProfileForm(forms.Form): nickname = forms.CharField(max_length=64, required=False) intro = forms.CharField(max_length=256, required=False) de...
M4573R/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
refs/heads/master
sandbox/Chapter10_/github_datapull.py
108
try: import numpy as np from requests import get from bs4 import BeautifulSoup stars_to_explore = ( 2**np.arange( -1, 16 ) ).astype("int") forks_to_explore = ( 2**np.arange( -1, 16 ) ).astype("int") repo_with_stars = np.ones_like( stars_to_explore ) repo_with_forks = np.ones_like( forks...
40223110/2015CDAFinal_test2
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/multiprocessing/util.py
696
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
jmgc/myhdl-numeric
refs/heads/numeric
myhdl/test/conversion/general/test_method.py
1
from __future__ import absolute_import, print_function from myhdl import * from myhdl.conversion import verify, toVHDL, toVerilog class HdlObj(object): def __init__(self): pass def method_func(self, clk, srst, x, y): z = Signal(intbv(0, min=y.min, max=y.max)) ifx = self._mfunc(x, z) ...
SivilTaram/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_bulk_assertions.py
173
import ddt import itertools from xmodule.tests import BulkAssertionTest, BulkAssertionError STATIC_PASSING_ASSERTIONS = ( ('assertTrue', True), ('assertFalse', False), ('assertIs', 1, 1), ('assertEqual', 1, 1), ('assertEquals', 1, 1), ('assertIsNot', 1, 2), ('assertIsNone', None), ('as...
JeyZeta/Dangerous
refs/heads/master
Dangerous/Golismero/tools/sqlmap/lib/core/defaults.py
8
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.datatype import AttribDict _defaults = { "csvDel": ",", "timeSec": 5, "googlePage": 1, "cpuThrottle": 5, "verbose": 1, "del...
damianpv/sfotipy
refs/heads/master
sfotipy/context_processors.py
1
from random import choice frase = ['hello', 'hola', 'hi'] from tracks.models import Track def basico(request): tracks = Track.objects.all() track = None #import ipdb;ipdb.set_trace() for t in tracks: if request.path == t.get_absolute_url(): track = t break return...
crmccreary/openerp_server
refs/heads/master
openerp/addons/auction/barcode/code39.py
9
# -*- coding: utf-8 -*- # # Copyright (c) 1996-2000 Tyler C. Sarna <tsarna@sarna.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above co...
dmccloskey/component-contribution
refs/heads/master
examples/simeon.py
1
import logging from scipy.io import savemat from component_contribution.component_contribution import ComponentContribution from component_contribution.kegg_model import KeggModel REACTION_FNAME = '../examples/simeon_reactions.txt' OUTPUT_FNAME = '../res/simeon.mat' logger = logging.getLogger('') logger.setLevel(logg...
juangj/selenium
refs/heads/master
py/test/selenium/webdriver/support/color_tests.py
39
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
gylian/Sick-Beard
refs/heads/master
lib/osxnotify/registerapp.py
3
#!/usr/bin/python import shutil import os import stat import platform import subprocess def registerapp(app): # don't do any of this unless >= 10.8 v, _, _ = platform.mac_ver() v = float('.'.join(v.split('.')[:2])) if v < 10.8: return None, 'Registering requires OS X version >= 10.8' app...
nutztherookie/wagtail
refs/heads/master
wagtail/wagtailcore/migrations/0010_change_page_owner_to_null_on_delete.py
9
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0009_remove_auto_now_add_from_pagerevision_created_at'), ...
Nitaco/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/ansible_tower/tower_user.py
23
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
samuelclay/NewsBlur
refs/heads/master
utils/monitor_newsletter_delivery.py
1
#!/srv/newsblur/venv/newsblur/bin/python import sys sys.path.append('/srv/newsblur') import subprocess import requests from newsblur import settings import socket def main(): df = subprocess.Popen(["df", "/"], stdout=subprocess.PIPE) output = df.communicate()[0] device, size, used, available, percent, mo...
ftomassetti/intellij-community
refs/heads/master
python/helpers/pycharm_generator_utils/clr_tools.py
82
# coding=utf-8 """ .NET (CLR) specific functions """ __author__ = 'Ilya.Kazakevich' def get_namespace_by_name(object_name): """ Gets namespace for full object name. Sometimes last element of name is module while it may be class. For System.Console returns System, for System.Web returns System.Web. Be ...
jalexvig/tensorflow
refs/heads/master
tensorflow/examples/benchmark/sample_benchmark.py
94
# 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...
daniarherikurniawan/Chameleon512
refs/heads/master
src/contrib/hod/hodlib/Schedulers/torque.py
182
#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 thi...
ESRC-CDRC/ckan-ckanext-cdrc
refs/heads/master
ckanext/cdrc/controllers/organization_admin.py
2
""" File: blog.py Author: Wen Li Email: spacelis@gmail.com Github: http://github.com/spacelis Description: A blog controller that wrapping a wp in a page. """ from ckan.common import OrderedDict, c, g, request, _ import ckan.lib.base as base import ckan.lib.helpers as h import ckan.model as model import ckan.plug...
bracket/handsome
refs/heads/master
tests/test_c.py
2
from handsome.Tile import Tile from handsome.Pixel import FloatPixel, array_view from handsome.capi import generate_numpy_begin, fill_micropolygon_mesh from handsome.util import color from pathlib import Path import ctypes import json import numpy as np def test_coordinate_image(tmpdir): try: lib = buil...
cooniur/ansible-modules-core
refs/heads/devel
windows/win_file.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # # 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, eith...
tiborsimko/invenio-ext
refs/heads/master
invenio_ext/registry/__init__.py
6
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014, 2015 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 optio...
evaautomation/binutils
refs/heads/master
gdb/testsuite/gdb.python/py-unwind-maint.py
32
# Copyright (C) 2015 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is...
fly19890211/edx-platform
refs/heads/master
lms/djangoapps/shoppingcart/pdf.py
103
""" Template for PDF Receipt/Invoice Generation """ from PIL import Image import logging from reportlab.lib import colors from django.conf import settings from django.utils.translation import ugettext as _ from reportlab.pdfgen.canvas import Canvas from reportlab.lib.pagesizes import letter from reportlab.lib.units imp...
freezmeinster/avagata-site
refs/heads/dev
django/db/backends/mysql/validation.py
392
from django.db.backends import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def validate_field(self, errors, opts, f): """ There are some field length restrictions for MySQL: - Prior to version 5.0.3, character fields could not exceed 255 characters in...
alexproca/askbot-devel
refs/heads/master
askbot/migrations/0103_rename_post_fields_back_2.py
18
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from askbot.migrations import innodb_ready_rename_column class Migration(SchemaMigration): def forwards(self, orm): #db.rename_column(u'activity', 'question_post_id', 'question_id'...
Ifetayo/alt1
refs/heads/master
qa/rpc-tests/invalidblockrequest.py
87
#!/usr/bin/env python2 # # Distributed under the MIT/X11 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 * from test_framework.comptool import TestManager, Te...
githubutilities/LeetCode
refs/heads/master
Python/palindrome-number.py
3
# Time: O(1) # Space: O(1) # # Determine whether an integer is a palindrome. Do this without extra space. # # Some hints: # Could negative integers be palindromes? (ie, -1) # # If you are thinking of converting the integer to string, note the restriction of using extra space. # # You could also try reversing an int...
ampax/edx-platform-backup
refs/heads/live
common/djangoapps/student/management/commands/assigngroups.py
12
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),(...