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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
9367032792 | import time
import argparse
import numpy as np
import torch
from deeprobust.graph.defense import GCN, ProGNN
from deeprobust.graph.data import Dataset, PrePtbDataset
from deeprobust.graph.utils import preprocess, encode_onehot, get_train_val_test
# Training settings
parser = argparse.ArgumentParser()
parser.add_argume... | ChandlerBang/Pro-GNN | save_splits.py | save_splits.py | py | 3,762 | python | en | code | 249 | github-code | 36 |
43400299413 | """OTE-API OntoKB Plugin
A plugin for OTE-API.
Authored by Alessandro Calvio, UNIBO, 2022
Created from cookiecutter-oteapi-plugin, SINTEF, 2022
"""
__version__ = "0.0.1"
__author__ = "Alessandro Calvio"
__author_email__ = "alessandro.calvio2@unibo.it"
| xAlessandroC/oteapi-ontokb-plugin | oteapi_ontokb_plugin/__init__.py | __init__.py | py | 255 | python | en | code | 0 | github-code | 36 |
20015295669 | """
Skriv ett program som ersätter alla förekomster av ett givet ord i en fil med ett annat ord.
Programmet ska läsa in filnamn, ord att ersätta samt ord att använda istället från användaren via kommandoraden.
Notera att den ursprungliga filen ska skrivas över.
Exempel på körning:
Ange ett filnamn: kort_saga.txt
Or... | yararajjoub/pythonModulo | Modul7/Labb_7/replacing.py | replacing.py | py | 840 | python | sv | code | 0 | github-code | 36 |
32788623389 | import wx
import re
import Wammu
import Wammu.Events
import Wammu.Utils
import Wammu.Paths
from Wammu.Locales import StrConv, ugettext as _
import wx.lib.mixins.listctrl
COLUMN_INFO = {
'info':
(
(
_('Name'),
_('Value')
),
(
... | gammu/wammu | Wammu/Browser.py | Browser.py | py | 19,382 | python | en | code | 63 | github-code | 36 |
43535999214 | """
Very simple Flask web site, with one page
displaying a course schedule.
"""
import flask
from flask import render_template
from flask import request
from flask import url_for
from flask import jsonify # For AJAX transactions
import json
import logging
# Date handling
import arrow # Replacement for datetime, ba... | RedMustard/proj3-ajax | app.py | app.py | py | 3,951 | python | en | code | null | github-code | 36 |
72694605863 | import requests
from datetime import datetime
from helpers.db import ExchangeRateDb
class RetrieveHourlyCryptoToUSDData:
def __init__(self):
self.db_path = 'helpers/cryptocurrency_exchange_rate.db'
self.db = ExchangeRateDb(self.db_path)
self.currency = None
def insert_data_... | madeleinema-cee/walletwatch_python_backend | update/generic_retrieve_exchange_rate_class.py | generic_retrieve_exchange_rate_class.py | py | 635 | python | en | code | 0 | github-code | 36 |
32352103733 | from service_app.logger import get_logger
from scrapers_app.constants import *
from lxml import html
import requests
import copy
import re
logger = get_logger(__name__)
# аттрибут == элемент
class ZaraItemInfoScraper:
NAME = "name"
SIZES_ON_SITE = "sizes_on_site"
COLORS_ON_SITE = "colors_on_site"
PR... | Radislav123/discount_waiter | scrapers_app/scrapers/zara_item_info_scraper.py | zara_item_info_scraper.py | py | 3,298 | python | en | code | 0 | github-code | 36 |
11194234055 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Use this to execute the differential kinematics
controller in our kinecontrol paper.
'''
from __future__ import print_function
import Sofa
import math
import sys, os
import time
import logging
import datetime
import numpy as np
from utils import *
from config import *... | robotsorcerer/superchicko | sofa/python/kinecontrol/single_controller.py | single_controller.py | py | 5,485 | python | en | code | 0 | github-code | 36 |
18878055040 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from imp import reload
except ImportError:
from importlib import reload
from django.core.urlresolvers import resolve, reverse
from django.http import Http404
from django.test import override_settings
from django.utils.translation import ove... | aldryn/aldryn-faq | aldryn_faq/tests/test_views.py | test_views.py | py | 7,363 | python | en | code | 5 | github-code | 36 |
19279623611 | import tensorflow as tf
import numpy as np
import random
from agents.AbstractAgent import AbstractAgent
from minigames.utils import state_of_marine, move_to_position
from utils.select_algorithm import choose_algorithm
from utils.replay_buffer import UniformBuffer
class Agent(AbstractAgent):
def __init__(self, en... | ericPrimelles/RLProject | agents/Agent.py | Agent.py | py | 4,824 | python | en | code | 0 | github-code | 36 |
15185050967 | """Extraction."""
import json
import logging
import time
from pathlib import Path
from typing import Any, List
import numpy as np
import pandas as pd
import requests
from bs4 import BeautifulSoup, SoupStrainer
from requests.exceptions import HTTPError
DATA_DIR = "/opt/airflow/data"
IMDB_TABLES = ["title.basics", "tit... | albutz/de-movies | dags/extract.py | extract.py | py | 6,534 | python | en | code | 0 | github-code | 36 |
70040826024 | from django.db import models
class IterFieldsValuesModel(models.Model):
def __iter__(self):
for field_name in self._meta.fields:
value = getattr(self, field_name.name)
yield (field_name.name, value)
class Meta:
abstract = True
| luke9642/Poll | questionnaire/models/iter_fields_values_model.py | iter_fields_values_model.py | py | 289 | python | en | code | 0 | github-code | 36 |
5667898056 | from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_restful import Resource, Api
import sqlite3 as lite
app = Flask(__name__)
api = Api(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///covid.db'
app.config['SQLALCHEMY_TRACK_MODI... | joshloo/iot-pandemic-stack | web-database/flaskapp.py | flaskapp.py | py | 3,161 | python | en | code | 0 | github-code | 36 |
35917171486 | import ipywidgets as widgets
# Measured in g/cm^3
MATERIAL_DENSITIES = {
"Aluminium": 2.7,
"Egetræ": 0.85,
"Granit": 2.650,
"Vand": 1.00,
"Uran": 18.70,
"Magnesium": 1.74,
"Messing": 8.40,
"Candy floss": 0.059,
}
MaterialDropDown = widgets.Dropdown(
options=[(f"{name} ({value} g/... | EmilLytthansBoesen/source | opgave_2/user_interface.py | user_interface.py | py | 882 | python | en | code | 0 | github-code | 36 |
5426664308 | """
Mini text-based role-playing game for practising OOP programming concepts.
Aim of this game to get 3 friends, most of the time you have to fight with them to become friendly.
Possible commands to move the player from room to room are north, south, west, east. Other commands talk, fight, check, backpack.
"""
# imp... | Maja0108/mini_rpg | mini_rpg_main.py | mini_rpg_main.py | py | 3,823 | python | en | code | 0 | github-code | 36 |
5547518029 | """
Tests for voting 10/07/2021.
"""
import pytest
from scripts.vote_2021_10_07 import (start_vote)
from utils.config import ldo_token_address, lido_dao_acl_address, lido_dao_token_manager_address
PURCHASE_CONTRACT_PAYOUT_ADDRESS = '0x689E03565e36B034EcCf12d182c3DC38b2Bb7D33'
payout_curve_rewards = {
'amount': ... | lidofinance/scripts | archive/tests/xtest_2021_10_07.py | xtest_2021_10_07.py | py | 4,121 | python | en | code | 14 | github-code | 36 |
12486652790 | """
Basics OOP Principles
Check your solution: https://judge.softuni.bg/Contests/Practice/Index/1590#1
SUPyF Exam 24.03.2019 - 02. Command Center
Problem:
Input / Constraints
We are going to receive a list of integers from console.
After that we will start receive some of the following commands in format:
•... | SimeonTsvetanov/Coding-Lessons | SoftUni Lessons/Python Development/Python Fundamentals June 2019/Problems and Files/14. PAST EXAMS/02. Python Fundamentals Exam - 24 March2019/02. Command Center.py | 02. Command Center.py | py | 3,572 | python | en | code | 9 | github-code | 36 |
36121100233 | import logging
import os
from time import time
from abc import abstractmethod, ABC
from pathlib import Path
from typing import Any, Iterator, Optional, Union, List, Dict, Set
from forte.common.configuration import Config
from forte.common.exception import ProcessExecutionException
from forte.common.resources import Re... | asyml/forte | forte/data/base_reader.py | base_reader.py | py | 14,338 | python | en | code | 230 | github-code | 36 |
30502981495 | #########################################################################
# Iterative server - webserver3b.py #
# #
# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X #
# ... | feng1o/python_1 | socket/server-con/webserver3b.py | webserver3b.py | py | 1,820 | python | en | code | 1 | github-code | 36 |
42522310312 | #WebCrawler é uma ferramenta de captura de informações em sites, cadastrando e salvando o que acha que seja mais relevante por meio de palavras chave
#Importa operadores matematicos
import operator
#Biblioteca de manipulação de estruturas do python
from collections import Counter
from bs4 import BeautifulSoup
i... | CaioNM/S.I.comPython | Aula 04/Web Crawler.py | Web Crawler.py | py | 1,835 | python | pt | code | 0 | github-code | 36 |
37442560200 | """estres forms"""
from django import forms
from estres.models import *
class EstresForm(forms.ModelForm):
class Meta:
model = EstresModel
fields = [
"numero_escenarios",
"horizonte_riesgo",
"fechacorte",
"info_merca... | adandh/Bedu_RiesgosSeguros | estres/forms.py | forms.py | py | 1,467 | python | en | code | 0 | github-code | 36 |
75287915945 |
from PyQt5.QtWidgets import QLabel,QLineEdit,QPushButton,QMessageBox,QWidget,QApplication,QMainWindow,QTextEdit
from PyQt5.QtGui import QFont
import sys,time
getter=str()
getter2=str()
class FirstWindow(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(200, 100, 500, 500)
... | Golibbek0414/PYTHON | imtihonga.py/class1.py | class1.py | py | 3,837 | python | en | code | 0 | github-code | 36 |
75143366504 | import cv2
from model import FacialKeypointModel
import numpy as np
import pandas as pd
from matplotlib.patches import Circle
facec = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
model = FacialKeypointModel("KeyPointDetector.json", "weights.hdf5")
font = cv2.FONT_HERSHEY_SIMPLEX
class VideoCamera(obje... | kartikprabhu20/FacialKeypoints | .ipynb_checkpoints/camera-checkpoint.py | camera-checkpoint.py | py | 1,990 | python | en | code | 0 | github-code | 36 |
21806692940 | import socket
import string
import os
ADDR = ([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][0])
MEDIA_SERVER_ADDRESS = (ADDR,21567)
TRACKER_ADDRESS = (ADDR,21568)
#MEDIA_SERVER_ADDRESS = ('192.168.0.16', 21567) # (serv_ip, serv_port)
#TRACKER_ADDRESS = ('192.168.... | chrishzhao/VideoShare | python/src/Configure.py | Configure.py | py | 4,823 | python | en | code | 6 | github-code | 36 |
28192387095 | # -*- coding: utf-8 -*-
from odoo import models, fields, _, api
class PosPromotionTotalPriceBuyOtherProduct(models.Model):
_name = 'pos.promotion.total.price.buy.other.product'
promotion_id = fields.Many2one('pos.promotion', string='Promotion')
product_id = fields.Many2one('product.product', string='Sản... | zyn1030z/promotion | ev_pos_promotion_total_price_buy_other_product/models/pos_promotion_total_price.py | pos_promotion_total_price.py | py | 1,138 | python | en | code | 1 | github-code | 36 |
8891981416 | from os import access
from tkinter import image_names
import cv2
import dropbox
import time
import random
start_time=time.time()
def take_snapshot():
number = random.randint(0,100)
videoCaptureObject=cv2.VideoCapture(0)
result=True
while(result):
ret,frame=videoCaptureObject.read()... | ARYAN0021/PythonProjectsFinal | SecurityWebCam.py | SecurityWebCam.py | py | 1,223 | python | en | code | 0 | github-code | 36 |
10642138456 | from SPARQLToSQL.parser_helper import *
from SPARQLToSQL.translation_helper import *
from SPARQLToSQL.sql_helper import *
from SPARQLToSQL.mapping import *
# Simple SPARQL query translator
def construct_SQL_object(tp):
pr_list = genPRSQL(tp)
fromClause = SQLTable(alpha(tp))
conditions = genCondSQL(tp)
return SQ... | munkhbayar17/sparql-to-sql | SPARQLToSQL/sql_functions.py | sql_functions.py | py | 13,806 | python | en | code | 1 | github-code | 36 |
74050271464 | import os
from parlai.core.build_data import DownloadableFile
import parlai.core.build_data as build_data
import parlai.utils.logging as logging
RESOURCES = [
DownloadableFile(
'https://raw.githubusercontent.com/uclanlp/gn_glove/master/wordlist/male_word_file.txt',
'male_word_file.txt',
'd4... | facebookresearch/ParlAI | parlai/tasks/genderation_bias/build.py | build.py | py | 1,261 | python | en | code | 10,365 | github-code | 36 |
10211953658 | from collections import defaultdict
import time
import os
#This class represents a directed graph using adjacency list representation
class Graph:
def __init__(self,vertices):
self.V = vertices
self.graph = defaultdict(list)
self.file = open("Result1.txt","a")
# function to add ... | MuhammadAliAhson/Connected_Components_Graphs | Code_To_Find_Connected_Nodes_1.py | Code_To_Find_Connected_Nodes_1.py | py | 4,926 | python | en | code | 5 | github-code | 36 |
40533943010 | import io
import os.path
import pickle
import json
import time
from threading import Thread
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseDownload
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import _G
# Goole Drive ... | ken1882/pyclip_analyze_repeater | datamanager.py | datamanager.py | py | 2,333 | python | en | code | 0 | github-code | 36 |
40961303379 | # coding: utf-8
import argparse
import importlib.util
import inspect
import os
from datetime import datetime
problemas = []
def problema(mensaje, *args):
problemas.append(mensaje.format(*args))
def validar_tiempo(inicio, fin, tope, mensaje):
diferencia = (fin - inicio).total_seconds()
if diferencia > ... | ucse-ia/ucse_ia | 2019/probar_entrega1.py | probar_entrega1.py | py | 9,466 | python | es | code | 5 | github-code | 36 |
5838427982 | from .msg_queue import MsgQueue
class MsgQueueMgr(object):
def __init__(self, queue_capacity):
self.__queue_capacity = queue_capacity
self.__dict = dict()
def clear(self):
for queue in self.__dict.values():
queue.clear()
self.__dict.clear()
def get(self, topic... | maxwell-dev/maxwell-client-python | maxwell/client/msg_queue_mgr.py | msg_queue_mgr.py | py | 665 | python | en | code | 1 | github-code | 36 |
74123444263 | #!/usr/bin/env python
"""Test `crtm_api` module."""
from crtm_poll import crtm_api
from aiohttp import ClientSession
from aioresponses import aioresponses
import os
import pytest
class TestAPI:
def test_can_log_fetch(self, tmpdir):
fetch_path = 'fetch_log'
file = tmpdir.join(fetch_path)
... | cgupm/crtm_poll | tests/test_stop_times.py | test_stop_times.py | py | 1,317 | python | en | code | 0 | github-code | 36 |
11875960821 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 17 13:24:02 2019
@author: stark
"""
import threading
from queue import Queue
from spider import Spider
from domain import *
from utility import *
PROJECT_NAME = 'dragzon'
HOMEPAGE = 'https://dragzon.com'
DOMAIN_NAME = get_domain_name(HOMEPAGE)
QU... | pandafy/WebCrawler | main.py | main.py | py | 1,124 | python | en | code | 0 | github-code | 36 |
31462474999 | # Python built-in modules and packages
from dataclasses import dataclass
from typing import Dict, List, Union, Tuple
# --- Useful type hints ---
TableName = str
DatafieldName = str
PacketType = str
PacketData = Union[int, str, float]
Packet = Dict[DatafieldName, PacketData]
Message = Dict[str, List[Packet]]
RowDB = L... | PerKjelsvik/iof | src/backend/dbmanager/msgconversion.py | msgconversion.py | py | 3,037 | python | en | code | 1 | github-code | 36 |
21186201558 | from datetime import datetime
import pytest
from model_bakery import baker
from mytodo.models import Tarefa
from mytodo.services import tarefa_service
def test_should_get_tarefa_as_pending(db):
my_tarefa = baker.make(Tarefa, description='Create an ansible deploy script', due_to=datetime.now())
assert my_ta... | JonathansManoel/todolist | mytodo/tests/test_tarefa_status.py | test_tarefa_status.py | py | 1,160 | python | en | code | 0 | github-code | 36 |
12027951137 | from solid import (
part,
sphere,
cube,
translate,
hull,
)
from solid.utils import right
from utils import render_to_openscad
def main():
# -> Example 1
ex1 = part()
ex1.add(translate((0, 0, 0))(
cube((5, 5, 5), center=False)
))
ex1.add(translate((0, 10, 0))(
c... | cr8ivecodesmith/py3dp_book | solid_/hull_.py | hull_.py | py | 1,566 | python | en | code | 4 | github-code | 36 |
42334454225 | #!/usr/bin/python2
import socket
import sys
rec_ip="127.0.0.1"
rec_port=4444
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind((rec_ip,rec_port))
while 4 > 2:
data=s.recvfrom(150)
if data[0]=="exit":
sys.exit(0)
else:
print("Message from sender:",data[0])
print("IP and Port Number:",data[1])
reply=r... | ananyabisht07/Python | rec1.py | rec1.py | py | 533 | python | en | code | 0 | github-code | 36 |
70614836904 | a=input()
b=list(a.split())
c=[]
d=[]
for i in range(len(b)):
c.append(max(b[i]))
d.append(min(b[i]))
m=list(map(ord,c))
n=list(map(ord,d))
for i in range(len(m)):
print(abs(m[i]-n[i]),end=" ") | divyasrisaipravallika/codemind-python | absolute_difference_of_small_and_large.py | absolute_difference_of_small_and_large.py | py | 205 | python | en | code | 0 | github-code | 36 |
37826834676 | from Tree_zzh import tree
import queue
class Solution(object):
def sumNumbers(self, root):
"""
:type root: TreeNode
:rtype: int
"""
self.res = 0
self.dfs(root, 0)
return self.res
def dfs(self, root, val):
if root:
self.dfs(root.left, ... | zzhznx/LeetCode-Python | 129-Sum Root to Leaf Numbers.py | 129-Sum Root to Leaf Numbers.py | py | 1,724 | python | en | code | 0 | github-code | 36 |
74261408425 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import time
import random
from twisted.internet import task
from twisted.internet.protocol import DatagramProtocol
from demo.main import reactor
from demo.proto import ProtocolParser
tasks = {}
finished_tasks = {}
class ClientProtoc... | frad00r4/demo_project | demo/modules/client.py | client.py | py | 2,553 | python | en | code | 0 | github-code | 36 |
11336978974 | import ujson
import time
from stepist.flow.libs.simple_queue import SimpleQueue
from stepist.flow.workers.worker_engine import BaseWorkerEngine
from stepist.flow.workers.adapters import utils
class SimpleQueueAdapter(BaseWorkerEngine):
def __init__(self, redis_connection, data_pickler=ujson, verbose=True,
... | electronick1/stepist | stepist/flow/workers/adapters/simple_queue.py | simple_queue.py | py | 3,251 | python | en | code | 27 | github-code | 36 |
18974168832 | from __future__ import print_function
import os
import sys
import pandas as pd
FORMATS = {
'mixcr': ('cloneCount', 'aaSeqCDR3', None),
'changeo_with_sample': ('DUPCOUNT', 'CLONE_CDR3_AA', 'SAMPLE'),
'changeo': ('DUPCOUNT', 'CLONE_CDR3_AA', None),
'vdjtools': ('count', 'cdr3aa', None),
... | NCBI-Hackathons/PyClonal | pyclonal/parser.py | parser.py | py | 2,592 | python | en | code | 5 | github-code | 36 |
1312451969 | """changing viewer layer names
Revision ID: 99ebe4492cee
Revises: b0b51fd07bfa
Create Date: 2023-06-12 15:34:29.609937
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '99ebe4492cee'
down_revision = 'b0b51fd07bfa'
branch_labels = None
depends_on = None
def upg... | seung-lab/AnnotationFrameworkInfoService | migrations/versions/99ebe4492cee_changing_viewer_layer_names.py | 99ebe4492cee_changing_viewer_layer_names.py | py | 1,039 | python | en | code | 1 | github-code | 36 |
73444055143 | # Test der while-Schleife
"""
n = 0
while (n < 5):
print(n)
n = n + 1
"""
"""
Ausgabe:
0
1
2
3
4
"""
# Beliebige Zahlenreihenfolge wird aufsteigend ausgegeben
n = int(input("Bitte geben Sie eine Zahl ein: "))
i = 0
"""
while (i <= n):
print(i)
i = i +
"""
# Geben Sie alle ungeraden Zahlen klei... | feldoe/university | scripts/2019-11-26/while.py | while.py | py | 474 | python | de | code | 0 | github-code | 36 |
28247026448 | import datetime
import time
from playsound import playsound
# using deffunction set the alarm-time
def set_alarm(alarm_time):
while True:
current_time = datetime.datetime.now().strftime("%H:%M:%S")
if current_time == alarm_time:
print("It's an alarm time")
print("Play the al... | Madhusudhan178/Alarm_clock-py | alarm_clock.py | alarm_clock.py | py | 1,033 | python | en | code | 0 | github-code | 36 |
24975211817 | import os
from setuptools import setup, find_packages
from version import get_git_version
def files(folder, exclude=[]):
found_files = []
for root, dirs, files in os.walk(folder):
for f in files:
if not any(("%s/%s" % (root, f)).startswith(e) for e in exclude):
found_files... | opennode/opennode-console | setup.py | setup.py | py | 1,732 | python | en | code | 13 | github-code | 36 |
17233286907 | import argparse
import torch
import torch.nn as nn
import numpy as np
import os
import pickle
from data_loader import get_loader
from build_vocab import Vocabulary
from model import EncoderCNN, DecoderRNN
from torch.nn.utils.rnn import pack_padded_sequence
from torchvision import transforms
# Device configuration
de... | vshantam/ImageCaptioning | train.py | train.py | py | 2,842 | python | en | code | 4 | github-code | 36 |
28856814409 | from __future__ import print_function, absolute_import
import sys
import PyQt4.QtGui as QtGui
import PyQt4.QtScript as QtScript
from PyQt4.QtCore import SIGNAL
app = QtGui.QApplication(sys.argv)
from qtreactor import pyqt4reactor
pyqt4reactor.install()
class DoNothing(object):
def __init__(self):
sel... | ghtdak/qtreactor | qtreactor/gtrial.py | gtrial.py | py | 969 | python | en | code | 50 | github-code | 36 |
20163912786 | from django.db import models
from django.contrib.auth.models import User
# Crear Modelos
class Mueble(models.Model):
nombre=models.CharField(max_length=40)
modelo=models.CharField(max_length=150)
descripcion=models.CharField(max_length=250)
precio=models.FloatField(default='')
imagen=models.ImageFi... | gonzalezmirko/Proyecto-Final-Coder | Proyecto/core/models.py | models.py | py | 2,980 | python | es | code | 0 | github-code | 36 |
28092663576 | from statistics import mean
n, x = (map(int, input().split()))
ar = []
for i in range(x):
ar.append(list(map(float, input().split())))
s = zip(*ar)
for i in s:
print (mean(i))
| Avani18/Hackerrank-Python | 11. Built-Ins/Zipped.py | Zipped.py | py | 188 | python | en | code | 0 | github-code | 36 |
19368162206 | #! /usr/bin/python2.7
import rospy
import datetime
import geometry_msgs.msg
CMD_VEL_TOPIC = "/cmd_vel"
def main():
rospy.init_node("drive_forward_node")
drive_speed = rospy.get_param("~drive_speed")
drive_time = rospy.get_param("~drive_time")
twist_publisher = rospy.Publisher(CMD_VEL_TOPIC, geometry_... | slensgra/robotic-perception-systems-assignment-1 | src/drive_forward_node.py | drive_forward_node.py | py | 1,349 | python | en | code | 0 | github-code | 36 |
18355189069 | from flask import Flask, render_template, request, redirect, session, flash, url_for
from mysqlconnection import connectToMySQL # import the function that will return an instance of a connection
import re # the regex module
from flask_bcrypt import Bcrypt
import sys;
EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@... | full-time-april-irvine/kent_hervey | flask/flask_mysql/FavoriteBooksFlask/fav_books.py | fav_books.py | py | 14,005 | python | en | code | 0 | github-code | 36 |
34892117243 | from django.contrib import admin
from .models import Product, Order, OrderProduct
class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'price', 'quantity', 'product_image')
list_filter = ('price', 'quantity')
search_fields = ('name', 'price')
class OrderAdmin(admin.ModelAdmin):
list_display... | rustamovilyos/raw_materials | app/admin.py | admin.py | py | 817 | python | en | code | 1 | github-code | 36 |
13483897568 | import bpy
from bpy import context
import sys
import os
from os.path import exists
from os.path import splitext
fileArgument = sys.argv[-1]
print("\r\n")
print("Looking for FBX file " + fileArgument + " in working directory:")
print(os.getcwd())
filename = splitext(fileArgument)[0]
if exists(filename + ".fbx"):
... | lmsorenson/PyGeometry | create_scene_from_fbx.py | create_scene_from_fbx.py | py | 3,235 | python | en | code | 4 | github-code | 36 |
11892197760 | class Solution:
def majorityElement(self, nums: List[int]) -> int:
# Approach 1 - Hash Map
# if len(nums) == 1:
# return nums[0]
# hash_map={}
# for i in range(len(nums)):
# if nums[i] in hash_map:
# hash_map[nums[i]]+=1
# ... | bandiatindra/DataStructures-and-Algorithms | Additional Algorithms/LC 169. Majority Element.py | LC 169. Majority Element.py | py | 884 | python | en | code | 3 | github-code | 36 |
41308544644 | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib, GObject
from random import randint
from threading import Thread
from time import sleep
import i3
def do_nothing():
return
def do_nothing(a, b):
return
# needed so one can jump to a specific window on button click.
# there ar... | KillingSpark/i3-Overview | mywindow.py | mywindow.py | py | 8,918 | python | en | code | 0 | github-code | 36 |
30553351838 | '''
statistics.minutes delayed.weather: number of minutes delayed (per month) caused by significant meteorological
conditions that, in the judgment of the carrier, delays or prevents the operation of a flight.
'''
'''
In de opdracht willen ze dat we list_of_airports twee keer gaan gebruiken...
Dit kan... | puppy1004/School-Python | School/Oefentoets2/opgave_2.py | opgave_2.py | py | 1,623 | python | nl | code | 0 | github-code | 36 |
3829993290 | from waflib.Logs import pprint
def options(opt):
opt.load('python')
def configure(conf):
conf.load('python')
if not conf.env.ENABLE_CROSS:
conf.check_python_version((2, 6, 0))
conf.check_python_headers(features='pyext') # Extension-only, no embedded
try:
conf.check_python_module... | ntpsec/ntpsec | pylib/wscript | wscript | 3,341 | python | en | code | 225 | github-code | 36 | |
36978432823 | class Node():
def __init__(self, data):
self.data = data
self.next_node = None
class LinkedList():
def __init__(self):
self.head = None
# adds new node to the end of list
def add(self, data):
node = Node(data)
if (self.head == None):
# list is empty
self.head = node
else:... | scott-ammon/python-stack-queue-ll | linked_list.py | linked_list.py | py | 3,319 | python | en | code | 0 | github-code | 36 |
73103994024 | import datetime
import jwt
from api import app, db
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy import text as sa_text
from sqlalchemy_utils.types.password import PasswordType
class User(db.Model):
id = db.Column(UUID(as_uuid=True), primary_key=True, server_default=sa_text("uuid_generate_v4()")... | Basile-Lequeux/PerfectTripApi | api/models/User.py | User.py | py | 1,587 | python | en | code | 0 | github-code | 36 |
17618492062 | import csv
from messages_sender.model.Contact import Contact
def read_contacts(file_path: str):
file = open(file_path)
csvreader = csv.reader(file)
next(csvreader)
contacts = []
for row in csvreader:
contact = Contact(id=int(row[0]), name=row[1], cell_phone=row[2], email=row[3])
... | andre-luiz-pires-silva/pytest | messages_sender/services/contacts_reader.py | contacts_reader.py | py | 383 | python | en | code | 0 | github-code | 36 |
7994328417 | import pymongo
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
products_db = myclient["products"]
branches_db = myclient["branches"]
order_management_db = myclient["order_management"]
# branches = {
# 1: {"name":"Katipunan","phonenumber":"09179990000"},
# 2: {"name":"Tomas Morato","phonenumber":... | mjimlee/Flask-ecommerce | digitalcafe/database.py | database.py | py | 1,431 | python | en | code | 0 | github-code | 36 |
73451722984 | '''
Lets implement CutAndPaste augmentation
This augmentations can be added as an augmentation in the DataGenerators, but for the sake of keeping this project
simple I am doing this separately and then performing other-augmentations.
This can be considered as the first augmentation of Albumentation augmentations.
ref... | Anshul22Verma/TP_projects | CopyAndPaste/copy_and_paste_augmentation.py | copy_and_paste_augmentation.py | py | 5,384 | python | en | code | 0 | github-code | 36 |
1985519465 | import kivy
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import NumericProperty, ObjectProperty, StringProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.uix.recycleview import RecycleView
from kivy.uix.screenmanag... | djose1164/bank-management-system | src/main.py | main.py | py | 11,784 | python | en | code | 3 | github-code | 36 |
31518478012 | import huobi_eth_client
import poloniex_client
import email_client
class Transfer_ETH():
def transfer_eth_from_huobi_to_poloniex(self, amount=''):
# INVALID: the method of withdraw eth needs trade pw which is not yet supported by the server
print('Start Transferring ETH from Huobi to Poloniex...... | szhu3210/Arbitrage-trader | legacy/transfer_eth.py | transfer_eth.py | py | 4,497 | python | en | code | 5 | github-code | 36 |
6667647383 | from flask import request, jsonify, abort, Blueprint
import requests
import json
from app import models
from .authRoutines import *
likeRoutes = Blueprint('likesBp', __name__)
# {authToken: xxxx, like: 0, betId: xxxx}
# {authToken: xxxx, like: 1, betId: xxxx}
@likeRoutes.route('/like/update', methods=['POST'])
def ... | ThreeOhSeven/Backend | app/likesBp.py | likesBp.py | py | 1,828 | python | en | code | 0 | github-code | 36 |
27977157667 | import os
from django.core.exceptions import ValidationError
def validate_recording_file_extension(value):
# [0] returns path+filename, [1] returns the extension
extension = os.path.splitext(value.name)[1]
# Add/Remove from the valid music file extensions as you see fit
valid_extensions = ['.mp3','.o... | Trainzack/MarkTime | MarkTimeSite/MarkTimeApp/validators.py | validators.py | py | 443 | python | en | code | 0 | github-code | 36 |
34954108287 |
import logging
import apache_beam as beam
from etl_operations.models.remittances import RemittanceSchema
from etl_operations.transforms.left_join import LeftJoin
def filter_remittance(remittance):
schema = RemittanceSchema()
errors = schema.validate(remittance)
logging.info(f'{errors} - {errors == {}} - ... | luisarboleda17/etls_valiu | etl_operations/etl_operations/transforms/remittances.py | remittances.py | py | 2,088 | python | en | code | 1 | github-code | 36 |
30349073082 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('paper', '0010_auto_20160131_0616'),
]
operations = [
migrations.AddField(
model_name='paper',
name='... | sychen1121/paper_label | website/paper/migrations/0011_paper_time_final.py | 0011_paper_time_final.py | py | 414 | python | en | code | 0 | github-code | 36 |
27543338589 | def count(word,character):
total = 0
for letter in word:
if letter == character:
total = total + 1
return total
inpword = input('Please enter a word: ')
inpletter = input('Please enter the letter you would like to count: ')
total = count(inpword, inpletter)
print(total) | kmcad/class-work | lettercount.py | lettercount.py | py | 303 | python | en | code | 0 | github-code | 36 |
30864450241 | import torch
from torch.utils.data import Dataset
import numpy as np
from pathlib import Path
from synthesizer.utils.text import text_to_sequence
class SynthesizerDataset(Dataset):
def __init__(self, metadata_fpath: Path, mel_dir: Path, embed_dir: Path, hparams):
print("Using inputs from:\n\t%s\n... | IronIron2121/not_i | modules/synthesizer/synthesizer_dataset.py | synthesizer_dataset.py | py | 4,028 | python | en | code | 0 | github-code | 36 |
7537125263 | from __future__ import print_function
import six
from six.moves.html_parser import HTMLParser
from collections import defaultdict
from itertools import count
HTMLP = HTMLParser()
class SugarEntry:
"""Define an entry of a SugarCRM module."""
_hashes = defaultdict(count(1).next if hasattr(count(1), 'next') else... | gddc/python_webservices_library | sugarcrm/sugarentry.py | sugarentry.py | py | 7,119 | python | en | code | 46 | github-code | 36 |
6829356831 | import re
import time
from os import environ
from datetime import datetime
from mkdocs.config import config_options
from mkdocs.plugins import BasePlugin
from .gitinfo import GitInfo
class GitShowHistoryLogPlugin(BasePlugin):
config_scheme = (
('max_number_of_commits', config_options.Type(int, default=5)),... | pawelsikora/mkdocs-git-show-history-log-plugin | mkdocs_git_show_history_log_plugin/plugin.py | plugin.py | py | 1,784 | python | en | code | 2 | github-code | 36 |
4062839778 | import turtle
def main():
## Draw a partial moon.
t = turtle.Turtle()
t.hideturtle()
drawDot(t, 0, 0, 200, "orange") # Draw moon.
drawDot(t, -100, 0, 200, "white") # Take bite out of moon.
def drawDot(t, x, y, diameter, colorP):
## Draw dot with center (x, y) having color colorP.
... | guoweifeng216/python | python_design/pythonprogram_design/Ch6/6-3-E13.py | 6-3-E13.py | py | 399 | python | en | code | 0 | github-code | 36 |
42152798528 | #! Lianjia_Sold/sync2es.py
# synchronize data in MongoDB to ElasticSearch with updating item
from pymongo import MongoClient
from datetime import datetime
from uuid import uuid1
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
# import json
class MongoSyncEs(object):
def __init__(se... | feelingu1314/lianjia | lianjia_sold/lianjia_sold/sync2es.py | sync2es.py | py | 4,288 | python | en | code | 0 | github-code | 36 |
13834428775 | #!/usr/bin/env python3
import json
import os
from sys import argv
import clap
import bearton
# Building UI
args = clap.formater.Formater(argv[1:])
args.format()
_file = os.path.splitext(os.path.split(__file__)[-1])[0]
uipath = os.path.join(bearton.util.getuipath(), '{0}.json'.format(_file))
builder = clap.builder... | marekjm/bearton | ui/bearton-init.py | bearton-init.py | py | 3,312 | python | en | code | 0 | github-code | 36 |
955279052 | pkgname = "perl-json"
pkgver = "4.10"
pkgrel = 1
build_style = "perl_module"
hostmakedepends = ["gmake", "perl"]
makedepends = ["perl"]
checkdepends = ["perl-test-pod"]
depends = ["perl"]
pkgdesc = "JSON encoder/decoder"
maintainer = "q66 <q66@chimera-linux.org>"
license = "Artistic-1.0-Perl OR GPL-1.0-or-later"
url = ... | chimera-linux/cports | main/perl-json/template.py | template.py | py | 483 | python | en | code | 119 | github-code | 36 |
5209753399 | import os
import bs4
import requests
import re
import time
def main():
# from alphabet "a" to "c"
alphabetical_list = "abc"
for char in alphabetical_list:
try:
url = "https://www.gutenberg.org/browse/authors/{}".format(char)
site = pull_site(url)
authors = scrape_author(site)
print(authors)
except... | zabuchan/web_scraping | show_gutenberg_authors.py | show_gutenberg_authors.py | py | 1,662 | python | en | code | 0 | github-code | 36 |
40861536656 | import numpy as np
from dataclasses import dataclass
import random
from image_multi_thresholding.base import _between_class_var, _image_probabilities
"""
Find thresholds of the gray levels using shuffled frog-leaping algorithm with between
class variance as fitness function.
"""
def _is_valid_frog(frog, L):
re... | image-multithresholding/Image-multithresholding | src/image_multi_thresholding/threshold/sfl.py | sfl.py | py | 4,404 | python | en | code | 1 | github-code | 36 |
36896022139 | import dns.exception
import dns.name
import dns.resolver
public_enum_domain = dns.name.from_text('e164.arpa.')
def from_e164(text, origin=public_enum_domain):
"""Convert an E.164 number in textual form into a Name object whose
value is the ENUM domain name for that number.
@param text: an E.164 number in ... | RMerl/asuswrt-merlin | release/src/router/samba-3.6.x/lib/dnspython/dns/e164.py | e164.py | py | 2,142 | python | en | code | 6,715 | github-code | 36 |
43046798509 | from data_process import empty_extractor
import random
import numpy as np
import os
DATA_DIR = 'D:\home\zeewei\projects\\77GRadarML\classification_train_data'
PROCESSED_DATA_DIR = 'D:\home\zeewei\projects\\77GRadarML\classification_train_data'
PLAYGROUND_TRAIN_DATA_INPUT = os.path.join(DATA_DIR, 'pg_train_data.npy')
... | wzce/77GRadarML | data_process/empty_radar_data.py | empty_radar_data.py | py | 3,029 | python | en | code | 6 | github-code | 36 |
2648456516 | from entities.basic import Roomspace
from entities.boxes import Box
from src.text import *
class MapRoom(Roomspace):
# A MapRoom is an overworld scene. There won't be any items but
# locations and directions can still be uncovered.
def __init__(self, name):
Roomspace.__init__(self, name)
... | crashonthebeat/ifrpg-engine | entities/rooms.py | rooms.py | py | 4,361 | python | en | code | 0 | github-code | 36 |
31489463671 | from flask import Flask
from flask import render_template
from flask import request
from urllib.parse import quote
from urllib.request import urlopen
import json
app = Flask(__name__)
OPEN_WEATHER_URL = "http://api.openweathermap.org/data/2.5/weather?q={0}&units=metric&APPID={1}"
OPEN_WEATHER_KEY = '36c7941... | pacharasiri/news-app-61102010154 | app.py | app.py | py | 3,173 | python | en | code | 0 | github-code | 36 |
11686525581 | from pynamodb.models import Model
from pynamodb.attributes import (
UnicodeAttribute,
UnicodeSetAttribute,
NumberAttribute,
BooleanAttribute,
MapAttribute,
UTCDateTimeAttribute
)
from datetime import datetime
class WatchingList(Model):
"""
References:
https://pynamodb.readthedo... | tanlin2013/stockbot | .aws/stack/lib/dynamo/table.py | table.py | py | 603 | python | en | code | 0 | github-code | 36 |
21477703253 | import sys
sys.setrecursionlimit(100000000)
def getParents(a):
# 종료 조건
if parents[a] == a:
return a
parents[a] = getParents(parents[a]) #경로 최적화
return parents[a]
def union(a, b):
a = getParents(a)
b = getParents(b)
if a == b: return
if a < b: parents[b] = a
else: parents[a]... | Minsoo-Shin/jungle | week03/1717_집합의표현.py | 1717_집합의표현.py | py | 838 | python | en | code | 0 | github-code | 36 |
27073968555 | from itertools import count
from geopy.distance import geodesic
from datetime import timedelta, datetime
import json
import sys
import random
time_format = '%Y-%m-%d %H:%M:%S'
default_start = datetime.strptime('2020-01-01 00:00:00', time_format)
default_end = datetime.strptime('2020-06-30 23:59:59', time_format)
myica... | guillaumemichel/aircraft-privacy-simulator | structures.py | structures.py | py | 12,932 | python | en | code | 0 | github-code | 36 |
30067750251 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import pandas as pd
# Definición de funciones de activación y su derivada
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_derivative(x):
return x * (1 - x)
# Clase para la red neuronal
class NeuralNetwork:
de... | Kenayman/Perceptron-simple | Ejercicio4.py | Ejercicio4.py | py | 4,365 | python | en | code | 0 | github-code | 36 |
10667830718 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 21 21:35:24 2021
@author: kanikshasharma
"""
import random
def randomSolution(pdp):
dlocation = list(range(len(pdp)))
solution = []
for i in range(len(pdp)):
randomlocation = dlocation[random.randint(0, len(dlocation) - 1)]
... | kanikshas4/hill-climbing-project | hill climbing ai project.py | hill climbing ai project.py | py | 2,061 | python | en | code | 0 | github-code | 36 |
36420895419 | #!/usr/bin/env python
# coding: utf-8
# # KSHEMA S
#
# TCS iON INTERNSHIP
# RIO-125:HR Salary Dashboard - Train the Dataset and Predict Salary
# # Problem statement
# This project aims to sanitize the data, analysis and predict if an employee's salary is higher or lower than $50K/year depends on certain attributes ... | Kshema85/TCS-iON--KSHEMA-HR-Salary-prediction | model1.py | model1.py | py | 12,261 | python | en | code | 0 | github-code | 36 |
856254777 | #!/usr/bin/env python
from pyhesity import *
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--vip', type=str, default='helios.cohesity.com')
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-d', '--domain', type=str, default='local')
parser.add_ar... | bseltz-cohesity/scripts | python/firewallTool/firewallTool.py | firewallTool.py | py | 4,351 | python | en | code | 85 | github-code | 36 |
23966932572 | #
# Process WRF solution file
#
# written by Eliot Quon (eliot.quon@nrel.gov)
#
from __future__ import print_function
import sys, os
import numpy as np
#from netCDF4 import Dataset
from netCDF4 import Dataset, MFDataset
try:
import xarray
except ImportError:
have_xarray = False
else:
print('xarray reader av... | NWTC/datatools | WRF/solution.py | solution.py | py | 4,452 | python | en | code | 2 | github-code | 36 |
29111172736 | #1. 정렬이 있는 순차 검색 [중복 허용 ]
# 정렬이 되어있는 배열의 순차검색 정의
def seqSearch( ary , fdata ) :
poslist = []
size = len(ary)
for i in range( size ) :
if ary[i] == fdata :
# pos = i
poslist.append( i )
elif ary[i] > fdata :
break
return poslist
# 전역변수
dataAry = [ 188 ... | itdanja/week_python_202206 | 7일차/예제4_순차검색.py | 예제4_순차검색.py | py | 709 | python | ko | code | 0 | github-code | 36 |
23873430764 | import hashlib
import plistlib
import dictionary
from file import File
from macho import MachO
from math import exp, log
from symbol import Symbol
from signature import Signature
from universal import Universal
from ctypescrypto import cms, oid
from abnormality import Abnormality
from certificate import Certificate
fr... | own2pwn/macholibre | src/macholibre/parser.py | parser.py | py | 31,156 | python | en | code | null | github-code | 36 |
36494224748 | import os
import json
import platform
from os import path
from time import sleep
import winsound
from win10toast import ToastNotifier
toaster = ToastNotifier()
# assets
APP_ICO = path.join("assets","app.ico")
COFFEE_ICO = path.join("assets","coffee.ico")
TAUNT_WAV= path.join("a... | roshansai24081/Sedentary-alert | _app.py | _app.py | py | 1,172 | python | en | code | 0 | github-code | 36 |
14126041012 | from re import split
from itertools import zip_longest
from more_itertools import windowed
from pyperclip import copy as ctrl_C
Lboth = []
for filename in ["input/in22_test.txt", "input/in22_real.txt"]:
with open(filename,"r") as infile:
gridstr,inststr = infile.read().split('\n\n')
gridLR = [list(filter(lambda p... | arguhuh/AoC | 2022/code22.py | code22.py | py | 4,619 | python | en | code | 0 | github-code | 36 |
10516160537 | def frequences(str):
mot = ''
dict = {}
for i in str:
if i == ' ' and mot != '':
dict[mot] = dict.get(mot,0) +1
mot = ''
else:
mot += i
if mot != '':
dict[mot] = dict.get(mot,0) +1
return dict
def plus_frequents(str):
res = ''
m... | Mazen2378/.config | aymen/serie3/ex1.py | ex1.py | py | 620 | python | en | code | 0 | github-code | 36 |
335981878 | import os, wx, atexit
class StickyNotes():
def __init__(self):
self.save_exists = False
self.list = [""]
self.list_to_save = []
def run(self):
self.check_file()
for line in self.list:
frame = StickyFrame(None, 'Sticky Note', line)
def check_file(self):
... | Ghrehh/stickynotes | stickynotes.py | stickynotes.py | py | 1,750 | python | en | code | 0 | github-code | 36 |
5571273421 | from django.contrib import admin
from django.contrib.admin.options import TabularInline
from apps.info_section_app.models import SimilarLike, SimilarDislike, SimilarTitle, \
Favorite, RelatedTitle
class SimilarLikeAdminInLine(TabularInline):
extra = 1
model = SimilarLike
class SimilarDislikeAdminInlin... | urmatovnaa/Manga-universe | apps/info_section_app/admin.py | admin.py | py | 592 | python | en | code | 0 | github-code | 36 |
34696107762 | #!/usr/bin/env python3
# coding : utf-8
# @author : Francis.zz
# @date : 2023-07-28 15:30
# @desc : 使用网页的session key访问chat gpt
from revChatGPT.V1 import Chatbot
import json
"""
使用 `pip install --upgrade revChatGPT` 安装依赖包
使用文档说明:https://github.com/CoolPlayLin/ChatGPT-Wiki/blob/master/docs/ChatGPT/V1.md
1. 可以使用用户名... | zzfengxia/python3-learn | gpt/chatgpt_conversion.py | chatgpt_conversion.py | py | 1,355 | python | zh | 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.