code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-10-26 01:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial')... | ricardogtx/estudoDjango | simplemooc/accounts/migrations/0002_passwordreset.py | Python | gpl-3.0 | 1,198 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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... | noironetworks/neutron | neutron/plugins/ml2/drivers/agent/capabilities.py | Python | apache-2.0 | 1,161 |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | kjagoo/wger_stark | wger/nutrition/views/unit_ingredient.py | Python | agpl-3.0 | 4,765 |
#!/usr/bin/env python
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | GorK-ChO/selenium | py/setup.py | Python | apache-2.0 | 3,684 |
"""Tests for nexus reading manipulation"""
import os
import re
import unittest
from nexus import NexusReader
from nexus.reader import GenericHandler, DataHandler, TreeHandler
EXAMPLE_DIR = os.path.join(os.path.dirname(__file__), '../examples')
class Test_Manipulation_Data(unittest.TestCase):
"""Test the manipulat... | zhangjiajie/PTP | nexus/test/test_reader_manipulation.py | Python | gpl-3.0 | 2,555 |
#/*
# This file is part of ddprint - a 3D printer firmware.
#
# Copyright 2015 erwin.rieger@ibrieger.de
#
# ddprint 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 y... | ErwinRieger/ddprint | host/ddprofile.py | Python | gpl-2.0 | 12,336 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Tests elements of the cartography module.
"""
# import iris tests first so that some things can be initialised before imp... | SciTools/iris | lib/iris/tests/test_cartography.py | Python | lgpl-3.0 | 1,999 |
"""HTTP views to interact with the device registry."""
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.components.websocket_api.decorators import (
async_response,
require_admin,
)
from homeassistant.core import callback
from homeassistant.helpers.device_registry ... | sdague/home-assistant | homeassistant/components/config/device_registry.py | Python | apache-2.0 | 2,447 |
# Copyright (c) 2016, the Cap authors.
#
# This file is subject to the Modified BSD License and may not be distributed
# without copyright and license information. Please refer to the file LICENSE
# for the text and further information on this license.
from pycap import PropertyTree, EnergyStorageDevice, TimeEvolution... | dalg24/Cap | python/test/test_time_evolution.py | Python | bsd-3-clause | 2,928 |
from django.conf.urls.defaults import *
urlpatterns = patterns('autoadmin.views',
(r'^$','index'),
(r'server_fun_categ/$','server_fun_categ'),
(r'server_app_categ/$','server_app_categ'),
(r'server_list/$','server_list'),
(r'module_list/$','module_list'),
(r'module_info/$','module_info'),
(r... | zhengjue/mytornado | omserver/OMserverweb/autoadmin/urls.py | Python | gpl-3.0 | 434 |
__all__ = ['create_subprocess_exec', 'create_subprocess_shell']
import collections
import subprocess
from . import events
from . import futures
from . import protocols
from . import streams
from . import tasks
from .coroutines import coroutine
from .log import logger
PIPE = subprocess.PIPE
STDOUT = subprocess.STDOU... | ruibarreira/linuxtrail | usr/lib/python3.4/asyncio/subprocess.py | Python | gpl-3.0 | 7,702 |
from nose.tools import *
import stacktrain.storage_tasks as storage_tasks
import os
path = os.getcwd()
storage = storage_tasks.Storage(path, 'test.qcow2')
def test_create_disk():
assert storage.create_disk()
def test_list_disk():
assert (len(storage.list_disk()) > 0)
def test_destroy_disk():
assert ... | sayalilunkad/libvirtPOC | stacktrain/tests/test_storage_tasks.py | Python | apache-2.0 | 343 |
from django.contrib.auth.models import BaseUserManager
class LifeUserManager(BaseUserManager):
def create_user(self, email, password=None):
if not email:
raise ValueError('Users must have an email address')
user = self.model(
email=self.normalize_email(email),
)
... | BoraDowon/Life3.0 | life3/dashboard/managers.py | Python | mit | 635 |
import jieba
import sys
if __name__ == '__main__':
jieba.set_dictionary('jieba/extra_dict/dict.txt.big')
for l in sys.stdin:
words = jieba.cut(l.strip())
sys.stdout.write((u' '.join(words) + u'\n').encode('utf8'))
| shaform/experiments | word2vec_tw/cut.py | Python | mit | 239 |
import logging
from zeroless import (Server, log)
# Setup console logging
consoleHandler = logging.StreamHandler()
log.setLevel(logging.DEBUG)
log.addHandler(consoleHandler)
# Binds the reply server to port 12345
# And assigns a callable and an iterable
# To both transmit and wait for incoming messages
reply, listen... | x8lucas8x/python-zeroless | examples/reqRepServer.py | Python | lgpl-2.1 | 424 |
# Global Forest Watch API
# Copyright (C) 2013 World Resource Institute
#
# 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... | wri/gfw-api | gfw/v2/migrations/handlers.py | Python | gpl-2.0 | 1,961 |
#!/usr/bin/env python3
'''ioriodb CLI client to interact with the api from the command line'''
from __future__ import print_function
import time
import json
import argparse
import iorio
def get_arg_parser():
'''build the cli arg parser'''
parser = argparse.ArgumentParser(description='Iorio DB CLI')
parser... | javierdallamore/ioriodb | tools/ioriocli.py | Python | mpl-2.0 | 8,730 |
"""
:class:`DominatorTree` computes the dominance relation over
control flow graphs.
See http://www.cs.rice.edu/~keith/EMBED/dom.pdf.
"""
class GenericDominatorTree:
def __init__(self):
self._assign_names()
self._compute()
def _traverse_in_postorder(self):
raise NotImplementedError
... | JQIamo/artiq | artiq/compiler/analyses/domination.py | Python | lgpl-3.0 | 4,947 |
from __future__ import division
import numpy as np
import tensorflow as tf
from cost_functions.huber_loss import huber_loss
from data_providers.data_provider_32_price_history_autoencoder import PriceHistoryAutoEncDataProvider
from interfaces.neural_net_model_interface import NeuralNetModelInterface
from mylibs.batch_n... | pligor/predicting-future-product-prices | 04_time_series_prediction/models/model_32_price_history_autoencoder.py | Python | agpl-3.0 | 22,093 |
#-*- coding:utf-8 -*-
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^', include('blog.urls')),
# Examples:
... | elover/python-django-blog | myblog/myblog/urls.py | Python | mit | 847 |
import glob
import importlib
import settings
import os
import sys
def import_all(name, object_name):
modules = glob.glob(os.path.join(settings.BASE_DIR, name) + "/*.py")
all_objects = []
for module in modules:
module_name = os.path.basename(module)[:-3]
if module_name == "__init__":
... | ovkulkarni/hangoutsbot | utils/imports.py | Python | mit | 522 |
# -*- coding: utf-8 -*-
import time
def log(func):
def wrapper(*args, **kw):
print('call %s():' % func.__name__)
return func(*args, **kw)
return wrapper
def exe_time(func):
def wrapper(*args, **args2):
t0 = time.time()
print("@%s, {%s} start" % (time.strftime("%X", time.... | jtr109/Alpha2kindle | utils/timer.py | Python | mit | 692 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2013 Yahoo! 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/LICE... | openstack/oslo.utils | oslo_utils/reflection.py | Python | apache-2.0 | 8,707 |
from .common import *
ENVIRONMENT = 'development'
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS += (
'debug_toolbar',
)
MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
from fnmatch import fnmatch
class glob_list(list):
def __contains__(self, key):
for elt in s... | gunnery/gunnery | gunnery/gunnery/settings/development.py | Python | apache-2.0 | 549 |
# Use Netmiko to enter into configuration mode on pynet-rtr2.
# Also use Netmiko to verify your state (i.e. that you are currently in configuration mode).
from getpass import getpass
import time
from netmiko import ConnectHandler
password = getpass()
pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'use... | linkdebian/pynet_course | class4/exercise5.py | Python | apache-2.0 | 563 |
# (C) British Crown Copyright 2010 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | jswanljung/iris | lib/iris/analysis/_interpolate_backdoor.py | Python | lgpl-3.0 | 5,248 |
##===-- statuswin.py -----------------------------------------*- Python -*-===##
##
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
##
##===------------------------------... | apple/swift-lldb | utils/lui/statuswin.py | Python | apache-2.0 | 1,419 |
#!/usr/bin/env python
#
# Copyright (C) 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 ... | MapofLife/MOL | earthengine/google-api-python-client/samples/gtaskqueue_sample/gtaskqueue/taskqueue_cmd_base.py | Python | bsd-3-clause | 10,637 |
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
import os
import os.path
import urlparse
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
script_file = os.path.realpath(__file__)
directory = os.path.dirname(script_file)
# miramos si hay alguna accion
args = urlpar... | bite-your-idols/Gamestarter-Pi | repository.gamestarter/game.emulationstation/addon.py | Python | gpl-2.0 | 14,760 |
#!/usr/bin/env python
'''Simple viewer for DDS texture files.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from ctypes import *
import getopt
import sys
import textwrap
from SDL import *
from pyglet.gl.VERSION_1_1 import *
import pyglet.dds
import pyglet.event
import pyglet.image
import pyglet.sprit... | shaileshgoogler/pyglet | tools/ddsview.py | Python | bsd-3-clause | 4,680 |
'''
Created by auto_sdk on 2015.09.16
'''
from top.api.base import RestApi
class WlbWmsStockOutOrderNotifyRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.car_no = None
self.carriers_name = None
self.extend_fields = None
self.order_co... | colaftc/webtool | top/api/rest/WlbWmsStockOutOrderNotifyRequest.py | Python | mit | 794 |
'''
Author Alumet 2015
https://github.com/Alumet/Codingame
'''
n = int(input()) # Number of elements which make up the association table.
q = int(input()) # Number Q of file names to be analyzed.
Link_table = {None : 'UNKNOWN'}
# Fill the dic
for i in range(n):
ext, mt = input().split()
Link_table[ext.... | Alumet/Codingame | Easy/MIME_Type.py | Python | mit | 533 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import luigi
import luigi.contrib.external_program
import sqlite3
import pickle
import os
import numpy as np
import pandas as pd
import uncertainties as u
from contrib import afterpulse, darknoise, crosstalk
def is_none(param):
"""
Checks if param is None or "None"... | ntim/g4sipm | sample/run/luigi/darknoise_simulation_new.py | Python | gpl-3.0 | 14,785 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/site_seal_request.py | Python | mit | 1,117 |
"""
git-flow - Manage version branches and tags
Usage:
git-flow status
[--root=DIR] [--config=FILE] [-B|--batch] [-v|--verbose] [-p|--pretty]
[(-a|--all) | <object>]
git-flow (bump-major|bump-minor)
[--root=DIR] [--config=FILE] [-B|--batch] [-v|--verbose] [-p|--pretty]
[-d|--dry-run] ... | abacusresearch/gitflow | gitflow/__main__.py | Python | mit | 10,798 |
from ionotomo import *
import numpy as np
import pylab as plt
def test_turbulent_realisation(plot=True):
xvec = np.linspace(-100,100,100)
zvec = np.linspace(0,1000,1000)
M = np.zeros([100,100,1000])
TCI = TriCubic(xvec,xvec,zvec,M)
print("Matern 1/2 kernel")
cov_obj = Covariance(tci=TCI)
si... | Joshuaalbert/IonoTomo | src/ionotomo/tests/test_turbulent_realisation.py | Python | apache-2.0 | 5,260 |
from itertools import combinations
def stringy(stringtoget, strings):
stringtoget=sorted(stringtoget)
strlen = len(stringtoget)
strlens = len(strings)
for i in xrange(strlens):
for perm in combinations(strings, i):
perm="".join(perm)
if len(perm) == strlen:
... | jamtot/HackerEarth | Problems/The String Monster/monster.py | Python | mit | 690 |
"""This example samples from a simple bivariate normal distribution."""
import jass.mcmc as mcmc
import jass.samplers as samplers
import numpy as np
import scipy.stats as stats
import triangle
import matplotlib.pyplot as pl
# Define the log-likelihood function to be a bivariate normal
normal_rv = stats.multivariate_n... | ebnn/jass | examples/normal.py | Python | mit | 563 |
#!/usr/bin/env python
#
# 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 writin... | matteobertozzi/RaleighSL | build.py | Python | apache-2.0 | 27,503 |
# swift_build_support/products/llvm.py --------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | JGiola/swift | utils/swift_build_support/swift_build_support/products/llvm.py | Python | apache-2.0 | 2,666 |
####################################################################################################
#
# Musica - A Music Theory Package for Python
# Copyright (C) 2017 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | FabriceSalvaire/Musica | Musica/Audio/AudioFormat.py | Python | gpl-3.0 | 5,905 |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
start_time = demisto.args()['start_time'].replace('"', '')
end_time = demisto.args()['end_time'].replace('"', '')
try:
# Strip microseconds and convert to datetime object
start_time_obj = datetime.strptime(star... | VirusTotal/content | Packs/CommonScripts/Scripts/CalculateTimeDifference/CalculateTimeDifference.py | Python | mit | 938 |
#! /usr/bin/env python3
# Convert GNU texinfo files into HTML, one file per node.
# Based on Texinfo 2.14.
# Usage: texi2html [-d] [-d] [-c] inputfile outputdirectory
# The input file must be a complete texinfo file, e.g. emacs.texi.
# This creates many files (one per info node) in the output directory,
# overwriting ... | technologiescollege/Blockly-rduino-communication | scripts_XP/Tools/Scripts/texi2html.py | Python | gpl-3.0 | 70,169 |
# original work: https://github.com/graphite-project/whisper/issues/22
# whisper-fill: unlike whisper-merge, don't overwrite data that's
# already present in the target file, but instead, only add the missing
# data (e.g. where the gaps in the target file are). Because no values
# are overwritten, no data or precisio... | unbrice/carbonate | carbonate/fill.py | Python | mit | 4,207 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | marmyshev/transitions | openlp/plugins/songs/lib/ui.py | Python | gpl-2.0 | 3,142 |
"""This module contains a series of unit tests which
validate lib/mac.py"""
import logging
import unittest
import string
import time
import uuid
import hashlib
import base64
import json
import os
import mock
import requests
from yar.util import mac
class HexifyTestCase(unittest.TestCase):
def test_bytes_is_no... | simonsdave/yar | yar/util/tests/mac_unit_tests.py | Python | mit | 15,971 |
from StringIO import StringIO
import subprocess
from pyethapp.app import app
from click.testing import CliRunner
from ethereum.block import BlockHeader
import rlp
import pytest
@pytest.mark.xfail # can not work without mock-up chain
def test_export():
# requires a chain with at least 5 blocks
assert subproce... | gsalgado/pyethapp | pyethapp/tests/test_export.py | Python | mit | 1,032 |
#!/usr/bin/python -tt
# An incredibly simple agent. All we do is find the closest enemy tank, drive
# towards it, and shoot. Note that if friendly fire is allowed, you will very
# often kill your own tanks with this code.
#################################################################
# NOTE TO STUDENTS
# This is... | bweaver2/bzrFlag | bzagents/agent0.py | Python | gpl-3.0 | 3,861 |
# Copyright (c) 2012 Citrix Systems, 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 ... | ewindisch/nova | nova/tests/api/openstack/compute/contrib/test_aggregates.py | Python | apache-2.0 | 20,787 |
import logging
from test.parser.pattern.test_matching.base import PatternMatcherBaseClass
class PatternMatcherBasicTests(PatternMatcherBaseClass):
def test_single_word_match(self):
self.add_pattern_to_graph(pattern="A", topic="X", that="Y", template="1")
self.dump_graph()
context = self.... | Thielak/program-y | src/test/parser/pattern/test_matching/test_basics.py | Python | mit | 781 |
# 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.
import logging
import os
from telemetry import decorators
from telemetry.core import exceptions
from telemetry.core import forwarders
from telemetry.core i... | anirudhSK/chromium | tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py | Python | bsd-3-clause | 16,477 |
#
# An example that presents CAPTCHA tests in a web environment
# and gives the user a chance to solve them.
#
# This example is for use with Apache using mod_python and its
# Publisher handler. For example, if your apache configuration
# included something like:
#
# AddHandler python-program .py
# PythonHandler mo... | lerouxb/seymour | thirdparty/pycaptcha/modpython_example.py | Python | mit | 2,728 |
import itertools
import os
import logging
from gettext import gettext as _
from pulp.plugins.util.misc import mkdir
from pulp.plugins.util.publish_step import PluginStep, AtomicDirectoryPublishStep
from pulp.server.exceptions import PulpCodedException
from pulp.server.controllers.repository import get_unit_model_quer... | pcreech/pulp_ostree | plugins/pulp_ostree/plugins/distributors/steps.py | Python | gpl-2.0 | 4,693 |
# coding: utf-8
from django.contrib import admin
from .models import Note, NoteBook, NoteRevision, User
admin.site.register(User)
admin.site.register(NoteBook)
admin.site.register(Note)
admin.site.register(NoteRevision)
| skitoo/aligot | aligot/admin.py | Python | mit | 223 |
from electrum_dgb.i18n import _
fullname = 'Virtual Keyboard'
description = '%s\n%s' % (_("Add an optional virtual keyboard to the password dialog."), _("Warning: do not use this if it makes you pick a weaker password."))
available_for = ['qt']
| protonn/Electrum-Cash | plugins/virtualkeyboard/__init__.py | Python | mit | 246 |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool by AusAid - ** Generic Impact
Function on Population for Classified Hazard.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | kant/inasafe | safe/impact_functions/generic/classified_raster_population/impact_function.py | Python | gpl-3.0 | 10,176 |
from nekrobox.docdecs import params
from six.moves import range
@params(one=(int, "First symbol"),
two=(int, "Next symbol"),
symbols=(int, "Number of symbols to choose from"),
returns=(int, "Shortest distance"))
def distance(one, two, symbols=36):
"""Get the shortest distance between two s... | Nekroze/quickdial | quickdial/pathing.py | Python | mit | 936 |
"""
WSGI config for mysite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.wsgi... | juanc27/myfavteam | mysite/wsgi.py | Python | mit | 460 |
import json
import os
import re
import sys
import django
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.sitemaps.views import x_robots_tag
from django.core.exceptions import PermissionDenied, ViewDoesNotExist
from django.core.paginator import EmptyPage, PageNo... | wagnerand/addons-server | src/olympia/amo/views.py | Python | bsd-3-clause | 8,643 |
import datetime
def even_fib(le = None):
a = 1
b = 1
while True:
c = a + b
if le and c > le:
return
yield c
a = b + c
b = c + a
def main(le):
return sum(even_fib(le))
try:
para = int(input())
except:
para = int(4e6)
beg = datetime.datetime.... | nowsword/ProjectEuler | p002.py | Python | gpl-3.0 | 422 |
"""
Some utilities related to i386 analysis. Loaders and analysis
modules may use these as needed...
"""
import binascii
sigs = [
("558bec", "ffffff"), # push ebp; mov ebp,esp; Intel/Microsoft
("568bf1", "ffffff"), # push esi; mov esi,ecx (c++)
("5589e5", "ffffff"), # push ebp; mov ebp,esp; GCC
("... | bat-serjo/vivisect | vivisect/analysis/i386/__init__.py | Python | apache-2.0 | 752 |
import json
import logging
from tornado import web, gen
from lib.blinx.core.router.routestar import AddRoute
from lib.blinx.core.handlers import BaseHandler
from utils.email import validate_email
app_log = logging.getLogger("tornado.application")
@AddRoute(r'/recovery')
class RecoveryHandler(BaseHandler):
@... | blinxin/blinx | blinx/routes/recovery.py | Python | gpl-2.0 | 5,542 |
#!/usr/bin/env python
import os
import sqlite3
import sys
from xml.etree import ElementTree
def generate_columns(table, columns):
ret = []
types = {
"Bool": "bool",
"Int": "int",
"Long": "long",
"ULong": "unsigned long",
"String": "text",
"LocString": "text",
"AssetPath": "text",
}
for name, type in... | oftc-ftw/stove | scripts/dbf_to_sqlite.py | Python | agpl-3.0 | 3,185 |
# Copyright (C) 2013 Statoil ASA, Norway.
#
# The file 'unrecognized_enum.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/config/unrecognized_enum.py | Python | gpl-3.0 | 929 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 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.apac... | ntt-sic/nova | nova/tests/api/openstack/compute/plugins/v3/test_scheduler_hints.py | Python | apache-2.0 | 12,196 |
from os.path import dirname, join
import subprocess
base = dirname(__file__)
mabot_path = join(base, '..', 'src', 'mabot', 'run.py')
test_path = join(base, 'tests')
subprocess.call('python %s %s' % (mabot_path, test_path)) | qitaos/robotframework-mabot | atest/start_tests.py | Python | apache-2.0 | 229 |
import re #dont kill me, just for preprocessing
with open("regexcif-src.py") as x,open("regexcif.py","w") as w:
y=re.sub("( *)##restart(\n\1pass)?","""
\\1##restart
\\1if len(stack)==0: #no backtrack points
\\1 start+=1
\\1 if start>len(inp):
\\1 return []
\\1 if debug:print("next start")
\\1 ini... | CatsAreFluffy/regexcif.py | src/regexcif-launch.py | Python | mit | 590 |
"""setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import marshal
import textwr... | d3banjan/polyamide | webdev/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | Python | bsd-2-clause | 17,606 |
# -*- coding: utf-8 -*-
# Copyright 2017, 2021 ProjectQ-Framework (www.projectq.ch)
#
# 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.... | ProjectQ-Framework/ProjectQ | projectq/ops/_command_test.py | Python | apache-2.0 | 12,405 |
'''
Windows file chooser
--------------------
'''
from plyer_lach.facades import FileChooser
from win32com.shell import shell, shellcon
import os
import win32gui
import win32con
import pywintypes
class Win32FileChooser(object):
'''A native implementation of NativeFileChooser using the
Win32 API on Windows.
... | locksmith47/turing-sim-kivy | src/plyer_lach/platforms/win/filechooser.py | Python | mit | 3,452 |
"""
Copyright 2008 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... | ambikeshwar1991/gnuradio-3.7.4 | grc/base/ParseXML.py | Python | gpl-3.0 | 3,968 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Vincent A
#
# This file is part of weboob.
#
# weboob 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 Free Software Foundation, either version 3 of the License, or
# (at your opt... | yannrouillard/weboob | modules/unsee/backend.py | Python | agpl-3.0 | 2,379 |
def formData(List):
for each in List:
if('-' in each):
sep='-'
elif(':' in each):
sep=':'
else:
return each
(m,s)=each.split(sep)
return [m+'.'+s]
try:
with open('sara.txt','r') as sara:
sara_f=sara.readline()
sara_s=[for... | mayaobei/funnyTest | pyhton/HeadFirstPython/Chapter/cocah.py | Python | gpl-3.0 | 426 |
from gamtools import segregation, cosegregation
import io
from numpy.testing import assert_array_equal, assert_array_almost_equal
import pytest
import numpy as np
try:
from unittest.mock import patch
except ImportError:
from mock import patch
fixture_window1_only = io.StringIO(
u"""chrom start stop A B C D... | pombo-lab/gamtools | lib/gamtools/tests/test_cosegregation.py | Python | apache-2.0 | 10,531 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import logging
from scripttest import TestFileEnvironment
from migrate.tests.fixture.pathed import *
log = logging.getLogger(__name__)
class Shell(Pathed):
"""Base class for command line tests"""
def setUp(self):
super(Shell, self... | odubno/microblog | venv/lib/python2.7/site-packages/migrate/tests/fixture/shell.py | Python | bsd-3-clause | 926 |
# -*- coding: utf-8 -*-
'''
Sample application for the Python library for controlling the Teufel Raumfeld system
@author: Patrick Maier
@contact: mail@maierp.de
Webpage: https://github.com/maierp/pyraumfeld
Based on python-raumfeld by Thomas Feldmann:
https://github.com/tfeldmann/python-raumfeld
'''
import raumfe... | maierp/PyRaumfeld | PyRaumfeldSample.py | Python | mit | 1,924 |
from datetime import date, datetime
from decimal import Decimal
from functools import partial
from collections import namedtuple
from testfixtures.shouldraise import ShouldAssert
from testfixtures.tests.sample1 import SampleClassA, SampleClassB, Slotted
from testfixtures.mock import Mock, call
from re import compile... | Simplistix/testfixtures | testfixtures/tests/test_compare.py | Python | mit | 59,062 |
from octopy import *
def InitDuplication(host1, host2, timeout = Minutes(10)):
def dup_module(host1, host2):
return {
"const" : {
"type" : "octotron",
"host" : host1,
"dup_host" : host2
},
"sensor" : {
"working" : Boolean(timeout)
},
"trigger" : {
"not_working" : Match("working"... | srcc-msu/octotron | octopy_lib/util_duplication.py | Python | mit | 1,193 |
import json
from django.core.urlresolvers import reverse
from test_base import MainTestCase
from main.views import api
from odk_viewer.models.parsed_instance import ParsedInstance, \
_encode_for_mongo, _decode_from_mongo
import base64
def dict_for_mongo_without_userform_id(parsed_instance):
d = parsed_instan... | makinacorpus/formhub | main/tests/test_form_api.py | Python | bsd-2-clause | 7,229 |
import io
import zipfile
import csv
import sys
w = csv.writer(open("output-{0}.csv".format(sys.argv[1]), "w"))
w.writerow(["STATE", "PUMA", sys.argv[1]])
# number of rows for ss13husa,ss13husb
row_counts = [756065,720248]
pumaC = 0
for fNr in range(2):
if (fNr == 0):
alpha = 'a'
else... | openmachinesblog/visualization-census-2013 | getCSVByColumn.py | Python | mit | 1,038 |
# coding=utf-8
# Author: Gonçalo M. (aka duramato/supergonkas) <supergonkas@gmail.com>
#
# This file is part of Medusa.
#
# Medusa 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 Licens... | FireBladeNooT/Medusa_1_6 | medusa/providers/torrent/xml/bitsnoop.py | Python | gpl-3.0 | 5,911 |
# 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... | AndreasMadsen/tensorflow | tensorflow/contrib/rnn/python/kernel_tests/rnn_test.py | Python | apache-2.0 | 18,801 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import logging
import exhibitionist.settings as settings
def getLogger(name, level=settings.DEFAULT_LOG_LEVEL):
logger = logging.getLogger(name.replace("exhibitionist.", ""))
sh = logging.FileHandler(settings.LOG_FILE)
sh.setFormatter(settings... | kentfrazier/Exhibitionist | exhibitionist/log.py | Python | bsd-3-clause | 406 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Admin model views for records."""
import json
from flask import flash
from flask... | tiborsimko/invenio-records | invenio_records/admin.py | Python | mit | 2,051 |
#!/usr/bin/env python3
# Copyright (c) 2013 Jakub Filipowicz <jakubf@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 your option) any... | jakubfi/em400 | tools/m4konf.py | Python | gpl-2.0 | 15,829 |
# pylint: disable=too-many-arguments
import random
import string
from dataclasses import dataclass, fields, replace
from functools import singledispatch
from eth_utils import to_checksum_address
from raiden.constants import EMPTY_MERKLE_ROOT, UINT64_MAX, UINT256_MAX
from raiden.messages import Lock, LockedTransfer, R... | hackaugusto/raiden | raiden/tests/utils/factories.py | Python | mit | 34,939 |
# -*- coding: utf-8 -*-
__author__ = 'Eric Larson'
__email__ = 'eric@ionrock.org'
__version__ = '0.1.6'
import cgitb
import smtplib
import traceback
from cStringIO import StringIO
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from contextlib import contextmanager
class ErrorEma... | ionrock/erroremail | erroremail/__init__.py | Python | bsd-3-clause | 2,084 |
# This file was generated by 'versioneer.py' (0.7+) from
# revision-control system data, or from the parent directory name of an
# unpacked source archive. Distribution tarballs contain a pre-generated copy
# of this file.
version_version = '0.2.13'
version_full = '01a5d50179af4adf28195ce6a926c735eede6b06'
def get_ve... | proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/obfsproxy/_version.py | Python | gpl-2.0 | 418 |
"""
Functions file for login app
consists of common functions used by both api.py and views.py file
"""
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.contrib.auth import login as django_login
from django.core.mail import send_mail, EmailMultiAlternatives
from djan... | BuildmLearn/University-Campus-Portal-UCP | UCP/login/functions.py | Python | bsd-3-clause | 10,003 |
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library ... | FedoraScientific/salome-paravis | test/VisuPrs/Animation/H1.py | Python | lgpl-2.1 | 2,941 |
"""
Task sequencer
"""
import sys
import logging
from teuthology import run_tasks
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Sequentialize a group of tasks into one executable block
example:
- sequential:
- tasktest:
- tasktest:
You can also reference the job fr... | ktdreyer/teuthology | teuthology/task/sequential.py | Python | mit | 1,305 |
'''
=====================
Folder "View" Classes
=====================
These classes wrap Directories and perform automatic actions
to Histograms retrieved from them. The different views can be composited and
layered.
Summary of views:
- ScaleView: scale histogram normalization
- NormalizeView: normalize histograms... | ndawe/rootpy | rootpy/plotting/views.py | Python | bsd-3-clause | 15,818 |
# 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... | petewarden/tensorflow | tensorflow/python/ops/summary_ops_v2.py | Python | apache-2.0 | 49,451 |
from django.test import TestCase
from django.core.exceptions import ValidationError
from oscar.core.compat import get_user_model
from oscar.apps.catalogue.reviews import models
from oscar.test.factories import create_product
from oscar.test.factories import UserFactory
User = get_user_model()
class TestAnAnonymousR... | vicky2135/lucious | tests/integration/catalogue/reviews/test_models.py | Python | bsd-3-clause | 5,519 |
"""
Contains application CRUD view definitions.
"""
from django.core.exceptions import ImproperlyConfigured
from django.core.paginator import EmptyPage
from django.core.paginator import PageNotAnInteger
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.utils.decorators impor... | thenewguy/wagtailplus | wagtailplus/utils/views/crud.py | Python | bsd-2-clause | 10,014 |
T = [(1,2),(3,4),(5,6)]
for (a,b) in T:
print(a,"e",b)
for i in range(100):
print(i,end=' ')
| felipeatr/tresa | 01_exemplos_revisao/11_laco_for.py | Python | gpl-3.0 | 100 |
#-------------------------------------------------------------------------------
# This file is part of PyMad.
#
# Copyright (c) 2011, CERN. 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... | pymad/cpymad | test/test_lhc.py | Python | apache-2.0 | 952 |
"""
chatrelater.analyzer_cli
~~~~~~~~~~~~~~~~~~~~~~~~
Command line interface for analyzer.
:Copyright: 2007-2021 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from argparse import ArgumentParser
from pathlib import Path
from .analyzer import analyze
from .serialization import serialize_data_to_fi... | homeworkprod/chatrelater | src/chatrelater/analyzer_cli.py | Python | mit | 2,473 |
#!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 lamarpavel
# Copyright 2015-2017 Alexey Nabrodov (Averrin)
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistrib... | lahwaacz/qutebrowser | scripts/dev/ua_fetch.py | Python | gpl-3.0 | 4,386 |
import models
class BTM(object):
def __init__(self, totalAmountBills,
currentAmountBills, currentAmountBitcoin):
self.priceModel = models.PriceModel(totalAmountBills,
currentAmountBills,
currentAmount... | cjduncana/Unbanked-Bitcoin-ATM | btm/btm.py | Python | gpl-2.0 | 822 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.