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 2020 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/timesketch | end_to_end_tests/interface.py | Python | apache-2.0 | 7,957 |
import sublime_plugin
from ..libs.global_vars import get_language_service_enabled
from ..libs.view_helpers import is_typescript, active_view
class TypeScriptBaseTextCommand(sublime_plugin.TextCommand):
def is_enabled(self):
return is_typescript(self.view) and get_language_service_enabled()
class TypeScr... | Microsoft/TypeScript-Sublime-Plugin | typescript/commands/base_command.py | Python | apache-2.0 | 671 |
from btserver import BTServer
from btserver import BTError
from sensor import SensorServer
import argparse
import asyncore
import json
import logging
import sqlite3
from threading import Thread
from time import gmtime, sleep, strftime, time
import datetime
logger = logging.getLogger(__name__)
if __name__ == '__main_... | JungInkyo/Qualcomm_sensor | pa10a/Team_C_sensor.py | Python | gpl-2.0 | 3,324 |
import bpy
from mathutils import *
from math import *
from . import collada as c, fix, armatures
from bpy.props import StringProperty
import xml.etree.cElementTree as etree
try:
from . import simox
use_simox = True
except ImportError:
use_simox = False
try:
from . import mmm
use_mmm = True
excep... | StefanUlbrich/RobotEditor | files.py | Python | gpl-2.0 | 9,977 |
# Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | cortext/crawtextV2 | ~/venvs/crawler/lib/python2.7/site-packages/whoosh/fields.py | Python | mit | 51,656 |
import time
import traceback
from couchpotato.core.helpers.variable import getImdb, md5, cleanHost
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.base import YarrProvider
from couchpotato.environment import Env
log = CPLog(__name__)
class TorrentProvider(YarrProvider):
p... | koomik/CouchPotatoServer | couchpotato/core/media/_base/providers/torrent/base.py | Python | gpl-3.0 | 2,163 |
from __future__ import (absolute_import, print_function, division)
import os
import select
import socket
import sys
import threading
import time
import traceback
import binascii
from six.moves import range
import certifi
from backports import ssl_match_hostname
import six
import OpenSSL
from OpenSSL import SSL
from ... | dufferzafar/mitmproxy | netlib/tcp.py | Python | mit | 34,025 |
#!/usr/bin/env python
import vtk
def main():
colors = vtk.vtkNamedColors()
points = vtk.vtkPoints()
points.InsertNextPoint(0.0, 0.0, 0.0)
points.InsertNextPoint(1.0, 0.0, 0.0)
points.InsertNextPoint(2.0, 0.0, 0.0)
points.InsertNextPoint(3.0, 0.0, 0.0)
points.InsertNextPoint(4.0, 0.0, 0.0... | lorensen/VTKExamples | src/Python/PolyData/WarpVector.py | Python | apache-2.0 | 2,235 |
import logging
import plugins
logger = logging.getLogger(__name__)
bot = plugins.tracking.bot
@bot.message_handler( commands = [ 'echo' ] )
def echo_message(message):
logger.info( "{} - {}".format( message.chat.id, message.text ) )
mes = ""
if len(message.text.split( " " )) == 1 :
pass
else:
... | ssdoz2sk/Telegram_ENL-Bot | plugins/echo.py | Python | agpl-3.0 | 426 |
"""
REST player
"""
from .player import Player
class RESTPlayer(Player):
"""Implementation of Player which gets moves moves from a REST Api"""
def __init__(self, state):
super(RESTPlayer, self).__init__(state)
self.move = None
def __str__(self):
return 'REST {}'.format(super(RE... | christianreimer/raottt | raottt/player/rest.py | Python | mit | 606 |
class BrokenRequestMiddleware(object):
def process_request(self, request):
raise ImportError('request')
class BrokenResponseMiddleware(object):
def process_response(self, request, response):
raise ImportError('response')
class BrokenViewMiddleware(object):
def process_view(self, request,... | dirtycoder/opbeat_python | tests/contrib/django/testapp/middleware.py | Python | bsd-3-clause | 549 |
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any... | pixelspark/corespark | Libraries/Spirit/boost/miniboost/tools/build/v2/test/dependency_property.py | Python | lgpl-3.0 | 1,139 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ogr2ogrclip.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | wonder-sk/QGIS | python/plugins/processing/algs/gdal/ogr2ogrclip.py | Python | gpl-2.0 | 3,659 |
import sys, argparse
import nose
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose', action='store_true')
parser.add_argument('-p', '--public', action='store_true')
parser.add_argument('-t', '--tests', action='store_true')
if 'runtests' in sys.argv[0]:
args = parser.parse_args(sys.argv[1:]... | rogerfan/simpleml | runtests.py | Python | mpl-2.0 | 693 |
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.resources import resource_find
from kivy.clock import Clock
import timeit
Builder.load_string('''
<PerfApp>:
value: 0
but: but.__self__
slider: slider
text_input: text_input
BoxLayout:
... | JulienMcJay/eclock | windows/kivy/kivy/tests/perf_test_textinput.py | Python | gpl-2.0 | 6,601 |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.toontowngui.IntuitiveColorPicker
from panda3d.core import Texture
from direct.gui.DirectGui import *
from otp.otpgui.ColorPicker import ColorPicker
from toontown.toonbase import TTLocalizer, ToontownGlobals
import math, colorsys
class Intuitive... | DedMemez/ODS-August-2017 | toontowngui/IntuitiveColorPicker.py | Python | apache-2.0 | 5,821 |
__author__ = 'laharah'
import gtk
import os
import time
import webbrowser
from twisted.internet import defer
from deluge.ui.client import client
import deluge.component as component
from filebottool.common import get_resource
from filebottool.common import LOG
from filebottool.gtkui.common import EditableList
from... | Laharah/deluge-FileBotTool | filebottool/gtkui/config_ui.py | Python | gpl-3.0 | 9,780 |
'''
A package of utilities for exporting NEURON models to NeuroML 2 & for analysing/comparing NEURON models to NeuroML versions
Will use some some utilities from https://github.com/OpenSourceBrain/NEURONShowcase
'''
from pyneuroml.pynml import validate_neuroml1
from pyneuroml.pynml import validate_neuroml2
from py... | rgerkin/pyNeuroML | pyneuroml/neuron/__init__.py | Python | lgpl-3.0 | 2,783 |
import sys
import lexer
from ast import *
debug = False
class SymbolTable(dict):
"""
Class representing a symbol table. It should
provide functionality for adding and looking
up nodes associated with identifiers.
"""
def __init__(self, decl=None):
super().__init__()
self.decl =... | gmCrivelli/Lya-Compiler | semantic.py | Python | mit | 46,544 |
import sys
from pyspark.sql import SparkSession, functions, types
spark = SparkSession.builder.appName('reddit averages').getOrCreate()
assert sys.version_info >= (3, 4) # make sure we have Python 3.4+
assert spark.version >= '2.1' # make sure we have Spark 2.1+
schema = types.StructType([ # commented-out fields wo... | MockyJoke/numbers | ex10/code/reddit_averages_hint.py | Python | mit | 2,099 |
# Copyright Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | hglkrijger/WALinuxAgent | tests/ga/test_remoteaccess.py | Python | apache-2.0 | 5,846 |
#!/usr/bin/env python
# coding=UTF-8
__author__ = "Pierre-Yves Langlois"
__copyright__ = "https://github.com/pylanglois/uwsa/blob/master/LICENCE"
__credits__ = ["Pierre-Yves Langlois"]
__license__ = "BSD"
__maintainer__ = "Pierre-Yves Langlois"
from uwsas.common import *
from uwsas.core import L
from uwsas.commands.... | pylanglois/uwsa | uwsas/commands/install_awstats.py | Python | bsd-3-clause | 704 |
#encoding: utf8
import struct
import functools
import os
import rejit.common
import rejit.x86encoder
from rejit.x86encoder import int32bin, Scale, Reg, Opcode
class CompilationError(rejit.common.RejitError): pass
class JITCompiler:
def __init__(self):
pass
def compile_to_x86_32(self, ir, args, var_... | ziowk/rejit | rejit/jitcompiler.py | Python | gpl-2.0 | 17,668 |
from corehq.apps.adm.admin import BaseADMAdminInterface
from corehq.apps.adm.admin.forms import ADMReportForm
from corehq.apps.adm.models import ADMReport
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
class ADMReportAdminInterface(BaseADMAdminInterface):
name = "Default ADM Reports"... | gmimano/commcaretest | corehq/apps/adm/admin/reports.py | Python | bsd-3-clause | 1,425 |
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
short_version = '1.8.1'
version = '1.8.1'
full_version = '1.8.1'
git_revision = '62a7575fd82ddf028517780c01fecf7e0cca27aa'
release = True
if not release:
version = full_version
| AdaptiveApplications/carnegie | tarc_bus_locator_client/numpy-1.8.1/numpy/version.py | Python | mit | 228 |
"""
Tools for generating forms based on Peewee models
(cribbed from wtforms.ext.django)
"""
from collections import namedtuple
from wtforms import Form
from wtforms import fields as f
from wtforms import validators
from wtfpeewee.fields import ModelSelectField
from wtfpeewee.fields import SelectChoicesField
from wtfpe... | bryhoyt/wtf-peewee | wtfpeewee/orm.py | Python | mit | 8,207 |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | sasha-gitg/python-aiplatform | .sample_configs/param_handlers/create_hyperparameter_tuning_job_python_package_sample.py | Python | apache-2.0 | 3,158 |
from website.addons.base.serializer import OAuthAddonSerializer
from website.addons.googledrive.exceptions import ExpiredAuthError
class GoogleDriveSerializer(OAuthAddonSerializer):
@property
def addon_serialized_urls(self):
node = self.node_settings.owner
return {
'files': node.... | haoyuchen1992/osf.io | website/addons/googledrive/serializer.py | Python | apache-2.0 | 1,189 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# This is derived from a cadquery script for generating PDIP models in X3D format
#
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
# This is a
# Dimensions are from Microchips Packaging Specification document:
# DS00000049BY. Body drawing is the same as QFP ... | easyw/kicad-3d-models-in-freecad | cadquery/FCAD_script_generator/Fuse/main_generator.py | Python | gpl-2.0 | 8,654 |
""" Some utility functions for handling the data. """
import base64, subprocess, numpy
from subprocess import Popen, PIPE, STDOUT
def hash_distance(v1, v2):
"""
Most likely the most inefficient code to calculate hamming distance ever.
"""
result = v1 ^ v2
return float(bin(result).count('1'))
def distance_ma... | googleprojectzero/functionsimsearch | testdata/functionsimsearchutil.py | Python | apache-2.0 | 2,293 |
#!/usr/bin/env python3
import subprocess
from functions import *
from variables import *
# Re-create old folder
RecreateDir(DEPLOY_DIR)
# Copy files/dirs for deployment
dst = DEPLOY_DIR
for src in RELEASE_PATHS_TO_DEPLOY:
Copy(src, dst)
# Deploy
if Os() == 'mac':
args = ['macdeployqt',
'{}'.form... | AndrewSazonov/Davinci | Scripts/makeDeploy.py | Python | gpl-3.0 | 1,821 |
def overlap(start_1, end_1, start_2, end_2):
result = min([end_1, end_2]) - max([start_1, start_2]) + 1
if result >= 0:
return result
return 0
| konrad/kufpybio | kufpybio/helpers.py | Python | isc | 163 |
"""normalize constraint and key names
correct keys for pre 0.5.6 naming convention
Revision ID: 438c27ec1c9
Revises: 439766f6104d
Create Date: 2015-06-13 21:16:32.358778
"""
from __future__ import unicode_literals
from alembic import op
from alembic.context import get_context
from sqlalchemy.dialects.postgresql.base... | ergo/ziggurat_foundations | ziggurat_foundations/migrations/versions/438c27ec1c9_normalize_constraint_and_key_names.py | Python | bsd-3-clause | 12,558 |
from setuptools import setup, find_packages
setup(name='pygame_toolbox',
version='0.1.2',
license='MIT',
description='Tools to help with game development using pygame\nFor' +
' complete details please reference the github page',
author='James Milam',
author_email='jmilam... | jbm950/pygame_toolbox | setup.py | Python | mit | 780 |
from __future__ import unicode_literals
from rest_framework import viewsets
from rest_framework import permissions
from videos.api.serializers import video as video_serializers
from videos.models import Video
class VideoViewSet(viewsets.ModelViewSet):
permission_classes = [permissions.DjangoModelPermissionsOrA... | sdeleeuw/contagement | videos/api/viewsets/video.py | Python | gpl-3.0 | 1,272 |
#-*- coding: utf-8 -*-
'''
123123
123
'''
# 统计包括c/c++,python程序代码行、注释行
# 建字典,保存对应的程序语言和后缀、单行注释符、多行注释符
import pdb
# 扩展其他程序可以在这里加入
lan_postfix={'python':'.py','c':'.c'}
lan_comment={'python':'#','c':'//'}
# 解决多行注释 如python中的'''
multi_comment_start={'python':'\'\'\'','c':'/*'}
multi_comment_end={'python':'\'\'\'','c':'*/'... | Supersuuu/python | burness/0007/Program_lines_stat.py | Python | mit | 2,401 |
#!/usr/bin/env python3
# Copyright (C) 2013-2019 Florian Festi
#
# 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.... | florianfesti/boxes | boxes/generators/drillstand.py | Python | gpl-3.0 | 8,194 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestWebsiteSettings(unittest.TestCase):
pass
| adityahase/frappe | frappe/website/doctype/website_settings/test_website_settings.py | Python | mit | 227 |
# Django specific
from django.core.management.base import BaseCommand
from geodata.updaters import RegionUpdater
class Command(BaseCommand):
option_list = BaseCommand.option_list
def handle(self, *args, **options):
ru = RegionUpdater()
ru.update_unesco_regions() | tokatikato/OIPA | OIPA/geodata/management/commands/region_update_unesco_regions.py | Python | agpl-3.0 | 289 |
#!/usr/bin/python
from txzookeeper.client import ZookeeperClient
from txzookeeper.retry import RetryClient
import zookeeper
import sys
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
import os
from twisted.python import log
from twisted.internet import reactor, defer
log.startLogging(sys.stdout)
class... | Wallix-Resilience/LogMonitor | resilience/zookeeper/configure/config.py | Python | gpl-2.0 | 4,845 |
import bpy
import math
import sys
import os
import stat
import bmesh
import time
import random
##---------------------------RELOAD IMAGES------------------
class reloadImages (bpy.types.Operator):
bl_idname = "image.reload_images_osc"
bl_label = "Reload Images"
bl_options = {"REGISTER", "UNDO"}
def exe... | Passtechsoft/TPEAlpGen | blender/release/scripts/addons_contrib/oscurart_tools/oscurart_files.py | Python | gpl-3.0 | 2,626 |
#!/usr/bin/env python
# Original Author: Michael Lelli <toadking@toadking.com>
import usb.core
import usb.util
import uinput
import sys
import getopt
if sys.version_info.major < 3:
iteritems = lambda x: x.iteritems()
else:
iteritems = lambda x: x.items()
controllers = [None, None, None, None]
controllers_st... | ToadKing/wii-u-gc-adapter | old/wii-u-gc-adapter.py | Python | mit | 6,068 |
from toontown.coghq.BossbotCogHQLoader import BossbotCogHQLoader
from toontown.toonbase import ToontownGlobals
from toontown.hood.CogHood import CogHood
class BossbotHQ(CogHood):
notify = directNotify.newCategory('BossbotHQ')
ID = ToontownGlobals.BossbotHQ
LOADER_CLASS = BossbotCogHQLoader
def load(... | ToontownUprising/src | toontown/hood/BossbotHQ.py | Python | mit | 635 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-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 views for managing access to actions."""
from flask import current_app
from... | tiborsimko/invenio-access | invenio_access/admin.py | Python | mit | 3,832 |
from flask import request
from flask_restful import Resource
from airy.units import client, report
from airy.resources import Api
from airy.resources.user import requires_auth
class Clients(Resource):
def get(self):
# Return list of clients
return {'clients': client.get_all()}
def post(self... | xuhcc/airy | airy/resources/client.py | Python | mit | 1,957 |
import pygame
import sys
import os
import re
import itertools
import string
import time
from pygame.locals import *
from PacManMap import *
from MakeGraph import *
from Moving_pacman import *
from Ghosts import Ghost
import socket
import pickle
class DrawGraphic():
def __init__(self,class_pacman,class_ghost,class_gh... | Yordan92/Pac-man-multiplayer | drawGraphic.py | Python | gpl-3.0 | 9,683 |
"""
WSGI config for django_rest_omics 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", "django_rest_omics.local_sett... | naderm/django_rest_omics | django_rest_omics/wsgi.py | Python | bsd-2-clause | 415 |
# encoding: utf8
# 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.
import tempfile
import unittest
from bkr.server.test... | beaker-project/beaker | Server/bkr/server/tests/test_testinfo.py | Python | gpl-2.0 | 20,598 |
# Wrapper for coinroll.it's API
import requests
from urllib import parse
from decimal import Decimal
from collections import namedtuple
BASE_URI = 'https://coinroll.it'
ONE_SATOSHI = Decimal('0.00000001')
ONE_BTC = 100000000
# convert a number in satoshis to BTC
def btc(x):
return ONE_SATOSHI * x
# convert a numb... | andrew12/python-coinroll | coinroll.py | Python | unlicense | 5,007 |
#!/usr/bin/python
"""Test of menu accelerator label output."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("<Control>f"))
sequence.append(TypeAction("Application class"))
sequence.append(KeyComboAction("Return"))
sequence.append(KeyComboAction("Return"))
se... | pvagner/orca | test/keystrokes/gtk3-demo/role_accel_label.py | Python | lgpl-2.1 | 2,381 |
'''
Author: Jennifer Clark
Description: This program demonstrates a simple breadth-first algorithm. It takes input
from a file called 'arcs.txt' and creates a matrix containing information about the nodes.
'''
from numpy import inf # Allows the use of infinity
# Forward star representation of graph 7.21a on page 243
... | nerdgirl999/school-examples | MATH466/reverse_BFS.py | Python | mit | 3,654 |
from rps import *
from flask import Flask, render_template, request, redirect
app = Flask(__name__)
gamecount = 0
game = RPS(verbose=True)
cats = ['Random Cat', 'Logistic Cat', 'Naive Bayes Cat', 'Random Forest Cat', 'XGBoost Cat']
@app.route('/play', methods = ['POST'])
def play():
global gamecount, cats
ga... | bartekpi/rps | main.py | Python | mit | 608 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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... | tzpBingo/github-trending | codespace/python/tencentcloud/tcm/v20210413/tcm_client.py | Python | mit | 3,255 |
def authorized_to_manage_request(_, request, current_user, pushmaster=False):
if pushmaster or \
request['user'] == current_user or \
(request['watchers'] and current_user in request['watchers'].split(',')):
return True
return False
| bchess/pushmanager | ui_methods.py | Python | apache-2.0 | 263 |
from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.sites.requests import RequestSite
from django.template import RequestContext
from .models import Overview, PersonalInfo, Education, Job, Accomplishment, Skillset, Skill
def index(request):
site_name = RequestSite(request)... | ckelly/django-resume | resume/views.py | Python | mit | 794 |
import numpy as np
def primes(n):
if n == 2:
return [2]
elif n < 2:
return []
s = np.arange(3, n+1, 2)
mroot = n ** 0.5
half = (n+1) / 2 - 1
i = 0
m = 3
while m <= mroot:
if s[i]:
j = (m*m - 3) / 2
s[j] = 0
whil... | Van314159/Stokeslet-between-two-parallel-plate | python files/Primes.py | Python | mit | 463 |
import unittest
from helper import UsesQApplication
from PySide.QtCore import QTimer
from PySide.QtGui import QPainter, QFont, QFontInfo, QWidget, qApp
class MyWidget(QWidget):
def paintEvent(self, e):
p = QPainter(self)
self._info = p.fontInfo()
self._app.quit()
class TestQPainter(Uses... | M4rtinK/pyside-android | tests/QtGui/bug_750.py | Python | lgpl-2.1 | 577 |
# -*- coding: utf-8 -*-
import requests
from crestify.archivers import ArchiveService, ArchiveException
class ArchiveOrgService(ArchiveService):
def get_service_name(self):
return "org.archive"
def submit(self, url):
url = 'http://web.archive.org/save/%s' % (url)
response = requests.... | crestify/crestify | crestify/archivers/archiveorg.py | Python | bsd-3-clause | 684 |
""" generic mechanism for marking and selecting python functions. """
import inspect
class MarkerError(Exception):
"""Error in use of a pytest marker/attribute."""
def pytest_namespace():
return {'mark': MarkGenerator()}
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addo... | Yukarumya/Yukarum-Redfoxes | python/pytest/_pytest/mark.py | Python | mpl-2.0 | 11,102 |
# 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.
"""A module for the basic architectures supported by cr."""
import cr
DEFAULT = cr.Config.From(
CR_ENVSETUP_ARCH='{CR_ARCH}',
)
class Arch(cr.Plugin,... | jaruba/chromium.src | tools/cr/cr/base/arch.py | Python | bsd-3-clause | 1,544 |
import copy
from types import GeneratorType
class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
If a key appears in more than one of the given dictionaries, only the
first occurrenc... | skevy/django | django/utils/datastructures.py | Python | bsd-3-clause | 15,444 |
# Copyright 2015 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.
"""This module wraps Android's split-select tool."""
from devil.android.sdk import build_tools
from devil.utils import cmd_helper
from devil.utils import la... | js0701/chromium-crosswalk | build/android/devil/android/sdk/split_select.py | Python | bsd-3-clause | 1,938 |
def oss():
import RPi.GPIO as GPIO
import cv2
import time
from datetime import datetime
from model.lampu import lampu_on, lampu_off
#from model.kirim import mail
#from model.camera import VideoCamera as camera
GPIO.setmode(GPIO.BCM)
pirPin = 18
... | alifpamuji93/OSSS | app.py | Python | mit | 1,468 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'djangosite.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| fanscribed/django-react | example/djangosite/urls.py | Python | mit | 279 |
import numpy as np
from layers import *
class SeqNN(object):
def __init__(self, word_to_idx, wordvec_dim=128, hidden_dim=128,
cell_type='rnn', sentlen=7, storylen=70, qlen=5,
dtype=np.float32):
if cell_type not in {'rnn', 'lstm', 'gru'}:
raise ValueError('Invalid cell_type "%s"' ... | kadircet/CENG | 783/project/approach1.py | Python | gpl-3.0 | 4,760 |
from ircBase import *
import urllib2
import urllib
from bs4 import BeautifulSoup
@respondtoregex('.*')
def twss_response(message, **extra_args):
#Don't check for messages that arent room messages or pms
#This also filters out things said by Rafi, so it only looks at other nicks messages'
if message.is_private_mess... | Mov1s/RafiBot | modules/twssModule.py | Python | bsd-2-clause | 894 |
from osrf_pycommon.process_utils import asyncio
from osrf_pycommon.process_utils.async_execute_process import async_execute_process
from osrf_pycommon.process_utils import get_loop
from .impl_aep_protocol import create_protocol
loop = get_loop()
@asyncio.coroutine
def run(cmd, **kwargs):
transport, protocol = y... | ros2/ci | ros2_batch_job/vendor/osrf_pycommon/tests/unit/test_process_utils/impl_aep_asyncio.py | Python | apache-2.0 | 505 |
# Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
import sys
import time
from threading import Thread
from unittest import TestCase
try:
from unittest import SkipTest
except ImportError:
from unittest2 import SkipTest
from pytest import mark
import zmq
from zmq.util... | josephkirk/PipelineTools | packages/zmq/tests/__init__.py | Python | bsd-2-clause | 6,227 |
# Scrapy settings for daytonlocal project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'codefordayton'
SPIDER_MODULES = ['dayton.spiders']
NEWSPIDER_MODULE = '... | codefordayton/scrapers | dayton/settings.py | Python | unlicense | 537 |
# -*- coding:utf-8 -*-
import mock
import pytest
import libpy
import libpy.shadow
class TestShadow(object):
def test(self):
proxy = libpy.shadow.Shadow(ShadowTarget())
assert isinstance(proxy, libpy.shadow.Shadow)
assert proxy.a == mock.sentinel.proxy_target_a
assert proxy.b == ... | surabujin/libpy | libpy/test/test_shadow.py | Python | mit | 1,664 |
# Copyright (c) 2011, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condit... | ii0/bits | python/cpu_wsm_ex.py | Python | bsd-3-clause | 1,836 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | zzacharo/inspire-next | inspirehep/modules/workflows/tasks/magpie.py | Python | gpl-3.0 | 5,019 |
import bisect
import re
from itertools import combinations
class NFA(object):
EPSILON = object()
ANY = object()
def __init__(self, start_state):
self.transitions = {}
self.final_states = set()
self._start_state = start_state
@property
def start_state(self):
return... | GlobalNamesArchitecture/gnmatcher | matcher/src/main/resources/levenshtein_py/automata.py | Python | mit | 21,685 |
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sms_proxy.settings import DB, TEST_DB, DEBUG_MODE
if DEBUG_MODE:
engine = create_engine('sqlite:////tmp/{}'.format(TEST_DB),
convert_... | flowroute/sms-proxy | sms_proxy/database.py | Python | mit | 811 |
from readinglistlib import ReadingListReader
| anoved/ReadingListReader | readinglistlib/__init__.py | Python | mit | 45 |
# -*- coding: utf-8 -*-
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org>
Task Coach 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 vers... | wdmchaft/taskcoach | taskcoachlib/persistence/xml/reader.py | Python | gpl-3.0 | 20,854 |
# WARPnet Client<->Server Architecture
# WARPnet Parameter Definitions
#
# Author: Siddharth Gupta
#ETH_INTERFACE = 'en0'
#LOCAL_MAC_ADDRESS = [0x00,0x50,0xc2,0x63,0x3f,0xee]
# Ethernet Types (with or without header)
ETH_HEADER = 0x9090
ETH_NO_HEADER = 0x9292
ETH_RECEIVE = 0x9191
| shailcoolboy/Warp-Trinity | ResearchApps/Measurement/warpnet_framework/warpnet_server_params.py | Python | bsd-2-clause | 284 |
# Copyright 2019 ForgeFlow S.L. (http://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Move Budget",
"summary": "Create Accounting Budgets",
"version": "14.0.1.0.0",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/account... | OCA/account-financial-tools | account_move_budget/__manifest__.py | Python | agpl-3.0 | 683 |
#----------------------------------------------------------------------
# $Id: mozilla_dbd.py,v 1.1 2004/06/12 03:13:27 lsaffre Exp $
# Copyright: (c) 2003-2004 Luc Saffre
# License: GPL
#----------------------------------------------------------------------
import types
import warnings
from lino.adamo import
from... | MaxTyutyunnikov/lino | obsolete/src/lino/adamo/mozilla_dbd.py | Python | gpl-3.0 | 646 |
import time
import gevent
import operator
from collections import OrderedDict
from protocol import BaseProtocol
from p2p_protocol import P2PProtocol
from service import WiredService
import multiplexer
from muxsession import MultiplexedSession
from crypto import ECIESDecryptionError
import slogging
import gevent.socket
... | ms83/pydevp2p | devp2p/peer.py | Python | mit | 11,577 |
from __future__ import absolute_import
from sentry.api.bases.organization import OrganizationEndpoint, OrganizationIntegrationsPermission
from sentry.api.paginator import OffsetPaginator
from sentry.api.serializers import serialize
from sentry.models import ObjectStatus, OrganizationIntegration
class OrganizationInt... | beeftornado/sentry | src/sentry/api/endpoints/organization_integrations.py | Python | bsd-3-clause | 1,208 |
# The equalizer class and some audio eq functions are derived from
# 180093157554388993's work, with his permission
from pathlib import Path
from typing import Final
from redbot.core.i18n import Translator
_ = Translator("Audio", Path(__file__))
class Equalizer:
def __init__(self):
self.band_count: Fina... | palmtree5/Red-DiscordBot | redbot/cogs/audio/equalizer.py | Python | gpl-3.0 | 1,518 |
# DESCRIPTION
# Renders a PNG image like bacteria that mutate color as they spread. TRY IT. The output is awesome.
# DEPENDENCIES
# python 3 with numpy, queue, and pyimage modules installed (and others--see the import statements).
# USAGE
# Run this script through a Python interpreter without any parameters, and it w... | r-alex-hall/fontDevTools | scripts/imgAndVideo/color_growth.py | Python | gpl-3.0 | 45,584 |
#!/usr/bin/env python
#
# This tool is copyright (c) 2006, Sean Estabrooks.
# It is released under the Gnu Public License, version 2.
#
# Import Perforce branches into Git repositories.
# Checking out the files is done by calling the standard p4
# client which you must have properly configured yourself
#
import marsha... | 2ndy/RaspIM | usr/share/doc/git/contrib/p4import/git-p4import.py | Python | gpl-2.0 | 10,722 |
#!/usr/bin/env python
import os
import sys
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(PROJECT_DIR)
sys.path.append(os.path.abspath(PROJECT_DIR + '/../'))
sys.path.append(os.path.abspath(PROJECT_DIR + '/../realestate/'))
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTIN... | wm3ndez/realestate | testproject/manage.py | Python | bsd-2-clause | 464 |
'''
Button
======
.. image:: images/button.jpg
:align: right
The :class:`Button` is a :class:`~kivy.uix.label.Label` with associated actions
that are triggered when the button is pressed (or released after a
click/touch). To configure the button, the same properties (padding,
font_size, etc) and
:ref:`sizing syst... | rnixx/kivy | kivy/uix/button.py | Python | mit | 4,598 |
import unicodecsv as csv
import tempfile
import os
import errno
from datetime import date
class Recommendations:
STORED_RECOMMENDATIONS_FILENAME = os.path.join(tempfile.gettempdir(), 'seuraaja_recommendations_last.csv')
CSV_FIELD_NAMES = ['name', 'recommendation', 'potential', 'timestamp']
@staticmethod
d... | 2mv/seuraaja | recommendations.py | Python | isc | 2,250 |
import sh
class GitCommitMessage(object):
""" Class representing a git commit message. A commit message consists of the following:
- original: The actual commit message as returned by `git log`
- full: original, but stripped of any comments
- title: the first line of full
- body: all lines... | tobyoxborrow/gitlint | gitlint/git.py | Python | mit | 1,705 |
# -*- coding: utf-8 -*-
'''
Beacon to monitor disk usage.
.. versionadded:: 2015.5.0
:depends: python-psutil
'''
# Import Python libs
from __future__ import absolute_import
import logging
import re
# Import Third Party Libs
try:
import psutil
HAS_PSUTIL = True
except ImportError:
HAS_PSUTIL = False
log... | stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/beacons/diskusage.py | Python | apache-2.0 | 1,982 |
#!/usr/bin/python
import network
import threading
import blockchain
import code
import logging
import socket
import sys
#logging.basicConfig(format='%(name)s - %(message)s', level=logging.INFO)
chain = blockchain.BlockChain()
server = network.BitcoinServer(hosts=["127.0.0.1"], chain=chain)
server_thread = threading.T... | kokjo/pycoin | pycoin.py | Python | unlicense | 665 |
import inspect
import os
import textwrap
import types
import warnings
from .reference import Reference
from .shim import ModuleShim
class XTracebackFrame(object):
FILTER = ("__builtins__", "__all__", "__doc__", "__file__", "__name__",
"__package__", "__path__", "__loader__", "__cached__",
... | g2p/xtraceback | xtraceback/xtracebackframe.py | Python | mit | 8,655 |
"""
This is an Astropy affiliated package.
"""
# Affiliated packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import *
# --------------------------------------------------------... | hamogu/marxs | marxs/__init__.py | Python | gpl-3.0 | 536 |
short_name = "godot"
name = "Godot Engine"
major = 2
minor = 1
patch = 4
status = "beta"
| pixelpicosean/my-godot-2.1 | version.py | Python | mit | 89 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# pynag - Python Nagios plug-in and configuration environment
# Copyright (C) 2013 Pall Sigurdsson
#
# 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; e... | pynag/pynag | tests/build-test.py | Python | gpl-2.0 | 924 |
# -*- coding: utf-8 -*-
# Zeobuilder is an extensible GUI-toolkit for molecular model construction.
# Copyright (C) 2007 - 2012 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center
# for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights
# reserved unless otherwise stated.
#
# This file is part of Z... | molmod/zeobuilder | test/test_molecular.py | Python | gpl-3.0 | 20,897 |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2015, PAL Team.
# All rights reserved. See LICENSE for details.
from flask import request
from flask.ext.restful import Resource
from flask_restful_swagger import swagger
from pal.nlp.standard_nlp import StandardNLP
PRESENT_TAGS = ['VB', 'VBG', 'VBP', 'VBZ']
PA... | Machyne/pal | pal/nlp/tense_classifier.py | Python | bsd-3-clause | 1,198 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
def ou(n):
s = 0.0
if n < 2:
return 0
else:
for j in range(n, 0, -2):
s += (1.0 / j)
print j
return s
def ji(n):
s = 0.0
if n < 1:
return 0
else:
for i in range(n, 0, -2):
s ... | tomhaoye/LetsPython | practice/practice76.py | Python | mit | 510 |
from bucket_filter.bucket import Bucket
from bucket_filter.condition import ConditionType, BooleanCondition
from bucket_filter.resolver import parse, evaluate
buckets = {}
def get_bucket(expression):
key = BooleanCondition.build_key(expression)
return buckets.get(key, None)
def register_bucket(expression, e... | conlini/bucket_filters | bucket_filter/__init__.py | Python | apache-2.0 | 958 |
# -*- coding: utf-8 -*-
import os
import urllib2
import urllib
from mechanize import Browser
from bs4 import BeautifulSoup
import re
from PIL import Image
import pyimgur
favi = "/home/ozgur/mount/media/Series/Conan/ConanTheBarbarian/Conan.the.Barbarian.1982.iNTERNAL.DVDRiP.XViD.CD1-HLS.avi"
fmkv = "/home/ozgur/mount/... | obayhan/hddiyari_presentation | engine.py | Python | gpl-2.0 | 6,149 |
# ~*~ coding: utf-8 ~*~
from .callback import *
from .inventory import *
from .runner import *
from .exceptions import *
| eli261/jumpserver | apps/ops/ansible/__init__.py | Python | gpl-2.0 | 122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.