code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# coding=utf-8
# Copyright 2019 The SGNMT 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 requir... | ucam-smt/sgnmt | cam/sgnmt/decoding/multisegbeam.py | Python | apache-2.0 | 27,707 |
import os
def build_namespace():
from codenode.engine.introspection import introspect
from sage.all import *
try:
from codenode.external.mmaplotlib.codenode_plot import show
except ImportError:
pass
return locals()
| ccordoba12/codenode | codenode/engine/sage/runtime.py | Python | bsd-3-clause | 255 |
#!/usr/bin/env python
"""
4. Use PExpect to change the logging buffer size (logging buffered <size>) on pynet-rtr2.
Verify this change by examining the output of 'show run'.
"""
__author__ = 'Chip Hudgins'
__email__ = 'mudzi42@gmail.com'
import pexpect
import sys
import class4_devices as devices
def router_connec... | mudzi42/pynet_class | class4/class4_ex4.py | Python | apache-2.0 | 2,379 |
# 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 ... | yugangw-msft/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/auto_rest_azure_special_parameters_test_client.py | Python | mit | 8,340 |
#!/usr/bin/python
import boto3
import json
import sys
from datetime import datetime, timedelta
import time
import timeit
import os
import sys
# Pretty print a JSON object - for debugging
def pretty(d, indent=0):
for key, value in d.iteritems():
print '\t' * indent + str(key)
if isinstance(value, ... | akarmas/mrgeo | scripts/aws/mrgeo-emr.py | Python | apache-2.0 | 12,013 |
# Generated by Django 2.2.7 on 2019-11-05 14:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tasks', '0026_task_groups'),
]
operations = [
migrations.AlterModelManagers(
name='task',
managers=[
],
... | rdmorganiser/rdmo | rdmo/tasks/migrations/0027_manager.py | Python | apache-2.0 | 329 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class NfsGanesha(CMakePackage):
"""NFS-Ganesha is an NFSv3,v4,v4.1 fileserver that runs in user ... | LLNL/spack | var/spack/repos/builtin/packages/nfs-ganesha/package.py | Python | lgpl-2.1 | 1,294 |
import argparse
import asyncio
import logging
import sys
from pyintesishome import IntesisHome, IntesisHomeLocal
from pyintesishome.const import (
DEVICE_AIRCONWITHME,
DEVICE_ANYWAIR,
DEVICE_INTESISHOME,
DEVICE_INTESISHOME_LOCAL,
)
_LOGGER = logging.getLogger("pyintesishome")
async def main(loop):
... | jnimmo/pyIntesisHome | examples/cli_example.py | Python | mit | 2,243 |
#! /usr/bin/env python
'''
IKFast Plugin Generator for MoveIt!
Creates a kinematics plugin using the output of IKFast from OpenRAVE.
This plugin and the move_group node can be used as a general
kinematics service, from within the moveit planning environment, or in
your own ROS node.
Author: Dave Coleman, CU Boulder
... | jdsika/TUM_HOly | src/moveit_ikfast/scripts/create_ikfast_moveit_plugin.py | Python | mit | 14,106 |
# Copyright 2013 Cloudwatt
# 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... | cisco-openstack/tempest | tempest/api/object_storage/test_container_quotas.py | Python | apache-2.0 | 4,559 |
import datetime
td = datetime.timedelta(weeks=1, days=1, hours=1, minutes=1,
seconds=1, milliseconds=1, microseconds=1)
print(td)
# 8 days, 1:01:01.001001
print(type(td))
# <class 'datetime.timedelta'>
print(datetime.timedelta(days=0.5, hours=-6, minutes=120))
# 8:00:00
td = datetime.timede... | nkmk/python-snippets | notebook/datetime_timedelta_conversion.py | Python | mit | 2,475 |
import logging
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse, reverse_lazy
from django.views.generic import CreateView, DeleteView, DetailV... | zentralopensource/zentral | zentral/contrib/simplemdm/views.py | Python | apache-2.0 | 8,061 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import ok_
from py_api.api import ApiClient
from py_api.endpoint import Endpoint
import unittest
class GoogleApiClient(ApiClient):
HOST = "http://google.com"
def _host(self):
return self.HOST
class TestApiClient(unittest.TestCase):
... | ryankanno/py-api | tests/test_api_client.py | Python | mit | 565 |
# Copyright 2015 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... | jbedorf/tensorflow | tensorflow/python/saved_model/loader_impl.py | Python | apache-2.0 | 17,028 |
import warnings
def deprecated(func):
'''This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used.'''
def new_func(*args, **kwargs):
warnings.warn("Call to deprecated function {}.".format(func.__name__),
... | rosenbrockc/fortpy | fortpy/base.py | Python | mit | 1,967 |
"""
Baseclass for creating plugins
"""
class Plugin:
def __init__(self, *commands):
self._commands = commands
def can_handle(self, command):
if command in self._commands:
return True
else:
return False
def add_sub_parser(self):
raise NotImplemen... | owncloud/ocdev | ocdev/plugins/plugin.py | Python | gpl-3.0 | 595 |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | cisco-openstack/tempest | tempest/api/object_storage/test_crossdomain.py | Python | apache-2.0 | 2,264 |
# 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... | tombstone/models | research/object_detection/metrics/coco_tools.py | Python | apache-2.0 | 43,170 |
#!/usr/bin/env python
# Copyright (C) 2013-:
# Gabes Jean, naparuba@gmail.com
# Pasche Sebastien, sebastien.pasche@leshop.ch
#
# 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... | ovh/check-linux-by-ssh | check_disks_by_ssh.py | Python | mit | 6,947 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2017 gepd@outlook.com
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... | gepd/Deviot | libraries/readconfig/__init__.py | Python | apache-2.0 | 10,553 |
from sacred import Experiment
ex = Experiment('my_commands')
@ex.config
def cfg():
name = 'kyle'
@ex.command
def greet(name):
print('Hello {}! Nice to greet you!'.format(name))
@ex.command
def shout():
print('WHAZZZUUUUUUUUUUP!!!????')
@ex.automain
def main():
print('This is just the main comma... | zzsza/TIL | python/sacred/my_command.py | Python | mit | 345 |
import re
from collections import namedtuple
from pathlib import Path
from django.utils.text import slugify
from lxml import etree
# noinspection PyProtectedMember
from lxml.etree import _Element as XMLElement
def get_xml_from_file(path) -> XMLElement:
with open(str(path), "rb") as file:
content = file.... | erudit/eruditorg | eruditorg/apps/public/book/toc.py | Python | gpl-3.0 | 5,670 |
import sys
def do_something():
# Make sure that the file is actually loaded with relative path, otherwise
# we are not testing the scenario properly.
if sys._getframe().f_code.co_filename == 'A/relpath.py':
print('ok')
| jkorell/PTVS | Python/Tests/TestData/DebuggerProject/A/relpath.py | Python | apache-2.0 | 245 |
import cv2
import numpy as np
def main():
img = cv2.imread('./images/G0014107.JPG')
grayscaled = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
retval, threshold = cv2.threshold(img, 127, 255, cv2.THRESH_BINARY)
retval2,threshold2 = cv2.threshold(grayscaled, 125, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
h... | ricklon/travelcv | python/ezThreshold.py | Python | apache-2.0 | 2,001 |
#! /usr/bin/env python
# example of sequence unpacking
x, y, z = 1, 2, 3
print x, y, z
# unpacking
x, y = y, x
print x, y, z
# unpacking
x, z = y, x
print x, y, z | IPVL/Tanvin-PythonWorks | chapter5/codes/seqUnpack.py | Python | mit | 169 |
# 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
# distributed under t... | dudymas/python-openstacksdk | examples/get.py | Python | apache-2.0 | 1,097 |
from pony.orm import *
from datetime import datetime
from model.contact import Contact
from model.group import Group
from pymysql.converters import decoders
from pymysql.converters import encoders, decoders, convert_mysql_timestamp
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_=... | ainur-fa/python_training_mantis | fixture/orm.py | Python | apache-2.0 | 3,010 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing, Queue
import signal, time
import setting
from socketserver import SocketServer
from tunserver import TunServer
def sigHandler(signum, frame):
print "signal %s received, client going to shutdown" % signum
setting.running = False
if __nam... | ayouwei/minivpn | server/server.py | Python | apache-2.0 | 857 |
import http
import secrets
import pytest
from django.contrib.auth.models import User
from django.urls import reverse
from django.utils import timezone
from django.utils.http import urlencode
from guildmaster import views
from guildmaster.utils import reverse
@pytest.fixture()
def user():
user, __ = User.objects... | AIE-Guild/umami | guildmaster/tests/test_views.py | Python | mit | 4,495 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask_themes2 import render_theme_template
__author__ = 'James Iter'
__date__ = '2017/5/30'
__contact__ = 'james.iter.cn@gmail.com'
__copyright__ = '(c) 2017 by James Iter.'
def render(template, **context):
return render_theme_template('default', template, **... | jamesiter/JimV-C | jimvc/views/__init__.py | Python | gpl-3.0 | 330 |
#!/usr/bin/env python
#
# Covert VCF to R for SNP analysis
#
# POS REF ALT SAMPLE 1 ... SAMPLEN
# 1 A T 0/0(ref) .... 1/1(alt)
#
#
import argparse
def get_genotype(gt):
""" Get the genotypes
0/0 = 0
0/1 = 1
1/1 = 2
? What happens if there a non-biallelic SNPs
"""
... | theboocock/ancient_dna_pipeline | python_scripts/vcf_to_R.py | Python | mit | 1,516 |
"""
flask_oauthlib.contrib.client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An experiment client with requests-oauthlib as backend.
"""
import os
import contextlib
import warnings
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from flask import current_app, redirect, r... | daspots/dasapp | lib/flask_oauthlib/contrib/client/application.py | Python | mit | 11,945 |
from setuptools import setup
setup(
name='pyformat_site',
install_requires=[
"click==6.6",
"jinja2==2.8",
"python-rex==0.4",
"libsass==0.11.1",
"Markdown==2.6.6",
"pytest==2.9.2",
"Pygments==2.1.3",
"astunparse==1.4.0",
"pytz==2016.6.1",
... | ulope/pyformat.info | setup.py | Python | mit | 429 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | GoogleCloudPlatform/python-compat-runtime | appengine-compat/exported_appengine_sdk/google/appengine/api/search/stub/document_matcher.py | Python | apache-2.0 | 18,623 |
#!/usr/bin/python
from body3 import *
function_decl(link='extern',srcp='eval.c:216',
body=bind_expr(
body=statement_list(
E0=decl_expr(
ftype=void_type(algn='8',name='126')),
E1=decl_expr(
ftype=void_type(algn='8',name='126')),
E2=modify_expr(
OP0=var_decl(algn='32',srcp=... | h4ck3rm1k3/gcc_py_introspector | data/body4.py | Python | gpl-2.0 | 6,023 |
import os
def color2string(color):
return "rgb(%d,%d,%d)" % (int(255 * color[0]),
int(255 * color[1]),
int(255 * color[2]))
def colorFields(strokeColor, fillColor):
txt = ""
if strokeColor:
if isinstance(strokeColor, str):
... | wutron/compbio | rasmus/svg.py | Python | mit | 9,960 |
# 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... | eaplatanios/tensorflow | tensorflow/python/estimator/export/export_lib.py | Python | apache-2.0 | 1,993 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | jimi-c/ansible | lib/ansible/modules/source_control/git.py | Python | gpl-3.0 | 48,007 |
""" Various kinds of dialog and message box widgets. """
from __future__ import absolute_import
from ...properties import Bool, String, List, Instance, Either
from .widget import Widget
from .layouts import BaseBox, HBox
from .buttons import Button
class Dialog(Widget):
""" Simple dialog box with string message.... | htygithub/bokeh | bokeh/models/widgets/dialogs.py | Python | bsd-3-clause | 1,502 |
from bs4 import BeautifulSoup
import cgi
import htmlentitydefs
import os
import time
import calendar
import logging
logger = logging.getLogger('myapp')
hdlr = logging.FileHandler(os.getcwd() + os.sep + 'test.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logge... | elifesciences/elife-api-prototype | parseNLM.py | Python | mit | 32,885 |
"""Internal module for Python 2 backwards compatibility."""
import sys
if sys.version_info[0] < 3:
from urlparse import parse_qs, urlparse
from itertools import imap, izip
from string import letters as ascii_letters
from Queue import Queue
try:
from cStringIO import StringIO as BytesIO
... | holys/ledis-py | ledis/_compat.py | Python | mit | 2,327 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | fenglu-g/incubator-airflow | airflow/__init__.py | Python | apache-2.0 | 2,958 |
# Generated by Django 2.2.12 on 2020-06-03 12:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('addons', '0008_auto_20200604_0928')]
operations = [
migrations.AlterField(
model_name='addon',
name='public_stats',
... | bqbn/addons-server | src/olympia/addons/migrations/0009_auto_20200603_1251.py | Python | bsd-3-clause | 437 |
#!/usr/bin/env python3
import argparse
import sys
from struct import *
import datetime
class Input:
def __init__(self, filename):
if args.verbose:
print('[INFO] Trying to read data from %s...' % filename)
try:
with open(filename, 'rb') as inputFile:
self.con... | kenorb/FX-BT-Scripts | mt_dump.py | Python | mit | 7,835 |
#!/usr/bin/python
# -*- coding: utf8 -*-
import lbasync
import logging
def timer_cb(timer):
logging.info("Volana funkce co %ss" % timer.delay)
def main():
lbasync.set_timer(timer_cb, 2, True)
if __name__ == "__main__":
lbasync.run(main)
| linuxbox-cz/lbasync | example/timer_repeat.py | Python | lgpl-3.0 | 257 |
from django.conf.urls import patterns, url
from .views import deity_list, deity_detail
app_name = 'deities'
urlpatterns = [
# deities
url(r'^$', deity_list, name='deity_list'),
# deities > detail
url(r'^(?P<deity_slug>[^/]+)/$', deity_detail, name='deity_detail')
]
| dndtoolsnet/dndtools | dndtools/dnd/deities/urls.py | Python | mit | 286 |
# coding=utf-8
# Run a test server.
from app import app
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=7000, debug=True)
| leitelm/RISE_scada | wsgi.py | Python | apache-2.0 | 189 |
# coding: utf-8
# In[1]:
import tensorflow as tf
import numpy as np
import pylab as plt
@tf.RegisterGradient('WrapGrad')
def _wrap_grad(op,grad):
phi = op.inputs[0]
return tf.ones_like(phi)*grad
def wrap(phi):
out = tf.atan2(tf.sin(phi),tf.cos(phi))
with tf.get_default_graph().gradient_override_map... | Joshuaalbert/IonoTomo | src/ionotomo/notebooks/itoh_gp/wrap_op_gradients.py | Python | apache-2.0 | 381 |
import queue
class Solution:
def isBipartite(self, graph):
"""
:type graph: List[List[int]]
:rtype: bool
"""
subsets = [set(), set()]
visited = set()
for i in range(len(graph)):
if not graph[i]:
visited.add(i)
cont... | YiqunPeng/Leetcode-pyq | solutions/785IsGraphBipartite.py | Python | gpl-3.0 | 899 |
from uplift.ensemble import RandomForestClassifier
from uplift.datasets import make_radcliffe_surry
from uplift.metrics import qini_q
X_train, y_train, group_train = make_radcliffe_surry()
X_test, y_test, group_test = make_radcliffe_surry()
rfc = RandomForestClassifier(n_estimators=50, min_samples_leaf=200, criterion... | psarka/uplift | example.py | Python | bsd-3-clause | 465 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-22 16:10
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('website', '0005_remove_project_link'),
]
operations = [
migrations.RemoveField(
... | NotAGameDev/website | website/migrations/0006_remove_project_title.py | Python | agpl-3.0 | 394 |
import logging
from django.test.utils import override_settings
from django.test.client import Client
from django.contrib.auth.models import User
from student.tests.factories import CourseEnrollmentFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import M... | mjg2203/edx-platform-seas | lms/djangoapps/django_comment_client/base/tests.py | Python | agpl-3.0 | 16,619 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014, David Poulter
#
# 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.
#
# This p... | davebrent/consyn | consyn/ext/aubio_ext.py | Python | gpl-3.0 | 7,993 |
#!BPY
"""
Name: 'pxwgl loader (.pxwgl)...'
Blender: 242
Group: 'Import'
Tooltip: 'Custom Import (.pxwgl)'
"""
__author__ = "Daniel Aquino aka Methods"
__url__ = ("http://fly.thruhere.net")
__version__ = "0.1"
__bpydoc__ = """\
Imports json files used in pxwgl.
Usage: Execute this script from the "File->Import" menu
"... | ForsakenX/forsaken-utils | blender/json_import.py | Python | gpl-2.0 | 4,415 |
'''tzinfo timezone information for America/Dominica.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Dominica(DstTzInfo):
'''America/Dominica timezone definition. See datetime.tzinfo for details'''
zone = 'America/Dominic... | newvem/pytz | pytz/zoneinfo/America/Dominica.py | Python | mit | 498 |
''' Class definition for Pre processed contents'''
class PreprocessedContents:
def __init__(
self,
title_text,
normal_text,
media,
embedded_content,
quoted_content):
self.title_text = title_text
self.normal_text = normal_text
... | googleinterns/stampify | data_models/preprocessed_contents.py | Python | apache-2.0 | 1,366 |
#-*- encoding:utf-8 -*-
import re
import time
import datetime
import psycopg2
from scrapy.spiders import CrawlSpider
from scrapy.selector import Selector
from scrapy.loader import ItemLoader
from scrapy.http import Request
from LjSpider.items import *
from LjSpider.Db.Mysql import *
class ResidenceIr... | Justyer/LianjiaSpider | LjSpider/LjSpider/spiders/residence_increment_spider.py | Python | mit | 4,760 |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class XAxis(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.scene"
_path_str = "layout.scene.xaxis"
_valid_props = {
"autorange",
... | plotly/plotly.py | packages/python/plotly/plotly/graph_objs/layout/scene/_xaxis.py | Python | mit | 98,589 |
'''
FVCproductions
September 29, 2014
Combining Two Lists in Python
Extra Credit
'''
'''
Here I'm using the slicing method:
I'm creating a new list called list_3
and then making the even index values of list_3 equal to all the list_1 values
then I will make all the odd index values of list_3 equal to all the list_2... | fvcproductions/CS-HU | CSC-291/Projects/combo_list.py | Python | gpl-2.0 | 2,513 |
import uuid
unique_filename = uuid.uuid4()
print(unique_filename)
| mitlti/lti_website | random_filename_gen.py | Python | mit | 66 |
# -*- coding: utf-8 -*-
"""
Log window.
"""
__author__ = 'Sohhla'
import os
from PyQt4 import QtGui, QtCore
from qt.log import Ui_Dialog as Ui_Log
from shared import constant
# TODO: Works, but waaaaaay too slow to load
class LogUpdater(QtCore.QObject):
"""
Updates the [Log window].
"""
finish = Qt... | geosohh/AnimeTorr | animetorr/manager/log.py | Python | gpl-2.0 | 7,132 |
import os
import sys
import traceback
from _pydev_bundle.pydev_imports import xmlrpclib, _queue, Exec
from _pydev_bundle._pydev_calltip_util import get_description
from _pydev_imps._pydev_saved_modules import thread
from _pydevd_bundle import pydevd_vars
from _pydevd_bundle import pydevd_xml
from _pydevd_bundle.pydevd... | ThiagoGarciaAlves/intellij-community | python/helpers/pydev/_pydev_bundle/pydev_console_utils.py | Python | apache-2.0 | 24,235 |
# Import the future
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
# Import standard library modules
import logging
import os
import shutil
import sys
import time
import cPickle as pickle
import yaml
from datetime import datetime
# Import extra mod... | akehrer/Motome | Motome/Controllers/MainWindow.py | Python | bsd-2-clause | 46,227 |
__author__ = 'wentian'
test = "123"
print(test)
input_A = input("Input: ")
print(input_A) | zhihaoSong/spring-practices | demo/src/main/java/demo/docker/entry.py | Python | apache-2.0 | 91 |
# encoding: utf-8
import re
import sys
import urllib2
from time import sleep
from bs4 import BeautifulSoup
from douban import html_outputer
reload(sys)
sys.setdefaultencoding("utf-8")
# 设置cookie
# cookie_jar = cookielib.CookieJar()
# opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie_jar))
class ... | david-woody/SpiderDouBan | douban/spider_main.py | Python | apache-2.0 | 4,864 |
from rest_framework import serializers
from server.fundraisers.models import Fundraiser
class FundraiserSerializer(serializers.ModelSerializer):
class Meta:
model = Fundraiser
fields = ('id', 'user', 'ride', 'pageId', 'pageUrl', 'signOnUrl', 'pageStatus', 'currency', 'fundraisingTarget',
... | Techbikers/techbikers | server/fundraisers/serializers.py | Python | mit | 466 |
import os
import logging
from logging.config import fileConfig
this_dir, this_filename = os.path.split(__file__)
log_file = os.path.join(this_dir, 'logging.ini')
fileConfig(log_file)
logger = logging.getLogger()
| khilnani/ec2.py | ec2/utils.py | Python | gpl-3.0 | 214 |
"""
Internationalization tasks
"""
import sys
import subprocess
from path import path
from paver.easy import task, cmdopts, needs, sh
try:
from pygments.console import colorize
except ImportError:
colorize = lambda color, text: text # pylint: disable-msg=invalid-name
@task
@needs(
"pavelib.i18n.i18n_val... | LICEF/edx-platform | pavelib/i18n.py | Python | agpl-3.0 | 3,969 |
import multiprocessing
# Server Socket
bind = 'unix:/tmp/reversi-bot.sock'
backlog = 2048
# Worker Processes
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = 'sync'
worker_connections = 1000
max_requests = 0
timeout = 30
keepalive = 2
debug = False
spew = False
# Logging
logfile = '/var/log/reversi/bot.l... | naari3/line-reversibot | Docker/gunicorn/gunicorn-config.py | Python | mit | 401 |
"""
Test ants.learn module
nptest.assert_allclose
self.assertEqual
self.assertTrue
"""
import os
import unittest
from common import run_tests
from tempfile import mktemp
import numpy as np
import numpy.testing as nptest
import ants
class TestModule_surface(unittest.TestCase):
def setUp(self):
pass
... | ANTsX/ANTsPy | tests/test_viz.py | Python | apache-2.0 | 3,081 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import json
import sys
import os
import re
import subprocess
DEFINE_PAT=re.compile(r'^#define\s+(?P<name>\w+)\s+(?P<value>.*)\s+$')
class VersionFile:
def __init__(self, includeFile):
self.includeFile = inc... | cwi-dis/iotsa | extras/mkversionh.py | Python | mit | 2,253 |
# -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansUI-BoldItalic'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #uni0000 ????
chars.append(0x2000) #uni2000 EN QUAD
chars.append(0x2002) #uni2002 EN SPACE
chars.append(0x2003... | davelab6/pyfontaine | fontaine/charsets/noto_chars/notosansui_bolditalic.py | Python | gpl-3.0 | 157,264 |
##
# Copyright (c) 2015 Forschungszentrum Juelich GmbH, Germany
#
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notic... | torbjoernk/easybuild-framework | easybuild/tools/module_naming_scheme/categorized_hmns.py | Python | gpl-2.0 | 4,235 |
import question_template
game_type = 'input_output'
source_language = 'C'
parameter_list = [
['$x1','int'],['$x2','int'],['$x3','int'],['$y0','int'],
]
tuple_list = [
['for_break_',
[0,1,2,None],
[0,2,2,None],
[0,4,2,None],
[0,6,2,None],
[0,7,2,None],
[None,None,2,1],
[None,None,2,2],
[None,None,2... | stryder199/RyarkAssignments | Assignment2/ttt/archive/for_loops/for_break.py | Python | mit | 1,059 |
import sys
import pprint
import time
path_type = {1:"provider path", 2:"peer path", 3: "customer path"}
disable_stats = False
graph = {}
def check_args():
""" checks if a file was supplied to the script """
if len(sys.argv) < 2:
print "Usage: python " + sys.argv[0] + " <internet_file> [--disable-stats]\n"
exit(... | goncalor/ADRC | proj2/electedroute.py | Python | gpl-2.0 | 7,142 |
"""
"""
from fractions import gcd
import math
from grendel.gmath import divisors
from grendel.gmath.matrix import Matrix
from grendel.util.strings import classname, superscript, subscript
from symmetry_operation import SymmetryOperation
__all__ = [
'Rotation'
]
class Rotation(SymmetryOperation):
""" A rotati... | spring01/libPSI | lib/python/grendel/symmetry/rotation.py | Python | gpl-2.0 | 4,317 |
from collections import OrderedDict
class DataSet(object):
__slots__ = (
'events', # List of all events in this data set
'group', # Iterable containing groups of events
)
def __init__(self, query, group_function):
self.events = query.all()
if group_function is None:
... | ex-nerd/health-stats | health_stats/dataset.py | Python | mit | 1,067 |
__author__ = 'mpetyx'
from django.contrib import admin
from .models import OpeniApplication
class ApplicationAdmin(admin.ModelAdmin):
pass
admin.site.register(OpeniApplication, ApplicationAdmin)
| OPENi-ict/ntua_demo | openiPrototype/openiPrototype/APIS/Profile/Application/admin.py | Python | apache-2.0 | 204 |
#! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import TaskGen,Task,Utils
from Logs import debug
import ccroot
from TaskGen import feature,before,extension,after
g_cxx_flag_vars=['CXXDEPS','FRAMEWORK','FRAMEWORKPATH','STATICLIB','LIB','LIBPATH','LINKFLAGS'... | diedthreetimes/VCrash | pybindgen-0.15.0.795/.waf-1.5.9-0c853694b62ef4240caa9158a9f2573d/wafadmin/Tools/cxx.py | Python | gpl-2.0 | 2,783 |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - Context objects which are passed thru instead of the classic
request objects. Currently contains legacy wrapper code for
a single request object.
@copyright: 2008-2008 MoinMoin:FlorianKrupicka
@license: GNU GPL, see COPYING fo... | Glottotopia/aagd | moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/web/contexts.py | Python | mit | 16,564 |
__author__ = 'briannelson'
from SID.Utilities import ConfigUtility
from SIDClient.Controllers import SendToSidWatchServerController
config = ConfigUtility.load('./Config/sidwatch.cfg')
controller = SendToSidWatchServerController(config)
controller.start()
| SidWatch/pySIDWatch | Source/SendToSidWatchServer.py | Python | mit | 261 |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from locators import InfraHostsLocators
from locators import InfraPageLocators
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.... | aruneli/rancher-test | ui-selenium-tests/pages/InfraHostsPage.py | Python | apache-2.0 | 6,392 |
#!/usr/bin/env python3
#
# This file is part of the utilities shipped with 'Aleph - A Library for
# Exploring Persistent Homology'. Its purpose is the conversion of image
# data to matrix data.
#
# Usage: image_to_matrix FILE
#
# The matrix will be written to `stdout` in matrix format. Note that the
# function does *no... | Submanifold/Aleph | utilities/image_to_matrix.py | Python | mit | 596 |
from __future__ import division
from collections import deque
import base64
import random
import re
import sys
import time
from twisted.internet import defer
from twisted.python import log
import bitcoin.getwork as bitcoin_getwork, bitcoin.data as bitcoin_data
from bitcoin import helper, script, worker_interface
fro... | jramos/p2pool | p2pool/work.py | Python | gpl-3.0 | 26,833 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | danielfrg/jupyterhub-kubernetes_spawner | kubernetes_spawner/swagger_client/models/v1_delete_options.py | Python | apache-2.0 | 6,047 |
from collections import namedtuple
import pickle
from math import sin, cos, radians
import os
import time
import cv2
import numpy as np
from caffew import caffe_classifier
import shm
from vision.modules import ModuleBase, gui_options
capture_source = 'downward'
vision_options = [gui_options.BooleanOption('debugging... | cuauv/software | vision/modules/deprecated/Bins_SVM.py | Python | bsd-3-clause | 12,569 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connection_peerings_operations.py | Python | mit | 22,763 |
"""
Bayer CFA Mosaicing
===================
*Bayer* CFA (Colour Filter Array) data generation.
"""
from __future__ import annotations
from colour.hints import ArrayLike, Literal, NDArray, Union
from colour.utilities import as_float_array, tsplit
from colour_demosaicing.bayer import masks_CFA_Bayer
__author__ = "Co... | colour-science/colour-demosaicing | colour_demosaicing/bayer/mosaicing.py | Python | bsd-3-clause | 1,623 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Student.std'
db.alter_column(u'fest_student', 'std', s... | rashivkp/animation-fest | fest/migrations/0004_auto__chg_field_student_std.py | Python | agpl-3.0 | 7,707 |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - migration from base rev 1090300
Nothing to do, we just return the new data dir revision.
@copyright: 2011 by Thomas Waldmann
@license: GNU GPL, see COPYING for details.
"""
def execute(script, data_dir, rev):
return 1090400
| RealTimeWeb/wikisite | MoinMoin/script/migration/1090300.py | Python | apache-2.0 | 292 |
"""
Functional tests for fdtd daemon which can't be run
via py.test (or it's complicated).
Combined functional tests calling methods from fdtcp - running
the the whole transfer starting from fdtcp.
__author__ = Zdenek Maxa
"""
from __future__ import print_function
from builtins import str
import os
import sys
impor... | cmscaltech/fdtcp | tests/python/fdtcplibtest.py | Python | apache-2.0 | 52,229 |
"""
Interval Abstract Domain
========================
Non-relational abstract domain to be used for **numerical analysis**.
The set of possible numerical values of a program variable in a program state
is represented as an interval.
:Authors: Caterina Urban and Simon Wehrli
"""
from collections import defaultdict
fro... | caterinaurban/Lyra | src/lyra/abstract_domains/numerical/interval_domain.py | Python | mpl-2.0 | 21,065 |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'tree',
'USER': 'tree',
},
}
INSTALLED_APPS = (
'tree',
'tests',
)
SECRET_KEY = 'not important here'
| BertrandBordage/django-tree | tests/settings.py | Python | bsd-3-clause | 230 |
# -*- coding: utf-8 -*-
###############################################################################
#
# FinalizeOAuth
# Completes the OAuth process by retrieving an access token for a user, after they have visited the authorization URL returned by the InitializeOAuth Choreo and clicked "allow."
#
# Python versions... | jordanemedlock/psychtruths | temboo/core/Library/Utilities/Authentication/OAuth2/FinalizeOAuth.py | Python | apache-2.0 | 5,094 |
#!/usr/bin/python3
"""
AUTHOR: Matthew May - mcmay.web@gmail.com
"""
# Imports
import json
#import logging
import maxminddb
#import re
import redis
import io
from const import META, PORTMAP
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from os import getuid
from sys import exit
#from textwrap imp... | MatthewClarkMay/geoip-attack-map | DataServer/DataServer.py | Python | apache-2.0 | 12,161 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Milosz Piglas <milosz@archeocs.com>
#
# 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 opt... | miloszpiglas/qtqube | pyqube/views.py | Python | gpl-3.0 | 12,095 |
#
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | shawnbow/git-repo | subcmds/sync.py | Python | apache-2.0 | 34,780 |
# usage:
# grep.py -d <directory> -f <text>
#
# <directory> is a folder, with subfolders, containing .svg files. In each svg file in the directory or its children
# look for <text>
import getopt, sys, os, re
def usage():
print """
usage:
grep.py -d [directory] -f [text] -n
... | logxen/Fritzing | part-gen-scripts/misc_scripts/grep.py | Python | gpl-3.0 | 2,033 |
# flake8: noqa
# Version: 0.16
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.3, 3.4, 3.5, and pypy
* [![Latest Versi... | arawlin2/mixpanel-jql | versioneer.py | Python | mit | 65,761 |
from client import StoreClient, VoldemortException
| cshaxu/voldemort | clients/python/voldemort/__init__.py | Python | apache-2.0 | 51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.