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 |
|---|---|---|---|---|---|---|---|---|
23f7b729ffe54f6fa2d95b94d4902868d5eeddb8 | a9509b482255da3670113ee0884be3bd7bc178ef | hrz123/algorithm010 | /Week18/lc周赛/1.py | Python | py | 464 | no_license | # tmp.py
from typing import List
class Solution:
def minOperations(self, logs: List[str]) -> int:
cur = []
for log in logs:
if log == '../':
if cur:
cur.pop()
elif log == './':
continue
else:
cu... |
7c1360cb1522f4e48e503c47d4f1fe747bfdd20d | bd5709596e706e22412288e859a9eade206a961d | JudeJang7/CSE_231 | /CSE_231/Lab/Lab 7/lab07.py | Python | py | 838 | no_license | def open_file():
user_input = input("Input a file name: ")
while True:
try:
fp = open(user_input)
return fp
except FileNotFoundError:
print("Unable to open file. Please try again.")
user_input = input("Input a file name: ")
... |
9606de634a89d23f196cd72b9c8075245ae6b1e8 | 5bac47cabf8ad174cce4ff58ce20b1ef14671bef | mohit-chawla/pystride | /django/myfirstproject/myfirstproject/urls.py | Python | py | 824 | no_license | """myfirstproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... |
c9e8e87f6352cfdcc882cd73e92a3d75d92fefb6 | ef41a831dbcf46fd3f07cbf52d600b282b95b78d | tmcdonnell87/auction-manager | /auction/auction/migrations/0017_auto_20180120_0858.py | Python | py | 2,200 | permissive | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-01-20 16:58
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auction', '0016_auto_20180... |
80042b5e957b8aec663cd6ce38fd8739e4875754 | b8612dd91075e4c70578e3760ebff0a34d3dbe6c | sumin3/holbertonschool-higher_level_programming | /0x0B-python-input_output/2-read_lines.py | Python | py | 405 | no_license | #!/usr/bin/python3
def read_lines(filename="", nb_lines=0):
"""read n lines of a text file (UTF8) and prints it to stdout
Args:
filename: name of the file
nb_lines: number of lines that need to read
"""
with open(filename) as f:
for line in f:
nb_lines -= 1
... |
e5969131c6cd64e4df0d24837ef45a6e5f2aa548 | f98bb17caad8395ae8ff293350498d29ec0471f4 | Ichbinhippo/Adversarial-Attacks-on-CapsNets | /code/util/config.py | Python | py | 3,347 | permissive | import os
import sys
import tensorflow as tf
import __main__
flags = tf.app.flags
def _is_interactive():
return not hasattr(__main__, '__file__')
# Fix stupid absl stuff
flags.FLAGS.__delattr__('log_dir')
flags.DEFINE_integer('batch_size', 128, 'batch size')
flags.DEFINE_integer('epochs', 50, 'number of epoch... |
b59af88694149346256f8b8a26f71f282640bc06 | 12265060c4578e4fd3f43d2f0e90745a6f3e1294 | cnulenka/Django-Blog-Web-App | /blogproject/blogproject/urls.py | Python | py | 994 | no_license | """blogproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... |
51e1aab19aad19f72f4fa4f6701b9b770e7bcd62 | dba6c952566b466717bff1e2acc9ae5b7c227507 | Quang7hong81/bitcoinV | /test/functional/wallet_txn_doublespend.py | Python | py | 6,073 | permissive | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there is a double-spend conflict."""
from decimal import Decimal... |
3b464b925c809d724cba5cf6d5797f934eead4d4 | d7b4d828518819c5be48688e5a8123a766f3b63e | TommyCChen/E6889-project | /Final/Top trending.py | Python | py | 3,007 | no_license | import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
import collections
from send_mongo import monsendmany
import tweepy as tw
import nltk
from nltk.corpus import stopwords
import re
import networkx
import warnings
import pymongo
# 3.md: regular expressions #
def remo... |
72f5ec2f353867c4e9b8a0b88c7ccde1588e94bb | acd6e1a60fdcb53f982b02ff755bb9a7f8fb0051 | cskiraly/dcase2020_task2_baseline | /01_test.py | Python | py | 5,940 | permissive | """
@file 01_test.py
@brief Script for test
@author Toshiki Nakamura, Yuki Nikaido, and Yohei Kawaguchi (Hitachi Ltd.)
Copyright (C) 2020 Hitachi, Ltd. All right reserved.
"""
########################################################################
# import default python-library
######################... |
3de632d29946a9128bd9fba6d15f557668cc856b | 58594955a7e07800e741675a0f5a9b1dc75bf1b5 | penaguerrero/Ly_alpha | /src/Bstars3.py | Python | py | 6,611 | no_license | import os
import glob
import numpy
import sys
import table
import re
import string
from scipy.optimize import leastsq
from spectrum import spectrum
from spectrum import pyplot
from configobj import ConfigObj
def selection(A, cgs, lower, upper):
# This functions selects according to a wavelength range
xlist = [... |
795c6ac70a29390f87ba901d6e29b1c6e94b8f7d | b9473fc667e36f9aef76fc87b20b46f66a67268e | 2644783865/django2 | /django2/settings.py | Python | py | 5,562 | no_license | """
Django settings for django2 project.
Generated by 'django-admin startproject' using Django 2.2.4.
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/
"""
from __futur... |
c1f35fe6e34eeb7ffdc644d0e8d3f32bdd51950b | 27042b442bb17241a56f7e6bd3aae31f304ce032 | lixiang2017/leetcode | /leetcode-cn/2367.0_Number_of_Arithmetic_Triplets.py | Python | py | 910 | no_license | '''
执行用时:36 ms, 在所有 Python3 提交中击败了82.52% 的用户
内存消耗:14.9 MB, 在所有 Python3 提交中击败了62.75% 的用户
通过测试用例:104 / 104
'''
class Solution:
def arithmeticTriplets(self, nums: List[int], diff: int) -> int:
ans, s = 0, set()
for x in nums:
if x - diff in s and x - diff - diff in s:
... |
09e1f01f38a3dc72f6690ae441ef07a00a59ec64 | beb47a3c63cc71a7cd1fa3730e18e07140d0e875 | pekshevds/negrustno.ru | /negrustno/urls.py | Python | py | 751 | no_license | """negrustno URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/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... |
a7b32e11e6fb4654c49003267ce3be878bffb3f4 | 562368af8ba9e85542be7c9d1dd7bbba1a40dd06 | Aqissiaq/league_simulation | /plotter.py | Python | py | 572 | no_license | import matplotlib.pyplot as plt
def parse_line(line):
l = line.split(',')
return int(l[0]), int(l[1]), float(l[2])
def plot_ns(data, *ns):
for n in ns:
plt.plot([tpl[2] for tpl in filter(lambda x: x[1] == n, data)],
label=f"n = {n}")
plt.ylabel("% Chance")
plt.xlabel("Numb... |
7dc35580d6d1e4acdbe7f4963acd9d522e4e4da4 | 351ae08587c9b62a3fb8406a96bd4f4716587401 | edmagnu/PhaseMod | /2018-10-06.py | Python | py | 2,296 | no_license | # University of Virginia, Department of Physics
# Eric Magnuson, edm5gb@virginia.edu
# 2018-10-06
import os
import numpy as np
from scipy.stats import cauchy
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import pandas as pd
def cauchy_model(x, a, loc, scale, y0):
return a*cauchy.pdf(x, l... |
97110d15b83c2840977771ca9db6e7bc619c2c62 | b742f62d758f8da8a9d63e8667e3bf5626b5333a | JeffreyLauDev/MusicSchool | /profile/models_orig.py | Python | py | 6,043 | no_license | from django.db import models
#enum for gender choice
GENDERCHOICE = (
('0', 'Male'),
('1', 'Female'),
('2', 'Other'),
)
#enum for gender choice
LANGUAGECHOICE = (
('0', 'English'),
('1', 'Chinese'),
('2', 'Japanese'),
('3', 'German'),
('4', 'French')... |
e4908a8f301666b1bdac38b50570534ab716b602 | 7eefd8b902dd157c9ee2c039daf4abb6176e6f35 | rubiruchi/fdeval | /plotter/agg_01_minimum_example.py | Python | py | 1,556 | permissive | # Minimum example for an analysis script
def plot(blob, **kwargs):
"Minimum working example of an analysis script"
# Define the columns that should be included in the SQL query; only these columns are
# queried which is important because the data sets can contain hundreds of these columns.
# Note that... |
47758b9b374fa3cc142f1e3293020a1c96f62e57 | 8acc9a1a8564e8e0a6e9f1c64decef7d946ccca4 | Unicomcat/Hardway | /ex7.py | Python | py | 617 | no_license |
print "Mary had a little lamb."
print "Its fleece was white as %s." % 'snow'
print "And everywhere that Mary went."
print "."*10 #what'd that do?
end1 = "C"
end2 = "h"
end3 = "e"
end4 = "e"
end5 = "s"
end6 = "e"
end7 = "B"
end8 = "u"
end9 = "r"
end10 = "g"
end11 = "e"
end12 = "r"
# watch that comma at the end. try r... |
1185551c3c42f6fe61d429028b06cfad8f59b645 | 10279da7b0d7d95589484ee80b025607c76020ca | arthurpiazzi/Traffic-Flow | /RBM.py | Python | py | 5,463 | no_license | from base import Base
import numpy as np
import tensorflow as tf
#Class that defines the behavior of the RBM
class RBM(Base):
def __init__(self, input_size, output_size):
#Defining the hyperparameters
self._input_size = input_size #Size of input
self._output_size = output_size #Size of ... |
a78b0803f9e0f1a148cee6d90a5128d53760e824 | 0ad3fb4396a3ecbaef9bb92b587cfcc9ac94dbda | TuringWorks/codalab-cli | /codalab/model/tables.py | Python | py | 14,716 | permissive | """
The SQLAlchemy table objects for the CodaLab bundle system tables.
"""
from sqlalchemy import (
Column,
ForeignKey,
Index,
MetaData,
Table,
UniqueConstraint,
)
from sqlalchemy.types import (
Integer,
String,
Text,
Boolean,
DateTime,
Float,
Enum,
)
from sqlalchemy.sql.schema import ForeignK... |
0e139ebd8c12aa10527027c9769940b035c331c3 | 37e0cee987bc6e6dd9b98eae5776f68b630649e6 | zhi-re/python | /class.py | Python | py | 2,306 | no_license | #!/usr/bin/python
# coding=utf-8
class Employee:
'所有员工的基类'
empCount = 0
def __init__(self, name, salary):
self.name = name
self.salary = salary
Employee.empCount += 1
def displayCount(self):
print "Total Employee %d" % Employee.empCount
def displayEmployee(self):
pri... |
6ecab25aa13699b17ec5f85c4c97de718a52e46b | 09ce06a1f154dabd58b1cb80f2af6c318e12b0c4 | jonathankohen/channels_chat | /channels_chat/wsgi.py | Python | py | 403 | no_license | """
WSGI config for channels_chat project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... |
daeac92659b0281852dbc333cc80eea27132c958 | dcccf5f5ced5261a36caf354106e896ee635499a | igen-ftn/igenhub | /igenapp/forms.py | Python | py | 2,308 | permissive | from django.contrib.auth.models import User
from django import forms
from .models import *
class IssueForm(forms.Form):
title = forms.CharField(max_length=100)
text = forms.CharField(max_length=500)
milestone = forms.CharField(max_length=100)
class LabelForm(forms.Form):
name = forms.CharField(max... |
2f5269a7f2c581b8ea894b4783523bb58c6b5422 | 51feeea974a1a3be5a95de1114bb1c34d954846c | googlezhang/kafka | /nagios/add_alerts.py | Python | py | 5,690 | no_license | import sys
from commands import *
class Alerts:
def __init__(self, alert_name, alert_condition, start_from_box, box_granularity, max_boxes, critical, warning):
self.critical = critical
self.alert_name = alert_name
self.ale... |
c7be12a13e56e5b0ff3221e28301a374d3153ae1 | 9a8e74718f0a7fed9d6dd5c4fd039075a1c7010f | da2so/Pytorch_MultiGPU | /networks/mobilenetv2.py | Python | py | 4,566 | no_license |
import torch.nn as nn
import math
__all__ = ['mobilenetv2']
def _make_divisible(v, divisor, min_value=None):
if min_value is None:
min_value = divisor
new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)
# Make sure that round down does not go down by more than 10%.
if new_v < 0... |
c94309802be2c1db8953f2c5d85c73d9c2d54e92 | 37e3784564ec180924e342d774ba242b7e67d219 | EdsonRomao/CursoEmVideo | /Exercicios/Mundo 2/ex045.py | Python | py | 1,703 | permissive | """
Crie um programa que faça o computador jogar Jokenpô com você.
Pedra, papel e tesoura.
pedra ganha tesoura
pedra perde pra papel
papel perde pra tesoura
"""
import random
from time import sleep
print('Vamos jogar JOKENPÔ? ')
lista = ['Pedra', 'Papel', 'Tesoura']
computador = random.choice(lista)
jogador = str(in... |
4e824dcf54730170fdf41130f9346e392314c15f | 06aa8b39197d29197c965fcf336bf15f0147c926 | jonvw28/testing_for_bristol | /mod.py | Python | py | 416 | no_license | import numpy as np
def sinc2d(x, y):
if x == 0.0 and y == 0.0:
return 1.0
elif x == 0.0:
return np.sin(y) / y
elif y == 0.0:
return np.sin(x) / x
else:
return (np.sin(x) / x) * (np.sin(y) / y)
def a(x):
return x + 1
def b(x):
return 2 * x
def... |
33920b7dad4b93f7fe93d589a156c38dff13c124 | bc57d38172a7c64ec79b963d8b7099f445df104d | KarlSobischDigitium/soai-air-quality-no2-stream-producer | /air-quality-backend/SOAI/__init__.py | Python | py | 1,422 | no_license | import logging
import logging.config
from pathlib import Path
import os
####### SET UP PROJECT PATH #######
os.environ['SOAI'] = str(Path(__file__).parent / "..")
if os.path.exists(os.environ.get("SOAI") + "/logs") is False:
os.mkdir(os.environ.get("SOAI") + "/logs")
####### SET UP LOGGER #######
# Open the conf... |
9bca47197e4fe6723736687ce75d59f52cc3ebab | 059df4009e2f6842fd8d95bd922965b182dc3910 | jancervenka/pandas | /pandas/core/dtypes/concat.py | Python | py | 12,786 | permissive | """
Utility functions related to concat.
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
cast,
)
import warnings
import numpy as np
from pandas._typing import (
ArrayLike,
DtypeObj,
)
from pandas.util._exceptions import find_stack_level
from pandas.core.dtypes.astype impor... |
10f88b8758c2f696c6ea916945097071580330d1 | ac32947b29e15ca42e715694d3be6b017d3ebcca | sudoheader/PythonScripts | /regexStrip.py | Python | py | 501 | no_license | #! python3
# Write a function that takes a string and does the same thing as the strip()
# string method. If no other arguments are passed other than the string to
# strip, then whitespace characters will be removed from the beginning and
# end of the string. Otherwise, the characters specified in the second
# argumen... |
e5ba0037862c67ad60c4a0f1a586c95019a79bc3 | 7b54422174ec4de81593f90bdefd6e90fedc9254 | runfalk/vismalib | /vismalib/store.py | Python | py | 6,343 | no_license | import json
from requests.auth import HTTPBasicAuth
from requests_oauthlib import OAuth2Session
from ._compat import urljoin
from .model import Customer
__all__ = [
"FileTokenStorage",
"VismaSession",
"Store",
]
class FileTokenStorage(object):
# TODO: The current approach is possibly not thread safe... |
44098db095a02baa937983e1c8b88a046420a130 | 722f5cbe3d22a0a008a0517e45febbed1118b3b5 | gortyy/leetcode-solutions | /1137.-n-th-tribonacci-number/solution.py | Python | py | 428 | no_license | from testcase import testcase
class Solution:
def tribonacci(self, n: int) -> int:
ts = [0, 1, 1]
if n <= 2:
return ts[n]
for i in range(3, n + 1):
ts.append(ts[i - 1] + ts[i - 2] + ts[i - 3])
return ts[-1]
def test():
s = Solution()
for t, expec... |
0c8b672d72cebbfa05df74e8ae03d19300db7f8b | 9c7da17a0fbaa2e5d701dacf60e0a1a714fe0a2e | tblazhev/HackBulgaria-Programming101 | /Week2/oop_war/orc_tests.py | Python | py | 977 | no_license | import unittest
import orc
import weapon
class OrcTest(unittest.TestCase):
"""Bootcamp for the bad guys"""
def setUp(self):
self.my_orc = orc.Orc("Shrek", 100, 1.6)
def test_init_orc(self):
self.assertEqual("Shrek", self.my_orc.name)
self.assertEqual(100, self.my_orc.health)
... |
7b8c4e65f0740277c1511a97b7fda73c9d4b75a8 | a7058cd14828e3922d16a268e00ccfbb91a67a34 | codechamp2006/Calculator | /base-folder/setup.py | Python | py | 951 | permissive | from setuptools import setup, find_packages
import codecs
import os
# long description
with open("README.md", "r", encoding="utf-8") as fh:
LONG_DESCRIPTION = fh.read()
VERSION = '2.3'
DESCRIPTION = 'Fully integrated and packaged all sorts of mathematical equations and common problems, series.'
# Setting up
set... |
70eaefc81174c1494ef2889c078ecfb9f6824fc3 | 9ed2f053092ecf6e4b19366765d500f718d0d197 | Vahman/Project-108- | /project-108.py | Python | py | 614 | no_license | import plotly.figure_factory as ff
import pandas as pd
import random
import plotly_express as px
dice_result=[]
count=[]
for i in range(0, 100):
dice1=random.randint(1,6)
dice2=random.randint(1,6)
dice_result.append(dice1+dice2)
count.append(i)
print(count,dice_result)
fig=px.bar(x=dice_result... |
d2f4b08a6fc7df8f284ebd0bdf9feda4f267debf | b66fb2acdc5e0d1bbeb403bdff445556dc755d54 | adelapie/grammarinator | /setup.py | Python | py | 2,413 | permissive | # Copyright (c) 2017-2021 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from setuptools import find_packages, setup
def grammarinator_ve... |
c38fc93bbabf88a3e97308e070e8105f7474b9a6 | 86e31215ede95787b4b0a64f55ae7b9bc8dc9d17 | haohuifeng0/cloudhawk_simulation | /libs/graphqlobjecttype.py | Python | py | 1,680 | no_license | # -*- coding: utf-8 -*-
import graphene
class Result(graphene.ObjectType):
code = graphene.Int()
message = graphene.String()
class ChargingStatus(graphene.Enum):
NO = 0
YES = 1
CON = 2
class AlertType(graphene.Enum):
illegalShake = 1
powerLow = 2
powerFull = 3
SOS = 4
power... |
56f03c1ebd4ea09c02e5056da62cc13b146ad9cc | ff2c4bb468c23e55d95ceffb0d813ee758055b28 | gehilley/PML | /tests.py | Python | py | 6,279 | permissive | import PML as pml
import numpy as np
def test_icp_recursive():
fixed = pml.read_file('clip_small.txt')
transform = np.array([[1.0, 0.0, 0.0, -3.2],
[0.0, 1.0, 0.0, 4.1],
[0.0, 0.0, 1.0, 0.5],
[0.0, 0.0, 0.0, 1.0]]);
moving = pml.... |
5b47966f22e97ec36ce323db7ae0219be9c62c9a | 96f18a2e03b0691f99499b51693a77a9ea600d51 | hamada2029/gdata-python3 | /src/gdata/contentforshopping/__init__.py | Python | py | 718 | permissive | #!/usr/bin/python3
#
# Copyright (C) 2010-2011 Google 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 applicabl... |
a133fdd2cea79e21fa993cc920edf6b082797e6c | 0da86636252091ae071b5c8eb486c7cca077620f | return02/ASA.tv | /src/ASA/settings.py | Python | py | 2,908 | permissive | """
Django settings for ASA project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... |
0fa921ae45cfb0e6bcbc45d78f28dda0d84b935c | 35d9d3247735141787f2f6570790ee9d8ee0de44 | amoydream/ultra_predictor | /ultra_predictor/races/migrations/0015_auto_20191219_1611.py | Python | py | 1,328 | no_license | # Generated by Django 2.2.6 on 2019-12-19 15:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('races', '0014_auto_20191219_1610'),
]
operations = [
migrations.AddField(
model_name='predictionrace',
name='finish_... |
762f11d4cc8ca6f94e978abf31a90db955bfba81 | 2b840e64d63de94b382a45a413835d78ef03b5b6 | solunareclipse1/roleman | /cogs/utils/help.py | Python | py | 2,374 | no_license | ## Initialisation
import lib
import discord
from discord.ext import commands, tasks
## Define help cog
class help(commands.Cog):
## Initialose with help info
def __init__(self,bot):
self.bot = bot
self.category = lib.getCategory(self.__module__)
self.description = f"Display help about ... |
c31834923d930787fa5c27edfcf00a20a88abe08 | 6ca87f3cd5eba8eb9d560dbbd570e5c4804ffae9 | singhpawan/cicd-buzz | /learn_python/src/main/lesson7/dateobj.py | Python | py | 614 | no_license | # dateobj.py
class Date(object):
def __init__(self, year, month, day):
self.year = year
self.month = month
self.day = day
@classmethod # cls is "Date" Avoiding the problem of hardcoding
def from_string(cls, s):
parts = s.split('-')
return cls(int(parts[0]), int(part... |
1ad2ef45c3e26137ba262819eb01eed05b5432a0 | ee8b18c89538497338f70540eb9bde3935878e65 | phanrahan/loam | /tests/test_mantle/mothball/logic/_nxor2.py | Python | py | 314 | permissive | import sys
from magma import *
from mantle import *
from loam.shields.megawing import MegaWing
megawing = MegaWing()
megawing.Switch.on(2)
megawing.LED.on(1)
main = megawing.main()
A = main.SWITCH[0]
B = main.SWITCH[1]
O = main.LED[0]
nxor2 = NXor2()
nxor2(A, B)
wire(nxor2.O, O)
compile(sys.argv[1], main)
|
e131beeec3b55439eaea445a9a324b3d8d381ba2 | 53b53768d3069483a1c615f8950da86e36d49f24 | wooheaven/Hattrick-Study | /03_Remake_with_TDD/test/postgresql/test_hattrickPlayerPostgreSQL.py | Python | py | 5,011 | no_license | from unittest import TestCase
import psycopg2
from postgresql import ht_player_postgresql
import csv
class TestHattrickPlayerPostgreSQL(TestCase):
def test_select_player(self):
conn = psycopg2.connect("dbname='mydatabase' user='myuser' host='localhost' port='65432' password='123qwe'")
ht_player_pg... |
04d283e58756c7f53b9ee62e47c5f62906645b40 | 8bab51573a79f43b7bdc9ed37a33621c199073b8 | aaron276h/kaggle-rcic-1st | /make_submission.py | Python | py | 11,853 | permissive | #!/usr/bin/env python3
import argparse
import logging
import math
import numpy as np
import pandas as pd
import pickle
import sys
from collections import defaultdict
from functools import reduce
from itertools import permutations, groupby, chain
from multiprocessing import Pool
from operator import itemgetter
from pat... |
7062c256f62010ef5d2183adf613c91801a72aa2 | 1731534d3d5a7f41d644a4cb63bd4beba73ed4f7 | LemonCANDY42/vnpy-docker | /examples/run.py | Python | py | 4,839 | no_license | # flake8: noqa
from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
# from vnpy.gateway.binance import BinanceGateway
# from vnpy.gateway.bitmex import BitmexGateway
# from vnpy.gateway.futu import FutuGateway
# from vnpy.gateway.ib import IbG... |
1975bb29deaf4984d9fa8439409d55749a19cb72 | f91fbb3a190cdab078e630f0859804cd0927bcb3 | prjemian/ipython-poof | /instrument/devices/signals.py | Python | py | 498 | no_license | """
various signals
"""
__all__ = ["shutter", "noisy"]
import apstools.devices
import numpy
from ophyd import EpicsSignalRO
from ..session_logs import logger
logger.info(__file__)
shutter = apstools.devices.SimulatedApsPssShutterWithStatus(
name="shutter", labels=("shutters",)
)
shutter.delay_s = 0.05 # shutt... |
e1afb4a53971f9b055326dfa707f59827a189ad6 | fe0d3271fe8cc3467485a178b3436961e0f1c819 | owlhawk/prjxray | /fuzzers/100-dsp-mskpat/generate.py | Python | py | 3,990 | permissive | #!/usr/bin/env python3
from prjxray.segmaker import Segmaker
from prjxray.verilog import to_int
from prjxray.verilog import quote
import json
def add(segmk, site, dsp, tag, bit, value, invert):
tag = "%s.%s%s[%u]" % (dsp, ('Z' if invert else ''), tag, bit)
value = (~value if invert else value)
value >>= ... |
33eca66b41bb32e23b0894e69fb64a9a11d0956b | fef761a84243c47c8b0f03be716698a6d8e4114e | shamyla/MyEcom | /ecomerce2/src/products/views.py | Python | py | 3,492 | no_license | from django.contrib import messages
from django.db.models import Q
from django.http import Http404
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.shortcuts import render, get_object_or_404, redirect
from .forms import VariationInventoryFormset
from .mode... |
fa97ccefa6e055a4cd5cc18604ce8132f8976909 | 545b58b442663c72de7ec131c5db86c833ce8d19 | Asher-1/AI | /ML/EM/20.4.GMM_Iris.py | Python | py | 3,156 | no_license | # !/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
import pandas as pd
from sklearn.mixture import GaussianMixture
import matplotlib as mpl
import matplotlib.colors
import matplotlib.pyplot as plt
from sklearn.metrics.pairwise import pairwise_distances_argmin
mpl.rcParams['font.sans-serif'] = ['SimHei']
mpl... |
91b862a5df17c3efa5072ef820c6b9aedbb4dfd0 | 4062d31b93f67e5b15fffd879f28249ab05cdef4 | Bindeep/referral | /apps/referrer/api/v1/mixins/profile.py | Python | py | 2,349 | no_license | from django.utils.functional import cached_property
from rest_framework.exceptions import NotAuthenticated
from rest_framework.generics import get_object_or_404
from apps.core.utils.helpers import nested_getattr
from apps.referrer.models import Referrer
class ReferrerProfileViewSetMixin:
"""
Defines `referre... |
14e46ff04b0073be73c1821425e1ee2c8c6098c9 | 12c61d07e745298726776f6d7df3422ee5f9f791 | whyj107/Algorithm | /Programmers/20200901_베스트앨범.py | Python | py | 956 | no_license | # 문제
# 베스트앨범
# https://programmers.co.kr/learn/courses/30/lessons/42579?language=python3
# 나의 풀이
def solution(genres, plays):
music = {}
music_total_play = {}
for i in range(len(genres)):
if not genres[i] in music.keys():
music[genres[i]] = [(-plays[i], i)]
music_total_play[... |
063eef5b6a09e97fe86b10c2c25690d4e09019e5 | 30bfcc13039774f61b938441fd81213050e4e9e1 | dpnr/NLP_Project | /eventextract_ML.py | Python | py | 2,225 | no_license | # !/usr/bin/python
# -*- coding: utf-8 -*-
import glob
import os
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import SGDClassifier
from sklearn.pipeline ... |
9bc75571a84204d29ea763a4147faa34200fc018 | 8e1415e7ab50a698e63d0f89c20c6ba9e060c15f | ErikaAzabache/hackbright-lessons | /calc-2/arithmetic_org.py | Python | py | 1,376 | no_license | def add(num1, num2):
return num1 + num2
def subtract(num1, num2):
return num1 - num2
def multiply(num1, num2):
return num1 * num2
def divide(num1, num2):
# Need to turn at least argument to float for division to
# not be integer division
return float(num1) / float(num2)
def square(num1):... |
32e5ae503d7e5fd2644b3aad7097ff7d36d2784c | 7de4f9117c84ad81ad6fd8adbe214ca43108811a | alexanderbergman7/cnn-factorization | /cnn-factorization/UNet2D_separable.py | Python | py | 5,940 | no_license | import torch
import torch.nn as nn
from torch.nn import functional as F
import torchvision.utils
import torch.optim as optim
import torchvision
import numpy as np
import math
import numbers
import random
# UNet models
import separable_model_prototyping
from skimage import io
import os
# hacky method since running ... |
901b2a59ab881a50e5bae014da218889d9fc0279 | 35b230bba3e50fe43ec42235598dc4265209d3a2 | navneet066/ray | /python/ray/tune/trial_runner.py | Python | py | 53,753 | permissive | from typing import Optional, Union
import click
from datetime import datetime
import json
import logging
import os
import time
import traceback
import warnings
import ray
from ray.util import get_node_ip_address
from ray.tune import TuneError
from ray.tune.callback import CallbackList
from ray.tune.stopper import Noo... |
c6e8748b678a8f883fa8c8dc515d7752e609bf3d | 251e47ee3e1ee55320ae3ff8ba4bafaead316792 | a-agrz/cudf | /python/cudf/groupby/groupby.py | Python | py | 9,857 | permissive | # Copyright (c) 2018, NVIDIA CORPORATION.
import numpy as np
import collections
from pandas.api.types import is_categorical_dtype
from cudf.dataframe.dataframe import DataFrame
from cudf.dataframe.series import Series
from cudf.dataframe.buffer import Buffer
from cudf.dataframe.categorical import CategoricalColumn
f... |
40736cd78acc1517d2e3fcbff1e82738856d70a2 | 540f271824fac5a4d004e2bf98b05c11ab9ca2a7 | RevLogic/GA | /revsim/tests/test_4mod7.py | Python | py | 457 | no_license | # RevSim Test Toolkit
# Christopher Rabl
# This test file implements the circuit: http://revlib.org/doc/real/4mod7-v0_95.real
from revsim import *
b = arg(1)
c = arg(2)
d = arg(3)
e = arg(4)
lines = [0, b, c, d, e]
c = Cascade(lines)
c.append(tof, [1,4], 0)
c.append(tof, [1], 4)
c.append(tof, [2,3,4], 0)
c.append(tof... |
8bd0fd0cc0f738523dff9d01763e55e7dd028d79 | c9ab261f6eb697a162b57fde86143e37d837448d | junlinp/syncpy | /client.py | Python | py | 1,382 | no_license |
import codec_pb2
import requests
import time
import hashlib
import os
url = "http://127.0.0.1:8000/"
BLOCKSIZE = 1024 * 1024 * 4 # 4M
def send(path, name):
start = time.time()
filesize = os.path.getsize(path)
fileinfo = codec_pb2.FileInfo()
fileinfo.BlockSize = BLOCKSIZE
fileinfo.BlockNum ... |
bfef39195ec4c4a17817bfe0c7788348fcc7baa8 | b4084dac259d095b1242f0459236dca81ddb9823 | YuliiaAntonova/leetcode | /if_pangram.py | Python | py | 618 | no_license | # A pangram is a sentence where every letter of the English alphabet appears at least once.
# Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.
class Solution:
def checkIfPangram(self, sentence):
alphabet = "abcdefghijklmnopqrstuvw... |
3f1f2ddf8dfa5c96947dec261bcd4fd6ce238435 | f7fa552289ec4c2a85c8ddd76a03688b0e1ac8d2 | AmineCh1/NavGan | /images/model_skeleton/BiGAN/utility/VGG.py | Python | py | 5,478 | no_license | # ------------------------------------------------------------------------------
# VGG-19 architecture
# ------------------------------------------------------------------------------
import torch.nn as nn
import torch
import sys
sys.path.append('./')
from Models.utility.feature import FeatureMap
class VGG_score(Fe... |
16144170b17380820d438494d5e1d9f8a852ece4 | 608e23a58e320af8eb2d00ed40627a43c38fa50d | harrisonfeng/distributed | /distributed/__init__.py | Python | py | 1,103 | no_license | from . import config
from dask.config import config
from .actor import Actor, ActorFuture
from .core import connect, rpc
from .deploy import LocalCluster, Adaptive, SpecCluster, SSHCluster
from .diagnostics.progressbar import progress
from .diagnostics.plugin import WorkerPlugin, SchedulerPlugin
from .client import (
... |
e200135e60f39ed24c68ee6aad79eac2a79ef2ea | 56fa50ad61aea1c8559aeb6991cc841c88102ba5 | mmtechslv/tutorial-django-oscar-newapp | /myoscarapp/src/boutique/migrations/0001_initial.py | Python | py | 680 | no_license | # Generated by Django 3.1.7 on 2021-03-16 17:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Boutique',
fields=[
('id', models.AutoField... |
20c724345d1e159814df3ba6e6a906da43965718 | 966ec93b93c7361ec00749576941302df87c7e37 | GabCh/Gringo-design3 | /design3-backend-h18/src/atlas/communication/arduino.py | Python | py | 1,236 | no_license | import serial
from atlas.infrastructure.binder import AbstractContext
from atlas.infrastructure.yaml_config_loader import ApplicationProperties
from atlas.logging import LoggerFactory
class Arduino(object):
LOGGER = LoggerFactory.get_logger("Arduino")
def __init__(self, application_properties: ApplicationPr... |
f53c23088abf3b98ee1a9bcc102d472603da4448 | 3b2023322ea4f84bdb7ee366b29409671db0b873 | a-soliman/google-vision-api | /code/server/security.py | Python | py | 394 | no_license | ''' THIS FILE CONTAINS THE SECURITY FUNCTIONS FOR JWT'''
from werkzeug.security import safe_str_cmp
from models.user import UserModel
def authenticate(email, password):
print("\n\n\n @authenticate\n\n")
return UserModel.find_by_email(email)
def identity(payload):
print("\n\n\n @identity\n\n")
... |
3eda84a7be53b7e3601ef3ed8dda4f576b0d57dc | 9eaf4b972482e8ba30d403bec5ac7b80a5c31e3e | DanielAlecrin/aspect-based-om | /database.py | Python | py | 7,321 | no_license | import pymysql, pre_processing
try:
connection = pymysql.connect(
host='localhost',
user='root',
password='Totvs@123456',
db='tcc')
cursor = connection.cursor()
except pymysql.connections.Error as err:
print(err)
def insert_into_review_table(review):
insert_query = ("... |
30c191b91d59459cca5890d24df74090e15cbfe4 | a03a4bf4c7160f66eef1df9106e8a0aa157f2aa0 | jrggaston/IoT_Certs_Bootstrapping | /ID_Server/challenge.py | Python | py | 797 | no_license | import random
import hashlib
import time
#funcion to generate a random number of four bytes
def generate_random_number():
random_int = random.randint(0,255) + random.randint(0,255) * 2**8 + random.randint(0,255) * 2**16 + random.randint(0,255)* 2**24
return random_int
#function to calculate the hash that so... |
9ac8541b44062e6ace80944ccad90939c08e93ea | 6cf36ea4e51576409fbb2ab8c976b147d61aee57 | CI-WATER/hydrogate_python_client | /tests/non_hpc/delineate_watershed_at_shapefile_tests.py | Python | py | 2,213 | no_license | __author__ = 'Pabitra'
""" This is an example usage of the 'delineate_watershed' HydroDS client api using outlet shapefile """
from hydrogate import HydroDS
import settings
# Create HydroDS object passing user login account for HydroDS api server
hds = HydroDS(username=settings.USER_NAME, password=settings.PASSWORD)... |
49c9f2b70333b3dda30ade51babbcc7f300bb74f | 8e63fe3be866ecff3ced3e828ae865d0f68ca517 | abs-tudelft/arrow | /dev/archery/archery/integration/datagen.py | Python | py | 46,546 | 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 u... |
fcc774da6846961264cd12bac0cc758b990b8db0 | e32522d7e29dddbff8be84adc0563d5d122d0a28 | junyang10734/leetcode-python | /348.py | Python | py | 3,376 | no_license | # 348. Design Tic-Tac-Toe
# Design
# runtime: faster than 83.88%
class TicTacToe:
def __init__(self, n: int):
"""
Initialize your data structure here.
"""
self.n = n
self.rows, self.cols = [[0,0] for i in range(n)], [[0,0] for i in range(n)]
self.diagonal, self.anti... |
2f4a3cdd22fa5714880fbb7ba61dd427b07130e5 | e9ac18efbd5dc53df9e6c79b2526b5fc04aa5794 | areski/djangoproject.com | /django_docs/settings.py | Python | py | 2,361 | no_license | # Settings for docs.djangoproject.com
from django_www.common_settings import *
### Django settings
ALLOWED_HOSTS = ['docs.djangoproject.com']
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
INSTALLED_APPS = [
'django.contrib.redirects',
'django.contrib.sitemaps',
'django.contrib.sites',
'django.contrib... |
fb15667ce1120273ad23b82c479fc0e54edd6862 | 021970a2cbd828230fa519c22444568ff89e43f0 | Mikayla-Barthelette-1/ICS3U-Unit1-03-Python-Hello_World | /hello_world.py | Python | py | 220 | no_license | #!/usr/bin/env python3
# Created by: Mikayla Barthelette
# Created on: Sept 2021
# This is the "Hello, World!" program, with proper style
def main():
print("Hello, World!")
if __name__ == "__main__":
main()
|
7d96a6cb919c7d954546fe094658d5b4bb6ae799 | 22617b010d0b317824f284bc8776b83e6ba0b08a | Aduzona/INTRO-TO-PYTHON-DEVELOPMENT | /17 - JSON/4 - create_json_with_nested_dict.py | Python | py | 623 | no_license | import json
# Create a dictionary object
person_dict = {'first': 'Christopher', 'last':'Harrison'}
# Add additional key pairs to dictionary as needed
person_dict['City']='Seattle'
# create a staff dictionary
# assign a person to a staff position of program manager
staff_dict={}
staff_dict['Program Manager']=person_di... |
5d29d0f7465d5a3fd4761d6302d021556fda2480 | 4c93d1307a427d1ea20b999688f451b9dbf955df | jingtaow/google-cloud-python | /bigquery/google/cloud/bigquery/magics.py | Python | py | 17,392 | permissive | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
b910c7ac08034ad7140842066c31b33e8c5c6ad5 | 1cd993a51ca523d5be494bcb79bb41efab934125 | TS-N/AirBnB_clone_v2 | /models/review.py | Python | py | 469 | no_license | #!/usr/bin/python3
""" Review module for the HBNB project """
from models.base_model import BaseModel, Base
from sqlalchemy import Column, String, ForeignKey
class Review(BaseModel, Base):
""" Review classto store review information """
__tablename__ = "reviews"
place_id = Column(String(60), ForeignKey("p... |
e791be6006fd46092586f2f28169bad8d034bde2 | 48abd70d93f90e932e3f54d4e9a6988ea25828c8 | rogeroger-yu/ustack-gringotts | /gringotts/client/noauth/client.py | Python | py | 2,015 | no_license | import logging
from gringotts.client import client
from gringotts import exception
from gringotts.openstack.common import timeutils
from gringotts.openstack.common import uuidutils
from gringotts import utils as gringutils
LOG = logging.getLogger(__name__)
TIMESTAMP_TIME_FORMAT = '%Y-%m-%d %H:%M:%S.%f'
quantize_dec... |
4ea86f4b091cd7f356c889866f6df125e43f8f95 | e63cacfcdebb0ae272ac214d8e23f6993d780017 | 07kamrul/Python-A-Z | /GUI Project - Building Portfolio App With Tkinter/Calculating Profit and Loss.py | Python | py | 1,594 | no_license | import requests
import json
api_request = requests.get("https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=5&convert=USD&CMC_PRO_API_KEY=3889ce63-c733-403d-8b7d-c41a2438b4ea")
api = json.loads(api_request.content)
print("------------------")
print("------------------")
coins = [
{... |
494d1e1e50897a105ee177b8eeeb81c431f6ca7d | 90babce8696d760237c9965af7cdcb82df53b8f9 | julialia9512/pattern | /softmax.py | Python | py | 1,687 | no_license |
import numpy as np
from sklearn import datasets
mnist = datasets.fetch_mldata('MNIST original', data_home='.')
# print(mnist["data"].shape)
learningdata = mnist["data"][:60000]/255.0
predictdata = mnist["data"][60000:]/255.0
# print(learningdata.shape)
# print(predictdata.shape)
target = mnist["target"][:60000]
chec... |
835be9276b940da7f809f5c2f08a86a32e2564f8 | c089fe4fb30a38c4548d72ff4ca143eb6cc9f17a | hongfz16/Data-Structure-2-Project | /Project2/code/MyDataset.py | Python | py | 1,393 | no_license | # class MyDataset similar to class Dataset in torch
from torchvision import transforms
from torch.utils.data import Dataset
from PIL import Image
def default_loader(path):
return Image.open(path).convert('RGB')
class MyDataset(Dataset):
def __init__(self, txt, imagepath, transform = None, target_transform = ... |
2a2f1323541690ecacbe6061342b5dbeda5e1fdb | 3ecf0ddbc80c9591255e4e745b25f859bb27039f | Teo-KJ/Multidiscipli.-Des.-Proj.-Grp-31 | /Image Recognition/research/object_detection/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10-master/generate_tfrecord.py | Python | py | 4,587 | permissive | """
Usage:
# From tensorflow/models/
# Create train data:
python generate_tfrecord.py --csv_input=images/train_labels.csv --image_dir=images/train --output_path=train.record
# Create test data:
python generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record
"... |
643177987b1d792f0cc3f59bd10c20ddeffb6311 | 1ae3680cc3d0a6e15bb17ecb8e7de54d2f5e589a | rafaelperazzo/programacao-web | /moodledata/vpl_data/4/usersdata/111/1442/submittedfiles/swamee.py | Python | py | 452 | no_license | # -*- coding: utf-8 -*-
from __future__ import division
import math
#COMECE SEU CÓDIGO AQUI
f=input('Digite o valor de f: ')
l=input('Digite o valor de L: ')
q=input('Digite o valor de Q: ')
h=input('Digite o valor de delta H: ')
v=input('Digite o valor de v: ')
g=9.81
e=0.000002
pi=math.pi
D=((8*f*l*(q)**2)/((pi)*... |
fea2711b76bdcea076577bbde2e6340dac28ff63 | 4f9bfdd1b7c960f0cecdc8bc49866378358eea9d | EvaMarco/BootCamp_Python_mod2 | /Poo_perro.py | Python | py | 1,786 | no_license | class Perro():
# Función constructor. El primer parámetro será self.
def __init__(self, n, e, p):
# Esto son los atributos.
self.nombre = n
self.edad = e
self.peso = p
# Estos son los métodos de la clase.
def ladrar(self):
if self.peso >= 8:
prin... |
f731d036aa67066a8e0b376f009258f855383db5 | 2a7cc8a46e12e366aacbf116ce1a2439f989957f | zmlabe/predictGMSTrate | /Dark_Scripts/calc_SegmentData.py | Python | py | 6,111 | permissive | """
Function to slice trainging/testing data
Notes
-----
Author : Zachary Labe
Date : 23 August 2021
Usage
-----
[1] segment_data(data,classesl,fac,random_segment_seed)
"""
def segment_data(data,classesl,fac,random_segment_seed):
"""
Function to segment data based on ensemble members
P... |
1e7dfff77ef13ca4cc44e51d39d010790670a72d | da56fb5c6171419887f1f40fc4ec39741907a2dd | wichmann-lab/testing_visualizations | /human_experiments/exp_ii/ui/trials/forced_choice_trial.py | Python | py | 4,758 | no_license | from ui.trials import TwoTypesGridInstructionTrial
from psychopy.event import Mouse
from psychopy.visual import Window
from typing import List, Optional
from typing_extensions import Literal
from ui import HorizontalUncertainTwoAFCStim, VerticalUncertainTwoAFCStim
from psychopy.visual import ImageStim
from psychopy imp... |
d1e188bacf576adb18597f0017a1c71a5e805a17 | a730ef27c93abd6c5d7fb36d88150a22c354c93a | yccc233/bs_diseaseTriples | /venv/lib/python3.8/site-packages/py2neo/movies/__init__.py | Python | py | 3,288 | no_license | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2021, Nigel Small
#
# 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
#
# Unle... |
ea0e9cf7bd7f9ccea146c817710e19cfca344606 | 56b630a40d0a5f4ce9d123c1dcb48e098ea0cdb0 | celestinosalim/platform-code-test | /python_solution/award.py | Python | py | 1,002 | no_license | from python_solution.award_types.BlueCompare import BlueCompare
from python_solution.award_types.BlueStar import BlueStar
from python_solution.award_types.BlueFirst import BlueFirst
from python_solution.award_types.NormalAward import NormalAward
class Award(object):
def __init__(self, name="", expires_in=None, qu... |
03a83f304f7a82cf1b60f767b971584613fc9b1c | 393b79059e98349e54edfe184ee58e7b87a99dac | walmardfg/api-ibuss | /maestros/ciudades/migrations/0009_auto_20200407_2222.py | Python | py | 445 | no_license | # Generated by Django 3.0.4 on 2020-04-07 22:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ciudades', '0008_auto_20200407_2212'),
]
operations = [
migrations.AlterField(
model_name='ciudad',
name='ind_estado... |
8bc51a56d1f3cccb6644ada0a1c4d50bc6a74d09 | e44133431004cbcb730fa30a2228068de5de971a | Veenion/ursina_tutorials | /python_minecraft_tut_2021/code from previous videos/pyCraft_tut_10.py | Python | py | 8,726 | permissive | """
Minecraft in Python, with Ursina, tut 10
Petter Amland :)
3.2) Dictionary for stepping onto built blocks
4) Caves
5) Layers of terrain
DONE 6) Axe model
7) Fog darkens/changes colour as we descend height
DONE 8) Trees
...
future) Mining?
"""
from random import randrange
from ursina import *
from ursina.prefabs.f... |
fb1704b29db7c6eb55f031f811416772dc1ec0bd | 58b6cf2437f112b760db6858ab13df8bdecb217b | John-AZ1/omnitool | /plugins/worldify.py | Python | py | 12,719 | permissive | config = {
"name": "Worldify", # plugin name
"type": "generator", #plugin type
"description": ["Image -> World"] #description
}
# ref id: 5
import sys
import os
if __name__ == "__main__":
sys.path.extend(["."])
os.chdir("..")
import pygame
import tempfile
import colorsys
import io
from random i... |
d3d00fc83f108ec349dd55e8d10a35eb81465e68 | 26172b3088c0942657a7cb190d6c5da21fd66b97 | mazalves/OrCS | /trace_generator/extras/pinplay/PinPoints/scripts/sinuca_replay_dir.py | Python | py | 2,646 | no_license | #!/usr/bin/env python3
#
# BEGIN_LEGAL
# BSD License
#
# Copyright (c)2014 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the abo... |
6e55841dc593e784b7434c541e48dc5e7299fc57 | 49f1d918a1e7fd464f4afb1ca343c0f31d47998b | DEADalus9/Test | /Lesson_2/task_27.py | Python | py | 439 | no_license | #!/usr/bin/python3
from pyrob.api import *
@task
def task_7_5():
move_right()
fill_cell()
n = 0
nn = n
while not wall_is_on_the_right():
if n < nn:
n += 1
move_right()
else:
n = 0
nn += 1
move_right()
if ... |
fdd8f2edc3b12218f570c68b6052d6fe081ece7c | 1bfab385a843ee97fd1c083a5440d720affdd076 | nakeisha0601/melomania | /MelomaniaAPI/melomania/melomaniapp/migrations/0004_auto_20200910_1345.py | Python | py | 326 | no_license | # Generated by Django 3.1.1 on 2020-09-10 18:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('melomaniapp', '0003_auto_20200909_2218'),
]
operations = [
migrations.AlterModelTable(
name='cancion',
table='',
),
... |
e1038312dd13f7d3e9131005fb9afce34ec904ef | 06fbeec84a47c8ca66f2a36d9e53b736f0ddd994 | harshitpoddar09/InterviewBit-Solutions | /Programming/Linked Lists/List Sort/Insertion Sort List.py | Python | py | 1,065 | no_license | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param A : head node of linked list
# @return the head node in the linked list
def insertionSortList(self, head):
if not head or not head.n... |
01b468043c3a5fda73d6cddd19a8b40ad24065ba | 4d074e5c40f2b114c553e7537ee05f3181b52318 | thhapke/sdi_utils | /deprecated/df_table/df_table.py | Python | py | 4,935 | permissive | import sdi_utils.gensolution as gs
import sdi_utils.set_logging as slog
import sdi_utils.textfield_parser as tfp
import sdi_utils.tprogress as tp
import subprocess
import os
import pandas as pd
try:
api
except NameError:
class api:
class Message:
def __init__(self,body = None,attributes... |
445ac07c1bfdaa3b4a9ce8b1562a2f3f9dca94e9 | 7c60d0304500767f9dc13cb90699596d18f73f1d | AlexDannn/django_agr | /django_web_scraping/users/migrations/0005_auto_20201014_1756.py | Python | py | 598 | no_license | # Generated by Django 3.1.2 on 2020-10-14 17:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('users', '0004_auto_20201... |
a9775f246f40aed5062daa10590475d2cf784cb0 | 8718fb5c36c9a2da1fad6b71426d840241bbd478 | gilmiz/plantcv | /plantcv/plantcv/morphology/find_branch_pts.py | Python | py | 3,798 | permissive | # Find branch points from skeleton image
import os
import cv2
import numpy as np
from plantcv.plantcv import params
from plantcv.plantcv import dilate
from plantcv.plantcv import outputs
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import find_objects
def find_b... |
04aaaca6fa982ffaac0fb64e2502ba7ee3cdafe8 | 5213d881f7c9edfc5e719be39cf27dbc26b73833 | sashkarivkind/imagewalker | /fbm_mbm_lic/fbm.py | Python | py | 9,844 | permissive | """Generate realizations of fractional Brownian motion."""
import warnings
import numpy as np
class FBM(object):
"""The FBM class.
After instantiating with n = number of increments, hurst parameter, length
of realization (default = 1) and method of generation
(default daviesharte), call fbm() for fB... |
dce0a7aa76804942f44b1cda366fd00c310bbeb4 | 1c4d5c4d7de571dd7925401ae051f921edfca1dd | chainer/onnx-chainer | /tests/functions_tests/test_noises.py | Python | py | 762 | permissive | import chainer
import chainer.functions as F
from chainer import testing
import numpy as np
from tests.helper import ONNXModelTest
@testing.parameterize(
{'name': 'dropout', 'ops': lambda x: F.dropout(x, ratio=0.5)},
)
class TestNoises(ONNXModelTest):
def setUp(self):
class Model(chainer.Chain):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.