code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
from IPython import get_ipython
def custom_exc(shell, etype, evalue, tb, tb_offset=None):
import traceback
from p4.interactive.excepthook import invoke_editor
te = traceback.extract_tb(tb)
shell.showtraceback((etype, evalue, tb), tb_offset=tb_offset)
invoke_editor(te)
# Tell IPython to use it for... | blaiseli/p4-phylogenetics | p4/interactive/ipython.py | Python | gpl-2.0 | 397 |
#This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2005 Al Riddoch (See the file COPYING for details).
from atlas import *
from physics import *
from physics import Quaternion
from physics import Vector3D
import math
from random import *
import server
class Logging(server.T... | ytaben/cyphesis | rulesets/mason/world/tasks/Logging.py | Python | gpl-2.0 | 4,546 |
# Standard
import os
import sys
# Third Party
import numpy as np
from netCDF4 import Dataset
import f90nml as nml
#local
import field_helper as field
class Run(object):
"""
Run object which stores basic simulation information.
"""
def __init__(self, cdf_file):
"""
Initialize with Net... | ferdinandvwyk/gs2_analysis | run.py | Python | gpl-2.0 | 13,244 |
######################################################
#
# MouseLook.py Blender 2.55
#
# Tutorial for using MouseLook.py can be found at
#
# www.tutorialsforblender3d.com
#
# Released under the Creative Commons Attribution 3.0 Unported License.
#
# If you use this code, please include this information ... | TomBurnett/BlenderGameEngineJavabot | Scripts/Camera-Scripts/Mouselook.py | Python | gpl-2.0 | 5,772 |
'''
Created on Jun 19, 2016
@author: riccardo
'''
import os
import sys
import glob
from click.testing import CliRunner
from gfzreport.cli import main as gfzreport_main
from gfzreport.sphinxbuild import get_logfilename as get_build_logfilename
from gfzreport.templates.utils import get_logfilename as get_template_logfil... | rizac/gfzreport | tests/test_templates_network.py | Python | gpl-3.0 | 24,752 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2016 Vladimir Ermakov <vooon341@gmail.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 3 of t... | Entropy512/libsigrokdecode | decoders/rgb_led_ws281x/pd.py | Python | gpl-3.0 | 4,320 |
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | dmccue/ansible | lib/ansible/plugins/lookup/file.py | Python | gpl-3.0 | 2,091 |
#!/usr/bin/env python
import re,os,glob,sys,gc,ctypes,time
import numpy as np
try:import ROOT
except:print "Error!! pyroot didn't compile! please recompile your root!"
from array import array
#from pylab import plot,show,subplot
from bcmconst import *
from runinfo import getpklpath,runinfo,zload,zdump
try:from scipy.si... | zhupengjia/beampackage | beampackage/signalfilter.py | Python | gpl-3.0 | 32,657 |
import os
import re
import copy
import paramiko
import StringIO
import unicodedata
from paramiko import SSHException, BadHostKeyException
# CloudScape Libraries
from cloudscape.common import config
from cloudscape.common import logger
from cloudscape.common.scp import SCPClient
from cloudscape.common.utils import vali... | djtaylor/cloudscape-DEPRECATED | python/cloudscape/common/remote.py | Python | gpl-3.0 | 25,284 |
"""Correlation matrix View: show correlation matrix."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import numpy as np
import numpy.random as rdn
from galry import (Manager, DefaultPaint... | DavidTingley/ephys-processing-pipeline | installation/klustaviewa-0.3.0/klustaviewa/views/similaritymatrixview.py | Python | gpl-3.0 | 13,760 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_pitchtools_Octave_from_pitch_name_01():
assert pitchtools.Octave.from_pitch_name("cs'") == 4
assert pitchtools.Octave.from_pitch_name('cs') == 3
assert pitchtools.Octave.from_pitch_name('cs,') == 2 | mscuthbert/abjad | abjad/tools/pitchtools/test/test_pitchtools_Octave_from_pitch_name.py | Python | gpl-3.0 | 267 |
__author__ = 'drobisch'
from models import User, Action
from marshmallow import Schema, fields, post_load, post_dump
import datetime
class UserListForSupervisorsSerializer(Schema):
class Meta:
fields = ("id", "email", "firstName", "lastName", "phone", "role", "licenseMask", "keyMask", "lastBudgetUpdateDa... | mdrobisch/roseguarden | server/app/serializers.py | Python | gpl-3.0 | 5,422 |
async def fun():
"""Note coroutine function must be declared with async def."""
async for a in b:
if a > 5:
break
else:
continue
| pyta-uoft/pyta | examples/ending_locations/async_for.py | Python | gpl-3.0 | 169 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, scrub
from erpnext.stock.utils import get_incoming_rate
from erpnext.controllers.queries import get_match_cond
from ... | saurabh6790/erpnext | erpnext/accounts/report/gross_profit/gross_profit.py | Python | gpl-3.0 | 14,572 |
# -*- coding: utf-8
#------------------------------------------------------------------#
__author__ = "Xavier MARCELET <xavier@marcelet.com>"
#------------------------------------------------------------------#
import logging
from . import formatter, manager
from .tools import get, debug, info, warning, err... | psycofdj/xtdpy | xtd/core/logger/__init__.py | Python | gpl-3.0 | 419 |
from django.conf import settings
def i18n(request):
from django.utils import translation
def get_language_code():
base_code = translation.get_language()
sub_codes = base_code.split('-')
if len(sub_codes) > 1:
sub_codes[1] = sub_codes[1].upper()
return "_".join(su... | okfn/spendingstories | webapp/context_processors.py | Python | gpl-3.0 | 471 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "EuroDrivers.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| pilhoo/EuroDriversWebSite | old/manage.py | Python | gpl-3.0 | 254 |
# This file is part of FiberModes.
#
# FiberModes 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.
#
# FiberModes is distributed in the ... | cbrunet/fibermodes | fibermodes/slrc.py | Python | gpl-3.0 | 9,544 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2015 by the Free Software Foundation, Inc.
#
# This file is part of Postorius.
#
# Postorius 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... | khushboo9293/postorius | src/postorius/tests/test_auth_decorators.py | Python | gpl-3.0 | 8,684 |
import numpy as np
import matplotlib.pyplot as plt
from .utils import rotate_point, bin_pix2arcmin, get_bkg_exp
from .messages import ErrorMessages
from .image import Image
class Region(object):
def get_bin_vals(self, counts_img, bkg_img,
exp_img, pixels_in_bin, only_net_cts=False):
"""Calculate ... | gogrean/SurfFit | pyxel/prof.py | Python | gpl-3.0 | 13,240 |
// Program Name: chatterbot2
#pragma warning(disable: 4786)
include <iostream>
include <string>
include <vector>
include <ctime>
const int MAX_RESP = 3;
typedef std::vector<std::string> vstring;
vstring find_match(std::string input);
void copy(char *array[], vstring &v);
typedef struct {
char *input;
cha... | Surouxx/Excalibur | brain.py | Python | gpl-3.0 | 2,436 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Testing and testing related modules.
''' | vagonbar/GNUnetwork | gwn/utils/testing/__init__.py | Python | gpl-3.0 | 90 |
from django.http import Http404
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt
from velo.payment.models import Transaction
from velo.core.utils import log_message
__all__ = ['... | eeriks/velo.lv | velo/payment/views/return_views.py | Python | gpl-3.0 | 1,552 |
#!/usr/bin/env python
"""
Manage apertures, read aperture table, etc.
--------------------------------------------------------------------
This program is licensed under the GNU General Public License (GPL)
Version 3. See http://www.fsf.org for details of the license.
Rugged Circuits LLC
http://ruggedcircuits.com/g... | digistump/gerbmerge3 | gerbmerge/aptable.py | Python | gpl-3.0 | 11,947 |
"""
timer.py: Request timer statistical tool
Code adapted from Bottle documentation
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
from __future__... | karanisverma/feature_langpop | librarian/utils/timer.py | Python | gpl-3.0 | 1,356 |
"""
Copyright 2012 Jan Demter <jan@demter.de>
This file is part of LODStats.
LODStats 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.
LODS... | jandemter/lodstats | lodstats/stats/TypedSubjects.py | Python | gpl-3.0 | 1,348 |
# Written by Stephen Fromm <stephenf nero net>
# Copyright (C) 2016-2017 University of Oregon
#
# This file is part of netspryte
#
# netspryte 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 o... | sfromm/snmpryte | lib/netspryte/db/influx.py | Python | gpl-3.0 | 4,597 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Search through the subfolders of the current folder. For each subfolder found,
chdir() to it, then run all executable scripts ending in .SH in that folder.
Does not exhaustively search for subfolders of subfolders, or subfolders of
subfolders of subfolders, etc.; it onl... | patrick-brian-mooney/python-personal-library | run_subfolder_scripts.py | Python | gpl-3.0 | 1,560 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# relevant imports
import sys
import time
import espressopp
import mpi4py.MPI as MPI
import Tetracryst # Preparation of tetrahedral crystal and constuctions of bonds in tetrahedral liquid
from espressopp import Real3D, Int3D
from espressopp.tools import decomp
from espre... | capoe/espressopp.soap | examples/hadress/hadressDensityPressure/hadressDensity.py | Python | gpl-3.0 | 8,087 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from dateutil.relativedelta import relativedelta
from frappe.utils import cint,... | StrellaGroup/erpnext | erpnext/hr/doctype/payroll_entry/payroll_entry.py | Python | gpl-3.0 | 21,415 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.utils.nestedset import get_root_of
@frappe.whitelist()
def get_items(start, page_length, price_list, item_group, search... | emmuchira/kps_erp | erpnext/selling/page/point_of_sale/point_of_sale.py | Python | gpl-3.0 | 2,765 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('flooding_lib', '__first__'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
o... | lizardsystem/flooding | flooding_lib/tools/exporttool/migrations/0001_initial.py | Python | gpl-3.0 | 4,116 |
from sparkle.QtWrapper import QtCore, QtGui
from sparkle.acq.daq_tasks import get_ai_chans
class ChannelDialog(QtGui.QDialog):
def __init__(self, device_name):
super(ChannelDialog, self).__init__()
layout = QtGui.QGridLayout()
cnames = get_ai_chans(device_name)
layout.add... | portfors-lab/sparkle | sparkle/gui/dialogs/channel_dlg.py | Python | gpl-3.0 | 1,792 |
# 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 by applicable law or a... | harshk360/yantra_shiksha | hw8/cifar/enhanced/cifar10_eval.py | Python | gpl-3.0 | 5,485 |
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distri... | amazinger2013/OpenSesame | libqtopensesame/items/sketchpad.py | Python | gpl-3.0 | 1,289 |
import speech_recognition as sr
# Obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source, phrase_time_limit=5)
# Recognize using wit.ai
WIT_AI_KEY = "GP3LO2LIQ2Y4OSKOXZN6OAOONB55ZLN5"
try:
print("wit.ai thinks you said " + r.recognize_w... | amlannayak/apollo | src/mic_test.py | Python | gpl-3.0 | 521 |
# Copyright (c) 2007 The Regents of The University of Michigan
# 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 ... | vineodd/PIMSim | GEM5Simulation/gem5/src/python/m5/ticks.py | Python | gpl-3.0 | 3,221 |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | XeCycle/indico | indico/core/index/base.py | Python | gpl-3.0 | 7,870 |
# I Robot? - a dancing robot game for pyweek
#
# Copyright: 2008 Hugo Ruscitti
# License: GPL 3
# Web: http://www.losersjuegos.com.ar
'''Simple data loader module.
Loads data files from the "data" directory shipped with a game.
Enhancing this to handle caching etc. is left as an exercise for the reader.
'''
import ... | alcemirfernandes/irobotgame | lib/data.py | Python | gpl-3.0 | 788 |
import mock
from tools.wpt import revlist
def test_calculate_cutoff_date():
assert revlist.calculate_cutoff_date(3601, 3600, 0) == 3600
assert revlist.calculate_cutoff_date(3600, 3600, 0) == 3600
assert revlist.calculate_cutoff_date(3599, 3600, 0) == 0
assert revlist.calculate_cutoff_date(3600, 3600, ... | DominoTree/servo | tests/wpt/web-platform-tests/tools/wpt/tests/test_revlist.py | Python | mpl-2.0 | 6,239 |
# encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __... | klahnakoski/esReplicate | pyLibrary/queries/es09/expressions.py | Python | mpl-2.0 | 26,115 |
"""Load test fixtures from a specification."""
import logging
from django.apps import apps
from django.contrib.auth.hashers import make_password
logger = logging.getLogger("kuma.scraper")
class FixtureLoader(object):
"""Load fixtures into the current database."""
# Needed information about the supported ... | Elchi3/kuma | kuma/scrape/fixture.py | Python | mpl-2.0 | 10,807 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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
# (at your... | willprice/weboob | weboob/applications/radioob/radioob.py | Python | agpl-3.0 | 15,978 |
import time
import gevent
import collections
from datetime import datetime
from sqlalchemy import asc, desc, bindparam
from inbox.api.kellogs import APIEncoder, encode
from inbox.models import Transaction, Message, Thread, Account, Namespace
from inbox.models.session import session_scope
from inbox.models.util import ... | nylas/sync-engine | inbox/transactions/delta_sync.py | Python | agpl-3.0 | 10,974 |
#!/usr/bin/env python3
#
# This script requires the MISP retention taxonomy is installed and enabled
# See https://github.com/MISP/misp-taxonomies/tree/master/retention/retention
from pymisp import ExpandedPyMISP, MISPEvent
from datetime import datetime
from dateutil.relativedelta import relativedelta
import re
from k... | MISP/MISP | tools/misp_retention.py | Python | agpl-3.0 | 3,874 |
import os
import string
from pubsublogger import publisher
import calendar
from datetime import date
from dateutil.rrule import rrule, DAILY
import csv
def listdirectory(path):
"""Path Traversing Function.
:param path: -- The absolute pathname to a directory.
This function is returning all the absolut... | xujun10110/AIL-framework | bin/packages/lib_words.py | Python | agpl-3.0 | 3,335 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('election', '0005_election_description'),
]
operations = [
migrations.CreateModel(
name='Question',
f... | joanma100/mieli | election/migrations/0006_auto_20150322_2156.py | Python | agpl-3.0 | 883 |
# The contents of this file are subject to the Mozilla Public License
# (MPL) Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# b... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/lepl/stream/core.py | Python | agpl-3.0 | 12,016 |
# -*- coding: utf-8 -*-
{
'name' : 'Live Chat',
'version': '1.0',
'sequence': 170,
'summary': 'Live Chat with Visitors/Customers',
'category': 'Website',
'complexity': 'easy',
'website': 'https://www.odoo.com/page/live-chat',
'description':
"""
Live Chat Support
=================... | maxive/erp | addons/im_livechat/__manifest__.py | Python | agpl-3.0 | 1,269 |
from AccessControl import ClassSecurityInfo
from archetypes.querywidget.views import WidgetTraverse as _WidgetTraverse
from archetypes.querywidget.widget import QueryWidget as _QueryWidget
from bika.lims.querystring.querybuilder import QueryBuilder
from bika.lims.querystring.querybuilder import RegistryConfiguration
fr... | anneline/Bika-LIMS | bika/lims/browser/widgets/querywidget.py | Python | agpl-3.0 | 5,599 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Libuv(AutotoolsPackage):
"""Multi-platform library with a focus on asynchronous IO"""
homepage = "http://libu... | iulian787/spack | var/spack/repos/builtin/packages/libuv/package.py | Python | lgpl-2.1 | 1,625 |
"""Test D-Bus private tube support"""
import dbus
from dbus.connection import Connection
from dbus.lowlevel import SignalMessage
from servicetest import call_async, EventPattern, unwrap, watch_tube_signals,\
assertContains, assertEquals
from gabbletest import sync_stream, make_presence
import constants as cs
impo... | Ziemin/telepathy-gabble | tests/twisted/tubes/offer-private-dbus-tube.py | Python | lgpl-2.1 | 8,556 |
#!/usr/bin/env python
from nose.tools import *
from utilities import execution_path, run_all
from utilities import side_by_side_image
import os, mapnik
import re
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))... | TemplateVoid/mapnik | tests/python_tests/image_filters_test.py | Python | lgpl-2.1 | 2,704 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from libavg import avg, gesture, app
import gestures
RESOLUTION = avg.Point2D(800, 600)
nodeList = []
nodesEnabled = True
def abortAll():
for node in nodeList:
node.recognizer.abort()
def switchNodesEnabled():
global nodesEnabled
nodesEnabled = not... | hoodie/libavg | src/samples/abort_gestures.py | Python | lgpl-2.1 | 3,317 |
import sys
def setup(core, object):
object.setStfFilename('static_item_n')
object.setStfName('item_entertainer_boots_02_01')
object.setDetailFilename('static_item_d')
object.setDetailName('item_entertainer_boots_02_01')
object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3)
object.setStringAttr... | ProjectSWGCore/NGECore2 | scripts/object/tangible/wearables/boots/item_entertainer_boots_02_01.py | Python | lgpl-3.0 | 366 |
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2016 Rooms For (Hong Kong) Limited T/A OSCG
# <https://www.odoo-asia.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
# publishe... | yostashiro/awo-custom | purchase_line_split/__openerp__.py | Python | lgpl-3.0 | 1,484 |
import sys, os
from pmx import *
from pmx.ffparser import RTPParser, NBParser
from pmx.rotamer import _aa_chi
from pmx.parser import kickOutComments, readSection, parseList
import tempfile
standard_pair_list = [
('N','N'),
('H','H'),
('CA','CA'),
('C','C'),
('O','O'),
('HA','HA'),
('CB','CB... | Alwnikrotikz/pmx | scripts/cmpaa_new.py | Python | lgpl-3.0 | 42,934 |
import requests
import json
import restful_webapi
import os
# This example shows how to use the Requests library with RESTful API
# This web service stores arbitrary JSON data under integer keys
# We can use GET/POST/PUT/DELETE HTTP methods to modify the data
# Run a local server that we can use
restful_webapi.run_se... | sudikrt/costproML | staticDataGSir/restful.py | Python | apache-2.0 | 1,107 |
# 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... | openstack/sahara-tests | sahara_tempest_plugin/tests/cli/cluster_templates.py | Python | apache-2.0 | 2,305 |
"""LCM package __init__.py file
This file automatically generated by lcm-gen.
DO NOT MODIFY BY HAND!!!!
"""
from .ax_control_t import ax_control_t
from .eng_control_t import eng_control_t
from .eng_status_t import eng_status_t
from .mode_control_t import mode_control_t
from .net_status_t import net_status_t
from .cam_... | charleswongzx/sutd-evos | lcm_typedef/exlcm/__init__.py | Python | apache-2.0 | 501 |
# =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | Xuanwo/qingcloud-sdk-python | qingcloud/iaas/router_static.py | Python | apache-2.0 | 12,301 |
import unittest
class Test0039(unittest.TestCase):
def test_problem(self):
m, num = 0, 0
for p in range(12, 1001):
total = 0
for a in range(1, p / 3 + 1):
for b in range(a + 1, (p - a) / 2 + 1):
c = p - a - b
if a * a ... | mccxj/leetcode | projecteuler/p0039_test.py | Python | apache-2.0 | 483 |
"""Support for Plum Lightpad lights."""
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, Light)
from homeassistant.components.plum_lightpad import PLUM_DATA
import homeassistant.util.color as color_util
DEPENDENCIES = ['plum_lightpad']
async def asyn... | nugget/home-assistant | homeassistant/components/plum_lightpad/light.py | Python | apache-2.0 | 5,479 |
# Copyright 2014 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... | rajalokan/glance | glance/tests/unit/common/scripts/test_scripts_utils.py | Python | apache-2.0 | 5,341 |
# Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | shakamunyi/neutron-dvr | neutron/agent/securitygroups_rpc.py | Python | apache-2.0 | 12,495 |
from __future__ import absolute_import
# System modules
import argparse
import sys
import os
import textwrap
# LLDB modules
from . import configuration
def create_parser():
parser = argparse.ArgumentParser(
description='description',
prefix_chars='+-',
add_help=False)
group = None
... | google/llvm-propeller | lldb/packages/Python/lldbsuite/test/dotest_args.py | Python | apache-2.0 | 11,181 |
# Copyright 2015 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... | alistairlow/tensorflow | tensorflow/python/framework/ops.py | Python | apache-2.0 | 189,521 |
# Copyright 2015 Internap.
#
# 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, so... | godp1301/netman | tests/global_reactor.py | Python | apache-2.0 | 2,119 |
from django.db import models
from django.contrib import auth
from django.db.models.signals import post_save
class Priority(object):
Aggregate_Admin = 12000
Campus_Admin = 10000
Department_Admin = 8000
Building_Admin = 6000
Group_Admin = 4000
Strict_User... | dana-i2cat/felix | optin_manager/src/python/openflow/optin_manager/users/models.py | Python | apache-2.0 | 1,961 |
# ===============================================================================
# Copyright 2018 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/licenses/LICE... | USGSDenverPychron/pychron | pychron/dvc/cache.py | Python | apache-2.0 | 2,303 |
"""The tests for Z-Wave JS device triggers."""
from unittest.mock import patch
import pytest
import voluptuous_serialize
from zwave_js_server.const import CommandClass
from zwave_js_server.event import Event
from zwave_js_server.model.node import Node
from homeassistant.components import automation
from homeassistant... | mezz64/home-assistant | tests/components/zwave_js/test_device_trigger.py | Python | apache-2.0 | 48,655 |
# Copyright (c) 2015 Red Hat 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... | jacknjzhou/neutron | neutron/services/qos/qos_plugin.py | Python | apache-2.0 | 7,356 |
import os, json, datetime
from ContinuousRegistration.Source.make_registration_scripts import parser
from ContinuousRegistration.Source.util import logging, load_submissions, write_json
from ContinuousRegistration.Source.datasets import load_datasets
def run(parameters):
submissions = load_submissions(parameters)
... | kaspermarstal/SuperElastix | ContinuousRegistration/Source/make_evaluation.py | Python | apache-2.0 | 4,367 |
# -*- 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... | googleads/google-ads-python | google/ads/googleads/v9/services/services/account_budget_service/transports/__init__.py | Python | apache-2.0 | 1,063 |
import unittest, time, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_hosts, h2o_kmeans
import h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
global lo... | janezhango/BigDataMachineLearning | py/testdir_multi_jvm_fvec/test_KMeans_covtype20x_fvec.py | Python | apache-2.0 | 2,882 |
# Copyright (c) 2013 Mirantis 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 writ... | tellesnobrega/sahara | sahara/db/sqlalchemy/models.py | Python | apache-2.0 | 20,130 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 MORITA Kazutaka.
# 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.or... | xushiwei/nova | nova/db/sqlalchemy/migrate_repo/versions/019_add_volume_snapshot_support.py | Python | apache-2.0 | 2,896 |
from django.conf.urls import patterns, url
from orientation import views
urlpatterns = patterns('',
url(r'^$', views.search, name='search'),
url(r'^majors/$', views.majors, name='majors'),
)
| gravitylow/OpenCourse | orientation/urls.py | Python | apache-2.0 | 201 |
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Andrew Kerr. All rights reserved.
# Copyright (c) 2015 Tom Barron. All rights reserved.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); y... | tlakshman26/cinder-https-changes | cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_base.py | Python | apache-2.0 | 36,142 |
from pyscf.pbc.gto import Cell
from pyscf.pbc.scf import RHF
from pyscf.pbc.tdscf import TDHF
from pyscf.pbc.tdscf.rhf_slow import PhysERI, PhysERI4, PhysERI8, TDRHF
from pyscf.tdscf.common_slow import eig
from test_common import retrieve_m, retrieve_m_hf, assert_vectors_close
import unittest
from numpy import testin... | gkc1000/pyscf | pyscf/pbc/tdscf/test/test_rhf_slow.py | Python | apache-2.0 | 3,697 |
#!/usr/bin/python
import sys, argparse, StringIO, re, gzip
from multiprocessing import Pool, cpu_count, Queue
from Bio.Format.BGZF import is_bgzf, reader as BGZF_reader, get_block_bounds
from Bio.Format.Fastq import FastqEntry
# Create an index for bgzf zipped fastq files.
# Pre: A fastq file that has been compress... | jason-weirather/py-seq-tools | seqtools/cli/legacy/fastq_bgzf_index.py | Python | apache-2.0 | 6,010 |
import functools
import itertools
import logging
import re
import urlparse
import warnings
import bson
from django.db.models import Q
from dirtyfields import DirtyFieldsMixin
from django.apps import apps
from django.contrib.contenttypes.fields import GenericRelation
from django.core.paginator import Paginator
from dja... | leb2dg/osf.io | osf/models/node.py | Python | apache-2.0 | 117,415 |
'''
This module holds the constants used for specifying the states of the debugger.
'''
from __future__ import nested_scopes
import platform
import sys # Note: the sys import must be here anyways (others depend on it)
STATE_RUN = 1
STATE_SUSPEND = 2
PYTHON_SUSPEND = 1
DJANGO_SUSPEND = 2
JINJA2_SUSPEND = 3
JUPYTER_SU... | google/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_constants.py | Python | apache-2.0 | 15,389 |
# 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... | stackforge/solum | solum/api/controllers/v1/component.py | Python | apache-2.0 | 4,074 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | dhermes/google-cloud-python | vision/google/cloud/vision_v1/__init__.py | Python | apache-2.0 | 1,393 |
#!/usr/bin/python
import argparse, os, sys, re, subprocess
from random import randint
from GenePredBasics import line_to_entry as genepred_line_to_entry
from SequenceBasics import read_fasta_into_hash
from shutil import rmtree
import BedToolsBasics
def main():
parser = argparse.ArgumentParser(description="Analyze na... | jason-weirather/py-seq-tools | seqtools/cli/legacy/background_and_nascent_expression.py | Python | apache-2.0 | 9,310 |
# 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 u... | ZihengJiang/mxnet | python/mxnet/gluon/rnn/rnn_cell.py | Python | apache-2.0 | 33,469 |
"""Support for Neato Connected Vacuums switches."""
import logging
from datetime import timedelta
import requests
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.components.neato import NEATO_ROBOTS, NEATO_LOGIN
_LOGGER = logging.getLogger(__... | HydrelioxGitHub/home-assistant | homeassistant/components/neato/switch.py | Python | apache-2.0 | 3,290 |
# Copyright 2013 dotCloud 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 t... | cglewis/wharf | patch/auth.py | Python | apache-2.0 | 4,303 |
from eventlet.green import os
from hashlib import md5
import socket
import struct
from sys import exit
import re
import cPickle as pickle
from time import sleep
from argparse import ArgumentParser
from eventlet import GreenPool, listen
from nvram_parser import read_env
def errdump(zvm_errcode, nexe_validity, nexe_err... | zerovm/zerocloud | test/unit/zerovm_mock.py | Python | apache-2.0 | 10,194 |
# 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... | ghchinoy/tensorflow | tensorflow/python/tpu/ops/tpu_ops.py | Python | apache-2.0 | 18,915 |
# use priority queue to implement stack and queue
import heapq
class stack:
data = []
highestPriority = 0
lowestPriority = 0
def push(self, e):
self.highestPriority -= 1 # smaller value means priority is higher
heapq.heappush(self.data, (self.highestPriority, e))
def pop(self):... | yubinbai/python_practice | priorityqueue.py | Python | apache-2.0 | 1,718 |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.generator... | hkernbach/arangodb | 3rdParty/V8/v5.7.492.77/tools/gyp/pylib/gyp/generator/msvs.py | Python | apache-2.0 | 133,929 |
from h2o.estimators.xgboost import *
from tests import pyunit_utils
def xgboost_insurance_poisson_small():
assert H2OXGBoostEstimator.available()
# Import big dataset to ensure run across multiple nodes
training_frame = h2o.import_file(pyunit_utils.locate("smalldata/testng/insurance_train1.csv"))
tes... | h2oai/h2o-3 | h2o-py/tests/testdir_algos/xgboost/pyunit_insurance_poisson_small.py | Python | apache-2.0 | 2,021 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2014 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/licenses/LICENSE-2.0
#
# Unl... | halober/ovirt-engine | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/asynctasks.py | Python | apache-2.0 | 14,855 |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache ... | apache/allura | scripts/wiki-copy.py | Python | apache-2.0 | 5,643 |
from .settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'sharedgoals',
'USER': 'admin',
'PASSWORD': 'blah',
'HOST': 'localhost',
'PORT': '',
}
}
# SECURITY WARNING: keep the secret key used in production sec... | mnieber/shared-goal | django/main/settings_prod.py | Python | apache-2.0 | 429 |
import struct
import time
from .types import t_string, t_list, t_set, t_zset, t_hash
from .errors import *
class Coloradoes(object):
STRUCT_KEY = '!ic'
STRUCT_KEY_VALUE = '!icd'
STRUCT_ID = '!i'
def __init__(self, storage=None):
if storage is None:
raise ValueError('A storage is ... | pombredanne/coloradoes.py | src/coloradoes/coloradoes.py | Python | bsd-2-clause | 3,539 |
from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
import mock
from bazaar.listings.processor import OrderProcessor
from .. import factories as f
class TestProcessorGetOrder(TestCase):
def setUp(self):
self.order = f.OrderFactory()
def t... | meghabhoj/NEWBAZAAR | tests/listings/test_processor.py | Python | bsd-2-clause | 631 |
from __future__ import print_function, absolute_import
from . import context, values, types, _utils
class Module(object):
def __init__(self, name='', context=context.global_context):
self.context = context
self.name = name # name is for debugging/informational
self.globals = {}
s... | m-labs/llvmlite | llvmlite/ir/module.py | Python | bsd-2-clause | 4,930 |