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 |
|---|---|---|---|---|---|
#
# 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... | spektom/incubator-airflow | tests/providers/google/cloud/operators/test_gcs.py | Python | apache-2.0 | 8,920 |
from abc import ABCMeta, abstractmethod
class Parser(object):
__meta__ = ABCMeta
def __init__(self, source):
self.source = source
@abstractmethod
def schedule(self):
pass
| vtemian/uni-west | second_year/os/exams/round2/scheduler/parsers/base.py | Python | apache-2.0 | 207 |
import cv2
import numpy as np
import os
from database import Data
### TRAINING ###
path = ""
samples = np.loadtxt('%sgeneralsamples.data' % path, np.float32)
responses = np.loadtxt('%sgeneralresponses.data' % path, np.float32)
responses = responses.reshape((responses.size, 1))
model = cv2.ml.KNearest_create()
model.... | BrunoTh/ETS2Autopilot | speed_detection.py | Python | mit | 1,220 |
# Copyright (C) 2010-2015 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import sys
import requests
import tempfile
import random
import json
from django.conf import settings
from django.shortcuts import render_t... | lixiangning888/whole_project | web/submission/views.py | Python | lgpl-3.0 | 38,047 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | kilon/sverchok | nodes/list_basic/match.py | Python | gpl-3.0 | 5,511 |
# -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS Instructor Dashboard.
"""
from ..helpers import UniqueCourseTest
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.instructor_dashboard import InstructorDashboardPage
from ...fixtures.course import CourseFixture
class AutoEnrollmentWithCSVTest(... | OmarIthawi/edx-platform | common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py | Python | agpl-3.0 | 5,227 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class Users(models.Model):
_inherit = 'res.users'
karma = fields.Integer('Karma', default=0)
karma_tracking_ids = fields.One2many('gamification.karma.tracking', 'user_i... | jeremiahyan/odoo | addons/gamification/models/res_users.py | Python | gpl-3.0 | 12,740 |
# $Id$
#
# Copyright (C) 2004-2012 Greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" uses pymol to inter... | adalke/rdkit | rdkit/Chem/PyMol.py | Python | bsd-3-clause | 8,287 |
"""
The mailer module contains the Mailer class, a simple way to send emails.
"""
from __future__ import absolute_import
# let people use: from mailer import Mailer
# (instead of: from mailer.mailer import Mailer)
# pylint: disable-msg=W0403
from .mailer import Mailer
# pylint: enable-msg=W0403
| invenia/mailer | mailer/__init__.py | Python | mit | 296 |
# Copyright 2014 Rackspace Inc.
#
# Author: Tim Simmons <[email protected]>
#
# 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... | openstack/designate | designate/tests/unit/agent/backends/test_fake.py | Python | apache-2.0 | 1,576 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
n = int(input().strip())
ans = 0
count = 0
while n:
v = n % 10
n //= 10
if v == 4:
ans += 1 * 2 ** count
else:
ans += 2 * 2 ** count
count += 1
print(ans)
| pybae/etc | CodeForces/535B.py | Python | mit | 240 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | tuskar/tuskar-ui | horizon/browsers/__init__.py | Python | apache-2.0 | 806 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
CONFIG_NAME = ".clang_complete"
def readConfiguration():
try:
f = open(CONFIG_NAME, "r")
except IOError:
return []
result = []
for line in f.readlines():
strippedLine = line.strip()
if strippedLine:
result.append(strippedLine)
f... | t0tec/dotfiles | vim/vim.symlink/bin/cc_args.py | Python | mit | 2,045 |
#!/usr/bin/env python
# coding=utf-8
"""
__init__.py
"""
__author__ = 'Rnd495' | SakuraSa/TenhouLoggerX | UI/__init__.py | Python | mit | 80 |
# ---------------------------------------------------------------------
# ------------------------- Plight Rising -----------------------------
# -----------------------------txtsd-----------------------------------
# ---------------------------------------------------------------------
"""Handles the account, login, ... | txtsd/Plight-Rising | classes/FRAccount.py | Python | gpl-3.0 | 7,336 |
from django import template
from django.utils.encoding import force_unicode
register = template.Library()
@register.filter
def recommends_geodata(user, geodata):
return user.profile.recommends(geodata)
| linventifatelier/cartoterra | cartoterra/templatetags/recommends_geodata.py | Python | agpl-3.0 | 208 |
""" Unit Tests for Beam Block's core/beam_block_radar.py module. """
import pyart
from numpy.testing import assert_almost_equal
import beam_block
def test_beam_block():
""" Unit test for the beam_block_radar.beam_block function. """
radar = pyart.io.read(beam_block.testing.SAMPLE_RADAR_NC_FILE)
tif_file... | zssherman/beam_block | beam_block/core/tests/test_beam_block_radar.py | Python | bsd-2-clause | 1,653 |
# 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... | chengduoZH/Paddle | python/paddle/fluid/regularizer.py | Python | apache-2.0 | 10,063 |
# -*- coding: Latin-1 -*-
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always ... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.5/Lib/heapq.py | Python | mit | 14,339 |
# -*- 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, softw... | sbauza/badger | badger/__init__.py | Python | apache-2.0 | 662 |
#@PydevCodeAnalysisIgnore
# 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
#
# ... | rossumai/keras-multi-gpu | keras_tf_multigpu/examples/avolkov1/cifar/tf_examples/cifar10_train.py | Python | mit | 4,529 |
# Copyright (C) 2014 Codethink Limited
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHO... | CodethinkLabs/online-atomic-update | migratelib/findmnt.py | Python | lgpl-2.1 | 2,345 |
import sys, csv, string
def generate_R_input(report_path, output_path):
confidence_values = []
report_file = open(report_path, 'r')
first_line = True
for line in report_file:
if first_line:
first_line = False
continue
line = line.strip().split(',')
if line[5] == 'Yes'... | emvecchi/mss | src/utils/crowdflower/retrieve_stats.py | Python | apache-2.0 | 925 |
# Top settings file for development
from .base import *
COMPRESS_ENABLED = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['localhost', '0.0.0.0']
# Including a default secret key since this is just for development
SECRET_KEY = env_or_default('SECRET_KEY', u'dipps!+sq49#e2k#5^@4*^qn#8s83$kawqqxn&_-*xo7twru... | njl/pycon | pycon/settings/dev.py | Python | bsd-3-clause | 325 |
import io, os, re, subprocess, sys
#@snip/WorkDir[
#@requires: mod:os
class WorkDir(object):
'''A context manager for changing to a different working directory. The
original working directory is restored upon exiting the context.'''
def __init__(self, path):
'''Initialize a context for changing t... | Rufflewind/calico | tools/utils.py | Python | mit | 5,989 |
from subprocess import Popen, PIPE
import shlex
import httplib as hlib
import urllib as ulib
import xml.etree.ElementTree as ET
import astropy.io.votable as VT
import warnings
def queryVizier(fitsTableName,format='asu-fits',source='USNO-B1.0',pos='104.9566125,14.2341555',radius=2):
'''
documentation: http://cdsa... | bmazin/ARCONS-pipeline | astrometry/guide-centroid/catalog.py | Python | gpl-2.0 | 2,390 |
#!/usr/bin/python3
import sys
sys.path.append('/usr/lib/python3.5/site-packages')
import numpy as np
from pylamp_const import *
#from bokeh.plotting import figure, output_file, show, save
import vtk
#import gr
from scipy.interpolate import griddata
import os
import glob
###
# program to convert pylamp output (npz f... | larskaislaniemi/PyLamp | pylamp_post.py | Python | bsd-2-clause | 7,910 |
import numpy as np
from scipy.interpolate import interp1d
from pandas import DataFrame, read_csv
from shapely.geometry import LineString, Polygon, LinearRing, Point
from warnings import warn
import matplotlib.pyplot as plt
try: # Python 3.x
izip = zip
except: # Python 2.7
from itertools import izip
def SVF... | geocryology/HorizonPy | horizonpy/skyview.py | Python | gpl-3.0 | 18,037 |
# -*- coding: utf-8 -*-
#
# Copyright 2012 James Thornton (http://jamesthornton.com)
# BSD License (see LICENSE for details)
#
"""
Bulbs supports pluggable clients. This is the Rexster client.
"""
from bulbs.config import Config, DEBUG
from bulbs.registry import Registry
from bulbs.utils import get_logger
# specific ... | mudbungie/NetExplorer | env/lib/python3.4/site-packages/bulbs/titan/client.py | Python | mit | 14,723 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_network_interfaces_operations.py | Python | mit | 5,642 |
#reset.py
#contains url endpoints for setting and resetting user password
import webapp2
import re
import os
import my_db
from google.appengine.ext import db
import html
import validate_email
from webapp2_extras import security
import util
import my_email
IS_DEV = os.environ['SERVER_SOFTWARE'].count('Development') > ... | whamtet/gae-webstore | reset.py | Python | epl-1.0 | 2,798 |
# Django settings for homepage project.
import django.conf.global_settings as DEFAULT_SETTINGS
import os
import re
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add ... | crchemist/test42 | homepage/settings.py | Python | unlicense | 5,589 |
# Copyright 2008-2015 Nokia Solutions and 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 l... | userzimmermann/robotframework | src/robot/reporting/jsbuildingcontext.py | Python | apache-2.0 | 3,444 |
from django.utils.translation import ugettext_lazy as _
import horizon
class LogPanels(horizon.PanelGroup):
slug = "logpanels"
name = _("LogPanels")
panels = ('overview','detail')
class LogDashboard(horizon.Dashboard):
name = _("LogDashboard")
slug = "logdashboard"
panels = (LogPanels,) # Ad... | TechBK/horizon-dev | openstack_dashboard/dashboards/logdashboard/dashboard.py | Python | apache-2.0 | 503 |
from django.conf.urls import url, include
from django.views.generic import RedirectView
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from nba_py.constants import CURRENT_SEASON
urlpatterns = [
# Redirect to current season ranking view
url(r'^$',... | pawelad/nba-rank | src/nba_rank/urls.py | Python | mit | 849 |
from __future__ import division
from collections import Counter
from itertools import chain, combinations
import json
from math import sqrt
import os
from random import randint, random, randrange, uniform
import tarfile
import time
import zipfile
_debug = False
def debug():
global _debug
return _debug
def... | AlexKuhnle/ShapeWorld | shapeworld/util.py | Python | mit | 12,503 |
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2012-2016 Symless Ltd.
# Copyright (C) 2009 Nick Bolton
#
# This package is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# found in the file LICENSE that should have accompanied this file.
#
... | ommokazza/synergy | ext/toolchain/__init__.py | Python | gpl-2.0 | 704 |
#!/usr/bin/env python
import gtk
class FontSelection(gtk.Window):
def __init__(self):
gtk.Window.__init__(self)
self.set_title("FontSelection")
self.set_border_width(5)
self.connect("destroy", gtk.main_quit)
vbox = gtk.VBox(False, 5)
self.add(vbox)
self.fo... | Programmica/pygtk-tutorial | examples/fontselection.py | Python | cc0-1.0 | 840 |
# 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 perf_tools import smoothness_metrics
from telemetry.core import util
from telemetry.page import page_measurement
class DidNotScrollException(page_me... | topcoat/topcoat-grunt-telemetry | src/tools/perf/measurements/smoothness.py | Python | apache-2.0 | 9,662 |
# Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | cmin764/cloudbase-init | cloudbaseinit/plugins/factory.py | Python | apache-2.0 | 4,203 |
import os.path
import re
import shutil
import struct
import subprocess
import sys
import zipfile2 as zipfile
import bz2
def import_boto():
global Key, S3Connection, bucket_lister, awscreds
try:
from boto.s3.key import Key
from boto.s3.connection import S3Connection
from boto.s3.bucketlistresultset impo... | kzmkv/SumatraPDF | scripts/util.py | Python | gpl-3.0 | 5,028 |
# -*- coding: utf-8 -*-
from .speedcurve import SpeedCurve
__author__ = 'Matt Chung'
__copyright__ = 'Copyright 2014 Matt Chung'
__license__ = 'MIT'
__title__ = 'speedcurve'
__version__ = '0.1.0'
__all__ = (
'SpeedCurve',
)
| itsmemattchung/speedcurve.py | speedcurve/__init__.py | Python | mit | 230 |
#!/usr/bin/env python
#
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | mogoweb/webkit_for_android5.1 | webkit/Source/WebKit/chromium/scripts/inline_js_imports.py | Python | apache-2.0 | 3,145 |
bdLibPath=os.path.abspath(sys.argv[0]+"..")
if not bdLibPath in sys.path: sys.path.append(bdLibPath)
from _lib import *
import unittest
class SmokeTests(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_001_GoogleSearch(self):
LaunchB... | YoTsenkov/TelerikSoftwareAcademyHomeworks | QA/Sikuli/sikuli_tests/smoke_tests.sikuli/smoke_tests.py | Python | mit | 3,679 |
from event import X10Event
from flask import Flask
from flask import g
from flask import jsonify as j
app = Flask(__name__)
daemon = None
def run_api(d, port=5000):
global daemon
daemon = d
app.run(host='0.0.0.0', port=port)
@app.before_request
def before_request():
g._daemon = daemon
@app.route('/o... | umbc-hackafe/x10-controller | api.py | Python | unlicense | 662 |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the Stanford NER-tagger
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Nitin Madnani <[email protected]>
# Rami Al-Rfou' <[email protected]>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A module for interfac... | devs4v/devs4v-information-retrieval15 | project/venv/lib/python2.7/site-packages/nltk/tag/stanford.py | Python | mit | 6,820 |
def as_bool(value):
'''
Smart cast value to bool
'''
if isinstance(value, bool):
return value
value = value.strip().lower()
if value in ('y', 'yes', 'on', 't', 'true', '1'):
return True
if value in ('n', 'no', 'off', 'f', 'false', '0'):
return False
raise ValueE... | funkybob/django-classy-settings | cbs/utils.py | Python | bsd-2-clause | 796 |
"""
This part of code is the reinforcement learning brain, which is a brain of the agent.
All decisions are made in here.
Policy Gradient, Reinforcement Learning.
View more on my tutorial page: https://morvanzhou.github.io/tutorials/
Using:
Tensorflow: 1.0
gym: 0.8.0
"""
import numpy as np
import tensorflow as tf
# r... | DarainS/texas-holdem-tools | ai/tfpreflop/RL_brain.py | Python | mit | 4,040 |
# Copyright 2017 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... | adit-chandra/tensorflow | tensorflow/python/grappler/tf_optimizer_test.py | Python | apache-2.0 | 5,449 |
#!/usr/local/bin/python
'''
Date July 4, 2012
Author: Justin Jessup
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Disclaimer:
All software provided as is. All software covered under the GPL license and free for public redistribution.
If unintended consequences occur due to utilization of this software, user bear... | proactivecndosint2012/OSINTREALTIMECND | reddit/cull_reddit.py | Python | gpl-3.0 | 4,522 |
# pylint: disable=W0401,W0223
import re
from .datatype import *
from .exception import NamingError
from .util import UnicodeMixin
__all__ = (
'Setting',
'StringSetting',
'IntegerSetting',
'FloatSetting',
'BooleanSetting',
'ListSetting',
'ChoiceSetting',
)
class Setting(UnicodeMixin, D... | jayclassless/setoptconf | setoptconf/setting.py | Python | mit | 1,755 |
""" putJSONdata.py
Copyright 2016 OSIsoft, 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 a... | danielElopez/PI-Connector-for-UFL-Samples | COMPLETE_SOLUTIONS/North American General Bike Feed/putJSONdata_SF_Bikes_service.py | Python | apache-2.0 | 3,727 |
#! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator().SetSeed(0)
try :
# We create a distribution
meanPoint = NumericalPoint(1)
meanPoint[0] = 1.0
sigma = NumericalPoint(1)
sigma[0] = 1.0
R = CorrelationMatrix(1)
distribution = Normal(meanPoint, sigma, R)
re... | dbarbier/privot | python/test/t_RandomVector_distribution.py | Python | lgpl-3.0 | 995 |
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
'''
Intuition results analyzer
--------------------------
Wraps session results with convenient analyse methods
:copyright (c) 2014 Xavier Bruhiere
:license: Apache 2.0, see LICENSE for more details.
'''
import pytz
import pandas as pd
import numpy as np
import dna... | intuition-io/intuition | intuition/core/analyzes.py | Python | apache-2.0 | 6,451 |
from django.db import models
class CalendarEvent(models.Model):
title = models.CharField(max_length=255)
scheduled_on = models.DateTimeField()
created = models.DateTimeField(auto_now_add=True)
edited = models.DateTimeField(auto_now=True)
def __unicode__(self):
return self.title | RockingRolli/django-event-calendar | event_calendar/models.py | Python | mit | 309 |
from article_metrics import models, utils
import json
from django.conf import settings
import boto3
import logging
LOG = logging.getLogger(__name__)
def sns_topic_arn(**overrides):
"returns an arn path to an AWS event bus. this is used to connect and send/receive events"
vals = {}
vals.update(settings.EV... | elifesciences/elife-metrics | src/article_metrics/events.py | Python | gpl-3.0 | 1,616 |
#!/usr/bin/env python
# coding=utf8
import os
import shutil
import sys
reload(sys)
sys.setdefaultencoding('utf-8') # @UndefinedVariable
# 输出文件夹
OUT_DIR = "output"
#
# 删除目录 (递归)
#
# Delete everything reachable from the directory named in "top",
# assuming there are no symbolic links.
# CAUTION: This is dangerou... | scwanglijun/disconf | disconf-web/src/main/webapp/build.py | Python | gpl-2.0 | 1,700 |
# coding=utf-8
import logging
# About language detecting logic:
#
# Step 1: if member.l10n is not empty/false, use it as the best choice
#
# Step 2: if Accept-Language header has something interesting, use it as the second choice
#
# Step 3: Fallback to site.l10n
def Getlang(langid):
if langid == 'en':
f... | melice/akiraguru | v2ex/babel/l10n/__init__.py | Python | bsd-3-clause | 1,288 |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google 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 2 of the License, or
# (at your option) any later version.
#
... | ekohl/ganeti | lib/backend.py | Python | gpl-2.0 | 108,319 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import httplib
import json
import logging
import re
import socket
import string
import time
import traceback
import urllib2
import urlparse
from extra.safe2bin.safe2bin impor... | pwnieexpress/raspberry_pwn | src/pentest/sqlmap/lib/request/connect.py | Python | gpl-3.0 | 46,892 |
import os,sys,inspect
try:
binary_path = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0],"binaries-python" + str(sys.version_info[0]) + "." + str(sys.version_info[1]) + '-' + ('win64' if sys.maxsize>2**32 else 'win32'))))
if binary_path not in sys.path:
... | sccn/SNAP | src/pylsl/pylsl.py | Python | bsd-3-clause | 473 |
import requests
from instagram.client import InstagramAPI
from flask import Flask, request, render_template, session, redirect, abort, flash, jsonify
import sys
import logging
import os
app = Flask(__name__)
app.logger.addHandler(logging.StreamHandler(sys.stdout))
app.logger.setLevel(logging.ERROR)
app.secret_key = o... | mr-karan/Insta-notFollow | main.py | Python | mit | 3,243 |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
... | netgroup/dreamer-ryu | ryu/controller/controller.py | Python | apache-2.0 | 11,676 |
#!/usr/bin/python
# Copyright (c) 2009, Purdue University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list ... | stephenlienharrell/roster-dns-management | roster-core/roster_core/db_access.py | Python | bsd-3-clause | 41,336 |
#!/usr/bin/python
import serial
import time
import random
import sys
s = None
num_leds = 93
play_time = 0
def flush_input():
s.flushInput()
def wait_for_ack():
while s.inWaiting() <= 0:
pass ... | jhogsett/linkit | python/windmill.py | Python | mit | 5,144 |
# Copyright (c) 2013, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condit... | ii0/bits | python/testsuite.py | Python | bsd-3-clause | 9,610 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-04 02:49
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('djangosourcecontrol', '0001_initial'),
]
operations = [
migrations.AlterModelOption... | kull2222/DjangoSourceControl | dsc/djangosourcecontrol/migrations/0002_auto_20161203_1849.py | Python | gpl-3.0 | 535 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 McKinsey Academy
#
# Authors:
# Jonathan Piacenti <[email protected]>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) a... | open-craft/xblock-poll | tests/integration/test_studio.py | Python | agpl-3.0 | 3,214 |
## 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 applic... | mrry/tensorflow | tensorflow/python/saved_model/saved_model_test.py | Python | apache-2.0 | 17,915 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from .api import asex
class ParallelExec:
def __init__(self, cmd_str_lst):
self.cmd_str_lst = cmd_str_lst
self.runcmd_lst = [asex(cmd) for cmd in cmd_str_lst]
def wait(self):
for p in self.runcmd_lst:
p.wait()
return se... | houqp/shell.py | shell/parallel_exec.py | Python | mit | 636 |
import math
import pygame
import time
from random import uniform, choice
from itertools import cycle
import binball_game.collision as collision
import binball_game.events as events
class Point():
def __init__(self, x, y=None):
self.x = x
self.y = y
def copy(self):
return Point(self.x,... | Jessime/MazeDay2017 | src/binball_game/components.py | Python | mit | 21,274 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ResultsDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | sebastic/QGIS | python/plugins/processing/gui/ResultsDialog.py | Python | gpl-2.0 | 2,576 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#windowController.py
from PyQt4 import QtGui
import sys, multiprocessing
import mainWindow, windowListerner
class QWindowsController(multiprocessing.Process):
def __init__(self, messageBox):
super(QWindowsController, self).__init__()
self.messageBox = messageBox
def run... | sharmaking/CoIntegrationAnalysis | windowController.py | Python | mit | 579 |
from .rpc import *
from .pcic import *
| cfreundl/o3d3xx-python | o3d3xx/__init__.py | Python | mit | 40 |
# coding=utf-8
# Copyright 2021 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | deepmind/jax_verify | jax_verify/tests/crownibp_test.py | Python | apache-2.0 | 2,800 |
#
# Notification Originator
#
# Send SNMP INFORM notification using the following options:
#
# * SNMPv3
# * with user 'usr-md5-none', auth: MD5, priv NONE
# * over IPv4/UDP
# * using Trollius framework for network transport
# * to a Manager at 127.0.0.1:162
# * send INFORM notification
# * with TRAP ID 'warmStart' spec... | ww9rivers/pysnmp | examples/v3arch/trollius/agent/ntforg/inform-v3.py | Python | bsd-2-clause | 3,361 |
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, 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 applicabl... | dreamhost/akanda-horizon | akanda/horizon/alias/forms/ports.py | Python | apache-2.0 | 2,876 |
# -*- test-case-name: txorm.test.test_property -*-
# Copyright (c) 2014 Oscar Campos <[email protected]>
# See LICENSE for details
from __future__ import unicode_literals
from .base import SimpleProperty
from ..variable._fraction import FractionVariable
class Fraction(SimpleProperty):
variable_class =... | DamnWidget/txorm | txorm/property/_fraction.py | Python | lgpl-3.0 | 338 |
"""
ldapurl - handling of LDAP URLs as described in RFC 2255
written by Michael Stroeder <[email protected]>
See http://python-ldap.sourceforge.net for details.
\$Id: ldapurl.py,v 1.32 2003/05/26 07:49:07 stroeder Exp $
Python compability note:
This module only works with Python 2.0+ since
1. string methods are u... | fxia22/ASM_xf | PythonD/lib/python2.4/site-packages/link/pyldap/ldapurl.py | Python | gpl-2.0 | 11,775 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, codecs, shutil, string, unicodedata
from PyQt4 import QtCore, QtGui
from peewee import *
from views.newproject import Ui_newProjectWizard
from models.corpus import *
from controllers.mainwindow import project
class newProjectWizard(QtGui.QWizard, Ui_newProj... | TopazaPyra/flying_squirrel | controllers/newprojectwizard.py | Python | gpl-2.0 | 4,097 |
"""
Utils for unittest
"""
class MockStorage(object):
def event(self, *args, **kwargs):
return {
"tasks": [],
"workers": [],
"tasks_average": {
"test1": 1,
"test2": 2,
"test3": 3,
},
"workers_aver... | ikeikeikeike/celery-tracker | tests/utils.py | Python | mit | 436 |
#!/usr/bin/python2
import matplotlib, sys
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy
matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']})
matplotlib.rc('text', usetex=True)
import styles
import readandcompute
readandcompute.absolute_f('../data/scrunched-ww1.30-L2.83/i0/N... | droundy/deft | papers/renormalization/figs/test.py | Python | gpl-2.0 | 336 |
#!/usr/bin/env python
import argparse
import csv
import random
import sys
import math
from math import inf
from textwrap import dedent
from editCIGAR import CIGAR
from textwrap import dedent
# Don't throw an error if output is piped into a program that doesn't
# read all of its input, like `head`.
from signal import ... | mlell/tapas | scripts/src/indel.py | Python | mit | 16,326 |
__author__ = "Ole Weidner"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
""" This examples shows how to run a job on a remote PBSPRO cluster
using the 'PBSPRO' job adaptor.
More information about the saga-python job API can be found at:
http://saga-project.github.com/s... | telamonian/saga-python | examples/jobs/pbsprojob.py | Python | mit | 3,616 |
from setuptools import setup
setup(name='YT-Watcher', version='0.0.1', packages=['ytw'], url='', license='MIT', author='jrg', author_email='',
description='Youtube multi search tool', install_requires=['PySide', 'urllib3', 'certifi'])
| jr-garcia/YT-Watcher | setup.py | Python | mit | 242 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2014 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under... | miltonruelas/cursotecnico | branch/customize/account.py | Python | agpl-3.0 | 5,997 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""nginx config file formatter/beautifier with no additional dependencies.
Originally published under https://github.com/1connect/nginx-config-formatter,
then moved to https://github.com/slomkowski/nginx-config-formatter.
"""
import argparse
import codecs
import context... | 1connect/nginx-config-formatter | nginxfmt.py | Python | apache-2.0 | 14,643 |
import unittest
from typing import List
import utils
# DP, prefix.
class NumMatrix:
# O(n) time. O(n) space.
def __init__(self, matrix: List[List[int]]):
sums = [[0] * len(matrix[0]) for _ in range(len(matrix))]
for r, row in enumerate(matrix):
for c, val in enumerate(row):
... | chrisxue815/leetcode_python | problems/test_0304.py | Python | unlicense | 1,569 |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | danielballan/scikit-xray | skbeam/core/tests/test_correlation.py | Python | bsd-3-clause | 15,181 |
from __future__ import print_function
from cms.sitemaps import CMSSitemap
from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
from ImmOrbit.api import... | RedMap/Django-ImmOrbit | example/src/Demo/urls.py | Python | apache-2.0 | 1,077 |
# coding: utf-8
"""
Stakeholder engagement API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger... | iEngage/python-sdk | iengage_client/apis/question_api.py | Python | apache-2.0 | 248,935 |
# -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.or... | wontfix-org/wtf | _setup/py3/ext.py | Python | apache-2.0 | 7,479 |
# Generated by Django 1.9.13 on 2017-08-31 03:58
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('community', '0002_auto_20150416_1853'),
]
operations = [
migrations.AlterField(
model_name=... | manhhomienbienthuy/pythondotorg | community/migrations/0003_auto_20170831_0358.py | Python | apache-2.0 | 460 |
# pylint: disable=missing-docstring
import unittest
from housecanary.object import Property
from housecanary.object import Block
from housecanary.object import ZipCode
from housecanary.object import Msa
class PropertyTestCase(unittest.TestCase):
def setUp(self):
self.test_json = {
'property/v... | housecanary/hc-api-python | tests/test_object.py | Python | mit | 13,530 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, [email protected], All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | var/spack/repos/builtin/packages/r-numderiv/package.py | Python | lgpl-2.1 | 1,693 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
setup (name='igep_qa',
version='0.1',
description=u'IGEP Quality Assurance scripts',
long_description=u'This is overall test software for IGEP Technology '
u'based devices, which defines test sc... | eballetbo/igep_qa | setup.py | Python | mit | 1,324 |
import os
import sys
import pytest
# Hacky way to import application/
my_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, my_path + '/../')
from application.api_service import create_app
@pytest.fixture
def app():
app = create_app()
return app
| Tri-Try/REST | tests/conftest.py | Python | gpl-2.0 | 276 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | YuepengGuo/backtrader | backtrader/observers/broker.py | Python | gpl-3.0 | 1,655 |
inf = 1000
def Bridge4x4(width1 = 5.0, width2=10.0, spacing = 3.01/1.1):
angle = -45.0
#
y0 = 0.0
y1 = y0 + 0.5*spacing + 0.5*width1
y2 = y1 + 0.5*(width1+width2) + spacing
y_1 = y0 - 0.5*spacing - 0.5*width2
y_2 = y_1 - 0.5*(width1+width2) - spacing
#
line1 = Line(Poin... | raphaelvalentin/qtlayout | Projects/Bridges/bridge5.py | Python | gpl-2.0 | 11,681 |
# Copyright 2021 The gRPC Authors
#
# 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... | vjpai/grpc | tools/run_tests/xds_k8s_test_driver/tests/url_map/fault_injection_test.py | Python | apache-2.0 | 15,937 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.