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 |
|---|---|---|---|---|---|---|---|---|
cd351c6d6fa856688c2520a4a478033d2b542312 | 434bf06bfd30812713b2161bb086219ebede10a5 | lmccartney/adventure | /adventure/magic/serializers/simple.py | Python | py | 443 | no_license | from rest_framework import serializers
from adventure.magic.models import Card, Print, Set
class CardSerializer(serializers.ModelSerializer):
class Meta:
model = Card
fields = '__all__'
class PrintSerializer(serializers.ModelSerializer):
class Meta:
model = Print
fields = '_... |
ab0da652c90e061c4b60891b999e6b58ee084c62 | d975a9e8087c40944f515cc43fb39771eddee817 | TonikX/ITMO_ICT_WebProgramming_2020 | /students/k3343/practical_works/lr3/admin.py | Python | py | 361 | permissive | from django.contrib import admin
# Register your models here.
from .models import Owner, Car, Ownership, License
admin.site.register(Car)
admin.site.register(Ownership)
admin.site.register(License)
class OwnerAdmin(admin.ModelAdmin):
list_display = ('name', 'surname', 'birth_date', 'passport', 'nationality')
... |
ba8cfdae536f8dcd49186bd8d57c9813e303a902 | fdf7a215e9caa249971acd63e4a9624fe6781799 | uba888/uba_python | /fishc/cs2.py | Python | py | 957 | no_license | #encoding=utf-8
from HTMLParser import HTMLParser
import requests
if __name__ == "__main__":
phonenum='xxxxxxxxxxx'
pwd='xxxxxxx'
mainURL='http://www.zhihu.com/'
loginURL='http://www.zhihu.com/login/phone_num'
headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, l... |
db5bf2588bc0dc18d7c6b39960cf33a737b5bead | 2ef8cc093aed8ab925e836661432996032bfa255 | nmichiels/adventofcode2015 | /day3/day3.py | Python | py | 914 | no_license | import numpy as np
# https://adventofcode.com/2015/day/3
file = open('input.txt', 'r')
instructions = file.readline()
# print(len(instructions))
def run(instructions, houses):
row = 0
col = 0
houses[ hash(str(row)+','+str(col))] = 1
for instruction in instructions:
if instr... |
f36f2509be2e705758a4ab57b4cc6afe77f3cc16 | be13b42092348cab61d2fb21fec9ae38fa21d834 | juanarturovargas/openstack-juju | /ceph-osd/unit_tests/test_status.py | Python | py | 2,948 | permissive | # Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
ff1264e794a5cc861d3fd06cbfdfafd18bfd1614 | 92955df2e7e6298a582c74d7ae677367ac42f4c4 | shjwudp/mmocr | /mmocr/utils/check_argument.py | Python | py | 1,239 | permissive | import numpy as np
def is_3dlist(x):
if not isinstance(x, list):
return False
if len(x) > 0:
if isinstance(x[0], list):
if len(x[0]) > 0:
return isinstance(x[0][0], list)
return True
return False
return True
def is_2dlist(x):
if not ... |
ca22c062ccc61ea21e385a934056487b55c049c6 | 2f7b0e7ba3dfba306cb4dd90c25a431fad34aad2 | Fellsmarch/COSC262 | /Assignment: Convex Hulls/convexhull_time.py | Python | py | 5,589 | no_license | """
Convex Hull Assignment: COSC262 (2018)
Student Name: Harrison Cook
Usercode: HGC25
"""
import time
def readDataPts(filename, N):
"""Reads the first N lines of data from the input file
and returns a list of N tuples
[(x0,y0), (x1, y1), ...]
"""
listPts = []
file = open(f... |
3602606fec75b00fb13e5548a7d6eddeb249e99c | 3cd89587bac10887e7d9f237296ec8c517c5e753 | cohux/ocean_ctf | /data/models/ctf.py | Python | py | 3,577 | no_license | """
用户相关模型
"""
from enum import Enum
from sqlalchemy import Column, String, Boolean, Integer, ForeignKey
from sqlalchemy.orm import relationship
from data.models.base import MainBase
class QType(Enum):
web = "web"
misc = "Misc"
reverse = "Reverse"
pwn = "Pwn"
crypto = "Crypto... |
59a36b0e12376cfa1ba8159d0c2a7fed2359f9cd | 35c83f2a7cdafa0be04dd441ea8593415fdd5e46 | kimjh1753/AIA_Academy_Study | /Study/DACON/mnist/data-1/dacon_mnist_cnn5.py | Python | py | 6,677 | no_license | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from keras.preprocessing.image import ImageDataGenerator # 이미지데이터 늘리는 작업
from numpy import expand_dims
from sklearn.model_selection import train_test_split, StratifiedKFold
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras.callba... |
dbf6a345c656db2ef9ef6c05fc868a3a10b83d2c | 8ac1f8ae7d1f54bfc9c186edefb894cae3ba76c5 | sallowdish/LeetCode | /033_Search_in_Rotated_Sorted_Array/tests.py | Python | py | 1,814 | no_license | #!/usr/bin/python3
from unittest import TestCase, main
from sol1 import Solution
from collections import Counter
class Test(TestCase):
sol = None
def setUp(self):
self.sol = Solution()
# test binary_search
def test0_0(self):
nums = [1, 2, 3]
target = -1
ans = -1
... |
d8fbb6a55231c2ac8fbed18e4f3f2b19283959d8 | a862b552f10e6d8c0a55cfed27cc33d8907778f5 | michael-pavlov/urbanback | /clusterize.py | Python | py | 1,464 | no_license | from batch import read_csv, Batch
from cluster_builder import ClusterBuilder
# This class represents a result of clusterization. `attacks` is a list of 'Attack' values, and
# `classes` is a dictionary of form `{class_ID: indices}`.
class Clusters:
def __init__(self, attacks, classes):
self.attacks = attac... |
8b9bdf8946c34b717d145e89c4b9a9ab47e07314 | d2b7c0cd933953215e455e71245949b0be2292f9 | nss-day-cohort-33/keahua-arboretum-hela-dancers | /user_action/annex.py | Python | py | 1,187 | no_license | import os
from environments import River
from environments import Swamp
from environments import Coastline
from environments import Grassland
from environments import Forest
from environments import Mountain
def annex_habitat(arboretum):
os.system('cls' if os.name == 'nt' else 'clear')
print("1. River")
pr... |
85bab1013badd1d5b3909b1386796cac5c139984 | 31b17947fa9518b0af5716c5b72dc707285755d7 | doctry/router | /data.py | Python | py | 1,139 | no_license | import sys
import random as rd
import numpy as np
#open file
In = sys.argv[1]
f_in = open(In,"w")
#produce random network
x = int(sys.argv[2])
y = int(sys.argv[3])
#z = sys.argv[4]
die = np.zeros((x,y))
output = []
for i in range(x*y//10):
_x = rd.randrange(0,x)
_y = rd.randrange(0,y)
if die[_x][_y] == ... |
abefd19ca0dae659f69da70082fd38c0cfe21cc2 | 748b060d0fd14a059fb95d90a84e89ad9da7d147 | aneeshusa/retype | /tests/test_retype.py | Python | py | 80,199 | permissive | #!/usr/bin/env python3
from textwrap import dedent
from typing import Optional
from unittest import TestCase, main
from typed_ast import ast3
from retype import (
ReApplyFlags,
_type_comment_re,
fix_remaining_type_comments,
lib2to3_parse,
reapply_all,
serialize_attribute,
)
class RetypeTest... |
673fb76401dd5e9330f26e8803c7d6321760698b | 8937af937ba358d84c4f99bb41a7aa2d798b481b | aaronk/metagen | /centSumm2.py | Python | py | 9,801 | no_license | #!/usr/bin/python
# JMG 1/2018
# Producing an html summary of the top 20 taxa from
# centrifuge's kraken-style report.
import sys
import gzip
def openRead(filename):
'''
Open filename for reading. '-' indicates stdin.
'.gz' suffix indicates gzip compression.
'''
if filename == '-':
return sys.stdi... |
02ec44c60d5b9e99e7c233c894ce7e86e6b6cea5 | 8f8b3489c77b8a807880c60d715070ec4cc8dae6 | the-scott-hand/incubator-heron | /heron/instance/tests/python/network/gateway_looper_unittest.py | Python | py | 1,903 | permissive | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... |
df39f1ded4598fb4ae037eb19097abe153bcfa9d | df3ac4580ee43a18eea4672ec719c2be5d2f9a56 | miladrux/plotly.py | /plotly/validators/scattercarpet/marker/colorbar/_tickvalssrc.py | Python | py | 466 | permissive | import _plotly_utils.basevalidators
class TickvalssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name='tickvalssrc',
parent_name='scattercarpet.marker.colorbar',
**kwargs
):
super(TickvalssrcValidator, self).__init__(
pl... |
fbec26ed40c3e28006745aab3e9992459fde115f | 2ba85285fd681b4dfbe9397b42b952269415fba3 | apettinen/munki | /code/client/munkilib/info.py | Python | py | 27,821 | permissive | # encoding: utf-8
#
# Copyright 2009-2017 Greg Neagle.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
7fb4d0feffb4c73f6befde083c45e8766cd1a322 | b1f6663ac950d101938a31c89888d099bf21e60f | unlimitedfocus/python | /practice/20141022/fibo.py | Python | py | 298 | no_license | def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
def fib2(n): # return Fibonacci series up to n
result = []
a, b = 0, 1
while b < n:
print b,
result.append(b)
a, b = b, a+b
return result |
825b69dc80c1ae3962526d3daf6d66abf7609547 | 71860b8883a78aa3a2b39258af681dd68c5ae2b2 | redwing710886/IR_search | /IR_search/main_window.py | Python | py | 3,420 | no_license | import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from read_dictionary import *
import codecs
class Findpage(QWidget):
oo = Analysis()
file_path = '../desktop/IRdata/'
def __init__(self, parent = None):
super(Findpage, self).__init__(parent)
self.createLayout()
... |
e3f78b52c87b782e920546e5f9d557b01a16a23d | 4041bfd2b10edff1ccc6fe8309500220df891ef2 | liuruitao/2mouth | /25-day/2类方法的作用.py | Python | py | 404 | no_license | class dateTest():
def __init__(self,year,month,day):
self.year = year
self.month = month
self.day = day
def outDate(self):
print('%s年%s月%s日'%(self.year,self.month,self.day))
@classmethod
def handleDate(cls,date):
a,b,c = date.split('-')
d = cls(a,b,c)
return d
a = '2018'
b = '05'
c = '04'
d = dateTest... |
bbeeafe2293dd932a4a0334cc2cf07b5b5f6a969 | 427fb689cf4804ba5218a8f52202c5d2f3ded73f | zoeanne/SI206_Project4_PyGame | /Pygame.py | Python | py | 10,314 | no_license | # Name: Zoe Halbeisen
# Unique name: zoeanne
# Unique ID: 8419 4416
# Section Day/Time: Wednesday 5:30-6:30
import pygame
from pygame.sprite import *
import random
import sys
import time
pygame.init()
width = 800
height = 600
score = 0 #max score user can reach is 120
screen = pygame.display.set_mode((width, heig... |
ec584bbf587e56272b14905062d8bc3d5ca99e87 | b437fe75ef209e837340262e86800eab12cb212a | ccbogel/QualCoder | /qualcoder/GUI/ui_dialog_report_comparisons.py | Python | py | 5,736 | permissive | # Form implementation generated from reading ui file 'ui_dialog_report_comparisons.ui'
#
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, Qt... |
2dacf2a63a82ae3a8ab7b0b4082e26a90b5f8bf7 | 1e797503e2e8dc62154eeb640d52f91d030449b3 | s1124226/IPOMEDT_INF1V | /interaction-hero-main/main.py | Python | py | 5,412 | no_license | # General imports
import pygame, utils, os
from classes.GameState import GameState
from classes.Button import Button
import song_library
def main():
# Initialize pygame
pygame.init()
# Set screen size. Don't change this unless you know what you are doing!
screen = pygame.display.set_mode((1280, 720))
... |
5f098ae58e209b520a9f0767bfb1751e160da32e | 332c38d24349f74a58fb1491a152d8107b8550e0 | NelleV/SORBB | /src/histograms.py | Python | py | 1,674 | no_license | import numpy as np
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.preprocessing import normalize
from load import load_data
from descriptors import get_interest_points, compute_boundary_desc
def compute_histogram(im, mask, vocabulary):
words = get_visual_words(im, mask, vocabulary)
h... |
3e86c1ea49fa78c0fbcf5087b82e442e1526e2d6 | 884bdf492a8a5175c548f5f49a968b860acee4f7 | tonybaloney/azure-pipelines-python-examples | /flask-basic/tests/test_auth.py | Python | py | 2,066 | permissive | import pytest
from flask import g, session
from flaskr.db import get_db
def test_register(client, app):
# test that viewing the page renders without template errors
assert client.get('/auth/register').status_code == 200
# test that successful registration redirects to the login page
response = client... |
8052ea244ae8184d9b134d548bc72dea9ea2a28f | c944420740a0dea67440e85f954b000023d35f2a | hariharans15/python | /armstrong_inter.py | Python | py | 218 | no_license | s,r=map(int,input().split())
a=str(s)
l=len(a)
#print(l)
for i in range(s,r):
tema=i
rem=0
while(i!=0):
dig=i%10
rem=rem+dig**l
i=i//10
if(tema==rem):
print(rem,end=" ")
|
78f09e20650fe17df5674bd9a500df39e020f5d8 | 91f8a820b820f15272f21ed1176aa9de7f897b49 | mzmcbride/gerrit-reports | /reports/oldest-open-changesets.py | Python | py | 1,793 | permissive | #! /usr/bin/env python
# Public domain; MZMcBride; 2013
import ConfigParser
import os
import sqlite3
import wikitools
config = ConfigParser.ConfigParser()
config.read([os.path.expanduser('~/.gerrit-reports.ini')])
database_name = config.get('gerrit-reports', 'database_name')
wiki_api_url = config.get('gerrit-report... |
004d44fc16e6322c6c6374bf010a68b04d556f7f | 5884fe2cc7b1a867081a3f7c264f58a460b3b445 | Castillosa/django_boilerplate | /src/apps/users/tests/test_views.py | Python | py | 1,499 | no_license | import pytest
from django.conf import settings
from django.test import RequestFactory
from src.apps.users.views import UserRedirectView, UserUpdateView
pytestmark = pytest.mark.django_db
class TestUserUpdateView:
"""
TODO:
extracting view initialization code as class-scoped fixture
would be ... |
fa31b0afa316f3a5484221b205f92790ae80d8b8 | bc5922c0abdca234635dc85234043909196d1195 | roxaline/Instagram | /instagram/models.py | Python | py | 2,121 | permissive | from django.db import models
from django.contrib.auth.models import User
from tinymce.models import HTMLField
# Create your models here.
class Image(models.Model):
image = models.ImageField(upload_to = "images/",null = True)
user = models.ForeignKey(User, on_delete = models.CASCADE, null = True)
image_name ... |
2ce5f648196a368b82e9ed35693597f561198864 | 4fc01537f245750260342aa77a829a33756b5267 | Huxhh/LeetCodePy | /1-50/017LetterCombinationsMedium.py | Python | py | 1,619 | no_license | # coding=utf-8
"""
思路:
方法一:递归,使用长度控制返回,具体见代码
时间复杂度 O(n^2) 空间复杂度 O(n)
方法二:循环,将当前每一个数字对应的字符加到res中每一个字符串后面
时间复杂度 O(n^2) 空间复杂度 O(n^2)
"""
def letterCombinations(digits):
dic = {'2': ['a', 'b', 'c'],
'3': ['d', 'e', 'f'],
'4': ['g', 'h', 'i'],
'5': ['j', 'k', 'l'],
... |
6f2e0a1a01d10b442b7c4f2cb6f1eb1f231c99d4 | ac8ed7fa2b6d4902229509fcaf0e110f44ab4507 | fifa920/Django_Study | /SS1/SS1/asgi.py | Python | py | 383 | no_license | """
ASGI config for SS1 project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_... |
165792c9107a4a140660f4d9cdff6692ec11a381 | 62b15ba0035c752f003dd02704505ca47e132f35 | pluswing/pyxel_puzdora | /block.py | Python | py | 2,923 | no_license | import pyxel
import math
import random
class Block:
BLOCK_SIZE = 0
WHITE = 7
def __init__(self, x, y, color):
self.x = int(x)
self.y = int(y)
self.r = 16
self.color = color
self.targetX = self.x
self.targetY = self.y
self.animation = False
s... |
c17f2f1f4db5d0c174500c344475df627429c987 | c55dd1e31adae4776b17442d2b37c677ea5f7ca7 | damomeen/tnrc-sp | /tnrcspCorbaServant.py | Python | py | 6,283 | no_license | #
# The Geysers project (work funded by European Commission).
#
# Copyright (C) 2012 Poznan Supercomputing and Network Center
# Authors:
# Damian Parniewicz (PSNC) <damianp_at_man.poznan.pl>
#
# This software is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Publ... |
dfa59aca9fd0b016544c223f329f9444bc3d5781 | fcec7dc81f512ff9f2e782915b732acd40426f10 | jizhuoran/caffe-huawei-atlas-convertor | /convertor/huawei/te/lang/cce/te_schedule/softmax_cross_entropy_with_logits_schedule.py | Python | py | 85,678 | no_license | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# pylint: disable=too-many-lines
"""
Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the Apache License Version 2.0.You may not use this file
except in complian... |
346ec6d92fe3594a5a90b5f6cf9f3391c0c4556c | aeb2ef8ec1522413cdcd912562df0e12ee58b76b | MuCephei/kif | /managers/channel_manager.py | Python | py | 2,048 | no_license | import util.file_IO as io
from util.api_calls import get_channels, get_groups, get_ims
import util.constants as k
_channel_manager_folder = 'channel_manager'
_channel_names = _channel_manager_folder + '/ChannelNames.json'
_channel_ids = _channel_manager_folder + '/ChannelIds.json'
_default = _channel_manager_folder + ... |
c8d19d9d4720423272f6f2166a1833f9751af49c | bded431ef6656064812518a22a77d8c2e5b4d9c6 | Ming-blue/mindspore | /model_zoo/official/cv/googlenet/postprocess.py | Python | py | 3,721 | permissive | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
f2e43304cfd319ed6cf094d9dd7408b6b8c5f991 | 7a5a8dbb4dde1641c4c88177a9b00384fc984bcd | usdot-fhwa-stol/carma-platform | /stop_and_wait_plugin/launch/stop_and_wait_plugin_launch.py | Python | py | 2,235 | permissive | # Copyright (C) 2022 LEIDOS.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
2bebb20c2e0354dc078bf81162b457b078e64f2b | c1a581e7bd23c94f5eda08df47a0836c6a3b4d63 | JanethLem/proyecto-final | /RentaDeCabañas/registros/views.py | Python | py | 1,588 | no_license | from django.shortcuts import render
from .models import Cabañas
from .models import Promociones
from .models import Reservacion
from .forms import ReservacionForm
# Create your views here.
def registros(request):
cabañas=Cabañas.objects.all() #Recuperar los objetos de la bd
return render(request, "registros/pr... |
272cb1db184e8ddeded29db787aa4f351d035250 | 8a703540ef6fa96218e6a173f92b367cf784f16d | shaheen2013/django_edubd | /edubd/announcement/form.py | Python | py | 2,111 | no_license | from django import forms
from django.forms import ModelForm
from .models import *
from django.forms.widgets import Select
class NoticeForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(NoticeForm, self).__init__(*args, **kwargs)
for visible in self.visible_fields():
visi... |
524806d343c33d29134d119f2b9d81bf13efdb1c | a1c949052751b1f1169babdd0047fd2851c2ef2b | basickler/FlaskRestBiolerplate | /gunicorn_config.py | Python | py | 6,710 | no_license | import multiprocessing
#
# Server socket
#
# bind - The socket to bind.
#
# A string of the form: 'HOST', 'HOST:PORT', 'unix:PATH'.
# An IP is a valid HOST.
#
# backlog - The number of pending connections. This refers
# to the number of clients that can be waiting to be
# served. Exceeding ... |
93584fcda9959bf603d84435fcd7e4f3e6154605 | bef4151e48963ecd8ec48f2c1710a6323d398e82 | rafacab1/1daw-python-prog | /Primer Trimestre/04 Funciones/Ejercicios 20 a 28 (p. 148)/4_media_array_int.py | Python | py | 555 | no_license | # -*- coding: utf-8 -*-
from funciones.funciones2028 import *
# Comprobación de 4_media_array_int
print("Devuelve la media del array que se pasa como parámetro.")
print("\nPrimero vamos a crear un array con enteros aleatorios...")
n = int(input("Introduce la longitud del array: "))
minimo = int(input("Introduce el n... |
04ff3ffdb025a49033d06c244d9f118869685ab9 | 5edbaca6f5456e28c9e4a37666f7a16acbdae6a8 | bat-serjo/vivisect-py3 | /vparsers/macho.py | Python | py | 2,979 | permissive | import os
import vparsers as viv_parsers
import vstruct.defs.macho as vs_macho
def parseFile(vw, filename):
fbytes = open(filename, 'rb').read()
return _loadMacho(vw, fbytes, filename=filename)
def parseBytes(vw, filebytes):
return _loadMacho(vw, filebytes)
archcalls = {
'i386': 'cdecl',
'am... |
323a67e18095d80a6902553a8176d54560619a92 | 2a98811877b4f07f071ab294ac15b3b79c4395b1 | Zuya14/TDM | /train_GC_SAC.py | Python | py | 1,172 | no_license | import gym
import pybullet_envs
# from PPO import PPO
from GC_SAC import GC_SAC
from trainer import Trainer
# from mazeEnv import mazeEnv
# from crossEnv import crossEnv
from square3Env import square3Env
from maze3Env import maze3Env
# ENV_ID = 'InvertedPendulumBulletEnv-v0'
SEED = 0
# NUM_STEPS = 5 * 10 ** 4
NUM... |
92050423a4b8a14ebbcb5030d56fd8bd0beab499 | f13236e18ec5a09d25c08281689dc82bbb2a7900 | cadmuscyber/grr | /grr/client/grr_response_client/client_actions/file_finder_utils/conditions.py | Python | py | 9,020 | permissive | #!/usr/bin/env python
# Lint as: python3
"""Implementation of condition mechanism for client-side file-finder."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import abc
import re
from typing import Iterator
from typing import NamedTuple
from typing imp... |
166540b02ca220b620bb1fe5154ac500d417bc78 | 3bc78d6aa94e9499cf674fde65b9f0b153bfd4e4 | cbc506/cloudrail-knowledge | /cloudrail/knowledge/context/aws/resources_builders/scanner/cloudtrail_builder.py | Python | py | 553 | permissive | from cloudrail.knowledge.context.aws.resources_builders.scanner.base_aws_scanner_builder import BaseAwsScannerBuilder
from cloudrail.knowledge.context.aws.resources_builders.scanner.cloud_mapper_component_builder import build_cloudtrail
class CloudTrailBuilder(BaseAwsScannerBuilder):
def get_file_name(self) -> s... |
d97d05780184ccabc8cb080c8e963d079daa7c6e | e73f606b75d85d0335aa3ceace022efaa4a4d5ed | joashivanmoodley/downloader_service | /file_processor/models.py | Python | py | 396 | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Queue(models.Model):
date_added = models.DateTimeField(auto_now_add=True)
email_address = models.EmailField()
content = models.TextField(blank=True, null=True)
download_type = models.CharField(blank=Tru... |
29da8565c9710044a063c1c2964bef2ca882c494 | f566bf229ec912b6b0b1aab49fc366627b8e1e61 | bentoonsmurf/bi423 | /python_td10/ex01.py | Python | py | 1,410 | no_license | import colors
import time
from Tkinter import *
#but de l'exercice :
#faire le gc skew
#debut
path = raw_input(colors.warning("Fichier 1 a ouvrir : "))
#ouverture fichier
f = open(path, "r")
#lecture premiere ligne
#on ne prend pas en compte la premiere ligne du fichier fasta
seq = f.readline().rstrip('\n')
#on co... |
ee4fedb10c71f34194a625420f5794ba6d5d390f | 3ae104ffd42364744f224e460eefd5a98be6e3ac | scottilee/python | /kubernetes/client/models/v1_quobyte_volume_source.py | Python | py | 8,515 | permissive | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
8ac736e02dd0d6cc993db4f9211842293ee0c687 | 58c02b40e6e0004754b0819b78e361b9ba51a4c0 | jay256/coprhd-controller | /cli/src/project.py | Python | py | 27,415 | no_license | #!/usr/bin/python
# Copyright (c) 2012-13 EMC Corporation
# All Rights Reserved
#
# This software contains the intellectual property of EMC Corporation
# or is licensed to EMC Corporation from third parties. Use of this
# software and the intellectual property contained therein is expressly
# limited to the terms and... |
18be6adf9f5f7fe222764f743df4b999568fc8c0 | 8705ccc8fa609d2f4fa7e4c41b2e2b36d3c8bbb2 | mgaborit/pyven | /source/pyven/results/line_logs_parser.py | Python | py | 995 | permissive | from pyven.results.logs_parser import LogsParser
class LineLogsParser(LogsParser):
def __init__(self, error_patterns=[], error_exceptions=[], warning_patterns=[], warning_exceptions=[]):
super(LineLogsParser, self).__init__()
self.error_patterns = error_patterns
self.error_exceptions = error_exceptions
self.... |
e5e5d20ebb226b047bfdd6abe05fde34758b4735 | 9b95d97b6c1bbd89b67247e9f662b5298e33c633 | UCLA-SEAL/QDiff | /data/p2DJ/New/program/qiskit/class/startQiskit_Class307.py | Python | py | 3,324 | permissive | # qubit number=2
# total number=17
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... |
26becf1d2ed3e16a3196f847024a2ee17d9d657c | 037ab1cf7812e60ff8b5d0cac329d9495620e764 | mlockett42/spreadsheet-historygraph-cavorite | /spreadsheet/historygraph_backend/api/urls.py | Python | py | 360 | permissive | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from django.conf.urls import url
from . import views
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = [
url(r'^$', views.HistoryGraphView.as_view(), name='historygraph-post'),
]
urlpatterns... |
fc056632cfd2fc64b254f62cdf7dbdbf511d1b94 | d2b6d691c89865444b2dce30078adda649e0af98 | ken2190/ProgramPractice | /DLFCV/pyimagesearch/nn/conv/lenet.py | Python | py | 1,537 | no_license | #
# Construct the model of lenet
# a: zhonghy
# date: 2018-7-21
#
#
# import the necesary packages
from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
from ke... |
e0a87931fd1bab638dc519e941aab5906da78e0f | 2cbbfa399b39893ca2c7ef5416501baf9cf69194 | baidu/baiduads-sdk | /python/baiduads-sdk-auto/test/test_fc_trans_trace_add_request.py | Python | py | 721 | permissive | """
dev2 api schema
'dev2.baidu.com' api schema # noqa: E501
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import baiduads
from baiduads.fctranstraceapi.model.fc_trans_trace_add_request import FcTransTraceAddRequest
class TestFcTransTraceAddRequest(unittest.TestCase):
"... |
29b4ff9565f03d1f8a23754de1e92b8abd9a28db | dd38a5f24f0743050d72b62bdf783eee014d26f4 | foxxeehi/cfn-python-lint | /src/cfnlint/formatters/__init__.py | Python | py | 4,141 | permissive | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... |
b83fe56a435835ed95eb15a656833fb6b1cbb2a0 | 68b31c357b7bdd7b9b89b38165047e27b627638b | fairinternal/ELF | /rlpytorch/rlsampler.py | Python | py | 3,218 | permissive | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import numpy as np
impor... |
3e46d178118cb6be34c613b3a674674eaada162a | bc157271fb72482ce1c8486b6554830d4f79ed00 | ManoMambane/Python-PostgresSQL | /A Full Python Refresher/25_static_class_method/methods.py | Python | py | 333 | no_license | class ClassTest:
def instance_method(self):
print(f"Called instance_method of {self}")
@classmethod
def class_method(cls):
print(f"Call class_method of {cls}")
@staticmethod
def static_method():
print(f"Called static method.")
#ClassTest.class_method()
ClassTest.st... |
be280449edd97cf8c990ddfb382f090781e24f21 | 18b458b1ae2c37cdbf86d77e71c80709c8c82c1e | CiscoTestAutomation/genieparser | /src/genie/libs/parser/junos/tests/ShowInterfacesTerseMatch/cli/equal/golden_output_expected.py | Python | py | 373 | permissive | expected_output = {
"fxp0": {
"admin_state": "up",
"enabled": True,
"link_state": "up",
"oper_status": "up",
},
"fxp0.0": {
"admin_state": "up",
"enabled": True,
"link_state": "up",
"oper_status": "up",
"protocol": {"inet": {"172.25.192... |
240893baee76d6bf9d56d699436ed4261fb49369 | 2d30a19491c24f2a9360ebebd5bae7f95a782c6e | graingert/twisted | /docs/web/howto/listings/transparent_element.py | Python | py | 354 | permissive | from twisted.web.template import Element, renderer, XMLFile
from twisted.python.filepath import FilePath
class ExampleElement(Element):
loader = XMLFile(FilePath("transparent-1.xml"))
@renderer
def renderer1(self, request, tag):
return tag("hello")
@renderer
def renderer2(self, request, ... |
6a18ed40b9e73f3535dfaa169cacd5e9628639b2 | c0d932cd68e1b141c4151abce0400b27ae9e17a1 | SirDuvan/DSHOPPING10 | /dshopping10/apps/administration/migrations/0001_initial.py | Python | py | 5,212 | no_license | # Generated by Django 2.2.4 on 2019-10-23 15:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... |
c9c74922b0dbeaa1069e1f7c38f0c426f15e2d54 | d0a14ebdb548d28fb40f37d6d85b8ec6ec909cfe | quay/quay | /tools/sendconfirmemail.py | Python | py | 713 | permissive | import argparse
from flask import Flask, current_app
from app import app
from data import model
from util.useremails import send_confirmation_email
def sendConfirmation(username):
user = model.user.get_nonrobot_user(username)
if not user:
print("No user found")
return
with app.app_conte... |
03dd75fd4522a95638d74e31871a5e6bdab9cd70 | cfd4c4ae1f49e3a9156a7a69903d62b618e11c23 | j471n/Hacker-Rank | /10 Days of Statistics/Day-4/Python/02_Binomial Distribution II.py | Python | py | 1,011 | no_license | import operator as op
from functools import reduce
"""
formula: b(n,r,p) = n!/((n-r)! * r!).p^r.q^(n-r)
"""
class BD:
def findNcR(n, r):
"""
Calculating: n!/((n-r)! * r!)
"""
r = min(r, n - r)
if r == 0:
return 1
numerator = reduce(op.mul, range(n... |
dce2d0829b070b06c656e2153ca6d3419ff073d2 | b4cdb0c5198b9b1e3a558b9181507e7f0269238f | leelasd/LigPos | /OverLapCode/pdb_utils.py | Python | py | 5,709 | no_license | import os
import sys
import argparse
import pandas as pd
import numpy as np
import warnings
def ReadMolFile(mollines):
[nats, nbonds] = map(int, (mollines[3][0:3], mollines[3][3:6]))
cooslines = mollines[4:4 + nats]
coos = {}
atypes = {}
for i in range(nats):
els = cooslines[i].split()
... |
1baa3d2095fd4c3aa1170470bf0aa58930af0e13 | 792fa04a674605e476be6cc3b162c54733dc7fe0 | scottwedge/flipper-client | /flipper/contrib/cached.py | Python | py | 2,486 | permissive | # Copyright 2018 eShares, Inc. dba Carta, 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
d72981ab6c90da691d377cb3c6d582435bce8df3 | 61a9d16340f2e09b65080a9366f381eb6fdcaca6 | johnmay/rdkit | /rdkit/Logger/UnitTestLogger.py | Python | py | 2,842 | permissive | # $Id$
#
# Copyright (c) 2001-2006, Greg Landrum and Rational Discovery LLC,
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" unit testin... |
782d949ce85a4d60aef665e411a9910e923aa6bc | e0e0c44d85cb40ba8b7912decd5393614e760d83 | sweenzor/weathermodel | /parsetmy.py | Python | py | 755 | no_license | #!/usr/bin/env python
import matplotlib.mlab as mlab
import os
import datetime
def fixdatetime(record):
"""combine date and time columns"""
for r in record:
raw_time = r[1].split(':')
raw_time = [int(t) for t in raw_time]
# move from 1..24 to 0..23
raw_time[0] = raw_time[0]-... |
7096d6fba4f329ad3fa88f6146e82c775e7a744c | 0e5404c3dc9ce155e544fed6d74d8746d2295076 | grmaple/algorithm | /剑指offer/19.py | Python | py | 749 | no_license | # -*- coding:utf-8 -*-
class Solution:
# matrix类型为二维列表,需要返回列表
def printMatrix(self, matrix):
# write code here
ret = []
if not matrix or not matrix[0]:
return ret
n = len(matrix)
m = len(matrix[0])
state = [[0 for i in range(m)] for j in range(n)]
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
x = 0
y =... |
e196f9bc756fc419dc09d42a505f1deb3324c891 | 62adba43716945ae8d428b3ceccbe25af56cc127 | rggs/Modeling | /Modeling_5/gambler.py | Python | py | 3,359 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 15 12:41:14 2020
@author: ryanswope
"""
import numpy as np
import matplotlib.pyplot as plt
from fractions import Fraction
def Roulette(capital,stakes,ret,tries):
size = int(ret*capital/stakes)+1
print(str(size))
mat=np.zeros((size,size... |
499ea6f2fb7ed4391307b569b1b56b946bcdfe9d | 4c6c52fa47172d6a06c0b44c9d9f240026b0f025 | radicalbiscuit/django-inline-media | /inline_media/tests/test_conf.py | Python | py | 989 | permissive | #-*- coding: utf-8 -*-
import os
import sys
from inline_media.conf import settings
from django.test import TestCase as DjangoTestCase
CUSTOM_SIZES = getattr(settings, 'INLINE_MEDIA_CUSTOM_SIZES', {})
TEXTAREA_ATTRS = getattr(settings, 'INLINE_MEDIA_TEXTAREA_ATTRS', {})
class ConfTestCase(DjangoTestCase):
def t... |
a4908e1d537984d352edbf85a0c7b972ba15213a | 931758e018ea7a8d491e3a0231714d758fc2676e | dlenwell/rally | /tests/db/test_api.py | Python | py | 16,740 | permissive | # Copyright 2013: 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 b... |
2dce2641684fd33c3e5c26df042d1d7aa3846e85 | 5e89e67b8fa2811710ce3e1b21e36feb30794d42 | earlgreyness/itv-axxonsoft-code-samples | /slider.py | Python | py | 1,612 | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import arrow
from . import LOCALE, TIMEZONE
from .gui_element_wrapper import GUIElementWrapper as Wrapper
PIXELS_TOLERANCE = 4
class Slider(Wrapper):
"""
Класс, описывающий "бегунок" в панели архива.
"""
TEMPLATE = 'DD-MMM-YY HH:mm:ss'
CONTROL_TYPE... |
e3fa881389998122c91da13e4cddc6005e3496b3 | 80b0e513f91fcbe55ffb21ca6ed63ba5d091ec33 | DocTocToc/silver | /silver/payment_processors/manual.py | Python | py | 1,046 | permissive | # Copyright (c) 2017 Presslabs SRL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
76bf681cb5de15eb0769c5ac74addc01a5e081b8 | 2d0cc2d7d6b04f187ecb22fc759336ac32b8982b | drbhpark/Sanfra | /KisEVALRAW2EvalFull_1906_20yrs.py | Python | py | 44,456 | no_license | #12월3일현재 잘 작동하는 공식버전. kis 로부터 받은 evalrawnonpub1201byname를 받아서 변환.
#
# 싫행성공/ 19-6-03
#19년치를 변환해 18년치를 완벽하게 보여주는 버전
import requests
import pandas as pd
from pandas import Series, DataFrame
import json
import sqlite3
from pandas import ExcelWriter
import time
import numpy as np
#Terminal = 0.03 #Terminal sales grow... |
feaa5c37406898a7b028ed7dbe736b30dd046d82 | 936c879fcf9979107dfcc1929625524e029a3455 | Lotus08/ndustrialio-python | /ndustrialio/apiservices/feeds.py | Python | py | 7,563 | no_license | from datetime import datetime
from ndustrialio.apiservices import *
class FeedsService(Service):
def __init__(self, client_id, client_secret=None):
super(FeedsService, self).__init__(client_id, client_secret)
def baseURL(self):
return 'https://feeds.api.ndustrial.io'
def audience(self... |
4d092b2e7b5c890db09f8d22d8d2c16873b20fdb | ec28089014cd54fa3800f4db0248e573123b63ba | Mehtal/ecole | /src/accounts/migrations/0001_initial.py | Python | py | 5,654 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2021-10-28 12:13
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
... |
dd9fc0f58304f39672659da6b234e5a0419a895f | 6bc95f5f7bab98917e2da0143f044582f8460863 | shangguan9191/KPConv-Pytorch | /utils/cpp_wrappers/cpp_neighbors/setup.py | Python | py | 490 | no_license | from distutils.core import setup, Extension
import numpy.distutils.misc_util
SOURCES = ["../cpp_utils/cloud/cloud.cpp",
"neighbors/neighbors.cpp",
"wrapper.cpp"]
module = Extension(name="radius_neighbors",
sources=SOURCES,
extra_compile_args=['-std=c++... |
bad40a825b880fd8e84aeed8ebedd2c50ee51bed | f9ef49d87e23639b5f415bca880db8ddccebf712 | MeeraMeera1/SomeOne | /app/models/user.py | Python | py | 1,353 | no_license | from .db import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
import datetime
class UserProfile(db.Model, UserMixin):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key = True)
display_name = db.Column(db.String(40), nullable = False)
... |
1de36bae8323db7d440b954c8b413749fb027be1 | b2a25899cd6bc41b30dba214acd78dcd5ee89a55 | JosephLevinthal/Research-projects | /5 - Notebooks e Data/1 - Análises numéricas/Arquivos David/Atualizados/logDicas-master/data/2019-1/224/users/4431/codes/1771_2390.py | Python | py | 289 | no_license | from numpy import*
x=array(eval(input("Digite a quantidade de presentes por mes: ")))
y=array(eval(input("Digite a quantidade de faltantes por mes: ")))
z=0
m=zeros(len(x),dtype=int)
while(len(x)>z):
m[z]=x[z]-y[z]
z=z+1
t=0
while(m[t]!=max(m)):
t=t+1
print(t+1)
|
3fb6ca3a3deac866b4e8065576d81e47c9fc4e41 | bd2415556dce42b875325352b494d0a8ce2af018 | clab/dynet | /examples/variational-autoencoder/basic-image-recon/vae.py | Python | py | 6,690 | permissive | from __future__ import print_function
from utils import load_mnist, make_grid, pre_pillow_float_img_process, save_image
import numpy as np
import argparse
import dynet as dy
import os
if not os.path.exists('results'):
os.makedirs('results')
parser = argparse.ArgumentParser(description='VAE MNIST Example')
parser... |
f6704a2d2d599a0a21cc1a9cf7632cb419f88cc5 | e0f4bda8238f3290cf5cced5814755e79c8c5ba1 | mlopez8621/ResourcesAdminBackend | /admin/settings.py | Python | py | 4,542 | no_license | """
Django settings for admin project.
Generated by 'django-admin startproject' using Django 1.11.15.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
#... |
1f55ff4a36427c8bd2c1d4f5ef1555be9facb9a3 | 6ed61be36d9cb3d5d3c50bbeab86ef7c74e6944f | zhucc/jenkins-job-wrecker | /jenkins_job_wrecker/cli.py | Python | py | 9,753 | permissive | # encoding=utf8
import argparse
from argparse import ArgumentDefaultsHelpFormatter
import errno
import logging
import jenkins
import os
import sys
import textwrap
from jenkins_job_wrecker.modules.handlers import Handlers
from jenkins_job_wrecker.modules.listview import Listview
from jenkins_job_wrecker.registry import ... |
5aafc089c5c779e05be6993fe05457b3c78e6fc0 | e4d28820a4071f0520f7c637a26ec09695e74873 | the-blue-alliance/the-blue-alliance | /src/backend/common/manipulators/district_manipulator.py | Python | py | 2,449 | permissive | from typing import List
from backend.common.cache_clearing import get_affected_queries
from backend.common.manipulators.manipulator_base import ManipulatorBase, TUpdatedModel
from backend.common.models.cached_model import TAffectedReferences
from backend.common.models.district import District
from backend.common.queri... |
08aba5272f5216bc9e5ce87cd764baa860a44290 | e4d893548b032e5c37a896db576955bb1e4394fa | kylegong/advent-of-code | /aoc2020/day24.py | Python | py | 2,618 | no_license | import collections
def part1(lines):
locs = [location(parse(line)) for line in lines]
return len(visit(locs))
def part2(lines):
locs = [location(parse(line)) for line in lines]
b = visit(locs)
for n in range(100):
b = turn(b)
return len(b)
def turn(b):
w = collections.defaultdi... |
141fe85a6108cb8fdc5d2fdc743128563272661f | c9370b4dbed5e8d38f1ec254840a2880948b7031 | mutanganord93/-Independence- | /BinarySearchT.py | Python | py | 3,460 | no_license | from collections import deque
import compareTo
import csv
class country:
def __init__(self):
self.countryName = None
self.colonyName = None
self.colonialPower = None
self.leader = None
self.indYear = None
self.politicParty = None
def fileReader(self,file):
myIndependenceList = []
with open(file)as c... |
881ffb45c5a417fd39286527f99dd3eeb8edc57b | bfbfd628a66a7e1367b0bc4eb2c96531161d9073 | mishka28/NYU-Python | /advance_python_class_3/Homework4/mysite/polls/urls.py | Python | py | 240 | permissive | from django.conf.urls import url
from . import views
app_name = 'polls'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^about/', views.about, name='about'),
# url(r'^link/', views.link, name='link'),
] |
38e24dd60d2e5ea088fc1e5b668ca354a5ae9a99 | 2c8625df8cd3e20c5ded3e3c925297ab13377d00 | washort/typhon | /typhon/objects/data.py | Python | py | 45,252 | permissive | # encoding: utf-8
#
# Copyright (C) 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
bd3f9e90222113058719e031b313a4480a54fcd7 | abafb73c21cf5a01a9092f789c29bd6c02b308b9 | xuxinstyle/DogPrediction | /myself_train.py | Python | py | 4,934 | no_license | from sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
import random
import cv2
import matplotlib.pyplot as plt
from keras.callbacks import ModelCheckpoint
from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from tqdm import ... |
eb268ab6c6dd46eefd91245b83a270eea60d66bb | 67d9065ce0afc3bc6a485bee8d673807384cdf22 | smilee/polyaxon | /sdks/python/http_client/v1/polyaxon_sdk/models/v1_hp_uniform.py | Python | py | 4,493 | permissive | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... |
2f42779a2885fbd4cd7e88a8dab77e498f538af0 | 38edd5e1341cf36c437c7cd99972a8d2458cf82c | Jashwanth-k/Data-Structures-and-Algorithms | /1.Recorsions - 1/Check if string is Palindrome using Recuesion.py | Python | py | 526 | no_license | def helper(s,si,ei): # si = 0 and ei = length - 1
if si == ei: # here length == 1 return True
return True
elif s[si] != s[ei]: #If first and last indexes are != False
return False
elif si < ei+1: # If si < ei True
return helper(s,si+1,ei-1)
return True
def check... |
be7e055e31ab23534efe5627434b0034cddbc1c8 | f6a2f130c76b1bce48e3e5fc13724725b1fddc70 | kraigb/inventory-tool | /extract-metadata.py | Python | py | 5,285 | no_license | # Script to take the output of take-inventory.py (a .csv file), and go and open
# the specific files therein to extract author, date, H1, and other metadata,
# producing a second, more extensive .csv file (named with a "-with-metadata" suffix).
#
# take-inventory.py invokes this script automatically at the end of its p... |
4a1c2f674e10285acf16fa1a307f2ba197b2f393 | f75f3530114c715effeacd8d78fc7c9001700d46 | citronneur/aioxmlrpc | /aioxmlrpc/client.py | Python | py | 4,332 | permissive | """
XML-RPC Client with asyncio.
This module adapt the ``xmlrpc.client`` module of the standard library to
work with asyncio.
"""
import asyncio
import logging
from xmlrpc import client as xmlrpc
import aiohttp
__ALL__ = ['ServerProxy', 'Fault', 'ProtocolError']
# you don't have to import xmlrpc.client from your... |
f642386faccccf8b912fc0f9a5dcd61b73a80ffa | bce3f61f3cab5d412c6b99f0709ec7764a6f2232 | Vardges1215/django_projects-1 | /django_todo/django_todo/settings.py | Python | py | 3,207 | no_license | """
Django settings for django_todo project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import o... |
ba17e1102c6960c35d00574340b62d43f3ff3e83 | 7ab35824ac610b448b05ed7a450399f41c075e50 | ucb-cs250/OpenRAM | /compiler/tests/22_sram_1bank_wmask_1rw_1r_func_test.py | Python | py | 2,369 | permissive | #!/usr/bin/env python3
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import unittest
from test... |
fd269bceeaa427e72e0ce5f0f4a22d2307e76ac0 | 60f01f10f094e67c7aeb2782b49f86148fafc71d | Tourountzis/cuckoo | /modules/processing/memory.py | Python | py | 30,386 | no_license | # Copyright (C) 2010-2014 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import logging
from lib.cuckoo.common.abstracts import Processing
from lib.cuckoo.common.config import Config
from lib.cuckoo.common.constan... |
8b5966ab846639d6dad2263120d953d5e772453c | b63227a9afffc38d88308eee3c93671d3eadc442 | Doctor-Gandalf/2048_Rogue | /controller/settingloader.py | Python | py | 530 | no_license | import os
import json
__author__ = 'Kellan Childers'
def get_main_directory():
full_path = os.path.realpath(__file__)
directory, file = os.path.split(full_path)
while file != '2048_Rogue':
directory, file = os.path.split(directory)
return os.path.join(directory, file)
def read_settings(fil... |
8a766bd50e78c20eea8f458b2bdc0045bbe14c32 | bdd339bb22d6aa19b6c03ad865adb02ad9bc3787 | rbo93/mi_primer_programa | /Ejercicios Realizados/Practica de listas/lista_ejercicio_tres.py | Python | py | 511 | no_license | #Ejercicio 3
# Dada una lista mixta de enteros y strings, devolver dos listas, una con todos los enteros y otra con todas las strings.
lista_inicial = [2, "a", 3, 5, "basdsa", 85, "hola", 4.2, 5.2]
lista_enteros = []
lista_strings = []
for dato in lista_inicial:
if type(dato) == type(str(dato)):
lista_str... |
97e20c524e3e4c39502a351b94b960e5e2e71f98 | 095ee891f57e3dce5d18d6af774a73fe7d45f32c | sv2fr/nlp-projects | /proj 3 - rnn language models/sv2fr_simple_rnnlm.py | Python | py | 2,497 | no_license | # -*- coding: utf-8 -*-
"""
@author: sri01
11/30/2018
"""
from data_processing import *
from utils import *
import time
import math
corpus = Corpus(os.getcwd())
train_data = corpus.train
dev_data = corpus.dev
test_data = corpus.test
# training step
def train(model, batch_size, criterion, n_tokens, optimizer, clip_... |
4e0f4e71bc0078d9564016ee68b50e2ed0c1558d | 777d1e52212ec66ad8b7613c6609a6fd97daa774 | esprengle/python-droppy-workspace | /Tasks/Filter.ByExtensions/test_task.py | Python | py | 1,716 | permissive | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import py
import task
files_dir = py.path.local(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'Test', 'files'))
def test_input_empty(tmpdir):
input_dir = tmpdir.join('0')
os.makedirs('%s' % input_dir)... |
92cbd453981f57f18939873f753d6e709700bb8d | d321e2ecb0aa70b747d15c2aa6684e879844a36c | canayoz/cmssw | /HLTrigger/Configuration/test/OnLine_HLT_Fake.py | Python | py | 19,194 | no_license | # /dev/CMSSW_7_4_0/Fake/V16 (CMSSW_7_4_8_patch1)
import FWCore.ParameterSet.Config as cms
process = cms.Process( "HLTFake" )
process.HLTConfigVersion = cms.PSet(
tableName = cms.string('/dev/CMSSW_7_4_0/Fake/V16')
)
process.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) )
process.datasets = cms.PSet( Initia... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.