repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/core/management/color.py | 151 | """
Sets up the terminal color scheme.
"""
import os
import sys
from django.utils import lru_cache, termcolors
def supports_color():
"""
Returns True if the running system's terminal supports color,
and False otherwise.
"""
plat = sys.platform
supported_platform = plat != 'Pocket PC' and (pl... |
gcblue/gcblue | refs/heads/master | scripts/UnitCommands.py | 1 | import os, sys
from os.path import dirname, abspath, join, normpath
sys.path.append(abspath(join(dirname(__file__), 'Amram_Script_Data')))
from MissionTemplates import *
from Amram_Utilities import *
import math
deg_to_rad = 0.01745329252
def SetFormationLeader(UI, id):
UI.SetFormationLeader(id)
UI.UpdateMi... |
vdemeester/compose | refs/heads/master | tests/unit/cli/errors_test.py | 3 | import pytest
from docker.errors import APIError
from requests.exceptions import ConnectionError
from compose.cli import errors
from compose.cli.errors import handle_connection_errors
from compose.const import IS_WINDOWS_PLATFORM
from tests import mock
@pytest.yield_fixture
def mock_logging():
with mock.patch('c... |
How2Compute/SmartHome | refs/heads/master | cli/py3env/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/misc.py | 1428 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Backports for individual classes and functions."""
import os
import sys
__all__ = ['cache_from_source', 'callable', 'fsencode']
try:
from imp import cache_from_source
except ImportError:
... |
antirais/estnin | refs/heads/master | setup.py | 1 | #!/usr/bin/env python3
# coding: UTF-8
import os
from setuptools import setup, Command
root = os.path.abspath('.')
current_dir = os.path.dirname(__file__)
def read_file(file_name):
with open(os.path.join(current_dir, file_name), 'r') as file:
return file.read()
README = read_file('README.rst')
VERSION... |
iamthearm/bazel | refs/heads/master | tools/android/build_split_manifest.py | 20 | # Copyright 2015 The Bazel 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 applicable la... |
olasitarska/django | refs/heads/master | tests/serializers/models.py | 5 | # -*- coding: utf-8 -*-
"""
42. Serialization
``django.core.serializers`` provides interfaces to converting Django
``QuerySet`` objects to and from "flat" data (i.e. strings).
"""
from __future__ import unicode_literals
from decimal import Decimal
from django.db import models
from django.utils import six
from django... |
geohot/topmodel | refs/heads/master | topmodel/hmetrics.py | 1 | import numpy as np
def recalls(hist):
# true positive rate
# TP / (TP + FN)
ret = []
trues = sum(hist['trues'])
all_trues = trues
for i in range(len(hist['probs'])):
ret.append(trues * 1.0 / all_trues if all_trues != 0 else None)
trues -= hist['trues'][i]
return ret
def f... |
ericholscher/merchant | refs/heads/master | billing/models/authorize_models.py | 3 | from django.db import models
# Response Codes
# APPROVED, DECLINED, ERROR, FRAUD_REVIEW = 1, 2, 3, 4
class AuthorizeAIMResponse(models.Model):
RESPONSE_CODES = [
(1, 'Approved'),
(2, 'Declined'),
(3, 'Error'),
(4, 'Held for Review'),
]
ADDRESS_VERIFICATION_RESPONSE = [
... |
beangoben/qwxwhat | refs/heads/master | qwxwhat.py | 1 | __version__ = "0.5.6"
from pythonwhat.check_syntax import state_dec, Ex
#from pythonwhat.test_funcs import test_student_typed
#from pythonwhat.check_funcs import test_not
import numpy as np
# ERROR messages
TYPE_MSG = "__JINJA__: **type** **mismatch**: expected `{{sol_eval}}`, got `{{stu_eval}}`."
TYPE_EXPR = 'type({... |
apache/arrow | refs/heads/master | dev/merge_arrow_pr.py | 4 | #!/usr/bin/env python
#
# 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 "Li... |
fangxingli/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/formtools/tests/wizard/namedwizardtests/forms.py | 318 | import os
import tempfile
from django import forms
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.http import HttpResponse
from django.template import Template, Context
from django.contrib.auth.models import User
from django.contrib.formtools.wiz... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GLES2/ARM/mali_program_binary.py | 8 | '''OpenGL extension ARM.mali_program_binary
This module customises the behaviour of the
OpenGL.raw.GLES2.ARM.mali_program_binary to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARM/mali_program_binary.txt
'''
from OpenGL import ... |
isrohutamahopetechnik/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/lib/lapack/__init__.py | 62 | #
# LAPACK wrappers
#
from info import __doc__
__all__ = ['get_lapack_funcs','calc_lwork','flapack','clapack']
import calc_lwork
# The following ensures that possibly missing flavor (C or Fortran) is
# replaced with the available one. If none is available, exception
# is raised at the first attempt to use the resou... |
boretom/pyload-apkg | refs/heads/master | source/py-mods-prebuilt-i386/site-packages/PIL/JpegImagePlugin.py | 40 | #
# The Python Imaging Library.
# $Id$
#
# JPEG (JFIF) file handling
#
# See "Digital Compression and Coding of Continous-Tone Still Images,
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
#
# History:
# 1995-09-09 fl Created
# 1995-09-13 fl Added full parser
# 1996-03-25 fl Added hack to use th... |
foreni-packages/golismero | refs/heads/master | tools/sqlmap/waf/varnish.py | 7 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.enums import HTTP_HEADER
from lib.core.settings import WAF_ATTACK_VECTORS
__product__ = "Varnish FireWall (OWASP) "
def detect(get_page):
retval... |
s0lst1ce/twisted-intro | refs/heads/master | basic-twisted/hello.py | 11 |
def hello():
print 'Hello from the reactor loop!'
print 'Lately I feel like I\'m stuck in a rut.'
from twisted.internet import reactor
reactor.callWhenRunning(hello)
print 'Starting the reactor.'
reactor.run()
|
sankalpg/Essentia_tonicDebug_TEMP | refs/heads/master | test/src/unittest/highlevel/test_singlebeatloudness.py | 10 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... |
mickele77/FreeCAD | refs/heads/master | src/Mod/Path/PathScripts/PathDrilling.py | 7 | # -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
#* ... |
kushalbhola/MyStuff | refs/heads/master | Practice/PythonApplication/env/Lib/site-packages/pandas/plotting/_matplotlib/core.py | 2 | import re
from typing import Optional # noqa
import warnings
import numpy as np
from pandas._config import get_option
from pandas.errors import AbstractMethodError
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common import (
is_hashable,
is_integer,
is_iterator,
is_lis... |
bspink/django | refs/heads/master | tests/utils_tests/test_lorem_ipsum.py | 246 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.utils.lorem_ipsum import paragraphs, words
class WebdesignTest(unittest.TestCase):
def test_words(self):
self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur adipisicing')
def test_paragraphs(... |
msebire/intellij-community | refs/heads/master | python/testData/inspections/PyProtocolInspection/protocolBases.py | 19 | from typing import Protocol
class MyProto1(Protocol):
pass
class MyProto2(Protocol):
pass
class A:
pass
class B(A, MyProto1):
pass
class C(MyProto1, MyProto2):
pass
class <warning descr="All bases of a protocol must be protocols">D</warning>(A, MyProto1, Protocol):
pass
class E(MyP... |
CRImier/yowsup | refs/heads/master | yowsup/layers/protocol_profiles/protocolentities/iq_picture_set.py | 65 | from .iq_picture import PictureIqProtocolEntity
from yowsup.structs import ProtocolTreeNode
import time
class SetPictureIqProtocolEntity(PictureIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:profile:picture", to={{jid}}">
<picture type="image" id="{{another_id}}">
{{Binary bytes of t... |
supriyantomaftuh/django | refs/heads/master | tests/forms_tests/tests/test_fields.py | 134 | # -*- coding: utf-8 -*-
"""
##########
# Fields #
##########
Each Field class does some sort of validation. Each Field has a clean() method,
which either raises django.forms.ValidationError or returns the "clean"
data -- usually a Unicode object, but, in some rare cases, a list.
Each Field's __init__() takes at least... |
MSOpenTech/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/courseware_index.py | 6 | """ Code to allow module store to interface with courseware index """
from __future__ import absolute_import
import logging
from django.utils.translation import ugettext as _
from opaque_keys.edx.locator import CourseLocator
from search.search_engine_base import SearchEngine
from eventtracking import tracker
from . ... |
datapythonista/pandas | refs/heads/master | pandas/__init__.py | 3 | # flake8: noqa
__docformat__ = "restructuredtext"
# Let users know if they're missing any of our hard dependencies
hard_dependencies = ("numpy", "pytz", "dateutil")
missing_dependencies = []
for dependency in hard_dependencies:
try:
__import__(dependency)
except ImportError as e:
missing_depe... |
deshipu/micropython | refs/heads/master | tools/gen-cpydiff.py | 1 | # This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Rami Ali
#
# 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 res... |
clayg/swift | refs/heads/master | test/unit/common/test_storage_policy.py | 4 | # 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... |
dmcelectrico/Subtitle-Toolbox | refs/heads/master | sites/subtitulos_es.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import utils
import iso6392
import re
from classes.Entities import *
from bs4 import BeautifulSoup
URL = "http://www.subtitulos.es/"
def get_all_subtitles(series,season,episode):
series_url_name = __translate_series_name(series)
subtitles_url = URL+series_url_name+"/"+str(s... |
AICP/external_chromium_org | refs/heads/lp5.0 | chrome/common/extensions/docs/server2/cron_servlet.py | 7 | # Copyright 2013 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 logging
import posixpath
import traceback
from app_yaml_helper import AppYamlHelper
from appengine_wrappers import IsDeadlineExceededError, logservic... |
zmap/ztag | refs/heads/master | ztag/annotations/netgear.py | 1 | from ztag.annotation import *
class NetGearSmartSwitch(Annotation):
protocol = protocols.HTTP
subprotocol = protocols.HTTP.GET
port = None
tests = {
"netgear_smart_switch":{
"global_metadata":{
"manufacturer":Manufacturer.NETGEAR,
"device_type":Type.SWITCH,
... |
DukeOfHazard/crits | refs/heads/master | crits/comments/api.py | 21 | from tastypie import authorization
from tastypie.authentication import MultiAuthentication
from crits.comments.comment import Comment
from crits.comments.handlers import comment_add
from crits.core.api import CRITsApiKeyAuthentication, CRITsSessionAuthentication
from crits.core.api import CRITsSerializer, CRITsAPIReso... |
FFMG/myoddweb.piger | refs/heads/master | monitor/api/python/Python-3.7.2/Lib/test/bisect.py | 3 | #!/usr/bin/env python3
"""
Command line tool to bisect failing CPython tests.
Find the test_os test method which alters the environment:
./python -m test.bisect --fail-env-changed test_os
Find a reference leak in "test_os", write the list of failing tests into the
"bisect" file:
./python -m test.bisect -o b... |
elmerdpadilla/iv | refs/heads/8.0 | addons/mrp_operations/report/__init__.py | 443 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
marc-sensenich/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_log_publisher.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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',
... |
abhi252/GloVeGraphs | refs/heads/master | Initial_Test/glove.py | 1 | #!/usr/bin/env python
from argparse import ArgumentParser
import codecs
from collections import Counter
import itertools
from functools import partial
import logging
from math import log
import os.path
import cPickle as pickle
from random import shuffle
import msgpack
import numpy as np
from scipy import sparse
from... |
IndonesiaX/edx-platform | refs/heads/master | common/djangoapps/performance/views/__init__.py | 51 | import datetime
import json
import logging
from django.http import HttpResponse
from track.utils import DateTimeJSONEncoder
perflog = logging.getLogger("perflog")
def _get_request_header(request, header_name, default=''):
"""Helper method to get header values from a request's META dict, if present."""
if ... |
gangadharkadam/v6_frappe | refs/heads/develop | frappe/patches/v6_2/ignore_user_permissions_if_missing.py | 42 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("System Settings")
system_settings = frappe.get_doc("System Settings")
system_settings.ignore_user_permissions_if_missing = 1
system_settings.flags.ignore_mandatory = 1
system_settings.save()
|
frappe/erpnext | refs/heads/develop | erpnext/education/doctype/fees/test_fees.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate
from frappe.utils.make_random import get_random
from erpnext.education.doctype.program.test_program import make_pro... |
indevgr/django | refs/heads/master | django/contrib/gis/admin/options.py | 52 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.db import models
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
from django.core.exceptions import ImproperlyConfigured
spherical_mercator_srid = 3857
class GeoModelAdmin(Model... |
DougBurke/astropy | refs/heads/master | astropy/constants/__init__.py | 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains astronomical and physical constants for use in Astropy or other
places.
A typical use case might be::
>>> from astropy.constants import c, m_e
>>> # ... define the mass of something you want the rest energy of as m ...
>>> m = m_... |
prutseltje/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_device_ntp.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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',
... |
jashwanth9/Expert-recommendation-system | refs/heads/master | code/collab_content_based_tags.py | 1 | import pdb
import random
import evaluate
import warnings
import collections
import numpy as np
import cPickle as pickle
from scipy import sparse
from scipy.spatial import distance
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import MultinomialNB
from sklearn.neighbors import NearestNeighbors
fr... |
nicoboss/Floatmotion | refs/heads/master | OpenGL/GL/NV/register_combiners2.py | 9 | '''OpenGL extension NV.register_combiners2
This module customises the behaviour of the
OpenGL.raw.GL.NV.register_combiners2 to provide a more
Python-friendly API
Overview (from the spec)
The NV_register_combiners extension provides a powerful fragment
coloring mechanism. This specification extends the register... |
richbs/colourlens | refs/heads/master | colourlens/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py | 2918 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
tripzero/snetcam | refs/heads/master | snetcam/test_color_filter.py | 1 | #!/usr/bin/env python
import cv2
from .avg_color import color_filter
import numpy as np
def nothing(x):
pass
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('file_to_process', help="file_to_process")
args = parser.parse_args()
img = cv2.imread(args.file_to... |
throwable-one/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/templatetags/__init__.py | 12133432 | |
samatdav/zulip | refs/heads/master | tools/__init__.py | 12133432 | |
aleksandra-tarkowska/django | refs/heads/master | tests/conditional_processing/__init__.py | 12133432 | |
meskobalazs/django-bootstrap | refs/heads/master | main/__init__.py | 12133432 | |
wkschwartz/django | refs/heads/stable/3.2.x | django/contrib/gis/db/backends/mysql/operations.py | 16 | from django.contrib.gis.db import models
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import (
BaseSpatialOperations,
)
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.geos.geometry import GEOSGeometry... |
hpcugent/graphite-web | refs/heads/HPC | webapp/graphite/jobs.py | 1 | """
Interacts with the job database/storage.
At the moment; this uses hard coded data but should finally interact with the real database/storage.
"""
import time
from vsc.utils.dateandtime import timestamp_parser
from sqlalchemy import create_engine, MetaData, Table, select
from graphite.logger import log
engine = cr... |
nju520/youtube-dl | refs/heads/master | youtube_dl/extractor/rai.py | 76 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
from ..utils import (
parse_duration,
unified_strdate,
)
class RaiIE(InfoExtractor):
_VALID_URL = r'(?P<url>(?P<host>http://(?:.+?\.)?(?:rai\.it|rai\.tv|rainews\.it))/dl/... |
UITools/saleor | refs/heads/master | saleor/order/migrations/0043_auto_20180322_0655.py | 1 | # Generated by Django 2.0.3 on 2018-03-22 11:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0042_auto_20180227_0436'),
]
operations = [
migrations.AlterModelOptions(
name='order',
options={'ordering'... |
3dfxmadscientist/CBSS | refs/heads/master | addons/portal/__openerp__.py | 55 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
nickpegg/ciscolib | refs/heads/master | ciscolib/helpers.py | 2 | import re
def shorten_int_name(interface_name):
"""
Returns the Cisco shortened interface name from a full one.
If the full interface name is invalid, this will return None
"""
short = None
regex = "(\w{2}).*?(\d+(?:/\d+)?(?:/\d+)?)"
match = re.match(regex, interface_name)
... |
Qgap/zulip | refs/heads/master | zerver/lib/test_helpers.py | 114 | from django.test import TestCase
from zerver.lib.initial_password import initial_password
from zerver.lib.db import TimeTrackingCursor
from zerver.lib import cache
from zerver.lib import event_queue
from zerver.worker import queue_processors
from zerver.lib.actions import (
check_send_message, create_stream_if_ne... |
pamfilos/invenio | refs/heads/master-sql-fixes | modules/bibformat/lib/elements/bfe_date.py | 25 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 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
## ... |
NeovaHealth/odoo | refs/heads/8.0 | addons/website_membership/controllers/__init__.py | 7372 | import main
|
pra85/calibre | refs/heads/master | src/html5lib/treewalkers/simpletree.py | 27 | import gettext
_ = gettext.gettext
import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
"""Given that simpletree has no performant way of getting a node's
next sibling, this implementation returns "nodes" as tuples with the
following content:
1. The parent Node (Element, Document or DocumentF... |
sisl/Chimp | refs/heads/master | chimp/simulators/gym/__init__.py | 1 | """
Import OpenAI Gym Wrapper
"""
|
vechorko/django-filer | refs/heads/develop | filer/models/tools.py | 46 | #-*- coding: utf-8 -*-
from filer.models import Clipboard
def discard_clipboard(clipboard):
clipboard.files.clear()
def delete_clipboard(clipboard):
for file_obj in clipboard.files.all():
file_obj.delete()
def get_user_clipboard(user):
if user.is_authenticated():
clipboard = Clipboard.... |
ziir/lumbergh | refs/heads/master | vendor-local/lib/python/south/tests/circular_b/migrations/0001_first.py | 174 | from south.db import db
from django.db import models
class Migration:
depends_on = [('circular_a', '0001_first')]
def forwards(self):
pass
def backwards(self):
pass
|
Horrowind/mockup | refs/heads/master | tools/wasm-sourcemap.py | 1 | #!/usr/bin/env python
# Copyright 2018 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Utility tools that extracts DWARF informatio... |
Amber-Creative/amber-frappe | refs/heads/master | frappe/utils/logger.py | 6 | from __future__ import unicode_literals
import frappe
import logging
default_log_level = logging.DEBUG
def get_logger(module, with_more_info=True):
if module in frappe.loggers:
return frappe.loggers[module]
formatter = logging.Formatter('%(asctime)s - %(pathname)s [%(levelname)s]:\n%(message)s')
handler = loggi... |
pedrobaeza/odoo | refs/heads/master | addons/hr_timesheet/report/__init__.py | 395 | import hr_timesheet_report
|
mapbased/vitess | refs/heads/master | test/initial_sharding_bytes.py | 5 | #!/usr/bin/env python
#
# Copyright 2013, 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.
"""Re-runs initial_sharding.py with a varbinary keyspace_id."""
from vtdb import keyrange_constants
import base_sharding
import initial_shar... |
drewokane/xray | refs/heads/master | xarray/test/test_combine.py | 1 | from copy import deepcopy
import numpy as np
import pandas as pd
from xarray import Dataset, DataArray, auto_combine, concat, Variable
from xarray.core.pycompat import iteritems, OrderedDict
from . import TestCase, InaccessibleArray, requires_dask
from .test_dataset import create_test_data
class TestConcatDataset(... |
Reddcraft/reddcraftd | refs/heads/master | lib/dividend.py | 1 | #! /usr/bin/python3
"""Pay out dividends."""
import struct
import decimal
D = decimal.Decimal
from . import (util, config, exceptions, reddcoin, util)
FORMAT_1 = '>QQ'
LENGTH_1 = 8 + 8
FORMAT_2 = '>QQQ'
LENGTH_2 = 8 + 8 + 8
ID = 50
def validate (db, source, quantity_per_unit, asset, dividend_asset, block_index):
... |
ncbray/pystream | refs/heads/master | bin/analysis/ipa/memory/__init__.py | 39 | # Copyright 2011 Nicholas Bray
#
# 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... |
SoftwareMaven/django | refs/heads/master | tests/migrations/test_migrations_squashed_erroneous/2_auto.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "1_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
Samael500/helena | refs/heads/master | helena/content/models.py | 1 | from django.db import models
from helpers.service import image_path
class ImgWithDescr(models.Model):
""" class with genres model """
directory = None
def get_image_path(instace, filename):
return image_path(instace, filename, directory=instace.directory)
title = models.CharField(verbose_... |
GunoH/intellij-community | refs/heads/master | python/testData/resolve/TypingListInheritor.py | 20 | from typing import List
class A(List[int]):
pass
A().append()
# <ref> |
tao12345666333/app-turbo | refs/heads/master | turbo/fake/project_template/models/settings.py | 1 | # -*- coding:utf-8 -*-
from db.conn import (
test as _test,
user as _user,
test_files as _test_files,
user_files as _user_files,
)
MONGO_DB_MAPPING = {
'db': {
'test': _test,
'user': _user,
},
'db_file': {
'test': _test_files,
'user': _user_files,
}
}
|
puzan/ansible | refs/heads/devel | lib/ansible/modules/packaging/language/bundler.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Tim Hoiberg <tim.hoiberg@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 L... |
prudnikov/python-oauth2 | refs/heads/master | oauth2/_version.py | 2 | # This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "212"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... |
AidanGG/tensorflow_tmva | refs/heads/master | tensorflow_tmva/classification/__init__.py | 12133432 | |
puzan/ansible | refs/heads/devel | lib/ansible/modules/utilities/__init__.py | 12133432 | |
indictranstech/ebuy-now-frappe | refs/heads/develop | frappe/integrations/doctype/__init__.py | 12133432 | |
infoclock/OlympicTracker | refs/heads/master | allauthdemo/demo/migrations/__init__.py | 12133432 | |
sanghinitin/golismero | refs/heads/master | thirdparty_libs/django/conf/locale/es_MX/__init__.py | 12133432 | |
erikr/django | refs/heads/master | tests/migrations/__init__.py | 12133432 | |
sublime1809/django | refs/heads/master | django/contrib/gis/tests/layermap/__init__.py | 12133432 | |
henry-ajere/rad2py | refs/heads/master | assignments/program6A.py | 16 | #!/usr/bin/env python
# coding:utf-8
"PSP Program 6A - Linear Regression Prediction Interval"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__license__ = "GPL 3.0"
from math import sqrt, pi
# reuse previous programs
from program1A import mean
from progr... |
ergodicbreak/evennia | refs/heads/master | evennia/objects/objects.py | 1 | """
This module defines the basic `DefaultObject` and its children
`DefaultCharacter`, `DefaultPlayer`, `DefaultRoom` and `DefaultExit`.
These are the (default) starting points for all in-game visible
entities.
"""
import time
from builtins import object
from future.utils import listvalues, with_metaclass
from django... |
DuCorey/bokeh | refs/heads/master | tests/integration/integration_tests_plugin.py | 8 | import os
import pytest
from bokeh.io import output_file
from .screenshot import Screenshot, ScreenshotMismatchError
def pytest_addoption(parser):
parser.addoption(
"--set-new-base-screenshot", dest="set_new_base_screenshot", action="store_true", default=False,
help="Use to set a new screenshot f... |
Alofoxx/club-websystem | refs/heads/master | src/events/migrations/0004_created_recurring_event_model.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('events', '0003_changed_event_model'),
]
operations = [
migrations.CreateModel(
... |
mattesno1/Sick-Beard | refs/heads/master | sickbeard/notifiers/nma.py | 10 | import sickbeard
from sickbeard import logger, common
from lib.pynma import pynma
class NMA_Notifier:
def test_notify(self, nma_api, nma_priority):
return self._sendNMA(nma_api, nma_priority, event="Test", message="Testing NMA settings from Sick Beard", force=True)
def notify_snatch(se... |
ramineni/myironic | refs/heads/master | ironic/drivers/modules/ipminative.py | 1 | # coding=utf-8
# Copyright 2013 International Business Machines Corporation
# 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/... |
gxk/libnl | refs/heads/master | python/netlink/route/address.py | 3 | #
# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
#
"""Module providing access to network addresses
"""
__version__ = "1.0"
__all__ = [
'AddressCache',
'Address']
import datetime
import netlink.core as netlink
import netlink.capi as core_capi
import netlink.route.capi as capi
import netlink.route.link as Link
imp... |
thermokarst/qiime2 | refs/heads/master | qiime2/core/testing/type.py | 1 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
garethsion/Bad_Boids | refs/heads/master | refactored_boids_no_classes.py | 1 | """
A deliberately bad implementation of [Boids](http://dl.acm.org/citation.cfm?doid=37401.37406)
for use as an exercise on refactoring.
"""
from matplotlib import pyplot as plt
from matplotlib import animation
import random
from numpy import array
# Deliberately terrible code for teaching purposes
number_of_boids =... |
pablorecio/djangae | refs/heads/master | djangae/contrib/gauth/sql/backends.py | 14 | from djangae.contrib.gauth.common.backends import BaseAppEngineUserAPIBackend
class AppEngineUserAPIBackend(BaseAppEngineUserAPIBackend):
pass
|
dpnishant/appmon | refs/heads/master | appmon.py | 1 | #!/usr/bin/python
###
# Copyright (c) 2016 Nishant Das Patnaik.
#
# 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 b... |
enriquepablo/nl | refs/heads/master | nl/examples/modality.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2007-2012 by Enrique Pérez Arnaud <enriquepablo@gmail.com>
#
# This file is part of nlproject.
#
# The nlproject 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 v... |
fe11x/dpark | refs/heads/master | dpark/moosefs/master.py | 14 | import os
import socket
import threading
import Queue
import time
import struct
import logging
from consts import *
from utils import *
logger = logging.getLogger(__name__)
# mfsmaster need to been patched with dcache
ENABLE_DCACHE = False
class StatInfo:
def __init__(self, totalspace, availspace, trashspace,
... |
uwcirg/true_nth_usa_portal | refs/heads/develop | portal/models/role.py | 1 | """Role module
Role data lives in the `roles` table, populated via:
`flask seed`
To restrict access to a given role, use the ROLE object:
@roles_required(ROLE.ADMIN.value)
To extend the list of roles, add name: description pairs to the
STATIC_ROLES dict within.
"""
from enum import Enum
from ..database imp... |
qedsoftware/commcare-hq | refs/heads/master | corehq/apps/callcenter/tests/test_owner_options_view.py | 1 | import json
import math
from django.test import TestCase
from elasticsearch import ConnectionError
from corehq.apps.callcenter.views import CallCenterOwnerOptionsView
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.groups.models import Group
from corehq.apps.locations.models import LocationTyp... |
mikepea/fullerite | refs/heads/master | src/diamond/collectors/dseopscenter/dseopscenter.py | 29 | # coding=utf-8
"""
Collect the DataStax OpsCenter metrics
#### Dependencies
* urlib2
"""
import urllib2
import datetime
try:
import json
except ImportError:
import simplejson as json
import diamond.collector
class DseOpsCenterCollector(diamond.collector.Collector):
last_run_time = 0
column_fam... |
marcosdiez/ansible-modules-extras | refs/heads/devel | notification/flowdock.py | 91 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Coddington <coddington@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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.