text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
TIPOS_MENSAJES = {
'entrada': "entrada",
'salida': "salida",
'pago_ticket': "pago de ticket",
}
MENSAJES = {
'entrada': "Se ha reportado en el sistema una entrada ",
'salida': "salida",
'pago_ticket': "pago de ticket",
}
def
| ac-seguridad/ac-seguridad | project/manejador/mensajes.py | Python | apache-2.0 | 256 | 0.003906 |
# Copyright 2020 Makani Technologies 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... | google/makani | avionics/motor/monitors/motor_ina219.py | Python | apache-2.0 | 2,535 | 0 |
import csv
import sys
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
def parse(file_name):
"Parses the data sets from the csv file we are given to work with"
try:
file = open(file_name)
except IOError:
print "Failed to open the data file"
sys.exit()
... | GZakharov1525/SOFE3770 | Assignment2/plot_lines.py | Python | gpl-3.0 | 2,119 | 0.003303 |
#!/usr/bin/env python3
"""*.h5 の値の最小・最大などを確認するスクリプト。"""
import argparse
import pathlib
import sys
import h5py
import numpy as np
try:
import pytoolkit as tk
except ImportError:
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent.parent))
import pytoolkit as tk
logger = tk.log.get(__name... | ak110/pytoolkit | pytoolkit/bin/h5ls.py | Python | mit | 1,745 | 0.001826 |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS 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 json
import mox
import os
import sys
import shutil
import time
import constants
sys.path.insert(0, constants.SOURCE_ROOT)
f... | espadrine/opera | chromium/src/third_party/chromite/buildbot/remote_try_unittest.py | Python | bsd-3-clause | 7,349 | 0.006668 |
'''
base tools
'''
# -*- coding: utf-8 -*-
import re
def is_ipv4(ip) :
pattern = r'^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$'
matcher = re.match(pattern, ip)
if matcher is not None :
return True
return False
def is_domain(domain) :
... | allen1989127/WhereRU | org/sz/tools.py | Python | gpl-3.0 | 508 | 0.015748 |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Set up paths for Fast R-CNN."""
import os.path as osp
import sys
d... | yxliang/fast-rcnn | tools/_init_paths.py | Python | mit | 637 | 0.00314 |
from asyncio import coroutine
import pytest
from aiohttp import HttpBadRequest, HttpMethodNotAllowed
from fluentmock import create_mock
from aiohttp_rest import RestEndpoint
class CustomEndpoint(RestEndpoint):
def get(self):
pass
def patch(self):
pass
@pytest.fixture
def endpoint():
r... | atbentley/aiohttp-rest | tests/test_endpoint.py | Python | mit | 2,542 | 0.003541 |
# coding=utf-8
import logging
import time
from adapter import Adapter
DROIDBOT_APP_PACKAGE = "io.github.ylimit.droidbotapp"
IME_SERVICE = DROIDBOT_APP_PACKAGE + "/.DroidBotIME"
class DroidBotImeException(Exception):
"""
Exception in telnet connection
"""
pass
class DroidBotIme(Adapter):
"""
... | nastya/droidbot | droidbot/adapter/droidbot_ime.py | Python | mit | 3,282 | 0.000612 |
# postgresql/json.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
import json
import collections
from .base... | fernandog/Medusa | ext/sqlalchemy/dialects/postgresql/json.py | Python | gpl-3.0 | 9,821 | 0.000204 |
# This file is part of Radicale - CalDAV and CardDAV server
# Copyright © 2008 Nicolas Kandel
# Copyright © 2008 Pascal Halter
# Copyright © 2008-2017 Guillaume Ayoub
# Copyright © 2017-2018 Unrud <unrud@outlook.com>
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GN... | Kozea/Radicale | radicale/app/options.py | Python | gpl-3.0 | 1,395 | 0 |
try:
import unittest2 as unittest # Python2.6
except ImportError:
import unittest
from tests.functional import test_base
@unittest.skipIf(test_base.get_test_server_api() == 1,
"The tag API didn't work at v1 - see frontend issue #927")
class TestTags(test_base.TestBase):
testcase_name = "t... | photo/openphoto-python | tests/functional/test_tags.py | Python | apache-2.0 | 3,889 | 0.000771 |
from Tkinter import *
import tkMessageBox
from functools import partial
import os
import sys
import hashlib
import gzip
class niUpdater:
def __init__(self, parent):
self.myParent = parent
self.topContainer = Frame(parent)
self.topContainer.pack(side=TOP, expand=1, fill=X, anchor=NW)
self.btmContainer = Frame(... | Naozumi/hashgen | ni_hashGen.py | Python | mit | 3,412 | 0.036928 |
import copy
import resource
import sys
import traceback
import unittest
import mock
import numpy as np
import sklearn.datasets
import sklearn.decomposition
import sklearn.ensemble
import sklearn.svm
from sklearn.utils.testing import assert_array_almost_equal
from HPOlibConfigSpace.configuration_space import Configura... | hmendozap/auto-sklearn | test/test_pipeline/test_regression.py | Python | bsd-3-clause | 18,360 | 0.000926 |
import os
import ycm_core
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-pedantic',
'-std=c++1y',
#'-stdlib=libc++',
'-x',
'c++',
'-Iinclude',
'-Itest/include',
'-Ilib/jest/include',
'-isystem',
'../BoostParts',
'-isystem',
'/System/Library/Frameworks/Python.framework/Headers',
'-isystem',
'../llvm/include',
'-isystem',
... | jeaye/jeayeson | .ycm_extra_conf.py | Python | bsd-3-clause | 3,051 | 0.041298 |
from __future__ import absolute_import
import numpy as np
import conf
from time import sleep
from functools import reduce
from hardware.robot.modules.motor_math import get_triangular_direction_vector
from hardware.robot.modules.com import send_encoder_steps_and_speed
##
## This is the code that instructs how to get fr... | ut-ras/robotticelli | src/hardware/robot/run-real.py | Python | lgpl-3.0 | 3,189 | 0.007839 |
# -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster
class CyberlockerCh(DeadHoster):
__name__ = "CyberlockerCh"
__type__ = "hoster"
__version__ = "0.06"
__status__ = "stable"
__pattern__ = r'http://(?:www\.)?cyberlocker\.ch/\w+'
__config__ = [] #@TODO: ... | manuelm/pyload | module/plugins/hoster/CyberlockerCh.py | Python | gpl-3.0 | 485 | 0.014433 |
'''
A secret file with data that we can use in unit tests without needing to
clutter up that file with a bunch of raw data structures.
'''
from datetime import datetime
SEARCH_TEST_DATA = [
{
"created" : datetime(2015, 10, 1),
"published": datetime(2015, 10, 1),
"edited": datet... | bgporter/wastebook | testData/postTestData.py | Python | mit | 1,496 | 0.004679 |
# Projection 1D2D
# Project triangles from one meshed face to another mesh on the same box
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)... | FedoraScientific/salome-smesh | doc/salome/examples/defining_hypotheses_ex11.py | Python | lgpl-2.1 | 1,063 | 0.01223 |
# From CPython 2.5.1
import sys
import os
import unittest
from array import array
from weakref import proxy
from test.test_support import TESTFN, findfile, is_jython, run_unittest
from UserList import UserList
class AutoFileTests(unittest.TestCase):
# file tests for which a test file is automatically set up
... | babble/babble | include/jython/Lib/test/test_file.py | Python | apache-2.0 | 13,201 | 0.000985 |
import os
import logging
from pdb import pm
from elfesteem import pe
from miasm2.analysis.sandbox import Sandbox_Win_x86_32
from miasm2.core import asmbloc
filename = os.environ.get('PYTHONSTARTUP')
if filename and os.path.isfile(filename):
execfile(filename)
# User defined methods
def kernel32_GetProcAddress(j... | amohanta/miasm | example/jitter/unpack_upx.py | Python | gpl-2.0 | 3,028 | 0.000661 |
"""
Extensible permission system for pybbm
"""
from django.db.models import Q
from pybb import defaults
from pybb.models import Topic, PollAnswerUser
from pybb.permissions import DefaultPermissionHandler
class CustomPermissionHandler(DefaultPermissionHandler):
"""
Custom Permission handler for PyBB.
In... | ugoertz/django-familio | accounts/permissions.py | Python | bsd-3-clause | 6,670 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# feeluown documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 2 20:55:54 2015.
#
# 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
# a... | JanlizWorldlet/FeelUOwn | sphinx_doc/source/conf.py | Python | mit | 9,220 | 0.005965 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-04-11 10:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hkm', '0018_auto_20170411_1301'),
]
operations = [
migrations.AddField(
... | andersinno/kuvaselaamo | hkm/migrations/0019_productorder_total_price_with_postage.py | Python | mit | 554 | 0.001805 |
# -*- coding: utf-8 -*-
"""
flaskbb.forum.forms
~~~~~~~~~~~~~~~~~~~
It provides the forms that are needed for the forum views.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from flask_wtf import Form
from wtforms import (TextAreaField, StringField, Sele... | realityone/flaskbb | flaskbb/forum/forms.py | Python | bsd-3-clause | 3,976 | 0 |
from django.utils.translation import ugettext as _
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView, DayArchiveView, CreateView,\
TemplateView
from datetime import date
from antxetamedia.agenda.forms import HappeningForm
from antxetamedia.agenda.models impor... | GISAElkartea/antxetamedia | antxetamedia/agenda/views.py | Python | agpl-3.0 | 2,216 | 0.002256 |
import pygame, sys
from pygame.locals import *
# --- Functions ---
def distance(speed, time):
distance = time * speed
return distance
# --- Classes ---
class Character(object):
def __init__(self, position, direction, sprite):
self.position = position
self.direction = direction
self... | Pietdagamer/Lanseloet | Old/2.py | Python | mit | 4,586 | 0.006542 |
# -*- coding: utf-8 -*-
#
# PyOmicron documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 26 09:12:21 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.
#
#... | ligovirgo/pyomicron | docs/conf.py | Python | gpl-3.0 | 9,982 | 0.00561 |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the... | JScott/ansible-taiga | templates/opt/taiga/back/settings/local.py | Python | mit | 1,982 | 0.005561 |
#!/usr/bin/env python
# -*- coding: <utf-8> -*-
"""
This file is part of Spartacus project
Copyright (C) 2016 CSE
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, o... | CommunicationsSecurityEstablishment/spartacus | CapuaEnvironment/Instruction/Instruction.py | Python | gpl-2.0 | 4,253 | 0.003292 |
#!/usr/local/bin/python3
# coding: utf-8
try:
import json, requests, urllib
from geopy.geocoders import Nominatim
from geopy.distance import vincenty
except:
print("Error importing modules, exiting.")
exit()
api_url = "http://opendata.iprpraha.cz/CUR/FSV/FSV_VerejnaWC_b/WGS_84/FSV_VerejnaWC_b.json... | vkotek/kotek_bot | features/toilet_finder.py | Python | unlicense | 1,885 | 0.009549 |
#!/usr/bin/env python
import sys
import os
from treestore import Treestore
try: taxonomy = sys.argv[1]
except: taxonomy = None
t = Treestore()
treebase_uri = 'http://purl.org/phylo/treebase/phylows/tree/%s'
tree_files = [x for x in os.listdir('trees') if x.endswith('.nex')]
base_uri = 'http://www.phylocommons.org/... | NESCent/phylocommons | tools/treebase_scraper/annotate_trees.py | Python | mit | 622 | 0.008039 |
# This file is part of Fail2Ban.
#
# Fail2Ban 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.
#
# Fail2Ban is distributed in the hope t... | yarikoptic/Fail2Ban-Old-SVNGIT | testcases/datedetectortestcase.py | Python | gpl-2.0 | 2,300 | 0.01913 |
# Unix SMB/CIFS implementation.
# Copyright (C) Sean Dague <sdague@linux.vnet.ibm.com> 2011
#
# 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 optio... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/samba/tests/samba_tool/base.py | Python | mit | 4,702 | 0.002127 |
from pywin.mfc import dialog
import win32api
import win32con
import win32ui
import copy
import string
from . import scintillacon
# Used to indicate that style should use default color
from win32con import CLR_INVALID
######################################################
# Property Page for syntax formatting options
... | sserrot/champion_relationships | venv/Lib/site-packages/pythonwin/pywin/scintilla/configui.py | Python | mit | 9,244 | 0.034401 |
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class RegisterForm(UserCreationForm):
invitation = forms.CharField(max_length=8)
class Meta:
model = User
fields = ('username', 'password1', 'password2', 'invitation')
c... | AtenrevCode/scChat | users/forms.py | Python | mit | 542 | 0.00738 |
#!/usr/bin/python3 -B
exec(open("../index.py").read())
from waitress import serve
serve(application, host='0.0.0.0', port=8080, threads=1, channel_timeout=1)
| shark555/websnake_demo | scripts/serve.py | Python | mit | 161 | 0.018634 |
"""
.. math.py
Simple math movers.
"""
## Inheritance
import base
# import library.movers.pushqueue as pq
## Inifinity definition
inf = float("inf")
#########################################
## ----- Special data containers ----- ##
#########################################
class MovingMax(base.Mover):
""" Co... | pelegm/movers | math.py | Python | unlicense | 9,322 | 0.002789 |
"""
taskmaster.controller
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import cPickle as pickle
import gevent
import sys
from gevent_zeromq import zmq
from gevent.queue import Queue, Empty
from os import path, unlink, rename
from taskmaster.util im... | alex/taskmaster | src/taskmaster/server.py | Python | apache-2.0 | 6,026 | 0.00083 |
#!/usr/bin/env python
import os.path
import re
from setuptools import Command, find_packages, setup
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys,subprocess
errno = subprocess.call([sys.executable, "runtests.py"])
ra... | Knewton/pettingzoo-python | setup.py | Python | apache-2.0 | 1,447 | 0.041465 |
import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
from pcl_helper import *
def rgb_to_hsv(rgb_list):
rgb_normalized = [1.0*rgb_list[0]/255, 1.0*rgb_list[1]/255, 1.0*rgb_list[2]/255]
hsv_normalized = matplotlib.colors.rgb_to_hsv([[rgb_normalized]])[0][0]
return hsv_normalized
de... | squared9/Robotics | Robotic_PR2_3D_Perception_Pick_And_Place/sensor_stick/src/sensor_stick/features.py | Python | mit | 2,473 | 0.002831 |
axes = az.plot_forest(non_centered_data,
kind='ridgeplot',
var_names=['theta'],
combined=True,
ridgeplot_overlap=3,
colors='white',
figsize=(9, 7))
axes[0].se... | mcmcplotlib/mcmcplotlib | api/generated/arviz-plot_forest-3.py | Python | apache-2.0 | 367 | 0.016349 |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from pandas import Index, MultiIndex
@pytest.fixture
def idx():
# a MultiIndex used to test the general functionality of the
# general functionality of this object
major_axis = Index(['foo', 'bar', 'baz', 'qux'])
minor_axis = Index(['one', 'two... | cython-testbed/pandas | pandas/tests/indexes/multi/conftest.py | Python | bsd-3-clause | 1,577 | 0 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Martine Lenders <mail@martine-lenders.eu>
#
# Distributed under terms of the MIT license.
from __future__ import print_function
import argparse
import os, sys
import random
import pexpect
import subprocess
import time
import types
DE... | alignan/RIOT | tests/lwip/tests/01-run.py | Python | lgpl-2.1 | 9,890 | 0.003539 |
from ij import IJ
from ij.gui import NonBlockingGenericDialog
from ij import WindowManager
from ij.gui import WaitForUserDialog
from ij import ImageStack
from ij import ImagePlus
theImage = IJ.getImage()
sourceImages = []
if theImage.getNChannels() == 1:
IJ.run("8-bit")
sourceImages.append(theImage)
else:
sourceIm... | stalepig/deep-mucosal-imaging | dmi_0.3/Isolate_stack_ROI2.py | Python | gpl-2.0 | 2,120 | 0.034906 |
"""The tests for the Script component."""
# pylint: disable=too-many-public-methods,protected-access
from datetime import timedelta
from unittest import mock
import unittest
# Otherwise can't test just this file (import order issue)
import homeassistant.components # noqa
import homeassistant.util.dt as dt_util
from h... | Smart-Torvy/torvy-home-assistant | tests/helpers/test_script.py | Python | mit | 9,704 | 0 |
# This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Li... | aerkalov/Booktype | lib/booki/channels/group.py | Python | agpl-3.0 | 2,141 | 0.004671 |
#!/usr/bin/env python
import subprocess
import re
import os
import errno
import collections
import sys
class Platform(object):
pass
sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
def sdkinfo(sdkname):
ret = {}
for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PI... | teeple/pns_server | work/install/Python-2.7.4/Modules/_ctypes/libffi/generate-ios-source-and-headers.py | Python | gpl-2.0 | 5,303 | 0.005846 |
from itertools import product, repeat, chain, ifilter, imap
from multiprocessing import Pool, cpu_count
from sklearn.preprocessing import binarize
from utils.profiling import profile
from numpy.random import randint
from functools import partial
from random import sample
import numpy as np
import logging
logger = logg... | dominiktomicevic/pedestrian | classifier/extractor.py | Python | mit | 6,723 | 0.000149 |
#!/bin/env python
# Copyright (c) 2006-2008 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.
"""Unittests that verify that the various test_types (e.g., simplified_diff)
are working."""
import difflib
import os
import unit... | amyvmiwei/chromium | webkit/tools/layout_tests/layout_package/test_types_unittest.py | Python | bsd-3-clause | 1,667 | 0.007798 |
from erukar.system.engine import Enemy, BasicAI
from ..templates.Undead import Undead
from erukar.content.inventory import Shortsword, Buckler
from erukar.content.modifiers import Steel, Oak
class Skeleton(Undead):
ClassName = 'Skeleton'
ClassLevel = 1
BaseMitigations = {
'bludgeoning': (-0.25, 0)... | etkirsch/legends-of-erukar | erukar/content/enemies/undead/Skeleton.py | Python | agpl-3.0 | 1,103 | 0.012693 |
from django.contrib import sitemaps
from django.core.urlresolvers import reverse
from .models import Artist, Song, User
class StaticViewSitemap(sitemaps.Sitemap):
changefreq = "weekly"
priority = 0.5
def items(self):
return ['index', 'popular', 'recently_added', 'search', 'contact']
def loc... | Ilias95/guitarchords | chords/sitemaps.py | Python | mit | 977 | 0 |
# -*- coding: utf-8 -*-
#
# SRL 5 documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 16 15:51:55 2010.
#
# 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.
#
# All c... | SRL/SRL-5 | doc/sphinx/conf.py | Python | gpl-3.0 | 6,360 | 0.006918 |
#
# ImageViewAgg.py -- a backend for Ginga using the aggdraw library
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import numpy
from io import BytesIO
import aggdraw as agg
from . import AggHelp
from ginga import ImageView
from ginga.aggw.CanvasRenderAg... | rupak0577/ginga | ginga/aggw/ImageViewAgg.py | Python | bsd-3-clause | 6,082 | 0.000658 |
# -*- coding: utf-8 -*-
import os
import os.path
import tempfile
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.dispatch import receiver
from registration.signals import user_activated
from imagekit.models import ImageSpecField
from imagekit.proces... | ugoertz/igelgrafik | igelmain/models.py | Python | bsd-3-clause | 6,801 | 0.003971 |
import pytest
def test_app_hostname_is_not_none():
from openods import app
value = app.config['APP_HOSTNAME']
assert value is not None
def test_cache_timeout_is_greater_equal_0():
from openods import app
value = app.config['CACHE_TIMEOUT']
assert value >= 0
def test_database_url_is_not_non... | open-ods/open-ods | tests/test_openods_api_config.py | Python | gpl-3.0 | 421 | 0 |
"""Unit tests for PyGraphviz interface."""
import os
import tempfile
import pytest
import pytest
pygraphviz = pytest.importorskip('pygraphviz')
from networkx.testing import assert_edges_equal, assert_nodes_equal, \
assert_graphs_equal
import networkx as nx
class TestAGraph(object):
def build_graph(sel... | sserrot/champion_relationships | venv/Lib/site-packages/networkx/drawing/tests/test_agraph.py | Python | mit | 3,587 | 0.000836 |
import bpy
from ... base_types.node import AnimationNode
class an_EdgesOfPolygonsNode(bpy.types.Node, AnimationNode):
bl_idname = "an_EdgesOfPolygonsNode"
bl_label = "Edges of Polygons"
def create(self):
self.newInput("Polygon Indices List", "Polygons", "polygons")
self.newOutput("Edge Ind... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/mesh/edges_of_polygons.py | Python | gpl-3.0 | 685 | 0.00292 |
# 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, software
# d... | vmturbo/nova | nova/tests/functional/db/api/test_migrations.py | Python | apache-2.0 | 25,993 | 0.001731 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from certproxy.certproxy import run
if __name__ == '__main__':
run()
| geneanet/certproxy | main.py | Python | bsd-3-clause | 118 | 0 |
# !/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import os
from typing import Optional, List, Tuple, Dict, Union
from models.literalConstants import LiteralConstants
class FileProcessing:
BASE_PATH: str = os.getcwd() + "/"
def __init__(self, path: str, file_type: LiteralConstants.FileType) -> None:
... | gmm96/Txt2SpeechBot | models/fileProcessing.py | Python | gpl-3.0 | 1,856 | 0.00431 |
from show_latent import LatentView | mzwiessele/GPyNotebook | GPyNotebook/latent/__init__.py | Python | bsd-2-clause | 34 | 0.029412 |
# Copyright (c) 2018 PaddlePaddle 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 app... | chengduoZH/Paddle | python/paddle/fluid/tests/unittests/test_group_norm_op.py | Python | apache-2.0 | 8,301 | 0.000482 |
"""SCons.Tool.gfortran
Tool-specific initialization for gfortran, the GNU Fortran 95/Fortran
2003 compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
... | stonekyx/binary | vendor/scons-local-2.3.4/SCons/Tool/gfortran.py | Python | gpl-3.0 | 2,256 | 0.00133 |
from OpenGLCffi.GL import params
@params(api='gl', prms=['value'])
def glMinSampleShadingARB(value):
pass
| cydenix/OpenGLCffi | OpenGLCffi/GL/EXT/ARB/sample_shading.py | Python | mit | 109 | 0.027523 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math
import operator
from pycket import values
from pycket import vector as values_vector
from pycket.arity import Arity
from pycket.error import... | magnusmorton/pycket | pycket/prims/numeric.py | Python | mit | 23,301 | 0.008412 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | odicraig/kodi2odi | addons/plugin.video.salts/scrapers/rlshd_scraper.py | Python | gpl-3.0 | 3,957 | 0.004043 |
"""Order/create a VLAN instance."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.managers import ordering
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
@click.command()
@click.option('--name', required=Fa... | softlayer/softlayer-python | SoftLayer/CLI/vlan/create.py | Python | mit | 2,493 | 0.001604 |
"""Interpolators wrap arrays to allow the array to be indexed in continuous coordinates
This module uses the trackvis coordinate system, for more information about
this coordinate system please see dipy.tracking.utils
The following modules also use this coordinate system:
dipy.tracking.utils
dipy.tracking.integration
... | mdesco/dipy | dipy/reconst/interpolate.py | Python | bsd-3-clause | 1,865 | 0.002681 |
# copied from OpenCAMLib Google code project, Anders Wallin says it was originally from Julian Todd. License unknown, likely to be GPL
# python stl file tools
import re
import struct
import math
import sys
###########################################################################
def TriangleNormal(x0, y0, z... | JohnyEngine/CNC | heekscnc/STLTools.py | Python | apache-2.0 | 10,565 | 0.015618 |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | chippey/gaffer | python/GafferUITest/GadgetTest.py | Python | bsd-3-clause | 8,732 | 0.065964 |
import unittest
from distutils.errors import CompileError
from pythran.tests import TestFromDir
import os
import pythran
from pythran.syntax import PythranSyntaxError
from pythran.spec import Spec
class TestOpenMP(TestFromDir):
path = os.path.join(os.path.dirname(__file__), "openmp")
class TestOpenMP4(TestFromDir... | serge-sans-paille/pythran | pythran/tests/test_openmp.py | Python | bsd-3-clause | 1,597 | 0.001879 |
# testyacc.py
import unittest
try:
import StringIO
except ImportError:
import io as StringIO
import sys
import os
sys.path.insert(0,"..")
sys.tracebacklimit = 0
import ply.yacc
def check_expected(result,expected):
resultlines = []
for line in result.splitlines():
if line.startswith("WARNING... | anuragiitg/nixysa | third_party/ply-3.1/test/testyacc.py | Python | apache-2.0 | 13,190 | 0.006444 |
import requests
import json
import restful_webapi
import os
# This example shows how to use the Requests library with RESTful API
# This web service stores arbitrary JSON data under integer keys
# We can use GET/POST/PUT/DELETE HTTP methods to modify the data
# Run a local server that we can use
restful_webapi.run_se... | sudikrt/costproML | staticDataGSir/restful.py | Python | apache-2.0 | 1,107 | 0 |
# -*- coding:utf-8 -*-
# @author xupingmao <578749341@qq.com>
# @since 2020/08/22 21:54:56
# @modified 2022/02/26 10:40:22
import xauth
import xtemplate
import xutils
import os
import re
import sys
import platform
import xconfig
from xutils import dateutil
from xutils import fsutil
from xutils import Storage
from xutil... | xupingmao/xnote | handlers/system/system_info.py | Python | gpl-3.0 | 2,138 | 0.013069 |
#
# Copyright (C) 2010 Kelvin Lawson (kelvinl@users.sourceforge.net)
#
# 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 ... | kelvinlawson/pykaraoke | pykplayer.py | Python | lgpl-2.1 | 16,454 | 0.003343 |
# The Hazard Library
# Copyright (C) 2015, GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# T... | g-weatherill/oq-hazardlib | openquake/hazardlib/tests/gsim/gsim_table_test.py | Python | agpl-3.0 | 29,750 | 0 |
from .chucky_neighborhood_tool import NeighborhoodTool
| a0x77n/chucky-tools | src/chucky_tools/neighborhood/__init__.py | Python | gpl-3.0 | 55 | 0 |
#!/usr/bin/env python
# example setselection.py
import pygtk
pygtk.require('2.0')
import gtk
import time
class SetSelectionExample:
# Callback when the user toggles the selection
def selection_toggled(self, widget, window):
if widget.get_active():
self.have_selection = window.selection_ow... | certik/pyjamas | pygtkweb/demos/065-setselection.py | Python | apache-2.0 | 2,570 | 0.002335 |
import git
def download_repos(dst, repos):
"""
handles downloading paginated gists
Arguments
---------
dst : string
folder to write repositories to
repos : array-like of git.repo.base.Repo
repositories to download
"""
for repo in repos:
try:
# we c... | cameres/github-dl | download/download_repos.py | Python | mpl-2.0 | 779 | 0.003851 |
# -*- coding: utf-8 -*-
"""
===========
TaskCarrier
===========
:mod:`taskcarrier` contains a set of tools built on top of the `joblib`
library which allow to use transparently Parallel/Serial code using
simple but nice abstraction.
"""
__author__ = "Begon Jean-Michel <jm.begon@gmail.com>"
__copyright__ = "3-clause BS... | jm-begon/taskcarrier | taskcarrier/__init__.py | Python | bsd-3-clause | 764 | 0.001309 |
from __future__ import unicode_literals
import json
import xmltodict
from jinja2 import Template
from six import iteritems
from moto.core.responses import BaseResponse
from .models import redshift_backends
def convert_json_error_to_xml(json_error):
error = json.loads(json_error)
code = error["Error"]["Cod... | william-richard/moto | moto/redshift/responses.py | Python | apache-2.0 | 28,522 | 0.001227 |
"""
XmlObject
This module allows concise definitions of XML file formats for python
objects.
"""
#
# KeepNote
# Copyright (c) 2008-2009 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@alum.mit.edu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GN... | brotchie/keepnote | keepnote/compat/xmlobject_v3.py | Python | gpl-2.0 | 13,706 | 0.008172 |
"""
Admonition extension for Python-Markdown
========================================
Adds rST-style admonitions. Inspired by [rST][] feature with the same name.
[rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions # noqa
See <https://Python-Markdown.github.io/extensions/admoniti... | unreal666/outwiker | plugins/markdown/markdown/markdown_plugin_libs/markdown/extensions/admonition.py | Python | gpl-3.0 | 3,188 | 0.000941 |
from __future__ import unicode_literals
from datetime import date
from django.test import TestCase
from import_export import fields
class Obj:
def __init__(self, name, date=None):
self.name = name
self.date = date
class FieldTest(TestCase):
def setUp(self):
self.field = fields.F... | daniell/django-import-export | tests/core/tests/test_fields.py | Python | bsd-2-clause | 2,262 | 0.000442 |
## Automatically adapted for scipy Oct 21, 2005 by
"""
Integration routines
====================
Methods for Integrating Functions given function object.
quad -- General purpose integration.
dblquad -- General purpose double integration.
tplquad -- General purpose triple integration.
... | stefanv/scipy3 | scipy/integrate/info.py | Python | bsd-3-clause | 1,311 | 0.000763 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
#
# This program is free software: yo... | jmesteve/saas3 | openerp/addons_extra/base_location/state.py | Python | agpl-3.0 | 1,248 | 0.000801 |
# Copyright 2013 IBM Corp.
#
# 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 agree... | HybridF5/nova | nova/tests/unit/objects/test_aggregate.py | Python | apache-2.0 | 8,667 | 0 |
#!/usr/bin/env python3
"""
script -- A widget displaying output of a script that lets you interact with it.
"""
import gi.repository, subprocess, sys
gi.require_version('Budgie', '1.0')
gi.require_version('Wnck', '3.0')
from gi.repository import Budgie, GObject, Wnck, Gtk, Gio, GLib
class ScriptPlugin(GObject.GObje... | kacperski1/budgie-script-applet | script.py | Python | gpl-2.0 | 1,518 | 0.003953 |
```
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.
The first integer of each row is greater than the last integer of the previous row.
For example,
Consider the following matrix:
[
[1, 3, 5,... | UmassJin/Leetcode | Array/Search_in_2D_matrix.py | Python | mit | 999 | 0.013013 |
from __future__ import absolute_import, unicode_literals, print_function, division
import tempfile
import re
import os
import codecs
import sublime
import sublime_plugin
from . import git_root, GitTextCommand
def temp_file(view, key):
if not view.settings().get('git_annotation_temp_%s' % key, False):
fd... | kemayo/sublime-text-git | git/annotate.py | Python | mit | 7,837 | 0.001786 |
import numpy as np
from spins import goos
from spins.goos import material
from spins.goos import shapes
def test_pixelated_cont_shape():
def init(size):
return np.ones(size)
var, shape = shapes.pixelated_cont_shape(
init, [100, 100, 10], [20, 30, 10],
var_name="var_name",
na... | stanfordnqp/spins-b | spins/goos/test_shapes.py | Python | gpl-3.0 | 6,692 | 0.000299 |
from setuptools import setup, find_packages
import os
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
CLASSIFIERS = [
#'Development Status :: 1 - ',
'Environment :: Web Enviro... | OKFNat/offenewahlen-nrw17 | setup.py | Python | mit | 1,452 | 0.002066 |
# -*- coding: utf-8 -*-
import factory
from data.tests.factories import DepartmentFactory
from ..models import Tourist, TouristCard
class TouristFactory(factory.DjangoModelFactory):
class Meta:
model = Tourist
first_name = 'Dave'
last_name = 'Greel'
email = 'greel@musicians.com'
class To... | notfier/touristique | tourists/tests/factories.py | Python | mit | 524 | 0 |
# -*- coding: utf-8 -*-
"""
Plugin that logs the current optimum to standard output.
"""
# Future
from __future__ import absolute_import, division, print_function, \
unicode_literals, with_statement
# First Party
from metaopt.plugin.plugin import Plugin
class OptimumPrintPlugin(Plugin):
"""
Logs new opti... | cigroup-ol/metaopt | metaopt/plugin/print/optimum.py | Python | bsd-3-clause | 1,486 | 0.000673 |
import argparse
import subprocess
import struct
import json
import shutil
import os
import collections
argparser = argparse.ArgumentParser(description='Reduce the logfile to make suitable for online destribution.')
argparser.add_argument('js_file', help='the js file to parse')
argparser.add_argument('output_name', hel... | tschneidereit/shumway | traceLogging/reduce.py | Python | apache-2.0 | 8,311 | 0.006858 |
from urlparse import urljoin
from django import template
from django.template.base import Node
from django.utils.encoding import iri_to_uri
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self, varname=None, na... | rebost/django | django/templatetags/static.py | Python | bsd-3-clause | 3,940 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2022 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-compute | google/cloud/compute_v1/services/region_commitments/pagers.py | Python | apache-2.0 | 5,692 | 0.000878 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | 0x0all/nupic | tests/unit/py2/nupic/data/aggregator_test.py | Python | gpl-3.0 | 2,186 | 0.001372 |
# Copyright 2015 PerfKitBenchmarker 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 appli... | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py | Python | apache-2.0 | 5,544 | 0.005051 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.