blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 283 | content_id stringlengths 40 40 | detected_licenses listlengths 0 91 | license_type stringclasses 2
values | repo_name stringlengths 3 135 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 68 | visit_date timestamp[ns]date 2015-07-25 20:53:29 2023-09-06 10:46:05 | revision_date timestamp[ns]date 1970-01-01 00:00:00 2037-05-03 13:00:00 | committer_date timestamp[ns]date 1970-01-01 00:00:00 2036-02-09 17:40:36 | github_id int64 1.61k 691M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 24
values | gha_event_created_at timestamp[ns]date 2012-06-03 10:21:33 2023-09-14 21:59:50 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-09-13 22:40:33 ⌀ | gha_language stringclasses 250
values | src_encoding stringclasses 27
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 6 10M | extension stringclasses 289
values | filename stringlengths 1 218 | content stringlengths 6 10M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ae29e4e34098b8b0a5a94a4c7a30d5ae7aab7260 | 52fc25b679bfb962a17c18420d16692706f8697e | /ExploringTableFunctions.py | 3199684325b34aac09d2aedb4ad90312c96de4c4 | [] | no_license | adanque/Data-Gathering-Techniques-using-APIs-and-Web-scraping-with-Python | 15fecd4da2f71a065cff6be2f2aa67410bc0bb75 | 7d3dc205e4aba5bd9444513fdce465d31805f178 | refs/heads/main | 2023-03-15T08:42:27.212870 | 2021-03-21T21:08:01 | 2021-03-21T21:08:01 | 349,256,716 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,537 | py | ExploringTableFunctions.py | # Name: Alan Danque
# Date: 20200119
# Course: DSC 540
# Desc: Week 7 Exercise - Exploring Table Functions
# Pages 225 - 228
import xlrd
from xlrd.sheet import ctype_text
import agate
# Function to return a list of cleaned data types from a passed in list
def getTypes(passedlist):
types = []
for v in passe... |
4f38f8691db1d45e8546b6425f74e72cc0f59151 | 9f1975da46069d65d67f33d4e7d23acebc102247 | /pra-algen.py | d1b11cef1631204bfd4fa00f39cf1ef369f5a4e3 | [] | no_license | Aqil606/Pra-Algen | 34145846ff59355aaf266a255b437c80665a4fe9 | af677582b65abf32563b0c455d117ff6e250370d | refs/heads/master | 2023-03-13T10:08:48.778622 | 2021-03-04T07:11:16 | 2021-03-04T07:11:16 | 344,376,102 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,020 | py | pra-algen.py | # data matakuliah
matakuliah = ["web","jarkom","struktur data","basis data I",
"basis data II","microcontroler","microprocessor","Pengantar Pemrograman",
"Pemrograman Terstruktur","APL","SPK","matematika dasar",
"statistika", "robotika", "algoritma"]
banyak_mk = len(matakuliah)... |
ad0984cc3b6541a21c1e3bb5bfd7f2bdeaf70294 | 49b2aa462c28c7efea8357a89d848a1e9b0c4152 | /assignment4/action.py | 488f4b8429e8346fe9fa1924c53de7b5bb1cf1d2 | [] | no_license | yadinbk/SPL | 0b31e26a51a45767ca6f1b34012e129bb012e56e | 881e893d4fe1f45956b3dc2f803ede8f17f0526d | refs/heads/master | 2023-04-09T20:58:09.339267 | 2021-04-18T18:43:08 | 2021-04-18T18:43:08 | 359,225,855 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 774 | py | action.py | from DAO.Activitie import Activitie
import _Repository
def main(args):
inputFile = open(args)
fill_activities(inputFile)
print("bye")
def fill_activities(inputFile):
for line in inputFile:
arg = line[:].split(", ")
a = Activitie(*arg)
repo.activities.insert(a)
prod... |
c22c46d2e3c2a17c7dc209de7b57e9b9957c2c7d | b8126dfd5a186c398f7dee6a641be465b01c540d | /py/Code/review_tool.py | 83621809c22293ed37e688040a38ea0caa707c7f | [] | no_license | GDGVIT/Code-Reviewer | f1ccdd62a6ed307ecb23ea32a815a0b0e2c304d4 | 9479f3a11ef8892f6ae410618bab428a54e1befc | refs/heads/master | 2022-12-28T01:27:39.264135 | 2020-10-08T08:02:16 | 2020-10-08T08:02:16 | 197,820,906 | 4 | 2 | null | 2020-10-08T08:02:17 | 2019-07-19T18:05:42 | Rust | UTF-8 | Python | false | false | 8,252 | py | review_tool.py | # -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(998, 717)
MainWindow.setLayoutDirection(QtCore.Qt.LeftToRight)
self.centralwidget = QtWidgets.QW... |
a3188df78cd669a45ce01d8d65f92e150ec88091 | c9e2944b8997e5e301fce56bcc0a06a8d189554d | /Models/images.py | 12bbd62d4ca6d483c69c09ae14593352f172cd12 | [] | no_license | novaleksey/ColoredNews | 6ff1e7e01b2be38200fda8a13d9b49c605df29d6 | 8bc11287473238d8eaf404c746fa507a9aaf05d5 | refs/heads/master | 2022-12-10T03:49:53.395277 | 2020-09-02T12:30:06 | 2020-09-02T12:30:06 | 292,276,576 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 298 | py | images.py | from sqlalchemy import Column, Integer, String, ForeignKey
from .base import BaseModel
class Images(BaseModel):
__tablename__ = 'images'
id = Column(Integer, ForeignKey('news.image_id'), primary_key=True)
path = Column(String)
def __init__(self, path):
self.path = path |
fd90dc695e3b451895f1d4517f5a7862a2454e7b | 9db8c55efd7a2c046f6890250029cfd572eb695d | /Hyperopt + SparkTrials demo.py | 873472b260f692c11c861698e69cbc67a13f0c8f | [] | no_license | pauldevos/Efficient-Distributed-Hyperparameter-Tuning-with-Apache-Spark | a2a4a98e52b7eee0c3218d21fee615750fa7f7a1 | 08308cf592c883ca564ef87d8031e5654824d5ad | refs/heads/main | 2023-04-05T16:18:48.642156 | 2021-04-29T19:12:32 | 2021-04-29T19:12:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,560 | py | Hyperopt + SparkTrials demo.py | # Databricks notebook source
# MAGIC %md
# MAGIC ## Distributed hyperparameter tuning with Hyperopt + SparkTrials
# MAGIC
# MAGIC - Dataset: [Credit Card Fraud Detection, Worldline & Machine Learning Group of ULB](http://mlg.ulb.ac.be/)
# MAGIC - Anonymized credit card transactions labeled as fraudulent or genuine
#... |
89bf9be02f10484f15a34155f1f8b8b3f65cde71 | 87b9f66231eec23ae2bf70559ff8bf97758bf83d | /src/utility/file_io.py | fb632a9306a83adfbefa7374f5ef61604edfea44 | [] | no_license | biophilross/fabsim | 4d579139e51d983e01d2f007f5f7c4e2a3a104c9 | a5de88a959c181d33c9af0732d9da7a1a75ea4a5 | refs/heads/master | 2021-11-25T01:05:33.392821 | 2013-08-19T23:28:20 | 2013-08-19T23:28:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,233 | py | file_io.py | #!/usr/bin/env python
# Agent-Based Simulation - Diffusion & Adoption of Personal Fabricators - PROTOTYPE
# Original Author: Wyman Zhao
# Contributor(s): Philipp Ross
"""
This file contains all of the file input/output functions used
within validate.py and simulation.py. Currently it can only read and write
data in J... |
966434b5fca2df6b84e684be32a3a99c47619565 | 13f583e1414b545053287063674d6b2d19fed20c | /bulk_test.py | f2bbdf1153364ac868ee981d1f51b6e966e2abc8 | [] | no_license | sar-autograder/cfg-grader | 85668a4d1fba57f431921b3f3ee2e7fa957f6b2e | df5602a2f66fd79645ae416f2b8b9d584d32927e | refs/heads/master | 2023-08-17T03:21:24.841036 | 2021-05-18T17:17:20 | 2021-05-18T17:17:20 | 407,388,582 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,053 | py | bulk_test.py | import json
from os import listdir
from os.path import isfile, join
# from tkinter import filedialog
from pycfg_ex import generate_cfg
from test import compare
from collapse_test import collapse
from blackbox import blackbox
import xlsxwriter
class Result:
def __init__(self, filename, examplefile, results):
... |
2e7fbbec1d6f8ae23453a419f9b9c5f2ce22188d | 4578b30c433510cf370d51475ec11cac9c3de1cb | /serpent/templates/SerpentGameAgentPlugin/files/serpent_game_agent.py | 6ec2024f4fc78be5085535f4513a8da7c1dda7a5 | [
"MIT"
] | permissive | SerpentAI/SerpentAI | 0a5b2d567b50388722c3a3c5152555ce94256c49 | 00a487dd088c6ca2528d025f3273c0a796efe210 | refs/heads/dev | 2023-03-08T14:14:07.171435 | 2020-05-22T22:34:09 | 2020-05-22T22:34:09 | 88,444,621 | 7,216 | 950 | MIT | 2020-07-15T00:41:35 | 2017-04-16T21:48:39 | Python | UTF-8 | Python | false | false | 379 | py | serpent_game_agent.py | from serpent.game_agent import GameAgent
class SerpentGameAgent(GameAgent):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.frame_handlers["PLAY"] = self.handle_play
self.frame_handler_setups["PLAY"] = self.setup_play
def setup_play(self):
pass
def handle... |
44bf6bf7910c6cdd98f2404a3f0f5551fb1b858d | 9cb2a751b5476793ec583723fd4a827b461c81b2 | /src/models/users/views.py | e8ad58dd6a3e2012fa83d757e97e44b6b178bff5 | [] | no_license | zanalkamar/alloons | 8a3dd620349c77051b372dca9d0598b82d7d9878 | 7704c9c102e68d323e59642f12590fd7bd166fb0 | refs/heads/master | 2020-04-01T04:20:06.144171 | 2019-11-20T07:38:05 | 2019-11-20T07:38:05 | 152,858,936 | 0 | 0 | null | 2019-01-26T05:02:44 | 2018-10-13T10:03:17 | HTML | UTF-8 | Python | false | false | 3,584 | py | views.py | from flask import Blueprint, render_template, request, session, redirect, url_for
from src.models.users.users import User
user_blueprint = Blueprint('users', __name__)
@user_blueprint.route('/login', methods=['GET', 'POST'])
def login_users():
if request.method == 'POST':
email = request.form['email']
... |
3d31595cb652bda3550a4d65710afb6e8ac48b7b | fcb883d6a316eaa3d4f493ac2746a1dcdacb911b | /converter.py | 41d211c6a22c1ed0925f38ccdcee931eb241eec7 | [] | no_license | matEhickey/GameboyProcessing | dedec34f075a2b291c1e31c5eec1f0aa54b347f2 | 4e4d3e25caafa85a5dd2108414b5bc76de00086f | refs/heads/master | 2022-04-01T22:32:46.680938 | 2020-01-31T22:14:29 | 2020-01-31T22:14:29 | 237,061,492 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 465 | py | converter.py | # coding: utf8
minifiedName = "minified"
list = ["Color.pde","Afficheur.pde","Debugger.pde","Theme.pde","Mode.pde","CanvasButton.pde","Jeu.pde","CatalogueJeux.pde","ModeJeu.pde","Plateformer1.pde","SampleGame.pde","gb.pde"]
f = open(minifiedName,"w", encoding='utf-8')
chaine = ""
for fn in list:
fi = open(f... |
184cc926601eade165d2329ece9f02b1c748c4a1 | 3288923770609c1a791b3c1fd2b59f40311ca68f | /1 191111 Longest Common Prefix 2.py | b6a85ca85c32cc46d896229c88455f089d3293f0 | [] | no_license | PuffedRiceCrackers/algorithmChallenge | d821d085e1fabb7f96782e2ad88bcf0066151f4c | deeb58e0381e946e3380ce9f8e91564ba0127400 | refs/heads/master | 2020-09-20T19:53:59.319505 | 2019-11-28T06:07:55 | 2019-11-28T06:07:55 | 224,576,665 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 432 | py | 1 191111 Longest Common Prefix 2.py | def longestCommonPrefix(strs):
prefix = ''
try:
j = 0
while True:
nextAlphabet = strs[0][j]
for i in range(1, len(strs)):
if strs[i][j] != nextAlphabet:
return prefix
else:
prefix += nextAlphabet
... |
19d9e2b7fb7fffc02bc491964be8c3306bf5e2cb | 1159b2200134468b2ea27c720a12b95b59be1bb0 | /lib/parsers2/pickle/pickle.py | 5a1dd1c7b4d9cdad71b6e0a0ccb001f3376c1ac4 | [] | no_license | YULIYA2001/Parser | a3ac8e418010159810416a5996d1ff9dd05b18e4 | 23d940bc7f46f99a24cfe7af92de4073854c9454 | refs/heads/main | 2023-06-11T18:23:47.850168 | 2021-06-24T08:06:45 | 2021-06-24T08:06:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 252 | py | pickle.py | import pickle
def dumps(obj):
return pickle.dumps(obj)
def dump(obj, fp):
s = dumps(obj).decode(encoding='unicode_escape')
fp.write(s)
def loads(temp_str):
return pickle.loads(temp_str)
def load(fp):
return loads(fp.read())
|
131060a3fca0c517f7abeb8241dccdaac6139ef5 | ab9ee91a408d0d9b3c376e3fd93b0069e17c4cdf | /auth/db/partition.py | 9fc8f8c486adfa68765f75a1be556c4d97030029 | [] | no_license | ShirokikhAlexey/Auth_sprint_2 | 4fc00673f5b7bc4adba1e53169c0a66d8bb55959 | 27c4c9d053dfb823937bdc9419c94f4a5adaf961 | refs/heads/main | 2023-03-18T17:50:44.180869 | 2021-03-08T14:56:52 | 2021-03-08T14:56:52 | 344,796,235 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 768 | py | partition.py | from flask_sqlalchemy import SQLAlchemy
def create_new_users_sign_in(session: SQLAlchemy().session, device_type: str, device_type_id: str):
"""
Функция для создании новой таблицы в PARTITION content.users_sign_in
:param session: сессия подключения к бд
:param device_type: тип устройства
:param dev... |
5a470872847382f6e89ad0f8aa21cedf9b8e2281 | 8b0d6c277163a92d644d722ce948766dab06ad3e | /standardsite/standardtime/migrations/0020_auto_20210222_0600.py | 11d9576b952cde2840bfd600d365e7311d3e5576 | [] | no_license | ljmatilda/poly | 106431c6b9cdc3b4a977a6c8d7ee7254c7b3cc82 | fc8b7c14b96900d3bab213e1a699b2dd76a31558 | refs/heads/main | 2023-03-06T00:28:06.343512 | 2021-02-23T07:31:04 | 2021-02-23T07:31:04 | 341,444,384 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,759 | py | 0020_auto_20210222_0600.py | # Generated by Django 3.1.1 on 2021-02-22 06:00
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('standardtime', '0019_auto_20210205_0813'),
]
operations = [
migrations.CreateModel(
name='District'... |
cc3f33dc07d29b98b48f4bca3b100a0918d9e010 | 515af4c2df5e314d6720a7f5674714981714a30d | /docs/code/getting_started_with_tensorbay.py | a372ce8902cfd1f680675c141c94ea81ea680b79 | [
"MIT"
] | permissive | luyao77/tensorbay-python-sdk | 4b8a9aa52334bc902e8e42ba5a4490e8f425f35f | 4babe16c75a07465bfcca74175fe037c9d93827f | refs/heads/main | 2023-05-12T00:37:07.217183 | 2021-06-02T03:11:01 | 2021-06-02T16:55:35 | 342,153,457 | 1 | 0 | MIT | 2021-02-25T07:02:41 | 2021-02-25T07:02:40 | null | UTF-8 | Python | false | false | 1,510 | py | getting_started_with_tensorbay.py | #!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=wrong-import-position
# pylint: disable=wrong-import-order
# pylint: disable=not-callable
# pylint: disable=ungrouped-imports
# pylint: disable=import-error
# pylint: disable=pointless-string-statement
"""This file incl... |
0508f9a9c62aef65a9356163629a2114698a37b4 | dd59ecf7302755eb67f969cf01014e23abf3b924 | /scripts/compare.py | 2e6ef87bc529061d753984a97396e50d6b406c28 | [] | no_license | longknown/Python | 0aeba6f7c6f1c99cc336165a6bda2bc39b1837ac | df97d5de874bdd4b3d979a952044520378543a67 | refs/heads/master | 2021-01-21T04:37:03.782632 | 2016-05-27T02:04:17 | 2016-05-27T02:04:17 | 32,141,717 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 685 | py | compare.py | #!/usr/bin/python
import sys
__author__ = 'Thomas'
mir_target = {} # key: miRNA name; value: target list;
literal_file = sys.argv[1]
predict_file = sys.argv[2]
with open(predict_file, 'r') as f:
for line in f:
line = line.rstrip('\n')
elements = line.split()
mir = elements[0]
ta... |
c1980fe640c3394a0083b6774e74cb1392dd964f | f615215232e68b9e2b5d7e1ba9c3cc981506312b | /code/neuro_Sim/neuroSim1.2.py | d431301ecd10b7af8c4589a983fe03036e255a26 | [] | no_license | krus7ev/Neuro_MI | 03afeb9be2c954dbffedb09102815f78b624e022 | e784ae99a866ae33271384e098370234579b3d5f | refs/heads/master | 2020-12-09T03:24:43.751317 | 2019-05-21T19:23:45 | 2019-05-21T19:23:45 | 55,440,955 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,688 | py | neuroSim1.2.py | from __future__ import division
from neuro import *
import numpy as np
import scipy as scp
import matplotlib as mp
import matplotlib.pyplot as plt
plt.switch_backend('QT4Agg')
# EXPERIMENTAL NETWORK CONNECTIVITY
#
# Integrate-and-fre neurons {0,1}
#
# 0 1
# ^ ^
# |\1-g/|
# | \ /... |
33b7c87f36722df9f7b36adcae933c9cf2673ea2 | 802ff21dc092752b09e37b69ebcce603ca6681d6 | /Lab02/Bai9.py | 30d1229b10a1c9446f7dc1bb9e63edb1a0d21dfa | [] | no_license | long945/Pythonadvance | 076dc625e3292d51f41c06a8b7c61d09170577db | e8664d0ec1669ae3a03ef24bbf35ffd7852f08f4 | refs/heads/main | 2023-09-04T19:43:13.738269 | 2021-11-07T10:32:56 | 2021-11-07T10:32:56 | 425,467,862 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 52 | py | Bai9.py | values = [0, 1, 2]
values[1] = values
print(values)
|
919b16f33d1b69d67ea3fd0530cc232824d94e91 | 8e2bdaeb8ad2b83acb05e46b6e5894f2b00474a8 | /workflow/views/dashboardView.py | 1505cda14aaeaf71bdc1d2967bdfea32dc4214b8 | [] | no_license | xinpengthk/DBM | 2618edd46656edb488447d1a03b7e2449269497c | c314e38ee82357b11c408ca9f9ce6b8c699fa77c | refs/heads/master | 2021-01-16T19:36:30.244400 | 2019-04-19T07:03:10 | 2019-04-19T07:03:10 | 100,179,852 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 279 | py | dashboardView.py | from django.shortcuts import render
# Create your views here.
def menuPage(request):
return render(request,'html/base/menu.html')
def dashboard(request):
# return render(request,'html/base/dashboard.html')
return render(request,'html/base/table_base.html') |
7063bbfd685e4d16becc99bf25476f382eaa51e3 | 34b5a5c8a41f1803c57c11a0de2c1f43960f8ec4 | /prettify.py | d2d2597bf7fe12d452a1c2b73e253697ab172ec9 | [] | no_license | MoAbdulrahem/XML_parser | 56d1a6401eafe4605716d32c3e91c0b3aa6bad83 | 008f2e2b1c670e484e6214bb83593073ae28ffcc | refs/heads/main | 2023-06-18T01:19:24.335531 | 2021-07-15T20:15:26 | 2021-07-15T20:15:26 | 384,542,007 | 2 | 2 | null | null | null | null | UTF-8 | Python | false | false | 3,630 | py | prettify.py | # This file contains two functions: scrape_data(text) and prettify_data(tags)
# scrape_data(text) should be assigned the XML file at the beggining of execution, it returns a list of tags that should be used during the rest of the runtime
# prettify_data(tags) takes a list of tags (like the one outputted by scrape_data(... |
cf845574da7d5e22f01be4dd02f90ed630a005e1 | 71a96bab384d7030c679d4743bfa0c6b717f4808 | /MPNet/model.py | e71b3d50ef797efdc5baf090d0dcbdad313bf385 | [] | no_license | zqianAiii/MPNetCar | 5e7f3f78b75db93ec7f9107945dacf6026504023 | 03fcdd3521351b4f0dc66cbfaddef2a415f7779e | refs/heads/master | 2020-07-05T08:13:07.357827 | 2019-08-29T22:55:53 | 2019-08-29T22:55:53 | 202,585,109 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,566 | py | model.py | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import torch
from torch import nn
# In[2]:
class Enet(nn.Module):
def __init__(self):
super(Enet, self).__init__()
self.conv = nn.Sequential(nn.Conv2d(1, 4, (7, 7)),
nn... |
6acacfe4b031e7ab941cef252351f3896dd32b78 | 75b70f002a3f233b6dbc1abc20a3fccf7c6d04e2 | /operate.py | 50836638927ae96f75c33dba92fd98545c26de1b | [] | no_license | jamesedchristie/calculator | 350f969a5280b246ec9564bd186397bb676156e0 | 11a2c6a4870095175f74c1300b450ecb3d6ffc4a | refs/heads/master | 2022-11-06T14:31:01.424012 | 2020-06-27T13:52:37 | 2020-06-27T13:52:37 | 275,096,698 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 286 | py | operate.py | # Function to perform operations on two values
def operate(y, x, op):
if "+" in op:
return x + y
elif op.count("-") % 2 == 1:
return x - y
elif op == "*":
return x * y
elif op == "/":
return x / y
elif op == "^":
return x ** y |
628e60406ed7baaeba8043f9455fd9bfe067f551 | f1e837ce56590662edf5b64afb93f82d6c27431b | /context-free-grammar/cfg.py | 4e5d97bf4943da34ad5d61798d15fcc4a3ea6c01 | [] | no_license | camelliaredko/computational-linguistics-projects | 75fb875f2eaa8e4fe097254de00f410963623fd8 | 08b0a83368372369433053aef7d6d26ba4301072 | refs/heads/main | 2023-06-15T08:01:58.602291 | 2021-07-09T04:48:30 | 2021-07-09T04:48:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,673 | py | cfg.py | # Olga Redko
import nltk
import pickle
# PART A:
grammar1 = nltk.CFG.fromstring("""
S -> NP VP | NP Aux VP
NP -> Det Adj N | Det Adj Adj N | N | Pro | Det N | NP CP | NP Conj NP | NP PP | N N
VP -> V PP | V NP | V NP PP | V NP NP | V AdjP | V | VP Conj VP | V NP CP | VP AdvP
PP -> P... |
d7a3e82984963bf44c46c4809441486550c1a9e5 | 41d0bbe2b7f1c45a2973195be3aac84cb3ad37fd | /app/__init__.py | e0deb9150c0772af1cb1955c135428302939b946 | [] | no_license | yaliyalida/CoolTurn | 217c7735b2dfc15c31c184479edb56c41d1143ef | b72fae2028cd80dc892771417983a6675e595f3a | refs/heads/main | 2023-02-03T12:26:31.050039 | 2020-12-20T09:28:53 | 2020-12-20T09:28:53 | 312,762,448 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 847 | py | __init__.py | # app包由app目录和__init__.py脚本来定义构成,并在from app import routes语句中被引用
# app变量被定义为__init__.py脚本中的Flask类的一个实例,以至于它成为app包的属性
'''
routes模块是在底部导入的,而不是在脚本的顶部。
最下面的导入是解决循环导入的问题,你将会看到routes模块中需要导入这个脚本中定义的app变量,因此将routes的导入
放在底部可以避免由于这两个文件之间的相互引用而导致的错误
'''
from flask import Flask
from config import Config
from flask_sql... |
e62769f964fe9d23d7b016464f13726c99656888 | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/AtCoder/arc072/B/2449882.py | eec9bde8f3fe06ccd766ea87f34411580cfb15b5 | [] | no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | Python | false | false | 209 | py | 2449882.py | import collections
def solve():
x,y = map(int,input().split())
if x-y == 0 or abs(x-y) == 1:
print("Brown")
else:
print("Alice")
if __name__ == "__main__":
solve() |
1fb87a90f93cedbedc821db71a9c93670eced5bc | d1dc42146a4e9b6fe26a4b03df801affe6e0daff | /nn/loss/__init__.py | 565bb2f08c9af1ae0f214283a496017adfccdf51 | [
"MIT"
] | permissive | Frognar/Super-Resolution | eb6be1ff57021f2bbadeb29abfc96a6547df10f5 | 406b909d71e156aa11ee589698744e3ad9abfee7 | refs/heads/main | 2023-02-17T09:10:35.898772 | 2021-01-07T19:33:52 | 2021-01-07T19:33:52 | 312,056,159 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 108 | py | __init__.py | from nn.loss.discriminator_loss import DiscriminatorLoss
from nn.loss.perceptual_loss import PerceptualLoss
|
96d1425202bbe98d67e76e77036be39ad4f1a078 | 41740945dce3213eaf09802e196db554375a66a7 | /HR/population.py | 76a288ec82163a9bb24202f27edce05ff9e64241 | [] | no_license | TomasIV/HR-Forritun | 710557b893323b42438a977ab936e07b2c8a8ea0 | 433c4a27939f83038caa031aadf07e96435aa8ab | refs/heads/master | 2020-07-20T05:27:37.303647 | 2019-09-17T09:12:21 | 2019-09-17T09:12:21 | 206,580,828 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 491 | py | population.py | #/Tómas Ingi Villalobos
#08/21/2019 - Háskóli Reykjavíkur
people = 307357870
user_input = int(input("Years: "))
seconds = 365*24*60*60
birth = seconds/7
death = seconds/13
immigrant = seconds/35
if user_input >= 0:
user_input_float =(user_input)
people_now = people + (user_input_float*birth) - (user_input_flo... |
aab9a18a00f8af777b1123d8b36b2ac5a39ba95d | ac5e52a3fc52dde58d208746cddabef2e378119e | /exps-sblp-obt/sblp_ut=3.5_rd=0.65_rw=0.06_rn=4_u=0.075-0.325_p=harmonic-2/sched=RUN_trial=44/sched.py | a09b4560ec520a35d207662fe7faa680e1c8cbed | [] | no_license | ricardobtxr/experiment-scripts | 1e2abfcd94fb0ef5a56c5d7dffddfe814752eef1 | 7bcebff7ac2f2822423f211f1162cd017a18babb | refs/heads/master | 2023-04-09T02:37:41.466794 | 2021-04-25T03:27:16 | 2021-04-25T03:27:16 | 358,926,457 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 521 | py | sched.py | -S 0 -X RUN -Q 0 -L 3 117 400
-S 0 -X RUN -Q 0 -L 3 87 300
-S 1 -X RUN -Q 0 -L 3 53 400
-S 0 -X RUN -Q 0 -L 3 52 175
-S 2 -X RUN -Q 1 -L 2 50 200
-S 2 -X RUN -Q 1 -L 2 45 175
-S 2 -X RUN -Q 1 -L 2 39 400
-S 4 -X RUN -Q 2 -L 1 38 400
-S 4 -X RUN -Q 2 -L 1 35 125
-S 4 -X RUN -Q 2 -L ... |
cf5c7b37d4a0f3c60ee54ba442b2b6e01fc08a64 | eb634dff13bc0e2d0263c4880488fa3bd883c98f | /cut_words/HMM/prob_emit.py | dc58af83977087b344df2421a6d63a4e413b264b | [] | no_license | linchart/NLP | d788196a56457018132bce73dc2f144cb3222402 | 5b9b0602ee193e1f9c47916c5a1173d1ee8e394f | refs/heads/master | 2020-04-25T19:23:30.156697 | 2019-02-28T01:45:51 | 2019-02-28T01:45:51 | 173,018,600 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 457,223 | py | prob_emit.py | P = {'S': {'抵': -9.744304608423588,
'欢': -11.232381663853422,
'抗': -10.613342455447198,
'灵': -10.875706719914689,
'辰': -13.178291812908736,
'贾': -8.783842658236296,
'流': -9.489412358794798,
'徐': -7.6976528895667435,
'嫁': -11.38653234368068,
'唯': -1... |
ef59d30d0c71b05b4d728c32b74ac37d22e0deb6 | 47fdde90ff7017bbff0646c77ba66c51e8a5b74d | /services/system/tests/mocks/mock_firestore_proxy.py | eafd4d5d26cfcbe9f621fd134590a06dee87e7f1 | [
"MIT"
] | permissive | mdryden/110yards | 817ae6716e724f6e921718e9317695fd528bc6bf | 2bd4b5b75b69f822000f68ea7301527a9af210e0 | refs/heads/main | 2023-08-14T23:05:29.317705 | 2023-07-18T13:37:38 | 2023-07-18T13:37:38 | 358,979,413 | 6 | 0 | MIT | 2023-07-27T01:16:25 | 2021-04-17T20:49:02 | Python | UTF-8 | Python | false | false | 2,651 | py | mock_firestore_proxy.py | from google.cloud.firestore_v1.base_document import BaseDocumentReference
from yards_py.core.firestore_proxy import Query
from typing import Any, Dict, Generic, List, TypeVar, Union
import uuid
from yards_py.core.base_entity import BaseEntity
from google.cloud.firestore_v1.transaction import Transaction
T = TypeVar("... |
aa8f5d25fc2b8d7631a77233854c29fab9049603 | 32cce6c09c152bdb848ef4205428f918dc0fda51 | /_lib/consts.py | 0fe8486e530c6f01d9aa1e4b6bd8d82fd1e19569 | [] | no_license | AlexanderGrigoryev/pyqgis | 921b9fad7fc0c39d7ebc159173d19667c1cd999e | 4f9c9bc65f62bd44383ef3945c9140b5ec1ca5bf | refs/heads/master | 2021-03-14T21:04:26.790508 | 2020-03-25T08:52:20 | 2020-03-25T08:52:20 | 246,794,294 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,044 | py | consts.py | class Keys:
"""ключи доступа к словарным значениям"""
title = 'title'
name = 'name'
icon = 'icon'
callback = 'callback'
dialog = 'dialog'
drawing_tool = 'drawing_tool'
geometry = 'geometry'
segments = 'segments'
feature = 'feature'
features = 'features'
laye... |
5ce2d53571c11855e00c7f450da80157b16d84f1 | 3cca537e780ba900087b187d1494713f0c81a24d | /lenstools/scripts/nbodyheader.py | 5b59d6beab2e5b64a91ee03326594cfde44bdc2f | [
"MIT"
] | permissive | apetri/LensTools | 4119c1b5c0570fb6e4078fa67fb3acd5b443c0a5 | 9151988bfe6fbd6809353a33cfb556d44b6806ed | refs/heads/master | 2023-07-19T02:03:26.708366 | 2021-01-21T14:26:47 | 2021-01-21T14:26:47 | 27,881,137 | 32 | 33 | null | 2023-07-12T10:53:00 | 2014-12-11T16:43:33 | Python | UTF-8 | Python | false | false | 662 | py | nbodyheader.py | from .. import configuration
import sys
import argparse
def main(args=None):
parser = argparse.ArgumentParser()
parser.add_argument("filename",nargs="+",help="path to one or more N-body simulation snapshots to display")
args = parser.parse_args(args)
if args.filename is None:
parser.print_help()
sys.exit(0... |
66f97ed889470abd8d92af3e9d1da6cc86173a8b | 50ab3aa62fc8d3589604c0b2e02b97fd78703a28 | /lab10/lab10.pyde | 0bacfc0cf6464d991518e8d9bc9483cbc44a7b26 | [] | no_license | clairefan816/PythonExcercises | ca70d38b1233c6e9950d5e714f2c284742a21a7b | f8a4f581723423f4ba0904d9d7ca5a1526f394d2 | refs/heads/main | 2023-01-23T09:57:53.066419 | 2020-11-23T05:44:34 | 2020-11-23T05:44:34 | 315,205,920 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,843 | pyde | lab10.pyde | size_x = 600
size_y = 600
circle_x = 300
circle_rad = 75
thrust_factor = 0
spaceship_x = 300
spaceship_y = 300
x_vel = 0
y_vel = 0
rotation = 0
def setup():
size(size_x, size_y)
strokeWeight(3)
colorMode(RGB, 1)
def draw():
global circle_x
global rotation
background(0)
circle_x = ci... |
888f25776a2510fcdb9a4d953ff16c19a55bb217 | 1455645a02959de721c81d38ab5fd5a78672fd7b | /src/p104.py | 6b35867ce7d74303ea39d287456fe79fc07c6641 | [] | no_license | chrisliu529/euler_proj | 758876722195fb779a4a734b772f34813b864438 | b9bee630f08b66b3c3dc9edfb077767fb907af69 | refs/heads/master | 2022-07-09T02:14:13.900216 | 2022-06-24T07:03:35 | 2022-06-24T07:03:35 | 3,430,923 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,890 | py | p104.py | import time
def solve():
hs1 = hs2 = ts1 = ts2 = '1'
f1 = f2 = 1
nb = n = 2
tail = head = False
lb = 1
# while n < 2750:
while not (tail and head):
tail = head = False
# f3 = f1 + f2
hs3 = add_head(hs1, hs2)
ts3 = add_tail(ts1, ts2)
n = n + 1
''... |
41db76a2c624139cc4a6df9ef8226846cabdcf46 | b5af6140af7ab6736c23f25223ffc3b64cadf434 | /stringReverse.py | dc6349437b0fe123f0457797983cd2aa602c9b9e | [] | no_license | adikadu/DSA | 9b94063a9dbce0dd6ef599f7cc233332e973b162 | 574667198e1cfe6b25a054f14b28487e94530a33 | refs/heads/master | 2022-07-01T16:16:29.812342 | 2020-05-11T17:36:32 | 2020-05-11T17:36:32 | 263,113,244 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 84 | py | stringReverse.py | def esr(a):
if not a: return
esr(a[1:])
print(a[0], end="")
esr(input())
print() |
4971b0637fdf12306b15459e1163acf56486b3aa | 54a3024bd27756d2e658cc06ca3b2cd851884b22 | /parking/realtime/migrations/0010_auto_20191209_1150.py | e6dc26a434f95be7d624b6c7984a4af6a071187c | [] | no_license | codefish-yu/parking | 0f9568be8650f859d629a1107a035123f1330ed7 | 7752b9fb2ff58958d21b39f8ac2aa4402646574c | refs/heads/master | 2021-06-28T02:37:10.787609 | 2020-01-08T08:42:05 | 2020-01-08T08:42:05 | 232,518,396 | 0 | 0 | null | 2021-06-10T22:28:22 | 2020-01-08T08:44:00 | HTML | UTF-8 | Python | false | false | 511 | py | 0010_auto_20191209_1150.py | # Generated by Django 2.2.3 on 2019-12-09 11:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('realtime', '0009_auto_20191209_1139'),
]
operations = [
migrations.AlterField(
model_name='pay'... |
51aca2677fc1959d2a146a88f4cbb27824e0ad08 | af48a854ca211c116efec8302270b943fcab3aab | /bayes_opt/bayesian_optimization.py | 89644ac24e3f9b572b1e966f05b66680002a6e25 | [] | no_license | hliejun/BayesianOptimisationProject | c8c19bca2b948e17858f093ee0b52cf7b426aa15 | 999800c74a0fb1521e6c69d77f4707a71e1751da | refs/heads/master | 2020-12-24T09:55:14.064442 | 2016-11-11T09:15:24 | 2016-11-11T09:15:24 | 73,259,589 | 0 | 0 | null | 2016-11-10T12:30:13 | 2016-11-09T07:03:16 | Python | UTF-8 | Python | false | false | 7,524 | py | bayesian_optimization.py | import numpy as np
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern
from .helpers import UtilityFunction, get_unique_rows, PrintLog, acq_max
class BayesianOptimization(object):
def __init__(self, parameter_bounds, gp_kernel=Matern(), verbose=1):
... |
0c1852bccfeecd734779e9e4b933de9d04647d3c | f829939fdc73dcc3d923c1a7053af1108507bfba | /webdownload.py | f23fb8eb605118a10e40b6241d9c8cb49af20d2f | [] | no_license | kcthogiti/ThinkPython | a29638470ce00bf7bc4a2be7c8a4e52071396e7f | 3e60913c88c0ae9931c2de5ef50b77e8ecd2664d | refs/heads/master | 2021-01-10T08:53:15.364928 | 2015-11-22T02:20:14 | 2015-11-22T02:20:14 | 46,226,329 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 237 | py | webdownload.py |
import sys, webbrowser, requests
res = requests.get('https://automatetheboringstuff.com/files/rj.txt')
res.raise_for_status()
p = open("test.txt", "wb")
for chunk in res.iter_content(100000):
p.write(chunk)
print chunk
p.close() |
0e857e2025f7407ab65cb12115eb958357184c01 | b179ee1c603139301b86fa44ccbbd315a148c47b | /blank_res_str.py | 2a85a3de0a119fdcee7122e03ee06ed5ba5b0e8d | [
"MIT",
"Zlib"
] | permissive | prolog/shadow-of-the-wyrm | 06de691e94c2cb979756cee13d424a994257b544 | cd419efe4394803ff3d0553acf890f33ae1e4278 | refs/heads/master | 2023-08-31T06:08:23.046409 | 2023-07-08T14:45:27 | 2023-07-08T14:45:27 | 203,472,742 | 71 | 9 | MIT | 2023-07-08T14:45:29 | 2019-08-21T00:01:37 | C++ | UTF-8 | Python | false | false | 801 | py | blank_res_str.py | #!/usr/bin/env/python
# Check the blank resource strings for any key not found in the English
# resource strings. The English strings should always be fully populated.
data = {'shadowofthewyrmtext_blank.ini': {}, 'shadowofthewyrmtext_en.ini' : {}}
for fname in data:
with open(fname) as file:
lines = file... |
be485c8fcc86a8eed65e36761fe54e15896e4401 | 3d244294e1623c654857cc0879c176d24a6bd0f6 | /intervals/infinity.py | ef2a91f47d287b6f472c654420a27c7c3343cbe4 | [
"BSD-3-Clause"
] | permissive | kitsuyui/python-intervals | e5ddfbf85173b20108be026ad0cce675e95c9741 | c2dcf07529d411238e5b67d296b988a8fa247404 | refs/heads/main | 2022-12-05T05:12:33.372454 | 2022-11-24T09:13:05 | 2022-11-24T09:13:05 | 141,875,387 | 0 | 0 | BSD-3-Clause | 2022-11-24T09:13:06 | 2018-07-22T07:34:34 | Python | UTF-8 | Python | false | false | 610 | py | infinity.py | from enum import Enum
class Infinity(Enum):
Positive = object()
Negative = object()
def __lt__(self, other: object) -> bool:
if self == other:
return False
if self == Infinity.Negative:
return True
return False
def __gt__(self, other: object) -> bool:
... |
c7a7622923e17610853c1e8efeea377178a60b22 | 18d0fd624ea15d1c08ff6d5cc561881814ce4029 | /src/main.py | 02d15cdcab9e8ae617d77b95fdd14e9abd46ea41 | [] | no_license | Bensabat/Giant-Graph-Calculus | 48037756c8dc83d7f52de175c63ec7d61ff88376 | 925c6e80d2233b55e706ff5416502aa5a6a9899d | refs/heads/master | 2020-03-20T20:45:14.739018 | 2018-06-24T20:06:40 | 2018-06-24T20:06:40 | 137,704,566 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,565 | py | main.py | import sys
import time
from operator import itemgetter
from igraph import *
# Colors class for pretty print
class bcolors:
BLUE = '\033[94m'
GREEN = '\033[92m'
RED = '\033[91m'
GOLD = '\033[93m'
ENDC = '\033[0m'
# Function that add a vertex on a dict
def add_vertex_dico(vertex_dict, u, i... |
6859c6ead87eb3c507936c304cf2a96c3ea27ef2 | 6651d94aa24f2efcb9276b2b7016be3ee8662248 | /Logistic_Regression_on_Features.py | e4813c9c6edaf1a7c3d196843a8385d4e1a1988e | [] | no_license | jaiswalrichik/Galaxy-Morphology | aa88e715a29f27a080567437664b1a745097cb0c | ab007d1385cc992e05a64782b9bdf4e8189033cf | refs/heads/master | 2020-03-17T20:11:02.229386 | 2018-05-18T03:50:04 | 2018-05-18T03:50:04 | 133,896,797 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,519 | py | Logistic_Regression_on_Features.py | import matplotlib.pylab as plt
import seaborn as sns
import data_utils
import numpy as np
from time import time
from sklearn.linear_model import LogisticRegression
from sklearn import metrics
from sklearn.model_selection import GridSearchCV
projectFolder = 'D:\\Data Science\\NYU Data Science\\DS-GA 1003 Project Smalle... |
3698f21bd1d339a6cd3e8764f35f0053a982807e | 5390632b129323d8817a384a712696042df38558 | /50_Startups.py | 94327319a8dc053ca2ba0ddf5b87f84ad711c3c7 | [
"MIT"
] | permissive | kmeagle1515/50-STARTUPS | 5a50fd4dc162c13154ff0ca1d154e5343377cf42 | f81fe9eb6f0ed1213a68eea3556fc16b8a241ffb | refs/heads/master | 2020-05-03T06:23:06.391422 | 2019-03-29T20:39:14 | 2019-03-29T20:39:14 | 178,471,554 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 986 | py | 50_Startups.py | import pandas as pd
from sklearn import linear_model
from sklearn.metrics import r2_score
from sklearn.svm import SVR
from sklearn import preprocessing
dataTrain = pd.read_csv("50_Startups.csv")
le = preprocessing.LabelEncoder()
le.fit(dataTrain['State'])
print(list(le.classes_))
print(le.transform(dataT... |
4f9707d7ac90977c3e263528cbf8ab8353ac6029 | 45db85dc2ff232a90c951b4f235f36b55d72d45b | /places/urls.py | 85458bc071cf2a8aed90bf8541b6ee7059ee5c4b | [
"MIT"
] | permissive | AdilaSouza/crud_django | b5cb4d0842e4e53985f89be6c9f5475e29130bc1 | d9bbe88a49b725a49caaf0fe3ceeffdfdd2b3702 | refs/heads/master | 2023-01-22T16:07:55.093820 | 2020-12-02T03:55:52 | 2020-12-02T03:55:52 | 297,327,053 | 0 | 1 | null | 2020-12-02T02:02:52 | 2020-09-21T12:04:09 | Python | UTF-8 | Python | false | false | 361 | py | urls.py | from django.urls import path
from places import views
app_name = 'places'
urlpatterns = [
path('', views.index, name='index'),
path('detail', views.detail, name='detail'),
path('<int:place_id>/detail', views.detail, name='detail'),
path('<int:place_id>/delete/', views.delete, name='delete'),
path(... |
b0d3df0f86d0e267b8477d6674443b9a5ea0d787 | ee96dd041c00b7db4e6a2d401603db638be83ecd | /api_demo/assign_add_scatter_add.py | 787c37d96f6153143dbb16256ebb3066247dfcb3 | [] | no_license | huqinwei/tensorflow_demo | b8711b239638370b8190bdfe9d472633b55ca21a | 3b38e4a7e5770cfe607174b7b75b46f26e34b48b | refs/heads/master | 2020-03-29T02:10:51.441802 | 2019-03-05T07:23:54 | 2019-03-05T07:23:54 | 149,423,901 | 3 | 3 | null | null | null | null | UTF-8 | Python | false | false | 1,781 | py | assign_add_scatter_add.py | import tensorflow as tf
t1 = tf.Variable(tf.ones([2,3,4], tf.int32))
t2 = tf.Variable(tf.ones([2,3,4], tf.int32))
print(t1)
print(t2)
t3 = tf.assign_add(t1, t2)
print(t3)
print(type(t1))
print(type(t1[1]))
t4 = t1[1] + t2[1]
t5 = t1[1][1][1] + t2[1][1][1]
# t6 = tf.scatter_add(t1[1][1][1] + t2[1][1][1])
# t42 = tf.as... |
24df8136fd6ea447d5e603c254f5c5666bd7a581 | bc1a34209d5491ecd7832a2ee8673db465a75e53 | /srcTorch/BEN_modelCNN.py | 0563b08a12f1c6b00ee4efb19a39079bc4447a50 | [] | no_license | nguyendachungphu/Mediapipe-With-CNN | 879f35ba9952228c2cc25ce0d8994ceef19f8edb | a0272917c61403d0151c5c26b2c79c264c169e37 | refs/heads/master | 2023-06-04T17:30:36.852796 | 2021-06-24T03:21:24 | 2021-06-24T03:21:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,666 | py | BEN_modelCNN.py | import torch
import torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d , BatchNorm, Loss functions
import torch.optim as optim # For all optimization algorithms , SGD , Adan, etc.
import torch.nn.functional as F # All functions that don't have any parameters
from torch.utils.data import DataLoader ... |
4d64181c8c52101085501ca82d05c5518ef4b245 | b8480c09a1a31970e4e691254f3ca878bd5ca920 | /mlp/replay/replay_handler.pyi | 647a5b8b4c16ac78dd77a81dc802cbf9d662060c | [] | no_license | Ecialo/seven_something_somewhat | b7e96320feb7c0a0bbdc255527e12b0916c772cf | dddce65b5f95e488aa70023d20e65527b3a42ce9 | refs/heads/master | 2021-04-29T11:02:15.427405 | 2018-10-20T12:40:33 | 2018-10-20T12:40:33 | 77,858,425 | 0 | 2 | null | 2017-11-11T17:58:45 | 2017-01-02T20:00:15 | Python | UTF-8 | Python | false | false | 594 | pyi | replay_handler.pyi | from typing import (
List,
Dict,
Union,
BinaryIO,
)
from tornado import (
queues,
)
from ..commands.command import Command
from ..serialization import CreateOrUpdateTag
class ReplayHandler:
replay_path: str
is_alive: bool
queue: queues.Queue
# replay: List[Dict[str, Union[List[Cr... |
6a0bdd2b8956a4595a70e4809cdce8dc1f1db0ef | 4731981ae801808f12c01d1a66180b2ae548715f | /Bus.py | 5b7afaf47f3302c3b171c4a6d573840a0e705f35 | [] | no_license | JesseFentress/CMPSC462-Project-1 | 8af18ea30f5e85245abe9fd13cd93ad60d41f0cd | bb96ddcc77eae84cfb9e8214b0c3a7a04f123f2c | refs/heads/master | 2023-08-11T20:17:48.990756 | 2021-09-22T04:54:55 | 2021-09-22T04:54:55 | 404,907,555 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 638 | py | Bus.py | from Stack import Stack
from Student import Student
# Class that uses a stack to simulate a bus
class Bus:
def __init__(self):
self.seats = Stack()
# Encapsulates the stack push() function to put students on the bus
def getOnBus(self, student):
self.seats.push(student)
print(st... |
78237d7ec4bb9b8786265b55193aa4fe2eabafe5 | 5e51548b3b60b1e940c7c1c70a2e4314f698d004 | /SKIM/__init__.py | 4132a203eeb1591017c23021d3380463cc749c8f | [
"Apache-2.0"
] | permissive | tlmakinen/pyskim | ac47af882cb571820f3e7ad36fee13b46f33cf02 | 82cd0e460ee825ae1aa0bb4cf90b9b2545526a84 | refs/heads/main | 2023-03-22T19:01:33.541152 | 2021-03-12T13:34:46 | 2021-03-12T13:34:46 | 321,354,900 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 49 | py | __init__.py | __version__ = "0.1"
__author__ = "Lucas Makinen"
|
9512b3eca099284366f020f82f2586ad08210af0 | 6e5a17050eaeed44144440868b2cbb56390db545 | /CountingWords.py | 66889ed0af8c46c1e4c0c13bb20124088ed2eee9 | [] | no_license | yusuf17-10/c98 | 77af12f0754fb915dd938bd741fdcb1417c1e856 | 6a7f14eea411932b00aa916f93ee793ebe034ffc | refs/heads/main | 2023-03-08T06:33:46.223559 | 2021-02-22T15:37:36 | 2021-02-22T15:37:36 | 341,248,435 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 313 | py | CountingWords.py | introString = input("enter A Sentence : ")
characterCount = 0
wordCount = 1
for i in introString:
characterCount=characterCount+1
if(i == " "):
wordCount=wordCount+1
print("number of characters in a string")
print(characterCount)
print("number of words in a string")
print(wordCount) |
00b512be44a20b3d016c9566a41c8a8cff728c06 | 6bac4c98c7d4181697f7992752aac54ca63843a7 | /content/generate.py | 0fe6437572047a14d61afcfa7535a1edb4e338e5 | [] | no_license | RajeshHegde/phone-review-sentiment-analyser | 97c5e33ca7a2d7b4dd7fe92dcf2ef40ca99417a2 | 665749b7a712e6c9306360ce395a68055741fbd4 | refs/heads/master | 2020-12-03T00:15:51.904707 | 2017-07-02T06:22:38 | 2017-07-02T06:22:38 | 96,005,472 | 1 | 0 | null | 2017-07-02T06:08:29 | 2017-07-02T06:01:54 | null | UTF-8 | Python | false | false | 2,404 | py | generate.py | import re
import sys
sys.path.insert(1, '.')
from common.database import Database
reviews = Database().db.reviews
phones = Database().db.phones
phones_cursor = phones.find({})
sentiments = ['battery', 'design', 'camera', 'display', 'sound', 'heat']
for phone in phones_cursor:
phone_name = phone['phone_name']
prin... |
b0b2fc1d2249122c31c25414afc9ed663c41e03d | 44840e3f9a676da30e8c9657b3b7153af1434d3a | /app/stats/migrations/0001_initial.py | ed8b9a46f42fa8efe5baa01e0ebe8ccef147412e | [
"BSD-2-Clause"
] | permissive | macports/macports-webapp | 860996a722e11a40d3d3ec76cc5efc43579d8693 | 6cb75865a0b729d16cb648e8774276acf07ae54d | refs/heads/main | 2023-02-08T13:58:29.792649 | 2023-02-06T11:06:18 | 2023-02-06T11:06:18 | 178,649,833 | 57 | 25 | BSD-2-Clause | 2023-02-08T00:43:46 | 2019-03-31T06:10:21 | Python | UTF-8 | Python | false | false | 5,238 | py | 0001_initial.py | # Generated by Django 2.2.10 on 2020-05-01 11:56
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... |
e1486d68b6bf1962db42aea5731c93876e8997e4 | 9e9920c69f8c3f5bef01de97226f1ce5961e2534 | /temp.py | e6f0774f464fdfadb70bb540eaccc34960f7cb1c | [] | no_license | B21-CAP0356/Cloud-Backend | 7e3a5dab66c070e8037a38c62c0b90a1f4fac26a | 32c23aca964581acdf5d0e465cc9b8511abc7bb5 | refs/heads/main | 2023-05-15T03:32:41.484734 | 2021-06-09T11:26:36 | 2021-06-09T11:26:36 | 373,478,144 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,077 | py | temp.py | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import os
from google.cloud import storage
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'C:\Users\ASUS\Downloads\lofty-bolt-313607-e8b2d338b62e.json'
storage_client = storage.Client()
"""
Create Bucket
"""
bucket_nam... |
857006094724b758f175c4e97a00ecf3c22dcf5b | 0acb7b6461f8e63e2c9ad78201b0289287821670 | /staunishing/migrations/0010_product_cat.py | 4d82dd7e4487e08e8378944b9b90e6e4981637db | [] | no_license | tarandeep0908/watches | cf9fa9a449442857ae1821cf6b4175364d940b0c | 6412e45222cddd5c20643cbedc2e4a028abfc1ec | refs/heads/master | 2020-06-23T09:41:11.131130 | 2019-07-24T14:01:21 | 2019-07-24T14:01:21 | 198,587,431 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 434 | py | 0010_product_cat.py | # Generated by Django 2.2.2 on 2019-07-12 07:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('staunishing', '0009_remove_product_cat'),
]
operations = [
migrations.AddField(
model_name='product',
name='cat',
... |
29d2a3575ddd74a4ad45fee3e6589a6070bc7d00 | 3da76d1150433c8081987ed282235f895e82caae | /chatproject/apps/chatapp1/views.py | 91b886f800182f07db821eabfe36a7858f0cda21 | [] | no_license | rlr/django-gevent-socketio-redis-chat-example | 2f253fff64e729c3a65506621d37d17141f6d70b | a86045de705cbf60dca636fd944b43a547206340 | refs/heads/master | 2020-12-30T09:57:37.927028 | 2011-06-24T18:22:24 | 2011-06-24T18:22:24 | 1,832,846 | 26 | 8 | null | null | null | null | UTF-8 | Python | false | false | 1,772 | py | views.py | from django.conf import settings
from django.shortcuts import render_to_response
from django.template import RequestContext
from gevent import Greenlet
from redis import Redis
def chat(request):
"""Render the chat page."""
return render_to_response('chatapp1/chat.html', {}, RequestContext(request))
def soc... |
b0a9201e9e913379861522cb88fe835746d24a6c | 9906ece6069869694cbcc83d60ed5e140d4563d1 | /server.py | 03016cb667a8cbbc00134f75df7dac23188ac637 | [] | no_license | Kovak/NoRageNovemberApp | 6940ff5ca1b7b5b88a7c1dda9290cbebda522e96 | 261608969063169f88f3c9dcf3fcb41f16721ec7 | refs/heads/master | 2021-01-01T06:10:24.612539 | 2013-11-01T11:42:24 | 2013-11-01T11:42:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,029 | py | server.py | import bottle
from bottle import route, run
import os
import psycopg2
import urlparse
urlparse.uses_netloc.append("postgres")
db = os.environ["HEROKU_POSTGRESQL_PURPLE_URL"]
url = urlparse.urlparse(db)
@route('/increment_number_of_rages')
def increment_rages():
conn = psycopg2.connect(
database=url.path[1... |
9c7f3ee8db10b9dc4366fd6692b6dfa15f1d35d1 | b63eeef355bbd6d65d262b5a5a1d622785420325 | /von-neumann.py | 848cee9516eb8fa839087074f07dcef800321d2b | [] | no_license | thelightwasbrighter/von-neumann | fa22801d4c975659ddff2d645d6444bd5c063297 | f6027afe57bc8c5d18333c02652759f492e740c6 | refs/heads/master | 2021-01-10T20:59:00.167782 | 2014-11-21T00:51:18 | 2014-11-21T00:51:18 | 10,481,270 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 41,384 | py | von-neumann.py | #!/usr/bin/env python2
import random
import math
import sys
import time
from time import strftime, gmtime
import importlib
import copy
import pygame, pygame.locals
import gzip
sys.path.reverse()
sys.path.append(sys.path[len(sys.path)-1]+'/ais')
sys.path.reverse()
UNIVERSE_WIDTH = 400
UNIVERSE_HEIGHT = 260
PLANETS = ... |
b7a6db8236c23fc4f0e3abf7ec025668ab12bfb2 | 686caafac9e57b7f16e7148b5bd4ad3b8aa046f9 | /apis/procedure/controller.py | 5a3cd929305a4f50b4aa8385bd00f25bcf0670df | [] | no_license | sam735/Pyramid_restfull_Api | 7368fdcfe90cc819e00dd664ee17a08c9365006b | c0155785464cfc0462a2d558165707d8fdc52ffb | refs/heads/master | 2020-04-28T15:19:09.405579 | 2019-03-13T07:29:11 | 2019-03-13T07:29:11 | 175,368,292 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,034 | py | controller.py | import json
from pyramid.response import Response
from apis.procedure.service import insert_procedure, fetch_procedure
def add_procedure(request):
try:
insert_procedure(request)
except Exception:
request.db.rollback()
return Response(
status='500',
body=json.dum... |
9b0c98267f9460d3fa4188142f388cfaed48ef0f | 2ccbd3a49f6bbaa32bd1288e331dbbd565f4a3a6 | /grass7/vector/v.out.gps/v.out.gps.py | 4af1db2eef26a1902fc1316cf8344b6b44be859b | [] | no_license | Tekpre012/grass-addons | 127cdded15ce87eead9b77f3f348ebca511fa0e7 | 8f56d3ab47c5e845812231d20234b30c0230c8a2 | refs/heads/master | 2020-08-06T19:46:43.534720 | 2019-10-04T20:08:22 | 2019-10-04T20:08:22 | 213,129,488 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,694 | py | v.out.gps.py | #!/usr/bin/env python
#
############################################################################
#
# MODULE: v.out.gps
#
# PURPOSE: Exports a GRASS vector map to a GPS receiver
# or data file using GPSBabel
#
# COPYRIGHT: (c) 2008-2009 Hamish Bowman, and the GRASS Development Tea... |
b23e37bbd611332a8835c8b4a06b1f83e5c867d6 | d7e0303d7f8ab4b89deb25f88e586f4a392975a0 | /DiabeticRetinopathy/Learning/learning.py | 01fb70c77a8d7ea801964ec128eaeac2e7ae994f | [
"MIT"
] | permissive | gurusura/retina | 915131cba28d3be965f2724ed5db9250d6d6a4a8 | 2bc50b3354e5e37f1cfd34f11fbe4b0a4178b7ac | refs/heads/master | 2022-01-23T06:47:54.569924 | 2016-01-07T05:09:16 | 2016-01-07T05:09:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,369 | py | learning.py | import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC
from sklearn.cross_validation import train_test_split
from kobra import SKSupervisedLearning
from kobra.tr_utils import time_now_str
import numpy as np
sample_file = '/kaggle/retina/reduced/features/sample/features.csv'... |
f93b89f90634f3e5620b574a9d5c507cd014fd72 | 2f6128cbb8a7f1cc66693023d0ed0433cc59ebd6 | /rango/forms.py | bd571fecc4fe190ebf00db775d087b926394da1d | [] | no_license | vansant/Tango-With-Django | 12d0a2d371fa1f4cefea90efbe1606b9add90c22 | 2c0d13bd8430f14fcd7388903c2039953914c20c | refs/heads/master | 2016-09-05T23:20:13.488325 | 2014-06-18T19:36:29 | 2014-06-18T19:36:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,417 | py | forms.py | from django import forms
from rango.models import Page, Category
class CategoryForm(forms.ModelForm):
name = forms.CharField(max_length=128, help_text="Please enter the category name.")
views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)
likes = forms.IntegerField(widget=forms.HiddenInput(), ... |
3c69431f8eac047cb7ab6823d9a1e232704201e7 | bce6119d4c20d93b9ec206054bca793fb89de9c5 | /get_colors/U-2-Net/helpful_methods.py | 1cc0da45219326a1552ec4caf8d158584e4c143e | [
"Apache-2.0"
] | permissive | ks867/colorRecognition | 14e2dea225cb1ab36737b955c24fd2f7a111481c | bb45b71f5e86bd559189dc0e200546716f19318d | refs/heads/main | 2023-06-17T03:32:14.231973 | 2021-07-17T21:49:56 | 2021-07-17T21:49:56 | 368,818,068 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,729 | py | helpful_methods.py | import numpy as np
import cv2
def color_avg(photos, name):
""" Saves the average color of a list of color swatches as a new color swatch with the given name.
Params: {photos: List,
name: String}
Returns: None
"""
rgbs = [np.array((c[:,:,0][0][0], c[:,:,1][0][0], c... |
203bb6bd7175440a01a656cd10be2b785c90866e | fdbf338088d72a13b11d7982ca81bc577e63661b | /3x+1.py | 745f78d1c7c117712a040f4d07cfa54c03d9dd8e | [] | no_license | Aituns/fluffy-doodle | 7b74b19f977f280031b8b3c6ce817beef1239486 | a7a0de61cab61c01d4c7f8b4889bc395a5671634 | refs/heads/main | 2023-06-28T18:12:40.668929 | 2021-08-06T18:17:14 | 2021-08-06T18:17:14 | 393,464,111 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 539 | py | 3x+1.py | def devide_by_three_add_one(n):
return 3*n+1
def devide_by_two(n):
return n/2
#values = int(input("Input highest range: "))
number = 1
i = 0
#for i in range(values):
while True:
number = i + 1
steps = 0
ognum = number
while (number != 1):
if (number % 2) == 0:
number = dev... |
3693d947bb1dde0888f61b6c3accfe64b1c88f12 | 7ed4a07b8b41269245aa79137d119e1992bb4347 | /datastructures/relationalpath.py | 93b41f21e6412d823c18a72ec8d1cccd465db9d3 | [] | no_license | himahuja/StreamMiner | e6f9118f2065f299b48664c84e45fcabd931b952 | 4cd156e75fe80571141ae6c470230688c5914904 | refs/heads/master | 2022-12-17T21:56:10.074844 | 2020-09-09T09:55:39 | 2020-09-09T09:55:39 | 145,911,405 | 12 | 2 | null | 2022-11-04T19:36:27 | 2018-08-23T21:58:29 | Python | UTF-8 | Python | false | false | 1,581 | py | relationalpath.py | """
A class to create instances of relational paths produced by closure algorithms.
"""
import numpy as np
ROUND_DIGITS = 15
rel_delim = " -{}-> "
node_delim = "[{}]"
class RelationalPath:
def __init__(self, src, rel, target, score, pathlen, path, rel_path, caps):
self.source = src
self.relation = rel
self.tar... |
3787d6f459340636f5a5cea8ed6270afde533554 | 1683cd92471c08a6e6fb4a2913a78ba2658d1fc8 | /tests/ngc6946_ca.py | 20cde7eb5301137dcdbb802c19cbd06947d2d4a5 | [
"CECILL-B",
"LicenseRef-scancode-cecill-b-en"
] | permissive | pombredanne/csh | 04ed74007d3725782871ef7a4fb52ba6b4a0a45c | 6e36fea6ccb9fdd6e79f92d9fd1840f98f4c9805 | refs/heads/master | 2021-01-01T00:06:15.637419 | 2011-07-18T15:28:04 | 2011-07-18T15:28:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,302 | py | ngc6946_ca.py | #!/usr/bin/env python
import numpy as np
import os
import tamasis as tm
import lo
import csh
# define data set
datadir = os.getenv('CSH_DATA')
filenames = [datadir + '/1342185454_blue_PreparedFrames.fits[5954:67617]',
datadir + '/1342185455_blue_PreparedFrames.fits[5954:67617]']
pacs = tm.PacsObservation(f... |
0cdc7c2b12a955ee616eddd28772b4af652fcb5b | 219588f6643881fb75b086fed64424db3b2204b7 | /src/bat/derivekernelconfig.py | 8d093fe9891629d2483ba4f5e239004ee21983ce | [
"Apache-2.0"
] | permissive | armijnhemel/binaryanalysis | 910ded34a7c0be52dad18e0c8bf36b524b7fb94f | ea97b6b7617128ccf7cfa19244b91675d9bf66df | refs/heads/master | 2022-06-28T23:51:52.842978 | 2022-06-14T19:43:37 | 2022-06-14T19:43:37 | 68,471,787 | 81 | 54 | null | null | null | null | UTF-8 | Python | false | false | 7,011 | py | derivekernelconfig.py | #!/usr/bin/env python
# Binary Analysis Tool
# Copyright 2013-2016 Armijn Hemel for Tjaldur Software Governance Solutions
# Licensed under Apache 2.0, see LICENSE file for details
'''
This program prints out a possible partial configuration for all Linux kernel
images plus associated modules found in a scan done by B... |
f562d48969ce8b469601ee9e8ada2d7c82dc6880 | c92a06100a60564f554aed33d675c8ab36dc16c0 | /favourite_number.py | ae3c0631877633a6cc1f80f9eef5462d8038acd4 | [] | no_license | Paul-Marchenko/PythonTrainingTasks | 1cdc7042979fc77acb3d480a45c3cc2e2b2257d9 | fc8afe2cb8d80ba76f8d01a989fe86b7d3a3973d | refs/heads/master | 2020-03-12T01:05:05.186234 | 2018-08-09T15:13:57 | 2018-08-09T15:13:57 | 130,366,926 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,337 | py | favourite_number.py | import json
"""
def enter_favorite_number():
file_place = 'my_numbers.json'
try:
favor_num = input("Your number: ")
with open(file_place, 'w') as file_1:
json.dump(favor_num, file_1)
except FileNotFoundError:
print("Something wrong")
except Exception:
print(... |
5dbc5227b19ada5a57746a1c3c78074888b48df9 | 25a29869bfd825f5fe48743e0a354c7383f01461 | /python/alpenglow/utils/DataframeData.py | 60a69d9b376d2386e955b3d7e9b008e83a655e87 | [
"Apache-2.0"
] | permissive | KartikPadmanabhan/Alpenglow | b4ceafc4d45b65b49685cef3df00134e714bb2aa | bad491ac740ba3566716b52fe177a58323b351b4 | refs/heads/master | 2021-01-20T07:27:56.367909 | 2017-08-27T08:19:00 | 2017-08-27T08:19:00 | 101,541,509 | 1 | 0 | null | 2017-08-27T09:12:28 | 2017-08-27T09:12:28 | null | UTF-8 | Python | false | false | 1,791 | py | DataframeData.py | import alpenglow.cpp as rs
import numpy as np
import sip
class DataframeData(rs.DataframeData):
"""Python wrapper around :py:class:`alpenglow.cpp.DataframeData`.
"""
def __init__(self, df, columns={}):
super(rs.DataframeData, self).__init__()
self.columns = columns
self.position = ... |
5c5a4e233ba09675c51c4a3c30d916097ff7c346 | ffa64ebf830da803c6bb753fa56eefcb11fe3f17 | /1_Software_Development_and_Design/1.6_Identify_the_advantages_of_common_design_patterns/mvc_controller.py | 17d022883a52b44f0cfd6eab4323a85271752780 | [] | no_license | automatethenetwork/devnet-associate | fe0695fc30c083b8b9c653270104132d7d64eee8 | 33171217a8d9e96edb386ad99b727a8396f9c728 | refs/heads/master | 2022-12-02T04:56:34.047056 | 2020-08-10T15:10:08 | 2020-08-10T15:10:08 | 273,618,549 | 2 | 0 | null | 2020-06-20T01:41:02 | 2020-06-20T01:41:02 | null | UTF-8 | Python | false | false | 785 | py | mvc_controller.py | class Device: # model
ip = ""
port = ""
@staticmethod
def findDevices():
devices = []
d = Device()
d.ip = "192.168.1.1"
d.port = "80"
devices.append(d)
d = Device()
d.ip = "192.168.1.2"
d.port = "81"
devices.append(d)
d ... |
02a277cecba442476c629c42c3b7d373bf87499f | 9acb90245df7700851964a980b67902abdf29120 | /datalayer.py | 6a10d7b084667f084c477f0adf1c7afd1cb37d95 | [] | no_license | bhrzk/Twitter-Cpation-Analyzer | 4fe562dcd3ae0887c0802b8f63ac87c6ec13b058 | 9f285a959c64eb40b188df1bde3b3649622963b7 | refs/heads/master | 2022-10-07T03:51:52.204537 | 2020-06-12T15:58:45 | 2020-06-12T15:58:45 | 271,833,778 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,151 | py | datalayer.py | import asyncio
import aio_pika
import json
import motor.motor_asyncio
import configs
async def send_to_analyze(message):
await configs.RABBIT_CONNECTION.default_exchange.publish(aio_pika.Message(body=json.dumps(message, ensure_ascii=False).encode()), routing_key="analyzer")
async def insert_query(req):
awai... |
fcc0a258dace84a9a62ad61e869554066db67acc | f5ba406d2da9ace67cd7daf56c25f5d142b30a0c | /cls/json2.py | f823c36ba95cea0202c3634f993680f0fee47a9d | [] | no_license | searchlink/pycodes-from-Guo | b6ee60eeceba0ca80910085e8ef5a3c445d2eb49 | 6e17271e5ab89d77a649f54be02b0dbec0c7f1f7 | refs/heads/master | 2022-11-22T02:17:31.688141 | 2020-07-17T03:46:37 | 2020-07-17T03:46:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,893 | py | json2.py | # json与其它python格式的互相转换
import json
class Myjson(object):
def __init__(self, datas):
self.data = datas
# dict字典转成json数据
def dict2json(dict):
# dict = {}
# dict['name'] = 'many'
# dict['age'] = 10
# dict['sex'] = 'male'
# print(dict) # 输出:{'name': 'many', ... |
04d90611bf1d0a31093b0e012a749b31d736731c | cfa6eedda4ab55043380ac12c8fbd96013b4bebc | /a.py | 7a717a1b8b00d6b611e3b81f810b5890634ad72f | [
"MIT"
] | permissive | dark0ghost/test_rust_on_python | 947e5112fb2c29ef733013fdc737df6c5fb47b3b | 0c0377e303a60e1e9425d175e1a2911f27787f5f | refs/heads/master | 2023-06-02T18:06:32.566459 | 2021-06-19T19:26:35 | 2021-06-19T19:26:35 | 259,262,229 | 0 | 0 | MIT | 2021-06-19T19:26:36 | 2020-04-27T09:09:40 | Rust | UTF-8 | Python | false | false | 166 | py | a.py | from target.release import libfastpython
from time import sleep
print(libfastpython.sum_int(65343253232, 6787867878))
print(libfastpython.test_thread())
sleep(100)
|
a4270d13abef978514bfa1b014f6d759a067eeb7 | 4e328f5fa3e12dd72d715a49c0290d5de4dd5107 | /Scripts/test_address.py | cd2c47ba95fdb6e0b2b756962d19ac14c0259e8a | [] | no_license | LGY2008/BJ06BNAL01 | e697f7f4cd8e90f0857a6ebb654d878c5e71cd14 | af867d43c8b0fd5ad8a3863e00e39c692d888b75 | refs/heads/master | 2020-04-08T21:55:05.938606 | 2018-12-03T07:00:38 | 2018-12-03T07:00:38 | 159,763,401 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,050 | py | test_address.py | import os,sys
sys.path.append(os.getcwd())
import allure
from Base.read_yaml import ReadYaml
import pytest
from Page.page_in import PageIn
def get_data(data_type):
arrs = []
if data_type=="add":
for data in ReadYaml("address.yaml").read_yaml().get("add_address").values():
arrs.append((data.... |
131fe2c0181770842988d3721ea56a2eda4e832f | da469df99e63b92f91a4846a97cb0d6699f58966 | /otokon_homework/contact/forms.py | 535ac8be209931d032d8b90297d18f327fc0a462 | [
"MIT"
] | permissive | bilbeyt/otokon-homework | 2e6ad27ad79e1f47f8e9ce98473077f6be615f8e | 60b456b5ce3c36b4afae2573e4af14c0eceab42a | refs/heads/master | 2021-01-20T17:50:46.569456 | 2017-10-19T16:52:10 | 2017-10-19T16:52:10 | 61,724,806 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 516 | py | forms.py | from django import forms
from contact.models import Message
class MessageCreateForm(forms.ModelForm):
class Meta:
model = Message
exclude = ["send_user", "to_user", "slug", "answer", "is_answered"]
class MessageUpdateForm(forms.ModelForm):
class Meta:
model = Message
exclude ... |
4b9cb9aef9e431129c94f5bafd1da5862dbc8b8e | 48d91655683a27919efc5948e081fdbc0f6c0d4e | /myapi/models/task.py | 7d9b05213fac2e003c9502ae6df461efeabddacb | [] | no_license | cj-lin/coding-exercise-flask | c932355a2ad8ef5902fcb1e29445d7d96b4bba19 | 34d1cc318cff162ddd94505811a150a24e760511 | refs/heads/main | 2023-03-06T17:32:16.248723 | 2021-02-12T20:50:40 | 2021-02-12T20:50:40 | 334,783,176 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 312 | py | task.py | from myapi.extensions import db
class Task(db.Model):
"""Basic task model"""
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), unique=True, nullable=False)
status = db.Column(db.Boolean, default=False)
def __repr__(self):
return "<Task %s>" % self.name
|
0c69b43fe88362dcc2b456e2c85e07d71c2ae543 | ec987d09263009ca7238bb3924572b0310bc29b5 | /Assignment 5/layer.py | a20419a846450962b41d539e465eee1f7589b333 | [] | no_license | nimakondori/400D_Assignments | 0f7eab5b4a440a4e40dc63ec03c6c59693fe2e76 | 37e1907ed269c2193bc0b2b108c0fe66d5555a5a | refs/heads/master | 2022-07-30T06:22:07.624269 | 2020-05-26T18:09:05 | 2020-05-26T18:09:05 | 267,114,534 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 922 | py | layer.py | import numpy as np
class Layer(object):
""" Abstract Base class for a layer """
@property
def output_shape(self):
raise NotImplementedError
@property
def input_shape(self):
return self._input_shape
@property
def has_params(self):
return False
@property
d... |
653b8c02ebbc3cdf30d1b1d44f79b8ba611298dd | 8fbdedebc092f38fa859c6a71e9b4a81a053fbe1 | /logical_comparisons.py | f83d5d52bac04ecb8d5938f55f9541fc73c30db0 | [] | no_license | kelbymartin/kmart-python | b34a197eabd7a93311762f6e80cca0d4b8a93118 | 7800d75d38e6bc2cff2ff33c0e1e502b80fe2b7f | refs/heads/main | 2023-03-11T02:08:05.399930 | 2021-02-26T17:53:00 | 2021-02-26T17:53:00 | 341,973,933 | 0 | 2 | null | 2021-02-24T18:09:00 | 2021-02-24T17:07:39 | Python | UTF-8 | Python | false | false | 149 | py | logical_comparisons.py | print(5 < 10)
print(5 < 5)
print(5 == 5)
print(5 != 5)
print(5 <= 5)
print(True and True)
print(True and False)
print(True or False)
print(not True) |
c197334d46fb9e59c8649f570da81e41448fbb11 | 0be19cd3a3ec44141f03dd523da6fb770b08f569 | /src/smart_compose/run_smart_compose.py | 628cd1cf84b9aa86b82bce5441be277aeb25b435 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | linkedin/detext | f2cdace77d4b3c6cc88d3992a67dde305e2b8a52 | 671d43c5ffc83cae635174ed15c58d0bc84b76ef | refs/heads/master | 2023-09-01T00:53:57.571516 | 2023-03-02T22:27:06 | 2023-03-02T22:27:06 | 234,432,813 | 1,289 | 151 | BSD-2-Clause | 2023-03-02T22:03:34 | 2020-01-16T23:38:58 | Python | UTF-8 | Python | false | false | 2,191 | py | run_smart_compose.py | import sys
import tempfile
from dataclasses import asdict
import tensorflow as tf
from absl import logging
from official.utils.misc import distribution_utils
from smart_compose.args import SmartComposeArg
from smart_compose.train import train
from smart_compose.utils import distributed_utils, parsing_utils
def main... |
8f00201b68fda3a0f2c7235549a360acb69cf40b | 1fc543de89c69fff05ff7c2daa3482f5dc2af551 | /test/redis_test.py | 8ef4053099fed518ab33ce5d8268ae9eada3ff2f | [] | no_license | nkpatro/Shotgun-Redis | af5fe0f3f95377f5b43f69ca93ab57d682196c2e | 5707afed339a973791a1a4db88b14f4347785f39 | refs/heads/master | 2020-03-18T09:01:22.434372 | 2011-05-18T13:01:42 | 2011-05-18T13:01:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 447 | py | redis_test.py | import re
import redis
import pickle
#result = sg.find( 'Version', filters, fields )
#print '#results: ', len(result)
#print "RESULT: ", result[0]
results = []
rd = redis.Redis('localhost')
if rd.exists( -3689653915491585144 ):
results = pickle.loads( rd.get( -3689653915491585144 ) )
shots = []
for result in r... |
e09407b21b376248fa08d7a5415240b46bf088b1 | dcbb35c966b4b98e0313bdd45068bb4e29b93d55 | /Scheduler.py | 97018a6d45fc998e3eeb3c95a9fadc2da57d6a8a | [] | no_license | prodipta/QuantInsti | 6dcd3bb7e976756a09c48c60af02c1bb2b8a7a29 | 220c5a7887f500681595e961a3486c2feeadce98 | refs/heads/master | 2020-03-26T21:57:34.202684 | 2018-08-12T12:46:08 | 2018-08-12T12:46:08 | 145,421,373 | 0 | 1 | null | 2018-08-20T13:28:54 | 2018-08-20T13:28:53 | null | UTF-8 | Python | false | false | 589 | py | Scheduler.py | #!/usr/bin/env python
import sys, time
from daemon import runner
from Algorithm import Algorithm
from DataManager import DataManager
import redis
class Scheduler():
def __init__(self):
self.tickNo = 1
self.dbm = DataManager()
self.algo = Algorithm(self.dbm)
self.rCon = redis.Redi... |
d2fe3708f0f571c461cce3563d8c5b2959b5a20d | 4e746f844d0c50c788819a8f8492b3bd10f9b402 | /core/cruiser/geneticcruiser_test.py | f5bbd2f20b852c10c98aa61728982bd332195613 | [] | no_license | hbwzhsh/foxengine | 80bc241a0e68cf5574612d1987883eb2d1fa49d2 | 4fc290f16d01c39114c7a8cc28b99f513becbfb3 | refs/heads/master | 2021-01-23T02:06:18.050575 | 2013-01-20T04:36:00 | 2013-01-20T04:36:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,763 | py | geneticcruiser_test.py | # -*- coding: utf-8 -*-
import sys
import time as stime
import unittest
import logging
import os
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
#准备测试环境
from django.core.management import setup_environ
import wolfox.foxit.other_settings.settings_sqlite_test as settings
setup_environ(setting... |
c614f9780d78e84f7e5e143da27fb96b30241791 | 4cb9ceb8840ed18c9d5b17faee4eb5841f890c83 | /tests/rustworkx_tests/generators/test_heavy_hex.py | c97c1d08b5b5231108ec782bd15752bb25ce8b5e | [
"Apache-2.0"
] | permissive | Qiskit/rustworkx | f5c4b94d21bee2fcac999cd2057246c307570bad | e0af0a26c71eadb6d15807efb6ec1cd4d3893244 | refs/heads/main | 2023-09-01T03:45:25.807566 | 2023-08-30T13:48:41 | 2023-08-30T13:48:41 | 186,025,444 | 250 | 38 | Apache-2.0 | 2023-09-14T14:08:45 | 2019-05-10T17:09:02 | Python | UTF-8 | Python | false | false | 10,733 | py | test_heavy_hex.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
52e52e06a68e91824ad7929eded8f09868e2d2d7 | c97bed6b89d0725a4480d1ca741783b0dce4fe74 | /cell_maker.py | bd321671bc61639928c098f066d0e16ca0434a36 | [] | no_license | alan010/MyBrain | d106256c41b63a9fcc47264d156a7347e5287db8 | 2309198481a5aabac7d3db84361fed6227474131 | refs/heads/master | 2016-08-12T07:05:14.322120 | 2016-01-31T03:36:49 | 2016-01-31T03:36:49 | 52,013,492 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,337 | py | cell_maker.py | #! /usr/bin/python
import sys, os, random
TEMP='/root/MyBrain/cell_temp.py'
BASIC_DIR='/MyBrain'
def open_temp(cell_temp):
return open(cell_temp).read().splitlines()
def gen_axon():
while True:
path = '/'.join([BASIC_DIR, str(random.randint(0,255)), str(random.randint(0,255)), str(random.randint(... |
96413965c6b5541d6151e091c1ef1f13dc449a7b | 559f3dec0964d2e0f86c6c871371fe779cf3726c | /contrib/QualityInspector/tools/uad/patchcore/val.py | c8233bb29c3bae5274795737b30f05bc7e2decae | [
"Apache-2.0"
] | permissive | PaddlePaddle/PaddleSeg | 319ab26665ea492527a1949671650135123ffc39 | 2c8c35a8949fef74599f5ec557d340a14415f20d | refs/heads/release/2.8 | 2023-08-31T09:08:06.724717 | 2023-08-18T01:59:56 | 2023-08-18T01:59:56 | 204,380,779 | 8,531 | 1,866 | Apache-2.0 | 2023-09-12T02:30:42 | 2019-08-26T02:32:22 | Python | UTF-8 | Python | false | false | 9,645 | py | val.py | # Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
f4dd13da4505b03cb60a3c8ef8d4f813cbcb44fa | 7eb9c62866bed445a165a87e9125d07908350c33 | /benchmark.py | 8f15394925ef556cf4ca13f6d9275c9325c35348 | [] | no_license | archibate/facereco | c3f93396305298a943b65670ab1582a7f1742a0c | ce89e271ad752d99f838bcc3190d9278fa219756 | refs/heads/master | 2023-06-09T18:29:19.288414 | 2021-03-15T09:07:46 | 2021-03-15T09:07:46 | 376,837,267 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 569 | py | benchmark.py | from core import FaceDetector
import argparse
import cv2
def benchmark(func, times=20, warmup=2):
import time
for i in range(warmup):
t = time.time()
func()
print('warmup', time.time() - t)
t0 = time.time()
for i in range(times):
t = time.time()
func()
pr... |
181def31c36bd2f25dee13310d16709704280307 | 47cdfe37c164a4d89ea3373c52b54ed9cd832bad | /Task 3/1).py | ead3884bc562d004de17ac389a99440c60c304c2 | [] | no_license | Dhairya2512/Dhairya2512 | 7c8f1d292ccb70dd0d18376e0010df9f7340f14c | 86d98b7b1ee52b4bb9bb25210218bf91e3a7621f | refs/heads/main | 2023-05-13T08:09:29.950372 | 2021-06-10T04:57:14 | 2021-06-10T04:57:14 | 370,753,265 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 247 | py | 1).py | n = int(input("Enter Number to calculate sum & average"))
sum = 0
for num in range(0, n + 1, 1):
sum = sum + num
average = sum / n
print("SUM of", n, "numbers is: ", sum)
print("Average of", n, "natural number is: ", average) |
c08157d14498f8a2c655c4b67a21f686726b7790 | 1c390cd4fd3605046914767485b49a929198b470 | /leetcode/pancake-sorting.py | 1ddc95fab207f8da64815c12f951a13743632dd9 | [] | no_license | wwwwodddd/Zukunft | f87fe736b53506f69ab18db674311dd60de04a43 | 03ffffee9a76e99f6e00bba6dbae91abc6994a34 | refs/heads/master | 2023-01-24T06:14:35.691292 | 2023-01-21T15:42:32 | 2023-01-21T15:42:32 | 163,685,977 | 7 | 8 | null | null | null | null | UTF-8 | Python | false | false | 284 | py | pancake-sorting.py | class Solution:
def pancakeSort(self, a: List[int]) -> List[int]:
z = []
for i in range(1,len(a)+1)[::-1]:
r = a.index(i)+1
z.append(r)
a[:r] = a[:r][::-1]
z.append(i)
a[:i] = a[:i][::-1]
return z |
f1040cf7b762b2216f65ab4cfe83e292a06352b2 | 6e39f57de23589b3b289f0ed5c56674fd1dec68b | /labs/Lab2.py | 3ff23a08b809bb605974d56f8b9d2b91d9c07567 | [] | no_license | anderson-github-classroom/csc-448-student | 062d6e00cf5456db90291a1c0d8b233f60421754 | 1b4471551ff51206daa026eb8ad5348cb5ab59e3 | refs/heads/master | 2021-05-18T19:33:48.735024 | 2020-12-04T16:46:57 | 2020-12-04T16:46:57 | 251,380,214 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 24,492 | py | Lab2.py | # ---
# jupyter:
# jupytext:
# formats: ipynb,md,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# + [markdown] slideshow={"s... |
b6f7e96cce340738f1d7567bb067f7ac8b651d71 | 50e1000773a456a4454da3b65e08cdc406bbcd48 | /functions.py | 645ba2cefe4a76b35c432a4fc28af580226886c8 | [] | no_license | christianmaza/Web-Development-with-Python | 702545641e718c96bc38060196ca742a600daa2d | 638628860434ac58b2e6f94ede446561ac40b51f | refs/heads/master | 2022-12-26T06:21:02.889751 | 2020-09-30T00:29:39 | 2020-09-30T00:29:39 | 299,798,198 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 295 | py | functions.py | def square(x):
return x * x
def main():
for i in range(5):
# .format is the older way for placing data in placeholders.
print("{} squared is {}".format(i, square(i)))
# the newest way is to use print(f"{i}...{square(i)")
if __name__ == "__main__":
main()
|
37df5cb4195b4ddb4a1b9e4874a24fcb1a105531 | cc4357a9c1c8ba731b0a9d20e86239c7a2557670 | /tutorial_tensorboard.py | 729f9503ab8ccda9fd9d23b502b6a3bdda1bbf85 | [] | no_license | seungwon91/TensorflowTutorial | 5a25d4f4fae8c561a3c08f0d6ea14545f52126fe | 0daa35ac4562ed23d05a402a7266106796f1cd3d | refs/heads/master | 2021-07-08T03:49:24.464985 | 2017-10-05T14:25:55 | 2017-10-05T14:25:55 | 105,899,098 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,536 | py | tutorial_tensorboard.py | import tensorflow as tf
import numpy as np
from tutorial_tensorboard_utils import new_fc_layer, new_fc_net
batch_size = 16
x_dim, y_dim = 564, 10
data_x, data_y = np.random.rand(batch_size, x_dim), np.zeros((batch_size, y_dim))
for cnt in range(batch_size):
data_y[cnt, np.random.randint(0, y_dim, size=1)[0]] = 1
... |
40df49851f311c928af503802e3a8d15acb8b069 | f9f0529316f8b883cc9b4a73b72d7588461178a6 | /uteis/metodos/__init__.py | 012917ed6589b91e0e2351c833e1e3069eafc167 | [] | no_license | victoraugusto6/selenium-python-covid | d4b7777a15c7ac70d53d959455800eb3862379fb | ab8fc42d5842085bdbfd4c02ab0a1b37a7412f44 | refs/heads/master | 2023-08-07T02:37:47.970954 | 2021-02-10T02:21:02 | 2021-02-10T02:21:02 | 323,229,561 | 0 | 0 | null | 2021-09-15T12:52:09 | 2020-12-21T04:24:33 | Python | UTF-8 | Python | false | false | 1,170 | py | __init__.py | import chromedriver_autoinstaller
from selenium import webdriver
from time import sleep
from datetime import datetime
# Driver
chromedriver_autoinstaller.install()
driver = webdriver.Chrome()
# Url
url = "https://www.coronatracker.com/"
# Abrindo página
driver.get(url)
# Aguarda 1 segundo
sleep(1)
# Datas
data_atu... |
bb449f6409efcb5821ecdb98d442b02e89f4e238 | 94c0ade24bbe69ecb1596e2245c8fc7fee7739e3 | /csv_to_excel.py | 6f366e7c806f8275dc94909f56fb8de7a11198be | [] | no_license | rafaelakiyoshi/csv_utils | db73692cd2872de69881dab7daecd77d8cef1b2b | 53322bb43f9cea609e69573d35f25c6b3f416a79 | refs/heads/master | 2020-05-24T05:33:18.811056 | 2017-03-12T03:48:25 | 2017-03-12T03:48:25 | 84,826,637 | 0 | 0 | null | 2017-03-13T12:58:17 | 2017-03-13T12:58:17 | null | UTF-8 | Python | false | false | 763 | py | csv_to_excel.py | import os
import glob
import csv
from xlsxwriter.workbook import Workbook
for csvfile in glob.glob(os.path.join('.', '*.csv')):
workbook = Workbook(csvfile + '_2.xlsx')
worksheet = workbook.add_worksheet()
offset = 130000
limit = 230000
with open(csvfile, 'r') as f:
spamreader = csv.reader... |
44c08a049d6b5569d4b3029e4527d082972ad9d3 | 8dcbda8b9fc3efeb49e5b4016b375b100073f4c4 | /stable_baselines3/common/envs/multi_input_envs.py | d7e222d0be3c45a6d2c0e034be2a9cbc415c4d5e | [
"MIT"
] | permissive | DLR-RM/stable-baselines3 | 16844c0778d824d311918b2ea9cafe9b1f54a3dd | 84163b468c99538f2c98a3ebcc6124974ec631fd | refs/heads/master | 2023-08-30T19:08:15.262853 | 2023-08-30T15:02:41 | 2023-08-30T15:02:41 | 261,372,860 | 6,430 | 1,534 | MIT | 2023-09-12T09:28:34 | 2020-05-05T05:52:26 | Python | UTF-8 | Python | false | false | 6,497 | py | multi_input_envs.py | from typing import Dict, List, Optional, Tuple, Union
import gymnasium as gym
import numpy as np
from gymnasium import spaces
from stable_baselines3.common.type_aliases import GymStepReturn
class SimpleMultiObsEnv(gym.Env):
"""
Base class for GridWorld-based MultiObs Environments 4x4 grid world.
.. co... |
5a018b9587ed329dbac8a71f04a89b630f314fda | 6448a0eaab1870427472c1acadc723cb228226c3 | /Solution/prob76_U.py | 6d912e5546e383eb8fd83105efce7b7f9e532f18 | [] | no_license | trung-hn/Project-Euler | d668d0167343345570d53143e9293824402baf26 | 9c33b3971019d450b117221b90f4f97843b231e1 | refs/heads/master | 2020-06-24T08:24:28.992456 | 2019-08-22T00:09:35 | 2019-08-22T00:09:35 | 198,912,505 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 322 | py | prob76_U.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 23 08:47:47 2019
@author: hoangt1
"""
#Not done
def calculate(n):
if n==2: return 1
return calculate(n-1)+n//2
lst=list()
lst.append(0)
for i in range(2,1000000):
lst.append(lst[-1]+i//2)
# print(i,lst[-1])
# print(i,calculate(i))
print(len(lst),lst[-1... |
2c4d0e2070a49e72865671d01d2efdc4d4b7554a | 4c20b5105d7770e8f1520a62cdf459ecc8f02992 | /make_kana.py | 111e04f78594957490fb690af3993d63ed2f935d | [
"Apache-2.0"
] | permissive | yantao006/iroha | b2fca37c3ecef55c1778542245199c8ac9a7a111 | 77d2f0965c6e34c9f87bfd7cbbbde7dc6842b7e2 | refs/heads/master | 2021-01-22T20:25:08.396693 | 2017-03-11T04:08:15 | 2017-03-11T04:08:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,059 | py | make_kana.py | from PIL import Image
block_len_height = 7
block_len_width = 7
matrix_len_height = 13
matrix_len_width = 6
CHAR_COL = 1
CHAR_ROW = 15
text = [
"""
oooo..
...o..
...o..
...o..
...o..
...o..
...o..
...o..
...o..
...o..
...o..
...o..
oooooo
""",
"""
oooooo
.....o
.....o
.....o
.....o
.....o
oooooo
o.....
o.....
o........ |
92e4402fdbd31464bd166a8ddf8cd922cf836106 | bb4808b52e334de10e3e9b3374ad38dc4daed5d4 | /scan_for_dwi.py | eba36478bfa1bff8913ca88b99e7d7fed4cde756 | [
"MIT"
] | permissive | shanqing-cai/dwi_workflow | 9685191d03b6651a94837516e20473a9ba3053a3 | 059b45a98b6bb986ad9a69b6597c42e7eb032cb7 | refs/heads/master | 2021-01-02T22:16:28.573395 | 2014-03-29T03:52:01 | 2014-03-29T03:52:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,847 | py | scan_for_dwi.py | #!/speechlab/software/EPD7/epd-7.1-1-rh5-x86_64/bin/python
import os
import sys
import glob
import argparse
import tempfile
from scai_utils import *
def extract_dwi_from_dicom(inDicomDir, outDir, logFN=None):
#=== Work ===#
#== Check the availability of dcm2nii and dicomhdr ==#
check_bin_path("dcm2nii", l... |
87005ed7f1c2f79cc2d36ec6d51faf692c08296a | 2b6fa34dac030ec1f2918b1377956bf791219d22 | /leetcode/easy/climbing-stairs.py | bb312aaf5f5134d8d0b7f7608c61b100e8a467fb | [
"MIT"
] | permissive | rainzhop/cumulus-tank | aa13fb8f14c27893838a67d2eb69fdd2ac3d6450 | 09ebc7858ea53630e30606945adfea856a80faa3 | refs/heads/master | 2020-06-06T23:24:37.498966 | 2020-01-06T09:52:16 | 2020-01-06T09:52:16 | 192,874,778 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 669 | py | climbing-stairs.py | # https://leetcode.com/problems/climbing-stairs/
#
# You are climbing a stair case. It takes n steps to reach to the top.
#
# Each time you can either climb 1 or 2 steps.
# In how many distinct ways can you climb to the top?
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
... |
0c80e96bf19ebaee0e95d9664c5e64462b0e2400 | 406bf2be90b5ae35b68998ca246f38ab40e86543 | /school/urls.py | 3cbdc15462ffbb45013c55642e05c08123b1cbe8 | [] | no_license | vahgar/user_types_django | e54d3ade1f56b8f0612c6df925334e5bced7dcd3 | 5d8e09f173e9e8061c8b2d6b820418ed015b719f | refs/heads/master | 2021-01-20T19:29:44.291972 | 2016-08-21T14:46:03 | 2016-08-21T14:46:03 | 65,737,696 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 316 | py | urls.py | from django.conf.urls import include,url
from . import views
from school.api.api_views import (
SchoolListAPIView,
SchoolCreateAPIView,
)
urlpatterns = [
url(r'^api_list/$', SchoolListAPIView.as_view(), name='school_list'),
url(r'^create/$', SchoolCreateAPIView.as_view(), name='school_create'),
]
|
15dc1115407ad9808d46a4b6fba040fb813407be | 8fbc91c1ec041198c9092094282b79ff529048f6 | /Analyse/TestResultClasses/CMSPixel/QualificationGroup/Reception/Grading/Grading.py | 81cbe27b5dcc5bebc1c2f6c1003cf4710fab4cd2 | [] | no_license | tarsenovich/MoReWeb | c53c141fe87e5ad1e751d15c68068e5e34d40eda | e1abad4cd108f5cba7641bc13cd69a1bd99d270d | refs/heads/master | 2020-12-13T19:59:09.495031 | 2016-03-17T14:01:31 | 2016-03-17T14:01:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,367 | py | Grading.py | import AbstractClasses
import ROOT
class TestResult(AbstractClasses.GeneralTestResult.GeneralTestResult):
def CustomInit(self):
self.Name='CMSPixel_QualificationGroup_Grading_Chips_TestResult'
self.NameSingle='Grading'
self.Attributes['TestedObjectType'] = 'CMSPixel_Module'
self.Resu... |