code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
from .layer import YowCallsProtocolLayer
tgalal/yowsup
yowsup/layers/protocol_calls/__init__.py
Python
gpl-3.0
41
#!/usr/bin/python # -*- coding: utf-8 -*- # (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...
andreaso/ansible
lib/ansible/modules/system/ohai.py
Python
gpl-3.0
1,863
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
zephyrplugins/zephyr
zephyr.plugin.jython/jython2.5.2rc3/Lib/encodings/cp855.py
Python
epl-1.0
34,106
#!/usr/bin/env python # # dfu.py: Access USB DFU class devices # Copyright (C) 2009 Black Sphere Technologies # Copyright (C) 2012 Transition Robotics Inc. # Written by Gareth McMullin <gareth@blacksphere.co.nz> # Modified by Piotr Esden-Tempski <piotr@esden.net> # # This program is free software: you can redistribut...
mmoiozo/mavcourse
sw/tools/dfu/dfu.py
Python
gpl-2.0
7,206
exec 'print 1' in {}, {}
ivan-fedorov/intellij-community
python/testData/psi/ExecPy2.py
Python
apache-2.0
25
a = u"lo \u00d6sterreich\\!\n" print(u"Hel%s\n" % a)
smmribeiro/intellij-community
python/testData/refactoring/introduceVariable/substringContainsEscapes.after.py
Python
apache-2.0
52
#!/usr/bin/env python from nose.tools import * import networkx as nx class TestGeneratorsGeometric(): def test_random_geometric_graph(self): G=nx.random_geometric_graph(50,0.25) assert_equal(len(G),50) def test_geographical_threshold_graph(self): G=nx.geographical_threshold_graph(50,10...
LumPenPacK/NetworkExtractionFromImages
win_build/nefi2_win_amd64_msvc_2015/site-packages/networkx/generators/tests/test_geometric.py
Python
bsd-2-clause
1,036
"""Utility code for constructing importers, etc.""" from ._bootstrap import MAGIC_NUMBER from ._bootstrap import cache_from_source from ._bootstrap import decode_source from ._bootstrap import source_from_cache from ._bootstrap import spec_from_loader from ._bootstrap import spec_from_file_location from ._bootstrap im...
milinbhakta/flaskmaterialdesign
venv/Lib/importlib/util.py
Python
gpl-2.0
7,227
from __future__ import unicode_literals import keyword import re from optparse import make_option from django.core.management.base import NoArgsCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS from django.utils import six class Command(NoArgsCommand): help = "Introspects the database tab...
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/core/management/commands/inspectdb.py
Python
bsd-3-clause
9,570
# -*- coding: utf-8 -*- """Generic feature selection mixin""" # Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman # License: BSD 3 clause from abc import ABCMeta, abstractmethod from warnings import warn import numpy as np from scipy.sparse import issparse, csc_matrix from ..base import TransformerMixin f...
WangWenjun559/Weiss
summary/sumy/sklearn/feature_selection/base.py
Python
apache-2.0
4,186
# -*- coding: utf-8 -*- """ werkzeug.useragents ~~~~~~~~~~~~~~~~~~~ This module provides a helper to inspect user agent strings. This module is far from complete but should work for most of the currently available browsers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta...
zwChan/VATEC
~/eb-virt/Lib/site-packages/werkzeug/useragents.py
Python
apache-2.0
5,418
""" Tests the implementation of the solution to the Euclidean Minimum Spanning Tree (EMST) problem """ import pytest from exhaustive_search.point import Point from exhaustive_search.euclidean_mst import solve, edist def compare_solutions(actual, expected): assert len(actual) == len(expected), "expected %d to equ...
ciarand/exhausting-search-homework
test/test_euclidean_mst.py
Python
isc
2,000
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages PROJECT = 'cax' VERSION = '5.2.1' with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'checksumdir', 'scp', '...
XENON1T/cax
setup.py
Python
isc
2,712
# -*- coding: utf-8 -*- # Copyright (c), 2011, the txyoga authors. See the LICENSE file for details. """ Tests for basic class serialization and deserialization. """ from twisted.trial.unittest import TestCase from txyoga.base import Collection, Element from txyoga.serializers import jsonEncode class Screwdriver(Ele...
lvh/txyoga
txyoga/test/test_serialization.py
Python
isc
2,471
# -*- coding: iso-8859-1 -*- """A lexical analyzer class for simple shell-like syntaxes.""" from __future__ import print_function # Module and documentation by Eric S. Raymond, 21 Dec 1998 # Input stacking and error message cleanup added by ESR, March 2000 # push_source() and pop_source() made explicit by ESR, January...
looooo/pivy
scons/scons-local-1.2.0.d20090919/SCons/compat/_scons_shlex.py
Python
isc
11,866
#!/usr/bin/env python # Copyright (c) 2010-2016, Daniel S. Standage and CONTRIBUTORS # # The AEGeAn Toolkit is distributed under the ISC License. See # the 'LICENSE' file in the AEGeAn source code distribution or # online at https://github.com/standage/AEGeAn/blob/master/LICENSE. from __future__ import print_function...
standage/AEGeAn
data/scripts/version.py
Python
isc
1,633
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016, Silvio Peroni <essepuntato@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. ...
essepuntato/opencitations
script/tools/create_nq.py
Python
isc
4,821
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import connection from django.utils.translation import ugettext as _ from modoboa.lib.exceptions import InternalError def db_table_exists(table): """Check if table exists.""" return table in conn...
tonioo/modoboa
modoboa/lib/db_utils.py
Python
isc
848
import logging import sys from mutant.parsers.python_parser import PythonParser logger = logging.getLogger(__name__) class MutantApp(object): """ App stores all readers, parser middlewares generators. All plugins can register themselves on this instance. And finally it has `parse` and `mutate` meth...
peterdemin/mutant
src/mutant/app.py
Python
isc
2,308
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2022 F4PGA 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 # # Unl...
SymbiFlow/prjuray
fuzzers/002-tilegrid/generate_full.py
Python
isc
11,798
#!/usr/bin/env python import logging import time import pymongo from pyfocas.Collector import Collector from pyfocas.Machine import Machine from FanucImplementation.DriverImplementations import Fanuc30iDriver from pyfocas import Exceptions THREE_SIXTEEN = "10.108.7.41" THREE_TWENTY = "10.108.7.42" THREE_TWENTY_TWO ...
monkpit/pyfocas
aggregator.py
Python
mit
3,926
from .module import FakeShopModule __all__ = ['FakeShopModule']
hinance/www
hinance-www/weboob/modules/fakeshop/__init__.py
Python
mit
64
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import division from time import sleep from ev3.ev3dev import Motor from ev3.lego import LargeMotor from ev3.lego import ColorSensor import sys # left motor motor_b = LargeMotor(port = Motor.PORT.B) # right motor motor_c = LargeMotor(port = Motor.PORT.C) colo...
lavish/drs
snippets/tracker/tracker.py
Python
mit
1,608
from datetime import date, datetime, timedelta from os import environ from psycopg2 import ProgrammingError from spans import * from storm.expr import State from storm.locals import * from storm.variables import ListVariable from unittest import TestCase, skipUnless from .. import * from ..database import install_rang...
runfalk/stormspans
stormspans/tests/test_database.py
Python
mit
10,294
import typer from controller import log from controller.app import Application from controller.deploy.docker import Docker @Application.app.command(help="Provide instructions to join new nodes") def join( manager: bool = typer.Option( False, "--manager", show_default=False, help="join new node with manag...
rapydo/do
controller/commands/swarm/join.py
Python
mit
1,350
from django.conf import settings from django.contrib.auth import get_user_model from django.template.loader import render_to_string from core.utils.email import send_email class SendVerificationEmailTaskMixin(object): @property def email_sender(self): return NotImplemented @property def ema...
jupiny/EnglishDiary
english_diary/users/mixins/tasks.py
Python
mit
1,168
import unittest from conans.model.options import OptionsValues, PackageOptions, Options, PackageOptionValues,\ option_undefined_msg from conans.model.ref import ConanFileReference from conans.test.utils.tools import TestBufferConanOutput from conans.errors import ConanException class OptionsTest(unittest.TestCase...
tivek/conan
conans/test/model/options_test.py
Python
mit
12,830
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ---------------------------------------------------------------- # test_groupProperties.py # # test for groupProperties rule # ---------------------------------------------------------------- # copyright (c) 2014 - Domen Ipavec # Distributed under The MIT License, see L...
matematik7/CSSQC
tests/test_groupProperties.py
Python
mit
1,126
from .htu21d_mc import *
peterhinch/micropython-async
v3/as_drivers/htu21d/__init__.py
Python
mit
25
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from hwt.hdl.constants import Time from hwt.interfaces.std import Signal, HandshakeSync, VectSignal from hwt.interfaces.utils import addClkRstn, propagateClkRstn from hwt.simulator.simTestCase import SimTestCase from hwt.synthesizer.interfaceLevel.unitImplHelpers import g...
Nic30/hwtLib
hwtLib/examples/timers.py
Python
mit
4,810
#!/usr/bin/python import argparse from vmipl_communication.network_connection import NetworkConnection def main(): parser = setup_options_parser() # parse given arguments args = parser.parse_args() validate_input(parser, args) port = args.port script_content = args.vmipl_script.read() args.vmipl_script.clos...
FlorianWestphal/VMI-PL
front_end/client.py
Python
mit
2,163
def test_upgrade_atac_alignment_enrichment_quality_metric_1_2( upgrader, atac_alignment_enrichment_quality_metric_1 ): value = upgrader.upgrade( 'atac_alignment_enrichment_quality_metric', atac_alignment_enrichment_quality_metric_1, current_version='1', target_version='2', ) ...
ENCODE-DCC/encoded
src/encoded/tests/test_upgrade_atac_alignment_enrichment_quality_metric.py
Python
mit
467
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('member', '0007_auto_20150501_2124'), ] operations = [ migrations.AddField( model_name='member', name...
mozillazg/chendian-plus
chendian/member/migrations/0008_auto_20150502_1013.py
Python
mit
697
from __future__ import unicode_literals import logging import os import tornado.ioloop import tornado.web from .webhandler.DownloadHandler import DownloadHandler from .webhandler.OverviewHandler import OverviewHandler from .webhandler.GradingPreviewMailsHandler import GradingPreviewMailsHandler from .webhandler.Grad...
hhucn/netsec-uebungssystem
netsecus/korrekturserver.py
Python
mit
4,455
import requests import json import math import matplotlib.pyplot as plt data=[] price=[] #weighted price per day, reverse order volume=[] #volume USD per day onedaychange=[] Xmovingaverage=[] Xinterval=15 Ymovingaverage=[] Yinterval=50 Xdifference=[] # PERCENTAGE DIFFERENCE between X moving average and todays p...
barisser/perceptron
btcanalysis.py
Python
mit
2,614
############################# #get_L_L_H3N2_predictions.tex # # this script identifies the strain names we obtained from Luksza and Laessig # with sequences in our mutliple sequence alignment # ################################ import sys sys.path.append('../src') import predict_flu as PF from datetime import date from...
rneher/FitnessInference
flu/sequence_and_annotations/get_L_L_H3N2_predictions.py
Python
mit
1,340
#!/usr/bin/env python import os import re import sys import socket import httplib import urlparse from urllib import urlencode from urllib2 import urlopen from argparse import ArgumentParser from collections import OrderedDict def _get_discover_url(given_discover_url, update_type): if update_type == '4': r...
popen2/he_dns
update_he_dns.py
Python
mit
4,258
import pytest import numpy as np import numpy.testing as npt import toppra as ta import toppra.constraint as constraint from toppra.constants import JACC_MAXU @pytest.fixture(params=[1, 2, 6, '6d'], name='accel_constraint_setup') def create_acceleration_pc_fixtures(request): """ Parameterized Acceleration path co...
hungpham2511/toppra
tests/tests/constraint/test_joint_acceleration.py
Python
mit
3,595
#!/usr/bin/env python # -*- coding: utf-8 -*- # # MIT License # # Copyright (c) 2018 Miha Purg <miha.purg@gmail.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, ...
mpurg/qtools
qscripts-cli/q_setprot.py
Python
mit
3,879
""" ===================================== :mod:`topologies` -- Swarm topologies ===================================== This module defines various topologies for swarm intelligence algorithms. Particle swarms make use of topologies, which determine the logical relationships among partic...
aarongarrett/inspyred
inspyred/swarm/topologies.py
Python
mit
4,282
from __future__ import print_function from django.core.management.base import BaseCommand, CommandError from alapage.models import Page class Command(BaseCommand): help = 'Creates a homepage' def handle(self, *args, **options): content = "" #~ check if home exists home_exists = Page.ob...
synw/django-alapage
alapage/management/commands/create_homepage.py
Python
mit
603
from bt_proximity import BluetoothRSSI import time import sys import datetime #//////////////////////////////// BT_ADDR = 'xx:xx:xx:xx:xx:xx'#/// Enter your bluetooth address here! #//////////////////////////////// # ----------------------- DO NOT EDIT ANYTHING BELOW THIS LINE --------------------------- # def ...
stan-cap/bt_rssi
test/main_test.py
Python
mit
1,713
import boto3 region = 'ap-southeast-2' instancesContainer = [] ec2 = boto3.resource('ec2', region_name=region, api_version='2016-04-01') ec2Client = boto3.client('ec2', region_name=region, api_version='2016-04-01') #Retrieve all the instances instances = ec2.instances.filter(Filters = [{'Name':'tag:Name', 'Values'...
albertocubeddu/serverUtility
amazon/awsLambdaFunction/startInstances.py
Python
mit
852
import question_template game_type = 'input_output' source_language = 'C' parameter_list = [ ['$x0','string'],['$x1','string'],['$x2','string'], ['$y0','string'],['$y1','string'],['$y2','string'] ] tuple_list = [ ['echo_io_forward_',['a','b','c',None,None,None]], ] global_code_template = '''\ d #include &lt;s...
stryder199/RyarkAssignments
Assignment2/ttt/archive/_old/other/echo_io.py
Python
mit
750
import os.path def handle_uploaded_file(f, path, new_name=None): if new_name: file_name = new_name else: file_name = f.name destination = open(os.path.join(path, file_name), 'wb+') for chunk in f.chunks(): destination.write(chunk) destination.close()
JoshStegmaier/django-nimbus
nimbus/filehandling/fileupload.py
Python
mit
295
import unittest class TestColor(unittest.TestCase): def test(self): self.assertTrue(True)
Samael500/social-inspector
inspector/tests/test.py
Python
mit
105
from sqlalchemy.orm.session import Session, sessionmaker import transaction from sqlalchemy.orm.scoping import scoped_session from zope.sqlalchemy.datamanager import ZopeTransactionExtension from sqlalchemy.ext.declarative.api import declarative_base class MySession(Session): """This allow us to use the flask-admi...
ArneBab/gamification-engine
gengine/metadata.py
Python
mit
1,091
# -*- coding: utf-8 -*- # Copyright © 2017 Kevin Thibedeau # Distributed under the terms of the MIT license import os import math import gi import cairo from .shapes import * try: import pango import pangocairo use_pygobject = False except ImportError: gi.require_version('Pango', '1.0') from gi.repository...
SymbiFlow/symbolator
nucanvas/cairo_backend.py
Python
mit
13,085
import os import json import pyodbc import psycopg2 import psycopg2.extras from psycopg2.pool import ThreadedConnectionPool import datetime from concurrent.futures import ThreadPoolExecutor, wait import multiprocessing import sys import hashlib from utils import * THREADNUM = 16 class IntWriter: def __init__(self...
HeavenlySword/INTINT
intint/intwriter.py
Python
mit
12,384
import _plotly_utils.basevalidators class OutlinecolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="outlinecolor", parent_name="choropleth.colorbar", **kwargs ): super(OutlinecolorValidator, self).__init__( plotly_name=plotly_name, ...
plotly/python-api
packages/python/plotly/plotly/validators/choropleth/colorbar/_outlinecolor.py
Python
mit
487
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('accounts', '0005_auto_20150422_0105'), ] operations = [ migrations.AlterField( model_name='userp...
vivianbuan/cs3240-s15-team20
SecureWitness/accounts/migrations/0006_auto_20150423_1615.py
Python
mit
454
# ------------------------------------------------------------------------------- # mmc.py # # Customization of GnuHealth for the needs of Mercy Maternity Clinic, Inc. # ------------------------------------------------------------------------------- from trytond.model import ModelView, ModelSingleton, ModelSQL, fields ...
kbsymanz/gnuhealth_mmc
mmc.py
Python
mit
35,273
from color import Color from orientation import Orientation from tile import ( Terrain, Harbor, ) CENTER_TILE_TEMPLATE = [ list(' + -- + '), list(' / \ '), list('+ +'), list(' \ / '), list(' + -- + '), ] BORDER_TILE_TEMPLATE = [ list(' | -- | '), list(' - - ')...
mackorone/catan
src/view.py
Python
mit
8,044
import json import urllib import urllib2 import sys for login in json.load(open(sys.argv[1])): if login['EmailAddress']: try: # encode the json data = urllib.urlencode(login) # make the POST request # response = urllib2.urlopen('https://login.eovendo.com', data, 10) # encode ...
Discountrobot/Headless
headless/checkLogins.py
Python
mit
715
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('duck_examen', '0001_initial'), ] operations = [ migrations.AlterField( model_name='examcenter', name...
iedparis8/duck_examen
migrations/0002_auto_20150417_1207.py
Python
mit
638
#!/usr/bin/env python # Visualize the scatter of photon transmission/absorption/reflection events # in different planes. The input file and user selection determines the # representation that is produced by the script. import numpy as np import matplotlib.pyplot as plt import sys import os import time # define input...
acochran50/MCSTIL
vis/scatter_vis.py
Python
mit
2,419
from OctaHomeCore.OctaFiles.urls.base import * from OctaHomeTempControl.views import * class TempControlOctaUrls(OctaUrls): @classmethod def getUrls(cls): return [ url(r'^TempControl/command/(?P<command>\w+)/$', handleTempCommand.as_view(), name='TempControlCommandWithOutDevice'), url(r'^TempControl/command/...
Tomcuzz/OctaHomeAutomation
OctaHomeTempControl/OctaFiles/urls.py
Python
mit
1,656
# -*- coding: utf-8 from __future__ import absolute_import, unicode_literals import django DEBUG = True USE_TZ = True # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = "o0fy)a6pmew*fe9b+^wf)96)2j8)%6oz555d7by7_(*i!b8wj8" DATABASES = { "default": { "ENGINE": "django.db.backe...
rparent/django-lock-tokens
tests/settings.py
Python
mit
1,481
import sys import os import os.path import difflib import subprocess import re import pydoc import inspect import unittest import xml.etree import test.test_support from contextlib import contextmanager from test.test_support import TESTFN, forget, rmtree, EnvironmentVarGuard from test import pydoc_mod ...
babyliynfg/cross
tools/project-creator/Python2.6.6/Lib/test/test_pydoc.py
Python
mit
12,989
import numpy as np import binvox_rw import numba import mcubes @numba.jit(forceobj=True) def get_voxel_resolution(pc, patch_size): """ This function takes in a pointcloud and returns the resolution of a voxel given that there will be a fixed number of voxels. For example if patch_size is 40, then we...
CRLab/curvox
src/curvox/pc_vox_utils.py
Python
mit
14,287
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="size", parent_name="scatterternary.selected.marker", **kwargs ): super(SizeValidator, self).__init__( plotly_name=plotly_name, parent_...
plotly/python-api
packages/python/plotly/plotly/validators/scatterternary/selected/marker/_size.py
Python
mit
509
#!/usr/bin/env python import roslib; roslib.load_manifest('beginner_tutorials') import rospy import actionlib from beginner_tutorials.msg import * if __name__ == '__main__': rospy.init_node('do_dishes_client') client = actionlib.SimpleActionClient('do_dishes', DoDishesAction) client.wait_for_server() goal = DoDi...
utmi-2014/utmi-soft3
beginner_tutorials/scripts/simple_action_client.py
Python
mit
582
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json from frappe.model.document import Document from frappe.permissions import (get_valid_perms, update_permission_property) from f...
manassolanki/frappe
frappe/core/doctype/user_permission/user_permission.py
Python
mit
1,295
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Class for bitcoind node under test""" import contextlib import decimal import errno from enum import E...
yacoin/yacoin
test/functional/test_framework/test_node.py
Python
mit
24,353
''' Created by auto_sdk on 2015.06.23 ''' from aliyun.api.base import RestApi class Rkvstore20150101DescribeInstancesRequest(RestApi): def __init__(self,domain='r-kvstore.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.InstanceIds = None self.InstanceStatus = None self.PageNumber = None self...
francisar/rds_manager
aliyun/api/rest/Rkvstore20150101DescribeInstancesRequest.py
Python
mit
447
# -*- 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): # Adding model 'TimedOffer' db.create_table(u'timedoffers_timedoffer', ( ...
djmckee/django-cms-timedcontent
timedoffers/migrations/0001_initial.py
Python
mit
1,757
"""Fake output as if code was typed in an interactive interpreter This is used to generate docs """ import ast import sys from pyterm import Term # copy from doit.action class Writer(object): """write to many streams""" def __init__(self, *writers): """@param writers - file stream like objects""" ...
schettino72/pyterm
ddemo.py
Python
mit
2,060
from gensim import corpora,models,utils import numpy as np from pymongo import MongoClient from preprocess_text import clean from corpus_dictionary import custom_corpus, CompleteCorpus client = MongoClient() db = client['crawled_news'] collection = db['crawled_news'] def tagged_docs(): for d in collection.find():...
amirothman/news_aggregator
modelling.py
Python
mit
3,268
from functools import wraps from threading import RLock import traceback def Synchronized(lock=None): """ :param lock: if None - global lock will used, unique for each function :return: """ if not lock: lock=RLock() def decorator(fn): @wraps(fn) def wrapped(*args, **kw...
shaddyx/simpleDecorators
simpledecorators/Synchronized.py
Python
mit
511
import glob import pandas as pd import numpy as np import os os.chdir('/Users/evanbiederstedt/Downloads/annoOld_files') # set glob subdirectory via cell batch normalB_cellbatch_mcell = glob.glob("RRBS_NormalBCD19pCD27mcell45_66*.anno") newdf1 = pd.DataFrame() for filename in normalB_cellbatch_mcell: df = pd.re...
evanbiederstedt/RRBSfun
scripts/PDR_GenomicRegions_mcell45_66.py
Python
mit
7,713
import _plotly_utils.basevalidators class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="thicknessmode", parent_name="surface.colorbar", **kwargs ): super(ThicknessmodeValidator, self).__init__( plotly_name=plotly_name, ...
plotly/plotly.py
packages/python/plotly/plotly/validators/surface/colorbar/_thicknessmode.py
Python
mit
506
# Input: # 2 # 5 # 1 2 3 4 5 # 6 # 2 4 6 7 5 1 # # Output: # 3 # 7 def findMid(head): if head == None: return -1 fast, slow = head, head while fast.next != None and fast.next.next != None: fast = fast.next.next slow = slow.next if fast.next != None: return slow.next ...
HoussemCharf/FunUtils
linked_lists/1_finding_middle_element_in_a_linked_list.py
Python
mit
335
from django.db import models from django.conf import settings # Create your models here. User = settings.AUTH_USER_MODEL class Genre(models.Model): genre = models.CharField(max_length=30) def __unicode__(self): return self.genre class Movie(models.Model): name = models.CharField(max_length=255) ...
triump0870/movie_task
src/movie/models.py
Python
mit
719
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth import login as user_login, logout as user_logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.core.exceptions impor...
OuO/pyconkr-2015
pyconkr/views.py
Python
mit
12,387
""" ============= Generic Views ============= Class based helper views. """ class GenericManyToMany(object): """Generic view to edit many to many relations with extra fields.""" left_table = None right_table = None allow_multiple = True
tjnapster555/django-edu
djangoedu/core/generic_views.py
Python
mit
264
"""AWS ECS: Update cluster service to utilize a cloned task definition. Clone latest task and register it in order to update the image used on tasks in the service. It will take a while because it needs to drain connections and some other stuff. """ import sys import os import subprocess import json # we don't wan...
opensyllabus/osp-api
taskrefresh.py
Python
mit
2,540
import logging import aiohttp_jinja2 from aiohttp import web from aiohttp_session import get_session from .sa import check_password, user_exist, create_user auth_logger = logging.getLogger('auth.logger') @aiohttp_jinja2.template('auth/login.html') async def login(request): session = await get_session(request) ...
dmitriyminer/webgpio
webgpio/auth/views.py
Python
mit
2,048
import xml.etree.ElementTree as ET import os from Element import Element class PythonToGMX(object): def __init__(self, pythonTree): self.pythonroot = pythonTree self.root = ET.Element(eval(self.pythonroot.tag)) for child in self.pythonroot.children: self.process(child, self.root) def process(self, elemen...
Karuji/GMProjectImporter
PythonToGMX.py
Python
mit
493
__file__ = 'IRI_v1' __date__ = '5/15/2014' __author__ = 'ABREZNIC' import arcpy, os, datetime, csv, tpp now = datetime.datetime.now() curMonth = now.strftime("%m") curDay = now.strftime("%d") curYear = now.strftime("%Y") today = curYear + "_" + curMonth + "_" + curDay input = arcpy.GetParameterAsText(0) calRhino = ar...
adambreznicky/python
DanMan/IRI_v5_fixer.py
Python
mit
11,750
#Aqui resolveremos los puntos de la tarea import time import matplotlib.pyplot as plt import numpy as np from astropy import constants as const from astropy import units as un from scipy import integrate #PRIMERA PARTE #Cargamos los datos y definimos arreglos para la Longitud y el Flujo Datos = np.loadtxt("s...
faridborbar/01Tarea
Codigo.py
Python
mit
4,518
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
Kraymer/beets
beets/ui/commands.py
Python
mit
59,450
# A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: # 1/2 = 0.5 # 1/3 = 0.(3) # 1/4 = 0.25 # 1/5 = 0.2 # 1/6 = 0.1(6) # 1/7 = 0.(142857) # 1/8 = 0.125 # 1/9 = 0.(1) # 1/10 = 0.1 # Where 0.1...
drcsturm/project-euler
p026.py
Python
mit
1,084
from os.path import join, dirname from setuptools import setup, find_packages __version__ = open(join(dirname(__file__), 'pybot/VERSION')).read().strip() install_requires = ( 'requests>=2.4.0', 'websocket-client>=0.22.0', 'slacker>=0.5.5', 'six>=1.10.0' ) # yapf: disable excludes = ( '*test*', ...
junhuqc/pybot
setup.py
Python
mit
1,259
from __future__ import absolute_import, unicode_literals __version__ = '0.39' __license__ = 'MIT' import re import os import sys import time import logging import marshal import tempfile import threading from math import log from hashlib import md5 from ._compat import * from . import finalseg if os.name == 'nt': ...
gumblex/jieba
jieba/__init__.py
Python
mit
19,003
from __future__ import print_function import pandas as pd import os #This program will find all the compound words in a long list of words, by #taking the lexicon of all half-as-many-letters words and checking them against #the long list. print(os.getcwd()) #os.chdir() If using within psychopy, might start out in wr...
alexholcombe/words-calculate
anagramsCalculate.py
Python
mit
3,348
''' Created by auto_sdk on 2013.11.26 ''' from top.api.base import RestApi class PictureIsreferencedGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.picture_id = None def getapiname(self): return 'taobao.picture.isreferenced.get'
colaftc/webtool
top/api/rest/PictureIsreferencedGetRequest.py
Python
mit
318
""" Pov-ray template rendering ========================== This is a driver module that renders the pov-ray template for the given molecule and user configuration based on the several other modules for transforming molecular information into more and more primtive pov-ray objects. """ import pystache import pkg_resou...
tschijnmo/ccpoviz
ccpoviz/renderpov.py
Python
mit
2,302
# -*- coding: utf-8 -*- """" Folium Features Tests --------------------- """ import os from branca.six import text_type from branca.element import Element from folium import Map, Popup from folium import features tmpl = """ <!DOCTYPE html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /...
talespaiva/folium
tests/test_features.py
Python
mit
3,684
import _plotly_utils.basevalidators class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="alignsrc", parent_name="contour.hoverlabel", **kwargs ): super(AlignsrcValidator, self).__init__( plotly_name=plotly_name, parent_nam...
plotly/python-api
packages/python/plotly/plotly/validators/contour/hoverlabel/_alignsrc.py
Python
mit
466
# -*- coding: utf-8 -*- # # pymdstat documentation build configuration file, created by # sphinx-quickstart on Sat Dec 20 16:43:07 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. # # ...
nicolargo/pymdstat
docs/conf.py
Python
mit
8,164
# -*- coding: utf-8 -*- """collection of helpers for Miner module.""" import ipaddress import json import odin from odin.store import ThreadedModel # Default logging capabilities (logging nowhere) log = odin.get_logger() def findip(string): """calculate hosts to be scanned; it's just an helper. :param str...
j0lly/Odin
odin/utils.py
Python
mit
3,748
"""empty message Revision ID: a482d6aceb85 Revises: 01356afcc714 Create Date: 2017-11-09 15:57:26.288532 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a482d6aceb85' down_revision = '01356afcc714' branch_labels = None depends_on = None def upgrade(): # ...
ahoarfrost/metaseek
server/migrations/versions/a482d6aceb85_.py
Python
mit
670
# dev/py/upax3/upax3/ftlog.py """ Fault-tolerant log for a Upax node. """ import os import re # import sys from collections import Container, Sized from xlattice import (HashTypes, check_hashtype, # u, SHA1_HEX_NONE, SHA2_HEX_NONE, SHA3_HEX_NONE, BLAKE2B_HEX_NONE) from ...
jddixon/upax_py
src/upax/ftlog.py
Python
mit
16,036
# -*- coding: utf-8 -*- from django.conf.urls import re_path from . import views app_name = 'bookmark' urlpatterns = [ re_path(r'^(?P<topic_id>[0-9]+)/create/$', views.create, name='create'), re_path(r'^(?P<topic_id>[0-9]+)/find/$', views.find, name='find'), ]
nitely/Spirit
spirit/comment/bookmark/urls.py
Python
mit
273
""" Very simple example for creating and adding nodes to a graph """ from ds.vortex.core import graph from ds.vortex.nodes.constants import scalar from ds.vortex.nodes.math.basic import sum from ds.vortex.nodes.math.basic import multiply def testExample(): """Simple test example adding three math nodes,...
dsparrow27/vortex
src/ds/vortex/examples/simple.py
Python
mit
2,226
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-02 07:44 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('distances', '0010_auto_20170519_1604'), ] operations = [ migr...
tkettu/rokego
distances/migrations/0011_auto_20170602_1044.py
Python
mit
513
# -*- coding: utf8 ''' Common code for clustering tasks ''' from __future__ import division, print_function from sklearn.cluster import KMeans from sklearn.cluster import MiniBatchKMeans from sklearn.metrics import pairwise from vod.stats.ci import half_confidence_interval_size import numpy as np def kmeans_betacv(...
flaviovdf/vodlibs
vod/learn/cluster.py
Python
mit
2,393
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, antecedents, out_attributes, user_options, num_cores, outfile): from genomicode import filelib import os from genomicode imp...
jefftc/changlab
Betsy/Betsy/modules/plot_geneset_score_bar.py
Python
mit
1,784
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
bank-netforce/netforce
netforce_account/netforce_account/models/account_credit_alloc.py
Python
mit
9,494
# -*- coding: utf-8 -*- """ Created on Sat Jul 26 23:01:44 2014 @author: Jose Capriles """ import pygame, Buttons from pygame.locals import * #Initialize pygame pygame.init() class Button_Test: def __init__(self): self.loopFlag = True self.main() #Create a display ...
jrcapriles/armSimulator
ButtonTest.py
Python
mit
1,443