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 |
|---|---|---|---|---|---|---|---|---|
25063fdc6ad6d6b0f8c5b562183e527a100a6e40 | 318fc36476e16580ceb9b3843f53db92d327a0e0 | zoneyaner/neteaseNews | /version/v 4.0/spider/db.py | Python | py | 3,669 | permissive | import os
import pymongo
import requests
from .config import MONGODB_HOST, MONGODB_PORT, MONGODB_DBNAME, MONGODB_TABLE_1, MONGODB_TABLE_2, \
MONGODB_TABLE_3
client = pymongo.MongoClient(MONGODB_HOST, MONGODB_PORT)
neteasenews = client[MONGODB_DBNAME]
article = neteasenews[MONGODB_TABLE_1]
coldpage = neteasenews[... |
4769babfded2a8ebe41e446d079d21ccc013568f | 9f04df2da19972bd9301265ced0de40d0430225c | Vikash082/algo-1 | /invert_binary_tree.py | Python | py | 793 | no_license | ###############################################################################
# #
# invert binary tree #
# #
... |
52d8bb368f63ab71d87fa52a3b9cf27df8ffa661 | 6e70fc494c86e5ecad4d7ebd4cb3458de7555311 | timanderson1994/split-complex-net | /OldCode/svhn.py | Python | py | 2,697 | no_license | """
SVHN Dataset Loading Functions
Dataset available at: http://ufldl.stanford.edu/housenumbers/
Based on code from: https://github.com/tflearn/tflearn/blob/master/tflearn/datasets/cifar10.py
"""
from __future__ import absolute_import, print_function
import os
import sys
from six.moves import urllib
import tarfile... |
839f16d9831c881c7a2e9eee0eb87aacd6989824 | 877cd915425605db8bdc75d45963afbef640ab8e | embedded1/django-oscar-paypal | /paypal/payflow/models.py | Python | py | 3,324 | permissive | import re
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext
from paypal.payflow import codes
from paypal import base
@python_2_unicode_compatible
class PayflowTransaction(ba... |
b64d6fc4e7d7982ac5b223eff519256afef10902 | 52914415a34a271cd24b32cca1044aeb5b84f626 | StevenLudwig/resthookdemo | /resthookdemo/crm/urls.py | Python | py | 845 | no_license | from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^contacts/$', 'resthookdemo.crm.views.contacts', name='contacts_list'),
url(r'^contacts/create/$', 'resthookdemo.crm.views.edit_contact', name='create_contact'),
url(r'^contacts/(?P<contact_id>\d+)/edit/$', 'resthookdemo.c... |
1340c6016809bf83013660626a1e6b4a13b4271a | 1c345050909dbfc4a183d8c89f956cfd6316e47a | fedorgrab/suvorov-park | /suvorov_park/common/forms.py | Python | py | 788 | no_license | from django import forms
from django.contrib.auth import get_user_model
User = get_user_model()
class SendEmailToUsersForm(forms.Form):
users = forms.ModelMultipleChoiceField(
label="Выбор пользователей",
queryset=User.objects.filter(is_staff=False),
widget=forms.SelectMultiple(attrs={"cl... |
843883e37a0c2d5f32b58b32da4320bcab771fdb | 3644775de1c7d39c386eaa667d0e8b02c8c4a847 | rickyakilimali/ria | /product/migrations/0001_initial.py | Python | py | 120,792 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-08 14:32
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):
initial = True
dependencies = [
migratio... |
2977828b1d227fbd34509e574a5d6e541f92e9fb | dc243a013473ea1a73a005c73fa739449d5bda40 | hellospacecorgi/django-web | /src/products/migrations/0002_auto_20210910_1109.py | Python | py | 564 | no_license | # Generated by Django 2.0.7 on 2021-09-10 11:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='product',
name='description',
... |
25e1a8dad5995e586ed76dee1a1835363d7ebe8a | 1ce42cca98c8054e9c7ffa7423beab7d57b7396c | SHIVJITH/Odoo_Machine_Test | /addons/l10n_ar/models/l10n_ar_afip_responsibility_type.py | Python | py | 602 | permissive | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class L10nArAfipResponsibilityType(models.Model):
_name = 'l10n_ar.afip.responsibility.type'
_description = 'AFIP Responsibility Type'
_order = 'sequence'
name = fields.Char(required=True, ind... |
9e8fca777afc7db1ad3023eab424f9d9e3fc76ae | 709ea67e2de2372b45d09ee14a79154b4056bcbd | btemovska/DictionariesAndSets | /split.py | Python | py | 830 | no_license | locations = {0: "You are sitting in front of a computer learning Python",
1: "You are standing at the end of a road before a small brick building",
2: "You are at the top of a hill",
3: "You are inside a building, a well house for a small stream",
4: "You are in a val... |
f4005eb4a563e7d1e25123e579567bff2a17a7b2 | b5f3062b3bdd91ece2c123c3a7b232a5d9e4f7d6 | zteng/Django_Web_Ticketing_Portal | /djangoappengine/main/main.py | Python | py | 2,350 | permissive | # Python 2.5 CGI handler.
import os
import sys
from djangoappengine.main import application
from google.appengine.ext.webapp.util import run_wsgi_app
from djangoappengine.boot import setup_logging, env_ext
from django.conf import settings
path_backup = None
def real_main():
# Reset path and environment variabl... |
9979f12ce40572974b1994410195cc4a8a04c2ac | fc7a54a2ad9584861e67b0dc6c7d8d8cf3228ed4 | njhanley/adventofcode | /2021/13/part1.py | Python | py | 906 | no_license | import re
def read(filename):
with open(filename) as file:
return file.read()
def match(string, pattern, function):
return [function(*match.groups()) for match in re.finditer(pattern, string)]
def parse(filename, pattern, function):
return match(read(filename), pattern, function)
data = read... |
fd12814944d0af92086b0fc54bf623d963e30572 | 094e4d28829a0f8ca54a9d0884e368cb97e444bb | ZeuSMK/vita | /src/program/lwaftr/tests/subcommands/config_test.py | Python | py | 11,538 | permissive | """
Test the "snabb lwaftr config" subcommand. Does not need NIC names because
it uses the "bench" subcommand.
"""
import json
import os
from signal import SIGTERM
import socket
from subprocess import PIPE, Popen
import time
import unittest
from test_env import BENCHDATA_DIR, DATA_DIR, ENC, SNABB_CMD, BaseTestCase
... |
75b5c6adc84f56cd613e4dd46fdfd14956a70847 | d2db532c13b03d8338688f9f71cb90be67272e62 | Dawars/pytorch | /test/inductor/test_minifier_isolate.py | Python | py | 1,860 | permissive | # Owner(s): ["module: inductor"]
import functools
import unittest
import torch
import torch._dynamo
import torch._inductor.config as inductor_config
import torch._inductor.utils
from torch._dynamo.test_minifier_common import MinifierTestBase
from torch.testing._internal.common_utils import IS_JETSON, IS_MACOS, TEST_WI... |
6f9833f4d5fce800ac5587ffe0fff9eab2b7dd46 | 804e061564f6600cb7e3966aad78f3fae2aa58c1 | ManishKumar-4/MLP-intro-streamlit-app | /obj_detection_app.py | Python | py | 4,317 | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 20 10:31:55 2021
@author: 20052
"""
# https://analyticsindiamag.com/guide-to-real-time-object-detection-model-deployment-using-streamlit/
import streamlit as st
import cv2
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
def obj_detection(my_im... |
577e29072f0e1cb65d0f5489e7a14b95db73f3ff | 5480bd0ace19884ee990c7ec7552e8b9fd4b2498 | jaypei/salt | /salt/pillar/pillar_ldap.py | Python | py | 5,235 | permissive | '''
This pillar module parses a config file (specified in the salt master config),
and executes a series of LDAP searches based on that config. Data returned by
these searches is aggregated, with data items found later in the LDAP search
order overriding data found earlier on.
The final result set is merged with the p... |
3ff2f986c160ec00acec2b13cf711224a669d9de | e3b019483be5c08cf32c3305ae49cfb65771e0a4 | acniray/pgadmin4 | /web/pgadmin/help/__init__.py | Python | py | 3,626 | permissive | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
"""A blueprint mo... |
1ce0702e16f36358016a4bd4ec80d0d461842d93 | dc46ccdad6a3d967987ce6a88f532fcf5c7f238c | Ladytoluu/FirstDjangoTask | /DjangoTask/DjangoZuri/settings.py | Python | py | 3,249 | no_license | """
Django settings for DjangoZuri project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathli... |
b70dc81d98228c4cfcf1c1752167cfd8df0c0e3d | c93c41c25b54acfee6ad9073782c6225e25f0860 | Strugglingrookie/oldboy2 | /module3/mySocket/socket_class/file_server/server.py | Python | py | 3,555 | permissive | # -*- coding: utf-8 -*-
# @Time : 2018/12/14 9:11
# @Author : Xiao
import socket
import os
import struct
import json
class Myserver():
ip = "127.0.0.1"
port = 8083
max_connect = 1 # 最对只接收5个连接,超过时直接拒绝
ip_port = (ip, port)
send_path = r"/Users/yangyiyi/Documents/oldboy/module3/mySocket/socket... |
092089729c6f3080c064ef7825de48bb62039aaa | 6badd65361289294e6d2bc1626a20f8fed419d0b | Azure/azure-sdk-for-python | /sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py | Python | py | 1,994 | permissive | # 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 ... |
f4ab101af6db7eef1955ddb6ef53a1a08a335fee | 4276837d54d6ecfbc93dfdc0ab9dd72ae58261c8 | Rouizi/OC_project11 | /catalog/migrations/0008_auto_20191026_2232.py | Python | py | 745 | no_license | # Generated by Django 2.2.6 on 2019-10-26 20:32
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0007_auto_20191020_2214'),
]
operatio... |
4c1927c701b6c108f2397fa9bc57a1814f6106e3 | 6d61d1e96f74a313c2d51b26c7946564f005e301 | cash2one/xai | /xai/brain/wordbase/nouns/_sloths.py | Python | py | 231 | permissive |
from xai.brain.wordbase.nouns._sloth import _SLOTH
#calss header
class _SLOTHS(_SLOTH, ):
def __init__(self,):
_SLOTH.__init__(self)
self.name = "SLOTHS"
self.specie = 'nouns'
self.basic = "sloth"
self.jsondata = {}
|
d0ea1d57841a06ec4f7550874dc5dfb7bd75bd3a | a3f569370f9706e52cd887ec0bdda1bb437ce034 | GeburtstagsTorte/Homework | /Projects/Sorting Algorithms/Merge.py | Python | py | 754 | no_license | # source: https://pythonandr.com/2015/07/05/the-merge-sort-python-code/
# divide and conquer
from test import SortTest
def merge(l, r):
lst = []
while len(l) > 0 and len(r) > 0:
if l[0] < r[0]:
lst.append(l[0])
del l[0]
else:
lst.append(r[0])
de... |
71ec3d2f07e794c2e69b8e113360e89f24c00f67 | 825331e7c4220f68870037a4337719d8ad56c091 | alisazhou/examplejs | /integration_tests/basic_test.py | Python | py | 333 | no_license | import requests
def test_static_files_are_served(live_server):
response = requests.get(live_server.url + '/static/tests/testy.js')
assert response.status_code == 200
def test_react_script_loads_successfully_for_index_page(browser):
assert 'Loading...' not in browser.body_text
assert 'iChef' in brows... |
2a0dc33fc54c65865591962684f3cfb225635454 | 75ff42d12aa557bffe666d18765bf0addb8d8d49 | dahaj1897/2D-lattice | /Figure-2a.py | Python | py | 9,537 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 14 18:17:45 2018
@author: seyed
"""
import numpy as np
np.set_printoptions(threshold=np.nan)
import math
from scipy.stats import linregress
import matplotlib.pyplot as plt
import pandas as pd
import random
cell_genos=np.linspace(1,2,10)
st_dev_ce... |
2bf8b8966cf1bf26d8e8cc9df5464662932da55c | ce6d9a22211c106bf41148bdce29f90c7d081ee8 | shubhamv1436/python-bootcamp | /11_ranges.py | Python | py | 263 | permissive | # Difficulty Level: Beginner
# Question: Create a list using range method
# Expected output:
# [1,2,3,4,5,6,7,8,9,10]
# Program
print([i for i in range(1,11)])
# Output
# shubhamvaishnav:python-bootcamp$ python3 11_ranges.py
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
ca8d62c0fb63ed48cae30e207b4289be128a54ad | 8101ae8a354bd2a6ea0d756ac3d2b7a79f401bf9 | venki7474/Contests_Hackathons | /hackerrank/LinkedIn/bitwise/BitwiseAnd.py | Python | py | 246 | no_license | t = int(input().strip())
for a0 in range(t):
n,k = input().strip().split(' ')
n,k = [int(n),int(k)]
res = 0
for i in range(n):
for j in range(i+1,n+1):
l = i&j
if res < l and l < k:
res = l
print(res)
|
73f4fbeb66c19112a104e37687c76a4d0f96c493 | b699a434185246261d503c4a4b7a0d98333a41c1 | Hilly12/leetcode | /misc.py | Python | py | 390 | no_license | def arrayNesting(nums):
length = len(nums)
res = 0
visited = [False] * length
for i in range(0, length):
if (not visited[i]):
n = 0
index = i
while visited[index] == False:
n = n + 1
visited[index] = True
index =... |
fe74cf025b0cf32ba3ddfddb1a775c44902c9eb3 | ae9b4434a8334e7b22d80bb0c926d2001ec5e5fe | llfccc/Django-practice | /accounts/views.py | Python | py | 4,181 | no_license | # coding=utf-8
import time
from django.shortcuts import render_to_response, render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.models import User
from django.contrib import auth
from django.contrib import messages
from django.template.context import RequestCon... |
b4f17bcaf59a0069deed2f5d17ee473d91dc0dc2 | 501c11b9fdd02b109c23d49cc8e9a5b595bc24ec | gditzler/info-theory-adv-fs | /itafs/utils.py | Python | py | 1,167 | permissive | #!/usr/bin/env python
import numpy as np
import pandas as pd
def discretize_data(data, n_bins=10):
"""Discretize a data set uniformly with as specified number of bins.
Args:
data (2D numpy array): Data set with n_samples \x n_features
n_bins (int): Number of bins to discretize the data
Returns:
... |
8e4b297bc9aa60d7672d7719c4b9b708dd51282d | baac907b1d80966089215bf70ff89c1143e3b163 | LewsTherin511/tf_models | /research/object_detection/object_detection_images_simpler.py | Python | py | 9,692 | permissive | ###################
### Imports ###
###################
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
import cv2
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
... |
3beede551b88812ca8e3abd63b94b3f2517746ae | ea219bfcf5d7410cc11c90209e14a1bcf8d38fe5 | cjbear/BackPocketSocial | /main.py | Python | py | 624 | no_license | from app import create_app, app, db, cli
import cli.app
from models import User, PostModel, MessageModel, NotificationModel, TaskModel, AssignmentModel, FyGoalModel
from flask_bootstrap import Bootstrap
app = create_app()
cli.register(app)
@app.shell_context_processor
def make_shell_context():
return {'db': db, '... |
4c6c369bc071a6d49527f380831947b424f28cd5 | 4f7a4fd06487280240c81f005add8ff7bac954b0 | Chinmay1704/Face-Recognition | /Load_model_image.py | Python | py | 1,032 | no_license | import numpy as np
import cv2
import os
import Facerecognition as fr
print(fr)
test_img = cv2.imread(r"C:\Users\cpkha\OneDrive\Desktop\IPMV Project\CHinmay(1).HEIC")
faces_detected, gray_img = fr.faceDetection(test_img)
print("Face Detected :", faces_detected)
face_recognizer = cv2.face.LBPHFaceRecognizer... |
95e49ae11e530bf4be75cab3fad9431bba323c15 | b8eb09978e490d706595f18525f424548679ae64 | ryfeus/lambda-packs | /Keras_tensorflow_nightly/source2.7/tensorflow/contrib/data/python/ops/readers.py | Python | py | 26,392 | permissive | # Copyright 2017 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... |
feb944290344a96df7db4e5beaba386194a9f93f | e9258187dd0ced8471b7f3b67518702e1b57439e | pilgrim2go/tortilla | /tortilla/wrappers.py | Python | py | 12,127 | permissive | # -*- coding: utf-8 -*-
import os
import time
import bunch
import colorclass
import requests
from .compat import string_type
from .utils import run_from_ipython
debug_messages = {
'request': (
'{blue}Executing {method} request:{/blue}\n'
'{hiblack}'
' URL: {url}\n'
' h... |
6aadc27a8ea599cc084598b21bff92c8df6f9c17 | cd8d04d18b75c14343e2edb861e266f1346f0d0c | 12libao/DEA | /.history/Sizing_Method/ConstrainsAnalysis/ConstrainsAnlysisPDP1P2_20210712105835.PY | Python | py | 21,186 | no_license | # author: Bao Li #
# Georgia Institute of Technology #
import Sizing_Method.ConstrainsAnalysis.ConstrainsAnalysis as ca
import Sizing_Method.ConstrainsAnalysis.ConstrainsAnalysisPD as ca_pd
import Sizing_Method.Aerodynamics.Aerodynamics as ad
import Sizing_Method.Aerodynamics.ThrustLapse as thrust_lapse
import Sizing_... |
46872ef595626e441da467101d7043075029b60f | 990127a6da20b03d8b68208c61f01acbff516ef3 | AgbaD/LMS | /student/models.py | Python | py | 2,055 | no_license | import ast
import uuid
from django.db import models
# Create your models here.
class Student(models.Model):
firstname = models.CharField(max_length=33)
lastname = models.CharField(max_length=33)
email = models.EmailField("email")
phone = models.CharField(max_length=33)
headline = models.TextField... |
40478fdb5d97ed1e28c618043d7eddc5645e4e5e | 03f0c826a42bc0a0e9f20f1ea389552906a4bc5a | kmohan0602/Multi-Level-Cache-Simulator | /Ques2.py | Python | py | 2,636 | no_license | import collections
from collections import defaultdict
import sys
def lookup(l, tag):
if len(l) == 32768 and (not first_seen[(tag,1)]):
first_seen[(tag,1)] = True
return [False,1]
for i in l:
if i[0]==tag and i[1] ==1:
#update lru state
i[2] += 1
ret... |
93d82c4b56f4f7ceb3008fec7c5adc4fe8912a68 | 2fd8d41cff22ae141cc8b16a9dca918eed2d0a35 | anupjungkarki/Authentication-In-Python | /authenticate/migrations/0003_profile_image.py | Python | py | 412 | no_license | # Generated by Django 3.0.7 on 2020-08-21 09:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authenticate', '0002_auto_20200821_1255'),
]
operations = [
migrations.AddField(
model_name='profile',
name='image',... |
19071b088b6b2f36222cbf8baa67e303d7d0d019 | 79b7fa761f16b5fb09655080ca78ba49a4fb93e7 | openstack/designate | /designate/backend/impl_infoblox/object_manipulator.py | Python | py | 8,691 | permissive | # Copyright 2015 Infoblox Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
8932cf7649da9005497d4b2019ad3eab15a521c7 | 5352a0f15aaaf8c3fb715fc0ea9890f8e0b93767 | tannupriyasingh/FYI_Bot | /slackbot/plugins/hello.py | Python | py | 1,377 | permissive | #coding: UTF-8
import re
from slackbot.bot import respond_to
from slackbot.bot import listen_to
@respond_to('hello$', re.IGNORECASE)
def hello_reply(message):
message.reply('hello sender!')
@respond_to('^reply_webapi$')
def hello_webapi(message):
message.reply_webapi('hello there!', attachments=[{
'... |
557506dd4a6eeab6283cade50691d805ee32d008 | eb66d747e5192edbc103396472ea30770d45488d | byteinc/Phasor | /engine/2.80/scripts/addons/mesh_extra_tools/vertex_align.py | Python | py | 9,026 | permissive | # -*- coding: utf-8 -*-
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
#... |
dd39368c02196dbbb3d1b18bf79cd45934799931 | e310bbad0e4468fc3c3e77a96f4b674ffa9f4e6d | shivaligulati/machine-learning-positive-or-negative-tone | /code.py | Python | py | 2,377 | no_license | from sklearn import tree
from sklearn.feature_extraction.text import CountVectorizer
print('')
print("Welcome to my first machine learning program! I am going to check whether your sentences in the code below are positive or negative. You can edit the sentences below and see how accurate I am.")
print('')
#dictionari... |
eb81811913a617c6bf6ad4ead1202db9ae3981ec | 5215f5a0a03692fb4bcc825907dbf2da64a335d4 | IDdesigner/readit | /readit/urls.py | Python | py | 1,701 | no_license | """readit URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/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-base... |
cef89ac737d1d2a5930872ee11c876eeef6fca90 | f2e5cf729b8f806f701d0ad2c0e77e371a6ac064 | OttaboticsRobotRacing/IARRC2018 | /pipelinetest.py | Python | py | 13,083 | no_license | import cv2
import numpy as np
from clusterpathfinder import pathfinding as pathfinder
from calibration import CameraCalibration
import binarization_utils
import matplotlib.pyplot as plt
import line_utils
from line_utils import Line
from globals import xm_per_pix, time_window
import communication.serial_communication as... |
f19d3e8fe2c19e4eceefc698062fe4b3541ea13c | 95771b6ad8753c68669d212d4b3183cc99d91be8 | fhzh123/korean_historical_documents | /neural_machine_translation/nmt_evaluation.py | Python | py | 8,431 | no_license | # Import Module
import os
import math
import time
import pickle
import argparse
import numpy as np
import pandas as pd
import sentencepiece as spm
from tqdm import tqdm
# Import PyTorch
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils as torch_utils
from torch import optim
from ... |
032f4a10824b2148bf281654b05cf9823cb10433 | 4760418ccb6094bcf5212a42da1807d86ff13fb6 | ditojohn/raspi | /electronics/pilot_getch.py | Python | py | 578 | no_license | #!/usr/bin/env python
#-----------------------------------------------------------
# File name : pilot_thread_io.py
# Description : Input/Output program to read input and
# display output using different threads
# Author : Dito
# Date : 2015/11/24
#------------------------------------------... |
1154932078b1cbe48eff103fff15c15209522db3 | 74a696dadca46d47b083f0630b23c6f4522f990b | fanhaipeng0403/redash | /redash/handlers/__init__.py | Python | py | 1,539 | permissive | from flask import jsonify
# redash __init__.py文件里
# setup_authentication(app)
# login_manager.init_app(app)
from flask_login import login_required
from redash.handlers.api import api
from redash.handlers.base import routes
from redash.monitor import get_status
from redash.permissions import require_super_admin
# Ha... |
9f8ce6b19d7dd1a753fb3df1f768b2d9871cd59e | 601aab171b162ded2ea27750ac7db1b00fb0add3 | Felix-neko/argparse_dataclasses | /example/cmd_fields_example.py | Python | py | 1,434 | no_license | from enum import IntEnum, auto
import argparse
from dataclasses import dataclass, field
from argparse_dataclasses.boilerplate import cmd_field, CmdParsingMixin
class ExplosiveType(IntEnum):
PENT = auto()
TNT = auto()
RDX = auto()
PLASTIC = auto()
UNKNOWN = auto()
@dataclass
class ExampleSetting... |
1593d848b20ba5ee4ae4defb61c807fde2b65c35 | ed98944c8782b08e06227fd827d2cb14fa7628a2 | zhuweigh/vpx13 | /nitro-python-13.0.36/nssrc/com/citrix/netscaler/nitro/resource/config/appfw/appfwlearningsettings.py | Python | py | 27,729 | permissive | #
# Copyright (c) 2008-2019 Citrix Systems, 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 l... |
44c5024a42eaf96442266aadb0f4b4a948a2af37 | 5621b4c4ecca7abde6f5995c24827766bbc455e2 | melandres8/holbertonschool-higher_level_programming | /0x02-python-import_modules/3-infinite_add.py | Python | py | 267 | no_license | #!/usr/bin/python3
from sys import argv
if __name__ == '__main__':
ind = 0
argv.remove(argv[0])
if len(argv) is 0:
print("{:d}".format(len(argv)))
else:
for index in argv:
ind += int(index)
print("{}".format(ind))
|
2ee7454d4630d59b63fb49f68f89dc1b9fcef8f2 | 7f1848c7963115c27a2a3fb1ec554ff488c6f317 | BF4045/TWEAC-qa-agent-selection | /tweak/transformer_model.py | Python | py | 14,989 | permissive | import torch
from torch import nn
class TransformerModel(nn.Module):
def __init__(self, config, bert):
super(TransformerModel, self).__init__()
self.config = config
self.model_config = config["model"]
self.agents_extended = config.get("agents_extended", 0)
self.num_labels = ... |
c54a7c80d708de6eec2ce6fe8422a4be136be54f | 9c67209f87e4e080bbaf024168abf8d3543add05 | JStrohm-10e/sqlalchemy | /lib/sqlalchemy/orm/descriptor_props.py | Python | py | 27,787 | permissive | # orm/descriptor_props.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Descriptor properties are more "auxiliary" properties
that exist as confi... |
48dce589148cfa501a411e7124fa75ac32e256d6 | 881743523c29b1f296c96280ea3be8b9453909a4 | ccBrita/YVR_Airbnb_retrieval | /A5T3MongoDB.py | Python | py | 476 | no_license | import pymongo
import time
def main():
myclient = pymongo.MongoClient("mongodb://localhost:27017")
mydb = myclient["A5db"]
mycol = mydb["listings"]
hosts = mycol.distinct("host_id")
hosts.sort()
hosts = hosts[:10]
t1 = time.time()
for host in hosts:
number = mycol.find({"host_id"... |
5e5e5c0817d20acbd17ac2b348bbc05d99ef2fdd | 17f8cdf8efc9185d59a255421d91980f269eb6f3 | novking/Deep-Learning-Project | /mnist_unzip.py | Python | py | 480 | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 7 14:08:40 2016
@author: yiz613
"""
import gzip
import pickle
'''
def load(filename):
with open(filename, "rb") as f:
while True:
try:
yield pickle.load(f)
except EOFError:
break... |
d5163d78759527bcfa891e2dfd040a589b6070c1 | 0755828b197c4add0bff9c411623f362962064af | raosudha89/clarification_question_classifier | /src/data_generator.py | Python | py | 9,479 | no_license | import sys, os
import argparse
from parse import *
from post_ques_ans_generator import *
from helper import *
import time
import numpy as np
import cPickle as p
import pdb
import random
def get_sent_vectors(sents, vocab):
sent_vectors = [None]*len(sents)
for i, sent in enumerate(sents):
sent_vectors[i] = get_indi... |
324f7fd42956efe1daf62570114405d1b18167cd | 142465217bdde014257f901b385e38055fa065da | kokosabu/Gasyori100knock | /Question_91_100/my_answer_100.py | Python | py | 9,911 | no_license | import cv2
import numpy as np
pad = 1
class NN:
def __init__(self, ind=144, w=64, w2=64, outd=1, lr=0.01):
self.w1 = np.random.normal(0, 1, [ind, w])
self.b1 = np.random.normal(0, 1, [w])
self.w2 = np.random.normal(0, 1, [w, w2])
self.b2 = np.random.normal(0, 1, [w2])
self.... |
002d5e0b034e5350d89013ad2d1ed1a5a5faf146 | 060e4a390971bfd18ac5d8b0f8f5f9156cc7cf0f | junishitsuka/supporteropinion_development | /supporteropinion_development/urls.py | Python | py | 385 | no_license | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'supporteropinion_development.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... |
1457bb36ce8caeb9df7ac3c01e01e59eb8e37ecd | f0f32b522fb61d98417e4b12a0d46ce9d56a9d7b | KB-perByte/ansible-navigator | /ansible_navigator/ui_framework/curses_defs.py | Python | py | 389 | permissive | """ commonly used defs
"""
from typing import NamedTuple
from typing import Tuple
class CursesLinePart(NamedTuple):
# pylint: disable=inherit-non-class
# pylint: disable=too-few-public-methods
"""One chunk of a line of text"""
column: int
string: str
color: int
decoration: int
CursesLi... |
089cb56da9f5292010892b78c03b8c78c19cef22 | 0c206c678a84fa3bf96f686be64445a8b6cac216 | Faylixe/crawler-manga | /sample.py | Python | py | 542 | permissive | #!/usr/bin/python
from bookler import Bookler
def build_url(chapter, page):
""" """
return 'http://www.japscan.com/lecture-en-ligne/love-hina/volume-%s/%s.html' % (chapter, page)
def get_image_url(soup):
""" """
img = soup.find('img', {'id': 'image'})
if img is not None:
for attribute in ... |
e804cbe495f627ec5f198d6f71db899613cda333 | 59c8fc5995fbf748bd4c25daa7a57823bebebba5 | mrujowfi/llwhelloworld | /requests/packages/chardet/sjisprober.py | Python | py | 3,857 | no_license | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... |
a975b44d99822c90e4c60e90224de65784403a68 | caefcc267a36f8c48e6d1834230b2d5ad4a5cc28 | YueNing/vnegmas | /vnegmas/backend/src/pyecharts/charts/basic_charts/graph.py | Python | py | 3,259 | permissive | from ... import options as opts
from ...charts.chart import Chart
from ...commons.types import Numeric, Optional, Sequence, Union
from ...globals import ChartType
class Graph(Chart):
"""
<<< Graph >>>
The graph is used to represent the relational data.
"""
def __init__(self, init_op... |
26d901bad17db6fd4fe98cd6e7dc35089a341594 | 7bfa9eb05995260c1f271ed88bda5a42801ed9db | watermelonlh/DjangoApp | /sample1/sample1/urls.py | Python | py | 655 | no_license | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'sample1.views.home', name='home'),
# url(r'^sample1/', include('sample1.foo.urls')),
# Unc... |
256a7ee666d19c6d7f5ab3f7b10e46a6caecd910 | d46a40a2dc53e267c16029c828a056517b94da71 | Manan98/breakout | /breakout/colormodel.py | Python | py | 14,649 | no_license | # colormodel.py
# Walker M. White (wmw2)
# September 2, 2012
"""Classes for three different color models.
The classes are RGB, CMYK, HSV. The constants in this module are all
defined in the RGB color space."""
import colorsys
# To handle round off error
_epsilon = 1e-13
class RGB(object):
"""An instance is ... |
02bd1770eab89190f6c3c2c91871a2fadae7603b | 2ac410ae357d6d111a42228948c13056c494ed84 | manson800819/test | /shop/migrations/0005_auto_20200310_0905.py | Python | py | 545 | permissive | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-03-10 09:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0004_type1'),
]
operations = [
mi... |
0a7f09dab8f077e3a9bb7fb19678e5cf5002df8d | 937f7d750acbd0a35aba91c9a0ca0c3eeff5170b | MdAbuZehadAntu/SimulationLab | /Offline-Montecarlo/Monte_Carlo.py | Python | py | 964 | no_license | import random
import math
import matplotlib.pyplot as plt
l=[1000,5000,10000]
pi=[]
for item in l:
hits=0
hit_lx=[]
hit_ly=[]
miss_lx=[]
miss_ly=[]
for i in range(item):
x=random.uniform(2,8)
y=random.uniform(0,8)
if math.sqrt(math.pow((5-x),2)+(5-y)**2)<=2:
... |
ffbc2d07ed13b78fa4996c3ed93b14a2600d54f2 | 1d2abbe09868bb8d19e2f87df154e217413d98a7 | berryrock/mealmapp | /map/migrations/0015_device_allowed_users.py | Python | py | 406 | no_license | # Generated by Django 2.0.13 on 2019-06-25 13:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('map', '0014_remove_device_allowed_users'),
]
operations = [
migrations.AddField(
model_name='device',
name='allowed... |
1d27b0cae8755691649cd789e88296e6f1048906 | 3a1d78dbfb81bd8be3905319ebecc9db682f32da | watsonwanda/STA141B | /mod1/testworkflow.py | Python | py | 529 | no_license | ## Paste the consecutive lines into one cell; the blank line means new cell.
## In Python, whitespace has meaning, so make sure you include the tabs and newlines
S = "STRING"
print (S[0:6])
ci = ord(S[5])
print (ci)
print (chr(ci + 1))
Y = list([0,2,6,3,1,7])
print (sum(Y))
Y[3] = 0
print (sum(Y))
cumsum = 0
for i... |
b3c21f9eaf9fb7ce1e8e34f80dbf9d880f13250e | d057b04062f3054eb21905454c5cfd83d2dc3acd | nowacki69/Python | /Udemy/Python3Bootcamp/Debugging&ErrorHandling/PythonDebugger.py | Python | py | 351 | no_license | def divide(a, b):
try:
result = a/b
except ZeroDivisionError:
return ("You cannot divide by zero!")
except TypeError:
return ("a and b must be ints or floats")
else:
return (f"{a} divided by {b} is {result}")
print(divide(1, 2))
import pdb; pdb.set_trace()
print(divid... |
f3c63dcc2b3e25719a209707c152314f10a8a66d | 152ccdd5c1319cae2f5b500c0338bf49efb87a38 | RaphaelOlivier/collision-bert | /models/presumm/encoder.py | Python | py | 3,567 | no_license | import math
import torch
import torch.nn as nn
from models.presumm.neural import MultiHeadedAttention, PositionwiseFeedForward
class Classifier(nn.Module):
def __init__(self, hidden_size, ):
super(Classifier, self).__init__()
self.linear1 = nn.Linear(hidden_size, 1)
self.sigmoid = nn.Sig... |
047cb0f64b229f6486c1514e459366ae8464bc7d | c326ccb875db1b2decfcefd2be8f9e666450d6b1 | AlexandreMouzouni/ProjectPygame | /rocket.py | Python | py | 1,308 | no_license | import pygame
import random
class Rocket(pygame.sprite.Sprite):
def __init__(self,game):
super().__init__()
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)
GREEN = (0, 255, 0)
WHITE = (255, 255, 255)
self.game = game
self.image = pygame.image.load('assets/roc... |
21fbd36bef28dc2370a31a5620af0785b69e879b | f6cd1934ce730c4670d8cf8b11fa4aa5a0440597 | WangYueScream/MyPythoTestAndPalyer | /python基础/异常模块/工厂方法模式.py | Python | py | 1,411 | no_license | class CarSotre(object):
def __init__(self):
self.factory = Foctory()
def order(self, price):
return self.factory.createCarByType(price)
class Foctory(object):
def createCarByType(carType):
if carType == 100:
return CarO()
elif carType == 102:
re... |
4b26e5f629d590e93481363f6f5da61985aacdab | ff02da87cf23a86913824aac3dc28fef13ed3319 | jzijin/PyTorch-Image-Dehazing | /dehaze.py | Python | py | 1,012 | permissive | import torch
import torchvision
import net
import numpy as np
from PIL import Image
import glob
if __name__ == '__main__':
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# device = torch.device('cpu')
test_list = glob.glob("test_images/*")
dehaze_net = net.dehaze_net().to(devic... |
1d3c8c18323c8b01c3a91d1ac24f745babad7e92 | c2ce3af73f37490f601f9b53b2648dd908122515 | chernova-ann/Data-collection-and-processing-methods | /lesson_7/items.py | Python | py | 1,010 | no_license | # Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy.loader.processors import MapCompose, TakeFirst, Identity
def process_link(value):
value = 'https://leroymerlin.ru' + value
return value
def process_price(va... |
b77ad1e138770ac2858e25e7094ec7d537bbc214 | 701a3c8c716209b6d0963aad4c064f69f2565973 | huzaifabaloch/Scrapy | /quotetutorial/quotetutorial/items.py | Python | py | 406 | no_license | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
# Extracted data in temporary containers (items) then storing in database.
import scrapy
class QuotetutorialItem(scrapy.Item):
# temporary continers called fie... |
efb7c24459564d0e2e898e32dbf8c49741ac0d0d | 65f22e9f3210f651c1d13eecd1667fb4f8cc09b0 | Aasthaengg/IBMdataset | /Python_codes/p03193/s668726608.py | Python | py | 251 | no_license | N, H, W = list(map(int, input().strip().split(' ')))
AB = []
cnt = 0
for i in range(N):
AB.append(list(map(int, input().strip().split(' ')))) #[A][B]
for i in range(N):
if int(AB[i][0]) >= H:
if int(AB[i][1]) >= W:
cnt += 1
print(cnt) |
80a3dd532972b6df11b8e440ad84549628c749c0 | 0d659ea18e97c9282e0282ffdcbff321581af16e | hagit01/ha-portfolio | /.history/base/models_20210801134115.py | Python | py | 2,221 | no_license | from django.db import models
import uuid
from ckeditor_uploader.fields import RichTextUploadingField
# Create your models here.
class Project(models.Model):
title = models.CharField(max_length=200)
thumbnail = models.ImageField(null=True)
body = RichTextUploadingField()
slug = models.SlugField(null=T... |
2e3590e3647763157039102a970063d34ead5313 | 9ac207c06d19c8401627bc973f0628ba7a6de1c7 | IvenSky/pygameTest | /drawLine.py | Python | py | 424 | no_license | import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((600,500))
pygame.display.set_caption("draw Line")
while True:
for event in pygame.event.get():
if event.type in (QUIT,KEYDOWN):
sys.exit()
#draw line
color = 100,255,200
screen.fill((0,80,0))
... |
82a5ab0f8493e932462f277038b1b08aa53db56b | 6df40434b335a9e2d85174b58ef13cd63de4423e | crhamiltonj/recipe-app-api | /app/core/tests/test_commands.py | Python | py | 819 | permissive | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommmandTest(TestCase):
def test_wait_for_db_ready(self):
"""Test waiting for db when db is available"""
with patch("django.db.utils.... |
cd3cc14fbb52bd1af8ae7c9fafd8a053fc8fb7d9 | 95d9f546f66139f430a9f893870e1391e92d32e1 | AlbertVeli/pwtools | /dicmask.py | Python | py | 4,958 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Dictionary mask analyser.
# Does the same as pwgen_stat but
# this is easier to understand and
# as a bonus it does sorting automatically.
#
# EXAMPLES
#
# Generate length 8 masks from rockyou:
# dicmask.py --min 8 --max 8 rockyou.txt > rockyou_8.txt
#
# Fetch 100 most ... |
8567a494e1265b728fe193a63a0aa39ea3b56444 | f0ae7257e99937f0884f3f0503960eed57256dd8 | XavierXia/robotframework | /src/robot/libraries/OperatingSystem.py | Python | py | 66,200 | permissive | # Copyright 2008-2014 Nokia Solutions and Networks
#
# 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... |
6bf4915249cc9bbc12753c0c18861b906f247988 | 2eb34a8bc27d56de60ee5deda26a5db855e7a297 | ddcc/llvm-project | /lldb/test/API/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py | Python | py | 3,040 | permissive | """
Check that vector types format properly
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class VectorTypesFormattingTestCase(TestBase):
def setUp(self):
# Call super's setUp().
... |
5d210d037affcc13661803c666fb1772e24c1c58 | 6e0bc4f28208fc855148759d6b2757e8d50dbab4 | jinlccs/python-sdk | /test/test_filing.py | Python | py | 1,410 | no_license | # coding: utf-8
"""
Intrinio API
Welcome to the Intrinio API! Through our Marketplace, we offer a wide selection of financial data feeds sourced by our own proprietary processes as well as from many data vendors. The primary application of the Intrinio API is for use in third-party applications and integratio... |
0a1ff51f6df232d8f74e23877fac1bf5e7c3bb02 | 6c6c1e92d27093bfb518488ecf6c725123d47d44 | Luckyaxah/leetcode-python | /寻找数组的中心下表.py | Python | py | 485 | no_license | class Solution:
def pivotIndex(self, nums) -> int:
left = 0
l = len(nums)
right = sum(nums)
for ind, num in enumerate(nums):
if ind > 0:
left += nums[ind-1]
right -= num
print(left, right)
if left == right:
... |
5bae4dd14eba1bfc23f46e5a3bc79df4b4b5b71d | 41eb6c8633f163417356644eaace83886e6e7423 | simoneromano96/sdk | /clients/client/python/test/test_json_error.py | Python | py | 942 | permissive | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.3
Contact: support@ory.sh
Generated by: http... |
6549e0a9c455af61fb2c45b50f24a23d7c722af5 | 772b37c8f3d8c5e86ce54b387e2b39d671c466cf | researchase/valohai-cli | /valohai_cli/consts.py | Python | py | 483 | permissive | import click
yes_option = click.option('--yes', '-y', is_flag=True, help='Assume `yes` to confirmation prompts.')
stream_styles = {
'status': {'fg': 'blue'},
'stderr': {'fg': 'red'},
'stdout': {'fg': 'white'},
}
incomplete_execution_statuses = {
'created',
'queued',
'started',
}
complete_exe... |
e7b50f124e0ea115399d1f8f4583b103d0226c0b | e86065ba75f73f2681975d2ef3766d778304297f | maylinaung/python-learning | /Useful Operator.py | Python | py | 318 | no_license | #word = 'abcde'
#for index,letter in enumerate(word):
#print(index)
#print(letter)
#print('\n')
#mylist1 = [1,2,3]
#mylist2 = ['a','b','c']
#for item in zip(mylist1,mylist2):
#print(item)
st = 'Print only the wordds that start with s'
for word in st.split():
if word[0] == 'P':
print(word) |
05a79f585ca580ee3a6b4ee6999b32bbe30c5e75 | a8e947c1aff0ec3fba9edd7352ba06c0893fcc86 | meniossin/src | /components/cronet/tools/package_ios.py | Python | py | 7,938 | permissive | #!/usr/bin/python
# Copyright 2016 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.
"""
package_ios.py - Build and Package Release and Rebug fat libraries for iOS.
"""
import argparse
import os
import shutil
import sys
de... |
e78d5f3b2fab1bcd1ec737519c4ae2e36e72b1a0 | f8d241b5be9fa4e54fbaacc9a687890560d3a084 | LeeThomas13/data-structures-and-algorithms | /python/code_challenges/tree_intersection/tree_intersection.py | Python | py | 2,459 | no_license | class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
self.next_ = None
self.front = None
self.back = None
class BinaryTree:
def __init__(self):
self.root = None
def pre_order(self):
values = []
... |
35ad6ae300fa05e67ca7d14ca07da3badbd3f821 | 24cc8b167af4337e4d6c3abc1adafdb59db4f133 | nesnoj/WAM | /wam/sessions.py | Python | py | 616 | no_license | from stemp.user_data import UserSession
class SessionData(object):
def __init__(self):
self.sessions = {}
def start_session(self, request):
if request.session.session_key is None:
request.session.create()
if request.session.session_key not in self.sessions:
sel... |
adf3acad0e41d251aa89e604375c0f95c5df2166 | 2512a7cf2982784566089d6f0c1b83a1437c80bb | teddude75/MNPR | /scripts/mnpr_UIs.py | Python | py | 22,010 | permissive | """
@license: MIT
@repository: https://github.com/semontesdeoca/MNPR
_ _ ___
_ __ ___ _ __ _ __ _ __ | | | |_ _|___
| '_ ` _ \| '_ \| '_ \| '__| | | | || |/ __|
| | | | | | | | | |_) | | | |_| || |\__ \
|_| |_| |_|_| |_| .__/|_| \___/|___|___/
... |
51688da5e6a3e600b755e13f9898729a0ed55d0d | 40581da1bc913610c67f90c8d0687eb4d3f653c6 | ecavan/recipe-app-api | /app/recipe/tests/test_recipe.py | Python | py | 9,737 | permissive | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import RecipeSerializer, RecipeDetailSerializer
import te... |
293fdfee64dba90bc3a1d94c5fe1f493c4e679a7 | f99a9c867ccebf99e450177ca0456ba14e335075 | dqrtec/IA | /Trabalho1 - Métodos de busca/arvore.py | Python | py | 537 | no_license | from heap import heap
class arvore:
def __init__(self, tabela, custo):
self.tabela = tabela
self.custo = custo
self.filhos = []
self.heap = heap(self,self)
def adicionarFilho(self,filho):
self.filhos.append(filho)
self.heap.adicionar(filho)
def MenorValor(self):
if self.filhos == []:
return self... |
0c40f359bf5e766cc702776cc3bdb4e45a05787f | c24fd8b810840402751ce4b53bb9990f2dd58e6c | gilles/voyeur | /docs/conf.py | Python | py | 8,294 | no_license | # -*- coding: utf-8 -*-
#
# Voyeur documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 24 13:55:51 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
01a13034cabca297b8f5dcc92210164aa31ddd47 | 24de98b875028f534c528d2198f3a9c654f24382 | lwy642473876/lwy_repository | /test_2/app/src/main/python/ShoppingWebsiteCrawlwer/items.py | Python | py | 599 | no_license | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy import Field,Item
class Good(Item):
_id = Field() #
category=Field() #
shop=Field() #
url=Field()#
name = Fiel... |
5beb95a6f97e4b757d30aac9f2ec2702589f3bb6 | 29c965d06795b29b1397a04edfc6de884a354fff | zois-tasoulas/DailyInterviewPro | /p35/p35.py | Python | py | 630 | no_license | class Queue:
def __init__(self):
self.main = []
self.aux = []
def enqueue(self, element):
self.main.append(element)
def dequeue(self):
if not self.aux:
while self.main:
self.aux.append(self.main.pop())
return self.aux.pop()
if __name__ =... |
7267236ef48a0c58cfe466dacfe64a6380e3b4a1 | c5f5f52ad3b9217de69c7e20969945be4176a0c1 | ipl31/fastparquet | /fastparquet/test/test_converted_types.py | Python | py | 5,194 | permissive | # -*- coding: utf-8 -*-
"""test_converted_types.py - tests for decoding data to their logical data types."""
import datetime
import sys
import numpy as np
import pandas as pd
import pytest
from fastparquet import parquet_thrift as pt
from fastparquet.converted_types import convert
def test_int32():
"""Test deci... |
c66604af1a0e4f9a740ce219f34b73334a319c7e | bf0070d753582d575824ed6c6e8f13cc77bf9e0d | eSedano/hoplite | /0.5/models/model_pce_cond.py | Python | py | 32,537 | no_license | # @author Enrique Sedano
# @version 0.14.07
#
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
#
import sys
import copy
import time
import random
import scipy
import sympy
from sympy import Symbol
from scipy import linalg
import os,sys
parentdir = os.path.dirname(__file__)
sys... |
4099294d611182220f8346e6dd16f50b4e043a33 | 82845d8b656015c6a7fe0cfd1e0e90f116093e04 | martinKindall/piedra_papel_tijera_python | /src/Mano.py | Python | py | 517 | no_license | from __future__ import annotations
import abc
from src import Resultado, Papel, Tijera, Piedra
class Mano(metaclass=abc.ABCMeta):
@abc.abstractmethod
def jugar(self, otraMano: Mano) -> Resultado:
pass
@abc.abstractmethod
def jugarContraPapel(self, papel: Papel) -> Resultado:
pass
... |
4431ba84abc211f6b93a5ccfe19465ee3d4a8478 | 45073f21a03d0f9c9b1853466c38c68886263e65 | zhmaoli/Django | /mysite/comment/migrations/0005_auto_20181029_1819.py | Python | py | 1,502 | no_license | # Generated by Django 2.0 on 2018-10-29 10:19
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('comment', '0004_auto_20181025_0913'),
]
operations = [
migrations.AlterField... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.