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 # Copyright 2016 Joel Dunham # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
jrwdunham/old
onlinelinguisticdatabase/lib/parse.py
Python
apache-2.0
3,675
import os from time import strftime from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation, ePicLoad from ServiceReference import ServiceReference from Screens.Screen import Screen from Screens.HelpMenu import HelpableScreen from Screens.MessageBox import MessageBox from Screens.InputBox impor...
popazerty/dvbapp2-gui
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
Python
gpl-2.0
36,514
#!/usr/bin/env python3.5 # -*- coding: utf-8 -*- # Author: ChenLiang import socket # 定义IP加端口 ip_port = ('127.0.0.1', 9999) # 一定是元组形式 # 买通信设备 s = socket.socket() # 关联通信设备 s.bind(ip_port) # 开机 s.listen(5) # 最大挂起5个连接, 3.0默认为128 # 待机 conn, addr = s.accept() # 通信连接 while True: try: # 接收消息 recv_...
smartczm/python-learn
Old-day01-10/s13-day9/Socket/while_socket/server.py
Python
gpl-2.0
681
from django.conf import settings from django.utils.translation import gettext as _ from django.shortcuts import render, get_object_or_404 from django.contrib.auth.decorators import login_required from django.http import HttpResponseForbidden from keops.contrib.base.models.ui import Menu from keops.api import site @l...
katrid/keops
keops/views/web.py
Python
bsd-3-clause
1,743
#Code generator for gauss kernel import Utils local_size = 64 from KDECodeGenerator import GaussKernel from KDECodeGenerator import CategoricalKernel import copy from KDECodeGenerator import generateTableGradientContributionKernel from KDECodeGenerator import generateTableEstGrad from KDECodeGenerator import generateT...
martinkiefer/join-kde
code/AggressiveKDECodeGenerator.py
Python
gpl-3.0
35,836
#!/usr/bin/env python from __future__ import print_function ################################################################################ # # # drmaa_wrapper.py # # Copyright (C) 2013 Leo Goodstadt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associa...
magosil86/ruffus
ruffus/drmaa_wrapper.py
Python
mit
18,668
from django.conf.urls import url, include from . import views from .vi import vi_views app_name='polls' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^welcome$', views.welcome, name='welcome'), url(r'^login$', views.my_login, name='login'), url(r'^logout$', views.my_logo...
saulario/pruebas
python/mysite/polls/urls.py
Python
gpl-3.0
689
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import runpy runpy.run_module('announce', run_name='__main__', alter_sys=True)
DonJayamanne/pythonVSCode
news/__main__.py
Python
mit
175
""" Django settings for CoPub project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os # ...
sh4rkman/CoPub
CoPub/settings.py
Python
mit
3,162
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
liamcoau/WATCoin
watcoin/contrib/pyminer/pyminer.py
Python
apache-2.0
6,438
# -*- coding: utf-8 -*- from openerp.http import request, STATIC_CACHE from openerp.addons.web import http import json import io from PIL import Image, ImageFont, ImageDraw from openerp import tools import cStringIO import werkzeug.wrappers import time import logging logger = logging.getLogger(__name__) class Web_Edi...
ChawalitK/odoo
addons/web_editor/controllers/main.py
Python
gpl-3.0
10,264
from link import Wrapper from link.utils import list_to_dataframe class NoSqlDB(Wrapper): """ wraps a database connection and extends the functionality to do tasks like put queries into dataframes """ def __init__(self, wrap_name = None, **kwargs): if kwargs: self.__dic...
uhjish/link
link/wrappers/nosqlwrappers.py
Python
apache-2.0
5,162
# -*-coding:iso-8859-1 -* import pygame,pdb,math from pygame.locals import * from .constantes import * from .horloge import * from .interrupteur import * from .mobile import * from .observable import * class Joueur(Mobile, Observable): """Classe représentant le joueur""" def __init__(self, jeu, gestionnaire...
Rastagong/narro
Releases/0.1/narro/joueur.py
Python
mit
14,568
from office365.entity import Entity from office365.outlook.calendar.email_address import EmailAddress class CalendarPermission(Entity): """ The permissions of a user with whom the calendar has been shared or delegated in an Outlook client. Get, update, and delete of calendar permissions is supported on b...
vgrem/Office365-REST-Python-Client
office365/outlook/calendar/calendar_permission.py
Python
mit
1,204
## Week 3: Solving Minimization Problems # Extending the client project example from last week. # The project is worked by 2 types of workers (Manager, Offshore). # The manager worked x hours on the project # and offshore staff worked y hours, for at least 1200 hours. # Managers cost 150/hour but bring in revenue ...
sgranitz/northwestern
predict400/week3.py
Python
mit
1,482
""" WSGI config for vcal_webgui project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
mksachs/WebVC
vcal_webgui/wsgi.py
Python
mit
1,663
""" The md5 and sha modules are deprecated since Python 2.5, replaced by the hashlib module containing both hash algorithms. Here, we provide a common interface to the md5 and sha constructors, depending on system version. """ import sys import warnings warnings.warn("django.utils.hashcompat is deprecated; use hashlib...
skevy/django
django/utils/hashcompat.py
Python
bsd-3-clause
688
# -*-*- encoding: utf-8 -*-*- # # gateway4labs is free software: you can redistribute it and/or modify # it under the terms of the BSD 2-Clause License # gateway4labs is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PA...
labsland/labmanager
labmanager/views/ple/admin.py
Python
bsd-2-clause
24,701
#!/usr/bin/env python # -*- coding: UTF-8 -*- # REF [site] >> # https://torchtext.readthedocs.io/en/latest/index.html # https://github.com/pytorch/text import io, time import torch, torchtext # REF [site] >> # https://github.com/pytorch/text # https://torchtext.readthedocs.io/en/latest/examples.html def tutorial_exa...
sangwook236/general-development-and-testing
sw_dev/python/rnd/test/language_processing/torchtext_test.py
Python
gpl-2.0
3,292
# -*- coding: utf-8 -*- """ Occam 1D GUI ----------------- All encompassing ploting data, model and model response. JP 2017 """ # # ============================================================================= # Imports # ============================================================================= import os import ...
MTgeophysics/mtpy
mtpy/gui/occam1d_gui_qt5.py
Python
gpl-3.0
59,895
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of th...
CERNDocumentServer/invenio
modules/miscutil/lib/sequtils_regression_tests.py
Python
gpl-2.0
7,816
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.on...
drmrd/ansible
test/units/modules/network/onyx/test_onyx_linkagg.py
Python
gpl-3.0
4,801
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
otron/invenio-accounts
tests/test_cli.py
Python
gpl-2.0
5,023
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "prueba.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
aztrock/django-host-extend
manage.py
Python
gpl-2.0
249
''' /****************************************************************** * * Copyright 2018 Samsung Electronics 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...
iotivity/iotivity
test/src/automation/robot/helper/DeviceControlKeyword.py
Python
apache-2.0
67,193
import unittest from Pluss import add class TestAdd(unittest.TestCase): def setUp(self): pass def test_numbers_5_7(self): self.assertEqual(add(5,7), 12) if __name__ == '__main__': unittest.main()
github4321/IS-105_2016_Gruppe92
uke03/Sebastian_Test_Pluss.py
Python
mit
233
#!/usr/bin/python3 # Copyright (c) 2017 Johannes Leupolz # # 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, modif...
joleuger/bluetooth-monitor
core.py
Python
mit
14,157
# Purpose: AC1015 graphic builder # Created: 10.03.2013 # Copyright (C) 2013, Manfred Moitzi # License: MIT License from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" class GraphicsFactoryAC1015(object): def add_lwpolyline(self, points, dxfattribs=None): if dxfattribs is None: ...
lautr3k/RepRap-iTopie
odmt/ezdxf/ac1015/graphicsfactory.py
Python
gpl-3.0
569
import pyautogui from rague.config import blt def test_movement_system_on_dummy_entity_one_turn(world, dummy_entity): world.entities.add(dummy_entity) world.make_iteration() assert dummy_entity.position.x == dummy_entity.position.y == 1 def test_movement_system_on_paralyzed_dummy(world, dummy_entity): ...
vitkarpenko/rague
tests/test_systems.py
Python
mit
1,514
class QueryBase(object): def __or__(self, other): return QueryGroup('or', self, other) def __and__(self, other): return QueryGroup('and', self, other) def __invert__(self): return QueryGroup('not', self) class QueryGroup(QueryBase): def __init__(self, operator, *args): ...
chrisseto/modular-odm
modularodm/query/query.py
Python
apache-2.0
1,198
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft. 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 #...
phonnz/azure-storage-python
tests/test_storage_queue.py
Python
apache-2.0
26,556
# # Copyright 2005,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later ...
UpYou/relay
my_gnuradio/blks2impl/qam16.py
Python
gpl-3.0
7,599
""" Forum attachments cache ======================= This module defines an abstraction allowing to put forum attachments into cache when users are creating forum posts and topics. """ from io import BytesIO from django.conf import settings from django.core.cache import InvalidCacheBackendError, cach...
ellmetha/django-machina
machina/apps/forum_conversation/forum_attachments/cache.py
Python
bsd-3-clause
4,544
from behave import given, when, then import json import os from django.contrib.auth.models import User, Group from pybel import readfile @given('I have valid stereochem compound with one stereocentre') def step(context): context.inchi = "InChI=1S/C10H12O2/c1-3-8-4-7(2)5-9(6-8)10(11)12/h4-6H,3H2,1-2H3,(H,11,12)" ...
thesgc/cbh_chembl_ws_extension
cbh_chembl_ws_extension/features/steps/stereochem.py
Python
mit
7,146
from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.is_.forms import (ISIdNumberField, ISPhoneNumberField, ISPostalCodeSelect) class ISLocalFlavorTests(SimpleTestCase): def test_ISPostalCodeSelect(self): f = ISPostalCodeSelec...
M157q/django-localflavor
tests/test_is.py
Python
bsd-3-clause
9,213
import os import unittest from coala_quickstart.generation.InfoCollector import ( collect_info) from tests.TestUtilities import generate_files package_json = """ { "name": "awesome-packages", "version": "0.8.0", "license": "MIT", "dependencies": { "coffeelint": "~1", "ramllint": "...
MalkmusT/coala-quickstart
tests/generation/InfoCollectorTest.py
Python
agpl-3.0
2,740
import Queue import logging import threading import time import subprocess import os from datetime import datetime, timedelta from mirrors.libmirrors import t2s class Singleton(type): """Singleton Class for RepoManager.""" _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._ins...
ehouse/mirrors
mirrors/repo.py
Python
bsd-2-clause
16,133
from ..graph import Greengraph from itertools import combinations_with_replacement from nose.tools import assert_almost_equal from nose.tools import assert_raises from mock import patch graph = Greengraph('London', 'Chiacago') def test_geolocate(): start, end = (graph.geolocate(graph.start), graph.geolocate(gra...
padraic-padraic/MPHYSG001_CW1
greengraph/test/test_graph.py
Python
gpl-2.0
1,830
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. 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 # noti...
aspectron/jsx
extern/v8/tools/js2c.py
Python
mit
16,982
#! -*- coding: utf-8 -*- """ @author: David Siroky (siroky@dasir.cz) @license: MIT License (see LICENSE.txt or U{http://www.opensource.org/licenses/mit-license.php}) """ import unittest import net_flow_vizu_dia ############################################################################# #################...
dsiroky/NetFlowVizu
tests/tests.py
Python
mit
758
import asyncio import itertools import random import sys import weakref from operator import mul from time import sleep import dask import pytest from distributed import Nanny, Worker, wait, worker_client from distributed.config import config from distributed.metrics import time from distributed.scheduler import key_s...
blaze/distributed
distributed/tests/test_steal.py
Python
bsd-3-clause
23,436
#!/usr/bin/env python # encoding: utf-8 from fabric.api import run, env from cfg import aliyun3_cfg from helper import update_sys env.hosts = ['root@{host}'.format(host=aliyun3_cfg['host'])] env.password = aliyun3_cfg['root_pass'] def update_maplet(): run('cp /opt/mapdisk/mapws/wcs_maplet/mapproxy.yaml /home/b...
bukun/bkcase
DevOps/aliyun3_su.py
Python
mit
389
# Copyright 2005, 2006 Benoit Boissinot <benoit.boissinot@ens-lyon.org> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''commands to sign and verify changesets''' import os, tempfile, binascii from mercurial import util, comman...
hekra01/mercurial
hgext/gpg.py
Python
gpl-2.0
9,698
#!/usr/bin/env python ''' The MIT License (MIT) Copyright (c) <2014> <Mathias Lesche> 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 ...
mlesche/dsp
dsp/src/support_scripts/merge_fastq.py
Python
mit
20,921
# -*- coding: utf-8 -*- #------------------------------------------------------------ import sys PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int if PY3: import urllib.parse as urlparse # Es muy lento en PY2. En PY3 es nativo else: import...
alfa-addon/addon
plugin.video.alfa/channels/pornvibe.py
Python
gpl-3.0
5,118
#! /usr/bin/env python # ******************************************************************************* # This file is part of tools_piccante. # # tools_piccante 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 Foundati...
ALaDyn/tools-piccante
py-tools/readFieldsWithGUI.py
Python
gpl-3.0
11,248
import errno import os def deepgetattr(obj, attr): """Recurse through an attribute chain to get the ultimate value.""" return reduce(getattr, attr.split('.'), obj) def mkdir_p(path): """Makes a directory path, but doesn't crash if the path already exists.""" try: os.makedirs(path) except...
shashi792/courtlistener
alert/lib/utils.py
Python
agpl-3.0
448
#!/usr/bin/env python from manager import Plugin from operator import itemgetter import GeoIP class GeoIPStats(Plugin): def __init__(self, **kwargs): self.gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE) self.countries = {} def process(self, **kwargs): if 'remote_host' in kwargs: ...
rytis/Apache-access-log-parser
plugins/plugin_geoip_stats.py
Python
apache-2.0
767
# # Copyright 2013 © Nguyễn Hà Dương (cmpitgATgmailDOTcom) # # This file is part of Blutkit. # # Blutkit 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) a...
cmpitg/blutkit
blutkit/gui/keyutils.py
Python
gpl-3.0
3,939
from pprint import pprint VAR = 42 def foo(): import sys import ast, tokenize pass class C: from textwrap import dedent pass import codecs as C pass
asedunov/intellij-community
python/testData/formatter/noBlankLinesAfterLocalImports_after.py
Python
apache-2.0
182
import pytest from opentrons import protocol_api as papi, types labware_name = 'corning_96_wellplate_360ul_flat' def test_load_to_slot(loop): ctx = papi.ProtocolContext(loop=loop) labware = ctx.load_labware(labware_name, '1') assert labware._offset == types.Point(0, 0, 0) other = ctx.load_labware(la...
Opentrons/labware
api/tests/opentrons/protocol_api/test_labware_load.py
Python
apache-2.0
1,271
import datetime import numbers from functools import partial from django.urls import reverse from django.utils.translation import ugettext as _ import pytz from couchdbkit import ResourceNotFound from casexml.apps.case.views import get_wrapped_case from corehq.apps.hqwebapp.templatetags.proptable_tags import get_di...
dimagi/commcare-hq
corehq/apps/reports/view_helpers.py
Python
bsd-3-clause
7,625
# 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 may ...
Azure/azure-sdk-for-python
sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py
Python
mit
3,243
# http://trac.secdev.org/scapy/ticket/31 # scapy.contrib.description = MPLS # scapy.contrib.status = loads from scapy.packet import Packet,bind_layers from scapy.fields import BitField,ByteField from scapy.layers.l2 import Ether from scapy.layers.l2 import GRE class MPLS(Packet): name = "MPLS" fields_desc = [...
guedou/scapy-bpf
scapy/contrib/mpls.py
Python
gpl-2.0
814
#!/usr/bin/env python # -*- mode: python; sh-basic-offset: 4; indent-tabs-mode: nil; coding: utf-8 -*- # vim: tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8 import argparse import sys import clusto from clusto import drivers from clusto import script_helper from pprint import pprint import sys impo...
sanyaade-mobiledev/clusto
src/clusto/commands/attr.py
Python
bsd-3-clause
5,122
# redditarchiver 0.02, a tool for archiving reddit JSON data and linked files # Copyright (C) 2014 Thadeus J. Fleming # # redditarchiver 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 ...
iamthad/redditarchiver
redditarchiver.py
Python
gpl-3.0
8,190
# -*- test-case-name: foolscap.test.test_pb -*- import re, time from zope.interface import implements, implementsOnly, implementedBy, Interface from twisted.python import log from twisted.internet import defer, reactor, task, protocol from twisted.application import internet from twisted.web.client import getPage from...
david415/foolscap
src/foolscap/test/common.py
Python
mit
20,624
from inputs import SIXTEENTH import operator import functools sues = SIXTEENTH.input possibles = [] possibles2 = [] for id,att in sues.items(): if 'children' in att and not att['children'] == 3: continue if 'cats' in att and not att['cats'] == 7: continue if 'samoyeds' in att and ...
lyrixderaven/AdventOfCode
16.advent.py
Python
gpl-2.0
1,736
from ._filesdb import *
stilley2/filesdb
filesdb/__init__.py
Python
mit
24
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: run-and-draw-last.py # Date: Thu Sep 18 15:43:47 2014 -0700 import matplotlib.pyplot as plt from scipy.misc import imread, imsave import numpy as np import os, sys import glob from copy import copy sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(_...
mfs6174/Deep6174
scripts/run-and-draw-last.py
Python
apache-2.0
2,768
#!/usr/bin/env python # # Copyright (c) 2005 The SCons Foundation # # 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...
azverkan/scons
bin/memlogs.py
Python
mit
1,715
class Stock(): def __init__(self, name, symbol, prices=[]): self.name = name self.symbol = symbol self.prices = prices def high_price(self): if len(self.prices) == 0: return 'MISSING PRICES' return max(self.prices) apple = Stock('Apple', 'APPL', [500.43, 570...
schmit/intro-python-course
lectures/code/classes_stocks.py
Python
mit
351
import os import sys import active import operator from os import listdir ## Author: James Earle. ## ## This script parses the output files from 20 separate GPP runs ## and creates a file, 'sorted_inds.txt' displaying all the runs ## ordered by fitness in terms of their performance on testing data. ## We don't want t...
JamesEarle/PythonProjects
GPP Scripts/sort_runs.py
Python
mit
1,733
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistrib...
goddardl/gaffer
python/GafferSceneUI/SceneSwitchUI.py
Python
bsd-3-clause
2,393
""" Cisco_IOS_XR_snmp_test_trap_act This module contains a collection of YANG definitions for Cisco IOS\-XR action package configuration. Copyright (c) 2016 by Cisco Systems, Inc. All rights reserved. """ import re import collections from enum import Enum from ydk.types import Empty, YList, YLeafList, DELETE, D...
111pontes/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_snmp_test_trap_act.py
Python
apache-2.0
71,452
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import logging from flask i...
javivi001/OctoPrint
src/octoprint/server/api/settings.py
Python
agpl-3.0
15,741
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
akshayaurora/electrum
plugins/cosigner_pool/qt.py
Python
gpl-3.0
6,879
#! /usr/bin/env python import openturns as ot import matplotlib import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from openturns.viewer import View import time ot.RandomGenerator.SetSeed(0) ot.Log.Show(ot.Log.INFO) # Bounds are [0,1]^dimension dimension = 50 # Size of sample size ...
aurelieladier/openturns
validation/src/optimal_lhs/validate_SA_big.py
Python
lgpl-3.0
2,430
from django import forms class etl_form(forms.Form): csv_file = forms.CharField(label='location of CSV file to load', max_length=100)
PatrickCoffey/TLRweb
TLRweb/TLR_ETL/forms.py
Python
gpl-2.0
172
# Copyright (c) 2019 PaddlePaddle 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 appli...
luotao1/Paddle
python/paddle/fluid/tests/unittests/test_imperative_data_loader_process.py
Python
apache-2.0
4,212
# # This file is part of pysnmp software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pysnmp.sf.net/license.html # from pysnmp.carrier import sockfix from pysnmp.carrier.base import AbstractTransportAddress from pysnmp.carrier.asyncore.dgram.base import DgramSocketTransport import so...
k11a/snmpconverter
pysnmp/carrier/asyncore/dgram/udp6.py
Python
gpl-3.0
1,380
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-07-02 15:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rooms', '0001_initial'), ] operations = [ migrations.AlterField( ...
ViktorMarinov/get-a-room
get_a_room/rooms/migrations/0002_auto_20160702_1537.py
Python
mit
471
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'shape': [(4, 3, 2), (1,), (1, 2, 3, 4, 5, 6)], 'Wdim': [0, 1, ...
ronekko/chainer
tests/chainer_tests/functions_tests/activation_tests/test_prelu.py
Python
mit
3,278
#!/usr/bin/env python #Boa:App:BoaApp import wx import frm_sideka_menu modules ={u'bantuan': [0, u'bantuan', u'bantuan.py'], u'cari_administrasi': [0, '', u'cari_administrasi.py'], u'cari_kemiskinan': [0, '', u'cari_kemiskinan.py'], u'cari_penduduk': [0, '', u'cari_penduduk.py'], u'data_penduduk': [0, '', u'data_p...
gedhe/sidesa2.0
sidesa.py
Python
gpl-2.0
4,181
from __future__ import division import sys import numpy as np from random import randrange import math import random def get_maxUptake(maxUptake_dict, prop, mean, std, system): maxUptake = mean #if system != 'ideal': # uncomment to make 'ideal' systems ne...
embaldridge/hydrobide
models/BoneYard/BideProcesses/bide.py
Python
mit
9,023
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S+00:00'
liveblog/liveblog
server/liveblog/tests/test_settings.py
Python
agpl-3.0
40
import os import shutil import sys import zipfile import platform from distutils.core import setup from distutils.sysconfig import get_python_lib import py2exe version = __import__('p2pool').__version__ im64 = '64' in platform.architecture()[0] if os.path.exists('INITBAK'): os.remove('INITBAK') os.rename(os.path...
vertoe/p2pool-drk
setup.py
Python
gpl-3.0
2,191
# coding: utf-8 import app.resource class Race(app.resource.IdResource): fields = { "name": str, "date": str, "leader_id": int, "state": str, "description": str } defaults = { "description": "" } def __init__(self, application): self.file...
DarkLuk42/hn-ias-race
app/resources/race.py
Python
gpl-2.0
1,898
import select_backport import select import unittest class TestSelectBackport(unittest.TestCase): def test_alias(self): self.assert_(select_backport.select is select.select) self.assert_(select_backport.error is select.error) if hasattr(select, "poll"): self.assert_(select_back...
gorakhargosh/select_backport
tests/test_select_backport.py
Python
mit
547
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The ios lacp fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based on the confi...
thaim/ansible
lib/ansible/module_utils/network/ios/facts/lacp/lacp.py
Python
mit
2,528
"""Utilities for memristor functions.""" try: from tools import izip except: izip = zip import os import numpy as np import matplotlib.pyplot as plt import tensorflow as tf PI = np.array(np.pi, dtype='float32') # Encoding network def build_multilayer_network(x, n_, f='tanh'): """ Parameters ----...
rzarcone/CAEs
utils/mem_utils.py
Python
bsd-2-clause
5,633
# # 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...
apache/incubator-airflow
airflow/providers/google/cloud/operators/dataproc.py
Python
apache-2.0
90,576
"""Collection of fixtures and functions for the HomeKit tests.""" from unittest.mock import patch def patch_debounce(): """Return patch for debounce method.""" return patch( "homeassistant.components.homekit.accessories.debounce", lambda f: lambda *args, **kwargs: f(*args, **kwargs), )
fbradyirl/home-assistant
tests/components/homekit/common.py
Python
apache-2.0
317
# -*- coding: utf-8 -*- # # Peony documentation build configuration file, created by # sphinx-quickstart on Tue Aug 30 16:36:34 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
odrling/peony-twitter
docs/conf.py
Python
mit
10,839
# 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 by applicable law or agr...
tvansteenburgh/PerfKitBenchmarker
tests/sample_test.py
Python
apache-2.0
1,098
#!/usr/bin/env python # Copyright 2015 Byhiras (Europe) Limited # # 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 appl...
crs4/pyavroc
tests/test_write.py
Python
apache-2.0
8,092
import RPi.GPIO as GPIO import time def move(angle=90): "Move the servo to the specified angle" pulse = int(angle) / 18.0 + 2.5 GPIO.setmode(GPIO.BOARD) GPIO.setup(16,GPIO.OUT) p = GPIO.PWM(16,50) p.start(pulse) time.sleep(1) p.stop() GPIO.cleanup() if __name__ == "__main__": import sys angle = 90 if l...
dmollaaliod/raspicamserver
servo.py
Python
gpl-2.0
583
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "production.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
effa/smartoo
manage.py
Python
gpl-2.0
253
# coding: utf-8 """Setup lightgbm package.""" import logging import struct import subprocess import sys from os import chdir from pathlib import Path from platform import system from shutil import copyfile, copytree, rmtree from typing import List, Optional, Union from setuptools import find_packages, setup from setup...
henry0312/LightGBM
python-package/setup.py
Python
mit
15,596
from pawt import swing lst = swing.JList(['a', 'b', 'c']) swing.test(lst)
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Demo/swing/ListDemo.py
Python
gpl-3.0
83
import os import shutil from lutris import settings from lutris.config import LutrisConfig from lutris.gui.dialogs import QuestionDialog, FileDialog from lutris.runners.runner import Runner from lutris.util.system import find_executable class pcsxr(Runner): """PlayStation emulator""" human_name = "PCSX-Reload...
GoeGaming/lutris
lutris/runners/pcsxr.py
Python
gpl-3.0
3,721
# Copyright (c) 2014, Matt Layman import os import tempfile from handroll.site import Site class Factory(object): """A factory to produce commonly needed objects""" def make_site(self): """Make a valid site instance.""" site = tempfile.mkdtemp() open(os.path.join(site, 'template.htm...
mblayman/handroll
handroll/tests/factory.py
Python
bsd-2-clause
364
from decimal import Decimal as D from django.utils.translation import ugettext_lazy as _ from oscar.apps.shipping.base import Base class Free(Base): code = 'free-shipping' name = _('Free shipping') is_tax_known = True charge_incl_tax = charge_excl_tax = D('0.00') class NoShippingRequired(Free): ...
elliotthill/django-oscar
oscar/apps/shipping/methods.py
Python
bsd-3-clause
4,173
from __future__ import absolute_import from datetime import timedelta from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils import timezone from allauth.exceptions import ImmediateHttpResponse from allauth.utils...
rajexp/stepMuzic
allauth/socialaccount/providers/oauth2/views.py
Python
unlicense
5,413
#!/usr/bin/env python # Copyright (C) 2013-2014 Computer Sciences Corporation # # 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 # # ...
ezbake/ezbake-discovery
servicediscovery/python/ezdiscovery.py
Python
apache-2.0
8,729
# # jython examples for jas. # $Id$ # import sys from java.lang import System from jas import PolyRing, QQ, AN, RF from jas import terminate, startLog # polynomial examples: prime/primary decomposition in Q(sqrt(2))(x)(sqrt(x))[y,z] Q = PolyRing(QQ(),"w2",PolyRing.lex); print "Q = " + str(Q); [e,a] = Q.gens();...
breandan/java-algebra-system
examples/prime-decomp_algeb_trans.py
Python
gpl-2.0
2,178
from flask import Flask, Response import json from rdflib import Namespace app = Flask(__name__) vocabsNS = Namespace("http://memesearch.herokuapp.com/static/vocabs/") ###=================================================================== ### Data access functions ###=================================================...
ericmoritz/memesearch-rdf
memesearch_www.py
Python
bsd-3-clause
4,433
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import sys import os import glob import helper from mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResult): ...
ammiranda/python_koans
python2/runner/sensei.py
Python
mit
9,856
from django.contrib import admin from django.contrib.contenttypes import generic from models import * class TaxonomyItemInline(admin.StackedInline): model = TaxonomyItem extra = 1 class TaxonomyMapInline(generic.GenericStackedInline): model = TaxonomyMap extra = 1 class TaxonomyGroupAdmin(admin.Model...
jmichalicek/django-taxonomies
taxonomy/admin.py
Python
bsd-2-clause
633
import os import textwrap import unittest from mock import Mock from conans.client.generators import PremakeGenerator from conans.model.build_info import CppInfo from conans.model.conan_file import ConanFile from conans.model.env_info import EnvValues from conans.model.ref import ConanFileReference from conans.model....
conan-io/conan
conans/test/unittests/client/generators/premake_test.py
Python
mit
5,948