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 |
|---|---|---|---|---|---|---|---|---|
b5c6ca65f70545692f893e216e77cb03adb563a7 | 2904f9d0429bcc6eefd3bed01200585c62474655 | saidsabri010/ml-assignment-saidsabri010 | /src/decisiontree.py | Python | py | 2,736 | no_license | """
this module is for decision tree
"""
import os
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import tree
from sklearn.metrics import plot_confusion_matrix
from sklearn.model_selection import GridSearchCV, train_test_split
from sklearn.tree import DecisionTreeClassifier
class DecisionTree: # py... |
5aafc60185405ee826ebc0a44ae8961931f678ac | 47a63bc6fa4b9e0610f0e9e52a6aaaf0bc2d74e3 | tespechit/OLX_analise_de_dados | /obterDados.py | Python | py | 3,711 | no_license | from selenium import webdriver
from selenium.webdriver.common.by import By
import numpy as np
import pandas as pd
# Obtém a URL
def getUrl(paginacao):
'''
Obtém a URL que abriga os anúncios analisados
param int paginacao: O número da paginação
'''
return "https://sp.olx.com.br/grande-campinas/autos-e-pecas/motos... |
eba3535806059112fdc17dfc3fe95cd976b3caf0 | 653a7c0eba0499eb4252eea369c4370d7230b2d9 | pratik18v/CSE-523-Advanced-Project-I | /missingBB.py | Python | py | 945 | no_license | import csv
import shutil
bb_names = []
with open('1stbb1.csv','rb') as csvFile:
reader = csv.reader(csvFile,delimiter=' ',quotechar='|')
for row in reader:
row = ''.join(r for r in str(row) if r not in "['']")
bb_names.append(row);
#print row
print len(bb_names)
im_names = []
with open... |
a837650a49abd2b2b164203af01a21335e514644 | ce2eca99bf0c900d0e836cf70bd0de95102aa58b | thornstrom/TDDE31-Big-Data-Analytics | /lab1/q2.py | Python | py | 727 | no_license | from pyspark import SparkContext
sc = SparkContext(appName = "q2_all")
temperature_file = sc.textFile("/user/x_johth/data/temperature-readings.csv")
#102170;2013-11-29;18:00:00;-2.9;G
lines = temperature_file.map(lambda line: line.split(";"))
#102170 2013-11-29 18:00:00 -2.9 G
year_temperature = lines.map(lambda x... |
87939f8181767454794dd6933b43cdcd2e83c301 | 618aa50e3ba97eaec8e52dba34c8cd3deb3ff799 | MrWang6666/my-first-blog | /blog/migrations/0001_initial.py | Python | py | 986 | no_license | # Generated by Django 2.1.7 on 2019-02-14 14:08
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.AUT... |
aa46e49a2e1021591ded7122b97e3f38b013b327 | b35a5962a92b1753ee1313c7ff8cc755456ad309 | KareliaConsolidated/Data-Structures-and-Algorithms | /47_Practice/18_Recursion_Fibonacci/Fib.py | Python | py | 474 | no_license | # Write a recursive function called fib which accepts a number and returns the nth number in the Fibonacci sequence. Recall that the Fibonacci sequence is the sequence of whole numbers 1,1,2,3,5,8....which starts with 1 and 1, and where every number thereafter is equal to the sum of the previous two numbers.
def fib(n... |
71b6da97bd157dfb34acf8d9b9941be6f3d4f59e | d5f3af563db57737a02d909d5170ab81efcd472f | tacaswell/EPICS_CA | /EPICS_CA/CA.py | Python | py | 61,764 | permissive | #!/usr/bin/env python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... |
0c0d39da9fd931e2c53921f6d6fae631a96c903f | dbdad7efddf520c1c84c621c89ec738d886ec611 | acepele/PRG105 | /main2song.py | Python | py | 2,707 | no_license | # Variables for MadLibs program
noun = input("Enter a noun to describe the time: ")
noun1 = input("Enter a noun for your love one: ")
action = input("Enter a verb: ")
body = input("Enter a part of body: ")
feeling = input("Enter an emotional state: ")
color = input("Enter a color: ")
verb = input("Enter a loved ... |
325014e26e28966320fb21b918fc1fed608ca907 | 387e5e20035a154b8ba7ec0c5c640fd11e2231ca | bin0mial/django-course | /bookstore/urls.py | Python | py | 893 | no_license | """bookstore URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... |
23b9a72749f14945b51d77fbdf40daa32669a2f5 | 3c012ad00c672f56fb0415ed8a5908e712c52ba8 | javakian/Paddle | /python/paddle/fluid/tests/unittests/test_elementwise_div_op.py | Python | py | 7,492 | permissive | # Copyright (c) 2018 PaddlePaddle 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 appli... |
57faf17c0f86893efa0e0ac32cf54cac7e67a9a1 | 2f01fa42f03673418272ddcc7cb5682e2052dc6c | GuyAfik/MetasploitAutomation | /metasploit/api/logic/container_service.py | Python | py | 4,784 | no_license | from metasploit.api.logic.services import ContainerService
from metasploit.api.database import (
DatabaseOperations,
DatabaseCollections
)
from metasploit.api.docker.docker_operations import ContainerOperations
from metasploit.api.aws.amazon_operations import DockerServerInstanceOperations
from metasploit.api ... |
c1f5bea4713b25b3d8759dd6aa708bf8f4936a47 | 269713a8083fd10279f5b8dfceb5f6ab3e37de26 | TriggerDark/StudyCodes | /PycharmProjects/PythonCodes/02-Senior/01-迭代器、闭包、装饰器/01-迭代器.py | Python | py | 513 | no_license | """
1.function。可迭代对象
一类是集合数据类型如list、02-tuple、dictionary、set、str
一类是generator,包括生成器和带yield的generator function。
"""
"""
2.判断 是否可以迭代
"""
from collections import Iterable
from collections import Iterator
print(isinstance("abc", Iterable))
print(isinstance([], Iterable))
print(isinstance([x for x in range(5)], Iterable))
p... |
b48966d6df3509ae9c20efe0084f11abf1973ecd | eccecd2bb8ee151a689c060db8b93137489b8db8 | cclauss/Pyto | /Pyto Mac/PyObjC/WebKit/__init__.py | Python | py | 761 | permissive | '''
Python mapping for the WebKit framework.
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import objc
import sys
import Foundation
from WebKit import _metadata
from WebKit._WebKit import *
objc.addConvenienceForBa... |
64ea379e89b63a8bd881afe35c20ac2e499f6870 | 35a2ab37cf9c3d3dccc7939a9b02e0c38a28ebf3 | jagpk/nlp-bert | /question_answering/src/inference.py | Python | py | 1,137 | no_license | import logging
import json
from transformers import AutoTokenizer, AutoConfig, AutoModelForQuestionAnswering, pipeline
logger = logging.getLogger()
def input_fn(input_bytes, content_type):
if content_type == 'application/json':
logger.info(input_bytes)
return json.loads(input_bytes)
else:
... |
bf29803ffa8b2fceb03ae33432a461e487983eec | a5cc96c6eadbeb0ac35372253b3845b4baf90c82 | jdpls/Servrhe | /commands/lastadded.py | Python | py | 1,108 | no_license | from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.protocol import ClientCreator
from twisted.protocols.ftp import FTPClient, FTPFileListProtocol
import time, re
config = {
"access": "admin",
"help": ".lastadded || .lastadded || Lists the last 5 files ... |
19f270a1914e440aea2d46f2b7ea0227320a426c | 710bacba11c5047ca728c3618bc02fcf896f7f10 | apdaza/python_UEFI_2021-1 | /06 tkinter/cronometro/cronometro.py | Python | py | 989 | no_license | from unidad import UnidadDeTiempo
class Cronometro:
def __init__(self):
self.hora = UnidadDeTiempo(23)
self.minuto = UnidadDeTiempo()
self.segundo = UnidadDeTiempo()
self.parado = True
def avanzar(self):
self.segundo.avanzar()
if self.segundo.valor == 0:
... |
b10e5fbcb8d2d1815d9cda0f3ee270732dd30d94 | be2e516442b28131f37a570cda1bdd5a7bd160f7 | ratndeo/ChatterBot | /examples/django_app/tests/test_settings.py | Python | py | 728 | permissive | from django.test import TestCase
from django.conf import settings
class SettingsTestCase(TestCase):
def test_modified_settings(self):
with self.settings(CHATTERBOT={'name': 'Jim'}):
self.assertIn('name', settings.CHATTERBOT)
self.assertEqual('Jim', settings.CHATTERBOT['name'])
... |
ef0da26586f6462a69fbf42fdb044ba5ddfc763c | 6251a839c2f694bc89ca9c04828e2dbbe08c963e | ZombieIce/Python_Study | /From Introduction To Practice/Part 1 Basic Knowledge/chapter 5 dictionary/many_users.py | Python | py | 496 | no_license | users = {
'aeinstein': {
'first': 'albert',
'last': 'einstein',
'location': 'princeton'
},
'mcurie':{
'first': 'marie',
'last': 'curie',
'location': 'paris'
}
}
for username, user_info in users.items():
print('\nUsername: ' + username)
full_name ... |
4f5fefaa9b6e89f99d37d95cf8d04f0a14c21d83 | 5f74b828bcc877e8970bdde140ed1597d7c0ea5f | Aasthaengg/IBMdataset | /Python_codes/p03287/s903073803.py | Python | py | 377 | no_license | def main():
N, M = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
ans = 0
s = [0] * (N + 1)
for i in range(N):
s[i+1] = (s[i] + A[i]) % M
from collections import Counter
c = Counter(s)
for v in c.values():
if v >= 2:
ans += (v*(v-1))//... |
24c6b7e925ffe55de6593d2e94564395596cbc2f | edc379796525704e06512326438a128406ef2889 | jsw800/hwr | /recognition/crnn/train.py | Python | py | 4,960 | no_license | from __future__ import print_function
from builtins import range
import json
import character_set
import sys
import hw_dataset
from csv_dataset import HwDataset
import crnn
import os
import torch
from torch.utils.data import DataLoader
from torch.autograd import Variable
from warpctc_pytorch import CTCLoss
import erro... |
4d4a31db974ecb5872d48ce5c4f26ecd6fc9143e | a03f2f14959791ab4fec10ad20d06438d623a043 | jbampton/airflow | /airflow/providers/google/cloud/hooks/dlp.py | Python | py | 75,048 | permissive | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
24b6fb42a579e52f8421eabac425a0bddf1dd3b0 | 6a67df0e0250cf6ba0a536c15019b0b7e8239767 | abhinavrai44/nupic_anomaly | /run.py | Python | py | 1,385 | no_license | import csv
import datetime
from nupic.data.inference_shifter import InferenceShifter
from nupic.frameworks.opf.modelfactory import ModelFactory
from model_params import model_params
import nupic_output
DATE_FORMAT = "%m/%d/%y %H:%M"
def createModel():
model = ModelFactory.create(model_params.MODEL_PARAMS)
model.ena... |
b62911de7c427f13e4dec264538623c98a01449b | 96d9187d6f632ebcc6b2c871ca0647054cf956a6 | csrg-utfsm/varstar | /varstarscan/plotings.py | Python | py | 952 | permissive | from .pondering import proximity_ponderation,outlier_ponderation
from .fitting import fit
import numpy as np
import matplotlib.pyplot as plt
def plot(points,res=256):
#plots each point with it's ponderation, and the function
fig, ax1 = plt.subplots()
points= np.array(points)
xpoints= points[:,0]
... |
5607db5452dfc97d1a1bfa9259b059a640d6aa90 | 492e36b622f380dd65d8614ea0b4b2d79e93849b | singalen/hige_class | /adventure/adventure.py | Python | py | 9,829 | no_license | # coding=utf-8
import random
from bottle import route, run, template, request, static_file
class Cell:
def __init__(self):
self.type = '_'
self.items = []
self.actions = []
self.mobs = []
def get_cell_type(self):
if self.type == '_':
return template('степь ... |
434fbe0eae1d0c9f14f0cd6c92d820afc681dda5 | c484337db8eaf282c50ab6892c8e074e026b42ce | slashgk/Chat-App | /client.py | Python | py | 1,929 | no_license | """Script for Tkinter GUI chat client."""
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
import tkinter
HOST = input('Enter host: ')
PORT = input('Enter port: ')
if not PORT:
PORT = 33000 # Default value.
else:
PORT = int(PORT)
BUFSIZ = 1024
ADDR = (HOST, PORT)
client_socket ... |
a810d8d537ed16a4ce0e5d7c9713c70810588c2f | be93f86e238024a2f529d817609d050e72dfee97 | nbezverkhnii/PyWebFinalTask | /final_task/final_task/settings_local.py | Python | py | 282 | no_license | """
Файло локальных настроек. Эти настройки нужны для упрощения разработки.
"""
import os
DEBUG = True
ALLOWED_HOSTS = ['*']
AUTH_PASSWORD_VALIDATORS = []
os.environ['MY_SERVER_VERSION'] = '1.0.0.0'
VERSION = '1.2.3.4'
|
69c5a6643a48dd53490e87f7b1c54e8c7597fd62 | a4f2a100436fca5a3dccc93347d9e510d366114b | stsmith1991/opened-repository-for-homeworks | /2of6.py | Python | py | 740 | no_license | class Stationery:
def __init__(self, title):
self.title = title
def drow(self):
print('Запуск отрисовки')
class Pen(Stationery):
def drow(self):
print('Уникальное сообщение')
class Pencil(Stationery):
def drow(self):
print('Другое уникальное сообщение')
class Handl... |
1bf98e4aa9154b8d9b7e9d0d2f307a2ab7a738fc | 63ecb07c934f08d5c84f3704da80bfb3f8eaef90 | buttegab/SideScroller | /Scoller Files/scroller_old.py | Python | py | 7,476 | no_license | """ A Collaboratively-Coded Clone of Flappy Bird """
import pygame
import random
import time
class DrawableSurface():
""" A class that wraps a pygame.Surface and a pygame.Rect """
def __init__(self, surface, rect):
""" Initialize the drawable surface """
self.surface = surface
self.rec... |
d2c5684b8654cc4ca222a8c419f4bd751bf33e7a | efdce46d4f81003f53160493c76bb736a69e5d05 | mathias-ta/alx-higher_level_programming | /0x08-python-more_classes/9-rectangle.py | Python | py | 2,138 | no_license | #!/usr/bin/python3
"""
defining a class Rectangle that defines
rectangle
"""
class Rectangle():
"""
class Rectangle with
width and heigh attributes
"""
number_of_instances = 0
print_symbol = "#"
def __init__(self, width=0, height=0):
self.width = width
self.height = height... |
114b2e394742a6048a9485ffdc36c85e8dc5a9d6 | 9d2ee47eeaaf39432e75d24c9be4392d8dab3095 | fayeab/crypto-pandas | /cryptopandas/encryption.py | Python | py | 2,425 | no_license | import os
from io import StringIO
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP, AES
import pandas
def encrypt_file(data, path_file, password, recipient_key, sep=";"):
"""
Encrypt DataFrame and save it
Parameters
----------
data : Pandas Dataframe or stri... |
bc04bca85a344ace0f8117590aa7eff5708f3625 | 66edbaf3581e531db62dbdb3d9a9324c0c933a9a | igv4321/cmssw | /RecoMET/METProducers/python/HTMET_cfi.py | Python | py | 2,385 | no_license | import FWCore.ParameterSet.Config as cms
# File: HTMET.cff
# Author: R. Cavanaugh
# Date: 08.08.2006
#
# Form uncorrected Missing HT from Jets and store into event as a MET
# product
htMet = cms.EDProducer("ElseMETProducer",
src = cms.InputTag("midPointCone5CaloJets"),
METType = cms.string('MET'),
alias = ... |
cd734d2d3b7cbe2dfb7ff1eca56b7d5472723ac3 | 976d2c1a56258cc9b443bafff3aa113fbad42f65 | Antpouh467/learning | /Homework_11.py | Python | py | 4,276 | no_license | # Задание из видео "Python для начинающих 12"
# Подзадание №1: В терминах ООП описать предметную область, которую вы ранее
# писали словарем
# Подзадание №2: Придумать по 2-3 действия каждому представителю
# Подзадание №3: Обосновать в комментариях, почему именно такая структара
# выбрана и такие имена даны
# =========... |
288bc327cd3c31176e5c5dd24e3fad96ac6c68f9 | 7f10b83af4b44c19f9408b80eef4a1d3980d3f50 | jiangfeng-Myself/my-test | /python100days/day7/review_test2.py | Python | py | 504 | no_license | import random
def generate_code(code_len = 4):
"""
生成指定长度的验证码,包含数字、小写字母。大写字母
:param code_len: 验证码长度
:return: 返回验证码
"""
all_charts = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQSTUVWXYZ'
last_pos = len(all_charts) - 1
code = ''
for _ in range(code_len):
... |
b4797b4ddd18023801717832706c347d298d6839 | 146f25096d5d20e10dd97d09ffc688bcdf2eb148 | JenD123/desertisland_game | /rooms.py | Python | py | 5,889 | no_license | from items import *
#This is the info about the rooms...
beach1 = {
'locname': 'beach',
'location': [1,2],
'setting': """Around you are small yellow particles littering the beach. Oh wait,
it\'s just sand. To the right is an impassable shelf of rock. In
front of you is a small winding trail, leading into t... |
db68f8c470e5e2785617f51003cbbc4e1fe54fb8 | cc4dad4b40358a172604085dc6be6fbd59ff0eed | Nexenta/manila | /manila_tempest_tests/tests/api/admin/test_share_networks.py | Python | py | 3,672 | permissive | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
f18423572068edfbaba6eb6fe2f24318b12d1de9 | d0859da8319a4e5cdd18fbd82491d3d1c77c18b4 | ravijain056/GEMAC | /test/test_addrfilter.py | Python | py | 2,959 | no_license | from myhdl import block, instance, delay, ResetSignal, Signal, intbv,\
StopSimulation, now
from myhdl.conversion import verify
from gemac.addrfilter import addrfilter
import pytest
def clkwait(clk, count=1):
while count:
yield clk.posedge
count -= 1
@pytest.fixture()
def setupt... |
e8b9510522c09d0daf3ce803f7e0cedb94cba213 | 51f4d6995589e9330c8e9a99e6a9f047cbb65564 | nishantsinha15/Bipedal-Walker-RL | /Beta/AIProject-Explore/submission/temp.py | Python | py | 5,629 | no_license | import time, math, random, bisect, copy
import gym
import numpy as np
import pickle
GAME = 'BipedalWalker-v2'
MAX_STEPS = 1600
MAX_GENERATIONS = 1000
POPULATION_COUNT = 100
MUTATION_RATE = 0.01
def savePickle(name, toSave):
file = open(name, 'wb')
pickle.dump(toSave, file)
file.close()
def loadPickle(na... |
225c6674e0621382786ff17c8a07535545c047de | 55c4ccb5b1fedfa9eecaf062b86752a21086b71e | Jdatechong/WinSwitchCtr | /src/services/win_event_handler.py | Python | py | 4,299 | permissive | """
Script using the Windows API to register for window focus changes and print the
titles of newly focused windows.
This uses open source code from
https://github.com/Danesprite/windows-fun
on 3/1/21
"""
import ctypes
import ctypes.wintypes
import threading
class ObservableWindowChange(object):
def __init__(sel... |
1f20e8e18f3f03c4ca9e01234857f020b8913642 | 98e5f8126900137391bc43858478e05bf3522347 | jason9075/insightface | /recognition/partial_fc/pytorch/eval.py | Python | py | 3,387 | permissive | import glob
import math
import os
import cv2
import numpy as np
import requests
import tensorflow as tf
import torch
import backbones
from align import align
SIM_THR = 0.3
RECOG_SIZE = 224
LANDMARK_SIZE = 112
def main():
landmark_predictor = tf.keras.models.load_model('saved_model/face_landmark/1/')
backbo... |
3c2730bf5fa0693b09186d82737c60b21cad9432 | 19a54e60fbaea0b79cbe8e761f8a7721c496953b | GozAttila/Luna | /backend/luna_project/urls.py | Python | py | 1,444 | no_license | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from rest_framework_simplejwt import views as jwt_views
urlpatterns = [
path('backend/admin/', admin.site.url... |
f048ec9f270beb68df626c6f78d87f4378378db5 | c782677f89d92122b55a963ece5465196385d8d1 | yifaniii/python-blender | /model-active.py | Python | py | 6,820 | no_license | import bpy
import math
import random
d = 4
anz = 100
frameAnz = 21 # 动画帧到20结束
scene = bpy.context.scene
scene.frame_start = 1 # 从第一帧开始
scene.frame_end = 100 # 第100帧结束
# 不同物体进行大致动画生成,变化坐标进行移动
a = bpy.data.objects['1010']
l = a.location
a1 = bpy.data.objects['1011']
l1 = a1.location
a2 = bpy.data.objects['1012']
l2 = ... |
556296b84b7e5c8598dfbddde177fd37cd1e29d4 | 6cac4eed3b52d7f690521e2b5107713c0e300421 | CONABIO-audio/irekua-permissions | /irekua_permissions/general.py | Python | py | 961 | permissive | def is_authenticated(user, **kwargs):
return user.is_authenticated
def is_special(user, **kwargs):
return user.is_special
def is_admin(user, **kwargs):
return user.is_superuser
def is_model(user, **kwargs):
return user.is_model
def is_developer(user, **kwargs):
return user.is_developer
def... |
60ad3a1ced01861c4d095afaf584f23463f311c0 | 66def5d9b0681cee73329669fe6b152ae0e9dd2f | Curzy/UnivNews | /univs/junbuk.py | Python | py | 630 | no_license |
from bs4 import BeautifulSoup
from utils.http import fetch
from utils.univ import univ_info2dict
async def get_list(session):
prefix_url = "http://enter.jbnu.ac.kr/"
notice_url = "bbs/board.php?bo_table=sub06_01&sca=수시%2F정시"
html = await fetch(session, prefix_url + notice_url)
bs = BeautifulSoup(htm... |
6c2c615370d12a456918e39ce8eb1f2f8f9c1800 | 5edfd17099c3ad4ebeb1bf952ec387a9de414b9a | navigation-lab/gpp | /gpp_plugin/test/mbf_costmap_nav.py | Python | py | 1,506 | permissive | #!/usr/bin/env python3
import rospy
import rostest
import unittest
from actionlib.simple_action_client import SimpleActionClient
from mbf_msgs.msg import GetPathAction, GetPathGoal, GetPathResult
class TestMbfCostmapNav(unittest.TestCase):
"""Verifies that move_base can handle our plugin"""
def test_server... |
83ad9fdd08c9ad36a355b43d59826ab846f553d9 | 541b19524c48a06a75423dc08146495cb90dda9f | zshwuhan/BMF_Priors | /experiments/convergence/movielens_100K/gaussian_l21.py | Python | py | 1,246 | no_license | '''
Measure convergence on the MovieLens 100K dataset, with the Gaussian + L21 model.
'''
project_location = "/Users/thomasbrouwer/Documents/Projects/libraries/"
import sys
sys.path.append(project_location)
from BMF_Priors.code.models.bmf_gaussian_l21 import BMF_Gaussian_L21
from BMF_Priors.data.movielens.load_data i... |
6a6740efedc59cffdd85dfac20ac94ed2cf689ca | 7810e46db462e5b864a10f66180e2fc91b95830e | orionwills/Automate-The-Boring-Stuff-With-Python | /ex_regex_170.py | Python | py | 208 | no_license | #!/usr/bin/python3
import re
text = '''
42
1,234
6,368,745
12,34,567
1234
1,234,567,789
'''
mo = re.compile(r'''
^
\d{1,3}(?:,\d{3})*
$
''', re.VERBOSE | re.MULTILINE)
print(mo.findall(text))
|
e771096aee7ee9da1e8f42ad94ebceba6a7e3c5d | cce1d52d206dc51720494c9285cbfe8bbe3d6968 | sjklipp/autochem | /automol/graph/base/_amchi.py | Python | py | 10,185 | permissive | """ AutoMechanic Chemical Identifier (AMChI) generating functions
BEFORE ADDING ANYTHING, SEE IMPORT HIERARCHY IN __init__.py!!!!
"""
import itertools
from automol import util
import automol.formula
from automol.graph.base._core import atom_keys
from automol.graph.base._core import atoms_neighbor_atom_keys
from automo... |
784471f44c9d8fb46684a2300dd3b7987a3dfc31 | 65b59acd50b4e486d0cf1dba38582523f2b5ffc8 | jaynoel/azure-cli-extensions | /src/mesh/azext_mesh/servicefabricmesh/mgmt/servicefabricmesh/models/volume_resource_description.py | Python | py | 3,023 | 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 ... |
e740bb97bbbe0f8e685bd39f773714a09075fa51 | 3af96da0eddd4c14a0f4f6aee13e0acdd4b50de1 | amelgrenier/deeplodocus | /deeplodocus/utils/flags/__init__.py | Python | py | 448 | permissive | #
# DEEP_ENCODE_FLAGS
#
DEEP_ENCODE_ASCII = "ascii"
DEEP_ENCODE_UTF8 = "utf-8"
FINISHED_TRAINING = "Finished training"
SUMMARY = "Summary"
TOTAL_LOSS = "Total Loss"
WALL_TIME = "Wall Time"
RELATIVE_TIME = "Relative Time"
EPOCH = "Epoch"
BATCH = "Batch"
TRAINING = "Training"
VALIDATION = "Validation"
TIME_FORMAT = "%Y:... |
549c50dd6d299ccaf1070865939d0748236335a6 | 05973b90b7c04f656863daaaa5096b4361fcabd6 | zhangweida2080/mmd_gan_gp | /mmd_gan_1_gp.py | Python | py | 9,884 | no_license | #!/usr/bin/env python
# encoding: utf-8
import argparse
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.utils.data
import torchvision.utils as vutils
from torch.autograd import Variable
import torch.nn.functional as F
import os
import timeit
... |
2e8314f78ea2aa9ce337027fca613ffcb4181e0c | 341c75f33421489af72709d795567e9fe4e1f6d8 | goodcode-200/LabSpace | /labSpace/user/models.py | Python | py | 597 | no_license | from django.db import models
# Create your models here.
class User(models.Model):
class Meta:
db_table = 'user'
id = models.AutoField(primary_key=True)
nickname = models.CharField(max_length=10,null=False,unique=True,default="用户")
name = models.CharField(max_length=10,null=False)
email = m... |
69e5e12072780d3b1c32e80c09355d50fdcb9444 | b9cff304388ee84cc37f0d21ac45868b2b6b8c05 | stephensonc/FuzzyApplesBot | /src/worker.py | Python | py | 1,369 | no_license | import discord
import asyncio
import random
import commands
import os
client = discord.Client()
command_dict = commands.command_dict
command_trigger = "!"
@client.event
async def on_ready():
print("Logged in as")
print(client.user.name)
game = discord.Game("with time")
await client.... |
a858b9ce506108b01b9b8a8114c908a82f76ad86 | 751aeb4c374a0cdbb69bb668142844e1b58ee57a | hariNEzuMI928/bolt-python | /slack_bolt/workflows/step/utilities/async_fail.py | Python | py | 1,126 | permissive | from slack_sdk.web.async_client import AsyncWebClient
class AsyncFail:
"""`fail()` utility to tell Slack the execution failure of a workflow step.
async def execute(step, complete, fail):
inputs = step["inputs"]
# if something went wrong
error = {"message": "Just testi... |
1dd83cc4bc46859d561d88d902cd2877030b9245 | d0f26e08ada2e360479d46918c5a7beb62e4cbf7 | DHLau/PythonDemo | /12面向对象/面向对象2(继承).py | Python | py | 341 | no_license | #coding=utf-8
# 继承
class Cat:
name = '猫'
color = 'white'
def run(self):
print('%s%s跑起来了'%(self.color,self.name))
class Bosi(Cat):
def setName(self,newName):
self.name = newName
def eat(self):
print self.name,'在吃饭'
bs = Bosi()
print bs.name
print bs.color
bs.run()
bs.setName('波斯猫')
bs.run()
bs.eat()
|
553460baa4c627e127504b1212cc82c5a282c94b | 0068f48f3ec064848dc3eb6856ee81e60327df8f | Midtrans/midtrans-python-client | /midtransclient/transactions.py | Python | py | 4,746 | permissive | import sys
import json
class Transactions:
"""
These are wrapper/implementation of API methods described on:
https://api-docs.midtrans.com/#midtrans-api
"""
def __init__(self,parent):
self.parent = parent
def status(self, transaction_id):
api_url = self.parent.api_config.... |
0493821086aece06e55e8c12ff15c963b0907470 | 0f764074ed69b37b11252db1ec89e5d63e57e8fd | Hl4p3x/L2T_Server | /data_classic/scripts/quests/160_NerupasFavor/__init__.py | Python | py | 4,380 | no_license | # Made by Mr. Have fun!
# Version 0.3 by H1GHL4ND3R
import sys
from l2server import Config
from l2server.gameserver.model.quest import State
from l2server.gameserver.model.quest import QuestState
from l2server.gameserver.model.quest.jython import QuestJython as JQuest
qn = "160_NerupasFavor"
SILVERY_SPIDERS... |
19c2ed83e98032c7e6b01c6616afe18e55721cad | 082724c7369d5d8178c9a75e13ccdc7b9d125a67 | huoyu123/other | /pcaptest.py | Python | py | 10,617 | no_license | from scapy.all import *
import binascii
import bson
import time
pks = []
def parse_mongo(s):
if len(s) < 28:
return
request_header = struct.unpack('<4I', s[:16])
if (2004 == request_header[3]):
flag = struct.unpack('<I', s[16:20])
a = s[20:].index('\x00') + 1
sp = "%ds" % ... |
fd11f94acd7fcd10cc5f7ffd4201592cc443e83c | 9c1c6afe3fe65bd7df0d97b005a57abcc9bf5e96 | hakjun7/Movie-pjt | /movies/forms.py | Python | py | 554 | no_license | from django import forms
from .models import User_Vote
class User_VoteForm(forms.ModelForm):
content = forms.CharField(
max_length=100,
label='한줄평',
widget=forms.TextInput(attrs={
'placeholder': '한줄평을 작성해주세요',
'size':70
}))
cnt = forms.IntegerField(
... |
bf2fd83999f2407d8b8414670cb1082a6e930cdb | 1ea01bbd4b7c4e3a210cdccf58c347393b03f2d9 | Ophiun/Doorbell | /Server Files/old servers/testPythonFiles/client.py | Python | py | 600 | no_license | import socket
import time
# Connect a client socket to my_server:8000 (change my_server to the
# hostname of your server)
client_socket = socket.socket()
client_socket.connect(('0.0.0.0.', 8001))
# Make a file-like object out of the connection
connection = client_socket.makefile('rb')
try:
while True:
... |
b48357d56125b0af573165a294eadab81c2c060b | 80251c81c84767b7a2c9cfee20cc3d8d0e01aae0 | RossSong/keras-radam | /setup.py | Python | py | 874 | permissive | import codecs
from setuptools import setup, find_packages
with codecs.open('README.md', 'r', 'utf8') as reader:
long_description = reader.read()
with codecs.open('requirements.txt', 'r', 'utf8') as reader:
install_requires = list(map(lambda x: x.strip(), reader.readlines()))
setup(
name='keras-rectifie... |
567a2d3ffc540e2dba5e0d56bd526c3b452e76fa | f5a4b80fb3a6ff04859433f546a1524976d316e3 | fishesandloaves/propresenter-conversion | /formatutilities.py | Python | py | 317 | permissive |
def rvnumberformat(number, formatstring=None):
numberstring = str(number)
if formatstring is not None:
numberstring = formatstring.format(number)
# Check for existence of decimal place.
if '.' not in numberstring:
return numberstring
return numberstring.rstrip('0').rstrip('.') |
0a7c425210e6a8a2576a5c637a42032e970c2371 | 737fc290dba0d1f132550325cecdc8cc4f0ce013 | Eraldo/colegend | /colegend/academy/migrations/0001_initial.py | Python | py | 2,033 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-06-05 18:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0032_add_bulk_delete_pag... |
9057cfaaf4a6eba5db1bd0680d7f926aff434726 | daab988144e015b19fcf08c29e86a49e7d18ffa8 | MicroSTM/PSF | /utils/utils_physics.py | Python | py | 1,797 | no_license | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
from .utils_vec import *
def kinetic(vels, m=None, combine=False):
"""Get kinetoc energy
Args
sequences of velocities: velocities of all entities
m: mass of each enti... |
b83e4b2ef2e59bfe2bceadac4cf32127a3f7519d | 29eec70e974852e27c47254639457122b7329517 | bimalghartimagar/stocksmanager | /stocksmanager/wsgi.py | Python | py | 403 | no_license | """
WSGI config for stocksmanager 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/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... |
b26dd62a73c0a76a9273dfcbb91de6758b29c877 | 077141a25f8ce50cadcc77025821224cb2dd381b | Strangemother/mewps | /mewps_cms/home/migrations/0003_auto_20170112_1333.py | Python | py | 1,515 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-12 13:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import home.models
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class M... |
97b9c29004d61c88b17b22422745c37de76748a7 | a4adf920fc65cb85a5a12348f0d840168f84e328 | Neihtq/yt-remote | /server/client.py | Python | py | 719 | no_license | import socket, sys, struct
PORT = 8001
HOST = 'localhost'
def packSize(msg):
size = struct.pack('!I', len(msg))
return size
def connectAndSend(msg):
sock = socket.create_connection((HOST, PORT))
try:
size = packSize(msg)
sock.send(size)
sock.send(msg)
size = so... |
6a666f552572b74d876ac8e2a57e47cfec8e7a77 | ad10f5c8434497f8f7d85350c4d94c12c5813832 | HorangApple/TIL | /JavaScript/수업/day10/REST/manage.py | Python | py | 625 | no_license | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Notes.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportEr... |
1fccf8fc7ffc12263842ad2d1db00c6b412179bc | 0aa6a6590a1ede32e37990b913fb67c7babf56c5 | sudipta26889/covid-vaccine-availability-notification | /covidVaccineBook.py | Python | py | 4,807 | no_license | #!/usr/bin/env python3
import copy
from types import SimpleNamespace
import requests, sys, argparse, os, datetime
from utils import generate_token_OTP, check_and_book, beep, BENEFICIARIES_URL, WARNING_BEEP_DURATION, \
display_info_dict, save_user_info, collect_user_details, get_saved_user_info, confirm_and_proceed... |
4d7efc01ac5641b370402c095f341a8443d7474d | 59a632d43cec35b88c3ff81271109c11bcdff52c | ProjectBlackFalcon/BlackFalconCore | /strategies/harvest_duration.py | Python | py | 3,870 | permissive | import json
import time
import strategies
from strategies import support_functions, goto, harvest_map, go_drop_bank
from tools import logger as log
def harvest_duration(**kwargs):
"""
Harvests the resources on a path of maps for a specific duration
:param kwargs:
:return: report
"""
strategy... |
c0a550d89fcc25ef0fa66ade69d436cd489d0371 | 563677266fc52b9bbd51c224b0764aa7d46513ff | alisapriya/Ant_colony_optimization_process_scheduling | /ant_colony.py | Python | py | 17,258 | no_license | from threading import Thread
class Ant_colony:
class ant(Thread):
def __init__(self, init_location, possible_locations, pheromone_map, distance_callback, alpha, beta, first_pass=False):
"""
initialized an ant, to traverse the map
init_location -> marks where in the map that the ant starts
possible_locat... |
4483b11d014f0fffe5d63bc6334e14f5438a0c93 | e4986fc452fd38d5329422dab9221ef24159181f | pythonmentor/clelio-p8 | /website/views.py | Python | py | 300 | no_license | from django.shortcuts import render
def index(request):
"""Print index.html in website"""
context = None
return render(request, 'website/index.html', context)
def legal_mentions(request):
"""Print legal_mentions.html in website"""
return render(request, 'legal_mentions.html') |
999fe9f59fe659e86e854947f696e2ffc470b10c | cc3dcf83f86294a0f2cdc6e92796e28983a50017 | Melissa9596/Agora-Python-Tensorflow-Demo | /MainWindow.py | Python | py | 3,545 | no_license | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... |
970195577d0caca178180e0dfce160add71e90b2 | 8f87094d194993a62f97cde5a418002d5ed734d3 | EdgarACarneiro/fcup-bdcc | /Classes/LabExercises3.py | Python | py | 10,957 | no_license |
# coding: utf-8
# # Apache Spark exercises for laboratory class 3
#
# _Eduardo R. B. Marques, [Big Data and Cloud Computing](http://www.dcc.fc.up.pt/~edrdo/aulas/bdcc), DCC/FCUP_
#
#
# In[1]:
# This block is required if you run the program using spark-submit
# or through Google DataProc or spark-submit
if __nam... |
3caae5d93b149c26d15c0e4d15b277f089358faa | 79a497092203fb5d8863b57e7fa9b839204f7e3c | saitharun1997/eazy-nlp | /model.py | Python | py | 8,897 | permissive | from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from xgboost import XGBClassifier
from sklearn.metrics import roc_auc_score,accuracy_score
class Model_Finder:
"""
This class shall be used to find the model with best accuracy and AUC scor... |
2e0c2238383a88d5debdd3262dd2a09682f6f3cb | dbf4d108c6ae70eb14354373bf8475c25b5e92cd | Irlet/Python_SelfTraining | /Prime_numbers_less_than.py | Python | py | 461 | no_license | def return_prime_numbers_less_than_(max_num):
"""Returns a list containing prime numbers that are less than max_num"""
numbers = list(range(2, max_num))
prime_numbers = list(range(2, max_num))
for number in numbers:
for element in range(2, int((number/2)+1)):
if number % element == ... |
8d378e66b91576acffdd3ba6a8ec9fb81a9b1784 | 47a0674babfbf21b103a9c6672236f8bd6d3e958 | huyangc/flower-classify | /libs/test.py | Python | py | 2,320 | no_license | import cv2
from datalayer.minibatch import im_list_to_blob
from config.config import cfg
import numpy as np
def _get_blob(im,box):
blobs = {'data':None}
processed_imgs = []
im = im.astype(np.float32,copy=False)
im -= cfg.PIXEL_MEANS
im = im[box[1]:box[3],box[0]:box[2]]
im = cv2.resize(im,(cfg.T... |
c841aa8fc8e6c0bf1adc0f48311555c9815c6ad2 | 4a03e390148d92cfc0f592c04c7d49ed92e20a13 | rahuldhavale/djangoapi | /ApiAssessment/urls.py | Python | py | 914 | no_license | """ApiAssessment URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... |
f5595fb3a9e1a34339c72efbc23d4176728eee85 | 421ac6caf4de0c6cc30ba8ce3ad0cf8b426910a5 | aldrinpscastro/PythonExercicios | /EstruturaDeDecisao/ex009.py | Python | py | 532 | no_license | n1 = int(input('Digite um número: '))
n2 = int(input('Digite outro número: '))
n3 = int(input('Digite mais um número: '))
if n1 > n2 and n1 > n3:
print(n1)
if n2 > n3:
print(n2)
print(n3)
else:
print(n3)
print(n2)
if n2 > n1 and n2 > n3:
print(n2)
if n1 > n3:
... |
ee43e5f1b1694b4f9865be51fb486ee9e5d1fa53 | f0976761f9b9c63b07a1c21813d336488e96d89f | ben-amara/django_rest_api | /django_rest_api/rest_api/api.py | Python | py | 10,939 | no_license | import os
import io
from rest_framework import permissions, status
from rest_framework.decorators import (api_view, permission_classes,
renderer_classes)
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from django_rest_api.models impo... |
52ccc4a7006be0fedcf311da822e66d02cabf902 | 5e74c8551ca7bc592cf7a3ba7068c3feabd6ba72 | agapeuni/python_bk_ai | /bk_easy_ai/part3/p162/Fashion_MINIST.py | Python | py | 4,736 | no_license | # CNN을 쓰지 않고 일반 Neural Net만으로 학습, 학습 속도는 빠르나 정확도가 떨어지므로 여러 번 학습해야 함.
# from __future__ import absolute_import, division, print_function, unicode_literals, unicode_literals
import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
fashion_mnist = keras.datasets.fashion_mni... |
9056ba9b13160433832618466f74ddff07a542cb | 55230a28e4d61469cf2738210d9228e66a897a71 | Raagini539/programs | /Pro_4_2.py | Python | py | 305 | no_license | #raagini
a,b=map(int,input().split())
if a<=b:
d=a
else:
d=b
c=[]
for i in range(0,d):
c.append(sorted(list(map(int,input().split()))))
c=sorted(c)
for i in range(0,len(c[0])):
for j in range(0,len(c)-1):
if c[j][i]>c[j+1][i]:
c[j][i],c[j+1][i]=c[j+1][i],c[j][i]
for i in c:
print(*i)
|
e52b48de70802cb2bcf5babbb114f920b1495f18 | a867a34659be0d63b7379f466867396632a37d7b | bigpussy/pythontestarea | /business.py | Python | py | 642 | no_license | # -*- coding: utf-8 -*-
import mysql.connector
class dbMgr:
def __init__(self):
self.__conn = None
self.__cursor = None
def __enter__(self):
self.__conn = mysql.connector.connect(user='root', password='',database='mysql',use_unicode=True)
self.__cursor = self.__conn.cursor()
return self.__cursor
def ... |
3f58de795e33c97ba532937234ddc3f489164665 | 1ec52ace69d0104c55bacfe1f6f5de476c597d6b | siddsach/OpenNRE-PyTorch | /models/CNN_FF.py | Python | py | 521 | permissive | import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from networks.embedding import *
from networks.encoder import *
from networks.selector import *
from networks.classifier import *
from .Model import Model
... |
8db15dbf10dd1cfcafaea9b68d168beccd507bf4 | 912e89d7e68e667ae3957ef44a950ec642bc830b | Nik-Pod/smartsocket | /html/relay/2/on2.py | Python | py | 206 | no_license | import RPi.GPIO as GPIO
from time import sleep
led2 = 19
rel2 = 20
GPIO.setmode(GPIO.BCM)
GPIO.setup(led2, GPIO.OUT)
GPIO.setup(rel2, GPIO.OUT)
GPIO.output(led2, True)
sleep(0.1)
GPIO.output(rel2, True)
|
8ce9ee2b32021b5a05a79d2ddecb07f097da17a0 | 28ab5e18324443f43ea9a28a9007653bd2e2f533 | rnajeeb3/Pyramid | /app.py | Python | py | 449 | no_license | from flask import Flask, request, render_template, redirect, url_for, json
from checkword import check_word
app = Flask(__name__)
@app.route('/')
def start():
return render_template("form.html")
@app.route('/', methods=['POST'])
def input_data():
input_text = request.form['Word']
result = check_word(inp... |
f2f152e1e7e6d5161b5d4671cbf68dafd3401f35 | d07d89f641fbbde0bd26f56f5eaf45b372cd45d2 | baballev/TeleRPG | /game.py | Python | py | 2,546 | no_license | import pygame
import random
from pygame.locals import *
import os
import math
os.chdir("D:\\Informatique\\prog python\\jeux\\moi\\Telegame")
exec(open('lib/Perso.py').read())
exec(open('lib/DoorConnector.py').read())
exec(open('lib/Map.py').read())
exec(open('lib/Dialogue.py').read())
window_dimensions = [800, 600]
py... |
43f316ad88ec92d9913777d030a7a998b524ffad | 57accfa550ba70689d47ce2ed1b0b92a30979ea0 | persue/typeidea | /typeidea/blog/migrations/0001_initial.py | Python | py | 3,498 | permissive | # -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-08-20 13:40
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 = [
migrati... |
b57d8f2cf86b6d843b3736828d93840f074fed3b | 12c18875e958105f48bdb1656f76438f7fbc62b3 | JingkaiTang/github-play | /ask_life_with_young_point.py | Python | py | 260 | no_license |
#! /usr/bin/env python
def call_last_number_in_old_work(str_arg):
old_time(str_arg)
print('work_early_problem_from_way')
def old_time(str_arg):
print(str_arg)
if __name__ == '__main__':
call_last_number_in_old_work('seem_company_by_group')
|
525a25da01db342e066a00d88b7ff445b4886fc7 | c31b7a87e987b3a5ab721bfbbb19cda146ecf84e | Python3pkg/NeuroUnits | /src/neurounits/visitors/common/simplify_symbolic_constants.py | Python | py | 7,857 | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... |
51321ada829341a5846aa79d68aa597f87bf20ef | 995d9d7135ca453f69e4f9ea41d3cbc4afcb311e | aicanhelp/ai-harness | /src/ai_harness/language/langconv.py | Python | py | 8,250 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from copy import deepcopy
try:
import psyco
psyco.full()
except:
pass
from aiharness.language.zh_wiki import zh2Hant, zh2Hans
import sys
py3k = sys.version_info >= (3, 0, 0)
if py3k:
UEMPTY = ''
else:
_zh2Hant, _zh2Hans = {}, {}
for old, new i... |
b24e40857a838188279017b103a93732c416f24d | b9d7349823aefa17c98c3cc5b14ef9f36a752c3e | nix18/FlaskForum | /venv/Scripts/pip-script.py | Python | py | 381 | permissive | #!G:\final\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_... |
69ea36f596533b5eaf1b95c6aa87c4dad5aec81b | df6bfad53a157ec79529ab35ec698b0314020689 | EESheep/alien_invasion | /alien_invasion/ship.py | Python | py | 1,423 | no_license | import pygame
class Ship():
def __init__(self, ai_settings, screen):
"""初始化飞船并设置其初始位置"""
self.screen = screen
self.ai_settings = ai_settings
#加载飞船图像并获取其外接矩形
self.image = pygame.transform.scale(pygame.image.load('images\ship.bmp'),(73,128))
self.rect = self.i... |
f0b543627ab6839d295144ae528ca0c31eb9b51d | 5887f5052d2ca677115698145fb2584ca4a3b1a9 | skripkar/noc | /sa/profiles/3Com/SuperStack/get_mac_address_table.py | Python | py | 1,771 | permissive | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# 3Com.SuperStack.get_mac_address_table
# ----------------------------------------------------------------------
# Copyright (C) 2007-2010 The NOC Project
# See LICENSE for details
# ----------------------------------------... |
b6d93156a05e376bcb4c3b50a2e0ec724eaba678 | d0b209d2967af64a19ca23da8b503b680cd43ce0 | watheuer/db_project | /scripts/itembuild.py | Python | py | 2,615 | no_license |
#For itembuild.csv, creates a csv with:
#Buildname, Champion, role, build
#Doing that import thing. This is the library for requesting the stuff, opening the response
# that has the stuff, and handling errors if it didn't want to give us the stuff.
from urllib2 import Request, urlopen, URLError
#Import for creati... |
baf34e34b8decc65e275e821ffbff11293580eee | b4e35e31e95bf92c8aec92caf56c636b5b93eff5 | firas16/BusAPI | /instance/config.py | Python | py | 948 | no_license | import os
class Config(object):
"""Parent configuration class."""
DEBUG = False
CSRF_ENABLED = True
SECRET = "\x91N83\xb3\xea\xdd\x85\xfa\xa1c\xfa\xae\xb1\x1cFFy\xb7i/\xb4\x99\x88"
SQLALCHEMY_DATABASE_URI = "postgresql://postgres:postgres@localhost:5432/postgres"
class DevelopmentConfig(Config):
... |
a42cf37c94082431190e5bfbc2460a621c2b9d1c | 5a6c4d15d269b5740b82b3778b93794001c10113 | kozakusek/ipp-2020-testy | /z2/part3/updated_part2_batch/jm/parser_errors_2/366414052.py | Python | py | 2,583 | permissive | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 366414052
"""
"""
random actions, total chaos
"""
board = gamma_new(4, 4, 3, 8)
assert board is... |
b1647b5668a41c1bb03184382eca46adfe491467 | 8a185f43119842e9ed86d12284d4cadabeb49489 | spujols/bondblack-auto | /regression.py | Python | py | 22,679 | no_license | #This script will serve several purposes as of now it includes:
#Extracting every id from portal and saving it to a .csv file called "customer_ids"
#Testing redirect on login (pointing to every url in portal then testing if it goes there after login in, including sub tabs).
from splinter import Browser
import csv
impor... |
c6d7940bb0f4cd7c5d24cb299a20a02163bda1af | ce0fdc01909d689db413df8bfaa59ccbddf06c13 | curt-mitch/kattis | /different/different.py | Python | py | 291 | no_license | import sys
if __name__ == '__main__':
inputs = []
for line in sys.stdin:
inputs.append(line)
# with open('sample_data/sample.in') as f:
# inputs = [line.strip() for line in f]
for line in inputs:
n1, n2 = map(int, line.split(' '))
print(abs(n1 - n2))
exit(0)
|
a87289cdf312ca0a7ff6e8e5a179c3940ca6399e | 1bf5b6618c84327b6d39ad3fc49795b3ed11e2db | paulsha/dis_file_sys | /sec_serv.py | Python | py | 3,165 | no_license | from flask import request
from flask_api import FlaskAPI
import sqlite3 as sql
import base64, random, json, string
app = FlaskAPI(__name__)
db = sql.connect('database.db')
cursor = db.cursor()
def get_database():
return db
# encrypt the data according to the key using Vigenere cipher
def encrypt(data, key):
... |
9d2e75f2dd3e26368197d87b76fcf6cbfbed617f | ca3e93b9cd00fb58369bb08bdb4cb64c4e4df8f0 | feefis12/Lake-Currents | /events/migrations/0017_auto_20210409_1343.py | Python | py | 624 | no_license | # Generated by Django 3.1.7 on 2021-04-09 18:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0016_remove_blogpost_date_created'),
]
operations = [
migrations.AddField(
model_name='blogpost',
name='pu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.