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 |
|---|---|---|---|---|---|---|---|---|
2ac89d8aeed98301cb8487c8c3303459b233f086 | fc5d2b5395dff955df7e471a63a8a4ffb66e3109 | aijtj009/MaoCoding | /95X7=.py | Python | py | 267 | no_license | import random
f=open("95X7=.doc","w")
i=0
while i<800:
j=random.randint(11,99)
k=random.randint(2,9)
n=j*k
if j % 10 == 0: continue
f.write(str(j)+"X"+str(k)+"="+" "*5)
i+=1
if i%9==0: f.write("\n")
f.close()
print("95X7=.doc Generated.") |
3236b0cff8508c866e1abab5df5f38710e56044e | 3be6b84d9bef92e7df47aa790e348bd51c05668b | vEnhance/otis-web | /roster/urls.py | Python | py | 1,551 | permissive | from django.shortcuts import redirect
from django.urls import path
from . import views
urlpatterns = [
path(r"user/<str:username>/", views.username_lookup, name="username-lookup"),
path(r"curriculum/<int:student_pk>/", views.curriculum, name="currshow"),
path(r"finalize/<int:student_pk>/", views.finalize,... |
9e8d90b051e403577c03c05323aeed3ba291e3e9 | 3649def3ee56e2424a8297f2cf173d869746dfba | rmap-project/rmap-python-harvester | /RMap_Harvester.py | Python | py | 19,206 | permissive | #!/usr/local/bin/python -u
# RMap_Harvest.py
# See this page for DataCite: http://oai.datacite.org
__author__ = 'timmo'
logging_config_file = 'config/logging.conf'
logging_logger_name = 'rmapLogger'
CONFIGURATION_FILE = 'config/default.cfg'
# get us some stderr handling, at least
import time
import logging
import lo... |
6d4e568c9fd4222bf0b0ca673fd1bcac549f7733 | 640002a367c468edffce2cdf3c17de8d3cd22c74 | mdai/rsna-challenge-2018 | /retinanet/rsna_evaluate.py | Python | py | 6,623 | permissive | #!/usr/bin/env python
"""
rsna_evaluate.py
- Script to evaluate model and print mAP based on GT information. Also, create file with detections to submit.
@author Alesson Scapinello
@author Bernardo Henz
@author Daniel Souza
@author Felipe Kitamura
@author Igor Santos
@author José Venson
... |
2c953c4a3cbd8e95f54a79ced916672d3fd37c8f | 9251c9e102ab6339fea7158d20f997969bd5f653 | HQBIAO/carawler | /crawler/src/wanfang/test/cnki_test.py | Python | py | 2,402 | no_license | # coding=utf-8
# date:2019/1/28 上午1:26
# author:chenjunbiao
import unittest
import pandas as pd
from crawler.src.wanfang.download_cnki import get_ref_list, get_down_url
class TestCnki(unittest.TestCase):
def test_get_ref_list(self):
self.skipTest('')
# get_ref_list('/kns/detail/detail.aspx?dbcode... |
a21c5369049c492b42400795ae5fee0e1bf249a0 | da501f38c04e05d6293a637cb4b42e3901a61952 | natamelo/synapse | /synapse/handlers/room_member_worker.py | Python | py | 3,300 | permissive | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# 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 la... |
6dcb783867db9f605afce62d168f02af3e0d3978 | 2dcad44f760cd942b2041fdc18c0ef73a5c08faf | Clacket/action | /migrations/versions/b9e4f76babb8_.py | Python | py | 1,366 | no_license | """empty message
Revision ID: b9e4f76babb8
Revises: 13db7779cb06
Create Date: 2018-01-25 13:25:22.647450
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b9e4f76babb8'
down_revision = '13db7779cb06'
branch_labels = None
depends_on = None
def upgrade(engine_na... |
4da655a34e5b651fb257fefc95d142cb9d31ab10 | 01a2c82be2135da651a8664bb11caed88dc721b4 | ROB-Seismology/eqcatalog | /app/evaluate_MS-MW_relation.py | Python | py | 1,476 | no_license | """
Evaluate validity of MS->MW relations
"""
import os
import numpy as np
from prettytable import PrettyTable
from plotting.generic_mpl import plot_xy
import eqcatalog
## Read catalog
## Note: only 2 post-1985 earthquakes with ML and MW: Roermond and Alsdorf!
cat = eqcatalog.rob.query_local_eq_catalog(... |
44b0dd16aaf5fe1ed40356be153fbc00182e78ac | d5165daff5def142042397dcf3d1adb96e5099da | hujieying/python-learning | /LPTHW/ex20.py | Python | py | 1,228 | no_license | # coding:utf-8
from sys import argv
script, input_file = argv
#定义print_all这个函数,变量是f,然后打印f中的内容,如果这里是文件,就打印文件内容
def print_all(f):
print f.read()
#定义rewind这个函数,变量是f,然后对f执行seek函数
def rewind(f):
f.seek(0)
#定义print_a_line这个函数,里面有两个变量,然后打印line_count,然后读取文件的一行
def print_a_line(line_count, f):
print line_count, f.readlin... |
127c8db0596dc0399133c22bc65cc15ae8c57251 | e78351e79e397931fbfee7f44a182d201db6eaec | molotof/Snoopy | /snoopy/server/bin/snoopy/src/snoopy/db/models.py | Python | py | 3,432 | permissive | """Contains all SQLAlchemy ORM models."""
from cryptacular import bcrypt
from sqlalchemy import Column
from sqlalchemy import Boolean, CHAR, DateTime, Integer, Numeric, SmallInteger, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property
crypt = bcrypt.BCRYPT... |
dc3fea69eff3e95e208deae0ed88f6077cb2d1f2 | 1eb63d69fe1151ae97508f70215775ad7f776a28 | Thornycrackers-Misc/ghost-flask | /app/views.py | Python | py | 2,643 | no_license | from app import app, db
from app.models import Post
from flask import render_template, request, jsonify, url_for, redirect
# pylint: disable=E1101
# no member
@app.route('/')
@app.route('/posts')
def posts_index():
"""
Returns a page that lists all of the posts
"""
posts = Post.query.all()
retur... |
e19d50a1ccc0d98232da5c3f80d72cee85d36761 | e60a224281e10bdc03bbd15ad926c439f10d2141 | ADemkin/Practice | /datetime module.py | Python | py | 334 | no_license | #!/usr/bin/env python3
#coding: utf-8
#
import datetime
#print(help(datetime.time))
# my birthday date
bd = (datetime.date(1987, 9, 14))
print(bd)
# 6000 days
delta = datetime.timedelta(6000)
# add a date and a time delta
print(bd + delta)
# format a string differently
# russian date format
print(bd.strftime('%... |
d0589da2146d0d3cad296643bbd1b2061fa554f0 | 924a6f53f496f25a9bd85c6ac0726ec1f52eaf75 | liumihust/aliyun-openapi-python-sdk | /aliyun-python-sdk-domain/aliyunsdkdomain/request/v20180129/SaveBatchTaskForCreatingOrderTransferRequest.py | Python | py | 3,040 | permissive | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
d9f679737e1a12956d0643c61bb318738fe5e8b2 | f649fcd258b85801a9ed5d932de94c386319773f | hacoo/superlists | /functional_tests/base.py | Python | py | 1,576 | no_license |
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
#import unittest
import time
import sys
# A functional test story!
# Adapted from Harry J.W. Percival "Test Driven Development with Python "
class FunctionalTest(Sta... |
069a2cbab1fdc64e7b293b0dec65795db58776ee | 6dade0c039df4ff39805d4dc4d3bc7bf05c670bd | guofei9987/leetcode_python | /solved/[226][Invert Binary Tree][Easy].py | Python | py | 798 | no_license | # https://leetcode.com/problems/invert-binary-tree
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def invertTree(self, root):
"""
:type root: TreeNode
:rtype: ... |
79d6f085028220d679e8e8db2673bd00116459d6 | 1352ff5798698dbb17a2d3a9a6afa69e402c9771 | Panav2008/C-124 | /pro124.py | Python | py | 1,067 | no_license | from flask import Flask,jsonify, request
app = Flask(__name__)
List = [
{
'id': 1,
'Name': u'Arjun',
'Contact': u'9354298855',
'done': False
},
{
'id': 2,
'Name': u'Rohit',
'Contact': u'9872226543',
'done': False
}
]
... |
3ecd04f5a6b1e99182032cf0a00a521d313b52a8 | 0c5092d5175c9222133de7cf50d78c90a23c5c8f | 2019zding/Python | /pokeman.py | Python | py | 1,624 | no_license | import random
class Pokeman(object):
def __init__(self, name, listofAbilities, hp):
self.name = name
self.hp = hp
if listofAbilities == 'bur':
self.listofAbilities = {
'deathhowl': random.randint(10,50),
'heal': random.randint(-50,-10)
}
... |
f3e4825a2144cf787b0d707208c4f57ea671b5d4 | 1604a21eabb945f0328fb1f98c17b03548b722ec | smallball-ljj/saopy | /saopy/function_evaluation/CFD.py | Python | py | 5,987 | no_license | # ==================================================
# author:luojiajie
# ==================================================
import os
import shutil
import numpy as np
import csv
class CFD():
def __init__(self,rootDir):
self.rootDir = rootDir # root path
def calculate(self):
s... |
8c79728ec8a362934a65e91df2d83b5b2740b0d8 | 842185e49eb0199d8d76562d91e504a47e4e8363 | khediibawa/hackerrank | /src/main/python/candies.py | Python | py | 977 | no_license | __author__ = 'nastra'
def get_minimum_candies(candy, ratings, k):
if k == 0:
return 0
for i in range(1, k):
c = candy[i]
left = ratings[i - 1]
mid = ratings[i]
right = ratings[i + 1]
if left < mid <= right:
c = candy[i - 1] + 1
... |
27918e88ec1fe9d39154e3b5aba87aca42c22b7d | b9236be64e7d345fcc5912042b3f69d0e8814f97 | ZeroILumi/Projetos_de_Teste | /Testes_Complexos/Projetos Python com Django/Zero_ILumi_Agenda/Zero_ILumi_Agenda/settings.py | Python | py | 3,301 | no_license | """
Django settings for Zero_ILumi_Agenda project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
fr... |
1806a3cae68be17ee7e7b16838d804a06fac5cac | 1bba59232e323372fe36803674f38cca05484371 | Leezki/simple-container | /grading/rest/ConfigTests.py | Python | py | 2,493 | no_license | import requests, unittest, json
from MySupport import MySupport
class ConfigTests(unittest.TestCase):
HOSTNAME = "host"
PORT = 80
def suite():
suite = unittest.TestSuite()
suite.addTest(ConfigTests('test_invalid'))
suite.addTest(ConfigTests('test_config'))
return suite
... |
1c7580af6cfc3e27f87098b1461d96a4baa56b0b | fbbaaf9132a80a51b8765389ddb15c12eb149fc3 | jcpince/shoppingcart | /unittests/backend/check_cart.py | Python | py | 9,766 | no_license | import pytest
import os
if 'BASE_URL' not in os.environ.keys():
print("Missing environment variables, please source setenv.sh [offline]")
exit(-1)
try:
import requests
import logging
import pytest
import json
except ModuleNotFoundError as e:
print(e)
print("Some modules are not found, ... |
37bec407bcb63c16c15d8f51b70c8b98d4b18509 | 13c054453e9279cdcfeddd8dc8ee6f62dc4739a1 | tcl326/forte | /forte/processors/base/tests/dummy_pack_processor.py | Python | py | 1,057 | permissive | # Copyright 2019 The Forte 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 applicable ... |
b57cf0c81ad55487b45b9bd0bb90cfc25643c53b | 5be49301cf260333a5e5e41995deceaaa0794e52 | NJ261/HackerRank | /Problem Solving/miniMaxSum.py | Python | py | 425 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 27 01:15:23 2019
@author: nirav
"""
# Complete the miniMaxSum function below.
def miniMaxSum(arr):
minNum = arr.pop(arr.index(max(arr)))
maxNum = arr.pop(arr.index(min(arr)))
remainSum = sum(arr)
print(remainSum+minNum, remainSum+ma... |
dd6790790cf578504f1e391330ad0abf4bd1e813 | 478cff5beda3c53b66002b36ab6736045bb37b3d | itsolutionscorp/AutoStyle-Clustering | /all_data/exercism_data/python/bob/4d1250affb0b4130a3545b302bbf51af.py | Python | py | 314 | no_license | # -*- coding: utf-8 -*-
class Bob:
def hey(self, saywat):
if saywat is None or saywat.strip() == '':
return 'Fine. Be that way!'
if saywat == saywat.upper():
return 'Woah, chill out!'
if saywat[-1] == '?':
return 'Sure.'
return 'Whatever.'
|
28d28bb256b1b1df82792bed8af6c536f037d996 | 9b90d7ce2d7b84e2b64681f2889d67465d4a812d | PaulBenMarsh/BlenderAPI-WaveFunctionCollapse | /src/main.py | Python | py | 8,530 | no_license |
from enum import Enum
import mathutils
import bpy
class Direction(Enum):
Up = mathutils.Vector((0, 1, 0))
Left = mathutils.Vector((-1, 0, 0))
Down = mathutils.Vector((0, -1, 0))
Right = mathutils.Vector((1, 0, 0))
def to_rotation(self):
return Rotation[self.name]
class Rotation(Enum):... |
a16eee9efc0af0a9a691fa18745615e381dc4f91 | 9d1ba11e543d8a7067b7f5e3dd173175c67cb579 | the-snowwhite/Machinekit-Workbench | /MKServiceCommand.py | Python | py | 7,241 | permissive | # Service implementation to interact with the MK service 'command'.
#
# This is the main interface to make MK do something. Most commands sent to MK
# will get a response in the form of status updates (typically two, one for
# executing and another one for its completion).
# However, the impact of most commands need to... |
a7b4e37e561e684fabe567f9acfb217c7379bad5 | 962e2046fa95f1998b5828e42af635e8c7a4dfd8 | mcclowes/bitbar-plugins | /Dev/GitHub/notifications.30s.py | Python | py | 11,896 | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <bitbar.title>GitHub Notifications</bitbar.title>
# <bitbar.version>v3.0.2</bitbar.version>
# <bitbar.author>Matt Sephton, Keith Cirkel, John Flesch</bitbar.author>
# <bitbar.author.github>flesch</bitbar.author.github>
# <bitbar.desc>GitHub (and GitHub:Enterprise) notifi... |
96f987e53c6c5cff5968fb1d55af394d6c8a0ab9 | 1d43ce22d5c645b94a6b9ff68e23b9b3d21f37a0 | fenixjp/my-first-blog | /mysite/settings.py | Python | py | 3,218 | no_license | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.11.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... |
ca925f2d32bdc83edd0d1f86cc1fce4497f94052 | 682dc5d6c600aa07b792d1355a300a06734907c9 | prettyirrelevant/giveawayy | /payments/urls.py | Python | py | 348 | no_license | from django.urls import path
from . import views
app_name = "payments"
urlpatterns = [
path(
"payments/paystack/callback/",
views.PaystackTopupCallbackView.as_view(),
name="paystack-callback",
),
path(
"payments/paystack/webhook/", views.PaystackWebhookView.as_view(), name=... |
8e826ae408248cb29cb16cd3a07ee11b232d3f57 | 06b90360214602af90eea520d1b8694f9eb47060 | Devansh-Anhal/CIIE-Website | /gallery/models.py | Python | py | 657 | no_license | from django.db import models
# Create your models here.
class Category(models.Model):
category = models.CharField(primary_key=True,max_length=255, default="All")
thumbnail = models.ImageField(upload_to = "gallery/category", default='default.jpg', blank=True)
def __str__(self):
return self.category
class Image(m... |
b2a6202fe08e23307fc599c8acafb0183182a8cf | b1bd99dd322ae9976ecf6075f6e3ab6004fb2ce9 | EmmaSRose/first_project | /dice.py | Python | py | 310 | no_license |
#small change
import random
#print(random.randint(1,6))
print(" Hello! Welcome to Dice")
done = False
while not done:
n = random.randint(1,6)
print(" Your number is " + str(n))
print("Would you like to play again? [y/n]")
response = raw_input()
if response == 'n':
print("game over.")
done = True
|
e45e12c77d1be1dfa0963486fca4b52cdbe54082 | cf90c6d7666f0d3e8219d6ead77994e13379b920 | pkr26/Machine-Learning | /Home Works/HW1/question 1/HW1-Question1.py | Python | py | 5,078 | permissive |
# coding: utf-8
# In[254]:
import pandas as pd
import numpy as np
import os
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
# In[255]:
#checking the path directory
print("Previous directory",os.getcwd())
#Now changing the path directory
path=r"C:\Users\Pavan\Desk... |
6428fab867925b1f63c416089edb35bc6b0ee2d8 | b4027227f395ce28d2529d91a882a1a5d8a508d7 | nivir/Picapy | /Directorio.py | Python | py | 1,039 | no_license | #! /usr/bin/python
# -*- coding: iso-8859-15 -*-
#
__author__='atareao'
__date__ ='$24-abr-2010 12:34:44$'
#
# <one line to give the program's name and a brief idea of what it does.>
#
# Copyright (C) 2009 Lorenzo Carbonell
# lorenzo.carbonell.cerezo@gmail.com
#
# This program is free software: you can redistribute it ... |
1c08a8d3c8e524b65cfcf002ac495cd769c7b369 | cb9648fa1e71bd47cc9278a48dbb9aef52b60e6b | jetuk/pycllp | /pycllp/solvers/hsd.py | Python | py | 7,938 | no_license | """
Original implementation:
Implementation of the Primal-Dual Interior Point Method
Robert J. Vanderbei
28 November 1994
http://www.princeton.edu/~rvdb/LPbook/
Port to Python
James E. Tomlinson
2015
"""
from __future__ import print_function
import numpy as np
from . import BaseCSCS... |
c97b44394f8194cf1e5b1c3fec5309b062339d6f | 25686ba0760589ffcb8ce29fc1a2f91321963d03 | pyloque/gkron | /worker.py | Python | py | 2,058 | no_license | # -*- coding: utf-8 -*-
import os
import sys
import time
import errno
import random
import socket
import select
import signal
from datetime import datetime, timedelta
from core import Buffer, HandlerMap
class Worker(object):
def __init__(self, parent, store):
self.parent = parent
self.store = st... |
d252beb799d2b3a09039bcf8517a3b2acfd4ff61 | 0d730fa22c2d794ddeef0ded3e419a8940a11834 | doccano/doccano | /backend/roles/tests/test_views.py | Python | py | 620 | permissive | from rest_framework import status
from rest_framework.reverse import reverse
from .utils import create_default_roles
from api.tests.utils import CRUDMixin
from users.tests.utils import make_user
class TestRoleAPI(CRUDMixin):
@classmethod
def setUpTestData(cls):
create_default_roles()
cls.user... |
d16532ddeab6514c5abec049f120ac4032725649 | af45760d9711d6a2bd03dffcd6e2f868b024415e | gabriellaec/desoft-analise-exercicios | /backup/user_259/ch44_2020_03_28_23_31_58_978869.py | Python | py | 290 | no_license | nome_mes = input("Qual o nome do mês? ")
meses = ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro']
i = 0
while i<len(meses):
if nome_mes == meses[i]:
print(meses[i])
else:
i+=1
|
8151dbf70a562d6f1cd9f75d9c0a760ae21cacfc | a6a28b98451fde0627124ed59bb519e420905170 | ahmedelsaghear/Swvl-Auth | /migrations/versions/b486bbb95477_.py | Python | py | 626 | no_license | """empty message
Revision ID: b486bbb95477
Revises: b0cad8c41bd4
Create Date: 2018-03-18 12:48:51.799111
"""
# revision identifiers, used by Alembic.
revision = 'b486bbb95477'
down_revision = 'b0cad8c41bd4'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... |
898823ca4653f198972fb79d704f490d2b90a040 | b5083c430a31d779f00a0f4c3a5800ad0f20b176 | themarwhal/magma | /lte/gateway/python/magma/pipelined/tests/pipelined_test_util.py | Python | py | 24,586 | permissive | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
966fde2932e5b0e0a5654b7094d6438e5002cc0f | d4ae17f00a5f2a0f4429aeacad5a0b47ba747b46 | kmooft/basketballVideoAnalysis | /mask-rcnn/mask_rcnn.py | Python | py | 5,508 | permissive | # USAGE
# python mask_rcnn.py --mask-rcnn mask-rcnn-coco --image images/example_01.jpg
# python mask_rcnn.py --mask-rcnn mask-rcnn-coco --image images/example_03.jpg --visualize 1
# import the necessary packages
import numpy as np
import argparse
import random
import time
import cv2
import os
# construct the argument... |
6b4510c4729f4f03c8a7a300b599ba891d1b6318 | cd00e39d8970f51946213f9b28fc263b212c90e0 | johantenhouten/aocd2020 | /2020-12-14.py | Python | py | 2,690 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 13 23:29:25 2020
@author: johan
"""
from aocd import get_data
instructions = get_data(day=14).split('\n')
testdata="""mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
mem[8] = 11
mem[7] = 101
mem[8] = 0""".split('\n')
testdata2="""mask = 0000000000000... |
ba24dc0fcd64ddf0a7bd21f39360448f462396b9 | 16457a0bde9076205f05aeeeeeb052c2bc811c33 | brandtkilian/MSE-SkyViewFactor | /core/ImageDataGenerator.py | Python | py | 15,206 | no_license | import cv2
from tools.FileManager import FileManager
import os
import re
from sklearn.utils import shuffle
import random
import numpy as np
from enum import IntEnum
from tools.ImageTransform import ImageTransform
from core.ClassesEnum import Classes
class NormType(IntEnum):
"""The available equalization and norma... |
a2957b24a06aa2a6504c9c50d1251ceca10e0f7b | 6ba354e281597f56108a36c9d40bc37cd917663b | chipflw/MoreSequences | /src/m5_more_sequences.py | Python | py | 11,808 | permissive | """
This module lets you practice various patterns
for ITERATING through SEQUENCES, including:
-- Beginning to end
-- Other ranges (e.g., backwards and every-3rd-item)
-- The COUNT/SUM/etc pattern
-- The FIND pattern (via LINEAR SEARCH)
Authors: David Mutchler, Valerie Galluzzi, Mark Hays, Amanda Stouder,
... |
3e7b29bef18de03a01a0794d8bb5a91b9dfadbea | 3829849a7a07cdb9081e2280d500c6b859ef74a5 | jonathangray/386bsd | /othersrc/contrib/isode/dsap/x500as/do.py | Python | py | 15,148 | permissive | -- do.py - manually augmented DistributedOperations module
-- $Header: /f/osi/dsap/x500as/RCS/do.py,v 7.2 91/03/09 11:53:54 mrose Exp $
--
-- $Log: do.py,v $
-- Revision 7.2 91/03/09 11:53:54 mrose
-- update
--
-- Revision 7.1 91/02/22 09:21:56 mrose
-- Interim 6.8
--
-- Revision 7.0 90/12/06 07:34:44 mrose... |
e1f23ca9975db793fbed1cea62c8b9c507cda194 | e4cdcf06e2cc35d1357713ed0c86f05b26fd5afe | FingerLeakers/kernelpop | /exploits/mac/CVE20155889.py | Python | py | 1,800 | no_license | import os
import subprocess
from exploits.exploit import MacExploit
from src.kernels import KernelWindow
from constants import ARCHITECTURE_GENERIC, MAC_EXPLOIT_PATH, PLAYGROUND_PATH, color_print, \
MEDIUM_RELIABILITY, CONFIRMED_VULNERABLE, GENERIC_MAC
class CVE20155889(MacExploit):
def __init__(self):
super().__i... |
28ad4d16c2f07994f141654573595d5cafca5d21 | 0ce7ac54733d594005f27c10a70c22c94bcef27f | liuxiaoxiao666/python_study | /tutorial/L40爬虫入门/豆瓣书2.py | Python | py | 915 | no_license | #糗事百科热点文章爬取
#分析: 请求 url https://www.qiushibaike.com/hot/page1/ 要抓取div class='article' urllib或requests
# coding:utf-8
import requests
import urllib.request
from fake_useragent import UserAgent
import random
import re
base_url = 'https://book.douban.com/?qq-pf-to=pcqq.group'
url = base_url + '1' + '/'
print(base_url)
... |
0ba5228e0986e1cbcf1df39188eb3a2dbcf4f01c | a65b4fbcdfca9f6f9ea7a203b92bb1d03a7a7181 | crscillitoe/HangmanSAVANT | /CalcFrequencies.py | Python | py | 1,023 | no_license | letters = ['a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' ,
'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' ,
'u' , 'v' , 'w' , 'x' , 'y' , 'z' , '\n']
totals = [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0]
filePath = ... |
9d231e2f8e53c77716b02a7e1883dd8bacd15a03 | 6c7b26c860673e643530ea6d0dc2ed2a662cb0b2 | jtpio/repo2docker | /repo2docker/contentproviders/figshare.py | Python | py | 3,476 | permissive | import json
import os
import re
import shutil
from os import makedirs, path
from urllib.error import HTTPError
from urllib.request import Request
from zipfile import is_zipfile
from ..utils import copytree, deep_get
from .doi import DoiProvider
class Figshare(DoiProvider):
"""Provide contents of a Figshare artic... |
09486e157d0b9466ec563a0b678ea0408a7c713c | f9b76876ee6acbfed7d6c68b1416608bcf6ef2c4 | andreavb/fence-agents | /fence/agents/lib/XenAPI.py.py | Python | py | 7,237 | no_license | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... |
cafd1da06a7918c2b70864c5e6fb6d045e2fb915 | 52f4b17672d65033c97f97f5bb97836f5493b8bf | larsoner/scipy | /scipy/stats/_qmc.py | Python | py | 59,163 | permissive | """Quasi-Monte Carlo engines and helpers."""
from __future__ import annotations
import os
import copy
import numbers
from abc import ABC, abstractmethod
import math
from typing import (
Callable,
ClassVar,
Dict,
List,
Optional,
overload,
TYPE_CHECKING,
)
import warnings
import numpy as np
... |
d1c4442915d73b271935512b3dce4e0ba3b622a9 | 89404433644c4847026b9cb4e6e57330cefdaacf | jksdou/tkinter-learn | /demo/layout_pack/pack.py | Python | py | 3,942 | no_license | #!/usr/bin/env python3
#-*- coding: UTF-8 -*-
# pack几何布局管理器
"""
pack()
Tkinter中包含的所有控件都有pack()方法,它表示调用这个方法的控件,要把自己打包到父组件容器中。
pack()的参数包含如下六种:
fill属性:
说明:
它表示某个控件在横轴方向或纵轴方向该怎么填充,到底要不要填满。
值范围:
X # 表示这个控件在横轴方向填满父父组件容器,不留空白。
Y # 表示这个控件在纵轴方向填满父父组件容器... |
93bd920726d69ac6ea95dfb20ad45bb944315dbc | 37bfa4892043eaf05842fd93b53aca9ca798ec4a | TS-N/holberton-system_engineering-devops | /0x16-api_advanced/2-recurse.py | Python | py | 794 | no_license | #!/usr/bin/python3
"""query the Reddit API and
and returns a list containing the titles of
all hot articles for a given subreddit
"""
import requests
def recurse(subreddit, hot_list=[], before=None):
""" get hot titles for a subreddit """
header = {'User-Agent': 'School project'}
pl = {'after': before}
... |
8c14df35bc1ad865a45b8d686c9ae94959285031 | e95f54a04949e5e6d70f6b528e4ab73269da7d6b | snowsledge/Tora-Zilliqa | /backend/monitor/monitor.py | Python | py | 5,629 | permissive | # -*- coding:utf-8 -*-
# Copyright 2020 Shanghai Gejing InfoTech Co.,Ltd.
#
# 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... |
8a963ff58e87b902e3209b32b8ee5cebe0da863d | 74ab86b1e53838266c668c75be456706a09a63c2 | manoontje/website-content | /website-pathology/pelicanconf.py | Python | py | 3,474 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from datetime import date
CURRENTYEAR = date.today().year
TODAY = date.today()
AUTHOR = u'WebteamDIAG'
SITENAME = u'Computational Pathology Group'
SITENAME_SHORT = 'CPG'
SITEURL = ''
IMGURL = SITEURL
SITE_REPO = 'website-pathology'... |
02b3f81ca299247fb6e70d6265b5646714b2b6ae | f9b983097ea69871b0a666cd02bb2ad6cff93caf | Nagendrak12/django | /django/products/productsapp/models.py | Python | py | 1,900 | no_license | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class ProductsData(models.Model):
Title = models.CharField(max_length=100)
Description = models.CharField(max_length=500)
Image_Link = models.ImageField(upload_to='images/')
Product_Price=models.Integer... |
056e0f1e4fb9e7bfd20fe615cd2392a001168828 | f4bf4248bdc65c437d135b7c156cfc41dcfded8d | jasonbrackman/dailyprogrammer | /challenge_378/main.py | Python | py | 4,975 | no_license | from typing import List
def strip_zeroes(items: List) -> List:
"""
Optional Warmup 1: eliminating 0's.
Given a sequence of answers, return the same set of answers with all the 0's removed.
"""
return [i for i in items if i != 0]
def sort_descending(items: List) -> List:
"""
Optional Warm... |
b7dbac5d689a7317675e3b794357633fb617dbcc | dc55b0c1442f072d3012db49124b9f90497419b0 | fexd12/pi_VI-backend | /app/models/cadastro.py | Python | py | 943 | no_license | from app import db
from app.authenticate import generate_hash,check_passwd
class Cadastro(db.Model):
__tablename__ = 'cadastro_usuario'
id_cadastro = db.Column(db.Integer,primary_key = True)
senha = db.Column(db.Text, nullable=False)
usuario_id = db.Column(db.Integer, db.ForeignKey('usuario.id_usuario'... |
2dd741f5e24a24321b9f4c79ac44277578302e91 | 7b3f5862cf671c5547063d3fa862b566d9ff768c | cdcs-repos/core_main_app | /core_main_app/templatetags/dict_key_extras.py | Python | py | 371 | permissive | """ Template tag to access a dictionary's key
"""
from django import template
register = template.Library()
# TODO: see if we can do it directly in the template
@register.filter(name='get')
def get(d, k):
"""Get the value of the dictionary d with the key k.
Args:
d: dictionary
k: key
Ret... |
8b7f342950cfce1fed486bf7fdcefe3849349c30 | 8ca53fe9df291e2a484437be7ac48e40bf0d828a | FactomProject/genesisblockmaker | /scanblocks.py | Python | py | 6,185 | no_license | # Factoid genesis block creation script
# Uses some code from ethereum/vbuterin pyethsaletool
# https://github.com/ethereum/pyethsaletool
# pip install websocket-client
# run btcd with btcd --addrindex
import os
import websocket
import pprint
import json
from datetime import datetime
# Timestamp of sale start
start ... |
6755eb69dc1022a350cdfa35a8af0e718c86e8d3 | 7ea42112d0c0fed3f201e5f28ee883f774efc1d4 | NiharikaRay/panoramix | /dashed/utils.py | Python | py | 7,428 | permissive | """Utility functions used across Dashed"""
from datetime import datetime
import hashlib
import functools
import json
import logging
from dateutil.parser import parse
from sqlalchemy.types import TypeDecorator, TEXT
from markdown import markdown as md
import parsedatetime
from flask_appbuilder.security.sqla import mod... |
ab12686f2236a7c4d2901e126b179d611379673c | 11c6c1cab8db8c4ae2248b3aa6634fbb970338b0 | Vaishali81patel/Refactoring | /interpreter_controller.py | Python | py | 10,287 | no_license | from cmd import Cmd
from csv import Error as CSVError
from data_validator import DataValidator
from console_view import ViewConsole as View
# from employee_data import EmployeeData
from employee_get_data import GetEmployee
from data import Data
class InterpreterController (Cmd):
# This class is a controller class... |
3884e28941f48d683b9f8520aa490be7333cb394 | dc896d8598a27edcfd35ace91afbd8027b9ce50c | deepa-karthik/Python_assignments | /task2/task2_3.py | Python | py | 802 | no_license | #3. Write a program in Python to implement the given flowchart to find average of 3 nos:
a,b,c=10,20,30
avg=(a+b+c)/3
print("avg=",avg)
if avg>a and avg>b and avg>c:
print("average is higher than a,b,c")
else:
if avg>a and avg>b:
print("avg is higher than a,b,c")
else:
if avg>a and avg>c:... |
d4fbd0836daa60b292f63ac013b517d4b0b13fcf | 18449893de2c0be5c33b616a9da9d32a4f08460e | nzzdev/st-methods | /bots/verivox-de/gas-dashboard.py | Python | py | 23,259 | no_license | import os
import pandas as pd
import sys
import json
from datetime import date, timedelta, datetime
if __name__ == '__main__':
try:
# add parent directory to path so helpers file can be referenced
sys.path.append(os.path.dirname((os.path.dirname(__file__))))
from helpers import *
... |
fcfc4bea198d1f371e564bb909be06edba72d481 | 62f62375e4b498fef4bed0a9fef94bae9b3cd315 | TroyMurphy/StampProject | /Master/_models/stamp.py | Python | py | 2,422 | no_license | import StringIO
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter, legal, elevenSeventeen, landscape,portrait
from reportlab.lib.colors import PCMYKColor, PCMYKColorSep, Color, black, blue, red
from PyPDF2 import PdfFileReader
try:
import tkinter as tk
except:
import Tkinter as tk... |
fd182663815ada58d4749c91d5c87e5bb89b4bc1 | fb31f17df0f31903c1fdb58a3a94cfbffae0b087 | satyaaman97/Hand-Gesture-Recognition-Keras | /gesture.py | Python | py | 3,261 | no_license | from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D, ZeroPadding2D
from keras.optimizers import SGD,RMSprop,adam
from keras.utils import np_utils
from keras import backend as K
K.set_image_dim_ordering('th')
import numpy as np
im... |
0677a15d3e17578b3b9f70eb4d23c83beb9bffbb | 2b4f0905312087b1c1f68caead71fe011c593e3f | victorvfx/cortex | /test/IECore/Imath.py | Python | py | 34,678 | no_license | ##########################################################################
#
# Copyright (c) 2007-2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
c6de8bfaa058bd401f71ef87e416f04c334d3cce | 0f273061a4518bc7ca268726a85183ea2bdbf153 | Shadowking1235/backspace | /venv/Scripts/pip3-script.py | Python | py | 387 | no_license | #!C:\backspace\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
... |
c39e903e7b51f6deebe5a1442ee2d432ccc83420 | 93578b44c9705badd77a1d2a22975de8bdf18aa8 | omarryhan/sanic_session | /sanic_session/mongodb.py | Python | py | 5,200 | permissive | from datetime import datetime, timedelta
from sanic_session.base import BaseSessionInterface
import warnings
try:
from sanic_motor import BaseModel
class _SessionModel(BaseModel):
"""Collection for session storing.
Collection name (default session)
Fields:
sid
... |
46ef294d9fc3f79caf27995cb00ca9e01581c0b2 | 7924a99d30ba480aaeee5cd57805ba738283cf9f | mmiklavc/metron | /metron-deployment/packaging/ambari/elasticsearch-mpack/src/main/resources/common-services/KIBANA/5.6.14/package/scripts/kibana_master.py | Python | py | 2,746 | permissive | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
b9f9eca793bbb3b6e82b9129aab00b789c540f77 | 6be1034672aef74a70675b6c1865921711ad5cf8 | YaoZhao94/allearn | /time_zone.py | Python | py | 532 | no_license | # class that handle the time zone and format transfer
# import library
from datetime import datetime
from dateutil import tz
# function that transfer GMT time zone to Melbourne time
def zone_change(time):
from_zone = tz.gettz('GMT')
to_zone = tz.gettz('Australia/Melbourne')
utc = datetime.strptime(time,... |
694be1460ed509dc80cb9c70a2c8000b373a37bd | 5ba9361d017e3e60a9635dc8f0230e330295f6b1 | gitter-badger/chains | /chains/links/reverse_dns.py | Python | py | 3,143 | permissive | """ReverseDNS: Perform a reverse dns lookup on fields in the ip_field_list"""
import socket
import logging
# Local imports
from chains.links import link
from chains.utils import file_utils, log_utils, net_utils
log_utils.log_defaults()
class ReverseDNS(link.Link):
"""Perform a reverse dns lookup on fields in the... |
de0f9588d0b5ca693ea43412a22f092ccd56a92b | 03d5fa4f8f7318615d61fbded94bd8a899f24c96 | aperiyed/servicegraph-cloudcenter | /servicegraph/lib/python2.7/site-packages/acimodel-4.0_3d-py2.7.egg/cobra/modelimpl/dlgt/postponedcont.py | Python | py | 4,491 | no_license | # coding=UTF-8
# **********************************************************************
# Copyright (c) 2013-2019 Cisco Systems, Inc. All rights reserved
# written by zen warriors, do not modify!
# **********************************************************************
from cobra.mit.meta import ClassMeta
from cobra.m... |
b4ded57636e555f58ffb50a45834d35ed5f7fcc0 | d731826b47d021cf1ffa7879ffb8f7acc5f406ec | CharlesPurser/Graphics | /Comp Graphics/HMWK_04b_cnp1474/BezierPatch.py | Python | py | 1,707 | no_license | # Purser, Charles N
# cnp1474
# 2019-04-30
import numpy as np
def resolveBezierPatch( res, patch) :
pointList = []
for u in np.linspace( 0.0, 1.0, res ) :
for v in np.linspace( 0.0, 1.0, res ) :
pointList.append( calculate_each_point( patch, u, v ) )
return ( pointList )
... |
60c02e0bafa16f7584923e9e5c911f3aa862b693 | c9e0a7d2e56703ef1e2bc66a1aa0872deafcc98b | rfoxxxy/Telethon | /telethon/tl/types/storage.py | Python | py | 3,544 | permissive | """File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
from datetime import datetime
class FileGif(TLObject):
CONSTRUCTOR_ID = 0xcae1aadf
SUBCLASS_OF_ID = 0xf3a1e6f3
def t... |
7c4f7c3a3d60412336e3379d29f3031d2bdbea03 | ef69754fa8118402a1f6ea9c7321ef88e11951c8 | naoe1999/ReinforcementLearning-4-All-Labs | /lab01_gym_env.py | Python | py | 766 | permissive | import gym
# PRINT ALL GAMES
def print_all_envs():
all_envs = sorted(gym.envs.registry.all(), key=lambda x: x.id)
for env_spec in all_envs:
print(env_spec.id)
def show_env(id):
env = gym.make(id)
print(id)
print('observation space:', env.observation_space)
print('action space:', env.... |
fb8ec3e42d8d3e633c18a87d4c97e439b0856e33 | 9f523a85f223c1bb6ef063937894ff9fdc107bff | DUVELA/testNotepad | /DLS/ch04/mini-batch.py | Python | py | 271 | no_license | import sys, os
sys.path.append(os.pardir)
import numpy as np
from DLS.dataset.mnist import load_mnist
(x_train, t_train), (x_test, t_test) = \
load_mnist(normalize=True, one_hot_label=True)
print(x_train.shape) #(60000, 784)
print(t_train.shape) #(60000, 10)
|
36f0fe405e6115be2c45d7fdbb87520ff93eb34d | 737ad5c4566e58c597c545e1fa6e4091b3fcc864 | PureStorage-OpenConnect/py-pure-client | /pypureclient/flasharray/FA_2_2/api/hardware_api.py | Python | py | 11,156 | permissive | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re
# pyth... |
2780e348eed0ea36c8e8f610fb683e09e5064612 | bf6a302bdd75aa31694fc39db406cec0caab2582 | cgrudz/data_assimilation | /EKF-AUSE/ekf_ause_l96/ekf_v_ause_v_aus.py | Python | py | 4,746 | no_license | import numpy as np
from l96 import l96_rk4_step
from ekf_riccati import simulate_ekf_jump
from ekf_ause_riccati import simulate_kf_ause_jump
from ekf_ause_riccati import simulate_ekf_aus_jump
from scipy.linalg import circulant
import pickle
##############################################################################... |
62fd39e38bf2d501fcf52e87bf08fc0843dacf48 | 446ff70a3f3e4f4bf0d9fb7460f82f547510ab35 | shreyaganguly/hola-python | /rock_paper_scissor/rock_papers_scissors.py | Python | py | 3,124 | no_license | import random
import math
def init_rock_paper_scissor_game():
print("Welcome to Rock, Paper, Scissor Game!!!")
try:
playing_times = int(input("Enter number of times you want to play the game? Maximum wins among the lot wins the league! "))
print()
play_game(playing_times)
except K... |
dcd7904c105b317b6ea68483ac09122084eed973 | f86b6c4bbda16e324b1a1199809d47604e0d4104 | openvinotoolkit/openvino | /tests/layer_tests/pytorch_tests/test_masked_fill.py | Python | py | 2,255 | permissive | # Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from pytorch_layer_test_class import PytorchLayerTest
class TestMaskedFill(PytorchLayerTest):
def _prepare_input(self, mask_fill='ones', mask_dtype=bool, input_dtype=float):
input_shape = [... |
aba872f5889ba3da796b0f63ff38a8d751ddce48 | a0e018fbfb0d1d3e072d308c4af029850908cdf3 | krishna7745/tensorFlow-prac | /tensorflow_test1.py | Python | py | 2,035 | no_license | # -*- coding: utf-8 -*-
"""tensorFlow test1.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1l545prQKhn_uP-Pml_-hU9vtWim57CJ7
"""
from keras.datasets import imdb
import numpy as np
from keras import models,layers
import matplotlib.pyplot as plt
... |
d304565e17579380d4b5d600749474e3ea7eaa92 | 6372b0bbc08ac83f6f6e7431284c6a84b138137b | existeundelta/boto_emr | /boto_emr/tests/test_parse_marc.py | Python | py | 2,136 | permissive | import unittest
import boto_emr.parse_marc as parse_marc
import pprint
pp = pprint.PrettyPrinter(indent = 4)
class TestParseMarc(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.test_txt1 = """
WARC/1.0
WARC-Type: warcinfo
WARC-Date: 2016-12-08T13:00:23Z
WARC-Record-ID: <urn:uuid:f609f246-df... |
bfbc02439b68701e899a94a638b312bc777368c5 | ab38f741cad635af544f3efa640a9abe693c85a4 | suningwz/My-Custon-Odoo-Modules | /appointment_management/__manifest__.py | Python | py | 968 | no_license | # -*- coding: utf-8 -*-
{
'name': "Appointment Management",
'summary': """
This module helps to schedule and manage appointments for professionals.""",
'description': """
This module helps to schedule and manage appointments for professionals.
""",
'author': "Evans Ehiorobo",
... |
761cdf3738fd7861304e9c16f266dcc556f6f9b9 | dd616a41791a1d687be4993ef40d00e03678850f | machao123343/CauGNN | /MTS_TEGNN-master/TENet-master/imdb.py | Python | py | 487 | permissive | import matplotlib.pyplot as plt
import sys,pprint
from gexf import Gexf
import networkx as nx
import random
import numpy as np
import os
path = "/home/jiangnanyida/dzh/GraphMatching_BA/dzh_mini_data/IMDBMulti/all/"
l = []
with open('graph.txt','w') as f1:
for f in os.listdir(path):
graph = nx.read_gexf(path... |
605419fe3eae58888c3d03adc3858fb4616c534d | d1d92365eb271bffbfb2b37c231b00090fb03ae4 | mmore500/conduit | /include/uit_emp/_codegen/pylib/_iter_header_paths.py | Python | py | 978 | permissive | import typing
def iter_header_paths() -> typing.Iterator[str]:
# header_paths = glob(
# "../../third-party/Empirical/include/emp/**/*.hpp",
# recursive=True,
# )
yield from (
"base/macros.hpp",
"config/config.hpp",
"data/DataNode.hpp",
"data/DataFile.hpp",
"datastructs/... |
267905f6b93f3d70d9f526ab0f79add8a2b35325 | 2bb467b7178688c04f220420512165e8a75bcad1 | saroad2/toga | /iOS/src/toga_iOS/widgets/selection.py | Python | py | 2,439 | permissive | from rubicon.objc import CGSize, objc_method, objc_property
from travertino.size import at_least
from toga_iOS.libs import UIColor, UIPickerView, UITextBorderStyle, UITextField
from toga_iOS.widgets.base import Widget
class TogaPickerView(UIPickerView):
interface = objc_property(object, weak=True)
impl = ob... |
8f1682e8904640e1f08013c13975260b56f92754 | 7f06227620f48a62624e82dc3250b11e23f503ad | andrewb1999/prjxray | /utils/find_missing_segbits.py | Python | py | 6,933 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
"""
This script allows to find missin... |
595f76349d1c3494905579e9af36839ed7671aa6 | c5650cb90abdfb6dbbf53d43ceeeb0eeb9192859 | RashiGupta712/tathastu_week_of_code1 | /Day7/python_assistant/jarvis.py | Python | py | 3,194 | no_license | import webbrowser as wb
import speech_recognition as sr
from tkinter import *
from time import ctime
import time
import os
from gtts import gTTS
import pygame
from pygame import mixer
def speak(audioString):
global x
b = audioString
if len(b) == 0:
#w1 = Label(root, text="No input!").pack()
... |
9a203d782df355b0ffc1b1b4382aea4b12ea2e49 | 1a95b44ead80774eb35398a1d05d10c820ff66be | JMU2021/DESRGAN | /codes/models/SRGAN_model.py | Python | py | 13,824 | permissive | import logging
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.nn.parallel import DataParallel, DistributedDataParallel
import models.networks as networks
import models.lr_scheduler as lr_scheduler
from .base_model import BaseModel
from models.loss import GANLoss
from .gradient_loss im... |
ee163b36b01e29d531d3c540642ae9d32a5876e5 | 367f977df54b12ce5eb7306dc9286e051089c942 | sjgosai/cms2-work | /component_stats/cms/cms/composite.py | Python | py | 30,894 | permissive | #!/usr/bin/env python
## top-level script for combining scores into composite statistics as part of CMS 2.0.
## last updated: 07.24.2017 vitti@broadinstitute.org #update docstrings, clean up common args
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from power.parse_func import get_neut_repfi... |
6787761976e576cdd6590409f3d431a0ef7495ac | 2af5b219c986bc647b1c18d20edca115658a219e | yinghsienwu/MachineLearningUdacity | /mini-projects/neural_networks/Perceptron_Update_Rule.py | Python | py | 3,044 | no_license | # ----------
#
# In this exercise, you will update the perceptron class so that it can update
# its weights.
#
# Finish writing the update() method so that it updates the weights according
# to the perceptron update rule.
#
# ----------
import numpy as np
class Perceptron:
"""
This class models an artificia... |
ee158d11ccc639fe0214eb2f4d8f831add1c7d4a | f6b7fa064e2a5f83b4def09a472bf30b0644f4ee | uutzinger/BucketTracker | /display_lidar_pi.py | Python | py | 1,782 | no_license | """
Consume LIDAR measurement file and create an image for display.
Adafruit invests time and resources providing this open source code.
Please support Adafruit and open source hardware by purchasing
products from Adafruit!
Written by Dave Astels for Adafruit Industries
Copyright (c) 2019 Adafruit Industries
Licensed... |
865f61f6ae4a7e830843cb5ed6afe8ddc5c5bd30 | 68cdc26b7a2dc89268282fce0150c244bbf9d238 | vipul-rathod/lsapipeline | /custom/renderGlobals_writeXML.py | Python | py | 20,761 | no_license | import os, getpass, sys
if 'T:/software/lsapipeline/custom' not in sys.path:
sys.path.append('T:/software/lsapipeline/custom')
import time
import maya.cmds as cmds
import maya.api.OpenMaya as om
from xml.etree.ElementTree import ElementTree
import xml.etree.ElementTree as etree
from xml.etree.ElementTree im... |
e747ea2a8e95dee19b22722df679c1f983790988 | 8fe2a5d5c344cc4f7eb4f8a5c13219183e93eebd | duncanrudd/tRigger | /components/guide.py | Python | py | 7,655 | no_license | import pymel.core as pm
from maya.api import OpenMaya as om2
import os
from tRigger.core import icon, attribute, dag, transform, curve
reload(attribute)
reload(icon)
reload(transform)
reload(curve)
class TGuide(object):
def __init__(self):
self.root = pm.createNode('transform', name='guide')
self.... |
3f1f84440b8da66951a85835a25b0c8e87cb1b5c | 3debdbab3b3a1f249c418aa1fbdfd0321b58a2d4 | ljungmanag42/Project-Euler | /PE-002.py | Python | py | 691 | no_license | # ProjectEuler 2
'''
Each new term in the Fibonacci sequence is generated by adding the previous two terms.
By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not
exceed four million, find the sum of the ev... |
39328b745d85a31bd59a6b31feee7f0418901e92 | c747231e341bbe49470486f2c4b5123c40a76f70 | pp21/partial-face-morphing | /face_nor.py | Python | py | 1,923 | no_license | import cv2
import dlib
# eyes based rotation
def warp_affine(image, dx, dy, cen, scale):
# get rotation degree
bdval = [ image[0][0][0], image[0][0][1], image[0][0][2] ]
bdval = tuple( int(x) for x in bdval )
angle = cv2.fastAtan2(dy, dx)
rot = cv2.getRotationMatrix2D(cen, angle, scale=s... |
e3f98d5f36aec88d4003a4811ea8b526b6a5b162 | 2e95f44d907e4b3ce5891fd1fba7cc3e5b58ac9d | RaleighPublicUtilities/EasementBasinUpdate | /checkBasinDomain.py | Python | py | 3,164 | no_license | import arcpy
from arcpy import env
# env.workspace = "C:/data/BasinTest.gdb"
#test
# env.workspace = "Database Connections/RPUD_TESTDB.sde"
#trans
env.workspace = "Database Connections/RPUD_TRANSDB.sde"
fcs = arcpy.ListFeatureClasses("", "", "RPUD.SewerCollectionNetwork")
domDict = {"BEAVER EAST": "BEAVER EAST",
... |
604b0debad0bde1b9cb1663c22c4e92ee9145320 | 640913a7acc0ff28da481d232be568450f323634 | IlyanAzaLun/Python | /arithmetic_analysis/bisection.py | Python | py | 1,662 | permissive | from collections.abc import Callable
def bisection(function: Callable[[float], float], a: float, b: float) -> float:
"""
finds where function becomes 0 in [a,b] using bolzano
>>> bisection(lambda x: x ** 3 - 1, -5, 5)
1.0000000149011612
>>> bisection(lambda x: x ** 3 - 1, 2, 1000)
Traceback (m... |
731214d1c7460baf7e993d89344932298e64f745 | 6711ebca7eabb23459f0145d05df1672510aaff8 | rupindermonga/euler22NameScores | /euler22NameScores.py | Python | py | 1,129 | no_license | #Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.
#For example, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.