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 |
|---|---|---|---|---|---|
from django.conf.urls.defaults import *
__copyright__ = "Copyright 2011 Red Robot Studios Ltd."
__license__ = "GPL v3.0 http://www.gnu.org/licenses/gpl.html"
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'accounts/login.html'}, name='accounts_login'),
url(r... | andrewgleave/OpenElm | web/openelm/accounts/urls.py | Python | mit | 439 |
import subprocess
import os
import infra.basetest
class TestUbi(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
"""
BR2_TARGET_ROOTFS_UBIFS=y
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x7ff80
BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE=0x1
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_PEBSIZE=0x80000
BR2_T... | tSed/buildroot | support/testing/tests/fs/test_ubi.py | Python | gpl-2.0 | 1,436 |
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import MinMaxScaler
from tpot.builtins import ZeroCount
# NOTE: Make sure that the class is labeled 'class' in the data file... | deo1/deo1 | KaggleTitanic/models/model_2017_09_18_03_06_32-0.9989.py | Python | mit | 911 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
MAIL_TEMPLATE = """Return-Path: <whatever-2a840@postmaster.twitter.com>
To: {to}
cc: {cc}
Received: by mail1.openerp.com (Postfix, from userid 10002)
id 5DF9ABFB2A; Fri, 10 Aug 2012 16:16:39 +0200 (CEST)
From: {email... | ygol/odoo | addons/test_mail/data/test_mail_data.py | Python | agpl-3.0 | 34,003 |
# Python - 3.6.0
def find_2nd_largest(arr):
arr = sorted(set(filter(lambda x: type(x) is int, arr)))
return arr[-2] if len(arr) > 1 else None
| RevansChen/online-judge | Codewars/7kyu/find-the-2nd-largest-integer-in-array/Python/solution1.py | Python | mit | 151 |
# Copyright 2015 Observable Networks
#
# 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 ... | hjacobs/flowlogs-reader | flowlogs_reader/__main__.py | Python | apache-2.0 | 3,323 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... | stitchfix/pybossa | pybossa/sched.py | Python | agpl-3.0 | 7,613 |
config = {
"interfaces": {
"google.privacy.dlp.v2.DlpService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"http_get": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": [],
"no_retry": []
... | tseaver/gcloud-python | dlp/google/cloud/dlp_v2/gapic/dlp_service_client_config.py | Python | apache-2.0 | 6,096 |
import mpd
class MPDClientWrapper(mpd.MPDClient):
"""docstring for MPDClientWrapper"""
_host = "localhost"
_port = "6600"
def __init__(self, MPD_HOST, MPD_PORT):
super(MPDClientWrapper, self).__init__()
self._host = MPD_HOST
self._port = MPD_PORT
self.connect(MPD_HOST, MPD_PORT)
def playlistid(self):
... | leiflm/SimpleMPDVote | MPDClientWrapper.py | Python | lgpl-3.0 | 1,578 |
# -*- coding: utf-8 -*-
""" Swagger Fuzzer helps you do fuzzing testing on your Swagger APIs.
"""
import argparse
from urllib.parse import urlparse, urlunparse
import requests
from hypothesis import given, settings as hsettings, note
from swagger_spec_validator.util import get_validator
from .strategy import data
fro... | Lothiraldan/swagger-fuzzer | swagger_fuzzer/swagger_fuzzer.py | Python | mit | 2,463 |
# Author: Idan Gutman
# Modified by jkaberg, https://github.com/jkaberg for SceneAccess
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 Sof... | eXistenZNL/SickRage | sickbeard/providers/hdtorrents.py | Python | gpl-3.0 | 11,376 |
"""Unit tests!
""" | trycs/ozelot | ozelot/tests/__init__.py | Python | mit | 18 |
from collections import namedtuple
Datapoint = namedtuple("Datapoint", "phrase sentiment")
| ahmedshabib/evergreen-gainsight-hack | sentiment Analyser/samr/data.py | Python | mit | 93 |
import unittest
import numpy as np
from cleverhans.devtools.checks import CleverHansTest
class TestMNISTTutorialCW(CleverHansTest):
def test_mnist_tutorial_cw(self):
import tensorflow as tf
from cleverhans_tutorials import mnist_tutorial_cw
# Run the MNIST tutorial on a dataset of reduced... | cihangxie/cleverhans | tests_tf/test_mnist_tutorial_cw.py | Python | mit | 2,033 |
mustBeAdmin = ['You must be the webadmin to access this page.','danger']
mustBeStudentCoord = ['You must be a student coordinator to access this page.','danger']
from sockdefs import *
print("forming routes...")
monkey.patch_all()
# MAIN EVENTS PAGE #
@app.route('/', methods=['GET', 'POST'])
def index():
if requ... | theapricot/oppapp2 | app.py | Python | mit | 13,357 |
import itertools
import math
import time
import cPickle as pickle
from gensim import corpora
import numpy
from etl import ETLUtils
from evaluation import precision_in_top_n
from recommenders.context import basic_knn
# from recommenders.context.basic.basic_contextual_knn import BasicContextualKNN
from recommenders.co... | melqkiades/yelp | source/python/recommenders/context/context_knn.py | Python | lgpl-2.1 | 20,100 |
file = open("grid.txt", "r")
nums = []
maxProduct = 0
line = file.readline()
while line != "":
nums.append([int(x) for x in line.rstrip().split(" ")])
line = file.readline()
for i in range(0, len(nums)):
for j in range(0, len(nums[i]) - 4):
p = nums[i][j] * nums[i][j+1] * nums[i][j+2] * nums[i][j+... | dkaisers/Project-Euler | 011/11.py | Python | unlicense | 938 |
def nama ():
gelar = "Bapak"
aksi = (lambda x: gelar + " " + x)
return aksi
tulis_nama = nama ()
act = nama()
#Penggunaan nya dengan menuliskan act("Nama anda")
z = (lambda a = "tic", b = "tac", c = "toe" : a + b + c)
#Penggunaan lambda dengan perjumlahan bernilai string
#Penggunaan z("string")
f = lam... | GunadarmaC0d3/Gilang-Aditya-Rahman | Python/Penggunaan fungsi def dan lambda dalam operator penjumlahan.py | Python | gpl-2.0 | 483 |
"""
Drop the package table's ``file_id`` column.
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f3f9957de30c'
down_revision = '8f6ba74cfa82'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table('pkg', schema=None) as batch_op:
... | layday/instawow | src/instawow/migrations/versions/f3f9957de30c_drop_file_id.py | Python | gpl-3.0 | 520 |
#!/usr/bin/env python
import sys
MIN_SUPPORT = 1400
movieNameDictionary = {}
def initializeMovieNames():
movieFile = open('movies.dat', 'r')
#print "reading movies.dat"
for dataline in movieFile:
#print "*****"
moviedata = dataline.split('::')
movieID = int(moviedat... | jatinmistry13/PrimitiveRecommenderSystem | Task4-SON/src/SON_Reduce.py | Python | mit | 1,470 |
# By Ed Cashin (ed.cashin at acm dot org), committed by Andrew Fleenor
"""ATA over Ethernet Protocol."""
import struct
import dpkt
class AOE(dpkt.Packet):
__hdr__ = (
('ver_fl', 'B', 0x10),
('err', 'B', 0),
('maj', 'H', 0),
('min', 'B', 0),
('cmd', 'B', 0),
('ta... | Turkingwang/dpkt | dpkt/aoe.py | Python | bsd-3-clause | 1,769 |
from django.db import models
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
class CommentManager(models.Manager):
def all(self):
qs = super(CommentMana... | timle1/try_django_1_10 | comments/models.py | Python | mit | 2,432 |
# https://leetcode.com/problems/shortest-distance-to-a-character/
# Given a string s and a character c that occurs in s,
# return an array of integers answer where answer.length == s.length and
# answer[i] is the distance from index i to the closest occurrence of character c in s.
# The distance between two indices i a... | anu-ka/coding-problems | Python/shortest_distance.py | Python | mit | 1,228 |
from getpass import getpass
from hyperlink import URL
import spotipy.util
USERNAME = ";-.-;"
CLIENT_ID = u"9c3971b106ea4e019c04967a0974b1af"
DASHBOARD = URL(scheme=u"https", host=u"beta.developer.spotify.com").child(
u"dashboard", u"applications", CLIENT_ID,
)
PROMPT = "Client Secret (" + DASHBOARD.to_text().enc... | Julian/Great | automanual/spotify_token.py | Python | mit | 543 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 sw=4 sts=4 et :
#
# Copyright (c) 2007 Piotr Jaroszyński
#
# This file is part of the Paludis package manager. Paludis is free software;
# you can redistribute it and/or modify it under the terms of the GNU General
# Public License version 2, as published by the Free... | impulze/paludis | python/contents_TEST.py | Python | gpl-2.0 | 2,612 |
"""Forms to render HTML input & validate request data."""
from wtforms import Form, BooleanField, DateTimeField, PasswordField
from wtforms import TextAreaField, TextField
from wtforms.validators import Length, required
class AppointmentForm(Form):
"""Render HTML input for Appointment model & validate submission... | abacuspix/NFV_project | Instant_Flask_Web_Development/sched/forms.py | Python | mit | 1,083 |
"""
Tests for course group views
"""
# pylint: disable=attribute-defined-outside-init
# pylint: disable=no-member
import json
from collections import namedtuple
from django.contrib.auth.models import User
from django.http import Http404
from django.test.client import RequestFactory
from django_comment_common.models im... | philanthropy-u/edx-platform | openedx/core/djangoapps/course_groups/tests/test_views.py | Python | agpl-3.0 | 49,756 |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import image_transform
import layers
import preprocess
import postprocess
import objectives
import theano_printer
import update... | 317070/kaggle-heart | configurations/je_meta_fixedaggr_jsc80leakyconv_augzoombright_short.py | Python | mit | 7,486 |
# Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | VeritasOS/cloud-custodian | c7n/resources/simpledb.py | Python | apache-2.0 | 2,048 |
"""(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017"""
from django.conf.urls import url, include
from api import views
urlpatterns = [
url(r'^$', views.index),
url(r'^v1/', include('api.urls')),
]
| epfl-idevelop/amm | src/config/urls.py | Python | mit | 249 |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC calls related to net.
Tests correspond... | aurarad/auroracoin | test/functional/rpc_net.py | Python | mit | 7,965 |
# Copyright (c) 2018 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 app... | Canpio/Paddle | python/paddle/fluid/tests/unittests/test_minus_op.py | Python | apache-2.0 | 1,171 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.conf import settings
def context_settings(request):
context = dict()
context['GOOGLE_ANALYTICS_ID'] = settings.GOOGLE_ANALYTICS_ID
return context
| djangocon/2017.djangocon.eu | conference/context_processors.py | Python | bsd-3-clause | 270 |
import unittest
from mygrations.formats.mysql.file_reader.parsers.type_numeric import TypeNumeric
class TestTypeNumeric(unittest.TestCase):
def test_simple(self):
# parse typical insert values
parser = TypeNumeric()
returned = parser.parse("created int(10) not null default 0,")
se... | cmancone/mygrations | mygrations/formats/mysql/file_reader/parsers/type_numeric_test.py | Python | mit | 2,633 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Ignacio Rossi
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option)... | pignacio/pignacio_scripts | pignacio_scripts/namedtuple/__init__.py | Python | lgpl-2.1 | 1,029 |
from setuptools import (
setup,
find_packages,
)
setup(
name='azmq',
author='Julien Kauffmann',
author_email='julien.kauffmann@freelan.org',
maintainer='Julien Kauffmann',
maintainer_email='julien.kauffmann@freelan.org',
version=open('VERSION').read().strip(),
url='http://ereOn.gith... | ereOn/azmq | setup.py | Python | gpl-3.0 | 1,177 |
from __future__ import print_function
import argparse
import inspect
import os
import cluster_config as cc
from cluster_config.utils import convert
from cluster_config.cdh.cluster import Cluster, save_to_json
from cluster_config.utils import file, log
def cli(parser=None):
if parser is None:
parser = ar... | tapanalyticstoolkit/cluster-config | cluster_config/generate.py | Python | apache-2.0 | 3,862 |
# Copyright initOS GmbH 2016
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': "Website Canonical URL",
'summary': "Canonical URL in Website Headers",
'author': "initOS GmbH, Tecnativa, "
"Camptocamp, Odoo Community Association (OCA)",
'website': "https://github.co... | Vauxoo/website | website_canonical_url/__manifest__.py | Python | agpl-3.0 | 597 |
from __future__ import unicode_literals
from fig.project import Project, ConfigurationError
from fig.container import Container
from .testcases import DockerClientTestCase
class ProjectTest(DockerClientTestCase):
def test_volumes_from_service(self):
project = Project.from_config(
name='figtest... | heroku/fig | tests/integration/project_test.py | Python | apache-2.0 | 8,790 |
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its
# affiliates and/or its licensors.
#
from .entity import EntityTranslator
from ..converters.default import convert_links, convert_project
class SceneTranslator(EntityTranslator):
"""
Scene property translator.
Assigni... | xxxIsaacPeralxxx/anim-studio-tools | grenade/sources/grenade/translators/scene.py | Python | gpl-3.0 | 1,937 |
change_title = widget_inputs["check1"]
consolidate_inputs = widget_inputs["check2"]
better_validation = widget_inputs["check3"]
add_more_questions = widget_inputs["check4"]
comments = []
def commentizer(new):
if new not in comments:
comments.append(new)
is_correct = False
if change_title:
is_correct ... | udacity/course-web-forms | widget_quizzes/L1_4q_fixthisform.py | Python | mit | 1,363 |
"""An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest log... | babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/ftplib.py | Python | mit | 29,598 |
############################################################################
# This file is part of the Maui Web site.
#
# Copyright (c) 2012 Pier Luigi Fiorini
#
# Author(s):
# Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
#
# $BEGIN_LICENSE:AGPL3+$
#
# This program is free software: you can redistribute it and/... | HengeSense/website | website/views.py | Python | agpl-3.0 | 3,342 |
"""
.15925 Editor
Copyright 2014 TechInvestLab.ru dot15926@gmail.com
.15925 Editor is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.... | TechInvestLab/dot15926 | editor_qt/iso15926/common/dialogs.py | Python | lgpl-3.0 | 14,622 |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | TeXitoi/navitia | source/tyr/tyr/binarisation.py | Python | agpl-3.0 | 16,911 |
# Fall 2015 6.034 Lab 2: Search
import xmlrpclib
import traceback
import sys
import os
import tarfile
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
"""
try:
from key import USERNAME as username, PASSWORD as password, XMLRPC_URL as server_url
except ImportError:
... | jasonleaster/MIT_6.034_2015 | lab2/tester.py | Python | gpl-2.0 | 13,241 |
# 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 ag... | Sorsly/subtle | google-cloud-sdk/lib/googlecloudsdk/api_lib/test/matrix_ops.py | Python | mit | 12,616 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 confirm IT solutions
#
# 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, mo... | confirm/ansibleci | ansibleci/test.py | Python | mit | 2,788 |
# Copyright 2014 - Mirantis, Inc.
# Copyright 2014 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | StackStorm/mistral | mistral/actions/std_actions.py | Python | apache-2.0 | 15,111 |
# -*- coding: utf-8 -*-
## $Id: webmessage_webinterface.py,v 1.13 2008/03/12 16:48:08 tibor Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 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 t... | kaplun/Invenio-OpenAIRE | modules/bibexport/lib/bibexport_method_fieldexporter_webinterface.py | Python | gpl-2.0 | 22,858 |
from django.db import models
from datasources.models import RealTime
class AbstractStopTime(models.Model):
trip_id = models.CharField(max_length=255)
stop_id = models.CharField(max_length=255)
stop_sequence = models.IntegerField()
## Char fields to match scala's definition of gtfs_stop_types
... | WorldBank-Transport/open-transit-indicators | python/django/gtfs_realtime/models.py | Python | gpl-3.0 | 884 |
def count(text):
"""Count the number of words in a text."""
words = text.split()
return len(words)
def find(text, word):
"""Check if a word is present in a text."""
words = text.split()
for w in words:
if w == word:
return True
return False
if __name__ == '__main__':
text = """
Lorem ipsum... | root-mirror/training | BasicCourse/Exercises/PythonInterface/PythonTutorial.py | Python | gpl-2.0 | 594 |
#!/usr/bin/python
import os, sys, argparse, json, markdown, urllib, re
parser = argparse.ArgumentParser(description='Creates index.html for the upload')
parser.add_argument('-d', dest='dir', required=True, help='target directory')
parser.add_argument('-t', dest='type', required=True, help='type of index (root, builds... | mbits-os/JiraDesktop | installer/www/index.py | Python | mit | 19,475 |
"""Configuration for the test hosts requested by the user."""
from __future__ import annotations
import abc
import dataclasses
import enum
import os
import pickle
import sys
import typing as t
from .constants import (
SUPPORTED_PYTHON_VERSIONS,
)
from .io import (
open_binary_file,
)
from .completion import... | nitzmahone/ansible | test/lib/ansible_test/_internal/host_configs.py | Python | gpl-3.0 | 17,563 |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def CMC():
return 'Welcome to the Container Master Class by Cerulean Canvas'
if __name__ == '__main__':
app.run(host='0.0.0.0')
| tarsoqueiroz/Docker | Study/Oreilly Kubernetes and Docker/s2d9/app.py | Python | mit | 198 |
import sys
def bye():
sys.exit(40) # Crucial error: abort now!
try:
bye()
except Exception:
print('got it') # Oops--we ignored the exit
print('continuing...')
| simontakite/sysadmin | pythonscripts/learningPython/exiter2.py | Python | gpl-2.0 | 208 |
# 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 use ... | elastacloud/libcloud | libcloud/compute/drivers/ec2.py | Python | apache-2.0 | 156,169 |
from __future__ import absolute_import, unicode_literals
class Person(object):
def __init__(self, data):
# primary attributes that should be set in all cases
self.name = self._extract_name(data)
self.imdb_id = self._extract_imdb_id(data)
self.photo_url = self._extract_photo_url(d... | logituit/Recbot | PY/imdbpie/objects.py | Python | mit | 7,777 |
# -*- coding: utf-8 -*-
#
#
# Project name: OpenVAS2Report: A set of tools to manager OpenVAS XML report files.
# Project URL: https://github.com/cr0hn/openvas_to_report
#
# Copyright (c) 2015, cr0hn<-AT->cr0hn.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificatio... | cr0hn/openvas_to_report | openvas_to_report/examples/__init__.py | Python | bsd-3-clause | 1,761 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | eXistenZNL/SickRage | sickbeard/notifiers/emby.py | Python | gpl-3.0 | 4,138 |
from setuptools import setup
setup(name='joinmarketbitcoin',
version='0.9.0',
description='Joinmarket client library for Bitcoin coinjoins',
url='http://github.com/Joinmarket-Org/joinmarket-clientserver/jmbitcoin',
author='',
author_email='',
license='GPL',
packages=['jmbitco... | undeath/joinmarket-clientserver | jmbitcoin/setup.py | Python | gpl-3.0 | 472 |
import win32com.server.util
import win32com.client
import pythoncom
import winerror
import win32com.test.util
import unittest
class Error(Exception):
pass
# An object representing a list of numbers
class PythonSemanticClass:
_public_methods_ = ["In"] # DISPIDs are allocated.
_dispid_to_fun... | zhanqxun/cv_fish | win32com/test/policySemantics.py | Python | apache-2.0 | 3,061 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Sub programs for doing the measurements
author : Eoin O'Farrell
email : phyoec@nus.edu.sg
last edited : July 2013
Explantion:
There are 3 variables in our instrument:
1 Temperature
2 Field
3 Device parameter; e.g. Backgate V, Topgate V, Current, Angle (one day)
T... | ectof/Fridge | MeasurementSubs.py | Python | mit | 21,736 |
"""
GravMag: 3D gravity gradient inversion by planting anomalous densities using
``harvester`` (with non-targeted sources)
"""
from fatiando import gridder, utils
from fatiando.gravmag import prism, harvester
from fatiando.mesher import Prism, PrismMesh, vremove
from fatiando.vis import mpl, myv
# Generate a synthetic... | drandykass/fatiando | cookbook/gravmag_harvester_tensor.py | Python | bsd-3-clause | 3,670 |
# Author: Daryl Harrison
# Enthought library imports.
from enthought.traits.api import HasTraits, Instance, String
from enthought.tvtk.api import tvtk
# Local imports.
from os import path
######################################################################
# `TriangleWriter` class
#################################... | rjferrier/fluidity | mayavi/mayavi_amcg/triangle_writer.py | Python | lgpl-2.1 | 4,638 |
# -*- coding: utf-8 -*-
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
exchanges = {} # a placeholder for your instances
for id in ccxt.exchanges:
exchange = getattr(ccxt, id)
exchanges[id... | ccxt/ccxt | examples/py/instantiate-all-at-once.py | Python | mit | 447 |
__author__ = 'Anton'
| plankter/augeo-cloud | events/__init__.py | Python | mit | 21 |
"""
Unit tests for the methods in the NMF class (/code/nmf_np.py).
"""
import sys, os
project_location = os.path.dirname(__file__)+"/../../../"
sys.path.append(project_location)
import numpy, math, pytest, itertools
from BNMTF.code.models.nmf_np import NMF
""" Test the initialisation of Omega """
def test_init():
... | ThomasBrouwer/BNMTF | tests/code/test_nmf_np.py | Python | apache-2.0 | 8,379 |
###########################################################################
# (C) 2016 Elettra - Sincrotrone Trieste S.C.p.A.. All rights reserved. #
# #
# #
# This file is ... | ElettraSciComp/STP-Core | STP-Core/phaseretrieval/tiehom.py | Python | gpl-3.0 | 5,373 |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'http://thbs600.neill.id.au'
RELATIVE_URLS = F... | neillc/thbs600 | publishconf.py | Python | gpl-3.0 | 534 |
#
# This file is part of gruvi. Gruvi is free software available under the
# terms of the MIT license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2012-2017 the gruvi authors. See the file "AUTHORS" for a
# complete list.
from __future__ import a... | swegener/gruvi | tests/test_logging.py | Python | mit | 6,559 |
import matasano_crypto_solutions.set2 as s
def test_task_9():
res9 = s.pad_with_pkcs7(b'YELLOW SUBMARINE', 20)
assert res9 == b'YELLOW SUBMARINE\x04\x04\x04\x04'
def test_task_10():
ciphertext10 = s.base64_to_bytes(s.get_file('10.txt'))
password10 = b'YELLOW SUBMARINE'
iv = b'\x00' * 16
res1... | ismail-s/Matasano-Crypto-Solutions | tests/test_set2.py | Python | mit | 1,035 |
#!/usr/bin/python
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
from optparse ... | qt-haiku/LibreOffice | bin/mvn.py | Python | gpl-3.0 | 1,775 |
import os
from xml.sax.saxutils import quoteattr
from json import JSONEncoder
from lit.BooleanExpression import BooleanExpression
# Test result codes.
class ResultCode(object):
"""Test result codes."""
# We override __new__ and __getnewargs__ to ensure that pickling still
# provides unique ResultCode ob... | GPUOpen-Drivers/llvm | utils/lit/lit/Test.py | Python | apache-2.0 | 14,188 |
from canvas_sdk import client
from collections import defaultdict
"""
The util module contains helper methods for the SDK
"""
def validate_attr_is_acceptable(value, acceptable_values=[], allow_none=True):
"""
Test an input value against a list of acceptable values. A value of None may or may
not be cons... | penzance/canvas_python_sdk | canvas_sdk/utils.py | Python | mit | 4,413 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def migrate_steam_ids(apps, schema_editor):
LeagueRating = apps.get_model('users', 'LeagueRating')
for rating in LeagueRating.objects.all():
# Get the Steam ID for this user.
rating.steam... | rocket-league-replays/rocket-league-replays | rocket_league/apps/users/migrations/0006_steam_id_migration.py | Python | gpl-3.0 | 612 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Niklas Hauser
# All rights reserved.
#
# The file is part of my bachelor thesis and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
# -------------------------------------------------------... | salkinium/bachelor | link_analysis/experiment_parser_big_small.py | Python | bsd-2-clause | 2,964 |
from canvasapi.canvas_object import CanvasObject
from canvasapi.exceptions import RequiredFieldMissing
from canvasapi.paginated_list import PaginatedList
from canvasapi.util import combine_kwargs, obj_or_id
class Module(CanvasObject):
def __str__(self):
return "{} ({})".format(self.name, self.id)
def... | ucfopen/canvasapi | canvasapi/module.py | Python | mit | 8,462 |
#! /usr/bin/env python
from ppclass import pp
import numpy as np
## settings
#fi = ["nest1_rad.nc","nest2_rad.nc","nest3_rad.nc"]
#fi = ["PHOENIX_water/my29_start03_top10km/wrfout_d01_9999-01-01_02:03:21"]
#fi = ["PHOENIX_water/old_to_compare_with/wrfout_d01_9999-01-01_07:11:42"]
#fi = ["wrfout_d01_9999-01-01_06:10:00... | aymeric-spiga/planetoplot | examples/ppclass_additional/maskradius2.py | Python | gpl-2.0 | 1,722 |
class Solution(object):
def isPowerOfTwo(self, n):
"""
:type n: int
:rtype: bool
"""
if n <= 0:
return False
elif n in (1, 2):
return True
while n > 1:
if n % 2 != 0:
return False
n = n // 2
... | mistwave/leetcode | Python3/no231_Power_of_Two.py | Python | mit | 335 |
# -*- python -*-
# Copyright (C) 2009-2016 Free Software Foundation, Inc.
# 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 your option) any later versio... | ATM-HSW/mbed_target | buildtools/gcc-arm-none-eabi-6-2017-q2/arm-none-eabi/lib/thumb/v8-m.main/fpv5-sp/hard/libstdc++.a-gdb.py | Python | apache-2.0 | 2,550 |
# pylint: disable=unused-argument
# 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.... | sekikn/incubator-airflow | tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py | Python | apache-2.0 | 23,781 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import product_pricelist
| vileopratama/vitech | src/addons/product/report/__init__.py | Python | mit | 124 |
import logging
from datetime import timedelta
from django.db import models, transaction
from django.db.models import Q, Sum
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from dateutil.relativedelta import relativedelta
from mymoney.apps.bank... | ychab/mymoney | mymoney/apps/banktransactionschedulers/models.py | Python | bsd-3-clause | 6,239 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | alshedivat/tensorflow | tensorflow/python/framework/test_util.py | Python | apache-2.0 | 79,316 |
# This file is part of the PySide project.
#
# Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
# Copyright (C) 2010 Riverbank Computing Limited.
# Copyright (C) 2009 Torsten Marek
#
# Contact: PySide team <pyside@openbossa.org>
#
# This program is free software; you can redistribute it and/or
# m... | PySide/pyside-tools2 | pyside2uic/Compiler/qtproxies.py | Python | gpl-2.0 | 13,994 |
"""
A suffix tree implementation in Python
Algorithm:
Ukkonen E. On-line construction of suffix trees[J]. Algorithmica, 1995, 14(3): 249-260.
https://www.cs.helsinki.fi/u/ukkonen/SuffixT1withFigs.pdf
Author:
Luyu (taoistly@gmail.com)
"""
import collections
class SuffixTree(object):... | taoistly/dec | suffixtree.py | Python | mit | 5,627 |
from django.contrib import admin
from nonprofit.mailroom.models import Slot
class SlotAdmin(admin.ModelAdmin):
list_display = ('description','forward_to','enabled')
admin.site.register(Slot, SlotAdmin) | sunlightlabs/django-nonprofit | nonprofit/mailroom/admin.py | Python | bsd-3-clause | 207 |
# Copyright 2014 NEC Corporation. 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 ... | afaheem88/tempest_neutron | tempest/api_schema/response/compute/v2/limits.py | Python | apache-2.0 | 4,541 |
import os
THREAD_SLEEP = 0.001
PROTOCOL_VERSION = 1
MAX_PACKAGE_DATA = 548 # 576 MTU - 20 IPv4 Header - 8 UDP Header == 548
STORJ_HOME = os.path.join(os.path.expanduser("~"), ".storj")
CONFIG_PATH = os.path.join(STORJ_HOME, "config.json")
| Storj/storjnode | storjnode/common.py | Python | mit | 243 |
#
# This file is part of Plinth.
#
# 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 version.
#
# This program is distribute... | freedomboxtwh/Plinth | plinth/__init__.py | Python | agpl-3.0 | 750 |
import urllib
import threading
import timeit
import stockretriever
global lock
lock = threading.Lock()
def getRSI (symbol):
url = "https://chartapi.finance.yahoo.com/instrument/1.0/"+symbol+"/chartdata;type=rsi;ys=2014;yz=2;ts=1234567890/csv?period=14"
htmltext = urllib.urlopen(url).read()
stockinfo = sto... | fro391/Investing | Archive/RSI.py | Python | gpl-2.0 | 1,581 |
# Generated by Django 3.0.8 on 2020-07-20 01:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('jobs', '0002_auto_20200708_2203'),
('accounts', '0002_models'),
('projects', '0004_add_project_temporary'),
... | stencila/hub | manager/projects/migrations/0005_auto_20200720_0116.py | Python | apache-2.0 | 905 |
"""
Author: Shameer Sathar
"""
import csv
class ARFFcsvReader:
"""
Operates on WEKA generated output file of predictions.
The file is parsed and the predictions are returned as 1D numpy array.
"""
def __init__(self, file_name):
"""
:param file_name: WEKA generated csv file nam... | ssat335/GuiPlotting | ARFFcsvReader.py | Python | mit | 1,379 |
#!/usr/bin/env python
'''
Utilities for boilerplate model, which uses dSPP (https://peptone.io/dssp) dataset.
Peptone Inc. - The Protein Intelligence Company (https://peptone.io)
'''
from __future__ import print_function
from keras.callbacks import Callback
import numpy as np
import tensorflow as tf
class Struct:
... | PeptoneInc/dspp-keras | examples/utils.py | Python | agpl-3.0 | 2,733 |
# Copyright 2014 Mathew Odden
#
# 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 i... | locke105/scrapbin | scrapbin/flaskapi.py | Python | apache-2.0 | 2,951 |
import os
import time
import json
from pymongo import MongoClient
from settings import Settings
dataset_file = Settings.DATASET_FILE
reviews_collection = MongoClient(Settings.MONGO_CONNECTION_STRING)[Settings.REVIEWS_DATABASE][
Settings.REVIEWS_COLLECTION]
count = 0
done = 0
start = time.time()
with open(data... | postfix/topics | yelp/yelp-reviews.py | Python | apache-2.0 | 988 |
"""
Role tests
"""
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_sftp_group(host):
"""
Test dedicated group
"""
assert host.group('sftp-users').exists
@pytest.m... | Temelio/ansible-role-sftp | molecule/default/tests/test_installation.py | Python | mit | 1,610 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread 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:
# 1. Redistributions of source code must retain the above copyright
# notic... | erja-gp/openthread | tools/harness-automation/cases/router_9_2_14.py | Python | bsd-3-clause | 1,877 |
from setuptools import setup, find_packages
setup(name='MODEL0913003363',
version=20140916,
description='MODEL0913003363 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL0913003363',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... | biomodels/MODEL0913003363 | setup.py | Python | cc0-1.0 | 377 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.