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 -*-
"""
/***************************************************************************
LDMP - A QGIS plugin
This plugin supports monitoring and reporting of land degradation to the UNCCD
and in support of the SDG Land Degradation Neutrality (LDN) target.
-------------... | ConservationInternational/ldmp-qgis-plugin | LDMP/calculate_rest_biomass.py | Python | gpl-2.0 | 17,013 |
#Hello World from pycom LoPy
import machine, pycom, time, sys, uos
pycom.heartbeat(False)
print("")
print("Hello World from pycom LoPy")
print("Running Python %s on %s" %(sys.version, uos.uname() [4]))
print("CPU clock = %d MHz" %(int(machine.freq()[0]/1000/1000)))
print("On-board RGB LED will blink 10... | ckuehnel/pycom | blink.py | Python | gpl-3.0 | 701 |
from .pollxblock import PollXBlock
| nttks/pollxblock | pollxblock/__init__.py | Python | agpl-3.0 | 35 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'edit2.ui'
#
# Created: Tue Jun 14 20:37:37 2016
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form)... | fansubgroup/Hyperion3.x | edit2.py | Python | gpl-3.0 | 1,141 |
#!/usr/bin/env python
"""
Copyright 2010 Randall Mason
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... | ClashTheBunny/LaCie-Vanilla | LaCieVanilla.py | Python | apache-2.0 | 7,877 |
"""
Implements the ID3 algorithm for the construction of
decision trees.
"""
import dtree
import math
class ID3(dtree.DTree):
def create_tree(self, parent_subset=None, parent=None, parent_value=None,
remaining=None):
"""
Recursively create the decision tree with the specifie... | jayelm/decisiontrees | id3.py | Python | mit | 7,116 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result.py | Python | mit | 1,299 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | sebrandon1/nova | nova/tests/functional/api_sample_tests/test_servers.py | Python | apache-2.0 | 12,957 |
# -*- coding: utf-8 -*-
import pycurl
from module.plugins.Hook import Hook
class RestartSlow(Hook):
__name__ = "RestartSlow"
__type__ = "hook"
__version__ = "0.04"
__config__ = [("free_limit" , "int" , "Transfer speed threshold in kilobytes" , 100 ),
(... | immenz/pyload | module/plugins/hooks/RestartSlow.py | Python | gpl-3.0 | 2,111 |
from __future__ import print_function
from scan.client.logdata import iterateSamples, getDatetime, parseXMLData, createTable
# client = ScanClient()
# id = client.submit(Loop('motor_x', 1, 5, 1, Loop('motor_y', 2, 4, 1, Log('motor_x', 'motor_y'))))
# client.waitUntilDone(id)
xml_text = """<?xml version="1.0" encoding... | PythonScanClient/PyScanClient | Test/test_data.py | Python | epl-1.0 | 3,143 |
"""
Voronoi analysis of atom positions
author Gerd and Rama
part of pycrosocpy
"""
import numpy as np
import sys
# from skimage.feature import peak_local_max
from skimage.feature import blob_log
from sklearn.cluster import KMeans
from scipy.spatial import cKDTree
import scipy.optimize as optimization
import pyTEM... | pycroscopy/pycroscopy | pycroscopy/image/image_atoms.py | Python | mit | 7,225 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Implementation for `pmg structure` CLI.
"""
import sys
from tabulate import tabulate
from pymatgen.core.structure import Structure
from pymatgen.analysis.structure_matcher import El... | davidwaroquiers/pymatgen | pymatgen/cli/pmg_structure.py | Python | mit | 3,810 |
#!/usr/bin/env python
# Copyright (C) 2011 Statoil ASA, Norway.
#
# The file 'test_deprecation.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 Fou... | arielalmendral/ert | python/tests/core/ecl/test_deprecation.py | Python | gpl-3.0 | 8,063 |
from twython import Twython
import config
def get_access_token():
tw = Twython(config.CONSUMER_KEY, config.CONSUMER_SECRET, oauth_version = 2)
access_token = tw.obtain_access_token()
f = open('access_token.txt', 'w')
f.write(access_token)
f.close()
print 'Access token successfully written to ac... | gchandru1/thedress | access_token.py | Python | mit | 355 |
# Copyright (C) 2015 Canonical Ltd.
#
# This file is part of cloud-init. See LICENSE file for license information.
import copy
class DictRegistry(object):
"""A simple registry for a mapping of objects."""
def __init__(self):
self.reset()
def reset(self):
self._items = {}
def regist... | larsks/cloud-init | cloudinit/registry.py | Python | gpl-3.0 | 1,039 |
import time
from amqp_on_demand import AMQPOnDemand
from kombu import Exchange, Connection, Queue
class RackHDAMQPOnDemand(AMQPOnDemand):
def __init__(self):
super(RackHDAMQPOnDemand, self).__init__()
self.__setup_rackhd_style_amqp()
def __setup_rackhd_style_amqp(self):
"""
N... | johren/RackHD | test/stream-monitor/stream_sources/amqp_od/rackhd_amqp_od.py | Python | apache-2.0 | 2,076 |
"""
Tests for dit.inference.knn_estimators.
"""
from hypothesis import given, settings
from hypothesis.strategies import floats, lists
import pytest
import numpy as np
from dit.inference.knn_estimators import differential_entropy_knn, total_correlation_ksg
@settings(max_examples=25)
@given(mean=floats(min_value=-... | dit/dit | tests/inference/test_knn_estimators.py | Python | bsd-3-clause | 2,424 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from utilities import execution_path, run_all
import os, mapnik
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
if 'osm' in mapnik.Dataso... | yiqingj/work | tests/python_tests/osm_test.py | Python | lgpl-2.1 | 1,608 |
# -*- coding: utf-8 -*-
import asyncio
from paco.observer import Observer
from .helpers import run_in_loop
def test_observer():
def foo_listener(data, key=None):
assert data == 'foo'
assert key == 'foo'
@asyncio.coroutine
def bar_listener(data, key=None):
assert data == 'bar'
... | h2non/paco | tests/observer_test.py | Python | mit | 927 |
from PyQt5.QtWidgets import QWidget
from TriblerGUI.widgets.channel_list_item import ChannelListItem
from TriblerGUI.tribler_request_manager import TriblerRequestManager
class DiscoveredPage(QWidget):
"""
The DiscoveredPage shows an overview of all discovered channels in Tribler.
"""
def __init__(se... | Captain-Coder/tribler | TriblerGUI/widgets/discoveredpage.py | Python | lgpl-3.0 | 1,932 |
def fingerleft():
i01.setHandSpeed("left", 0.85, 0.85, 0.85, 0.85, 0.85, 1.0)
i01.setHandSpeed("right", 1.0, 0.85, 1.0, 1.0, 1.0, 1.0)
i01.setArmSpeed("left", 1.0, 1.0, 1.0, 1.0)
i01.setArmSpeed("right", 0.90, 1.0, 1.0, 1.0)
i01.setHeadSpeed(1.0, 0.90)
i01.setTorsoSpeed(0.9, 0.5, 1.0)
i01.mo... | MyRobotLab/pyrobotlab | home/hairygael/GESTURES/fingerleft.py | Python | apache-2.0 | 532 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2012 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 Foundati... | andrebellafronte/stoq | stoq/gui/test/test_purchase.py | Python | gpl-2.0 | 11,536 |
import numpy as np
import pandas as pd
import numpy_indexed as npi
from collections import namedtuple
from scipy.stats import f
from mathpy.stats.summary import var
def anova_oneway(group, x, *args):
r"""
Performs one-way analysis of variance (ANOVA) of one measurement and a grouping variable
... | aschleg/mathpy | mathpy/stats/aov.py | Python | mit | 17,490 |
#This script is built as a prototype during Mozilla HelloWeb Hackathon Kolkata 2016
#An Interactive Artificial Intelligence with a friendly personality to teach 5 year olds about HTML and WEB
#Copyright Protected Under GPL3 License | Follow the License | Send Pull Requests
import re
import py
import requests
imp... | ultimatepritam/HelloWeb | DoraTheExplorer.py | Python | gpl-3.0 | 7,919 |
# -*- encoding: utf-8 -*-
"""
TODO:
* Fix problems with Issue 2510, ascii printing using unicode
* Address Issue 2251, printing of spin states
"""
from sympy.physics.quantum.anticommutator import AntiCommutator
from sympy.physics.quantum.cg import CG, Wigner3j
from sympy.physics.quantum.commutator import Commutator
fro... | ichuang/sympy | sympy/physics/quantum/tests/test_printing.py | Python | bsd-3-clause | 27,828 |
#! /usr/bin/env python
#-*- coding: utf-8 -*-
#################################################################
# Copyright (C) 2015 Sean Guo. All rights reserved.
#
# > File Name: < set_English.py >
# > Author: < Sean Guo >
# > Mail: < iseanxp+code@gmail.com >
# > Cre... | SeanXP/Nao-Robot | python/language/set_English.py | Python | gpl-2.0 | 753 |
import struct
class url(object):
"""
"""
def __init__ (self, debug):
self.debug = debug
@staticmethod
def pack(unpacked):
"""
Given an url (string), pack it so that it can be included in a rowkey
The rowkey packed format is: a string
"""
retur... | jeffmurphy/cif-db | src/DB/PrimaryIndex/PackUnpack/url.py | Python | bsd-3-clause | 534 |
#!/usr/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
evaluate-gbsa.py
Evaluate the GBSA model on hydration free energies of small molec... | hainm/open-forcefield-group | ideas/bayesian-gbsa-parameterization/evaluate-gbsa.py | Python | gpl-2.0 | 24,285 |
#!/usr/bin/env python3
"""Create a custom installation of Apache and PostgreSQL for the current user"""
from os.path import join
from os import mkdir
from stat import S_IRUSR, S_IXUSR, S_IWUSR
from subprocess import check_call, Popen, PIPE, check_output
from .utils import (is_valid_site_id, get_template, sdo, START, ... | Zigazou/DSM | desima/pgsql.py | Python | gpl-3.0 | 3,874 |
from fontTools.pens.basePen import BasePen
from reportlab.graphics.shapes import Path
__all__ = ["ReportLabPen"]
class ReportLabPen(BasePen):
"""A pen for drawing onto a reportlab.graphics.shapes.Path object."""
def __init__(self, glyphSet, path=None):
BasePen.__init__(self, glyphSet)
if path is None:
pa... | google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/pens/reportLabPen.py | Python | apache-2.0 | 1,779 |
import pyautogui as gui
import pyperclip
import os.path
import time
IMG_SRC = 'imgs'
IMG_TOP = os.path.join(IMG_SRC, 'target_top.png')
DB_NAME = 'connections_db.txt'
###############################################################################
# Functions to obtain all connections in your network. Assume that a b... | etoccalino/link | link/update-connections.py | Python | mit | 3,407 |
import re
import os
import sha
import subprocess
from . import prepr
from ql.pg import psql, silent_psql
import glob
def getin(d, ks):
for p in ks:
if p not in d:
return None
d = d[p]
return d
def resolve(t):
acc = dict(idx=dict(), guard=dict(), deps=[])
for k in t:
... | harikt/fhirbase | ql/__init__.py | Python | mit | 4,081 |
import pandas
def compare():
data_sets = ['airport', 'collaboration', 'congress', 'forum', ]
# models = ['pWSBM', 'bWSBM', 'SBM', 'DCWBM', 'node2vec', 'LLE', 'Model R', ]
# errors = pandas.DataFrame([
# [0.0486, 0.0543, 0.0632, 0.0746, 0.0171, 0.0170, 0.0114, ],
# [0.0407, 0.0462, 0.0497, ... | yuchenhou/elephant | elephant/plot.py | Python | mit | 3,079 |
# -*- coding: utf-8 -*-
import os
import urllib
import re
from xml.etree import ElementTree as ET
from .fetcher import Fetcher
class Flickr_Fetcher(Fetcher):
'''A fetcher for the Flicr API.
Currently, it takes a user id and grabs the flickr.people.getPublicPhotos
to get the list of all photos.
It then... | mredar/harvester | harvester/fetcher/flickr_fetcher.py | Python | bsd-3-clause | 6,498 |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | citrix-openstack-build/sahara | sahara/tests/integration/tests/gating/test_transient_gating.py | Python | apache-2.0 | 5,413 |
"""
taskmaster.controller
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import cPickle as pickle
import gevent
import sys
from gevent_zeromq import zmq
from gevent.queue import Queue, Empty
from os import path, unlink, rename
from taskmaster.util im... | alex/taskmaster | src/taskmaster/server.py | Python | apache-2.0 | 6,026 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | vlegoff/tsunami | src/primaires/information/tips.py | Python | bsd-3-clause | 1,990 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('spirit_topic', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations... | nitely/Spirit | spirit/topic/favorite/migrations/0001_initial.py | Python | mit | 1,157 |
class Globals:
pass
class Proxy:
def __init__(self, name):
self.name = name
def __getattr__(self, item):
return getattr(getattr(_globals, self.name), item)
_globals = Globals()
| item4/chatterbox | chatterbox/globals.py | Python | mit | 211 |
#! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
import argparse
import csv
from elasticsearch import Elasticsearch
def get_aggs(address):
return {
"aggs": {
"sent_agg": {
"filter": {
"bool": {
"must": [
{
"range": {
"datetime": {
... | Sotera/pst-extraction | tools/es_email_timeseries_csv.py | Python | apache-2.0 | 3,531 |
import copy
import random
from six import text_type
import time
from unittest import TestCase, skipIf
import warnings
import mongomock
try:
import pymongo
from pymongo import ReturnDocument
_HAVE_PYMONGO = True
except ImportError:
_HAVE_PYMONGO = False
warnings.simplefilter('ignore', DeprecationWarn... | magaman384/mongomock | tests/test__collection_api.py | Python | bsd-3-clause | 28,119 |
#####################################################################
# mlcl.py
#
# (c) Copyright 2021, Benjamin Parzella. All rights reserved.
#
# 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 Found... | bparzella/secsgem | secsgem/secs/data_items/mlcl.py | Python | lgpl-2.1 | 1,387 |
#This is a cell with a custom comment as marker
x=10
y=11
print(x+y)
| HugoGuillen/nb2py | tutorial_files/custom.py | Python | mit | 70 |
"""
Beam characterization calculations.
For more information and the math behind this code go to the `LOFAR imaging
capabilities page
<http://www.astron.nl/radio-observatory/astronomers/lofar-imaging-capabilities-sensitivity/lofar-imaging-capabilities/lofa>`_.
"""
import math
def fwhm(lambda_, d, alpha1=1.3):
""... | mkuiack/tkp | tkp/telescope/lofar/beam.py | Python | bsd-2-clause | 1,207 |
import texwrap
def wrap(string, max_width):
# return a list comprehension
return "\n".join([string[i:i+max_width] for i in range(0, len(string), max_width)])
| bluewitch/Code-Blue-Python | HR_pythonTextWrap.py | Python | mit | 167 |
# -*- coding:UTF-8 -*-
# !/usr/bin/env python
#########################################################################
# File Name: train.py
# Author: Banggui
# mail: liubanggui92@163.com
# Created Time: 2017年04月23日 星期日 15时36分29秒
#########################################################################
import numpy ... | shihuai/TCAI-2017 | models_config/train_unet2d.py | Python | mit | 1,797 |
DNS_EAV_MODELS = ("soa_av",)
| drkitty/cyder | cyder/cydns/constants.py | Python | bsd-3-clause | 29 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/libemos/package.py | Python | lgpl-2.1 | 2,991 |
"""
********************************************************************************
* Name: context_processors.py
* Author: Nathan Swain
* Created On: 2014
* Copyright: (c) Brigham Young University 2014
* License: BSD 2-Clause
********************************************************************************
"""
from te... | tethysplatform/tethys | tethys_apps/context_processors.py | Python | bsd-2-clause | 1,403 |
# -*- 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 'PootleProfile.rate'
db.add_column('pootle_app_pootleprofile', 'rate',
... | evernote/pootle | pootle/apps/pootle_profile/migrations/0004_auto__add_field_pootleprofile_rate__add_field_pootleprofile_score.py | Python | gpl-2.0 | 6,584 |
from telnetlib import Telnet
class JamesHelper:
def __init__(self, app):
self.app = app
def ensure_user_exists(self, username, password):
james_config = self.app.config["james"]
session = JamesHelper.Session(james_config["host"], james_config["port"], james_config["password"], james_co... | Oliebert/testing_mantis | fixture/james.py | Python | apache-2.0 | 2,632 |
__author__ = 'mpetyx'
from tastypie.authorization import DjangoAuthorization
from .models import OpeniActivityEvent
from OPENiapp.APIS.OpeniGenericResource import GenericResource
from OPENiapp.APIS.OPENiAuthorization import Authorization
from OPENiapp.APIS.OPENiAuthentication import Authentication
class ActivityEv... | OPENi-ict/ntua_demo | openiPrototype/openiPrototype/APIS/Activity/Event/Resources.py | Python | apache-2.0 | 2,179 |
from django.conf import settings
import mailchimp_subscribe
def subscribe(email_address):
mailchimp_subscribe.subscribe(settings.MAILCHIMP_API_KEY,
settings.MAILCHIMP_LIST_ID, email_address)
| curbyourlitter/curbyourlitter-alley | curbyourlitter_alley/canrequests/mailinglist.py | Python | gpl-3.0 | 232 |
import platform
# -----------------------------------------------------------------------------
# Guess platform we are running on
def current_platform():
machine = platform.machine()
if machine == 'armv5tejl':
return 'ev3'
elif machine == 'armv6l':
return 'brickpi'
else:
return... | ddemidov/ev3dev-lang-python-1 | ev3dev/auto.py | Python | mit | 497 |
from django.apps import AppConfig
class GraphsConfig(AppConfig):
name = 'graphs'
| sprenge/energywizard | graphs/apps.py | Python | mit | 87 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
### BEGIN LICENSE
#Copyright (c) 2009 Eugene Kaznacheev <qetzal@gmail.com>
#Copyright (c) 2013 Joshua Tasker <jtasker@gmail.com>
#Permission is hereby granted, free of charge, to any person
#obtaining a copy of this software and associated documentation
#files (the "Software")... | IntegerMan/Pi-MFD | PiMFD/Applications/Scheduling/Weather/pywapi.py | Python | gpl-2.0 | 36,413 |
#!/usr/bin/env vpython
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""High level test for Primary <-> Replica replication logic.
It launches two local services (Primary and Replica) via dev... | luci/luci-py | appengine/auth_service/replication_smoke_test.py | Python | apache-2.0 | 9,882 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | jss-emr/openerp-7-src | openerp/addons/mail/wizard/mail_compose_message.py | Python | agpl-3.0 | 12,527 |
#!/usr/bin/python
# coding: utf8
import geocoder
import requests_mock
us_address = '595 Market St'
us_city = 'San Francisco'
us_state = 'CA'
us_zipcode = '94105'
us_locations = ['4650 Silver Hill Road, Suitland, MD 20746', '42 Chapel Street, New Haven']
def test_uscensus():
url = 'https://geocoding.geo.census.go... | DenisCarriere/geocoder | tests/test_uscensus.py | Python | mit | 1,697 |
from flask import render_template, redirect,request,url_for,flash
from flask.ext.login import login_user,logout_user,login_required,current_user
from . import auth
from ..models import User
from .forms import LoginForm
from .forms import RegistrationForm
from .. import db
from ..email import send_email
@auth.route('/... | zhangwangjin/Test | app/auth/views.py | Python | mit | 2,946 |
__author__ = 'traviswarren'
from mock import patch
from django.test import TestCase
from django.core.urlresolvers import reverse
from wordplay import responses, utils
from wordplay.tests.factories import UserFactory, SurveyFactory, ResponseFactory
class TemperatureViewTestCases(TestCase):
def test_get_temperat... | mvillis/wordplay | wordplay/tests/views/test_temp_views.py | Python | apache-2.0 | 2,826 |
# 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... | pcmanus/python-cql | cql/marshal.py | Python | apache-2.0 | 2,275 |
#!/usr/bin/env python
# coding: utf-8
# In[33]:
import os
from datetime import datetime
from dateutil import parser
from twython import Twython
import pandas as pd
import numpy as np
import json
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
# In[25]:
w... | eepgwde/pyeg0 | soc-media/twython/demo0.py | Python | gpl-3.0 | 924 |
###########################################################
#
# Copyright (c) 2010, 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 permi... | diegocortassa/TACTIC | src/tactic/ui/widget/discussion_wdg.py | Python | epl-1.0 | 113,291 |
# 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
# distributed under the... | AlexOugh/horizon | openstack_dashboard/nikola_auth/urls.py | Python | apache-2.0 | 1,023 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a port of the original in testprogs/ejs/ldap.js
import optparse
import sys
import time
import base64
import os
sys.path.insert(0, "bin/python")
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/p... | amitay/samba | source4/dsdb/tests/python/ldap.py | Python | gpl-3.0 | 128,886 |
from fabric.api import *
import fabric.contrib.project as project
import http.server
import os
import shutil
import sys
import socketserver
# Local path configuration (can be absolute or relative to fabfile)
env.deploy_path = 'output'
DEPLOY_PATH = env.deploy_path
# Remote server configuration
production = 'root@char... | charlesfleche/charlesfleche.net | fabfile.py | Python | mit | 3,663 |
# proc_data.py
#
# Copyright 2010 dan collins <danc@badbytes.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at ... | badbytes/pymeg | pdf2py/proc_data.py | Python | gpl-3.0 | 2,561 |
# -*- coding: utf-8 -*-
# © 2015 Akretion (http://www.akretion.com).
# @author Valentin CHEMIERE <valentin.chemiere@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class StockMove(models.Model):
_inherit = 'stock.move'
@api.multi
def _prep... | kittiu/sale-workflow | sale_order_lot_selection/model/stock.py | Python | agpl-3.0 | 520 |
from __future__ import unicode_literals
import copy
import os
import re
import sys
from io import BytesIO
from pprint import pformat
try:
from urllib.parse import parse_qsl, urlencode, quote, urljoin
except ImportError:
from urllib import urlencode, quote
from urlparse import parse_qsl, urljoin
from djang... | ericholscher/django | django/http/request.py | Python | bsd-3-clause | 19,393 |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | amit0701/rally | tests/unit/task/test_exporter.py | Python | apache-2.0 | 1,007 |
import re
from modularodm import Q
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import PermissionDenied, ValidationError, NotFound, MethodNotAllowed, NotAuthenticated
from rest_framework.status import HTTP_204_NO_CONTENT
from rest_framework.response import Response
... | rdhyee/osf.io | api/nodes/views.py | Python | apache-2.0 | 141,472 |
# 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... | metacloud/python-glanceclient | tests/v2/test_schemas.py | Python | apache-2.0 | 4,845 |
#
# Copyright 2005,2006 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version... | gnu-sandhi/sandhi | modules/gr36/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py | Python | gpl-3.0 | 10,386 |
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
e... | vericoin/vericoin-core | contrib/bitrpc/bitrpc.py | Python | mit | 9,384 |
#!/usr/bin/env python2
import momxml
import ephem
import sys
from numpy import array
# 17:29 - 06:10
cal_duration_s = 5*60
source_catalogue = momxml.SourceCatalogue()
mid_day = momxml.ephem.Date(sys.argv[1])
start_date = momxml.ephem.Date(momxml.next_sunset(mid_day) + 20*momxml.ephem.minute)
end_date = momx... | brentjens/lofar-obs-xml | scripts/lc3_028-ncp.py | Python | gpl-3.0 | 4,487 |
#!/usr/bin/env python3
'''
This file is used to 'scribe' a random piece of 'text' on to a 'slab'.
'text' - A sequence based on an alphabet [0, 1, 2 ...n_chars)
'slab' - An numpy matrix
Has as many rows as the size of the alphabet i.e. n_chars
A character 'i' in the text is of length i+2 by default an... | rakeshvar/rnn_ctc | scribe/rows.py | Python | apache-2.0 | 4,239 |
import threading
import Queue
import spotify
import zmq
import constants
import os.path
import json
import time
class Player:
def __init__(self, session):
self.queue = []
self.cursor = None
self.session = session
self.midtrack = False
self.playing = False
self.audio... | SteveParrington/jukeboxify | server/jukeboxify.py | Python | apache-2.0 | 6,347 |
#!/usr/bin/env python3
# =========================================================================
#
# Copyright NumFOCUS
#
# 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
#
# ... | InsightSoftwareConsortium/ITKExamples | src/Registration/Metricsv4/RegisterTwoPointSets/Code.py | Python | apache-2.0 | 5,415 |
#***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | JonasThomas/free-cad | src/Mod/Ship/Instance.py | Python | lgpl-2.1 | 20,505 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | wainersm/buildbot | master/buildbot/data/builders.py | Python | gpl-2.0 | 4,882 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule_paged.py | Python | mit | 978 |
from .validator import Validator
from .block import BLOCK_SCHEME
from .domain import DOMAIN_SCHEME
from .flow_graph import FLOW_GRAPH_SCHEME
| iohannez/gnuradio | grc/core/schema_checker/__init__.py | Python | gpl-3.0 | 142 |
"""
This file defines two objects:
1. RecipeList is an object for the TOC
2. Recipe is an object for a specific recipe
"""
# TODO Rebuild RecipeBook to be more of a recipe book that can contain recipes, other stuff
# TODO add recipes into a RecipeBook (right now recipeList)
# TODO add an additional column in your rec... | briancousins/RecipeBook | classes/recipes.py | Python | mit | 5,471 |
# tests fix of gh-14 for "from" parameter in the "transfer" function.
# Proposed convention is to use "_from" as the parameter
# so as not to conflict with "from" Python reserved word.
# _from arg works
# _from arg works with straight json
# Invoke by calling up app access number
# Sample application using the itty... | tropo/tropo-webapi-python | samples/tropo_11258_transferOnTest.py | Python | mit | 1,151 |
# -*- coding:utf-8 -*-
# Copyright (C) 2007-2010 Libresoft Research Group
# Copyright (C) 2011-2014 Germán Poo-Caamaño <gpoo@gnome.org>
#
# 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 v... | gpoo/MailingListStats | pymlstats/analyzer.py | Python | gpl-2.0 | 10,998 |
from robot.libraries.BuiltIn import BuiltIn, register_run_keyword
def run_keyword_function(name, *args):
return BuiltIn().run_keyword(name, *args)
register_run_keyword(__name__, run_keyword_function)
def run_keyword_without_keyword(*args):
return BuiltIn().run_keyword('\Log Many', *args)
register_run_keyw... | yahman72/robotframework | atest/testdata/standard_libraries/builtin/RegisteringLibrary.py | Python | apache-2.0 | 364 |
import re
from scrapy.selector import HtmlXPathSelector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from detalle.items import DetalleItem
filename = 'maxpaginacion.txt'
filename2 = 'paraextraer.txt'
class UltimospiderSpider(CrawlSpider):
n... | jesuscuesta/Python | TuPlanazo/alicanteyumping/detalle/spiders/ultimospider.py | Python | mit | 1,126 |
# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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
... | encukou/freeipa | ipaclient/plugins/user.py | Python | gpl-3.0 | 2,966 |
from datetime import timedelta as td
from unittest.mock import Mock
from django.core import mail
from django.utils.timezone import now
from hc.api.management.commands.sendreports import Command
from hc.api.models import Check
from hc.test import BaseTestCase
class SendReportsTestCase(BaseTestCase):
def setUp(sel... | healthchecks/healthchecks | hc/api/tests/test_sendreports.py | Python | bsd-3-clause | 4,734 |
from django.conf.urls.defaults import *
from django.views.static import serve
from W4W.models import school, inschrijving,steunpunt
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
info_dict_list_scholen = {
'queryset': scho... | mtwestra/akvo-wandelenvoorwater | wvw/urls.py | Python | agpl-3.0 | 1,878 |
# -*- coding: utf-8 -*-
# equalize.py
# by Jens Kutilek
# https://github.com/jenskutilek/Curve-Equalizer
#-----------------------
# EQMethods/geometry.py
#-----------------------
from math import atan2, cos, pi, sin, sqrt
# helper functions
def getTriangleArea(a, b, c):
return (b.x - a.x) * (c.y - a.y) - (c.x... | gferreira/hTools2_extension | hTools2.roboFontExt/lib/hTools2/extras/equalize.py | Python | bsd-3-clause | 4,304 |
import os, subprocess, types, sys, re
def check_output_for_error(output, match, error_in_first_match):
success = re.findall(match, output)
if len(success) > 0:
if (error_in_first_match):
print "[ERROR] %s" % success[0]
sys.exit(1)
else:
return True
else:
return False
def check_and_print_err(err, war... | xissy/titanium-mobile-sdk | android/run.py | Python | apache-2.0 | 1,625 |
# 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... | dhuang/incubator-airflow | chart/tests/test_pod_template_file.py | Python | apache-2.0 | 20,197 |
import ast
import subprocess
import time
from stevedore import extension
from common import common_functions
from common import constants
from common import docker_lib
from common import fm_logger
from dbmodule.objects import app as app_db
from server.dbmodule.objects import container as cont_db
from dbmodule.objects... | cloud-ark/cloudark | server/local_handler.py | Python | apache-2.0 | 4,788 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from tests.apidocs.util import APIDocsTestCase
class ProjectKeyDetailsDocs(APIDocsTestCase):
def setUp(self):
self.url = reverse(
"sentr... | beeftornado/sentry | tests/apidocs/endpoints/projects/test-key-details.py | Python | bsd-3-clause | 820 |
# pylint: disable=invalid-name
""" SANSCreateWavelengthAndPixelAdjustment algorithm creates workspaces for pixel adjustment
and wavelength adjustment.
"""
from __future__ import (absolute_import, division, print_function)
from mantid.kernel import (Direction, StringListValidator, PropertyManagerProperty, Composit... | dymkowsk/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSCreateWavelengthAndPixelAdjustment.py | Python | gpl-3.0 | 12,993 |
#!/bin/python
import getopt
import sys
from coapthon.server.coap_protocol import CoAP
from example_resources import Storage, Separate, BasicResource, Long, Big
class CoAPServer(CoAP):
def __init__(self, host, port, multicast=False):
CoAP.__init__(self, (host, port), multicast)
self.add_resource('b... | Cereal84/CoAPthon | coapserver.py | Python | mit | 1,338 |
from django.shortcuts import render, redirect
def index(request):
user = request.user
if user.is_authenticated:
return redirect(dashboard)
else:
return render(request, 'index.html')
| chop-dbhi/biorepo-portal | auth0login/views.py | Python | bsd-2-clause | 212 |
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2010-2015, Michigan State University.
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | souravsingh/khmer | khmer/__init__.py | Python | bsd-3-clause | 8,306 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.