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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
41936261526 | # The name that the server expects to be referred to by.
chocolate_server_name = "ca.theobroma.info"
# Where is a form located through which payments can be submitted
# if required by policy? (note: this address should expect to be
# called followed by a slash and then the 64 hex digit session ID)
payment_uri = "https... | pbullian/lets-encrypt-preview | attic/server-ca/CONFIG.py | CONFIG.py | py | 1,300 | python | en | code | null | github-code | 36 |
29748242745 | #server
import os
import tkinter as tk
import sqlite3
import random
from tkinter import ttk
from tkinter import messagebox as mbox
import PIL
from PIL import Image
from tkinter import *
from PIL import Image, ImageTk
from PIL import ImageGrab
import socket
#from gtts import gTTS
#import pyttsx3
from fu... | shetyeanuja/python-mini-projects | Client Server Chat/server.py | server.py | py | 3,275 | python | en | code | 0 | github-code | 36 |
19294805910 | import discord
from discord.ext import commands
from cogs.errors import WegbotException
@commands.command(hidden=False, name="pin", brief="Pin a message.", rest_is_raw=True)
@commands.guild_only()
async def pin_that(self, ctx, message_id: int, *, addition=None):
""" Pins the message with the given ID.
You ma... | ChaoticWeg/wegbot2-discord | cogs/messaging/pin.py | pin.py | py | 1,566 | python | en | code | 1 | github-code | 36 |
36748147361 | import string
import requests
from fudge import __version__
from fudge.utils import FudgeException
def get_repository_name(repo_url):
repo_url = repo_url.rstrip('/')
repo_name = repo_url.split('/')[-1].rstrip('.git')
whitelist = set([char for char in string.ascii_letters + string.digits + '-_'])
if... | QuantamKawts/fudge | fudge/protocol.py | protocol.py | py | 3,209 | python | en | code | 0 | github-code | 36 |
28418721166 | # Implementation of Selenium WebDriver with Python using PyTest
import pytest
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import sys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Ke... | syedsair/rateer-automated-tests | UI/rate.py | rate.py | py | 4,624 | python | en | code | 0 | github-code | 36 |
31454265122 | import argparse
import subprocess
import os
# Create argument parser
parser = argparse.ArgumentParser(description='Create and build base UFS case')
parser.add_argument("--project", default=None, help='Project to charge', required=True)
parser.add_argument("--tag", default=None, help='Model tag', required=True)
parser.... | benjamin-cash/ufs_utils | ufs_cold_start.py | ufs_cold_start.py | py | 2,759 | python | en | code | 0 | github-code | 36 |
16445576901 | """ Author: Daniel J. Sawtelle
*** Purpose: Bombard the given URL with randomized form return data
***
*** Source: https://www.youtube.com/watch?v=UtNYzv8gLbs
"""
import os
import random
import string
import json
import time
import requests
""" Function - Return a string object of a date formatted as specified
*** s... | DSawtelle/ScammerSpammer | scammerSpammer.py | scammerSpammer.py | py | 7,010 | python | en | code | 0 | github-code | 36 |
40631353290 | import json
from odata import ODataHandler
def test_service_endpoint(service, endpoint="", urlparams={}, sap_client = '100', print_result=False):
"""Simple test function for odata service"""
odatahandler = ODataHandler()
slash = "" if endpoint == "" else "/"
service_endpoint = "/%s%s%s" % (service, sl... | asumansuenbuel/ewm-access | src/test_ewm_connection.py | test_ewm_connection.py | py | 1,617 | python | en | code | 0 | github-code | 36 |
34948989285 | import torch
import os
import logging
import datetime
import argparse
import json
import pandas as pd
import numpy as np
from tqdm import tqdm
from generative_utils import load_model, load_context, process_outputs
def inference(model, tokenizer, question, context, no_ans_threshold, ans_threshold, max_length=4096, s... | Kreik2809/Open-Book-Question-Answering | inference/src/generative_inference.py | generative_inference.py | py | 12,340 | python | en | code | 0 | github-code | 36 |
29393480332 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def generateTrees(self, n: int) -> List[Optional[TreeNode]]:
def recursion(start, end):
... | AnotherPianist/LeetCode | unique-binary-search-trees-ii/unique-binary-search-trees-ii.py | unique-binary-search-trees-ii.py | py | 772 | python | en | code | 1 | github-code | 36 |
586765290 | import os
import sys
import argparse
import numpy as np
import pdb
sys.path.append("../datasets")
from trainDataset import volume_loader
def parse_args():
parser = argparse.ArgumentParser(description="Deep Learning Model")
parser.add_argument("--root", required=True, type=str,
help="roo... | trainsn/TSR-TVD | eval/lerp.py | lerp.py | py | 1,736 | python | en | code | 1 | github-code | 36 |
7814426661 | from django.core.cache import cache
from kavenegar import *
from redis.exceptions import ConnectionError as RedisServerConnectionError
KEY_KAVENEGAR = '4442494F6A77766776746B3444575466373961693741335956544F6B45683669556B6C7731493538534A413D'
SENDER = '1000596446'
def send_smd(code, phone):
api = KavenegarAPI(KEY... | atefesharifi/login-register-and-dashboard | common/utilities.py | utilities.py | py | 683 | python | en | code | 0 | github-code | 36 |
20883522665 | from unittest import result
from django.shortcuts import render
from django.http import Http404, HttpResponseRedirect
from results.models import WeatherStation
from .apps import ResultsConfig
import pmdarima as pm
import pandas as pd
import numpy as np
from datetime import date
# Create your views here.
def results(re... | shaner13/Ivy | results/views.py | views.py | py | 9,431 | python | en | code | 0 | github-code | 36 |
21920270118 | from psychopy import visual, core, monitors
import PhotodiodeMarker as pdm
class Moving_Dots():
def __init__(self,cur_screen=0, cur_monitor="testMonitor", win_dim = [800,600], dot_size=20, num_dots=10, pres_time=20, dot_life=20, dot_speed=0.5, dot_coherence=0.5, dot_dir=90): # pres_time is time in seconds
self.m... | brainhack-school2020/catboucher_dfconvert | movingdots.py | movingdots.py | py | 1,508 | python | en | code | 0 | github-code | 36 |
2920768004 | from flask_smorest import Blueprint
from flask.views import MethodView
from src.contextmanager import DatabaseContextManager
from src.models import Chama
import uuid
from src.schema import (
ChamaSchema,
ChamaDisplaySchema,
ChamaCreateSchema
)
chama_router = Blueprint('chama endpoints', __name__)
@chama_r... | kenreagan/ChamaYetuBackend | src/Chama/__init__.py | __init__.py | py | 1,904 | python | en | code | 0 | github-code | 36 |
43057319028 | import os
import random
import shutil
from paths import det_dir, data_name, data_train_name, data_validation_name
from model_configs import suffixes
def add_suffix_to_path(path, suffix):
# Check if the path already ends with a slash
if path.endswith('/'):
new_path = path.rstrip('/') + suffix + '/'
... | Frankalexej/slprt | random_split.py | random_split.py | py | 2,306 | python | en | code | 0 | github-code | 36 |
70806707943 | import datetime
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from .models import *
from .functions import method
from django.http import JsonResponse
# Create your views here.
def index(request):
current_time = datetime.datetime.now()
formatted_time = c... | umleeho1/sugangapply | sugang/views.py | views.py | py | 2,242 | python | en | code | 0 | github-code | 36 |
33677649557 | from fastapi.routing import APIRouter
from typing import Annotated
from fastapi import Depends
from app.main.factories import (
make_db_list_videos,
make_db_list_my_videos,
make_db_list_friends_videos
)
from app.schemas.video import VideosListOut
from app.infra.auth import JwtBearer
from app.main.config imp... | Mauricio-Silva/backend-user | app/main/routes/video.py | video.py | py | 1,610 | python | en | code | 0 | github-code | 36 |
298929817 | # Write a script that takes in two numbers from the user and calculates the quotient.
# Use a try/except statement so that your script can handle:
#
# - if the user enters a string instead of a number
# - if the user enters a zero as the divisor
#
# Test it and make sure it does not crash when you enter incorrect value... | symonkipkemei/cnd-labs | python-301/resources/05_exceptions/05_02_calculator.py | 05_02_calculator.py | py | 759 | python | en | code | 0 | github-code | 36 |
14950275682 | from flask import Flask, render_template, render_template, request, redirect, session
from . import auth, queries, uploads
from .utils import Settings
app = Flask(__name__)
app.secret_key = Settings().secret_key
API_BASE_URL = "http://app:8080" # Replace with the actual base URL of your API
# Register blueprints
ap... | talhaanwarch/openai-chatbot | frontend/app.py | app.py | py | 551 | python | en | code | 3 | github-code | 36 |
18994725718 | # ะะฐะดะฐัะฐ 1:
# ะะฐะฟะธัะธัะต ะฟัะพะณัะฐะผะผั, ะบะพัะพัะฐั ะฝะฐ ะฒั
ะพะด ะฟัะธะฝะธะผะฐะตั ะดะฒะฐ ัะธัะปะฐ A ะธ B, ะธ ะฒะพะทะฒะพะดะธั ัะธัะปะพ ะ ะฒ ัะตะปัั ััะตะฟะตะฝั B ั ะฟะพะผะพััั ัะตะบัััะธะธ.
# A = 3; B = 5 -> 243 (3โต)
# A = 2; B = 3 -> 8
def production(number, power):
if power == 1:
return number
else:
return (number * production(number, power -... | kuha1088/GB_IntroPython_GU4025Sudakov | HomeWork/Seminar5/Task1/Task1.py | Task1.py | py | 830 | python | ru | code | 2 | github-code | 36 |
2583396106 | import yaml
def get_latest_jdk(distroJdks):
latest = None
latestInt = 0
for jdk in distroJdks:
if jdk == "latest":
latest = jdk
latestInt = 999
elif int(jdk) > latestInt:
latest = jdk
latestInt = int(jdk)
return latest
def get_lts_jdk(jdk... | basicimg/images | basicimg-actions-generator/jdk.py | jdk.py | py | 2,187 | python | en | code | 0 | github-code | 36 |
39279700922 | from plot_model import plot_results
import glob
from astropy.io import fits
import tensorflow as tf
import numpy as np
import time
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape = shape)
return t... | grd349/LearningLAMOST | Matt/ClassifierNN/Old_Models/model_LAMOST_conv.py | model_LAMOST_conv.py | py | 3,910 | python | en | code | 1 | github-code | 36 |
30132799933 | from collections import defaultdict
from typing import Tuple, Union
import cv2
import distinctipy
import matplotlib.pylab as plt
import numpy as np
from PIL import Image
def preprocess_image_draw(image: Union[Image.Image, np.ndarray]):
image = np.array(image) # Convert if PIL, copy if numpy
if len(image.sh... | Radio-Memory/radiomemory-ai-api-demo | vis.py | vis.py | py | 10,117 | python | en | code | 0 | github-code | 36 |
22995979758 |
from time import sleep
import pytest #ๆพๅฐๆต่ฏ็จไพ,ๆง่ก
import requests #ๅ้่ฏทๆฑ็ๅ
from common.send_request import SendRequest #ๅฏผๅ
ฅๅ
ฌๅ
ฑ็่ฏทๆฑ็ฑป
from common.yaml_util import write_yaml, read_yaml #yamlๆไปถ็ๆไฝ
# scope="function"-ไธบๅฝๆฐ็บงๅซ scope="class"-็ฑป็บงๅซ scope="session"-่กจ็คบๅ่ฏ autouse=False-ไธ่ชๅจๆง่ก params-ๆฐๆฎ้ฉฑๅจ ids-ๆฐๆฎ้ฉฑๅจ็ๅซๅ name-ๅซๅ
# @pytes... | xmtxy/pytest | test_case/bzx_test_api.py | bzx_test_api.py | py | 4,370 | python | zh | code | 0 | github-code | 36 |
36539454569 | # -*- coding:utf-8 -*-
#Name:
#Descripton:
#Author: smartwy
#Date:
#Version:
import os
# print('Process (%s) start ...'%os.getpid())
#
# pid = os.fork() # windows ๆฒกๆfork่ฐ็จ๏ผlinux unix Macๆฏๆfork่ฐ็จ
#
# if pid == 0:
# print('I am child process (%s) and my parent is %s .'%(os.getpid(),os.getppid()))
... | smartwy/python_test | ็ปไน ๆไปถ/ๅค่ฟ็จ.py | ๅค่ฟ็จ.py | py | 2,102 | python | en | code | 0 | github-code | 36 |
21694229487 | import numpy as np
import re
from io import StringIO
def GetChunkFromTextFile(FileName, StartStr, StopStr, skip_header=0, skip_footer=0, LastHit=True, DataType='array'):
# DataType means we can extract the chunk and then turn it into:
# 1) Numpy table 'numpy'
# 2) return the raw text 'raw'
DataType = D... | ZGainsforth/QEScripts | IR/GetChunkFromTextFile.py | GetChunkFromTextFile.py | py | 1,560 | python | en | code | 4 | github-code | 36 |
38859095273 | from adonthell import base, input, world, event
import actions
import ui.savegame
class player (object):
"""
Implements the PC "schedule", which is being controlled
by the player.
"""
def __init__ (self, schedule):
"""
ctor
"""
# -- the map for this schedule
... | ksterker/adonthell | test/data/schedules/char/player.py | player.py | py | 5,108 | python | en | code | 28 | github-code | 36 |
14091980069 | # tao 1 dictionary
# hoi nguoi dung key
# in ra value cua key
person={
'name' : 'Thuy',
'age' : 21,
}
# key = input("What key ")
# value = person[key]
# print(value)
key = input("What key ")
if key in person: #kiem tra key cos o trong person hay k
# if key not in person: kiem tra key cos k lam trong per... | VuThiThuyB/vuthithuy-fundamental-c4e22 | session4/read2.py | read2.py | py | 403 | python | en | code | 0 | github-code | 36 |
1674184175 | from django.db import models, connection
# Create your models here.
class News(models.Model):
news_id = models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')
news_title = models.CharField(max_length=200)
news_source = models.CharField(max_length=50)
news_content = models.Tex... | chundonghan/pysite | portal/models.py | models.py | py | 3,193 | python | en | code | 0 | github-code | 36 |
2666772723 | import pandas as pd
from matplotlib import pyplot as plt
data = pd.read_csv("countries.csv")
print(data)
#Compare population growth in the US and China
us = data[data.country == "United States"]
china = data[data.country == "China"]
print(us)
print(china)
#Plot US and China population growth
plt.plot(us.year, u... | CharlesIvia/data-visualization | pop_growth.py | pop_growth.py | py | 486 | python | en | code | 0 | github-code | 36 |
20063508538 | from django.urls import path
from api import views
from rest_framework_simplejwt.views import (
TokenRefreshView,
)
app_name = 'api'
urlpatterns = [
path('', views.getRoutes,name='routes'),
path('token/', views.MyTokenObtainPairView.as_view(), name='token_obtain_pair'),
path('token/refresh/', TokenR... | Hack-Weekly/lavender-snake-password-manager | api/urls.py | urls.py | py | 647 | python | en | code | 1 | github-code | 36 |
10532200845 | import requests
from datetime import datetime
USERNAME = "kristijan"
TOKEN = "hafdaga134312"
pixela_endpoint = "https://pixe.la/v1/users"
user_params = {
"token": "hafdaga134312",
"username": "kristijan",
"agreeTermsOfService": "yes",
"notMinor": "yes",
}
#response = requests.post(url=pixela_endpoint... | Kvidakovic1/Python-Exercises | Habit_Tracking/main.py | main.py | py | 1,106 | python | en | code | 0 | github-code | 36 |
22769347103 | #!/bin/python
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlencode, parse_qs
# Facebook
#ACCESS_TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRlX2lzc3VlZCI6IjIwMTUtMTEtMjFUMTg6NTc6MzAuNTQ4MDk3IiwiY2xpZW50X2lkIjoiaHR0cDovL2V4YW1wbGUuY29tLyIsInNpdGUiOjQzLCJzY29wZSI6InBvc3QiLCJtZSI6Imh... | kylewm/silo.pub | scripts/do_local_micropub_flickr.py | do_local_micropub_flickr.py | py | 1,961 | python | en | code | 27 | github-code | 36 |
34050456586 | import shadow.utils
shadow.utils.set_seed(0, cudnn_deterministic=True) # set seeds for reproducibility
#%matplotlib inline
import matplotlib.pyplot as plt
from sklearn import datasets
import numpy as np
import random
import math as m
n_samples = 1000 # number of samples to generate
noise = 0.05 # noise to add to sa... | alalba221/Advanced-Machine-Learning | Final23F/Q4.py | Q4.py | py | 3,742 | python | en | code | 0 | github-code | 36 |
12198109778 | #!/usr/bin/python
import os
import sqlite3, time, re
import subprocess
def DB_Extr(conn, Subdomain, number, Service, Message, Time):
query = "SELECT * FROM Extraction WHERE Message= '" + Message + "'"
try:
cursor = conn.execute(query)
except:
Bad_query ='echo "'+query+'" >> BAD_QUERIES.txt'
os.system(Bad_que... | fulgid0/ASMS_discovery | Scan_lib.py | Scan_lib.py | py | 4,231 | python | en | code | 0 | github-code | 36 |
28876927609 | # ้
็ฝฎไฟกๆฏ---ๅฐ็จๆท่ชๅฎไน้
็ฝฎๆไปถๅ้ป่ฎค้
็ฝฎๆไปถๅๆไธไธช
import importlib
import os
from lib.conf import global_settings
class Settings():
def __init__(self):
# ่ทๅ้ป่ฎค้
็ฝฎๆไปถ็ๅ
ๅฎนๅๅ
ฅๅฐSettings็ฑป็ๅ็งฐ็ฉบ้ด
for name in dir(global_settings):
if name.isupper():
value = getattr(global_settings, name)
... | Zhu-GF/AutoGatheringAsserts | lib/conf/config.py | config.py | py | 915 | python | en | code | 0 | github-code | 36 |
4014075302 | # ๋ฌธ์ ์ถ์ฒ : https://programmers.co.kr/learn/courses/30/lessons/42839?language=python3
from itertools import permutations
import math
def solution(numbers):
answer = 0
'''
์ค๋ฅ์ฝ๋
arr = list(map(int, list(numbers)))
for per in permutations(list(numbers)):
arr.append(int(''.join(per)))
print... | ThreeFive85/Algorithm | Programmers/level2/findPrime/find_prime.py | find_prime.py | py | 1,102 | python | en | code | 1 | github-code | 36 |
15295704029 | from django.urls import include, path
from rest_framework import routers
from . import views
app_name = 'articles'
router = routers.DefaultRouter()
router.register(r'articles', views.ArticleViewSet)
urlpatterns = [
# path('', views.article_list, name="list"),
path('', include(router.urls)),
path('api-aut... | Dban1/myDjangoTraining | cynoblog/articles/urls.py | urls.py | py | 698 | python | en | code | 0 | github-code | 36 |
27750968929 | #! /usr/bin/env python
# System imports
from distutils.core import *
from distutils import sysconfig
# Third-party modules - we depend on numpy for everything
import numpy
# Obtain the numpy include directory.
numpy_include = numpy.get_include()
_vsueig_omp = Extension("_vsueig_omp",
["vsue... | hornos/pyf3 | lib/kernel/setup_omp_intel.py | setup_omp_intel.py | py | 838 | python | en | code | 0 | github-code | 36 |
36164549179 | from blog.models import Post
from django.urls import path
from . import views
# using django view
# from .views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, post
# urlpatterns = [
# path("", PostListView.as_view(), name="blog-home"),
# path("post/<int:pk>", PostDetailVi... | nubcakee/django-basic-template | blog/urls.py | urls.py | py | 996 | python | en | code | 1 | github-code | 36 |
39752425383 | import MySQLdb
class InsertsEmprestimo:
def __init__(self):
self.con = ""
def conecta(self):
host = "localhost"
user = "ProjetoFinal"
password = "123456"
db = "db_biblioteca"
port = 3306
self.con = MySQLdb.connect(host, user, password, db, port)
de... | DavidDevOps2000/ProgramaBibliotecaPython | inserts.py | inserts.py | py | 2,226 | python | pt | code | 0 | github-code | 36 |
37428725368 | from __future__ import division
from pyglet import image, text
from tdgl.gl import *
from tdgl import part, picking
from tdgl.stylesheet import border_points
__all__ = ('Panel','LabelPanel')
class Panel(part.ScalePart):
"""Base class for things with a bordered panel behind"""
_default_style = dict(
... | scavpy/Scav-Team-Pyweek-Aug-2010 | gamelib/tdgl/panel.py | panel.py | py | 9,576 | python | en | code | 3 | github-code | 36 |
41771464057 | class LRUCache:
'''ะะปะฐัั ั
ัะฐะฝะธั ะทะฐะฟัะพัั ะธ ัะดะฐะปััั ัะฐะผัะต ััะฐััะต ะฟัะธ ะดะพััะธะถะตะฝะธะธ ะปะธะผะธัะฐ'''
def __init__(self, limit: int = 3):
self.__limit = limit
self.__cache = []
@property
def cache(self): # ััะพั ะผะตัะพะด ะดะพะปะถะตะฝ ะฒะพะทะฒัะฐัะฐัั ัะฐะผัะน ััะฐััะน ัะปะตะผะตะฝั
return self.__cache[0]
@cache.s... | Bednyakov/Tasks | Decorators (ะดะตะบะพัะฐัะพัั)/08_request_caching/main.py | main.py | py | 2,099 | python | ru | code | 0 | github-code | 36 |
3450084677 | #This file was used to take only the variables to be used as x and y out of a
#.csv file and save them to a new file as two space-sepparated lines. The first
#line is x-values and the second is y-values.
#config variables
infile = "data/tempc12.txt"
outfile = "data/tempc12.txt"
x_key = 'DATE'
y_key = 'TEMPC'
file = o... | Oliver-OBrien/TemperatureInterpolationPlotter | isolate_xy.py | isolate_xy.py | py | 1,003 | python | en | code | 0 | github-code | 36 |
34446941066 | """
TITLE: Nested Lists
INPUT:
5
Harry
37.21
Berry
37.21
Tina
37.2
Akriti
41
Harsh
39
OUTPUT:
Berry
Harry
"""
if __name__ == '__main__':
marksheet = []
for _ in range(int(input())):
name = input()
score = float(input())
marksheet.append([name, score])
second_highest = sorted(lis... | bakliwalvaibhav1/Python-HackerRank | 02) Basic Data Types/nested_lists.py | nested_lists.py | py | 449 | python | en | code | 1 | github-code | 36 |
20244284451 | #!/usr/bin/env python
import os
import sys
from lib.util import rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
rm_rf('node_modules')
rm_rf('dist')
rm_rf('out')
rm_rf('spec/node_modules')
rm_rf('vendor/brightray/vendor/download/libchrom... | brave/muon | script/clean.py | clean.py | py | 482 | python | en | code | 970 | github-code | 36 |
30395093762 | from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from blog.models import Blog, BlogCategory
from blog.api.serializers import BlogApi, BlogCategoryApi
@api_view(['GET',])
def api_blog_view(request):
try:
blog = Blog.objects.all(... | siklerdaniiii/astral | blog/api/views.py | views.py | py | 1,731 | python | en | code | 0 | github-code | 36 |
34481978389 | from datetime import datetime
import matplotlib.pyplot as plt
"""
Please read the README file before running this code
In order to fully understand the purpose and the execution of this code
"""
def clean_line(line):
cleaned_line = line.strip()
cleaned_line = cleaned_line[1:]
if cleaned_line.st... | andrea-gentilini/InstagramUnFollowers | main.py | main.py | py | 4,840 | python | en | code | 0 | github-code | 36 |
26222486814 | import json
from datetime import datetime
from . import calc_func
from .db_queries_source import *
from .connection_to_database import create_connection
conn = ''
def insert_to_db(city_sender, city_recipient, urgency, type_of_cargo, weight,
delivery_type, lenght, width, height, declared_value_rate... | DamirF/IB | database_admin/psg_cse_api/psg_cse_api_tools/cse_to_db.py | cse_to_db.py | py | 4,246 | python | en | code | 0 | github-code | 36 |
8855120507 | import random
import turtle
colors = ["red", "green", "blue", "orange", "purple", "pink", "yellow"] # Make a list of colors to picvk from
turtle.width(10)
length = 5
for count in range(100):
color = random.choice(colors)
turtle.forward(length)
turtle.right(135)
turtle.color(color)
length = length ... | StuartSpiegel/TurtleArt | my_turtle.py | my_turtle.py | py | 327 | python | en | code | 0 | github-code | 36 |
6394563903 | import jax
import jax.numpy as jnp
import numpy as np
import pyscf
import chex
from jaxtyping import Float, Array, Int
from jsonargparse import CLI, Namespace
from functools import partial
from collections import namedtuple
from icecream import ic
from pyscf_ipu.nanoDFT import utils
from pyscf_ipu.exchange_correlation.... | graphcore-research/pyscf-ipu | pyscf_ipu/nanoDFT/nanoDFT.py | nanoDFT.py | py | 36,015 | python | en | code | 31 | github-code | 36 |
72522523624 |
"""
"""
import lvgl as lv
import ili9XXX
from ili9XXX import st7789
import machine
import time
# see pin_defs.py and import the pin defs that match your build
from pin_defs import dev_board as pins
# from pin_defs import manual_wiring as pins
import fs_driver
lv.init()
# FS driver init
fs_drv = lv.fs_drv_t()
fs_dri... | kdmukai/micropython-esp32 | demos/hardware_tests/button_test.py | button_test.py | py | 2,742 | python | en | code | 22 | github-code | 36 |
2411604704 | from game.Params import *
from game.BonusManager import Bonus
BONUS_IMAGES = {Bonus.Pause: {YELLOW: 'game/images/pause_yellow.png',
GREEN: 'game/images/pause_green.png',
BLUE: 'game/images/pause_blue.png',
RED: 'game/images/pause... | dshzhkv/Zuma | game/ui.py | ui.py | py | 6,555 | python | en | code | 2 | github-code | 36 |
14681878400 | import csv
import math
import os
import sys
import torch
from matplotlib import pyplot as plt
from torch.utils.data import DataLoader
import Feedforward
import Kalman
from BKF_testing import start_test
from CircleGenerator import CirclesDataset, create_directory, save_tensor
from DeviceDataLoader import DeviceDataLoade... | tiboat/BackpropKF_Reproduction | BKF.py | BKF.py | py | 16,374 | python | en | code | 6 | github-code | 36 |
20060032970 |
import matplotlib.pyplot as plt
import matplotlib.collections as mcoll
from collections import defaultdict
from matplotlib import colors
from matplotlib.lines import Line2D
import warnings
import seaborn as sns
import math
import numpy as np
import pandas as pd
def deCasteljau(b, t):
N = len(b)
a = np.copy(b... | Thopic/chordialement | chordialement/core.py | core.py | py | 17,468 | python | en | code | 1 | github-code | 36 |
10244244417 | import os
import csv
#describe the path to find the files needed
csv_file_path = os.path.join("election_data.csv")
#identify variables
total_votes = 0 # count total number of votes
candidates = {} # dictionary of keys (candidate names) and values (number of votes)
candidates_percent = {} # dictionary ... | kblakeroth/python-challenge | PyPoll/pp_main.py | pp_main.py | py | 2,815 | python | en | code | 0 | github-code | 36 |
32949601057 | import turtle
wn = turtle.Screen()
wn.title("Estrella tortuga Python")
wn.bgcolor("lightgreen")
leonardo = turtle.Turtle()
leonardo.hideturtle()
leonardo.pensize(3)
leonardo.fillcolor("#ffa41b")
leonardo.color("#ffa41b")
side = wn.numinput("Tamaรฑo", "Indica un tamaรฑo en pรญxeles para la estrella")
leonardo.begin_fil... | JSalram/Python | Learning/Tortuga/estrella.py | estrella.py | py | 518 | python | en | code | 0 | github-code | 36 |
7934166631 | '''
Description: Definitions of functions
Author: Nan Li
Contact: linan.lqq0@gmail.com
'''
# import packages
import re
import time
import pandas as pd
from headers import headers
from datetime import datetime
from seleniumwire import webdriver
# short names dictionary
address_dict = ({'road':'rd', 'street':'st', 'plac... | linan-1990/RealestateCrawler | functions.py | functions.py | py | 6,379 | python | en | code | 1 | github-code | 36 |
71952079785 | def parentheses(s):
l=[]
for i in range(len(s)):
if s[i]=='(' or s[i]=='{' or s[i]=='[':
l.append(s[i])
else:
if len(l)==0:
return False
x=l[-1]
if x=='(' and s[i]==')':
l.pop()
elif x=='{' and... | Exile404/LeetCode | LEETCODE_Valid-Parentheses.py | LEETCODE_Valid-Parentheses.py | py | 562 | python | en | code | 2 | github-code | 36 |
72776117224 | import requests
import bs4
from bs4 import BeautifulSoup
import pandas as pd
import time
import csv
import simplejson as json
import threading
def extract_job_title_from_result(soup):
jobs = []
for div in soup.find_all(name="div", attrs={"class":"row"}):
for a in div.find_all(name="a", attr... | arthimj/Web-Scrapping-Python | web_scrapping.py | web_scrapping.py | py | 3,426 | python | en | code | 2 | github-code | 36 |
25337681092 | import json
#build the dict, takes in the file name as param
def buildDict(s):
fp = open(s, "r")
dictionary = {}
linesInFile = []
for line in fp:
newLine = line.split('@')
linesInFile.append(newLine)
length = len(linesInFile)
for i in range(0,length):
#new innerDict for using the insidedict
... | sinanbayoud/Composr | Composr/readfromfile.py | readfromfile.py | py | 777 | python | en | code | 0 | github-code | 36 |
38897570278 | #!/usr/bin/env python2
# engine='python'.
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 25 16:43:06 2016
@author: andrepignata
"""
import urllib.request
from os import getcwd
import pandas as pd
import numpy as np
cwd = getcwd()
print(cwd)
aCidades = pd.read_csv('bases/cidades.csv')
#aTemas = [{'ano':2010,'tema':1... | tykoth/web_scrap_python | scripts/ibge_cidade.py | ibge_cidade.py | py | 1,603 | python | pt | code | 0 | github-code | 36 |
71050503145 | def buddyStrings(s, goal):
if len(s) != len(goal):
return False
if s == goal:
# Check if there are at least two repeated characters in s
char_count = {}
for char in s:
if char in char_count:
return True
char_count[char] = 1
ret... | Shreyanshraj12/practice8 | question8.py | question8.py | py | 669 | python | en | code | 0 | github-code | 36 |
74523493544 | import matplotlib.pyplot as plt
import glob
import os
import argparse
# File select index out of range exception
class ValueOutOfRange(Exception):
def __str__(self):
return 'Value out of range'
data_path = None
parser = argparse.ArgumentParser()
parser.add_argument('--data', '-d', nargs='?', action='st... | EHAerospace/EHA-TestStand | graph/graph.py | graph.py | py | 2,669 | python | en | code | 1 | github-code | 36 |
23747786249 | """
Khinshan Khan - oss.py.
This module implements a God class for OS simulation.
"""
from collections import deque
import itertools
from mcm_oss import memory
from mcm_oss import disk
class OSS:
"""An OS mimicker."""
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, tra... | shan-memery/mcm-oss | mcm_oss/oss.py | oss.py | py | 4,275 | python | en | code | 0 | github-code | 36 |
18264517083 | from django.contrib import admin # ์ฅ๊ณ ์์ ์ ๊ณตํ๋ Admin ๊ธฐ๋ฅ ์ฌ์ฉ์ ์ํ ์ํฌํธ
from .models import Post # ์ง์ ์์ฑํ Post ๋ชจ๋ธ ์ฌ์ฉ์ ์ํ ์ํฌํธ
@admin.register(Post) # ์ด๋๋ฏผ ์ฌ์ฉ์ ์ํ ๋ชจ๋ธ ์ฐ๊ฒฐ
class PostAdmin(admin.ModelAdmin): # ๋ชจ๋ธ๊ธฐ๋ฐ์ ์ด๋๋ฏผ ์ฌ์ฉ์ ์ํ ์์
list_display = ['id', 'title', 'content', 'created_at'] # ๋ฆฌ์คํธ ํ๋ฉด์ ์ถ๋ ฅ ํ๋ ์ ์
list_editable ... | 3chamchi/likelion-seoul-6th | week5/blog-app/posts/admin.py | admin.py | py | 721 | python | ko | code | 3 | github-code | 36 |
27036421539 | import os
dist_params = dict(backend="nccl")
log_level = "INFO"
load_from = None
resume_from = None
cudnn_benchmark = True
custom_imports = dict(imports=["geospatial_fm"])
num_frames = 3
img_size = 224
num_workers = 2
# model
# TO BE DEFINED BY USER: model path
pretrained_weights_path = "<path to pretrained weights>"... | NASA-IMPACT/hls-foundation-os | configs/multi_temporal_crop_classification.py | multi_temporal_crop_classification.py | py | 7,554 | python | en | code | 183 | github-code | 36 |
19784797483 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ๅ่ฝ๏ผ้ธขๅฐพ่ฑๆฐๆฎๅค็
ๆถ้ด๏ผ2018ๅนด04ๆ20ๆฅ14:52:44
"""
import pandas as pd
import tensorflow as tf
CSV_COLUMN_NAMES = ['SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth', 'Species'] # ๅๅ
SPECIES = ['Setosa', 'Versicolor', 'Virginica'] # ็ฑปๅซ
train_path = "data/iris_training.csv... | churximi/Learn-TensorFlow | iris_data.py | iris_data.py | py | 2,827 | python | en | code | 0 | github-code | 36 |
10731339024 | from db import model
from api import api
from datetime import datetime
import json
import webbrowser
from vkinder.settings import Settings
class APP:
def __init__(self, token, _id):
self.vk = api.VK(token)
self.user_id = str(self.vk.resolve_screen_name(_id))
self.db = model.DB(self.user_i... | rychanya/vkinder | src/vkinder/app.py | app.py | py | 3,208 | python | en | code | 0 | github-code | 36 |
15150949741 | """
Generic Kedro Nodes
"""
import logging
import json
from sklearn.ensemble import IsolationForest
from sklearn.covariance import EllipticEnvelope
from sklearn.neighbors import LocalOutlierFactor
from .plugin import hooks
import pandas as pd
from .views import ADAlgorithms, create_samples_os_view
iso_params = {
... | TU-Berlin-SNET/Waldo-Kedro-Plugin | waldo_kedro_plugin/nodes.py | nodes.py | py | 7,196 | python | en | code | 1 | github-code | 36 |
12520460708 | #!/usr/bin/python3
'''
Select data from states table and filter it
by the names that contain an a
then print it.
'''
import sys
from model_state import Base, State
from sqlalchemy import (create_engine)
from sqlalchemy.orm import Session
if __name__ == "__main__":
engine = create_engine('mysql+mysqldb://{}:{}@l... | sebastiancalleu/holbertonschool-higher_level_programming | 0x0F-python-object_relational_mapping/9-model_state_filter_a.py | 9-model_state_filter_a.py | py | 706 | python | en | code | 0 | github-code | 36 |
13239290421 | """Notes on the different columns of the csv files
PSNR: Peak Signal-to-Noise Ratio
SSIM: Structural Similarity
Loss_D: Discriminator Loss; Used to train Discriminator
Loss_G: Generator Loss; Used to train Discriminator; Composed of img perception and disc Loss
Score_D: Discriminator score given to the real image
Sc... | PierreSp/DL4CV_2017_Final_Project | srgan/plots.py | plots.py | py | 1,509 | python | en | code | 0 | github-code | 36 |
8017126240 | import datetime as dt
import logging
from sqlalchemy import (
Column,
ForeignKey,
MetaData,
Table,
UniqueConstraint,
create_engine,
)
from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import backref, relationship, sessio... | iterlace/knu_assistant | assistant/src/app/database.py | database.py | py | 8,494 | python | en | code | 0 | github-code | 36 |
21366611631 | '''
Link: https://www.lintcode.com/problem/136/
'''
# My own solution, uses memoized DFS. I also verified that a DFS without memoization can still pass.
class Solution:
"""
@param: s: A string
@return: A list of lists of string
"""
def partition(self, s):
# write your code here
self... | simonfqy/SimonfqyGitHub | lintcode/medium/136_palindrome_partitioning.py | 136_palindrome_partitioning.py | py | 4,804 | python | en | code | 2 | github-code | 36 |
29495477058 | from pathlib import Path
from my_scientific_profile.papers.papers import (
fetch_all_paper_authors,
fetch_all_paper_infos,
)
papers = fetch_all_paper_infos()
paper_authors = fetch_all_paper_authors()
print(f"fetched {len(papers)} papers and {len(paper_authors)} authors")
from my_scientific_profile.database.a... | tbereau/tbereau | scripts/fetch_papers.py | fetch_papers.py | py | 963 | python | en | code | 0 | github-code | 36 |
27998927746 | """Retrieves data object from table if exists, otherwise create it"""
def get_or_create(session, model, **kwargs):
instance = session.query(model).filter_by(**kwargs).first()
if instance:
return instance
else:
instance = model(**kwargs)
session.add(instance)
session.commit()
... | KaiminOng/EsdWatchDog | microservices/dataHandler/dataHandler/helper.py | helper.py | py | 343 | python | en | code | 0 | github-code | 36 |
21620485761 | from __future__ import absolute_import
import sys
from typing import ByteString
from typing import Mapping
from typing import NamedTuple
from typing import Optional
from typing import Sequence
from uuid import uuid4
import numpy as np
from past.builtins import unicode
from apache_beam.portability.api import schema_p... | a0x8o/kafka | sdks/python/apache_beam/typehints/schemas.py | schemas.py | py | 6,240 | python | en | code | 59 | github-code | 36 |
33501403446 | import sys
from lxml import etree
from math import sqrt
from GammaPipeCommon.utility import *
from conf import get_resultsdb_conf
from conf import get_pipedb_conf
import mysql.connector as mysql
import re
import time
import os
import subprocess
class ImportResults:
def import_results(results_xml,check_alert):
... | cta-rta/ctoolsint | ImportResults.py | ImportResults.py | py | 8,133 | python | en | code | 1 | github-code | 36 |
41758783563 | import pylab
import random
outcomes = []
for s_length in range(1, 101, 2):
a = .6
series_length = s_length
num_trials = 1000
num_series_wins = 0
for trial in range(num_trials):
counter = 0
for game in xrange(series_length):
if random.random() < a:
c... | CodeProgress/misc | BetterTeamsChanceOfWinningSeries.py | BetterTeamsChanceOfWinningSeries.py | py | 564 | python | en | code | 0 | github-code | 36 |
10080595644 | #! /usr/bin/python3
import os
import boto3
import json
import logging
import random
import traceback
from datetime import datetime
from python.opentelemetry import trace
from python.opentelemetry.semconv.trace import SpanAttributes
CUSTOM_OTEL_SPAN_EVENT_NAME = 'LambdaUpdateEvent'
SQS_MESSAGE_GROUP_ID = 'otel'
# Re... | utr1903/monitoring-lambda-with-opentelemetry | python/apps/update/lambda_function.py | lambda_function.py | py | 4,368 | python | en | code | 2 | github-code | 36 |
32925227061 | import sqlite3
import sys
import colorama
connection = sqlite3.connect("rubiksql.db")
cursor = connection.cursor()
colorama.init()
def selectTop (cantidad = 10, direction = "ASC", campos = "*"):
global cursor, connection
cursor.execute("SELECT "+campos+" FROM layouts ORDER BY distance "+
... | jonoreilly/python | rubik/rubikLooker.py | rubikLooker.py | py | 2,605 | python | en | code | 0 | github-code | 36 |
12131483929 | from youtube_transcript_api import YouTubeTranscriptApi
import re
import string
import copy
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from PIL import Image
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
from sklearn.feature_extraction.text import CountVectorizer
import spac... | vitmesquita/desafio_1sti | script/main.py | main.py | py | 9,747 | python | pt | code | 0 | github-code | 36 |
34451715981 | import arff
import pandas as pd
import numpy as np
import json
import data_utils
import os
def load_data(use_data=None):
data_load = np.load('dataset/'+use_data+str('.npy'))
print(data_load.shape)
return np.asarray(data_load).astype(np.float)
def creat_dataset(directory):
if not os.path.exists(dir... | mvisionai/FedLimited | convert_to_arff.py | convert_to_arff.py | py | 1,605 | python | en | code | 1 | github-code | 36 |
8306618656 | from django.contrib import admin
from .models import Topic, Course, Student, Order, Review
from decimal import Decimal
def decrease_price(modeladmin, request, queryset):
for obj in queryset:
obj.price = obj.price*Decimal(0.9)
obj.save()
class CourseAdmin(admin.ModelAdmin):
fields = [('title'... | krunal1998/Course-Registration | myapp/admin.py | admin.py | py | 1,417 | python | en | code | 0 | github-code | 36 |
8690419881 | import numpy as np
from automaton_handler import Automaton
import os
import tensorflow as tf
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
class Automaton2Network:
def __init__(self, automaton, train_set_size):
"""
Creates a base for the creation of a network
:param automaton: automaton to be c... | JeremyRozier/simulation-automates | NFA_convolution_network.py | NFA_convolution_network.py | py | 5,460 | python | en | code | 0 | github-code | 36 |
28849901111 | #Consider a list (list = []). You can perform the following commands:
#insert i e: Insert integer at position i.
#print: Print the list.
#remove e: Delete the first occurrence of integer e.
#append e: Insert integer at the end of the list.
#sort: Sort the list.
#pop: Pop the last element from the list.
#revers... | CHIRAG3899/Hackerrank | Python Hackerrank/12 Lists.py | 12 Lists.py | py | 1,460 | python | en | code | 0 | github-code | 36 |
33028130226 | from xml.etree import ElementTree
from blog import app
import sys
import requests
import sys
from bs4 import BeautifulStoneSoup as Soup
def analyze_site_map():
r = requests.get('{}{}sitemap.xml'.format(app.config['WEB_PROTOCOL'], app.config['DOMAIN']))
soup = Soup(r.content)
locs = soup.findAll('loc')
... | mkmoisen/blog | verify_sitemap.py | verify_sitemap.py | py | 888 | python | en | code | 2 | github-code | 36 |
73915028905 | import sqlite3
import utils
import csv
con = sqlite3.connect('bookswort.sqlite')
cur = con.cursor()
def positionStdDev(Books_id,Words_id):
import statistics
cur.execute('''SELECT position FROM Textorder WHERE Books_id = ? AND
Words_id = ?''', (Books_id,Words_id))
positions = [v[0] for ... | jevargas-m/bookdistillery | analyzebook.py | analyzebook.py | py | 7,639 | python | en | code | 0 | github-code | 36 |
74352477543 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
GUFY - Copyright (c) 2019, Fabian Balzer
Distributed under the terms of the GNU General Public License v3.0.
The full license is in the file LICENSE.txt, distributed with this software.
----------------... | Fabian-Balzer/GUFY | GUFY/simgui_modules/configureGUI.py | configureGUI.py | py | 15,735 | python | en | code | 0 | github-code | 36 |
11292852216 | import os
from msgraph import api, sites
authority_host_uri = 'https://login.microsoftonline.com'
tenant = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
resource_uri = 'https://graph.microsoft.com'
client_id = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
client_thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
client_certifi... | WMInfoTech/python-msgraph | examples/sites_lists.py | sites_lists.py | py | 1,261 | python | en | code | 4 | github-code | 36 |
73485125223 | # https://programmers.co.kr/learn/courses/30/lessons/72415
from collections import defaultdict
import heapq
dr = (-1, 1, 0, 0)
dc = (0, 0, -1, 1)
def get_cnt(board, r, c, _r, _c):
cnt_map = [[float('inf') for _ in range(4)] for _ in range(4)]
cnt_map[r][c] = 0
pq = [(0, r, c)]
heapq.heapify(pq)
... | lexiconium/algorithms | programmers/2021_KAKAO_BLIND_RECRUITMENT/72415.py | 72415.py | py | 1,997 | python | en | code | 0 | github-code | 36 |
4871461849 | import tensorflow as tf
# tensorflow ์์ ์ฌ์ฉํ ์ ์๋ ์์(๋ณํ์ง ์๋ ๊ฐ)์ ์ ์ธ
# a ๋ 120์ด์ธ์ ๋ค๋ฅธ ๊ฐ์ ๊ฐ์ง ์ ์๋ค.
# ์๋ฐ์ ๋ฌธ๋ฒ์ธ final int a = 120 ๊ณผ ๊ฐ์ ์๋ฏธ
a = tf.constant(120, name="a")
b = tf.constant(130, name="b")
c = tf.constant(140, name="c")
# ๋ณ์ ์ ์ธ
v = tf.Variable(0, name="v")
# ๋ฐ์ดํฐ ํ๋ก์ฐ(ํ๋ฆ) ๊ทธ๋ํ(tensorflow ์ฌ์ฉํ ์์) ์ ์
# a+b ๋จผ์ ํ๊ณ ์ถ๋ ฅ๋ ๊ฒฐ๊ณผ... | kyunghee28/pythonTest | day0412/tensorflowTest02.py | tensorflowTest02.py | py | 1,510 | python | ko | code | 0 | github-code | 36 |
37746699511 | import requests
from bs4 import BeautifulSoup
from lxml.html import fromstring
from itertools import cycle
import traceback
class Scrape:
proxies = ""
proxy_pool = ""
def __init__(self):
self.proxies = self.get_proxies()
self.proxy_pool = cycle(self.proxies)
def get_proxies(self):
url = '... | msheroubi/album-central | main/scripts/scrape - Proxy Loop.py | scrape - Proxy Loop.py | py | 3,457 | python | en | code | 0 | github-code | 36 |
12553103859 | import requests
import json
import time
url = 'https://formulae.brew.sh/api/formula.json'
response = requests.get(url)
packages_json = response.json()
results = []
t1 = time.perf_counter()
for package in packages_json:
package_name = package['name']
package_desc = package['desc']
package_url = f'h... | iampaavan/Pure_Python | How to Write Python Scripts to Analyze JSON APIs and Sort Results.py | How to Write Python Scripts to Analyze JSON APIs and Sort Results.py | py | 1,406 | python | en | code | 1 | github-code | 36 |
21358659989 | a, b, c = 60, 24, 7
print(a * b * c)
a, b, c = 60, 26, 7
print(a * b * c)
days_in_a_week = 7
hours_in_a_day = 24
minutes_in_an_hour = 60
minutes_in_a_week = days_in_a_week * hours_in_a_day * minutes_in_an_hour
| A3015d/pte_ep_cl_2021 | ora8/minutes_in_a_week.py | minutes_in_a_week.py | py | 212 | python | en | code | 0 | github-code | 36 |
42994932549 | """ fonction Boucle affichage d'une table de multiplication en boucle """
def table_multiplication(chiffre, multiplicateur):
""" Focntion qui affiche la table de multiplication de votre choix """
i = 1
while i <= multiplicateur:
print(i,"x",chiffre,"=",chiffre * i)
i += 1
# test de la fon... | Ubunlucky/OpenTP | mod_cours/multiplication.py | multiplication.py | py | 417 | python | fr | code | 0 | github-code | 36 |
1202982324 | from enum import Enum
import re
import datetime as dt
import pytz
from os.path import basename
from pandas import read_csv, to_datetime
class StrEnum(str, Enum):
def __str__(self):
return self._value_
@classmethod
def values(cls):
return [v.value for _, v in cls.__members__.items()]
cl... | sheryllan/tickdb | bar_checks/bar/datastore_config.py | datastore_config.py | py | 4,478 | python | en | code | 0 | github-code | 36 |
12483696382 | import numpy as np
import tensorflow as tf
from src.model import get_model
import os
def train_model(x_train, x_test, y_train, y_test,
pt_weights=None, h5_name='temp'):
tf.keras.backend.clear_session()
model = get_model(1e-5)
h_file = f'{h5_name}.h5'
if pt_weights is not None:
... | drivendataorg/mars-spectrometry-gcms | bonus-prize/src/training_utils.py | training_utils.py | py | 1,896 | python | en | code | 1 | github-code | 36 |
34482110199 | import bpy
import math
bpy.context.scene.frame_end = 180
# add a cube
bpy.ops.mesh.primitive_cube_add()
cube = bpy.context.active_object
# insert keyframe at frame one
start_frame = 1
cube.keyframe_insert("rotation_euler", frame=start_frame)
bpy.context.scene.frame_current = 180
# change the rotation of the cube ar... | ambivalenzia/BlenderPythonProjects | cube_rotation_animation.py | cube_rotation_animation.py | py | 655 | python | en | code | 0 | github-code | 36 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.