repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
adedayo/intellij-community | python/lib/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 |
shaananc/security-proj2 | bindings/python/apidefs/gcc-ILP32/ns3_module_virtual_net_device.py | 6 | 13786 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## virtual-net-device.h: ns3::VirtualNetDevice [class]
module.add_class('VirtualNetDevice', parent=root_module['ns3::NetDevice'])
## Register a nested ... | gpl-2.0 |
tensorflow/lucid | lucid/scratch/pretty_graphs/visualizations.py | 1 | 6814 | import numpy as np
import tensorflow as tf
import json
import lucid.modelzoo.vision_models as models
from lucid.misc.io.showing import _image_url, _display_html
from lucid.scratch.pretty_graphs.format_graph import complete_render_model_graph
from lucid.misc.io import show, load
def display_model(model, tooltips=None... | apache-2.0 |
scalable-networks/ext | gnuradio-3.7.0.1/gr-digital/python/digital/gmsk.py | 10 | 10972 | #
# GMSK modulation and demodulation.
#
#
# Copyright 2005-2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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... | gpl-2.0 |
GeographicaGS/moocng | moocng/badges/migrations/0004_auto__chg_field_issuer_url__chg_field_badge_criteria__del_field_award_.py | 2 | 11175 | # -*- 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 'Issuer.url'
db.alter_column('badges_issuer', 'url', self.gf('django.db.models.fields.URLF... | apache-2.0 |
qvazzler/Flexget | flexget/plugins/plugin_spy_headers.py | 4 | 1531 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('spy_headers')
class PluginSpyHeaders(object):
"""
Logs all hea... | mit |
evax/ansible-modules-core | system/user.py | 26 | 72722 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Stephen Fromm <sfromm@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 Lice... | gpl-3.0 |
Mobleyta/GasChromino | PythonCode/gaschromatogram.py | 1 | 20669 | """
Module for various aspects of holding and interpreting GC data
Major structure is GasChromatogram class which is used to make a
GasChromatogram object for every GC trace acquired.
This object consists of:
the actual trace
information about the acquisition
time
instrument
user comme... | gpl-3.0 |
noahwilliamsson/micropython | tools/gendoc.py | 101 | 16995 | """
Generate documentation for pyboard API from C files.
"""
import os
import argparse
import re
import markdown
# given a list of (name,regex) pairs, find the first one that matches the given line
def re_match_first(regexs, line):
for name, regex in regexs:
match = re.match(regex, line)
if match:... | mit |
axmetishe/serna-free | serna/dist/plugins/publishing/BuiltinTransformers.py | 5 | 7802 | ##
## Copyright(c) 2009 Syntext, Inc. All Rights Reserved.
## Contact: info@syntext.com, http://www.syntext.com
##
## This file is part of Syntext Serna XML Editor.
##
## COMMERCIAL USAGE
## Licensees holding valid Syntext Serna commercial licenses may use this file
## in accordance with the Syntext Serna Commercial... | gpl-3.0 |
hongliang5623/sentry | tests/sentry/web/frontend/test_organization_api_key_settings.py | 24 | 1487 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import ApiKey
from sentry.testutils import TestCase, PermissionTestCase
class OrganizationApiKeySettingsPermissionTest(PermissionTestCase):
def setUp(self):
super(OrganizationApiKeySettingsPermissionTe... | bsd-3-clause |
nishigori/boto | boto/ec2/securitygroup.py | 150 | 14687 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Eucalyptus Systems, Inc.
#
# 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
# w... | mit |
ocampocj/cloud-custodian | c7n/resources/workspaces.py | 3 | 3703 | # Copyright 2019 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
jakevdp/scipy | scipy/optimize/tests/test_cobyla.py | 100 | 3562 | from __future__ import division, print_function, absolute_import
import math
import numpy as np
from numpy.testing import assert_allclose, TestCase, run_module_suite, \
assert_
from scipy.optimize import fmin_cobyla, minimize
class TestCobyla(TestCase):
def setUp(self):
self.x0 = [4.95, 0.66]
... | bsd-3-clause |
yoer/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/meta.py | 56 | 2138 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | apache-2.0 |
kyvinh/home-assistant | tests/components/emulated_hue/test_upnp.py | 12 | 3757 | """The tests for the emulated Hue component."""
import json
import unittest
from unittest.mock import patch
import requests
from homeassistant import bootstrap, const, core
import homeassistant.components as core_components
from homeassistant.components import emulated_hue, http
from homeassistant.util.async import r... | apache-2.0 |
louietsai/python-for-android | python-modules/twisted/twisted/names/server.py | 54 | 6654 | # -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Async DNS server
Future plans:
- Better config file format maybe
- Make sure to differentiate between different classes
- notice truncation bit
Important: No addit... | apache-2.0 |
wwj718/edx-video | manage.py | 1 | 3169 | #!/usr/bin/env python
"""
Usage: manage.py {lms|cms} [--settings env] ...
Run django management commands. Because edx-platform contains multiple django projects,
the first argument specifies which project to run (cms [Studio] or lms [Learning Management System]).
By default, those systems run in with a settings file ... | agpl-3.0 |
Evervolv/android_external_chromium_org | chrome_frame/tools/smoke_test.py | 78 | 3074 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Builds and runs the Chrome Frame unit and integration tests,
the exit status of the scrip is the number of failed tests.
"""
imp... | bsd-3-clause |
alu042/edx-platform | cms/djangoapps/contentstore/features/pages.py | 35 | 5026 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import world, step
from nose.tools import assert_equal, assert_in
CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox"
@step(u'I go to the pages page$')
def go_to_static(step):
... | agpl-3.0 |
eugena/django | django/contrib/sessions/models.py | 158 | 2230 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
use_in_migrations = True
def encode(self, session_dict):
"""
Return... | bsd-3-clause |
xq262144/hue | desktop/core/ext-py/sqlparse-0.2.0/tests/test_grouping.py | 5 | 16475 | # -*- coding: utf-8 -*-
import pytest
import sqlparse
from sqlparse import sql, tokens as T
def test_grouping_parenthesis():
s = 'select (select (x3) x2) and (y2) bar'
parsed = sqlparse.parse(s)[0]
assert str(parsed) == s
assert len(parsed.tokens) == 7
assert isinstance(parsed.tokens[2], sql.Par... | apache-2.0 |
freakboy3742/django | django/contrib/gis/gdal/libgdal.py | 11 | 3431 | import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contrib.gis')
# Custom library path set?
try:
... | bsd-3-clause |
carolineLe/miasm | test/arch/x86/sem.py | 3 | 5955 | #! /usr/bin/env python2
#-*- coding:utf-8 -*-
# Loosely based on ARM's sem.py
from __future__ import print_function
from builtins import range
from future.utils import viewitems
import unittest
import logging
import copy
from miasm.ir.symbexec import SymbolicExecutionEngine
from miasm.arch.x86.arch import mn_x86 a... | gpl-2.0 |
spapas/django-nice-stats | stats/models.py | 1 | 12262 | # This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if ... | mit |
bikash/h2o-dev | h2o-py/tests/testdir_algos/kmeans/pyunit_emptyclusKmeans.py | 1 | 2019 | import sys
sys.path.insert(1, "../../../")
import h2o
import random
import numpy as np
from sklearn import preprocessing
from sklearn.cluster import KMeans
def emptyclusKmeans(ip,port):
# Connect to a pre-existing cluster
h2o.init(ip,port) # connect to localhost:54321
#Log.info("Importing ozone.csv data... | apache-2.0 |
ScreamingUdder/mantid | Framework/PythonInterface/test/python/plugins/algorithms/BinWidthAtXTest.py | 3 | 4123 | from __future__ import (absolute_import, division, print_function)
from mantid.simpleapi import CreateWorkspace, DeleteWorkspace
import numpy
import sys
import testhelpers
import unittest
class BinWidthAtXTest(unittest.TestCase):
def _make_algorithm_params(self, ws, x, rounding='None'):
return {
... | gpl-3.0 |
AradhanaR/myapp | vendor/doctrine/orm/docs/en/conf.py | 2448 | 6497 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | mit |
InAnimaTe/CouchPotatoServer | libs/pyutil/nummedobj.py | 106 | 2141 | # Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# mailto:zooko@zooko.com
# This file is part of pyutil; see README.rst for licensing terms.
import dictutil
class NummedObj(object):
"""
This is useful for nicer debug printouts. Instead of objects of the same class being
distinguished from one another by t... | gpl-3.0 |
CloverHealth/airflow | airflow/example_dags/example_python_operator.py | 4 | 1909 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
CXQERP/ODOOERP | addons/purchase_analytic_plans/__init__.py | 441 | 1220 | # -*- 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 |
lukecwik/incubator-beam | .test-infra/metrics/sync/github/ghutilities.py | 14 | 1115 | #
# 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 |
bobwalker99/Pydev | plugins/org.python.pydev.jython/Lib/pdb.py | 119 | 46016 | #! /usr/bin/env python
"""A Python debugger."""
# (See pdb.doc for documentation.)
import sys
import linecache
import cmd
import bdb
from repr import Repr
import os
import re
import pprint
import traceback
class Restart(Exception):
"""Causes a debugger to be restarted for the debugged python program."""
pa... | epl-1.0 |
IshankGulati/scikit-learn | sklearn/metrics/tests/test_score_objects.py | 33 | 17877 | import pickle
import tempfile
import shutil
import os
import numbers
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regexp
from sklearn.utils.t... | bsd-3-clause |
z0by/django | django/contrib/gis/db/backends/postgis/pgraster.py | 491 | 5071 | import binascii
import struct
from django.forms import ValidationError
from .const import (
GDAL_TO_POSTGIS, GDAL_TO_STRUCT, POSTGIS_HEADER_STRUCTURE, POSTGIS_TO_GDAL,
STRUCT_SIZE,
)
def pack(structure, data):
"""
Pack data into hex string with little endian format.
"""
return binascii.hexli... | bsd-3-clause |
Samweli/inasafe | safe/impact_functions/ash/ash_raster_places/metadata_definitions.py | 1 | 4203 | # coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Ash Raster on Population
Metadata
Contact : ole.moller.nielsen@gmail.com
.. 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 Foun... | gpl-3.0 |
davinwang/caffe2 | caffe2/python/operator_test/pack_rnn_sequence_op_test.py | 4 | 3650 | # Copyright (c) 2016-present, Facebook, 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | apache-2.0 |
tkaitchuck/nupic | external/darwin64/lib/python2.6/site-packages/numpy/core/function_base.py | 82 | 5474 | __all__ = ['logspace', 'linspace']
import numeric as _nx
from numeric import array
def linspace(start, stop, num=50, endpoint=True, retstep=False):
"""
Return evenly spaced numbers over a specified interval.
Returns `num` evenly spaced samples, calculated over the
interval [`start`, `stop` ].
Th... | gpl-3.0 |
writefaruq/lionface-app | django/contrib/gis/tests/geoapp/test_feeds.py | 9 | 3930 | from xml.dom import minidom
from django.test import Client
from django.utils import unittest
from models import City
class GeoFeedTest(unittest.TestCase):
client = Client()
def assertChildNodes(self, elem, expected):
"Taken from regressiontests/syndication/tests.py."
actual = s... | bsd-3-clause |
victorbriz/rethinkdb | external/v8_3.30.33.16/build/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | agpl-3.0 |
Times-0/Timeline | Timeline/Handlers/Games/SledRacing/__init__.py | 1 | 3900 | from Timeline.Server.Constants import TIMELINE_LOGGER, LOGIN_SERVER, WORLD_SERVER
from Timeline import Username, Password, Inventory
from Timeline.Utils.Events import Event, PacketEventHandler, GeneralEvent
from Timeline.Server.Room import Game, Place, Multiplayer
from Timeline.Handlers.Games.WaddleHandler import W... | gpl-3.0 |
benagricola/exabgp | lib/exabgp/bgp/message/update/attribute/community/extended/origin.py | 4 | 2843 | # encoding: utf-8
"""
origin.py
Created by Thomas Mangin on 2014-06-20.
Copyright (c) 2014-2015 Orange. All rights reserved.
Copyright (c) 2014-2015 Exa Networks. All rights reserved.
"""
from struct import pack
from struct import unpack
from exabgp.protocol.ip import IPv4
from exabgp.bgp.message.open.asn import ASN... | bsd-3-clause |
postrational/django | tests/settings_tests/tests.py | 10 | 10233 | import os
import warnings
from django.conf import settings, global_settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRequest
from django.test import SimpleTestCase, TransactionTestCase, TestCase, signals
from django.test.utils import override_settings
from django.utils import... | bsd-3-clause |
cloudera/hue | desktop/core/ext-py/oauth2client-4.1.3/docs/conf.py | 12 | 3357 | # -*- coding: utf-8 -*-
#
# oauth2client documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 17 23:13:19 2014.
#
import os
import sys
# In order to load django before 1.7, we need to create a faux
# settings module and load it. This assumes django has been installed
# (but it must be fo... | apache-2.0 |
gepuro/csvkit | csvkit/py3.py | 1 | 3184 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Python3-specific classes.
"""
import csv
import six
class CSVKitReader(six.Iterator):
"""
A wrapper around Python 3's builtin :func:`csv.reader`.
"""
def __init__(self, f, **kwargs):
self.reader = csv.reader(f, **kwargs)
def __iter__(self... | mit |
dmlc/tvm | rust/tvm/examples/resnet/src/build_resnet.py | 1 | 5380 | #!/usr/bin/env python3
# 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
# "L... | apache-2.0 |
rwl/pylon | pylon/util.py | 1 | 16569 | #------------------------------------------------------------------------------
# Copyright (C) 2007-2010 Richard Lincoln
#
# 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.ap... | apache-2.0 |
obiben/pokemongo-api | pogo/POGOProtos/Settings/Master/Pokemon/CameraAttributes_pb2.py | 16 | 4036 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/Master/Pokemon/CameraAttributes.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from... | mit |
SecurityArtWork/VolGUI | volgui/urls.py | 1 | 1250 | # coding=utf-8
"""volgui URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='ho... | gpl-3.0 |
Leila20/django | tests/db_typecasts/tests.py | 40 | 2685 | # Unit tests for typecast functions in django.db.backends.util
import datetime
import unittest
from django.db.backends import utils as typecasts
from django.utils import six
TEST_CASES = {
'typecast_date': (
('', None),
(None, None),
('2005-08-11', datetime.date(2005, 8, 11)),
('1... | bsd-3-clause |
yumingfei/virt-manager | virtcli/cliconfig.py | 2 | 2798 | #
# Copyright (C) 2013 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-2.0 |
GFZ/isdc-drupal | sites/all/libraries/OpenLayers/OpenLayers-2.12/tests/selenium/remotecontrol/test_ol.py | 254 | 2873 | from selenium import selenium
import time
import sys
from ConfigParser import ConfigParser
MAX_TEST_LENGTH = 300
if len(sys.argv) > 2:
filename = sys.argv[2]
else:
filename = "config.cfg"
c = ConfigParser()
c.read(filename)
targets = {}
server = c.get('config', 'server')
url= c.get('config', 'url')
if c.h... | gpl-2.0 |
fgesora/odoo | addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py | 381 | 2572 | # -*- 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 |
mosbasik/buzhug | javasrc/lib/Jython/Lib/encodings/iso2022_jp.py | 816 | 1053 | #
# iso2022_jp.py: Python Unicode Codec for ISO2022_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... | bsd-3-clause |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/test/script_helper.py | 35 | 5568 | # Common utility functions used by various script execution tests
# e.g. test_cmd_line, test_cmd_line_script and test_runpy
import sys
import os
import re
import os.path
import tempfile
import subprocess
import py_compile
import contextlib
import shutil
import zipfile
from test.test_support import strip_python_stder... | gpl-2.0 |
gcode-mirror/audacity | lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/intltool.py | 330 | 2949 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re
from waflib import Configure,TaskGen,Task,Utils,Runner,Options,Build,Logs
import waflib.Tools.ccroot
from waflib.TaskGen import feature,before_method
from waflib.... | gpl-2.0 |
Sylrob434/CouchPotatoServer | libs/guessit/__init__.py | 92 | 10198 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
irisfeng/CodeScanner | SZQRCodeViewController/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/pylib/gyp/generator/ninja_test.py | 610 | 1611 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | mit |
drencrom/yowsup | yowsup/layers/protocol_acks/protocolentities/ack_outgoing.py | 15 | 1662 | from .ack import AckProtocolEntity
class OutgoingAckProtocolEntity(AckProtocolEntity):
'''
<ack type="{{delivery | read}}" class="{{message | receipt | ?}}" id="{{MESSAGE_ID}} to={{TO_JID}}">
</ack>
<ack to="{{GROUP_JID}}" participant="{{JID}}" id="{{MESSAGE_ID}}" class="receipt" type="{{read | }}">
... | gpl-3.0 |
iap-mutant/godot | tools/glwrapper/makewrapper.py | 19 | 3887 | #! /usr/bin/python
import sys
if (len(sys.argv)<2):
print("usage: makewrapper.py <headers>")
sys.exit(255)
functions=[]
types=[]
constants=[]
READ_FUNCTIONS=0
READ_TYPES=1
READ_CONSTANTS=2
read_what=READ_TYPES
for x in (range(len(sys.argv)-1)):
f=open(sys.argv[x+1],"r")
while(True):
line=f.readline(... | mit |
LBenzahia/cltk | cltk/tests/test_nlp/test_phonology.py | 1 | 40731 | """Test cltk.phonology."""
__author__ = ['Jack Duff <jmunroeduff@gmail.com>', "Clément Besnier <clemsciences@aol.com>"]
__license__ = 'MIT License. See LICENSE.'
import unicodedata
from cltk.phonology.arabic.romanization import transliterate as AarabicTransliterate
from cltk.phonology.greek import transcription as gr... | mit |
philprobinson84/RPi | camera/timelapse/cam_timeLapse_Threaded.py | 1 | 1642 | #!/usr/bin/env python2.7
import time
from subprocess import call
from threading import Thread
import sys
class Logger(object):
def __init__(self):
self.terminal = sys.stdout
self.log = open("logfile.log", "a")
def write(self, message):
self.terminal.write(message)
self.log.wri... | artistic-2.0 |
Aurelien1609/Computational-model | frequency_neural_field.py | 1 | 2681 | # -*- coding: utf-8 -*-
from dana import *
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.distance import cdist
from math import *
import matplotlib.animation as animation
# ------------------- Functions ------------------------- #
def gauss(X, width = 0.1, center = 0.0) :
""" Transform dist... | bsd-3-clause |
damdam-s/hr | __unported__/hr_department_sequence/hr_department.py | 14 | 2877 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
#
# This program 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, either version 3 of the Licens... | agpl-3.0 |
huangkebo/zulip | zerver/filters.py | 124 | 1058 | from __future__ import absolute_import
from django.views.debug import SafeExceptionReporterFilter
from django.http import build_request_repr
class ZulipExceptionReporterFilter(SafeExceptionReporterFilter):
def get_post_parameters(self, request):
filtered_post = SafeExceptionReporterFilter.get_post_paramet... | apache-2.0 |
adsabs/ADS_records_merger | merger/merger_settings.py | 1 | 22313 | # Copyright (C) 2011, The SAO/NASA Astrophysics Data System
#
# 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 p... | gpl-3.0 |
Nebuleon/barbie-seahorse-adventures | lib/door.py | 1 | 1736 | import pygame
from pygame.locals import *
from cnst import *
import sprite
import player
def init(g, r, n, hidden=False, *params):
s = sprite.Sprite3(g, r, 'door-1', (0, 0, 16, 24)) # 3
s.rect.centerx = r.centerx
s.rect.centery = r.centery - (24 - 16) / 2
s.loop = loop
s.hit = sprite_hit
s.... | gpl-2.0 |
anvil8/django-admin-tools | admin_tools/dashboard/views.py | 9 | 1619 | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
from django... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/Cython/Compiler/Naming.py | 93 | 5553 | #
# C naming conventions
#
#
# Prefixes for generating C names.
# Collected here to facilitate ensuring uniqueness.
#
pyrex_prefix = "__pyx_"
codewriter_temp_prefix = pyrex_prefix + "t_"
temp_prefix = u"__cyt_"
builtin_prefix = pyrex_prefix + "builtin_"
arg_prefix = pyrex_prefix + "arg_"
f... | agpl-3.0 |
kernow/ansible-modules-core | cloud/google/gc_storage.py | 41 | 16706 | #!/usr/bin/python
# 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... | gpl-3.0 |
dgarros/ansible | lib/ansible/modules/net_tools/dnsimple.py | 63 | 12241 | #!/usr/bin/python
# 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... | gpl-3.0 |
ymap/aioredis | tests/scripting_commands_test.py | 1 | 3604 | import pytest
import asyncio
from aioredis import ReplyError
@pytest.mark.run_loop
async def test_eval(redis):
await redis.delete('key:eval', 'value:eval')
script = "return 42"
res = await redis.eval(script)
assert res == 42
key, value = b'key:eval', b'value:eval'
script = """
if redis.... | mit |
jtl999/certbot | certbot-apache/certbot_apache/display_ops.py | 2 | 3484 | """Contains UI methods for Apache operations."""
import logging
import os
import zope.component
from certbot import errors
from certbot import interfaces
import certbot.display.util as display_util
logger = logging.getLogger(__name__)
def select_vhost(domain, vhosts):
"""Select an appropriate Apache Vhost.
... | apache-2.0 |
benley/Mathics | mathics/core/parser.py | 2 | 46517 | # -*- coding: utf8 -*-
u"""
Mathics: a general-purpose computer algebra system
Copyright (C) 2011-2013 The Mathics Team
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 ver... | gpl-3.0 |
zstars/weblabdeusto | server/src/test/unit/experiments/ud_xilinx/test_server_logic.py | 1 | 17803 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | bsd-2-clause |
tectronics/wot-xvm | src/xpm/xpm/mods/lib/tlslite/utils/rsakey.py | 148 | 8833 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Abstract class for RSA."""
from .cryptomath import *
class RSAKey(object):
"""This is an abstract base class for RSA keys.
Particular implementations of RSA keys, such as
L{openssl_rsakey.OpenSSL_RSAKey}... | gpl-3.0 |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/solnlib/packages/splunklib/modularinput/input_definition.py | 8 | 1888 | # Copyright 2011-2015 Splunk, 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | isc |
0x0FFF/gpdb | gpMgmt/bin/ext/yaml/serializer.py | 129 | 4170 |
__all__ = ['Serializer', 'SerializerError']
from error import YAMLError
from events import *
from nodes import *
class SerializerError(YAMLError):
pass
class Serializer(object):
ANCHOR_TEMPLATE = u'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=None, version=No... | apache-2.0 |
USGSDenverPychron/pychron | pychron/lasers/autotuner.py | 1 | 4855 | # ===============================================================================
# Copyright 2013 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | apache-2.0 |
tellesnobrega/horizon | openstack_dashboard/dashboards/admin/volumes/volume_types/urls.py | 39 | 2068 | # 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 t... | apache-2.0 |
jamessergeant/pylearn2 | pylearn2/datasets/stl10.py | 44 | 5563 | """
.. todo::
WRITEME
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
from theano.compat.six.moves import xrange
from ... | bsd-3-clause |
boland1992/seissuite_iran | build/lib/ambient/response/FDSN_resp.py | 8 | 14082 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 17 15:38:50 2015
@author: boland
"""
from obspy.fdsn import Client
from obspy import UTCDateTime
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.basemap import Basemap
import pickle
import os
from scipy.optimize import fsolve
import pylab
# set ra... | gpl-3.0 |
michelts/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/i18n/commands/compilation.py | 52 | 1032 | import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.management import CommandError
from django.core.management.commands.compilemessages import compile_messages
from django.test import TestCase
LOCALE='es_AR'
class MessageCompilationTests(TestCase)... | gpl-3.0 |
canglade/NLP | appengine/standard/users/main.py | 8 | 1847 | # Copyright 2016 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
marcelovilaca/DIRAC | Core/DISET/private/BaseClient.py | 1 | 13665 | # $HeadURL$
__RCSID__ = "$Id$"
import time
import types
import thread
import DIRAC
from DIRAC.Core.DISET.private.Protocols import gProtocolDict
from DIRAC.FrameworkSystem.Client.Logger import gLogger
from DIRAC.Core.Utilities import List, Network
from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR
from DIRAC.C... | gpl-3.0 |
ghandiosm/Test | addons/website_blog/tests/common.py | 46 | 1479 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestWebsiteBlogCommon(common.TransactionCase):
def setUp(self):
super(TestWebsiteBlogCommon, self).setUp()
Users = self.env['res.users']
group_blog_manager_id = self.ref('base.group_website_designer')
group_employee_i... | gpl-3.0 |
whereismyjetpack/ansible | lib/ansible/modules/cloud/centurylink/clc_modify_server.py | 48 | 35314 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | gpl-3.0 |
xNovax/SickRage | sickbeard/clients/download_station_client.py | 19 | 2684 | # Authors:
# Pedro Jose Pereira Vieito <pvieito@gmail.com> (Twitter: @pvieito)
#
# URL: https://github.com/mr-orange/Sick-Beard
#
# This file is part of SickRage.
#
# SickRage 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 Softwa... | gpl-3.0 |
GDGLima/contentbox | third_party/django/contrib/gis/admin/options.py | 113 | 5700 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographic models. Map settings
may be... | apache-2.0 |
dimagol/trex-core | scripts/external_libs/pyzmq-14.5.0/python3/intel/ucs4/32bit/zmq/eventloop/zmqstream.py | 28 | 18816 | #
# Copyright 2009 Facebook
#
# 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, s... | apache-2.0 |
dragonfi/snowfall | pyglet-1.1.4/pyglet/text/caret.py | 9 | 20725 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | mit |
ralphwort/chef-repo | build/pbr/pbr/tests/test_files.py | 41 | 2624 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# htt... | apache-2.0 |
richardwhiuk/ns-moose | bindings/python/apidefs/gcc-ILP32/ns3_module_uan.py | 132 | 3902 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
... | gpl-2.0 |
dark-lbp/isf | icssploit/test/test_s7comm.py | 1 | 33453 | from icssploit.test import icssploitTestCase
from icssploit.protocols.s7comm import *
class S7commTests(icssploitTestCase):
def setUp(self):
super(S7commTests, self).setUp()
def test_cotp_cr(self):
data = '0300001611e00000000100c0010ac102' \
'0100c2020200'.decode('hex')
... | bsd-2-clause |
yyuu/botornado | boto/gs/__init__.py | 265 | 1076 | # Copyright 2010 Google Inc.
#
# 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, modify, merge, publish, dis-
# trib... | mit |
Sutto/cloud-custodian | tools/c7n_gcp/tests/test_loadbalancer.py | 2 | 29700 | # Copyright 2019 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
lokeshjindal15/gem5_transform | src/arch/x86/isa/insts/simd128/integer/shift/right_arithmetic_shift.py | 91 | 3243 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
vaygr/ansible | lib/ansible/modules/system/svc.py | 63 | 9262 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2015, Brian Coca <bcoca@ansible.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': '... | gpl-3.0 |
3dfxsoftware/cbss-addons | procurement_order_merge/__openerp__.py | 1 | 1862 | # -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
###################################################... | gpl-2.0 |
JoseBlanca/franklin | franklin/gmod/markers.py | 1 | 7118 | '''
This script provides the tools to deal with markers. It provides tools to read,
write and search the markers data structure
Created on 08/07/2010
@author: peio
'''
from franklin.gff import GffFile
import csv
SOFA_TRADUCTOR = {'rflp': 'RFLP_fragment',
'snp' : 'SNP',
'RFLP': 'RF... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.