code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/python
#
# \file 1_export.py
# \brief Export displace
# \date 2009-03-10-21-45-GMT
# \author Jan Boon (Kaetemi)
# Python port of game data build pipeline.
# Export displace
#
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2010 Winch Gate Property Limited
#
# This program is ... | osgcc/ryzom | nel/tools/build_gamedata/processes/displace/1_export.py | Python | agpl-3.0 | 1,885 |
#-*- coding: utf-8 -*-
#
# Blah
'''opencv wrapper'''
__all__ = ('ALoaderOpenCV', 'ImageOpenCV', 'AsyncImageOpenCV')
from kivy.logger import Logger
from kivy.core.image import ImageLoader
from kivy.compat import PY2
from os import write, close, O_RDWR, O_CREAT
from os import open as openfile
import mimetypes
fr... | insiderr/insiderr-app | app/modules/image/img_opencv.py | Python | gpl-3.0 | 18,899 |
import json
import os
import requests
import webbrowser
from get_twitter_api_params import get_rate_limit_rules, save_api_dict
from lxml import html
from twython import Twython
class TweetCatcher():
def __init__(self):
self.app_creds = Twython(APP_KEY, APP_SECRET).get_authentication_tokens()
self... | withtwoemms/tweetcatcher | tweetcatcher.py | Python | mit | 2,926 |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | luzheqi1987/nova-annotation | nova/tests/unit/api/openstack/compute/plugins/v3/test_migrations.py | Python | apache-2.0 | 3,967 |
# Copyright 2019 Zadara Storage, Inc.
# Originally authored by Jeremy Brown - https://github.com/jwbrown77
#
# 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... | zadarastorage/zadarapy | zadarapy/vpsa/vpsa_users.py | Python | apache-2.0 | 15,007 |
print(bytearray(2**65 - (2**65 - 1)))
| martinribelotta/micropython | tests/basics/bytearray_longint.py | Python | mit | 38 |
# This file is part of beets.
# Copyright 2011, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | MusikPolice/beets | test/test_ui.py | Python | mit | 25,895 |
import sys
import warnings
from django.db.models.fields import FieldDoesNotExist
from django.utils.text import capfirst
from django.utils.encoding import smart_text
try:
from django.db.models.options import get_verbose_name
except ImportError:
from django.utils.text import camel_case_to_spaces as get_verbose_... | iandd0824/ri-app | web/django_mongoengine/forms/document_options.py | Python | apache-2.0 | 7,439 |
#init for the project
import shapely
import geopandas as gpd
import pandas as pd
import numpy as np
import matplotlib
import pysal
from scipy import ndimage
from urllib2 import Request, urlopen, URLError
from datetime import time
from datetime import date
import datetime
import time
import sys
import os
import matplot... | gengho/Car2know | Car2know/__init__.py | Python | mit | 358 |
""" Default class inherited by all test classes that provides basic behaviour
to write a test class easily """
import sublime
import inspect
import re
import sys
if sys.version_info < (3, 0):
from tableofcomments import TableOfComments
else:
from ..tableofcomments import TableOfComments
class TestCase():
... | kizza/Table-of-comments | tests/testcase.py | Python | mit | 4,447 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Product serial module for OpenERP
# Copyright (C) 2010-2011 Anevia. All Rights Reserved
# Copyright (C) 2013 Akretion
# @author: Sebastien Beau <sebastien.beau@akretion.com>
# @author: Alexis de L... | numerigraphe/stock-logistics-workflow | __unported__/product_serial/company.py | Python | agpl-3.0 | 1,719 |
#!/usr/bin/env python
# encoding: utf-8
import os
import subprocess
import stat
import tempfile
from UltiSnips.compatibility import as_unicode
from UltiSnips.text_objects._base import NoneditableTextObject
class ShellCode(NoneditableTextObject):
def __init__(self, parent, token):
NoneditableTextObject.__... | zenshade/vim_config | bundle/UltiSnips-2.1/plugin/UltiSnips/text_objects/_shell_code.py | Python | mit | 1,117 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test txindex generation and fetching
#
import time
from test_framework.test_framework import Bitcoin... | terracoin/terracoin | qa/rpc-tests/txindex.py | Python | mit | 2,703 |
# Задача 6. Вариант 10.
# Создайте игру, в которой компьютер загадывает название одной из трех стран, входящих в военно-политический блок "Тройственный союз", а игрок должен его угадать.
# Donkor A.H.
# 14.04.2016
import random
x=random.choice(['Германия','Австро-Венгрия','Италия'])
y=input('Сыграем в игру. Я загад... | Mariaanisimova/pythonintask | PMIa/2015/Donkor_A_H/task_6_10.py | Python | apache-2.0 | 1,052 |
import sys
from io import StringIO
from unittest.mock import patch
import tables.scripts.ptrepack as ptrepack
import tables.scripts.ptdump as ptdump
import tables.scripts.pttree as pttree
from tables.tests import common
class ptrepackTestCase(common.PyTablesTestCase):
"""Test ptrepack"""
@patch.object(ptre... | PyTables/PyTables | tables/tests/test_utils.py | Python | bsd-3-clause | 2,960 |
from .. import BaseForm
from wtforms import StringField, TextAreaField
from wtforms.validators import DataRequired
class CategoryForm(BaseForm):
name = StringField('name',
validators=[
DataRequired()
])
description = TextAreaField('desc... | friendly-of-python/flask-online-store | flask_online_store/forms/admin/category.py | Python | mit | 461 |
# -*- coding: utf-8 -*-
"""Utility stuff for tests."""
__revision__ = "$Rev: 492 $"
__date__ = "$Date: 2007-07-06 21:38:45 -0400 (Fri, 06 Jul 2007) $"
__author__ = "Ryan Tomayko (rtomayko@gmail.com)"
__copyright__ = "Copyright 2004-2005, Ryan Tomayko"
__license__ = "MIT <http://www.opensource.org/licenses/mit-license... | gandrewstone/yadog | kid/test/util.py | Python | gpl-3.0 | 5,500 |
import pickle
from functools import partial
from typing import Tuple
import numpy as np
try:
import torch
import torch.nn as nn
except ImportError:
raise ImportError("pytorch is not installed. Please installed version it by running pip install torch torchvision")
try:
from pybnn.util.layers import Ap... | EmuKit/emukit | emukit/examples/profet/meta_benchmarks/meta_forrester.py | Python | apache-2.0 | 2,792 |
##
# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
# Copyright (c) 2007 Twisted Matrix Laboratories.
#
# 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... | trevor/calendarserver | txdav/xml/base.py | Python | apache-2.0 | 25,071 |
import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="reversescale", parent_name="treemap.marker", **kwargs
):
super(ReversescaleValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/treemap/marker/_reversescale.py | Python | mit | 433 |
try:
from ._speedups import pack_command
except ImportError:
from ._backup import pack_command
| simonz05/pack-command | pack_command/__init__.py | Python | mit | 103 |
# -*- coding: utf-8 -*-
"""
fudcon.ui.backend
------
fudcon ui backend application package
"""
| echevemaster/fudcon | fudcon/ui/backend/__init__.py | Python | mit | 107 |
#!/usr/bin/env python
import rospy
from task_executor.testing import TestEntry
def check_task_descriptions(task_descriptions):
print 'remaining task descriptions: ', task_descriptions
def check_time_diffs(time_diffs):
print 'time diffs: ', time_diffs
if __name__ == '__main__':
executor = TestEntry(... | bfalacerda/strands_executive | task_executor/scripts/use_all_test_script.py | Python | mit | 667 |
#!/usr/bin/env python
from cloudmon_dash import app
if __name__ == '__main__':
app.run(host='0.0.0.0')
| dgivens/cloudmon-dash | dash.py | Python | apache-2.0 | 109 |
# Copyright (c) 2008,2010,2015,2016,2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Setup script for installing MetPy."""
import sys
from setuptools import setup
if sys.version_info[0] < 3:
error = """
MetPy v0.12 and greater requir... | ahaberlie/MetPy | setup.py | Python | bsd-3-clause | 713 |
#Author Yukun Chen
#email: cykustc@gmail.com
#Date: Sept 04 2015
import getopt
import argparse
import sys
import re
from collections import defaultdict
def displaymatch(match):
if match is None:
return None
return '<Match: %r, groups=%r>' % (match.group(), match.groups())
def bib2rest(input_bibfile... | cykustcc/bib2reSTcitation | bib2reSTcitation.py | Python | mit | 2,664 |
#/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Common objects shared by all _ps* modules."""
from __future__ import division
import errno
import os
import socket
import stat
im... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/psutil/_common.py | Python | agpl-3.0 | 5,770 |
from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile
import json
class TestChangingPartitions(DBTIntegrationTest):
@property
def schema(self):
return "bigquery_test_022"
@property
def models(self):
return "partition-models"
def run_changes(self, before, af... | fishtown-analytics/dbt | test/integration/022_bigquery_test/test_bigquery_changing_partitions.py | Python | apache-2.0 | 3,058 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import subprocess
import sys
from test_util import TestFailedError, run_command, \
serializeIncrParseMarkupFile
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
... | jopamer/swift | utils/incrparse/incr_transfer_tree.py | Python | apache-2.0 | 3,699 |
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
from __future__ import absolute_import
from h5py im... | ryfeus/lambda-packs | HDF4_H5_NETCDF/source2.7/h5py/tests/old/test_objects.py | Python | mit | 953 |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 29 14:29:21 2016
A script for drawing the Phase Plane plot for the
glucose/oxygen levels (for the 6 selected EFMs)
@author: noore
"""
import os
import pandas as pd
import numpy as np
from matplotlib import rcParams, cm, pyplot, colors, colorbar
import zipfile
import defi... | liebermeister/flux-enzyme-cost-minimization | scripts/monod_surface.py | Python | gpl-2.0 | 36,182 |
from datetime import datetime
import time
import pytest
from scheduler_service.models import Task, URLDetail
from tests.const import task_url
async def test_task(user):
await Task.objects.create(name="test",
start_time=datetime.now(),
user_id=user.id,
... | moonlitlaputa/scheduler-service | tests/test_task.py | Python | bsd-2-clause | 942 |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
# Create your models here.
from django.contrib import admin
SUBMITTER = (('parent', 'parent'),
('faculty','faculty'),
('expert', 'expert'),
... | pankajlal/prabandh | obspost/models.py | Python | apache-2.0 | 1,110 |
def print_board(board):
print "The board look like this: \n"
for i in range(3):
print " ",
for j in range(3):
if board[i*3+j] == 1:
print 'X',
elif board[i*3+j] == 0:
print 'O',
elif board[i*3+j] != -1:
print... | motealle/python | tictactoe-web.py | Python | gpl-2.0 | 2,703 |
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from ..models import Message, UserFollowingRelationship
class ServicesTestCase(TestCase):
def setUp(self):
self.username = 'test'
self.password = '123'
self.email = 'tester@abv.bg'
... | vdtodorov93/Hirundo | hirundo/website/tests/tests.py | Python | mit | 5,836 |
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
import time
from ..base.addon import BaseAddon, expose
try:
import caffeine
except ImportError:
pass
class Kernel32:
ES_AWAYMODE_REQUIRED = 0x00000040
ES_CONTINUOUS = 0x80000000
ES_DISPLAY_REQUIRED = 0x00000002
ES_SYSTEM_REQUIRE... | vuolter/pyload | src/pyload/plugins/addons/AntiStandby.py | Python | agpl-3.0 | 4,619 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Gestión de parámetros de configuración - xbmc
#------------------------------------------------------------
# tvalacarta
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#--------------------------------------------------------... | conejoninja/pelisalacarta | python/version-xbmc-09-plugin/core/config.py | Python | gpl-3.0 | 5,454 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py | Python | mit | 19,888 |
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals, print_function, absolute_import
import math
import copy
from pint import UnitRegistry
from pint.unit import UnitsContainer
from pint.util import ParserHelper
from pint.compat import np, long_type
from pint.errors import UndefinedUnitError, D... | fernandog/Medusa | ext/pint/testsuite/test_issues.py | Python | gpl-3.0 | 19,906 |
# -*- coding: utf-8 -*-
# wasp_backup/file_archiver.py
#
# Copyright (C) 2017 the wasp-backup authors and contributors
# <see AUTHORS file>
#
# This file is part of wasp-backup.
#
# wasp-backup is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | a1ezzz/wasp-backup | wasp_backup/file_archiver.py | Python | lgpl-3.0 | 2,627 |
# -*- coding: utf-8 -*-
try:
from urllib import urlencode
from urlparse import urlparse, urljoin
from urllib import unquote
except ImportError:
from urllib.parse import urlencode # nopyflakes
from urllib.parse import urlparse # nopyflakes
from urllib.parse import unquote # nopyflakes
from... | SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/cms/utils/compat/urls.py | Python | mit | 363 |
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2015 Andrew Colin Kissa <andrew@topdog.za.net>
#
# 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 S... | akissa/baruwa2 | baruwa/lib/mq/commands.py | Python | gpl-3.0 | 5,582 |
"""Support for the EZcontrol XS1 gateway."""
import asyncio
import logging
import voluptuous as vol
import xs1_api_client
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_SSL,
CONF_USERNAME,
)
from homeassistant.helpers import discovery
import homeassistant.helpers.confi... | tchellomello/home-assistant | homeassistant/components/xs1/__init__.py | Python | apache-2.0 | 2,712 |
"""
A collection of functions for evaluating TimeSeries.
"""
# pylint: disable=E1101
import numpy as np
def f_score(test, truth, threshold=np.float32(0.0)):
"""
Calculate the F1 score of the test timeseries against the ground truth,
with indicators calculated according to the given threshold.
We as... | CMPUT-466-551-ML-Project/NILM-Project | nilm/evaluation.py | Python | gpl-2.0 | 1,433 |
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from .commands import COMMANDS
from .excludes import add_exclude_patters, get_exclude_patt... | shoopio/shoop | shuup_setup_utils/__init__.py | Python | agpl-3.0 | 760 |
"""Config flow for local_ip."""
from __future__ import annotations
from typing import Any
from homeassistant.config_entries import ConfigFlow
from homeassistant.data_entry_flow import FlowResult
from .const import DOMAIN
class SimpleConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for local_ip.""... | jawilson/home-assistant | homeassistant/components/local_ip/config_flow.py | Python | apache-2.0 | 757 |
import re
from django.core.exceptions import ValidationError
def colorValidator(value):
"""
Validates if the given value is a string representing an hexadecimal color
value (starts with a #, then RGB composants in hex).
>>> colorValidator('#0a1b2C')
>>> colorValidator('#AAAAAA')
>>> colorVa... | gordon-/yolo | learning/validators.py | Python | agpl-3.0 | 555 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | mcltn/ansible | lib/ansible/template/__init__.py | Python | gpl-3.0 | 15,952 |
# coding=utf-8
# Copyright 2022 RigL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | google-research/rigl | rigl/experimental/jax/fixed_param_test.py | Python | apache-2.0 | 1,424 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Hybrid LFP scheme example script, applying the methodology with the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (3): 785-806.
doi: ... | espenhgn/hybridLFPy | examples/Hagen_et_al_2016_cercor/cellsim16pops_modified_ac_exc.py | Python | gpl-3.0 | 6,661 |
#!/usr/bin/env python3
import os
import sys
import uuid
import json
import argparse
import redis
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
from worker_conf import REDIS_CONF
rs = redis.Redis(**REDIS_CONF)
def upload_submission(data, content_dirname, debug=False):
data['u... | algochecker/algochecker-engine | contrib/submit.py | Python | mit | 1,582 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2018-09-05
git sha ... | lcoandrade/DsgTools | gui/CustomWidgets/DatabaseConversionWidgets/SupportedDrivers/geopackageWidget.py | Python | gpl-2.0 | 4,233 |
from future import standard_library
standard_library.install_aliases()
from builtins import range
from tkinter import *
class TabFrames(Frame):
def __call__(self, N): #return frame widget of screen number N
return self.pageFramesL[N]
def setSelectCallback(self, N, callback): #set selecting callb... | sonofeft/XYmath | xymath/gui/tabframes.py | Python | gpl-3.0 | 6,103 |
__all__ = [
'null', 'Invalid', 'FieldsetErrors',
'Field', 'FieldFactory', 'Fieldset',
'field', 'fieldpreview', 'get_field_factory', 'get_field_preview',
'Term', 'Vocabulary',
'All','Function','Regex','Email','Range', 'Length','OneOf',
'CompositeField', 'CompositeError',
'InputField', 'Op... | djedproject/djed.form | djed/form/__init__.py | Python | isc | 3,170 |
# Copyright 2017 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... | cshallue/models | research/rebar/config.py | Python | apache-2.0 | 976 |
# Copyright 2014 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 writing... | nebril/fuel-web | fuel_agent/fuel_agent/objects/__init__.py | Python | apache-2.0 | 1,819 |
from crankshaft.regression.gwr import *
from crankshaft.regression.glm import *
from crankshaft.regression.gwr_cs import *
| CartoDB/crankshaft | src/py/crankshaft/crankshaft/regression/__init__.py | Python | bsd-3-clause | 123 |
# $HeadURL$
__RCSID__ = "$Id$"
import types
from DIRAC import S_OK, S_ERROR
from DIRAC.ConfigurationSystem.Client.Config import gConfig
from DIRAC.ConfigurationSystem.Client.Helpers.CSGlobals import getVO
gBaseSecuritySection = "/Registry"
def getUsernameForDN( dn, usersList = False ):
if not usersList:
retVal... | avedaee/DIRAC | ConfigurationSystem/Client/Helpers/Registry.py | Python | gpl-3.0 | 7,183 |
# Copyright (c) 2014 INFN - "Istituto Nazionale di Fisica Nucleare" - Italy
# 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/LIC... | opencityplatform/os-federation-addons | src/openstack_auth_fedext/__init__.py | Python | apache-2.0 | 746 |
from django.db import models
import datetime
class Profile(models.Model):
first_name=models.CharField(max_length=30)
last_name=models.CharField(max_length=30)
address=models.CharField(max_length=30)
location=models.CharField(max_length=30)
phone_home=models.CharField(max_length=30)
phone_mobil... | b10n1k/foodspot69 | foodspot/models.py | Python | gpl-2.0 | 3,321 |
from serial import Serial
ser = Serial("/dev/ttyACM0", 9600)
while True:
print(ser.read())
| dkkline/CanSat14-15 | tests/camera_test/serial_dump.py | Python | mit | 98 |
from protorpc.messages import *
from protorpc.protojson import *
from protopigeon import *
from .component import *
| yowmamasita/social-listener-exam | ferris/core/messages/__init__.py | Python | mit | 116 |
# Copyright (c) 2012 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.
from datetime import datetime
import glob
import optparse
import os
import re
from telemetry import test
from telemetry.core import bitmap
from telemetry... | qtekfun/htcDesire820Kernel | external/chromium_org/content/test/gpu/gpu_tests/pixel.py | Python | gpl-2.0 | 5,592 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import system
import sys
from PyQt5 import QtGui, QtCore, QtWidgets
settings = QtCore.QSettings('qrdp', 'qrdp1')
servers = settings.value('servers')
credentials = settings.value('credentials')
resolution = settings.value('resolution')
def main():
app = QtWid... | qtheya/qrdp | qrdp.py | Python | unlicense | 8,057 |
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | chromium/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer_unittest.py | Python | bsd-3-clause | 24,752 |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2003-2007 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFT... | HomeRad/TorCleaner | tests/dns/test_ntoaaton.py | Python | gpl-2.0 | 4,720 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Spotlight Volume configuration plist plugin."""
import unittest
from plaso.parsers.plist_plugins import spotlight_volume
from tests.parsers.plist_plugins import test_lib
class SpotlightVolumePluginTest(test_lib.PlistPluginTestCase):
"""Tests for the... | kiddinn/plaso | tests/parsers/plist_plugins/spotlight_volume.py | Python | apache-2.0 | 1,536 |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to install the Chrome OS fonts on Linux.
# This script can be run manually (as root), but is also run as part
# install-build-... | endlessm/chromium-browser | build/linux/install-chromeos-fonts.py | Python | bsd-3-clause | 4,006 |
# Copyright 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
#
# Unless required by applicable law or a... | rahulunair/nova | nova/objects/network.py | Python | apache-2.0 | 9,406 |
# -*- coding: utf-8 -*-
import argparse
from getpass import getpass
from listener_service.tables import User
import config
import tabulate
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from passlib.hash import pbkdf2_sha512
def check_args(a):
if not a.username:
print("Use... | katajakasa/aetherguild2 | aetherguild/manage_users.py | Python | mit | 4,375 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# aiohttp documentation build configuration file, created by
# sphinx-quickstart on Wed Mar 5 12:35:35 2014.
#
# 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
# au... | playpauseandstop/aiohttp | docs/conf.py | Python | apache-2.0 | 10,410 |
import logging
from scrapy.downloadermiddlewares.retry import RetryMiddleware
from scrapy.utils.response import response_status_message
from scrapy.utils.misc import load_object
logger = logging.getLogger(__name__)
FIXED_PROVIDER_PATH = 'scrapy_fake_useragent.providers.FixedUserAgentProvider'
FAKE_USERAGENT_PROVIDE... | alecxe/scrapy-fake-useragent | scrapy_fake_useragent/middleware.py | Python | bsd-3-clause | 3,861 |
#!/usr/bin/env python
# coding: utf-8
#
# Urwid tour. It slices, it dices..
# Copyright (C) 2004-2011 Ian Ward
#
# 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
# ... | inducer/urwid | examples/tour.py | Python | lgpl-2.1 | 14,031 |
import fiona
import numpy as np
from numpy.linalg import norm
def compute_normals_2d(datadict):
"""compute vertex normals by averaging incident edge normals"""
def orthogonal(vec):
v = np.array([-vec[1], vec[0]])
return v/norm(v)
def normal(p,q):
"""returns unit vector orthogo... | Ylannl/masb2d | shp_reader.py | Python | gpl-3.0 | 2,999 |
import time
import unittest
from nive.definitions import *
from nive.tools import *
from nive.security import User
from nive.components.tools.example import configuration
import db_app
# -----------------------------------------------------------------
class ToolTest1(unittest.TestCase):
def test_tool(self):... | nive-cms/nive | nive/tests/test_tool.py | Python | gpl-3.0 | 1,714 |
from ._cardutil import unmungFlip
from .card import Card
from .cardset import CardSet, CardSetDB
from .color import Color
from .jsonify import EnVecEncoder, iloadJSON
from .multipart import MultipartDB, CardClass
from .rarity import Rarity
from .tutor import ChecklistPage, Tutor
from ._util impo... | jwodder/envec | envec/__init__.py | Python | mit | 334 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | ywcui1990/nupic.research | htmresearch/algorithms/temporal_memory_factory.py | Python | agpl-3.0 | 4,118 |
#!/usr/bin/python2.4
# Copyright (c) 2006-2008 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.
'''Adaptation of the extern.tclib classes for our needs.
'''
import re
import types
from grit import exception
import grit.e... | rwatson/chromium-capsicum | tools/grit/grit/tclib.py | Python | bsd-3-clause | 6,009 |
# -*- coding: utf-8 -*-
"""tick module
"""
# License: BSD 3 clause
import tick.base
| X-DataInitiative/tick | tick/__init__.py | Python | bsd-3-clause | 85 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... | adam111316/SickGear | sickbeard/notifiers/__init__.py | Python | gpl-3.0 | 2,860 |
# Case Conductor is a Test Case Management system.
# Copyright (C) 2011 uTest Inc.
#
# This file is part of Case Conductor.
#
# Case Conductor 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... | mozilla/caseconductor-ui | ccui/manage/forms.py | Python | gpl-3.0 | 15,347 |
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from tinymce.widgets import TinyMCE
from django.conf import settings
class PageForm(FlatpageForm):
class Meta:
model = FlatPage
exclude = []
widgets = {
... | erral/promesak | promesak/admin.py | Python | gpl-2.0 | 824 |
#!/usr/bin/env python
from webdriver_testing.pages.site_pages.teams import ATeamPage
class MessagesTab(ATeamPage):
"""Actions for the Messages tab of the Team Settings Page.
"""
_URL = 'teams/%s/settings/messages/' #provide the team slug
#MESSAGES FIELDS
_INVITATION_MESSAGE = 'textarea#id_messa... | ofer43211/unisubs | apps/webdriver_testing/pages/site_pages/teams/messages_tab.py | Python | agpl-3.0 | 3,683 |
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)
... | csgrad/ns-3-9-ngwmn | bindings/python/apidefs/gcc-LP64/ns3_module_flame.py | Python | gpl-2.0 | 9,222 |
#!/usr/bin/python
#!/usr/bin/env python
#This file launches spectrum_sense.py in one thread and transactions.py in another thread. This file should be executed to start the basestation.
import os
import threading
def start_transactions:
os.system('./transactions.py')
print 'Transactions started sucessfully'
... | levelrf/level_basestation | spectrum_sense/main.py | Python | gpl-3.0 | 526 |
from flask import Flask, render_template, send_from_directory
app = Flask(__name__)
@app.route('/js/<path:path>')
def send_js(path):
return send_from_directory(u'templates/js', path)
@app.route('/css/<path:path>')
def send_css(path):
return send_from_directory(u'templates/css', path)
@app.route('/fonts/<p... | c0state/python-skeleton-for-ci-cd | app/main_app.py | Python | mit | 680 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, get... | MartinEnder/erpnext-de | erpnext/stock/doctype/material_request/material_request.py | Python | agpl-3.0 | 10,868 |
'''
James D. Zoll
4/29/2013
Purpose: Defines the single view for the DK Optimize project.
License: This is a public work.
'''
# Library Imports
from django.template import RequestContext
from django.shortcuts import render_to_response
def index(request):
return render_to_response('dk_optimize/index.html', ... | Zerack/zoll.me | dk_optimize/views.py | Python | mit | 363 |
import sys
sys.path[0] = 'build/lib.linux-i686-2.7'
import io
import os.path
import numpy
import random
import itertools
from selfrepairing import HSRC, HSRCMode
numpy.set_printoptions(linewidth=100)
k = 3
n = 7
w = 32
packetsize = 128
buffsize = w*packetsize
mode = HSRCMode.SCHDULE
dec_points = numpy.ndarray(dtype... | llpamies/selfrepairing | decode.py | Python | gpl-3.0 | 1,505 |
from qtpy import QtWidgets, QtCore
class WarningTimerModel(object):
"""Model for Warning Boxes that close after a certain amount of time
Parameters
----------
parent
The parent of the QMessageBox
title : :obj:`str`
The title of the window
message : :obj:`str`
... | planetarypy/pdsspect | pdsspect/warningtimer.py | Python | bsd-3-clause | 5,012 |
import plyvel
import ast
import hashlib
import os
import sys
from processor import print_log, logger
from utils import bc_address_to_hash_160, hash_160_to_pubkey_address, hex_to_int, int_to_hex, Hash
global GENESIS_HASH
GENESIS_HASH = '00000b7e804f0de87e7752550ff04d7686a4599509897feefd7f03904eb45633'
"""
Patricia tr... | TrainMAnB/electrum-vcn-server | src/storage.py | Python | agpl-3.0 | 18,186 |
"""Hello Analytics Reporting API V4."""
import argparse
from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
from oauth2client import client
from oauth2client import file
from oauth2client import tools
SCOPES = ['https://www.googleapis.com/auth/ana... | desavera/bicraft | var/googleapi/HelloAnalytics.py | Python | gpl-3.0 | 2,445 |
"""Unit tests for PyGraphviz interface."""
import os
import tempfile
from nose import SkipTest
from nose.tools import assert_true, assert_equal, assert_raises
from networkx.testing import assert_edges_equal, assert_nodes_equal, \
assert_graphs_equal
import networkx as nx
class TestAGraph(object):
@classm... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/networkx/drawing/tests/test_agraph.py | Python | gpl-3.0 | 3,262 |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authorization... | ECYS-USAC/cpfecys | src/cpfecys/controllers/admin_academic.py | Python | lgpl-3.0 | 2,248 |
from pygame import image, Rect
class ScrollButton():
def __init__(self, direction, resourcePath):
self.direction = direction
if (self.direction == "up"):
self.image = image.load(resourcePath + "img/uparrow.png")
elif (self.direction == "down"):
self.image = image.load(resourcePath + "img/downarrow.png")
... | ZakDoesGaming/OregonTrail | lib/scrollButton.py | Python | mit | 452 |
# Copyright: 2011, Grigoriy Petukhov
# Author: Grigoriy Petukhov (http://lorien.name)
# License: BSD
import logging
import sys
try:
from cStringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
import random
try:
from urlparse import urlsplit
except ImportError:
from urllib.parse... | istinspring/grab | grab/transport/curl.py | Python | mit | 24,234 |
# 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... | wolverineav/neutron | neutron/tests/unit/agent/l3/test_router_info.py | Python | apache-2.0 | 16,514 |
# coding=utf-8
# MIT License
#
# Copyright 2021 Google LLC
# Copyright (c) 2018 Maluuba 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 limitatio... | google-research/jumping-task | gym_jumping_task/envs/jumping_task.py | Python | mit | 17,965 |
# coding=utf-8
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.auth.views import password_reset_confirm
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _
fr... | sshwsfc/django-xadmin | xadmin/plugins/passwords.py | Python | bsd-3-clause | 4,680 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_spannertools_MeasuredComplexBeam_01():
staff = Staff("abj: | 2/16 c'16 d'16 || 2/16 e'16 f'16 |"
"| 2/16 g'16 a'16 |")
assert systemtools.TestManager.compare(
staff,
r'''
\new Staff {
{
\time 2... | mscuthbert/abjad | abjad/tools/spannertools/test/test_spannertools_MeasuredComplexBeam.py | Python | gpl-3.0 | 1,571 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.