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
# coding=utf-8 from __future__ import unicode_literals, division import sys import logging from subprocess import Popen, PIPE import shutil import os import re from os.path import join as pjoin from PIL import Image from django.utils.six import StringIO from django.core import management from django.core.files.storag...
caioariede/sorl-thumbnail
tests/thumbnail_tests/tests.py
Python
bsd-3-clause
29,267
# 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...
DaanHoogland/cloudstack
tools/marvin/marvin/lib/ncc.py
Python
apache-2.0
14,471
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Processors """ from collections import defaultdict import copy from rebulk import Rebulk, Rule, CustomRule, POST_PROCESS, PRE_PROCESS, AppendMatch, RemoveMatch from .common import seps_no_groups from .common.formatters import cleanup from .common.comparators import ma...
wackou/guessit
guessit/rules/processors.py
Python
lgpl-3.0
8,305
# 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...
apache/incubator-superset
superset/models/reports.py
Python
apache-2.0
6,747
# -*- coding: utf-8 -*- """CA Observer Copyright (C) 2015 Michael Davidsaver This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later ver...
mdavidsaver/caobserver
web/careport/plot.py
Python
agpl-3.0
2,567
# coding: utf-8 from __future__ import print_function import os import numpy as np import time np.random.seed(1337) from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.utils.np_utils import to_categorical from keras.layers import Dense, Flatten, Activation ...
irisliu0616/Short-text-Classification
Model/20News/20news_LSTM_CV.py
Python
mit
7,410
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "locationUpdator.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
valarpirai/team-locator
manage.py
Python
mit
258
from __future__ import division import numpy as np from scipy.misc import comb as combinations from sklearn.utils.random import sample_without_replacement from sklearn.utils.testing import ( assert_raises, assert_equal, assert_true) ######################################################################...
mrshu/scikit-learn
sklearn/utils/tests/test_random.py
Python
bsd-3-clause
3,875
import json import unittest from unittest.mock import MagicMock, patch from tornado.ioloop import IOLoop from tornado.testing import AsyncHTTPTestCase from tornado.web import Application from handlers import HealthCheck class TestHealthcheckHandler(AsyncHTTPTestCase): def setUp(self): super().setUp() ...
evemorgen/GdzieJestTenCholernyTramwajProject
backend/schedule_worker/tests/unit/handlers/test_healthcheck_handler.py
Python
mit
929
# -*- coding: utf-8 -*- # Copyright 2018 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models class AccomplishParticipant(models.TransientModel): _name = "hr.accomplish_participant" _description = "Accomplish Participant" @api...
open-synergy/opnsynid-hr
hr_employee_training/wizards/participant_accomplish.py
Python
agpl-3.0
2,383
# -*- coding: utf-8 -*- import re from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL as get_url from .Crypter import Crypter from .misc import parse_name, parse_time, replace_patterns class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter...
Velociraptor85/pyload
module/plugins/internal/SimpleCrypter.py
Python
gpl-3.0
12,499
"""Support for N26 switches.""" import logging from homeassistant.components.switch import SwitchDevice from . import DEFAULT_SCAN_INTERVAL, DOMAIN from .const import CARD_STATE_ACTIVE, CARD_STATE_BLOCKED, DATA _LOGGER = logging.getLogger(__name__) SCAN_INTERVAL = DEFAULT_SCAN_INTERVAL def setup_platform(hass, co...
fbradyirl/home-assistant
homeassistant/components/n26/switch.py
Python
apache-2.0
1,836
from iomedia.plonemail.plonemail import EmailBase from Products.Five.browser import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile import logging; logger=logging.getLogger('iomedia.plonemail.examples') class SampleEmail(BrowserView,EmailBase): """ Simple browserview to send an...
iomedia/iomedia.plonemail
iomedia/plonemail/examples/form.py
Python
gpl-2.0
1,115
spell_check_dict={ 'steele stake': 'steel stake', 'gas mowe': 'gas mower', 'metal plate cover gcfi': 'metal plate cover gfci', 'lawn sprkinler': 'lawn sprinkler', 'ourdoor patio tile': 'outdoor patio tile', '6 teir shelving': '6 tier shelving', 'storage shelve': 'storage shelf', 'American Standard Bone round toliet': '...
hamid-omid/search_relevance
spell_corr.py
Python
mit
170,663
# Copyright 2015, 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...
gameduell/kythe
third_party/grpc/src/python/src/grpc/framework/base/interfaces_test_case.py
Python
apache-2.0
11,724
from umlfri2.application.commands.base import Command from umlfri2.application.events.diagram import ConnectionMovedEvent class MoveConnectionLabelCommand(Command): def __init__(self, connection_label, delta): self.__diagram_name = connection_label.connection.diagram.get_display_name() self.__conn...
umlfri/umlfri2
umlfri2/application/commands/diagram/moveconnectionlabel.py
Python
gpl-3.0
1,001
import os import platform import unittest from conans.model.ref import ConanFileReference from conans.test.utils.tools import TestClient class ShortPathsTest(unittest.TestCase): @unittest.skipUnless(platform.system() == "Windows", "Requires Windows") def inconsistent_cache_test(self): conanfile = ""...
luckielordie/conan
conans/test/functional/short_paths_test.py
Python
mit
4,784
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016, 2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in...
josepht/snapcraft
snapcraft/internal/cache/_cache.py
Python
gpl-3.0
1,674
# Copyright 2016, 2017 Peter Zybrick and others. # # 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 ag...
petezybrick/iote2e
iote2e-pyclient/src/iote2epyclient/processsim/processsimhumiditytomister.py
Python
apache-2.0
3,105
# # Copyright (C) 2013-2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it wi...
rvykydal/blivet
blivet/safe_dbus.py
Python
lgpl-2.1
7,233
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
frouty/odoogoeen
openerp/report/render/rml2pdf/trml2pdf.py
Python
agpl-3.0
45,807
import pytest from github3 import AuthenticationFailed, GitHubError from github3.github import GitHub from .helper import UnitHelper, UnitIteratorHelper def url_for(path=''): """Simple function to generate URLs with the base GitHub URL.""" return 'https://api.github.com/' + path.strip('/') class TestGitHu...
icio/github3.py
tests/unit/test_github.py
Python
bsd-3-clause
31,906
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.txt')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'python-memcached', 'pyramid', 'apache-libcloud', 'PasteScript', 'pa...
DimensionDataCBUSydney/mist.io
setup.py
Python
agpl-3.0
1,708
from django import forms from rest_framework.compat import parse_datetime class ISO8601DateTimeField(forms.DateTimeField): def strptime(self, value, format): return parse_datetime(value)
jgmize/rna
rna/fields.py
Python
mpl-2.0
202
# Copyright 2012 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...
HybridF5/tempest_debug
tempest/manager.py
Python
apache-2.0
2,876
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010-2011 OpenStack Foundation # Copyright 2012 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
Akrog/cinder
cinder/common/sqlalchemyutils.py
Python
apache-2.0
4,861
# -*- coding: utf-8 -*- # # # Author: Guewen Baconnier # Copyright 2013-2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Li...
Eficent/sale-workflow
sale_procurement_group_by_line/__openerp__.py
Python
agpl-3.0
1,247
########################################################### # # Copyright (c) 2005-2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written ...
sadanandb/pmt
src/tactic/ui/table/spreadsheet_element_wdg.py
Python
epl-1.0
2,490
from keras.models import Sequential, Model from keras.layers import Input, BatchNormalization, Conv2D from keras.layers.merge import add from keras.layers.core import Activation, Flatten from AlphaGo.util import flatten_idx from AlphaGo.models.nn_util import Bias, NeuralNetBase, neuralnet import numpy as np @neuralne...
Rochester-NRT/RocAlphaGo
AlphaGo/models/policy.py
Python
mit
13,485
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Photo' db.create_table(u'accounts_photo', ( (...
ygrass/handsome
accounts/migrations/0003_auto__add_photo.py
Python
unlicense
5,858
# Copyright 2016 - Nokia # # 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, sof...
openstack/vitrage
vitrage/api/controllers/rest.py
Python
apache-2.0
1,420
#!/usr/bin/env python import Queue import threading class ThreadSafePriorityQueue: def __init__(self, name): self.name = None self.queue = None self.get_lock = None self.put_lock = None self.name = name self.queue = Queue.PriorityQueue() self.get_lock = t...
aransena/uarm_metal
src/ThreadSafePriorityQueue.py
Python
mit
3,038
import factory class Entry(factory.django.DjangoModelFactory): title = factory.Faker('sentence') content = factory.Faker('paragraph') class Meta: model = 'faq.Entry'
EliotBerriot/mnm
mnm/faq/tests/factories.py
Python
mit
190
#!/bin/env python """ Copyright 2010-2018 University Of Southern California 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 applicabl...
SCECcode/BBP
bbp/comps/PlotMap.py
Python
apache-2.0
9,038
from unittest import TestCase from unittest import TestSuite from unittest import main from unittest import makeSuite from mwstools.parsers.products import GetMatchingProductForIdResult class TestGetMatchingProductForIdResult(TestCase): body = """ <GetMatchingProductForIdResult Id="082676082658" IdType="UPC...
ziplokk1/python-amazon-mws-tools
tests/parsers/products/test_GetMatchingProductForIdResult.py
Python
unlicense
1,383
""" MAVProxy rally module """ from pymavlink import mavwp from pymavlink import mavutil import time, os, platform from MAVProxy.modules.lib import mp_module from MAVProxy.modules.lib import mp_util if mp_util.has_wxpython: from MAVProxy.modules.lib.mp_menu import * class RallyModule(mp_module.MPModule): ...
tridge/MAVProxy
MAVProxy/modules/mavproxy_rally.py
Python
gpl-3.0
13,720
# -*- coding: utf-8 -*- """ Enumerazione delle tipologie degli oggetti. """ from src.element import EnumElement, finalize_enumeration #------------------------------------------------------------------------------- name = __name__[__name__.rfind(".")+1 : ] elements = [] cycle_on_last = False #------------------...
Onirik79/aaritmud
src/enums/ENTITYPE.py
Python
gpl-2.0
1,664
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik <steven@wedontsleep.org> # # ...
mgorny/PyGithub
tests/BranchProtection.py
Python
lgpl-3.0
2,619
#!python """Bootstrap distribute installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from distribute_setup import use_setuptools use_setuptools() If you want to require a specific version of se...
victorlin/ez2pay
distribute_setup.py
Python
mit
15,758
#!/usr/bin/env python """alerts.py Classes for sendings alerts """ __author__ = "Jean-Martin Archer" __copyright__ = "Copyright 2013, MIT License." import smtplib from twilio.rest import TwilioRestClient from vendors.pushbullet.pushbullet import PushBullet import configuration class Alerts(object): """<ac:im...
j-martin/raspberry-gpio-zmq
raspzmq/alerts.py
Python
mit
3,371
import os import pty import json import pytest from contextlib import contextmanager from serjax.server import app as app_test from serjax.server import api, add_api_endpoints from serjax.client import serial add_api_endpoints(api) @contextmanager @pytest.fixture def fetch_api_lock(): """Context manager to setup ...
olymk2/serJax
tests/helper.py
Python
gpl-3.0
2,018
from seahub.base.models import UserEnabledModule, GroupEnabledModule from seahub.wiki.models import PersonalWiki MOD_PERSONAL_WIKI = 'personal wiki' MOD_GROUP_WIKI = 'group wiki' class BadModNameError(Exception): pass def get_available_mods_by_user(username): """Returns a list of available modules for user. ...
cloudcopy/seahub
seahub/views/modules.py
Python
apache-2.0
2,544
import unittest import numpy as np from kona.linalg.memory import KonaMemory from kona.user import UserSolverIDF from dummy_solver import DummySolver class DesignVectorTestCase(unittest.TestCase): def setUp(self): solver = DummySolver(10, 10, 0) self.km = km = KonaMemory(solver) km.desig...
OptimalDesignLab/Kona
src/kona/test/test_design_vector.py
Python
lgpl-3.0
7,369
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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 restri...
argentumproject/electrum-arg
lib/bitcoin.py
Python
mit
27,317
# coding=utf-8 """ Profiler utility for python Erik de Jonge erik@a8.nl license: gpl2 """ from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() import os...
erikdejonge/pyprofiler
pyprofiler/__init__.py
Python
gpl-2.0
2,901
class Background: """pre-game background image Attributes: filename (str): image filename included (int): is image included ? Todo: load() -load image from a file save() -save image to a file """ def __init__(self, filename="", included=0, size=0, ...
dderevjanik/agescx
agescx/controller/background.py
Python
mit
1,505
import tarfile import tempfile import os import os.path import re from django.core.files import File from storages.backends.s3boto3 import S3Boto3Storage from xml.etree import ElementTree from ..papers.models import SourceFile, SourceFileBulkTarball def convert_source_file_to_arxiv_id(filename): """ Convert...
arxiv-vanity/arxiv-vanity
arxiv_vanity/scraper/bulk_sources.py
Python
apache-2.0
4,230
# Copyright (C) 2008 AG Projects # Author: Ruud Klaver <ruud@ag-projects.com> # """Header encoding and decoding rules for communication between the dispatcher and relay components""" class EncodingError(Exception): pass class DecodingError(Exception): pass class MediaProxyHeaders(object): @classmetho...
misaksen/umediaproxy
mediaproxy/headers.py
Python
gpl-2.0
3,161
# This file is part of ranger, the console file manager. # License: GNU GPL version 3, see the file "AUTHORS" for details. # Author: Emanuel Guevel, 2013 # Author: Delisa Mason, 2015 """Interface for drawing images into the console This module provides functions to draw images in the terminal using supported implemen...
Vifon/ranger
ranger/ext/img_display.py
Python
gpl-3.0
16,218
import os import json import logging import random from django.conf import settings from backend.kubernetes.k8sclient import KubeClient from backend.schedule import DockerSchedulerFactory logger = logging.getLogger('hummer') def fetch_digest_from_response(response): """ Fetch the image digest from response...
wangtaoking1/hummer
backend/utils.py
Python
apache-2.0
1,817
#!/usr/bin/env python3 # Copyright (c) 2015-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 mulitple rpc user config option rpcauth # from test_framework.test_framework import BitcoinTest...
freemanjackal/bolsonarocoin
qa/rpc-tests/multi_rpc.py
Python
mit
4,581
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Clas...
Larvichee/StolenProjects
mysite/mysite/urls.py
Python
mit
822
import sys import numpy import math from foldyFloatList import foldyFloatList class OOBError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) from KMCLib.PluginInterfaces.KMCAnalysisPlugin import KMCAnalysisPlugin from KMCLib.Utilities.CheckU...
joshuahellier/PhDStuff
codes/thesisCodes/kmc/customAnalysis/DensHist.py
Python
mit
2,799
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado.escape import utf8, _unicode from tornado import gen from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy from tornado import httputil from tornado.http1connection...
mr-ping/tornado
tornado/simple_httpclient.py
Python
apache-2.0
24,731
# -*- coding: utf-8 -*- """ Models for the base application. All apps should use the BaseModel as parent for all models """ # standard library import json # django from django.contrib.sites.models import Site from django.db import models from django.utils import timezone from django.utils.translation import ugettext...
Angoreher/xcero
base/models.py
Python
mit
4,142
# -*- coding: utf-8 -*- __all__ = ('QLearning', ) import numpy as np import matplotlib.pyplot as plt from .NeuralNetwork import * class Cost: cost_history = [] def append(self, value): self.cost_history.append(value) return def show(self): ...
kelifrisk/justforfun
python/QLearning/DQN/QLearning.py
Python
mit
5,343
#!/usr/bin/env python3 # Copyright 2021 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 or ...
google/google-ctf
2021/quals/pwn-tridroid/attachments/server.py
Python
apache-2.0
4,265
from __future__ import absolute_import, unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name def get_absolut...
atruberg/django-custom
tests/contenttypes_tests/models.py
Python
bsd-3-clause
644
"""Extension to execute code outside the Python shell window. This adds the following commands: - Check module does a full syntax check of the current module. It also runs the tabnanny to catch any inconsistent tabs. - Run module executes the module's code in the __main__ namespace. The window must have been sa...
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/idlelib/ScriptBinding.py
Python
gpl-3.0
8,061
"""Implements generic utilities for monitoring classes. """ import sys import re import subprocess import urllib, urllib2 import socket import telnetlib __author__ = "Ali Onur Uyar" __copyright__ = "Copyright 2011, Ali Onur Uyar" __credits__ = [] __license__ = "GPL" __version__ = "0.9.12" __maintainer__ = "Ali Onur...
aouyar/PyMunin
pysysinfo/util.py
Python
gpl-3.0
13,551
import base64 import glob import os import re import threading import urllib import execjs from concurrent.futures import ThreadPoolExecutor from queue import Queue, Empty from core.login import Login from util.utils import HttpUtils class Crawler(Login): task_pool = Queue() process_thread = None book_id...
AaronGeist/Llama
biz/js518.py
Python
gpl-3.0
5,174
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
hjanime/VisTrails
vistrails/core/external_connection.py
Python
bsd-3-clause
12,398
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:13144") pwd = raw_input("Enter old wallet passphrase: ") pwd2 = raw_input("Enter new wallet passphrase: ") access.walletpassphrasechange(pwd, pwd2)
LiveChains/Live-Coin
contrib/wallettools/walletchangepass.py
Python
mit
220
#!/usr/bin/env python import os import sys from setuptools import find_packages, setup EXCLUDE_FROM_PACKAGES = ['nucleo.migrations', 'nucleo.fixtures'] version = __import__('nucleo').__version__ def get_required(): required_txt = os.path.join(os.path.dirname(__file__), 'requirements.txt') return open(requir...
Naible/django-nucleo
setup.py
Python
gpl-3.0
1,725
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # ssh - remote command wrappers using ssh/scp # Copyright (C) 2003-2014 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public ...
heromod/migrid
mig/shared/ssh.py
Python
gpl-2.0
13,910
# -*- coding: utf-8 -*- # # hl_api_types.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, o...
alberto-antonietti/nest-simulator
pynest/nest/lib/hl_api_types.py
Python
gpl-2.0
32,884
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICEN...
JioCloud/cinder
cinder/backup/manager.py
Python
apache-2.0
35,514
import yaml import unittest from bipy.toolbox import piranha from bcbio.utils import safe_makedir, file_exists import os from bipy.toolbox import reporting from bipy.utils import in2out STAGENAME = "piranha" class TestPiranha(unittest.TestCase): def setUp(self): self.config_file = os.path.join("test", S...
roryk/bipy
test/piranha/test_piranha.py
Python
mit
1,767
#!/usr/bin/python # -*- coding: utf-8 -*- from .__init__ import * from .object import Object from .control import Control from gi.repository import Gtk from gi.repository import Pango from gi.repository import PangoCairo class Table(Object): """This class represents a table""" __name__ = "Table"...
jmouriz/sanaviron
sanaviron/objects/table.py
Python
apache-2.0
4,006
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
jocave/snapcraft
snapcraft/tests/test_states_build.py
Python
gpl-3.0
2,391
#!/usr/bin/env python # # Copyright (C) 2007 SIOS Technology, 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 a...
arbn/pysaml2
tests/test_00_xmldsig.py
Python
bsd-2-clause
26,402
import time import socket from client import Client import util class SimpleClient(Client): def __init__(self, ip): Client.__init__(self) self.ip = ip def send_request(self,hostname): for whitelist_ip_port in self.whitelist: request = {"client_ip": self.ip, "hostname":hostname,"timestamp": str(time.time())...
xniccum/P2P-DNS
src/Client/SimpleClient.py
Python
gpl-3.0
745
# -*- coding: utf-8 -*- # @Author : Huangcc import requests import urllib from lxml import etree import re import datetime import codecs import time import random SLEEP = [0.5, 1, 1.5, 2, 2.5, 3] class BaiduZhidao(): search_url = 'https://zhidao.baidu.com/search?word={keyword}&ie=gbk&site=-1&sit...
huangchuchuan/Spider
BaiduZhidaoCommentSpider/baidu_zhidao_comment_spider.py
Python
apache-2.0
5,584
request = { "method": "GET", "uri": uri("/silly"), "version": (1, 1), "headers": [ ("AAAAAAAAAAAAA", "++++++++++") ], "body": "" }
pschanely/gunicorn
tests/requests/valid/004.py
Python
mit
162
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-05-17 19:20 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('core', '0013_auto_20180516_1559'), ...
cmjatai/cmj
cmj/agenda/migrations/0001_initial.py
Python
gpl-3.0
1,895
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA). """ # Author: Lars Buitinck <L.J.Buitinck@uva.nl> # Olivier Grisel <olivier.grisel@ensta.org> # Michael Becker <mike@beckerfuffle.com> # License: 3-clause BSD. import numpy as np import scipy.sparse as sp try: from scipy.sp...
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/decomposition/truncated_svd.py
Python
mit
7,897
# Copyright 2021 DeepMind Technologies Limited. 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 ...
deepmind/deepmind-research
wikigraphs/scripts/visualize_graph.py
Python
apache-2.0
5,249
"""Models for the builds app.""" from __future__ import absolute_import import logging import os.path import re from shutil import rmtree from builtins import object from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_u...
pombredanne/readthedocs.org
readthedocs/builds/models.py
Python
mit
17,368
# coding: utf8 # intente algo como from gluon import reserved_sql_keywords keywords = reserved_sql_keywords.POSTGRESQL def index(): return dict(message="hello from pgtest.py") @auth.requires_membership("manager") def test_keywords(): response.generic_patterns = ["*",] report = UL() fields = UL() for t...
bkahlerventer/web2congress
controllers/pgtest.py
Python
bsd-3-clause
726
#!/usr/bin/python # -*- coding:UTF-8 -*- # Copyright (c) Stephen Smally <stephen.smally@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 ...
hyperdriveguy/mint-software-center
src/threadingops.py
Python
gpl-2.0
9,535
#!/usr/bin/env python3 def say_hi(): print('Hi, this is mymodule speaking') __version__ = '0.1'
pam-phy/python-notes
byte-of-python/mymodule.py
Python
gpl-2.0
99
#!/usr/bin/env python import pika import os cloud_broker_host = os.environ.get('CLOUD_BROKER_HOST') cloud_broker_port = os.environ.get('CLOUD_BROKER_PORT') cloud_broker_auth = os.environ.get('CLOUD_BROKER_AUTH') cloud_username = cloud_broker_auth.split(':')[0] cloud_password = cloud_broker_auth.split(':')[1] # Connect...
cloudcomputinghust/IoT
test-component/receive_data_only.py
Python
mit
1,140
#!/usr/bin/env python ''' 006.py: https://projecteuler.net/problem=6 Sum Square Difference The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of...
ikumen/project-euler
solutions/006.py
Python
mit
1,157
import re import ephem from datetime import datetime, timedelta def valid_grid(grid): mo = re.match(r'^[A-R]{2}([0-9]{2}([a-x]{2})?)?$', grid, re.IGNORECASE) return mo is not None def grid_to_latlon(grid): if not valid_grid(grid): raise Exception('invalid grid locator %s' % grid) grid = grid...
lofaldli/satellite-tracker
tracker/utils.py
Python
mit
1,532
# coding:utf-8 """ Utility Tools for Jieba ======================= https://github.com/fxsjy/jieba "Jieba" (Chinese for "to stutter") Chinese text segmentation """ __author__ = "GE Ning <https://github.com/gening/>" __copyright__ = "Copyright (C) 2017 GE Ning" __license__ = "LGPL-3.0" __version__ = "1.0" from jieba ...
gening/nlp_util
nlp_util/jieba_nlp.py
Python
lgpl-3.0
842
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.http import Js...
suutari/shoop
shuup/simple_supplier/admin_module/views.py
Python
agpl-3.0
6,635
# -*- coding: utf-8 -*- """ Base Library (:mod:`refmanage`) =============================== .. currentmodule:: refmanage """ from version import __version__ from refmanage import * from reffile import RefFile, BibFile, NonbibFile import utils
jrsmith3/refmanage
refmanage/__init__.py
Python
mit
245
import TestData import TestGetItemDescriptionRequest import TestItemDatabase import TestBountyHunter import TestLogin import TestLogout from kol.util import Report import sys import unittest def main(argv=sys.argv): TestData.data["userName"] = argv[1] TestData.data["password"] = argv[2] Report.activeSecti...
ijzer/cwbot-ndy
kol/test/TestAll.py
Python
bsd-3-clause
725
# coding: utf-8 from __future__ import unicode_literals from datetime import datetime import io import logging import os from jinja2.exceptions import TemplateNotFound import jinja2 import json from mkdocs import nav, search, utils from mkdocs.relative_path_ext import RelativePathExtension import mkdocs log = loggi...
jpush/mkdocs
mkdocs/commands/build.py
Python
bsd-2-clause
9,619
import nengo import numpy as np model = nengo.Network() model.config[nengo.Ensemble].neuron_type=nengo.Direct() with model: x = nengo.Ensemble(100, 1, neuron_type=nengo.LIF()) y = nengo.Ensemble(100, 1, neuron_type=nengo.LIF()) nengo.Connection(x, y, function=lambda x: 1-4*(x-0.5...
tcstewar/nengo_learning_examples
rl/find_best.py
Python
gpl-3.0
1,066
""" :mod:`neo.io` provides classes for reading and/or writing electrophysiological data files. Note that if the package dependency is not satisfied for one io, it does not raise an error but a warning. :attr:`neo.io.iolist` provides a list of successfully imported io classes. Functions: .. autofunction:: neo.io.get...
JuliaSprenger/python-neo
neo/io/__init__.py
Python
bsd-3-clause
7,472
#!/usr/bin/env python # # Copyright 2015 British Broadcasting 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 # # Unless requ...
tjenkinson/dvbcss-synctiming
tests/test_detect.py
Python
apache-2.0
14,628
import logging class Logger(object): """ @summary: A common logger for this library """ def __init__(self): self.logger = logging.getLogger(__name__) logging.basicConfig(filename='master.log', filemode='a', format='%(asctime)s,%(msecs)d %(name...
wzin/interactivespaces-python-api
interactivespaces/misc.py
Python
apache-2.0
483
from utils import parse_date_string from . import app, configure, request, instance_method from . import get_or_create, commit from . import Resource, QueryResource, BaseIngestResource, RangeQuery from ..models.vms import Instance class IngestResource(BaseIngestResource): def ingest(self): """Ingest ins...
eResearchSA/reporting-unified
unified/apis/vms.py
Python
apache-2.0
1,198
#!/usr/bin/env python3 # This file is part of the Finna Pomodoro Project # Copyright (C) 2014 Vinícius dos Santos Oliveira <vini.ipsmaker@gmail.com> # # This software 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 Softwar...
finna-pomodoro-project/finna-pomodoro-pyclient
pypomodoro-toggle.py
Python
gpl-3.0
1,257
# BEGIN_COPYRIGHT # # Copyright (C) 2009-2013 CRS4. # # This file is part of biodoop-blast. # # biodoop-blast 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 opt...
crs4/biodoop-blast
setup.py
Python
gpl-3.0
3,496
#!/usr/bin/python # coding=utf-8 import time for x in range(0, 10): tempFile = open('/sys/class/thermal/thermal_zone0/temp') temp = float(tempFile.read()) tempC = temp / 1000 print("Raspberry Pi Temperature: %.2fC" % tempC) time.sleep(2)
kizniche/Mycodo
mycodo/tests/manual_tests/test_RPi_temperature.py
Python
gpl-3.0
260
import re ######################################## # GlslInt ############################## ######################################## class GlslInt: """GLSL integer.""" def __init__(self, source): """Constructor.""" if source[0] in ("-", "+"): self.__sign = source[0] se...
trilkk/dnload
dnload/glsl_int.py
Python
bsd-3-clause
3,332
#!/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. """ ZMQ example using python3's asyncio Bitcoin should be started with the command line argument...
nlgcoin/guldencoin-official
contrib/zmq/zmq_sub3.4.py
Python
mit
3,273
#!/usr/bin/env python """Interactive context using the PyGame API (provides navigation support)""" import string from OpenGLContext.pygamecontext import * from OpenGLContext import interactivecontext from OpenGLContext.move import viewplatformmixin class PygameInteractiveContext( viewplatformmixin.ViewPlatformM...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGLContext/pygameinteractivecontext.py
Python
lgpl-3.0
1,126