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 |
|---|---|---|---|---|---|
#! /usr/bin/env python
#
# __init__.py ---
#
# Filename: __init__.py
# Description:
# Author: Werther Zhang
# Maintainer:
# Created: Sat Oct 21 20:23:38 2017 (+0800)
#
# Change Log:
#
#
from filemanager import FileManager
| pengzhangdev/slackbot | slackbot/plugins/component/filemanager/__init__.py | Python | mit | 224 |
from datetime import datetime
import requests
from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth import user_logged_in
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.conf import settings
from foundry.models import Member
... | praekelt/jmbo-janrain | janrain/models.py | Python | bsd-3-clause | 5,684 |
from setuptools import setup, find_packages
import os
HERE = os.path.abspath(os.path.dirname(__file__))
def get_long_description():
dirs = [HERE]
if os.getenv("TRAVIS"):
dirs.append(os.getenv("TRAVIS_BUILD_DIR"))
long_description = ""
for d in dirs:
rst_readme = os.path.join(d, "REA... | deep-compute/funcserver | setup.py | Python | mit | 1,512 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-14 16:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20170614_1607'),
('paypal', '0001... | django-danceschool/django-danceschool | danceschool/payments/paypal/migrations/0002_auto_20170614_1607.py | Python | bsd-3-clause | 2,443 |
"""Support for Brunt Blind Engine covers."""
from __future__ import annotations
from collections.abc import MutableMapping
import logging
from typing import Any
from aiohttp.client_exceptions import ClientResponseError
from brunt import BruntClientAsync, Thing
from homeassistant.components.cover import (
ATTR_PO... | jawilson/home-assistant | homeassistant/components/brunt/cover.py | Python | apache-2.0 | 6,797 |
from rig.place_and_route import Cores, SDRAM
import struct
from nengo_spinnaker.builder.ports import InputPort
from nengo_spinnaker.builder.netlist import netlistspec
from nengo_spinnaker.netlist import Vertex
from nengo_spinnaker.regions import Region
from nengo_spinnaker.regions.filters import make_filter_regions
fr... | project-rig/nengo_spinnaker | nengo_spinnaker/operators/sdp_transmitter.py | Python | mit | 3,555 |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 18 10:21:22 2016
@author: Wasit
"""
import numpy as np
import cv2
import os
cmax=800
rmax=600
dataset_path=os.path.join('dataset')
r=5
cmap=np.array([
( 0 , 255, 255, ),
( 64 , 177, 255, ),
( 94 , 210, 94 , ),
( 40 , 39 , 214, ),
... | wasit7/algae2 | shrimp/beta/marker/algae_mark.py | Python | gpl-2.0 | 3,445 |
# Copyright 2019 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | jesseengel/magenta | magenta/pipelines/pipeline_test.py | Python | apache-2.0 | 8,715 |
class Solution:
# @param A a list of integers
# @param m an integer, length of A
# @param B a list of integers
# @param n an integer, length of B
# @return nothing
def merge(self, A, m, B, n):
A[:] = sorted(A[:m] + B[:n])
| rahul-ramadas/leetcode | merge-sorted-array/Solution.6603525.py | Python | mit | 266 |
# 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... | TheNeuralBit/arrow | integration/integration_test.py | Python | apache-2.0 | 21,106 |
###############################################################################
# Name: ed_mdlg.py #
# Purpose: Commonly used message dialogs #
# Author: Cody Precord <cprecord@editra.org> ... | ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/tools/Editra/src/ed_mdlg.py | Python | mit | 7,259 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | KhronosGroup/COLLADA-CTS | StandardDataSets/collada/library_visual_scenes/visual_scene/node/_reference/_reference_node_translate_xyz_cube/_reference_node_translate_xyz_cube.py | Python | mit | 3,826 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-19 07:40
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 = [
('practiceapp', '0009_auto_20... | MrHarigo/StudyConfirmationProject | StudyConfirmationProject/practiceapp/migrations/0010_auto_20160819_1040.py | Python | apache-2.0 | 1,103 |
#MenuTitle: Enable alignment for selected glyphs
# -*- coding: utf-8 -*-
__doc__="""
Enables automatic alignment for all components in all selected glyphs. (The opposite to makkablue's Enable alignment for selected glyphs)
"""
import GlyphsApp
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def process( this... | juandelperal/glyphsScripts | Utils/Enable alignment.py | Python | mit | 596 |
"""Test queues inspection SB APIs."""
from __future__ import print_function
import unittest2
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestQueues(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUn... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/macosx/queues/TestQueues.py | Python | bsd-3-clause | 17,019 |
import json
import requests
import base64
from . import check_input_attribute, checking_error, standard_error_message
from pymisp import MISPEvent, MISPObject
from urllib.parse import quote
moduleinfo = {'version': '1.0',
'author': 'Ben Verschaeren',
'description': 'SOPHOSLabs Intelix Integ... | VirusTotal/misp-modules | misp_modules/modules/expansion/sophoslabs_intelix.py | Python | agpl-3.0 | 6,396 |
import os
import random
import unittest
import requests
import json
import datetime
from app.config import basedir
from app import create_app, db
from app import models
from app import config
class TestCase(unittest.TestCase):
def setUp(self):
self.app = create_app(config.TestingConfig)
self.c... | johnrbnsn/Template_FlaskMarshmallowSQLAlchemy | api/tests.py | Python | mit | 2,021 |
import importlib
from importlib import _bootstrap
from .. import abc
from .. import util
from . import util as source_util
import imp
import marshal
import os
import py_compile
import shutil
import stat
import sys
import unittest
from test.support import make_legacy_pyc
class SimpleTest(unittest.TestCase):
"""... | invisiblek/python-for-android | python3-alpha/python3-src/Lib/importlib/test/source/test_file_loader.py | Python | apache-2.0 | 16,111 |
import urllib.request
import glob
def download_from_url(url, block_size=8192, location=""):
file_name = "files/" + url.split('/')[-1]
u = urllib.request.urlopen(url)
file_stream = open(file_name, 'wb')
print(u.info()._headers)
while True:
buffer = u.read(block_size)
if not buffer:
... | gharizanov92/Organizer | utils/io.py | Python | mit | 1,720 |
"""
This is the Advanced Generic Widgets package (AGW). It provides many
custom-drawn wxPython controls: some of them can be used as a replacement
of the platform native controls, others are simply an addition to the
already rich wxPython widgets set.
Description:
AGW contains many different modules, listed belo... | beiko-lab/gengis | bin/Lib/site-packages/wx-2.8-msw-unicode/wx/lib/agw/__init__.py | Python | gpl-3.0 | 5,945 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# saltytools.py
#
# Copyright 2015 gkmcd <saltystats@tuta.io>
#
# 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 Licen... | gkmcd/salty-stats | saltytools.py | Python | gpl-2.0 | 9,133 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('calendars', '0020_auto_20151104_1112'),
]
operations = [
migrations.RemoveField(
model_name='event',
... | Fisiu/calendar-oswiecim | webapp/calendars/migrations/0021_auto_20151121_1625.py | Python | agpl-3.0 | 572 |
# -*- encoding: utf8 -*-
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2017 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# ... | woju/qubes-core-admin | qubespolicy/graph.py | Python | lgpl-2.1 | 4,395 |
import sys
import random
def main():
rows = int(sys.argv[1]) if len(sys.argv) > 1 else 10
cols = int(sys.argv[2]) if len(sys.argv) > 2 else 10
queries = int(sys.argv[3]) if len(sys.argv) > 3 else 0
mode = int(sys.argv[4]) if len(sys.argv) > 4 else 0 # likelynes to repeat same
print(rows, cols)
... | rvrheenen/OpenKattis | Java/10kindsofpeople/make_test.py | Python | mit | 1,131 |
# Copyright 2018 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/loaner | loaner/web_app/backend/actions/send_welcome.py | Python | apache-2.0 | 1,342 |
# Authors: Jonas Thiem
import re
from gi.repository import Gtk, GObject, Pango
from pychess.System import uistuff
from pychess.System.glock import glock_connect
from pychess.System.Log import log
from pychess.System.prefix import addDataPrefix
from pychess.Utils.const import ARTIFICIAL
__title__ = _("Engines")
__... | importsfromgooglecode/pychess | sidepanel/engineOutputPanel.py | Python | gpl-3.0 | 15,439 |
from codecs import open
import os
from setuptools import setup, find_packages
ROOT = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(ROOT, 'VERSION')) as f:
VERSION = f.read().strip()
setup(
name='supervisor-confator',
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
... | alexhayes/supervisor-confator | setup.py | Python | mit | 1,557 |
#!/usr/bin/env python3
# Copyright (c) 2008-9 Qtrac Ltd. All rights reserved.
# This program or module 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
# version 3 of the Lic... | paradiseOffice/Bash_and_Cplus-plus | CPP/full_examples/pyqt/chap08/addeditmoviedlg_ans.py | Python | gpl-2.0 | 3,155 |
"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | adustm/mbed | tools/build_api.py | Python | apache-2.0 | 61,089 |
#**********************************************************************************************#
#********* Return the top most group name of an object ****************************************#
#********* by Djordje Spasic ******************************************************************#
#********* issworld2000@yahoo... | stgeorges/pythonscripts | objectTopGroup.py | Python | unlicense | 1,167 |
# Copyright 2005 Duke University
# Copyright (C) 2012-2015 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later versi... | shaded-enmity/dnf | dnf/base.py | Python | gpl-2.0 | 72,096 |
import asyncio
async def hello_world():
print("Hello World")
return 42
hello_world_coroutine = hello_world()
print(hello_world_coroutine)
event_loop = asyncio.get_event_loop()
try:
print("entering event loop")
result = event_loop.run_until_complete(hello_world_coroutine)
print(result)
finally:... | zzsza/TIL | python/asyncio-helloy.py | Python | mit | 343 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import numpy as np
def matrix_test():
a = np.matrix([[1,4,3],[6,3,8],[-1,5,3]])
print a
print a.shape
print a.T
print a.A
print a.A1
print np.linalg.det(a) #hang lie shi
print np.linalg.det(a.T)
print np.linalg.matrix_rank(a)
print a.I... | AgainstWind/python-demos | mathematics/linear_algebra_test.py | Python | apache-2.0 | 335 |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | brechtm/rinohtype | tests_regression/sphinx/test-twotargets/conf.py | Python | agpl-3.0 | 2,445 |
import os
import sys
root_path = os.path.abspath("../../../")
if root_path not in sys.path:
sys.path.append(root_path)
import numpy as np
import tensorflow as tf
from _Dist.NeuralNetworks.Base import Generator4d
from _Dist.NeuralNetworks.h_RNN.RNN import Basic3d
from _Dist.NeuralNetworks.NNUtil import Activations... | carefree0910/MachineLearning | _Dist/NeuralNetworks/i_CNN/CNN.py | Python | mit | 3,860 |
"""Site-specific content, templatetags and such.""" | JamesJGarner/cms | src/cms/project_template/project_name/apps/site/__init__.py | Python | bsd-3-clause | 51 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Youtubedlg module for managing the download process.
This module is responsible for managing the download process
and update the GUI interface.
Attributes:
MANAGER_PUB_TOPIC (string): wxPublisher subscription topic of the
DownloadManager thread.
WORK... | Sofronio/youtube-dl-gui | youtube_dl_gui/downloadmanager.py | Python | unlicense | 23,289 |
"""
Classes for representing hierarchical data
"""
import json
import logging
import sys
from neoteric.util.compat import NoneType
from neoteric.util.debug import get_caller
from neoteric.util.files import read_file, write_file
from neoteric.util.json_util import json_format
from neoteric.util.type import type_as... | j3ffhubb/neoteric | neoteric/resource/hdata.py | Python | gpl-3.0 | 2,297 |
# 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... | tqchen/tvm | python/tvm/topi/nn/winograd_util.py | Python | apache-2.0 | 6,191 |
from django.db import models
from django.contrib.auth.models import User
from django.template import loader, Context
# There can be basically infinite hierarchy of categories
class Category(models.Model):
""" A Category for Skills
"""
name = models.CharField(max_length=50)
description = models.CharFie... | CSXM/laborbook | siteapp/models.py | Python | gpl-2.0 | 3,513 |
"""Leecode 482. License Key Formatting
Easy
URL: https://leetcode.com/problems/license-key-formatting/
You are given a license key represented as a string S which consists only
alphanumeric character and dashes. The string is separated into N+1 groups
by N dashes.
Given a number K, we would want to reformat the stri... | bowen0701/algorithms_data_structures | lc0482_license_key_formatting.py | Python | bsd-2-clause | 3,662 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'URLChangeRecord.old_url'
db.alter_column('url_tracker_urlchangerecord', 'old_url', self.g... | elbaschid/django-url-tracker | url_tracker/migrations/0005_auto__chg_field_urlchangerecord_old_url__chg_field_urlchangerecord_new.py | Python | bsd-3-clause | 1,609 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _
from odoo.http import route, request
from odoo.osv import expression
from odoo.addons.mass_mailing.controllers.main import MassMailController
class MassMailController(MassMailController):
@route... | rven/odoo | addons/website_mass_mailing/controllers/main.py | Python | agpl-3.0 | 4,228 |
#exercise 11 - asking questions
print "How old are you?",
age = raw_input()
print "How tall are you?",
height = raw_input()
print "How much do you weigh?",
weight = raw_input()
print "So, you're %r old, %r tall and %r heavy." % (age, height, weight)
print | UWPCE-PythonCert/IntroPython2016 | students/sheree/session_02/homework/LPTHW-EXC-11.py | Python | unlicense | 261 |
# -*- coding: utf-8 -*-
#
# sphinx-tests documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 10 13:50:13 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | leftxs/sphinx-tests | docs/conf.py | Python | gpl-2.0 | 9,185 |
# 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/compute/drivers/vsphere.py | Python | apache-2.0 | 78,343 |
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url('^server.html$', views.commonplace, {'repo': 'fireplace'},
name='commonplace.fireplace'),
url('^comm/thread/(?P<thread_id>\d+)$', views.commonplace, {'repo': 'commbadge'},
name='commonplace.commbadge... | Joergen/zamboni | mkt/commonplace/urls.py | Python | bsd-3-clause | 655 |
# 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... | nuagenetworks/nuage-openstack-neutron | nuage_neutron/db/migration/alembic_migrations/versions/newton/expand/b05bd74f4cc7_add_nuage_config.py | Python | apache-2.0 | 2,072 |
import json
import uuid
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.core.cache import cache
from rest_framework.test import APITestCase
from rest_framework.exceptions import ValidationError
from model_mommy import mommy
from ..models import (
County,
... | urandu/mfl_api | common/tests/test_views.py | Python | mit | 18,078 |
from decouple import config
from unipath import Path
import dj_database_url
PROJECT_DIR = Path(__file__).parent
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', default=False, cast=bool)
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.... | Stegallo/django | website/settings.py | Python | mit | 3,178 |
#!/usr/bin/python
import sys
import os
username="#DEFINEME"
ff='/home//.todorepo/%s'
fdir='/home/' + username + '/.todorepo'
class TaskList(object):
def __init__(self):
self.tasks=list()
if not(os.path.isdir(fdir)):
os.mkdir(fdir)
def loadTasks(self):
if os.path.exists(ff%'cur.todo'):
curto... | fredsmithjr/de-scripts | pytasks.py | Python | gpl-2.0 | 1,160 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import binascii
import evernote.edam.userstore.constants as UserStoreConstants
from evernote.edam.notestore.ttypes import NoteFilter
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient
# Sandbox: https://sandbox.evernot... | Doingcast/bizmem | tip.py | Python | mit | 2,785 |
# Copyright 2014 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... | Chilledheart/chromium | tools/telemetry/third_party/gsutilz/third_party/gcs-oauth2-boto-plugin/gcs_oauth2_boto_plugin/oauth2_client.py | Python | bsd-3-clause | 27,433 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of kryptomime, a Python module for email kryptography.
# Copyright © 2013,2014 Thomas Tanner <tanner@gmx.net>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published ... | ttanner/kryptomime | setup.py | Python | lgpl-3.0 | 3,207 |
# Generated by Django 2.2.5 on 2019-09-14 07:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('groups', '0039_group_theme'),
]
operations = [
migrations.AlterField(
model_name='group',
name='theme',
... | yunity/foodsaving-backend | karrot/groups/migrations/0040_auto_20190914_0724.py | Python | agpl-3.0 | 479 |
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.arrays import BooleanArray
from pandas.core.arrays.boolean import coerce_to_array
def test_boolean_array_constructor():
values = np.array([True, False, True, False], dtype="bool")
mask = np.array([False, False, Fals... | jorisvandenbossche/pandas | pandas/tests/arrays/boolean/test_construction.py | Python | bsd-3-clause | 12,897 |
#
# 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... | mway08/thrift | test/crossrunner/test.py | Python | apache-2.0 | 4,187 |
# -*- coding: utf8 -*-
"""
KARN voting app in Google App Engine
Copyright (C) 2014 Klubb Alfa Romeo Norge <webmaster@klubbalfaromeo.no>
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 Foundat... | KlubbAlfaRomeoNorge/voting | bestealfa.py | Python | gpl-2.0 | 9,434 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | xsm110/Apache-Beam | sdks/python/apache_beam/transforms/util_test.py | Python | apache-2.0 | 1,749 |
# -*- coding: utf-8 -*-
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "New API for Timesheet Analytic Line Onchange",
"version": "8.0.1.1.0",
"website": "https://simetri-sinergi.id",
"author... | open-synergy/opnsynid-hr | hr_timesheet_onchange/__openerp__.py | Python | agpl-3.0 | 617 |
# 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 ... | NexusIS/libcloud | libcloud/loadbalancer/types.py | Python | apache-2.0 | 2,298 |
#!/usr/bin/env python
# -*- mode: python -*-
#
# Copyright (C) 2008 Hartmut Goebel <h.goebel@goebel-consult.de>
# Licence: GNU General Public License version 3 (GPL v3)
#
# This file is part of PyInstaller <http://www.pyinstaller.org>
#
# pyinstaller is free software: you can redistribute it and/or modify
# it under th... | supercheetah/diceroller | pyinstaller/buildtests/import/test_onefile_zipimport.py | Python | artistic-2.0 | 1,296 |
from unittest import TestCase
from grail import step
from tests.utils import validate_method_output
import grail.settings as settings
import grail.state as state
@step
def simple_step():
pass
@step(pending=True)
def pending_step():
pass
@step(description='Some Description')
def step_with_description():
... | wgnet/grail | tests/test_export.py | Python | apache-2.0 | 2,316 |
import threading
import time
import cv2
import config
# Rate at which the webcam will be polled for new images.
CAPTURE_HZ = 30.0
class OpenCVCapture(object):
def __init__(self, device_id=0):
"""Create an OpenCV capture object associated with the provided webcam
device ID.
"""
# Open the camera.
self._... | MayurRocks/haims-project | webcam.py | Python | gpl-3.0 | 1,456 |
# A very basic settings file that allows Sphinx to build
# the docs (this is becuase autodoc is used).
import os
import sys
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))
SITE_ID = 303
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {"default": {
"NAME": ":memory:",
"... | mazelife/django-scaffold | docs/settings.py | Python | bsd-3-clause | 698 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from imagekit.imagecache import PessimisticImageCacheBackend, InvalidImageCacheBackendError
def generate(model, pk, attr):
try:
instance = model._default_manager.get(pk=pk)
except model.DoesNotExist:
pass # The model was deleted ... | pcompassion/django-imagekit | imagekit/imagecache/celery.py | Python | bsd-3-clause | 1,730 |
from django.shortcuts import resolve_url as r
from django.test import TestCase
class HomeTest(TestCase):
def setUp(self):
self.response = self.client.get(r('core:home'))
def test_get(self):
self.assertEqual(200, self.response.status_code)
def test_template(self):
"""Must use core... | tyagow/FacebookBot | src/core/tests_core/test_view.py | Python | mit | 400 |
from novaclient import exceptions
from novaclient.v1_1 import security_group_rules
from novaclient.tests import utils
from novaclient.tests.v1_1 import fakes
cs = fakes.FakeClient()
class SecurityGroupRulesTest(utils.TestCase):
def test_delete_security_group_rule(self):
cs.security_group_rules.delete(1)... | tylertian/Openstack | openstack F/python-novaclient/novaclient/tests/v1_1/test_security_group_rules.py | Python | apache-2.0 | 2,485 |
#!/usr/bin/env python
import argparse, collections, math
import nltk.corpus, nltk.corpus.reader, nltk.data, nltk.tag, nltk.metrics
from nltk.corpus.util import LazyCorpusLoader
from nltk_trainer import load_corpus_reader, load_model, simplify_wsj_tag
from nltk_trainer.chunking import chunkers
from nltk_trainer.chunking... | japerk/nltk-trainer | analyze_chunker_coverage.py | Python | apache-2.0 | 3,938 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... | hjoliver/cylc | cylc/flow/option_parsers.py | Python | gpl-3.0 | 16,598 |
#!/usr/bin/env python
# se_config.py - contains configuration information
#
# Copyright (c) 2016,2020 Casey Bartlett <caseytb@bu.edu>
#
# See LICENSE for terms of usage, modification and redistribution.
from os.path import join
home = "/home/botuser"
install_directory = join(home,"knife_scraper")
| Uname-a/knife_scraper | se_config.py | Python | mit | 303 |
# Copyright (c) 2016-present, Facebook, 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... | davinwang/caffe2 | caffe2/python/layers/sparse_feature_hash.py | Python | apache-2.0 | 3,959 |
import traceback
class Watcher(object):
def __init__(self, obj=None, attr=None, log_file='log.txt', include=[], enabled=True):
"""
Debugger that watches for changes in object attributes
obj - object to be watched
attr - string, name of attribute
log_file - st... | pexnet/poxlibpacket | poxlibpacket/lib/packet/watcher.py | Python | apache-2.0 | 2,268 |
# Tools for working with modern DreamMaker icon files (PNGs + metadata)
import math
from PIL import Image
from PIL.PngImagePlugin import PngInfo
DEFAULT_SIZE = 32, 32
LOOP_UNLIMITED = 0
LOOP_ONCE = 1
NORTH = 1
SOUTH = 2
EAST = 4
WEST = 8
SOUTHEAST = SOUTH | EAST
SOUTHWEST = SOUTH | WEST
NORTHEAST = NORTH | EAST
NORT... | Cruix/-tg-station | tools/dmi/__init__.py | Python | agpl-3.0 | 7,556 |
# Copyright 2016 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | yaybu/touchdown | touchdown/tests/fixtures/ssh_connection.py | Python | apache-2.0 | 2,710 |
import sys
def count_length(input_file, output_file):
input_handle = open(input_file, 'rU')
output_handle = open(output_file, "w")
for line in input_handle:
line = line.strip().split()
line_type = line[0]
if line_type != 'S':
break
e_id = line[1]
e_... | snurk/meta-strains | scripts/scripts_for_desman/edges_lengths.py | Python | mit | 545 |
from shardgather.renderers import (
render_plain, render_table, render_csv)
collected = {
'live': [{'a': 1}],
}
def test_render_plain():
result = render_plain(collected)
expected = (
"Total: 1\n"
"----------------------------------------------------------------\n"
"{'live': [... | kevinjqiu/shardgather | tests/test_renderers.py | Python | bsd-3-clause | 781 |
"""Test coils."""
from mpf.platforms.interfaces.driver_platform_interface import PulseSettings, HoldSettings
from mpf.tests.MpfTestCase import MpfTestCase
from unittest.mock import MagicMock
class TestDeviceDriver(MpfTestCase):
def get_config_file(self):
return 'coils.yaml'
def get_machine_path(sel... | missionpinball/mpf | mpf/tests/test_DeviceDriver.py | Python | mit | 4,266 |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2014 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | grantjenks/pyannote-core | pyannote/core/__init__.py | Python | mit | 1,810 |
#
# Copyright (c) Dariusz Biskup
#
# This file is part of Spotlight
#
# Spotlight 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 ve... | oikarinen/plugin.audio.spotlight | spotlight/service/command/Search.py | Python | gpl-3.0 | 1,404 |
#!/usr/bin/env python
"""A simple example demonstrating how one can use numpy arrays
transparently with TVTK.
"""
# Author: Prabhu Ramachandran and Eric Jones
# Copyright (c) 2004-2007, Enthought, Inc.
# License: BSD Style.
from tvtk.api import tvtk
from tvtk.common import configure_input_data
from numpy import arr... | nicjhan/mom-particles | vtk/tiny_mesh.py | Python | gpl-2.0 | 2,212 |
# Copyright 2022 The Kubric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | google-research/kubric | test/test_cameras.py | Python | apache-2.0 | 1,140 |
from __future__ import absolute_import
import itertools
import uuid
from textile import textile_restricted
from django.db import models
from django.dispatch import receiver
from django.urls import reverse
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from... | ox-it/talks.ox | talks/users/models.py | Python | apache-2.0 | 10,534 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def extract(text, start, end):
if start == 0:
sindex = 0
else:
s = text.find(start)
sindex = s + len(start)
if end == -1:
return text[sindex:]
else:
e = text.find(end, sindex)
return text[sindex:e]
def extr... | damonchen/chan | chan/utils/extract.py | Python | bsd-2-clause | 576 |
import os
import tempfile
from kripodb.hdf5 import SimilarityMatrix
from kripodb.frozen import FrozenSimilarityMatrix
def tmpname():
tmpf = tempfile.NamedTemporaryFile()
out_file = tmpf.name
tmpf.close()
return out_file
class SimilarityMatrixInMemory(object):
def __init__(self):
self.ma... | 3D-e-Chem/python-modified-tanimoto | tests/utils.py | Python | apache-2.0 | 1,185 |
# -*- coding: utf-8 -*-
# vim: ts=4
###
#
# Copyright (c) 2009-2011 J. Félix Ontañón
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation
#
# This program is distributed in the hope that i... | GNOME/wiican | wiican/__init__.py | Python | gpl-3.0 | 1,252 |
#!/usr/bin/env python
# Copyright (C) 2013 Equinor ASA, Norway.
#
# The file 'test_options_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,... | Statoil/libres | python/tests/res/analysis/test_options_enum.py | Python | gpl-3.0 | 1,013 |
import magic
import os
import re
from gzip import GzipFile
from tarfile import TarFile
from django.apps import apps
PACKAGE_INFO_REGISTRY = []
def infoDetect( target_file ):
magic_helper = magic.open( 0 )
magic_helper.load()
for info in PACKAGE_INFO_REGISTRY:
result = info.detect( target_file, magic_help... | Virtustream-OSS/packrat | packrat/Repos/PackageInfo.py | Python | apache-2.0 | 6,231 |
#!/usr/bin/env python
import rospy
import actionlib
from strands_executive_msgs.msg import Task
from strands_executive_msgs import task_utils
from task_executor.msg import *
from topological_navigation.msg import GotoNodeAction
from task_executor import task_routine
from datetime import *
from threading import Thread
... | bfalacerda/strands_executive | task_executor/scripts/task_routine_node.py | Python | mit | 2,689 |
from django.core.urlresolvers import reverse
from mappings.tests import MappingBaseTest
from mappings.validation_messages import OPENMRS_SINGLE_MAPPING_BETWEEN_TWO_CONCEPTS
from oclapi.models import CUSTOM_VALIDATION_SCHEMA_OPENMRS
from test_helper.base import create_user, create_source, create_concept
class OpenMRS... | ayseyo/oclapi | django-nonrel/ocl/integration_tests/tests/openmrs_mapping_validation.py | Python | mpl-2.0 | 1,429 |
# -*- coding: utf-8 -*-
from .env import *
from amoco.arch.core import Formatter
def mnemo(i):
return i.mnemonic.lower().ljust(8, " ")
def op0(i):
return str(i.operands[0])
def rel0(i):
return "*%s" % i.misc["to"]
def op1(i):
return ", " + str(i.operands[1])
def dest1(i):
return ", %s" % ... | LRGH/amoco | amoco/arch/pic/F46K22/formats.py | Python | gpl-2.0 | 1,399 |
#!/usr/bin/env python
# Copyright 2021 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... | googleapis/python-dialogflow | samples/snippets/participant_management.py | Python | apache-2.0 | 4,681 |
"""
WSGI config for jmp project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` sett... | exarch/massive-sansa | jmp/jmp/wsgi.py | Python | agpl-3.0 | 1,410 |
# -*- coding: utf-8 -*-
###############################################################################
#
# SearchUsers
# Allows you to search for users by name.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this ... | jordanemedlock/psychtruths | temboo/core/Library/Instagram/SearchUsers.py | Python | apache-2.0 | 3,764 |
from __future__ import print_function
from sympy import symbols, sin, cos
from galgebra.ga import Ga
from galgebra.printer import Format, xpdf, Eprint, Print_Function, Get_Program
def main():
Print_Function()
(a, b, c) = abc = symbols('a,b,c',real=True)
(o3d, ea, eb, ec) = Ga.build('e_a e_b e_c', g=[1, 1... | arsenovic/galgebra | examples/LaTeX/diffeq_sys.py | Python | bsd-3-clause | 989 |
from collections import defaultdict
import logging
from django.http import HttpResponse
from typepad import TypePadObject
from typepadapp.models.users import User
from makeaface.models import Favoriteface, Lastface
from makeaface.views import oops
log = logging.getLogger(__name__)
def all_items(source):
"""Ge... | markpasc/make-a-face | makeaface/makeaface/backface.py | Python | mit | 3,250 |
#!/usr/bin/python
import os
import koam
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class KoamMainWindow(QMainWindow):
def __init__(self, koamwidget, controller, parent=None):
QMainWindow.__init__(self, parent)
self.setCentralWidget(koamwidget)
self.controller = controller
... | lmiphay/gentoo-koam | koam/mainwindow.py | Python | gpl-2.0 | 545 |
from django import forms
from .models import Reimbursement
class ReimbursementForm(forms.ModelForm):
class Meta:
model = Reimbursement
# Add CSS class 'form-control' to all fields to allow styling
widgets = {
'explanation': forms.TextInput(attrs={'class': 'form-control'}),
... | amacnair/team-toolkit | clubbr/reimbursement/forms.py | Python | mit | 702 |
import random
"""
Recieve a hello command
"""
def recv(channel, person, arguments):
exclaim_responses = ["hey", "hi", "hello"]
question_responses = ["sup", "how are you", "how's it going"]
responses = []
punct = ""
if (random.choice([1, 2]) == 1):
punct = "!"
responses = exclaim_responses
else:
punct = "?... | SkylarKelty/pyirc | src/commands/hello.py | Python | mit | 454 |
###############################################################################
#
# 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... | meejah/AutobahnPython | examples/twisted/websocket/echo/client_coroutines.py | Python | mit | 2,668 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.