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
# Copyright 2016 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...
AndreasMadsen/tensorflow
tensorflow/contrib/solvers/python/ops/util.py
Python
apache-2.0
1,889
# Copyright 2012 OpenStack Foundation # # 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...
dpgoetz/swift
swift/common/middleware/keystoneauth.py
Python
apache-2.0
25,905
"""Track progress of completed DESI observations. """ from __future__ import print_function, division import os.path import numpy as np import astropy.table import astropy.units as u import desimodel.io import desiutil.log import desisurvey.config import desisurvey.utils # Increment this value whenever a non-bac...
desihub/desisurvey
py/desisurvey/old/progress.py
Python
bsd-3-clause
26,909
import pytest from django.utils import timezone from api.base.settings.defaults import API_BASE from django.contrib.auth.models import Permission from osf.models import RegistrationSchema from osf_tests.factories import ( ProjectFactory, RegistrationFactory, AuthUserFactory, CollectionFactory, Draf...
erinspace/osf.io
api_tests/nodes/views/test_node_draft_registration_list.py
Python
apache-2.0
19,847
from __future__ import with_statement import sys from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.template import TemplateDoesNotExist from django.test.testcases import TestCase from djangocms_text_cke...
amaozhao/basecms
cms/tests/api.py
Python
mit
9,853
import random def shellSort(array): n = len(array) gap = n/2 while gap > 0: for i in range(gap,n): temp = array[i] j = i while j >= gap and array[j-gap] >temp: array[j] = array[j-gap] j -= gap array[j] = temp ga...
parcpaes/cplus
vectors/shellSort.py
Python
lgpl-2.1
459
# 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 ...
lmazuel/azure-sdk-for-python
azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization.py
Python
mit
1,967
# Lint as: python3 # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
tensorflow/tensorflow
tensorflow/python/keras/distribute/sidecar_evaluator.py
Python
apache-2.0
11,398
from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import random as random import numpy as np import sys fill, view = True, True width, height = 1000, 1000 theta, sign = 0.0, 1.0 rotate = 0 ex = 0 ey = 0 ez = 8 #trianger obA = [ [3.0 , 0.0] ,[6.0, 0.0] , [4.5, 3.0] ] #r...
dewtx29/python_ann
project/cg/homework/1_rotate_object.py
Python
gpl-3.0
5,874
from collections import OrderedDict, defaultdict from .misc.ux import deprecated import copy import re import logging import claripy l = logging.getLogger(name=__name__) # pycparser hack to parse type expressions errorlog = logging.getLogger(name=__name__ + ".yacc") errorlog.setLevel(logging.ERROR) try: import ...
iamahuman/angr
angr/sim_type.py
Python
bsd-2-clause
38,799
from pycp2k.inputsection import InputSection class _point65(InputSection): def __init__(self): InputSection.__init__(self) self.Type = None self.Atoms = [] self.Weights = [] self.Xyz = None self._name = "POINT" self._keywords = {'Xyz': 'XYZ', 'Type': 'TYPE'}...
SINGROUP/pycp2k
pycp2k/classes/_point65.py
Python
lgpl-3.0
397
#!/usr/bin/python # 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 distributed...
Jmainguy/ansible-modules-extras
cloud/misc/proxmox.py
Python
gpl-3.0
18,785
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: [email protected] ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
CMUSV-VisTrails/WorkflowRecommendation
vistrails/gui/debugger.py
Python
bsd-3-clause
10,087
# -*- coding: utf-8 -*- """ rdd.exceptions ~~~~~~~~~~~~~~ This module contains the exceptions raised by rdd. """ from requests.exceptions import * class ReadabilityException(RuntimeError): """Base class for Readability exceptions.""" class ShortenerError(ReadabilityException): """Failed to shorten URL."...
mlafeldt/rdd.py
rdd/exceptions.py
Python
mit
407
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Geoffrey T. Dairiki # """ """ from __future__ import absolute_import from trac.core import Interface class ILoginManager(Interface): """Store authentication state. """ def remember_user(req, authname): """ Set the current user to ``authname``. ...
trac-hacks/trac-oidc
trac_oidc/api.py
Python
bsd-3-clause
614
"""Default tags used by the template system, available to all templates.""" from __future__ import unicode_literals import sys import re from datetime import datetime from itertools import groupby, cycle as itertools_cycle import warnings from django.conf import settings from django.template.base import (Node, NodeLi...
jgeskens/django
django/template/defaulttags.py
Python
bsd-3-clause
50,082
#!/usr/bin/env python # 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...
googleapis/python-videointelligence
samples/labels/labels.py
Python
apache-2.0
3,327
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from pymongo import MongoClient class MongoPipeline(object): client = MongoClient('localhost', 27017) db = client.cigrasp def process_item(...
digitalmethodsinitiative/emaps
code_project_7,8,9/undp/pipelines.py
Python
apache-2.0
403
import ctypes class MPQFileData(ctypes.Structure): _fields_ = [ ('filename', ctypes.c_char * 1024), ('plainpath', ctypes.c_char_p), ('hashindex', ctypes.c_int, 32), ('blockindex', ctypes.c_int, 32), ('filesize', ctypes.c_int, 32), ('fileflags', ctypes.c_int, 32), ...
srounet/pystormlib
pystormlib/structure.py
Python
mit
485
#!/usr/bin/env python import sys import os import tempfile import glob import filecmp import time from argparse import ArgumentParser usage = "usage: %prog [options] program_to_test" parser = ArgumentParser(description="""Testrunner for programming puzzles, runs a program against each .in-file and checks the...
plilja/algolib
util/checksol.py
Python
apache-2.0
2,044
class Redraw: """ Invalidate bitmasks. """ Nothing = 0 Cursor = 1 Borders = 2 Panes = 4 StatusBar = 16 ClearFirst = 32 All = Cursor | Borders | Panes | StatusBar | ClearFirst
jonathanslenders/python-vterm
libpymux/invalidate.py
Python
bsd-2-clause
210
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
maljac/odoo-addons
product_stock_location/__openerp__.py
Python
agpl-3.0
1,577
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0008_auto_20150907_0317'), ] operations = [ migrations.RenameField( model_name='experiment', ...
niekas/dakis
dakis/core/migrations/0009_auto_20150907_0553.py
Python
agpl-3.0
408
#!usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from collections import Counter from operator import itemgetter import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns import numpy as np from gensim.models import Word2Vec from sklearn.cluster im...
mikekestemont/pandora
pandora/pretraining.py
Python
mit
6,321
import unittest import utils from tree import TreeNode # O(n) time. O(log(n)) space. Recursive post-order DFS. class Solution: def pruneTree(self, root): """ :type root: TreeNode :rtype: TreeNode """ def prune(node): if not node: return True ...
chrisxue815/leetcode_python
problems/test_0814.py
Python
unlicense
1,085
r""" Summary ---------- This test checks correctness of docker run -u ... Operational Summary -------------------- 1. get container's /etc/passwd 2. generate uid which suits the test needs (nonexisting, existing name, uid..) 3. execute docker run -u ... echo $UID:$GID; whoami 4. check results (pass/fail/details)...
luwensu/autotest-docker
subtests/docker_cli/run_user/run_user.py
Python
gpl-2.0
10,198
# coding=utf-8 # 方便出中文版,采用utf-8字符 import random secret = random.randint(1,100) guess = int(0) tries = int(0) #加载随机数模块,生成了一个1-99的随机整数为答案。并将"猜的数字(guess)"和"次数(tries)"初始化。 print("我是个可怕的海盗,罗伯特。我有个秘密!") print("猜一个1-99的整数,你有6的机会。") #开场语,"我是可怕的海盗罗伯特,我有个秘密!" #开场语,"猜一个1-99的整数,你有6次机会。" while int(guess) != secre...
duaiyumi/python-test
NumGuessGame_vip.py
Python
gpl-3.0
1,598
import torch from .Module import Module class SoftShrink(Module): def __init__(self, lambd=0.5): super(SoftShrink, self).__init__() self.lambd = lambd def updateOutput(self, input): self._backend.SoftShrink_updateOutput( self._backend.library_state, input, ...
RPGOne/Skynet
pytorch-master/torch/legacy/nn/SoftShrink.py
Python
bsd-3-clause
678
#!python.exe import find_distances stations_in = [find_distances.Station("Raynes Park, UK", "RAY")] stations_out = find_distances.get_stations_close_to(stations_in, "driving", "Wimbledon, UK", 7000) for s in stations_out: print s stations_out = find_distances.get_stations_close_to(stations_in, "transit", ...
PeterSchuebel/home-finder
test_find_distances.py
Python
gpl-2.0
385
from asposewords import Settings from com.aspose.words import Document from com.aspose.words import NodeType from com.aspose.words import AutoFitBehavior class AutoFitTables: def __init__(self): self.dataDir = Settings.dataDir + 'programming_documents/' doc = Document(self.dataDir + "Test...
aspose-words/Aspose.Words-for-Java
Plugins/Aspose_Words_Java_for_Jython/asposewords/programming_documents/AutoFitTables.py
Python
mit
1,685
#!/usr/bin/env python """ /******************************************************************************* * Copyright (c) cortical.io GmbH. All rights reserved. * * This software is confidential and proprietary information. * You shall use it only in accordance with the terms of the * license agreement you ente...
cortical-io/python-client-sdk
cortical/textApi.py
Python
bsd-2-clause
5,619
import bpy import colorsys from math import sin, cos, pi from mathutils import Euler TAU = 2*pi def rainbow_lights(r=5, n=100, freq=2, energy=100): for i in range(n): t = float(i)/float(n) pos = (r*sin(TAU*t), r*cos(TAU*t), r*sin(freq*TAU*t)) # Create lamp bpy.ops.object.add(type=...
njanakiev/blender-scripting-intro
scripts/simple_sphere.py
Python
mit
2,273
import argparse import os import sys from collections import defaultdict from postprocess import processdata from utility import utility import config parser = argparse.ArgumentParser( description="Counts for a given metric how often it occurs per hour. " + "Creates then daily and a monthly tsv file containg t...
Wikidata/QueryAnalysis
tools/getHourlyMetricCount.py
Python
apache-2.0
3,940
from pyscp import core, utils, snapshot, wikidot
anqxyr/pyscp
pyscp/__init__.py
Python
mit
48
from scope import * class CPPCompiler: pass class ObjectCompiler(CPPCompiler): def __init__(self, name): self.parName = name + "&" self.typeName = name self.retName = name self.deserial = "%s = %s.deserializeObject(inStream)" % ("%s",name) self.serial = "cxn.serializeObject(%s, outStream)" % ("%s") Abs...
disnesquick/ripley
codegen/cpp.py
Python
gpl-2.0
3,787
from django.core.exceptions import ImproperlyConfigured from django.utils.six import string_types from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS from .base import BaseConfig __all__ = [ "LegacyConfig" ] class empty(object): pass class LegacyConfig(BaseConfig): def _get_application_settings(sel...
matthewh/django-push-notifications
push_notifications/conf/legacy.py
Python
mit
5,166
# # 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 "License"); you may not us...
jasonkuster/beam
sdks/python/apache_beam/examples/complete/autocomplete.py
Python
apache-2.0
3,029
"""Constants. From pygame: QUIT MOUSEBUTTONDOWN MOUSEBUTTONUP MOUSEMOTION KEYDOWN PGU specific: ENTER EXIT BLUR FOCUS CLICK CHANGE OPEN CLOSE INIT Other: NOATTR """ import pygame from pygame.locals import QUIT, MOUSEBUTTONDOWN, MOUSEBUTTONUP, MOUSEMOTION, KEYDOWN, USEREVENT ENTER = pygame.locals.USE...
smathot/opensesame_questionnaire_plugins
multiple_choice/pgu/gui/const.py
Python
gpl-2.0
619
#!/usr/bin/python # Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright n...
jebpublic/pybvc
samples/sampleopenflow/demos/demo40.py
Python
bsd-3-clause
11,998
#!/usr/bin/env python """Convert fastq to fasta Usage: python fastq_to_fastq.py inputfile outputfile proportion Where: inputfile is a fastq or fastq.gz file outputfile is a fastq or fastq.gz file to output to proportion is the proportion of converted Ts """ # Modules import sys import gzip import ran...
wkh124/wkh124
fastq_rrbs_convert.py
Python
gpl-3.0
1,200
# coding:utf-8 ''' created on 2018/2/24 @author:sunyihuan ''' import tensorflow as tf import os from tensorflow.python.tools import inspect_checkpoint as chkp logdir = '/Users/sunyihuan/Desktop/孙义环/mnist-model/mnist_data' # chkp.print_tensors_in_checkpoint_file(logdir+'/model_epoch_0008_step_3860',tensor_name='Prima...
sunyihuan326/DeltaLab
mnist/model.py
Python
mit
803
from betamax import Betamax import sys from currencycloud import Client, Config from currencycloud.resources import * def is_string(s): if sys.version_info[0] < 3: return isinstance(s, basestring) else: return isinstance(s, str) class TestActions: beneficiary_id = None beneficiary_f...
CurrencyCloud/currencycloud-python
tests/integration/test_actions.py
Python
mit
7,051
# -*- coding: utf-8 -*- """The artifact knowledge base object. The knowledge base is filled by user provided input and the pre-processing phase. It is intended to provide successive phases, like the parsing and analysis phases, with essential information like the timezone and codepage of the source data. """ from __f...
rgayon/plaso
plaso/engine/knowledge_base.py
Python
apache-2.0
15,317
import sys sys.path.append("yam") sys.path.append("../../yam") import config, clientapp, threading import time from devices import DevicePresenceBroadcaster, Device from player import LocalPlayer, RemotePlayer class TestClientApp: config.setConfigFolder('tests/config/') clientReceivedBroadcastMsg = False device =...
Aleksandre/YAM
tests/unit/test_clientapp.py
Python
mit
1,536
from collections import OrderedDict import numpy as np from ._ut_constants import constit_index_dict, ut_constants from .astronomy import ut_astron from .utilities import Bunch def ut_cnstitsel(tref, minres, incnstit, infer): """ Select constituents and organize constituent data. inputs tref = re...
wesleybowman/UTide
utide/constituent_selection.py
Python
mit
4,849
# META: timeout=long import pytest from tests.support.asserts import assert_error, assert_success, assert_dialog_handled from tests.support.inline import inline def get_element_property(session, element_id, name): return session.transport.send( "GET", "session/{session_id}/element/{element_id}/property/...
UK992/servo
tests/wpt/web-platform-tests/webdriver/tests/get_element_property/user_prompts.py
Python
mpl-2.0
4,054
# -*- coding: utf-8 -*- import datetime, time, csv, os from utils.db import SqliteDB from utils.rwlogging import log from utils.rwlogging import strategyLogger as logs from trader import Trader from indicator import ma, macd, bolling, rsi, kdj from strategy.pool import StrategyPool highest = 0 def runStrategy(prices)...
rolandwz/pymisc
utrader/strategy/bollingTrader.py
Python
mit
2,348
#!/usr/bin/python """Test of radio button output using Firefox.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(KeyComboAction("<Alt>f")) sequence.append(KeyComboAction("p")) sequence.append(utils.StartRecordingAction()) sequence.append(KeyComboAction("<Alt>a")) sequence....
pvagner/orca
test/keystrokes/firefox/ui_role_radio_button.py
Python
lgpl-2.1
1,371
from django.conf.urls import url from literature import views pgsql_qualifier = r"[\w\d_]+" urlpatterns = [ url(r'^$', views.list_references,), url(r'^entry/upload/$', views.upload,), url(r'^entry/(?P<entries_id>\d+)/$', views.show_entry,), url(r'^entry/add$', views.LiteratureView.as_view(),), ur...
tom-heimbrodt/oeplatform
literature/urls.py
Python
agpl-3.0
396
""" TinyMCE 4 forms widget This TinyMCE widget was copied and extended from this code by John D'Agostino: http://code.djangoproject.com/wiki/CustomWidgetsTinyMCE """ import json import logging from django.conf import settings from django.contrib.admin import widgets as admin_widgets from django.forms import Media, Te...
browniebroke/django-tinymce4-widget
src/tinymce/widgets.py
Python
mit
5,392
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class AnyTests(TranspileTestCase): pass class BuiltinAnyFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["any"]
cflee/voc
tests/builtins/test_any.py
Python
bsd-3-clause
211
# -*- coding: utf-8 -*- # Copyright (C) 2010, 2011, 2012 Sebastian Wiesner <[email protected]> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, or (at...
Stratoscale/inaugurator
inaugurator/pyudev/_libudev.py
Python
apache-2.0
10,338
# 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/v2019_12_01/aio/operations/_virtual_routers_operations.py
Python
mit
24,260
from .parameter import parameter from .attribute import attribute from .wasp import wasp
agoose77/hivesystem
hiveguilib/spyderbees/__init__.py
Python
bsd-2-clause
89
from django.conf.urls import url from django.contrib.auth.views import password_change from . import views urlpatterns = [ url(r'^$', views.UserList.as_view(), name='user_list'), url(r'^edit/$', views.UserUpdate.as_view(), name='user_profile_edit'), url(r'^change-password/$', password_change, name='user_...
lebronhkh/pythondotorg
users/urls.py
Python
apache-2.0
1,059
''' Integrate tRNA unique mass and find corresponding peaks ''' from RNAMassGen import GetUniqueMass from GetPeaks import GetPeaksWithRTEstimate def main(): ms_file = "./E165ug.mzML" mass_dict = GetUniqueMass("./Data/tRNAseq.txt") print mass_dict mass_list = [] mass_all_possible = dict() ...
ajing/MassSpec
Integrate.py
Python
mit
992
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), (r'^accounts/', include('allauth.urls')), (r'^accounts/', include('allauth.urls')), (r'^', in...
mainecivichackday/RISE_Survey
rise/urls.py
Python
bsd-3-clause
487
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <[email protected]> # # This file is part of Weblate <http://weblate.org/> # # 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...
mablae/weblate
weblate/trans/management/commands/unlock_translation.py
Python
gpl-3.0
1,136
"""Used as an example of sugiyama experiment. This example consists of 22 IDM cars on a ring creating shockwaves. """ from flow.controllers import IDMController, ContinuousRouter from flow.core.experiment import Experiment from flow.core.params import SumoParams, EnvParams, \ InitialConfig, NetParams, SumoCarFoll...
cathywu/flow
examples/sumo/sugiyama.py
Python
mit
1,961
cars = 100 space_in_a_car = 4.0 drivers = 30 passengers = 90 cars_not_driven = cars - drivers cars_driven = drivers carpool_capacity = cars_driven * space_in_a_car average_passengers_per_car = passengers / cars_driven print("There are", cars, "cars available.") print("There are only", drivers, "drivers available.") p...
zedshaw/learn-python3-thw-code
ex4.py
Python
mit
566
import nash.parser as parser nash_parser = parser.Parser() def test_parsing_integers(): ast = nash_parser.parse("3") assert ast == ('BLOCK', [('INTEGER', 3)]) def test_parsing_floats(): ast = nash_parser.parse("3.3") assert ast == ('BLOCK', [('FLOAT', 3.3)]) def test_parsing_addition(): ast = na...
mightymoose/nash
tests/test_parsing_math_expressions.py
Python
bsd-3-clause
1,163
import os from .script import ScriptDirectory from .environment import EnvironmentContext from . import util, autogenerate as autogen def list_templates(config): """List available templates""" config.print_stdout("Available templates:\n") for tempname in os.listdir(config.get_template_directory()): ...
adamwwt/chvac
venv/lib/python2.7/site-packages/alembic/command.py
Python
mit
8,392
# -*- coding: utf-8 -*- import xarray as xr # import pathlib as pl import numpy as np # import cartopy.crs as ccrs # import metpy # from scipy import interpolate # from datetime import datetime, timedelta from mpl_toolkits.basemap import Basemap from pyproj import Proj import matplotlib.pyplot as plt import plt_tools ...
hagne/atm-py
atmPy/data_archives/goes_satellites/satlab.py
Python
mit
7,395
# pylint: disable=no-self-use,invalid-name import numpy from keras.layers import Input, Embedding from keras.models import Model from deep_qa.layers.encoders import BOWEncoder class TestBOWEncoder: def test_on_unmasked_input(self): sentence_length = 5 embedding_dim = 10 vocabulary_size = 1...
RTHMaK/RPGOne
deep_qa-master/tests/layers/encoders/bow_encoder_test.py
Python
apache-2.0
3,504
# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
brianrock/brianrock-ringo
handlers/play.py
Python
apache-2.0
2,318
import paho.mqtt.publish as publish import sys from coapthon.client.helperclient import HelperClient import vdtp ptl = sys.argv[2] ip_address = sys.argv[1] #broker payload = 'Happy' def sendCoap(client,path,payload): response = client.post(path,payload,timeout=30) client.stop() print 'COAP sent' return if ptl ==...
aganji/vdtp
client_perf.py
Python
apache-2.0
619
# # The Python Imaging Library. # $Id$ # # EPS file handling # # History: # 1995-09-01 fl Created (0.1) # 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2) # 1996-08-22 fl Don't choke on floating point BoundingBox values # 1996-08-23 fl Handle files from Macintosh (0.3) # 2001-02-17 fl ...
FreddieShoreditch/image_folder_organiser
venv/lib/python2.7/site-packages/PIL/EpsImagePlugin.py
Python
mit
12,539
# Load in our dependencies import os from flask import Flask, request from slack_to_trello.model import SLACK_TOKEN, make_trello_card, send_slack_message # Start up a server app = Flask(__name__) # Set up our endpoints @app.route('/') def root(): """Reply to curious persons""" return 'slack-to-trello made ...
underdogio/slack-to-trello
slack_to_trello/__init__.py
Python
mit
1,930
import os import channels.asgi os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jobhuntr.settings") channel_layer = channels.asgi.get_channel_layer()
timkofu/jobhuntr
jobhuntr/asgi.py
Python
mit
151
#!/usr/bin/python # # \file directories.py # \brief Directories configuration # \date 2010-08-27 17:13GMT # \author Jan Boon (Kaetemi) # \date 2001-2005 # \author Nevrax # Python port of game data build pipeline. # Directories configuration. # # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # Copyright ...
osgcc/ryzom
ryzom/tools/build_gamedata/workspace/common/characters_maps_hr/directories.py
Python
agpl-3.0
3,224
""" Authentication adapters for Allauth """ try: from allauth.account.adapter import DefaultAccountAdapter except ImportError: print('ERROR: This authentication adapter requires django-allauth.') raise from django.conf import settings from django.contrib import messages from django.utils.translation import...
rosarior/django-autoadmin
autoadmin/auth/allauth.py
Python
mit
1,844
import os import matplotlib.pyplot as plt from matplotlib.pyplot import clf , plot , draw , show import tensorblock as tb ### Plot Initialize def initialize( shape ): plt.figure( figsize = ( 12 , 9 ) ) ### Plot Reconstruction def reconst( x1 , x2 , epoch = 0 , dir = 'figures' , shape = None ): ...
NiloFreitas/Deep-Reinforcement-Learning
tensorblock/functions/func_plotters.py
Python
mit
1,085
import os from setuptools import setup, find_packages # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path....
Lacrymology/django-google-tag-manager
setup.py
Python
mit
1,031
try: from urlparse import urlunparse except ImportError: from urllib.parse import urlunparse from datetime import timedelta from functools import partial from celery.exceptions import SoftTimeLimitExceeded from celery.task import Task from celery.utils.log import get_task_logger from demands import HTTPServic...
praekelt/seed-stage-based-messaging
subscriptions/tasks.py
Python
bsd-3-clause
21,273
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.contrib.auth.models import AbstractUser from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy...
show0k/ressources_management_django
flowers_ressources_management/users/models.py
Python
gpl-3.0
766
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.utils.transla...
shoopio/shoop
shuup/admin/modules/service_providers/views/_list.py
Python
agpl-3.0
1,374
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
blueboxgroup/neutron
neutron/plugins/ml2/drivers/type_vxlan.py
Python
apache-2.0
7,094
from nav.ipdevpoll.plugins import typeoid def test_make_new_vendor_id_has_reasonable_response(): sysobjectid = '1.3.6.1.4.1.11.2.3.7.11.51' assert typeoid.make_new_vendor_id(sysobjectid) == 'hewlettpackard'
sigmunau/nav
tests/unittests/ipdevpoll/typeoid_test.py
Python
gpl-2.0
217
import numpy as np import scipy.weave as weave import scipy.stats.stats as stats import cPickle import os, time import pdb # machine epsilon EPS = np.finfo(np.double).tiny # sum function that maintains array shape length sum = lambda x,axes: np.apply_over_axes(np.sum,x,axes) prod = lambda x,y: x*y class ADT(dict): ...
rajanil/mkboost
src/boost.py
Python
mit
18,517
# coding: utf-8 from nose.tools import assert_equal # @UnresolvedImport from clinvoc.icd10 import ICD10CM, ICD10PCS from clinvoc.icd9 import ICD9CM, ICD9PCS from clinvoc.ubrev import UBREV from clinvoc.hcpcs import HCPCS, HCPCSModifier from clinvoc.ndc import NDC from clinvoc.loinc import LOINC def test_icd10_cm_no_d...
jcrudy/clinvoc
clinvoc/test/test_code_systems.py
Python
mit
4,969
from beautifulsoup4 import beautifulsoup4 import re def sanitize(html): # allow these tags. Other tags are removed, but their child elements remain whitelist = ['em', 'i', 'strong', 'u', 'a', 'b', 'p', 'br', 'code', 'pre', 'table', 'tr', 'td' ] # allow only these attributes on these tags. No other tags ar...
fredzannarbor/pagekicker-community
scripts_python_3/bin/sanitize.py
Python
apache-2.0
2,661
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'pygesture/ui/templates/new_session_template.ui' # # Created by: PyQt5 UI code generator 5.5 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_NewSessionDialog(object): def setu...
ixjlyons/pygesture
pygesture/ui/templates/new_session_template.py
Python
bsd-3-clause
6,242
# This file is a minimal clang-format vim-integration. To install: # - Change 'binary' if clang-format is not on the path (see below). # - Add to your .vimrc: # # map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> # imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> # # The first line enables clang-fo...
8carlosf/dotfiles
vim/.vim/clang-format.py
Python
unlicense
3,961
from utils import url_xpath, State from .people import MSLegislatorScraper from .bills import MSBillScraper # from .committees import MSCommitteeScraper class Mississippi(State): scrapers = { "people": MSLegislatorScraper, # "committees": MSCommitteeScraper, "bills": MSBillScraper, }...
sunlightlabs/openstates
scrapers/ms/__init__.py
Python
gpl-3.0
8,618
# django-websockets doesn't have any models
samuelcolvin/django-websockets
django_websockets/models.py
Python
mit
44
# -*- coding: utf-8 -*- # # File: infofolder.py # # Copyright (c) 2016 by Bundesamt für Strahlenschutz # Generator: ConPD2 # http://www.condat.de # __author__ = '' __docformat__ = 'plaintext' """Definition of the InfoFolder content type. See infofolder.py for more explanation on the statements below. """ f...
OpenBfS/dokpool-plone
Plone/src/docpool.base/docpool/base/content/infofolder.py
Python
gpl-3.0
2,843
# Copyright (c) 2013 Intel Corporation # # Released under the MIT license (see COPYING.MIT) # DESCRIPTION # This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest # It provides a class and methods for running commands on the host in a convienent way for tests. import os import sys im...
marcosbontempo/inatelos
poky-daisy/meta/lib/oeqa/utils/commands.py
Python
mit
3,796
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license. # See LICENSE in the project root for license information. from urllib.parse import unquote from falcon import HTTPError, HTTPNotFound, HTTPBadRequest from ujson import dumps as json_dumps from ...auth import login_req...
diegocepedaw/oncall
src/oncall/api/v0/roster.py
Python
bsd-2-clause
7,890
# Test the module type from test.test_support import verify, vereq, verbose, TestFailed from types import ModuleType as module # An uninitialized module has no __dict__ or __name__, and __doc__ is None foo = module.__new__(module) verify(foo.__dict__ is None) try: s = foo.__name__ except AttributeError: pass ...
adaussy/eclipse-monkey-revival
plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_module.py
Python
epl-1.0
1,896
import numpy as np import pickle from scipy.spatial.distance import cosine from numpy.linalg import norm from scipy.sparse import csr_matrix class Recommender: keywords = None content_vectors = None user_preference_vectors = None user_visited_content = None USER_CONTENT_DUMP = 'user_content.dat' ...
marcospy/hackathon-globo-app
recommender/recommender.py
Python
mit
5,022
# Copyright 2017-2020 Kamil Sindi # # 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 writ...
ksindi/implements
tests.py
Python
mit
24,860
"Django-compatible disk and file backed cache." from django.core.cache.backends.base import BaseCache try: from django.core.cache.backends.base import DEFAULT_TIMEOUT except ImportError: # For older versions of Django simply use 300 seconds. DEFAULT_TIMEOUT = 300 from .fanout import FanoutCache class D...
pymedusa/SickRage
ext/diskcache/djangocache.py
Python
gpl-3.0
11,256
from typing import Any from django.conf import settings from zerver.lib.management import ZulipBaseCommand if settings.BILLING_ENABLED: from corporate.lib.stripe import invoice_plans_as_needed class Command(ZulipBaseCommand): help = """Generates invoices for customers if needed.""" def handle(self, *a...
andersk/zulip
zilencer/management/commands/invoice_plans.py
Python
apache-2.0
430
import glob import os import time import json with open('settings.json') as data_file: settings = json.load(data_file) input_folder = settings["input_folder"] output_folder = settings["output_folder"] output_name = settings["output_name"] extension = settings["extension"] custom_sorting = settings["custom_sor...
brunurd/jscompiler.py
sfconcat.py
Python
cc0-1.0
1,214
from PETScMatOps import *
wathen/PhD
MHD/FEniCS/MyPackage/PackageName/PETScFunc/__init__.py
Python
mit
26
import random def randomurl(): chars='abcdefghijklmnopqrstuvwxyz' length=random.randint(5, 20) choice=random.choice return ''.join(choice(chars) for i in range(length))+'.com' def xssencode(javascript): javascript2='eval(String.fromCharCode(%s))' % ','.join(str(ord(i)) for i in javascript) ...
RaspPiTor/JAPTT
XSS/xssencode.py
Python
mit
1,283
# Pretty-printers for bounds registers. # Copyright (C) 2013-2016 Free Software Foundation, 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 o...
thanhphat11/android_kernel_xiaomi_msm8996
toolchains/share/gdb/python/gdb/printer/bound_registers.py
Python
gpl-2.0
1,386
# ---------------------------------------------------------------------- # SSLCAUDIT - a tool for automating security audit of SSL clients # Released under terms of GPLv3, see COPYING.TXT # Copyright (C) 2012 Alexandre Bezroutchko [email protected] # ----------------------------------------------------------------------...
grwl/sslcaudit
sslcaudit/core/ConnectionAuditEvent.py
Python
gpl-3.0
1,966
import pytest from datetime import datetime from pytest_flask import fixtures from flask_login import current_user, login_user from mdt_app.models import User @pytest.mark.usefixtures('client_class', 'db_session', 'populate_db') class TestUserModel(): def setup(self): self.user = User(f_name='test', l_n...
stefpiatek/mdt-flask-app
tests/unit/test_auth_models.py
Python
mit
1,339
""" An i386 specific function analysis module that is designed to attempt to detect the calling convention. """ import collections import vivisect.impemu.monitor as viv_imp_monitor import vivisect.exc as v_exc from vivisect.const import * import vivisect.analysis.generic.switchcase as vag_switch import envi.archs....
bat-serjo/vivisect
vivisect/analysis/i386/calling.py
Python
apache-2.0
4,460