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
daniel-jacob-pearson/Moosic
moosic/server/methods.py
1
47738
# moosic.server.methods.py - defines and registers the Moosic server methods # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose,...
unlicense
losnikitos/googleads-python-lib
examples/adwords/v201502/basic_operations/add_keywords.py
4
2687
#!/usr/bin/python # # Copyright 2015 Google 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 b...
apache-2.0
losnikitos/googleads-python-lib
examples/dfp/v201505/audience_segment_service/update_audience_segments.py
4
2683
#!/usr/bin/python # # Copyright 2015 Google 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 b...
apache-2.0
wangyum/tensorflow
tensorflow/contrib/learn/python/learn/grid_search_test.py
137
2035
# 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
lupyuen/RaspberryPiImage
home/pi/GrovePi/Projects/Advanced_RGB_LCD_TempAndHumidity/grovepi_lcd_dht.py
5
4898
# grovepi_lcd_dht.py # # This is an project for using the Grove RGB_LED Display and the Grove DHT Sensor from the GrovePi starter kit # # In this project, the Temperature and humidity from the DHT sensor is printed on the RGB_LCD Display ''' The MIT License (MIT) GrovePi for the Raspberry Pi: an open source platform ...
apache-2.0
gurneyalex/OpenUpgrade
addons/account/wizard/account_move_bank_reconcile.py
385
2684
# -*- 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
candu/composing-programs
ch1/17.py
1
1154
def count_partitions_DP(n, m): """Count the ways to partition n using parts up to m. We use a technique known as "dynamic programming" (DP), which sounds more magical than it is: essentially, we compute intermediate results and store them in a table. It's really just recursion plus caching, minus the ...
mit
DJMuggs/ansible-modules-extras
system/facter.py
91
1614
#!/usr/bin/python # -*- coding: utf-8 -*- # (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...
gpl-3.0
eg-zhang/h2o-2
ec2/h2o-cluster-print-info.py
32
1604
#!/usr/bin/env python import os import time import boto import boto.ec2 # Environment variables you MUST set (either here or by passing them in). # ----------------------------------------------------------------------- # # os.environ['AWS_ACCESS_KEY_ID'] = '...' # os.environ['AWS_SECRET_ACCESS_KEY'] = '...' # Opt...
apache-2.0
DarthMaulware/EquationGroupLeaks
Leak #1 - Equation Group Cyber Weapons Auction - Invitation/EQGRP-Free-File/Firewall/EXPLOITS/EXBA/scapy/layers/isakmp.py
4
14123
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license import struct from scapy.packet import * from scapy.fields import * from scapy.ansmachine import * from scapy.layers.inet...
unlicense
gshivani/ansible-modules-extras
system/known_hosts.py
8
9019
#!/usr/bin/python """ Ansible module to manage the ssh known_hosts file. Copyright(c) 2014, Matthew Vernon <mcv21@cam.ac.uk> 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 Li...
gpl-3.0
fujita/ryu
ryu/services/protocols/bgp/operator/commands/clear.py
52
1593
from ryu.services.protocols.bgp.operator.command import Command from ryu.services.protocols.bgp.operator.command import CommandsResponse from ryu.services.protocols.bgp.operator.command import STATUS_OK from ryu.services.protocols.bgp.operator.commands.responses import \ WrongParamResp class BGPCmd(Command): ...
apache-2.0
Chilledheart/vbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
11
7674
## @file # Generate PCD table for 'Patchable In Module' type PCD with given .map file. # The Patch PCD table like: # # PCD Name Offset in binary # ======== ================ # # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are l...
gpl-2.0
ArtsiomCh/tensorflow
tensorflow/python/kernel_tests/range_dataset_op_test.py
4
19693
# Copyright 2017 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
tangyiyong/odoo
addons/portal_project/__openerp__.py
380
1686
# -*- 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
ccnmtl/lettuce
tests/integration/lib/Django-1.3/django/contrib/messages/storage/session.py
456
1213
from django.contrib.messages.storage.base import BaseStorage class SessionStorage(BaseStorage): """ Stores messages in the session (that is, django.contrib.sessions). """ session_key = '_messages' def __init__(self, request, *args, **kwargs): assert hasattr(request, 'session'), "The sessi...
gpl-3.0
ehealthafrica-ci/onadata
onadata/libs/utils/middleware.py
2
1498
import traceback from django.http import HttpResponseNotAllowed from django.template import RequestContext from django.template import loader from django.middleware.locale import LocaleMiddleware from django.utils.translation.trans_real import parse_accept_lang_header class ExceptionLoggingMiddleware(object): d...
bsd-2-clause
ujenmr/ansible
lib/ansible/modules/storage/netapp/na_ontap_iscsi.py
21
8339
#!/usr/bin/python # (c) 2017, NetApp, Inc # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
dnephin/compose-addons
tests/merge_test.py
1
1982
import textwrap import pytest import yaml from compose_addons import merge def test_merge_file_build_to_image(): base = { 'web': { 'build': '.', 'ports': [] } } override = { 'web': { 'image': 'service:latest', 'environment': [], ...
apache-2.0
mikeNG/android_kernel_oppo_msm8974
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
golismero/golismero
thirdparty_libs/nltk/metrics/windowdiff.py
12
2012
# Natural Language Toolkit: Windowdiff # # Copyright (C) 2001-2012 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT ###############################################################...
gpl-2.0
ampax/edx-platform-backup
lms/djangoapps/courseware/features/video.py
50
20992
# -*- coding: utf-8 -*- # pylint: disable=missing-docstring from lettuce import world, step, before, after import json import os import time import requests from nose.tools import assert_less, assert_equal, assert_true, assert_false from common import i_am_registered_for_the_course, visit_scenario_item from django.uti...
agpl-3.0
smart-developerr/my-first-blog
Lib/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py
2930
11275
######################## 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
holachek/ecosense
app/south/orm.py
10
15092
""" South's fake ORM; lets you not have to write SQL inside migrations. Roughly emulates the real Django ORM, to a point. """ from __future__ import print_function import inspect from django.db import models from django.db.models.loading import cache from django.core.exceptions import ImproperlyConfigured from sout...
mit
Jgarcia-IAS/SAT
openerp/addons/l10n_br/__init__.py
430
1403
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
neurodata/ndstore
scripts/ingest/kat14s1col/kat14s1anno.py
2
3487
import argparse import sys import os import numpy as np from PIL import Image import cStringIO import zlib import ocppaths import ocpcarest import zindex import kanno_cy # # ingest the PNG files into the database # """This file is super-customized for Bobby's meso-scale s1 data""" # Stuff we make take from a c...
apache-2.0
ramineni/my_congress
congress/tests/datasources/test_glancev2_driver.py
1
5433
# 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 b...
apache-2.0
piquadrat/django
django/core/files/temp.py
28
2501
""" The temp module provides a NamedTemporaryFile that can be reopened in the same process on any platform. Most platforms use the standard Python tempfile.NamedTemporaryFile class, but Windows users are given a custom class. This is needed because the Python implementation of NamedTemporaryFile uses the O_TEMPORARY f...
bsd-3-clause
sogelink/ansible
lib/ansible/modules/files/archive.py
18
16335
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ben Doherty <bendohmv@gmail.com> # Sponsored by Oomph, Inc. http://www.oomphinc.com # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_impor...
gpl-3.0
harryjubb/pdb_interactions
determine_interactions.py
1
10147
import argparse import itertools import logging import os import re import simplejson as json from Bio.PDB.PDBParser import PDBParser from Bio.PDB import NeighborSearch from config import PDB_RESIDUE_TYPES_BY_RESIDUE LEVEL_MAP = { 'A': 'atom', 'R': 'residue', 'C': 'chain' } # MATCHES PDB ACCESSIONS # E...
mit
Thingee/cinder
cinder/tests/api/contrib/test_scheduler_hints.py
9
3521
# Copyright 2013 OpenStack Foundation # 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 requ...
apache-2.0
pepevalbe/ardupilot
Tools/LogAnalyzer/tests/TestMotorBalance.py
215
2265
from LogAnalyzer import Test,TestResult import DataflashLog class TestBalanceTwist(Test): '''test for badly unbalanced copter, including yaw twist''' def __init__(self): Test.__init__(self) self.name = "Motor Balance" def run(self, logdata, verbose): self.result = TestResult() ...
gpl-3.0
saisai/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/jsonchecker_unittest.py
124
5004
# Copyright (C) 2010 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
tdliu/hoop-picks
lib/dateutil/easter.py
202
2611
# -*- coding: utf-8 -*- """ This module offers a generic easter computing method for any given year, using Western, Orthodox or Julian algorithms. """ import datetime __all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"] EASTER_JULIAN = 1 EASTER_ORTHODOX = 2 EASTER_WESTERN = 3 def easter(year,...
apache-2.0
yongshengwang/hue
build/env/lib/python2.7/site-packages/kazoo-2.0-py2.7.egg/kazoo/protocol/states.py
50
6304
"""Kazoo State and Event objects""" from collections import namedtuple class KazooState(object): """High level connection state values States inspired by Netflix Curator. .. attribute:: SUSPENDED The connection has been lost but may be recovered. We should operate in a "safe mode" until...
apache-2.0
SOKP/kernel_samsung_klte
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
hbrunn/OpenUpgrade
addons/project_issue_sheet/__init__.py
442
1105
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
robbat2/teuthology
teuthology/task/tests/__init__.py
9
3714
""" This task is used to integration test teuthology. Including this task in your yaml config will execute pytest which finds any tests in the current directory. Each test that is discovered will be passed the teuthology ctx and config args that each teuthology task usually gets. This allows the tests to operate again...
mit
ericjang/cryptocurrency_arbitrage
bterapi/trade.py
2
5785
# Copyright (c) 2013 Alan McIntyre import urllib import hashlib import hmac from datetime import datetime import decimal import time import common import keyhandler # Putting this here in case I change my mind and want to use UTC or something. def now(): return datetime.now() def validate_order(func): def...
gpl-3.0
tectronics/browserscope
categories/summary/test_set.py
9
2578
#!/usr/bin/python2.4 # # Copyright 2009 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 ...
apache-2.0
onestarshang/flask_super_config
venv/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py
573
16810
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
gpl-2.0
laszlocsomor/tensorflow
tensorflow/contrib/distributions/python/ops/normal_conjugate_posteriors.py
120
5530
# 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
InfoSec812/vertx-web
vertx-web/src/test/sockjs-protocol/websocket.py
14
15457
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) 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, ...
apache-2.0
tseaver/gcloud-python
bigtable/google/cloud/bigtable_admin_v2/proto/instance_pb2.py
3
24817
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/bigtable/admin_v2/proto/instance.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 googl...
apache-2.0
eyohansa/django
django/contrib/gis/db/backends/spatialite/operations.py
257
11441
""" SQL functions reference lists: http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re import sys from django.contrib.gis.db.backends.base.operations import \ ...
bsd-3-clause
googleapis/googleapis-gen
google/cloud/aiplatform/v1/schema/predict/prediction/prediction-py/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/tabular_regression.py
3
1435
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
apache-2.0
iPatso/PyGameProjs
PYex/hexGame/hex.py
1
8425
## Francisco Rivera - franr.com.ar/hex | ## ------------------------------------/ # import os import random from threading import Thread import pygame # constantes RUN = True LONG = 20 AMARILLO = (255, 231, 0) AMARILLO_C = (255, 255, 50) AZUL = (0, 127, 245) AZUL_C = (50, 177, 255) BLANCO = (255,255,255) NEGRO = (0,0...
apache-2.0
jburel/openmicroscopy
components/tools/OmeroWeb/omeroweb/webadmin/views.py
3
43081
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # Copyright (c) 2008-2018 University of Dundee. # # 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 # License, or...
gpl-2.0
shakamunyi/nova
nova/tests/unit/objects/test_instance_numa_topology.py
4
6706
# 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 # d...
apache-2.0
thaumos/ansible
lib/ansible/modules/utilities/logic/fail.py
45
1287
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Dag Wieers <dag@wieers.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
pythonvietnam/scikit-learn
sklearn/datasets/twenty_newsgroups.py
126
13591
"""Caching loader for the 20 newsgroups text classification dataset The description of the dataset is available on the official website at: http://people.csail.mit.edu/jrennie/20Newsgroups/ Quoting the introduction: The 20 Newsgroups data set is a collection of approximately 20,000 newsgroup documents,...
bsd-3-clause
DayGitH/Python-Challenges
DailyProgrammer/DP20150204B.py
1
12512
""" [2015-02-04] Challenge #200 [Intermediate] Metro Tile Meltdown https://www.reddit.com/r/dailyprogrammer/comments/2uo3yf/20150204_challenge_200_intermediate_metro_tile/ # [](#IntermediateIcon) _(Intermediate)_: Metro Tile Meltdown In the continued name of backward-compatibility, Microsoft has released a version of...
mit
sahiljain/catapult
third_party/gsutil/third_party/boto/tests/unit/auth/test_sigv4.py
75
23443
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
bsd-3-clause
BradAJ/zipflights
zipflights_data_parsing.py
1
11460
import pandas as pd import numpy as np #Columns of interest in BTS OrigDest:Market Survey csv. USECOLS = [u'MktCoupons', u'Year', u'Quarter', u'Origin', u'Dest', u'AirportGroup', u'TkCarrierChange', u'TkCarrierGroup', ...
mit
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8
lib/python2.7/warnings.py
265
14044
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys import types __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_war...
gpl-2.0
uclouvain/osis
base/models/admission_condition.py
1
6453
from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.db.models import F from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ from ordered_model.models import OrderedModel from reversion.admin im...
agpl-3.0
fyookball/electrum
plugins/email_requests/qt.py
1
10315
#!/usr/bin/env python3 # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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 withou...
mit
randy3k/R-Box
box/completion.py
2
3825
import sublime import sublime_plugin import re from .view_mixin import RBoxViewMixin from .namespace import namespace_manager from .settings import r_box_settings VALIDCOMPLETION = re.compile(r"[.a-zA-Z0-9_-]+$") VALIDOBJECT = re.compile(r"([a-zA-Z][a-zA-Z0-9.]*)(:::?)([.a-zA-Z0-9_-]*)$") ARGVALUE = re.compile(r"=\s*[...
mit
katuma/openvz-kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
smartdata-x/robots
pylib/Twisted/twisted/python/dist3.py
23
8952
# -*- test-case-name: twisted.python.test.test_dist3 -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Support for installing Twisted on Python 3. Only necessary while parts of Twisted are unported. @var modules: A list of modules that have been ported, e.g. "twisted.python.versions...
apache-2.0
nhuntwalker/astroML
book_figures/chapter4/fig_lyndenbell_toy.py
3
4082
""" Luminosity function code on toy data ------------------------------------ Figure 4.9. An example of using Lynden-Bell's C- method to estimate a bivariate distribution from a truncated sample. The lines in the left panel show the true one-dimensional distributions of x and y (truncated Gaussian distributions). The ...
bsd-2-clause
shajrawi/swift
utils/gyb_syntax_support/Node.py
6
3048
from __future__ import print_function import sys # noqa: I201 from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word def error(msg): print('error: ' + msg, file=sys.stderr) sys.exit(-1) class Node(object): """ A Syntax node, possibly with children. If the kind is "SyntaxCollect...
apache-2.0
olapaola/olapaola-android-scripting
python/src/Demo/scripts/morse.py
37
4333
# DAH should be three DOTs. # Space between DOTs and DAHs should be one DOT. # Space between two letters should be one DAH. # Space between two words should be DOT DAH DAH. import sys, math, audiodev DOT = 30 DAH = 3 * DOT OCTAVE = 2 # 1 == 441 Hz, 2 == 882 Hz, ... morsetab = { '...
apache-2.0
thesuperzapper/tensorflow
tensorflow/python/debug/lib/debug_data_test.py
17
9250
# 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
pytlakp/intranetref
src/intranet3/lib/times.py
1
10623
import datetime import copy import xlwt from jinja2 import escape from pyramid.httpexceptions import HTTPForbidden, HTTPBadRequest from pyramid.response import Response from sqlalchemy.sql import or_, and_ from intranet3.utils.filters import comma_number from intranet3.models import User, TimeEntry, Tracker, Project,...
mit
jelugbo/hebs_master
common/lib/xmodule/xmodule/tests/xml/factories.py
50
4908
""" Factories for generating edXML for testing XModule import """ import inspect from fs.memoryfs import MemoryFS from factory import Factory, lazy_attribute, post_generation, Sequence from lxml import etree from xmodule.modulestore.inheritance import InheritanceMixin from xmodule.modulestore import only_xmodules ...
agpl-3.0
bittomix/ucollect
src/master/collect-master.py
1
3790
#!/usr/bin/python2 # # Ucollect - small utility for real-time analysis of network data # Copyright (C) 2013 CZ.NIC, z.s.p.o. (http://www.nic.cz/) # # 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 Soft...
gpl-2.0
jackTheRipper/iotrussia
web_server/lib/werkzeug-master/werkzeug/http.py
317
33404
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
gpl-2.0
odyaka341/nxt-python
nxt/sensor/mindsensors.py
21
30599
# nxt.sensor.mindsensors module -- Classes implementing Mindsensors sensors # Copyright (C) 2006,2007 Douglas P Lau # Copyright (C) 2009 Marcus Wanner, Paulo Vieira, rhn # Copyright (C) 2010 Marcus Wanner, MindSensors # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
gpl-3.0
FactomProject/Testing
examples/python/libs/ecdsa/der.py
29
7018
from __future__ import division import binascii import base64 from .six import int2byte, b, integer_types, text_type class UnexpectedDER(Exception): pass def encode_constructed(tag, value): return int2byte(0xa0+tag) + encode_length(len(value)) + value def encode_integer(r): assert r >= 0 # can't support ...
mit
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/mpls/lsps/constrained_path/named_explicit_paths/named_explicit_path/__init__.py
1
33598
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
tdtrask/ansible
lib/ansible/modules/cloud/webfaction/webfaction_domain.py
19
4965
#!/usr/bin/python # # (c) Quentin Stafford-Fraser 2015 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # Create Webfaction domains and subdomains using Ansible and the Webfaction API from __future__ import absolute_import, division, print_function __metaclass__ = type A...
gpl-3.0
s40523239/2016fallcp_hw
plugin/liquid_tags/video.py
296
2360
""" Video Tag --------- This implements a Liquid-style video tag for Pelican, based on the octopress video tag [1]_ Syntax ------ {% video url/to/video [width height] [url/to/poster] %} Example ------- {% video http://site.com/video.mp4 720 480 http://site.com/poster-frame.jpg %} Output ------ <video width='720' hei...
agpl-3.0
gt-ros-pkg/rcommander-core
rcommander/src/rcommander/moved/linear_move_tool.py
1
9339
import tool_utils as tu #import smach_ros from PyQt4.QtGui import * from PyQt4.QtCore import * import rospy import tf_utils as tfu import tf.transformations as tr import numpy as np #import move_base_msgs.msg as mm #import math from object_manipulator.convert_functions import * import ptp_arm_action.msg as ptp import m...
bsd-3-clause
clebergnu/avocado-vt
virttest/error_context.py
8
4338
import sys import threading from traceback import format_exception # Add names you want to be imported by 'from errors import *' to this list. # This must be list not a tuple as we modify it to include all of our # the Exception classes we define below at the end of this file. __all__ = ['format_error', 'context_aware...
gpl-2.0
kenju254/yowsup
yowsup/layers/protocol_groups/protocolentities/iq_groups_leave_success.py
39
1424
from yowsup.structs import ProtocolTreeNode from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity class SuccessLeaveGroupsIqProtocolEntity(ResultIqProtocolEntity): ''' <iq type="result" from="g.us" id="{{ID}}"> <leave> <group id="{{GROUP_JID}}"></group> </le...
gpl-3.0
alvin319/CarnotKE
jyhton/lib-python/2.7/test/test_setcomps.py
132
3847
doctests = """ ########### Tests mostly copied from test_listcomps.py ############ Test simple loop with conditional >>> sum({i*i for i in range(100) if i&1 == 1}) 166650 Test simple case >>> {2*y + x + 1 for x in (0,) for y in (1,)} set([3]) Test simple nesting >>> list(sorted({(i,j) for i in...
apache-2.0
ya7lelkom/googleads-python-lib
examples/dfp/v201411/creative_template_service/get_creative_templates_by_statement.py
4
2383
#!/usr/bin/python # # Copyright 2014 Google 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 b...
apache-2.0
DolphinDream/sverchok
nodes/field/noise_vfield.py
2
1985
import numpy as np import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty, StringProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, match_long_repeat from sverchok.utils.modules.eval_formula import get_variabl...
gpl-3.0
aleksandra-tarkowska/django
django/contrib/admindocs/urls.py
574
1183
from django.conf.urls import url from django.contrib.admindocs import views urlpatterns = [ url('^$', views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'), name='django-admindocs-docroot'), url('^bookmarklets/$', views.BookmarkletsView.as_view(), name='django-ad...
bsd-3-clause
ftrautsch/mecoSHARK
mecoshark/processor/baseprocessor.py
1
3584
import abc import os import string import stat class BaseProcessor(metaclass=abc.ABCMeta): """ Main app for the mecoshark plugin :param output_path: path to an output directory, where files can be stored :param input_path: path to the revision that is used as input :property input_path: path to the r...
apache-2.0
supergentle/migueltutorial
flask/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/mxodbc.py
80
3856
# mssql/mxodbc.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mssql+mxodbc :name: mxODBC :dbapi: mxodbc :connectstrin...
bsd-3-clause
rnlf/motor
build.py
1
10128
#!/usr/bin/env python3 # # motor2d # # Copyright (C) 2015 Florian Kesseler # # This project is free software; you can redistribute it and/or modify it # under the terms of the MIT license. See LICENSE.md for details. # import sys import os import re import shutil optimize = 2 link_time_optimize = 0 sources...
mit
anthgur/servo
tests/wpt/web-platform-tests/tools/manifest/item.py
17
7093
import os from six.moves.urllib.parse import urljoin from abc import ABCMeta, abstractmethod, abstractproperty def get_source_file(source_files, tests_root, manifest, path): def make_new(): from .sourcefile import SourceFile return SourceFile(tests_root, path, manifest.url_base) if source_fi...
mpl-2.0
haad/ansible
lib/ansible/cli/doc.py
1
22549
# (c) 2014, James Tanner <tanner.jc@gmail.com> # # 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 i...
gpl-3.0
mforets/carlin
carlin/utils.py
1
5382
#=============================================== # Dependencies #=============================================== # NumPy import numpy as np from numpy.linalg import norm # SciPy import scipy as sp from scipy import inf from scipy.io import savemat from scipy.sparse import kron, eye import scipy.sparse.linalg # Toolb...
gpl-3.0
lmazuel/azure-sdk-for-python
azure-graphrbac/azure/graphrbac/operations/users_operations.py
1
18223
# 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
xu-cheng/youtube-dl
youtube_dl/postprocessor/common.py
19
1699
from ..utils import PostProcessingError class PostProcessor(object): """Post Processor class. PostProcessor objects can be added to downloaders with their add_post_processor() method. When the downloader has finished a successful download, it will take its internal chain of PostProcessors and sta...
unlicense
klavinslab/coral
coral/design/_gibson.py
1
9551
'''Gibson design module.''' import coral class LengthError(Exception): '''If primer would be longer than max length, throw this exception''' pass class TmError(Exception): '''If the assembly overlap would fall below the minimum Tm, throw this.''' pass def gibson_primers(dna1, dna2, overlap='mixed'...
mit
antong/ldaptor
ldaptor/protocols/ldap/ldifdelta.py
1
5248
from twisted.python.failure import Failure from twisted.internet import error from ldaptor.protocols.ldap import ldifprotocol from ldaptor import delta, entry WAIT_FOR_CHANGETYPE = 'WAIT_FOR_CHANGETYPE' WAIT_FOR_MOD_SPEC = 'WAIT_FOR_MOD_SPEC' IN_MOD_SPEC = 'IN_MOD_SPEC' IN_ADD_ENTRY = 'IN_ADD_ENTRY' IN_DELETE = 'IN_DE...
lgpl-2.1
willingc/oh-mainline
vendor/packages/twisted/twisted/conch/unix.py
20
15784
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.cred import portal from twisted.python import components, log from twisted.internet.error import ProcessExitedAlready from zope import interface from ssh import session, forwarding, filetransfer from ssh.filetransfer import FXF_READ, ...
agpl-3.0
bernardopires/django-tenant-schemas
tenant_schemas/routers.py
4
1564
from django.conf import settings from django.db.models.base import ModelBase from django.db.utils import load_backend class TenantSyncRouter(object): """ A router to control which applications will be synced, depending if we are syncing the shared apps or the tenant apps. """ def allow_migrate(se...
mit
SauloAislan/ironic
ironic/tests/unit/api/v1/test_portgroups.py
1
64108
# 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 # d...
apache-2.0
MalmoUniversity-DA366A/calvin-base
calvin/runtime/north/calvin_network.py
1
15984
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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
cmouse/buildbot
master/buildbot/test/util/gpo.py
3
4106
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
azurestandard/django
tests/regressiontests/admin_inlines/tests.py
9
27572
from __future__ import absolute_import, unicode_literals from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.contrib.admin.helpers import InlineAdminForm from django.contrib.auth.models import User, Permission from django.contrib.contenttypes.models import ContentType from django.test imp...
bsd-3-clause
ashutoshvt/psi4
psi4/header.py
7
3378
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
benoitsteiner/tensorflow
tensorflow/python/training/quantize_training_test.py
103
3828
# 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/site-packages/numpy/f2py/use_rules.py
51
3499
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" """ Build 'use others module data' mechanism for f2py2e. Unfinished. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given u...
gpl-3.0
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks
Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/solnlib/modular_input/modular_input.py
2
17340
# Copyright 2016 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 writing,...
isc