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 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Story.added_by'
db.add_column(u'stories_story', 'added_by',
self.gf('d... | ebrelsford/growing_cities | growing_cities/stories/migrations/0004_auto__add_field_story_added_by.py | Python | gpl-3.0 | 6,200 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | torypages/luigi | test/minicluster.py | Python | apache-2.0 | 3,127 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | sleepsonthefloor/openstack-dashboard | django-nova/src/django_nova/templatetags/truncate_filter.py | Python | apache-2.0 | 1,058 |
#!/usr/bin/python
#
# Copyright (C) 2012 Intel Corporation
#
# 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 2
# of the License, or (at your option) any later version.
#
# This p... | testkit/testkit-lite | testkitlite/engines/webdriver.py | Python | gpl-2.0 | 12,327 |
from django.core.management.base import BaseCommand, CommandError
from tmv_app.models import *
import numpy as np
from sklearn.decomposition import NMF
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from scipy.sparse import csr_matrix, find
from functools import partial
from multiprocess i... | mcallaghan/tmv | BasicBrowser/tmv_app/management/commands/nmf.py | Python | gpl-3.0 | 6,298 |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 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 the pruning code.
WARNING:
This test uses 4GB of disk space.
This test takes 30 mins or more (up ... | sebrandon1/bitcoin | test/functional/feature_pruning.py | Python | mit | 21,020 |
from django.conf.urls import url
# Import Class Based Views
from .views import IndexView
urlpatterns = (
url(r'^$', IndexView.as_view(), name='index_view'),
)
| CarlosMart626/umusicfy | umusicfy/index/urls.py | Python | apache-2.0 | 166 |
# test suite for launch() method in Shine.Lustre.Actions.*
# Copyright (C) 2013-2017 CEA
#
# This file is part of shine
#
# 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 2
# of th... | bullxpfs/lustre-shine | tests/Lustre/Actions/LaunchTest.py | Python | gpl-2.0 | 36,484 |
# -*- coding: utf-8 -*-
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
REQUIRES = [
'docopt',
]
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = Tr... | ClarkMitchell/songipy | setup.py | Python | mit | 2,168 |
# This file is part of SickRage.
#
# URL: https://www.sickrage.ca
# Git: https://git.sickrage.ca/SiCKRAGE/sickrage.git
#
# 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 Licen... | gborri/SickRage | sickrage/core/media/network.py | Python | gpl-3.0 | 1,535 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2017 Stephen Bunn (stephen@bunn.io)
# GNU GPLv3 <https://www.gnu.org/licenses/gpl-3.0.en.html>
from .obvius import *
| ritashugisha/neat | tests/requester/__init__.py | Python | gpl-3.0 | 184 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# led_task.py
#
# This module provides a Clery task interface to set specified led states
# via the Fadecandy server
#
# the functions in this module should interact directly with Fadecandy
#
# the Celery tasks defined in this module should be intended to be r... | bbulkow/MagnusFlora | flask/led_task.py | Python | mit | 2,997 |
# -*- coding: utf-8
import types
# default priorities
PRIO_OFFSET = 100
PRIO_PREFIX = 500
PRIO_TYPE = 600
PRIO_LENGTH = 700
PRIO_MAXLENGTH = 750
PRIO_NBOUNDS = 800
class IConstraint(object):
def __init__(self, priority):
self.priority = priority
def __str__(self):
return self.__class__.__nam... | ikex/telepathy-sunshine-ike | sunshine/lqsoft/cstruct/constraints.py | Python | gpl-3.0 | 6,323 |
#!/usr/bin/env python
'''
Gimp plugin "Enlarge and resynthesize"
Author:
lloyd konneker
Based on smart_enlarge.scm 2000 by Paul Harrison.
Version:
1.0 lloyd konneker lkk 2010 Initial version in python.
License:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Gener... | opengraphix/misdotfiles | config/gimp/2.8/plug-ins/plugin-resynth-enlarge.py | Python | mit | 3,303 |
# -*- coding:utf-8 -*-
'''
fio测试工具执行脚本
'''
import os,shutil,re,time,sys,copy
from test import BaseTest
from lpt.lib.error import *
from lpt.lib import lptxml
from lpt.lib import lptlog
from lpt.lib.share import utils
from lpt.lib import lptreport
class TestControl(BaseTest):
'''
继承BaseTest属性和方法
'''
... | ShaolongHu/lpts | tests/netperf.py | Python | gpl-2.0 | 5,260 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models,fields, api, _
class CrmTeam(models.Model):
_inherit = 'crm.team'
def _compute_dashboard_button_name(self):
super(CrmTeam, self)._compute_dashboard_button_name()
teams_w... | t3dev/odoo | addons/sale_crm/models/crm_team.py | Python | gpl-3.0 | 1,832 |
import sys
import os
if __name__ == '__main__':
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.insert(0, par... | Pedram26/Humans-vs-Aliens | HumansAliens.app/Contents/Resources/lib/python2.7/pygame/tests/font_test.py | Python | apache-2.0 | 21,363 |
"""
TEST CASES:
Test.describe("Basic tests")
col_arr = [["6B8E23", "9ACD32","2E8B57","00008B", "00FF00","6B8E23","00FA9A"],
["CD5C5C", "8B0000", "FF0000", "F08080", "98FB98", "DC143C"],
["00BFFF", "00008B", "B22222", "000080", "87CEEB", "4169E1"]]
Test.assert_equals(get_colors(col_arr),"Green+Blue,Red+Green,Blue+Red"... | bgarnaat/codewars_katas | src/python/6kyu/arrays_and_hex_color_codes/test_arrays_and_hex_color_codes.py | Python | mit | 2,154 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import date_diff, flt
def execute(filters=None):
if not filters: filters = {}
communication_l... | ovresko/erpnext | erpnext/crm/report/lead_conversion_time/lead_conversion_time.py | Python | gpl-3.0 | 2,916 |
"""Tests for the module 'api_v1'."""
import pytest
from f8a_jobs.scheduler import Scheduler, ScheduleJobError
import f8a_jobs.handlers as handlers
class TestScheduler(object):
"""Tests for the module 'scheduler'."""
def setup_method(self, method):
"""Set up any state tied to the execution of the gi... | fabric8-analytics/fabric8-analytics-jobs | tests/test_scheduler.py | Python | apache-2.0 | 2,583 |
#!/usr/bin/python
#
# So this script is in a bit of a hack state right now.
# This script reads
#
#
#
# Graciously copied and modified from:
# http://graphics.cs.cmu.edu/projects/im2gps/flickr_code.html
#Image querying script written by Tamara Berg,
#and extended heavily James Hays
#9/26/2007 added dynamic timesli... | intelie/pycollector | src/third/SimpleCV/MachineLearning/query_imgs/get_imgs_geo_gps_search.py | Python | bsd-3-clause | 16,223 |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | zodiac/incubator-airflow | tests/models.py | Python | apache-2.0 | 24,568 |
# (C) 2013, James Cammarata <jcammarata@ansible.com>
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import tarfile
import u... | Dhivyap/ansible | lib/ansible/galaxy/api.py | Python | gpl-3.0 | 23,872 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Retrieved from Wikipedia
isoLangs = {
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
"name":"Afar",
"nativeName":"Afaraf"
},
"af":{
"name":"Afrikaans",
"nativeName":"Afrikaans"
},
"ak":{
... | simudream/polyglot | polyglot/detect/langids.py | Python | gpl-3.0 | 17,897 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Registration.student'
db.add_column('classes_registration', 'student',
... | knowledgecommonsdc/kcdc3 | kcdc3/apps/classes/migrations/0006_auto__add_field_registration_student__add_field_registration_event__ad.py | Python | mit | 6,793 |
# -*- coding: utf-8 -*-
"""Parser for Windows IIS Log file.
More documentation on fields can be found here:
https://msdn.microsoft.com/en-us/library/ms525807(v=vs.90).aspx
"""
import pyparsing
from dfdatetime import time_elements as dfdatetime_time_elements
from plaso.containers import events
from plaso.containers ... | kiddinn/plaso | plaso/parsers/iis.py | Python | apache-2.0 | 14,279 |
# -*- coding: utf-8 -*-
# Copyright 2016 by Luc Saffre.
# License: BSD, see LICENSE for more details.
"""Defines the :rst:dir:`directory`, :rst:dir:`tickets_table` and
:rst:dir:`entry_intro` directives.
.. rst:directive:: directory
Inserts a table containing three columns 'title', 'author' and 'date',
and one row fo... | khchine5/atelier | atelier/sphinxconf/dirtables.py | Python | bsd-2-clause | 6,048 |
# -*- coding: utf-8 -*-
"""
@author: Callum Kift and Ralph Harti
"""
import datetime
def noMatchAdd(user, image, friend):
time = datetime.datetime.now()
friendID = ""
friendLIST = []
files = ["photos/" + user + "/.friends_list.txt"]
for file in files :
with open( file, 'r' ) as f :
# Loop over... | nBIOS/Face-Rec-Book | noMatch_add_photo.py | Python | gpl-2.0 | 974 |
# import time
# import unittest
import doctest
from django.test import LiveServerTestCase #, TestCase
from selenium import webdriver
import pug.nlp.util
# from pug.dj import db as djdb
# from traceback import print_exc
class HomeTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.Firefox... | hobson/pug-dj | pug/dj/miner/tests.py | Python | mit | 3,596 |
# Copyright (c) 2015 noteness
# 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, modify, merge, publish, distribute, ... | necessary129/my-hexchat-addons | addons/xkeep/xkeep.py | Python | mit | 2,502 |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
from .validators import boolean
def attribute_type_validator(x):
valid_types = ["S", "N", "B"]
if x not in valid_types:
raise ValueError("Attri... | 7digital/troposphere | troposphere/dynamodb.py | Python | bsd-2-clause | 2,852 |
def itemNames():
return ['motor','software_module']
def itemChances():
return [50,50] | agry/NGECore2 | scripts/loot/lootPools/talus/re_junk_aakuan_follower.py | Python | lgpl-3.0 | 92 |
from xcrawler.compatibility.string_converter.compatible_string_converter import CompatibleStringConverter
class StringConverterPython2(CompatibleStringConverter):
"""A Python 2 compatible class for converting a string to a specified type.
"""
def convert_to_string(self, string):
string = self.tr... | lucdom/xCrawler | xcrawler/compatibility/string_converter/string_converter_python2.py | Python | gpl-2.0 | 513 |
from pandas import Series
import pandas._testing as tm
def test_pop():
# GH#6600
ser = Series([0, 4, 0], index=["A", "B", "C"], name=4)
result = ser.pop("B")
assert result == 4
expected = Series([0, 0], index=["A", "C"], name=4)
tm.assert_series_equal(ser, expected)
| rs2/pandas | pandas/tests/series/methods/test_pop.py | Python | bsd-3-clause | 295 |
import git
import os
import tempfile
import pytest
from unittest import mock
import mlflow
from mlflow.exceptions import ExecutionException
from mlflow.projects import _project_spec
from mlflow.projects.utils import (
_get_storage_dir,
_is_valid_branch_name,
_is_zip_uri,
_fetch_project,
_fetch_git... | mlflow/mlflow | tests/projects/test_utils.py | Python | apache-2.0 | 8,128 |
#!/usr/bin/env python3
import collections # OrderedDict
import sys # exit
from pass_utils import UNOPS, BINOPS, expand
from expression_walker import walk
def lift_consts(exp, inputs, assigns, consts=None, hashed=dict()):
""" Extracts constant values from an expression """
# Note about hashed: This argum... | soarlab/FPTuner | src/parser/pass_lift_consts.py | Python | mit | 6,823 |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | hkariti/ansible | lib/ansible/modules/cloud/amazon/efs_facts.py | Python | gpl-3.0 | 11,683 |
#!/usr/bin/python
import argparse
import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np
import matplotlib.ticker as plticker
from matplotlib.patches import *
from mpl_toolkits.mplot3d import Axes3D
from random import randint, seed
from math import cos,... | sondree/Master-thesis | Python PLOTS/plotQxy.py | Python | gpl-3.0 | 3,340 |
# File: setup.py
# Version: 3
# Description: Setup for SHA2017 badge
# License: MIT
# Authors: Renze Nicolai <renze@rnplus.nl>
# Thomas Roos <?>
import ugfx, badge, appglue, dialogs, easydraw, time
def asked_nickname(value):
if value:
badge.nvs_set_str("owner", "name", value)
# Do the ... | SHA2017-badge/micropython-esp32 | esp32/modules/setup.py | Python | mit | 894 |
from myuw_selenium.platforms import on_platforms, SeleniumLiveServerTestCase
@on_platforms()
class CardOrderTest(SeleniumLiveServerTestCase):
"""
Tests the order and display of cards at various times in the quarter.
"""
def test_card_order(self):
from time import sleep
# Allow longer ... | uw-it-aca/myuw-selenium | myuw_selenium/test/card_order.py | Python | apache-2.0 | 6,423 |
"""
Django settings for elo project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib im... | GordonsBeard/elo | elo/settings.py | Python | mit | 3,307 |
import pytest
from aioredlock import Aioredlock, Lock
class TestLock:
def test_lock(self):
lock_manager = Aioredlock()
lock = Lock(lock_manager, "potato", 1, 1.0)
assert lock.resource == "potato"
assert lock.id == 1
assert lock.valid is False
@pytest.mark.asyncio
... | joanvila/aioredlock | tests/ut/test_lock.py | Python | mit | 739 |
import subprocess
import os
import shutil
import json
import re
import time
import config
import boxes
import defaults
recomputations_dir = "recompute/server/recomputations"
logs_dir = "recompute/server/logs"
base_boxes_dir = "recompute/server/boxes"
def execute(command, cwd=None, readline_callback=None):
p = s... | cjw-charleswu/Recompute | recompute/server/io.py | Python | mit | 13,791 |
# Copyright 2016 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 ... | googleads/googleads-python-lib | examples/adwords/v201809/basic_operations/__init__.py | Python | apache-2.0 | 631 |
from Crypto.Random import random
from Crypto.Hash import SHA, SHA256
from Crypto import Random
from Crypto.PublicKey import RSA
class KeyGen:
# generate an RSA key pair
@staticmethod
def generate_rsa_key():
rand_gen = Random.new().read
k = RSA.generate(1024, rand_gen)
return k
... | alienlike/courier | courier/keygen.py | Python | gpl-3.0 | 1,097 |
# Copyright 2015 SICS Swedish ICT AB
#
# 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... | nigsics/ramon | ceilocomm.py | Python | apache-2.0 | 7,030 |
# -*- coding: utf-8 -*-
from cwr.acknowledgement import AcknowledgementRecord, MessageRecord
from cwr.agreement import AgreementRecord, AgreementTerritoryRecord, \
InterestedPartyForAgreementRecord
from cwr.group import Group, GroupHeader, GroupTrailer
from cwr.info import AdditionalRelatedInfoRecord
from cwr.pars... | weso/CWR-DataApi | cwr/parser/decoder/dictionary.py | Python | mit | 46,129 |
#!/usr/bin/env python
# vim: noet
from django.db import models
from django.contrib.auth import models as auth_models
from django.core.exceptions import ObjectDoesNotExist
from datetime import date
class Respondant(models.Model):
connection = models.CharField(max_length=100, blank=True, null=True)
is_active = model... | genova/rapidsms-senegal | apps/poll/models.py | Python | bsd-3-clause | 5,052 |
#########################################################################################################
# Description: Function trying to predict fantasy points, yards and TDs for various players based on
# their performance over past many years
#
######################################################################... | SeyVu/subscription_renewal | nfl_ff_pred.py | Python | mit | 8,303 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 OpenERP - Team de Localización Argentina.
# https://launchpad.net/~openerp-l10n-ar-localization
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | morrillo/l10n_ar_invoice | __init__.py | Python | agpl-3.0 | 1,134 |
# Author : Alex Ksikes
import urllib
def get_paging(start, max_results, query=False, results_per_page=15, window_size=15):
c_page = start / results_per_page + 1
if not start:
c_page = 1
nb_pages = max_results / results_per_page
if max_results % results_per_page != 0:
nb_pages += 1
... | alexksikes/MLSS | app/helpers/paging.py | Python | agpl-3.0 | 2,107 |
#!/usr/bin/env python3
import sys
from Bio import SeqIO
from argparse import ArgumentParser, RawDescriptionHelpFormatter
usage = "Chromosome surgery: Splice something into and/or out of a chromosome."
# Main Parsers
parser = ArgumentParser(description=usage, formatter_class=RawDescriptionHelpFormatter)
parser.add_arg... | fruce-ki/utility_scripts | chromosome_surgery.py | Python | mit | 3,387 |
# -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | openstack/watcher | watcher/tests/decision_engine/planner/test_weight_planner.py | Python | apache-2.0 | 43,556 |
# 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 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | goodwinos/sos | sos/plugins/corosync.py | Python | gpl-2.0 | 2,002 |
"""
Stream TVsupertuga module
Copyright (C) 2016 Stream TVsupertuga
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 la... | repotvsupertuga/repo | script.module.stream.tvsupertuga.addon/resources/lib/modules/log_utils.py | Python | gpl-2.0 | 3,934 |
# -*- coding: utf-8 -*-
# Copyright © 2017 Kevin Thibedeau
# Distributed under the terms of the MIT license
from __future__ import print_function
from shapes import GroupShape, DrawStyle
class NuCanvas(GroupShape):
'''This is a clone of the Tk canvas subset used by the original Tcl
It implements an abstracted... | kevinpt/symbolator | nucanvas/nucanvas.py | Python | mit | 4,631 |
import os
import dec
print 'Building HOG feature extractor...'
os.system('python setup_features.py build')
os.system('python setup_features.py install')
print 'Preparing stl data. This could take a while...'
dec.make_stl_data()
| piiswrong/dec | dec/make_stl_data.py | Python | mit | 229 |
from random import random, randrange
class DNA(object):
def __init__(self, size=None):
if isinstance(size, int):
self._dna = []
self.size = size
for _ in range(size):
self._dna.append(randrange(2))
else:
dna = size
self._... | eniallator/Discord-EniBot | GOL_Sim/DNA.py | Python | gpl-3.0 | 1,238 |
"""Problem ?: ???"""
import unittest
def is_sum(n, power):
"""Returns whether n is equal to the sum of its digits to the given power"""
if n == 1:
return False
return n == sum([int(d)**power for d in str(n)])
def summer(power):
"""Sums all numbers that can be written as sum of their digits to ... | mattrid93/ProjectEuler | probs/prob30.py | Python | mit | 981 |
from handler import Handler
from models import Blogs, Comments
from util import comment_exists
class EditComment(Handler):
"""Edits comment for auth users"""
def get(self):
self.error(404)
def post(self):
comment_id = int(self.request.get("cid"))
comment_text = self.request.get("c... | joepettigrew/multi-blog | handlers/editcomment.py | Python | mit | 768 |
"""
API's subpackage:
Tools to extract data from Google using Google Maps API's Endpoints
"""
import datetime
import os
# Google
#GOOGLE_API_KEY = 'AIzaSyAmyPmqtxD20urqtpCpn4ER74a6J4N403k'
#GOOGLE_API_KEY = 'AIzaSyAxfyLSrj4WTboVipv9Faglk9znAKtwAnY'
# TRN
#GOOGLE_API_KEY = 'AIzaSyBTDoFnabhVEULsstwvIDB6XE9djyzzHsE'
# ... | JoaquimPatriarca/senpy-for-gis | gasp/fromapi/glg/__init__.py | Python | gpl-3.0 | 2,088 |
# Copyright 2007 Zachary Pincus
# This file is part of CellTool.
#
# CellTool is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""Save contour data as Matlab-readable .mat files.
The files will ... | tdsmith/celltool | celltool/command_line/to_matlab.py | Python | gpl-2.0 | 1,882 |
#(c) 2016-2018 by Authors
#This file is a part of Flye program.
#Released under the BSD license (see LICENSE file)
from __future__ import absolute_import
import os
import logging
import flye.utils.fasta_parser as fp
import flye.short_plasmids.unmapped_reads as unmapped
import flye.short_plasmids.circular_sequences as... | fenderglass/ABruijn | flye/short_plasmids/plasmids.py | Python | bsd-3-clause | 5,343 |
def f(n):
if n == 0:
return [[]]
if n == 1:
return [[], [1]]
if n == 2:
return [[], [1], [2], [1, 2]]
a = []
sub_n_1 = f(n-1)
for x in sub_n_1:
a.append(x)
for x in sub_n_1:
x.append(n)
a.append(x)
return a
| amiraliakbari/sharif-mabani-python | by-session/ta-922/j6/a6.py | Python | mit | 304 |
class Team:
def __init__(self, team):
self.id = team['_links']['self']['href']
pos = self.id.rfind('/') + 1
self.id = self.id[pos:]
self.name = team['name']
self.code = team['code']
self.shortName = team['shortName']
self.squadMarketValue = team['squad... | trishantofficial/Footyy | src/Footyy/Team.py | Python | mit | 1,017 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.timeline_event import TimelineEvent
from telemetry.timeline_model import TimelineModel
class TabBackendException(Exception):
pass
class... | nacl-webkit/chrome_deps | tools/telemetry/telemetry/inspector_timeline.py | Python | bsd-3-clause | 4,093 |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import traceback,sys
class WafError(Exception):
def __init__(self,msg='',ex=None):
self.msg=msg
assert not isinstance(msg,Exception)
self.stack=[]
if ex:
if not ms... | automatthias/aubio | waflib/Errors.py | Python | gpl-3.0 | 1,008 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | noroutine/ansible | lib/ansible/plugins/action/normal.py | Python | gpl-3.0 | 2,119 |
from __future__ import division
import os
from natsort import natsorted
import pandas as pd
from f02_RiboDataModule import *
from multiprocessing import Process
#===============================================================================
# 1. get coverage file for mRNA seqs
#===============... | shl198/Pipeline | RibosomeProfilePipeline/compareDay3Day6.py | Python | mit | 6,838 |
#!/usr/bin/env python
#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 version.
#
#This program is distributed in the hope that it wi... | sciunto/ZimArchivist | ZimArchivist/editline.py | Python | gpl-3.0 | 2,419 |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | wdwvt1/scikit-bio | skbio/stats/distance/tests/test_base.py | Python | bsd-3-clause | 23,628 |
import arctic.asynchronous as aasync
def test_async_arctic():
print(aasync.ASYNC_ARCTIC.total_alive_tasks())
| manahl/arctic | tests/integration/test_async_arctic.py | Python | lgpl-2.1 | 115 |
"""Logging Utilities."""
import logging
import numbers
import os
import sys
from logging.handlers import WatchedFileHandler
from .utils.encoding import safe_repr, safe_str
from .utils.functional import maybe_evaluate
from .utils.objects import cached_property
__all__ = ('LogMixin', 'LOG_LEVELS', 'get_loglevel', 'se... | ZoranPavlovic/kombu | kombu/log.py | Python | bsd-3-clause | 4,115 |
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.learners.valuebased.valuebased import ValueBasedLearner
class QLambda(ValueBasedLearner):
""" Q-lambda is a variation of Q-learning that uses an eligibility trace. """
offPolicy = True
batchMode = False
def __init__(self,... | iut-ibk/Calimero | site-packages/pybrain/rl/learners/valuebased/qlambda.py | Python | gpl-2.0 | 1,436 |
# -*- coding: utf-8 -*-
'''
Decorators for proving services.
'''
from functools import wraps
__license__ = 'http://mozilla.org/MPL/2.0/'
def service_class(cls):
'''
A class decorator enabling the instances of the class to be used
as a ``services``-provider in `JSONRpc Objects`_
and `BSONRpc Objects`_... | seprich/py-bson-rpc | bsonrpc/interfaces.py | Python | mpl-2.0 | 2,580 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
from __future__ import nested_scopes
import Tkinter as Tk
from twisted.web import monitor
from twisted.python import usage
import time, urlparse
ACK, NOACK = range(2)
class ChangeNotified(monitor.BaseChangeNotified):
def __init... | hortonworks/hortonworks-sandbox | desktop/core/ext-py/Twisted/doc/web/examples/tkwebmon.py | Python | apache-2.0 | 3,114 |
# Copyright (C) 2014,2015 American Registry for Internet Numbers (ARIN)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | dmizelle/jcrvalidator | abnf/make-abnf.py | Python | isc | 4,527 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the synchronization shared directory settings wizard page.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QWizardPage
from E5Gui impor... | paulmadore/Eric-IDE | 6-6.0.9/eric/Helpviewer/Sync/SyncDirectorySettingsPage.py | Python | gpl-3.0 | 2,260 |
import sublime, sublime_plugin
try:
from .github import *
except ValueError:
from github import *
class GithubIssuesCommand(GithubWindowCommand):
@with_repo
def run(self, repo):
open_url(repo.issues_url())
| temochka/sublime-text-2-github-tools | github_issues.py | Python | lgpl-3.0 | 232 |
from MakeGraph import MakeGraph
from Moving_pacman import PacMan
import pygame
class Ghost(MakeGraph):
index = 0
def __init__(self,class_graph,x,y):
Ghost.index = Ghost.index + 1
self.all_nodes = class_graph.get_nodes()
self.paths_to_all_nodes = class_graph.get_shortest_path()
self.path = []
self.hunt... | Yordan92/Pac-man-multiplayer | Ghosts.py | Python | gpl-3.0 | 5,718 |
# Copyright (C) 2015 KillerInstinct
#
# 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 version.
#
# This program is distributed in... | lixiangning888/whole_project | modules/signatures_orginal_20151110/js_phish.py | Python | lgpl-3.0 | 2,079 |
import overpy
import psycopg2
from psycopg2.extras import DictCursor
from collections import OrderedDict
import urllib2
import xml.etree.ElementTree
from xml.sax.saxutils import escape
from shapely.geometry import Polygon
from shapely.geometry import MultiPoint
from time import sleep
class Database(object):
"""A ... | gregrs-uk/python-fhrs-osm | fhrs_osm/__init__.py | Python | gpl-3.0 | 71,815 |
# -*- coding: utf-8 -*-
"""
Created on Mar 11, 2012
@author: moloch
Copyright 2012 Root the Box
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/licen... | moloch--/RootTheBox | models/Snapshot.py | Python | apache-2.0 | 2,178 |
# -*- coding: utf-8 -*-
import rest_framework_filters as filters
from django.db import models
from rest_framework import serializers, viewsets
from .models import Member, MembershipApplication, MembershipApplicationTag, MemberType
class MemberTypeSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
... | jautero/asylum | project/members/rest.py | Python | mit | 2,949 |
import re
from robber import expect
from robber.explanation import Explanation
from robber.matchers.base import Base
class Match(Base):
"""
expect('foo').to.match(r'foo')
"""
def matches(self):
return bool(re.match(self.expected, self.actual))
@property
def explanation(self):
... | vesln/robber.py | robber/matchers/regexp.py | Python | mit | 430 |
#Copyright 2008 Govind Salinas <blix@sophiasuchtig.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 2 of the License, or
#(at your option) any later version.
#This program is d... | blix/pyrite | pyrite/commands/checkout.py | Python | gpl-2.0 | 1,568 |
from pylab import *
import numpy
import scipy.io
from scipy.interpolate import interp1d
from matplotlib.font_manager import FontProperties
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Times New Roman'],'size':7})
number = 11
n0_y = 0.2
n0_x = 0.2
D = 45.7
B = 30.5
X = np.linspace(5, 5*number,... | cuiwei0322/cost_analysis | tall_building_zero_attack_angle_cost_analysis/Result/plot_simga_x_y.py | Python | apache-2.0 | 2,798 |
import ply.yacc as yacc
from column import Column
from select_statement import SelectStatement
from sql_statement import SQLStatement
from table import Table
from or_expression import OrExpression
from and_expression import AndExpression
from not_expression import NotExpression
from comparison import Comparison
from c... | nddsg/SimpleDBMS | simple_dbms/dbms_parser.py | Python | gpl-3.0 | 9,986 |
"""
CmdSethandler
The Cmdsethandler tracks an object's 'Current CmdSet', which is the
current merged sum of all CmdSets added to it.
A CmdSet constitues a set of commands. The CmdSet works as a special
intelligent container that, when added to other CmdSet make sure that
same-name commands are treated correctly (usua... | YourCyborg/Sun-RPI | src/commands/cmdsethandler.py | Python | bsd-3-clause | 19,637 |
# -----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------... | ericmjl/bokeh | bokeh/resources.py | Python | bsd-3-clause | 26,028 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
ROITool
A QGIS plugin
QGIS Plugin for exploring the spectral signatures of ROIs
-------------------
begin : 2015-06-23
... | bullocke/ROI_Plugin | src/roitool.py | Python | gpl-2.0 | 3,188 |
from builder.btools import RegisterCustomTest
from builder.btools import AddConfigKey
from builder.bconfig import getAutoconfPrefix
from builder.bconfig import filterOut
def CheckBoostRegex(ctx, write_config_h=False, add_to_compiler_env=False):
ctx.Message('Checking for Boost Regex Library... ')
confprefix = g... | paeschli/scons-builder | modules/boost_regex_check.py | Python | gpl-2.0 | 1,983 |
# -*- coding: utf-8 -*-
""" Procedures for visual inspection and human flagging.
"""
import numpy as np
from numpy import ma
try:
import pylab
import matplotlib.pyplot as plt
except:
print('matplotlib is not available')
class HumanQC(object):
""" Plot a profile and collect human QC evaluation
... | castelao/CoTeDe | cotede/humanqc/humaneval.py | Python | bsd-3-clause | 6,477 |
"""
Restricted Convolutional Neural Network
"""
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import models.model as md
import models.modules as ms
import utils.utils as ut
class RCNN(md.Model):
def learn(self, x, y, rate=None):
c = self.classifier
o = c.optimizer
run_dict = {
... | MehranMirkhan/ai_system | models/rcnn.py | Python | mit | 6,905 |
"""
Individual custom build steps for the Django tests.
See the docstring in builders.py for an overview of how these all fit together.
I'm using subclasses (instead of just passing arguments) since it makes the
overall build factory in builders.py easier to read. Unfortunately it makes some
of what's going here a bi... | hochanh/django-buildmaster | djangobotcfg/buildsteps.py | Python | bsd-3-clause | 6,606 |
import discord
async def permissions(cmd, message, args):
allowed_list = []
disallowed_list = []
if args:
user_q = message.mentions[0]
else:
user_q = message.author
embed = discord.Embed(title='ℹ ' + user_q.name + '\'s Permissions', color=0x0099FF)
for permission in user_q.gui... | aurora-pro/apex-sigma | sigma/plugins/utility/discord/permissions.py | Python | gpl-3.0 | 919 |
"""Config flow to configure the iCloud integration."""
import logging
import os
from pyicloud import PyiCloudService
from pyicloud.exceptions import (
PyiCloudException,
PyiCloudFailedLoginException,
PyiCloudNoDevicesException,
PyiCloudServiceNotActivatedException,
)
import voluptuous as vol
from home... | tboyce021/home-assistant | homeassistant/components/icloud/config_flow.py | Python | apache-2.0 | 10,441 |
#! /usr/bin/env python3
# Import
import dogWalkScore
from flask import Flask as Flask,\
jsonify as FlaskJSONify,\
render_template as FlaskRender,\
request as FlaskRequest
# Initialize
# Flask
app = Flask(__name__)
# Build graph
id2Node, id2Edge, id2Poi, id2Tree,... | jeffseif/dogWalkScore | static/py/flaskr.py | Python | bsd-3-clause | 1,701 |
# try out the denoising Autoencoder on MNIST
import cPickle
import gzip
import os
import sys
import time
import numpy
import theano
import theano.tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
from mlp.logistic_sgd import load_data
from AutoEncoder import AutoEncoder
from datetime import... | lzamparo/SdA_reduce | theano_models/dA/drive_dA.py | Python | bsd-3-clause | 4,632 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | dlundquist/ansible | lib/ansible/runner/__init__.py | Python | gpl-3.0 | 55,816 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.