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 |
|---|---|---|---|---|---|
import os
import sys
def main(args):
if len(args) != 2:
print("Usage: python project-diff.py [path-to-project-1] [path-to-project-2]")
return
dir1 = args[0]
dir2 = args[1]
project1 = collect_text_files(dir1)
project2 = collect_text_files(dir2)
files_only_in_1 = []
files_only_in_2 = []
files_... | blakeohare/crayon | Scripts/project-diff.py | Python | mit | 5,511 |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/wi/wisite_accessmethod_binding.py | Python | apache-2.0 | 9,580 |
# -*- coding: utf-8 -*-
# Copyright 2016 SYLEAM
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, api, fields, exceptions, _
class OAuthProviderToken(models.Model):
_name = 'oauth.provider.token'
_description = 'OAuth Provider Token'
_rec_name = 'token'
toke... | ClearCorp/server-tools | oauth_provider/models/oauth_provider_token.py | Python | agpl-3.0 | 3,749 |
# VMware vCloud Director Python SDK
# Copyright (c) 2017 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
#... | pacogomez/pyvcloud | pyvcloud/vcd/system.py | Python | apache-2.0 | 5,967 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the sqlite blob file resolver helper implementation."""
import unittest
from dfvfs.resolver import sqlite_blob_resolver_helper
from tests.resolver import test_lib
class SqliteBlobResolverHelperTest(test_lib.ResolverHelperTestCase):
"""Tests for the sqlite blo... | manashmndl/dfvfs | tests/resolver/sqlite_blob_resolver_helper.py | Python | apache-2.0 | 850 |
from hashes.hash_function import hash_function
from binascii import hexlify
try:
import ssl
random_function = ssl.RAND_bytes
random_provider = "Python SSL"
except (AttributeError, ImportError):
import OpenSSL
random_function = OpenSSL.rand.bytes
random_provider = "OpenSSL"
class DiffieHellman(... | yakovenkodenis/websockets_secure_chat | PythonClient/diffie_hellman/diffie_hellman.py | Python | mit | 2,659 |
# 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... | Mega-DatA-Lab/mxnet | python/mxnet/torch.py | Python | apache-2.0 | 6,722 |
#TESTING PRING AND MAIN
# def main():
# allAudioGenres = ["punk", "poil", "classic"]
# printStuff(allAudioGenres)
# def printStuff(stuff):
# print stuff
# if __name__=="__main__":
# main()
#PICKLING
from six.moves import cPickle as pickle
import subprocess as sp
import scikits.audiolab
import n... | vberthiaume/vblandr | tests/tests.py | Python | apache-2.0 | 2,438 |
# coding: utf-8
"""
Ubuntu Enterprise Cloud
cloud-images query interface
https://help.ubuntu.com/community/UEC/Images
"""
from __future__ import print_function
import urllib3
try:
import boto.ec2
except ImportError:
boto = None
# CI doc paths
CI_ROOT = 'https://cloud-images.ubuntu.com/query'
CI_QUERY_FORMA... | mruser/cloud_images | cloud_images/query.py | Python | mit | 10,693 |
# -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more details.
"""
import json
import time
import urllib
import ... | PegasusWang/WeiPython | wechat/wechatService.py | Python | mit | 4,478 |
import smtplib
import base64
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
from __builtin__ import file
import settings
import os
import datetime
def email_msg(sender, receiver, msg, ... | tobiz/OGN-Flight-Logger_V2 | flogger_email_msg.py | Python | gpl-3.0 | 1,204 |
# -ProblemSet2.py *- coding: utf-8 -*-
"""
Each problem will be a function to write.
Remember that you can execute just the code between the #%% signs by clicking
somewhere in that space and the using Ctrl-Enter (Cmd-Enter on Mac). An
alternative is to use the second toolbar green triangle or Menu>Run>Run c... | johjeff/Python-Wesleyen | Week2/ProblemSet2.py | Python | bsd-2-clause | 11,302 |
#! python3
# download source images from a sight
import requests
import logging
import traceback
# Initialise logging for program activity
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
def fetchitem():
res = requests.get('https://automatetheboringstuf... | Lifebeard/automate | getitem.py | Python | apache-2.0 | 915 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | andrewsomething/libcloud | libcloud/__init__.py | Python | apache-2.0 | 3,621 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | dash-dash/AutobahnPython | examples/asyncio/wamp/rpc/slowsquare/frontend.py | Python | mit | 2,616 |
"""
differential_evolution: The differential evolution global optimization algorithm
Added by Andrew Nelson 2014
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.optimize import OptimizeResult, minimize
from scipy.optimize.optimize import _status_messag... | Eric89GXL/scipy | scipy/optimize/_differentialevolution.py | Python | bsd-3-clause | 43,821 |
# -*-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/secondaires/botanique/element.py | Python | bsd-3-clause | 2,652 |
import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'fda4dc6c'.decode('hex')
P2P_PORT = 12340
ADDRESS_VERSION = 23
RPC_PORT = 12341
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
(yield helper.check_gen... | nzsquirrell/p2pool-myriad | p2pool/bitcoin/networks/auroracoin_skein.py | Python | gpl-3.0 | 1,284 |
# Copyright 2016 Douban 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 writing, soft... | mar29th/ring | ring/tests/test_replier.py | Python | apache-2.0 | 6,615 |
#!/usr/bin/env python2
import CliParsing
import Converting
import Cutting
import shutil
import tempfile
if __name__ == "__main__":
temp_dir = tempfile.mkdtemp(prefix="ocra_tmp")
try:
args = CliParsing.cli_args()
file_list = Converting.pdf_to_tiff(args['f'], temp_dir)
for file_name in f... | fneu/OCRA | ocra.py | Python | gpl-3.0 | 425 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | hadesbox/luigi | test/minicluster.py | Python | apache-2.0 | 2,787 |
import os
import shutil
from django import forms
from django.conf import settings
from django.utils import timezone
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
from django.core.validators import RegexValidator, MinLeng... | rob-hills/Booktype | lib/booktypecontrol/forms.py | Python | agpl-3.0 | 26,927 |
from api.webinterface import Webpage
from api.datas import timeUsage
import os
import json
class Database:
def __init__(self, loadLocs=None):
if loadLocs is None:
self.loadLocs=[]
else:
self.loadLocs=loadLocs
self.pages=[]
# Add a webpage to the database
... | WilliamDann/Researcher | api/database.py | Python | mit | 2,325 |
#!/usr/bin/env python
import unicorn
from unicorn import *
import regress
class MmapSeg(regress.RegressTest):
def test_seg1(self):
u = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
u.mem_map(0x2000, 0x1000)
u.mem_read(0x2000, 1)
for i in range(50):
u = unicorn.... | petmac/unicorn | tests/regress/memmap_segfault.py | Python | gpl-2.0 | 992 |
#!/usr/bin/env python3
# Copyright 2007-2018
# Niko Beerenwinkel,
# Nicholas Eriksson,
# Moritz Gerstung,
# Lukas Geyrhofer,
# Osvaldo Zagordi,
# Kerensa McElroy,
# ETH Zurich
# This file is part of ShoRAH.
# ShoRAH is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | ozagordi/shorah | src/shorah/shorah_snv.py | Python | gpl-3.0 | 22,713 |
#!/usr/bin/env python
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. 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 ... | dablak/boto | tests/unit/route53/test_connection.py | Python | mit | 10,237 |
from __future__ import division
import sys
from pygame import Rect, Surface, image
from pygame.locals import K_RETURN, K_KP_ENTER, K_ESCAPE, K_TAB, KEYDOWN, SRCALPHA
from pygame.mouse import set_cursor
from pygame.cursors import arrow as arrow_cursor
from pygame.transform import rotozoom
from vectors import add, subtra... | Neui/MCEdit-Unified | albow/widget.py | Python | isc | 26,028 |
#!/usr/bin/python3
import datetime, sys, os
homedir = os.getenv("HOME")
sys.path.append(homedir + '/Pigrow/scripts/')
import pigrow_defs
for argu in sys.argv[1:]:
if argu == '-h' or argu == '--help':
print("Pigrow Heater switch")
print("")
print("This turns the Humidifier OFF")
prin... | Pragmatismo/Pigrow | scripts/switches/humid_off.py | Python | gpl-3.0 | 2,621 |
import inspect
import itertools
import time
import typing
import warnings
import dataclasses
import os
from .._misc import helpers, utils, requestiter, hints
from ..types import _custom
from ..types._custom.inputmessage import InputMessage
from .. import errors, _tl
_MAX_CHUNK_SIZE = 100
if typing.TYPE_CHECKING:
... | LonamiWebs/Telethon | telethon/_client/messages.py | Python | mit | 29,185 |
from sys import stdin
def readLine():
return stdin.readline().strip()
def readInt():
return int(readLine())
def readInts():
return list(map(int, readLine().split()))
def main():
T = readInt()
for i in range(T):
pages = [{'url': None, 'v': 0} for j in range(10)]
for j in range(10):
pages[j]['url'], pag... | mikebsg01/Contests-Online | UVa/12015-GoogleisFeelingLucky.py | Python | mit | 604 |
import t3
def run():
t3.add(8) | paopao74cn/noworkflow | tests/t2.py | Python | mit | 35 |
print "I will now count my chickens:"
print "Hens", 25.0 + 30.0 / 6.0
print "Roosters", 100.0 - 25.0 * 3.0 % 4.0
print "Now I will count the eggs:"
print 3 + 2 + 1 - 5 + 4.0 % 2.0 - 1.0 / 4.0 + 6
print "Is it true that 3 + 2 < 5 - 7?"
print 3 + 2 < 5 - 7
print "What is 3 + 2?", 3 + 2
print "What is 5 - 7?", 5 - 7... | darthbinamira/learn_python | lpthw/03/ex3.py | Python | bsd-2-clause | 588 |
import os
import sys
from binascii import unhexlify as xeh
from vstruct2.types import *
from dissect.filelab import *
#HEAD_TYPE_MARKER = 0x72 #marker block
#HEAD_TYPE_ARCHIVE = 0x73 #archive header
#HEAD_TYPE_FILE_HDR = 0x74 #file header
#HEAD_TYPE_OLD_COMMENT = 0x75 ... | vivisect/dissect | dissect/formats/rar.py | Python | apache-2.0 | 14,800 |
from rest_framework.permissions import BasePermission, SAFE_METHODS
from mkt.access import acl
class AllowExtensionReviewerReadOnly(BasePermission):
def has_permission(self, request, view):
return request.method in SAFE_METHODS and acl.action_allowed(
request, 'ContentTools', 'AddonReview')
... | ingenioustechie/zamboni | mkt/extensions/permissions.py | Python | bsd-3-clause | 1,149 |
#!/usr/bin/python
b = []
a = open('C:/Python27/Myscripts/project/islandinput.txt', 'r')
def main():
for each_item in a:
b.append(each_item)
print(each_item)
print(b)
main()
| sketchyfish/ypp-price-calculator | commodity_automation.py | Python | gpl-2.0 | 200 |
__author__ = "Ian Goodfellow"
from matplotlib import pyplot
import sys
pyplot.hold(True)
from pylearn2.utils import serial
model_paths = sys.argv[1:]
smoothing = 1
try:
smoothing = int(model_paths[0])
model_paths = model_paths[1:]
except Exception:
pass
count = 0
style = '-'
for model_path in model_pat... | kastnerkyle/pylearn2 | pylearn2/sandbox/lisa_rl/bandit/plot_reward.py | Python | bsd-3-clause | 712 |
#!/usr/bin/env python
"""
Script that facilitates the modification of a element through the command line.
However, the usage of this script will set the element token to the command
issuer with a duration of 1 day.
"""
__RCSID__ = '$Id$'
from datetime import datetime, timedelta
from DIRAC import gLogger, exit as DIR... | fstagni/DIRAC | ResourceStatusSystem/scripts/dirac-rss-set-status.py | Python | gpl-3.0 | 8,092 |
# Copyright 2017 Nokia
#
# 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... | naveensan1/nuage-openstack-neutron | nuage_neutron/lbaas/agent/nuage_interface.py | Python | apache-2.0 | 8,740 |
# Copyright (c) 2011-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
#
# Un... | ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/filters.py | Python | gpl-2.0 | 3,273 |
# Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from __future__ import print_function
import sys, os, imp
from os.path import join as jp
here = os.path.abspath(os.path.dirname(__file__))
extra_sys_path = [os.path.normpath(path) ... | lechat/jenkinsflow | test/demos_test.py | Python | bsd-3-clause | 2,590 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Scikit learn wrapper for gensim.
Contains various gensim based implementations which match with scikit-learn standards.
See [1] for co... | duyet-website/api.duyet.net | lib/gensim/sklearn_integration/__init__.py | Python | mit | 398 |
# -*- coding: utf-8 -*-
"""
wakatime.projects.git
~~~~~~~~~~~~~~~~~~~~~
Information about the git project for a given file.
:copyright: (c) 2013 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import logging
import os
import sys
from .base import BaseProject
from ..compat import u... | fvcproductions/dotfiles | bin/sketch/Plugins/WakaTime.sketchplugin/Contents/Resources/wakatime/projects/git.py | Python | mit | 2,187 |
"""
Implementation of the paper,
Durand and Dorsey SIGGGRAPH 2002,
"Fast Bilateral Fitering for the display of high-dynamic range images"
"""
import numpy as np
import hydra.io
import hydra.filters
def bilateral_separation(img, sigma_s=0.02, sigma_r=0.4):
r, c = img.shape
sigma_s = max(r, c) * sigma_s
... | tatsy/hydra | hydra/tonemap/durand.py | Python | mit | 1,367 |
# -*- coding: utf-8 -*-
'''
Created on 11/04/2014
@author: cgaray
@contact: cdaniel.py@gmail.com
@summary: Clase para generacion de criterios de Restriccion de resultados
'''
#importamos los modulos y clases necesarias
import datetime
class Restriccion(object):
'''
Clase para generacion de c... | cdanielpy/MoziAPI | MoziAPI/moziapi/restricciones/restriccion.py | Python | gpl-2.0 | 17,560 |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from rest_framework import routers, serializers, viewsets
from r_banana_republic.views import BananaRepublicViewSet
router = routers.DefaultRouter()
router.register(r'banana_republic_items', GapViewSet)
urlpatterns = patterns('',
url(r'^',... | dplin/woola | woola/r_banana_republic/urls.py | Python | bsd-3-clause | 350 |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003-2004 The GemRB Project
#
# 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 opt... | flaing/gemrb | gemrb/GUIScripts/bg1/GUICG7.py | Python | gpl-2.0 | 2,040 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Laon-CRF
: Easy-to-use Linear Chain Conditional Random Fields
Author: Seong-Jin Kim
License: MIT License
Version: 0.0
Email: lancifollia@gmail.com
Created: May 13, 2015
Copyright (c) 2015 Seong-Jin Kim
"""
from read_corpus import read_conll_corpus
from feature ... | lancifollia/laon_crf | crf.py | Python | mit | 14,434 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import plottool_ibeis as pt
import utool as ut
import numpy as np
from ibeis.other import ibsfuncs
from ibeis.viz import viz_helpers as vh
from ibeis.viz import viz_chip
from ibeis.viz import viz_matches # NOQA
(... | Erotemic/ibeis | ibeis/viz/viz_qres.py | Python | apache-2.0 | 18,906 |
"""Tests for distributed model"""
from copy import copy
from absl.testing import absltest
import torch
from torch import nn
from dlrm import model
from dlrm import dist_model
# pylint:disable=missing-docstring, no-self-use
_DUMMY_BOTTOM_CONFIG = {
"num_numerical_features" : 13,
"categorical_feature_sizes" :... | mlperf/training_results_v0.7 | Inspur/benchmarks/dlrm/implementations/implementation_closed/tests/dist_model_test.py | Python | apache-2.0 | 3,328 |
'''
test_unit_k4atypes.py
Tests for the k4a types and enums.
Copyright (C) Microsoft Corporation. All rights reserved.
'''
import unittest
import ctypes
import k4a
def get_enum_values(n, start_value = 0):
value = start_value
while(value < n):
yield value
value = value + 1
class TestE... | microsoft/Azure-Kinect-Sensor-SDK | src/python/k4a/tests/test_unit_k4atypes.py | Python | mit | 11,324 |
#!/usr/bin/env python
#
# Copyright 2010 Google 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 o... | ciju/perf-hier | fork_join_queue.py | Python | bsd-2-clause | 19,586 |
#!/usr/bin/python
# coding: utf-8
# Copyright (C) 2010 Lucas Alvares Gomes <lucasagomes@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | umago/kabukiman | modules/GoogleTranslate/__init__.py | Python | gpl-2.0 | 4,180 |
try:
import __builtin__
except:
import builtins
try:
import gdb
except:
pass
import os
import os.path
import sys
import struct
import types
def warn(message):
print("XXX: %s\n" % message.encode("latin1"))
from dumper import *
####################################################################... | xianian/qt-creator | share/qtcreator/debugger/gdbbridge.py | Python | lgpl-2.1 | 64,687 |
from ctypes import windll
from accessible_output import paths
from main import OutputError, BrailleOutput
class NVDA (BrailleOutput):
"""Brailler which supports The NVDA screen reader"""
name = 'NVDA'
def __init__(self, *args, **kwargs):
try:
self.dll = windll.LoadLibrary(paths.root('lib\\nvdaControllerCli... | Timtam/cards-against-humanity | accessible_output/braille/outputs/nvda.py | Python | mit | 595 |
# coding: utf-8
import suds
from functools import wraps
from exceptions import RsApiError
def expect_zero_status(func):
"""
Декоратор, проверяющий результат вызова функций RS API, возвращающих статус в поле `RESULT.STATUS`.
Если поле объекта `RESULT.STATUS` не найдено или `RESULT.STATUS != 0`, бросает иск... | RealJTG/rsge | rsge/helpers.py | Python | gpl-3.0 | 2,845 |
import json
from django.test import TestCase
from gn_django.models import LazyAttributes, LazyAttributesMixin
class MockAttributesParent(LazyAttributesMixin):
attributes = {
'a': 'aa',
'b': 'bb',
'c': 'cc',
'd': 'dd',
}
parent = MockAttributesParent()
class MockAttributesChild... | gamernetwork/gn-django | tests/gn_django_tests/test_lazy_attributes.py | Python | mit | 2,441 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from os.path import abspath, dirname, join
PROJECT_ROOT = abspath(join(dirname(__file__), '..'))
| smarkets/hal | hal/__init__.py | Python | mit | 180 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bancos.py
#
# Copyright 2010 Jesús Hómez <jesus@jesus-laptop>
#
# 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; ei... | jehomez/pymeadmin | libro_compras.py | Python | gpl-2.0 | 3,092 |
# coding: utf-8
"""
This command polls all of the Feeds and inserts any new entries found.
"""
import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.db import transaction
from opps.feedcrawler.models import Feed
logger = logging.getLogger()
class Command(B... | jeanmask/opps-feedcrawler | opps/feedcrawler/management/commands/process_feeds.py | Python | mit | 2,349 |
"""
Module contains tools for processing Stata files into DataFrames
The StataReader below was originally written by Joe Presbrey as part of PyDTA.
It has been extended and improved by Skipper Seabold from the Statsmodels
project who also developed the StataWriter and was finally added to pandas in
a once again improv... | kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/io/stata.py | Python | apache-2.0 | 108,362 |
# 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... | yahman72/robotframework | src/robot/model/stats.py | Python | apache-2.0 | 6,017 |
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the L... | Forage/Gramps | gramps/webapp/grampsdb/view/tag.py | Python | gpl-2.0 | 3,331 |
"""
Unit tests for the stem.util.connection functions.
"""
import unittest
import stem.util.connection
class TestConnection(unittest.TestCase):
def test_is_valid_ipv4_address(self):
"""
Checks the is_valid_ipv4_address function.
"""
valid_addresses = (
"0.0.0.0",
"1.2.3.4",
"192... | saturn597/stem | test/unit/util/connection.py | Python | lgpl-3.0 | 5,202 |
# -*- coding: utf-8 -*-
import unittest
import pygeoip
from tests.config import ORG_DB_PATH
class TestGeoIPOrgFunctions(unittest.TestCase):
def setUp(self):
self.us_org = 'APPLE COMPUTER'
self.us_ip = '17.172.224.47'
self.us_hostname = 'apple.com'
self.gb_org = 'BBC'
self... | orbitvu/pygeoip | tests/test_org.py | Python | lgpl-3.0 | 887 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for i in orm['item.Item'].objects.exclude(notes=''):
i.data['notes'] = i.data.get('notes', '') + i.notes
... | maysara/pandora_image | pandora/item/migrations/0003_notes.py | Python | gpl-3.0 | 14,253 |
"""
TornadoServer create a web server and load services.
It may work better with TornadoClient but as it accepts HTTPS you can create your own client
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
import time
import datetime
import ... | ic-hep/DIRAC | src/DIRAC/Core/Tornado/Server/TornadoServer.py | Python | gpl-3.0 | 11,361 |
# -*- coding: utf-8 -*-
#
# Freeseer documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 4 18:21:52 2011.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to sho... | Freeseer/freeseer | docs/source/conf.py | Python | gpl-3.0 | 7,249 |
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | simonwydooghe/ansible | test/units/modules/network/fortios/test_fortios_firewall_schedule_recurring.py | Python | gpl-3.0 | 8,825 |
import yaml
import pprint
# Tokens mnemonic:
# directive: %
# document_start: ---
# document_end: ...
# alias: *
# anchor: &
# tag: !
# scalar _
# block_sequence_start: [[
# block_mapping_start: {{
# block_end: ]}
# flow... | wholeGenomeSequencingAnalysisPipeline/BacPipe | yaml/PyYAML-3.12/tests/lib3/test_tokens.py | Python | gpl-3.0 | 2,257 |
# coding=utf-8
from collections import OrderedDict
expected = OrderedDict(
[
("doi", u"10.7554/eLife.00001.001"),
(
"content",
[
OrderedDict(
[
("type", "paragraph"),
(
... | elifesciences/elife-tools | tests/fixtures/test_abstract_json/content_03_expected.py | Python | mit | 938 |
import logging, sys, os
from datetime import datetime
from django.test import TestCase
from django.core.files import File
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.auth.models import User, Group
from routes.models import Route
from ..models import Waypoint, WaypointMedia
logging.basicConfig... | bjohare/comap | waypoints/tests/test_models.py | Python | gpl-3.0 | 3,531 |
"""
This module contains Helper constructs
This module is a part of the program Kupfer, see the main program file for
more information.
"""
from gi.repository import Gio, GLib
from kupfer import pretty
class PicklingHelperMixin (object):
""" This pickling helper will define __getstate__/__setstate__
acting ... | engla/kupfer | kupfer/obj/helplib.py | Python | gpl-3.0 | 4,685 |
import json
import sys
import struct
from autobahn.twisted.websocket import WebSocketServerProtocol
from twisted.python import log
from twisted.internet import reactor
log.startLogging(sys.stdout)
class WSVoiceProtocol(WebSocketServerProtocol):
def onConnect(self, request):
super(WSVoiceProtocol, self).... | NLilley/HTML5-Voice | server/server/WSVoiceProtocol.py | Python | mit | 3,282 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2020-03-11 15:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('useradmin', '0003_auto_20200203_0802'),
]
operations = [
migrations.AddFie... | kawamon/hue | apps/useradmin/src/useradmin/migrations/0004_userprofile_hostname.py | Python | apache-2.0 | 471 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import profile_creator
import logging
import page_sets
from telemetry import benchmark
from telemetry.page import page_test
from teleme... | sgraham/nope | tools/perf/profile_creators/small_profile_creator.py | Python | bsd-3-clause | 2,596 |
import numbers
import numpy as np
from time import sleep
import progressbar
from .mesh import Mesh
from .wrapper import Uniform
from .utils import DEFAULT_SETTINGS
ds = DEFAULT_SETTINGS['boundary']
class Boundary:
'''
'''
def __init__(self, mesh=Mesh(), bcType=[ds[0], ds[1], ds[2]],
g1=[d... | frRoy/Heat | heat/boundary.py | Python | bsd-2-clause | 11,947 |
"""Tests for the AdGuard Home config flow."""
import aiohttp
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.adguard import config_flow
from homeassistant.components.adguard.const import DOMAIN
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
... | tboyce021/home-assistant | tests/components/adguard/test_config_flow.py | Python | apache-2.0 | 8,304 |
# Copyright 2013 Red Hat, 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... | redhat-openstack/glance | glance/tests/unit/common/test_client.py | Python | apache-2.0 | 2,956 |
#########################################################################################
# LSF.py
# 10.11.2014
# Author: A.T.
#########################################################################################
""" LSF.py is a DIRAC independent class representing LSF batch system.
LSF objects are used as bac... | ic-hep/DIRAC | src/DIRAC/Resources/Computing/BatchSystems/LSF.py | Python | gpl-3.0 | 7,238 |
# Copyright 2019 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/ml-metadata | ml_metadata/version.py | Python | apache-2.0 | 693 |
##############################################################################
#
# PROJECT: ownCloud v1.0
# LICENSE: See LICENSE in the top level directory
#
##############################################################################
import collections
import os
import polib
from optparse import OptionPars... | servergy/cyphre-client | admin/win/nsi/l10n/bin/build_locale_nsi.py | Python | gpl-2.0 | 6,085 |
# This file is part of Sibyl.
# Copyright 2014 Camille MOUGEY <camille.mougey@cea.fr>
#
# Sibyl 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 ... | cea-sec/Sibyl | sibyl/abi/arm.py | Python | gpl-3.0 | 1,021 |
# passenger_wsgi.py
from app import MyApp as application | sergeimoiseev/othodi | passenger_wsgi.py | Python | mit | 56 |
# Copyright 2017 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 a... | google/cauliflowervest | cauliflowervest/server/cron/inventory_sync.py | Python | apache-2.0 | 2,728 |
# -*- coding: utf-8 -*-
"""Miscellaneous helper functions (not wiki-dependent)."""
#
# (C) Pywikibot team, 2008-2020
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import collections
from distutils.version import LooseVersion
import gzip
import ... | PersianWikipedia/pywikibot-core | pywikibot/tools/__init__.py | Python | mit | 85,999 |
#!/usr/bin/python
# Version 0.1
# Python script for creation of referential from 4 different sources
#Create a timestamp format to make filenames later
import datetime
import pandas as pd
import glob
import os
temps = ('{:%Y-%m-%d-%H-%M-%S}'.format(datetime.datetime.now()))
os.system('clear')
print ("Bonjour, avez ... | ursus69/millenium-parrot | menu.py | Python | gpl-3.0 | 3,021 |
import _plotly_utils.basevalidators
class AutocolorscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="autocolorscale", parent_name="heatmapgl", **kwargs):
super(AutocolorscaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | plotly/plotly.py | packages/python/plotly/plotly/validators/heatmapgl/_autocolorscale.py | Python | mit | 479 |
#!/usr/bin/env python
# Conditional Generative Adversarial Networks (GAN) example with 2D samples in PyTorch.
import os
import numpy
from skimage import io
import torch
import torch.nn as nn
from torch.autograd import Variable
from sampler import generate_lut, sample_2d
from visualizer import CGANDemoVisualizer
from ar... | frombeijingwithlove/dlcv_for_beginners | random_bonus/gan_n_cgan_2d_example/cgan_demo.py | Python | bsd-3-clause | 5,781 |
"""User-friendly public interface to polynomial functions. """
from __future__ import print_function, division
from sympy.core import (
S, Basic, Expr, I, Integer, Add, Mul, Dummy, Tuple
)
from sympy.core.mul import _keep_coeff
from sympy.core.symbol import Symbol
from sympy.core.basic import preorder_traversal
... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/polys/polytools.py | Python | mit | 171,109 |
from pathlib import Path
import numpy as np
from pytest import fixture
from functools import partial
from beyond.orbits.cov import Cov
from beyond.orbits.man import ImpulsiveMan, ContinuousMan
from beyond.io.tle import Tle
from beyond.dates import Date, timedelta
from beyond.propagators.keplernum import KeplerNum
fro... | galactics/beyond | tests/io/ccsds/conftest.py | Python | mit | 4,239 |
from __future__ import absolute_import
import tahrir_api.model as m
import hashlib
import os
import shutil
import tempfile
from datetime import (
datetime,
timedelta,
)
import logging
log = logging.getLogger(__name__)
def scale_to_standard_size(filename):
try:
import magickwand.image as magick
... | fedora-infra/tahrir | tahrir/widgets.py | Python | agpl-3.0 | 800 |
# -*- coding: utf-8 -*-
#
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2016 Clear ICT Solutions (<info@clearict.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | Clear-ICT/odoo-addons | content_cleanup_stock_landed_costs/__init__.py | Python | agpl-3.0 | 881 |
# Copyright 2016 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.
"""A collection of ResourceGraphs.
Processes multiple ResourceGraphs, all presumably from requests to the same
site. Common urls are collected in Bags and d... | ds-hwang/chromium-crosswalk | tools/android/loading/resource_sack.py | Python | bsd-3-clause | 5,398 |
# -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | prarthitm/edxplatform | cms/envs/common.py | Python | agpl-3.0 | 39,560 |
"""task_list URL Configuration"""
from django.conf.urls import url
from django.contrib import admin
from task_list.views import tasks_main, task_list, task_status, task_edit
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', tasks_main, name='tasks'),
url(r'^task-list/', task_list, name='task-l... | moonsly/simple_task_manager | task_list/task_list/urls.py | Python | gpl-3.0 | 443 |
# 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... | HaebinShin/tensorflow | tensorflow/python/kernel_tests/matrix_solve_op_test.py | Python | apache-2.0 | 3,969 |
#!/usr/bin/env python
import os, util
util.chdir()
ports = util.get_ports()
if not os.path.exists('rethinkdb_data'):
util.cmd('rethinkdb create -d "rethinkdb_data"')
util.cmd('rethinkdb serve --cluster-port {cluster_port} --driver-port {driver_port} --no-http-admin'.format(
driver_port=ports['rethinkdb'... | haraldschilly/smc | src/dev/project/start_rethinkdb.py | Python | gpl-3.0 | 365 |
from __future__ import print_function, division
from sympy.core.function import Function, C
from sympy.core import S, Integer
from sympy.core.mul import prod
from sympy.utilities.iterables import (has_dups, default_sort_key)
from sympy.core.compatibility import xrange
#################################################... | hrashk/sympy | sympy/functions/special/tensor_functions.py | Python | bsd-3-clause | 11,981 |
# 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 list of conditions and the ... | youtube/cobalt | third_party/blink/Tools/Scripts/webkitpy/common/system/platform_info.py | Python | bsd-3-clause | 7,999 |
# -*- coding:utf-8 -*-
# app/models.py
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from app import db, login_manager
"""
# an account has many group
# a group has many account
an account has many todo-list
a todolist has many todo-items
a Role has m... | sharkspeed/dororis | packages/python/flask/todolist/app/models.py | Python | bsd-2-clause | 4,038 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.