blob_id
stringlengths
40
40
content_id
stringlengths
40
40
repo_name
stringlengths
5
114
path
stringlengths
5
318
language
stringclasses
5 values
extension
stringclasses
12 values
length_bytes
int64
200
200k
license_type
stringclasses
2 values
content
stringlengths
143
200k
f891c584d6372bdef3b3c4f1cd3fb8e26aac29cd
ac9ff9e42a65c47e9600c79eb41db08cf7ee32d0
botswana-harvard/edc
/edc/lab/lab_packing/doc/conf.py
Python
py
9,720
no_license
# -*- coding: utf-8 -*- # # lab_packing documentation build configuration file, created by # sphinx-quickstart on Mon Jul 16 15:16:44 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
da4c0158390f97e7799c47b08b14d2b0dc08ca64
ebf62ec71b49af0b5b27623257b8edbaefde4324
xigt/igt-edit
/yggdrasil/metadata.py
Python
py
1,348
permissive
from intent.igt.metadata import set_meta_attr, find_meta, find_meta_attr, set_meta_text from yggdrasil.consts import USER_META_ATTR, RATING_META_TYPE, QUALITY_META_ATTR, RATINGS, RATINGS_REV, \ EDITOR_METADATA_TYPE, COMMENT_META_TYPE, REASON_META_ATTR def set_rating(inst, user, rating, reason): set_meta_attr(...
f0879cd17237cecac45bc7e7afa224c964a98847
95ac7fc0dccb48bc3b7eef26497b40ee1d1e463c
tgluon/delta
/examples/python/table_exists.py
Python
py
1,812
permissive
# # Copyright (2021) The Delta Lake Project 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 applicable law or ag...
3d72e1d2cdc2ae1de9ee6acf186c81fb255ab74a
522c0b9fe1ecbb98d87304af6734458866eb830b
yam-ai/yamconv
/common/prepro.py
Python
py
2,103
permissive
# coding=utf-8 # Copyright 2019 YAM AI Machinery Limited # # 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 l...
c826a5fb7706d925b2664ae79dc91ea8650868ac
cde90a540190acba1c7febd953c42e93ddbcc377
f-9t9it/vet_care
/vet_care/hooks.py
Python
py
10,265
permissive
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version app_name = "vet_care" app_title = "Vet Care" app_publisher = "9T9IT" app_description = "ERPNext App for Vet Care" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "info@9t9it.com" app_lice...
6aa6b46c6cff9a723eda531e2ee96e5511ad019e
d21b3ef33a5a1cd87199b73518f11af22584dfb2
XDeviation/NLP_Learning
/code/read/input.py
Python
py
338
permissive
import pandas as pd from matplotlib import pyplot as plt datapath = '../../data/train_set.csv' train_df = pd.read_csv(datapath, sep='\t', nrows=100) train_df['text_len'] = train_df['text'].apply(lambda x: len(x.split(' '))) print(train_df['text_len'].describe()) plt.hist(train_df['text_len'], bins=200) plt.xlabel('...
2e6a2c96b970f2949745e31748ebb690ee821407
6c9ce2326bd1bcc03d9b73d073d6bade93dae7ea
chizel/os_dj
/wsgi/openshift/forum/urls.py
Python
py
742
no_license
from django.conf.urls import patterns, url from forum import views from forum.views import ThemesList, PostsList urlpatterns = patterns( '', url(r'^$', ThemesList.as_view(), name='list_of_themes'), url(r'^(?P<page>\d+)/$', ThemesList.as_view(), name='list_of_themes'), # themes url(r'^theme/(?P<the...
d0b589348cda8258b7d706df0e1472a69dbb1b37
95a03aad348dcdbf016f8060ff2ade9853db020e
MarouaneMaachou/ML_Implementation
/LWR.py
Python
py
1,734
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 23 12:31:22 2019 @author: maachou """ import scipy as sc import scipy.stats as stat import numpy as np def distance(u,v): return np.linalg.norm(u-v) def nearest(u,X,k): neirest=np.zeros((k,X.shape[1])) Distances=[distance(u,v) for v in...
219f7d319262448ae1974914877905c4ac4157b5
ff5d3211ada2a5e692a026bcb64be83858f15992
janesferr/WADD-Courses
/WA170 - Programming with Python/WA170_lab_solutions/Chapter 9/09_06/library.student.py
Python
py
2,129
no_license
class Patron(object): """This class represents a patron with a name and a number of books checked out.""" MAX_BOOKS_OUT = 3 def __init__(self, name): self._name = name self._numBooksOut = 0 def __str__(self): result = self._name + ', ' + str(self._numBooksOut) + \ ...
a2a4567457cbd2fdf72a06623898f6ee3e84c291
8a25f23640329b7e04e097b27282bc9571998be1
tupui/scipy
/scipy/signal/__init__.py
Python
py
16,116
permissive
""" ======================================= Signal processing (:mod:`scipy.signal`) ======================================= Convolution =========== .. autosummary:: :toctree: generated/ convolve -- N-D convolution. correlate -- N-D correlation. fftconvolve -- N-D convolution usi...
2b1f5ebf42bee1c52dee993e93318e05bd514895
2c1bbaf85c44188625013ec8a85b09b1cbd164ce
jimmyprior/brickify-old2
/tests/test_utils.py
Python
py
3,250
no_license
import unittest from brickify.utils import ( open_image, compare_colors, get_image_matrix, get_sub_matrix, get_sub_list, get_occupied, get_available, get_color_score, ) BLACK = (0, 0, 0) WHITE = (255,255,255) class UtilsTest(unittest.TestCase): def setUp(self): ...
b3d3c7178104b8293fcd219d4f4618d3cc52469f
e6c150fc94cb06cc92df6234663f5e9f97d27bf1
liuchaoren/google-auth-library-python
/google/auth/version.py
Python
py
597
permissive
# Copyright 2021 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 agreed to in writing, s...
3ece14fc52937deafd14c314ed9620c65753ea01
5994c8a4879f8d24895c9974f15130ccca018866
gaohj/jxlg_0304
/day13/urllib2_demo/demo2.py
Python
py
494
no_license
#encoding:utf-8 import urllib2 headers = { "User-Agent":"User-Agent, Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" } url = "http://www.baidu.com" #创建请求对象 req = urllib2.Request(url,headers=headers) print req.get_full_url() print req.get_...
da0db77a8d476cf4d961a53f1acbbe81d7ae1e93
ccee252b73713de1b29f20baebfa71dc4ae11a13
pascual143/clyma
/controllers/auth.py
Python
py
1,224
no_license
from flask import Blueprint, jsonify, request, g from models.user import User, UserSchema from lib.secure_route import secure_route from lib.helpers import is_unique api = Blueprint('auth', __name__) user_schema = UserSchema() @api.route('/register', methods=['POST']) def register(): data = request.get_json() ...
fb4395439afab51137a6794bef72ef81c171fc2f
a2c2e11659d97f1d798a8d9a0d16d8847066d5b3
gardian12/generators
/configs/bricklet_e_paper_296x128_config.py
Python
py
24,383
permissive
# -*- coding: utf-8 -*- # Redistribution and use in source and binary forms of this file, # with or without modification, are permitted. See the Creative # Commons Zero (CC0 1.0) License for more details. # E-Paper 296x128 Bricklet communication config from generators.configs.openhab_commonconfig import * com = { ...
03660a0c09b657b57d4ca77d449c5e899686ad1c
b6411d210b3852a5021ab5aff80ab9bf30e5affc
solomonndungu/FirstLSTMProject
/Final LSTM project/data_model.py
Python
py
3,078
no_license
import numpy as np# for scientific computing with Python. e.g, array object, linear algebra import os# provides a way of using operating system dependent functionality like fileopen or path of file import pandas as pd# library providing data structures and analysis tools for python import random#Random variable generat...
696a85c8a53efdaee928a2246b2250016be2fcb9
2540670b783fbc0c1796790efbdfd8eb8d20b440
Z-Zheng/torchgeo
/torchgeo/datasets/utils.py
Python
py
11,744
permissive
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """Common dataset utilities.""" import bz2 import contextlib import gzip import lzma import os import sys import tarfile import zipfile from datetime import datetime, timedelta from typing import Any, Dict, Iterator, List, O...
4d95503dae1149e6e977c84fb18eb4ace5bcc3cb
a3511ba535aa8a953dbc6e0d9d2e654aec2ef394
tuanqdinh/1712-glap-gan
/util/plotutil.py
Python
py
1,211
no_license
name0 = 'diffwgancom010_1000_10_10.npy' name1 = 'diffwgancom011_1000_10_10.npy' d1 = np.load('../../data/gaussians/' + name1) d0 = np.load('../../data/gaussians/' + nplotme0) x = np.arange(1, len(d0) + 1) plt.plot(x, d1, label='L-GAN') plt.plot(x, d0, label='Vanilla-GAN') plt.legend() plt.xlabel('#Modes') plt.ylabel("N...
cc7b66c7a8a4cc2060a74c3e2e469c0e887d3220
86acf7a166851edba30edc4cee181072fd2c7e0d
suyalmukesh/python
/warmup/creditcard.py
Python
py
232
no_license
import re TESTER = re.compile( r"^" r"(?!.*(\d)(-?\1){3})" r"[456]" r"\d{3}" r"(?:-?\d{4}){3}" r"$") for _ in range(int(input().strip())): print("Valid" if TESTER.search(input().strip()) else "Invalid")
6eb91bd4a8d639b63746f9c9f0fef25056e3a346
c904800b7c62a92e1772cc03c82c4023a12a549a
igorfelipes/Estrutura_de_dados_UNIESP
/Exercicios_estrutura_de_dados/exercicioF.py
Python
py
313
no_license
def main(): registers = [] for reg in range(5): registers.append(input('Digite o nome que deseja inserir no registro: ')) name = input('Digite o seu nome: ') registers[registers.index(name)] = input('Digite seu sobrenome: ') print(registers) if __name__ == "__main__": main()
700dfffa8bef1880b9f25edd6277ae7c8ea6e42d
7fb4facaef750cf5f1a7ce32042e47ee541efaf3
letsGoBharat/glow
/lib/model/activation_normalization.py
Python
py
2,438
no_license
import tensorflow as tf import tensorflow_probability as tfp import numpy as np class ACT(tfp.bijectors.Bijector): # Ref - https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/Bijector def __init__(self, channels, validate_args=False, name='actnorm', log_scale_factor = 1.0): super(ACT,...
dda551f7b68929ff9c98a98a50fc652e591660ee
3e86fd74d722111b93492718a9fd5575fa26831f
RibRibble/python_april_2017
/briana_bennett/python_fundamentals/Names.py
Python
py
1,288
no_license
# # Part I # def names(lst): # for elem in lst: # line_str = "" # for key, val in elem.items(): # line_str += val + " " # # print line_str # # # students = [ # {'first_name': 'Michael', 'last_name' : 'Jordan'}, # {'first_name' : 'John', 'last_name' : 'Rosal...
5647657a1b60a442795eea5dccafeea9a782260c
d9217e7816414b86a2146e8aaa2f12d711bbf3b0
cabbagesmasher/flaskapp
/app/__init__.py
Python
py
5,506
no_license
from __future__ import print_function from flask import Flask, render_template, g, request, session, redirect, url_for, abort, flash, jsonify import os, sys from flask_login import LoginManager, UserMixin import sqlite3 from contextlib import closing from werkzeug.debug import DebuggedApplication app = Flask(__name__)...
2c36335cc92dc65a7bf610a1dc11b8f6a8d603d0
074c1f4ce5879a5b79f6c9020df23211a0c70fc4
adrianppg/cloudman
/cm/boot/__init__.py
Python
py
20,709
permissive
#!/usr/bin/env python """ This module is used to generate CloudMan's contextualization script ``cm_boot.py``. To make changes to that script, make desired changes in this file and then, from CloudMan's root directory, invoke ``python make_boot_script.py`` to update ``cm_boot.py`` also residing in the root dir. Require...
8daf6a0646c495266f23a946da27255733e9e378
64fbb731b5ac053210ce4ea72b50566f02626c23
zionhjs/algorithm_repo
/1on1/DFS+Recursion/1192-criticalconnections.py
Python
py
213
no_license
for i in range(10): i += 100 print("i:", i) string = '123456' print("range:", string[2:]) print("string[j]:", string[3]) string = '1,2,3,4,5,6' str_list = string.split(',') print("str_list:", str_list)
7efa2d97a4c8f0b27956804065d25ff76bad2f6f
f249a016062c45ec57d61cd51941308174ae4afb
LukeBarry/stats
/prob_dist.py
Python
py
345
no_license
# plotting a normal probability distribution import matplotlib.pyplot as plt # matplotlib is the standard plotting package in Python import numpy as np import matplotlib.mlab as mlab mean = 0 variance = 1 sigma = np.sqrt(variance) # this is the standard deviation x = np.linspace(-3,3,100) plt.plot(x, mlab.normpdf(x,m...
256562cc29df25916381c99f5f6f481603875475
12a6b6a93e4544ba593c75d5c1c83901980c86b0
ecurtin2/Project-Euler
/src/599.py
Python
py
1,159
no_license
""" The well-known Rubik's Cube puzzle has many fascinating mathematical properties. The 2×2×2 variant has 8 cubelets with a total of 24 visible faces, each with a coloured sticker. Successively turning faces will rearrange the cubelets, although not all arrangements of cubelets are reachable without dismantling the ...
485e7bc587e97ec0bc42fdb4c1a4fc1abb378cb3
571cdd177b480e5315898f9bfeef5839ae08a84f
isasiluis28/superbar
/inventario/forms.py
Python
py
3,694
no_license
from django import forms from django.forms.models import BaseInlineFormSet from inventario.models import BandejaEnProduccion from models import Insumo, Lote, FacturaCompraProduccion, InsumoTamano, Produccion from ajax_select.fields import AutoCompleteSelectField class ProduccionBandejaForm(forms.ModelForm): clas...
44391adf374323479a034556b41045d9543d9fb9
a78e81a914c0cc9cc7d9470088d6f0b031085687
junwei-h/Learning-Algorithms-with-Leetcode
/divide-and-conquer/0050-powx-n-2.py
Python
py
315
no_license
class Solution: # 方法一:递归 def myPow(self, x: float, n: int) -> float: if n < 0: return 1 / self.myPow(x, -n) if n == 0: return 1 if n & 1: return x * self.myPow(x, (n - 1)) else: return self.myPow(x * x, n // 2)
6627e6c88373af59653a36808c7b55b0640be3dc
844cd0c6cb6e8f0858c09c170ccb4ba207025043
shinsung3/VitaminPlusWEB
/VitaminPlusChat/manage.py
Python
py
671
no_license
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VitaminPlusChat.settings') try: from django.core.management import execute_from_command_line exc...
5e40502b93950b08f5f45d07fc137b93a9856f38
14377bd8974ff6636c0396b602f11dedd54a84e6
borinot/plone.app.event
/setup.py
Python
py
3,532
no_license
from setuptools import setup from setuptools import find_packages import os version = '1.0dev' setup(name='plone.app.event', version=version, description="The Plone calendar framework", long_description=open("README.rst").read() + "\n" + open(os.path....
db8de1ac49d6c2f078880719128d4ed77bcdfebe
b041b932831ddc849678bfdda1e3f70c491eba84
sleepingcode/Google-code-challenge
/python-src/video_player.py
Python
py
5,690
permissive
"""A video player class.""" from .video_library import VideoLibrary is_playing = False is_paused = False now_playing = None previous_video = None Random = True class VideoPlayer: """A class used to represent a Video Player.""" def __init__(self): self._video_library = VideoLibrary() def number...
d1b5a77e454edbbecc67e039b937c20f32e0dc3f
d4c28013a391c49169b378603f8a3099fe3bd04e
netsak/AdventOfCode2020
/day-17.py
Python
py
2,842
permissive
#!/usr/bin/env python from collections import defaultdict kernel = ( (-1, -1, -1), (0, -1, -1), (1, -1, -1), (-1, 0, -1), (0, 0, -1), (1, 0, -1), (-1, 1, -1), (0, 1, -1), (1, 1, -1), (-1, -1, 0), (0, -1, 0), (1, -1, 0), (-1, 0, 0), (1, 0, 0), (-1, ...
e6c54d0d72c185842a72ba4d7173520f5bbaa6d9
ceeb5a0cbab67127bd4f3af523eea5ce331344d1
sarojkanta0704/Weather-App-Microservices
/user_management/src/__init__.py
Python
py
1,861
no_license
# user_management/src/__init__.py from src.const import Constant as constant from flask import Flask from flask_bcrypt import Bcrypt from flask_sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from sqlalchemy_utils import database_exists, create_database from kazoo.client import KazooClient from kaz...
356602edb5d58a141eedd0c04d8f1136c0b4a853
7c793dba8c9bfc83963a38b0b4d42d2715c0205e
applecool/spark-saturday
/tutorials/mlflow/src/python/misc/lab_6.py
Python
py
1,643
no_license
import mlflow import mlflow.sklearn import mlflow.pyfunc from lab_utils import load_data class MLflowOps(): def __init__(self): # # dictionary for mapping model types to their respective load_model calls # self._model_funcs = { 'sklearn':mlflow.sklearn.load_model, ...
791bd07589eb93d40d807f5d929b04cdc7425fb2
068d88e7d9452c6c8cb0a116ffdd3ffc77c0d13a
laglasenapp/pythonCourse
/app/12022020/ex7/ex7.py
Python
py
491
no_license
# Criar um método que recebe dos numeros inteiros # Metodos calcula a soma dos dois números e armazena em uma variável # Metodo retorna a variavel com o resultado # Imprimir o retorno do método def receber_numeros(): num = [] for i in range(0,2): num.append(int(input('Informe um número inteiro: '))) ...
eddb253b2a8522de7cfedd19cfa45021011b8174
ac1aba4a85f41c36468e91d2769551c5f6894afd
midwest117/portfolio-project
/portfolio/urls.py
Python
py
372
no_license
from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static import jobs.views urlpatterns = [ path('admin/', admin.site.urls), path('', jobs.views.home, name='home'), path('blog/', include('blog.urls')), ] + static(set...
dada891f0040d9c0af6d37e68e819a0ca8dc69ff
eb103a51732b752a253f945da734a7877da33a67
nunnun/redbot
/lib/formatter/html.py
Python
py
27,975
permissive
#!/usr/bin/env python """ HTML Formatter for REDbot. """ __author__ = "Mark Nottingham <mnot@mnot.net>" __copyright__ = """\ Copyright (c) 2008-2010 Mark Nottingham Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to de...
1e7c3a8ba683aace53af599b4b051539dae279b6
306922b4fdbbe920dc26caf1e4d971bf89d83ba4
duncandc/AssemBias_w_Neutrinos
/data/hlist_header_reader.py
Python
py
2,529
no_license
""" read the header in the ROCKSTAR halo catalogue ascii files to make processing easier """ #load packages from __future__ import print_function, division import re import sys __all__ = ['read_header'] def main(): """ print out the column names and number """ #set the ascii file to process ...
d36ce09015be17b0a835f16d09d9d8bff911e6ab
0f167257518abcba00ab21718cc87dfe3eede04f
crusaderky/aiohttp
/tests/test_cookiejar.py
Python
py
24,167
permissive
import asyncio import datetime import itertools import pathlib import unittest from http.cookies import BaseCookie, Morsel, SimpleCookie from unittest import mock import pytest from freezegun import freeze_time from yarl import URL from aiohttp import CookieJar, DummyCookieJar @pytest.fixture def cookies_to_send():...
fb2fee552137b23be1f0e75fc7e97ede97f7cf48
7f2505ea53cf2de07eaa491a5624fdc20d7a2151
markpseda/AOF_Day1
/Day1.py
Python
py
324
no_license
inputNumbers = input() print(inputNumbers) sum = 0 for x in range(len(inputNumbers)): if x != len(inputNumbers) - 1: if inputNumbers[x] == inputNumbers[x+1]: sum += int(inputNumbers[x]) else: if inputNumbers[x] == inputNumbers[0]: sum += int(inputNumbers[0]) print(su...
b0c5322f4fd0bd932bf9017db90d618ecc443743
09499690935727a67baf6e8e1fb86b5ec22065f4
SoccerStatsUS/metadata
/data/lists/awards/naia.py
Python
py
2,937
no_license
#!/usr/local/bin/env python # -*- coding: utf-8 -*- d = { 'competition': 'NCAA Division I', 'All-American': [ (2010, [ 'Aaron Fenlason', 'Joseph Omondi', 'Chris Dillon', 'Derek Prinz', 'Tom Mellor', 'Steph...
fa4f14c8ffe374194705e8f0c26b7c2f2e580096
6ba83db16da2e642cededbbbb680cb6077ee3174
FStraceski/legosort
/legosort.py
Python
py
1,830
no_license
import numpy as np import cv2 import IPython.display import PIL.Image from io import BytesIO import imutils import serial import time ser = serial.Serial('/dev/serial0', 115200, timeout=0) cap = cv2.VideoCapture(0) # d1 = IPython.display.display("Your image will be displayed here", display_id=1) counter = 0 lower_r...
10143fa26921dd9958c4087946099cc6618b4457
8417622893a2e41658250075c6ba8547a90ddf06
starlordali4444/ALI_INFY
/GENERIC/PROGRAM/PYTHON/.history/EXE_function_lvl_3_20200403113617.py
Python
py
989
no_license
'''Write a Python function to find all the Strong numbers in a given list of numbers. Write another function to find and return the factorial of a number. Use it to solve the problem. Example: A number is considered to be a Strong number if sum of the factorial of its digits is equal to the number itself. 145 is a St...
9af41c6f7b3bcfd7d7ba8c88590b174d3a837dce
82e416369acc1fa62b7dd5e151c450161700d42e
ZTK13/jetbrains-academy-simplebankingsystem
/Problems/Who is who/main.py
Python
py
316
no_license
class Angel: color = "white" feature = "wings" home = "Heaven" class Demon: color = "red" feature = "horns" home = "Hell" angel_1 = Angel() demon_1 = Demon() print(angel_1.color) print(angel_1.feature) print(angel_1.home) print(demon_1.color) print(demon_1.feature) print(demon_1.home)
b669d35b179434c9d797eb7612c19fe39e72e810
16e0ccea2b7e73ba52df57dae458658ce785c140
anilmenon14/django-blog-project
/Blog_Project_One/mysite/blog/migrations/0003_userprofileinfo.py
Python
py
935
no_license
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-09-02 04:33 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
cb9fe116606b84409ffdaa1b6a9374cca864007f
f5285f2618e579fb75ac957113cd3be75896fcbd
KosenkoDmitriy/docker_hello_world
/starter/API/views.py
Python
py
9,720
no_license
from django.http import HttpResponse, JsonResponse, Http404 from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.models import User, Permission, Group from rest_framework import permissions, viewsets, status, generics from rest_framework.renderers import JSONRenderer from rest_framework.parsers...
ac4216c1171bbed74215664f1169d1bf9111eca0
7c0d5e784492fc8e44e9e656f1e83dca7f726a09
serviceprototypinglab/continuum-deployer
/continuum_deployer/dsl/exporter/exporter.py
Python
py
528
no_license
import yaml from yapsy.IPlugin import IPlugin class Exporter(IPlugin): """Exports a set of matched resources to a deployable DSL""" def __init__(self, stdout=False, output_stream=None): self.stdout = stdout self.output_stream = output_stream def export(self, matched_resources): ...
f7d8ef807e818921777a16214a0e6f156cb9f02f
233b23c2785689ecde0c6643113e69db62680c4f
grollins/foldkin
/foldkin/stability_predictor.py
Python
py
1,667
no_license
import numpy from base.data_predictor import DataPredictor from base.prediction import Prediction from foldkin.util import ALMOST_ZERO, ALMOST_INF class StabilityPrediction(Prediction): """docstring for StabilityPrediction""" def __init__(self, stability): super(StabilityPrediction, self).__init__() ...
e0a369814b8df0e6ffb7131a3babd025c4677760
41641ec3a329bd7ac65eadfeb78fc229796eac60
iamlxb3/Dissertation_2017_Sheffield
/app/dow_jones_window_shift_regression_[baseline].py
Python
py
5,606
no_license
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # The complete PCA CV test for a share MLP regressor # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # (c) 2017 PJS, University of Sheffield, iamlxb3@gma...
8c08e111dd227ed580db6f1e2bf567505bfd3718
cd1eaaae833f6b7d2d5c89efd7f22b2ad4d58df9
ChristopherBradley/cogent3
/src/cogent3/cluster/UPGMA.py
Python
py
6,029
permissive
# usr/bin/env python """Functions to cluster using UPGMA upgma takes an dictionary of pair tuples mapped to distances as input. UPGMA_cluster takes an array and a list of PhyloNode objects corresponding to the array as input. Can also generate this type of input from a DictArray using inputs_from_dict_array function....
efcdd92e489c416505ea08875fe6daabe2e378d5
a6faa2ab6172f44df3d302b313e873aa6e61e99e
EvZissel/Residual-Flow
/calculate_log.py
Python
py
4,212
no_license
## Measure the detection performance - Kibok Lee from __future__ import print_function import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import numpy as np import torch.optim as optim import torchvision import torchvision.transforms as transforms import numpy as np i...
8683cf070f69b4e4ec1e05654de965ae985f38bc
a67fe9e8f6a14d32324763152ac8981369d161ed
arunmishra2000/hackMonteroXAirmax
/Machine Learning/Polygon Approximation/polygon_fit.py
Python
py
1,256
no_license
# import the necessary packages import cv2 class ShapeDetector: def __init__(self): pass def detect(self, c): # initialize the shape name and approximate the contour shape = "unidentified" peri = cv2.arcLength(c, True) approx = cv2.approxPolyDP(c, 0.04 * peri, True) ...
e983c9389b346b2433f5c53436da2cfb0f26589b
3433ba1104e2606f6ceaa1cf5f3ac63b09ddd54b
praneeth11009/neural-motifs
/lib/fpn/roi_align/build.py
Python
py
2,920
permissive
from __future__ import print_function import os import torch ## OLD # from torch.utils.ffi import create_extension ## NEW import glob from setuptools import find_packages from setuptools import setup from torch.utils.cpp_extension import CUDA_HOME from torch.utils.cpp_extension import CppExtension from torch.utils.cp...
7952e2d5597a47825cedb0d578dd3a13ff304104
ebd5289c7f0a0011e1e1b727c452da6583ef23e7
ItZzMJ/SpotifyDownloader
/app/progress.py
Python
py
8,397
no_license
import PySimpleGUI as sg from time import sleep sg.theme('Dark Blue 3') """ Demonstration of simple and multiple one_line_progress_meter's as well as the Progress Meter Element There are 4 demos 1. Manually updated progress bar 2. Custom progress bar built into your window, updated in a loop 3. o...
270afe41309061905a5dd9dd2a987132b359e3b9
eb44245aa0f616babe0a90ffd73ce6ee16435c57
dmculley/peryton
/peryton/navier_stokes/algorithm_ns.py
Python
py
1,077
no_license
""" .. module: algorithm_ns :synopsis: Implementation of the XXX algorithm for solving the navier stokes equations. """ from firedrake import * from ..helpers import * from backend_ns import NS_Backend, NS_BackendParameters class NS_AlgorithmParameters(NS_BackendParameters): pass class NS_Algorithm(NS_B...
9f43a645435d39d498684b9b9fe97a156ad59a30
497bb9d72d793f3df285477be4a53928de8243f3
paulsmith/django
/tests/modeltests/validation/test_unique.py
Python
py
5,919
permissive
from __future__ import absolute_import import datetime from django.core.exceptions import ValidationError from django.test import TestCase from django.utils import unittest from .models import (CustomPKModel, UniqueTogetherModel, UniqueFieldsModel, UniqueForDateModel, ModelToValidate, Post, FlexibleDatePost, ...
b1293bee4eeaa565b198a2312e050f976aa76a7e
de3a3e81222c978f11c7d9224a7f972b8818d56d
OliviaVitali/Galaxian
/breakout.py
Python
py
12,650
no_license
#!/usr/bin/env python3 import pygame import random import sys #handles text Overlay placed on screen class Overlay(pygame.sprite.Sprite): def __init__(self): # Equivalent statements: #pygame.sprite.Sprite.__init__(self) super(pygame.sprite.Sprite, self).__init__() self....
16e5d072a4940e3127d296930d28f7a61c05a818
86e1a9e0df7ec2069c24bfc517691889852b1766
e3bo/dvc
/dvc/main.py
Python
py
2,352
permissive
"""Main entry point for dvc CLI.""" from __future__ import unicode_literals import logging from dvc import analytics from dvc.cli import parse_args from dvc.config import ConfigError from dvc.exceptions import DvcParserError from dvc.exceptions import NotDvcRepoError from dvc.external_repo import clean_repos from dvc...
a26dad62f27e6012dfce8125c82cb065cda5a7d6
9e8bb9a9a3c7973e5e43eae3b6c90e789954c138
pollination/python-sdk
/test/test_input_folder_reference.py
Python
py
1,627
no_license
# coding: utf-8 """ pollination-server Pollination Server OpenAPI Definition # noqa: E501 The version of the OpenAPI document: 0.27.0 Contact: info@pollination.cloud Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import...
66dd1c1bf059be84599e5f7b0ac98f4176add54a
0845ae59942d4c550f456e4c3f600eb6e0dfeded
zzz2010/light-gcn-paddle
/code/model_conversion.py
Python
py
4,070
no_license
import paddorch from paddorch.convert_pretrain_model import load_pytorch_pretrain_model from glob import glob from paddle import fluid import os import numpy as np import torch_model import world import utils from world import cprint import paddorch as torch import numpy as np from tensorboardX import SummaryWriter ...
266a9b747e077635f8a3980f39b8d5a99a920c59
8c4119c85fa09ba69dcb1c74ac3bbbaea1a2e8b5
Oliver-Price/Python-Dust-Codes
/CORHEL/Plot_panstarrs_speeds.py
Python
py
5,263
no_license
# -*- coding: utf-8 -*- from astropy.time import Time import easygui import os import numpy as np import sys import matplotlib.pyplot as plt import scipy.ndimage sys.path.append(r"C:\PhD\Python\Python-Dust-Codes\General-Use") sys.path.append(r"C:\PhD\Python\Python-Dust-Codes\FP Overplot") sys.path.append(r"C:\PhD\Pyth...
7387160e2a2530918e2acc2eaa6a3b206212d67a
1cdd49bb7eb9ec1e4cb48ab432354ed09aa825bf
crowdbotics-apps/motormaker-20404
/home/migrations/0002_load_initial_data.py
Python
py
1,294
no_license
from django.db import migrations def create_customtext(apps, schema_editor): CustomText = apps.get_model("home", "CustomText") customtext_title = "motormaker" CustomText.objects.create(title=customtext_title) def create_homepage(apps, schema_editor): HomePage = apps.get_model("home", "HomePage") ...
43768df97dc7a89cbd01f7bed11cd577b7eefe46
901285b626a8551098a1313215aa2c7f1be6fd2f
tsergien/Python-Django-piscine
/d06/d06/ex00/views.py
Python
py
1,251
no_license
from django.shortcuts import render, redirect import random from django.conf import settings from django.contrib.sessions.models import Session from django.contrib.auth.models import User from django.contrib.auth import authenticate from .forms import RegisterForm def index(request): if 'user_name' not in request....
f62a08e5d3775f4a8c9b865b53b066f0edfc7f1a
8cad10dfe7fd131354f756bec6e20a67f34c3701
jpaarhuis/ALQO
/qa/rpc-tests/wallet.py
Python
py
3,936
permissive
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Exercise the wallet. Ported from wallet.sh. # Does the following: # a) creates 3 nodes, with an emp...
cd1bbf579921290d0f27a2724aa7555ea757f6db
e361e70103985a47f9edad2f824418f8de1eff59
michaeladayshchan/my-first-blog
/blog/migrations/0001_initial.py
Python
py
987
no_license
# Generated by Django 2.0.13 on 2019-03-22 21:04 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AU...
cdb118b306a4a14b846ddd9a894c3dbee4e93dc3
c43b6de4597c3f3b7a0850292b28c74eb508b129
ojwanganto/rest
/untitled/urls.py
Python
py
4,140
no_license
"""untitled URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
3aa7f166b58320335b51b9a814cbfeedf798897f
3e9572d388403f8156f7d7a57b0e29eec15e206e
csy1204/2019spring_01class_team4
/backend/problem/migrations/0001_initial.py
Python
py
5,093
permissive
# Generated by Django 2.1.7 on 2019-06-04 04:57 from django.conf import settings import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion import problem.models import utils.models class Migration(migrations.Migration): initial = True dependencies...
8449bd8689971782f86644edaa78e96c2f6be4f2
480c302e7f6c66a4ce314902268b57c3c0552900
ignasiialemany/1DVenousSystem
/helpers.py
Python
py
5,970
no_license
""" This file contains all the helper functions used in the codes for conservation laws. In particular, functions to extend the stencils, the slope limiters and the functions to initialize the problems. """ import numpy as np def extend(x, q, m, BCl, ql, BCr, qr): """Purpose: Extend dependent and independent ve...
058a9ff14df782b5f4cb6ee9aa280dae9cd1c132
44eacade95191eccdcd2ff05f6cbcfbcc80bb11d
Unungentium/deloitte
/deloitte/asgi.py
Python
py
393
no_license
""" ASGI config for deloitte project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETT...
5eaf2bf0865bb602266a0bda473362dc7ca32fb3
b6c648b67c521905c781feb1f9ebc7f5094ec42b
mbronstein/ss411
/ss411/common/models/mbbasemodel.py
Python
py
831
permissive
from django.db import models from uuid import uuid4 from django.conf import settings class MbBaseModel(models.Model): id = models.UUIDField(default=uuid4, editable=False, primary_key=True) rec_updated_by = models.ForeignKey(settings.AUTH_USER_MODEL, ...
4352c198437fc9694e3325171e617362414fe5b8
484ca4fd4af2b37be590add14ecf6504478d9be1
tkf/sphinxcontrib-emacs
/sphinxcontrib/emacs/directives/desc.py
Python
py
19,380
permissive
# -*- coding: utf-8; -*- # Copyright (c) 2014 Sebastian Wiesner <lunaryorn@gmail.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the ri...
98df19a3ec1f2b0fe208f1c1b8fa2aba476d8252
4eca87d5962fd3af87971b24f8c95ac39421cdd8
crowdbotics-apps/new-collab-25626
/backend/users/migrations/0002_auto_20210410_2236.py
Python
py
1,275
no_license
# Generated by Django 2.2.19 on 2021-04-10 22:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("users", "0001_initial"), ] operations = [ migrations.AddField( model_name="user", name="last_updated", ...
4068c5f45999bf5cd3df08130b63bef68adb126c
e4ca630c617f8ad7db1b2e3a495f3e3f867839c4
Infnote/infnote_django
/blockchain/client.py
Python
py
1,435
no_license
import grpc import json from django.conf import settings from users.serializers import UserBlockchainSerializer from posts.serializers import PostBlockchainSerializer from utils.singleton import Singleton from .codegen.manage_pb2 import BlockCreationRequest from .codegen.manage_pb2_grpc import IFCManageStub class C...
33a5eb64755663ab26bf13a466d9b639d4ae82d7
2423d627202b5150f807f0938eb9cb264989b946
ChaoGaoo/PYmods
/source/scripts/client/gui/mods/mod_ShowVehicle.py
Python
py
4,708
no_license
import BigWorld import Keys import Math import bisect from AvatarInputHandler.DynamicCameras.SniperCamera import SniperCamera from AvatarInputHandler.control_modes import SniperControlMode from PYmodsCore import PYmodsConfigInterface, overrideMethod, Analytics, checkKeys from vehicle_systems.tankStructure import TankPa...
e15c8d253c04bacf50a0bf234450e5430d4cb88c
0a56aa7bb392656d531abcdc370fc5a700463b3b
bjester/ricecooker
/setup.py
Python
py
1,966
permissive
#!/usr/bin/env python # -*- coding: utf-8 -*- import ricecooker from setuptools import setup, find_packages readme = open('README.md').read() with open('docs/history.rst') as history_file: history = history_file.read() requirements = [ "pytest>=3.0.2", "requests>=2.11.1", "docopt>=0.6.2", "le_ut...
0b59450a1a16f2d2b79eac46b85a19ac6cebbe43
d76ec0db87dac63e1debeb5e8c57cd99db60665e
timswyzen/discordTCG
/nodes/Neuron.py
Python
py
550
permissive
#!/user/bin/env python from cardList import addNode # Simple variables from classes.NodeFunction import NodeFunction NAME = "Neuron" DESC = "At the start of your turn, draw a card." ENERGY = -3 # What happens when you play it (at the start of your turn) async def turn_func(ply, enemy, data, affected_player): ...
0400d4a8d5b035456c439c53c06507ffd8f9bec1
6d8899daadb1521ced4f03aca1330657e0df1210
genius-2/python-files
/blackjack.py
Python
py
635
no_license
list = [1,6,7,8,9,10,2,3,4,11] * 4 import random random.shuffle(list) print('Lets play blackjack') count = 0 while True: bet = input('Do you want to add a card? y/n\n') if bet == 'y': new = list.pop() print('You got a card of dignity %d' % new) count += new if count > 21: ...
e648d46432edc436c6d046b724842be30059849b
0779d7675a19afc46b22a6209264f450b737fcdc
GuanghuiFU/clinicadl
/clinicadl/utils/caps_dataset/data.py
Python
py
37,502
permissive
# coding: utf8 import abc from logging import getLogger from os import path from typing import Any, Callable, Dict, List, Optional, Tuple, Union import numpy as np import pandas as pd import torch import torchvision.transforms as transforms from clinica.utils.exceptions import ClinicaCAPSError from torch.utils.data i...
7f5a50c2587672847270ad5027b0c88c1280262a
b759a4a7468506ad6654cfcd089be1f94897f504
DanielSantaR/snake-PDI
/src/controls.py
Python
py
11,049
no_license
# -------------------------------------------------------------------------- # ------- PLANTILLA DE CÓDIGO ---------------------------------------------- # ------- Conceptos básicos de PDI------------------------------------------ # ------- Por: Daniel Santa Rendón daniel.santar@udea.edu.co-------------- # ------- ...
5e5cf37028a660c478c9fa99337861ce28e55a2d
651fe33452091028cacc3cc2b67bad061fcad13c
dtiesling/rmvid19
/app/app/wsgi.py
Python
py
387
permissive
""" WSGI config for rmvid19 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTI...
4e42679fb3378fd82af23c74161811a179fd9c50
404108e1d49cb06108939658f8b40c8f3954af5d
LeeSungRyul/TIL
/Algorithm/BAEKJOON/Graph/2606_바이러스.py
Python
py
912
no_license
""" 1번 컴퓨터부터 시작하여 바이러스에 걸린 연결된 컴퓨터 수를 구하는 문제 모든 경우의 수 고려해야 하므로, DFS, BFS 상관 X """ from collections import deque def dfs(start): visited[start] = 1 for nxt in graph[start]: if not visited[nxt]: dfs(nxt) def bfs(start): queue = deque() queue.append(start) visited[start] = 1 ...
d7800469bfc6e00ce660e126ecb78ed744287846
baaad5ddf498ebf764628b110dc755e6e4de4848
MRowshan/chromesthesia
/synesthesia/urls.py
Python
py
6,435
no_license
from django.conf.urls import url, include from . import views import uuid app_name = 'synesthesia' urlpatterns = [ # ==================================================================================================================== # admin url(r'^adminpage/$', views....
5fd39cc5cb7ccad71e44fafe399a174af4b06234
14902551663cddcfff2e2285f64ced8d36c5fe64
taizilinger123/pythonjichu
/diqizhang/day07/renrenlogin/renrenlogin/spiders/renren.py
Python
py
1,911
no_license
# -*- coding: utf-8 -*- import scrapy # 实在没办法了,可以用这种方法模拟登录,麻烦一点,成功率100% class RenrenSpider(scrapy.Spider): name = "renren" allowed_domains = ["renren.com"] start_urls = ( 'http://www.renren.com/xxxxx', 'http://www.renren.com/11111', 'http://www.renren.com/xx', ) cookies =...
3885d7917961956408b7ee2cd27df39d78d515af
6c34eda8ef220d4dee00a4bf0db2728c22f53807
mepps-md/openprocurement.relocation.tenders
/openprocurement/relocation/tenders/views/award_complaint.py
Python
py
1,787
permissive
# -*- coding: utf-8 -*- from openprocurement.api.utils import ( json_view, APIResource, ROUTE_PREFIX, context_unpack ) from openprocurement.tender.core.utils import save_tender, optendersresource from openprocurement.relocation.core.utils import change_ownership from openprocurement.relocation.core.vali...
33d614bc0224eba83e99f746c8b157a5c22d9bc4
563dba3bfddcce58921a85ca5cee1a36341bd5a7
andykal/pythonled
/cpx/text.py
Python
py
1,823
no_license
from adafruit_circuitplayground.express import cpx # imports the CPX library from its subfolder cpx.pixels.brightness = 0.1 # set pixel brightness cpx.pixels.fill((0, 0, 0)) # turns all pixels off cpx.pixels.show() # sends data to pixels ...
d007a499c151770519fa5076f2d540f802e31d48
194e05d534d8bc11d842b946eefac0d13e6ba357
rheehot/plugin-azure-cloud-services
/src/spaceone/inventory/libs/schema/cloud_service_type.py
Python
py
1,664
permissive
from schematics import Model from schematics.types import ListType, StringType, PolyModelType, DictType, BooleanType from spaceone.inventory.libs.schema.metadata.dynamic_layout import QuerySearchTableDynamicLayout from .base import BaseMetaData, BaseResponse, MetaDataViewTable, MetaDataView class CloudServiceTypeMeta...
0eacf5be7c2259b3593a88f85b652bb9b4558635
ae78733529c6529c2ac9d0a05dd580401033db47
logicals7/problems-solving-python
/Hexagon/task.py
Python
py
293
no_license
import math class Hexagon: def __init__(self, side_length): self.side_length = side_length # create get_area here def get_area(self): # return f'{3 * 3 ** 0.5 * self.side_length ** 2 / 2:.3f}' return '%.3f' % (3 * math.sqrt(3) * self.side_length ** 2 / 2)
e98a5893f9fc4b6cc71204f04c23286d2693a591
6ec48edc419eea5404545c9eaf239125725989cf
KunalKP4042/KPs-Resto-Bar
/blog/migrations/0002_auto_20210111_1959.py
Python
py
560
no_license
# Generated by Django 3.1.3 on 2021-01-11 14:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='category', options={'verbose_name': 'ca...
5fc9b68fed5b7034796aab4e5ca9a8dc6a2e210d
d48dd3eae093501243f48fe6cde56ae64f99b28c
aman0511/E-portal
/online_status/views.py
Python
py
973
no_license
from django.contrib.auth.models import User from django.core.cache import cache from django.http import HttpResponse from django.shortcuts import render_to_response from django.template.context import RequestContext import json from online_status.status import CACHE_USERS from online_status.utils import encode_json d...
356de62915b296b549e41394b16de25cad432f40
46d21e0d0691dcc253df304832b34a369991dcec
skohlbr/pandora_ros_pkgs
/pandora_control/pandora_sensor_orientation_controller/scripts/pandora_sensor_orientation_controller/move_kinect_script.py
Python
py
541
no_license
#! /usr/bin/env python import roslib import rospy import sys import actionlib from pandora_sensor_orientation_controller.msg import MoveSensorAction, MoveSensorGoal if __name__ == '__main__': rospy.init_node('move_kinect_client_py') client = actionlib.SimpleActionClient('control/move_kinect_action', MoveSenso...
a45abb0cfc05379dd975f8ab8a5feed448bf12b7
336ebc9087d6e0fd6c6cdc37fb5b3075411a4b1a
aemann01/pythonMisc
/heterozygosity.py
Python
py
1,210
no_license
# heterozygosity program for an infinite number of observations # Allison Mann 9.4.12 # introduction print 'Heterozygosity Calculator v. 1.0' print '==========================' print '(n/[n-1])(1-SUMpi^2)' print '==========================' print 'To use you will need to know the following:' print '1. Sample size (n)'...
54bc17accb02d8289be07a646aff5cc68dd1c515
7199b498f2d5f0eb339ccd87963373aa5e595aca
FlavourApp/Flavour
/Flavour/Flavour/settings.py
Python
py
2,062
no_license
""" Django settings for Flavour project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
2212b21f503450df910c47bbacfc2d7aa18417fe
d108112e8f4b4a0a071605e475877615d0108607
MrLeaper/ConSERT
/transformers/testing_utils.py
Python
py
14,955
no_license
import inspect import logging import os import re import shutil import sys import tempfile import unittest from distutils.util import strtobool from io import StringIO from pathlib import Path from .file_utils import ( _datasets_available, _faiss_available, _flax_available, _sentencepiece_available, ...
8bd1fd60d976411dde6d5549995ec4c3fc8f4f48
80120a04075e134bcfe85c9f6f81987735cd770e
Khushboo-SerpentCS/EduERPv8
/library/library.py
Python
py
22,777
no_license
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2011-2012 Serpent Consulting Services # (<http://www.serpentcs.com>) # Copyright (C...
71a3e2cba5171312a6e3bc7d031c51ab2090dafd
25bb9b23d56f276b306f5a35fa68d155909397cc
sushanghai/pl
/python2/maopao.py
Python
py
239
no_license
arr = [5,7,1,311,2333,24,2,5,6] count = 0 index_max=len(arr)-1 for j in range(index_max): for i in range(index_max-j): count +=1 if arr[i]>arr[i+1]: arr[i],arr[i+1]=arr[i+1],arr[i] print arr print count
f6e50d97c6abf28d5c432b26b52b9b88f0daf3bc
103592c7d11540026a3e67851eb9782f3377148d
OmarWagih1/colour
/colour/models/rgb/datasets/max_rgb.py
Python
py
2,355
permissive
# -*- coding: utf-8 -*- """ Max RGB Colourspace =================== Defines the *Max RGB* colourspace: - :attr:`colour.models.MAX_RGB_COLOURSPACE`. References ---------- - :cite:`HutchColorf` : HutchColor. (n.d.). MaxRGB (4 K). http://www.hutchcolor.com/profiles/MaxRGB.zip """ from __future__ import divisio...
9a457c54eeb88821ed2101540ae63109d272712b
47f9b4dabf0587cd755fae17f7f1261fb19d706b
taoyongxin/python-learning
/语法基础/Day32/使用Pillow生成海报.py
Python
py
2,673
no_license
""" 使用Pillow生成海报 """ from PIL import Image, ImageDraw, ImageFont import time header = '001' title = '想看会儿海' books = ['中国史纲五十讲', '再见拖延症', '心流'] writes = ['让自己不失望最好的办法就是别妄想拥有', '你活着本应该独一无二简单快乐'] summary = '习惯在一个任务开始之前,先给自己设立一个看起来不太可能达到的完美标准,并因为这个标准而\ 迟迟无法动手,那你可能也是一个完美主义者' n = 18 summary_list = [summary[i:i + n] fo...
8bfebd8d82a6dbf1ec0f7b592dcce858fd23a221
138186f2ac9a1ee065fa962e313e9d223fc79e0d
haka-s/django
/account/filters.py
Python
py
463
no_license
import django_filters from django_filters import DateFilter, CharFilter from .models import * class OrderFilter(django_filters.FilterSet): start_date = DateFilter(field_name="date_created", lookup_expr='gte') end_date = DateFilter(field_name="date_created", lookup_expr='lte') note = CharFilter(field_name="...
663a3e8d76a6f6ee139fb23afaf50c7de01c075a
455c5047a2bc2028eb4a78a15724c88f6978d625
nikhita/release
/jenkins/controllers/secrets/bin/secret-names.py
Python
py
353
permissive
#!/usr/bin/python import re import oc_common def main(): j = oc_common.connect_to_jenkins() descRegex = re.compile("_openshift/(.*)/(.*)") for descr in j.credentials.keys(): match = descRegex.match(descr) if match: print("{}/{}".format(match.group(1), match.group(2))) if __...