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 |
|---|---|---|---|---|---|
#-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | timeyyy/PyUpdater | pyupdater/vendor/PyInstaller/hooks/hook-PIL.Image.py | Python | bsd-2-clause | 621 |
# -*- coding: UTF-8 -*-
#from gtts_token import gtts_token
#import led
import logging
import requests
import urllib
import json
import time
from flask import Flask, redirect, url_for, render_template, request, Response
import configparser
app = Flask(__name__)
config = configparser.ConfigParser()
config.read("settin... | gidong-lee/mirrorMirrorSmartMirror | routes.py | Python | gpl-3.0 | 3,316 |
"""
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
from __future__ import unicode_literals
import logging
import re
from django.conf import settings
from django.core.urlresolvers import get_callable
from django.utils... | samabhi/pstHealth | venv/lib/python2.7/site-packages/django/middleware/csrf.py | Python | mit | 9,921 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('spirit_category', '0002_auto_20150728_0442'),
]
operations = [
migrations.AddField(
model_name='category',
name='is_global',
fiel... | nitely/Spirit | spirit/category/migrations/0003_category_is_global.py | Python | mit | 485 |
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import NotFound, ValidationError, PermissionDenied
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from api.base.exceptions import Gone
from api.base import permissions as base_permissions
from... | rdhyee/osf.io | api/comments/views.py | Python | apache-2.0 | 13,558 |
#
# Copyright (c) 2013-2016 Intel Corporation.
#
# SPDX-License-Identifier: GPL-2.0-only
#
# DESCRIPTION
# This module provides the OpenEmbedded partition object definitions.
#
# AUTHORS
# Tom Zanussi <tom.zanussi (at] linux.intel.com>
# Ed Bartosh <ed.bartosh> (at] linux.intel.com>
import logging
import os
import uui... | schleichdi2/OPENNFR-6.3-CORE | opennfr-openembedded-core/scripts/lib/wic/partition.py | Python | gpl-2.0 | 16,169 |
from __future__ import division, print_function
import numpy as np
from functools import partial
from itertools import product
import warnings
from sklearn import datasets
from sklearn import svm
from sklearn.preprocessing import LabelBinarizer
from sklearn.datasets import make_multilabel_classification
from sklearn... | loli/sklearn-ensembletrees | sklearn/metrics/tests/test_metrics.py | Python | bsd-3-clause | 102,794 |
##
## func delegation tools
## These are some helper methods to make dealing with delegation
## dictionary trees a little more sane when dealing with delegation
## and related functions.
##
## Copyright 2008, Red Hat, Inc.
## Steve Salevan <ssalevan@redhat.com>
##
## This software may be freely redistributed under the ... | ssalevan/func | func/overlord/delegation_tools.py | Python | gpl-2.0 | 7,199 |
#!/usr/bin/env python
# $Id$
# Copyright (C) 2004,2008 Igor Belyi <belyi@users.sourceforge.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
# ... | malb/pyme | examples/delkey.py | Python | gpl-2.0 | 1,456 |
#! /usr/bin/python
"""
PCcrawler.py is the producer/consumer version of PF crawler. This will
be last the version before transforming into the pure-thread version.
PCcrawler.py is set up to start a crawl form a given list of frontiers,
pages already visted, and hash_codes already encountered:
webcrawl( file_to... | JoeDurrant/pysearch | PCcrawler.py | Python | gpl-2.0 | 22,205 |
#Examen 2
#Octubre 11 - 2017
#procesamiento digital de senales
#universidad santiago de cali
#Nombre:
#ID:
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
#from fourierFunc import fourierAn
import wav_process as wp
from wav_rw import wavread, wavwrite
from scipy.signal import get_window
###... | miltonsarria/dsp-python | audio/examen3.py | Python | mit | 3,422 |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
'''MATRIX Log File Maker
Version: 2
This script will create a csv file that will be a table of settings for all
STM data recorded from the Omicron MATRIX software.
List of classes: -none-
List of functions:
main
'''
# built-in modules
im... | ampron/pyMTRX | pyMTRX/scripts/notebook_sheet.py | Python | gpl-3.0 | 12,420 |
# -*-coding:Utf-8 -*
# Copyright (c) 2012 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
# l... | stormi/tsunami | src/primaires/tresor/commandes/tresor/__init__.py | Python | bsd-3-clause | 2,467 |
#!/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.o... | xsmart/bluecherry-client | scripts/symbolstore.py | Python | gpl-2.0 | 23,687 |
# Copyright 2010 Google Inc.
#
# 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, dis-
# trib... | pwendell/mesos | third_party/boto-2.0b2/boto/file/key.py | Python | apache-2.0 | 4,416 |
import logging
import flask
from flask.views import MethodView
from conf.appconfig import TASK_SETTINGS, BOOLEAN_TRUE_VALUES
from orchestrator.views import task_client
from flask import request
logger = logging.getLogger(__name__)
class TaskApi(MethodView):
"""
Api for task
"""
def get(self, id=None... | totem/cluster-orchestrator | orchestrator/views/task.py | Python | mit | 901 |
from django.contrib.auth.models import User
class OAuth2User(User):
pass
| allanlei/django-oauthentication | oauthentication/oauth2/models.py | Python | bsd-3-clause | 79 |
from lino_xl.lib.contacts.fixtures.demo import site_company_objects as objects
| lsaffre/noi | lino_noi/lib/groups/fixtures/demo.py | Python | agpl-3.0 | 80 |
# Copyright 2011-2013 James McCauley
#
# 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 ... | avihad/ARP-Storm | src/arp_open_flow/pox/openflow/discovery.py | Python | apache-2.0 | 15,647 |
"""
Copyright (C) 2018 Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
This file is distributed under the terms of the 3-clause BSD License.
A copy of the license can be found in the root directory or at
https://opensource.org/licenses/BSD-3-Clause.
Author: Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
Da... | formalmethods/intrepyd | intrepyd/iec611312py/datatype.py | Python | bsd-3-clause | 2,009 |
# Copyright (C) 2017 FireEye, Inc. All Rights Reserved.
import contextlib
import envi
import viv_utils
class ApiMonitor(viv_utils.emulator_drivers.Monitor):
"""
The ApiMonitor observes emulation and cleans up API function returns.
"""
def __init__(self, vw, function_index):
viv_utils.emulat... | fireeye/flare-floss | floss/api_hooks.py | Python | apache-2.0 | 14,484 |
"""
Django settings for releasenotes_project project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
... | ajduncan/releasenotes | releasenotes_project/releasenotes_project/settings.py | Python | mit | 3,460 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
control_wizard
this main class load from one configuration file (default tracks.cfg) all the configured tables
and start the editor
This program is free software: you c... | mlabru/ptracks | control/wizard/control_wizard.py | Python | gpl-3.0 | 2,917 |
"""
Lets have a set of sets:
A = { {1, 2, 3} , {4, 5, 6}, {7, 8, 9} }
A transversal T for A is a set that contains at least one element from each set of A.
For example: T = {1, 4, 7}
Implement a function is_transversal(transversal, family), which check if given set is a valid transversal
for another family of sets (... | vladislav-karamfilov/Python-Playground | HackBulgaria-Programming-101-with-Python-Course/week01/Dive-into-Python/transversal.py | Python | mit | 983 |
# pylint:disable=no-member
import pickle
import logging
from collections import defaultdict
import networkx
from ...protos import cfg_pb2, primitives_pb2
from ...serializable import Serializable
from ...utils.enums_conv import cfg_jumpkind_to_pb, cfg_jumpkind_from_pb
from ...errors import AngrCFGError
from .cfg_node ... | schieb/angr | angr/knowledge_plugins/cfg/cfg_model.py | Python | bsd-2-clause | 16,175 |
import logging
logger = logging.getLogger(__name__)
from django.core.urlresolvers import reverse
from py_w3c.validators.html.validator import HTMLValidator
try:
from sitemap import UrlSet
except ImportError:
logger.error(
'Could not import sitemap from python-sitemap package. '
'Please be sur... | visualspace/django-vspace-utils | vspace_utils/tests.py | Python | bsd-3-clause | 2,809 |
# Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | quantumlib/Cirq | cirq-core/cirq/interop/quirk/cells/input_cells.py | Python | apache-2.0 | 2,927 |
#!/usr/bin/env python
from optparse import OptionParser
from pypsignifit import psigobservers
from pypsignifit import psigcorrect
import pypsignifit
from numpy import array,arange,mgrid,clip,zeros,sort, random,mean, asarray
import os,sys
import pylab
from pylab import prctile as ptile
import operator
import time
impor... | esc/Psignifit-3.x | scripts/nonstationarity/coverage.py | Python | mit | 25,414 |
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/lice... | bitcrystal/buildtools-BaseTools | Source/Python/AutoGen/StrGather.py | Python | bsd-2-clause | 23,172 |
#
# 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 us... | saltstar/spark | python/pyspark/sql/dataframe.py | Python | apache-2.0 | 81,603 |
try:
from scipy import special
available_cpu = True
except ImportError as e:
available_cpu = False
_import_error = e
import math
import chainer
from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
BACKWORDC = math.pi ** 0.5... | okuta/chainer | chainer/functions/math/erfcinv.py | Python | mit | 1,699 |
# -*- coding: utf-8 -*-
import argparse
import asyncio
import json
# import logging
import os
import sys
import time # noqa: F401
from os import _exit
from traceback import format_tb
# ------------------------------------------------------------------------------
# logging.basicConfig(level=logging.INFO)
# ---------... | ccxt/ccxt | python/ccxt/test/test_async.py | Python | mit | 22,780 |
dir_blacklist = ["behaviors/nodes", "vehicles/modularmech"]
path_blacklist = {"ai/ai.config": ["/shipStatus/0/animation"]}
| ProjectSky/FrackinUniverse-sChinese-Project | script/tools/blacklist.py | Python | mit | 123 |
import hashlib
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist
from django.template import resolve_variable
from django.core.cache import cache
from django.utils.encoding import force_unicode
from django.utils.http import urlquote
register = Library()
class CacheNode(Nod... | mitsuhiko/django | django/templatetags/cache.py | Python | bsd-3-clause | 2,355 |
from model.contact import Contact
import re
from fixture.group import GroupHelper
__author__ = 'Max'
class ContactHelper:
def __init__(self, app):
self.app = app
def change_field_value(self,field_name,text):
wd = self.app.wd
if text is None:
wd.find_element_by_name(field_... | mihushynmaksym/Python_Training | fixture/contact.py | Python | apache-2.0 | 3,371 |
from django import template
from djangopress.donate.models import Donation
register = template.Library()
@register.inclusion_tag('donate/list.html')
def show_latest_donations(number=5):
try:
number = int(number)
except ValueError:
number = 5
donations = Donation.objects.filter(validated=Tr... | codefisher/djangopress | djangopress/donate/templatetags/donate_tags.py | Python | mit | 775 |
import os, sys, urllib, requests, re, htmlentitydefs, hashlib, time
if sys.version < '2.7.3': #If crappy html.parser, use internal version. Using internal version on ATV2 crashes as of XBMC 12.2, so that's why we test version
import HTMLParser #analysis:ignore
import bs4 # @UnresolvedImport
import functools
from ... | ruuk/plugin.video.geekandsundry | geekandsundry.py | Python | gpl-2.0 | 13,345 |
glm_object_dict = {}
glm_object_dict[0] = {'object' : 'overhead_line_conductor',
'name' : 'ohlc_100',
'geometric_mean_radius' : '0.0244',
'resistance' : '0.306'}
glm_object_dict[1] = {'object' : 'overhead_line_conductor',
'name' : 'ohlc_101',
'geometric_mean_radius' : '0.00814',
'resista... | NREL/glmgen | glmgen/four_node_residential.py | Python | gpl-2.0 | 5,252 |
# restapi setup.py script
#
# It doesn't depend on setuptools, but if setuptools is available it'll use
# some of its features, like package dependencies.
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
from subprocess import Popen, PIPE
import os
import sy... | xgfone/taskpool | setup.py | Python | bsd-3-clause | 4,340 |
import caffe
import surgery, score
import numpy as np
import os
import setproctitle
setproctitle.setproctitle(os.path.basename(os.getcwd()))
weights = '../siftflow-fcn16s/siftflow-fcn16s.caffemodel'
# init
caffe.set_device(int(sys.argv[1]))
caffe.set_mode_gpu()
solver = caffe.SGDSolver('solver.prototxt')
solver.ne... | wkentaro/fcn | fcn/external/fcn.berkeleyvision.org/siftflow-fcn8s/solve.py | Python | mit | 861 |
from flask import current_app, request
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Build, Repository, TestCase, Job
from zeus.utils.trees import build_tree
from .base_repository import BaseRepositoryResource
from ..schemas import BuildSchema
build_schema = BuildSchema... | getsentry/zeus | zeus/api/resources/repository_testtree.py | Python | apache-2.0 | 2,890 |
from datetime import datetime
from unittest import TestCase
from pycrunchbase import FundingRound
FUNDING_ROUND_DATA = {
"uuid": "uuid1",
"type": "FundingRound",
"properties": {
"permalink": "uuid1",
"funding_type": "private_equity",
"series": "c",
"announced_on": "2011-01-21",
"announced_on_trust_code":... | alabid/pycrunchbase | tests/test_fundinground.py | Python | mit | 3,696 |
# plots.py
#
# Plotting code for Variant Filtration with Neural Nets
# This includes evaluation plots like Precision and Recall curves,
# various flavors of Receiver Operating Characteristic (ROC curves),
# As well as graphs of the metrics that are watched during neural net training.
#
# December 2016
# Sam Friedman
# ... | broadinstitute/hellbender | src/main/python/org/broadinstitute/hellbender/vqsr_cnn/vqsr_cnn/plots.py | Python | bsd-3-clause | 6,827 |
"""plistlib.py -- a tool to generate and parse MacOSX .plist files.
The PropertList (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.
To write out a plist file, use the writePlist(rootObject, pathOrFi... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-mac/plistlib.py | Python | gpl-2.0 | 14,969 |
#! /usr/bin/env python
#ADVICE: when starting fresh with a new cluster. first search for #adam-Warning# in this code and change stuff whereever there is a #adam-Warning
import commands
import matplotlib
host=commands.getoutput('hostname')
if not host.startswith('ki-ls'):
matplotlib.use('Agg')
import matplotlib.pyla... | deapplegate/wtgpipeline | simple_ic_PANSTARRS.py | Python | mit | 328,615 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | DCSaunders/tensorflow | tensorflow/python/ops/template.py | Python | apache-2.0 | 11,945 |
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_stream_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.lib.validator import check_dict, check_string
from zerver.m... | amanharitsh123/zulip | zerver/webhooks/papertrail/view.py | Python | apache-2.0 | 1,905 |
from __future__ import (absolute_import, division, print_function)
__version__ = '0.10-dev'
| mbertrand/OWSLib | owslib/__init__.py | Python | bsd-3-clause | 93 |
#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard W. Lincoln
#
# 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 restrictio... | rwl/puddle | puddle/resource/action/export_action.py | Python | mit | 4,917 |
# Copyright (c) 2011 AOL Inc. All Rights Reserved.
#
# 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, merg... | MapQuest/mapquest-osm-server | src/python/dbmgr/dbm_stats.py | Python | mit | 3,450 |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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 os
import json
import pytest
import sys
from nose.plugins.skip i... | trondhindenes/ansible | test/units/modules/network/f5/test_bigip_trunk.py | Python | gpl-3.0 | 4,616 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-24 21:15
from __future__ import unicode_literals
from django.db import migrations, models
import unixtimestampfield.fields
class Migration(migrations.Migration):
dependencies = [
('knowall', '0001_initial'),
]
operations = [
... | audiua/shkolyar_django | knowall/migrations/0002_auto_20170425_0015.py | Python | mit | 1,648 |
t1 = ("apple", "banana", "cherry", "durian", "orange")
i = 0
while i < len( t1 ):
print( t1[i] )
i += 1 | paulmcquad/Python | 10-Tuples/Tuple_indices.py | Python | gpl-3.0 | 111 |
from django import forms
import models
class RedirectForm(forms.ModelForm):
required_css_class = "required"
class Meta:
model = models.Redirect
| mayapurmedia/wagtail | wagtail/wagtailredirects/forms.py | Python | bsd-3-clause | 164 |
#!===================================================
#! The Distribution of Linear Regression Coefficients
#!===================================================
from pacal import *
from pylab import figure, show, plot, subplot, title
from scipy.optimize import fmin
from numpy.random import seed
from numpy i... | dkasak/pacal | pacal/examples/dependent/linreg.py | Python | gpl-3.0 | 2,564 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Autor: Alexey V. Polurotov
# e-mail: niimailtah@gmail.com
# Common nick: Niimailtah
# ----------------------------------------------------------------------------
# https://projecteuler.net/problem=7
# 10001st prime
# Problem 7
#
# By listing the first six prime number... | niimailtah/projecteuler.net | sources/problem007.py | Python | gpl-2.0 | 653 |
"""
MQTT provider for Herald
"""
import herald.beans as beans
import pelix.misc.mqtt_client as mqtt
import threading
class MQTTRouter(object):
"""
MQTT Router
"""
def __init__(self):
# (host, port) => link
self._links = {}
self.__lock = threading.Lock()
def get_link(self... | gattazr/cohorte-herald | python/snippets/herald_mqtt/mqtt.py | Python | apache-2.0 | 1,725 |
from journal import models
def yield_homepage_element_context(request, homepage_elements):
""" Renders a specific issue in the journal.
:param request: the request associated with this call
:return: a rendered template of this issue
"""
if homepage_elements is not None and homepage_e... | BirkbeckCTP/janeway | src/core/homepage_elements/issue/hooks.py | Python | agpl-3.0 | 967 |
# Copyright 2013-2017 ARM 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 applicable law or agreed to in w... | lisatn/workload-automation | wa/framework/configuration/__init__.py | Python | apache-2.0 | 827 |
# -*- coding: utf-8 -*-
import scrapy
import json
import re
from locations.items import GeojsonPointItem
class MisterCarWashSpider(scrapy.Spider):
name = "mistercarwash"
allowed_domains = ["mistercarwash.com/"]
start_urls = (
'http://mistercarwash.com/locations/',
)
def store_hours(self,... | iandees/all-the-places | locations/spiders/mistercarwash.py | Python | mit | 3,079 |
import pygame
import queue
class Monster:
"""
Class that maintains anything related to the monsters
"""
def __init__(self, board, screen, side, pacman):
self.board = board
self.screen = screen
#self.color = choice([0, 1, 2]) #Green = 0, Blue = 1, Red = 2
self.skin = pygame.image.load("skins/ghost.png")
... | h-utkuunlu/CMPM | monsters.py | Python | gpl-3.0 | 4,435 |
#!/usr/bin/env python
# Copyright 2011 VMware, 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
#
# ... | samsu/neutron | plugins/openvswitch/agent/ovs_neutron_agent.py | Python | apache-2.0 | 73,300 |
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.conf.urls import patterns
urlpatterns = patterns('utils.views',
... | ansp-2015/arquea | utils/urls.py | Python | mpl-2.0 | 326 |
#!/usr/bin/env python3
import os
import sys
from xml.dom import minidom
# STRINGTABLE DIAG TOOL
# Author: KoffeinFlummi
# ---------------------
# Checks for missing translations and all that jazz.
def get_all_languages(projectpath):
""" Checks what languages exist in the repo. """
languages = []
for mo... | firefly2442/ACE3 | tools/stringtablediag.py | Python | gpl-2.0 | 3,604 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
from __future__ import division
from __future__ import nested_scopes
from __future__ import generators
from __future__ import unicode_literals
from __future__ import print_function
import numpy as np
... | michaelerule/neurotools | linalg/arguments.py | Python | gpl-3.0 | 4,329 |
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http... | arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/botocore/retryhandler.py | Python | mit | 13,631 |
import unittest
import numpy as np
from ..stat import *
from .. import stat
class TestLedoitWolfCov(unittest.TestCase):
def setUp(self):
np.random.seed(0)
p, n = 40, 50
self.A = A = np.random.randn(p, p)
self.Sigma = np.dot(A, A.T)
X = np.random.randn(p, n)
X -= np.a... | wmvanvliet/psychic | psychic/tests/teststat.py | Python | bsd-3-clause | 9,137 |
from django.conf.urls import include, url
from django.contrib import admin
import django.contrib.auth.views
import membership.views
urlpatterns = [
url(r'^$', membership.views.index, name='index'),
url(r'^admin/', include(admin.site.urls)),
url('', include('social.apps.django_app.urls', namespace='social')... | HackUCF/ppl | ppl/urls.py | Python | gpl-3.0 | 707 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | Jgarcia-IAS/SAT | openerp/addons/mail/mail_followers.py | Python | agpl-3.0 | 12,402 |
'''OpenGL extension S3.s3tc
This module customises the behaviour of the
OpenGL.raw.GL.S3.s3tc to provide a more
Python-friendly API
Overview (from the spec)
This extension allows specifying texture data in compressed S3TC
format.
The official definition of this extension is available here:
http://www.opengl.or... | D4wN/brickv | src/build_data/windows/OpenGL/GL/S3/s3tc.py | Python | gpl-2.0 | 556 |
# Copyright The PyTorch Lightning team.
#
# 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... | williamFalcon/pytorch-lightning | pl_examples/test_examples.py | Python | apache-2.0 | 1,486 |
from django.conf import settings
from django.shortcuts import render_to_response, redirect
from oauthtwitter import OAuthApi
from seeder.models import AuthorizedAccount, Token, Seeder
from datetime import datetime
from urllib2 import HTTPError
def index(request):
return render_to_response(
'seeder/index.ht... | tswicegood/seeder | seeder/views.py | Python | gpl-3.0 | 2,036 |
from graphviz import Digraph
import torch
from torch.autograd import Variable
def make_dot(var, params=None):
""" Produces Graphviz representation of PyTorch autograd graph
Blue nodes are the Variables that require grad, orange are Tensors
saved for backward in torch.autograd.Function
Args:
va... | denizs/torchUp | torchup/logging/visualize.py | Python | bsd-2-clause | 2,018 |
๏ปฟ"""
>>> p = OriginalProvider('example')
>>> p.getTileUrls(Coordinate(25322, 10507, 16)) #doctest: +ELLIPSIS
('http://tile.cloudmade.com/example/1/256/16/10507/25322.png',)
>>> p = FineLineProvider('example')
>>> p.getTileUrls(Coordinate(25322, 10507, 16)) #doctest: +ELLIPSIS
('http://tile.cloudmade.com/example/2/256/... | fieldpapers/fp-legacy | decoder/ModestMaps/CloudMade.py | Python | gpl-2.0 | 2,467 |
import lyriczilla.player
import dbus
def quod_get_info():
try:
daemon = dbus.SessionBus().get_object('net.sacredchao.QuodLibet',
'/net/sacredchao/QuodLibet')
info = daemon.CurrentSong()
return {'title': info['title'],
'artist': ... | solos/Lyriczilla | player/quodlibet.py | Python | gpl-2.0 | 486 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import time
from django.db import connection
from django_logutils.conf import settings
logger = logging.getLogger(__name__)
de... | jsmits/django-logutils | django_logutils/middleware.py | Python | bsd-3-clause | 4,098 |
"""Image filters: operations on entire images at once.
A filter is merely a callable that accepts some number of frames and returns a
new image with a single frame:
new_image = some_filter(*old_image)
Note the use of ``*`` to flatten the image into its frames.
The API for filters is not particularly rigid. Som... | eevee/sanpera | sanpera/filters.py | Python | isc | 12,998 |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | cedriclaunay/gaffer | python/GafferUI/TransformPlugValueWidget.py | Python | bsd-3-clause | 2,773 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import os, sys, uuid, logging, logging.config, json, codecs, time, pyutils
# sys.path = ['/usr/local/lib/python2.7/dist-packages'] + sys.path
from pyutils import Options, LogAdapter, strflocal, ... | bstrebel/PySync | pysync/core.py | Python | gpl-2.0 | 29,015 |
from bears.c_languages.GNUIndentBear import GNUIndentBear
from coalib.testing.LocalBearTestHelper import verify_local_bear
test_file1 = """
int
main ()
{
return 0;
}"""
test_file2 = """
int
main ()
{
return 0;
}"""
test_file3 = """
int
main ()
{
\treturn 0;
}"""
test_file4 = """
int main() {
return 0;
}"... | coala-analyzer/coala-bears | tests/c_languages/GNUIndentBearTest.py | Python | agpl-3.0 | 2,675 |
# Generated by Django 2.2.5 on 2019-10-07 21:10
from django.db import migrations
from ureport.sql import InstallSQL
class Migration(migrations.Migration):
dependencies = [("contacts", "0021_auto_20190926_1554")]
operations = [InstallSQL("contacts_0022")]
| rapidpro/ureport | ureport/contacts/migrations/0022_install_triggers.py | Python | agpl-3.0 | 269 |
"""
There was a deadlock problem when work count is smaller than number of threads.
"""
from __future__ import absolute_import, print_function, division
from numba import unittest_support as unittest
import numpy as np
from numba import float32, float64, int32, uint32
from numba.npyufunc import Vectorize
def vecto... | jriehl/numba | numba/tests/npyufunc/test_parallel_low_work.py | Python | bsd-2-clause | 1,153 |
import json
from conans.model import Generator
class YouCompleteMeGenerator(Generator):
template = '''
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public ... | memsharded/conan | conans/client/generators/ycm.py | Python | mit | 6,595 |
"""
Custom management command to rebuild thumbnail images
- May be required after importing a new dataset, for example
"""
import os
import logging
from PIL import UnidentifiedImageError
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db.utils import OperationalError... | SchrodingersGat/InvenTree | InvenTree/InvenTree/management/commands/rebuild_thumbnails.py | Python | mit | 1,950 |
# This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | atom3dp/Burner | printrun/gui/controls.py | Python | gpl-3.0 | 22,789 |
#!/usr/bin/env python
from __future__ import print_function, absolute_import
try:
from itertools import ifilter as filter
except ImportError:
pass
import argparse
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
def get_eigs(vasp_xml):
"""Read vaspru... | ajjackson/mctools | mctools/get_vbm.py | Python | gpl-3.0 | 1,975 |
# Core imports
import copy
import Queue
import thread
import time
# Package imports
from ..core.Threadable import Threadable
from ..reconstruction.Buffer import Buffer
from ..settings import Arguments
from Packet import Packet
from TDMA_Scheduler import TDMA_Scheduler
# pylint: disable=undefined-all-variable
__all__ ... | timvandermeij/mobile-radio-tomography | zigbee/RF_Sensor.py | Python | gpl-3.0 | 15,115 |
#!/usr/bin/python
from BeautifulSoup import BeautifulSoup
import codecs
import os
import glob
import sys
import subprocess
import re
def soup_flatten(soup):
# http://stackoverflow.com/questions/753052/strip-html-from-strings-in-python
soupstring = "".join(soup.findAll(text=True))
soupstring = soupstring.r... | mponweiser/thesis-LDA-in-R | web-scraping/4-scrub.py | Python | mit | 9,217 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlWwwRobotrules(PerlPackage):
"""Database of robots.txt-derived permissions"""
home... | iulian787/spack | var/spack/repos/builtin/packages/perl-www-robotrules/package.py | Python | lgpl-2.1 | 637 |
from django.contrib import admin
from friends.apps.phonebook.models import Contact
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
list_display = ('id', 'first_name', 'last_name', 'phone_number')
list_filter = ('last_name', )
search_fields = ['first_name', 'last_name']
| alexdzul/friends | friends/apps/phonebook/admin.py | Python | mit | 299 |
"""Ecommerce API constants."""
class APIDictionaryKeys(object):
"""Dictionary keys used repeatedly in the ecommerce API."""
BASKET_ID = u'id'
CHECKOUT = u'checkout'
ORDER = u'order'
ORDER_NUMBER = u'number'
ORDER_TOTAL = u'total'
PAYMENT_DATA = u'payment_data'
PAYMENT_FORM_DATA = u'pay... | janusnic/ecommerce | ecommerce/extensions/api/constants.py | Python | agpl-3.0 | 689 |
import asyncio
import logging
import os
from waterbutler.core.exceptions import InvalidParameters, DownloadError
import waterbutler.core.streams
from mfr.core import utils
from mfr.server import settings
from mfr.server.handlers import core
logger = logging.getLogger(__name__)
class ExportHandler(core.BaseHandler)... | TomBaxter/modular-file-renderer | mfr/server/handlers/export.py | Python | apache-2.0 | 4,185 |
import sublime
import subprocess
import os
from ...anf_util import *
# The Code to find git path is copied verbatim from kemayo's Git plugin.
# https://github.com/kemayo/sublime-text-git
def _test_paths_for_executable(paths, test_file):
for directory in paths:
file_path = os.path.join(directory, test_file... | herove/dotfiles | sublime/Packages/AdvancedNewFile/advanced_new_file/vcs/git/git_command_base.py | Python | mit | 2,158 |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import numpy as np
import theano
import theano.tensor as T
import treeano
from . import base
def datamap_batch_merge(datamaps, scalar_merge="mean"):
"""
concatenates along the batch axis, and merges sca... | diogo149/treeano | canopy/handlers/batch.py | Python | apache-2.0 | 7,562 |
import re
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from plumbum.commands import CommandNotFound, ConcreteCommand, shquote
from plumbum.lib import ProcInfo
from plumbum.machines.base import BaseMachine
from plumbum.machines.env import BaseEnv
from plumbum.machines.local import Local... | tomerfiliba/plumbum | plumbum/machines/remote.py | Python | mit | 16,021 |
"""
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py schemamigration courseware --auto description_of_your_change
3. Add the migration file created... | morenopc/edx-platform | lms/djangoapps/courseware/models.py | Python | agpl-3.0 | 9,032 |
import urllib
import json
def get_json_url(url):
return json.loads(urllib.urlopen(url).read())
releases = get_json_url("https://api.github.com/repos/jhakonen/wot-teamspeak-mod/releases")
for release in releases:
for asset in release["assets"]:
print("File '{0}' has been downloaded {1} times.".format(asse... | jhakonen/wot-teamspeak-mod | utils/release_download_counts.py | Python | lgpl-2.1 | 358 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/googlecloudsdk/core/util/peek_iterable.py | Python | bsd-3-clause | 6,391 |
import json
import traceback
file_path = "data/languages.json"
lang_list = ["English (en)", "Spanish (es)", "Hebrew (he)", "Finnish (fi)", "French (fr)"]
language_settings = {}
class Languages:
with open("assets/languages/english.json", encoding="UTF-8") as file:
english = json.load(file)
with open(... | ZeroEpoch1969/RubyRoseBot | utils/language.py | Python | mpl-2.0 | 4,843 |
# coding=utf-8
import unittest
"""669. Trim a Binary Search Tree
https://leetcode.com/problems/trim-a-binary-search-tree/description/
Given a binary search tree and the lowest and highest boundaries as `L` and
`R`, trim the tree so that all its elements lies in `[L, R]` (R >= L). You
might need to change the root of ... | openqt/algorithms | leetcode/python/lc669-trim-a-binary-search-tree.py | Python | gpl-3.0 | 1,292 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.