repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Zero-man/exercism | refs/heads/master | python/clock/clock.py | 1 | class Clock:
def __init__(self, hours, minutes):
self.hours = hours
self.minutes = minutes
def __repr__(self):
return "%02d:%02d" % (self.hour, self.minute)
|
2013Commons/HUE-SHARK | refs/heads/master | build/env/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/lexer.py | 19 | # mako/lexer.py
# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides the Lexer class for parsing template strings into parse trees."""
import re, codecs
fro... |
solidfire/solidfire-cli | refs/heads/master | element/cli/commands/cmd_sfapi.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2014-2016 NetApp, Inc. All Rights Reserved.
#
# DO NOT EDIT THIS CODE BY HAND! It has been generated with jsvcgen.
#
import click
from element.cli import utils as cli_utils
from element.cli import parser
from element.cli.cli import pass_context
from eleme... |
ZG-Tennis/django-cropduster | refs/heads/master | cropduster/management/commands/backup_images.py | 2 | #Place in cropduster/management/commands/regenerate_thumbs.py.
# Afterwards, the command can be run using:
# manage.py regenerate_thumbs
#
# Search for 'changeme' for lines that should be modified
import sys
import os
import tempfile
from optparse import make_option
from django.core.management.base import BaseCommand... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/OpenSSL/__init__.py | 22 | # Copyright (C) AB Strakt
# See LICENSE for details.
"""
pyOpenSSL - A simple wrapper around the OpenSSL library
"""
from OpenSSL import rand, crypto, SSL
from OpenSSL.version import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__,
)
__all__ = [
"SSL", "... |
ravindrapanda/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/onehot_categorical.py | 78 | # 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... |
mvdbeek/tools-artbio | refs/heads/master | helper_scripts/clean_tool_conf_xml.py | 5 | #!/usr/bin/env python
## Example usage: python clean_tool_conf.py -i /galaxy/config/shed_tool_conf.xml -o clean_shed_tool_conf.xml
import xml.etree.ElementTree as ET
from os import path
from argparse import ArgumentParser
def check_child(root, children, tooldir, removed_tools=[]):
"""
For each child in chil... |
joakim-hove/django | refs/heads/master | tests/cache/liberal_backend.py | 446 | from django.core.cache.backends.locmem import LocMemCache
class LiberalKeyValidationMixin(object):
def validate_key(self, key):
pass
class CacheClass(LiberalKeyValidationMixin, LocMemCache):
pass
|
Vignesh2208/Awlsim | refs/heads/master | awlsim/core/instructions/insn_spbin.py | 2 | # -*- coding: utf-8 -*-
#
# AWL simulator - instructions
#
# Copyright 2012-2014 Michael Buesch <m@bues.ch>
#
# 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
... |
randomshinichi/QRL | refs/heads/master | src/qrl/crypto/__init__.py | 5 | # coding=utf-8
# Python hash signature library (quantum resistant)
|
shaufi/odoo | refs/heads/8.0 | addons/product_expiry/__openerp__.py | 260 | ##############################################################################
#
# 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 GNU Affero General Public L... |
cloudfoundry/php-buildpack-legacy | refs/heads/master | builds/runtimes/python-2.7.6/lib/python2.7/json/encoder.py | 105 | """Implementation of JSONEncoder
"""
import re
try:
from _json import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from _json import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x... |
eckucukoglu/arm-linux-gnueabihf | refs/heads/master | arm-linux-gnueabihf/libc/usr/lib/python2.7/encodings/mac_turkish.py | 593 | """ Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.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... |
xodus7/tensorflow | refs/heads/master | tensorflow/contrib/metrics/python/ops/set_ops.py | 167 | # 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... |
angelblue05/xbmc | refs/heads/master | tools/EventClients/examples/python/example_button1.py | 70 | #!/usr/bin/python
# This is a simple example showing how you can send 2 button events
# to XBMC in a queued fashion to shut it down.
# Queued button events are not repeatable.
# The basic idea is to create single packets and shoot them to XBMC
# The provided library implements some of the support commands and
# take... |
2014c2g19/2014c2g19 | refs/heads/master | exts/sphinxcontrib/bibtex/latex_codec.py | 38 | # -*- coding: utf-8 -*-
"""
Character translation utilities for LaTeX-formatted text
========================================================
Usage:
- unicode(string,'latex')
- ustring.decode('latex')
are both available just by letting "import latex" find this file.
- unicode(string,'latex+latin1')
- ustring.decod... |
chrisjaquet/FreeCAD | refs/heads/master | src/Mod/Fem/_TaskPanelFemSolverCalculix.py | 1 | # ***************************************************************************
# * *
# * Copyright (c) 2013-2015 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * Th... |
jwren/intellij-community | refs/heads/master | python/testData/quickFixes/PyMakeMethodStaticQuickFixTest/noSelf_after.py | 249 | __author__ = 'ktisha'
class Child(Base):
def __init__(self):
super(Child, self).__init__()
@staticmethod
def f():
test = 1 |
poolooloo/emind-cloud-printer | refs/heads/master | troubleshoot/Shrug.py | 6 | #!/usr/bin/python3
## Printing troubleshooter
## Copyright (C) 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
## Author: Tim Waugh <twaugh@redhat.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 Found... |
andyzsf/Cactus- | refs/heads/master | cactus/deployment/s3/__init__.py | 20 | #coding:utf-8
|
Erethon/synnefo | refs/heads/develop | snf-astakos-app/astakos/im/migrations/0050_project_logs.py | 10 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
NORMAL = 1
SUSPENDED = 10
TERMINATED = 100
class Migration(DataMigration):
def forwards(self, orm):
logs = []
suspended = orm.Project.objects.filter(state=SUSPENDED)
... |
64studio/smart | refs/heads/master | smart/plugins/zyppchannelsync.py | 3 | #
# Written by Jonathan Rocker <linux.learner@gmail.com>
# and Anders F Bjorklund <afb@users.sourceforge.net>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Fre... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_light_chair_s02.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/jedi/shared_frn_all_light_chair_s02.iff"
result.attribute... |
bandi13/cs980-ROS-bot | refs/heads/master | ROS_ws/src/eyes/006_parameters/param_talker.py | 1 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... |
kno10/WikipediaEntities | refs/heads/master | subset-recommended.py | 1 | #!/usr/bin/python
import gzip, re, sys
# Minimum phrase length (characters)
minlen = 3
# Minimum number of occurrences
mincount = 50
# Minimum trust value
mintrust = 90
mintrustexact = 80
# Results with exact matches only
exactonly = True
# Minimum contrast, i.e. second may have at most trust < besttrust-mincontrast
m... |
golismero/golismero | refs/heads/master | thirdparty_libs/snakemq/packeter.py | 9 | # -*- coding: utf-8 -*-
"""
Packet format: ``[4B size|payload]``, size is bytes count (unsigned integer in
network order) of all following packet data.
:author: David Siroky (siroky@dasir.cz)
:license: MIT License (see LICENSE.txt or
U{http://www.opensource.org/licenses/mit-license.php})
"""
import logging
... |
ak2703/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/errortracker.py | 177 | import logging
import sys
import traceback
from collections import namedtuple
log = logging.getLogger(__name__)
ErrorLog = namedtuple('ErrorLog', 'tracker errors')
def exc_info_to_str(exc_info):
"""Given some exception info, convert it into a string using
the traceback.format_exception() function.
"""
... |
mpercich/Calendarize | refs/heads/master | ios/dateparser/lib/python2.7/site-packages/pip/_vendor/colorama/win32.py | 535 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = None
SetCon... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/docs/lib/python2.7/site-packages/setuptools/py36compat.py | 313 | import sys
from distutils.errors import DistutilsOptionError
from distutils.util import strtobool
from distutils.debug import DEBUG
class Distribution_parse_config_files:
"""
Mix-in providing forward-compatibility for functionality to be
included by default on Python 3.7.
Do not edit the code in this... |
BT-fgarbely/partner-contact | refs/heads/8.0 | partner_helper/__init__.py | 35 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Sébastien BEAU <sebastien.beau@akretion.com>
# Copyright 2014 Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
santhoshtr/silpa | refs/heads/master | src/silpa/modules/fortune/fortune.py | 3 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Fortune program
# Copyright 2008 Santhosh Thottingal <santhosh.thottingal@gmail.com>
# http://www.smc.org.in
#
# This program 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 ... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_instance_management_client_enums.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
adeboisanger/thumbor | refs/heads/master | tests/test_url.py | 4 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from unittest import TestCase
from preggy import expect
from thumbo... |
samuelchong/libcloud | refs/heads/trunk | docs/examples/compute/ecs/ex_list_security_groups.py | 29 | import pprint
from libcloud.compute.providers import get_driver
from libcloud.compute.types import Provider
ECSDriver = get_driver(Provider.ALIYUN_ECS)
region = 'cn-hangzhou'
access_key_id = 'CHANGE IT'
access_key_secret = 'CHANGE IT'
driver = ECSDriver(access_key_id, access_key_secret, region=region)
sec_groups =... |
bioinformatics-ua/montra | refs/heads/master | emif/questionnaire/admin.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/
#
# 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 Found... |
MariusLauge/dnd_tracker | refs/heads/master | dnd_tracker/settings.py | 1 | """
Django settings for dnd_tracker project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impor... |
endolith/scipy | refs/heads/master | scipy/_lib/decorator.py | 12 | # ######################### LICENSE ############################ #
# Copyright (c) 2005-2015, Michele Simionato
# 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 so... |
JonNRb/physics506 | refs/heads/master | src/fresnel/f_ratio.py | 1 | txt = None
with open('f_data.txt') as f:
txt = f.read()
lines = [i for i in txt.split('\n') if i]
data = [[int(i.strip()) for i in j.split('\t')] for j in lines]
import math
d2r = lambda ang: ang * math.pi / 180
ratio = lambda ang_2, ang_1: math.sin(d2r(ang_1)) / math.sin(d2r(ang_2))
for point in data:
print(... |
pvagner/orca | refs/heads/master | src/orca/scripts/apps/Banshee/__init__.py | 36 | from .script import Script
|
ustramooner/zeitgeist-lucenepp | refs/heads/clucene | _zeitgeist/engine/extensions/fts.py | 1 | # -.- coding: utf-8 -.-
# Zeitgeist
#
# Copyright © 2009 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@gmail.com>
# Copyright © 2010 Canonical Ltd
#
# This program 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 Foun... |
DrKita/cm14 | refs/heads/master | tools/perf/tests/attr.py | 3174 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... |
JanMalte/secondhandshop_server | refs/heads/master | src/shs_auth/middleware.py | 1 | """
Second-Hand-Shop Project
@author: Malte Gerth
@copyright: Copyright (C) 2015 Malte Gerth
@license: MIT
@maintainer: Malte Gerth
@email: mail@malte-gerth.de
"""
import pytz
from django.shortcuts import redirect
from django.utils import timezone
from events.models import get_active_event
from shs_auth.... |
TieWei/nova | refs/heads/enhanced/havana | nova/api/openstack/compute/plugins/v3/extended_availability_zone.py | 15 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Netease, LLC.
# 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/licens... |
Insality/argalactic | refs/heads/master | argalactic.py | 1 | # coding: utf-8
__author__ = 'Insality'
from scenes.menu import *
import pyglet
import config
def main():
print("Hello, Argalactic!")
director.init(resizable=True, caption=config.GAME_TITLE, width=config.GAME_WIDTH, height=config.GAME_HEIGHT)
director.window.set_icon(pyglet.image.load('res/icon.png'))
... |
alphagov/digitalmarketplace-api | refs/heads/dependabot/pip/digitalmarketplace-apiclient-22.2.0 | migrations/versions/840_add_application_close_date_for_framework.py | 1 | """Add `application_close_date` for Framework
Revision ID: 840
Revises: 830
Create Date: 2017-02-06 11:09:26.852142
"""
from alembic import op
from datetime import datetime
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '840'
down_revision = '830'
frameworks_table = sa.table(
'frame... |
captainsafia/agate | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
impo... |
LubyRuffy/spiderfoot | refs/heads/master | ext/stem/util/__init__.py | 13 | # Copyright 2011-2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Utility functions used by the stem library.
"""
__all__ = [
'conf',
'connection',
'enum',
'log',
'lru_cache',
'ordereddict',
'proc',
'system',
'term',
'test_tools',
'tor_tools',
]
|
rexshihaoren/scikit-learn | refs/heads/master | sklearn/utils/random.py | 234 | # Author: Hamzeh Alsalhi <ha258@cornell.edu>
#
# License: BSD 3 clause
from __future__ import division
import numpy as np
import scipy.sparse as sp
import operator
import array
from sklearn.utils import check_random_state
from sklearn.utils.fixes import astype
from ._random import sample_without_replacement
__all__ =... |
edofic/ggrc-core | refs/heads/develop | src/ggrc/cache/cache.py | 3 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from collections import namedtuple
CacheEntry = namedtuple('CacheEntry', 'model_plural class_name cache_type')
MappingEntry = namedtuple('MappingEntry', 'class_name attr polymorph')
def resource(model_pl... |
yangchaogit/locust | refs/heads/master | locust/exception.py | 45 | class LocustError(Exception):
pass
class ResponseError(Exception):
pass
class CatchResponseError(Exception):
pass
class InterruptTaskSet(Exception):
"""
Exception that will interrupt a Locust when thrown inside a task
"""
def __init__(self, reschedule=True):
"""
If *r... |
GNOME/orca | refs/heads/master | src/orca/braille_generator.py | 1 | # Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This... |
darmaa/odoo | refs/heads/master | addons/account_followup/report/__init__.py | 447 | # -*- 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... |
rlugojr/django | refs/heads/master | tests/from_db_value/models.py | 26 | import decimal
from django.db import models
class Cash(decimal.Decimal):
currency = 'USD'
def __str__(self):
s = super().__str__(self)
return '%s %s' % (s, self.currency)
class CashField(models.DecimalField):
def __init__(self, **kwargs):
kwargs['max_digits'] = 20
kwarg... |
scripni/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-fixed-base.py | 344 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure fixed base setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGy... |
mbohlool/client-python | refs/heads/master | kubernetes/client/models/v1beta2_daemon_set.py | 1 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
jvanbrug/alanaldavista | refs/heads/master | boto/cloudfront/distribution.py | 5 | # 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... |
JVillella/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/init_ops_test.py | 67 | # 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... |
y12uc231/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_mako_module.py | 261 | """ Test mako_module.py """
from unittest import TestCase
from mock import Mock
from xmodule.mako_module import MakoModuleDescriptor
class MakoModuleTest(TestCase):
""" Test MakoModuleDescriptor """
def test_render_template_check(self):
mock_system = Mock()
mock_system.render_template = Non... |
frohoff/Empire | refs/heads/master | lib/stagers/windows/teensy.py | 12 | from lib.common import helpers
class Stager:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'TeensyLauncher',
'Author': ['@matterpreter'],
'Description': ('Generates a Teensy script that runes a one-liner stage0 launcher for Empire.'),
'C... |
Ictp/indico | refs/heads/master | indico/modules/scheduler/tasks/suggestions.py | 2 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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... |
mohammed-alfatih/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/code/test_excinfo.py | 165 | # -*- coding: utf-8 -*-
import _pytest
import py
import pytest
from _pytest._code.code import FormattedExcinfo, ReprExceptionInfo
queue = py.builtin._tryimport('queue', 'Queue')
failsonjython = pytest.mark.xfail("sys.platform.startswith('java')")
from test_source import astonly
try:
import importlib
except Impo... |
rhertzog/django | refs/heads/master | tests/sites_tests/tests.py | 16 | from __future__ import unicode_literals
from django.apps import apps
from django.apps.registry import Apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.management import create_default_site
from django.contrib.sites.middleware import CurrentSiteMiddleware
from djan... |
janusnic/youtube-dl-GUI | refs/heads/master | youtube_dl/extractor/wayofthemaster.py | 154 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class WayOfTheMasterIE(InfoExtractor):
_VALID_URL = r'https?://www\.wayofthemaster\.com/([^/?#]*/)*(?P<id>[^/?#]+)\.s?html(?:$|[?#])'
_TEST = {
'url': 'http://www.wayofthemaster.com/hbks.shtml',
'md5': '5316... |
rohlandm/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py | 636 | # Copyright 2012, 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 conditions and the f... |
wagnerand/olympia | refs/heads/master | src/olympia/amo/tests/test_decorators.py | 4 | from datetime import datetime, timedelta
from django import http
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from django.test import RequestFactory
import mock
import pytest
from olympia import amo
from olympia.amo import decorators
from olympia.amo.tests ... |
pwoodworth/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/__init__.py | 94 | from django.conf import settings
from django.core import signals
from django.core.exceptions import ImproperlyConfigured
from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \
DatabaseError, IntegrityError
from django.utils.functional import curry
... |
mosdef-hub/mbuild | refs/heads/master | mbuild/lib/molecules/__init__.py | 2 | """Library of molecules for mBuild."""
from mbuild.lib.molecules.ethane import Ethane
from mbuild.lib.molecules.methane import Methane
from mbuild.lib.molecules.water import (
WaterSPC,
WaterTIP3P,
WaterTIP4P,
WaterTIP4P2005,
WaterTIP4PIce,
)
|
lnls-dig/malamute | refs/heads/master | bindings/python/setup.py | 4 | ################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
#############################################################################... |
wartman4404/servo | refs/heads/master | tests/wpt/update/upstream.py | 43 | import os
import re
import subprocess
import sys
import urlparse
from wptrunner.update.sync import LoadManifest
from wptrunner.update.tree import get_unique_name
from wptrunner.update.base import Step, StepRunner, exit_clean, exit_unclean
from .tree import Commit, GitTree, Patch
import github
from .github import GitH... |
petewarden/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/bias_op_test.py | 20 | # Copyright 2019 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... |
xuru/restler | refs/heads/master | lib/usr/sqlalchemy/ext/mutable.py | 2 | # ext/mutable.py
# Copyright (C) 2005-2012 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
"""Provide support for tracking of in-place changes to scalar values,
which are propaga... |
netjunki/trac-Pygit2 | refs/heads/mergewithbeta1.0 | trac/wiki/model.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of th... |
jjmleiro/hue | refs/heads/master | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/openssl/bio.py | 7 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/bio.h>
"""
TYPES = """
typedef struct b... |
darren-rogan/CouchPotatoServer | refs/heads/master | couchpotato/core/providers/movie/themoviedb/main.py | 2 | from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import simplifyString, toUnicode
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.movie.base import MovieProvider
from libs.themoviedb import tmdb
log = CPLog(__name__)
class TheMovieDb(MovieProvider):
de... |
largelymfs/w2vtools | refs/heads/master | build/scipy/scipy/optimize/tnc/example.py | 95 | #!/usr/bin/env python
# Python TNC example
# @(#) $Jeannot: example.py,v 1.4 2004/04/02 18:51:04 js Exp $
from __future__ import division, print_function, absolute_import
import tnc
# A function to minimize
# Must return a tuple with the function value and the gradient (as a list)
# or None to abort the minimization... |
kz26/bang-at-uchicago | refs/heads/master | app/local_settings.py | 1 | # Django settings for app project.
import os
from datetime import timedelta
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('admin', 'bang@bangatuchicago.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add '... |
gizmag/django-mobile | refs/heads/master | django_mobile/compat.py | 6 | try:
from django.template.engine import Engine
from django.template.loaders.base import Loader as BaseLoader
except ImportError: # Django < 1.8
Engine = None
from django.template.loader import BaseLoader, find_template_loader, get_template_from_string
def template_loader(loader_name):
if Engine:
... |
Nymeria8/NGS_utilities | refs/heads/master | categorize.py | 1 | #!/usr/bin/python3
# This scripts was used as part of a redundancy pipeline. It forms groups of homologies, when a homologie search of sequences against themselves is made. It clusters the sequences by their mutual hits
#The output is a list of fasta headers, where each cluster is divided by "---\n"
#python categorize.... |
perezg/infoxchange | refs/heads/master | BASE/lib/python2.7/site-packages/django/core/mail/backends/smtp.py | 130 | """SMTP email backend class."""
import smtplib
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.utils import DNS_NAME
from django.core.mail.message import sanitize_address
from django.utils.encoding import force_bytes
class... |
chenss/ChatRoom | refs/heads/master | 14.5 已经能运行(虽然有很多Warning)的Django-nonrel框架/django/contrib/gis/db/backends/mysql/base.py | 308 | from django.db.backends.mysql.base import *
from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper
from django.contrib.gis.db.backends.mysql.creation import MySQLCreation
from django.contrib.gis.db.backends.mysql.introspection import MySQLIntrospection
from django.contrib.gis.db.backends.mysq... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | python/Lib/site-packages/win32/Demos/BackupRead_BackupWrite.py | 4 | ## demonstrates using BackupRead and BackupWrite to copy all of a file's data streams
import win32file, win32api, win32con, win32security, ntsecuritycon
from win32com import storagecon
import pythoncom, pywintypes
import struct, traceback
from pywin32_testutil import str2bytes, ob2memory
all_sd_info=win32secu... |
google/material-design-icons | refs/heads/master | update/venv/lib/python3.9/site-packages/pip/_internal/utils/filesystem.py | 2 | import fnmatch
import os
import os.path
import random
import shutil
import stat
import sys
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from typing import Any, BinaryIO, Iterator, List, Union, cast
from pip._vendor.tenacity import retry, stop_after_delay, wait_fixed
from pip._internal... |
ryfeus/lambda-packs | refs/heads/master | Tensorflow/source/pbr/hooks/base.py | 101 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... |
hmen89/odoo | refs/heads/master | addons/l10n_be/wizard/l10n_be_vat_intra.py | 332 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Adapted by Noviat to
# - make the 'mand_id' field optional
# - support Noviat tax code scheme
#... |
zanph/zanph | refs/heads/master | flaskroulette/venv/lib/python2.7/site-packages/wheel/egg2wheel.py | 471 | #!/usr/bin/env python
import os.path
import re
import sys
import tempfile
import zipfile
import wheel.bdist_wheel
import shutil
import distutils.dist
from distutils.archive_util import make_archive
from argparse import ArgumentParser
from glob import iglob
egg_info_re = re.compile(r'''(?P<name>.+?)-(?P<ver>.+?)
(-... |
sanastasiou/notepad-plus-plus | refs/heads/master | scintilla/scripts/Face.py | 56 | # Face.py - module for reading and parsing Scintilla.iface file
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Requires Python 2.5 or later
def sanitiseLine(line):
if line[-1:] == '\n': line = line[:-1]
if line.find("##") != -1:
line = line[:line.find("##")]
lin... |
linglung/ytdl | refs/heads/master | test/test_subtitles.py | 21 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, md5
from youtube_dl.extractor import (
YoutubeIE,
DailymotionIE,
TE... |
earshel/PokeyPySnipe | refs/heads/master | POGOProtos/Data/Player/PlayerCamera_pb2.py | 16 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Data/Player/PlayerCamera.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf... |
rajathkumarmp/BinPy | refs/heads/develop | BinPy/algorithms/makebooleanfunction.py | 5 | from BinPy.algorithms.ExpressionConvert import *
from BinPy.algorithms.QuineMcCluskey import *
import sys
def make_boolean(vars, min_max, dont_care=None, **kwargs):
"""
A function which takes in minterms/maxterms and
returns the Boolean Function and implementable form
Don't Care Conditions can also be... |
eivantsov/flask | refs/heads/master | lib/werkzeug/contrib/jsrouting.py | 318 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.jsrouting
~~~~~~~~~~~~~~~~~~~~~~~~~~
Addon module that allows to create a JavaScript function from a map
that generates rules.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
... |
erkrishna9/odoo | refs/heads/master | addons/website_event/__openerp__.py | 68 | # -*- coding: utf-8 -*-
{
'name': 'Online Events',
'category': 'Website',
'summary': 'Schedule, Promote and Sell Events',
'version': '1.0',
'description': """
Online Events
""",
'author': 'OpenERP SA',
'depends': ['website', 'website_partner', 'website_mail', 'event'],
'data': [... |
InstitutoPascal/Staff | refs/heads/master | languages/my-mm.py | 85 | # -*- coding: utf-8 -*-
{
'!langcode!': 'my-mm',
'!langname!': 'မြန်မာ',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%s %%{row} del... |
akhof/PySaved | refs/heads/master | PySaved/src/PyInstaller/hooks/hook-xml.dom.py | 10 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
Senseg/robotframework | refs/heads/master | src/robot/parsing/tablepopulators.py | 1 | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... |
Voyager1/xbmc | refs/heads/master | tools/EventClients/examples/python/example_mouse.py | 262 | #!/usr/bin/python
# This is a simple example showing how you can send mouse movement
# events to XBMC.
# NOTE: Read the comments in 'example_button1.py' for a more detailed
# explanation.
import sys
sys.path.append("../../lib/python")
from xbmcclient import *
from socket import *
def main():
import time
im... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | analytic_solution/test_cases/8NodeBrick/cantilever_irregular_element_with_divisions/shape3/NumberOfDivision4/vertical_load/compare_HDF5_ALL.py | 424 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
Coelhon/MasterRepo.repository | refs/heads/master | plugin.video.SportsDevil-2016.12.31/lib/utils/fileUtils.py | 15 | # -*- coding: utf-8 -*-
import os
import datetime, time
import random
import hashlib
import codecs
#######################################
# File Helpers
#######################################
def fileExists(filename):
return os.path.isfile(filename)
def getFileExtension(filename):
ext_pos = filename.rfind... |
vbshah1992/microblog | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/lang/snowball/italian.py | 96 | from .bases import _StandardStemmer
from whoosh.compat import u
class ItalianStemmer(_StandardStemmer):
"""
The Italian Snowball stemmer.
:cvar __vowels: The Italian vowels.
:type __vowels: unicode
:cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm.
:type __step0_suff... |
ebigelow/LOTlib | refs/heads/master | LOTlib/Testing/old/MiscellaneousTest.py | 2 | """
class to test Miscellaneous.py
follows the standards in https://docs.python.org/2/library/unittest.html
"""
import unittest
from LOTlib.Miscellaneous import *
class MiscellaneousTest(unittest.TestCase):
# initialization that happens before each test is carried out
def setUp(self):
... |
rickmei/p2pool | refs/heads/master | p2pool/util/deferred_resource.py | 283 | from __future__ import division
from twisted.internet import defer
from twisted.web import resource, server
from twisted.python import log
class DeferredResource(resource.Resource):
def render(self, request):
def finish(x):
if request.channel is None: # disconnected
return
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.