repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
igel-kun/pyload | module/plugins/accounts/PremiumizeMe.py | 1 | 2307 | # -*- coding: utf-8 -*-
from ..internal.misc import json
from ..internal.MultiAccount import MultiAccount
class PremiumizeMe(MultiAccount):
__name__ = "PremiumizeMe"
__type__ = "account"
__version__ = "0.32"
__status__ = "testing"
__config__ = [("mh_mode", "all;listed;unlisted", "Filter hosters ... | gpl-3.0 |
kim135797531/opencog | opencog/python/dingjie/atomspace_abserver.py | 36 | 4904 | from viz_graph import Graph_Abserver
from opencog.atomspace import types, AtomSpace
import networkx as ax
from types_inheritance import types_graph, name_to_type, is_a
#from pprint import pprint
from collections import defaultdict
from m_util import log, Logger
from m_adaptors import FakeAtom
log.add_level(Logger.INFO)... | agpl-3.0 |
goliate/sarakha63-persomov | libs/caper/parsers/usenet.py | 81 | 3844 | # Copyright 2013 Dean Gardiner <gardiner91@gmail.com>
#
# 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 a... | gpl-3.0 |
tensorflow/tensorboard | tensorboard/backend/event_processing/tag_types.py | 1 | 1107 | # Copyright 2020 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... | apache-2.0 |
KMK-ONLINE/ansible | lib/ansible/inventory/expand_hosts.py | 202 | 4357 | # (c) 2012, Zettar Inc.
# Written by Chin Fang <fangchin@zettar.com>
#
# This file is part of Ansible
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at y... | gpl-3.0 |
jwlawson/tensorflow | tensorflow/python/profiler/internal/print_model_analysis_test.py | 72 | 2048 | # 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... | apache-2.0 |
keyurpatel076/MissionPlannerGit | Lib/bisect.py | 1261 | 2595 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | gpl-3.0 |
Nolski/olympia | apps/addons/decorators.py | 14 | 2143 | import functools
from django import http
from django.shortcuts import get_object_or_404
import commonware.log
from access import acl
from addons.models import Addon
log = commonware.log.getLogger('mkt.purchase')
def owner_or_unlisted_reviewer(request, addon):
return (acl.check_unlisted_addons_reviewer(request)... | bsd-3-clause |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/yaml/resolver.py | 76 | 9122 |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... | gpl-2.0 |
deepaklukose/grpc | src/python/grpcio/grpc/framework/interfaces/face/utilities.py | 47 | 6711 | # Copyright 2015 gRPC authors.
#
# 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... | apache-2.0 |
hstau/covar-cryo | covariance/prepare_data.py | 1 | 4278 | import numpy as np
import multiprocessing
import prepare_data_single
from functools import partial
from contextlib import contextmanager
from subprocess import Popen
import myio
import set_params
import os
import p
'''Copyright (c) Columbia University Hstau Liao 2019
'''
import time
@contextmanager
def poolconte... | gpl-2.0 |
fighterCui/L4ReFiascoOC | l4/pkg/python/contrib/Demo/tkinter/matt/canvas-w-widget-draw-el.py | 47 | 1178 | from Tkinter import *
# this file demonstrates the creation of widgets as part of a canvas object
class Test(Frame):
def printhi(self):
print "hi"
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
command=self.quit)
self.QUIT.p... | gpl-2.0 |
SiftScience/phoenix | bin/queryserver.py | 18 | 7461 | #!/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 A... | apache-2.0 |
aidanlister/django | django/test/client.py | 132 | 26745 | from __future__ import unicode_literals
import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import ... | bsd-3-clause |
oktayacikalin/pyglet | contrib/wydget/wydget/event.py | 29 | 26158 | '''Implement event handling for wydget GUIs.
The `GUIEventDispatcher` class is automatically mixed into the `wydget.GUI`
class and is activated by pushing the gui onto a window's event handlers
stack::
gui = GUI(window)
window.push_handlers(gui)
Events
------
Standard pyglet events are passed through if ha... | bsd-3-clause |
talon-one/talon_one.py | test/test_new_campaign_group.py | 1 | 2176 | # coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | mit |
Eric89GXL/vispy | examples/demo/scene/klein.py | 2 | 1477 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
"... | bsd-3-clause |
felixjimenez/django | tests/model_formsets_regress/models.py | 40 | 1137 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
class UserSite(models.Model):
user = models.ForeignKey(User, to_field="username")
data = models.I... | bsd-3-clause |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information.py | 1 | 2744 | # 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 ... | mit |
vicky2135/lucious | src/oscar/core/compat.py | 3 | 6146 | import csv
import sys
import django
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from oscar.core.loading import get_model
# A setting that can be used in foreign key declarations
AUTH_USER_MODEL = get... | bsd-3-clause |
pannal/Subliminal.bundle | Contents/Libraries/Shared/guessit/rules/properties/container.py | 11 | 2338 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
container property
"""
from rebulk.remodule import re
from rebulk import Rebulk
from ..common import seps
from ..common.validators import seps_surround
from ...reutils import build_or_pattern
def container():
"""
Builder for rebulk object.
:return: Creat... | mit |
jmehnle/ansible | lib/ansible/plugins/connection/ssh.py | 18 | 40724 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
# Copyright 2017 Toshio Kuratomi <tkuratomi@ansible.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 Lice... | gpl-3.0 |
chippey/gaffer | python/GafferSceneTest/ScenePathTest.py | 2 | 6721 | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
bdoner/SickRage | tornado/testing.py | 66 | 26666 | #!/usr/bin/env python
"""Support classes for automated testing.
* `AsyncTestCase` and `AsyncHTTPTestCase`: Subclasses of unittest.TestCase
with additional support for testing asynchronous (`.IOLoop` based) code.
* `ExpectLog` and `LogTrapTestCase`: Make test logs less spammy.
* `main()`: A simple test runner (wra... | gpl-3.0 |
opencloudinfra/orchestrator | venv/Lib/site-packages/django/conf/locale/fr/formats.py | 504 | 1454 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... | gpl-3.0 |
strk/QGIS | tests/src/python/test_qgslayoutnortharrowhandler.py | 31 | 5552 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutNorthArrowHandler.
.. note:: 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 ver... | gpl-2.0 |
blakev/tappy | tap/tests/test_loader.py | 1 | 3477 | # Copyright (c) 2015, Matt Layman
import inspect
import os
import tempfile
from tap.i18n import _
from tap.loader import Loader
from tap.tests import TestCase
class TestLoader(TestCase):
"""Tests for tap.loader.Loader"""
def test_handles_file(self):
"""The loader handles a file."""
sample =... | bsd-2-clause |
StongeEtienne/dipy | doc/examples/snr_in_cc.py | 11 | 6528 | """
=============================================
SNR estimation for Diffusion-Weighted Images
=============================================
Computing the Signal-to-Noise-Ratio (SNR) of DW images is still an open question,
as SNR depends on the white matter structure of interest as well as
the gradient direction corr... | bsd-3-clause |
bhupennewalkar1337/erpnext | erpnext/tests/sel_tests.py | 81 | 2550 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
"""
Run Selenium Tests
Requires a clean install. After reinstalling fresh db, call
frappe --execute erpnext.tests.sel_tests.start
"""
from __future__ import unicode_literals
import frappe... | gpl-3.0 |
rfkrocktk/python-algorithms | src/algorithms/__init__.py | 1 | 5427 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from math import floor, ceil
def swap(collection, index1, index2):
"""
Swaps the value of the item at index1 in the collection with the value of
index2 in the collection.
"""
n = len(collection)
# if we're reaching outside of bounds, throw an ... | mit |
louyihua/edx-platform | common/djangoapps/util/memcache.py | 251 | 1344 | """
This module provides a KEY_FUNCTION suitable for use with a memcache backend
so that we can cache any keys, not just ones that memcache would ordinarily accept
"""
from django.utils.encoding import smart_str
import hashlib
import urllib
def fasthash(string):
"""
Hashes `string` into a string representatio... | agpl-3.0 |
avlach/univbris-ocf | expedient/src/python/plugins/vt_plugin/models/VM.py | 1 | 7047 | from django.db import models
#from django.db.models.fields import IPAddressField
from expedient.clearinghouse.resources.models import Resource
from vt_plugin.models import *
from vt_plugin.utils.validators import *
DISC_IMAGE_CHOICES = (
('default','Default'),
('spirent'... | bsd-3-clause |
40223247/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/_threading_local.py | 923 | 7410 | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-local d... | gpl-3.0 |
yuguang/django-cloud-ide | build/lib/cloud_ide/fiddle/compression.py | 2 | 1762 | from django.db import models
from django.utils.text import compress_string
from django.db.models.signals import post_init
def uncompress_string(s):
'''helper function to reverse django.utils.text.compress_string'''
import cStringIO, gzip
try:
zbuf = cStringIO.StringIO(s)
zfile = gzip.GzipFi... | gpl-3.0 |
CheeseLord/warts | src/shared/message_infrastructure.py | 1 | 14999 | from collections import namedtuple
import sys
import traceback
from src.shared.logconfig import newLogger
log = newLogger(__name__)
# Normal delimiter; separates tokens in messages.
TOKEN_DELIM = " "
# Used to indicate the start of an unsafe string; must be the first character
# after TOKEN_DELIM.
START_STRING = ... | mit |
jcoady9/python-for-android | python3-alpha/python3-src/Lib/encodings/cp869.py | 272 | 32965 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.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_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
thepiper/standoff | vpy/lib/python2.7/site-packages/setuptools/command/build_ext.py | 314 | 11964 | from distutils.command.build_ext import build_ext as _du_build_ext
from distutils.file_util import copy_file
from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler
from distutils.errors import DistutilsError
from distutils import log
import os
import sys
import itertools
from s... | gpl-3.0 |
luckielordie/conan | conans/test/functional/in_local_cache_test.py | 3 | 2296 | import os
import unittest
from conans.test.utils.tools import TestClient
from conans.paths import CONANFILE
conanfile = """
from conans import ConanFile, tools
class AConan(ConanFile):
name = "Hello0"
version = "0.1"
def build(self):
self.output.warn("build() IN LOCAL CACHE=> %s" % str(self.in_l... | mit |
kylewray/librbr | makemake.py | 1 | 4719 | """ The MIT License (MIT)
Copyright (c) 2014 Kyle Hollins Wray, University of Massachusetts
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 ... | mit |
OpusVL/odoo-sale-extras | sale_printout_split_sku/__openerp__.py | 1 | 1640 | # -*- coding: utf-8 -*-
##############################################################################
#
# Split SKU from Description on Sale Order printout
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero... | agpl-3.0 |
carlvlewis/bokeh | bokeh/tests/test_query.py | 45 | 6836 | from __future__ import absolute_import
import unittest
import bokeh.query as query
from bokeh.models import (
Axis, BoxZoomTool, ColumnDataSource, DatetimeAxis, GlyphRenderer, Grid, LinearAxis,
LogAxis, PanTool, Plot, PreviewSaveTool, Range1d, ResetTool, ResizeTool, Tool, WheelZoomTool,
)
from bokeh.models.g... | bsd-3-clause |
cdepillabout/semiautocards | semiauto/preferences.py | 1 | 5428 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Dennis Gosnell
#
# 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... | gpl-3.0 |
Jonekee/chromium.src | tools/usb_gadget/hid_descriptors_test.py | 95 | 1882 | #!/usr/bin/python
# Copyright 2014 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 unittest
import hid_descriptors
import keyboard_gadget
import mouse_gadget
class HidTest(unittest.TestCase):
def test_keyboard... | bsd-3-clause |
larsoner/mne-python | mne/utils/__init__.py | 4 | 4476 | # # # WARNING # # #
# This list must also be updated in doc/_templates/autosummary/class.rst if it
# is changed here!
_doc_special_members = ('__contains__', '__getitem__', '__iter__', '__len__',
'__add__', '__sub__', '__mul__', '__div__',
'__neg__', '__hash__')
from ._b... | bsd-3-clause |
alqfahad/odoo | addons/l10n_be_coda/wizard/__init__.py | 439 | 1098 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
v-iam/azure-sdk-for-python | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py | 2 | 1443 | # 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 ... | mit |
BT-astauder/odoo | addons/account/wizard/account_reconcile_partner_process.py | 385 | 5775 | # -*- 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... | agpl-3.0 |
colour-science/colour | colour/models/igpgtg.py | 1 | 5402 | # -*- coding: utf-8 -*-
"""
:math:`I_GP_GT_G` Colourspace
=============================
Defines the :math:`I_GP_GT_G` colourspace transformations:
- :func:`colour.XYZ_to_IgPgTg`
- :func:`colour.IgPgTg_to_XYZ`
References
----------
- :cite:`Hellwig2020` : Hellwig, L., & Fairchild, M. D. (2020). Using
Gaussi... | bsd-3-clause |
ECP-CANDLE/Supervisor | workflows/xcorr/db-init.py | 1 | 2261 |
# DB INIT PY
# Initialize the SQLite DB
# See db-init.sql for the table schema
import sys
from xcorr_db import xcorr_db, q
from pathlib import Path
THIS = Path(sys.argv[0]).parent.resolve()
DB = xcorr_db('xcorr.db')
DB.connect()
def create_tables():
""" Set up the tables defined in the SQL file """
global ... | mit |
40223103/w16b_test | static/Brython3.1.3-20150514-095342/Lib/importlib/abc.py | 743 | 14595 | """Abstract base classes related to import."""
from . import _bootstrap
from . import machinery
try:
import _frozen_importlib
except ImportError as exc:
if exc.name != '_frozen_importlib':
raise
_frozen_importlib = None
import abc
import imp
import marshal
import sys
import tokenize
import warnings
... | agpl-3.0 |
xaviercobain88/framework-python | build/lib.linux-i686-2.7/openerp/addons/hr_attendance/wizard/hr_attendance_byweek.py | 53 | 2143 | # -*- 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... | agpl-3.0 |
mexeniz/django-oscar | src/oscar/apps/dashboard/offers/forms.py | 27 | 5818 | import datetime
from django.utils import six
from django import forms
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_model
from oscar.forms import widgets
ConditionalOffer = get_model('offer', 'ConditionalOffer')
Condition = get_model('offer', 'Condition')
Benefit = get_mo... | bsd-3-clause |
leiferikb/bitpop | src/third_party/WebKit/Tools/Scripts/webkitpy/style/main.py | 177 | 6998 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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 copyright
# notice, this list of conditions and... | gpl-3.0 |
MissCatLady/AlarmEZ | ENV/lib/python2.7/site-packages/pip/index.py | 73 | 42347 | """Routines related to PyPI, indexes"""
import sys
import os
import re
import gzip
import mimetypes
import posixpath
import pkg_resources
import random
import socket
import ssl
import string
import zlib
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.log import logger
f... | mit |
kangkot/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32com/test/testvbscript_regexp.py | 40 | 1108 | import unittest
from win32com.client.gencache import EnsureDispatch
from win32com.client.dynamic import DumbDispatch
import win32com.test.util
class RegexTest(win32com.test.util.TestCase):
def _CheckMatches(self, match, expected):
found = []
for imatch in match:
found.append(imatch.Firs... | apache-2.0 |
ramjothikumar/Diamond | src/collectors/memory_docker/memory_docker.py | 31 | 1168 | # coding=utf-8
"""
The MemoryDockerCollector collects memory statistics from docker containers
#### Dependencies
* docker
"""
import os
import sys
try:
import docker
except ImportError:
docker = None
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)),
'm... | mit |
iKevinY/pelican | pelican/tests/test_urlwrappers.py | 1 | 3317 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pelican.tests.support import unittest
from pelican.urlwrappers import Author, Category, Tag, URLWrapper
class TestURLWrapper(unittest.TestCase):
def test_ordering(self):
# URLWrappers are sorted by name
wrapper_a = URLWrapper(na... | agpl-3.0 |
hohene/RackHD | test/stream-monitor/test/test_infra_logging.py | 13 | 1885 | """
Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved.
This file contains (very very crude, at the moment!) self
tests of the logging infrastructure.
"""
from flogging.infra_logging import logger_get_logging_dir
import os
from unittest import TestCase
class TestInfraLogging(TestCase):
de... | apache-2.0 |
JazzeYoung/VeryDeepAutoEncoder | pylearn2/pylearn2/format/tests/test_target_format.py | 33 | 5476 | import numpy
import theano
from numpy.testing import assert_equal, assert_, assert_raises
from theano.scalar.basic import all_types
from pylearn2.format.target_format import OneHotFormatter, compressed_one_hot
def test_one_hot_formatter_simple():
def check_one_hot_formatter(seed, max_labels, dtype, ncases):
... | bsd-3-clause |
sdmathis/LitecoinNEW | contrib/bitrpc/bitrpc.py | 224 | 7838 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | mit |
squilter/mavlink | pymavlink/tools/mavsearch.py | 45 | 1164 | #!/usr/bin/env python
'''
search a set of log files for a condition
'''
import sys, time, os
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--condition", default=None, help="conditional check on log")
parser.add_argument("--types",... | lgpl-3.0 |
KL-WLCR/incubator-airflow | airflow/ti_deps/deps/prev_dagrun_dep.py | 38 | 3341 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
motion2015/edx-platform | openedx/core/djangoapps/credit/tests/test_tasks.py | 10 | 10732 | """
Tests for credit course tasks.
"""
import mock
from datetime import datetime, timedelta
from pytz import UTC
from openedx.core.djangoapps.credit.api import get_credit_requirements
from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements
from openedx.core.djangoapps.credit.models import Cred... | agpl-3.0 |
jiangzhonghui/viewfinder | backend/db/asset_id.py | 13 | 8323 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Viewfinder asset id prefixes and helpers.
"""
__author__ = 'andy@emailscrubbed.com (Andy Kimball)'
import struct
from collections import namedtuple
from tornado import gen
from viewfinder.backend.base import base64hex, util
from viewfinder.backend.base.except... | apache-2.0 |
Foxfanmedium/python_training | OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/pygments/lexers/__init__.py | 27 | 10906 | # -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping ... | apache-2.0 |
foreni-packages/golismero | thirdparty_libs/geopy/format.py | 84 | 2758 | from geopy import units
# Unicode characters for symbols that appear in coordinate strings.
DEGREE = unichr(176)
PRIME = unichr(8242)
DOUBLE_PRIME = unichr(8243)
ASCII_DEGREE = ''
ASCII_PRIME = "'"
ASCII_DOUBLE_PRIME = '"'
LATIN1_DEGREE = chr(176)
HTML_DEGREE = '°'
HTML_PRIME = '′'
HTML_DOUBLE_PRIME = '&Prim... | gpl-2.0 |
bdestombe/flopymetascript | tests/reference_model_runs/pick_reference_model_run.py | 1 | 1255 | import os
from pick_model_runs_fun import fun_test_reference_run, get_exe_path
this_fp = os.path.dirname(os.path.abspath(__file__))
# test_example_dir = os.path.abspath(os.path.join(this_fp, 'SEAWAT', '1_box', 'case1'))
test_example_dir = os.path.abspath(os.path.join(this_fp, 'SEAWAT', '5_saltlake'))
# test_example_d... | mit |
daniloefl/Unfolder | toyModel/closureTest.py | 1 | 1560 | #!/usr/bin/env python3
import itertools
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
import pymc3 as pm
import matplotlib.cm as cm
import scipy
from Unfolder.ComparisonHelpers import *
from Unfolder.Unfolder import Unfolder
from Unfolder.Histogram import H1D, H2D, plot... | gpl-3.0 |
maxive/erp | addons/purchase/models/stock.py | 1 | 9814 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class StockPicking(models.Model):
_inherit = 'stock.picking'
purchase_id = fields.Many2one('purchase.order', related='move_lines.pu... | agpl-3.0 |
pabulumm/neighbors | lib/python3.4/site-packages/django/conf/locale/it/formats.py | 504 | 2079 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FO... | bsd-3-clause |
trhoden/ceph-deploy | ceph_deploy/rgw.py | 3 | 6451 | import errno
import logging
import os
from ceph_deploy import conf
from ceph_deploy import exc
from ceph_deploy import hosts
from ceph_deploy.util import system
from ceph_deploy.lib import remoto
from ceph_deploy.cliutil import priority
LOG = logging.getLogger(__name__)
def get_bootstrap_rgw_key(cluster):
"""
... | mit |
ack8006/Python-mode-klen | pymode/libs/pylama/lint/pylama_pylint/logilab/common/ureports/html_writer.py | 42 | 4887 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | lgpl-3.0 |
wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/polys/tests/test_sqfreetools.py | 123 | 4389 | """Tests for square-free decomposition algorithms and related tools. """
from sympy.polys.rings import ring
from sympy.polys.domains import FF, ZZ, QQ
from sympy.polys.specialpolys import f_polys
from sympy.utilities.pytest import raises
f_0, f_1, f_2, f_3, f_4, f_5, f_6 = f_polys()
def test_dup_sqf():
R, x = r... | mit |
basherone/libgdxcn | extensions/gdx-freetype/jni/freetype-2.4.10/builds/mac/ascii2mpw.py | 830 | 1033 | #!/usr/bin/env python
import sys
import string
if len( sys.argv ) == 1 :
for asc_line in sys.stdin.readlines():
mpw_line = string.replace(asc_line, "\\xA5", "\245")
mpw_line = string.replace(mpw_line, "\\xB6", "\266")
mpw_line = string.replace(mpw_line, "\\xC4", "\304")
mpw_line = string.replace(mpw_... | apache-2.0 |
kiwifb/numpy | numpy/lib/tests/test_recfunctions.py | 89 | 30630 | from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.ma as ma
from numpy.ma.mrecords import MaskedRecords
from numpy.ma.testutils import assert_equal
from numpy.testing import TestCase, run_module_suite, assert_
from numpy.lib.recfunctions import (
drop_fields, rename_fi... | bsd-3-clause |
ufoai/ufoai | src/po/compile_po.py | 5 | 1833 | #! /usr/bin/env python
# Compile src/po/*.po to base/i18n using command-line supplied "msgmerge" path
# This is primarily for windows users. "msgmerge" is usually in the same place
# as poedit
#
# by techtonik // rainforce.org
import os, glob, sys, stat, platform
#read the given path
if len(sys.argv) < 2:
msgfmt... | gpl-2.0 |
akashsinghal/Speech-Memorization-App | Python_Backend/lib/werkzeug/_compat.py | 342 | 6311 | # flake8: noqa
# This whole file is full of lint errors
import codecs
import sys
import operator
import functools
import warnings
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
WIN = sys.platform.startswith('win')
_identity = lambda x: x
if PY2:
u... | apache-2.0 |
MakeHer/edx-platform | cms/djangoapps/contentstore/git_export_utils.py | 187 | 7401 | """
Utilities for export a course's XML into a git repository,
committing and pushing the changes.
"""
import logging
import os
import subprocess
from urlparse import urlparse
from django.conf import settings
from django.contrib.auth.models import User
from django.utils import timezone
from django.utils.translation i... | agpl-3.0 |
Yong-Lee/django | tests/deprecation/tests.py | 199 | 7253 | from __future__ import unicode_literals
import os
import unittest
import warnings
from django.test import SimpleTestCase
from django.test.utils import reset_warning_registry
from django.utils import six
from django.utils.deprecation import RenameMethodsBase
from django.utils.encoding import force_text
class RenameM... | bsd-3-clause |
theflofly/tensorflow | tensorflow/python/data/util/options_test.py | 28 | 3751 | # Copyright 2018 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... | apache-2.0 |
fnp/librarian | src/librarian/dcparser.py | 1 | 18915 | # -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from __future__ import unicode_literals
from xml.parsers.expat import ExpatError
from datetime import date
from functools import total_order... | agpl-3.0 |
capturePointer/or-tools | examples/python/kenken2.py | 34 | 4935 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | apache-2.0 |
SpamScope/spamscope | src/modules/networks/post_processing.py | 1 | 3714 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2017 Fedele Mantuano (https://www.linkedin.com/in/fmantuano/)
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/... | apache-2.0 |
linino/kernel_3.3.8 | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
david-caro/jenkins-job-builder | tests/general/test_general.py | 5 | 1118 | # Joint copyright:
# - Copyright 2012,2013 Wikimedia Foundation
# - Copyright 2012,2013 Antoine "hashar" Musso
# - Copyright 2013 Arnaud Fabre
#
# 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 ... | apache-2.0 |
NetApp/cinder | cinder/volume/drivers/vmware/vmdk.py | 1 | 95227 | # Copyright (c) 2013 VMware, 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... | apache-2.0 |
SavinaRoja/OpenAccess_EPUB | src/openaccess_epub/commands/collection.py | 1 | 7618 | # -*- coding: utf-8 -*-
"""
oaepub collection
Convert and compile a collection of article XML files into a single EPUB
Usage:
collection [--silent | --verbosity=LEVEL] [--epub2 | --epub3] [options]
COLLECTION_FILE
General Options:
-h --help Show this help message and exit
-v --version... | gpl-3.0 |
jlegendary/Dato-Core | src/unity/python/graphlab/connect/server.py | 13 | 10869 | """
This module contains the interface for graphlab server, and the
implementation of a local graphlab server.
"""
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the DATO-PYTHON-LICENSE file for details.
'''
from graphlab.c... | agpl-3.0 |
zouzhberk/ambaridemo | demo-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/package/scripts/yaml_config.py | 4 | 1941 | #!/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
"License");... | apache-2.0 |
bmoar/ansible | lib/ansible/template/vars.py | 71 | 3480 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
tempbottle/rethinkdb | test/rql_test/connections/http.py | 21 | 12474 | #!/usr/bin/env python
'''Tests the http term'''
import datetime, os, re, subprocess, sys, tempfile, time, unittest
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'common'))
import driver, utils
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import http_suppo... | agpl-3.0 |
maestrano/openerp | openerp/addons/sale/report/__init__.py | 59 | 1083 | # -*- 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... | agpl-3.0 |
michellemorales/OpenMM | models/differential_privacy/multiple_teachers/analysis.py | 10 | 10944 | # 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... | gpl-2.0 |
gpoesia/servo | tests/wpt/css-tests/tools/pytest/_pytest/main.py | 171 | 26357 | """ core implementation of testing process: init, session, runtest loop. """
import imp
import os
import re
import sys
import _pytest
import _pytest._code
import py
import pytest
try:
from collections import MutableMapping as MappingMixin
except ImportError:
from UserDict import DictMixin as MappingMixin
from... | mpl-2.0 |
Ledoux/ShareYourSystem | Pythonlogy/draft/_Matrixer/draft/__init__ copy.py | 3 | 3275 | # -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Predicter
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Specials.Controllers.Systemer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Class... | mit |
kumar003vinod/SpeedDreams | src/tools/blender/acc3d_export.py | 9 | 27940 | #!BPY
""" Registration info for Blender menus:
Name: 'Speed Dreams / Torcs (.acc) ...'
Blender: 248
Group: 'Export'
Tip: 'Export selected meshes to Speed Dreams / Torcs (.acc) format'
"""
__author__ = "Brian Gavin taken from Willian P. Germano .ac export script"
__url__ = ("blender", "blenderartists.org", "AC3D's hom... | gpl-2.0 |
wakermahmud/sync-engine | inbox/contacts/remote_sync.py | 1 | 4537 | from datetime import datetime
from collections import Counter
from sqlalchemy.orm.exc import NoResultFound
from inbox.log import get_logger
logger = get_logger()
from inbox.models import Contact, Account
from inbox.sync.base_sync import BaseSyncMonitor
from inbox.contacts.google import GoogleContactsProvider
from inb... | agpl-3.0 |
saper/node-gyp | gyp/pylib/gyp/generator/xcode.py | 1363 | 58344 | # 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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | mit |
ritchyteam/odoo | addons/mrp_repair/wizard/make_invoice.py | 172 | 3150 | # -*- 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... | agpl-3.0 |
dataculture/mca | tests/test_mca.py | 2 | 9155 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_mca
----------------------------------
Tests for `mca` module.
"""
import unittest
from numpy.testing import assert_allclose
from numpy import array
import pandas
from mca import MCA
class TestMca(unittest.TestCase):
def test_abdi_valentin(self):
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.