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 |
|---|---|---|---|---|---|---|
# coding:utf-8
import logging
import numpy as np
from scipy.linalg import svd
from mla.base import BaseEstimator
np.random.seed(1000)
class PCA(BaseEstimator):
y_required = False
def __init__(self, n_components, solver="svd"):
"""Principal component analysis (PCA) implementation.
Transfor... | rushter/MLAlgorithms | mla/pca.py | Python | mit | 1,758 | 0.000569 |
"""
Add user scren name to whitelist if it is not to be unfollowed
"""
whitelist = [
] | kimgea/simple_twitter_functions | twitter_functions/twitter/whitelisted_users.py | Python | mit | 119 | 0.016807 |
#!/usr/bin/python
# parsing state representing a subgraph
# initialized with dependency graph
#
from __future__ import absolute_import
import copy,sys,re
import cPickle
from parser import *
from common.util import *
from constants import *
from common.SpanGraph import SpanGraph
from common.AMRGraph import *
import num... | didzis/CAMR | graphstate.py | Python | gpl-2.0 | 68,252 | 0.013406 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | nagyistoce/netzob | src/netzob/Common/Models/L3NetworkMessage.py | Python | gpl-3.0 | 4,102 | 0.008787 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
__author__='atareao'
__date__ ='$25/04/2011'
#
# Remember-me
# An indicator for Google Calendar
#
# Copyright (C) 2011 Lorenzo Carbonell
# lorenzo.carbonell.cerezo@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | christopherjbly/calendar-indicator | src/calendarindicator.py | Python | gpl-3.0 | 17,542 | 0.039813 |
#!/usr/bin/env python
import ctypes
import json
import os
from binascii import hexlify, unhexlify
import pytest
from pyasn1.codec.ber.decoder import decode as ber_decode
from pyasn1.codec.der.decoder import decode as der_decode
from pyasn1.codec.der.encoder import encode as der_encode
from pyasn1.type import namedtype... | trezor/trezor-crypto | tests/test_wycheproof.py | Python | mit | 21,271 | 0.000658 |
# -*- coding: utf-8 -*-
from .common import *
class ReferenceDescriptorTest(TestCase):
def setUp(self):
self.reference_descriptor = ReferenceDescriptor.objects.create(
content_type=ContentType.objects.get_for_model(Model))
self.client = JSONClient()
def test_reference_descriptor... | vlfedotov/django-business-logic | tests/rest/test_reference.py | Python | mit | 4,996 | 0.001401 |
"""
Define a few commands
"""
from .meeseeksbox.utils import Session, fix_issue_body, fix_comment_body
from .meeseeksbox.scopes import admin, write, everyone
from textwrap import dedent
def _format_doc(function, name):
if not function.__doc__:
doc = " "
else:
doc = function.__doc__.splitli... | MeeseeksBox/MeeseeksDev | meeseeksdev/commands.py | Python | mit | 6,864 | 0.002477 |
#!BPY
"""
Name: 'MDL (.mdl)'
Blender: 244
Group: 'Export'
Tooltip: 'Export to Quake file format (.mdl).'
"""
__author__ = 'Andrew Denner'
__version__ = '0.1.3'
__url__ = ["Andrew's site, http://www.btinternet.com/~chapterhonour/",
"Can also be contacted through http://celephais.net/board", "blender", "elysiun"]
... | atphalix/eviltoys | tools/myscripts/mdl_export.py | Python | gpl-2.0 | 38,523 | 0.052384 |
import os
import unicodedata
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.commons.utils import cmd_utils
from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import log_utils as logger
def sync():
try:
_keep_alive_for = int(NS.con... | Tendrl/node_agent | tendrl/node_agent/node_sync/disk_sync.py | Python | lgpl-2.1 | 18,338 | 0.000327 |
# This is your "setup.py" file.
# See the following sites for general guide to Python packaging:
# * `The Hitchhiker's Guide to Packaging <http://guide.python-distribute.org/>`_
# * `Python Project Howto <http://infinitemonkeycorps.net/docs/pph/>`_
from setuptools import setup, find_packages
import sys
import os
#... | sergeeva-olga/decree-server | setup.py | Python | gpl-3.0 | 3,119 | 0.002886 |
from testscenarios import TestWithScenarios
import unittest
from geocode.geocode import GeoCodeAccessAPI
class GeoCodeTests(TestWithScenarios, unittest.TestCase):
scenarios = [
(
"Scenario - 1: Get latlng from address",
{
'address': "Sydney NSW",
'l... | saleem-latif/GeoCode | tests/unittest_geocode.py | Python | gpl-2.0 | 1,541 | 0 |
"""
A simple client to query a TensorFlow Serving instance.
Example:
$ python client.py \
--images IMG_0932_sm.jpg \
--num_results 10 \
--model_name inception \
--host localhost \
--port 9000 \
--timeout 10
Author: Grant Van Horn
"""
from __future__ import absolute_import
from __future__ import division
from __futur... | visipedia/tf_classification | tfserving/client.py | Python | mit | 2,561 | 0.0164 |
"""A backport of the get_terminal_size function from Python 3.3's shutil."""
__title__ = "backports.shutil_get_terminal_size"
__version__ = "1.0.0"
__license__ = "MIT"
__author__ = "Christopher Rosell"
__copyright__ = "Copyright 2014 Christopher Rosell"
__all__ = ["get_terminal_size"]
from .get_terminal_size import ... | nateprewitt/pipenv | pipenv/vendor/backports/shutil_get_terminal_size/__init__.py | Python | mit | 338 | 0 |
from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse
from .models import UserProfile
from imagersite.tests import AuthenticatedTestCase
# Create your tests here.
class ProfileTestCase(TestCase):
"""TestCase for Profile"""
def setUp(self):
"""Set... | welliam/imagersite | user_profile/tests.py | Python | mit | 2,830 | 0 |
"""
Revision ID: 0146_add_service_callback_api
Revises: 0145_add_notification_reply_to
Create Date: 2017-11-28 15:13:48.730554
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0146_add_service_callback_api'
down_revision = '0145_add_notification_reply_to'
de... | alphagov/notifications-api | migrations/versions/0146_add_service_callback_api.py | Python | mit | 2,779 | 0.010076 |
# -*- coding: utf-8 -*-
#
# libmypaint documentation build configuration file, created by
# sphinx-quickstart2 on Wed Jun 13 23:40:45 2012.
#
# 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.
#
#... | kragniz/mypaint | brushlib/doc/source/conf.py | Python | gpl-2.0 | 8,376 | 0.007283 |
# -*- coding: utf-8 -*-
"""Controllers for the pypollmanage pluggable application."""
from .root import RootController | tongpa/pypollmanage | pypollmanage/controllers/__init__.py | Python | apache-2.0 | 119 | 0.008403 |
# -*- coding: utf-8 -*-
# © 2016 Comunitea
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
class GeneralLedgerReportWizard(models.TransientModel):
_inherit = "general.ledger.report.wizard"
@api.onchange('company_id')
def onchange_company_id(self):
... | Comunitea/CMNT_00098_2017_JIM_addons | jim_invoice/models/general_ledger_wizard.py | Python | agpl-3.0 | 545 | 0.003676 |
# Copyright 2012 Michael Still and Canonical 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
#
# ... | yatinkumbhare/openstack-nova | nova/virt/configdrive.py | Python | apache-2.0 | 9,964 | 0.000401 |
from django.contrib.admin.models import LogEntry
from django.contrib.auth.models import User, Group, Permission
from simple_history import register
from celsius.tools import register_for_permission_handling
register(User)
register(Group)
register_for_permission_handling(User)
register_for_permission_handling(Group)
... | cytex124/celsius-cloud-backend | src/addons/management_user/admin.py | Python | mit | 408 | 0 |
from django.test import TestCase
from voice.models import Call
class CallModelTestCase(TestCase):
def setUp(self):
self.call = Call(sid="CAxxx",
from_number="+15558675309",
to_number="+15556667777")
self.call.save()
def test_string_representa... | RobSpectre/garfield | garfield/voice/tests/test_models.py | Python | mit | 499 | 0 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8
import os
import argparse
from gff3 import genes, get_gff3_id, get_rbs_from, feature_test_true, feature_lambda, feature_test_type
from cpt_gffParser import gffParse, gffWrite
from Bio import SeqIO
from jinja2 import Environment, FileSystemLoader
import logging
from ma... | TAMU-CPT/galaxy-tools | tools/phage/phage_annotation_table.py | Python | gpl-3.0 | 19,472 | 0.004725 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | ntt-sic/nova | nova/tests/api/openstack/compute/plugins/v3/test_scheduler_hints.py | Python | apache-2.0 | 12,196 | 0.000246 |
#
# Copyright 2008-2018 Universidad Complutense de Madrid
#
# This file is part of Numina
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
"""Different methods for combining lists of arrays."""
import numpy
import numina.array._combine as intl_combine
CombineError = intl_combine.CombineErro... | guaix-ucm/numina | numina/array/combine.py | Python | gpl-3.0 | 9,851 | 0.000203 |
"""
Constants used across the ORM in general.
"""
# Separator used to split filter strings apart.
LOOKUP_SEP = '__'
| ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/db/models/constants.py | Python | bsd-3-clause | 118 | 0.008475 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 versio... | douggeiger/gnuradio | gr-blocks/python/blocks/qa_multiply_matrix_ff.py | Python | gpl-3.0 | 4,810 | 0.009356 |
import pyautogui, win32api, win32con, ctypes, autoit
from PIL import ImageOps, Image, ImageGrab
from numpy import *
import os
import time
import cv2
import random
from Bot import *
def main():
bot = Bot()
autoit.win_wait(bot.title, 5)
counter = 0
poitonUse = 0
cycle = True
fullCounter = 0
... | oyajiro/l2bot | hf/wl.py | Python | artistic-2.0 | 2,661 | 0.007516 |
# -*- coding: utf-8 -*-
import system_tests
class TestCvePoC(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/208"
filename = "$data_path/2018-01-09-exiv2-crash-001.tiff"
commands = ["$exiv2 " + filename]
retval = [1]
stdout = [""]
stderr = [
"""$exiv2_... | AlienCowEatCake/ImageViewer | src/ThirdParty/Exiv2/exiv2-0.27.5-Source/tests/bugfixes/github/test_CVE_2017_17722.py | Python | gpl-3.0 | 409 | 0 |
import subprocess
import sys
import os
import time
from collections import namedtuple
sys.path.append(os.path.join(os.getcwd(), "src"))
from utils import settings
from utils import logger
settings.initialize('watcher')
original_plist = '/opt/TopPatch/agent/daemon/com.toppatch.agent.plist'
osx_plist = '/System/Libra... | vFense/vFenseAgent-nix | agent/watcher_mac.py | Python | lgpl-3.0 | 4,731 | 0.001057 |
# When some software has issues and we need to fix it in a
# hackish way, we put it in here. This one day will be empty.
import copy_reg
from twisted.web.client import SchemeNotSupported
from txsocksx.http import SOCKS5Agent as SOCKS5AgentOriginal
def patched_reduce_ex(self, proto):
"""
This is a hack to ov... | Karthikeyan-kkk/ooni-probe | ooni/utils/hacks.py | Python | bsd-2-clause | 3,059 | 0.000654 |
try:
import _pygeapi
except ImportError as e:
e.msg += ' (this module can be imported only from greenev)'
raise
from .evloop import event_loop
| ateska/striga2-pocs | greenev/pyge/__init__.py | Python | unlicense | 147 | 0.020408 |
# -*- coding: ISO-8859-15 -*-
from twisted.web import client
from twisted.internet.defer import inlineCallbacks
from core.Uusipuu import UusipuuModule
import urllib, simplejson
class Module(UusipuuModule):
def startup(self):
self.log('google.py loaded')
@inlineCallbacks
def cmd_google(self, ... | desaster/uusipuu | modules/google.py | Python | bsd-2-clause | 1,007 | 0.005958 |
# -*- 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-security-private-ca | samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_authority_async.py | Python | apache-2.0 | 2,081 | 0.002403 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | emgirardin/compassion-modules | partner_communication/models/email.py | Python | agpl-3.0 | 908 | 0 |
__author__ = 'Ralph'
from ui.app import Application
if __name__ == '__main__':
from ui.app import Example
import wx
app = wx.App()
Example(None, title='Example')
app.MainLoop()
# application = Application()
# application.run()
# node1 = ImportARFF()
# node2 = SelectAttributes()... | rbrecheisen/pyminer | pyminer/pyminer.py | Python | apache-2.0 | 1,957 | 0.001533 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys, urllib2
def main():
if len(sys.argv) < 2:
print("Error, usage: {0} <your url>".format(sys.argv[0]))
return 1
url = sys.argv[1]
print(urllib2.urlopen('http://t34.me/api/?u=' + url).read())
return 0
if __name__ == '__main__':
... | z0rr0/t34.me | configs/api_python.py | Python | agpl-3.0 | 328 | 0.015244 |
"""
These are filters placed at the end of a tunnel for watching or modifying
the traffic.
"""
##############################################################################
from __future__ import absolute_import
LICENSE = """\
This file is part of pagekite.py.
Copyright 2010-2020, the Beanstalks Project ehf. and Bja... | pagekite/PyPagekite | pagekite/proto/filters.py | Python | agpl-3.0 | 8,412 | 0.011531 |
from .allow_origin import allow_origin_tween_factory # noqa
from .api_headers import api_headers_tween_factory # noqa
from .basic_auth import basic_auth_tween_factory # noqa
| victorlin/pyramid-handy | pyramid_handy/tweens/__init__.py | Python | mit | 177 | 0 |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | UManPychron/pychron | pychron/git_archive/diff_editor.py | Python | apache-2.0 | 9,035 | 0.001107 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | v-iam/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table.py | Python | mit | 2,557 | 0.000782 |
#!/usr/bin/env python3
import socket
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)
print('Received', repr(data... | RobMackie/robiverse | python/echo_client/echo_client.py | Python | gpl-2.0 | 323 | 0 |
# Lint as: python3
# Copyright 2019 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 ... | tensorflow/lingvo | lingvo/tasks/car/waymo/waymo_decoder.py | Python | apache-2.0 | 13,038 | 0.004295 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# general_hosts.py
#
# Copyright 2016-2020 fritzctl 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 2 of t... | not-na/fritzctl | fritzctl/ooapi/general_hosts.py | Python | gpl-2.0 | 9,883 | 0.012344 |
# -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2009,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... | gianina-ingenuity/titanium-branch-deep-linking | testbed/x/mobilesdk/osx/5.5.1.GA/common/css/ply/lex.py | Python | mit | 40,747 | 0.011633 |
#!/usr/bin/env python
# encoding: utf-8
"""
fuzz.py
Copyright (c) 2011 Adam Cohen
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 u... | CHBMB/LazyLibrarian | lib/fuzzywuzzy/fuzz.py | Python | gpl-3.0 | 8,419 | 0.00095 |
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | ilastikdev/ilastik | tests/test_applets/objectCounting/testObjectCountingMultiImageGui.py | Python | gpl-3.0 | 31,053 | 0.010756 |
from __future__ import division, print_function, absolute_import
import time
from collections import defaultdict
import numpy as np
try:
import scipy.optimize
from scipy.optimize.optimize import rosen, rosen_der, rosen_hess
from scipy.optimize import leastsq
except ImportError:
pass
from . import te... | WillieMaddox/scipy | benchmarks/benchmarks/optimize.py | Python | bsd-3-clause | 10,537 | 0.000949 |
def foo(x):
pass
x = 42
y = 42
z = 42
foo(x, y, <caret>) | siosio/intellij-community | python/testData/multipleArgumentsCompletion/noExceptionIfMoreArgumentsThanParameters.py | Python | apache-2.0 | 61 | 0.065574 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... | ddurieux/alignak | test/test_star_in_hostgroups.py | Python | agpl-3.0 | 3,007 | 0.000665 |
## This file is part of PyGaze - the open-source toolbox for eye tracking
##
## PyGaze is a Python module for easily creating gaze contingent experiments
## or other software (as well as non-gaze contingent experiments/software)
## Copyright (C) 2012-2013 Edwin S. Dalmaijer
##
## This program is free... | esdalmaijer/PyGaze | examples/simple_experiment/constants.py | Python | gpl-3.0 | 4,461 | 0.014795 |
def send_simple_message():
return requests.post(
"https://api.mailgun.net/v3/sandbox049ff464a4d54974bb0143935f9577ef.mailgun.org/messages",
auth=("api", "key-679dc79b890e700f11f001a6bf86f4a1"),
data={"from": "Mailgun Sandbox <postmaster@sandbox049ff464a4d54974bb0143935f9577ef.mailgun.org>",
... | nicorellius/pdxpixel | pdxpixel/core/mailgun.py | Python | mit | 1,073 | 0.002796 |
import os
from pyramid.config import Configurator
from pyramid.renderers import JSONP
from pyramid.settings import aslist
from citedby import controller
from citedby.controller import cache_region as controller_cache_region
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application... | scieloorg/citedby | citedby/__init__.py | Python | bsd-2-clause | 1,974 | 0.000507 |
# Ridiculously simple test of the os.startfile function for Windows.
#
# empty.vbs is an empty file (except for a comment), which does
# nothing when run with cscript or wscript.
#
# A possible improvement would be to have empty.vbs do something that
# we can detect here, to make sure that not only the os.startfile()
#... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_startfile.py | Python | gpl-3.0 | 1,193 | 0.000838 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import shutil
from profile_creators import profile_generator
from profile_creators import small_profile_extender
from telemetry.page import page as page_mod... | highweb-project/highweb-webcl-html5spec | tools/perf/page_sets/typical_25.py | Python | bsd-3-clause | 4,012 | 0.004487 |
import os
from unittest import TestCase
from click.testing import CliRunner
from regparser.commands.clear import clear
from regparser.index import entry
class CommandsClearTests(TestCase):
def setUp(self):
self.cli = CliRunner()
def test_no_errors_when_clear(self):
"""Should raise no errors... | cmc333333/regulations-parser | tests/commands_clear_tests.py | Python | cc0-1.0 | 2,301 | 0 |
from util import app
import hashlib
import os
phase2_url = '/phase2-%s/' % os.environ.get('PHASE2_TOKEN')
admin_password = u'adminpass'
admin_hash = hashlib.sha1(admin_password.encode('utf-8')).hexdigest()
session_key = 'sessionkey'
admin_session_key = 'adminsessionkey'
def init_data(redis):
redis.set('user:test... | nickfrostatx/polyrents-challenge | tests/test_phase2.py | Python | mit | 4,200 | 0 |
import unittest
from mock import patch, Mock
from the_ark import rhino_client
__author__ = 'chaley'
rhino_client_ojb = None
class UtilsTestCase(unittest.TestCase):
def setUp(self):
self.rhino_client_obj = rhino_client.RhinoClient('test_name',
'... | meltmedia/the-ark | tests/test_rhino_client.py | Python | apache-2.0 | 3,445 | 0.00029 |
import zipfile
import imghdr
from django import forms
from .models import Image, ImageBatchUpload, Album
class AlbumAdminForm(forms.ModelForm):
class Meta:
model = Album
fields = '__all__'
def clean(self):
cleaned_data = self.cleaned_data
if cleaned_data.get('authorized_u... | dsimandl/teamsurmandl | gallery/forms.py | Python | mit | 1,431 | 0.002096 |
import CatalogItem
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer
from direct.interval.IntervalGlobal import *
from direct.gui.DirectGui import *
class CatalogNametagItem(CatalogItem.CatalogItem):
sequenceNumber = 0
def makeNewItem(... | Spiderlover/Toontown | toontown/catalog/CatalogNametagItem.py | Python | mit | 3,528 | 0.001701 |
# This file is part of VoltDB.
# Copyright (C) 2008-2016 VoltDB Inc.
#
# 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 ver... | paulmartel/voltdb | lib/python/voltcli/voltadmin.d/pause.py | Python | agpl-3.0 | 9,312 | 0.00494 |
#!/usr/bin/env python3
import os, sys, glob, pickle, subprocess
sys.path.insert(0, os.path.dirname(__file__))
from clang import cindex
sys.path = sys.path[1:]
def configure_libclang():
llvm_libdirs = ['/usr/lib/llvm-3.2/lib', '/usr/lib64/llvm']
try:
libdir = subprocess.check_output(['llvm-config', '... | chergert/libgit2-glib | tools/coverage.py | Python | lgpl-2.1 | 6,733 | 0.003864 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/bjornl/ros/workspaces/bjorn_ws/install/include".split(';') if "/home/bjornl/ros/workspaces/bjorn_ws/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime".replace(';', ' ')
PKG... | blutjens/perc_neuron_ros_ur10 | pn_ros/bjorn_ws/build/rosserial/rosserial_mbed/catkin_generated/pkg.installspace.context.pc.py | Python | gpl-3.0 | 511 | 0.001957 |
# -*- coding: utf-8 -*-
'''
Funimation|Now Add-on
Copyright (C) 2016 Funimation|Now
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 yo... | Protocol-X/script.video.funimationnow | resources/lib/modules/menunav.py | Python | gpl-3.0 | 6,384 | 0.01911 |
import AnimatedProp
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
from toontown.effects.Splash import *
from toontown.effects.Ripples import *
import random
class FishAnimatedProp(AnimatedProp.AnimatedProp):
def __init__(self, node):
AnimatedProp.AnimatedProp.__init__(self, n... | Spiderlover/Toontown | toontown/hood/FishAnimatedProp.py | Python | mit | 2,348 | 0.002129 |
"""
viscount.task.models
Task models
"""
from ..core import db
from ..utils import JSONSerializer
class TaskInputFile(JSONSerializer, db.Model):
__tablename__ = 'tasks_input_files'
id = db.Column(db.Integer, primary_key=True)
task_id = db.Column(db.Integer, db.ForeignKey('tasks.id'), nullable=False)
file_type_... | dacb/viscount | viscount/tasks/models.py | Python | bsd-2-clause | 2,077 | 0.01637 |
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.conf import settings
from django.db import models
from django.core.urlresolvers import reverse
from django.db.models.signals import pre_save
from django.utils import timezone
from django.utils.text import... | neldom/qessera | careers/models.py | Python | mit | 2,634 | 0.015186 |
def task_hello():
"""hello py """
def python_hello(times, text, targets):
with open(targets[0], "a") as output:
output.write(times * text)
return {'actions': [(python_hello, [3, "py!\n"])],
'targets': ["hello.txt"],
}
| gh0std4ncer/doit | doc/tutorial/tutorial_02.py | Python | mit | 276 | 0 |
from numpy import *
from matplotlib.pyplot import *
import scipy.constants as sc
import copy
import scipy.integrate as integ
# test sun/earth with hw5(1.989e30,5.972e24,149.6e6,0.0167,1000)
def hw5(m1, m2, a, e, tmax, tstep=0.001, tplot=0.025, method='leapfrog'):
if method != 'leapfrog' and method != 'odeint':
... | smorad/ast119 | hw5.py | Python | gpl-2.0 | 2,857 | 0.00805 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# FetchGNX design notes documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 9 13:29:00 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are presen... | Spicery/ginger | apps/fetchgnx/design/conf.py | Python | gpl-3.0 | 9,404 | 0.005955 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-09 23:22
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('player', '0002_auto_20160505_0350'),
]
operations = [
migrations.RenameField(
... | betonreddit/betonreddit | betonreddit/player/migrations/0003_auto_20160509_2322.py | Python | apache-2.0 | 427 | 0 |
#!/usr/bin/env python
import sys
import textwrap
try:
import virtualenv # @UnresolvedImport
except:
from .lib import virtualenv # @Reimport
from . import snippits
__version__ = "0.9.1"
def file_search_dirs():
dirs = []
for d in virtualenv.file_search_dirs():
if "vootstrap" not in d:
... | tonyczeh/vootstrap | vootstrap/__init__.py | Python | mit | 5,176 | 0.001546 |
# 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 https://mozilla.org/MPL/2.0/.
# Import sile objects
from .sile import *
from sisl._internal import set_module
from sisl import Geometry
__all__ = [... | zerothi/sisl | sisl/io/molden.py | Python | mpl-2.0 | 1,873 | 0.001068 |
#!/usr/bin/env python
from __future__ import print_function
import boto3
import time
from botocore.exceptions import ClientError
from datetime import datetime
def get_unix_timestamp():
"""
Generate a Unix timestamp string.
"""
d = datetime.now()
t = time.mktime(d.timetuple())
return str(int... | meredith-digops/awsops | amicreation/amicreation.py | Python | mit | 1,866 | 0.001608 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import numpy as N
import os
import sys
def parse_args(args):
p = argparse.ArgumentParser()
p.add_argument('-i', '--input-files', default=[sys.stdin], nargs="+",
type=argparse.FileType('rt'),
help='input f... | melrief/Hadoop-Log-Tools | hadoop/util/stats.py | Python | apache-2.0 | 1,993 | 0.024586 |
"""
This module implements atom/bond/structure-wise descriptor calculated from
pretrained megnet model
"""
import os
from typing import Dict, Union
import numpy as np
from tensorflow.keras.models import Model
from megnet.models import GraphModel, MEGNetModel
from megnet.utils.typing import StructureOrMolecule
DEFAU... | materialsvirtuallab/megnet | megnet/utils/descriptor.py | Python | bsd-3-clause | 6,396 | 0.002502 |
#!/usr/bin/env python
import sys
import json
import logging
from logging import warning, error, info
from math import pi, degrees
from PyQt4 import Qt, QtCore, QtGui
from connection import Connection
arrow_points = (
Qt.QPoint(-1, -4),
Qt.QPoint(1, -4),
Qt.QPoint(1, 4),
Qt.QPoint(4, 4),
Qt.QPoin... | zwarren/morse-car-controller | user/map.py | Python | mit | 7,092 | 0.006204 |
""" Example of reasoning about the approximate node completeness. """
from tulip import *
from tulipgui import *
import tulippaths as tp
# Load graph
graphFile = '../data/514_4hops.tlp'
graph = tlp.loadGraph(graphFile)
# Compute completeness for each node label
completeness = tp.utils.getApproximateAnnotationComplet... | visdesignlab/TulipPaths | demos/simpleNodeCompleteness.py | Python | mit | 928 | 0.002155 |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | XeCycle/indico | indico/MaKaC/webinterface/rh/trackModif.py | Python | gpl-3.0 | 39,643 | 0.016195 |
import logging
from functools import partial
from unittest import (
TestCase,
mock,
)
from pcs.common import file_type_codes
from pcs.common.reports import ReportItemSeverity as severity
from pcs.common.reports import codes as report_codes
from pcs.lib.env import LibraryEnvironment
from pcs_test.tools.asserti... | tomjelinek/pcs | pcs_test/tier0/lib/test_env.py | Python | gpl-2.0 | 6,324 | 0 |
#!/usr/bin/python3
try:
import qr_tools as qrTools # Module for this project
except:
import gen_3dwallet.qr_tools as qrTools
try:
import TextGenerator as textGen # Module for this project
except:
import gen_3dwallet.TextGenerator as textGen
import bitcoin # sudo pip3 install bitcoin
import argpar... | btcspry/3d-wallet-generator | gen_3dwallet/base.py | Python | mit | 24,069 | 0.008226 |
def test(options, buildout):
from subprocess import Popen, PIPE
import os
import sys
python = options['python']
if not os.path.exists(python):
raise IOError("There is no file at %s" % python)
if sys.platform == 'darwin':
output = Popen([python, "-c", "import platform; print (pla... | upiq/plonebuild | python/src/test-python.py | Python | mit | 873 | 0.004582 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Python interface to the Chandra Data Archive (CDA) web services and an
interface to a local disk copy of the Observation Catalog (Ocat).
"""
from pathlib import Path
import re
import warnings
import time
import requests
import numpy as np
import tables... | sot/mica | mica/archive/cda/services.py | Python | bsd-3-clause | 23,345 | 0.001157 |
#### 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 = Creature()
result.template = "object/mobile/shared_mynock.iff"
result.attribute_template_id = 9
result.stfName("... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_mynock.py | Python | mit | 426 | 0.049296 |
#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... | InsightSoftwareConsortium/ITKExamples | src/IO/ImageBase/GenerateSlicesFromVolume/Code.py | Python | apache-2.0 | 1,976 | 0.001012 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-03-21 13:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('erudit', '0086_auto_20180321_0717'),
]
operations = [
migrations.RemoveField(
... | erudit/zenon | eruditorg/erudit/migrations/0087_auto_20180321_0853.py | Python | gpl-3.0 | 481 | 0 |
{
'name': 'View Editor',
'category': 'Hidden',
'description': """
OpenERP Web to edit views.
==========================
""",
'version': '2.0',
'depends':['web'],
'data' : [
'views/web_view_editor.xml',
],
'qweb': ['static/src/xml/view_editor.xml'],
'auto_install': Tr... | mycodeday/crm-platform | web_view_editor/__openerp__.py | Python | gpl-3.0 | 326 | 0.006135 |
"""Defines the SMEFT class that provides the main API to smeftrunner."""
from . import rge
from . import io
from . import definitions
from . import beta
from . import smpar
import pylha
from collections import OrderedDict
from math import sqrt
import numpy as np
import ckmutil.phases, ckmutil.diag
class SMEFT(object)... | DsixTools/python-smeftrunner | smeftrunner/classes.py | Python | mit | 11,842 | 0.001773 |
# This file is part of MANTIS OS, Operating System
# See http://mantis.cs.colorado.edu/
#
# Copyright (C) 2003-2005 University of Colorado, Boulder
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the mos license (see file LICENSE)
import wx, thread
import net_model
cla... | turon/mantis | src/tools/tenodera/net_view.py | Python | bsd-3-clause | 15,234 | 0.006302 |
from typing import Any
from typing import List
from typing import Optional
from typing import Union
import bpy
import compas_blender
from compas.artists import PrimitiveArtist
from compas.geometry import Line
from compas.colors import Color
from compas_blender.artists import BlenderArtist
class LineArtist(BlenderAr... | compas-dev/compas | src/compas_blender/artists/lineartist.py | Python | mit | 2,962 | 0.003038 |
n = int(input())
grid = [[int(c) for c in input()] for i in range (0, n)]
cavities = []
for i in range(0, n):
if i > 0 and i < n - 1:
for j in range(0, n):
if j > 0 and j < n - 1:
v = grid[i][j]
if grid[i - 1][j] < v and grid[i + 1][j] < v and grid[i][j - 1] <... | amol9/hackerearth | hackerrank/practice/cavity_map/solution.py | Python | mit | 500 | 0.006 |
import tkinter
tk = tkinter.Tk()
tk.title("Bounce")
tk.resizable(0, 0)
# Keep the window on the top
tk.wm_attributes("-topmost", 1)
canvas = tkinter.Canvas(tk, width=500, height=400)
# Remove border. Apparently no effect on Linux, but good on Mac
canvas.configure(bd=0)
# Make the 0 horizontal and vertical line appare... | amosnier/python_for_kids | course_code/13_039_animated_ball.py | Python | gpl-3.0 | 562 | 0.003559 |
import asyncio
import discord
from discord.ext import commands
if not discord.opus.is_loaded():
# the 'opus' library here is opus.dll on windows
# or libopus.so on linux in the current directory
# you should replace this with the location the
# opus library is located in and with the proper filename.
... | Boy-314/winner-winner-bidget-sbinner | examples/playlist.py | Python | mit | 8,569 | 0.002451 |
import csv
import os
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django.utils.decorators import method_decorator
from django.db import models
from converter.exceptions import UploadException
from .models import SystemSource, Reference, Referenc... | valentine20xx/portal | converter/utils.py | Python | gpl-3.0 | 2,852 | 0.001052 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-datacatalog | samples/generated_samples/datacatalog_generated_datacatalog_v1_policy_tag_manager_serialization_import_taxonomies_sync.py | Python | apache-2.0 | 1,711 | 0.001753 |
import multiprocessing
import Library.interfaz
import Library.config
import handler
import server
try:
config = Library.config.read()
except:
import sys
print("FAILED TO OPEN CONFIG FILE, EXITING")
sys.exit()
man = multiprocessing.Manager()
adios = man.Value(bool, False)
interfaz = Library.interfaz.Int... | elan17/irc-terminal | server/main.py | Python | gpl-3.0 | 927 | 0.002157 |
# -*- coding: utf-8 -*-
#
# Viper documentation build configuration file, created by
# sphinx-quickstart on Mon May 5 18:24:15 2014.
#
# 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... | LMSlay/wiper | docs/source/conf.py | Python | bsd-3-clause | 7,714 | 0.007519 |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class GetOpportunitiesTasksTaskIdOk(object):
"""
NOTE: T... | minlexx/pyevemon | esi_client/models/get_opportunities_tasks_task_id_ok.py | Python | gpl-3.0 | 5,602 | 0.001071 |
# -*- coding: utf-8 -*-
import requests
import json
misperrors = {'error': 'Error'}
mispattributes = {'input': ['md5', 'sha1', 'sha256', 'domain', 'url', 'email-src', 'ip-dst|port', 'ip-src|port'], 'output': ['text']}
moduleinfo = {'version': '0.1', 'author': 'Corsin Camichel', 'description': 'Module to search for an ... | VirusTotal/misp-modules | misp_modules/modules/expansion/threatfox.py | Python | agpl-3.0 | 2,146 | 0.001864 |
# -*- coding: utf-8 -*-
from py3Des.pyDes import triple_des, ECB, PAD_PKCS5
class TripleDES:
__triple_des = None
@staticmethod
def init():
TripleDES.__triple_des = triple_des('1234567812345678',
mode=ECB,
IV... | codeMarble/codeMarble_Web | codeMarble_Web/codeMarble_py3des.py | Python | gpl-3.0 | 649 | 0.007704 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.