blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 283 | content_id stringlengths 40 40 | detected_licenses listlengths 0 91 | license_type stringclasses 2
values | repo_name stringlengths 3 135 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 68 | visit_date timestamp[ns]date 2015-07-25 20:53:29 2023-09-06 10:46:05 | revision_date timestamp[ns]date 1970-01-01 00:00:00 2037-05-03 13:00:00 | committer_date timestamp[ns]date 1970-01-01 00:00:00 2036-02-09 17:40:36 | github_id int64 1.61k 691M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 24
values | gha_event_created_at timestamp[ns]date 2012-06-03 10:21:33 2023-09-14 21:59:50 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-09-13 22:40:33 ⌀ | gha_language stringclasses 250
values | src_encoding stringclasses 27
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 6 10M | extension stringclasses 289
values | filename stringlengths 1 218 | content stringlengths 6 10M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
772e99f5380bbdd9295decd7957b2eff9ed68e2e | 6e75173525a980c251b905ff3c7081770963d28a | /code/vrep_bak/parser/Objects/scenario.py | e5af07b882000e24a7c6f67013d11d2056f0d720 | [] | no_license | CaeruleusAqua/Masterarbeit | 72463b365116e2baa0b53a1b277d4f1c616bd2b0 | 15cc0da0a0657815a3d1a90538002cbbf82979c8 | refs/heads/master | 2021-03-30T17:57:13.540493 | 2017-05-18T21:18:19 | 2017-05-18T21:18:19 | 67,040,255 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,043 | py | scenario.py | import datetime
from layer import Layer
from groundlayer import GroundLayer
class Scenario:
def __init__(self):
self.version = "v1.0"
self.date = datetime.datetime.now()
self.coordinatesystem = "WGS84"
self.name = "Masterarbeit"
self.origin = []
self.ground = GroundL... |
fb6f8a348505eed1941978a536aedc8e0ec93a31 | e05cd6db8e8c541c3493c54bfdc561f7300e85be | /pensieve/settings.py | bd1e63b45399ba01246a15fdcdc14bb7f121f86f | [] | no_license | eldridgejm/pensieve | 5b3ceeb16f34917214c9eea58b660e78e16e6282 | 8c94b079d25af4314e9dafc32f61a7f0d9f3f03e | refs/heads/master | 2021-08-26T04:56:36.201264 | 2021-08-20T16:50:49 | 2021-08-20T16:50:49 | 41,009,730 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 388 | py | settings.py | """Universal settings."""
# the date format used when creating a repo with a date prefix
DATE_FORMAT = "%Y-%m-%d"
# what should be placed before and after a date when creating a repo with date prefix
HIGHLIGHT = "__"
# name of the file used to read a pensieve configuration
DOTFILE = ".pensieve.yaml"
# the file to ... |
87b2c4d62362fd67e8f17be808b259860dc4abd8 | 05b80d92bb2efec76f898c527cc803f931031266 | /Lowest Common Ancestor of a Binary Tree.py | 2746eaff9339d9d05496c4d4db0235c92cbe5e9d | [] | no_license | PriyankaKhire/ProgrammingPracticePython | b5a6af118f3d4ec19de6fcccb7933d84f7522d1a | 8dd152413dce2df66957363ff85f0f4cefa836e8 | refs/heads/master | 2022-08-28T00:44:34.595282 | 2022-08-12T19:08:32 | 2022-08-12T19:08:32 | 91,215,578 | 18 | 11 | null | null | null | null | UTF-8 | Python | false | false | 2,117 | py | Lowest Common Ancestor of a Binary Tree.py | #Lowest Common Ancestor of a Binary Tree
#https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/description/
#I am giving you inorder and preorder travarsals of the tree
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.lef... |
5f2f3bed2510f179f05966ceaa5b3959c92da43f | 82150c194973b6cf5cb3aa2e4b7d313e25ac5483 | /每十天休息一天.py | 0ad06475dda833d594c43c5ff7809dcaf355ca37 | [] | no_license | Cartridgethrower/yuuuka | 660a9a958cc21f386d98763343a1b30686dffc5e | da901046b5c898b37808ffd84e67241188568178 | refs/heads/master | 2020-07-23T07:47:40.030715 | 2019-12-29T03:58:24 | 2019-12-29T03:58:24 | 207,489,650 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 235 | py | 每十天休息一天.py | power = 1.0
for i in range(365):
if i % 11 in [0,1,2,7,8,9,10]: #由于休息一天,所以循环又开始
power = power * 1
else:
power = power * (1+0.01)
print("能力值为{:.2f}".format(power))
|
f24bf2f5331d4392c5131e1ea31fdd4a9153521d | deac57efb297008d080563940466bf829bf510c2 | /python/tests/challenges_test/test_array_shift.py | 2b294f3d4734c2439abd109a0c00ce5824d08b79 | [
"MIT"
] | permissive | abdalazzezzalsalahat/data-structures-and-algorithms | 183b65498ecaaa91b39d35ca80ef31ba45d7b9fd | 30c35da90bc2c605b40d263ead592c41aeed9db9 | refs/heads/main | 2023-07-03T17:22:38.973363 | 2021-06-29T16:21:43 | 2021-06-29T16:21:43 | 350,645,575 | 0 | 2 | MIT | 2021-06-29T16:21:45 | 2021-03-23T09:06:20 | JavaScript | UTF-8 | Python | false | false | 345 | py | test_array_shift.py | from code_challenges.arrayShift.array_shift import insertShiftArray
def test(): ## 1
actual = insertShiftArray([2,4,6,8],5)
expected = [2, 4, 5, 6, 8]
assert actual == expected
def test_two(): ## 2
actual = insertShiftArray([4,8,15,23,42],16)
expected = [4,8,15,16,23,42] or [4,8,16,15,23,42]
... |
615712e2489c0266480c891eb629d5f0ed0be382 | 74c0336dda4603d35e97218da19d552f88e8e829 | /proj2.py | 0220884bd6fe242b8963f022d6691fc4b4ad10ed | [] | no_license | nicksica99/PythonConnect4 | 9f501c625fc17301f17d7eb5b0c855b3216b115b | 9e88d3656de488a7622dd208f50133562c7527c9 | refs/heads/master | 2020-06-20T18:43:52.292837 | 2019-07-16T14:38:41 | 2019-07-16T14:38:41 | 197,211,588 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 17,423 | py | proj2.py | # File: proj2.py
# Author: Nick Sica
# Date: 10/30/2018
# Section: 30
# E-mail: nsica1@umbc.edu
# Description: # Playing the game connect 4, the user can either play against another play\er or a computer. First one to get 4 in a row on any size board greater than 4x4 wins
#random for computer
from random imp... |
3c2a018671cf2641a8972366f21f8e79dc1d73f8 | 6b07b0eb95f5cea5e15b717ea315d244046d573f | /domino.py | af1d304c12f2d2eb84d36602369b28eaa5f30d3c | [] | no_license | m-and-ms/Competitve-Programming-and-algorithms- | c69bb6d029576605dde86d76628ed76ad02d28cf | f9ee9c57ff8b682cefdfa66504d477af65857ed3 | refs/heads/master | 2020-08-30T12:15:53.120275 | 2019-12-03T23:24:05 | 2019-12-03T23:24:05 | 218,377,796 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,732 | py | domino.py | # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
from collections import Counter
def get_freq(A,B):
freq_A=Counter(A)
freq_B=Counter(B)
max_B_key=max(freq_B.iteritems(), key=operator.itemgetter(1))[0]
max_A_key=max(freq_A.iteritems(), key=operator.itemgetter(1))... |
c93516ee1acdd620246acbd88618c4b8494d0221 | 978f90026129cf8be1cd2ee1c5f0ff67d490ab00 | /src/my_assignments/opencv/zk_image_publisher.py | 1178e21bcdf987dbcd24eda78276cc5a74493256 | [] | no_license | ezgode/ros_essentials_cpp | 4ca136b46b9817aa2f53f1ba0e8817a7d5191e73 | d204ec3c61f958befd3d1b9ab8e9eb835f843533 | refs/heads/main | 2023-03-28T16:24:36.852769 | 2021-04-07T05:52:47 | 2021-04-07T05:52:47 | 346,609,311 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 667 | py | zk_image_publisher.py | #!/usr/bin/env python
import numpy as np
import cv2
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
if __name__ == '__main__':
rospy.init_node('image_publisher', anonymous=True)
video_capture = cv2.VideoCapture('/home/ezequiel/catkin_ws/src/ros_essentials_cpp/src/topic03_perception/v... |
71dba1a33d2517f41cd774d0d51bb8df02de3333 | 4cf6c75ab1b4bad2c148b099c0fc129f2e97f515 | /game/game.py | 69afc4b31af9baa6aaf0d5485ca563086bfc5c8f | [] | no_license | obsinf/SnakeForAI | 1dbc309688bbc897ffdd3173d7eb1d9f27d14f47 | 5facb4c22c47e4dd3ac913173c88ad74f390c21c | refs/heads/master | 2020-11-30T05:45:56.485856 | 2019-12-28T17:08:21 | 2019-12-28T17:08:21 | 230,322,206 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 126 | py | game.py | from engine import Game
from AI import AI
ais = [AI('right'), AI('left'), AI('up'), AI('left', b=True)]
Game(ais, tick=200)
|
5bf45557cbc38ace5369a9acc2433f8259ab8472 | bc380a5913f72cfe56c7a4ec1ffbd2f6a8d475dc | /application.py | ebc42dd2ca9109c97f40cd84aa2e4805b34be528 | [] | no_license | hongbosen/micrappws | e351cec6ece3a89bf79c7492e86772f1679b7f34 | 0f77875152ed46d830ee1e4c1c96d30f80d4c3fc | refs/heads/master | 2021-04-16T23:09:01.940910 | 2020-03-24T13:07:36 | 2020-03-24T13:07:36 | 249,390,795 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,065 | py | application.py | import asyncio
import platform
import signal
from config import get_config
from log import LogOjbect
from redisservice import RedisService
from wxservices import Master
class Application(object):
def __init__(self):
super(Application, self).__init__()
def run(self, host: str="", port: int=0, env: st... |
16c992e519ff05481a475521e048c93d8b0549b7 | 4e6422d691397b4d5ca4bb163c260f9e7ed23f05 | /poscar_test_lattice_integrity.py | f6db7640e8617332dc2d129e6f90ed5a9335cb49 | [] | no_license | danmichaelo/scripts | 94aed05bb66065a16c3279f83f9d970d9b79b1ee | 96f3c3a0692ea7aa79ca81e0e2b96a2c633dfccf | refs/heads/master | 2020-04-05T03:00:42.791788 | 2012-01-20T12:14:51 | 2012-01-20T12:14:51 | 1,754,818 | 5 | 6 | null | null | null | null | UTF-8 | Python | false | false | 2,022 | py | poscar_test_lattice_integrity.py | #!/usr/bin/env python
# encoding=utf8
import sys
import numpy as np
from ase.io import vasp
# Assuming cubic cell !!!
filename = 'POSCAR'
if len(sys.argv) > 1:
filename = sys.argv[1]
print "Checking",filename
v = vasp.read_vasp(filename)
r0 = v.get_scaled_positions()
a = v.get_cell()[0,0]
natoms = r0.shape[0]... |
eb52ec36265188e908f82b9dad5abce88661ba23 | dc7b570362226605722bbc1b85b23b3335e89daa | /BinaryGap.py | 5c5a56e3d1fb867181377c6815d78ff9fbbe60ab | [] | no_license | AnuragBhattacharjee17/BinaryGap | d2330909377d95ca96f9ea88e28e93e84b4fdee3 | 3b90cab7f13a694473895786dafb8cc7b2a07e6c | refs/heads/master | 2020-09-22T04:42:32.270120 | 2019-11-30T18:28:18 | 2019-11-30T18:28:18 | 225,053,263 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 489 | py | BinaryGap.py | # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(N):
# write your code in Python 3.6
c= bin(N)
c=c[2:]
c=c[::-1]
p=0
if(c[0]=='0'):
for i in range(0,len(c)):
if(c[i]!='1'):
p+=1
... |
7ccf6ac395fa83e580f58e0b85fa6df9831afc11 | e705de3a44a7cc922e93c76c3aa6e6108222e538 | /problems/0209_minimum_size_subarray_sum.py | cfe1681ce8035537487e8dc7fc5a21ae8f6b4d1c | [] | no_license | sokazaki/leetcode_solutions | 34d4877dc7d13dc80ef067211a316c48c6269eca | 42cf52eeef537806c9e3ec7a6e5113c53d0f18a3 | refs/heads/master | 2021-06-21T22:23:25.403545 | 2021-02-21T16:47:19 | 2021-02-21T16:47:19 | 193,951,202 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,057 | py | 0209_minimum_size_subarray_sum.py | # O(N) Solution with Two Pointers and Sliding Window
# (Another: O(NlogN) Solution with Cumulative Sum + Binary Search)
# (Another: O(N^2) Solution with Simple Brute-force approach)
import unittest
def minSubArrayLen(s, nums):
min_length = len(nums) + 1
start = count = 0
for i, c in enumerate(nums):
... |
b70e0bbfd820bf9f4eedbbd52a4385ac0d0c61c8 | 43fb9eedef7b436ea1f64cebc5945553b8971ab9 | /1.py | f08ae48d3e1725475ff3a85f4b0155e29b713e2c | [] | no_license | dhivya2nandha/players | a90bfa3daaf1f622bc1804021a28f68e0a2680fc | 5a868316984dab557cc6381f1db7436c2f23274c | refs/heads/master | 2020-05-27T02:03:01.360179 | 2019-06-11T07:20:47 | 2019-06-11T07:20:47 | 188,446,098 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 47 | py | 1.py | """ reverse string"""
s=input()
print(s[::-1])
|
5651c662892df114611f0f32a78ab3e825aa5fc5 | b62de220512634e3a5280c415ebba118ec16636b | /extracting_colors.py | 4f02bbc4638332819cdda7c22e97d2a4ec4b9a72 | [] | no_license | HarrietLLowe/python_drawing-dots-art | 3c92c2885f0418db53ac42c43cbe21e2c6653de6 | 35895a13abc0abd4f5f7eac7690bbe7a7d544d34 | refs/heads/master | 2023-06-19T21:19:36.729210 | 2021-07-15T13:43:21 | 2021-07-15T13:43:21 | 386,305,296 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 664 | py | extracting_colors.py | import colorgram
colors = colorgram.extract('Addictive---detail-of-Dam-007.jpg', 30)
# this is the long way of doing this
# first_color = colors[0]
# rgb_identify = first_color.rgb
# first_color_colors = ()
# red = rgb_identify[0]
# green = rgb_identify[1]
# blue = rgb_identify[2]
#
# first_color_colors = (red, green... |
c946ddcee3b081b269ad5a5a7097ab51b3d814a5 | 8343e8d417cefb3725556066678157e88a943cff | /app/recipe/serializers.py | 8cbb0da9228eb8f597d996e071b8e231e05c71e3 | [] | no_license | paumartin/tk-university-backend | a8d1b2f6fdb3abddfeb0f76268073b0e41e7658a | ebb074ad7628eb01e318f687935fa4b0e044a689 | refs/heads/master | 2023-08-03T06:18:47.062576 | 2020-06-30T15:33:37 | 2020-06-30T15:33:37 | 271,047,398 | 0 | 0 | null | 2021-09-22T19:15:29 | 2020-06-09T16:00:25 | Python | UTF-8 | Python | false | false | 631 | py | serializers.py | from rest_framework.serializers import ModelSerializer, PrimaryKeyRelatedField
from .models import Recipe, Ingredient
class IngredientSerializer(ModelSerializer):
"""Serializer for the ingredient object"""
class Meta:
model = Ingredient
fields = ('id', 'name',)
read_only_fields = ('i... |
b42b5f2e767bf589c4e2e186c1e730fa9c848d04 | bd07ef432f217c3c283d30e756aa89eb70c9a902 | /tk_sql_app/cli/__init__.py | 39174a90242975731d0c84f69ebbe43154c266cb | [] | no_license | Chanab0910/student_clubs | 43e9e03e426d4abc3a9807822ef777bcb93aff3c | 525b33c48f984ee7348b96160ae5e9ee33cc04eb | refs/heads/master | 2023-08-06T03:12:05.626826 | 2021-09-30T14:03:56 | 2021-09-30T14:03:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 20 | py | __init__.py | from . import menus
|
f076276c6e532cf7240552f69ffa574d38e3619e | d7c7bc04ddb9171c24ff1e79802c9e8acad6c1f3 | /record_time.py | 7a9afa5c15e779f11f62574510e9fdfc9dbeca53 | [] | no_license | ichizokichinosuke/GoogleHomeSystem | 9f2d1b3ac195b0071fa616d93f327bdd50d86e38 | b84cda02fbd63d94361b43391bb2a5f40b96f733 | refs/heads/master | 2023-07-05T18:20:08.060592 | 2021-08-14T17:20:48 | 2021-08-14T17:20:48 | 264,121,561 | 0 | 0 | null | 2020-05-29T10:20:15 | 2020-05-15T07:03:29 | Python | UTF-8 | Python | false | false | 4,093 | py | record_time.py | import json
import datetime
import os
import pandas as pd
import numpy as np
import paho.mqtt.client as mqtt
import ssl
import numpy as np
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
# TLS_v = ssl.PROTOCOL_TLSv1_2
COLUMNS = ["Work_start", "Rest_start", "Rest_end", "Work_end", "Work_time"]
WORK_INSTRUCTION = ["勤務", "... |
12c070245b1fd10df5628f7423b995039d242769 | 19c349eb59b63ccc3243bc1579ec303f8a5a27de | /db/progress/migrations/0002_add_table_common_fusioninvoice.py | 6535c41097ca1888bb5718243f33361a2cd36190 | [] | no_license | subi17/ccbs_new | 4d77d54aba8eff4564b2adccec6b001189a4e2ca | 660c859ca5fe4586f32ee70c76ee2d55c6d08c94 | refs/heads/master | 2020-03-27T04:49:20.708938 | 2018-08-22T06:42:19 | 2018-08-22T06:42:19 | 145,971,318 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,150 | py | 0002_add_table_common_fusioninvoice.py | from gearbox.migrations import Migration
class AddTableFusionInvoice(Migration):
database = "common"
def up(self):
t = self.table('FusionInvoice', area="Dyn_Data_32", multitenant="yes", label="FusionInvoice", dump_name="fusioninvoice", desc="FusionInvoice")
t.column('FuInvNum', 'integer', for... |
be0d0748a78f97b789c6e20c5b2d7889eb742af1 | 2cb9d1bf6e674049dd03b04e5714d12a268425a4 | /sariq_dev/darslar/11_dars_uy_ishi_6_.py | a6c2d4251caf57340d11a49f47c10d4074ef81e1 | [] | no_license | RuzimovJavlonbek/anvar.nazrullayevning-mohirdev.uz-platformasidagi-dasturlash.asoslari.python-kursidagi-amaliyotlar | 02885608c40e9dd9ae0d13013619ef787240bcf6 | f999be39d0e3c7edb990f9c3c29edbeeb0e19c2d | refs/heads/main | 2023-07-02T20:16:56.146956 | 2021-08-06T03:12:49 | 2021-08-06T03:12:49 | 390,466,668 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 360 | py | 11_dars_uy_ishi_6_.py | foydalanuvchilar = ['java', 'javlonbek', 'adham', "bo'rya",'sasha']
login = input(" Yangi login kiriting. >>>> ")
c= True
while login.lower() in foydalanuvchilar:
print("\nBu login band , yangi lgin tanlang ! ")
login = input(" Yangi login kiriting. >>>> ")
else:
print(f"\n Xush kelibsiz ! {login} ")
print(... |
a052ea9c9c2385674778ef06c14998344516ddb6 | 3823ec9852ecba7df108b70156541f2f7d35745f | /atbash.py | 529f7d21caa1289eb7870bb6885dd7b05f14785b | [
"MIT"
] | permissive | OlegWock/python-ciphers | 7bd183cf392502eff325876aefe5b7ccc17cb02f | 9a763357b927ac38093b3c4416d9134f3f8c2749 | refs/heads/master | 2021-01-10T15:06:06.581563 | 2016-03-02T17:02:30 | 2016-03-02T17:02:30 | 52,978,825 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 573 | py | atbash.py | #!/usr/bin/env python3
#-*- coding: UTF-8 -*-
from base import rus_abc, rus_cabc
rev_en = {rus_cabc[k]:rus_cabc[32-k] for k in range(33)}
rev_de = {rus_cabc[32-k]:rus_cabc[k] for k in range(33)}
def encrypt(text):
newtext = ""
for x in text:
l = x.islower()
cur = x.upper()
if cur in r... |
cc8de8b0652a2d4ad8445f04a20fe4b835135058 | e0518dd31d77de7a7ccc8a9b813288c91f95f6a7 | /chat/views.py | 110dff33794f984e8cf0edc37178ceb389b03f81 | [] | no_license | Raja-mishra1/django-chat | 4291b34df469084a576c34a28e4069f9ff6128c5 | 8616bd801fe4ca8d8920e9e2306f40382d56a3d2 | refs/heads/master | 2023-06-12T16:44:43.376904 | 2021-07-03T11:46:20 | 2021-07-03T11:46:20 | 382,421,444 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 402 | py | views.py | from rest_framework.views import APIView
from rest_framework.response import Response
from .pusher import pusher_client
# Create your views here.
class MessageAPIView(APIView):
def post(self, request):
pusher_client.trigger('chat', 'message',{
'username': request.data['username'],
... |
9642a7d49f9bdf964b2e8924cc5378fa6fff970b | 4b3d8f36d97b32bf1233dd7175f52b552bf82903 | /connect4.py | e0465bf6d749edbaa3a08dc1372c82ba1ff713cf | [] | no_license | TSLawrie/Connect-4 | 69736772debc14f20ba1897a77785ec6a608d56d | 02c4434de11eef7c99c29d2f2c815cbc1a332f2f | refs/heads/master | 2020-09-25T18:20:57.795830 | 2019-12-05T09:30:35 | 2019-12-05T09:30:35 | 226,062,085 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,880 | py | connect4.py | #! python -u
"""Program to play Connect Four in your terminal."""
from c4_tools import printGrid, pHoriWin, pVertWin, pDiagWin, bHoriWin, bVertWin, bDiagWin, addCheckerX, addCheckerO
from random import randint
from time import sleep
print("\nWelcome to Connect 4 for Terminal!")
while True:
choice... |
b1bd55a4a393f5e87395684c8d54842f34d76202 | 781e2692049e87a4256320c76e82a19be257a05d | /all_data/exercism_data/python/bob/5f3c9a3dfa414f4da2a0b0c7c0f3d2ea.py | 57516ef2c1928bb2f997df436f09b5995d7d1d4c | [] | no_license | itsolutionscorp/AutoStyle-Clustering | 54bde86fe6dbad35b568b38cfcb14c5ffaab51b0 | be0e2f635a7558f56c61bc0b36c6146b01d1e6e6 | refs/heads/master | 2020-12-11T07:27:19.291038 | 2016-03-16T03:18:00 | 2016-03-16T03:18:42 | 59,454,921 | 4 | 0 | null | 2016-05-23T05:40:56 | 2016-05-23T05:40:56 | null | UTF-8 | Python | false | false | 469 | py | 5f3c9a3dfa414f4da2a0b0c7c0f3d2ea.py | """
Bob exercise.
"""
class Bob(object):
"""
A typical teenager.
"""
@classmethod
def hey(cls, s):
"""
Returns a response for a typical teenager.
"""
if s.strip() == "":
return "Fine. Be that way!"
elif s.isupper(): # False iff no cased letters i... |
7deef7fa44353980a7aab919d15ae14c71398e90 | fb01300a19b14b3d9ad794a55db7a7f8504b14df | /wfc1/wfc_minizinc.py | bf09873d8b01d43741bb80cedb8471362883d7b8 | [
"MIT"
] | permissive | vallsv/wfc_2019f | 9e746a20a930438ba3c0bd94eabeb29181928e4e | 78e2449da0ecd6c6a23fc15c10d7249b592fd8bb | refs/heads/master | 2022-10-10T04:43:45.902620 | 2020-06-07T10:30:30 | 2020-06-07T10:35:54 | 270,271,765 | 1 | 1 | MIT | 2020-06-07T10:33:15 | 2020-06-07T10:33:14 | null | UTF-8 | Python | false | false | 3,690 | py | wfc_minizinc.py | # An interface to other solvers via MiniZinc
import pymzn
import time
import wfc.wfc_solver
from wfc.wfc_adjacency import adjacency_extraction_consistent
from wfc.wfc_utilities import CoordXY, CoordRC, hash_downto, find_pattern_center
import logging
logging.basicConfig(level=logging.INFO)
wfc_logger = logging.getLog... |
96430e89a05f31add691486f4e5562b52777fbb9 | 3af8a3b94774a2ade3b4796214cb2dd6bbc07ec6 | /insertionsort_for_string.py | c0e529d265f9b7594505aa0ef7d4f4ff98268c0c | [] | no_license | shailesh05/algorithm-functional_program | 696d18216ab943d1dd9370ae6d8f904d389ee86f | a870315105ebfa7da9e0d09d84a49c70be4b0e48 | refs/heads/master | 2020-04-30T08:17:54.453011 | 2019-03-29T13:15:13 | 2019-03-29T13:15:13 | 176,710,790 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 401 | py | insertionsort_for_string.py | def string_insert():
size = int(input("enter the size"))
list1=[]
for i in range(size):
val=input("enter the word")
list1.append(val)
for i in range(1,len(list1)):
temp=list1[i]
j=i-1
while (j>=0) and (temp<=list1[j]):
list1[j+1]=list1[j]
... |
fb3347d2d23cb8b0fae52ad5c948c77245eb0707 | 32f95dec2617f0c61a97ee22999eec8b29568c6e | /Statistical Thinking in Python-Part1/Introduction to Summary Statistics/computing_covariance.py | 788073244429996e1b5ac7a697bebaf99b851366 | [] | no_license | supersum9/DataCamp | f4728378ca976d72d2809f1c91577e3a1be8fa04 | 6126041924b7b530d6d9b7a710cfd25dd6f0d40e | refs/heads/master | 2023-03-16T20:34:31.333655 | 2021-02-11T05:50:13 | 2021-02-11T05:50:13 | 273,993,837 | 1 | 0 | null | 2021-02-11T05:50:14 | 2020-06-21T22:34:55 | Python | UTF-8 | Python | false | false | 329 | py | computing_covariance.py | # Compute the covariance matrix: covariance_matrix
covariance_matrix= np.cov(versicolor_petal_length,versicolor_petal_width)
# Print covariance matrix
print(covariance_matrix)
# Extract covariance of length and width of petals: petal_cov
petal_cov = covariance_matrix[0,1]
# Print the length/width covariance
print(pe... |
6dd682a477e5933eb88cdbb76d3da6bfaa3f6e95 | 3c0ccda87fdb06acb6c220832a793a1f8742f22d | /descent/codegen.py | b7c321dd04d9b1669e849d5345df4cff5bedc27a | [
"MIT"
] | permissive | ethframe/descent | ed23d0a661f6031c98e6a6bae1d3eeb14a50cfbc | 6ca34416953a6123daa280c519fca56c70bf5fee | refs/heads/master | 2020-03-22T08:24:22.959068 | 2018-07-17T21:41:03 | 2018-07-17T21:41:03 | 139,764,536 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,304 | py | codegen.py | import sys
from descent.asttypes import NamedType, TokenType, NodeType
def _indent(lines):
for line in lines:
if isinstance(line, list):
for indented in _indent(line):
yield " " + indented if indented else ""
else:
yield line
def _concat(lines):
re... |
80acfca0439c0572ffe2f3e395e4c91a7bd09dfd | 092dd56a1bf9357466c05d0f5aedf240cec1a27b | /pylith/meshio/OutputSoln.py | 005e651609336110a715e4d3c24956b330fcfbf3 | [
"MIT"
] | permissive | rwalkerlewis/pylith | cef02d5543e99a3e778a1c530967e6b5f1d5dcba | c5f872c6afff004a06311d36ac078133a30abd99 | refs/heads/main | 2023-08-24T18:27:30.877550 | 2023-06-21T22:03:01 | 2023-06-21T22:03:01 | 154,047,591 | 0 | 0 | MIT | 2018-10-21T20:05:59 | 2018-10-21T20:05:59 | null | UTF-8 | Python | false | false | 1,412 | py | OutputSoln.py | # ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... |
515e4753efe0ca0790fef9df08892424176793ea | a2e5ffabfcc8d40c561c523a2199237d209897f7 | /Working with Numpy/scalar.py | 7f4a1dbf5cab396c9542ad61c6cbd6473ba75fa3 | [
"MIT"
] | permissive | diawithsun/TakenMind-Internship | 935d52148b790769a37c0033e550351922a0f5a5 | 7fb7c1c0b255ee233f18fd9ab4fa76a9b2c992d7 | refs/heads/master | 2022-01-23T07:30:13.396080 | 2019-07-01T13:01:24 | 2019-07-01T13:01:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 275 | py | scalar.py | from __future__ import division
import numpy as np
arr1=np.array([[1,2,3,4],[5,6,7,8]])
print(arr1)
#multiplication
print('Multiplication',arr1*arr1)
#exponential multiplication
arr2=arr1 ** 3
print(arr2)
#subtraction
s=arr2-arr1
print(s)
d=arr1/2
print(d) |
a09ec6c6d487b01efd32346e07055f8701762752 | 7de4217aa5c4d777d750333ebe285ca892c1d7aa | /scrape.py | 942ef6c8b91eaac3c6f4f1abab28c6f539748162 | [
"MIT"
] | permissive | samloh84/python-scraper | d8e272cc24e024f56f72693b4138c0c4ed056f11 | 9384a6b5cb3bd3b2ac36a9af06f56664d6d131ac | refs/heads/master | 2021-08-22T13:26:14.390616 | 2017-11-30T08:59:40 | 2017-11-30T08:59:40 | 112,588,634 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,245 | py | scrape.py | from bs4 import BeautifulSoup
from concurrent.futures import ThreadPoolExecutor
from furl import furl
from pprint import pprint
from pydash import _
from requests import ConnectionError
from requests_futures.sessions import FuturesSession
import argparse
import pydash
import re
import requests
def parse_html_for_urls... |
978c4b49a30224198d47e9e2383be2e72dc38786 | ee9e7d72e50c0ff6d7c114870a63736b4ad97159 | /api/urls.py | fb400f48557460cd9006948fc1e32c4d480fc43a | [] | no_license | zzhng107/OOTO | 49ac15a8ea62abfef84216e54951527a5635d96d | 168ae827488d8d2f2558326c4ab5895443317bc2 | refs/heads/master | 2021-08-24T03:31:50.959347 | 2017-12-07T21:56:03 | 2017-12-07T21:56:03 | 106,769,435 | 0 | 0 | null | 2017-12-07T20:06:05 | 2017-10-13T02:40:54 | JavaScript | UTF-8 | Python | false | false | 811 | py | urls.py | from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from . import views, tripsViews
urlpatterns = [
url(r'^trip/insert', views.tripInsert, name='tripInsert'),
url(r'^trip/delete', views.tripDelete, name='tripDelete'),
url(r'^trip/updateId', tripsView... |
abc803efce5674701ba4078f19468ee726a38a46 | 45e376ae66b78b17788b1d3575b334b2cb1d0b1c | /checkov/common/util/banner.py | bbb582392c6a11f515b49024b8c9771fc78f39ab | [
"Apache-2.0"
] | permissive | bridgecrewio/checkov | aeb8febed2ed90e61d5755f8f9d80b125362644d | e64cbd27ffb6f09c2c9f081b45b7a821a3aa1a4d | refs/heads/main | 2023-08-31T06:57:21.990147 | 2023-08-30T23:01:47 | 2023-08-30T23:01:47 | 224,386,599 | 5,929 | 1,056 | Apache-2.0 | 2023-09-14T20:10:23 | 2019-11-27T08:55:14 | Python | UTF-8 | Python | false | false | 803 | py | banner.py | # flake8: noqa
from termcolor import colored
from checkov.version import version
from checkov.common.version_manager import check_for_update
tool = "Checkov"
banner = r"""
_ _
___| |__ ___ ___| | _______ __
/ __| '_ \ / _ \/ __| |/ / _ \ \ / /
| (__| | | | __/ (__| < (... |
8bdb6a37e5229260b1b82181ad787d739422746d | 3e793d816ab50aa17a975f4d538545459720ab93 | /utils/managers/user_manager.py | 8f038b7af209e516c96c823127c9bdf1b1261c7d | [
"Apache-2.0"
] | permissive | didoogan/micro-auth | 52f8996427fef00e04f0ede5a12447c6f65fa42e | 42a0883b3d9550b91ea1cd3617fc750678eb0b62 | refs/heads/master | 2022-11-07T19:53:15.640912 | 2020-06-02T13:59:58 | 2020-06-02T13:59:58 | 263,696,999 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 711 | py | user_manager.py | from users.models import users
import utils
from database import database
from users.schemas import UserIn
class UserManager:
model = users
@property
def query_manager(self):
return utils.QueryManager(users)
@property
def password_manager(self):
return utils.PasswordManager()
... |
8bd2693803fa477a9483da8978ab74119a924de5 | 45d537f5eaebee4a2e64c9ece12029152e770556 | /app.py | c8c763ecba2ad859b9d4c18405cfdd3a78c16d5f | [] | no_license | Jayedakhtar96/boston-house-price | 1d27b8b30ee309dfec2176e330a7055176971c5b | 6f4c8815a48289ad164141686200a0143fe9cd1c | refs/heads/main | 2023-02-22T09:30:52.340072 | 2021-01-10T10:34:13 | 2021-01-10T10:34:13 | 328,357,049 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,601 | py | app.py | #import the necesssary dependencies
from flask import Flask,render_template,request,jsonify
from flask_cors import CORS,cross_origin
import pickle
# initializing a flask app
app = Flask(__name__)
#route to display homepage
@app.route('/',method=['GEt'])
@cross_origin()
def homepage():
return ren... |
745ce86432360f8fc6f2a43d5f8ec74c25594513 | 10b0b261b1360e9e862f3c84b741feef4d7980af | /silkload_stakes/download_convert.py | add50c957e297ab5bb2e27ee262aa5e8bca23fc1 | [] | no_license | tsukudamayo/keiba | 360a76452a844bac214ad6224a0c1da8032f460b | 4afaee095a22c7929cf1d614971f2f8269cdce38 | refs/heads/master | 2023-06-23T03:25:17.458169 | 2021-07-21T04:48:24 | 2021-07-21T04:48:24 | 113,167,938 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,098 | py | download_convert.py | # _*_ codings: utf-8 _*_
import pandas as pd
def download_race_table():
""" read race table """
race_table = pd.io.html.read_html(
'https://race.netkeiba.com/?pid=race_old&id=c201908020211', header=0)
race_table = race_table[0]
print('race_table', race_table)
race_table.to_csv('race_table.... |
ee75828eca0a00a182a57e04c8d065bba53536ff | 94e7af253735921a42cec95d686ce07b104a6d52 | /lib/polly.py | c9b83482c044b7ca5c5f1dea29465432445f105c | [
"Apache-2.0"
] | permissive | tluong0/Alarm-Pi | e3e30524b994ca27b0c4f236771533e106ce01b2 | b26680d168a71b536ac00be22c515980e8cd4fd2 | refs/heads/master | 2020-04-07T13:35:10.545182 | 2018-11-28T19:45:11 | 2018-11-28T19:45:11 | 158,413,141 | 0 | 0 | Apache-2.0 | 2018-11-20T15:42:07 | 2018-11-20T15:42:06 | null | UTF-8 | Python | false | false | 1,642 | py | polly.py | import boto3
import pygame
import os
import time
import io
class Polly():
OUTPUT_FORMAT='mp3'
def __init__(self, voiceId):
self.polly = boto3.client('polly') #access amazon web service
self.VOICE_ID = voiceId
def talk(self, textToSpeech): #get polly response and play directly
poll... |
7e93402d5b806a4ef689b8e972da1cbef6556ca5 | 7c20e6c1a75d4e590d9c45a33fb25874ef60c5ea | /experiments.py | 0674b582585ad1eaffba19847922d8317687eb44 | [] | no_license | hselzayn/fairboosting | 01587d38424aa577e64f69192dc0a719b9a138a2 | 95a27654bfa15630c24695f849ce206a893fa93c | refs/heads/master | 2020-04-10T01:54:28.229923 | 2018-12-06T20:42:08 | 2018-12-06T20:42:08 | 160,729,000 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 44,914 | py | experiments.py | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random as random
import statsmodels.api as sm
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import AdaBoostClassifier as abc
from sklearn.metrics import accuracy_score
from sklearn.tree import DecisionTreeClassifie... |
304a509abd5a2d00281f71aa24acf51a19211ba9 | d0914715fc2760f802a98925ea90ccc61ad13609 | /src/utils/apparent_age_estimator/AAE_CVPR2016_OrangeLabs/General_age_estimation/PREDICT_AGE_FINAL.py | 78dcc1c1af6657fc742a707bbbf6e815675bfa9f | [
"MIT"
] | permissive | AaltoVision/img-transformer-chain | 41bddd04b03853499f9cca717abb7c9513ac3516 | 48479c34ba4842e7d8c40f589b2e8391b63cbd3d | refs/heads/master | 2020-03-25T10:25:08.724576 | 2018-08-10T13:05:46 | 2018-08-10T13:05:46 | 143,692,564 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,773 | py | PREDICT_AGE_FINAL.py | #!/usr/bin/python
# Executes apparent age estimation by general CNNs.
#
# Copyright Orange (C) 2016. All rights reserved.
# G. Antipov, M. Baccouche and S. A. Berrani.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
22cab76c04108c0dc1e3d9fb8205799457c5996f | 7dc3e4d235713561d9e5a9cef5998d163c84dc7d | /requirements_tools/upgrade_requirements.py | ecb6611a11b7190ec4e19547dbd3698d1306dcae | [
"MIT"
] | permissive | Yelp/requirements-tools | 447ceef0e1f97a76c99760737d27c614aa61c9fe | fcabc5f162d3520dd4e1c4f68f981690c3ca9fac | refs/heads/master | 2023-07-31T02:15:14.630635 | 2023-02-11T19:41:29 | 2023-02-11T19:41:29 | 76,284,900 | 85 | 49 | MIT | 2023-03-24T12:42:51 | 2016-12-12T18:43:04 | Python | UTF-8 | Python | false | false | 7,250 | py | upgrade_requirements.py | #!/usr/bin/env python
from __future__ import annotations
import argparse
import contextlib
import os
import shlex
import shutil
import subprocess
import sys
import tempfile
from typing import Generator
from typing import NoReturn
from typing import Sequence
from pkg_resources import Requirement
from pkg_resources imp... |
a93b177c43243bec5823cedd0cf48cc5c34d79a8 | 921cf37d4cfa37ef6c6fbae7ab77ba55ae3e1a0a | /armstrong-numbers/armstrong_numbers.py | 1f7501a27b50b6cac2c777f5d371275e34c4206f | [] | no_license | positiveoutlier/Exercism | d28f9700b9d36ceb4c4ed56a8d9c4fbb6eec2040 | 46148956ebdbfeaef4b6b70685198c0345585ad4 | refs/heads/master | 2020-04-14T01:37:18.778558 | 2019-01-19T20:37:55 | 2019-01-19T20:37:55 | 163,564,794 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 320 | py | armstrong_numbers.py | def is_armstrong(number):
"""
Checks if number is an armstrong number, which is is a number that is the
sum of its own digits each raised to the power of the number of digits.
Input: integer
Output: True or False
"""
return sum([int(i)**len(str(number)) for i in str(number)]) == number
|
b1ae391af205b769a425341874b6807f15f9f463 | d9a2035868f8d8892cc7984f451c47c40ef8f926 | /DBLoader.py | 18ac88665ec86d81907e5af5a9cecac89c3700b9 | [] | no_license | DavideFemia/AStar-con-Disjoint-Database | a1a9b03c58691759a3bca2ad29eb4c6645b0953f | 71271f32644e6187a7b2d9b4479cc27a9367620e | refs/heads/master | 2020-04-18T06:38:35.118173 | 2019-07-03T14:29:49 | 2019-07-03T14:29:49 | 167,330,172 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,748 | py | DBLoader.py | from timeit import default_timer as timer
import pickle
from Node import Node
from Frontier import AStarFrontier
from SubProblem import SubProblem
def generateDB(problem):
node = Node(problem.initialState, str(problem.initialState), 0)
frontier = AStarFrontier()
frontier.push(node)
db = {}
while fr... |
2a725aaf55fc7d80bdc7f94bee2263781a0582d3 | 8565e0f12bb11e14096964eeef3e34535c513d7f | /cyphersbot.py | 86221e1a649a9f2b206c5117cdf88ed248ced8cb | [] | no_license | No17Namsan/NightSkyK | 2be02740cd3520bf8216abe6069721a39ee0ad4b | 73aa3890780814726f5dc23bfe4416f75df200cb | refs/heads/main | 2023-07-18T04:41:12.381368 | 2021-09-06T11:21:00 | 2021-09-06T11:21:00 | 403,484,701 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 22,331 | py | cyphersbot.py | #!/usr/bin/env python3
# cyphersbot.py by.NightSkyK A.K.A MoonSeong Kang
# Library
import asyncio
import discord
import urllib.request
import urllib.parse
from urllib.parse import quote
import json
from datetime import datetime
import random
#client_set
client = discord.Client()
cy_client_id = "Cyphe... |
bba42725b719395a0448af93174a1eabe92f8ea1 | 22dbb4163b7280ac3d7d3d8780cfdc436ad29f0e | /inf_1_sem/lab2/14.py | 493b64aa5f84bb3f8fd2b29fff9da8be6b79b4e6 | [] | no_license | infa2021Vasilev/inf_1Sem | 8b4343423ce90a31ccd400fc161a36857dc29cc4 | 8f0ff4c74a9d710037376efedd62a9b92918a2c1 | refs/heads/master | 2023-08-07T07:26:12.321555 | 2021-10-10T15:45:54 | 2021-10-10T15:45:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 171 | py | 14.py | import turtle
turtle.shape('turtle')
n=11
def star(N):
for i in range(N):
turtle.forward(100)
turtle.right(180 - 180/N)
star(n)
|
ba517167073f2b5a75c81b90e7be2de5e3b058b5 | e9b06426f553b7c1d3550a0932e60756e82c3f78 | /Lab2/submission_autograder.py | 84041676d8f6716501aee64c8590d14471c44408 | [
"MIT"
] | permissive | MaAlonsoA/AI-Class | a5af9b2e1a2dd76f377e04f4f2f0a784802f12a8 | 7fa679b69b699e86dfc99548620c62a37f3d8e57 | refs/heads/master | 2023-04-14T22:54:52.130742 | 2021-04-24T17:23:52 | 2021-04-24T17:23:52 | 346,392,810 | 0 | 0 | MIT | 2021-04-24T17:23:53 | 2021-03-10T14:59:31 | Python | UTF-8 | Python | false | false | 8,999 | py | submission_autograder.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from codecs import open
import os, ssl
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context
"""
CS 188 Local Subm... |
29f058563bfb8c15f4465fab20a76f423a045507 | 74b2d65b0a1d60c219c6f33cd2b4099ccda4e4f9 | /KSH/5/sets.py | 98eedb6b05c18b1b48cdff784885484658dd7c4b | [] | no_license | KSH-code/study-python | c86012067b38ba49e7b8811e19f64fa5b0b9de30 | c7aa9fc74a878aa45212bb4991de6fbf40df6369 | refs/heads/master | 2021-07-14T04:16:29.821718 | 2017-10-19T08:38:18 | 2017-10-19T08:38:18 | 106,788,719 | 0 | 0 | null | 2017-10-16T04:16:06 | 2017-10-13T06:51:58 | Python | UTF-8 | Python | false | false | 364 | py | sets.py | basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
print(basket)
print('orange' in basket)
print('asdfasdf' in basket)
a = set('aaaasdfssdfsdfsdfzzxcvzxcv')
b = set('asdfasdfasdfs')
print(a)
print(b)
print(a - b)
print(a | b)
print(a & b)
print(a ^ b) # letters in a or b but not both
print
a = {x for x i... |
cc54d2d796556c14e380dbeb0532f17e2a072bca | 3b6c1278134a255cfa61d2eaa3df76486b39eb8f | /TargetSumBacktrack.py | 8fafdfa0d3fc377c4e1fb044ba635473c7e04152 | [] | no_license | hamzausmani302/python-problems | 9b4d890f564c27e5a2ae67f5cc1b096138b6c5c5 | da70cc3d1087a7bdd593475f06c391967392a706 | refs/heads/main | 2023-08-24T11:45:33.937269 | 2021-10-02T19:03:22 | 2021-10-02T19:03:22 | 380,801,249 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 473 | py | TargetSumBacktrack.py |
# backtracking to find the all the possible combinatiions that lead to a target sum
def target_sum(array , arr,result, sum1 , tsum):
if(sum1 == tsum):
result.append(arr);
return result; #change
elif(sum1 < tsum):
for i in range(0,len(array)):
if(sum1 + array[i] <= tsum):
arr.append(array[i]);
... |
bcbb9905bda2bc32f6936a09ea1cbdeb16da232c | 56246921153afd41300ceac4e89f530c925d32a3 | /app/__init__.py | 8af282f86d9567b9d7f50ff2a3c9cb5b3de1ef52 | [] | no_license | Darren2017/mini_project_test | 079d736b1b5adc50363d58ebb874c65cae3ee6d4 | 5b72649744b51b5f8ed8b324a37c9dacf675d01c | refs/heads/master | 2020-03-07T18:13:12.201401 | 2018-04-06T12:17:49 | 2018-04-06T12:17:49 | 127,631,207 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 477 | py | __init__.py | #coding:utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
import config
app = Flask(__name__)
#config_name = 'default'
app.config.from_object(config)
#config[config_name].init_app(app)
db = SQLAlchemy(app)
#初始化flask-login
login_manager = LoginManager()
log... |
70bd75ae6845b5b296d51bbe6fe5f05884dcd778 | 2187ec59c84e9e9ef9799df28f9334d5cdb7f213 | /Chapter 7 Enum/7.2 Iteration enums.py | 1fcecffe361258244d7cf9407a21e49d9c5bab77 | [] | no_license | Harry-Rogers/PythonNotesForProfessionals | 6b4a938270b2328956981f1545967ba8ffd67e88 | 8c3dae34f6fbc6d816bab2df9417eae3e5931b7f | refs/heads/master | 2022-12-06T20:47:54.457576 | 2020-09-03T13:22:14 | 2020-09-03T13:22:14 | 286,720,670 | 5 | 1 | null | null | null | null | UTF-8 | Python | false | false | 242 | py | 7.2 Iteration enums.py | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 26 17:39:17 2020
@author: Harry
"""
from enum import Enum
class color(Enum):
red = 1
green = 2
blue = 3
print([c for c in color])
#can iterate through all to find values |
2771ce31034b651b1367baf0ff9767296ec616f4 | 25f0c034015a01caa03423eba3b49dc34a3ee722 | /dashboard-generator/ds_generator/orm/EntityModels.py | 2a576b5b390a142aefe2c7c242ef79037bfd90d2 | [] | no_license | isabella232/wavekit | eebfac82fc4a17d87c0be4c20fdc2289b95da572 | 38c2671936556b3ceb8119ff1a982dc7356210cc | refs/heads/master | 2023-08-29T14:17:36.117465 | 2021-10-12T10:17:39 | 2021-10-12T10:17:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,011 | py | EntityModels.py | """
Copyright (c) 2018, Salesforce.com, Inc.
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 above copyright notice, this list of conditions and the foll... |
d625ac81a72abc582c7b38745b75e2e6d223af61 | 385c5299388ab9d92494b769572ceaf5f3dae221 | /系统学习Python/New_Start/Python_oop/Fan_27_from_import 导入模块.py | 52a18dd9103f7e9a959a10756d64b66d360c3a34 | [
"MIT"
] | permissive | MMSuperD/PythonStudy | 32c1aee122ebca1adf6cc389ce9362042cd84ba2 | 5de846983133ebf08f64df7219d5425ebb6b036d | refs/heads/master | 2020-04-16T13:32:54.511518 | 2020-03-19T09:01:51 | 2020-03-19T09:01:51 | 165,632,078 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 688 | py | Fan_27_from_import 导入模块.py |
# 语法 from 模块名字 import 导入的工具 as 工具别名
# from 模块名字 import * 可以导入这个模块的所有的工具,开发中少用.不推荐使用
# 如果从两个不同的模块中导入相同的工具,后导入的会覆盖前一个导入的模块
#from Fan_16_多继承使用 import C as MM
from Python_oop import Fan_16_多继承使用
c = Fan_16_多继承使用.C()
print(c)
print(Fan_16_多继承使用.__file__) # 查看导入模块的路径
# 为了让我们开发的模块能够被他人使用我们需要使用__name__ 这个内置的属性... |
534cfb6b0032d6a61f41a0c204b9e495b03a0602 | 319567bfe975d226f273258e65e61afb8d554e59 | /sample.py | 6171e0ee362b868ccdbaf658729d4683c6febb01 | [] | no_license | srinadhu/VariationalRecurrentNeuralNetwork | 6fc33edb883b69a4763bbb80e47d6d781d17a45e | 96894061259c09f38b7665bdc5fa83cb0d36adad | refs/heads/master | 2020-06-18T04:10:34.960045 | 2019-07-10T11:39:50 | 2019-07-10T11:39:50 | 196,160,051 | 2 | 1 | null | 2019-07-10T07:59:42 | 2019-07-10T07:59:42 | null | UTF-8 | Python | false | false | 370 | py | sample.py | import torch
import torch.nn as nn
import matplotlib.pyplot as plt
from model import VRNN
#hyperparameters
x_dim = 28
h_dim = 100
z_dim = 16
n_layers = 1
state_dict = torch.load('saves/vrnn_state_dict_41.pth')
model = VRNN(x_dim, h_dim, z_dim, n_layers)
model.load_state_dict(state_dict)
sample = model.sample(28*6)
... |
35ae686cf97179586b0de6d28a7c5bcb12bf9409 | 101fba2cf003048e37813059942d8844e560cdd4 | /gen_test_data.py | 4507392013604805abec499510bf43794f5dd352 | [] | no_license | michaelmez39/sorts | 849275a20890f078d700c8e2c48e14dd138a1ab4 | 236c268df3b5d989cfd2dacee4ecce81f22b9239 | refs/heads/master | 2021-05-17T03:30:26.969217 | 2020-03-27T17:27:21 | 2020-03-27T17:27:21 | 250,599,862 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 828 | py | gen_test_data.py | # Makes these files 10000, 20000, 50000 and 100000
# In random, ascending, descending
import random
def make_random_range(elements):
return [random.randint(0, (1 << 32) - 1) for i in range(0, int(elements))]
def make_ordered_range(elements):
return [i for i in range(0, int(elements))]
def make_rev_range(eleme... |
ded59d0e2b500a522ed545260042999b5e7fec2b | 1d83db8f46beb8ed6c21df13310fd3a680726714 | /nodes/ExampleNode/node/models.py | cdfa08bf1d795d4bda6037ca454c7aaf1bf674f9 | [] | no_license | xnx/VAMDC-VALD | def741a0dccc991c348c1095ca2f12524ebad0f7 | c081eb1b89aeecb9e1f039527a0be25e0fc504b4 | refs/heads/master | 2021-01-15T21:54:07.747545 | 2012-03-24T16:26:32 | 2012-03-24T16:26:32 | 853,278 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,258 | py | models.py | """
This module defines the database schema of the node.
Each model class defines a table in the database. The fields define the columns of this table.
"""
# library import
from django.db.models import *
from vamdctap import bibtextools
class Species(Model):
id = PositiveSmallIntegerField(primary_key=True, d... |
cc057fe4bbeb4ec0806e31732a24298bd2f43bf4 | b63cdfd553081e1d3e9e55ce34d0cd5c55ef766d | /apps/tasks_planning/migrations/0004_task_bot_user.py | db3d9fda1d763974939118e1c2cdd51b923eab1d | [] | no_license | RTS-1989/planning-tasks-api | ac36f8a21a72f81ef40cf63ad937d0ed11dac10b | d1d8d7d193fa9dc651f63e0e27b56b9a63cc7c6e | refs/heads/master | 2023-08-02T15:21:58.153003 | 2021-09-23T17:52:31 | 2021-09-23T17:52:31 | 369,988,661 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 601 | py | 0004_task_bot_user.py | # Generated by Django 3.1.7 on 2021-05-18 07:04
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bot_user', '0002_auto_20210508_1703'),
('tasks_planning', '0003_auto_20210424_0621'),
]
operations = [
... |
7dec6013e8b76d28869438267cc8bf8079724623 | 988020fa7466b2184873bab47d43d18f6798f59e | /tests/test_cube.py | 36950ba03b1d0560cc9e9c0fa1ee30529536379b | [] | no_license | jesus-a-martinez-v/awesome-cubes | 6c452299ec0ff6a35462aef7bd86e2921f481de0 | b41be05b0fba25383ec4662a711be5001a74d15c | refs/heads/master | 2021-01-16T21:05:30.779301 | 2018-09-06T12:34:19 | 2018-09-06T12:34:19 | 60,931,319 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,192 | py | test_cube.py | import os
from data.cube import Cube
def test_cube():
"""
Tests the update and query behaviors of the cube.
"""
parent_dir = os.path.dirname(os.path.abspath(__file__))
# Names of the files used to perform the test
input_filename = "%s/test_cube_input" % parent_dir
output_filename = "%s/te... |
6110b8e5c9c994f4e00433df9211ff5a8e377358 | 8d1ad2c86cd2064bec671c093fae66c0ef1249e2 | /3D Stiffness Map Rendering/main.py | 81a13bff340c72a8278fd609f588aa7bf13652b2 | [] | no_license | MinZhuUOTSickKids/3D-tissue-stiffness-mapping | 3ec72caa38e60a26d72ec4211d1a3ee139081aaa | d5ec899093af06b5bd2ef949ebd569c51ea19ef0 | refs/heads/master | 2020-04-17T19:47:46.389578 | 2019-05-31T21:58:04 | 2019-05-31T21:58:04 | 166,878,928 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,399 | py | main.py | #!/usr/bin/python3
import numpy as np
import glob
import pandas as pd
import plot
allXlsxFiles = glob.glob("./*.xlsx")
xlsxFileId = -1
if len(allXlsxFiles) < 1:
print("There are not .xlsx files in the current folder")
exit()
elif len(allXlsxFiles) == 1:
xlsxFileId = 0
else:
print("List of Excel files:")
for i in ... |
8aef385f38965ae2e356ee7eceaa6fe84d153e11 | 87dd8744ba102be397fd737df9db79af00e70ef1 | /iniciante/1078.py | 6bf068f4d97535a9f4e82c162c61c6879a1875a4 | [] | no_license | matheusgcdj/uri-solutions | d7e9e188076d8270201e1ce54552ab3e30790160 | c957158a93100f2798c5eddeb438e485e6dc338a | refs/heads/master | 2021-01-15T17:21:11.121792 | 2015-06-11T05:50:36 | 2015-06-11T05:50:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 239 | py | 1078.py | #
# Uian Sol Gorgonio <sol.uian@gmail.com>
# Feb 27 2015
# 1078 - Tabuaba
# https://www.urionlinejudge.com.br/judge/pt/problems/view/1078
#
# ad-hoc
#
n = int(raw_input())
for i in range(1, 11):
print '%d x %d = %d' % (i, n, i * n)
|
672aaa0c4858ea3d3fe50ddd5ec2c3e75c8682d0 | 7ff12769918ce52710297b46d67f0cfc58fb3126 | /src/bvh.py | a907aa26f4e0a75b5aad7f407a4ed83285e1dd98 | [] | no_license | zigengzhu/Ray_Tracer | f3f1a1cf3b330877b4838f329cec57f8a1091738 | 33ca747b29f7853ed22b7f4fbc65e88b905c5022 | refs/heads/master | 2023-04-26T12:25:15.561372 | 2021-05-10T04:37:54 | 2021-05-10T04:37:54 | 363,288,634 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,827 | py | bvh.py | from hittable import Hittable, HitRecord, surrounding_box
import rtxRay as ry
import rtxUtil as ru
from abc import ABC
from aabb import AABB
import numpy as np
empty = np.array([0.0, 0.0, 0.0])
def box_compare(a: Hittable, b: Hittable, axis: int):
box_a = AABB(empty, empty)
box_b = AABB(empty, empty)
fla... |
c494a7bbad479aad512cacc32dfd11bf0371a742 | add5cf61b75698bc902f1cdf0c7fb547dba3dfe0 | /obsolete/view_raw_images.py | c049330d89b12f95389a7723436c17382ba4f065 | [] | no_license | levlab-atomchip/BECy_stats | af74fb45cbc510fd540c6f2c5ab918b08444f126 | c12e6e9277288f02839bc04b867bdf3d36aa04f8 | refs/heads/master | 2016-09-06T10:16:50.242634 | 2015-02-06T03:46:53 | 2015-02-06T03:46:53 | 12,285,451 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,843 | py | view_raw_images.py | # import cloud_distribution as cd
import glob
from cloud_image import CloudImage as ci
import matplotlib.pyplot as plt
import scipy
import numpy as np
directory = r'C:\Users\LevLab\Desktop\raw_image_appearance'
filelist = glob.glob(directory + '\\*.mat')
imgno = 1
for f in filelist:
# print 'Image #%d'%imgno
i... |
fb43d8c16309b4fb91c9075291d5103935565fe6 | 2e0a751dcdd82ed51ac328552ee6b0632e28d552 | /working/DG_upwind_MMSFunctions.py | 8212d0c3a049184dff80792543c3985d1afcedc1 | [] | no_license | sparkinson/sediment_FEniCS | 671ffacda856e91aea6c2aedd6aac825c3df6c5e | 0e8e755515bed2d32e35738c90da1b0358518efd | refs/heads/master | 2020-04-25T10:39:47.636250 | 2013-09-03T22:56:53 | 2013-09-03T22:56:53 | 4,636,571 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 403 | py | DG_upwind_MMSFunctions.py | def u0_s():
return ' 0.6*sin(x[1]) + cos(x[0]) + 2.5 '
def u1_s():
return ' x[1]*sin(x[0]) '
def c_s():
return ' 0.6*sin(0.7*x[1]) + 0.4*cos(0.8*x[0]*x[1]/pi) + 0.9*cos(0.6*x[0]) + 0.9 '
def c_fs():
return ' (-0.32*x[0]*sin(0.8*x[0]*x[1]/pi)/pi + 0.42*cos(0.7*x[1]))*x[1]*sin(x[0]) + (0.6*sin(x[1]... |
e5b0150d13760bbde9b5162f194ea031d6956a2d | b2c54fc989e839348019dd52027f643ce669f121 | /code/breast/preprocess.py | 0ec4a79c51d3856c58635633740cfc3cc6e6fb9b | [
"MIT"
] | permissive | shalinkpatel/Deep-Forest | 195385aaf14350fb38e29af2cda4b40a04c14863 | c53aac1f59049a5045d5749f3873962cff6ad595 | refs/heads/main | 2023-01-31T20:14:49.073132 | 2020-12-08T23:36:58 | 2020-12-08T23:36:58 | 311,707,802 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,350 | py | preprocess.py | import numpy as np
from sklearn import datasets
import torch as th
def get_data(percent_train):
"""
Read and parse the train and test file line by line, then tokenize the sentences to build the train and test data separately.
Create a vocabulary dictionary that maps all the unique tokens from your train an... |
1305908e916b1fbf1b068f59c109c00818e09f98 | 250cc932b07e1c1e105dc341c9b07562b5eb3d58 | /pic2lmdb.py | b9b2a5e03ccb0008b90c77aa87066707fcfd8f51 | [] | no_license | ckhung/transfer-learning | a87841535f72babb12d2a68bc94919941fb13288 | 1689b42377e3e3820933148acaef4b52f3f049a2 | refs/heads/master | 2021-05-15T00:31:44.481169 | 2018-05-24T14:07:20 | 2018-05-24T14:07:20 | 103,202,886 | 7 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,667 | py | pic2lmdb.py | #!/usr/bin/python
'''
Title :create_lmdb.py
Description :This script divides the training images into 2 sets and stores them in lmdb databases for training and validation.
Author :Adil Moujahid/Chao-Kuei Hung
Date Created :20160619
Date Modified :20170911
usage :./pic2lmdb.py
pytho... |
45aebeb8f9d3d16fed60b92ea9c7ff935212f3bd | a40bc5f5468232300208b806828a1e1a12f726b5 | /42.py | f4dad6aeb040a421e63c92baba6eb9927f5a05f2 | [] | no_license | AmyYeh48/NLP100 | 1cfcdf4cfd20b5df9325fb4a072262022118e86b | 392ad32a6791d6bf88b10adb4abd1d0eca932697 | refs/heads/master | 2021-01-11T01:35:21.579846 | 2016-12-16T04:44:58 | 2016-12-16T04:44:58 | 70,684,962 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,757 | py | 42.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import fileinput
from collections import defaultdict
# 係り受け dependency
class Morph():
def __init__(self, surface, base, pos, pos1):
self.surface = surface
self.base = base
self.pos = pos
self.pos1 = pos1
def print_data(self):
... |
f81d57fb3ee0b260b4696cd79323f0e83eb22b95 | d93e128c7bb0e6571e85a4be8091d90ea0168dab | /window5.py | a53dd4b65ef55aef19bd50063382bdb5d5d6b3ee | [] | no_license | douglasdl/Python-tkinter | ea0e37d5ab6ced1dabfc0d970bbb86a06896aa8e | 8b257221bffe6282a4e44651f84c27a4bcc10be9 | refs/heads/main | 2023-08-20T14:27:56.620969 | 2021-10-12T01:15:58 | 2021-10-12T01:15:58 | 390,182,968 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 778 | py | window5.py | from tkinter import *
class Window1:
def __init__(self, master):
# keep `root` in `self.master`
self.master = master
self.title = "Window 1"
#self.minsize(200, 400)
self.label = Button(self.master, text="Example", command=self.load_new)
self.label.p... |
65328d1d00d96b53ef5e8fb1f200afd2841e6263 | 2430eb3f123995d73e0e89626fd85f25f9c9fed8 | /shared/task/task_service.py | 20d9d3e9c42ba5a872eb3c8c19181962758a00b7 | [
"MIT"
] | permissive | pietrot/timemebud | 1ca62b88b354485ddbfb3d47e996fc4b7d72e93d | 62534497c12218b459bd6ec5f3240005855245f3 | refs/heads/master | 2021-04-26T22:39:26.584745 | 2018-11-16T20:35:35 | 2018-11-16T20:35:35 | 124,127,645 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,280 | py | task_service.py | import time
from datetime import datetime
from shared.task.task import *
from shared.util.time_util import *
class TaskService:
""" Task Service
"""
def track(self, taskDescr):
print("(CTRL-C at any time to stop the timer and record your task)\n")
# Record start time
... |
359d9cfa8a6411ed698a6ec266650f90c3e196c7 | 174a10a913d2a91cadd5e8bacd6232c07d7addf9 | /algo/190304/swea_4864_문자열_kmp.py | 7c476477042d82c549393473ce6bc093793a3881 | [] | no_license | pjh6315/TIL | 7cf161ecd208ac75768bffe158963a297bdd9e64 | 6a7d45778c57aca7225485a1894bb93fb8ba6c23 | refs/heads/master | 2020-04-12T00:41:04.761991 | 2019-03-18T08:46:20 | 2019-03-18T08:46:20 | 162,208,481 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,018 | py | swea_4864_문자열_kmp.py | import sys
sys.stdin = open("4864.txt")
def kmp(target,pattern):
pi = [0 for i in range(len(pattern))]
pi[0] = -1
i = 0
j = 1
while j < len(pattern) - 1:
if pattern[i] != pattern[j]:
if pattern[0] == pattern[j]:
pi[j + 1] = pi[j]
else:
... |
07093a91979656a62b9676315a4eaa74b2f57052 | 0fcf45d3d2c1e1c4c1c64e584f6ce67023ba8944 | /shop/migrations/0003_order_total.py | a6b266ff6bb0f649b20976379172b297c7efe441 | [] | no_license | Aadil-Rashid/shopping_cart | ebb0fdacb47d717af64a7ddd5090b1e9250b243a | 6f799dbcd6ca5813b348715ef3477c2dd75cd481 | refs/heads/master | 2022-12-09T17:04:12.564046 | 2020-09-18T06:42:16 | 2020-09-18T06:42:16 | 296,518,299 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 403 | py | 0003_order_total.py | # Generated by Django 3.0.8 on 2020-09-03 10:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0002_order'),
]
operations = [
migrations.AddField(
model_name='order',
name='total',
field=mode... |
4f1f28d3935f578b813a2412620fdebae3487d0e | 70ecde635a902a07d42dcbfd06d2a8941e14b740 | /process3.py | ca1f0531ba386a6172b8965472e475e8e207beee | [] | no_license | DeekshithMedikurti/Virtual-Distributed-System | 0789730f360d6fa8585ff77cae20259bb978d9df | 9cc1a8d1423b73e49d8c87d7970d002d320b606e | refs/heads/master | 2020-04-09T03:18:25.668472 | 2018-12-12T07:35:46 | 2018-12-12T07:35:46 | 159,973,950 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,718 | py | process3.py | import socket
import time
import threading
class process3:
def __init__(self, serverport):
self.event = [0,0,0]
self.event1 = [0,0,1]
self.event2 = [0,0,2]
self.serverport = int(serverport)
self.sock = self.makeserversocket(self.serverport)
def makeserversoc... |
b53396a18d3644b300528ebda52c36d5152ce4ea | 667f2b4f95b527fe057a8239927e7766bc8288bd | /isSymmetric.py | d07e4cbf01e31a2391a1f1e768267e0c84a3ea86 | [] | no_license | devashishnyati/Trees-3 | e6a2455f587577b6ad717f0d99b58ed1e0e36131 | 828b175b116f7cbe5a465f588f0e8a7be1d24dfe | refs/heads/master | 2020-11-26T03:30:44.920852 | 2019-12-19T02:15:38 | 2019-12-19T02:15:38 | 228,953,727 | 0 | 1 | null | 2019-12-19T01:50:51 | 2019-12-19T01:50:50 | null | UTF-8 | Python | false | false | 786 | py | isSymmetric.py | # Time Complexity : O(n)
# Space Complexity : O(k) k:height of tree
# Did this code successfully run on Leetcode : Yes
# Any problem you faced while coding this : -
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# se... |
f37ddfa256b113ed409f532eddc0d208c32f404d | fbf80119087626ea84b7b757d13d85dc9e84531e | /main.py | 68ec1b2550dfba2317b3c00bc051b631ca40cfff | [] | no_license | amdonatusprince/Coronavirus-Tracker | c84b9423cc8cb3ef5cfc43b4d3bf65611525400f | c51e6271c7efb8cc935f5be561b3045ed6f2561f | refs/heads/main | 2023-06-22T04:48:19.118096 | 2021-07-02T16:30:58 | 2021-07-02T16:30:58 | 382,396,455 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,383 | py | main.py | from covid import Covid
from matplotlib import pyplot as py
covid = Covid()
countries_list = covid.list_countries()
countries = set([key['name'] for key in countries_list])
countries = sorted(countries)
def start():
print("Want data of specific country (press: 1)")
print("World data (press: 2)")
choice =... |
52661c2dbadbb99d281e739f56dcb7136c755f1d | b62f0d8d12c6f876590d6f45878b24a01b075c10 | /36_assgnmt.py | a6a1ddaae9c36ac51bd69e3d99724b0d32bbecbb | [] | no_license | NithyaSattu/Nithya_PythonTraining | 4f2046542a034701d6a06b93cd56c9090233ca16 | ed1958908629dcc8113a06165114e78922128d0b | refs/heads/master | 2021-01-22T18:01:48.695752 | 2017-05-16T05:58:12 | 2017-05-16T05:58:12 | 85,051,530 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 323 | py | 36_assgnmt.py | """
36.l=[1,2,3,[4,5,6],7,[8,9,10]] for single dimentional list
"""
l=[1,2,3,[4,5,6],7,[8,9,10]]
k=[]
for i in l:
if type(i) is list:
for j in i:
k.append(j)
else:
k.append(i)
print "Actual Multi dimensional list is ",l
print "Single dimensional list is",... |
2bc38ed67786c3b13e9650374401b16110721517 | 5b87c9d99dfee0799df24dae550b5322af3273c5 | /auctionhouse/views.py | d537a71e0308f05ac775a69b5e203a43c266bb7e | [] | no_license | cliveyg/poptape-auctionhouse | ed612999f192c4169121bc6b4475176e7ea7ed53 | a6295774de14880aa12fafcdaa81dde230666e7b | refs/heads/main | 2022-10-25T22:52:02.982633 | 2022-10-07T11:58:45 | 2022-10-07T11:58:45 | 193,140,545 | 3 | 0 | null | 2022-10-07T11:58:46 | 2019-06-21T18:02:45 | Python | UTF-8 | Python | false | false | 903 | py | views.py | # auctionhouse/auctionhouse/views.py
from rest_framework.permissions import IsAuthenticated
from rest_framework import status
from rest_framework.response import Response
from rest_framework.generics import RetrieveAPIView
from django.http import JsonResponse
from rest_framework.views import APIView
from django.conf im... |
d9c5708f4def764cbf1f15c5b98dcee9ea0d7070 | e62c405fcc561548fc4d555508d4da2d2a6a3912 | /src/utils/pythonSrc/watchFaceParser/models/elements/date/yearElement.py | bc23065b27b644333d42cf3ab63aeeda827dda5d | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | jobitjoseph/GTS-watchface-bundle | 515d5420af793bc2c9159137f14690a1e9e286fd | 4cb04be5215de16628418e9b38152a35d5372d3e | refs/heads/master | 2023-05-23T07:02:07.767457 | 2019-12-18T01:11:58 | 2019-12-18T01:11:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 913 | py | yearElement.py | import logging
from watchFaceParser.models.elements.basic.containerElement import ContainerElement
class YearElement(ContainerElement):
def __init__(self, parameter, parent = None, name = None):
self._oneLine = None
super(YearElement, self).__init__(parameters = None, parameter = parameter, par... |
93b488d6c24f0e0148b6e799e57fee58747623a8 | 8be9ec4d8d9f8a88e685f863f9fab75e76720b01 | /choose_your_own/your_algorithm.py | be4fd1fa2e00fe732718d8386c1958828559f751 | [] | no_license | Tejasri12/EnronData_MLproject | 15e53664fdc2472a13f190f26bf9bf12f137e269 | 2b04bed72b1c76a3e4bd85853fe45b625a6dee3d | refs/heads/master | 2020-04-02T05:41:51.917076 | 2018-10-23T20:30:41 | 2018-10-23T20:30:41 | 154,098,447 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,911 | py | your_algorithm.py | #!/usr/bin/python
import matplotlib.pyplot as plt
from prep_terrain_data import makeTerrainData
from class_vis import prettyPicture
features_train, labels_train, features_test, labels_test = makeTerrainData()
### the training data (features_train, labels_train) have both "fast" and "slow"
### points mixed together-... |
fb0b27f5580f08aff2d4bf2d8d1e9ed2a428e54a | 564921b87937da8bdf4daa3199b1fd57689716f7 | /eval.py | b36d97e5a7e75a6df97cf87126fc51549dea0aad | [
"MIT"
] | permissive | rebryk/mcc-benchmark | 9f8cbf8bddb123a6233a8c572e6dec008888a268 | 1f43f21c8a9d312822e0cc37d172d64a20df5203 | refs/heads/master | 2022-12-14T22:27:34.748587 | 2020-02-12T17:42:17 | 2020-02-12T17:42:17 | 156,213,629 | 0 | 0 | MIT | 2021-06-01T22:53:33 | 2018-11-05T12:21:49 | Python | UTF-8 | Python | false | false | 2,035 | py | eval.py | import argparse
from benchmark.experiment import Experiment
def get_config():
parser = argparse.ArgumentParser('Evaluate the given model on the specified dataset.')
parser.add_argument('--model', type=str, required=True, help='model to evaluate')
parser.add_argument('--params', type=str, default='', help... |
42e8c7a9f2410e0f3b4d91aed9fd595b562afcfd | 6fe1d325e3f9e0272716b893d93d17612f968f65 | /kokoa_sample.py | 6827517d28b9976bd755c157c4079fc697659a8d | [] | no_license | hyorard/kokoa | f2e458d551ad6f806bbe92ee401ded5e3e59ec23 | e37ca9e1ac5d40876aba27e49b3878e2c9503482 | refs/heads/master | 2020-04-22T14:23:15.481988 | 2019-02-13T04:42:34 | 2019-02-13T04:42:34 | 170,441,508 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,042 | py | kokoa_sample.py | import socket
import threading
import sys
class Server:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connections = []
nickname = {}
nick_cnt = -1
def __init__(self):
self.sock.bind(('0.0.0.0', 4967))
self.sock.listen(20)
def handler_all_chat(self,c,a):
... |
9e4fa9b0f4c10673f832c3df8748c2538d70ecdf | b00338bdaf7ec4f47de3dffcea4a7db7670f5f35 | /msdsl/expr/compression.py | 3303ad33cfe2fdd7db42e8421478cb3326a35969 | [
"MIT"
] | permissive | ryan-workFromHome/msdsl | 4b47e36be57ac5a8f3de1124268f6884fc69da5e | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | refs/heads/master | 2023-07-03T18:08:46.987989 | 2021-07-28T16:35:10 | 2021-07-28T16:35:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,271 | py | compression.py | import numpy as np
import numpy.ma as ma
def apply_compression(r):
# convert input to an array
# ref: https://stackoverflow.com/questions/29318459/python-function-that-handles-scalar-or-arrays
r = np.asarray(r)
scalar_input = False
if r.ndim == 0:
r = r[np.newaxis] # make 1D
scalar... |
4b7c9250547d4dfad30b26a2ec29b10113d27275 | 99cb92334718552c1bc5a02d89d8a610e3e319b3 | /Projects/python/pyh-pro/NFS-ADD-FOLDER.py | 13b42b2bf84788a0659be989bdc5b8369b972457 | [] | no_license | mindajalaj/academics | b9ccbc0b353f8d67a68576b28349bf67790d1986 | 95527e3ac03b37afa407fc179bac1c474c507143 | refs/heads/master | 2020-03-27T01:35:31.099826 | 2018-08-22T15:44:06 | 2018-08-22T15:44:35 | 145,725,513 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 241 | py | NFS-ADD-FOLDER.py | #!/usr/bin/python3
import os
y=input("Enter the Folder to be shared : ")
x=input("Enter cliet's IP address : ")
cmd='echo {} {} >> /etc/exports'.format( y, x )
os.system(cmd)
os.system("service nfs restart")
input("Enter to close.......")
|
cb77b3ed4d413f023ea22a656bda58c78c9bc1e9 | 8ee8b7e44c3f986c2fcd6f9f70f768fb7121bf77 | /menu.py | 39d26be33788447456a160c98301e601de22dbbd | [] | no_license | Pitabread8/Runaway-Trivia | ded2c7a7735a06d341b425610a2756c165198042 | eefacee5c61fb1d19c59bcb6bd5fd59a6fc2ec4a | refs/heads/main | 2023-02-12T10:33:31.880083 | 2021-01-12T20:17:53 | 2021-01-12T20:17:53 | 294,597,605 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 199 | py | menu.py | class Menu():
def __init__(self, lists):
self.lists = lists
def display(self):
print("Selection Options:")
for t in range(0, len(self.lists)):
print(f"[{t}] {self.lists[t]}") |
59a36befa28e6d55c7d0b83a1322b6f9f0d260e1 | f55aee6a17ba7ab4ef4ba88d2d416347bc3724ad | /src/community/urls.py | 944110c730a1bd124da0a7edb04dd97b336468ee | [] | no_license | guanghao479/mymd | 73abeaea6f7acda860b9e9518fc325d553fd1b9f | 0429b90fb20d97d25295dedf6cafd07525d16454 | refs/heads/master | 2021-05-27T21:23:38.577201 | 2013-10-23T07:47:04 | 2013-10-23T07:47:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 200 | py | urls.py | from django.conf.urls.defaults import patterns, url, include
from community.views import *
urlpatterns = patterns('community.views',
url(r"^$", "community_for_district", name='community_json'),
) |
036a9b9da3d00bcfae4515acfdaec9ec4dd7af8a | 4996af10a25966bd247dfc3bccdfea3951215732 | /enterprise_gateway/services/kernelspecs/remotekernelspec.py | 1881cc40dabd7869d0806e5509a810b8822f0b46 | [
"BSD-3-Clause"
] | permissive | adzafar/enterprise_gateway | a55c93ed3412ca8a4d5358bf4be86cdc90ce5bd9 | c826dc42093de5a3aa287059729a7aa745b3a5ed | refs/heads/master | 2020-04-08T10:44:51.005290 | 2018-11-19T20:53:15 | 2018-11-21T16:40:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,508 | py | remotekernelspec.py | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Kernel spec that knows about remote kernel types."""
import logging
from jupyter_client.kernelspec import KernelSpec, KernelSpecManager
#TODO - Remove this file once kernelspecs have been updated with metadata stan... |
a15cd750a67d9d3e3803c15229e48b048417aaf9 | 3256af0d6c19732bb84b256a9f792aaf7f3d901a | /f5/bigip/tm/security/test/functional/test_flowspec_route_injector.py | 300a4264fdb829c8cdc3d72edbb4229a4d7dca60 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | F5Networks/f5-common-python | 73e33ea489d989399d205077163f24ce584d83b9 | 3050df0079c2426af99b9a1b8f93d0b512468ff4 | refs/heads/development | 2023-08-29T10:11:23.713392 | 2022-09-21T02:45:03 | 2022-09-21T02:45:03 | 45,062,555 | 286 | 180 | Apache-2.0 | 2023-05-12T23:13:03 | 2015-10-27T18:48:06 | Python | UTF-8 | Python | false | false | 10,526 | py | test_flowspec_route_injector.py | # Copyright 2017 F5 Networks 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 law or agreed to in writi... |
0ae6aefef7826750b54f2d728723a50c375cb815 | a69a29aa9f59f3b4da722698c401343bfc85955d | /LaMobileDaemon/LaMobileDaemon.py | 86fb972074fa5f423c266802fd1f504f5b37ac79 | [] | no_license | CXuesong/LaMobileDaemon | e7cd5a72f74ddf69645d6d622ec1c3de2282c85f | cfc21dd58809b9cfc4e664d90f25ba9bdaa385f8 | refs/heads/master | 2021-01-15T12:02:12.003694 | 2017-08-06T15:42:26 | 2017-08-06T15:42:26 | 68,796,174 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,834 | py | LaMobileDaemon.py | #!/usr/bin/env python3
import Confidential
from weibo import APIClient
from datetime import datetime
import webbrowser
import logging
from Config import GetConfig, SetConfig, SaveConfig
import WikiPagesProvider
from io import BytesIO
from urllib import request
logging.getLogger().level = logging.INFO
logging.getLogg... |
0f38112542971aa66d265d7f9eff098aaf62cafc | 6e0d5c3139ec7f17973ab89b70593712ff823935 | /scripts/pyanchor-read/readcom_anchor.py | 58021c42e387e9083d67c2f28a1a59c847565526 | [] | no_license | dandanpan/multi-people-tracking | 9f9964b0f6a565fe020cd3ff79a6a5d7bf75ff14 | 031ec2c092b10927fe63a85111704b5628629ac2 | refs/heads/master | 2021-01-21T06:39:47.576027 | 2017-02-27T17:10:13 | 2017-02-27T17:10:13 | 83,268,745 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,824 | py | readcom_anchor.py | import string
import time
import serial
import thread
import Queue
import math
import struct
qr = Queue.Queue(0)
counter = 0;
def recive_data(com):
global qr
global counter
if tSerial.inWaiting() > 0:
comdata = com.read(com.inWaiting())
comdata = ''
bufferSize = 512
... |
c13a828938c75254d79e22e7b898562d30678c36 | f8329e77710b24b738cc2feab90a78394534d351 | /pn/__init__.py | aed021975646b985b89d7efe00469480d7fc11e7 | [] | no_license | oscar810429/pndfs | f477fde6a95be95f13c890224413dbbc18271a3e | 352ca8256dc01870d1328c38d4cd09ad45f066a5 | refs/heads/master | 2020-06-08T20:37:28.446976 | 2011-11-15T02:54:11 | 2011-11-15T02:54:11 | 562,709 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 61 | py | __init__.py |
__version__ = (0, 7, 0)
version = '%s.%s.%s' % __version__
|
adc5770734b9e84ccf130a21b6e7557c8638ef37 | 26c37b9963caa8d483e9ce3d092d951dce372d8a | /201601/agents.py | 979dc2c731d63dea2b67871a4b72ba5284dca3c2 | [
"MIT"
] | permissive | ryotaronaka/NikkeiRaspiMouse | 2395373c912d3bd212e67207a7d0abbb967114cf | 4a0073aba5523eb0fd7be2ce724375230e989085 | refs/heads/master | 2021-10-13T00:46:00.151491 | 2016-05-02T12:50:47 | 2016-05-02T12:50:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,850 | py | agents.py | #!/usr/bin/python
# vim:fileencoding=utf-8
import sys, time, threading
from sensors import Buttons
from actuators import StepMotorPair, Leds, Buzzer
class Agent:
def __init__(self):
self.state = "init"
self.motors = StepMotorPair("/tmp/motors")
self.buttons = Buttons("/tmp/button")
self.buzzer = Buzzer("/tmp/... |
85b86f011122510579438bf8a5b7fe94cbaa750f | 1c795ab8cc61c843b4cb92d84ba5803fea494015 | /src/jsbsim/middleware/hla/write_aircraft_ctrl.py | 93b4bc1bfbbbecb5d4abaabe4f139dbac199646a | [] | no_license | zhj149/morse-jsbsim | 17c1702d46bf9487e1508b35403fd972705cb068 | 2d9aa1e3bf9fd1b8c811f09fbccb227aa5a30410 | refs/heads/master | 2020-10-02T10:14:45.334197 | 2015-11-24T11:42:07 | 2015-11-24T11:42:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,240 | py | write_aircraft_ctrl.py | import logging; logger = logging.getLogger("morse." + __name__)
from morse.middleware.hla.message_buffer import MessageBufferWriter
from morse.middleware.hla.abstract_hla import AbstractHLAOutput
class AircraftCtrl(AbstractHLAOutput):
def initialize(self):
AbstractHLAOutput.initialize(self)
aircr... |
6e030c9ab10be0ac92afc74a2e01e2f7994f6fa7 | 8ae18bd4164b7a12a86faf266e3a5760f6c66111 | /Scripts/graphes.py | 2347863f289fa93277427ff24b9e5c34d486dddd | [] | no_license | Rafa-GB/LifeProject | bd4815556ffd50f8045d5575ac54ba1a9459307d | 4885c1a8a730f56425f8345143d286ee4e978d40 | refs/heads/master | 2020-12-24T06:58:46.582280 | 2016-11-10T14:34:31 | 2016-11-10T14:34:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,363 | py | graphes.py | ## Méthodes relatives aux Graphes
"""
Cette section va contenir toutes les methodes relatives aux graphes:
- trie des arretes
- extraire la liste des noeuds à partir d'un graphe
"""
def trieGraphe(graphe,ascendant=True):
"""
trie un graphe par valeur ascendante (par defaut) ou descendante des poids... |
32ba82208d0ec9c7e0a2f56b87e90d0ecab19af8 | caa6dced49f2d03d4fed4c0e9c6f09d0d374e7ce | /Python/1934.py | 14fc78625de5ed1873f704f2aaf771785cc2c18b | [] | no_license | hooong/baekjoon | 72e70cea5769467609150416be6f075f9d4c136a | 541f67859de0871ecfa134f8e5c6a8f399d17a1e | refs/heads/master | 2022-04-06T09:21:26.761766 | 2022-03-02T12:57:21 | 2022-03-02T12:57:21 | 180,535,683 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 335 | py | 1934.py | # 1934번 최소공배수
# main
T = int(input())
for _ in range(T):
a, b = map(int, input().split())
mul = a * b
# 최대공약수
while True:
if a == 0:
gcd = b
break
tmp = a
a = b % a
b = tmp
#최소공배수
lcm = mul // gcd
print(lcm)
|
3294e8d183ec29be6dd26a9d5b24563b6343d2b3 | a2c5648e483ad21b8a0d908a3a00a45e0b388ac1 | /BolsaTrabajo/apps/bolsa_trabajo/forms/offer_comment_form.py | de9fd44ffb10611b259022e721f8296c5f34b1b5 | [] | no_license | CarlosAvilesArredondo/BolsaTrabajo | c586246a1d40777871757d9c72ce13c50c13b4d8 | d7cf0592742e28a61fb2aa231fc4dcb54bae3de1 | refs/heads/master | 2021-01-01T18:21:29.044696 | 2017-07-25T15:18:58 | 2017-07-25T15:18:58 | 98,319,982 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 318 | py | offer_comment_form.py | #-*- coding: UTF-8 -*-
from django import forms
from django.core.exceptions import ValidationError
from bolsa_trabajo.models import *
class OfferCommentForm(forms.Form):
parent = forms.ModelChoiceField(queryset = OfferComment.objects.all(), required = False)
body = forms.CharField(widget = forms.Textarea())
|
64bd6437dab7965bd53440ef030f2de98c9d4f01 | a34062c3e219f76d1b5b016f8b5d77a24b1232c8 | /task.py | 635718311749ee455236a959e95ec5ae1adaf47f | [] | no_license | AlSayedGamal/box-game | b96b1832c24f505a1982727bc4381b47c3ee30ce | 4b145c3ee3966856fea207bece7193ed8c94fa02 | refs/heads/master | 2020-12-31T07:56:56.129888 | 2016-07-10T14:11:07 | 2016-07-10T14:11:07 | 63,001,799 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,220 | py | task.py | #!/usr/bin/python
from random import uniform
from math import ceil
import logging
def swap_list_items(i,j,listOfChars):
listOfChars[i], listOfChars[j] = listOfChars[j], listOfChars[i]
def shuffle(refString="aabbccddeeffgghhiijj"):
listOfChars = [c for c in refString]
index = 0
for c in listOfChars:
swap_list_it... |
3579a424695408e1663529498fcc2aecf9755e36 | 11b181a9f0577ee56f2eae62e86bde1ee74d59ff | /events/migrations/0004_auto_20160822_1856.py | df2d2014a078f00c0ef1d434e3971737591373b8 | [] | no_license | willkoua/codetributhon | 531f153dd9df6c567a4881439d6606f0fe22726f | 26789ba1afc106971787209e52758e6f91c8e0e3 | refs/heads/master | 2020-04-12T03:05:55.357327 | 2016-11-18T16:11:25 | 2016-11-18T16:11:25 | 63,183,876 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 857 | py | 0004_auto_20160822_1856.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-08-22 18:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0003_auto_20160822_1749'),
]
operations = [
migrations.RemoveField(
... |
b36d443e29bbe8d46b0e04bb3e7e6f12a23bfaf7 | 5f890ade5be03b8032ac7a4fd8009b04d3e59342 | /munshai/apps.py | 6edd832825dd58fc0d170649dc5e924df0062d7e | [] | no_license | stackoverflowed/djangoapp | c40791a96e3a88d666c8464712e1e556fada76a2 | 632f53701bf7a46380fed36b5d51c42b210b4dc7 | refs/heads/master | 2021-08-19T15:49:53.072625 | 2018-11-08T23:51:23 | 2018-11-08T23:51:23 | 156,274,099 | 0 | 0 | null | 2021-06-10T20:59:16 | 2018-11-05T19:51:05 | Python | UTF-8 | Python | false | false | 282 | py | apps.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
from material.frontend.apps import ModuleMixin
class MunshaiAppConfig(ModuleMixin, AppConfig):
name = 'munshai'
icon = '<i class="material-icons">settings_applications</i>'
|
9fa02a5e7d4747440547324ce75bba1b8c1e45b6 | 5313c5c16dc09c95feb26d0b9be8adab69557e18 | /nice/utils/AE.py | 380e9823fd158400bac623481d0dcfc3abb3933c | [
"Apache-2.0"
] | permissive | swaroop4learning/NICE | f6c4c222467e4101857196a51ba817f7c72a1227 | be183baf0c6d52e5125848db657ba813e5922190 | refs/heads/master | 2023-06-27T09:46:30.515954 | 2021-07-19T11:03:35 | 2021-07-19T11:03:35 | 387,432,818 | 0 | 0 | Apache-2.0 | 2021-07-19T11:03:35 | 2021-07-19T10:58:24 | null | UTF-8 | Python | false | false | 944 | py | AE.py | import tensorflow as tf
tf.get_logger().setLevel(40) # suppress deprecation messages
tf.compat.v1.disable_v2_behavior() # disable TF2 behaviour as alibi code still relies on TF1 constructs
from tensorflow.keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D, Input, UpSampling2D
from tensorflow.keras.models... |
deca7a872fc98a1419e8c3cf3c33ec40098451d6 | 4e968d3626afcad2d62d44c12f759f279a3b81f1 | /Sudoku Solver/view/sudoku_gui.py | a949cab3e39f1c292229308a7914affab2c95bd8 | [
"MIT"
] | permissive | keremkoseoglu/Python-Library | e05963fdb48872ffdc356bf1599131701511e79c | f66ab246da4eabea94596494cf2bc9b416b65b1d | refs/heads/master | 2021-08-19T22:47:04.393264 | 2021-06-05T08:23:13 | 2021-06-05T08:23:13 | 139,342,003 | 2 | 4 | MIT | 2021-06-05T08:23:14 | 2018-07-01T15:51:36 | Jupyter Notebook | UTF-8 | Python | false | false | 2,689 | py | sudoku_gui.py | import tkinter
from model.board import Board
from model.solver import Solver
from test import test_boards
class SudokuGUI:
_ENTRY_SIZE = 50
_BUTTON_WIDTH = 200
_BUTTON_HEIGHT = 50
def __init__(self):
self._window = tkinter.Tk()
self._inputs = [[0 for x in range(Board.BOARD_SIZE)] fo... |
3ce6a326e3ea3cfa737ef44f96e62d20f194ab09 | 74590f47a3d15e9e8fd46ac9df2c5d7c595278fe | /ebuy/api/order/models.py | 5e923303174eab43959ff1db2fdf577abc06df10 | [] | no_license | Swaniket/ebuy | e78b1fcdb15f818fd335dd6317f0a994d1685f81 | 9b0465079dbfb5ee047a44ceffef3be42ecac8b3 | refs/heads/main | 2023-04-06T14:11:16.284091 | 2021-04-08T13:24:14 | 2021-04-08T13:24:14 | 325,468,350 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 685 | py | models.py | from django.db import models
# To place order, there are 2 paameters, users & the products
from api.user.models import CustomUser
from api.product.models import Product
# Create your models here.
class Order(models.Model):
user = models.ForeignKey(CustomUser, on_delete = models.CASCADE, null = True, blank = True)
... |
a19da6bd05c8e50c5730e5982b5c5435c64164cf | c5c81cfdaf416dfb646c23783b8f2065d78f62e8 | /KMeans/k_means.py | 702eae2f271e465faa2988e15bb6b90a6f88408c | [] | no_license | guyraz89/Machine-Learning | cc8f5fff01d82eda6800789a59be594b9b03eea3 | 25c2d7f164f7a19696dae536eed8e119fe5ece33 | refs/heads/master | 2020-06-01T15:11:13.623033 | 2019-06-10T17:02:21 | 2019-06-10T17:02:21 | 190,828,650 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,193 | py | k_means.py | import numpy as np
import matplotlib.pyplot as plt
def readFile(path):
X = np.loadtxt(path)
return X
'''
--euclideanDistance--
Input:
inst1 - vector of size length
inst2 - vector of size length
length - the length of the two vectors.
Output:
the euclidean distan... |
893474abbe64fbd8c36e5af8962f0ee06220f826 | a57c8e0abe58f7324f531200dd77b3ff32f3564e | /home_crawler/lib/common/constants.py | 29a75a2ba7ca649fd2abef2d9fc9bf0001fa245e | [] | no_license | liebesu/home | ac4c129a7a138bbedda77315d53333e377185d96 | de1c8c8e47c22b7b62b3bdccbfc81ce8ced4de6a | refs/heads/master | 2020-04-15T14:01:11.910837 | 2017-11-30T03:18:09 | 2017-11-30T03:18:41 | 57,893,782 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 216 | py | constants.py | import os
_current_dir = os.path.abspath(os.path.dirname(__file__))
HOME_CRAWLER_ROOT = os.path.normpath(os.path.join(_current_dir, "..", ".."))
THIRD_ROOT=os.path.normpath(os.path.join(_current_dir,"..","third"))
|
fa5fbe79d6cb3518328a6c3776c3cc416c8f44c1 | eef09061c214f6dfb0875132a5ca5065fe8ffe04 | /seriesapp/admin.py | f2b8e191450e6e8bf7b5d257bf620f97152e5ed1 | [] | no_license | FrancoBRB/qevana-site | 45514f2c17e9d6b31418cf75da55777240cbf2a8 | ce1c9ab896956f968d3d57ab4bee1071a16365d3 | refs/heads/main | 2023-08-14T19:00:06.804847 | 2021-09-15T02:12:03 | 2021-09-15T02:12:03 | 402,879,864 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 109 | py | admin.py | from django.contrib import admin
from .models import *
admin.site.register(Serie)
admin.site.register(Caps)
|