seq_id stringlengths 4 11 | text stringlengths 113 2.92M | repo_name stringlengths 4 125 โ | sub_path stringlengths 3 214 | file_name stringlengths 3 160 | file_ext stringclasses 18
values | file_size_in_byte int64 113 2.92M | program_lang stringclasses 1
value | lang stringclasses 93
values | doc_type stringclasses 1
value | stars int64 0 179k โ | dataset stringclasses 3
values | pt stringclasses 78
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
45035468935 |
def parse(s):
x,s = parse_a(s)
assert(len(s) == 0)
return x
def parse_a(s):
if s[0] == '(':
x, s = parse_a(s[1:])
if s[0] == '+':
y, s = parse_a(s[1:])
assert(s[0] == ')')
return x+y, s[1:]
elif s[0] == '*':
y, s = parse_a(s[1:])
... | almostimplemented/codename | calculator.py | calculator.py | py | 917 | python | en | code | 0 | github-code | 13 |
5903439255 | from tensorflow import keras
from ray.tune import track
class TuneReporterCallback(keras.callbacks.Callback):
"""Tune Callback for Keras."""
def __init__(self, reporter=None, freq="batch", logs={}):
"""Initializer.
Args:
reporter (StatusReporter|tune.track.log|None): Tune object ... | zhuohan123/hoplite-rllib | python/ray/tune/integration/keras.py | keras.py | py | 1,692 | python | en | code | 2 | github-code | 13 |
17597189274 | # ํ๋ก๊ทธ๋จ ์ฌ์ฉ์๋ก๋ถํฐ ์์ฐ์๋ฅผ ์
๋ ฅ๋ฐ์ 0๋ถํฐ ์์ฐ์๊น์ง์ ํฉ๊ณ๋ฅผ ๊ตฌํ ๊ฒ.
# print("์๋ฌด ์์ฐ์๋ ์
๋ ฅํด์ฃผ์ธ์!")
# inputNum = int(input("0๋ถํฐ ์
๋ ฅ๋ ์์ฐ์๊น์ง ๋ํ ๊ฐ์ ์ถ๋ ฅํฉ๋๋ค. : "))
# count = 1
# totalSum1 = 0
# totalSum2 = 0
# ## while ์ฌ์ฉ
# while count <= inputNum :
# totalSum1 += count
# count += 1
# print("0๋ถํฐ" + str(inputNum)+"๊น์ง์ ์ด ํฉ์ " + str(totalSum1))
... | junkue20/Inflearn_Python_Study | 9๊ฐ_๋ฐ๋ณต๋ฌธ์์ /quiz.py | quiz.py | py | 1,173 | python | ko | code | 0 | github-code | 13 |
30698282913 | from django.contrib import admin
from django.urls import path,include
from . import views
urlpatterns = [
path('',views.studentinfo,name="studentinfo"),
path('removestudent/<int:id>',views.removestudent,name="removestudent"),
# path('filterbook',views.filterbook,name="filterbook"),
# path('modifybook',views.mo... | namansethi13/CollegeLibraryProject | Student_Details_App/urls.py | urls.py | py | 810 | python | en | code | 0 | github-code | 13 |
8815401830 | import json
import src.model_construction as mc
import src.data_management as dm
import pickle
import pandas as pd
class DataHandle:
"""
Data Handle for loading and performing operations on input data.
The Data Handle class allows data import and modifications of input data to an instance of t... | UU-ER/EHUB-Py_Training | src/data_management/data_handling.py | data_handling.py | py | 14,629 | python | en | code | 0 | github-code | 13 |
19253462626 | from urllib.request import urlopen
from bs4 import BeautifulSoup
from urllib.parse import quote
import csv
#makes = ["DS", "GAC", "SERES", "ืืืืจื", "ืืืื", "ืืืคื", "ืืืืืืื", "ืืืืืงื", "ืืื ืคืื ืืื", "ืืืกืืื", "ืืืคื_ืจืืืืื", "ืืกืืื ืืจืืื", "ื.ื.ืื", "ืืืืืืง", "ืื ืืื", "ื'ืืื", "ืืืค", "ื'ื ืกืืก", "ืืจืืื ืืื", "ืืืฆืื", "ืืื... | Chilledfish/icar-Project | icar_details.py | icar_details.py | py | 2,178 | python | en | code | 0 | github-code | 13 |
29158564384 | #!/usr/bin/env python3
#coding=utf-8
import rospy
from sensor_msgs.msg import Joy
from robot_msgs.msg import user_control_msg
def JoyCallBack(msg):
global control_info
if msg.buttons[1] ==1:
control_info.serial_port_status = 1 - control_info.serial_port_status
if msg.buttons[0] == 1:
contr... | sha236/ros_learn_note | src/ControllerReceiver/scripts/controler_receiver_node.py | controler_receiver_node.py | py | 755 | python | en | code | 0 | github-code | 13 |
43942460256 | from fields import *
class ModelCreator(type):
def __call__(cls, *args, **kwargs):
new_class = type.__call__(cls, *args)
for key, value in kwargs.iteritems():
if hasattr(new_class, key):
attr = getattr(new_class, key)
if issubclass(type(attr), ObjectFiel... | EdwOK/IGI_Labs | Lab2/build/lib/task14/model_creator.py | model_creator.py | py | 629 | python | en | code | 0 | github-code | 13 |
39024066946 | from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
def send_welcome_email(name,receiver):
#Creating message subject and sender
subject = 'Welcome to My Neighbourhood'
sender = 'alfred.kahenya@student.moringaschool.com'
#passing in the context variables
... | WaruiAlfred/Neighbourhood | home/email.py | email.py | py | 609 | python | en | code | 0 | github-code | 13 |
22336307433 | spell = input()
command = input()
while not command == 'Abracadabra':
cmd_info = command.split()
if cmd_info[0] == 'Abjuration':
spell = spell.upper()
print(spell)
elif cmd_info[0] == 'Necromancy':
spell = spell.lower()
print(spell)
elif cmd_info[0] == 'Illusion':
... | DimitarDimitr0v/Python-Fundamentals | Practical Exam Preparation/13. HOGWARDS.py | 13. HOGWARDS.py | py | 1,105 | python | en | code | 2 | github-code | 13 |
3998647560 | # SPDX-License-Identifier: GPL-2.0
"Print out the distribution of the working set sizes of the given trace"
import argparse
import sys
import tempfile
import _damo_dist
import _damo_fmt_str
import _damon_result
def get_wss_dists(records, acc_thres, sz_thres, do_sort):
wss_dists = {}
for record in records:
... | awslabs/damo | damo_wss.py | damo_wss.py | py | 5,602 | python | en | code | 119 | github-code | 13 |
333374614 | # This scirpt scrape the job title, company name, salay and job summary from the indeed.co.uk webiste for python devloper position.
# Results are appended to the lists and saved to csv file as pandas data frame.
import requests
from bs4 import BeautifulSoup
import pandas as pd
def extract(page):
headers = {'User... | gitmichu/Python | webscraping/webscraping_indeed.py | webscraping_indeed.py | py | 1,569 | python | en | code | 0 | github-code | 13 |
27706486433 | import tensorflow as tf
import numpy as np
import time
import os
import numpy
import json
import Utility
import DataHandlers
import HackathonDataNeuralNetwork
import NeuralNetwork as NN
import DataUtility
from DataUtility import Gesture
import MenuUtility
import ResultAnalyses
# Training Parameters
N_EPOCH = 5000
l... | Tonychausan/MyoArmbandPython | src/NeuralNetworkUtility.py | NeuralNetworkUtility.py | py | 24,716 | python | en | code | 3 | github-code | 13 |
7041723430 | from o3seespy.base_model import OpenSeesObject, OpenSeesMultiCallObject, opy
from o3seespy.opensees_instance import OpenSeesInstance
from o3seespy.exceptions import ModelError
def set_node_mass(osi, node, x_mass, y_mass, rot_mass):
op_type = 'mass'
parameters = [node.tag, x_mass, y_mass, rot_mass]
osi.to_... | o3seespy/o3seespy | o3seespy/command/common.py | common.py | py | 30,746 | python | en | code | 16 | github-code | 13 |
32122643205 | #-*-coding:utf-8-*-
import os
import io
import sys
import magic
from raids_h import rehis_zero_pic,rehis_zero
import numpy as np
from PIL import Image
import tensorflow as tf
import base64,time
from config import config_h
_MODEL_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data/models/1547856517')
_... | g37502/nsfw-master | nsfw_predict.py | nsfw_predict.py | py | 6,377 | python | en | code | 1 | github-code | 13 |
10385640905 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import shutil
import sys
from itertools import groupby
import gzip
import sys
_CSV_COLUMNS = [
'SVU_TYPE', 'SVV_VID', 'SVU_UID', 'SVA_UID',
'SVDWELL', 'SVSHARE', 'SVJOIN', 'SVCOMMENT', ... | alever520/tensorflow-ctr | python/calAuc.py | calAuc.py | py | 8,133 | python | en | code | 0 | github-code | 13 |
20524635580 | input = open("input.txt")
octo = {}
t = 0
for i in input:
i = i.strip()
for j in range(len(i)):
octo[(t,j)] = int(i[j])
t += 1
s = 0
while True:
for i in octo:
octo[i] += 1
flashed = []
f = True
while f:
f = False
for i in octo:
if octo[i] > 9 a... | Lesley55/AdventOfCode | 2021/11/part2.py | part2.py | py | 779 | python | en | code | 1 | github-code | 13 |
10868033225 | import os
from flask import request, jsonify
import flask.ext.restless
from werkzeug import secure_filename
from wand.image import Image
from .models import app, db, Artwork, ArtworkImage
manager = flask.ext.restless.APIManager(app, flask_sqlalchemy_db=db)
manager.create_api(Artwork,
methods=['G... | augustjd/maxsaunderspottery | sand/api.py | api.py | py | 2,153 | python | en | code | 0 | github-code | 13 |
12861554465 | # P.92 # ๊ทธ๋ฆฌ๋ # ์ฑ๊ณต!
# 2. ํฐ ์์ ๋ฒ์น
# ์ฒซ์งธ ์ค์ N(2 <= N <= 1000), M(1 <= M <= 10000), K(1 <= K <= 10000)์ ์์ฐ์๊ฐ
# ์ฃผ์ด์ง๋ฉฐ, ๊ฐ ์์ฐ์๋ ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถํ๋ค.
# ๋์งธ ์ค์ N๊ฐ์ ์์ฐ์๊ฐ ์ฃผ์ด์ง๋ค. ๊ฐ ์์ฐ์๋ ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถํ๋ค. ๋จ, ๊ฐ๊ฐ์ ์์ฐ์๋ 1 ์ด์
# 10000 ์ดํ์ ์๋ก ์ฃผ์ด์ง๋ค.
# ์
๋ ฅ์ผ๋ก ์ฃผ์ด์ง๋ K๋ ํญ์ M๋ณด๋ค ์๊ฑฐ๋ ๊ฐ๋ค.
n, m, k = map(int, input().split(' '))
# print(n, m, k) # ์
๋ ฅ ๊ฐ ํ
์คํธ
li = list(ma... | Nachtstolz/CTwithPython | 92.py | 92.py | py | 1,737 | python | ko | code | 0 | github-code | 13 |
26005045290 | import bgheatmaps as bgh
"""
This example shows how to use visualize a heatmap in 3D
"""
values = dict( # scalar values for each region
TH=1,
RSP=0.2,
AI=0.4,
SS=-3,
MO=2.6,
PVZ=-4,
LZ=-3,
VIS=2,
AUD=0.3,
RHP=-0.2,
STR=0.5,
CB=0.5,
FRP=-1.7,
HIP=3,
PA=-... | brainglobe/bg-heatmaps | examples/heatmap_3d.py | heatmap_3d.py | py | 565 | python | en | code | 20 | github-code | 13 |
32773348829 | import sys
sys.path.append("..")
import tkinter as tk
import tkinter.ttk as ttk
from Controller.ForumFunctions import *
from View.discussionFrame import *
class startDFrame:
def insertQuestion(self):
ques=self.questionT.get("1.0",'end-1c')
ans=self.answerT.get("1.0",'end-1c')
f=ForumFunction... | lovelotey1600/DicussionForum-2.0 | View/startDFrame.py | startDFrame.py | py | 3,195 | python | en | code | 0 | github-code | 13 |
17190071125 | import copy
import inspect
import json
import math
from itertools import permutations, product
from random import Random
from unittest import TestCase, mock
import numpy as np
from .client import ApiClient, ApiError, NetworksResult, Query, QueryFields, \
TextType
class TestTextType(TestCase):
def test_init... | agostbiro/aughie-py | aughie/nndb/test_client.py | test_client.py | py | 12,603 | python | en | code | 0 | github-code | 13 |
36588296066 | class Solution:
def isRectangleCover(self, rectangles: List[List[int]]) -> bool:
corners = set()
area = 0
for r in rectangles:
area += (r[3]-r[1])*(r[2]-r[0])
for p in [(r[0],r[1]), (r[2],r[3]), (r[0],r[3]), (r[2],r[1])]:
if p in corners:
... | ysonggit/leetcode_python | 0391_PerfectRectangle.py | 0391_PerfectRectangle.py | py | 583 | python | en | code | 1 | github-code | 13 |
28571945512 | import asyncore
from pysnmp.compat.pysnmp1x import session, error
class async_session(asyncore.dispatcher, session.session):
"""An asynchronous SNMP engine based on the asyncore.py classes.
Send SNMP requests and receive a responses asynchronously.
"""
def __init__(self, agent, community,\
... | ag1455/OpenPLi-PC | pre/python/lib/python2.7/dist-packages/pysnmp/compat/pysnmp1x/asynsnmp.py | asynsnmp.py | py | 3,188 | python | en | code | 19 | github-code | 13 |
17995538013 | # coding=utf-8
import json
import os
import requests
import logging
from subprocess import call
from flask import Flask, request
app = Flask(__name__)
logging.basicConfig(level=logging.DEBUG)
path = "/root/.jenkins/workspace/"
@app.route('/', methods=['post'])
def build():
json_payload = json.loads(request.dat... | Rayeee/ci-java-trigger | trigger.py | trigger.py | py | 1,923 | python | en | code | 0 | github-code | 13 |
17159230372 | # -*- coding: utf-8 -*-
import re
class Item(object):
def __init__(self, css, type_, use_parent=False, translate=False, sanitizer=None):
self.css = css
self.type = type_
self.use_parent = use_parent
self.translate = translate
self.sanitize = self.sanitize if sanitizer is No... | jiyonghong/html-schema | item.py | item.py | py | 5,990 | python | en | code | 0 | github-code | 13 |
19571875129 | from Arrow import Arrow
class Machine:
def __init__(self, name, fs_name):
self.alphabet = {"1", "=", "*"}
self.start_state, self.final_states, self.transitions, self.states = Machine\
.read_transitions(name, fs_name)
@classmethod
def read_transitions(cls, name, fs_name):
... | KanashinDmitry/GoMUN | Machine.py | Machine.py | py | 1,096 | python | en | code | 0 | github-code | 13 |
19199008855 | from core import LessonFactory
from pathlib import Path
import shutil
def setup(lesson_path):
for name in Path(__file__).parent.glob('*'):
if not name.is_dir():
shutil.copy(name, Path(lesson_path) / name.name)
else:
shutil.copytree(name, Path(lesson_path) / name.name)
les... | zawadm321/embsec-challenges | binary_exploitation/__init__.py | __init__.py | py | 376 | python | en | code | 1 | github-code | 13 |
73174678098 | import nltk
nltk.download('vader_lexicon')
from nltk.sentiment.vader import SentimentIntensityAnalyzer
analyzer = SentimentIntensityAnalyzer()
def Analyse(headlines):
sentimentScores = {'neg': 0, 'neu': 0, 'pos': 0, 'compound': 0}
for line in headlines:
scores = analyzer.polarity_scores(l... | lucyvjordan/News-Sentiment-Analysis-Comparison | analysis.py | analysis.py | py | 947 | python | en | code | 0 | github-code | 13 |
10041772824 | import numpy as np
from sklearn import preprocessing
import pandas as pd
X = pd.read_csv('train_weather.csv')
X_1 = X.select_dtypes(include=[object])
le = preprocessing.LabelEncoder()
X_2 = X_1.apply(le.fit_transform)
enc = preprocessing.OneHotEncoder()
enc.fit(X_2)
onehotlabels = enc.transform(X_2).toarray()
X=X.drop(... | Loielaine/545project | onehotenc.py | onehotenc.py | py | 485 | python | en | code | 0 | github-code | 13 |
73483329296 | import pandas as pd
import json
def proxy():
http = []
https = []
ftp = []
with open('') as source:
for line in source:
data = json.loads(line)
host = data['host']
http_proxy = "http://" + host + ":80"
https_proxy = "https://" + host + ":443"
... | MagnusXu/WebCrawler | CityRealty/proxy_logs_from_text.py | proxy_logs_from_text.py | py | 572 | python | en | code | 1 | github-code | 13 |
42147189140 | from test_services import logger
from test_services.atf import wsgw
from test_services.atf.common import (
Message,
Event,
Command,
)
from typing import (
Callable,
Type,
)
from test_services.config import settings
import asyncio
import threading
import queue
class M... | R4RPA/netbrain | src/netbrain_service/application/messagebus.py | messagebus.py | py | 8,454 | python | en | code | 0 | github-code | 13 |
17057136894 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi
from alipay.aop.api.domain.OpenApiInvoiceLinePreviewedOrder import OpenApiInvoiceLinePreviewedOrder
from alipay.aop.api.do... | alipay/alipay-sdk-python-all | alipay/aop/api/domain/OpenApiOutputInvoicePreviewedOrder.py | OpenApiOutputInvoicePreviewedOrder.py | py | 23,254 | python | en | code | 241 | github-code | 13 |
28301016588 | """
Plot the calculation steps for the eddy feedback parameter
2x2 plot showing seasonal means of
1. Zonal-mean zonal wind
2. Horizontal EP-Flux Divergence
3. Product of the anomalies (vs time) of the (1) and (2), such that the covariance is
the sum over time
4. (3) but normalised by the standard deviation of (1) a... | leosaffin/eddy_feedback | eddy_feedback/figures/fig1_efp_era5_calculation_steps.py | fig1_efp_era5_calculation_steps.py | py | 3,299 | python | en | code | 0 | github-code | 13 |
27609694768 | #[Exemplo 1] Escreva um programa que leia vรกrios nรบmeros inteiros e sรณ pare quando o usuรกrio digitar o valor 999.
#No final, mostre a soma entre eles
mumero = soma = 0
while True:
numero = int(input('Digite um nรบmero [999 to exit]: '))
if numero == 999:
break
soma += numero
print(f'A soma vale {som... | DIANAMOTTA/SENAC-TECH | Python/PythonAula08/exemplo001.py | exemplo001.py | py | 331 | python | pt | code | 0 | github-code | 13 |
10844223935 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Assigmnet in IPP course - DFA minimization
Author: Jakub Lukac
E-mail: xlukac09@stud.fit.vutbr.cz
Created: 06-04-2016
Testing: python3.4.4
"""
import sys
import argparse
from fsa import *
# Argument Parser with custom error function
class ArgumentPa... | cubolu/School-Projects | Python/IPP-MKA/mka.py | mka.py | py | 3,553 | python | en | code | 0 | github-code | 13 |
23026004791 | def solution(n):
# Your code here
currentLevel = n - 1
total = currentLevel
print('result: ', calculate(n, currentLevel, 0, 0))
def calculate(n, currentLevel, totalParam, levelParam):
level = levelParam + 1
print(level, currentLevel, totalParam, sep=' ')
count = 0
if totalParam == n... | xuanchuong/google-foobar | the-grandest-staircase-of-them-all/solution.py | solution.py | py | 1,238 | python | en | code | 0 | github-code | 13 |
19480904711 | import csv
filename = "allCountyData1.csv"
fields = []
rows = []
# reading csv file
with open(filename, 'r') as csvfile:
# creating a csv reader object
csvreader = csv.reader(csvfile)
# extracting each data row one by one
for row in csvreader:
rows.append(row)
# get total number of rows
... | ahmed-boutar/Understanding-the-Environmental-Factors-that-Contribute-to-Spread-of-COVID-19 | DatasetBuilding/SourceCombinations/weather.py | weather.py | py | 1,188 | python | en | code | 0 | github-code | 13 |
26186388762 | #!/usr/bin/env python
from functools import partial
import numpy as np
import recombination_utils as recomb
import vdj_recombination as vdj
def driver_function(n_trials=100, n_iterations=1000, sz_of_alphabet=256, sz_of_genome=10):
# need to set up a mutation operator
antigen = np.full(shape=(sz_of_genome,)... | gstqtfr/somatic_recombination | vdj_recombination_driver.py | vdj_recombination_driver.py | py | 813 | python | en | code | 0 | github-code | 13 |
17158732722 | import sys
@profile
def solve():
read = sys.stdin.readline
n = int(read())
table = [[] for _ in range(n)]
table[0].append(int(read()))
for i in range(1, n):
line = list(map(int, read().split()))
table[i].append(table[i - 1][0] + line[0])
for j in range(1, i):
ta... | jiyolla/study-for-coding-test | BOJwithDongbinNa/1932/1932_alt.py | 1932_alt.py | py | 476 | python | en | code | 0 | github-code | 13 |
36925802192 | import platform
from tools.Background_subtraction_KNN import BackgroundSubtractionKNN
if __name__ == '__main__':
window_size = (1980, 1080)
source_name = input("Video file name (stored in the video_files folder: ")
source_name = 'GX011307'
source_name = 'GH010731_cut_orig'
os_name = platform.syst... | RSantos94/vessel-impact-detection | tools/screencapture_tool.py | screencapture_tool.py | py | 448 | python | en | code | 1 | github-code | 13 |
22396749042 | import numpy as np
import pandas as pd
# pyburst
from pyburst.mcmc import burstfit, mcmc_versions, mcmc_tools, mcmc_plot
from pyburst.grids import grid_analyser
from pyburst.observations import obs_tools
from pyburst.plotting import plot_tools
"""
quick n dirty module for synthetic data in MCMC paper (2019)
"""
# ====... | zacjohnston/pyburst | pyburst/synth/synth_new.py | synth_new.py | py | 5,323 | python | en | code | 3 | github-code | 13 |
3938832720 | # In this file a nn created and trained with tensorflow will check if a given array is sorted or not.
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.models import Sequential, load_model
from tensorflow.keras.layers import Dense
from sklearn.metrics import accuracy_score
... | b2aff6009/ai-playground | tensorflow/sorted.py | sorted.py | py | 1,634 | python | en | code | 1 | github-code | 13 |
74449699217 | import tkinter as tk
from tkinter import ttk, NSEW
from StockData.data_keys import ASSET_TYPES
import tkinter.messagebox
HEIGHT = 700
WIDTH = 1400
def configButtonCommand(button, command):
button.config(command=command)
def throwError(title, message):
tk.messagebox.showerror(title, message)
class Gui(tk.... | LeviSforza/Cryptocurrency-Investment-Portfolio | Investment-Portfolio/investment_gui.py | investment_gui.py | py | 4,304 | python | en | code | 0 | github-code | 13 |
1165119927 | import pandas as pd
import torch
from sklearn.model_selection import train_test_split
from torch import optim
from torch.utils.data import DataLoader
import torch.nn as nn
from src.utils.data_util import MyDataset
from src.models.MLP import MLP
# ่ฏปๅๆๆๆฐๆฎ
all_data_path = '../../Data/processed/merged_data_KNN.csv'
all_d... | winter-fairy/SwC | src/run_model/Run_MLP.py | Run_MLP.py | py | 2,153 | python | en | code | 0 | github-code | 13 |
3387361118 | import os
import pandas as pd
import numpy as np
import torch
from . import config
from . import dispatcher
from . import model
TEST_DATA = os.environ.get("TEST_DATA")
MODEL = os.environ.get("MODEL")
def predict(model_path):
df = pd.read_csv(TEST_DATA)
df = df[["id", "excerpt"]]
test_idx = df["id"].valu... | RohanAwhad/kaggle-commonlit-readability | src/predict.py | predict.py | py | 1,131 | python | en | code | 0 | github-code | 13 |
24574360723 | # Exercรญcio 084 do curso de Python - Curso em vรญdeo
# Faรงa um programa que leia nome e peso de vรกrias pessoas,
# guardando tudo em uma lista. No final, mostre:
# A) Quantas pessoas foram cadastradas.
# B) Uma listagem com as pessoas mais pesadas.
# C) Uma listagem com as pessoas mais leves.
# Meu Cรณdigo
print('='... | felipecabraloliveira/Python | curso-de-python-curso-em-video/scripts/exercicios/ex084.py | ex084.py | py | 1,310 | python | pt | code | 0 | github-code | 13 |
69975975059 | """
In statistics, the mode of a set of values is the value that appears most often. Write
code that processes an array of survey data, where survey takers have responded to
a question with a number in the range 1โ10, to determine the mode of the data set.
For our purpose, if multiple modes exist, any may be chosen.
""... | chicocheco/tlp-python | find-mode-refactored.py | find-mode-refactored.py | py | 1,287 | python | en | code | 0 | github-code | 13 |
17040631054 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayFinanceFinassistantcoreBotchatQueryModel(object):
def __init__(self):
self._chat = None
self._question = None
self._session_id = None
self._user_type = None
... | alipay/alipay-sdk-python-all | alipay/aop/api/domain/AlipayFinanceFinassistantcoreBotchatQueryModel.py | AlipayFinanceFinassistantcoreBotchatQueryModel.py | py | 2,311 | python | en | code | 241 | github-code | 13 |
6155126224 | #-------------------------------------------------------------------------------------------------------------------
# Training - Processing EUMETSAT Data and Products (MTG) - Example 6: Lightning Imager (LI) Data - Flash Area
# Author: Diego Souza (INPE/CGCT/DISSM)
#-------------------------------------------------... | diegormsouza/spaceweek2023 | mtg/script_06_li.py | script_06_li.py | py | 6,224 | python | en | code | 2 | github-code | 13 |
600580298 | ds = [] # danh sรกch cรกc cแบงu thแปง vร phแปฅc vแปฅ
def chuc_nang_1():
while True:
chon = int(input("Bแบกn chแปn nhแบญp can bo (1) hay giao vien (2): "))
# nhแบญp thรดng tin chung
ma_so = input("Nhแบญp mรฃ sแป: ")
ho_ten = input("Nhแบญp hแป tรชn: ")
que_quan = input("Nhแบญp quรช quรกn: ")
... | thaicanhth/PYTHON | cau3/qlttAPP.py | qlttAPP.py | py | 3,050 | python | vi | code | 0 | github-code | 13 |
36374510899 | n,k=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
mod=mod = (10**9)+7
p = [[a[0],0]]
for i in range(1,n):
while p[0][1] + k < i:
p.pop(0)
temp = p[0][0]*a[i]
while p[-1][0]>temp and len(p) != 1:
p.pop(-1)
p.append([temp,i])
print(p[-1][0]%mod)
| k0malSharma/Competitive-programming | CHRL4.py | CHRL4.py | py | 309 | python | en | code | 1 | github-code | 13 |
19717436517 | class GolfClub():
"""
GolfClub class
Attributes:
hand: str
example: 'left'
brand: str
example: 'TaylorMade'
"""
def __init__(self, hand, brand):
self.hand = hand
self.brand = brand
@property
def choose(self):
print(f'Grab the... | ekselan/lambdata-abw | abw_helpers/golf_clubs.py | golf_clubs.py | py | 644 | python | en | code | 0 | github-code | 13 |
38457300085 | from bs4 import BeautifulSoup
from urllib.parse import urljoin
from find_xss import find_xss_vulnerability
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.edge.options import Options
def get_page(url):
edge_options = Options()
edge_options.use_chromium = True... | ahnaftazwar368/ivf | scraping.py | scraping.py | py | 1,634 | python | en | code | 0 | github-code | 13 |
18887999310 | # Basic requirements
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Train - test split
from sklearn.model_selection import train_test_split
# For XGBoost
from xgboost import XGBClassifier
from scipy.stats import uniform
from sklearn.model_selection import RandomizedSearchCV
# For flair
from... | nivii26/DSA4263-Voice-of-Customer-VOC-analysis | root/src/model/sa/sa_train.py | sa_train.py | py | 14,106 | python | en | code | 2 | github-code | 13 |
22544669558 | # ์ ํ์์ ํ๋ณํ๊ธฐ
import math
def solution(a, b):
gcd = math.gcd(a, b)
a //= gcd
b //= gcd
check_set = set([2, 5])
b_set = set()
while b != 1:
if b % 2 == 0:
b_set.add(2)
b //= 2
continue
elif b % 5 == 0:
b_set.add(5)
b //= ... | WeeYoungSeok/python_coding_study | programmers_100/problem_82.py | problem_82.py | py | 721 | python | ko | code | 0 | github-code | 13 |
39722694719 | # -*- coding: utf-8 -*-
# import matplotlib.pyplot as plt
import warnings
import numpy as np
from sklearn.linear_model import LinearRegression
from tabulate import tabulate
from helpers import *
from itertools import chain
warnings.filterwarnings(action="ignore", module="scipy",
message="^intern... | seltzerfish/senior-design | developer_tools/cross_validate.py | cross_validate.py | py | 1,908 | python | en | code | 0 | github-code | 13 |
15538306213 | from dummy_data.dummy_data import products_list
def product_search(query_vector):
# products list
products = products_list
# to track top 3 scores
score_list = [0, 0, 0] # top 3 items
response_product_list = []
# score each item with weight
for product in products:
score = 0
... | Lakith-Rambukkanage/dm_rasa_chatbot | actions/search.py | search.py | py | 1,288 | python | en | code | 0 | github-code | 13 |
12860497482 | import pytest
from src.core.services import UsersService
user_service = UsersService()
@pytest.mark.django_db
def test_create_offer(user, client):
data = {
"issue_year__gt": 2000,
"mileage__lt": 90019
}
client.credentials(HTTP_AUTHORIZATION='JWT ' + user_service.get_tokens_for_user(user)['a... | ChainHokesss/whitesnake_project | CarshowroomProject/src/customers/tests.py | tests.py | py | 433 | python | en | code | 0 | github-code | 13 |
14728890588 | import torch
import torch.nn as nn
import torchvision
import sys
import math
'''
The encoder of ASTER, which is composed of Resnet like conv network, and a multi-layer Bidirectional LSTM network
to enlarge the feature context, capturing long-range dependencies in both directions.
'''
def conv3x3(in_planes, ou... | wiikycheng/Attention-based-OCR | Models/encoder.py | encoder.py | py | 4,445 | python | en | code | 0 | github-code | 13 |
11032725877 | import pandas as pd
import os
import numpy as np
class Dls_Raw_Results():
def __init__(self, folder=None, folder_stack=None, column_selection=None):
self.folder = folder
self.files = []
self.dls_data = None
self.found = None
self.folder_stack = folder_stack
self.fi... | calvinp0/AL_Master_ChemEng | dls_file_search_rnd_choose.py | dls_file_search_rnd_choose.py | py | 11,382 | python | en | code | 0 | github-code | 13 |
4179130338 | import uuid
from .entities import Role, UserRole, AppRole
from .errors import RoleNotFoundError
from .repositories import IUserRoleRepository, IAppRoleRepository
class UserRoleUseCase:
user_role_repository: IUserRoleRepository
def __init__(self, user_role_repository: IUserRoleRepository):
self.user_... | KeepError/InnoID | Core/innoid_core/domain/modules/role/usecases.py | usecases.py | py | 2,383 | python | en | code | 0 | github-code | 13 |
41205420030 | import numpy as np
from LayerDense import LayerDense
from ActivationReLU import ActivationReLU
from ActivationSoftmax import ActivationSoftmax
from LossCategoricalCrossentropy import LossCategoricalCrossentropy
### TEST STUFF 1 ###
# from data_gen import data_gen
# X, y = data_gen().spiral_data(100, 3)
# layer1 = L... | bkstephen/ai_from_scratch | Python Version/main.py | main.py | py | 3,210 | python | en | code | 1 | github-code | 13 |
1070310682 | import argparse
import signal
import socket
import json
from happy_python.happy_log import HappyLogLevel
from common import hlog
__version__ = '0.0.1'
from miniim import LoginMessage
# noinspection PyUnusedLocal
def sigint_handler(sig, frame):
hlog.info('\n\nๆถๅฐ Ctrl+C ไฟกๅท๏ผ้ๅบ......')
exit(0)
def main():
... | geekcampchina/MiniIM | python/client.py | client.py | py | 2,896 | python | en | code | 0 | github-code | 13 |
29354159663 | from django.http import HttpResponse
from .models import Img
from django.template import loader
from django.shortcuts import redirect
from django.shortcuts import get_object_or_404
from .forms import ImgUpdateForm
from django.contrib.auth.models import User
import random
# Create your views here.
def index(request):
... | kirk5davis/ffpa-classifier | classifier/views.py | views.py | py | 6,603 | python | en | code | 1 | github-code | 13 |
71497028179 | # ์ธ์ด : Python
# ๋ ์ง : 2022.7.30
# ๋ฌธ์ : BOJ > ๊ฐ์ฅ ๊ธด ์ง์ ์ฐ์ํ ๋ถ๋ถ ์์ด (small)
# (https://www.acmicpc.net/problem/22857)
# ํฐ์ด : ์ค๋ฒ 3
# =================================================================
def solution():
# K๊ฐ๋ฅผ ์ญ์ ํ ๋ฌธ์์ด ์ค ์ต๋ ์ง์ ๋ฌธ์์ด์ ๊ธธ์ด
# == ํ์๋ฅผ K๊ฐ๋ง ํฌํจํ๊ณ ์๋ ์ต๋ ๋ฌธ์์ด์ ๊ธธ์ด
odd = 0 # ํ์ ๊ฐ์
size = 0 # ๋ถ๋ถ... | eunseo-kim/Algorithm | BOJ/์ฝ๋ฉํ
์คํธ ๋๋น ๋ฌธ์ ์ง with Baekjoon/DP/08_๊ฐ์ฅ ๊ธด ์ง์ ์ฐ์ํ ๋ถ๋ถ ์์ด(small).py | 08_๊ฐ์ฅ ๊ธด ์ง์ ์ฐ์ํ ๋ถ๋ถ ์์ด(small).py | py | 1,057 | python | ko | code | 1 | github-code | 13 |
12707952773 | import matplotlib.pyplot as mpl
from PySide2.QtWidgets import QDialog, QVBoxLayout
from matplotlib import gridspec
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
from seedpod_ground_risk.pathfindi... | aliaksei135/seedpod_ground_risk | seedpod_ground_risk/ui_resources/info_popups.py | info_popups.py | py | 2,905 | python | en | code | 4 | github-code | 13 |
74525527058 | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 22 11:01:27 2018
@author: Hugo
"""
def adigits(a,b,c):
d = [str(a) , str(b) , str(c)]
e = sorted(d)
h = list(reversed(e))
f = "".join(h)
f = int(f)
return f
print(adigits(1,2,3))
| Hugomguima/FEUP | 1st_Year/1st_Semestre/Fpro/Python/saved files/adigits_2.py | adigits_2.py | py | 277 | python | en | code | 0 | github-code | 13 |
21141796983 | import random
import discord
from discord import app_commands
from discord.ext import commands
import os
secret_code = os.getenv('RB_TOKEN')
bot = commands.Bot(command_prefix='!', intents=discord.Intents.all())
class db(discord.Client):
def __init__(self):
super().__init__(intents=discord.Intents.defaul... | RyBuck44/Roast_bot | r_bot.py | r_bot.py | py | 1,885 | python | en | code | 0 | github-code | 13 |
8242321430 | """\
Meshgrid motor explorer
"""
from __future__ import absolute_import, division, print_function
import random
import numbers
import collections
from .. import tools
from .. import meshgrid
from . import m_rand
defcfg = m_rand.defcfg._deepcopy()
defcfg._describe('res', instanceof=(numbers.Integral, collections.Iter... | benureau/explorers | explorers/algorithms/m_mesh.py | m_mesh.py | py | 1,392 | python | en | code | 0 | github-code | 13 |
19145970224 | import flax
import numpy as np
from jam.utils import checkpoint_utils
resnet_importer = checkpoint_utils.CheckpointTranslator()
def transpose_conv_weights(w):
return np.transpose(w, [2, 3, 1, 0])
@resnet_importer.add(r"layer(\d)\.(\d+)\.conv(\d)\.(weight|bias)")
def block(key, val, layer, block, conv, weight_... | ethanluoyc/jam | src/jam/flax/resnet/convert_torch_checkpoint.py | convert_torch_checkpoint.py | py | 3,492 | python | en | code | 0 | github-code | 13 |
16131405673 | #!/usr/bin/python3
"""
Purpose:
"""
import json
import shutil
import urllib3
# Pool Manager
http = urllib3.PoolManager()
# Download data
def download_data_from_url(url, filepath, chunk_size=1024):
r = http.request("GET", url, preload_content=False)
with open(filepath, "wb") as out:
while True:
... | udhayprakash/PythonMaterial | python3/16_Web_Services/c_REST/a_consuming_APIs/j_using_urllib3/d_sending_files.py | d_sending_files.py | py | 1,072 | python | en | code | 7 | github-code | 13 |
32309208155 | import argparse
def parameter_parser():
"""
A method to parse up command line parameters. By default it gives an embedding of the Bitcoin OTC dataset.
The default hyperparameters give a good quality representation without grid search.
Representations are sorted by node ID.
"""
parser = argpars... | 2742195759/SGCN_MF | src/parser.py | parser.py | py | 4,866 | python | en | code | 0 | github-code | 13 |
74405832976 | import math
import matplotlib.pyplot as plt
N = 30
x = []
y = []
s = 0
for i in range(1, N):
n = float(i)
an = math.factorial(2 * n) / ((3 ** n) * (math.factorial(n) ** 2))
print(an)
s += an
x.append(n)
y.append(s)
print(f"\n Sn = {s}")
print(f"For n = {N}")
plt.scatter(x, y)
plt.grid()
plt.show()
| LorenFiorini/Competitive-Programming | SCHOOL/Calculus/hw6/1B.py | 1B.py | py | 309 | python | en | code | 2 | github-code | 13 |
31014002643 | '''
fuzz.py
----------
The 'main' file.
Imeplements both fuzz and fals algorithms and provides an option to
randomly simulate a system.
Please type
./fuzz.py --help
for usage details.
'''
from __future__ import print_function
import matplotlib.pyplot as plt
import logging
import numpy as np
import argparse
impor... | shangfute/CPFuzz | cpfuzz.py | cpfuzz.py | py | 9,847 | python | en | code | 0 | github-code | 13 |
40864957494 | """
Implementation of Stack and all operations.
Using:
1. List
"""
# Using List
list1 = []
list1.append('1st')
list1.append('2nd')
list1.append('3rd')
list1.pop()
print(list1)
list1.pop()
print(list1)
# Using collections.deque collection
from collections import deque
stack = deque('abcd')
stack.append('e')
s... | kundan123456/100DaysCodeChallengeDS | Day3/stack.py | stack.py | py | 390 | python | en | code | 0 | github-code | 13 |
71544155859 | # import the necessary packages
import os
# name of the dataset we will be using
DATASET = "cityscapes"
# build the dataset URL
DATASET_URL = f"http://efrosgans.eecs.berkeley.edu/pix2pix/datasets/{DATASET}.tar.gz"
# define the batch size
TRAIN_BATCH_SIZE = 32
INFER_BATCH_SIZE = 8
# dataset specs
IMAGE_WIDTH = 256
I... | bashendixie/ml_toolset | ๆกไพ100 ไฝฟ็จPix2Pix่ฟ่กๅพๅ็ฟป่ฏ/config.py | config.py | py | 810 | python | en | code | 9 | github-code | 13 |
11354363791 | """
From Point-GNN
"""
import torch
from torch import nn
def multi_layer_fc_fn(Ks=[300, 64, 32, 64], num_classes=4, is_logits=False, num_layers=4):
assert len(Ks) == num_layers
linears = []
for i in range(1, len(Ks)):
linears += [
nn.Linear(Ks[i-1], Ks[i]),
nn.ReLU(... | datong-new/Point-HGNN | head/plain_head.py | plain_head.py | py | 1,847 | python | en | code | 0 | github-code | 13 |
3039573711 | #! python3
# WebComicDownloader.py - Downloads the most recent comics from xkcd once a day if new comics have been uploaded
import requests, os, bs4
def main():
downloadComics()
def downloadComics():
# Create folder for comics
os.makedirs('./xkcdComics', exist_ok=True)
# Check if we already have the ... | cjam3/AutomateTheBoringStuffPractice | Chapter 17/WebComicDownloader.py | WebComicDownloader.py | py | 2,241 | python | en | code | 0 | github-code | 13 |
26073616084 | import os
from numpy import *
import matplotlib.pyplot as plt
class Params():
def __init__(self,args):
self.dt = 1e-4 # timestep (s)
self.savetime = 1e-2 # (s)
self.t_f = 100.0 #100.0 # 3*self.dt # final time (s)
self.max_g = -9.81 # gravity (ms^-2)
self.max_q = 0.
s... | benjym/poly-mpm | inputs/bi_square_drum.py | bi_square_drum.py | py | 5,528 | python | en | code | 13 | github-code | 13 |
39399811440 | import re
from collections import Counter
def most_occr_element(word):
# re.findall will extract all the elements
# from the string and make a list
arr = re.findall(r'[0-9]+',word)
#Store Max Frequency
maxm = 0
#Max Elem of Most Frequency
max_elem = 0
# counter will store all the nu... | shank24/PythonCodingPractice | Code_Ground/geeksforgeeks/Regex/most_Occur_Number.py | most_Occur_Number.py | py | 636 | python | en | code | 0 | github-code | 13 |
16729066990 | import unittest
from jframework.modules.scan.synscan import Synscan
from jframework.modules.scan.ackscan import Ackscan
class ScanTest(unittest.TestCase):
def setUp(self):
self.syn_scan = Synscan()
self.ack_scan = Ackscan()
def test_default_value_syn(self):
self.assertEqual(self.syn_s... | Josue87/tfg-framework-python | framework/jframework/test/test_scan.py | test_scan.py | py | 658 | python | en | code | 0 | github-code | 13 |
9414892622 |
def run(wd, sampleGffDir, outputDir):
def sortGenomicFeatures(data):#{sample, {chr, [ [start, end] ] }}
for sample in data.keys():
for chr in data[sample].keys():
data[sample][chr].sort(key=lambda e: e[0])
sampleData={} #{sample, {chr, [ [start, end] ] }}
... | AntonS-bio/accessoryGenomeBuilder | groupGenesToMge.py | groupGenesToMge.py | py | 7,463 | python | en | code | 0 | github-code | 13 |
42658334759 | import unittest
import numpy as np
from PIL import Image
from operations import crop
class TestCrop(unittest.TestCase):
"""Test the crop operation"""
@classmethod
def setUpClass(cls):
# Load the test image
cls.img = np.array(Image.open('tests/tiny_test.png'))
def test_no_crop(self)... | CullenStClair/img-editor | tests/test_crop.py | test_crop.py | py | 1,134 | python | en | code | 1 | github-code | 13 |
38036565058 | import os
import os.path
import shutil
def installWebFiles(RTTLibDir, resultsBasePath):
webDir = os.path.join(RTTLibDir, 'web')
necessaryFiles = [os.path.join(webDir, f) for f in os.listdir(webDir) if os.path.isfile(os.path.join(webDir, f))]
for aFile in necessaryFiles:
if not os.path.exists(os.pa... | rushioda/PIXELVALID_athena | athena/Tools/RunTimeTester/src/installWebFiles.py | installWebFiles.py | py | 578 | python | en | code | 1 | github-code | 13 |
23913481336 | import socket
from colors import print_green, print_red, print_orange
def scan_port(ip, port, no_warnings):
try:
sock = socket.socket()
sock.connect((ip, port))
print_green(f"[+] {port} IS OPEN")
except:
if no_warnings:
return
print_red(f"[-] {port} IS CLOSE... | fadhilsaheer/scriptkiddie | tools/portscanner/scanner.py | scanner.py | py | 608 | python | en | code | 2 | github-code | 13 |
30816180147 | from time import sleep
from page_objects.basket_page import Basket
from page_objects.home_page import HomePage
from utilities.base_class import BaseClass
class TestForSale(BaseClass):
def test_sale(self, load_data):
loger = self.logger_object()
home_page = HomePage(self.driver)
try:
... | zGeorgi/for_sales | tests/test_for_sales.py | test_for_sales.py | py | 1,610 | python | en | code | 0 | github-code | 13 |
35466415428 | import os
import cv2
import pandas as pd
import torchvision
from torch.utils.data import Dataset, DataLoader
path_name = "../train_face_image"
# ่ฏปๅๅพ็ๆฐๆฎ
# image = []
# for dir_item in os.listdir(path_name):
# if dir_item is None:
# break
# else:
# image_path = os.path.relpath(os.p... | DirgeDos/RecognizeFace | face_check/src/face_dataset.py | face_dataset.py | py | 2,002 | python | en | code | 3 | github-code | 13 |
27620605490 | import requests
from lxml import etree
from bs4 import BeautifulSoup
import json
def discount_for_steam_balance(steam_price, buff_price):
return round(buff_price / (steam_price * 0.85), 3)
def discount_for_buff_balance(steam_price, buff_price):
return round(buff_price * 0.99 / steam_price, 3)
... | New-Heartbeat/spider-learn | buff้ฅฐๅไบคๆๆฐๆฎ็ฌๅ/prices_now.py | prices_now.py | py | 1,815 | python | en | code | 0 | github-code | 13 |
46976570344 | import FinanceDataReader as fdr
import pymysql
import numpy as np
import pandas as pd
import sqlalchemy
# ์ ๋ผ์ , 2018๋
df = fdr.DataReader('215600', '2021-05')
print(df.info())
from sqlalchemy import create_engine
conn = pymysql.connect(host='localhost', port=3306, user='root',
password='1234... | Deforeturn/AI-Stock-Prediction | ETC/test.py | test.py | py | 1,352 | python | en | code | 0 | github-code | 13 |
8488268133 | from django.core.management import BaseCommand
from theaters.models import Region, Theater
class Command(BaseCommand):
def handle(self, *args, **options):
regions_names = {
'์์ธ': [
'๊ฐ๋จ', '๊ฐ๋จ๋๋ก(์จํฐ)', '๊ฐ๋', '๊ตฐ์', '๋๋๋ฌธ', '๋ง๊ณก', '๋ชฉ๋', '์๋ด', '์์์๋์ปต๊ฒฝ๊ธฐ์ฅ', '์ฑ์', '์ผํธ๋ด', '์กํํํฌํ๋น์ค', '์ ์ด',... | OmegaBox/OmegaBox_Server | app/theaters/management/commands/theater_datas.py | theater_datas.py | py | 2,647 | python | ko | code | 1 | github-code | 13 |
36562472156 | import xml.etree.cElementTree as ET
import os
import re
import configparser
import pyodbc
from hebrew_numbers import int_to_gematria
config = configparser.ConfigParser()
config.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'settings.ini'))
current_dir_path = config.get('XML','current_dir')
tanakh_dir_... | mdanielov/limud-kodesh | database/DB_Table_creation/Tanakh_sefaria_word_to_DB/xml_tanakh_parser.py | xml_tanakh_parser.py | py | 4,554 | python | en | code | 3 | github-code | 13 |
19880297275 | from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name="index"),
path('customers',views.customers,name="customers"),
path('transactions',views.transactions,name="transactions"),
path('sender_Profile',views.sender_Profile,name="sender_Profile"),
path('history',view... | Keyur3766/DjangoProjects | Banking_System/home/urls.py | urls.py | py | 459 | python | en | code | 0 | github-code | 13 |
16978526939 | import numpy as nump
import pdb
from newTree import *
def breadth_search():
################ SETTING VALUES ####################################################################################
m = 3 # missionaries
c = 3 # cannibals
b = 2 # boat capacity
print("MISSIONARIES AND CANN... | NotEnoughMilk/CSC375--Artificial-Intelligence | Missionaries and Cannibals/otherOtherMain.py | otherOtherMain.py | py | 2,319 | python | en | code | 0 | github-code | 13 |
72489888017 | # 1 disc:
# 1 1 -> 2
# 2 discs:
# 1 0 -> 1
# 2 0 -> 2
# 3 1 -> 2
# 3 discs:
# 1 1 -> 2
# 2 1 -> 0
# 3 2 -> 0
# 4 1 -> 2
# 5 0 -> 1
# 6 0 -> 2
# 7 1 -> 2
# 4 discs:
# 1 0 -> 1
# 2 0 -> 2
# 3 1 -> 2
# 4 0 -> 1
# 5 2 -> 0
# 6 2 -> 1
# 7 0 -> 1
# 8 0 -> 2 # 3 discs:
# 9 1 -> 2 # 1 1 -> ... | ldnicolasmay/RunestonePythonDS3 | src/Chapter05/towers_of_hanoi.py | towers_of_hanoi.py | py | 2,077 | python | en | code | 0 | github-code | 13 |
42648376482 | """Represents the snake AI with personality D.Va"""
import random
from .Graph import Graph
from .a_star import a_star_search, alt_a_star_search
import time
class DVA(object):
"""Represents the Battlesnake D.Va"""
# In case server is started after game has begun
INIT = False
NAME = 'D.Va'
IMAGE_UR... | dlsteuer/battlesnake | snake/DVA.py | DVA.py | py | 7,768 | python | en | code | 0 | github-code | 13 |
17159071662 | import sys
def solve():
read = sys.stdin.readline
"""
def find(v):
while v != parent[v]:
parent[v] = parent[parent[v]]
v = parent[v]
return v
def union(v1, v2):
root_v1 = find(v1)
root_v2 = find(v2)
if root_v1 == root_v2:
re... | jiyolla/study-for-coding-test | BOJwithDongbinNa/9372/9372.py | 9372.py | py | 1,255 | python | en | code | 0 | github-code | 13 |
71544480659 | from sklearn import svm
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import pickle
from sklearn.ensemble import ExtraTreesClassifier
# data = pd.read_csv('data/train_for_duplicated_data.csv')
# data.drop_duplicates(keep='first', inplace=True)
# # ่ทๅๆ ็ญพๅ
# labels = data['ta... | bashendixie/ml_toolset | ๆกไพ49 (ๆบๅจๅญฆไน )kaggle_tabular_Feb_2022/extra_trees_v2.py | extra_trees_v2.py | py | 1,466 | python | en | code | 9 | github-code | 13 |
37865204092 | import numpy as np
from typing import Tuple
from matplotlib import pyplot as plt
def _array(mask, fill):
zero = np.zeros(mask.shape, dtype=np.uint8)
zero[mask] = fill
return zero
def colored(data, color: Tuple[int, int, int]):
r, g, b = color
data = data.astype(bool)
return np.dstack([_array... | unnamed42/metastasis-analyzer | jupyter/plot.py | plot.py | py | 1,820 | python | en | code | 0 | github-code | 13 |
27237347657 | #!/usr/bin/env python3
from graph.load_xml import load_graph
from graph.save_xml_v4 import save_graph
from lxml import etree
import sys
import os
source=sys.stdin
sourcePath="[XML-file]"
dest=sys.stdout
if len(sys.argv) < 2:
raise RuntimeError("This converts exactly one XML file. Please provide one path to an ... | joshjennings98/fyp | graph_schema-4.2.0/tools/convert_v3_graph_to_v4.py | convert_v3_graph_to_v4.py | py | 631 | python | en | code | 0 | github-code | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.