blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 2 333 | src_encoding stringclasses 30
values | length_bytes int64 18 5.47M | score float64 2.52 5.81 | int_score int64 3 5 | detected_licenses listlengths 0 67 | license_type stringclasses 2
values | text stringlengths 12 5.47M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
b739a61e9f5732aa158cc34d08b5270cb1a52726 | Python | ROMSOC/benchmarks-acoustic-propagation | /source/03_scattering_pu_probe/mpp_impedance.py | UTF-8 | 2,280 | 2.84375 | 3 | [
"MIT"
] | permissive | # ------------------------------------------------------------------ #
# ╦═╗╔═╗╔╦╗╔═╗╔═╗╔═╗
# ╠╦╝║ ║║║║╚═╗║ ║║
# ╩╚═╚═╝╩ ╩╚═╝╚═╝╚═╝
# Reduced Order Modelling, Simulation, Optimization of Coupled Systems
# 2017-2021
#... | true |
852ea9b2545d3030cbc0051bf7df62259eea942d | Python | tmkasun/apim_pyclient | /mock_servers/simple_websocket.py | UTF-8 | 2,337 | 2.828125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import asyncio
import ssl
import websockets
from websockets import WebSocketServerProtocol
# Simple WS server for testing APIM WS APIs
"""
http://websockets.readthedocs.io/en/stable/deployment.html#port-sharing
"""
class SimpleServer(WebSocketServerProtocol):
async def process_request(sel... | true |
fed5f7b7337032b65fce37e77c20949996a89877 | Python | Aasthaengg/IBMdataset | /Python_codes/p03130/s322520079.py | UTF-8 | 237 | 2.984375 | 3 | [] | no_license | from collections import Counter
import sys
A = []
for i in range(3):
a,b = map(int,input().split())
A.append(a)
A.append(b)
c = Counter(A)
for i in c.values():
if i >=3:
print('NO')
sys.exit()
print('YES') | true |
a98c8ea2d6eba37291f97a58d5ad4a635af44aa0 | Python | brunofurmon/challenge-bravo | /src/contracts/currencyconversion/currencyconversionapi.py | UTF-8 | 1,518 | 3.15625 | 3 | [] | no_license | import types
class CurrencyConversionApi(type):
def __new__(cls, name, bases, attr):
# Check upon existence of a string list called 'validCurrencies' for the integration subclass
# Verifies if there are any None or '' or non-str types
if not 'validCurrencies' in attr \
or n... | true |
d6bea34b803c3c2e49d755de0df84bad2c0634a6 | Python | MaDITIY/TerminalCalculator | /test/test_parser.py | UTF-8 | 1,684 | 2.796875 | 3 | [] | no_license | """Test module to test parser module."""
import ddt
from unittest import TestCase
from pycalc import exeptions
from pycalc import parser
@ddt.ddt
class TestParser(TestCase):
"""Test class to test parser module."""
@ddt.data(
(('2 + 2', ), ('2 + 2', [])),
(('2 + 2', '-m', 'module'), ('2 + 2'... | true |
f08e253e629f929446edaf9346a0ffefdd6f58d9 | Python | Rajiv-Nayan/HackerRank-Regex | /Introduction/Matching Start & End.py | UTF-8 | 115 | 2.640625 | 3 | [
"MIT"
] | permissive | Regex_Pattern = r"^\d{1}\w{4}[.]{1}$"
import re
print(str(bool(re.search(Regex_Pattern, input()))).lower())
| true |
2f94bca8063cdd6f49bd5e24f581f5d01c48594c | Python | snckmykek/magicbox | /contents/budget/reports/report_maker.py | UTF-8 | 2,204 | 2.671875 | 3 | [] | no_license | from kivy.lang import Builder
from kivy.uix.modalview import ModalView
import pandas as pd
import sqlite3
Builder.load_file(r'contents/budget/reports/report_maker.kv')
class ReportMaker(ModalView):
def __init__(self, **kwargs):
super(ReportMaker, self).__init__(**kwargs)
def get_report(self):
... | true |
a62f3e462c9170c44e38bc4bed30dbd933ed0e6b | Python | leohakim/dontforget-backend | /app/server/database.py | UTF-8 | 2,930 | 2.734375 | 3 | [] | no_license | """ Persistence Classes and methods """
from app.config import settings
import motor.motor_asyncio
from bson.objectid import ObjectId
from datetime import datetime
client = motor.motor_asyncio.AsyncIOMotorClient(settings.MONGODB_URL)
database = client.dontforget
task_collection = database.get_collection('dontforget')
... | true |
9991faba506a57fa463242c6995bf0117e7061b3 | Python | yunjoon-soh/Spring2017_CSE360_Project1 | /GenerateX.py | UTF-8 | 1,151 | 2.9375 | 3 | [] | no_license | #!/usr/bin/python
import sys
ARGC=len(sys.argv) # python does not have argc
if(ARGC < 2):
print 'Usage: ' + sys.argv[0] + ' [NUMBER OF %08X]'
print 'Usage: ' + sys.argv[0] + ' [STARTING NUMBER I FOR %I$8X] [ENDING NUMBER J FOR %J$8X]'
exit(1)
# base of the string
STR="e "
# NEW_LINE=4 # \n does not work for pre... | true |
ec548e8fa5bbf9738f88ba2c82a1dc41c117a9a2 | Python | 15110500442/2017-python- | /day12/多继承.py | UTF-8 | 676 | 2.9375 | 3 | [] | no_license | class Aaimal(object):
def zu(self):
print('祖宗')
class Ma(Aaimal):
def __init__(self):
zi_G = '有'
def fly(self):
print('飞')
def heihei(self):
print('我会嘿嘿')
def zu(self):
print('我是新祖宗')
class Lv(Aaimal):
def __init__(self):
BZ = '有'
def swin(self... | true |
38cbc861a4c94c295fc9562747fcf92f5010c2ec | Python | sjbitcode/panchang | /panchang/helpers/utils.py | UTF-8 | 3,095 | 3.484375 | 3 | [] | no_license | import datetime
import pytz
from panchang.settings import CELERY_TIMEZONE
def get_date_obj():
return datetime.datetime.now(pytz.timezone(CELERY_TIMEZONE))
def string_padding(key, width=21):
'''
Returns appropriate whitespace string
for left padding.
'''
padding = ' ' * abs(width - len(key))... | true |
13078892fcbc2a69517c4af2ac314ba0926e2348 | Python | pabloruancoder/aula-pec-2020 | /atividade002.py | UTF-8 | 130 | 3.390625 | 3 | [] | no_license | def letra(a):
return ord(a)
def main():
a = str(input())
print(f'{letra(a)}')
if __name__ == "__main__":
main()
| true |
79f60892c667bcc4500651a6c6e10f2667fec889 | Python | victor4107/ddddddddd | /lab4/main.py | UTF-8 | 1,721 | 3.109375 | 3 | [] | no_license | import psycopg2
from tabulate import tabulate
class Psql:
def __init__(self, password, dbname = 'postgres', user ='postgres', host='localhost'):
self.conn = psycopg2.connect(dbname = dbname,
user = user,
password = password,
... | true |
dd2ca2c8f6d843ffa4e718c8b4f2825ce65fb8e3 | Python | chuckkang/greatgame | /server.py | UTF-8 | 918 | 2.84375 | 3 | [] | no_license | from flask import Flask, render_template, request, redirect, session
import random
app = Flask(__name__)
app.secret_key = "thisisasecret"
@app.route('/', methods=['POST', 'GET'])
def index():
isCorrect=False
errMsg = False
if (request.method=="GET"):
#create random variable
session['rnd']... | true |
9f3f21dfec0c57cdafbc46fb3610deb98119f824 | Python | kaneron676/PyIPS | /end_program.py | UTF-8 | 3,302 | 2.625 | 3 | [] | no_license | import smtplib
import ssl
import os.path
import subprocess
import re
import time
from datetime import date
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
class EndProgram:
def __init__(self):
self.port = 465
self.ips_email_address = ""
self.admin_email... | true |
84101fb2e704b5b743e96e32d9b4347b507709af | Python | moracarlos/Face-recognition-surveillance-system | /recognizer/src/oldMain.py | UTF-8 | 2,240 | 2.640625 | 3 | [] | no_license | import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import cv2
import numpy as np
from csvmaker import CSVmaker
def read_csv():
images = []
labels = []
fileName = "./assets/faces/faces.csv"
with open(fileName) as f:
content = f.readlines()
for l in content:
... | true |
17693b0c3bd32a449cc3dc9acf39fedacc817759 | Python | stephenluc/AdventOfCode2017 | /06_code.py | UTF-8 | 1,323 | 3.296875 | 3 | [] | no_license | def memory_reallocation(blocks):
redistribution = 0
states = set()
seen_state = False
while not seen_state:
distribute_memory = max(blocks)
curr_index = blocks.index(distribute_memory)
blocks[curr_index] = 0
while distribute_memory > 0:
curr_index += 1
... | true |
310de8aa8be29f6601e53c57a6fd355a8ff018d4 | Python | georgianamaxim/flcd | /lab3/fa.py | UTF-8 | 3,870 | 3.59375 | 4 | [] | no_license | import re
class FiniteAutomata(object):
def __init__(self):
self.__set_of_states = []
self.__alphabet = []
self.__initial_state = ""
self.__final_states = []
self.__transitions = {}
self.read_fa()
def read_fa(self):
with open("fa.txt", "r") as f:
... | true |
bd5d9fd15f69e833257c2d475e660c26e749d517 | Python | meredytheco/bioagents | /bioagents/bionlg/bionlg_module.py | UTF-8 | 2,795 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | import sys
import json
import logging
logging.basicConfig(format='%(levelname)s: %(name)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger('BIONLG')
from indra.statements import stmts_from_json
from indra.assemblers import EnglishAssembler
from kqml import *
class BioNLGModule(KQMLMo... | true |
fdb27700f14444f7d47a92872d197b9fb46e2acc | Python | nocheacosador/UPLS | /UPLS_Py/utils/determine_shiboken_version.py | UTF-8 | 590 | 2.59375 | 3 | [] | no_license | import os, sys
sys.path.append('/usr/local/bin')
def clean_path(path):
return path if sys.platform != 'win32' else path.replace('\\', '/')
def find_package_path(dir_name):
for p in sys.path:
package = os.path.join(p, dir_name)
if os.path.exists(package):
return clean_path(os.path.... | true |
6336aa5f8b1c7224e60d060c68a9d92bbcfecfa5 | Python | afrench14/PetGame-OOP | /PetGame_MainCode.py | UTF-8 | 2,876 | 3.65625 | 4 | [] | no_license | class Pet:
#constructor
def __init__(self, petName, petType):
#setting attributes with an initial value
self.petName = petName
self.petType = petType
self.bored = 0
self.hunger = 50
self.intelligence = 50
self.alive = True
self.entertained = True
self.educated = True
#show h... | true |
e2bd49acdebcd032d36f0acca428b118b461d178 | Python | famaxth/Way-to-Coding | /Python/Grades.py | UTF-8 | 256 | 3.65625 | 4 | [] | no_license | mark = int(input("Enter your mark out of 100 : "))
if(mark>90):
print("A+")
elif(mark<=90 and mark >=80):
print("A")
elif(mark<80 and mark >=70):
print("B")
elif(mark<70 and mark >=60):
print("C")
elif(mark<60):
print("D")
| true |
5c1c85e8a54d724d12a144c522279a8f4a9f7025 | Python | cat-in-the-dark/ludum_43_game | /python/examples/line_prisma_draw.py | UTF-8 | 759 | 2.765625 | 3 | [
"MIT"
] | permissive | import jvcr
import math
base = jvcr.DISPLAY_HEIGHT - 1
PI_8 = math.pi / 8
PI_2 = math.pi * 2
t = 0
GREEN = 11
RED = 8
GREY = 6
BLACK = 0
def update(dt):
global t
jvcr.cls(BLACK)
i = math.fmod(t, 8.0)
while i < base:
jvcr.line(i, 0, 0, base - i, RED)
jvcr.line(i, base, base, 143 - i,... | true |
2ef9cf63b8dcfbd4ef233e2ebc4425d5861dbcfc | Python | portal2312/blog | /docs/develop/N-Z/Python/lib/twisted/study/OReilly.Twisted.Network.Programming.Essentials.2nd.Edition/chapter_7/part_1/logging_echoserver.py | UTF-8 | 668 | 2.546875 | 3 | [] | no_license | # -*- coding:utf8 -*-
from twisted.internet import protocol, reactor
from twisted.python import log
import sys
class Echo(protocol.Protocol):
def dataReceived(self, data):
log.msg(data)
self.transport.write(data)
class EchoFactory(protocol.Factory):
def buildProtocol(self, a... | true |
5621335f0007b57bf7229bf810690c4eddbb8d8e | Python | 02stevenyang850527/EECS504Final_AVSpeechSeparation | /ICA/ICA.py | UTF-8 | 3,808 | 2.78125 | 3 | [] | no_license | import numpy as np
import sys
import scipy.io.wavfile as wavfile
#########################
### Utility Functions ###
#########################
def mix_audio(wav_list, sr=16000, output_name='mixed.wav'):
audio_num = len(wav_list)
source = np.zeros((sr*3, audio_num))
for idx, file_name in enumerate(wav_list):... | true |
81d6bb2d5bbe3e8d34b31295f3e170314a7b3423 | Python | Soham-Rakhunde/VInLP | /VideoProcessor.py | UTF-8 | 4,436 | 2.5625 | 3 | [] | no_license | import threading
import cv2
import concurrent.futures
from dataClass import DataClass
from webScraper import Scraper
import numpy as np
class VideoProcessor:
def __init__(self, vidPath):
self.capture = cv2.VideoCapture(vidPath.name)
FPS = self.capture.get(cv2.CAP_PROP_FPS)
self.FRAME_SKIP ... | true |
b4c194f6d9ebdb61111d13898a9176a10a42b005 | Python | niudong1001/word-embed-api | /embed_server.py | UTF-8 | 6,027 | 2.9375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.restful import Resource, Api, reqparse
from gensim.models.word2vec import Word2Vec
import argparse
import json
import numpy as np
import random
parser = reqparse.RequestParser()
app = Flask(__name__)
api = Api(app)
def verify_words_exist(words):
if ... | true |
e54553d13cf2c9af50c3286abf7b45a8e82ca7d4 | Python | ahhnljq/GAN_PID | /simulate_delta_gan.py | UTF-8 | 1,568 | 2.703125 | 3 | [
"MIT"
] | permissive | import numpy as np
from utils_log import MetricSaver
data = 1.
delta_t = 0.01
class GAN_simualte(object):
def __init__(self, gantype, controller_d, damping):
self.type = gantype
self.controller_d = controller_d
self.damping = damping
self.d = 0.
self.g = 0.
def d_step... | true |
1d87d8a1a672bae9ca6a4c0465208d02add82d73 | Python | aajshaw/Ringable-Ensemble | /Methods.py | UTF-8 | 17,105 | 2.78125 | 3 | [
"Unlicense"
] | permissive | from threading import Thread
import socket
from time import sleep
from sys import byteorder
from Config import Config
import configparser
from Row import Row
import os
import sys
from random import randrange
def bell_indicators(MAX_BELLS,
INDICATE_BELL_NUMBER_SHIFT,
INDICATE_BEL... | true |
509c4c2539a8837b6642f2888cf6a41fa4bc87b6 | Python | g1ibby/GA | /genetics/cross.py | UTF-8 | 1,383 | 3.171875 | 3 | [] | no_license | __author__ = 'swaribrus'
import itertools
import random
def one_point_crossover(length):
point = random.randint(0, length)
yield from itertools.repeat(True, point)
yield from itertools.repeat(False, length - point)
def two_point_crossover(length):
point1, point2 = sorted(random.randint(0, length) f... | true |
c081947ea15be45988dc840a894c88b557f935e3 | Python | codicuz/gb_python | /Lesson03/task2.py | UTF-8 | 879 | 3.890625 | 4 | [] | no_license | '''
2. Реализовать функцию, принимающую несколько параметров, описывающих данные пользователя:
имя, фамилия, год рождения, город проживания, email, телефон. Функция должна принимать параметры
как именованные аргументы. Реализовать вывод данных о пользователе одной строкой.
'''
def user_function(name, surname, year_o... | true |
3e25b85555634100f33dd6053a4052d589035e16 | Python | Pfliger/Decorators | /main.py | UTF-8 | 2,909 | 3.40625 | 3 | [] | no_license | import json
import hashlib
from datetime import date, datetime
class CountryReader():
def __init__(self, file_name: str):
self.cursor = - 1
with open(file_name, 'r', encoding='utf8') as file:
self.countries = json.load(file)
def __iter__(self):
return self
def __next_... | true |
31c45a21302f826c9d1dfd7ff8696f9727b43215 | Python | Evan1987/BaseML | /Python_ML_and_Kaggle/chap02_linearsvc_svc.py | UTF-8 | 1,724 | 2.796875 | 3 | [] | no_license |
# coding: utf-8
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.svm import LinearSVC, SVC
from sklearn.datasets import load_digits
from sklearn.metrics import classification_report, roc_curve, auc
digits = load_... | true |
662cf9b9c641c441c2b70a7f1ef7c7f7a23acb06 | Python | 07kshitij/CS60075-Team-11-Task-1 | /Models/NeuralNet.py | UTF-8 | 589 | 2.609375 | 3 | [
"MIT"
] | permissive | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
class NN(nn.Module):
def __init__(self, embedding_dim):
super(NN, self).__init__()
self.linear1 = nn.Linear(embedding_dim, 128, bias=True)
self.linear2 = nn.Linear(128, 256, bias=True)
self.linear3 = nn.Lin... | true |
0dbe121f8c8a80919a9a1623d1ca4f49e02c72a9 | Python | dmitry-shaurov/-homework-itmo2018-dmitryshaurov | /task_exception_free_land.py | UTF-8 | 871 | 3.5625 | 4 | [] | no_license | def get_free_land(area, bed):
area_square = area[0] * 100
bed_square = bed[0] * bed[1]
area_lenth_k = int(area[1].split(":")[0])
area_width_k = int(area[1].split(":")[1])
k = area_square / (area_lenth_k * area_width_k)
area_lenth = area_lenth_k * k
area_width = area_width_k * k
if area[0... | true |
b09785d3a8c194d9205cffd993a07842d045657a | Python | hanseaston/stock-analysis-engine | /analysis_engine/perf/profile_algo_runner.py | UTF-8 | 1,803 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | """
Example tool for to profiling algorithm performance for:
- CPU
- Memory
- Profiler
- Heatmap
The pip includes `vprof for profiling algorithm code
performance <https://github.com/nvdv/vprof>`__
#. Start vprof in remote mode in a first terminal
.. note:: This command will start a webapp on port ``3434``
... | true |
b4dd3f5145c7d7e51b4123cf3d22634726050a56 | Python | Onebigbera/Daily_Practice | /test/sorting_algorithm/simple_selection_sort.py | UTF-8 | 2,039 | 4.3125 | 4 | [] | no_license | # -*- coding: utf-8-*-
# ****************Second One ****************
"""
简单选择排序(simple_selection_sort) 时间复杂度O(N^2)
通过n-1次关键字之间的比较,从n-i+1个记录中选出关键字最小的记录,并和第i(1<=i<=n)个元素护换位置
通俗的说,对尚未完成排序的所有元素,从头到尾比较一边,记录下来最小的那个元素的下标,也就是该元素的位置,再把该元素教化到当前遍历的最前面,其效率住处在于:每一轮进行了很多的比较,却只交换一次。因为它的时间复杂度也是O(n^2)但还是要比冒泡排序要好一点。
"""
__au... | true |
e667130e5e4c6bf2ee56b6651b52fdac242fa89d | Python | vishalpatil0/Python-cwh- | /dictionary-1.py | UTF-8 | 283 | 3.421875 | 3 | [] | no_license | #program to take create dictionary and take input (keys) from user and give the result which is value
d1={"vishal":"patil","namrata":"badge","mayur":"dhakane"}
search=input("please give the keys = ")
if(d1.get(search)==None):
print("go to hell")
else:
print(d1[search])
| true |
2ab114caf9609481b12d81d7439c21a08a51b779 | Python | spanneerselvam/Cracking-The-Code-Problems | /DataStructures/ch4_trees_graphs/graphs.py | UTF-8 | 1,033 | 3.765625 | 4 | [] | no_license | """
Graph Implementation in Python
"""
class Graph:
def __init__(self):
self.graph = {}
def add_edge(self, node, neighbor=None):
edges = []
if neighbor != None:
if node not in self.graph:
edges.append(neighbor)
self.graph[node] = e... | true |
77850d981ec1ee417031ec89163bcc8ee3876e71 | Python | APY-Plus/API-Jnilib | /test.py | UTF-8 | 193 | 2.78125 | 3 | [] | no_license | from time import sleep
from threading import Thread
def test():
sleep(3)
print('[py]new thread over')
t1 = Thread(target=test, daemon=False)
t1.start()
print('[py]main thread over')
| true |
b666a497a65dbd5f242f374acf2916d20eda5399 | Python | LeGeRyChEeSe/dogsbot | /assets/Games/Chess/classes/chess.py | UTF-8 | 2,783 | 3.203125 | 3 | [] | no_license | from collections import OrderedDict
from discord.ext import commands
from assets.Games.Chess.classes.player import Player
class Chess:
def __init__(self, white_player, black_player, super, ctx: commands.Context):
self.super = super
self.ctx = ctx
self.black = ":black_large_square:"
... | true |
937610be7ae050424c9cd4c665058e716fd06526 | Python | webclinic017/Backtesting-7 | /test/trade/test_trader.py | UTF-8 | 7,990 | 2.609375 | 3 | [] | no_license | import pytest
import pandas as pd
from backtesting.trade.trader import Trader
@pytest.fixture()
def trader():
return Trader(1000, 'BTC', 'harvir', 0, 0)
def test_long_max(trader):
trade = trader.long(100, pd.Timestamp('2020-01-01 00:00:00'), max=True)
assert trade.type == 'long'
assert trade.new_ba... | true |
bb2bdbaa7ecd6fea7eecd2e1d37f56e40b269a59 | Python | aryanchandrakar/Blockchain_Chat | /restnode.py | UTF-8 | 3,221 | 2.609375 | 3 | [] | no_license | import socket
import select
import threading
import json
import time
import flask
import requests
import random
import blockchain
def ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("40.114.26.190", 80)) # doesn't actually send traffic
ipa = s.getsockname()[0]
s.close()
retu... | true |
041ec546b8ddd5b0dd8b27d049b075e8647d5b5a | Python | devqazi/roman-urdu | /scripts/visualize_terminals.py | UTF-8 | 340 | 3.015625 | 3 | [
"MIT"
] | permissive | import matplotlib.pyplot as plt
in_path = "../res/terminal_freq.csv"
with open(in_path) as f:
data = f.read()
data = [int(i) for i in data.split(",")]
labels = [chr(i+97) for i in range(26)]
ticks = range(26)
plt.bar(ticks, data, align="center")
plt.xticks(ticks, labels)
plt.title("Terminal frequ... | true |
8875d1818713f6fa2dd52b337255b5e87c9b207a | Python | kzkMae/myProject | /code/vmGenymotion/GUI/guiOperate.py | UTF-8 | 2,073 | 3.0625 | 3 | [] | no_license | # coding:utf-8
import os
import time
#GUiでGenyotionの起動・停止を行うためのソースコード
#基本的には「xte」コマンドを用いる
#画面の位置を変数化
#Genymotionのスタートボタン,絶対位置(x,y)
startGeny = ['114','133']
#Genymotionの修了ボタン(x,y)
endGeny = ['642','45']
endGenyKey = ['Alt_L','F4']
#Wait時間(クリックまでの間隔,起動後,終了後)
waiTime = [0.5,25,5]
#xteコマンド(基礎)
xte = 'xte '
#xteコマンドの中身... | true |
c54d26b01cd24baba589470b867cc0ab2f82954f | Python | bh0085/compbio | /learning/multi/learner.py | UTF-8 | 4,493 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env python
from numpy import *
import numpy as np
import matplotlib.pyplot as plt
import compbio.learning.plots as lplots
import compbio.utils.plots as myplots
import compbio.utils.colors as mycolors
from regression_models import *
from orange_models import *
import itertools as it
import compbio.utils.pbar... | true |
f42038313f7513283d74eddb80085da621c10648 | Python | zhrmrz/pascalTriangle | /pascalTriangle.py | UTF-8 | 265 | 3.09375 | 3 | [] | no_license | class sol:
def pascalTriangle(self,numRows):
list=[[1]]
row=[1]
for i in range(numRows):
row=[1]+[row[i]+row[i+1] for i in range(len(row)-1)]+[1]
list.append(row)
print(list)
p1=sol()
p1.pascalTriangle(4)
| true |
6fc80cbb1ab2b36a3daebb5fc8453117b880583f | Python | bobqywei/Daily-Coding-Problem | /#13.py | UTF-8 | 607 | 3.125 | 3 | [] | no_license | while True:
k = int(input())
s = input()
char_freq = {s[0]: 1}
left = 0
right = 0
distinct_chars = 1
maxlen = 0
start = 0
while right < len(s)-1:
if distinct_chars <= k:
right += 1
freq = char_freq.get(s[right])
if freq is None or freq == 0:
distinct_chars += 1
char_freq[s[right]] =... | true |
3d8afb5021c5ccec6a78fd2f47fd516a19b246fe | Python | knighton/babi | /panoptes/ling/parse/parse.py | UTF-8 | 20,165 | 3.328125 | 3 | [] | no_license | from collections import defaultdict
class Token(object):
"""
A single token in a parse.
"""
def __init__(self, index, text, tag, up, downs):
self.index = index # integer index
self.text = text # text
self.tag = tag # tag
self.up = up # (dep, Token or No... | true |
917ae910bcaf1b34dffb3fe82ee7c632df382bdb | Python | liooil/leetcode | /convert-a-number-to-hexadecimal.py | UTF-8 | 250 | 2.765625 | 3 | [] | no_license | class Solution:
def toHex(self, num: 'int') -> 'str':
ans = ""
for _ in range(8):
num, r = divmod(num, 16)
ans = "0123456789abcdef"[r] + ans
if num == 0:
break
return ans | true |
2269b2373c07331d0ca0b61f3e1339a8fe04b895 | Python | ACSchil/PyAI | /towersofhanoi/search.py | UTF-8 | 14,113 | 3.09375 | 3 | [] | no_license | from collections import deque
from threading import RLock, Thread
from queue import Queue
from search.node import Node
from towersofhanoi.hanoi import immutable_hanoi
def dls_graph(problem, limit):
"""Depth limited search for hanoi with an explored set."""
problem.metrics.start()
explored = set()
exp... | true |
005b711f7cb47c17c6dfca91f469c0cdfd67efd8 | Python | jimmy-jing/housing_ml | /jj_dummification.py | UTF-8 | 6,423 | 3 | 3 | [] | no_license | import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
class LabelEncoders():
'''
class to return various label encoder instances based a dict of df columns
only to be used within class HousingCategorical
to understand each instance method, please use the ... | true |
77eff28bd52c7dfc2d93a501aa276fac8140b042 | Python | santb08/statistics-py | /exercises/ic/taller ic/punto_10.py | UTF-8 | 584 | 2.953125 | 3 | [
"MIT"
] | permissive | import sys
sys.path.insert(0, '../../../lib/')
import ic
"""
La Asociación de Finanzas Estudiantiles en Faber Collage está planeando una “Feria primaveral” en la cual intentan
vender camisetas con su logo. El tesorero desea un estimado de la proporción de estudiantes que comprarán una camiseta.
El estimado debe prop... | true |
909c67d5b55b056d2f1897154bf7171b49ce06dd | Python | tachylyte/HydroGeoPy | /monte_carlo.py | UTF-8 | 995 | 3.421875 | 3 | [
"BSD-2-Clause"
] | permissive | # Set of functions for generating monte carlo distributions
from random import *
import math
def Single(a, i):
samples = []
for i in range (1, i+1):
samples.append(a)
return samples
def Uniform(a, b, i):
samples = []
for i in range (1, i+1):
samples.append(uniform(a,... | true |
e409ec12b5052a9a69ef6f6e060d45fb64d56713 | Python | KanikaParikh/Streaming-Text-Analytics | /Spark_SentimentAnalysis.py | UTF-8 | 5,206 | 3.140625 | 3 | [] | no_license | # Kanika Parikh 216030215 and Kaumilkumar Patel 216008914
# Assignment 3 : Part B
"""
This Spark app connects to a script running on another (Docker) machine
on port 9009 that provides a stream of raw tweets text. That stream is
meant to be read and processed here, where top trending hashtags are
ident... | true |
a8f3ba8645868e108c4b647e563b0f7cce833266 | Python | vectominist/ZJ-Solutions-in-Python | /Contest/a864.py | UTF-8 | 741 | 3.109375 | 3 | [] | no_license | import sys
for s in sys.stdin:
num = s.split()
name = num[0]
if name == 'END':
break
mB = float(num[1])
mV = float(num[2])
delta = mB - mV
if delta < -0.251:
print('%s %.2lf O' % (name, delta))
elif delta > -0.250 and delta < -0.001:
print('%s %.2lf B' % (name, ... | true |
2f38cf343b6e1e56b89ff3f07ab9825079cdc5ad | Python | Rishabhchauhan30/Python-- | /function/sumreduce.py | UTF-8 | 99 | 2.65625 | 3 | [] | no_license | from functools import reduce
lst=[10,20,30,40,50]
result =reduce(lambda x,y:x+y,lst)
print(result) | true |
9eb8c80ea7bfcad3f9f332fd46a65150a962880f | Python | Raymond38324/Luffycity | /第三模块/测试代码/ftp/上传下载测试/Client/client.py | UTF-8 | 824 | 2.75 | 3 | [] | no_license | # coding: utf-8
import socket
import os
import struct
import json
from time import sleep
from sys import stdout
host = '127.0.0.1'
port = 8080
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((host, port)) # 连接到ip和端口对应的socket对象
filename = input(">>>")
file_size = os.path.getsize(filename)
hea... | true |
7e33687b9ecd243fb57de5686d86ea8476ad62b6 | Python | variito/practicassimulacion1 | /simbarb.py | UTF-8 | 3,095 | 2.53125 | 3 | [] | no_license | import random
import math
import time
#logaritmo natural = math.log()
t_entre_llegada = int(raw_input("INGRESA TIEMPO ENTRE LLEGADA: "))
t_minimo = int(raw_input("TIEMPO MINIMO EN CORTE: "))
t_maximo = int(raw_input("TIEMPO MAXIMO EN CORTE: "))
can_barberos = int(raw_input("CANTIDAD DE BARBEROS: "))
tot... | true |
f4377869de4e4ec82a76c7b571c19a16d8ccd12c | Python | SMikolaj99/Miko-aj-Solarz | /zadanie2/zadanie2.pyde | UTF-8 | 596 | 3.734375 | 4 | [] | no_license | def setup():
size(600,600)
frameRate(50)
stroke(150,0,150)
strokeWeight(2)
global x, y, kolor
x = 300
y = 25
kolor = 0
def draw():
global x, y, kolor
ellipse(x, y, 40, 40)
kolor = kolor + 1
stroke(150 + kolor,0 + kolor,150 - kolor)
x = x + 1
y = y... | true |
b86396f28b9996804d16080bfc5284e38daa22a8 | Python | zaneguqi/shoelace | /shoelace/dataset.py | UTF-8 | 6,171 | 3.046875 | 3 | [
"MIT"
] | permissive | import re
import numpy as np
import pickle
from collections import defaultdict
from chainer.dataset.dataset_mixin import DatasetMixin
class LtrDataset(DatasetMixin):
"""
Implementation of Learning to Rank data set
Supports efficient slicing on query-level data. Note that single samples are
collectio... | true |
1f8b5b01a976ac129fd20c6bd0a7a4f2bea7a56c | Python | meatripoli/PythonSandbox | /find_gcd.py | UTF-8 | 452 | 3.34375 | 3 | [] | no_license | def find_gcd(some_list):
gcd_list=[]
m=len(some_list)
gcd=[]
for item in some_list:
for n in range(1,item+1):
if item%n==0:
gcd_list.append(n)
for item in gcd_list:
if gcd_list.count(item)==m:
gcd.append(item)
x=gcd[0]
for l in range(le... | true |
6d4a187c4eee84f3e6819a0e5ce97b498dc58b01 | Python | intruedeep/target-data-extraction | /extract/tn_emulator/image.py | UTF-8 | 2,613 | 3.296875 | 3 | [] | no_license | #!/usr/bin/env python2
import numpy as np
from scipy import ndimage
import cv2
import sys
RED_LOWER = np.array([17, 15, 100])
RED_UPPER = np.array([50, 56, 200])
def get_target_data(img, lowbounds, highbounds):
#isolate colors to binary image
target_iso = cv2.inRange(img, lowbounds, highbounds)
#Blur the bina... | true |
3573817a45e96f6af3c1bb642e2d239e42259bb4 | Python | ChristopherHubbard/news-stock-predictor | /src/server/Prediction/TransformLayer.py | UTF-8 | 667 | 3.125 | 3 | [] | no_license | import torch
# Layer to transform a tensor in a sequential NN to a different format -- useful to define networks to output correctly shaped tensors
# Also helps include intermediate transformations between layers
class TransformLayer(torch.nn.Module):
def __init__(self, toSize):
# Call the base construct... | true |
b6d1f01a74a29e957e2a406edaaed76763f75dde | Python | yyoshiaki/gene2bed | /.ipynb_checkpoints/gene2bed-checkpoint | UTF-8 | 416 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
import sys
import pandas as pd
import argparse
parser = argparse.ArgumentParser(description='Convert a gene list into a bed file.')
#文字列オプション
parser.add_argument('input', type=str, help='a gene list file', )
#数値 オプション
parser.add_argument('-m','--mergin', type=int, help='mergin l... | true |
abbd5d1dd0bc964228e1cdc23788fc6fafd039a2 | Python | JoaoCostaIFG/MNUM | /exams/unknown_date_exam/1_newton_1eq.py | UTF-8 | 280 | 4.03125 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# In maxima:
# f: (x - 2.6) + (cos(x + 1.1))^3;
# diff(f, x);
from math import cos, sin
def f(x):
return (x - 2.6) + (cos(x + 1.1))**3
def df(x):
return 1 - 3 * (cos(x + 1.1)**2) * sin(x + 1.1)
x = 1.8
print(x)
x -= f(x) / df(x)
print(x)
| true |
97e41cc30482d20426233560913bde504b71252c | Python | weida2/practice | /6.py | UTF-8 | 395 | 2.578125 | 3 | [] | no_license | import easygui as eg
def function2():
title = '账户中心'
msg = '''
【*真实姓名】为必填项
【*E-mail】为必填项
【*手机号码】为必填项
'''
inputs = ['*用户名', '*真实姓名', '电话号码', '*手机号码', 'QQ', '*E-mail']
print(eg.multenterbox(msg, title, inputs))
function2() | true |
1631ec3dc46d4494944d182bbc2a4e80039f0910 | Python | DenisLamalis/cours-python | /lpp101-work/index_33.py | UTF-8 | 1,229 | 4.21875 | 4 | [] | no_license | # for loops and nesting
# for letter in 'Norwegian blue':
# print(letter)
# for furgle in range(8):
# print(furgle)
# for furgle in range(2,8):
# print(furgle)
# for furgle in range(1, 15, 3):
# print(furgle)
# for name in ['John','Terry','Eric','Michael','George']:
# print(name)
# friend... | true |
9ba6db72572959c4dbe8446a7a6e9b534698dd71 | Python | danhidsan/movie-trailer-classifier | /test/test_classifier.py | UTF-8 | 1,470 | 3.28125 | 3 | [] | no_license | import unittest
import time
import logging
from ml.classifier import TextClassifier
# logging config
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
class ClassifierTest(unittest.TestCase):
logging.info("Preparing set up test for Classifier Module")
def setUp(self):
sel... | true |
3ef74b4cd72a337b588ff60c71b13559ce759b83 | Python | lesilencieux/python_mongodb_flask | /app/models/mission.py | UTF-8 | 4,624 | 2.609375 | 3 | [
"MIT"
] | permissive | from pymongo import MongoClient
from flask import jsonify, session
from bson import ObjectId
from pymongo.errors import DuplicateKeyError
import dateutil.parser
from datetime import datetime as dt
import datetime
class Mission():
client = MongoClient("localhost", 27017)
db = client["missions"]
missions = ... | true |
ca6637e9034790a26dc23112f23f6358dfcb6020 | Python | Aasthaengg/IBMdataset | /Python_codes/p02766/s449956528.py | UTF-8 | 209 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python3
def main():
N, K = map(int, input().split())
for i in range(10 ** 9):
if N <= K ** i - 1:
print(i)
break
if __name__ == '__main__':
main()
| true |
ad67b1ab1158cf3c122b164ec34eb68c41289b9c | Python | imoneoi/CarZero | /src/carzero/scripts/movavg.py | UTF-8 | 1,029 | 3.5625 | 4 | [] | no_license | import numpy as np
class MovAvg:
"""Moving Average with Standard Deviation"""
def __init__(self, max_size=100):
self.maxsize = max_size
self.cache = np.zeros(max_size)
self.sum = 0.0
self.sq_sum = 0.0
self.size = 0
self.pointer = 0
def push(self, item):
... | true |
a1096a0c3cc3d2b916b8994a315d18ce7c8a67d8 | Python | ilayze/Ben-Yehuda-Project-Processor | /src/pageParser.py | UTF-8 | 1,927 | 2.953125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf8 -*-
import argparse
import urllib2
import unicodedata
from BeautifulSoup import BeautifulSoup
class PageParser:
def __init__(self, argsparser):
argsparser.add_argument('-u', '--url',
help='url to the creator main page',
def... | true |
766bcec5841cc079e5fb0eb02f9bbd73b0ed94b5 | Python | midaslmg94/CodingTest | /Backtracking/15652_N과 M(4).py | UTF-8 | 233 | 2.953125 | 3 | [] | no_license | n, m = map(int, input().split())
result = []
def dfs(idx, count):
if count == m:
print(*result)
return
for i in range(idx, n):
result.append(i+1)
dfs(i, count+1)
result.pop()
dfs(0, 0) | true |
15e7a9da15858d76c5cec6b6f9b1e3477d495af2 | Python | glangsto/analyze | /fitCrossing.py | UTF-8 | 22,026 | 2.734375 | 3 | [] | no_license | """
Read in an observation summary and fit the times of galaxy crossings.
From these measurements estimate the Azimuth and Elevation of the
telescope pointing. Then compute the azimuth and elevation offsets
"""
# Functions to create a grid and place astronomical data on that
# grid with a convolving function
# HISTORY... | true |
a6a89192203d5d2c327da0843f910299729faefe | Python | nuclearglow/machine-learning | /titanic/titanic.py | UTF-8 | 4,233 | 2.5625 | 3 | [] | no_license | #!/usr/bin/env python
import os
import pandas as pd
import numpy as np
import math
import joblib
import matplotlib
import matplotlib.pyplot as plt
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.preprocessing import OneHotEncoder, LabelBinarizer
from sklearn.impute import SimpleImputer
from sklearn.p... | true |
b4ac09619d6cc32e6a8fe4ab177385d15bbf6fb5 | Python | roshan9419/AStarPathFindingVisulaizer | /aStarPathFinder.py | UTF-8 | 5,983 | 3.421875 | 3 | [] | no_license | import pygame
import math
from random import randint
from queue import PriorityQueue
pygame.init()
ROWS = 50
WIDTH = 700
HEIGHT = 500
WIN = pygame.display.set_mode((WIDTH, HEIGHT)) # Screen Size
pygame.display.set_caption("A* Path Finding Algorithm")
# COLORS
START_COLOR = (124, 32, 49)
END_COLOR = (0, 255, 0)
WALL... | true |
613baad711862eb0ecc95d94c087c8235e3c8993 | Python | ekarincodizm/AutomateWemall.com | /Keyword/Portal/storefront_cms/shop_management_page/css_pages_list.py | UTF-8 | 2,434 | 2.953125 | 3 | [] | no_license | import datetime
import json
def get_pages_list_data_from_response(response, view):
pages_list = []
response_data = json.loads(response)
for key, item in response_data['data'].items():
pages_data = {}
pages_data['page_name'] = item['name']
if item['page_status'] == 'active':
... | true |
324928dd8bca612f5f95bec9428ced8776c21ed4 | Python | S41nz/diakrino | /model/enums/categoria_grado_academico.py | ISO-8859-1 | 564 | 2.671875 | 3 | [] | no_license | # -*- coding: latin-1 -*-
'''
Enumeracin que representa los diferentes tipos de grado acadmico que puede tener un candidato determinado
Created on 18/03/2015
@author: SA1nz
'''
class CategoriaGradoAcademico:
#Enumeraciones
PREESCOLAR = "Preescolar"
PRIMARIA = "Primaria"
SECUNDARIA = "Secundaria"
... | true |
368dc6a04942e0b651e8996f8821b1df964ac1dd | Python | home-assistant/supervisor | /tests/utils/test_json.py | UTF-8 | 612 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | """test json."""
from supervisor.utils.json import write_json_file
def test_file_permissions(tmp_path):
"""Test file permissions."""
tempfile = tmp_path / "test.json"
write_json_file(tempfile, {"test": "data"})
assert tempfile.is_file()
assert oct(tempfile.stat().st_mode)[-3:] == "600"
def test_... | true |
88904b6888ddf53e08168e72aaacc43c5c54cd5b | Python | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_97/1658.py | UTF-8 | 751 | 3.109375 | 3 | [] | no_license | cases = int( input() )
index = 1
while index <= cases:
_in = input()
low,high = _in.split()
low = int( low )
high = int( high )
firstNum = ""
secondNum = ""
revNum = ""
counter = 0
newNum = ""
for i in range( low, high + 1 ):
firstNum = str( i )
newNum = firstNum
... | true |
68e84da61f3dba108fc0d30167bbeefa3c8cefa5 | Python | mkbeh/rin-bitshares-arbitry-bot | /src/aiopybitshares/account.py | UTF-8 | 785 | 2.625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from .grambitshares import GramBitshares, default_node
class Account(GramBitshares):
def __init__(self):
super().__init__()
self._gram = None
async def connect(self, ws_node=default_node):
self._gram = await super().connect(ws_node)
return self
as... | true |
6976674424b68a14c404600b599b5bad51bf0eab | Python | sandeep325/python-GUI-calculator | /calculator.py | UTF-8 | 3,262 | 3.171875 | 3 | [] | no_license | from tkinter import *
top=Tk()
top.title("calculator")
top.wm_iconbitmap("calculator.ico")
top.geometry("800x900")
top.maxsize(670,500)
top.minsize(670,500)
def click(event):
global scvalue
text=event.widget.cget("text") #cget() function used to how to get a text from a button widget.
#print(text)
... | true |
7c2f3bfa1c8cf370a6d706197cd318f29ac76404 | Python | Tony0726/Python-TA-interview-questions | /Image Convolution.py | UTF-8 | 1,490 | 2.96875 | 3 | [] | no_license | import cv2
import numpy as np
def blur(videopath, kernel, savepath):
vid = cv2.VideoCapture(videopath)
video_width = int(vid.get(3)) #获取视频的宽
video_height = int(vid.get(4)) #获取视频的高
video_fps = int(vid.get(5)) #获取视频的帧速率
#创建VideoWriter类对象
fourcc = cv2.VideoWriter_fourcc('I', '4', '2', '0') #创建视频编解... | true |
176b4f9add010c28c74559ac4fac20424854f67c | Python | BCEM-UniAndes/Reproducibility-Guidelines | /codes/Change_header_fasta.py | UTF-8 | 1,303 | 3.046875 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
###About###
#Name:Change_header_fasta.py
#Author:Luisa Matiz
#Description:Script to change header of fasta
#Institution:Universidad de los Andes
#email:lf.matiz10@uniandes.edu.co
#Date:10-02-2019
#Version:Python3.0 or more
###Libraries###
import sys
import argparse
import click
... | true |
0e1a3141a72a1293a5a071ed8caa3f632ae5bebc | Python | koikera/JogoPython | /adivinhacao.py | UTF-8 | 1,717 | 3.9375 | 4 | [] | no_license | import random
def jogar():
print("*****************************")
print("Bem vindo ao jogo Adivinhacao")
print("*****************************")
numero_secreto= random.randrange(1, 100)
total_tentativas = 0
pontos = 1000
print("qual nivel de dificuldade?")
print("(1... | true |
efe7862549a082810c4f7ace229ce4d8353b2bfd | Python | paik11012/Algorithm | /lecture/day02/day02_2.py | UTF-8 | 655 | 2.984375 | 3 | [] | no_license |
import sys
from typing import Any, Union
sys.stdin = open('sample_2.txt','r')
# N, K = 3, 6
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
n = len(arr)
total_num = int(input())
for tot in range(1,total_num+1):
N, K = map(int, input().split())
candidate = []
result = []
total = 0
# bit이용하기
n =... | true |
ca9f7c9caf538039a87a349731ed3da91e6c403f | Python | dimpusagar91/python_tutorials | /3_datatypes_datastructures/functions_demo.py | UTF-8 | 1,873 | 4.125 | 4 | [] | no_license | #!/usr/bin/python
#Multiple assignment applicable
#assign
vara = varb = varc = 90
# to check the variable value
print("vara :", vara)
print("varb :", varb)
print("varc :", varc)
# assign
varint, varfloat, varstr = 90,92.75,"john"
#to check the variable value
print("varint :", varint)
print("varfloat :",... | true |
643e76af3dde06ec4c1ef6093a2ea4dfb352f693 | Python | scipp/scipp | /tests/core/math_test.py | UTF-8 | 4,825 | 2.921875 | 3 | [
"BSD-3-Clause"
] | permissive | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
# @author Jan-Lukas Wynen
import numpy as np
import pytest
import scipy
import scipp as sc
@pytest.mark.parametrize(
'funcs',
(
(sc.erf, scipy.special.erf),
(sc.erfc, scipy.special.erfc)... | true |
6b8a1886e7f6e848e5118e8017e461470e678345 | Python | marius-pop0/CybeDataAnlaytics | /assignment1/plotting.py | UTF-8 | 6,956 | 2.78125 | 3 | [] | no_license | import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
def statistics(df):
df1 = df.groupby(['shoppercountrycode', 'currencycode', 'simple_journal']).size().reset_index(name='freq').sort_values(by=['freq'], ascending=False).head()
df2 = df[(df['shoppercountrycode'] == 'AU'... | true |
b79f8afd34f5bb8fbe323712fe6a67496711b591 | Python | Spferical/bearcart | /bearcart/_compat.py | UTF-8 | 190 | 2.5625 | 3 | [
"MIT"
] | permissive | """For compatibility between Python 2 & 3"""
import sys
PY2 = sys.version_info[0] == 2
def iteritems(d):
if PY2:
return d.iteritems()
else:
return iter(d.items())
| true |
88a82ab7ad60d53af6f742400b67cf6708dcacdd | Python | TBespalko19/test-repository | /01_python_part/09_the_in_keyword/code.py | UTF-8 | 1,281 | 3.890625 | 4 | [] | no_license | # # friends = {"Bob", "Rolf", "Anne"}
# # print("Bob" in friends)
# movies_watched = {"The Matrix", "Green Book", "Her"}
# user_movie = input("Enter something you've watched recently: ")
# # print(user_movie in movies_watched)
# if user_movie in movies_watched:
# print(f"I've eatched {user_movie} too!")
# else:
... | true |
0d5f83831da8bfeb50f01eb7c71e7f3743d47bcb | Python | bbw7561135/phd_code | /sync_rotate_sfs.py | UTF-8 | 8,576 | 3.09375 | 3 | [] | no_license | #------------------------------------------------------------------------------#
# #
# This code is a Python script that reads in arrays of simulated synchrotron #
# intensities, and calculates the structure functions of the synchrotron ... | true |
778e8f86e43c11946d1868d6c5be214a01d46baa | Python | bigpianist/commitbasedtest | /python/musiclib/harmonypitch/scale.py | UTF-8 | 3,542 | 2.796875 | 3 | [] | no_license | modes = ["ionian", "dorian", "phrygian", "lydian", "mixolydian", "aeolian"]
scales = {
"ionian": [0, 2, 4, 5, 7, 9, 11],
"dorian": [0, 2, 3, 5, 7, 9, 10],
"phrygian": [0, 1, 3, 5, 7, 8, 10],
"lydian": [0, 2, 4, 6, 7, 9, 11],
"mixolydian": [0, 2, 4, 5, 7, 9, 10],
"aeolian": [0, 2, 3, 5, 7, 8, 10... | true |
dfa010a0145416f20785293bf66c2c0ea2a5a89a | Python | 3nippo/system_of_equations_solving_methods | /tests/test_integral.py | UTF-8 | 676 | 3.078125 | 3 | [] | no_license | import context
from approx import Integral
def func(x):
return x*x/(x*x + 16)
start = 0
end = 2
h = [0.5, 0.25]
methods = ['rectangle_method', 'trapeze_method', 'Simpson_method']
obj = Integral(start, end, func)
for step in h:
obj.set_table(step)
for method in methods:
print(f"{method}, step ... | true |
52ebe52feda3d46cebe8eec49b83b850a9db762a | Python | virendra2334/plivo-assignment | /assignment/utils/api_client.py | UTF-8 | 802 | 2.578125 | 3 | [] | no_license | import requests
class RequestType(object):
"""More request types can be added here as and when we have more."""
GET = 'GET'
POST = 'POST'
PUT = 'PUT'
DELETE = 'DELETE'
class APIClient(object):
"""Generic class based implementation to inherited by
clients of all apis."""
__rmethod_... | true |
d45876ef3a1f64a06eb586e65ec7c7e4ef119624 | Python | patterson-dtaylor/python_work | /Chapter_4/odd_numbers.py | UTF-8 | 123 | 3.640625 | 4 | [] | no_license | # 10/1/19 Exercise 4-6: Creating a list of odd numbers between 1-20
odd_numbers = list(range(1, 21, 3))
print(odd_numbers)
| true |
83622aeb2b050fff217c085a3d58dd01c78de1f3 | Python | powerfulaidan/firstproject | /hi.py | UTF-8 | 118 | 2.734375 | 3 | [] | no_license | print "hi"
family = ["Aidan" , "Dad" , "Vitak ", "mom" , "rufus" , "honey"]
for member in family:
print "hi" + member | true |
5518dd79266a4beec1003ab829f98d3798b60822 | Python | cpprhtn/Machine_Learning_Cookbook | /Chapter7/6_요일 인코딩.py | UTF-8 | 267 | 2.515625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 12 23:04:23 2020
@author: cpprhtn
"""
import pandas as pd
dates = pd.Series(pd.date_range("2/2/2002", periods=3, freq="M"))
#요일 확인
dates.dt.day_name()
#요일 확인
dates.dt.weekday | true |
6d6a8125f28f8e5d1b5b08062ba825397e095681 | Python | Vivek-M416/Basics | /Array/nparray1.py | UTF-8 | 89 | 2.921875 | 3 | [] | no_license | # creating array with numpy
import numpy
x = numpy.array([10, 20, 30, 40, 50])
print(x)
| true |