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 |
|---|---|---|---|---|---|---|
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | google/differentiable-atomistic-potentials | dap/tf/visualize.py | Python | apache-2.0 | 4,530 | 0.001987 |
from ast import Module, ImportFrom, Expr, Call, Name, FunctionDef, Assign, Str
from ast import dump, If, Compare, Eq, For, Attribute, Gt, Num, IsNot, BinOp
from ast import NameConstant, Mult, Add, Import, List, Dict, Is, BoolOp, And
from ast import Subscript, Index, Tuple, Lt, Sub, Global, Return, AugAssign
from ast im... | jjconti/ayrton | ayrton/ast_pprinter.py | Python | gpl-3.0 | 18,702 | 0.020426 |
import web
from inginious.frontend.plugins.utils.admin_api import AdminApi
from inginious.frontend.plugins.utils import get_mandatory_parameter
class FilterTasksApi(AdminApi):
def API_POST(self):
parameters = web.input()
task_query = get_mandatory_parameter(parameters, "task_query")
lim... | JuezUN/INGInious | inginious/frontend/plugins/problem_bank/pages/api/filter_tasks_api.py | Python | agpl-3.0 | 2,183 | 0 |
class Solution:
def findMin(self, nums):
mlength = len(nums)
if mlength == 0:
return -1
left = 0
right = mlength - 1
while left <= right:
mid = (left + right) >> 1
if mid == mlength - 1:
return nums[0]
... | WilliamYi96/Machine-Learning | LeetCode/0154.py | Python | apache-2.0 | 701 | 0.002853 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=invalid-name
""" Empty class... | mganeva/mantid | scripts/Inelastic/Direct/dgreduce.py | Python | gpl-3.0 | 15,191 | 0.009413 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/community_crafting/component/shared_reinforced_wall_module.... | obi-two/Rebelion | data/scripts/templates/object/draft_schematic/community_crafting/component/shared_reinforced_wall_module.py | Python | mit | 480 | 0.045833 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2016 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | mjbradburn/masters_project | node_modules/neo4j-driver/neokit/neorun.py | Python | apache-2.0 | 6,800 | 0.004118 |
# OeQ autogenerated correlation for 'Window/Wall Ratio East in Correlation to the Building Age'
import math
import numpy as np
from . import oeqCorrelation as oeq
def get(*xin):
# OeQ autogenerated correlation for 'Window to Wall Ratio in Eastern Direction'
A_WIN_E_BY_AW= oeq.correlation(
const= -6820.103... | UdK-VPT/Open_eQuarter | mole3/stat_corr/window_wall_ratio_east_SDH_by_building_age_correlation.py | Python | gpl-2.0 | 520 | 0.040385 |
#!/usr/bin/env python
# -*- python -*-
#
# Git Version: @git@
#-----------------------------------------------------------------------
# XALT: A tool that tracks users jobs and environments on a cluster.
# Copyright (C) 2013-2014 University of Texas at Austin
# Copyright (C) 2013-2014 University of Tennessee
#
# This... | xalt/xalt | contrib/upgradeDB_From0.7.1.py | Python | lgpl-2.1 | 5,640 | 0.009929 |
from flask import Flask, redirect, request
import flask_admin as admin
from flask.views import MethodView
class ViewWithMethodViews(admin.BaseView):
@admin.expose('/')
def index(self):
return self.render('methodtest.html')
@admin.expose_plugview('/_api/1')
class API_v1(MethodView):
d... | radioprotector/flask-admin | examples/methodview/app.py | Python | bsd-3-clause | 1,160 | 0 |
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | sajuptpm/neutron-ipam | neutron/plugins/ml2/driver_api.py | Python | apache-2.0 | 21,394 | 0 |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import debug
from pyasn1 import error
from pyasn1.codec.ber import eoo
from pyasn1.compat.integer import from_bytes
from pyasn1.compat.octets import oc... | kawamon/hue | desktop/core/ext-py/pyasn1-0.4.6/pyasn1/codec/ber/decoder.py | Python | apache-2.0 | 58,050 | 0.001602 |
import zmq
ctx = zmq.Context.instance()
server = ctx.socket(zmq.PUSH)
server.bind('inproc://foo')
clients = [ctx.socket(zmq.PULL) for i in range(10)]
poller = zmq.Poller()
for client in clients:
client.connect('inproc://foo')
poller.register(client, zmq.POLLIN)
for client in clients:
server.send(b'DATA')
... | waveform80/presentations | concurrency/demo3.py | Python | cc0-1.0 | 390 | 0 |
"""myproject
"""
__author__ = 'myproject:author_name'
__email__ = 'myproject:author_email'
#----------------------------------------------------------------------
def hello_world(extend_hello=False):
"""prints hello world
:returns: None
:rtype: None
"""
print 'Hello World!{}'.format(' Beautiful ... | diszgaurav/projecture | projecture/projects/python/myproject/myproject/myproject.py | Python | mit | 353 | 0.005666 |
from common import * # NOQA
SERVICE = 'com.docker.compose.service'
PROJECT = 'com.docker.compose.project'
NUMBER = 'com.docker.compose.container-number'
def test_container_create_count(client, context):
project, service, c = _create_service(client, context)
assert c.labels['io.rancher.service.deployment.u... | wlan0/cattle | tests/integration-v1/cattletest/core/test_compose.py | Python | apache-2.0 | 5,735 | 0 |
# vim:ts=4:sts=4:sw=4:expandtab
"""Package. Manages event queues.
Writing event-driven code
-------------------------
Event-driven procedures should be written as python coroutines (extended generators).
To call the event API, yield an instance of the appropriate command. You can use
sub-procedures - just yield the a... | zielmicha/satori | satori.events/satori/events/__init__.py | Python | mit | 1,410 | 0.002128 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-06-01 12:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0276_professional_integration'),
]
operations = [
migrations.AlterF... | uclouvain/OSIS-Louvain | base/migrations/0277_auto_20180601_1458.py | Python | agpl-3.0 | 682 | 0.001466 |
from django.http import StreamingHttpResponse, HttpResponseServerError
from download_service.zipbuilder import DDSZipBuilder, NotFoundException, NotSupportedException
from django.contrib.auth.decorators import login_required
from download_service.utils import make_client
from django.http import Http404
@login_require... | Duke-GCB/DukeDSHandoverService | download_service/views.py | Python | mit | 899 | 0.003337 |
#!/usr/bin/python
'''
This SimpleCV example uses a technique called frame differencing to determine
if motion has occured. You take an initial image, then another, subtract
the difference, what is left over is what has changed between those two images
this are typically blobs on the images, so we do a blob search to c... | tpltnt/SimpleCV | SimpleCV/examples/detection/MotionTracker.py | Python | bsd-3-clause | 1,540 | 0.012987 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2007-2012 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2012-2014 Paul Franklin
# Copyright (C) 2012 Nicolas Adenis-Lamarre
# Copyright (C) 2012 Benny Malengier
#
# This... | jralls/gramps | gramps/plugins/drawreport/fanchart.py | Python | gpl-2.0 | 33,745 | 0.001245 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
#------------------------------------------------------------
import selenium
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import time
import urlparse,urllib2,urllib,re,... | Reat0ide/plugin.video.pelisalacarta | pelisalacarta/channels/itastreaming.py | Python | gpl-3.0 | 11,292 | 0.021891 |
from coalib.bearlib.aspects import Root, Taste
@Root.subaspect
class Spelling:
"""
How words should be written.
"""
class docs:
example = """
'Tihs si surly som incoreclt speling.
`Coala` is always written with a lowercase `c`.
"""
example_language = 'reStructur... | kartikeys98/coala | coalib/bearlib/aspects/Spelling.py | Python | agpl-3.0 | 2,014 | 0 |
# -*- coding: utf-8 -*-
# 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... | smerritt/swift | doc/source/conf.py | Python | apache-2.0 | 8,171 | 0 |
class Location(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, direction):
return Location(self.x + direction.x, self.y + direction.y)
def __sub__(self, direction):
return Location(self.x - direction.x, self.y - direction.y)
def __repr__(sel... | Spycho/aimmo | aimmo-game-worker/simulation/location.py | Python | agpl-3.0 | 529 | 0 |
from pyvisdk.esxcli.executer import execute_soap
from pyvisdk.esxcli.base import Base
class StorageCoreDeviceWorld(Base):
'''
Operations on worlds pertaining to the pluggable storage architectures' logical devices on the system.
'''
moid = 'ha-cli-handler-storage-core-device-world'
def list(self,... | xuru/pyvisdk | pyvisdk/esxcli/handlers/ha_cli_handler_storage_core_device_world.py | Python | mit | 877 | 0.010262 |
class RCInput():
CHANNEL_COUNT = 14
channels = []
def __init__(self):
for i in range(0, self.CHANNEL_COUNT):
try:
f = open("/sys/kernel/rcio/rcin/ch%d" % i, "r")
self.channels.append(f)
except:
print ("Can't open file /sys/kern... | adrienemery/auv-control-pi | navio/rcinput.py | Python | mit | 484 | 0.004132 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2008 Richard Spiers <richard.spiers@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | billiob/papyon | papyon/msnp2p/webcam.py | Python | gpl-2.0 | 9,665 | 0.001242 |
from skimage import measure
import numpy as np
import struct
import math as m
from PIL import Image
from simplify import simplify
import argparse
parser = argparse.ArgumentParser(description='convert apk heightmaps to floating point tiff')
parser.add_argument('file', type=str, help='the apk heightmap file')
args ... | tarnheld/ted-editor | hm/apkhm.py | Python | unlicense | 3,380 | 0.012722 |
# -*- test-case-name: twisted.test.test_task,twisted.test.test_cooperator -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Scheduling utility methods and classes.
@author: Jp Calderone
"""
__metaclass__ = type
import time
from zope.interface import implements
from twisted.python imp... | Varriount/Colliberation | libs/twisted/internet/task.py | Python | mit | 24,723 | 0.002346 |
# Copyright 2022 The jax3d 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 wr... | google-research/jax3d | jax3d/projects/nesf/nerfstatic/utils/types_test.py | Python | apache-2.0 | 2,544 | 0.008648 |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, unicode_literals, division,
print_function)
from ..representation import SphericalRepresentation
from ..baseframe import BaseCoordinateFrame, TimeFrameAttribute
from ... | tbabej/astropy | astropy/coordinates/builtin_frames/ecliptic.py | Python | bsd-3-clause | 6,080 | 0.000987 |
#!/usr/bin/python
"""Preferences Editor for Terminator.
Load a UIBuilder config file, display it,
populate it with our current config, then optionally read that back out and
write it to a config file
"""
import os
import gtk
from util import dbg, err
import config
from keybindings import Keybindings, KeymapError
f... | FreedomBen/terminator | terminatorlib/prefseditor.py | Python | gpl-2.0 | 57,238 | 0.002009 |
from struct import unpack, pack, calcsize
from mobi_languages import LANGUAGES
from lz77 import uncompress
def LOG(*args):
pass
MOBI_HDR_FIELDS = (
("id", 16, "4s"),
("header_len", 20, "I"),
("mobi_type", 24, "I"),
("encoding", 28, "I"),
("UID", 32, "I"),
("generator_version", 36, "I"),
... | robwebset/script.ebooks | resources/lib/kiehinen/ebook.py | Python | gpl-2.0 | 8,604 | 0.002092 |
#!/usr/bin/python
"""
Small web application to retrieve information from uniprot and itag for
a given compound.
The idea is that for one compound we are able to find out in which
reactions it is involved and what are the proteins involved in these
reactions. For each of these proteins we can find if there are genes a... | PBR/chebi2gene | chebi2gene.py | Python | bsd-3-clause | 17,793 | 0.001124 |
import aiohttp
import discord
import random
from config import GoogleAPIKey
from config import GoogleCSECX
async def google(cmd, message, args):
if not args:
await message.channel.send(cmd.help())
return
else:
search = ' '.join(args)
url = 'https://www.googleapis.com/customsea... | valeth/apex-sigma | sigma/plugins/searches/google/google.py | Python | gpl-3.0 | 1,478 | 0.003392 |
from fsa import *
from nameGenerator import *
class IncrementalAdfa(Dfa):
"""This class is an Acyclic Deterministic Finite State Automaton
constructed by a list of words.
"""
def __init__(self, words, nameGenerator = None, sorted = False):
if nameGenerator is None:
nameGenerator ... | jpbarrette/moman | finenight/python/iadfa.py | Python | mit | 4,303 | 0.006739 |
import pytest
def pytest_addoption(parser):
group = parser.getgroup("debugconfig")
group.addoption(
"--setupplan",
"--setup-plan",
action="store_true",
help="show what fixtures and tests would be executed but "
"don't execute anything.",
)
@pytest.hookimpl(tryfirs... | alfredodeza/pytest | src/_pytest/setupplan.py | Python | mit | 818 | 0 |
from draftmim import app
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.restless import APIManager
db = SQLAlchemy(app)
api_manager = APIManager(app, flask_sqlalchemy_db=db)
| markalansmith/draftmim | web/draftmim/core.py | Python | apache-2.0 | 189 | 0 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | jairideout/q2cli | q2cli/dev.py | Python | bsd-3-clause | 1,137 | 0 |
# Built-in
import os
import warnings
# Common
import numpy as np
# #############################################################################
# Triangular meshes
# #############################################################################
def tri_checkformat_NodesFaces(nodes, indfaces, ids=... | Didou09/tofu | tofu/imas2tofu/_comp_mesh.py | Python | mit | 6,909 | 0 |
DESCRIPTION = """\
ACQ4 is a python-based platform for experimental neurophysiology.
It includes support for standard electrophysiology, multiphoton imaging,
scanning laser photostimulation, and many other experimental techniques. ACQ4 is
highly modular and extensible, allowing support to be added for new types of
d... | mgraupe/acq4 | setup.py | Python | mit | 7,496 | 0.007204 |
from root import *
version = 'v0.1'
| Strangemother/python-state-machine | scatter/__init__.py | Python | mit | 36 | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# 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)... | Zomboided/VPN-Manager | managefiles.py | Python | gpl-2.0 | 11,679 | 0.007192 |
#!/usr/bin/python
import os
import sys
import time
import logging
import subprocess
replot_poll_period = 1
plot_script_extension = '.gnuplot'
plot_script = None
for f in os.listdir('.'):
if f.endswith(plot_script_extension):
plot_script = f
break
assert plot_script != None, 'No file ending with "%s" found ... | govenius/plotbridge | examples/gnuplot_with_direction/expected_output/gnuplot.interactive.py | Python | gpl-2.0 | 3,554 | 0.019977 |
# Copyright (c) 2014. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | dmnfarrell/epitopemap | modules/pepdata/pmbec.py | Python | apache-2.0 | 2,894 | 0.001382 |
# Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# Author: Federico Ceratto <federico.ceratto@hpe.com>
#
# 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.... | openstack/designate | designate/tests/unit/agent/backends/test_knot2.py | Python | apache-2.0 | 7,785 | 0 |
#!/usr/bin/env python
## \file config.py
# \brief python package for config
# \author T. Lukaczyk, F. Palacios
# \version 4.0.1 "Cardinal"
#
# SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
# Dr. Thomas D. Economon (economon@stanford.edu).
#
# SU2 Developers: Pr... | Heathckliff/SU2 | SU2_PY/SU2/io/config.py | Python | lgpl-2.1 | 30,190 | 0.016827 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import pytest
from p... | jtrobec/pants | tests/python/pants_test/bin/test_goal_runner.py | Python | apache-2.0 | 756 | 0.005291 |
def extractTokyoESPScans(item):
"""
Tokyo ESP Scans
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
return False
| fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractTokyoESPScans.py | Python | bsd-3-clause | 230 | 0.030435 |
"""
42. Storing files according to a custom storage system
``FileField`` and its variations can take a ``storage`` argument to specify how
and where files should be stored.
"""
import random
import tempfile
from django.db import models
from django.core.files.base import ContentFile
from django.core.files.storage imp... | skevy/django | tests/modeltests/files/models.py | Python | bsd-3-clause | 1,085 | 0.001843 |
# -*- coding: utf-8 -*-
__title__ = 'pywebtask'
__version__ = '0.1.8'
__build__ = 0x000108
__author__ = 'Sebastián José Seba'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Sebastián José Seba'
from .webtasks import run, run_file
# Set default logging handler to avoid "No handler found" warnings.
import loggin... | ssebastianj/pywebtasks | pywebtasks/__init__.py | Python | mit | 546 | 0 |
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
| jb-old/chii | quoth/uwsgi_app.py | Python | unlicense | 148 | 0.006757 |
"""Graphical user interface."""
import collections
import ctypes
import sdl2
import hienoi.renderer
from hienoi._common import GLProfile, GraphicsAPI, ParticleDisplay, UserData
from hienoi._vectors import Vector2i, Vector2f, Vector4f
class NavigationAction(object):
"""Enumerator for the current nagivation acti... | christophercrouzet/hienoi | hienoi/gui.py | Python | mit | 20,220 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-20 18:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reddit', '0004_auto_20170520_1931'),
]
operations = [
migrations.AddField(
... | hcosta/escueladevideojuegos.net-backend-django | edv/reddit/migrations/0005_auto_20170520_2005.py | Python | gpl-3.0 | 788 | 0.001271 |
"""Module Description
Copyright (c) 2008 H. Gene Shin <shin@jimmy.harvard.edu>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: experimental
@version: $Revision$
@author: H. Gene Shin
@contact: s... | ChengchenZhao/DrSeq2 | ceas_lib/annotator.py | Python | gpl-3.0 | 75,107 | 0.022807 |
#!/usr/bin/env python
import argparse
from collections import OrderedDict
import itertools
import sys
from phylotoast import util, graph_util as gu
errors = []
try:
from palettable.colorbrewer.qualitative import Set3_12
except ImportError as ie:
errors.append("No module named palettable")
try:
import matplo... | smdabdoub/phylotoast | bin/PCoA.py | Python | mit | 10,870 | 0.004416 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from blinker import signal, Namespace, NamedSignal
from yosaipy2.core.event.abcs import EventBus
from typing import Dict
from functools import wraps
class BlinkerEventBus(EventBus):
def __init__(self):
# type: (str) -> None
self.AUTO_TOPIC = "blinker_e... | jellybean4/yosaipy2 | yosaipy2/core/event/event_bus.py | Python | apache-2.0 | 1,390 | 0 |
import webapp2
from google.appengine.ext import db
from google.appengine.ext import ndb
from db_class import DerivedClass as OldDerivedClass
from ndb_class import BaseClass as NewBaseClass
from ndb_class import DerivedClass as NewDerivedClass
class Repro(webapp2.RequestHandler):
def get(self):
self.response... | lantius/ndb-key | repro.py | Python | mit | 1,545 | 0.005825 |
# Copyright 2011 OpenStack LLC
# 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... | nii-cloud/dodai-compute | nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py | Python | apache-2.0 | 2,067 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# skyscanner documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# ... | valery-barysok/skyscanner-python-sdk | docs/conf.py | Python | apache-2.0 | 8,466 | 0.005315 |
""" Initialization code related to Commotion Router UI unit tests"""
| opentechinstitute/commotion-router-test-suite | tests/__init__.py | Python | agpl-3.0 | 69 | 0 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013 Contributor
#
# 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 t... | stdweird/aquilon | lib/python2.6/aquilon/worker/commands/show_rack_rack.py | Python | apache-2.0 | 1,055 | 0 |
'''
qobuz.extension.kooli.script.kooli-xbmc-service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:part_of: kodi-qobuz
:copyright: (c) 2012-2018 by Joachim Basmaison, Cyril Leclerc
:license: GPLv3, see LICENSE for more details.
'''
from os import path as P
import SocketServer
import socket
import... | tidalf/plugin.audio.qobuz | resources/lib/qobuz/extension/kooli/kooli/script/kooli-xbmc-service.py | Python | gpl-3.0 | 4,243 | 0.002593 |
from django.contrib import admin
from .models import Post, Category, Tag
# Register your models here.
class PostAdmin(admin.ModelAdmin):
list_display = ['title', 'created_time', 'modified_time', 'category', 'author']
# 注册新增PostAdmin
admin.site.register(Post, PostAdmin)
admin.site.register(Category)
admin.site.reg... | wldisaster/Alice | blog/admin.py | Python | gpl-3.0 | 339 | 0.009063 |
# -*- coding: utf-8 -*-
from .common_settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'dz(#w(lfve24ck!!yrt3l7$jfdoj+fgf+ru@w)!^gn9aq$s+&y'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME... | Mustapha90/IV16-17 | tango_with_django_project/dev_settings.py | Python | gpl-3.0 | 375 | 0.002667 |
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
VERSION = '0.4.1'
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
... | caioariede/pyintercept | setup.py | Python | mit | 1,498 | 0 |
from distutils.core import setup
setup(
name='captcha2upload',
packages=['captcha2upload'],
package_dir={'captcha2upload': 'src/captcha2upload'},
version='0.2',
install_requires=['requests'],
description='Upload your image and solve captche using the 2Captcha '
'Service',
... | Mirio/captcha2upload | setup.py | Python | bsd-2-clause | 647 | 0.001546 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | alshedivat/tensorflow | tensorflow/python/data/experimental/kernel_tests/optimization/map_and_filter_fusion_test.py | Python | apache-2.0 | 4,199 | 0.009288 |
# CubETL
# Copyright (c) 2013-2019 Jose Juan Montes
# 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 the rights
# to use, copy, modify, merge... | jjmontesl/cubetl | cubetl/template/__init__.py | Python | mit | 1,587 | 0.00189 |
"""
Tests for exporting OLX content.
"""
from __future__ import absolute_import
import shutil
import tarfile
import unittest
from six import StringIO
from tempfile import mkdtemp
import ddt
import six
from django.core.management import CommandError, call_command
from path import Path as path
from xmodule.modulestor... | ESOedX/edx-platform | cms/djangoapps/contentstore/management/commands/tests/test_export_olx.py | Python | agpl-3.0 | 3,608 | 0.000554 |
# subsystemBonusCaldariOffensive3RemoteShieldBoosterHeat
#
# Used by:
# Subsystem: Tengu Offensive - Support Processor
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"),
"overloadSelfDurati... | bsmr-eve/Pyfa | eos/effects/subsystembonuscaldarioffensive3remoteshieldboosterheat.py | Python | gpl-3.0 | 459 | 0.004357 |
import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_import as h2i
params = {
'response': 1049,
'family': 'binomial',
'beta_epsilon': 0.0001,
'alpha': 1.0,
'lambda': 1e-05,
'n_folds': 1,
'max_iter': 20,
}
class Basic(unittest.TestCase):... | 111t8e/h2o-2 | py/testdir_single_jvm/test_GLM2_syn_2659x1049.py | Python | apache-2.0 | 1,417 | 0.012703 |
# This script does the following:
#
# - create a user using bonafide and and invite code given as an environment
# variable.
#
# - create and upload an OpenPGP key manually, as that would be
# a responsibility of bitmask-dev.
#
# - send an email to the user using sendmail, with a secret in the body.
#
# - start a s... | leapcode/soledad | tests/e2e/test_incoming_mail_pipeline.py | Python | gpl-3.0 | 1,604 | 0 |
#!/usr/bin/env python
"""compares BSR values between two groups in a BSR matrix
Numpy and BioPython need to be installed. Python version must be at
least 2.7 to use collections"""
from optparse import OptionParser
import subprocess
from ls_bsr.util import prune_matrix
from ls_bsr.util import compare_values
from ls_b... | jasonsahl/LS-BSR | tools/compare_BSR.py | Python | gpl-3.0 | 3,059 | 0.012422 |
from os import path, access, W_OK, R_OK
import argparse
import logging
from django.core.management.base import BaseCommand, CommandError
from kinksorter_app.functionality.movie_handling import merge_movie, recognize_movie
from kinksorter_app.models import Movie, PornDirectory
from kinksorter_app.functionality.directo... | sistason/kinksorter2 | src/kinksorter_app/management/commands/kink_besteffortsync.py | Python | gpl-3.0 | 2,449 | 0.004492 |
# -*- coding: utf-8 -*-
#
# test documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 26 00:00:43 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.
#
# All ... | hanyassasa87/ns3-802.11ad | doc/manual/source/conf.py | Python | gpl-2.0 | 10,879 | 0.001287 |
# -*- coding: utf-8 -*-
import os
from datetime import datetime
import six
from bs4 import BeautifulSoup
from git import InvalidGitRepositoryError, Repo
from mock import ANY, call
from nose.tools import (
assert_equal,
assert_greater,
assert_in,
assert_less_equal,
assert_not_in,
assert_raises,
... | OddBloke/sphinx-git | tests/test_git_changelog.py | Python | gpl-3.0 | 11,748 | 0 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 23 03:24:37 2017
@author: Yuki
"""
import os,sys,logging
ENTRYPOINT=__path__[0]
ICONPATH=os.path.join(ENTRYPOINT,'Icons','logo.png')
KUCHINAWA='Kuchinawa'
from kuchinawa.Compile import compileUi
from kuchinawa.Thread import Main
#change the multiprocessing's context to... | threemeninaboat3247/kuchinawa | kuchinawa/__init__.py | Python | mit | 687 | 0.020378 |
import sys
import sqlite3
import CONST
import re
"""
Provides the low-level functions to insert, query and update the db
"""
def init():
con = sqlite3.connect( CONST.db_name )
# asr value is auto-speech-recognition rendered captions, either 0 (false) or 1 (true)
con.execute( '''CREATE TABLE IF NOT EXISTS... | krarkrrrc/vidpager | db/DbTools.py | Python | gpl-3.0 | 2,503 | 0.029165 |
from models.RepPoints.builder import RepPoints as Detector
from models.dcn.builder import DCNResNetFPN as Backbone
from models.RepPoints.builder import RepPointsNeck as Neck
from models.RepPoints.builder import RepPointsHead as Head
from mxnext.complicate import normalizer_factory
def get_config(is_train):
class ... | TuSimple/simpledet | config/RepPoints/reppoints_moment_dcn_r101v1b_fpn_multiscale_2x.py | Python | apache-2.0 | 7,766 | 0.000644 |
# coding: utf-8
from datetime import date
from django.db import models
from django.contrib.auth.models import User
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateField()
def __unicode__(self):
return self.name
class Conce... | thomazs/geraldo | site/newsite/django_1_0/tests/regressiontests/modeladmin/models.py | Python | lgpl-3.0 | 31,422 | 0.002005 |
import os
from functools import partial
from PyQt4.QtGui import QWidget
from PyQt4.QtCore import Qt
from qgis.core import QgsMapLayer
from qgis.gui import QgsExpressionBuilderDialog
from roam.api.utils import layer_by_name
from configmanager.models import QgsLayerModel, QgsFieldModel
from configmanager.editorwidget... | lmotta/Roam | src/configmanager/editorwidgets/listwidget.py | Python | gpl-2.0 | 5,997 | 0.001501 |
from typing import List, Optional
from fastapi import FastAPI, Header
app = FastAPI()
@app.get("/items/")
async def read_items(x_token: Optional[List[str]] = Header(None)):
return {"X-Token values": x_token}
| tiangolo/fastapi | docs_src/header_params/tutorial003.py | Python | mit | 216 | 0 |
import re
class Challenges:
@staticmethod
def first_factorial(number: int) -> int:
"""
Iterative approach
:param number: an input, first factorial of a number
:return: factorial
"""
found = 1
step = 2
while step <= number:
found *= s... | rlishtaba/py-algorithms | py_algorithms/challenges/challenges.py | Python | mit | 1,505 | 0 |
import sys
from starstoloves.models import User as UserModel
from starstoloves import model_repository
from starstoloves.lib.track import lastfm_track_repository
from .user import User
def from_session_key(session_key):
user_model, created = UserModel.objects.get_or_create(session_key=session_key)
return User... | tdhooper/starstoloves | starstoloves/lib/user/user_repository.py | Python | gpl-2.0 | 564 | 0.007092 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The primar... | romonzaman/newfies-dialer | newfies/dnc/constants.py | Python | mpl-2.0 | 748 | 0 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 lat... | fossilet/ansible | lib/ansible/module_utils/facts.py | Python | gpl-3.0 | 132,636 | 0.004976 |
import dataclasses
from typing import Dict, Mapping, Optional, Tuple
import numpy as np
from stable_baselines3.common import vec_env
from imitation.data import types
class Buffer:
"""A FIFO ring buffer for NumPy arrays of a fixed shape and dtype.
Supports random sampling with replacement.
"""
capa... | humancompatibleai/imitation | src/imitation/data/buffer.py | Python | mit | 13,770 | 0.001888 |
from storytext.javaswttoolkit import describer as swtdescriber
from org.eclipse.core.internal.runtime import InternalPlatform
from org.eclipse.ui.forms.widgets import ExpandableComposite
import os
from pprint import pprint
class Describer(swtdescriber.Describer):
swtdescriber.Describer.stateWidgets = [ ExpandableC... | emilybache/texttest-runner | src/main/python/storytext/lib/storytext/javarcptoolkit/describer.py | Python | mit | 2,499 | 0.008003 |
#!/usr/bin/env python
from connection import Conn as Connection
| Polychart/builder | server/polychartQuery/csv/__init__.py | Python | agpl-3.0 | 65 | 0 |
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the... | karrtikr/ete | ete3/tools/ete_extract.py | Python | gpl-3.0 | 2,246 | 0.00089 |
# devices/md.py
#
# Copyright (C) 2009-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the... | dwlehman/blivet | blivet/devices/md.py | Python | lgpl-2.1 | 22,939 | 0.000915 |
"""
Title: Image similarity estimation using a Siamese Network with a contrastive loss
Author: Mehdi
Date created: 2021/05/06
Last modified: 2021/05/06
Description: Similarity learning using a siamese network trained with a contrastive loss.
"""
"""
## Introduction
[Siamese Networks](https://en.wikipedia.org/wiki/Sia... | keras-team/keras-io | examples/vision/siamese_contrastive.py | Python | apache-2.0 | 11,646 | 0.001717 |
# Copyright 2018 The TensorFlow Hub 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... | tensorflow/hub | tensorflow_hub/compressed_module_resolver.py | Python | apache-2.0 | 3,271 | 0.006114 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | jart/tensorflow | tensorflow/contrib/data/python/kernel_tests/get_single_element_test.py | Python | apache-2.0 | 3,539 | 0.004521 |
from ... import types as sqltypes
class JSON(sqltypes.JSON):
"""SQLite JSON type.
SQLite supports JSON as of version 3.9 through its JSON1_ extension. Note
that JSON1_ is a
`loadable extension <https://www.sqlite.org/loadext.html>`_ and as such
may not be available, or may require run-time loadin... | gltn/stdm | stdm/third_party/sqlalchemy/dialects/sqlite/json.py | Python | gpl-2.0 | 2,292 | 0 |
import logging
import os
import sys
import tkinter
from tkinter import ttk
sys.path.append('../..')
import cv2
from src.image.imnp import ImageNP
from src.support.tkconvert import TkConverter
from src.view.template import TkViewer
from src.view.tkfonts import TkFonts
from src.view.tkframe import TkFrame, TkLabelFrame
... | afunTW/moth-graphcut | src/view/graphcut_app.py | Python | mit | 11,346 | 0.003552 |
# This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from load import load_dataset
import numpy as np
from threshold import learn_model, apply_model, accura... | krahman/BuildingMachineLearningSystemsWithPython | ch02/seeds_threshold.py | Python | mit | 921 | 0 |
#!/usr/bin/env python
""" patrol_smach_iterator.py - Version 1.0 2013-10-23
Control a robot using SMACH to patrol a square area a specified number of times
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2013 Patrick Goebel. All rights reserved.
This program is free software;... | fujy/ROS-Project | src/rbx2/rbx2_tasks/nodes/patrol_smach_iterator.py | Python | mit | 9,741 | 0.01314 |
"""
check_mod.py
Copyright 2015 Adam Greig
Licensed under the MIT licence, see LICENSE file for details.
Check all footprint files in a directory against a set of consistency fules.
"""
from __future__ import print_function, division
import sys
import os
import glob
from decimal import Decimal
import argparse
from ... | adamgreig/agg-kicad | scripts/check_mod.py | Python | mit | 4,233 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.