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 -*-
import urllib2
from BeautifulSoup import BeautifulSoup
class Other:
def __init__(self, url):
self.item = url
@property
def title(self):
""" return title of Item """
soup = BeautifulSoup(
urllib2.urlopen(self.item)
)
try:
... | sandlbn/drawn | shop/other.py | Python | gpl-3.0 | 661 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | open-synergy/vertical-travel | airport/__openerp__.py | Python | agpl-3.0 | 1,765 |
import glob
import os
import shutil
import sys
import nox
import nox_poetry
sys.path.append('.')
from noxutil import get_versions
CURRENT_PYTHON = (('pypy' if hasattr(sys, 'pypy_version_info') else '')
+ f'{sys.version_info.major}.{sys.version_info.minor}')
nox.options.sessions = ['check', 'check... | brechtm/rinohtype | noxfile.py | Python | agpl-3.0 | 4,671 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('basefeed', '0001_initial'),
('gamevideo', '0001_initial'),
]
operations = [
migrations.AddField(
model_n... | krinde/followup | gamevideo/migrations/0002_video_feedsource.py | Python | gpl-2.0 | 493 |
"""
Copyright (c) 2018, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE, distributed with this software.
Created on May 15, 2018
Converts Java classes to Python classes.
@author: jrm
"""
import os
from jinja2 import Template
import fnmatch
import javalang
from... | codelv/enaml-native | tools/java2py.py | Python | mit | 3,497 |
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | danieljaouen/ansible | test/units/plugins/connection/test_netconf.py | Python | gpl-3.0 | 3,564 |
"""Python 2 Unicode test."""
def main(args):
sep = args['delimiter']
str = sep + " ☃ ".decode('utf-8') + sep
print(str.encode('utf-8'))
return {"winter": str}
| duynguyen/incubator-openwhisk | tests/dat/actions/unicode2.py | Python | apache-2.0 | 179 |
import subprocess, os, sys
from reverseZone_naming import reverseZone_name
from netaddr import *
zone_files_path="/etc/bind/zones"
def remove_reverse_record():
host_name_to_be_removed= sys.argv[1]
reverse_zone_file_name,reverse_zone_name=reverseZone_name()
os.chdir(zone_files_path)
readFiles = open(reverse_zone_f... | anilveeramalli/cloudify-azure-plugin | blueprints/clustered-dns/dns/dns_remove_reverse_record.py | Python | apache-2.0 | 927 |
# -*- coding: utf-8 -*-
from geomsmesh import geompy, smesh
import math
import GEOM
import SALOMEDS
import SMESH
#import StdMeshers
#import GHS3DPlugin
#import NETGENPlugin
import logging
from fissureGenerique import fissureGenerique
from triedreBase import triedreBase
from genereMeshCalculZoneDefaut import genereM... | FedoraScientific/salome-smesh | src/Tools/blocFissure/gmu/fissureCoude.py | Python | lgpl-2.1 | 29,521 |
#!/usr/bin/python
import sys
import yaml
file = str(sys.argv[1])
def determine(item):
if ((item.get('action')=="add-br" and item.get('name')=="br-prv") or \
(item.get('action')=="add-br" and item.get('name')=="br-aux") or \
(item.get('action')=="add-br" and item.get('name')=="br-floating") or \
... | Mirantis/fuel-plugin-openldap | tools/remove-ovs-br.py | Python | apache-2.0 | 1,013 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
把gradle 下载的仓库转化为maven仓库的目录结构
gradle 的仓库默认下载到用户目录下,如:C:\\Users\\whydk[user name]\\.gradle\\caches\\modules-2\\files-2.1
gradle 仓库的目录结构是:groupId/artifactId/version/sha1/pom,jar
如:org.apache.tiles\\tiles-api\\3.0.4\83940300a42975f32339e2190acd7d326c3b64... | whyDK37/py_bootstrap | gradle_repo_to_maven_repo.py | Python | apache-2.0 | 3,569 |
################################################################################
#
# Module: Menu_Exit.py
#
# Author: Paul Tindle ( mailto:Paul@Tindle.org )
# Joe White ( mailto:joe@stoke.com )
#
# Descr: Menu execution
#
# Version: (See below) $Id$
#
# Changes:
#
# Still ToDo:
#
# License: ... | white111/CMtestpy | bin/lib/Menu.py | Python | lgpl-2.1 | 35,746 |
"""
WSGI config for trialrun project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | mpirnat/hackday | hackday/wsgi.py | Python | mit | 1,137 |
#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.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... | sorenh/python-django-greenfan | greenfan/migrations/0003_auto__add_field_server_disabled.py | Python | apache-2.0 | 4,440 |
import os
import pickle
import socket
import sys
import threading
import struct
import time
import yaml
# from gen_scraper import scraper
def handle_slave(slaveconn_info, config_info, work_info):
# print(v_chunk)
"""
handles a slave connection, sending config, work, or receiving more results.
param... | puddl3glum/gen_scraper | build/lib/gen_scraper/gen_master.py | Python | mit | 5,572 |
#
# Copyright 2017 Google 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
#
# Unless required by applicable law or... | youtube/cobalt | tools/_env.py | Python | bsd-3-clause | 942 |
import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="heatmap", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | plotly/plotly.py | packages/python/plotly/plotly/validators/heatmap/_legendgroup.py | Python | mit | 409 |
"""
Tagging related views.
"""
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.list_detail import object_list
from tagging.models import Tag, TaggedItem
from tagging.utils import get_tag, get_queryset_and_model
def tagged_object_list(request, queryset_or_m... | cidadania/e-cidadania | src/apps/thirdparty/tagging/views.py | Python | apache-2.0 | 2,113 |
import xchat
__module_name__ = "inxi"
__module_version__ = "1.0"
__module_description__ = "adds buttons for the most common inxi commands "
# delete buttons, just in case
xchat.command("delbutton CPU")
xchat.command("delbutton SYSTEM")
xchat.command("delbutton GFX")
xchat.command("delbutton AUDIO")
xchat.command("... | tecan/xchat-rt | plugins/scripts/inxi.py | Python | gpl-2.0 | 1,345 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | elopezga/ErrorRate | ivi/agilent/agilent85644A.py | Python | mit | 19,298 |
# $Id$
##
## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012)
## pyFormex is a tool for generating, manipulating and transforming 3D
## geometrical models by sequences of mathematical operations.
## Home page: http://pyformex.org
## Project page: http://savannah.nongnu.org/projects/pyformex/
##... | dladd/pyFormex | pyformex/examples/WireStent.py | Python | gpl-3.0 | 5,643 |
from django.contrib.auth import authenticate
from django.contrib.auth.models import AnonymousUser, User
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils.functional import lazy
from mock import patch
from pyquery import PyQuery as pq
from django_browserid.helpers import ... | mozilla/captain | vendor/lib/python/django_browserid/tests/test_helpers.py | Python | mpl-2.0 | 5,716 |
# -*- coding: utf-8 -*-
# Copyright 2012 Jason Kölker
#
# 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 ... | jkoelker/bushwacker | bushwacker/main.py | Python | apache-2.0 | 7,816 |
import logging
class InvalidSortKey(Exception):
message = "Sort key supplied was not valid."
# copy from glance/db/sqlalchemy/api.py
def paginate_query(query, model, limit, sort_keys, marker=None,
sort_dir=None, sort_dirs=None):
"""Returns a query with sorting / pagination criteria added.
... | lianhao/temp | try_sql.py | Python | apache-2.0 | 9,196 |
#!/usr/bin/env python
"""
Only use this script to run strip-hints from the source directory itself.
If installing from pip then a script called strip-hints will be added to
your Python scripts directory (which can be added to your PATH if it is not
already there).
The relative path of this script to the source code m... | abarker/strip-hints | bin/strip_hints.py | Python | mit | 836 |
import random
import pickle
import logging
import datetime
from google.appengine.ext import db
from gaeo import session
SESSION_DURATION = datetime.timedelta(hours = 1)
class SessionStore(db.Model):
id = db.StringProperty()
value = db.BlobProperty()
expires = db.DateTimeProperty()
... | naokits/adminkun_viewer_old | Server/gaeo/gaeo/session/datastore.py | Python | mit | 2,349 |
# Copyright 2017 Google LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | tseaver/google-cloud-python | appveyor/env_info.py | Python | apache-2.0 | 1,395 |
from __future__ import (absolute_import, division,print_function)
import numpy as np
import math
from Muon.MaxentTools.multimaxalpha import MULTIMAX
from mantid.api import *
from mantid.kernel import *
from mantid.simpleapi import *
"""
input params from MuonMaxEnt
RunNo (int)
Frames (int)
Ires (int) = resolution... | ScreamingUdder/mantid | Framework/PythonInterface/plugins/algorithms/MuonMaxent.py | Python | gpl-3.0 | 20,856 |
import sys
import os
def convbytes(bstr):
return str(buildint(bstr))
def buildint(bvals):
return int.from_bytes(bvals, byteorder='little')
def buildstr(bvals):
print(str(bvals))
#return str(bvals)
return bvals.decode("utf-8")
def getOutFile(infilename, outfiledir):
lastslashind = infilename.... | blpete16/ProgPoint | parsetwo.py | Python | gpl-2.0 | 2,963 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2009 B. Malengier
#
# 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; eithe... | beernarrd/gramps | gramps/gui/editors/displaytabs/eventrefmodel.py | Python | gpl-2.0 | 6,882 |
from collections import OrderedDict
from django import forms
from django.contrib.admin import FieldListFilter
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.utils import (
get_fields_from_path, label_for_field, lookup_needs_distinct, prepare_lookup_value, quote, unquot... | nealtodd/wagtail | wagtail/contrib/modeladmin/views.py | Python | bsd-3-clause | 33,257 |
# Copyright 2017 Google 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
#
# Unless required by applicable law or a... | spinnaker/spinnaker-monitoring | spinnaker-monitoring-daemon/tests/server_handlers_test.py | Python | apache-2.0 | 2,247 |
import DeepFried2 as df
class PoolingCUDNN(df.Module):
def __init__(self, window_size, stride=None, padding=None, mode='max'):
"""
Wraps CUDNN's pooling operation.
- `window_size`: A 2D or 3D tuple indicating the size of the pooling region.
- `stride`: A tuple or number indicating... | lucasb-eyer/DeepFried2 | DeepFried2/layers/PoolingCUDNN.py | Python | mit | 1,821 |
#!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
requires = [
"click==6.7",
"PyYAML==3.12",
"boto3==1.4.4",
"botocore==1.5.48",
"docutils==0.13.1",
"jmespath==0.9.2",
"mime==0.1.0",
"python-dateutil==2.6.0",
"s3transfer==0.1.10",
"six==1.10... | moduspwnens/boa-nimbus | setup.py | Python | mit | 1,220 |
#==============================================================================
# nohtest.py
# Run Noh test using initial conditions file 'noh.dat'.
#==============================================================================
from gandalf.analysis.facade import *
import time
# Create new Noh test simulation object ... | gandalfcode/gandalf | tests/hydro_tests/nohtest.py | Python | gpl-2.0 | 554 |
#!/usr/bin/env python
#
# Copyright (C) 2013 KKBOX Technologies Limited
# Copyright (C) 2013 Gasol Wu <gasol.wu@gmail.com>
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from setuptools import find_packages, setup
PACKAGE = 'TracAttachmen... | KKBOX/trac-attachment-notify-plugin | setup.py | Python | bsd-3-clause | 953 |
#
# Copyright (c) 2019 Google LLC.
# Copyright (c) 2016-2018 Nest Labs, 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... | openweave/openweave-core | src/test-apps/happy/test-templates/generated/nest/messages/schema_version_pb2.py | Python | apache-2.0 | 3,327 |
# Copyright 2015, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.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 requi... | tomfotherby/tower-cli | lib/tower_cli/resources/inventory_source.py | Python | apache-2.0 | 4,379 |
#This program provides a serial interface for a Superconductor Technologies Superlink cryocooler, returning the cold finger temperature,
#rejection temperature, and power drawn. It also allows you to switch the cryocooler between auto and manual shutdown modes
#I haven't used Python in ages, I'm sure there's goofs so... | petermaginot/Superlink-GUI | SuperlinkInterface.py | Python | mit | 9,216 |
#--- nbextensions configuration ---
from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir
import os
import sys
#data_dir = jupyter_data_dir()
data_dir = os.path.join(os.getcwd(), 'jupyter', 'data')
sys.path.append(os.path.join(data_dir, 'extensions'))
c = get_config()
c.Exporter.template_path = [os.pa... | pypyrus/pypyrus | jupyter/config/jupyter_nbconvert_config.py | Python | gpl-2.0 | 391 |
# coding=utf-8
import numpy as np
import pytest
from pandas import Categorical, Series
import pandas.util.testing as tm
def test_value_counts_nunique():
# basics.rst doc example
series = Series(np.random.randn(500))
series[20:500] = np.nan
series[10:20] = 5000
result = series.nunique()
asser... | GuessWhoSamFoo/pandas | pandas/tests/series/test_duplicates.py | Python | bsd-3-clause | 4,330 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# network.py
"""
Represents the network of interest. This is the primary object of PyPhi and the
context of all |small_phi| and |big_phi| computation.
"""
import json
import numpy as np
from . import cache, convert, utils, validate
from .constants import Direction
from... | slipperyhank/pyphi | pyphi/network.py | Python | gpl-3.0 | 9,047 |
"""
kde
~~~
A variety of "other" KDE methods, not drawn directly from the literature.
"""
from . import predictor
import open_cp.predictors
import tkinter as tk
import tkinter.ttk as ttk
import open_cp.kde
import open_cp.gui.tk.util as util
import open_cp.gui.tk.richtext as richtext
import open_cp.gui.tk.tooltips as ... | QuantCrimAtLeeds/PredictCode | open_cp/gui/predictors/kde.py | Python | artistic-2.0 | 25,159 |
import matplotlib.pyplot as plt
import pylab as pl
import networkx as nx
import random as rnd
import pickle
import math
import numpy as np
from matplotlib import rc
#Read the pickles
def read_pickled_metrics(k,l):
global degrees,nodes,moving
with open('RGGmetrics_random/degrees/degrees'+str(k)+'_'+str(l)+'.pickle', ... | kateBaou/Dynamic_Social_Networks | brownian_motion_simulation/RGG_degree_diff.py | Python | mit | 1,015 |
from django.db import models
from author.models import Author
from django.conf import settings
from django.utils import timezone
import uuid;
# Create your models here.
APP_URL = settings.APP_URL
class Post(models.Model):
VISIBILITY_CHOICES = [
(0, 'Public'),
(1, 'Friends'),
(2, 'Friends o... | md6113/404cmputProject | social/post/models.py | Python | apache-2.0 | 2,416 |
__author__ = 'allan'
from sys import maxsize
class Contacts:
def __init__(self, firstname=None, lastname=None, mob_phone=None, email=None, id=None):
self.firstname = firstname
self.lastname = lastname
self.mobile = mob_phone
self.email = email
self.id = id
def __repr_... | Latypov/Py_start | model/contacts.py | Python | apache-2.0 | 712 |
from .message import MessageSet
from .struct import Struct
from .types import Array, Int16, Int32, Int64, Schema, String
class FetchResponse(Struct):
SCHEMA = Schema(
('topics', Array(
('topics', String('utf-8')),
('partitions', Array(
('partition', Int32),
... | gamechanger/kafka-python | kafka/protocol/fetch.py | Python | apache-2.0 | 886 |
# encoding: utf8
# __init__.py
from telepyth.client import TelePythClient
from telepyth.utils import is_interactive
TelepythClient = TelePythClient # make alias to origin definition
if is_interactive():
from telepyth.magics import TelePythMagics
| daskol/telepyth | telepyth/__init__.py | Python | mit | 259 |
#! /usr/bin/env python
import rospy
import random
import numpy as np
from visualization_msgs.msg import Marker, MarkerArray
from nav_msgs.msg import Odometry
from std_msgs.msg import String
"""
type of marker:
ARROW = 0 --> triangle
CUBE=1 --> cruciform
SPHERE=2 --> circle
CYLINDER=3 --> totem
LINE_STRIP=4... | ron1818/Singaboat_RobotX2016 | robotx_nav/nodes/fake_scan_the_code_publisher.py | Python | gpl-3.0 | 3,193 |
# FROM https://raw.githubusercontent.com/mozilla/bedrock/master/bedrock/base/cache.py
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from django.core.cache.backends.locmem import LocMemCache
class SimpleDictCache(LocMemCache):
"""A local memory cache that doesn't pickle values.
Only for use wit... | schalkneethling/snippets-service | snippets/base/cache.py | Python | mpl-2.0 | 1,854 |
# Copyright 2013-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0#
# Unless required by applicable law or agreed to in writing... | HonzaKral/mongo-connector | mongo_connector/connector.py | Python | apache-2.0 | 31,369 |
#
# Copyright 2009 Benjamin Mellor
#
# This file is part of Fundy.
#
# Fundy 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... | cumber/fundy | utils.py | Python | gpl-3.0 | 7,484 |
__author__ = 'Antony Cherepanov'
from inversionscount import InversionsCounter
from closestpoints import ClosestPoints
| iamantony/PythonNotes | src/algorithms/search/__init__.py | Python | mit | 124 |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | samn/spectral-workbench | webserver/public/lib/bespin-0.9a2/lib/dryice/tests/test_combiner.py | Python | gpl-3.0 | 2,130 |
# PYTHON_ARGCOMPLETE_OK
"""
pytest: unit and functional testing with Python.
"""
# else we are imported
from _pytest import __version__
from _pytest.assertion import register_assert_rewrite
from _pytest.config import cmdline
from _pytest.config import hookimpl
from _pytest.config import hookspec
from _pytest.config imp... | hackebrot/pytest | src/pytest.py | Python | mit | 2,531 |
# encoding: utf-8
# module samba.dcerpc.lsa
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/lsa.so
# by generator 1.135
""" lsa DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class RefDomainList(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs): # real signature u... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/lsa/RefDomainList.py | Python | gpl-2.0 | 1,365 |
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import tornado.autoreload
import tornado.database
import os
import logging
import uuid
import hashlib
class WSHandler(tornado.websocket.WebSocketHandler):
waiters = set()
cache = []
cache_size = 200
@classmet... | awross/mtg-decko | tornado/server.py | Python | mit | 3,914 |
class Solution(object):
# dp
# time: O(n)
# space: O(n)
def new21Game(self, N, K, W):
"""
:type N: int
:type K: int
:type W: int
:rtype: float
"""
if K == 0 or N > K + W: return 1.
dp = [0.] * (N + 1)
dp[0] = 1.
... | YiqunPeng/Leetcode-pyq | solutions/837New21Game.py | Python | gpl-3.0 | 514 |
#!/usr/bin/python3
#
# Copyright (C) 2019 Google Inc.
#
# 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 program... | GoogleCloudPlatform/plspm-python | plspm/__init__.py | Python | gpl-3.0 | 706 |
from binding import *
from context import Context
def genEnumContexts(allEnums):
ungroupedName = "__UNGROUPED__"
enums = [enum for enum in allEnums if enum.type == "GLenum"]
maxLength = max([len(enumBID(enum)) for enum in enums])
enumContexts = []
for enum in enums:
groups = Context.listC... | steppobeck/rgbd-recon | external/glbinding-2.0.0/codegeneration/scripts/gen_enums.py | Python | mit | 961 |
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import models
from django.db.models import Count
from django.utils.translation import ugettext_lazy as _
from polymorphic.manager import PolymorphicManager
from polymorphic.polymorphic_model import Polym... | ojii/django-shop | shop/models/productmodel.py | Python | bsd-3-clause | 3,693 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from gaegraph.model import Node
from gaeforms.ndb import property
class Teste(Node):
preco = ndb.FloatProperty(required=True)
autor = ndb.StringProperty(required=True)
editora = ndb.String... | RoAbreu/AulaJavaScripts | PROJETO/backend/apps/teste_app/model.py | Python | mit | 489 |
""" Module to correct pulsar and FRB DMs for the MW ISM """
from ne2001 import ne_io, density #ne2001 ism model
import pygedm #ymw ism model
import numpy as np
import pandas as pd
from astropy import units as u
from astropy.coordinates import SkyCoord, Galactic
import logging
logging.basicConfig(format='%(asctime)s -... | FRBs/DM | frb/dm_kde/sort_transient_data.py | Python | bsd-3-clause | 4,742 |
from __future__ import with_statement
import sys
import datetime
import foo
from bar import *
sys.path
datetime.datetime
foo.bar() | akosyakov/intellij-community | python/testData/optimizeImports/order.after.py | Python | apache-2.0 | 132 |
from test.parser.pattern.matching.base import PatternMatcherBaseClass
class PatternMatcherWildcardBranchesTests(PatternMatcherBaseClass):
pass
| JustArchi/program-y | src/test/parser/pattern/matching/test_wildcard_branches.py | Python | mit | 149 |
from django.conf import settings
import base64
def getAuthUrl(url):
if '?' in url:
delimeter = '&'
else:
delimeter = '?'
authUrl = '{}{}client_id={}&client_secret={}'.format(
url, delimeter, settings.GITHUB_CLIENT_ID, settings.GITHUB_CLIENT_SECRET
)
return authUrl
def getBase64Bytes(content):
... | stlim0730/glide | glide/utils.py | Python | mit | 505 |
def greeting(msg):
print(msg)
print("making new branch") | maw3cn/cs3240-labdemo | helper.py | Python | mit | 61 |
#!/usr/bin/env python2
#
# You may want to alter these before running ./makebuildserver
# Name of the base box to use
basebox = "testing32"
# Location where raring32.box can be found, if you don't already have
# it. For security reasons, it's recommended that you make your own
# in a secure environment using trusted ... | fantastico/fdroidserver | examples/makebs.config.py | Python | agpl-3.0 | 635 |
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
# xierpa server
# Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com
#
# X I E R P A 3
# Distribution by the MIT License.
#
# -----------------------------------------------------------... | petrvanblokland/Xierpa3 | xierpa3/toolbox/dating.py | Python | mit | 32,005 |
"""Loading, parsing and storing of completion configurations."""
from __future__ import annotations
import abc
import dataclasses
import os
import typing as t
from .constants import (
CONTROLLER_PYTHON_VERSIONS,
SUPPORTED_PYTHON_VERSIONS,
)
from .util import (
ANSIBLE_TEST_DATA_ROOT,
read_lines_witho... | nitzmahone/ansible | test/lib/ansible_test/_internal/completion.py | Python | gpl-3.0 | 8,217 |
import sys
import requests
from termcolor import colored
ERROR_STATUS_FORMAT = 'Singularity responded with an invalid status code ({0})'
def get_json_response(uri, args, params={}):
singularity_response = requests.get(uri, params=params, headers=args.headers)
if singularity_response.status_code < 199 or singulari... | tejasmanohar/Singularity | scripts/logfetch/singularity_request.py | Python | apache-2.0 | 575 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Latinux Inc (http://www.latinux.com/) All Rights Reserved.
# Javier Duran <jduran@corvus.com.ve>
#
#
# WARNING: This program as such is intended to be used by professional
#... | 3dfxsoftware/cbss-addons | report_profit/account.py | Python | gpl-2.0 | 4,456 |
'''
Given a binary tree, check whether it’s a binary search tree or not.
'''
class Node: def __init__(self, val=None):
self.left, self.right, self.val = None, None, val
INFINITY = float("infinity")
NEG_INFINITY = float("-infinity")
def isBST(tree, minVal=NEG_INFINITY, maxVal=INFINITY):
if tree is N... | jenniferwx/Programming_Practice | ValidBinarySearchTree.py | Python | bsd-3-clause | 785 |
#!/usr/bin/env python
from codecs import open
from setuptools import find_packages, setup
with open('README.rst', 'r', 'utf-8') as f:
readme = f.read()
setup(
name='blanc-basic-pages',
version='0.3.7',
description='Blanc Basic Pages for Django',
long_description=readme,
url='https://github.... | blancltd/blanc-basic-pages | setup.py | Python | bsd-3-clause | 1,204 |
from django.core.urlresolvers import reverse
from django.db import models
# Create your models here.
class Participant(models.Model):
name = models.CharField(max_length=100, blank=False)
age = models.CharField(max_length=3, blank=False)
UMM_YES = "YES"
SAY_NO = "NO"
YES_NO_CHOICES = ((UMM_YES, 'Ye... | mczabaj/hms_udn | participants/models.py | Python | mit | 1,164 |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import product_update_from_planned_price_wizard
| ingadhoc/product | product_planned_price/wizards/__init__.py | Python | agpl-3.0 | 302 |
import collections
import json
import time
import gzip
import re
import subprocess
import operator
import functools
NestedCounter = functools.partial(collections.defaultdict, collections.Counter)
class MRCounter(collections.Iterable):
"""Two-story counter
"""
def __init__(self):
self.counter = N... | knighton/mapreduce | mrdomino/util.py | Python | mit | 5,223 |
__author__ = 'heborlz'
| hermagrini/pochoclo-system | api/lib/__init__.py | Python | apache-2.0 | 24 |
from __future__ import absolute_import, division, print_function
from .callbacks import Callback
from timeit import default_timer
from numbers import Number
import sys
overhead = sys.getsizeof(1.23) * 4 + sys.getsizeof(()) * 4
class Cache(Callback):
""" Use cache for computation
Examples
--------
... | jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/dask/cache.py | Python | mit | 2,058 |
from steve.backend.sqlitedb import SDB
from steve.item import Item
from steve.type import Type
from steve.market_group import MarketGroup
from steve.planet_schematic import PlanetSchematic
class Assets(object):
def __init__(self):
self._types = {} # { <uid... | PageArkanis/StEVE | steve/assets.py | Python | agpl-3.0 | 3,768 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2015 ASMlover. 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 copyrig... | ASMlover/study | python/bottle/hello/hello.py | Python | bsd-2-clause | 1,611 |
# support.py
# some development supporting decorators and functions
# author: Christophe VG
from __future__ import print_function
import sys
class warn():
"""
Decorator for methods to mark them with a warning when executed
"""
first = True
def __init__(self, text=None):
self.text = text
def __call__... | christophevg/py-util | src/util/support.py | Python | bsd-3-clause | 642 |
# -*- coding: UTF-8 -*-
from gnr.core import gnrstring
import datetime
import pytest
def test_getUntil():
"""docstring for test_getUntil"""
assert gnrstring.getUntil('teststring', 'st') == 'te'
assert gnrstring.getUntil('teststring', 'te') == ''
assert gnrstring.getUntil('teststring', 'te') == ''
def... | genropy/genropy-core | tests/gnrstring_test.py | Python | lgpl-2.1 | 5,103 |
import numpy as np
import catmap
from parser_base import *
string2symbols = catmap.string2symbols
Template = catmap.Template
class TableParser(ParserBase):
"""Parses attributes based on column headers and filters.
Additional functionality may be added by inheriting and defining
the parse_{header_name}... | ajmedford/catmap | catmap/parsers/table_parser.py | Python | gpl-3.0 | 17,136 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.firefox.base import FirefoxBasePage
class FirefoxAndroidPage(F... | schalkneethling/bedrock | tests/pages/firefox/android.py | Python | mpl-2.0 | 607 |
"""
This module contains all functions for adding, modifying and removing solution_type ids in the database.
Functions and Classes
---------------------
"""
from nordb.core import usernameUtilities
from nordb.database import nordicModify
from nordb.database import nordicSearch
from nordb.database import creationInfo
... | MrCubanfrog/NorDB | nordb/database/solutionTypeHandler.py | Python | mit | 3,383 |
from __future__ import print_function
import sys
py3 = sys.version_info >= (3,0)
import io
import re
import os
import itertools
import functools
TEMPLATE_PATH = ['.', './views']
TEMPLATE_EXTS = ['', '.tpl', '.html']
def render(code, **kwargs):
expre = re.compile(r'<%=\s*(.*?)\s*%>', re.DOTALL)
blkre = re.... | fallingduck/snifter | snifter/template.py | Python | bsd-3-clause | 1,878 |
"""
This file is part of EmailHarvester
Copyright (C) 2016 @maldevel
https://github.com/maldevel/EmailHarvester
EmailHarvester - A tool to retrieve Domain email addresses from Search Engines.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU... | Jeevan-J/Python_Funcode | plugins/baidu.py | Python | bsd-2-clause | 1,438 |
# Copyright (c) 2018, ETH Zurich and UNC Chapel Hill.
# 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
# notice, this ... | mapillary/OpenSfM | opensfm/actions/export_colmap.py | Python | bsd-2-clause | 20,954 |
#xc16_assembler.py
#SCons Builder Actions for the XC16 PIC assembler
import SCons.Builder
import SCons.Action
import SCons.Scanner
import os.path
import sys
import utilities
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from pymomo.utilities.paths import convert_path
def xc16_generator(source,... | amcgee/pymomo | pymomo/config/site_scons/site_tools/xc16_assembler.py | Python | lgpl-3.0 | 1,083 |
# Django settings for sunstreet project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_PATH = os.path.join(BASE_DIR, 'sunstreet/templates')
STATIC_PATH = os.path.join(BASE_... | dcarrot2/DjangoSunstreet | sunstreet/settings.py | Python | gpl-2.0 | 5,920 |
#!/usr/bin/env python3
# -*- coding: utf-8; -*-
#
# Copyright (c) 2016 Álan Crístoffer
#
# 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 ... | acristoffers/moirai | moirai/moirai.py | Python | mit | 8,554 |
#!/usr/bin/env python
# coding: utf-8
#
# Usage:
# Author: viking(auimoviki@gmail.com)
from . import outop
from .corpus import NceCorpus
| vikingMei/mxnet | example/rnn/word_lm/nce/__init__.py | Python | apache-2.0 | 139 |
# coding=utf8
import thread, sys, os, time, math, operator, socket, thread, json
from threading import Lock
from random import SystemRandom
from time import sleep
from copy import deepcopy
from socket import gethostname
from getpass import getuser
from proto import *
import pygame
from pygame.locals import *
from Qu... | g-andrade/gravity-well | client.py | Python | bsd-3-clause | 18,363 |
#!/usr/bin/env python
"""
inspectshow
Show the tree of submodules, classes, methods and functions in a module.
"""
import inspect
import imp,os, glob
import pkgutil
import pydoc
import argparse
import imp
import importlib
import os, sys, errno
###########################################
# inspectshow class
#########... | vadivelmurugank/picothing | src/python/inspectshow.py | Python | mit | 15,626 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | zestrada/nova-cs498cc | nova/api/openstack/compute/contrib/extended_ips_mac.py | Python | apache-2.0 | 4,427 |
# Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | tensorflow/tfx | tfx/tools/cli/handler/local_dag_runner_patcher.py | Python | apache-2.0 | 1,126 |
# This file is part of the Minecraft Overviewer.
#
# Minecraft Overviewer 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... | panfantastic/Minecraft-Overviewer | overviewer_core/nbt.py | Python | gpl-3.0 | 14,319 |
import pygame
import random
pygame.display.set_caption("Multi Bingo")
screen = pygame.display.set_mode((0,0))
screen.fill([0,0,0])
pygame.mouse.set_visible(False)
meter = pygame.image.load('graphics/assets/register_cover.png').convert()
magic_screen = pygame.image.load('bikini/assets/magic_screen.png').convert()
num... | bingopodcast/bingos | bingo_emulator/graphics/bikini.py | Python | gpl-3.0 | 43,305 |
from base64 import b64encode
from mimetypes import guess_type
from urllib.parse import quote
from django import template
from django.conf import settings
from django.contrib.staticfiles.finders import find
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag
def datify(va... | richardcornish/richardcornish | richardcornish/portfolio/templatetags/portfolio_tags.py | Python | bsd-3-clause | 732 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.