repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
ma1co/Sony-PMCA-RE | pmca/spk/__init__.py | 1 | 2713 | """Methods for reading and writing spk files"""
import sys
try:
from Cryptodome.Cipher import AES
from Cryptodome.PublicKey import RSA
from Cryptodome.Util.number import bytes_to_long, long_to_bytes
except ImportError:
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Util.number import... | mit |
chinmaygarde/depot_tools | third_party/boto/services/service.py | 70 | 6641 | # Copyright (c) 2006,2007 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... | bsd-3-clause |
markdryan/dleyna-renderer | test/dbus/cap.py | 4 | 8713 | #!/usr/bin/python
# cap
#
# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is ... | lgpl-2.1 |
chauhanhardik/populo | common/lib/xmodule/xmodule/modulestore/tests/test_libraries.py | 157 | 7393 | # -*- coding: utf-8 -*-
"""
Basic unit tests related to content libraries.
Higher-level tests are in `cms/djangoapps/contentstore`.
"""
import ddt
from bson.objectid import ObjectId
from opaque_keys.edx.locator import LibraryLocator
from xmodule.modulestore.exceptions import DuplicateCourseError
from xmodule.module... | agpl-3.0 |
huggingface/transformers | examples/tensorflow/benchmarking/run_benchmark_tf.py | 2 | 1915 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
# Copyright (c) 2020, NVIDIA 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 a... | apache-2.0 |
vineodd/PIMSim | GEM5Simulation/gem5/ext/pybind11/tests/test_methods_and_attributes.py | 13 | 17017 | import pytest
from pybind11_tests import methods_and_attributes as m
from pybind11_tests import ConstructorStats
def test_methods_and_attributes():
instance1 = m.ExampleMandA()
instance2 = m.ExampleMandA(32)
instance1.add1(instance2)
instance1.add2(instance2)
instance1.add3(instance2)
instanc... | gpl-3.0 |
junhuac/MQUIC | depot_tools/ENV/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py | 375 | 5760 | from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value for
:func:`parse_url`.
"""
s... | mit |
TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/timeline/timeline.py | 1 | 16578 | #! /usr/bin/env python
import wx, wx.lib
TimeLineSelectionEvent, EVT_TIMELINE_SELECTED = wx.lib.newevent.NewEvent()
TimeLineActivationEvent, EVT_TIMELINE_ACTIVATED = wx.lib.newevent.NewEvent()
class HotMap(object):
''' Keep track of which node is where. '''
def __init__(self, parent=None):
self... | gpl-3.0 |
dbmi-pitt/DIKB-Micropublication | scripts/mp-scripts/Bio/EUtils/setup.py | 1 | 1941 |
import sys
from distutils.core import setup
try:
import EUtils
except ImportError:
import __init__ as EUtils
def _dict(**kwargs):
return kwargs
d = _dict(
name = "EUtils",
version = EUtils.__version__,
description = "Client interface to NCBI's EUtils/Entrez server",
author = "Andrew Dalk... | apache-2.0 |
igabriel85/dmon-adp | adpformater/adpformater.py | 1 | 1615 | import pandas as pd
class DataFormatter():
def __init__(self, dataloc):
self.dataloc = dataloc
def aggJsonToCsv(self):
return "CSV file"
def expTimestamp(self):
return "Expand metric timestamp"
def window(self):
return "Window metrics"
def pivot(self):
r... | apache-2.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/boto/dynamodb2/items.py | 32 | 14656 | from copy import deepcopy
class NEWVALUE(object):
# A marker for new data added.
pass
class Item(object):
"""
An object representing the item data within a DynamoDB table.
An item is largely schema-free, meaning it can contain any data. The only
limitation is that it must have data for the ... | mit |
IllusionRom-deprecated/android_platform_tools_idea | python/lib/Lib/site-packages/django/contrib/localflavor/nl/forms.py | 311 | 2796 | """
NL-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
pc_re = re.compile('^\d{4}[A-Z]{2}$... | apache-2.0 |
rezasafi/spark | examples/src/main/python/ml/dct_example.py | 123 | 1509 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
tdyas/pants | src/python/pants/backend/jvm/register.py | 1 | 12485 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Support for both Java and Scala."""
from pants.backend.jvm.artifact import Artifact
from pants.backend.jvm.ossrh_publication_metadata import (
Developer,
License,
OSSRHPubl... | apache-2.0 |
morenopc/edx-platform | common/test/acceptance/pages/studio/unit.py | 13 | 3855 | """
Unit page in Studio
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise
from . import BASE_URL
from .container import ContainerPage
class UnitPage(PageObject):
"""
Unit page in Studio
"""
def __init__(self, browser, unit_locator):
super(Uni... | agpl-3.0 |
timokoola/timoechobot | docutils/parsers/rst/languages/zh_cn.py | 128 | 4007 | # -*- coding: utf-8 -*-
# $Id: zh_cn.py 7119 2011-09-02 13:00:23Z milde $
# Author: Panjunyong <panjy@zopechina.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two fil... | apache-2.0 |
simbtrix/screenmix | screenmix/reinforcement/shapeSelection.py | 1 | 5607 | '''
Created on 13.05.2016
@author: mkennert
'''
from kivy.properties import ObjectProperty, StringProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.scrollview import ScrollView
from ownComponents.design import Design
from ownComponents.ownButton import OwnButton
from ownComponents.ownGraph ... | gpl-3.0 |
lanfker/tdma_imac | .waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Tools/glib2.py | 3 | 8308 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Task,Utils,Options,Errors,Logs
from waflib.TaskGen import taskgen_method,before_method,after_method,feature
def add_marshal_file(self,filename,pre... | gpl-2.0 |
suryakencana/niimanga | niimanga/ctasks/batoto.py | 1 | 34700 | """
# Copyright (c) 06 2015 | surya
# 26/06/15 nanang.ask@kubuskotak.com
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ve... | lgpl-3.0 |
idlead/scikit-learn | examples/linear_model/plot_sgd_comparison.py | 112 | 1819 | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Author: Rob Zinkov <rob at zinkov dot com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot a... | bsd-3-clause |
jianran/spark | examples/src/main/python/ml/vector_assembler_example.py | 123 | 1649 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
lindsayad/sympy | sympy/matrices/tests/test_densearith.py | 80 | 1844 | from sympy.matrices.densetools import eye
from sympy.matrices.densearith import add, sub, mulmatmat, mulmatscaler
from sympy import ZZ
def test_add():
a = [[ZZ(3), ZZ(7), ZZ(4)], [ZZ(2), ZZ(4), ZZ(5)], [ZZ(6), ZZ(2), ZZ(3)]]
b = [[ZZ(5), ZZ(4), ZZ(9)], [ZZ(3), ZZ(7), ZZ(1)], [ZZ(12), ZZ(13), ZZ(14)]]
c = ... | bsd-3-clause |
hs634/algorithms | python/company/dropbox.py | 1 | 1392 | __author__ = 'hs634'
class Crawler(Thread):
def __init__(self, q, seen, index, lock, wlock, worker_pool_size):
self.queue = q
self.seen = seen
self.index = index
self.worker_pool_size = worker_pool_size
self.qandslock = lock
self.worker_lock = wlock
def crawl(se... | mit |
anandpdoshi/erpnext | erpnext/config/projects.py | 2 | 1504 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Projects"),
"icon": "icon-star",
"items": [
{
"type": "doctype",
"name": "Project",
"description": _("Project master."),
},
{
"type": "doctype",
"name": "Task",
"des... | agpl-3.0 |
junbochen/pylearn2 | pylearn2/scripts/papers/jia_huang_wkshp_11/evaluate.py | 44 | 3208 | from __future__ import print_function
from optparse import OptionParser
import warnings
try:
from sklearn.metrics import classification_report
except ImportError:
classification_report = None
warnings.warn("couldn't find sklearn.metrics.classification_report")
try:
from sklearn.metrics import confusion... | bsd-3-clause |
laurentgo/pants | tests/python/pants_test/net/http/test_fetcher.py | 14 | 6703 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | apache-2.0 |
vefimova/rally | rally/plugins/openstack/context/quotas/nova_quotas.py | 15 | 2762 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
CenterForOpenScience/modular-file-renderer | mfr/extensions/tabular/libs/xlrd_tools.py | 2 | 1632 | import xlrd
from collections import OrderedDict
from ..exceptions import TableTooBigError
from ..utilities import header_population
from mfr.extensions.tabular.compat import range, basestring
def xlsx_xlrd(fp):
"""Read and convert a xlsx file to JSON format using the xlrd library
:param fp: File pointer obje... | apache-2.0 |
sambyers/o365_fmc | .venv/lib/python3.6/site-packages/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-3.0 |
BehavioralInsightsTeam/edx-platform | common/lib/xmodule/xmodule/tests/test_editing_module.py | 13 | 2787 | """ Tests for editing descriptors"""
import unittest
import os
import logging
from mock import Mock
from pkg_resources import resource_string
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from xmodule.editing_module import TabsEditingDescriptor
from xblock.field_data import DictFieldData
from xb... | agpl-3.0 |
Lautitia/newfies-dialer | newfies/newfies_dialer/settings.py | 3 | 17942 | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... | mpl-2.0 |
miptliot/edx-platform | common/djangoapps/third_party_auth/migrations/0001_initial.py | 11 | 13948 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
import provider.utils
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | agpl-3.0 |
drm00/beets | beets/importer.py | 14 | 53270 | # This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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, ... | mit |
alexbruy/QGIS | python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py | 1 | 12223 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RectanglesOvalsDiamondsVariable.py
---------------------
Date : April 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot... | gpl-2.0 |
antonve/s4-project-mooc | lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py | 120 | 8430 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Optout.course_id'
db.alter_column('bulk_email_optout', 'course_id', self.gf('xmodule_djan... | agpl-3.0 |
drtuxwang/system-config | bin/fls.py | 1 | 5121 | #!/usr/bin/env python3
"""
Show full list of files.
"""
import argparse
import glob
import os
import signal
import sys
from typing import Iterator, List, Union
import file_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
self... | gpl-2.0 |
stelfrich/openmicroscopy | components/tools/OmeroWeb/omeroweb/settings.py | 1 | 40171 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # Django settings for OMERO.web project. # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# Copyright (c) 2008-2014 University of ... | gpl-2.0 |
maxalbert/tohu | tohu/v7/derived_generators/fstr.py | 1 | 1341 | import inspect
import re
from .apply import Apply
class fstr(Apply):
"""
Helper function for easy formatting of tohu generators.
Usage example:
>>> g1 = Integer(100, 200)
>>> g2 = Integer(300, 400)
>>> g3 = g1 + g2
>>> h = fstr('{g1} + {g2} = {g3}')
>>> print(nex... | mit |
liangazhou/django-rdp | packages/eclipse/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/encodings/mac_romanian.py | 593 | 13917 | """ Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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,inp... | apache-2.0 |
jrwdunham/old | onlinelinguisticdatabase/model/form.py | 1 | 8233 | # Copyright 2016 Joel Dunham
#
# 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 writi... | apache-2.0 |
kirca/OpenUpgrade | addons/mail/mail_mail.py | 183 | 18372 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
thomazs/geraldo | site/newsite/site-geraldo/django/views/defaults.py | 24 | 3359 | from django.core.exceptions import ObjectDoesNotExist
from django.template import Context, RequestContext, loader
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django import http
def shortcut(request, content_type_id, object_id):
"Redirect to an object... | lgpl-3.0 |
wrouesnel/ansible | lib/ansible/modules/cloud/vmware/vmware_migrate_vmk.py | 26 | 7038 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
adamgilman/ems-costing | tests/tests_postageapp.py | 1 | 1049 | from vendors import PostageApp
import unittest
class TestPostageApp(unittest.TestCase):
def setUp(self):
self.vendor = PostageApp()
def test_ZeroEmails(self):
self.assertEqual(self.vendor.getPrice(0), 9)
def test_Zero_10000(self):
self.assertEqual(self.vendor.getPrice(1), 9)
... | mit |
pshahzeb/vsphere-storage-for-docker | esx_service/cli/vmdkops_admin.py | 1 | 58143 | #!/usr/bin/env python
# Copyright 2016 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 |
dyim42/zerorpc-python | tests/test_pubpush.py | 102 | 3999 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
jusjusjus/pyedf | pyedf/score/score.py | 1 | 6055 | #! /usr/bin/python
from __future__ import with_statement
import logging
from .state import State
import numpy as np
import os
import re
class Score(object):
logger = logging.getLogger(name='Score')
commentSymbol = '#' # used for comments in state.annot
lineSeparator = ',' # used as separators i... | gpl-3.0 |
Perferom/android_external_chromium_org | sync/tools/testserver/chromiumsync_test.py | 154 | 30090 | #!/usr/bin/env python
# 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.
"""Tests exercising chromiumsync and SyncDataModel."""
import pickle
import unittest
import autofill_specifics_pb2
import bookmark_sp... | bsd-3-clause |
Omegaphora/external_chromium_org | third_party/protobuf/python/google/protobuf/descriptor_database.py | 230 | 4411 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
arongdari/sparse-graph-prior | sgp/GraphUtil.py | 1 | 1649 | import numpy as np
import networkx as nx
from collections import defaultdict
from scipy.sparse import csr_matrix, csc_matrix, triu
def sparse_to_networkx(G):
nnz = G.nonzero()
_G = nx.Graph()
_G.add_edges_from(zip(nnz[0], nnz[1]))
return _G
def compute_growth_rate(G, n_repeat=10):
"""
Compute... | mit |
bjodah/aqchem | chempy/tests/test_reactionsystem.py | 1 | 13409 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from itertools import chain
import pytest
from ..util.testing import requires
from ..util.parsing import parsing_library
from ..units import default_units, units_library, allclose
from ..chemistry import Substance, Reaction
fr... | bsd-2-clause |
ianmiell/docker-selinux | docker_selinux.py | 1 | 6584 | """ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class docker_selinux(ShutItModule):
def build(self, shutit):
# Some useful API calls for reference see shutit's docs for more info and options:
# shutit.send(send) - send a command
# shutit.multisend(send,send_dict) - send a co... | mit |
ycaihua/kbengine | kbe/src/lib/python/Lib/test/test_traceback.py | 80 | 16912 | """Test cases for traceback module"""
from io import StringIO
import sys
import unittest
import re
from test.support import run_unittest, Error, captured_output
from test.support import TESTFN, unlink, cpython_only
import traceback
class SyntaxTracebackCases(unittest.TestCase):
# For now, a very minimal set of ... | lgpl-3.0 |
kvar/ansible | lib/ansible/module_utils/ec2.py | 20 | 28571 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
armink/rt-thread | bsp/avr32uc3b0/rtconfig.py | 18 | 1667 | import os
# toolchains options
ARCH = 'avr32'
CPU = 'uc3'
PART = 'uc3b0256'
BOARD = 'USERBOARD'
CROSS_TOOL = 'gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = 'C:/Program Files/Atmel/AVR Tools/AVR Toolchain/bin'
elif CROSS_TOOL... | apache-2.0 |
azumimuo/family-xbmc-addon | plugin.video.specto/resources/lib/resolvers/cloudyvideos.py | 10 | 2259 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
456838/usefulCode | YHamburgGit/freeline.py | 11 | 1696 | #!/usr/bin/python
# -*- coding:utf-8 -*-
from __future__ import print_function
import sys
from argparse import ArgumentParser
from freeline_core.dispatcher import Dispatcher
from freeline_core.init import init
class Freeline(object):
def __init__(self):
self.dispatcher = Dispatcher()
def call(self, ... | apache-2.0 |
indro/t2c | libs/external_libs/Pygments-0.11.1/pygments/styles/friendly.py | 24 | 2508 | # -*- coding: utf-8 -*-
"""
pygments.styles.friendly
~~~~~~~~~~~~~~~~~~~~~~~~
A modern style based on the VIM pyte theme.
:copyright: 2006-2007 by Georg Brandl, Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from pygments.style import Style
from pygments.token import Keyword, Na... | mit |
ahu-odoo/odoo | addons/report_intrastat/__init__.py | 377 | 1079 | # -*- 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... | agpl-3.0 |
kuiwei/edx-platform | common/lib/xmodule/xmodule/tests/test_peer_grading.py | 33 | 16061 | import unittest
import json
import logging
from mock import Mock, patch
from webob.multidict import MultiDict
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from opaque_keys.edx.locations import Location, SlashSeparatedCourseKey
from xmodule.tests import get_test_system, get_test_descr... | agpl-3.0 |
chrisnatali/networkx | networkx/drawing/tests/test_layout.py | 43 | 1870 | """Unit tests for layout functions."""
import sys
from nose import SkipTest
from nose.tools import assert_equal
import networkx as nx
class TestLayout(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
try:
... | bsd-3-clause |
AnishShah/tensorflow | tensorflow/compiler/tests/adadelta_test.py | 16 | 5553 | # 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 |
LoHChina/nova | nova/api/openstack/compute/contrib/cells.py | 31 | 13462 | # Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# 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/lic... | apache-2.0 |
syhpoon/xyzcmd | libxyz/ui/size.py | 1 | 1143 | #-*- coding: utf8 -*
#
# Max E. Kuznecov ~syhpoon <syhpoon@syhpoon.name> 2008
#
# This file is part of XYZCommander.
# XYZCommander is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundation, either version 3 of the Licens... | gpl-3.0 |
junbochen/pylearn2 | pylearn2/datasets/tests/test_hdf5.py | 47 | 7240 | """
HDF5 dataset tests.
"""
import numpy as np
import os
import tempfile
from pylearn2.config import yaml_parse
from pylearn2.testing.datasets import (
random_dense_design_matrix,
random_one_hot_dense_design_matrix,
random_one_hot_topological_dense_design_matrix)
from pylearn2.testing.skip import skip_if_n... | bsd-3-clause |
yoer/hue | desktop/core/ext-py/Pygments-1.3.1/scripts/reindent.py | 194 | 9926 | #! /usr/bin/env python
# Released to the public domain, by Tim Peters, 03 October 2000.
# -B option added by Georg Brandl, 2006.
"""reindent [-d][-r][-v] [ path ... ]
-d (--dryrun) Dry run. Analyze, but don't make any changes to files.
-r (--recurse) Recurse. Search for all .py files in subdirectories too.
-B (--... | apache-2.0 |
tomzhang/googletest | test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | bsd-3-clause |
Cloudef/mpv | waftools/checks/custom.py | 1 | 4397 | from waftools.inflectors import DependencyInflector
from waftools.checks.generic import *
from waflib import Utils
import os
__all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front",
"check_cocoa"]
pthreads_program = load_fragment('pthreads.c')
def check_pthread_flag(ctx, dependency_ide... | gpl-2.0 |
anryko/ansible | test/units/modules/network/nxos/test_nxos_ospf.py | 23 | 2029 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
anryko/ansible | lib/ansible/modules/cloud/vultr/vultr_plan_info.py | 21 | 3763 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
# 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':... | gpl-3.0 |
kailIII/geraldo | site/newsite/django_1_0/django/dispatch/dispatcher.py | 9 | 17129 | """Multiple-producer-multiple-consumer signal-dispatching
dispatcher is the core of the PyDispatcher system,
providing the primary API and the core logic for the
system.
Module attributes of note:
Any -- Singleton used to signal either "Any Sender" or
"Any Signal". See documentation of the _Any class.
... | lgpl-3.0 |
Dunkas12/BeepBoopBot | lib/youtube_dl/extractor/tubitv.py | 32 | 3025 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
sanitized_Request,
urlencode_postdata,
)
class TubiTvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tubitv\.com/video/(?P<id>[0-9]+)'
_... | gpl-3.0 |
rmariano/pywars | game/views.py | 2 | 7077 | import json
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.contrib.auth.decorators import login_required
from django.views.decorators.cache import cach... | mit |
flotre/sickbeard-vfvo | lib/requests/packages/chardet2/gb2312prober.py | 2994 | 1681 | ######################## 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... | gpl-3.0 |
flotre/sickbeard-vfvo | cherrypy/_cpchecker.py | 39 | 14290 | import os
import warnings
import cherrypy
class Checker(object):
"""A checker for CherryPy sites and their mounted applications.
on: set this to False to turn off the checker completely.
When this object is called at engine startup, it executes each
of its own methods whose names start with... | gpl-3.0 |
GrognardsFromHell/TemplePlus | tpdatasrc/co8infra/scr/Spell741 - Ice Breath Weapon.py | 1 | 1381 | from toee import *
def OnBeginSpellCast( spell ):
print "Frozen Breath OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
game.particles( "sp-evocation-conjure", spell.caster )
def OnSpellEffect ( spell ):
print "Frozen Breat... | mit |
Nowheresly/odoo | addons/delivery/stock.py | 38 | 10914 | # -*- 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 |
fboers/jumeg | examples/do_MLICA.py | 1 | 5891 | """
Compute ICA object based on filtered and downsampled data.
Identify ECG and EOG artifacts using MLICA and compare
results to correlation & ctps analysis.
Apply ICA object to filtered and unfiltered data.
Ahmad Hasasneh, Nikolas Kampel, Praveen Sripad, N. Jon Shah, and Juergen Dammers
"Deep Learning Approach for A... | bsd-3-clause |
bfaviero/ok | nodisk.py | 1 | 2852 | import os
import subprocess
H_NAME = 'oauth-kerberos-server'
H_FOLDER = os.path.join('/cgroup', H_NAME)
CGROUP_NAME = 'thegroup'
CGROUP_FOLDER = os.path.join(H_FOLDER, CGROUP_NAME)
MOUNT_CMD_PATH = '/bin/mount'
UMOUNT_CMD_PATH = '/bin/umount'
MOUNTPOINT_CMD_PATH = '/bin/mountpoint'
def prevent_swapping():
"""preve... | mit |
explosion/thinc | thinc/tests/layers/test_combinators.py | 1 | 7655 | import pytest
import numpy
from numpy.testing import assert_allclose
from thinc.api import clone, concatenate, noop, add, map_list
from thinc.api import Linear, Dropout, Model, NumpyOps
from thinc.layers import chain, tuplify
@pytest.fixture(params=[1, 2, 9])
def nB(request):
return request.param
@pytest.fixtur... | mit |
tersmitten/ansible | lib/ansible/modules/cloud/vmware/vmware_tag.py | 7 | 8097 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | gpl-3.0 |
shadyueh/pyranking | env/lib/python2.7/site-packages/django/contrib/auth/handlers/modwsgi.py | 537 | 1344 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on whether the user exists and authen... | mit |
matejv/micropython-weatherstation | weatherstation.py | 1 | 4667 | from machine import I2C, Pin, Timer
import socket
import utime as time
import dht
from bmp180 import BMP180 # https://github.com/micropython-IMU/micropython-bmp180
from esp8266_i2c_lcd import I2cLcd # https://github.com/dhylands/python_lcd/
import clock, nethelper
class WeatherStation:
DHTPIN = 14 # DHT data pin
... | mit |
Tao-Ma/gpdb | src/test/tinc/tincrepo/mpp/models/mpp_tc.py | 12 | 25269 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | apache-2.0 |
schmidsi/django-pyodbc | tests/order_with_respect_to/models.py | 24 | 2132 | """
Tests for the order_with_respect_to Meta attribute.
"""
from django.db import models
class Question(models.Model):
text = models.CharField(max_length=200)
class Answer(models.Model):
text = models.CharField(max_length=200)
question = models.ForeignKey(Question)
class Meta:
order_with_res... | bsd-3-clause |
mjirik/teigen | tests/teigen_test.py | 1 | 6709 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
import unittest
import sys
import pytest
# import teigen
# import io3d
import os.path as op
path_to_script = op.dirname(op.abspath(__file__))
class MyTestCase(unittest.TestCase):
#
@pytest.mark.interactive
... | apache-2.0 |
40423130/2016fallcadp_hw | plugin/liquid_tags/flickr.py | 278 | 3478 | """
Flickr Tag
----------
This implements a Liquid-style flickr tag for Pelican.
IMPORTANT: You have to create a API key to access the flickr api.
You can do this `here <https://www.flickr.com/services/apps/create/apply>`_.
Add the created key to your config under FLICKR_API_KEY.
Syntax
------
{% flickr image_id [sma... | agpl-3.0 |
euri10/pynavitia | setup.py | 1 | 1662 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=6.0',
# TODO: put package requirements here
]
test_requirem... | mit |
lovexiaov/SandwichApp | venv/lib/python2.7/site-packages/wheel/egg2wheel.py | 471 | 2633 | #!/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>.+?)
(-... | apache-2.0 |
jimmbraddock/ns-3.20-ATN | src/fd-net-device/bindings/modulegen_customizations.py | 128 | 1118 | import os
def post_register_types(root_module):
enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',')
if 'EmuFdNetDevice' not in enabled_features:
if 'ns3::EmuFdNetDeviceHelper'in root_module:
root_module.classes.remove(root_module['ns3::EmuFdNetDeviceHelper'])
if 'TapFdNet... | gpl-2.0 |
JimCircadian/ansible | lib/ansible/module_utils/facts/hardware/darwin.py | 96 | 3527 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
15Dkatz/pants | src/python/pants/option/ranked_value.py | 6 | 3858 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
class RankedValue(o... | apache-2.0 |
gangeli/NaturalLI | etc/aristo/turk_51_view-turker.py | 1 | 2410 | #!/usr/bin/env python
#
import argparse
import sys
import os
import csv
import time
import math
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../../lib/')
from naturalli import *
"""
Parse the command line arguments
"""
def parseargs():
parser = argparse.ArgumentParser(description=
'Conve... | mit |
rednach/krill | test/shinken_modules.py | 13 | 9693 | #!/usr/bin/env python
import os
import re
import copy
import time
import subprocess
import shutil
import datetime # not used but "sub-"imported by livestatus test.. (to be corrected..)
import sys # not here used but "sub-"imported by livestatus test.. (to be corrected..)
#
from shinken.modulesctx import modulesctx
fr... | agpl-3.0 |
eLBati/stock-logistics-workflow | __unported__/stock_cancel/stock.py | 7 | 3434 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2012 Andrea Cometa All Rights Reserved.
# www.andreacometa.it
# openerp@andreacometa.it
# Copyright (... | agpl-3.0 |
402231466/40223146 | pybean.py | 562 | 8617 | #coding: utf-8
import sqlite3
from pkg_resources import parse_version
__version__ = "0.2.1"
__author__ = "Mickael Desfrenes"
__email__ = "desfrenes@gmail.com"
# Yen 2013.04.08, 將 Python2 的 .next() 改為 next(), 以便在 Python 3 中使用
class SQLiteWriter(object):
"""
In frozen mode (the default), the writer will not a... | gpl-3.0 |
Johnzero/OE7 | openerp/addons-modules/event_sale/event_sale.py | 30 | 4724 | # -*- 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 |
laperry1/android_external_chromium_org | build/android/pylib/base/test_dispatcher.py | 32 | 14970 | # 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.
"""Dispatches tests, either sharding or replicating them.
Performs the following steps:
* Create a test collection factory, using the given tests
- If sha... | bsd-3-clause |
Manojkumar91/odoo_inresto | addons/point_of_sale/report/account_statement.py | 8 | 1964 | # -*- 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 |
schlueter/ansible | lib/ansible/modules/notification/hall.py | 103 | 3365 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Billy Kimble <basslines@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.