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 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-datalabeling
samples/generated_samples/datalabeling_v1beta1_generated_data_labeling_service_create_instruction_sync.py
Python
apache-2.0
1,628
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
berrange/nova
nova/tests/volume/encryptors/test_luks.py
Python
apache-2.0
2,831
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
EmanueleCannizzaro/scons
test/WhereIs.py
Python
mit
4,794
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
rajalokan/keystone
keystone/tests/unit/test_v3_trust.py
Python
apache-2.0
21,901
# -*- coding: utf-8 -*- # Copyright (c) 2007, 2008, Benoît Chesneau # Copyright (c) 2007 Simon Willison, original work on django-openid # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
jesonyang001/qarepo
askbot/deps/django_authopenid/views.py
Python
gpl-3.0
55,438
# demo_gui.py --- # # Filename: demo_gui.py # Description: # Author: Subhasis Ray # Maintainer: # Created: Wed Jun 16 05:41:58 2010 (+0530) # Version: # Last-Updated: Tue Sep 11 14:26:13 2012 (+0530) # By: subha # Update #: 318 # URL: # Change log: # Tuesday 18 September 2018 09:51:56 AM IST` # ...
BhallaLab/moose-examples
izhikevich/demogui_qt.py
Python
gpl-2.0
5,815
#!/usr/bin/python from __future__ import print_function import sys import json from httplib import HTTPException import socket from pprint import pprint, pformat import os from gnt_rapi import GntRapi, GntTagMap import yaml def gnt_inst_list(rapi): """Get list of all instances (including host-vars)""" group_map=d...
thoto/ganeti_ansible_facts
gnt_index.py
Python
gpl-3.0
2,515
import argparse import numpy as np from PIL import Image import ocppaths import ocpcarest import zindex import anydbm import multiprocessing import pdb # # ingest the PNG files into the database # """This file is super-customized for Mitya's FlyEM data.""" # Stuff we make take from a config or the command line i...
openconnectome/open-connectome
scripts/ingest/flyem/flyem_anno_parallel.py
Python
apache-2.0
4,133
# Generated by Django 2.0.5 on 2019-07-18 22:59 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('scheduletemplates', '0004_shifttemplate_members_only'), ] operations = [ migrations.AlterField( ...
pitpalme/volunteer_planner
scheduletemplates/migrations/0005_cascade_deletion.py
Python
agpl-3.0
629
import time import itertools import gevent from Config import config from util import helper from Plugin import PluginManager from ChartDb import ChartDb from ChartCollector import ChartCollector if "db" not in locals().keys(): # Share on reloads db = ChartDb() gevent.spawn_later(10 * 60, db.archive) he...
OliverCole/ZeroNet
plugins/Chart/ChartPlugin.py
Python
gpl-2.0
2,057
#!/usr/bin/python # -*- coding: utf-8 -*- # # FILE: dump_tweets.py # DATE: February, 2014 # Author: David W. McDonald # # Sample code that requests tweets from the DB and dumps each tweet # to the screen # # Copyright by Author. All rights reserved. Not for reuse without # express permissions. # import s...
bhargavz/py-twitter-sentiment-analysis
data/sochi/dump_tweets.py
Python
mit
6,209
# OpenMV Unit Tests. # import os, sensor, gc TEST_DIR = "unittest" TEMP_DIR = "unittest/temp" DATA_DIR = "unittest/data" SCRIPT_DIR = "unittest/script" if not (TEST_DIR in os.listdir("")): raise Exception('Unittest dir not found!') print("") test_failed = False def print_result(test, result): s = ...
kwagyeman/openmv
scripts/examples/OpenMV/99-Tests/unittests.py
Python
mit
1,077
"""Support for KNX/IP sensors.""" from __future__ import annotations from typing import Any from xknx import XKNX from xknx.devices import Sensor as XknxSensor from homeassistant import config_entries from homeassistant.components.sensor import ( CONF_STATE_CLASS, DEVICE_CLASSES, SensorEntity, ) from hom...
jawilson/home-assistant
homeassistant/components/knx/sensor.py
Python
apache-2.0
2,801
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'MODEL7743358405.xml') with open(sbmlFilePath,'r') as f: sbmlString = f.read() def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: ret...
biomodels/MODEL7743358405
MODEL7743358405/model.py
Python
cc0-1.0
427
from tests.markdown_test.test_utils import MarkdownTest class ListTest(MarkdownTest): def testBasic(self): text = """ * item 1 * item 2 * item 3 """ expect = """ <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> ...
albert12132/templar
tests/markdown_test/list_test.py
Python
mit
13,140
import os import sys import string import re import shutil import traceback import cPickle import ConfigParser import exceptions import psutil from defaultdict import * All_Targets = [] Targets = [] Config_Replacement_File = None Args = [] Generated_Installers = {} try: import subprocess except: import popen...
lordtangent/arsenalsuite
python/blur/build.py
Python
gpl-2.0
33,209
from discord.ext import commands import discord from .utils.hero_dictionary import hero_dic, item_dic class Pics: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def hero(self, ctx, *, hero_name): """<hero_name>'s icon""" if hero_name.lower() in ...
bozhko-egor/dota2-discord-bot
cogs/pics.py
Python
mit
1,266
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs Mozilla's Kraken JavaScript benchmark.""" import os from telemetry.core import util from telemetry.page import page_measurement from telemetry....
loopCM/chromium
tools/perf/perf_tools/kraken.py
Python
bsd-3-clause
1,439
import numpy as np import matplotlib.pylab as plt import h5py fl=h5py.File('test.h5'); k=fl['/fields/k'].value[0] u=fl['/fields/u'].value u=u['real']+1j*u['imag'] fid = open ("out68.vtk", "w"); fid.write("# vtk DataFile Version 3.0\n"); fid.write("patates\n"); fid.write("ASCII\nDATASET UNSTRUCTURED_GRID\n"); fid.writ...
gurcani/dins
vtkgen.py
Python
gpl-2.0
1,152
#! /usr/bin/env python def probl4(): """Find the largest palindrome made by the products of x and y. Values between 101 and 1000""" largest_palindrome = 0 for i in xrange(101, 1000): for j in xrange(101, 1000): output = i * j if str(output) == str(output)[::-1] and...
efrainc/project_euler
problem4.py
Python
mit
495
#!/usr/bin/python import sys depth = int(sys.argv[1]) if len(sys.argv) > 1 else 2 lines = [] switches_left = [] counter = 0 def get_new_id(): global counter i = counter % 8 + 1 + (counter / 8 + 1) * 1000 counter += 1 return i def new_switch(parent_id, depth): if depth == 0: return new_id = get_new_id() l...
christoff-buerger/reat
communication/gen_config.py
Python
mit
744
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2016 Scifabric LTD. # # PYBOSSA is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
PyBossa/pybossa
pybossa/s3_client.py
Python
agpl-3.0
1,754
from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.url import urljoin_rfc from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader class ReidysSpider(BaseSpider): name = 'reidys.com' a...
0--key/lib
portfolio/Python/scrapy/soundslive/reidys_spider.py
Python
apache-2.0
2,164
# Copyright Bruno da Silva de Oliveira 2006. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) from distutils.core import setup import py2exe import sys sys.path.append('../src') setup(name='pyste', scripts=['../src/p...
NixaSoftware/CVis
venv/bin/libs/python/pyste/dist/setup.py
Python
apache-2.0
331
#!/home/upmc_aren/python_env/bin/python from yanoama.pilot.system._linux import LinuxSystemConsole try: import json except ImportError: import simplejson as json DEFAULT_CONF_FILE='/etc/yanoama.conf' try: config_file = file(DEFAULT_CONF_FILE).read() config = json.loads(config_file) except Exception,...
guthemberg/yanoama
yanoama/pilot/defaults.py
Python
bsd-3-clause
569
import asyncio import binascii import base64 import json import io import mimetypes import os import re import uuid import warnings import zlib from urllib.parse import quote, unquote, urlencode, parse_qsl from collections import deque, Mapping, Sequence from .helpers import parse_mimetype from .multidict import CIMul...
kehao95/Wechat_LearnHelper
src/env/lib/python3.5/site-packages/aiohttp/multipart.py
Python
gpl-3.0
28,717
from util_classes import ChipType from game_components import Chip def chip_type_for_colour_name(colour_name): """ Convert a string (colour) to a ChipType :param str colour_name: colour, e.g. 'red' :return: the ChipType for this colour """ return { 'red': ChipType.red_ruby, 'b...
CoachCoen/games
utils.py
Python
mit
2,044
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Projet : Editeur, Compilateur et Micro-Ordinateur pour un langage assembleur. Nom du fichier : 01-04-CodeScrolledText.py Identification : 01-04-CodeScrolledText Titre : Widget : Texte avec défilement et numéro ...
MarcAndreJean/PCONC
Modules/01-04-CodeScrolledText.py
Python
mit
11,142
from __future__ import absolute_import, division, print_function import datashape from datashape import String, DataShape, Option, bool_ from odo.utils import copydoc from .expressions import schema_method_list, ElemWise from .arithmetic import Interp, Repeat, _mkbin, repeat, interp, _add, _radd from ..compatibility ...
cpcloud/blaze
blaze/expr/strings.py
Python
bsd-3-clause
1,851
from gi.repository import Gtk, Gdk, GdkPixbuf (TARGET_ENTRY_TEXT, TARGET_ENTRY_PIXBUF) = range(2) (COLUMN_TEXT, COLUMN_PIXBUF) = range(2) DRAG_ACTION = Gdk.DragAction.COPY class DragDropWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Drag and Drop") vbox = Gtk.Box(orien...
Dehyrf/python_gates
window.py
Python
gpl-3.0
3,800
# -*- coding: utf-8 -*- # # diffoscope: in-depth comparison of files, archives, and directories # # Copyright © 2016 Chris Lamb <lamby@debian.org> # # diffoscope 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,...
ReproducibleBuilds/diffoscope
diffoscope/comparators/git.py
Python
gpl-3.0
2,663
''' Created on Jul 5, 2010 @author: Soren S. Nielsen #****************************************************************************** # This file is part of RAW. # # RAW 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 So...
lqhuang/SAXS-tools
RAW/SASM.py
Python
gpl-3.0
61,301
from __future__ import division import os import numpy as np import pandas as pd # what to do if skip_cols == 'auto' # (this is used in feature_transforms.py) column_range = {'loudness': (1, None), 'sharpness': (1, None), 'roughness': (1, None), 'bands': (1, None), ...
jvbalen/catchy
utils.py
Python
mit
5,181
# TweetPy # Test import unittest import tweet class SampleTestClass(unittest.TestCase): def sampleTest(self): #do something a = 1 if __name__ == '__main__': unittest.main()
andresitodeguzman/twtpy
test/test.py
Python
mit
189
import sys from .generic import Relocation from .defines import defines from plasma.lib.utils import warning from . import arm64, i386, mips64, ppc64, amd64, arm, mips, ppc ALL_RELOCATIONS = {} complaint_log = set() def load_relocations(): for module in [arm64, i386, mips64, ppc64, amd64, arm, mips, ppc]: ...
chubbymaggie/reverse
plasma/lib/fileformat/relocations/__init__.py
Python
gpl-3.0
1,184
# -*- coding: utf-8 -*- from django.db import models from django.conf import settings from datetime import datetime from django.contrib.auth.models import Group from django.db.models import Q class ProfileManager(models.Manager): """ Custom profile manager. """ def contactable_members(self): ...
DevHugo/zds-site
zds/member/managers.py
Python
gpl-3.0
1,730
""" Unit tests for adodbapi version 2.2.6 (d)""" """ adodbapi - A python DB API 2.0 interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund Email: <http://sourceforge.net/sendmessage.php?touser=618411> This library is free software; you can redistribute it and/or modify it under the term...
slozier/ironpython2
Src/StdLib/Lib/site-packages/adodbapi/tests/adodbapitest.py
Python
apache-2.0
28,674
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import gdb import six import pwndbg.auxv import pwndbg.chain import pwndbg.commands @pwndbg.commands.ParsedCommand @pwndb...
zachriggle/pwndbg
pwndbg/commands/auxv.py
Python
mit
606
#============================================================================= # gpx_layer_search.py # Search results map layer # Copyright 2013, 2014, Trinity College # Last modified: 7 November 2014 #============================================================================= import math import gtk from pykarta.ma...
david672orford/GPX_Trip_Planner
Code/gpx_layer_search.py
Python
gpl-2.0
3,542
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from dateutil.relativedelta import relativedelta from odoo import api, fields, models class FleetVehicleLogContract(models.Model): _inherit = ['mail.thread', 'mail.activity.mixin'] _name = 'fleet.vehicle.log.c...
jeremiahyan/odoo
addons/fleet/models/fleet_vehicle_log_contract.py
Python
gpl-3.0
7,365
# Spawn Group file created with PSWG Planetary Spawn Tool import sys from java.util import Vector from services.spawn import DynamicSpawnGroup from services.spawn import MobileTemplate def addDynamicGroup(core): dynamicGroup = DynamicSpawnGroup() mobileTemplates = Vector() mobileTemplates.add('mokk_clan_leader') m...
agry/NGECore2
scripts/mobiles/dynamicgroups/dantooine_mokk.py
Python
lgpl-3.0
1,010
#-*- coding: utf-8 -*- import logging import threading from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GLib from foobnix.gui.controls.playback import PlaybackControls from foobnix.gui.model.signal import FControl from foobnix.helpers.my_widgets import notetab_label, ImageButton ...
kagel/foobnix
foobnix/gui/controls/movie_area.py
Python
gpl-3.0
7,154
__author__ = 'ggdhines' import matplotlib matplotlib.use('WXAgg') from aggregation_api import AggregationAPI import matplotlib.cbook as cbook import matplotlib.pyplot as plt import cv2 import numpy as np with AggregationAPI(592,"development") as sea: sea.__setup__() postgres_cursor = sea.postgres_session.curs...
zooniverse/aggregation
blog/sea.py
Python
apache-2.0
4,802
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
a0c/odoo
openerp/addons/base/ir/ir_values.py
Python
agpl-3.0
25,151
from __future__ import unicode_literals import unittest from prompt_toolkit.document import Document from contrail_api_cli.command import Command, Arg, Option from contrail_api_cli.manager import CommandManager from contrail_api_cli.parser import CommandParser from contrail_api_cli.exceptions import CommandNotFound, ...
eonpatapon/contrail-api-cli
contrail_api_cli/tests/test_parser.py
Python
mit
4,305
#-*- coding: utf-8 -*- # Copyright (c) 2005 Canonical # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager is free software; you can redistribute it and/or # modify it under the terms of the GNU General Pu...
blackPantherOS/packagemanagement
smartpm/smart/interfaces/qt4/__init__.py
Python
apache-2.0
2,441
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
google-research/google-research
smurf/smurf_augmentation.py
Python
apache-2.0
44,282
# -*- coding: utf 8 -*- from __future__ import division import tarfile import os from scipy.io import wavfile import numpy as np import tables import numbers import random import string import fnmatch import theano from lxml import etree try: import urllib.request as urllib # for backwards compatibility except Imp...
kastnerkyle/minet
minet/datasets.py
Python
bsd-3-clause
28,453
# 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 u...
yufeldman/arrow
python/pyarrow/tests/test_tensor.py
Python
apache-2.0
4,521
import gym from gym.spaces import Box, Discrete import numpy as np from typing import Dict, List, Optional from ray.rllib.models.catalog import ModelCatalog from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.utils import force_list from ray.rllib.utils.annotations import override from ray.rll...
pcmoritz/ray-1
rllib/agents/sac/sac_torch_model.py
Python
apache-2.0
12,453
from jno.commands.command import Command from jno.commands.setdefault import SetDefault from jno.commands.init import Init from jno.commands.jnoserial import JnoSerial from jno.commands.build import Build from jno.commands.upload import Upload from jno.commands.boards import Boards from jno.commands.ports import Ports ...
Kosinkadink/jno
jno/commands/jnohelp.py
Python
mit
1,575
#!/usr/bin/env python from distutils.core import setup from stringlike import __version__ setup( name='stringlike', packages=['stringlike'], version=__version__, description='Classes for mimicking string behavior', author='Elliot Cameron', author_email='elliot.cameron@covenanteyes.com', u...
CovenantEyes/py_stringlike
setup.py
Python
mit
1,706
from flask import Blueprint, url_for, redirect, flash from flask_login import LoginManager, login_required, \ logout_user from spacewiki import model from spacewiki.auth import tripcodes import logging LOGIN_MANAGER = LoginManager() @LOGIN_MANAGER.user_loader def load_user(user_id): logging.debug("Loading...
spacewiki/spacewiki
spacewiki/auth/__init__.py
Python
agpl-3.0
639
#!/usr/bin/env python3 ''' Configure AntiVirus profiles Method https://<DEVICE_IP>/api/v2/cmdb/antivirus/profile https://<DEVICE_IP>/api/v2/cmdb/antivirus/profile?filter=name==default CLI FG # sh antivirus profile default config antivirus profile edit "default" set comment "Scan files and bl...
barbosm/gatepy
examples/cmdb_antivirus_profile.py
Python
gpl-2.0
4,491
#!/usr/bin/env python # -*- coding: utf-8 -*- # # NetProfile: Bills module - Views # Copyright © 2017 Alex Unigovsky # # This file is part of NetProfile. # NetProfile is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public # License as published by the Free Software...
unikmhz/npui
netprofile_bills/netprofile_bills/views.py
Python
agpl-3.0
3,005
from gi.repository import Gtk from forecastmgmt.ui.masterdata_mask import MasterdataMask from forecastmgmt.ui.forecast_mask import ForecastMask from forecastmgmt.ui.publication_mask import PublicationMask class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Forecaster") ...
vvladych/forecastmgmt
src/forecastmgmt.py
Python
unlicense
3,741
# # # Copyright 2009-2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
wpoely86/easybuild-framework
easybuild/framework/easyconfig/tools.py
Python
gpl-2.0
23,864
#!/usr/bin/env python import argparse import logging import dns from dns.resolver import Resolver def get_args(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-z', '--zone', default='.' ) parser.add_argument('-s', '--server', default='127.0.0.1' ) parser.add_argument('-b'...
b4ldr/rsn
5.1/test_rsn.py
Python
apache-2.0
1,577
import matplotlib.pyplot as plt import numpy as np import seaborn as sns import timeit from scipy.integrate import odeint from IPython.html.widgets import interact, fixed from derivsfunc import * from initialconditions import direct_ic, retro_ic def S7_parabola(M,S,gamma): """ Computes the intial conditions f...
brettavedisian/phys202-project
Project/S7_icsandsolutions.py
Python
mit
4,336
import json import requests import logging from requests.exceptions import * logger = logging.getLogger(__name__) class Service: """ Proxy Service for custom RESTful service API to MassDOT real-time data """ base_url = '' def __init__(self, base_url, prediction_uri): self.base_url = base_url self.predi...
infrared5/massroute-pi
app/service/service.py
Python
mit
1,548
# -*- coding: latin_1 -*- #*********************************************************************************** #----------------------------------------------------------------------------------- # Filnavn: Avrenningrivernet.py #----------------------------------------------------------------------------------- # ...
honglioslo/NorwayIndexFlood
DDDparametre1HongFlowAccFlowDir.py
Python
gpl-3.0
12,505
# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function, unicode_literals from collections import deque import gc import gzip import logging import signal import sys import textwrap import time import warnings import weakref impo...
funtoo/portage-funtoo
pym/_emerge/Scheduler.py
Python
gpl-2.0
61,389
#!/usr/bin/env python # # TestSystem # # Tests the System class # # Author P G Jones - 2014-02-15 <p.g.jones@qmul.ac.uk> : First revision #################################################################################################### import unittest import nusoft.system.standard import os class TestSystem(unittes...
pgjones/nusoft
nusoft/test/test_system.py
Python
mit
1,639
# encoding: utf-8 import datetime import os from south.db import db from south.v2 import SchemaMigration from django.conf import settings from panda.models import DataUpload from panda import utils class Migration(SchemaMigration): def get_path(self, data_upload): """ From BaseUpload abstract mo...
datadesk/panda
panda/migrations/0003_auto__add_field_dataupload_guessed_types.py
Python
mit
12,910
# -*- coding: utf-8 -*- """ Definitions for common aid configurations Rename to annot_cfgdef """ from __future__ import absolute_import, division, print_function, unicode_literals import utool as ut import numpy as np # NOQA print, rrr, profile = ut.inject2(__name__, '[aidcfg]') # easier to type names to alias some...
SU-ECE-17-7/ibeis
ibeis/expt/annotation_configs.py
Python
apache-2.0
27,587
from base64 import urlsafe_b64decode from io import StringIO from django.http.response import HttpResponse from django.shortcuts import render from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_exempt import openid2rp from Care4Care.settings import STATICFILES_DIRS @...
dsarkozi/care4care-sdp-grp4
Care4Care/C4CApplication/tests/OIDTest.py
Python
agpl-3.0
5,177
from collections import defaultdict class UserInfo(object): """ Class to be able to assign properties to a dict""" def __init__(self): self._values_ = {} def __getattr__(self, name): if name.startswith("_") and name.endswith("_"): return super(UserInfo, self).__getattr__(name...
conan-io/conan
conans/model/user_info.py
Python
mit
872
# coding: utf-8 from flask import Flask, request, current_app, make_response, abort, render_template, jsonify, redirect from flask.ext.script import Manager, Shell from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.migrate import Migrate, MigrateCommand from flask_restful import Resource, Api, reqparse, abort ...
librallu/virtual-boards
main.py
Python
gpl-2.0
18,510
#!/usr/bin/python from Queue import Queue from base64 import b64encode from hashlib import sha1 from optparse import OptionParser from SimpleHTTPServer import SimpleHTTPRequestHandler from threading import Thread import traceback import BaseHTTPServer import os import json import struct import ssl q = Queue() class...
vladfolts/Web-Motion-Detector
server.py
Python
mit
5,819
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
Juniper/neutron
neutron/db/migration/cli.py
Python
apache-2.0
4,441
# -*- coding: utf-8 -*- # Copyright (c) 2015-2021 Jose Antonio Chavarría <jachavar@gmail.com> # Copyright (c) 2015-2021 Alberto Gacías <alberto@migasfree.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 Softw...
migasfree/migasfree-backend
migasfree/hardware/models/configuration.py
Python
gpl-3.0
1,825
#!/usr/bin/python import os, sys import argparse import pycurl from lxml import etree from datetime import datetime, timedelta class FritzBox(object): def __init__(self, hostname='fritz.box', port=49000, pre_os6=False): self._hostname = hostname self._port = port self._status = None ...
aroth-arsoft/arsoft-python
python3/arsoft/fritzbox/__init__.py
Python
gpl-3.0
16,739
# -*- coding:utf-8 -*- import argparse from nlp.ner.idcnn.train import train from nlp.ner.idcnn.predict import predict def main(args): if args.train: train(args) else: predict(args) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--train', type=boo...
koala-ai/tensorflow_nlp
nlp/ner/idcnn/run.py
Python
apache-2.0
3,000
#!/usr/bin/env python # -*- coding: utf-8 -*- """ cityBikeWein.py Copyright (C) 2010 Patrick Installé <PatrickInstalle@P-Installe.be> 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...
iksaif/lugdulov
python/citybikewien.py
Python
gpl-2.0
4,354
#!/usr/bin/env python # -*- coding: utf-8 -*- # This is a simple echo bot using decorators and webhook with flask # It echoes any incoming text messages and does not use the polling method. import logging import time import flask import telebot API_TOKEN = '<api_token>' WEBHOOK_HOST = '<ip/host where the bot is r...
eternnoir/pyTelegramBotAPI
examples/webhook_examples/webhook_flask_echo_bot.py
Python
gpl-2.0
2,475
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ tkRAD - tkinter Rapid Application Development library (c) 2013+ Raphaël SEBAN <motus@laposte.net> 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 S...
ronaldsantos63/tkGAME
tkRAD/core/options.py
Python
gpl-3.0
6,240
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from simple_manager import __version__ as Version setup( name=u'simple-dependencies-manager', version=Version, description=u"A simple script that helps you take control of your projects so you do not get crazy!", long_description=u"A ...
victorpantoja/simple-dependencies-manager
setup.py
Python
apache-2.0
1,020
#!/usr/bin/env python3 import sys import os, os.path from IPython import get_ipython import nbformat import io import time NBVERSION = 4 def _compile_to_py(nb_path,py_path): shell = get_ipython() # load the notebook object with io.open(nb_path, 'r', encoding='utf-8') as f: nb = nbformat.read(f,...
nholtz/structural-analysis
matrix-methods/frame2d/Frame2D/ipynb_compiler.py
Python
cc0-1.0
1,694
from django.shortcuts import render def error404(request): respon = render(request,'errors/404error.tpl') respon.status_code = 404 return respon def error500(request): respon = render(request,'errors/500error.tpl') respon.status_code = 500 return respon
enixdark/10gen-Courses
Relational-SQL/DjangoBlog/DjangoBlog/views.py
Python
mit
282
#!/usr/bin/env python import optparse import sys import pdb #from numpy import * from collections import defaultdict ''' Ranks each group of translations in 'translations' using the features provided, with their corresponding weights. @translations: the list of lists of translations to be scored, one list of transla...
asantinc/translation-decoding
reranker/rerankfun.py
Python
mit
2,468
#-*- coding:utf-8 -*- import re from miasm2.expression.expression import * from pyparsing import * from miasm2.core.cpu import * from collections import defaultdict import miasm2.arch.x86.regs as regs_module from miasm2.arch.x86.regs import * from miasm2.core.asmblock import AsmLabel log = logging.getLogger("x86_arch...
stephengroat/miasm
miasm2/arch/x86/arch.py
Python
gpl-2.0
136,563
""" Django settings for a project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os _ = l...
GISAElkartea/bidasoamedia
project/settings.py
Python
agpl-3.0
4,791
import sys sys.path.append("/home/oracc/www/cuneifyplus") import cgi import os from collections import OrderedDict from html import escape from traceback import format_exc #from urllib.parse import quote from cuneify_interface import ( TransliterationNotUnderstood, UnrecognisedSymbol, cuneify_line, ...
oracc/oracc
misc/cuneifyplus/wsgi.py
Python
gpl-2.0
10,719
# Copyright (C) 2009, 2010 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANT...
isaacl/meliae
meliae/tests/test_loader.py
Python
gpl-3.0
19,580
from tests.package.test_perl import TestPerlBase class TestPerlDBDmysql(TestPerlBase): """ package: DBD-mysql XS direct dependencies: DBI XS """ config = TestPerlBase.config + \ """ BR2_PACKAGE_PERL=y BR2_PACKAGE_PERL_DBD_MYSQL=y """ def te...
masahir0y/buildroot-yamada
support/testing/tests/package/test_perl_dbd_mysql.py
Python
gpl-2.0
426
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE import os, sys import imp def opusRun(progressCB,logCB,params): f, filename, description = imp.find_module('arcgisscripting', ['c:/Python25/Lib/site-p...
apdjustino/DRCOG_Urbansim
src/opus_gui/data_manager/run/tools/esri_feature_to_point.py
Python
agpl-3.0
1,487
from django import forms from django.core.files import File from aur.models import * import aur.Package as PKGBUILD import os import sys from registration.backends.default import DefaultBackend from django.contrib.auth.models import Group class PackageSearchForm(forms.Form): # Borrowed from AUR2-BR def __in...
BackupTheBerlios/aur2
archlinux/aur/forms.py
Python
gpl-2.0
10,012
## @package tags # Module caffe2.python.layers.tags from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six from caffe2.python import context @context.define_context(allow_default=True) class TagContext(object): ...
xzturn/caffe2
caffe2/python/layers/tags.py
Python
apache-2.0
3,396
from collections import namedtuple import rpyc import cv2 from detection.opencv import draw_lines import time State = namedtuple("State", "name act default_args") State.__new__.__defaults__ = tuple([None] * 2) + ({},) def main_loop(robot, start_state, state_dict, delay=0.02, remote_display=None): print("Chec...
TheCamusean/DLRCev3
rick/rick/core.py
Python
mit
1,443
#! /usr/bin/env python3 import sys import random from enumeration import Goal, Status, Action from entity import Room, Agent, Knowledge, Cave from knowledge import perceive, tell, update, ask def print_intro(): print('Hunt the Wumpus') print('MIT License (MIT)') print('Copyright (c) 2014 gliderkite\n') de...
gliderkite/wumpus
src/wumpus.py
Python
mit
2,699
#!/usr/bin/env python # encoding=utf8 import setuptools with open('README.md') as fh: long_description = fh.read() setuptools.setup( name='EximHandler', version='1.1.0', author='Dan Michael O. Heggø', author_email='danmichaelo@gmail.com', description='A logging handler class which sends an em...
danmichaelo/eximhandler
setup.py
Python
unlicense
636
# -*- coding: utf-8 -*- """Setup file for easy installation""" import sys import os from os.path import join, dirname, split from setuptools import setup PY3 = os.environ.get('BUILD_VERSION') == '3' or sys.version_info[0] == 3 version = __import__('social').__version__ LONG_DESCRIPTION = """ Python Social Auth is a...
cjltsod/python-social-auth
setup.py
Python
bsd-3-clause
3,240
# -*- coding: utf-8 -*- """ Copyright 2003-2010 Cort Stratton. All rights reserved. Copyright 2015, 2016 Hanson Robotics 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 abov...
hansonrobotics/chatbot
src/chatbot/aiml/Kernel.py
Python
mit
50,732
import logging import time from autotest.client.shared import error from virttest import utils_misc @error.context_aware def run(test, params, env): """ change a removable media: 1) Boot VM with QMP/human monitor enabled. 2) Connect to QMP/human monitor server. 3) Eject original cdrom. 4) Ej...
swapnakrishnan2k/tp-qemu
qemu/tests/eject_media.py
Python
gpl-2.0
4,185
#!/usr/bin/python # -*- coding: utf-8 -*- # Ver 16 - 26 March 2017 - import time import mysql.connector from mysql.connector import errorcode import string import datetime from db import * import sys def output(x): print(str(datetime.datetime.now().time())[:8]+ " "+ str(x)) sys.stdout.flush() # -- DB Connection ...
theflorianmaas/dh
Python/dhproc/syncTime.py
Python
mit
1,369
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
Distrotech/scons
test/Script-import.py
Python
mit
2,878
#!/usr/bin/python3 # -*- coding: utf-8 -*- '''Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Softwar...
jjgomera/pychemqt
UI/prefPetro.py
Python
gpl-3.0
7,535
import wget import argparse import os import tensorflow as tf import tarfile import numpy as np MODEL_DIR = "/tmp/chrome/mobilebert" MODEL_URL = "https://storage.googleapis.com/cloud-tpu-checkpoints/mobilebert/mobilebert_squad_savedmodels.tar.gz" OUTPUT_DIR = "../android/app/src/main/assets" def prepare_model(opts): ...
googleinterns/chrome-on-device-ml
experimental/python/mobilebert_model.py
Python
apache-2.0
2,684
import re import tests.helper as th def passes(out, err): return all( [th.reads(err, '/tests/linkat.test'), th.reads(err, '/tests/null.test'), th.writes(err, '/tmp/subdir2/hidden/awesome'), th.mkdirs(err, '/tmp/subdir2/hidden'), th.count_writes(err, 1), th.coun...
droundy/bigbro
tests/execveat.py
Python
gpl-2.0
391
# -*- coding: utf-8 -*- import sys from decimal import Decimal from itertools import product from math import gcd import warnings import pytest from pytest import raises as assert_raises from numpy.testing import ( assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_al...
nmayorov/scipy
scipy/signal/tests/test_signaltools.py
Python
bsd-3-clause
130,387