blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
0a6bd7b57403705fb21835d4539a27268a25fd2a | 85de18a30234b8c41a0687d659d081aa969b1326 | swar-oops/Python | /Basics 1/Matrix.py | Python | py | 380 | no_license | #Matrix is an array with multiple dimensions. Matrix is useful in most of the computer science concepts.
matrix2d = [ #2d array with 3 rows & 3 coloumns.
[0,1,5],
[3,2,4],
[4,8,9],
]
print(matrix2d[1][2]) #prints the 2nd row and the 3rd coloumns intersection.
# 0 1 2
# 0 | 0 1 5 |
# 1 | 3 2 4 |
#... |
b8b44c3f9605a5e7966cb62b2a7dedc248e25fc7 | 2a8ec2bc33451246d490b3de60e7886b10d1c2d9 | daisuke-motoki/SemiconProcess | /source/etching_simulation/tool/make_wafer_phantom_10.py | Python | py | 1,247 | no_license | import numpy as np
import settings
if __name__ == "__main__":
filename = "initial_wafer_phantoms.npz"
shape = (5, 2, 10)
material_id_name = settings.MATERIAL_INDEX_NAME
vacuum_mat_id = 0
z_layer_materials = {
"Silicon": [0, 2],
"SiO2": [2, 4],
"PhotoResist": [4, 5],
}
... |
d15645ac6134d4ef05a5480b68661e7d60fc103b | a4801dd40a449d3673f25063cd4d44dfaa2cd97a | EnlitHamster/flask-tutorial | /tests/test_blog.py | Python | py | 2,608 | no_license | import pytest
from flaskr.db import get_db
def test_index(client, auth):
response = client.get('/')
assert b'Log In' in response.data
assert b'Register' in response.data
auth.login()
response = client.get('/')
assert b'Log Out' in response.data
assert b'test title' in response.data
a... |
033a7b9848a9e6bc4ae81d4096bb365f06577133 | cafbaa09ec9f1d2ddbf6cfc87fc75f7f84eb5e4b | gridcentric/reactor-core | /reactor/tests/pytest_plugin.py | Python | py | 5,577 | no_license | # Copyright 2013 GridCentric Inc.
# 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... |
45e9355da2cbf89d4280bf36054d41bc8be40f9e | b4a2ffb7bff61fe38f2c8f7b2b7270957143acea | trentzhou/novaword | /django_app/apps/operations/tasks.py | Python | py | 890 | no_license | from celery.schedules import crontab
from celery.task import periodic_task, task
from celery.utils.log import get_task_logger
from utils.user_plan import UserPlan
from utils.email_send import send_feedback_email
logger = get_task_logger(__name__)
@periodic_task(run_every=(crontab(minute='0', hour='*/2')), name="dep... |
d850900108cf264ae708921475abf6fe4b7cd6fc | be9bc88aaf46f760521f348d74ed8b5c5ce5b666 | ejramirez5/Lab7 | /LAB7sup.py | Python | py | 1,955 | no_license | def edit_distance(string_1, string_2):
"""
This method takes two strings and computes the minimum number of insertions, deletions, and or/ replacements needed to change
1 of the words to the other one. this is accomplished by breaking the problem down into smaller problems and saving the solutions
t... |
b2f0951927a808274c3af3d60bdb38053ca72819 | 66a8266173571df28763850c2b80349a6f3dea90 | fbeutel/conan | /conans/client/proxy.py | Python | py | 14,264 | permissive | from conans.client.output import ScopedOutput
from conans.util.files import path_exists, rmdir
from conans.model.ref import PackageReference
from conans.errors import (ConanException, ConanConnectionError, ConanOutdatedClient,
NotFoundException)
from conans.client.remote_registry import Remot... |
ce372b4e34a4da12fcb18945cc983dfeffc480c0 | 152e1f90ced1b7ba1aed83760297d7b742f9b606 | jnbek/aur_tools | /unfinished/crawl_moz.py | Python | py | 430 | permissive | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
import urllib2
from BeautifulSoup import BeautifulSoup
def main():
url = "https://hg.mozilla.org/releases/mozilla-beta";
page = urllib2.urlopen(url)
soup = BeautifulSoup(page)
version = soup.find('span', {'class': 'logtags'}).find('span', {'... |
b2b39e0fe674f6ae2ffa8e01677002dd0bb41889 | 6b86752e1360f20141c7dca31a816b86153fb103 | pisomnia/Research | /DL_Seismic_Response_Prediction_Model/Spectragram_Based_SRPM/RnnModel.py | Python | py | 2,078 | no_license |
from keras.models import Model
from keras.layers import Dense, LSTM, Conv1D, GRU, Activation, Dropout, BatchNormalization
from keras.layers import Input, Masking, TimeDistributed, concatenate, Flatten, Reshape
class RnnModel(object):
def __init__(self, num_gm_layer, num_concat_layer, num_fc_layer, gm_shape,br_sh... |
41ba9d505f39f01313381309d726a7decb6f084b | 388e6ef66baac7ce917a0645107d9197c503d039 | nikhilrayaprolu/codelabsback | /labs/migrations/0022_auto_20191026_0907.py | Python | py | 773 | no_license | # Generated by Django 2.2.5 on 2019-10-26 09:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('labs', '0021_auto_20191024_1012'),
]
operations = [
migrations.AddField(
model_name='submittedassignments',
name='gr... |
d411448c963f6562335a2574dec7bf0411ed84f3 | 2e2dd56c2974ce712661fe5bea3b61a39c7f1c3d | Om4roFF/BaygeBot | /models/user_model.py | Python | py | 2,199 | no_license | from config import BaseModel
from peewee import *
from bot_logger import logger
class Users(BaseModel):
id = PrimaryKeyField()
phone_number = CharField(max_length=13)
lang = CharField(max_length=2)
name = CharField(max_length=50)
class Meta:
db_table = 'users'
async def add_user(chat_id... |
6db22f26b197333020668c0aed358c78daaa9bc3 | 1eb1c40cb9c1b54edabd75597eb99c8682788e3a | umasp11/PythonProgrammes | /anagram.py | Python | py | 417 | no_license | #Check If Two Strings are Anagram
str1 = "Race"
str2 = "care"
str1 = str1.lower()
str2 = str2.lower()
if(len(str1) == len(str2)):
sorted_str1 = sorted(str1)
sorted_str2 = sorted(str2)
if(sorted_str1 == sorted_str2):
print(str1 + " and " + str2 + " are anagram.")
else:
print(str1 + " ... |
3792a6344053898b0c83cf945d5f8ebf5f58ebb7 | 62a7b91bc7c9660fd9c50b8efa901c00a9cb3cf9 | TheSmilingSky/CS663-IITB-Digital-Image-Processing | /assignment-1-transformations/1/code/myMainScript.py | Python | py | 4,919 | no_license | import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.image as mpimg
def myShrinkImageByFactorD(img, k):
return img[::k,::k]
def myBilinearInterpolation(img,P,Q):
M,N = img.shape
new = np.zeros((P,Q))
r,c = math.ceil(P/M),math.ceil(Q/N)
new[::r... |
d7cfe9e3d8fce6ba98cd6ba221c5876c00a5d647 | 94a0c92169566daeb58024c938c518b496b06fa4 | Tedhoon/dinga_db_update_test | /public/migrations/0009_remove_publicdata_pb_update_date.py | Python | py | 363 | no_license | # Generated by Django 2.2.7 on 2020-01-04 16:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('public', '0008_publicdata_pb_update_date'),
]
operations = [
migrations.RemoveField(
model_name='publicdata',
... |
f2a8d9e9682954b42c0b9b2ce91aa05c7f477099 | bc0463c089a7d8e18410779a80c30c670e0c5487 | kotaiah0908/Python_Fundamentals | /Python_Day12_B5_1.py | Python | py | 1,525 | no_license | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# Importing modules:
# let us consider a scenario that team of five members planned to do as below in first day:
# team member name ---> first day work ----> second day work
# ----------------- ----------------- ---------------
# bunty ... |
a60d32f493d095087bcb110271f1d2b58b9ebf57 | 7a4039747999a29737e068ed19cb99699ad41d6f | Awesome94/django-projects | /tutorial/tutorial/urls.py | Python | py | 1,076 | no_license | """tutorial URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... |
51b63cbaf881995f794b9cdd3c927de362c76ac0 | 5ce5e19285a01282aed405638a114ebf4f141e14 | romonzaman/Django-CRM | /contacts/tasks.py | Python | py | 1,281 | permissive | from celery import Celery
from django.core.mail import EmailMessage
from django.shortcuts import reverse
from django.template.loader import render_to_string
from common.models import User, Profile
from contacts.models import Contact
app = Celery("redis://")
@app.task
def send_email_to_assigned_user(
recipients,... |
239deba895aeba37a4958bae7ca020664febd71f | b8e677a9de86b80e3933e24bda50c6ceaa2006dd | prediction2020/vessel_annotation | /src/BRAVENET/dataprocessing/3d_patch_extraction_with_double_size.py | Python | py | 8,692 | permissive | """
This script extracts 3D patches randomly equally around all class labels (except background and not-annotated class
label). There are 2 features (MRA image, skeleton with radius values) and corresponding label (annotated skeleton)
patches extracted. At each location there is one patch in given arbitrarily size extr... |
060d196d3668fa745c96125f5cc35827b319ce90 | 4fd28930f214138b7892e48afa64bbf502b605c9 | peterljq/Recommendation-System-Practice | /WD/production/train.py | Python | py | 6,736 | no_license | # -*-coding:utf8-*-
from __future__ import division
import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
def get_feature_column():
"""
age,workclass,education,education-num,marital-status,occupation,relationship,race,sex,capital-gain,capital-loss,hours-per-week,native-country,label
... |
c6073b04d81e291d657bc61564e5fc119f3066ce | 65ae9df94df7eb004ac8ff22cd6b39800b27d7dd | briehl/narrative | /src/biokbase/narrative/jobs/specmanager.py | Python | py | 9,259 | permissive | import biokbase.narrative.clients as clients
from biokbase.narrative.app_util import app_version_tags, check_tag, app_param
import json
from jinja2 import Template
from IPython.display import HTML
class SpecManager(object):
__instance = None
app_specs = dict()
type_specs = dict()
def __new__(cls):
... |
6599099101a4599523eda0a3284a35bc8909bb69 | ea7107b726e36e95ee86de5da040db474160481f | compressore/moc | /src/untraceable/urls.py | Python | py | 575 | permissive | from django.urls import path
from . import views
from ie.urls_baseline import baseline_urlpatterns
from core import views as core
from library import views as library
app_name = "untraceable"
urlpatterns = baseline_urlpatterns + [
path("", views.index),
path("topics/<slug:slug>/", views.topic, name="topic"),... |
dd20eb4ee90a5a50d4c1e47fabe14b2e8192caac | da6e820f674b69866077cb1212d03047581111d4 | Reece323/coding-problems | /codesignal/rearrangeLastN.py | Python | py | 1,074 | permissive | # rearrangeLastN
#
# Note: Try to solve this task in O(list size) time using O(1) additional space, since this is what you'll be asked during an interview.
#
# Given a singly linked list of integers l and a non-negative integer n, move the last n list nodes to the beginning of the linked list.
#
# Example
# For l ... |
b38cef0e4269374088dac8606036d3a967dfbff1 | a7623c93c5c6795a2d7ae76803e65c893edf2124 | bcgov/fwben | /colin-api/colin_api/exceptions/__init__.py | Python | py | 4,800 | permissive | # Copyright © 2019 Province of British Columbia
#
# 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 agr... |
d95394100c3aed09150becc05918f374ecd55047 | 2c588293ff6d519f332ece5f1af18c88d7a30dd0 | adamrher/cime | /scripts/lib/CIME/case/preview_namelists.py | Python | py | 4,760 | permissive | """
API for preview namelist
create_dirs and create_namelists are members of Class case from file case.py
"""
from CIME.XML.standard_module_setup import *
from CIME.utils import run_sub_or_cmd, safe_copy
import time, glob
logger = logging.getLogger(__name__)
def create_dirs(self):
"""
Make necessary directori... |
4ccbeb3e3df25c6a8680c82c5af278f469590e70 | 5103d43b465c10dedb9e178760bc8103c2297ecd | srahmani786/Projects | /Python/Projects/Crossword Solver/generate.py | Python | py | 10,007 | permissive | import sys
from crossword import *
from copy import *
class CrosswordCreator():
def __init__(self, crossword):
"""
Create new CSP crossword generate.
"""
self.crossword = crossword
self.domains = {
var: self.crossword.words.copy()
for var in self.c... |
a00eab6ac14ebddb341c67fd4a2c193a4fb682c9 | c4d8855217ba16067125e1de89c43d7ae3a22243 | alexandrosstergiou/Class-Agnostic-Feature-Visualisation | /vis.py | Python | py | 30,255 | permissive | '''
--- I M P O R T S T A T E M E N T S ---
'''
import os
import glob
import cv2
import sys
import copy
import time
import math
import numpy as np
import torch
import scipy
from scipy import ndimage as nd
from skimage.draw import circle
from PIL import Image
from torch.optim import SGD, Adam
from torchvision import ... |
d82f8805dd027b29be93bf5c06f15f1a0458b1c1 | 2072b6f67c1ee92d880b7788d423c5d2822b52b6 | c6fc/Empire | /lib/modules/powershell/persistence/powerbreach/deaduser.py | Python | py | 6,809 | permissive | import os
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-DeadUserBackdoor',
'Author': ['@sixdub'],
'Description': ('Backup backdoor for a backdoor user.'),
'Background' : False,
... |
36494c46e6fa34e0373a64600997b7b359974463 | af5a6e20be3cad1e8b7b9fe8c5482c1460d8a90d | theKidOfArcrania/ctf-writeups | /2018/csaw18finalsctf/v35/test.py | Python | py | 991 | permissive | from z3 import *
import numpy as np
from lab3_values import values as data
#data = np.genfromtxt("xor-values.txt", str, delimiter=",")
data = [1,2,3,4,5]
def r_dec( _reg, _ebx, _esi, i ):
_reg -= _ebx
_ebx = _reg
_esi = _reg
_esi = LShR(_esi, 5)
_ebx <<= 4
_ebx ^= _esi
_ebx += _reg
_... |
8415dfde7bed5f6532a72c167e812c2ef9d3addf | ea1763171c6d96bc6c5217941c21b90e8548c098 | peterchou2413/camp | /web/models.py | Python | py | 400 | no_license | # -*- coding: UTF-8 -*-
from django.db import models
# 日誌
class Diary(models.Model):
memo = models.TextField()
time = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return self.memo
# 月份
class Month(models.Model):
date = models.IntegerField(default... |
f17ce70470f6980b25bdd255090ece968eb24c03 | f0254fd7f591bd6ce0252c2908431e14447ab5fc | olivaC/cmput404Labs | /mysite/polls/urls.py | Python | py | 408 | permissive | from django.urls import path
from . import views
app_name = 'polls'
urlpatterns = [
# ex: /polls/
path('', views.IndexView.as_view(), name='index'),
# ex: /polls/5/
path('<int:pk>/', views.DetailView.as_view(), name='detail'),
path('<int:pk>/results/', views.ResultsView.as_view(), name='results'),
... |
140c2c2b39b51aff82a240b868f4e0a8c9c84d7e | 879b43552b70417a610c2da4f869f08efa5fc053 | Askinkaty/error_detection | /utils/vocab.py | Python | py | 3,849 | no_license | # -*- coding: utf-8 -*-
import re
from multiprocessing.managers import BaseManager, NamespaceProxy
import json
#new
padding_label = 'pad'
unknown_label = 'unk'
number_label = 'num'
name_label = 'name'
punct_label = 'punct'
lat_label = 'lat'
#old
# padding_label = 'PAD'
# unknown_label = 'UNK'
# number_label = 'NUM'
# ... |
9c9a5ddfb326d67d630b922b68e33e710cdf929f | 63633f5da0a3b8a0d38b8bf995f897dbcda969e0 | toledoneto/Python-Django | /avançado/vendas/migrations/0005_auto_20190311_1528.py | Python | py | 470 | no_license | # Generated by Django 2.1.7 on 2019-03-11 18:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('vendas', '0004_auto_20190311_1457'),
]
operations = [
migrations.AlterModelOptions(
name='venda',
options={'permissions': ((... |
2aa1c2df87afbe96b9149159bfcafebf313391f6 | 8614cc7a0af20bcc305a5817c28fb11bac02f4f4 | Adreambottle/EcoDataPred | /data_selection/data_selection_v4.py | Python | py | 21,261 | no_license | import pandas as pd
import numpy as np
import re
import sys
# ---Helper functions
def generate_time(year, month, k):
"""
用于生成 y年m月 之后 k 期的月份名称
:param k: 是k期,不包括本月
:return: 返回的是一个list
"""
date = []
for i in range(k):
if month < 12:
month = month + 1
elif month ==... |
50c3018191e5d21f87e14962e804531f39bc34d8 | 77c7fea2b8a35a44c633a4ab11e7e6555b111d7e | height921/django-3.0-mysite | /mysite/urls.py | Python | py | 1,299 | no_license | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... |
7774c1ea48f39368e78527c703560a7a7a787343 | e10556785cf626d168e4c168324e0f6aeea3d08f | Houzz/luigi | /luigi/contrib/spark.py | Python | py | 11,076 | permissive | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
94587d4bbbcde24c15a8296ed72c2065512573a2 | dbfa5870300a1820bc3fac7510d93a9ac3405643 | nummy/exec | /mi/hw5/mi.py | Python | py | 18,423 | no_license | from vertex import Vertex
class UndirectedGraph():
''' an undirected graph '''
def __init__(self, vertex_nums:[int], edges_to_add:[(int,int)] = []):
self.vertices = dict()
for item in vertex_nums:
v = Vertex(item)
self.vertices[item] = v
for item in edges_to_a... |
21a8cdeeee3039e20109d3c5195e3dbfbb113b38 | 58090f1587d36a4c937f7503048c00aa83113e8f | uniosmarthome/home-assistant-core | /tests/components/derivative/test_sensor.py | Python | py | 7,807 | permissive | """The tests for the derivative sensor platform."""
from datetime import timedelta
from homeassistant.const import POWER_WATT, TIME_HOURS, TIME_MINUTES, TIME_SECONDS
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests.async_mock import patch
async def test_state(... |
406050fa2d18785a3fa68b754c6a86f510deac27 | ef6b308847811efa16a23ee32819bed67b3a71a4 | dkaz/butkus-django | /settings.py | Python | py | 2,786 | no_license | # Django settings for butkus project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Derek', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = 'butkus' # Or path to database file if using sqlite3.
... |
50a2704ef42cf747e6efb2e1b8fcaeb26ecdda67 | 2d48bb6b86c3939e84ec315cdc553144882dfef9 | leorzz/simplemooc | /Pillow-4.3.0/Tests/test_image_frombytes.py | Python | py | 429 | permissive | from helper import unittest, PillowTestCase, hopper
from PIL import Image
class TestImageFromBytes(PillowTestCase):
def test_sanity(self):
im1 = hopper()
im2 = Image.frombytes(im1.mode, im1.size, im1.tobytes())
self.assert_image_equal(im1, im2)
def test_not_implemented(self):
... |
cc6906f2788036c065dbf5b3e94bc3b6ca0319c8 | 136d87fe107878fac2f2380191d0dbc6888ad82b | Nora-Wang/Leetcode_python3 | /Binary Tree and Divide Conquer/366. Find Leaves of Binary Tree.py | Python | py | 2,215 | no_license | Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty.
Example:
Input: [1,2,3,4,5]
1
/ \
2 3
/ \
4 5
Output: [[4,5,3],[2],[1]]
Explanation:
1. Removing the leaves [4,5,3] woul... |
97fffe75dc332523d10cd3cdbd2f73702bff61f6 | 08fd2a2431228374c43f5b4330099fcb67d25c67 | roshan007/coursera-demo | /coursera_courses_demo/manage.py | Python | py | 264 | no_license | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "coursera_courses_demo.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
042d2de3368bba1c1d1ed2ddcf2072a8557ca655 | e8df3aa34456c67dae2ba78449ee10dc8cf2a554 | lahloudjango/Sauve_1.3.18 | /openpyxl/writer/drawings.py | Python | py | 10,349 | no_license | # coding=UTF-8
# Copyright (c) 2010-2011 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... |
833edc70229df715f05b62c86983be93f18a212c | 29135ca7aa4bbca4e1eae019b812d38509a08b9a | pikkaay/hyperband-MNIST | /defs.py | Python | py | 628 | no_license | from hyperopt.pyll.stochastic import sample
import importlib
class defs:
def __init__(self, tuning_cnf):
self.tuning_cnf = tuning_cnf
def get_params(self):
params = sample( self.tuning_cnf)
return self.handle_integers(params)
@staticmethod
def handle_integers(params):
new_params = {}
f... |
7acd98a4857f7d19bd102a9cac6915a953ed07a8 | 862005505fce2485738d3cbdb1d7dc167c54566e | KuwaNori/learning | /frog.py | Python | py | 1,105 | no_license | # 絶対値を返す関数を定義
def check(a,b):
c = max(a,b)
d = min(a,b)
return c-d
# ポールの数の入力
n = int(input())
# n個それぞれの高さの受け取り
trees = list(map(int, input().split()))
# 配列shortestを用意(0番目への到達最小コストの0をindex0する)
shortest = [0]
# 配列shortestにそれぞれのポールへの最小コストを入れて行くループ
for i in range(1,n):
if i == 1:
# iが1の時は最小コストが... |
8349bc383fb2febe5000f78f54eb29380163ccb9 | 6132e77f73dd06f06559e7a23eda0b1d12aae960 | samyunwei/NongHangZhidao-Question-Answering | /bert_main_predict.py | Python | py | 23,262 | no_license | import argparse
from collections import Counter
import code
import os
import logging
import random
from tqdm import tqdm, trange
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
from transformers import AdamW, W... |
600b74479912455c3dfdf19f9ec4688ae7f33431 | 9b66b583cff5158934ca144e56e0eaea39d993cb | svalgaard/fskintra | /skoleintra/pgFrontpage.py | Python | py | 5,307 | permissive | # -*- coding: utf-8 -*-
import collections
import re
import time
import config
import sbs4
import schildren
import semail
import surllib
SECTION = 'frp'
def parseFrontpageItem(cname, div):
'''Parse a single frontpage news item'''
# Do we have any comments?
comments = div.find('div', 'sk-news-item-comme... |
4b1f9184f5d2e082772df32d79a5eef11a375c0b | 55c0629d204fa27ccb88b8088e3017206ac8d87a | Meoo24/ecom | /backend/main/views/order_views.py | Python | py | 3,193 | no_license | from django.shortcuts import render
from rest_framework import serializers
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from rest_framework.response import Response
from rest_framework.utils import serializer_helpers
from main.mo... |
7e230f2f107a5eeab9114790d06549ccf403c768 | 39b86f43ade01129042d6feff201dc6735c1efdd | ax920/Gradient-Descent | /adam.py | Python | py | 2,859 | no_license | import numpy as np
import random
import sklearn
from sklearn.datasets.samples_generator import make_regression
import pylab
from scipy import stats
def rmsprop(alpha, x, y, ep, max_iter=10000, decay = 0.999, eps = 1e-8, beta1= 0.9):
converged = False
iter = 0
m = x.shape[0] # number of samples... |
6f8754598fc5643f9ea9db0ac019f52f485cb98f | 5ce48c33cef765a9a792b4bc85687039e101c7ad | bubanoid/profireader | /profapp/controllers/views_tools.py | Python | py | 2,654 | no_license | from flask import render_template, request
from .blueprints_declaration import tools_bp
from .request_wrapers import ok
from ..models.translate import TranslateTemplate
from .request_wrapers import check_right
from ..models.rights import UserIsActive, AllowAll
from ..models.files import File
# @tools_bp.route('/trans... |
61c36c58e2922d3d6c911177a1e258b86a768015 | 798547bd43a9044ace6b08696a26a8b1ca5c39bc | robcn/personalrobots-pkg | /controllers/pr2_mechanism_controllers/scripts/send_track_link_cmd.py | Python | py | 1,706 | no_license | #!/usr/bin/env python
PKG = "pr2_mechanism_controllers"
import roslib; roslib.load_manifest(PKG)
import sys
import os
import string
import rospy
from std_msgs import *
from geometry_msgs.msg import Point
from pr2_mechanism_controllers.msg import TrackLinkCmd
from time import sleep
def print_usage(exit_code = 0):... |
19e37dd4a3e63d0eb41190069393b223a1405634 | 8e9b3d579f59e34d5bff4498f2a90cb76eb854cf | jbobo/fragrantica-scraper | /perfumes_scraper.py | Python | py | 4,602 | permissive | from lxml import html
import requests
import json
from perfumes_db_helper import PerfumesDBHelper
from urllib import request, error
def represents_int(s):
try:
int(s)
return True
except ValueError:
return False
def main():
DB = PerfumesDBHelper("perfumes.sqlite")
... |
dc0f1937b488107ade1dcb292a515f74b63b104f | 2cc21418a8ae9038a956262fc0866955798d466b | akshatsoni64/TryOnProtoType | /TryOnVendor/form.py | Python | py | 7,024 | no_license | from django import forms
from TryOn.models import *
from TryOnShipper.models import *
from TryOnVendor.models import *
usersChoice = (
("customer", "Customer"),
("vendor", "Vendor"),
("shipper", "Shipper")
)
stateChoice = (
("Andhra Pradesh", "Andhra Pradesh"),
("Arunachal Pradesh", "Arunachal Prad... |
92faec787761a50a9a91f0abd9cb453dcbf07b5d | b7374a1aac20d76baf6c10cf6889aa1ecc5f7958 | nitin-yad/ud-120-ml | /choose_your_own/your_algorithm.py | Python | py | 1,657 | no_license | #!/usr/bin/python
import matplotlib.pyplot as plt
from prep_terrain_data import makeTerrainData
from class_vis import prettyPicture
features_train, labels_train, features_test, labels_test = makeTerrainData()
### the training data (features_train, labels_train) have both "fast" and "slow"
### points mixed together-... |
bb9861d3b664e80104751e3b3378435d2394868a | e08521e5a69fb214aaa8fdba9db51bb44a2fc142 | L1nu5/Crawling | /filpkart/linkcrawler.py | Python | py | 986 | no_license | #imports
from bs4 import BeautifulSoup
import requests
#open file for output printing
f=open("urlfile.txt","w+")
url=[]
allurl=[]
url.append("http://localhost/demo.php?hidden=1&url=aHR0cHM6Ly9hZmZpbGlhdGUtYXBpLmZsaXBrYXJ0Lm5ldC9hZmZpbGlhdGUvZmVlZHMvc2h1Ymh6MTIzL2NhdGVnb3J5L3R5eS00aW8uanNvbj9leHBpcmVzQXQ9MTQ3NDgzOTI3N... |
cf7ace9e1bd58a023882d3c36924903b23383943 | 09039cbc9ab500ceb6809b6a600830e52c2c7378 | monwarez/meson | /test cases/python/4 custom target depends extmodule/blaster.py | Python | py | 682 | permissive | #!/usr/bin/env python3
import os
import sys
import argparse
from pathlib import Path
filedir = Path(os.path.dirname(__file__)).resolve()
if list(filedir.glob('ext/*tachyon*')):
sys.path.insert(0, (filedir / 'ext').as_posix())
import tachyon
parser = argparse.ArgumentParser()
parser.add_argument('-o', dest='out... |
ac4388728ec217ab7f0b6b4b418b490bc8243bbd | 011ccb594c8ea20435d47de9f5413a3edd3ea175 | Fian1928/tugas_pyton_28 | /mainnew.py | Python | py | 1,172 | no_license | from one.nilaim import nilai_mahasiswa
from one.pembauas import pembayaran
from one.kalku import kalku
def menu():
print("===================================================")
print("\n\t---pilihan---")
print("\t1. penilaian mahasiswa")
print("\t2. pembayaran mahasiswa")
print("\t3. kalkul... |
b5a07b5423c1d998b900c491e236a0570b7bea1a | 1fb44ea1c78fe7bc1c6fa3257173b063f7a29d2b | hitsoft/fsqio | /src/python/fsqio/pants/buildgen/jvm/third_party_map_jvm.py | Python | py | 12,724 | permissive | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import absolute_import
jvm_third_party_map = {
'akka': 'akka',
'backtype': {
'storm': 'storm-core',
},
'breeze': 'breeze',
'caffe': 'caffe-protobuf',
'ch': {
'qos': {
'logback': 'logback',
},
},
... |
7bc2e6ef4f1d30b05cb86436a57ce5c60dceff60 | b834d3ad6b0230e89916c9666bb491d6bd9b1a44 | bb0711/korean_toxic_classifier | /data_helpers.py | Python | py | 3,935 | no_license | import numpy as np
import re
import codecs
import tensorflow as tf
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except for SST.
Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py
"""
string = re.sub(r"[^A-Za-z0-9(),!?\'\`]", " ", stri... |
8005e7c4851cc363376d697080355d5907cc3fe6 | c95a095519f960328a3df3715ce02d1b4fff1de3 | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_199/3333.py | Python | py | 1,016 | no_license | def isHap(arr):
for i in range(0,len(arr)):
if arr[i] == '-':
return False
return True
def flip(subpan):
return subpan.replace('+','t').replace('-','+').replace('t','-')
def firstInst(pans, flpr):
for i in range(0,len(pans)-flpr+1):
if pans[i] == '-':
return i
return "IMPOSSIBLE"
def optflip(pans, fl... |
baa2a51db49b01f8dc3fb4b386070673e6d19444 | fb1223c91fd2b7b52ccc45343bbeb0a57890f77c | lordtryndamere/reservas | /reservas/manage.py | Python | py | 555 | no_license | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'reservas.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import D... |
b41ff4b112feeb4ebbe7637e8171727e3742a76c | e7df359698722226abc5577ee09bd23d7585fdcf | k1r91/course2 | /payment_system/paymentserver_threaded.py | Python | py | 566 | no_license | import socketserver
import threading
from paymentserver import PaymentServerHandler
class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass
if __name__ == '__main__':
HOST, PORT = 'local... |
7ce1a19f4e62e86c53c9c5a593d41642ce4439a8 | 8705f81bd8bc3160568f09634cde30acc43a3663 | cournape/yaku | /examples/c/try_example.py | Python | py | 1,080 | no_license | from yaku.scheduler \
import \
run_tasks
from yaku.context \
import \
get_bld, get_cfg
from yaku.conftests \
import \
check_func, check_header, check_compiler, check_cpp_symbol
def configure(ctx):
ctx.use_tools(["ctasks", "cxxtasks"])
ctx.env.append("DEFINES", "_FOO")
c... |
f2984277705b7c3a2cdcfcc2714ea4dff79364a2 | 57cb33d54385e6c721d50b2a3aa8a322d47d9e03 | steinunnfridriks/ALEXIA_ordtokutol | /alexia/dci_extractor.py | Python | py | 1,206 | permissive | from xml.etree import ElementTree as ET
from string import punctuation
def get_text_output(input):
output = []
with open('islensk_nutimamalsordabok.xml', 'r', encoding='utf-8') as content:
tree = ET.parse(content)
for element in tree.iter():
for child in element:
if ... |
b41021533f3dd7f2e223b7faad7aa7bdbc960e7f | b54c49cf328e995907ee71c96d0e6d683cf9812a | ssivalenka/Visual-Understanding-from-Satellite-Images-towards-Predicting-Primary-Crop-Footprint. | /final_yr_proj/patch_trial.py | Python | py | 10,198 | permissive | from scipy.io import loadmat
import numpy as np
import scipy.io
import numpy as np
from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_score
from sklearn.utils import shuffle
import keras
from keras.wrappers.scikit_learn import KerasClassifier
from keras.models import Sequential
from... |
a198b658dd4ab8d71267eb718c075b7817fa35b9 | faba695324cd46f86a9530bb2ff83e2555488b14 | googleapis/python-tasks | /google/cloud/tasks_v2beta2/types/target.py | Python | py | 39,528 | permissive | # -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# 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... |
f3f519cec17426ac5bc4a71f56475c9fd4b60a18 | 651e876185f60d70c26a1f241634e683e2eda1e4 | thenemschabukswar/EmoInt | /Updated/Synapse/ims/gru_train_test.py | Python | py | 5,684 | no_license | import numpy as np
import theano
import math
import csv
import keras
import sklearn
import gensim
import random
import scipy
import keras
import tensorflow as tf
from scipy.stats import pearsonr
from scipy.stats import spearmanr
from keras.preprocessing import sequence
from keras.preprocessing.text import Tokenizer
fro... |
18e350057601a761745e2f05ba8d7862e2522a0e | 0a60e44e167ebfacf7a61df4894741da9dc5052a | Feirlao/Tdd_django | /superlist/funtional_tests/test_simple_list_creation.py | Python | py | 800 | no_license | from .base import FunctionalTest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class NewVisitorTest(FunctionalTest):
def test_can_start_a_list_and_retrieve_it_later(self):
self.browser.get(self.live_server_url)
self.assertIn('To-Do', self.browser.title)
hea... |
34f54ad13bea27a580ae0527065164b4fed4542c | a94b20fa3583cf05d17d9b69e09bd0ddd3514c5c | JeremiasJunior/stock_market_watcher | /RNN/Recurrent_Neural_Networks/tunning_data/tunning_epoch_data.py | Python | py | 3,594 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 25 18:04:53 2020
@author: gbson
"""
import sys
orig_stdout = sys.stdout
f = open('MSFT_analysis_4_test_real_deal', 'w')
sys.stdout = f
timesteps = 60
indicators = 1
#drop = 0.2
#optmizer = 'RMSprop'
loss = 'mean_squared_error'
#epochs = 50
#batc... |
c9c3821f2b07424e27844e7fdfef5b655e3ba771 | 185c768d97a55a13c236766568381e01c51a0568 | KHIT93/svp-oma | /control/src/windturbine_settings/migrations/0001_initial.py | Python | py | 841 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-16 08:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Windtu... |
9e24999ee3e5b02bf4986d4fa8ff16068b35535f | 37832c76773410e5e87bc57ee7d70c572575130f | lamhung81/UW-MORSE | /scenarios/MOOS/subseaIMR/src/subseaIMR/middleware/moos/CollisionBoxes.py | Python | py | 2,325 | no_license | import logging; logger = logging.getLogger("morse." + __name__)
import re
import ast
import numpy as np
from subseaIMR.middleware.moos.abstract_moos import AbstractMOOS
class CollisionReader(AbstractMOOS):
""" Read motion commands and update local data. """
def initialize(self):
AbstractMOOS.initializ... |
b5347d6a43e3e214500465d40fc2a805a8ea5515 | 1419ffe47cad985d7ba0e34404fd575ad3e2fb22 | andxu282/poker_engine | /models/card.py | Python | py | 441 | no_license | """
A card with its rank (2-Ace) and suit (Spades, Hearts, Diamonds, Clubs).
"""
from models.rank import Rank
from models.suit import Suit
class Card:
def __init__(self, rank_str, suit_str):
self.rank = Rank(rank_str)
self.suit = Suit(suit_str)
def rank(self):
return self.rank
de... |
b7ea8dd069a31f408611950006f7e9f99d1c273a | ef570fc529313ce5f3ba86348004ee860fd20aed | mjirik/kinect-server | /src/PySkeletonViewer/modules/comm.py | Python | py | 2,182 | no_license | # -*- coding: utf-8 -*-
"""
Communication Protocols and Factories.
"""
from threading import Thread
import autobahn
import twisted
########################################################################
########################################################################
################################... |
e54a959ed6bbc0661e825fc5c37209b858f3ac56 | 57e168fce9251cb7846707bc142c00fa2a7b5149 | easonlee/dataman | /dataman/settings.py | Python | py | 3,508 | no_license | """
Django settings for dataman project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... |
0aad996a09b7acb635ddb539784356523b5aa763 | 0e1c90c898d6d3ff675fadf7818b72026dc87f99 | anlongfei/cake | /src/cake/main.py | Python | py | 696 | permissive | """Main entrypoint.
This main module reduces the risk of a stack dump caused by a
KeyboardInterrupt by not loading any unnecessary modules until a
keyboard interrupt signal handler is in place.
@see: Cake Build System (http://sourceforge.net/projects/cake-build)
@copyright: Copyright (c) 2010 Lewis Baker, Stuart McMa... |
d75594d26e802fc6018224aa967de08003a88330 | 2a7cc907916339ae4a077bb5df9ab7ef8019a08d | riturajkush/Geeks-for-geeks-DSA-in-python | /Arrays/prog20.py | Python | py | 1,924 | no_license | #User function Template for python3
#Complete this function
def stockBuySell(A,n):
min_val = 10000
profit = 0
profit1 = 0
for i in range(0,n):
if (i>0):
if (A[i]>A[i-1]):
val = A[i]-min_val
profit1 = max_val(val, profit1)
'... |
b33cdf6ea67571cf47a617df769a6dc619a9a15a | f04d0869d010904a2fa90cf2179dff86cf4f1159 | izanawistalia/program_in_python | /wordCount.py | Python | py | 292 | no_license | word_count = {}
sentence = "i like name nurarihyon because it is the name of the character in a manga i like"
words = sentence.split()
print(words)
for word in words:
if(word_count.get(word) != None):
word_count[word] +=1
else:
word_count[word] = 1
print(word_count) |
ab95d9b20ba8e31cbc057611aedef85e874fc400 | 8726c3888aefaf110e4563c58f1b9557f3f332e5 | lxmbjt/TDD | /lists/tests.py | Python | py | 3,435 | no_license | from django.test import TestCase
from django.urls import resolve
from django.http import HttpRequest
from lists.views import home_page,view_list,new_list #(2)
from lists.models import Item,List
# Create your tests here.
class HomePageTest(TestCase):
def test_uses_home_template(self):
response=self.client.get('/... |
4332a967f8b12a0c2489f8d2b987ee1cd5d26375 | 56787a6b991591eb653b443a6ec4133e32d40d61 | vovalive/seqlogo | /seq_logo_svg.py | Python | py | 2,433 | no_license | import pysvg
import sys
from pysvg.animate import *
from pysvg.attributes import *
from pysvg.builders import *
from pysvg.core import *
from pysvg.filter import *
from pysvg.gradient import *
from pysvg.linking import *
from pysvg.parser import *
from pysvg.script import *
from pysvg.shape import *
from pysvg.structu... |
513957c2e7589caff0677949c15b915510def29f | 79a2b19f2c098040cda163fa35c0e7cbcbddcb6e | Ahmed-Galal/rest_api_beautifulsoup | /immo/immo/reekomer/viewsets/edition.py | Python | py | 1,391 | no_license | from rest_framework.viewsets import ModelViewSet
from ..models import *
from ..serializers.reekomer import *
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from django_filters import rest_framework
class Filter(rest_framework.FilterSet):
class Meta:
model... |
46c5c72dd438c650e29198ae4d29621de121d5d5 | 08b9060c63b9be3a09fd42c4e00aeeb06ff4670b | wahello/stellar-poe | /stellar_poe/users/urls.py | Python | py | 687 | permissive | from django.contrib.auth import views as auth_views
from django.urls import path
from . import views
app_name = "users"
urlpatterns = [
path(
"login",
auth_views.LoginView.as_view(template_name="login.html", success_url="/"),
name="login",
),
path("logout", auth_views.LogoutView.... |
e626073e6e3e2ea99a4eb96b71a13759ff21066b | 2504cf55951cacde6543bbabbd9086a2d58da582 | mikitachab/pandas-log | /pandas_log/pandas_log.py | Python | py | 4,632 | permissive | # -*- coding: utf-8 -*-
"""Main module."""
import warnings
from contextlib import contextmanager
from functools import wraps
import pandas as pd
import pandas_flavor as pf
from pandas_log import settings
from pandas_log.aop_utils import (keep_pandas_func_copy,
restore_pandas_func_c... |
e9467b5440069d387e8ef7ae23a9db3641b2119f | 22c699529b041823f16e7978dc58b767c2e04627 | wangyendt/LeetCode | /Contests/201-300/week 293/2276. Count Integers in Intervals/Count Integers in Intervals.py | Python | py | 1,352 | no_license | #!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: wangye(Wayne)
@license: Apache Licence
@file: Count Integers in Intervals.py
@time: 2022/05/15
@contact: wang121ye@hotmail.com
@site:
@software: PyCharm
# code is far away from bugs.
"""
import bisect
class CountIntervals:
def __init__(self):
... |
e84672fc6f22c280b6286aa3c2aeefd6d73ca229 | 89d303411f583302cb25b8ebb9d2debdeb2d2dcc | ivanliu1989/OOP_in_R | /python/scheduler.py | Python | py | 699 | no_license | # -*- coding: utf-8 -*-
#import numpy as np
import datetime as dtm
#import pandas as pd
#import matplotlib.pyplot as plt
#import matplotlib.dates as dt
#import os
import csv
import collections
#from functools import reduce
#import sys
import unittest
#import rpy
from rpy2.robjects import r
class Operation:
def _... |
fbce5478e7823e0b338b4062dd204a991d73ed94 | 3a22c6a2b3e34a8712fe5d3b84dfa8a48395e020 | Saij84/PyQt | /src/scripts/02_layout.py | Python | py | 301 | no_license | from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout
app = QApplication([])
app.setStyle('Windows')
window = QWidget()
layout = QVBoxLayout()
layout.addWidget(QPushButton('Top'))
layout.addWidget(QPushButton('Bottom'))
window.setLayout(layout)
window.show()
app.exec_() |
708afc0655ec4f69031fbc64bb77abb74b9fa383 | ced3809101b3931893b5dc50a18833dd1c474cba | franciscogodoy/flask-appengine-template | /src/application/views.py | Python | py | 6,439 | permissive | """
views.py
URL route handlers
Note that any handler params must match the URL route params.
For example the *say_hello* handler, handling the URL route '/hello/<username>',
must be passed *username* as the argument.
"""
from google.appengine.api import users, urlfetch, images
from google.appengine.ext import db
... |
ffd20b6d633e567b3420e4da308e2c5ecba92377 | f9ce4cf654cafb086d8d9bc99290f5eb3e9c2609 | Grupo13BIODI/Grupo13BIODI.github.io | /Codigos/Interfaz grafica/Preguntas_diarias.py | Python | py | 1,403 | no_license | import tkinter as tk
from tkinter import ttk
import tkinter.font as font
#Por completaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar
root = tk.Tk()
root.title("Preguntas diarias")
font.nametofont("TkDefaultFont").configure(size=15)
root.title("Lectura de datos preliminares")
i=1
#Titulo
ttk.Label(root, text="Preguntas... |
b8b863197f0499188303ff53b934b5e8b92a0799 | 0ef11afddf4b843815451e25fed122d15e075f36 | Szubie/Misc | /Euler project/3 - Sieve of Eratosthenes (write to harddrive).py | Python | py | 775 | no_license | primes_path = r'C:\temp\primes.txt'
def genPrimes():
for line in open(primes_path, 'r'):
yield int(line.strip())
def addPrime(prime):
primes_file = open(primes_path, 'a')
primes_file.write('%s\n' % prime)
primes_file.close()
def findPrimes(maxnum):
for i in xrange(2, maxnum):
... |
77a9fd70f63dba25fb44f4ee66b17b5f4c54ba1d | c9d091b3ad4561a645fc7f1e8a374380d8ba6dec | cocreature/pytracer | /ray.py | Python | py | 675 | permissive | class Ray:
def __init__(self, start, direction, t_max=float('inf')):
'''
:param Vector3D start: a vector representing the start point
:param Vector3D direction: a vectior representing
the direction of the ray
:param float t_max: the maximal length of the ray ... |
8df9b7e5a6894420119779afc79db9fb0d96b554 | 65d9aad9dc86e95405203e019c9a37a1e53c0ae3 | naderik/Catchup | /Catchup/asgi.py | Python | py | 391 | no_license | """
ASGI config for Catchup project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... |
a3c84bcbeb5eabf6913176d5749af0bbc5663f8d | 2491c36cfb647fe56775fc51bed73c7080a471e9 | TiphaineL/metrology-chip | /lib/python3.8/site-packages/matplotlib/legend.py | Python | py | 48,266 | no_license | """
The legend module defines the Legend class, which is responsible for
drawing legends associated with axes and/or figures.
.. important::
It is unlikely that you would ever create a Legend instance
manually. Most users would normally create a legend via the
:meth:`~matplotlib.axes.Axes.legend` functio... |
c3d65cecb30b2cc20ff485c32a414ee93e8775ac | 5a83b4ea9acef93e1dba2e99e90bf8505c4b4beb | wbkifun/my_stuff | /code_examples/print_refresh_line.py | Python | py | 878 | no_license | from time import sleep, localtime, strftime, gmtime
from datetime import datetime, timedelta
def print_progress(t0, step, max_step):
'''
Assume step starts from 0
'''
step += 1
dt = datetime.now() - t0
step_width = max(len(str(max_step)), 4)
if step == 1:
print('[{:>{ms}}] [prog... |
0928858a99861a97eb2c4576dff8f4bf2de44b4a | 97aecd1842d8cf683a8ca51ab31fcdeccbef0852 | helper-uttam/scikit-learn | /sklearn/metrics/_ranking.py | Python | py | 66,262 | permissive | """Metrics to assess performance on classification task given scores.
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better.
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inr... |
b86f850bc376f612c876362a6d9f8daabccdaedf | 45aaab1e124684b1d57e32c5ff5ca9fde0a0824f | sgadola/Projekt_Modul_133 | /venv/Scripts/easy_install-script.py | Python | py | 469 | no_license | #!"C:\Users\admin\Desktop\Web\Dev\Django\Projekt_Modul_133\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(... |
7655bbbb8e29e0a4a562ad94ad6544f601df16d6 | e03eca7c70874e72727f1b874b588d3677b65c25 | ahendry18/PyNR | /test script 4.py | Python | py | 1,528 | no_license | import time
t0 = time.time()
from PyNR.dependencies.components import VialTray
vialpop = {
# 'H8':{},
'H9':{},
'H10':{},
'H11':{},
'H12':{},
}
from PyNR.dependencies.vialprofiles import profiles
VT = VialTray(population=vialpop,vialproperties=profiles['HPLC1mLpierce'])
# locarray = VT.locationarr... |
9b2fcb73e6c3e212033426463c12b5ba2dd4f1ff | 562f38a16974dee4c7688fc3d7eb63677628c8d5 | zeeshan495/Python_programs | /demo.py | Python | py | 2,965 | no_license | import time
import math
from DataStructures.LinkedList import *
from DataStructures.Node import *
import random
from datetime import *
import boto3
# var_list=[]
# var_list.append(200)
# var_list.append(39)
# print(var_list)
# if(200 in var_list):
# print("yes")
# print(random.uniform(0,1))
# print(random.randint(0... |
2ea0ab374ff8c2637addd8a57a368d8461b08467 | 771539051d5585dbd31908eb71316fb392e08bdd | RujeenaMathema/mspworkshop | /List.py | Python | py | 670 | no_license | def change_list(mylist):
mylist = [1,2,3]
print("value inside function",mylist)
return
mylist = [5,6,7]
print("value outside the function:",mylist)
change_list([1,5])
print("------------------------------------------")
def change_list(name, age):
mylist = [1,2,3]
print("name is",name)
print("ag... |
c708725586ab5667da85bbe09309bd50c6b5279d | 373cf2a2fa73619ae303de4c3d2bee325d7aaeae | crowdbotics-apps/game1-22711 | /backend/manage.py | Python | py | 631 | no_license | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'game1_22711.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... |
1b434d639afd2155b3d5bee207969f506417c562 | 5a5ad0c7101a7b260c5dae8caa7871eea6637fc7 | rubenhelsloot/hypothesis_sqlalchemy | /hypothesis_sqlalchemy/enumerable.py | Python | py | 2,194 | permissive | from enum import (Enum,
EnumMeta,
_is_dunder as is_ignored_key,
_is_sunder as is_invalid_key)
from typing import (Any,
Callable,
Dict,
Hashable,
Optional,
Sequence)
... |
3582f84aae303f55bf8392138ce3b8f170841f86 | 157288e76f0eb5346476db29209a6b9f40931586 | bopopescu/Overmind | /overmind/models.py | Python | py | 3,053 | no_license | from google.appengine.ext import ndb
# Api Keys
class ApiKeys(ndb.Model):
name = ndb.StringProperty()
value = ndb.StringProperty()
# Users
class Users(ndb.Model):
username = ndb.StringProperty()
password = ndb.StringProperty()
email = ndb.StringP... |
fc591d394a0128fcf1c946d49cec6fceb0f8f8ce | d5c8c5b9e40005f25ffd5250aed93378e5edaee7 | Herbie89/Randomized-Algorithm | /randomised_bijection.py | Python | py | 622 | no_license | from random import randint
def equation(x):
return (x - 2) * (x - 3)
#return (x - 300) * (x + 4000) * (x - 50)
#return x - 10
count = 0
bool1, bool2 = True, True
while(bool1 or bool2):
count += 1
temprand = randint(-10000, 10000)
if equation(temprand) < 0:
x2 = temprand
bool2 = False
if equation(temprand)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.