blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 283 | content_id stringlengths 40 40 | detected_licenses listlengths 0 91 | license_type stringclasses 2
values | repo_name stringlengths 3 135 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 68 | visit_date timestamp[ns]date 2015-07-25 20:53:29 2023-09-06 10:46:05 | revision_date timestamp[ns]date 1970-01-01 00:00:00 2037-05-03 13:00:00 | committer_date timestamp[ns]date 1970-01-01 00:00:00 2036-02-09 17:40:36 | github_id int64 1.61k 691M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 24
values | gha_event_created_at timestamp[ns]date 2012-06-03 10:21:33 2023-09-14 21:59:50 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-09-13 22:40:33 ⌀ | gha_language stringclasses 250
values | src_encoding stringclasses 27
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 6 10M | extension stringclasses 289
values | filename stringlengths 1 218 | content stringlengths 6 10M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
91bfcc5b84b3440c8bf8f0f0211593d950df0063 | d5971b96b38f7ab1f28eca1eb3f1f8d9184b05b5 | /stage-3/Lesson3/check_profanity_mini_project.py | bd1e9fb7cd1c3204d3e5631a4143fa229cac4ec0 | [] | no_license | Aliciawyse/intro-programming-nanodegree | 7206273184ae156068eb0b0d9c15a5e1012d770f | 3e01762543e3e2c141edeab5f870e9cfd9608ec6 | refs/heads/master | 2020-05-21T22:12:48.019814 | 2016-12-16T13:12:45 | 2016-12-16T13:12:45 | 61,499,012 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,324 | py | check_profanity_mini_project.py | # Lesson 3.3: Use Classes
# Mini-Project: Check Profanity
# Typos can be embarassing! Imagine how youd feel if you
# accidentally sent your boss an email that said I'll take
# a sh?t at it, instead of Ill take a shot at it. Write
# a program that can detect curse words in a string of text.
import urllib
def read_tex... |
a55f535653ad76ffb57e459e3eb819f76a4d41bc | 962feeffee41625ff841f6590f97bb09cef9be4c | /torch_glow/tests/nodes/sigmoid_test.py | d7959a93086ff7d53a580260fb035b023882494c | [
"Apache-2.0"
] | permissive | SushantDaga/glow | 8c4c3fbc58c3ae760bdd8e1df2e8c05a72ff07bc | aab22c3e0421dadd29950c2ebfa88b86027cecf5 | refs/heads/master | 2022-11-03T08:39:33.958233 | 2020-06-19T17:03:14 | 2020-06-19T17:05:42 | 273,568,864 | 2 | 0 | Apache-2.0 | 2020-06-19T19:12:31 | 2020-06-19T19:12:30 | null | UTF-8 | Python | false | false | 781 | py | sigmoid_test.py | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
import torch_glow
from tests.utils import jitVsGlow
import unittest
class TestSigmoid(unittest.TestCase):
def test_sigmoid_basic(self):
"""Basic test of the PyTorch sigmoid Node on Glow"""
def sigmoi... |
2e08ddf4630dda2a346f9f6c930375b8b51df88c | 01f849cfb0a352a6a2df95cdbab8786dd276c724 | /backup/main.py | f9be3d326a02789fc5af647e5b9b2a2d9061b594 | [] | no_license | Alexfinkelshtein/ML4HC_RL_Glucose_Management | a898d884ea6957047266dee980edd0c7fe11a1ec | d76c10316e58200c944b808ca395a2358bea0d0e | refs/heads/master | 2020-05-30T07:07:16.670206 | 2019-09-18T09:10:01 | 2019-09-18T09:10:01 | 189,593,231 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,882 | py | main.py | from DDPG.ddpg import train_ddpg
from gym.envs.registration import register
import os
import datetime
import numpy as np
# imports
from simglucose.simulation.user_interface import *
import gym
import logging
import json
# import .simglucose.simulation.user_interface as sim_inter
##
# patient_names = get_patients([1, 2... |
960c8b1aba3ccd469ad2acd81f1b4584202f059b | b23f1cfc841f67c2b75ef4b1ef95bc48b61619dc | /spytz/spud.py | b9f94527662ad62df2ba32d1213b1791ff2ec234 | [
"MIT"
] | permissive | chaosity/spytz | 6e3215b9a18429fb0a9b624c52e6bd0b75f0d2b4 | 01032099c1275835fb4653051e72443318e411cd | refs/heads/master | 2021-01-23T11:49:40.978371 | 2014-11-12T11:32:09 | 2014-11-12T11:32:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,587 | py | spud.py | """
Auto-update.
"""
# Spytz module imports
import spytz
from spytz import gaetz
# Google API imports
try:
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
except:
pass
# Used by SpytzReleaseFile
import json
# Used by SpytzUpdateFile()
import hashlib
import tarfile
import co... |
d0b721911d1b5b4b2598ae2be092fcc65179a82b | 193dc69180868b12456e5b6ec1b9094a23377193 | /KeepPages.py | f00a1b5a229e2e2322a2418440165729c5b609e8 | [] | no_license | shobhit10058/KeepBlog | 99282d24a7b56a164a2b20eaaf752c91a37806a9 | d1fed78b9c528d9e1dcf263fa267623fa92f031a | refs/heads/master | 2023-07-01T23:36:00.677626 | 2021-08-06T11:36:16 | 2021-08-06T11:36:16 | 317,534,660 | 7 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,633 | py | KeepPages.py | import os, click, validators, webbrowser, shutil, string
import pandas as pd
from fuzzywuzzy import fuzz
from pathlib import Path
@click.group()
def main():
"""
Simple CLI for saving your favourite webpages like blogs
under different topics and then seeing them whenever you wish
"""
global dic, to... |
fcb7cb80cf1db0a462fd035edef14a676bd1416f | 97a01ed80d890472e24eb0ecce32d500dcad3231 | /LinuxSA/FileWatch/scripts/update_changelog.py | 7cf4b95454f49b9909c0750fa98c897812fb54b3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | todie42/linux_env_setup | e92112ae628f0031d4ed04e71204f6c9182ab113 | 536c01aa6e191438c41f2fa8c15c4adf6f9eaec0 | refs/heads/master | 2021-12-11T03:03:11.524629 | 2021-12-08T21:07:23 | 2021-12-08T21:07:23 | 151,981,005 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,534 | py | update_changelog.py | #!/usr/bin/env python
# Copyright 2018 Battelle Energy Alliance, LLC
import argparse
import sys
import re
import textwrap
from argparse import RawTextHelpFormatter
import os
import socket
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../lib'))
#import FileWatch
import file... |
5a67413542fcf63e7ac648642d6ed67a9a8896a8 | 561ea0847a2dda17d3e2a113a2e34bb15550a43f | /2.4_biggest.py | fc0a3866485175c085c1e9fbdb3fe80f66ccb703 | [] | no_license | ShaiLaric/IPND_Stage_2 | 73546d5ff65de3c00c5882e0f04765a1e4c7dec5 | f9e3f8f4d79d95c6b2fdb931ff1981d0e34a22a7 | refs/heads/master | 2020-12-02T19:37:44.214979 | 2015-11-11T14:57:36 | 2015-11-11T14:57:36 | 45,197,628 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 680 | py | 2.4_biggest.py | # Lesson 2.4: Making Decisions - If Statements
# Final If Quiz
def biggest(a, b, c):
if a >= b and a >= c:
return a
if b >= a and b >= c:
return b
else:
return c
# Redefined below with Dave's solution:
def biggest(a, b, c):
if a > b:
if a > c:
return a
else:
return c
else:
if b > c:
return ... |
40ed3edcdebbc9f2cc3c601d9d51f381f3ab559a | 5b8c06b43b663f7934a1acf08af36d8b34909a14 | /src/apis/room_api.py | 6adce65b879bf982e274447cdae008c76926d4ef | [] | no_license | SSaeedHoseini/odmantic-crash-docs-example | b23200e3f05562c49449d48daebb822ecfe3ab95 | 0154bc56a66c452afa883ba86cad25fdf0515869 | refs/heads/main | 2023-08-05T05:05:32.488092 | 2021-09-12T07:03:20 | 2021-09-12T07:03:20 | 405,558,745 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,631 | py | room_api.py | # coding: utf-8
from typing import List
from fastapi import APIRouter, Body, HTTPException, Path, Query, Response
from starlette.responses import Response
from odmantic.bson import ObjectId
from ..models.db import get_db
from ..models.room import Room
router = APIRouter()
@router.post(
"/room",
tags=["Ro... |
02b76545179f417982a6f8f8458e4313e465dc6e | b808ec897d6b7ee243fe0f17af4eb6eab0857046 | /single-player-agents/hamiltonian_cycle_agent.py | 2ed9a5a245a95d6f8e93c572bac520767b5bb232 | [
"MIT"
] | permissive | rpachauri/snake | 52b927f04e97635f01733bb68fb2563a4bfc6d6f | ad10c10c67c722fd1a6e485dc44e159417558c83 | refs/heads/master | 2020-09-22T14:55:16.303272 | 2020-09-13T02:11:21 | 2020-09-13T02:11:21 | 225,248,609 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,009 | py | hamiltonian_cycle_agent.py | # Gotta import gym!
import gym
import snake
import random
# Make the environment, replace this string with any
# from the docs. (Some environments have dependencies)
env = gym.make('snake-v0')
def get_head(observation):
"""Given the current state of the snake environment, finds where the head of the snake is.
A... |
8205099caf61e444a85de71b55c38fc362e8d713 | 65e2190b75cfe119f6882fa661413050d6ac1740 | /full_case_study_solns/_e_ballbeam/python/hw10/ballbeamController.py | 52bc01cdd22b052ddbc943b5622357ed433b4046 | [] | no_license | mebach/hummingbird | 0a5d8d2b9a4255fb5a4e9f6a372b4848ebb898c5 | f80f54539ecedbd6dbf0deb3402dde63b6da983c | refs/heads/master | 2023-04-22T17:29:00.471553 | 2021-05-04T17:24:42 | 2021-05-04T17:24:42 | 364,332,986 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,038 | py | ballbeamController.py | import sys
sys.path.append('..') # add parent directory
import ballbeamParam as P
import ballbeamParamHW10 as P10
from PIDControl import PIDControl
class ballbeamController:
'''
This class inherits other controllers in order to organize multiple controllers.
'''
def __init__(self):
# Ins... |
040187793f791bcd37e94e05a7358972c90cc957 | 3068bdf533bbd1dfddbbc22176bf5837844ac48a | /tensor/simple.py | 4aae98aabc431948135b27af5b0a80b8fc6ac74b | [] | no_license | jparimaa/nn | c2c67869a08779ce2f1e173489aaf6eb5e6d0b66 | 197425b7adceba0a8ea22d6008ac0c4fde21f438 | refs/heads/master | 2021-06-10T23:55:03.933529 | 2016-10-22T09:46:05 | 2016-10-22T09:46:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 939 | py | simple.py | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import model
data = input_data.read_data_sets("/tmp/data/", one_hot=True)
x = tf.placeholder("float", [None, 784])
y, variables = model.simple(x)
y_ = tf.placeholder("float", [None, 10])
cross_entropy = -tf.reduce_sum(y_ * tf.log(y))... |
06a8fb1cc030986cf444e7f0bdd403833151f09e | 5859ca431619ae22cab07a8283270974ac1ab7cb | /scores.py | 346f3876c6ce4d976c63d1f16c0101c71df1b421 | [] | no_license | evrimulgen/TermScores | cbdebb5005b56ef092a01705d9a5369d4b7a718a | bde779331438c5566a1d2e52328bb1cc14751b69 | refs/heads/master | 2020-04-09T00:23:53.110208 | 2016-03-31T14:22:10 | 2016-03-31T14:22:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 16,889 | py | scores.py | import requests
import pprint
import json
from colorama import Fore, Back, Style
def checkDate(date):
count = 0
month = ""
day = ""
year = ""
try:
for c in date:
if count == 0:
if c == '/':
count+=1
else:
m... |
bd6069231c9698dcbe392cb9622ff5006248488d | a6eda1c86318ae6e5dae1868989859393e2c093c | /Microsoft/Can list be strictly decresing with at most one change.py | 5737fac132e85f145c79e359f3b768e330ba666d | [
"MIT"
] | permissive | Jay206-Programmer/Technical_Interview_Practice_Problems | 76d80e4a65983dec54153cf33136cfc0e58165bd | 2fc38a20f710d0822bb8f57c7e2d1ccde71d27e8 | refs/heads/main | 2023-02-08T04:35:37.290707 | 2021-01-03T23:55:29 | 2021-01-03T23:55:29 | 308,727,164 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 944 | py | Can list be strictly decresing with at most one change.py | # Asked in Microsoft
# You are given an array of integers in an arbitrary order. Return whether or not it is possible to make the array non-decreasing by modifying at most 1 element to any value.
#We define an array is non-decreasing if array[i] <= array[i + 1] holds for every i (1 <= i < n).
#Example:
#[13, ... |
4ee43b0331031ed7bd7698cbcaa6600ccab0cd59 | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_157/961.py | 2334aa82ab8c7e9fbf24981a52c968bbcc5c3199 | [] | no_license | dr-dos-ok/Code_Jam_Webscraper | c06fd59870842664cd79c41eb460a09553e1c80a | 26a35bf114a3aa30fc4c677ef069d95f41665cc0 | refs/heads/master | 2020-04-06T08:17:40.938460 | 2018-10-14T10:12:47 | 2018-10-14T10:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,134 | py | 961.py | class Quaternions(object):
def __init__(self, val):
self.value = val
@staticmethod
def __multiply(a, b):
minus = False
if a[0] == '-':
minus = True
a = a[1:]
if b[0] == '-':
if not minus:
minus = True
... |
67cdf689803e18d98e1eda24e8ec0c8f26f0227b | 02b80e046772632ca360612cf7c8fcaaa6a1fbf5 | /django_test/test1/restapp/serializers.py | f1d59416d3dd31a213bdc175e3ae664b1ad84adf | [] | no_license | justrunshixuefeng/django-test | 15ea321f427d2a7a17c433dec2245a517418fc87 | 9652110410cc44aacb3d6153c12f694c6e2c3f61 | refs/heads/master | 2022-11-24T05:10:20.153260 | 2020-07-31T03:39:38 | 2020-07-31T03:39:38 | 283,924,270 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 661 | py | serializers.py | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from restapp.models import UserInformation
# HyperlinkedModelSerializer 超链接模型的序列化器
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'ema... |
d4ffadbdaf4f69f1aa0a820182e2e12b5b95da47 | 7c4d27d8d6d60b5b043ee55b708143c788c0af72 | /pension/models.py | c2fd305eedd5369e1f9ab4e6b86b1e87ec8fc0ee | [] | no_license | michalzadora/Python_django | d503670c9ff81459c32d5d3a6ab5c623d74114f2 | 8eccfc30a8dde773e030982636be7a4515a15023 | refs/heads/master | 2020-03-20T01:42:29.508912 | 2019-06-25T22:10:18 | 2019-06-25T22:10:18 | 137,086,035 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,135 | py | models.py | import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
class Room(models.Model):
name = models.CharField(max_length=200)
description = models.TextField(default="Opis")
def __str__(self):
return self.name
class Reservation(model... |
e9cf8150bcba30d588e9e7b917eda2563a1ab5fc | 80b967277432346bd108e5ff17c3d026ce28a027 | /predict.py | d7d8d7b887748b20ff618cebcb7588d5b0b27fdb | [] | no_license | runninglsy/Spooky-Author-Identification | 9445a7bcef8e9e854b9ec2240248a07b63374209 | 35b75523f73235ed4316f0d29d3c898a7ac7de32 | refs/heads/master | 2021-08-07T04:51:38.708075 | 2017-11-06T14:07:49 | 2017-11-06T14:07:49 | 109,368,389 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,498 | py | predict.py | import os
import sys
import json
import shutil
import pickle
import logging
import data_helper
import numpy as np
import pandas as pd
import tensorflow as tf
import csv
from text_cnn_rnn import TextCNNRNN
os.environ['CUDA_VISIBLE_DEVICES'] = '6'
logging.getLogger().setLevel(logging.INFO)
def load_tr... |
392ad67c2b52c34f9708ad252b33e4d7b63be04b | cf4e542356c0739c49b16c31260228622f433359 | /migrations/versions/5dfdd1781cf6_prueba_de_migracion.py | 06589a6e3aa456db2ad9687d790f40f64f6bd446 | [] | no_license | nehuenpereyra/Sistema-Gestion-Centros-de-Ayuda-y-Turnos | cb3d2b27c10840726fbd39aedcc77ab10018bf32 | 1295d498498743afe45e814955d478e3b54c47dc | refs/heads/main | 2023-08-05T18:40:57.916437 | 2021-09-17T11:45:32 | 2021-09-17T11:45:32 | 407,519,229 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 672 | py | 5dfdd1781cf6_prueba_de_migracion.py | """Prueba de migracion
Revision ID: 5dfdd1781cf6
Revises: 47b7e6b9c5ba
Create Date: 2020-10-13 19:28:59.057094
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5dfdd1781cf6'
down_revision = '47b7e6b9c5ba'
branch_labels = None
depends_on = None
def upgrade():
... |
abd7c803143f55311b553cd774378476ed261385 | c96f6611e5272fe1ec50cd9711a3b2671dc1bf09 | /ch02_linked_lists/linkedlist.py | 8af953f87c330e2047878c598fd49e1ee0da845c | [] | no_license | Jack-Tilley/ctci_python_jt | 1de096f67dd9d3942ae0ee4424ac7478d6c9e1fc | 69074d94e6381ffe36bbe5a3f757ff9bbce6dcd3 | refs/heads/master | 2022-12-17T10:08:03.646539 | 2020-09-27T00:26:01 | 2020-09-27T00:26:01 | 291,533,464 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 763 | py | linkedlist.py | class Node():
def __init__(self, data, nxt):
self.data = data
self.nxt = nxt
def append_to_tail(self, val):
n = self
while n.nxt is not None:
n = n.nxt
n.nxt = Node(val, None)
def delete_node(self, val):
head = self
n = se... |
c8ab78bfce03a411723f43e5ee7583ad7c84fd23 | 87a3f09a1edd5f987e64b43605d528f952fd42cf | /bin/bigsort | a38abe374ca393b56a457a0d4610f58f427a4e6d | [] | no_license | bmuller/SassyPy | 5f3c844cdb3a8e3edc1cbd53aff7decc96bb3d2a | 2194fcd464e7985244c11d52634eea4503df8e9e | refs/heads/master | 2021-01-18T13:47:18.778549 | 2011-06-01T19:17:16 | 2011-06-01T19:17:16 | 1,833,521 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,716 | bigsort | #!/usr/bin/env python
# based on Recipe 466302: Sorting big files the Python 2.4 way
# by Nicolas Lehuen
# Sorting Big Files the Python 2.6 Way
# http://code.activestate.com/recipes/576755-sorting-big-files-the-python-26-way/
# Licensed under the MIT License
import os
from tempfile import gettempdir
from itertools im... | |
60f5bdc0946f7fe56b39dbcb9c8316da01c0929f | 3ab2f5d1ba9b42d7d8fbaa8d58b4ab64546b6812 | /limage/process_ora.py | d2fa38edc3a359d7921852d85fea0c54f6e17b86 | [
"MIT"
] | permissive | Boyquotes/limage | 4afb0afad50ebd762f5d88fa3e2df2de1d57d69c | e890d989b83d8436a983ba0ff3033d9b84afba1f | refs/heads/main | 2023-08-18T22:59:01.942203 | 2021-10-07T00:45:10 | 2021-10-07T00:45:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,558 | py | process_ora.py | from pyora import Project, TYPE_LAYER, TYPE_GROUP
from PIL import Image
from . import util, shared, classes
from .util import get, print, print_error, print_warning
from .classes import Vec2
def process(path, data:dict):
file = Project.load(path)
wide, high = file.dimensions
layers = [x for x in file.children_rec... |
e3c971d15fea988625e43dbbefc9b3c2a207d08d | 6d24fe1325acc4e84dee3cd0352a1cbf77ab108f | /problem_solve_result/1018.py | 779e0ceccf814ceab718fe0dd8225a71bcb5b61c | [] | no_license | timetobye/BOJ_Solution | 77cebe0e79d408854719a57b462235dd8adb269d | 1a12e6e2bc58b40620e2458dcb38d799d5374a36 | refs/heads/master | 2023-06-14T01:35:30.230804 | 2023-05-25T14:34:04 | 2023-05-25T14:34:04 | 148,924,154 | 2 | 2 | null | null | null | null | UTF-8 | Python | false | false | 800 | py | 1018.py | m, n = map(int, input().split())
n_st = []
a = ['B', 'W', 'B', 'W', 'B', 'W', 'B', 'W']
b = ['W', 'B', 'W', 'B', 'W', 'B', 'W', 'B']
for i in range(m):
n_st.append(list(input()))
res = []
for i in range(m - 7):
p_st = n_st[i:i + 8]
for p in range(n - 7):
l_st = []
ct_1 = 0;
ct_2 = 0... |
e97b1534e3cd333443d4087975be183ba5d472db | 437d3ed6ef97d7575371791700650fd32da1d6f7 | /firstFile.py | 0601a1aa10168b494b4f6e3ba6c0050979b08685 | [] | no_license | ShivamChawla2017/git-github | 6a7ad2508cca4afb5043e2915e1ce57d395edeb3 | cd815237e0465bb18db75805146055643364cb24 | refs/heads/master | 2023-07-16T22:04:43.763327 | 2021-09-03T19:11:31 | 2021-09-03T19:11:31 | 402,866,469 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 69 | py | firstFile.py | print("First Python File is saying Hi")
print("Modifies first file")
|
cb6f45a8d353dea00083ab3f1c0bc1181932ace1 | d5619106323e2cf3c36b41bed34ed472cdbf8889 | /titus_isolate/event/constants.py | 4878b21bbba2c5406b346f3792f2645a4311a7ea | [] | no_license | Netflix-Skunkworks/titus-isolate | 6b33697d24d520f35999f253d02110b5ad945017 | 10dd8bacd0916ebeefc4607eac1bbac344ac4ca9 | refs/heads/master | 2023-08-24T17:24:48.209943 | 2023-02-23T17:34:48 | 2023-02-23T17:34:48 | 155,600,286 | 56 | 6 | null | 2023-02-23T17:26:46 | 2018-10-31T17:47:43 | Python | UTF-8 | Python | false | false | 1,125 | py | constants.py | import json
# Docker Event constants. You can see these in action by watching
# docker events --format '{{json .}}'
# on a titus agent as containers start
ACTION = "Action"
ACTOR = "Actor"
ATTRIBUTES = "Attributes"
ID = "ID"
LOWERCASE_ID = "id"
NAME = "name"
REPO_DIGESTS = 'RepoDigests'
TIME = "time"
TYPE = "Type"
CON... |
d992ddb35f7ba78915f6d9cbfbb334fdf9fbfc1a | 6d957d2b8f0d2d7ce3d421236f7d53d28ea77b9a | /blazingdb/migrator.py | 4003f5b5df4265f485c3de8ef582d077fd2a2f85 | [] | no_license | multimac/blazingdb-python | 56fdd0ad7ba3fd46ce30b27c7956608ca54a4c9d | 5ea81bceb281bf106870fe91de3eb86e29a18e65 | refs/heads/master | 2021-06-22T15:27:58.463867 | 2017-07-31T15:05:14 | 2017-07-31T15:05:14 | 76,217,797 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,935 | py | migrator.py | """
Defines the Migrator class which can be used for migrating data into BlazingDB
"""
import asyncio
import logging
from blazingdb.pipeline import packets
from . import processor
class Migrator(object):
""" Handles migrating data from a source into BlazingDB """
DEFAULT_PROCESSOR_COUNT = 5
def __ini... |
aee85b6d39aa1082080cfb862b10e60f4e1ebb36 | 20dc1814de6503e94105ac13b03f6f23bb03c098 | /mysite/blog/urls.py | 02a8ce55da4e2e5756944c56d41b29c360741927 | [] | no_license | ddubbu/Univ-Grad-Portfolio | 25b6ae1ed50140c2d45e33ece960dade76bfeb53 | 050282518477353aa3fd8029cb550c3b96ac62ca | refs/heads/master | 2023-01-23T23:04:35.767654 | 2020-11-22T08:17:58 | 2020-11-22T08:17:58 | 295,078,684 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 323 | py | urls.py | from django.urls import path
from . import views
urlpatterns = [
# /blog/
path('', views.index, name='index'),
path('post/<int:pk>', views.PostDetailView.as_view(), name='post'),
path('post/create', views.PostCreate.as_view(), name='post_create'),
# path('post/record', views.button, name='record'),... |
362ce12f5a2bff42248f4ca5bf2b9ec39a3e516e | 28598eee4ca65270bdcd5bec91f9f3c1eb9ddaab | /wukongqueue/_commu_proto.py | 95a1fcbef2e930d60c4fb948ba54a8c23dda9bf5 | [
"MIT"
] | permissive | lansings2009/wukongqueue | a82262ac83099be4b218d592b6aec20f7a44ac03 | 548432bc0f2dccd4c526811007018f16f2f455d9 | refs/heads/master | 2021-02-15T13:18:47.658480 | 2020-02-15T13:43:52 | 2020-02-15T13:43:52 | 244,902,319 | 1 | 0 | MIT | 2020-03-04T13:05:08 | 2020-03-04T13:05:07 | null | UTF-8 | Python | false | false | 9,146 | py | _commu_proto.py | # Protocol of communication
import json
import socket
from base64 import b64encode, b64decode
from ._item_wrapper import item_wrapper, item_unwrap
from .utils import Unify_encoding
__all__ = [
"read_wukong_data",
"write_wukong_data",
"WuKongPkg",
"TcpConn",
"TcpSvr",
"TcpClient",
"wrap_qu... |
2e6d7f45e569fb6cc9151d873b3ec80e2c77dd23 | 24c33c2ed391720a9bc2be77239d93d0e1f2d991 | /Raspberry Pi/Raspberry Pi Code/Arbi GUIs/GUI Tutorials/Tutorial2.py | 3013ed7fd07a7af2453b51b4a0568465e14f152e | [] | no_license | AnthonyWalton1/ARBI | 3ea4dfa051e597984cc486090f25e69170452890 | d620834effb615d9bb31e92d9fb48b84da62a66e | refs/heads/master | 2016-09-01T12:16:56.659112 | 2016-02-10T03:58:29 | 2016-02-10T03:58:29 | 47,526,464 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 682 | py | Tutorial2.py | #!/usr/bin/env python
from Tkinter import *
# Start a GUI (object) from Tkinter class
root = Tk()
topFrame = Frame(root)
topFrame.pack(side = TOP) #Note: by default it places it on top first, so could just use topFrame.pack()
bottomFrame = Frame(root)
bottomFrame.pack(side = BOTTOM)
button1 = Button(topFrame, text... |
59277e1b9298497b3aa7c887cb29adafcca73533 | 434529e01c7b65a0f9c5137796034445a3ca1635 | /d2/mgd/builder.py | 373e6c10016230d922039371a7d058a211e0f3bd | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | amajee11us/mgd | 8d2aac6d090754cdcc03480271ec9901e5f23962 | a5f98775963be680a18f9c46f00a116f3803c075 | refs/heads/master | 2023-07-08T01:03:54.860232 | 2021-08-07T01:33:58 | 2021-08-07T01:33:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,786 | py | builder.py | #!/usr/bin/env python
import torch
import torch.nn as nn
from detectron2.modeling import META_ARCH_REGISTRY
from detectron2.modeling.meta_arch import retinanet
from detectron2.layers.batch_norm import NaiveSyncBatchNorm
from .config import mgd_teacher_config, mgd_student_config
from .mgd import MGDistiller, SMDistil... |
34e1438ab0c3889036870e2cefb8e7fa1d42c044 | afabd1f1778d4911c825409501f215c634319f0b | /src/python/iob2off.py | c2c76a1d33035676131a1a3ccdef80ae5d020cac | [] | no_license | texttheater/xlci | 030b275a8ecf2bea640c9f9b70aa3fb9fbc768df | 702d3e90b2a97f56b98da62cd072f0988fcfa5a7 | refs/heads/master | 2021-12-24T09:40:10.803445 | 2021-12-22T13:54:49 | 2021-12-22T13:54:49 | 173,109,877 | 6 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,886 | py | iob2off.py | #!/usr/bin/env python
"""Converts tokenization in IOB format to tokenization in offset format."""
import codecs
import sys
import utils
def start_document():
global snum, tnum, token, offset
snum = 0
tnum = None
offset = 0
token = ''
def start_sentence():
global snum, tnum
snum += 1
... |
dc838f9d350c6cb24a86113ca46901908fd8445e | db06f61afaa09c78d0b4ab07286bbe9fe29da57c | /LatLng.py | 121bf39914c137a78224c16e843e6dfacfa9e955 | [] | no_license | amiruzzaman/generateLatLng | b11895c09916de25ec0f07f3dc21b494fb362ad6 | 823b8ecab8c46597e70bd3539dc98c0745078629 | refs/heads/master | 2020-03-12T23:02:53.815206 | 2018-06-03T04:06:17 | 2018-06-03T04:06:17 | 130,858,263 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,252 | py | LatLng.py | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 09:30:26 2018
@author: mamiruzz
"""
import random
import sys
import math
import os
latitude = 34.0543543
longitude = -118.2586675
csv_file = 'random_lat_lon'
file_type = 'csv'
number_of_lat_lng = 20
def generate_random_lat_lng_data(lat, lon, num_rows, file_name, fil... |
c8a6ac1afad5880b216118008c694893aa2a1699 | 67bae7c8b0433c5fd8c7de0165309976ae2be2c3 | /task3/Discrete_SAC.py | a1f2f4f007cd08de6ec7fbf7334847894172af62 | [] | no_license | KasperGroesLudvigsen/reinforcement_learning | 24c710a7a25447609618d7a5f1ade22269374ea9 | 557742cd956c157a01865c300b7b082bee0cff7a | refs/heads/main | 2023-04-02T17:30:06.510535 | 2021-04-11T15:56:14 | 2021-04-11T15:56:14 | 340,039,886 | 1 | 1 | null | 2021-04-10T16:48:03 | 2021-02-18T12:15:07 | Python | UTF-8 | Python | false | false | 13,412 | py | Discrete_SAC.py | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 14:09:10 2021
@author: groes
"""
import torch
import task3.networks.q_network as qnet
import torch.nn.functional as F
import task3.networks.policy_network as pi_net
import torch.nn as nn
from copy import deepcopy
import itertools
from torch.optim import Adam
import ra... |
72750d9f786fe747e0dc5d9fbcfbfadd36db088e | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03005/s835376884.py | 2624de614e79381fbd6cbfe07f0bdeebafaea059 | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 283 | py | s835376884.py | # from scipy.sparse import csr_matrix
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()
def resolve():
n,k=map(int,input().split())
if k==1:
print(0)
else:
n-=k
print(n)
resolve() |
436885be1792720a9cdb79e8bd513ae2cd534a38 | 13dec73b2c5f25cb5cf58a0ed67d6a6cfb12acd5 | /Machine Translation Evaluation/BLEU.py | 7f158a1a5767e1f9d98d6b91983b23287f265246 | [] | no_license | xipixiaolianoo/Natural_Language_Processing | 2c47394df94cff1cfee892ccdc62dacca514bb69 | d558af80fddc70694e11ba4120bd7fe8fe6a3bbe | refs/heads/master | 2021-09-10T23:15:59.734290 | 2018-04-04T04:26:23 | 2018-04-04T04:26:23 | 122,374,449 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 6,448 | py | BLEU.py | from nltk.stem.wordnet import WordNetLemmatizer
from nltk import ngrams
import string
import math
from scipy.stats.mstats import gmean
def read_files(data_file, answer_file, X, y):
with open(data_file, 'r') as a:
input1 = a.readline()
count = 0
while len(input1) != 0:
hhr = i... |
02f1eb790fec35f56c15a6b2c0b5bdf8ef907207 | 1fefa58e5ee2287f7d2251050c605b53f5aaf041 | /1.线性回归预测.py | 6bbc9e881a51e71d838b104a272bce64e014c090 | [] | no_license | sadjjk/tensorflow | 5f644ebe63445e50e585974695d81640836da375 | aeed40aa5720f52c6b82d9ab1bc44056e681f449 | refs/heads/master | 2020-04-16T23:47:01.921249 | 2019-02-01T15:44:43 | 2019-02-01T15:44:43 | 166,025,452 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,061 | py | 1.线性回归预测.py | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
x_data = np.linspace(-5,5,100)
y_data = 2 * x_data + 0.5 + np.random.normal(0,1,x_data.shape)
# plt.show()
# 构建线性回归
W = tf.Variable(tf.random_uniform([1],-1.0,1.0))
b = tf.Variable(tf.zeros([1]))
y = W * x_data + b
#定义loss function
lo... |
6ef74061d789c6fa111fddebcd996209c8164330 | 868b2a2de31ef7a18a4211a9536299a1ea0b8e5a | /txGoogle/services/cloudmonitoring_.py | 40d0d3b284412db6b502ba3723aaf5f42fc9d618 | [
"BSD-2-Clause"
] | permissive | runt18/txGoogle | 5e34de534eeb61ef2d411c3bfe4b8eb2d0013a40 | 8625f8fe6ca59c605c49246cc3a70309f1d0a8b6 | refs/heads/master | 2020-02-26T17:22:39.269228 | 2014-11-14T08:15:33 | 2014-11-14T08:15:33 | 56,247,074 | 0 | 1 | null | 2016-04-14T15:04:27 | 2016-04-14T15:04:27 | null | UTF-8 | Python | false | false | 5,831 | py | cloudmonitoring_.py | from txGoogle.googleService import GoogleService
from urllib import quote as urlibQuoteEncode
from txGoogle.googleResource import GoogleResource
class TimeseriesDescriptors(GoogleResource):
def __init__(self, service, conn, *args, **kwargs):
super(TimeseriesDescriptors, self).__init__(service, conn, *args... |
a4f5af460abc34d76eb64e6f409fc9a80df049c3 | 6c6feb21469e204680d8856a6692ecf6e17289d2 | /chapter_10/TIY_10-12.py | 15aa9bb7b0edfa28f683f07e2446ad86a56e23da | [] | no_license | kelvDp/CC_python-crash_course | 1766670cc0a4ede4f79b89f2cce5677189ed14bc | 1f7e8c36bb3da7ca46bcbd1bbfafbe85091d7a11 | refs/heads/master | 2022-12-16T01:46:52.442776 | 2020-09-18T12:50:13 | 2020-09-18T12:50:13 | 277,738,191 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 302 | py | TIY_10-12.py | import json
filename = "fav_nr.json"
try:
with open(filename) as f:
file = json.load(f)
except FileNotFoundError:
fav_nr = input("What is your favorite number?")
with open(filename,"w") as f:
json.dump(fav_nr,f)
else:
print(f"I know your favorite number! It's {file}") |
c3f811c403e52eccb1bbc39b9440e73830bf535e | 036759873151afb62d428f1a0f97fb7fd0c25697 | /exts.py | 81415db9f8f3413bbff02fb51a56f28925b8f533 | [] | no_license | xcc-code/Graduation_design | 160ddbcaf9e468737207ee7b931c5101ca1d3b4d | 714b2e32d980371789e9287b595fe161f8cee38f | refs/heads/master | 2023-04-27T02:10:45.721730 | 2021-05-24T05:46:16 | 2021-05-24T05:46:16 | 370,232,647 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 155 | py | exts.py | #这个文件用来解决循环引用
from flask_sqlalchemy import SQLAlchemy
db=SQLAlchemy() #创建ORM模型
from flask_cache import Cache
cache=Cache()
|
972bd2d773f17a849eaf9597313cf84804b6b6dc | 3938a20947f1f980f7425433e0f672609df86d09 | /counters_timer.py | 6b002e7c40426b6ed61f5dffc9b640b18f5be383 | [] | no_license | Ved-vampir/ceph_perf_counters | 1b8950881512403196572b5484246eb5a5e56c69 | e966bd915ac396d0da67e8855c163fb21373513c | refs/heads/master | 2021-01-25T08:54:33.251606 | 2015-02-12T10:45:20 | 2015-02-12T10:45:20 | 30,365,392 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,257 | py | counters_timer.py | #!/usr/local/bin/python
import time
from contextlib import contextmanager
import perfcollect as PC
class CountersTimer(object):
# perf_counters
# perf_values0 perf_values1
# host
# user
# perf_difference
def __init__(self, perf_counters=None, host="127.0.0.1", user="root"):
self.pe... |
588c8224003a6c8edab54898d13ed29a2e79b12c | c9be3222010cd74e65f9f2e7d6d11d78f91ea892 | /NYTP_Main.py | b4809f2bee4ee246e4275605ff412fd5df7f6cc7 | [] | no_license | luiza177/nytimes_headline_parser | 33e8f5c320df3f2240d54d7323ce11e8e741f44a | f26ddd25cbc65a45ad9d30f2786d95760abd2067 | refs/heads/master | 2020-05-19T14:22:59.729415 | 2019-05-06T15:57:24 | 2019-05-06T15:57:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 858 | py | NYTP_Main.py | import NYTimes_parser
# cd Desktop/"Python project 2"
# python NYTP_Main.py
while True:
user = input("Enter number of titles to analyse, or type 'all': ")
if not user.isdigit():
user = user.lower()
if user == 'all':
num = -1
break
try:
num = int(user)
if num >= 1:
break
except ValueError:
print... |
3b174790549a19150f3d2c9aeac575cd9d7ccf2f | f175e3b3382ed0674681bfe28da0f0887fd54762 | /routes/purchases.py | 777691eceb8f5f6a557989e847b4a32f0b06df2a | [] | no_license | FernandoLGuzman/DB_Project | 7365e7bf0c54cd0a8c172e0131281ec793a59cdc | fbd7c7c6243f21013b61f3b7a06a89e49c31428a | refs/heads/master | 2021-07-13T12:12:18.017076 | 2020-05-15T22:33:16 | 2020-05-15T22:33:16 | 246,142,973 | 0 | 1 | null | 2021-05-06T20:01:36 | 2020-03-09T21:10:50 | Python | UTF-8 | Python | false | false | 891 | py | purchases.py | from flask import Blueprint, request
from handlers.purchaseHandler import PurchaseHandler
purchases = Blueprint('purchases', __name__)
# unsure if methods are correct in routes, just wanted filler, less hardcoding
# GETs should be good, though
@purchases.route('/', methods = ['GET', 'POST'])
def purchase():
if r... |
52f94cd3d480dafbca6a06fdfa9365ef93a77273 | e4d55100250dd73e8eb10af39fc1abb41d67f723 | /Exercise4.py | c86b8b74e6bc82250412f4cdecf5a7d11db78a8a | [
"CC-BY-4.0",
"MIT"
] | permissive | n-sarraf/bootcamp | ad3fb2635d3340615e6d5c2967c09226ce0815f3 | 4f1b47d21e3d39790232d736cfc1f8dfc9f54856 | refs/heads/master | 2020-12-25T04:00:37.373128 | 2016-09-16T04:51:24 | 2016-09-16T04:51:24 | 68,036,339 | 0 | 0 | null | 2016-09-12T18:31:36 | 2016-09-12T18:31:35 | null | UTF-8 | Python | false | false | 5,180 | py | Exercise4.py | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import bootcamp_utils
import numba
rc={'lines.linewidth': 2, 'axes.labelsize': 18, 'axes.titlesize': 18}
sns.set()
# Load data
g_1973 = pd.read_csv('data/grant_1973.csv', comment='#')
g_1975 = pd.read_csv('data/grant_1975.csv'... |
0d82945dd849d9180209211e9bfa08683469d544 | a2756544fa0cc713fdac3333c335d17f8bf2d48f | /canny.py | 130eca218e0b8c9c75d20a21be19071f38e00f48 | [] | no_license | CLDXiang/Canny-Edge-Detection | d0815ba404e86130fb283e82c7cd0786bb1ab21a | 62f98857ba572caf067c71a2faf906e9ae03ebac | refs/heads/master | 2020-11-25T08:59:01.501280 | 2019-12-25T04:20:49 | 2019-12-25T04:20:49 | 228,583,489 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,456 | py | canny.py | from gauss_fileter import gauss_smooth
from sobel import get_gradient_and_direction
from NMS import *
from two_threshold import *
from utils import *
from os import path, mkdir
def canny(img_path, img_name='default', k=2, sigma=1.4, fast_mode=False, auto_threshold=True, ratio=0.05, high=60., low=30.):
'''
Can... |
ce12ab4dee8dfc3327b535a29ffd3b96f5d0ff91 | fbc04b3829744bf5d3bf7050a063531b0b386bc2 | /PyPoll/main.py | 839122808ca1649872a5b3f1653b1650f722f46a | [] | no_license | sdruiz79/python_challenge | 5102521c2aab91e5c465d41139654069ef922bc0 | dee749ed47ef04ed2474fe2d07bb5aa62e8536c7 | refs/heads/main | 2023-06-20T16:29:23.844261 | 2021-07-20T22:34:20 | 2021-07-20T22:34:20 | 387,218,876 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,243 | py | main.py | import csv
with open("Resources/election_data.csv" , "r") as fh:
import csv
csvpath = ("Resources/election_data.csv")
with open(csvpath, newline="") as csvfile:
csv_reader =csv.reader(csvfile, delimiter=",")
csv_headers = next(csv_reader, None)
#print (f"CSV Header: {csv_headers}"
# print headi... |
7083890ef82aea52bc2b5f5951b808274766419f | 2c7f3d16d89fa553fa5e700f345e417015a92b9b | /backend/test/test_match.py | c8f3e9989e9ca87f16983be013b86c12542febe2 | [
"Apache-2.0"
] | permissive | cs130-w21/bruintutor | eff5caf54c387a49b83503eb9e6bfc2eb7d76f7f | ce7234d657a96a0d3b18d3e92f5fe2c2b68b366f | refs/heads/master | 2023-03-22T14:57:23.540741 | 2021-03-07T18:24:54 | 2021-03-07T18:24:54 | 327,813,936 | 1 | 0 | Apache-2.0 | 2021-03-07T18:21:15 | 2021-01-08T06:07:16 | JavaScript | UTF-8 | Python | false | false | 3,298 | py | test_match.py | import json
TUTOR_INFO = {
"fname": "generic",
"lname": "tutor",
"email": "tutor@gmail.com",
"password": "T00t3r",
"isTutor": int(True)
}
STUDENT_INFO = {
"fname": "generic" ,
"lname": "user",
"email": "user@gmail.com",
"password": "Us3r",
"isTutor": int(False)
}
def set_users... |
aa15063eadeb23ce058bc27aa72868eca9f1674c | 62e453c354063a4ed5ecd0a03bab9ab8113ff953 | /Exercicio17.py | f7a140d4d13c43a624ede940f4b7ed13cd7c26a1 | [] | no_license | Pablo-Silva/Exercicios-Python | 61b24009ffe8b8a90eac88911925f14000819dd6 | 89600bad78f5d5e78e2c207f5adb9d423b603fad | refs/heads/master | 2020-03-29T14:36:52.134495 | 2018-09-23T21:14:06 | 2018-09-23T21:14:06 | 150,025,958 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 236 | py | Exercicio17.py | import math
catetoA = float(input('Informe o valor do Cateto A: '))
catetoB = float(input('Informe o valor do Cateto B: '))
hip = math.sqrt((math.pow(catetoA,2)) + (math.pow(catetoB,2)))
print('O valor ta Hipotenusa é {}'.format(hip)) |
37e29c9bb6d65917a41c8fa73eece9d48df81f71 | e9d78bba7b7e3b5d9a7a4e6f5f60dbe9be587d5c | /main.py | cc1696226b06fc291d3d8a4aad7f2ac611667c7a | [] | no_license | patkon2014/stock_scraper | d1505f7f0ad078a0e62ebcd29222ae008e179946 | dddf9a3dec5a0071367da275c4f198458b8a721a | refs/heads/main | 2023-01-19T00:11:42.007600 | 2020-11-29T12:15:19 | 2020-11-29T12:15:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,692 | py | main.py | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time, datetime, json, os
path = r'C:\Users\Adrian\Documents\youtube\video_01\Stock_price\geckodriver.exe'
class StockPrice:
def __init__(self, stock_code):
self.driver = webdriver.Firefox(executable_path=path)
... |
67fef0b5f8ed973777f5affb73173a62df943d18 | 8634dac3f8ee1b0bd929cd53f15324b92e32b0c0 | /Other problems/MergeSort/tests/output/fix.py | 779f3c45aab37b527b3fea7aff044b84253e2ea1 | [] | no_license | juemura/nb_whiteboarding | bc6a0ed7f8601a0180754d45aa11651bdec47a18 | 2c2a13be7c52269344b221bab6b79dbb540c78ea | refs/heads/master | 2020-04-17T12:51:41.231361 | 2019-03-22T07:30:34 | 2019-03-22T07:30:34 | 166,594,464 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 248 | py | fix.py | import sys
import fileinput
# replace all occurrences of 'sit' with 'SIT' and insert a line after the 5th
for line in fileinput.input('out_test11.txt', inplace=1):
sys.stdout.write(line.replace('------', '---\n---')) # replace 'sit' and write |
10cd55cb1375b8cb83d954fc30a52bca423c4d24 | b98bffe3aca4a69d3f3ec0e563fc61042e06e960 | /Playfair2.py | 632be65a44141163939ffc74362c55fe3574794a | [] | no_license | Rony20/Information-Security-Ciphers-and-Modular-Arithmetic | 2ae9898a279b05fb11fd576a660bb6045ad39953 | 17433e4fb5a4ac7c4780df2360e01ea022ae90df | refs/heads/master | 2020-04-21T23:48:11.896951 | 2019-02-11T09:54:26 | 2019-02-11T09:54:26 | 169,957,984 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,032 | py | Playfair2.py | #KEY IS MYCODE
m = [['M','Y','C','O','D'],['E','A','B','F','G'],['H','I','J','K','L'],['N','P','Q','R','S'],['T','U','V','W','X']]
for i in m:
print(i)
def playfair(msg):
msg+='\0'
result=""
P=''
q=''
fi=0;fj=0;si=0;sj=0
k=0
while(k<len(msg)):
p = msg[k]
if p == '\0':
... |
bba395847d6469e1d7e8367c6cfddc1f5419e1f7 | 59d92eb62ff1b49ec0d3f7a1f7bd75fb02b351b3 | /trainingdatabuilder.py | 6868c28037665e3ef4e721cb1b6e9714afaae86f | [] | no_license | oscarsauchelli/CETIIB-research-project- | 48fb58a52d80114276d23a351f70232776084e5f | d7eff87ee976e9e0dedb221070e4f9d04edea9f5 | refs/heads/main | 2023-09-05T18:21:33.071201 | 2021-11-01T15:03:37 | 2021-11-01T15:03:37 | 423,476,501 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,124 | py | trainingdatabuilder.py | import glob
from PIL import Image
import random
import parser
import os
import scipy.ndimage as ndimage
import numpy as np
import pickle
from skimage.measure import compare_ssim
from skimage import io
def blur(src,OTF):
#current code assumes uint8 synthetic one channel OTF
otf_img = Image.open(OTF)
otf ... |
36aaa98839bf0fc585107da8f1292216d057d7a6 | c99480f2292b42798c0ab852ac9b545e597f1eb1 | /SAT/X-Serv-Practica-Aparcamientos/PFinal/aparcamientos/forms.py | 41a5f8c60fe251a8485f1e0ba19746abebcc2781 | [] | no_license | Scarro/Otros | 7995fe82c74c23132a26aeec7f35d0846a54cacb | fb3b70d2f5b4da69684a960efe35de1e0cdcfcf1 | refs/heads/master | 2021-01-20T01:11:05.326771 | 2017-05-26T12:19:44 | 2017-05-26T12:19:44 | 89,231,717 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 453 | py | forms.py | from django import forms
from .models import Comentario
class ComentarioCreateForm(forms.ModelForm):
class Meta:
model = Comentario
fields = ('titulo', 'cuerpo')
labels = {
'titulo': 'Titulo',
'cuerpo': 'Texto'
}
widgets = {
'titulo': ... |
6e0766ec93259c54c446eeced8105ccd2ddb9017 | a6416472184caf3dee3d1a99d7cd36f254d4fea6 | /model_domain.py | b9b5a40ba0bcf4925a0943ca432a5d6022cd0d06 | [] | no_license | ua-snap/atm | 134281d9e63109fbf8aad758beaf1a17c8c0eabd | 8cdbb3a1787039e2a13676857e67d11d328af64b | refs/heads/master | 2021-01-10T02:03:47.852917 | 2017-02-23T01:08:11 | 2017-02-23T01:08:11 | 46,087,993 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 3,785 | py | model_domain.py | import numpy as np
def model_domain(self):
"""
The purpose of this module is to create the model domain at a 1km x 1km
resolution.
A check to make sure all the cohort arrays have the same
dimensions.
"""
print ' Initialize model domain.'
print ' In the model domain - check... |
a59a4cfca19d9e2026cd39f683550c3de2784ae1 | b9bfb169e103263caf906c94cdd0a271eecb990b | /higuchi/.ipynb_checkpoints/utils-checkpoint.py | b8c48f3a5bd6874fd538352e9ab0cf0d225ba396 | [] | no_license | zerebom/team-mynabi | 7bc76be79cb7a7a4d4843d1ba06b3ee246d249ad | 5bfb4d15fed562e14bb93ab803e297208ee1e5d6 | refs/heads/master | 2020-08-13T11:52:00.459839 | 2019-11-08T03:33:56 | 2019-11-08T03:33:56 | 214,963,964 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,143 | py | utils-checkpoint.py | import pandas as pd
from pathlib import Path
def save_data(oof,preds,rmse=20000,name='lgb',submit_dir='./submit',save_dir='./submit'):
'''stacking用にtrain,testの予測値を同じ形で保存する
from pathlib import Path がいる
'''
submit_dir=Path(submit_dir)
submit_path=submit_dir/'sample_submit.csv'
train_id_path=submi... |
3c3643857101612037d84af44719418c113b8a0e | 59aab601cc137b4ec736d2791a749b39be4a5d4e | /sim/axi_workload.py | f49202bedaa9bd99d140783fda99c1562434c438 | [] | no_license | jiankangren/ecrts-2020-ae | 876ac5c6e6ae265d47596b57ddf4ae7cc88f1613 | 960eb8cfcfef56f28510ce0510e61f900aeb7ed7 | refs/heads/master | 2022-07-27T15:14:57.646387 | 2020-05-21T13:14:19 | 2020-05-21T13:14:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,012 | py | axi_workload.py | '''
Artifact evaluation code for the paper:
Francesco Restuccia, Marco Pagani, Alessandro Biondi, Mauro Marinoni, and Giorgio Buttazzo,
"Modeling and Analysis of Bus Contention for Hardware Accelerators in FPGA SoCs",
In Proceedings of the 32nd Euromicro Conference on Real-Time Systems (ECRTS 2020), July 7-10, 2020.
T... |
d045be184d94c7b387007c383eeef9b0d370be8f | c1a74dbcb50ca36e94e686d55d32dca62ce2bca0 | /src/__init__.py | c86778c539f281a57306ee1ffda486c5cbf5a81e | [
"Apache-2.0"
] | permissive | clach04/modjy | 718f95d4e4f50f578e2f6b9baae9d3629201e0ec | 3ff9d1e0cc5bc51389b4d9b8723e9659f5763269 | refs/heads/master | 2020-04-04T00:25:03.905430 | 2018-11-01T02:19:45 | 2018-11-01T02:19:45 | 155,649,225 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 648 | py | __init__.py | ###
#
# Copyright 2004-2008 Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that... |
ce36bcb5934e9556bf0d1ddd04c38b4f53cfccd1 | 88c4d5b462998a9c0411a0243ab95ee05ffee60a | /src/graphql/validation/rules/stream_directive_on_list_field.py | 41ba6066acb1bcd1965445ba23a7f4a703aabd0b | [
"MIT"
] | permissive | graphql-python/graphql-core | 606f3f3d479d576a4bdcd7d7995c0fddc486282f | 0c93b8452eed38d4f800c7e71cf6f3f3758cd1c6 | refs/heads/main | 2023-09-04T09:22:45.162575 | 2023-06-09T22:13:10 | 2023-06-09T22:13:10 | 143,207,933 | 259 | 101 | MIT | 2023-06-09T22:13:11 | 2018-08-01T20:57:07 | Python | UTF-8 | Python | false | false | 1,793 | py | stream_directive_on_list_field.py | from typing import Any, List, cast
from ...error import GraphQLError
from ...language import DirectiveNode, Node
from ...type import GraphQLStreamDirective, is_list_type, is_wrapping_type
from . import ASTValidationRule, ValidationContext
__all__ = ["StreamDirectiveOnListField"]
class StreamDirectiveOnListField(AS... |
4fd5dd9ed98628aed46d9f459853f45dab871dce | 4f712782a533415a5062c5aaf8444ebb13839ff0 | /20201015_2/task_2.py | a6bf185ab84de4fcdf108a554bdbf0c388255034 | [] | no_license | TheGhost8/pythonprac | 607517d2db95959f78396e4654c03aa4099755cc | 6167e7c6803a5e9509dce0742cac8d62bf70f96a | refs/heads/master | 2023-05-04T14:57:42.669597 | 2021-05-17T09:09:33 | 2021-05-17T09:09:33 | 292,591,267 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 481 | py | task_2.py | from random import *
length = (int)(input())
glas = ['А', 'Е', 'Ё', 'И', 'О', 'У', 'Ы', 'Э', 'Ю', 'Я']
sogl = ['Б', 'В', 'Г', 'Д', 'Ж', 'З', 'К', 'Л', 'М', 'Н', 'П', 'Р', 'С', 'Т', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ']
password = ""
while len(password) < length:
slog = ['Г','ГС','СГ'][randint(0,2)]
for i in slog:
if i == '... |
ab2eca189b9275013471ad5a490aed3866161699 | ea0eba616fda9cc196d6582da8cf176ddbf1f58c | /docs/source/create_python_examples.py | 14345301e185a75e981950a3e6cc4de914c00d30 | [
"MIT"
] | permissive | OPM/ResInsight-UserDocumentation | 1a4d71619dec777b0c04eb58362479d436338eba | bb95bffb61f51c27ad1c160e8862e9c02ba46608 | refs/heads/next-major-release | 2023-07-27T17:30:57.345096 | 2023-07-07T13:02:56 | 2023-07-07T13:02:59 | 194,052,760 | 2 | 2 | MIT | 2023-06-09T12:33:53 | 2019-06-27T08:15:49 | CSS | UTF-8 | Python | false | false | 1,130 | py | create_python_examples.py | from os import listdir
# This script is used to create a RST file for all Python examples
# Content of the file 'PythonExamples.rst' will be overwritten
# The script will create a title from the file name, and add a reference to the source code using literalinclude
path_examples = "../rips/PythonExamples"
file_names ... |
0158b466b46670501506ab05320912f00cfcd891 | 3d6cc0c8bed185016b2942ad94f10b9ba182d467 | /new_model.py | ec466ccacb38bc20acbad29a2da3a55674705251 | [] | no_license | Hernandope/keras_resnet_FPN_cifar10 | bc343aa5a9e45359d3d58bcfff7782e2fb932ac1 | 36dfa770ebc2520f6e36765cc61ff3e391ee5a39 | refs/heads/master | 2022-12-24T03:47:46.081106 | 2020-09-22T18:07:25 | 2020-09-22T18:07:25 | 297,724,968 | 3 | 2 | null | null | null | null | UTF-8 | Python | false | false | 4,556 | py | new_model.py | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import datasets, layers, models, applications
def get_backbone_ResNet50(input_shape):
"""Builds ResNet50 with pre-trained imagenet weights"""
backbone = keras.applications.ResNet50(
include_top=False, input_shape=input_shape
... |
9a510822f1153a3bd7b4507f2b77df07cf5bb4ba | f8aa19ad8b0643f79c8a9cd944b729179aa3d7ca | /rollbar_udp_agent/rollbar_udp_agent.py | d38b17f390cf93c4c3dd75fbe15643b25bec659a | [
"MIT"
] | permissive | lrascao/rollbar-udp-agent | 26b096d7e80f5481c815395874f9d48a8cd04e39 | 51c698837e5141bff5fef3e20afe7301c3ecdf27 | refs/heads/master | 2021-01-10T07:38:11.133705 | 2015-05-27T09:47:55 | 2015-05-27T09:47:55 | 36,145,650 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,174 | py | rollbar_udp_agent.py | """
A Python Rollbar udp agent
"""
import logging
import os
import sys
import optparse
import threading
import signal
import socket
import select
import Queue
import re
import ConfigParser
# 3rd party
import requests
import json
from daemon import Daemon, Supervisor
from util import PidFile
os.umask(022)
# CONSTAN... |
cf716638c86c1526f4cbbe0c50d8bff914516ee2 | 66634946aec18840c00b0e568c41faf3e9f473e7 | /Level1/Lessons1845/yang_1834.py | 1b432895027211b62a59bd4210b744e699e90333 | [
"MIT"
] | permissive | StudyForCoding/ProgrammersLevel | 0525521b26ad73dcc1fe58a1b2f303b613c3a2f6 | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | refs/heads/main | 2023-08-14T23:15:53.108351 | 2021-10-05T16:04:32 | 2021-10-05T16:04:32 | 354,728,963 | 0 | 1 | MIT | 2021-10-05T16:04:33 | 2021-04-05T05:26:25 | Python | UTF-8 | Python | false | false | 1,027 | py | yang_1834.py | # 폰켓몬
def solution(nums):
half = len(nums)/2
nums = list(set(nums))
diff = len(nums)
if half >= diff:
return int(diff)
else:
return int(half)
# 테스트 1 〉 통과 (0.01ms, 10.2MB)
# 테스트 2 〉 통과 (0.01ms, 10.1MB)
# 테스트 3 〉 통과 (0.01ms, 10.2MB)
# 테스트 4 〉 통과 (0.01ms, 10.2MB)
# 테스트 5 〉 통과 (0.01ms, 10.... |
908ef82c222fee778480a425ee88e563804ae878 | 139af68b78734a6bc53bd942ffa05476baf3d71d | /Python Advanced 2021/COMPREHENSION/Exercise 08 ver 2.py | 936c21a5c5dcf5faf1a2419675fb479f36c7686b | [] | no_license | MiroVatov/Python-SoftUni | 7fe3fc0a3928848c5317fb120f789c773bfc117e | 0d0d6f116281b4de8c413d254386e27d992d047b | refs/heads/main | 2023-08-24T09:44:31.261137 | 2021-10-18T14:04:03 | 2021-10-18T14:04:03 | 317,510,574 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 428 | py | Exercise 08 ver 2.py | items_dict = {name: {} for name in input().split(', ')}
while True:
command = input()
if command == 'End':
break
data = command.split('-')
name = data[0]
item = data[1]
cost = int(data[2])
if item not in items_dict[name]:
items_dict[name][item] = cost
[print(... |
3def4d867dbbc05b1b1a3299a70bc23a68316f53 | 3d431b59126ea9db43ece0e5400755844d1686a4 | /modellingMEA.py | 37919141a54cf5ecd35687ad432c5d5789167c09 | [] | no_license | torbjone/MEA_binder | ded975fc8154d56b956e0c4f9594f3ca027f73b3 | d29485f38f90c64d87ea59dadfcacd4dd0842810 | refs/heads/master | 2021-01-01T05:29:10.447167 | 2016-04-26T10:26:49 | 2016-04-26T10:26:49 | 57,115,865 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 12,088 | py | modellingMEA.py | #!/usr/bin/env python
'''
Cortical pyramidal cell model from Almog and Korngreen (2014) J Neurosci 34:1 182-196
This file is only supplimentary to the Ipython Notebook file index.ipynb
'''
import sys, os
import numpy as np
import pylab as plt
import neuron
import LFPy
from vimeapy import MoI
# Disable
def blockPrint... |
39d6fc7827669cad550539961cd82df52fd63f38 | 29578774925785f7b286065830f5c8c2ae539a54 | /translater_game.py | d75849a0a2c7a0c49bd5b0c50e720b767070b6e3 | [] | no_license | dimavdp/translater_game | f2f7dd37b9f5b3e4e44b7a7fa372910efc238307 | eeab62410e44cd1530beed09f9f219739a8e1ddc | refs/heads/master | 2020-04-22T09:27:08.600355 | 2019-02-12T07:26:30 | 2019-02-12T07:26:30 | 170,272,529 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,849 | py | translater_game.py | from __future__ import print_function, unicode_literals
import os
import time
from random import shuffle
from pyfiglet import Figlet
from colorama import init, Fore, Back, Style
from pprint import pprint
from PyInquirer import style_from_dict, Token, prompt
from PyInquirer import Validator, ValidationError
f = Figlet... |
3a9d098a9dd206d2ad500822490377aa378b5b1a | cdc2833e0f9bd99392159dbef90475ab64b439f9 | /programs/modules/unit_mask.py | fbdf2cc52181f34f01b6e5ec1c5def43b3e9e4fc | [] | no_license | TobbysGitHub/PAN_vision | 2760c4e184613b0c9897f5e8a1947109b0acc0dd | 8a86225637f8d01feb30459f07190d32237f8474 | refs/heads/master | 2022-10-13T23:33:10.186135 | 2020-06-10T13:17:49 | 2020-06-10T13:17:49 | 268,181,453 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 634 | py | unit_mask.py | import torch
from torch import nn
class UnitMask(nn.Module):
def __init__(self, mask_p):
super().__init__()
self.drop_p = mask_p
def forward(self, x):
"""
:param x: s_b * n_u
:return: s_b * n_u
"""
batch_size, num_unit = x.shape
mask = torch.ra... |
694bf1e9735e75acbe68ba171a3a67e88e35fec0 | 199ad938261bb0549e43ec43c92ebdf0c915071f | /variation6/stats/diversity.py | 82964d6300b28b9b9e914c865990096d7026a311 | [] | no_license | pziarsolo/variation6 | 71492eb8f9a7e4335d0fb170064e131a40c9b6fe | f07b23743beea3349fd5b7d4b9f4f26da8a17713 | refs/heads/master | 2020-08-29T15:44:03.909890 | 2020-06-12T09:35:21 | 2020-06-12T09:35:21 | 218,078,637 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 13,345 | py | diversity.py | import numpy
import variation6.array as va
from variation6 import (GT_FIELD, MISSING_GT, AO_FIELD, MISSING_INT,
RO_FIELD, DP_FIELD, EmptyVariationsError,
MIN_NUM_GENOTYPES_FOR_POP_STAT,
ALT_FIELD, AD_FIELD)
from variation6.plot import plot_histog... |
82c4bd2ccb3e17a18d234b77120af104d6d248c2 | be5c7f49096c349a6fb68137f92d379c62b77dbe | /components/KML_to_Shapefile/KML_to_Shapefile.py | 038c3c93f776b7e68324cb7549d58b2e72acddaf | [] | no_license | jmcarrillog/machine-learning-workflow-for-carbon-assessment | 52a6b8b7fefd8c4c96d3c0ac75b763468e768f30 | 7b3204f8055c57431d8caa95e4515e8bcd355b86 | refs/heads/master | 2020-11-30T05:30:56.594732 | 2019-12-28T16:59:42 | 2019-12-28T16:59:42 | 230,316,730 | 2 | 0 | null | 2019-12-28T16:59:43 | 2019-12-26T19:24:45 | Python | UTF-8 | Python | false | false | 3,772 | py | KML_to_Shapefile.py | import os
import sys
from osgeo import ogr, osr
from zipfile import ZipFile
from os.path import isfile, join
def main():
# input (KML file)
in_file = sys.argv[1]
# parameters (epsg codes)
in_epsg = int(sys.argv[2])
# output (zip file)
out_file = sys.argv[3]
# prepare output shapefile name... |
aee316bcd2378d9c8fd14076dc5094456e265f9b | 3386002f960b70a8c381dbe4e8282d6b3c70fb3e | /iic2343/errors.py | c71117d67d5497aee3fb94d1b93535ccc101c1d1 | [
"MIT"
] | permissive | daleal/iic2343 | fc921f7ccfab143b2bde67203911b64d1269470b | ded3c035e77690e6881a82679d75775452d002e3 | refs/heads/master | 2023-08-15T07:50:38.459680 | 2021-09-16T04:41:35 | 2021-09-16T04:41:35 | 406,941,455 | 4 | 1 | MIT | 2021-09-16T04:41:35 | 2021-09-15T22:28:35 | Python | UTF-8 | Python | false | false | 554 | py | errors.py | """Module used to hold potential errors present on the client code."""
class BaseIIC2343Error(Exception):
"""
A base error class to be able to handle every error thrown by the
library at the same time.
"""
class CannotOpenPortError(BaseIIC2343Error):
"""Error for when a port cannot be opened."""... |
212bf83ee3a2360702d1f5daf2e39c5eea650b78 | b61725b5a9db22609074def3acb130d98f808da5 | /species.py | 1042f25e736f78c72b0e8fc11eb0ba3059f16c1e | [] | no_license | theoprovost/merge_code_as_a_team | d5c4c12c810f2b42caa85fbbfc4210729ab97369 | e89b05177329d5a4a1d5b533cd2aff4dfef73741 | refs/heads/master | 2023-07-02T14:30:15.958815 | 2021-08-09T13:46:28 | 2021-08-09T13:46:28 | 390,714,600 | 0 | 0 | null | 2021-08-11T06:57:01 | 2021-07-29T12:20:14 | Python | UTF-8 | Python | false | false | 1,244 | py | species.py | #!/usr/bin/env python
# coding: utf-8
# In[35]:
import requests
import pandas as pd
# In[44]:
uri = 'https://swapi.dev/api/species/'
# In[158]:
nspecies = 37
# In[162]:
data = []
for i in range(1,nspecies):
res = requests.get(f"{uri}/{str(i)}")
if res.status_code == 200:
data.append(res... |
00932e1dd2fa995a52c3c8092786f3af30794ada | a54d94f596b128f7d95dcbe68f251ff4aa7bc233 | /mliber_widgets/category_widget/category_widget.py | cc0a468180b50384d72e4d1eb7ca0d2b04445df3 | [] | no_license | githeshuai/mliber | 477433ad580f31dbeabd3c099669b8c575b7c854 | 5fdc4e308191345149b902c5913e2698336630ea | refs/heads/master | 2023-03-09T17:43:51.018584 | 2021-02-26T03:00:05 | 2021-02-26T03:00:05 | 331,487,121 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,547 | py | category_widget.py | # -*- coding:utf-8 -*-
from Qt.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QAction, QMenu
from Qt.QtCore import Qt
from mliber_widgets.category_widget.category_tree import CategoryTree
from mliber_qt_components.search_line_edit import SearchLineEdit
from mliber_qt_components.toolbutton import ToolB... |
28fbf2f485b08d0725985593f99c6cb300e4e397 | 59315c64189c563b11857ccf5fdfed4e94e94a37 | /xicam/SAXS/processing/linecut.py | a935a10f6f050f976711a9681fe21d4b19bd0a62 | [] | no_license | Richardk2n/Xi-cam.SAXS | f0a14e9f172261e2d530b1b814e4997ff84b30cc | e9962e89ff302dab405074168af2f1cb4776265c | refs/heads/master | 2020-07-14T02:25:50.567766 | 2019-09-06T20:04:05 | 2019-09-06T20:04:05 | 205,212,927 | 0 | 0 | null | 2019-08-29T17:09:52 | 2019-08-29T17:09:51 | null | UTF-8 | Python | false | false | 2,147 | py | linecut.py | from xicam.plugins import ProcessingPlugin, Input, Output, PlotHint
import numpy as np
from pyFAI import AzimuthalIntegrator, units
class LinecutPlugin(ProcessingPlugin):
name = 'Linecut'
coordinate = Input(description='Coordinate of the cut', type = int, default = 0)
parallelAxis = Input(description='Axi... |
b10ffacf1157957ac13e263aaab89cc3ead56381 | 48de5262a4e6ef5480e5597805e2b347f0555609 | /loadData.py | 0482e7a43c24919cd749355082418333616e5c79 | [] | no_license | zhoutengteng/regressionTree | 30361948a62052524843cc9548a202e849de34a0 | 833dec9ebc6c8ef7c50d182a700f1be70139ac56 | refs/heads/master | 2021-01-01T05:19:37.008476 | 2016-05-14T11:45:00 | 2016-05-14T11:45:00 | 58,627,859 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,231 | py | loadData.py | import random
import numpy as np
def produceData():
data = 300
list = []
label1 = map(lambda value: (value, random.randint(1, data), 1), map(lambda value: random.randint(1, data), range(0, data)))
label2 = map(lambda value: (value, random.randint(1, data), 2), map(lambda value: -1 * random.randint(1, d... |
f7b16383e9ad8535c26b43da26dd29b7c97f1ea2 | d3312951d262496ddf7bd86ccbf2879cba990fbf | /image_pipeline.py | 25aa15d576cc63a7e66e157d8efd6e496d4247a5 | [] | no_license | nschoonbroodt/CarND-Vehicle-Detection | 6ea243b97ba7ef2e88d514f96dda6d15b7a0adec | 499c393b9dae203ae1ba64ca22e406d1ac9ac517 | refs/heads/master | 2021-01-19T12:53:05.703142 | 2017-04-18T16:41:15 | 2017-04-18T16:41:15 | 88,054,843 | 0 | 0 | null | 2017-04-12T13:27:40 | 2017-04-12T13:27:39 | null | UTF-8 | Python | false | false | 2,619 | py | image_pipeline.py | """Detects cars in a single image."""
import pickle
from feature_extraction import generate_features_sliding
import matplotlib.pyplot as plt
import glob
import numpy as np
import cv2
from scipy.ndimage.measurements import label
import os
def find_and_draw(img, feature_def, window_definitions, clf):
"""Identi... |
af63ba58462783ee40edeecc019820dbbc58de0a | d2462d725a6e1803430e5230318da51d111e66fd | /LinkedIn Training/Exercise Files/Ch04/04_10/begin/postgres-stored-proc-workspace/sqlalchemycore-storedproc.py | b2cd04b9e7cf3ad87c19d6496b43492ae7eee206 | [] | no_license | dbaprgc/WORK | 85323e6161ba9ab5852b95a94ffcc021b6093aef | 49844c1519ef7b9425b30c7f2ccb4e266fdd92fa | refs/heads/main | 2023-04-15T08:45:27.416115 | 2021-05-05T00:33:36 | 2021-05-05T00:33:36 | 364,029,360 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 284 | py | sqlalchemycore-storedproc.py | from sqlalchemy import create_engine
from sqlalchemy import Table, MetaData
engine = create_engine('postgres://postgres:password@localhost/red30')
with engine.connect() as connection:
meta = MetaData(engine)
sales_table = Table('sales', meta, autoload=True, autoload_with=engine)
|
ca0e4de46915f774c2d6026246b1e9c34794571a | e6b3df4310864f8d77a2954d0c340d09293f2b57 | /photo_dash_sds011/base.py | 23177fb228a4efb6b08e8532ede74ecfe6a3e77f | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | cj-wong/photo-dash-sds011 | 5ff358dbcc43b51625d2fc496fa415125c84c779 | 9aed9b802af7bce64ebab49181b282be25f33056 | refs/heads/master | 2023-06-18T00:19:27.487710 | 2021-07-15T04:08:29 | 2021-07-15T04:08:29 | 307,252,193 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,278 | py | base.py | from datetime import timedelta
from time import sleep
import pendulum
import requests
from photo_dash_sds011 import config
_REQUEST_ERRS = (
requests.exceptions.ConnectionError,
requests.exceptions.HTTPError,
)
class BaseModule:
"""Base module for all photo-dash modules."""
def __init__(self)... |
dd8ce86d1a8c39f33afdfbc607a33dbb087bbb26 | 5c932dc59b8369c5a074363d892364dc13bceedd | /tests/test_pygeohydro.py | 530a93dbb1b7532a782cd4c7fa3c436a111aa1f5 | [
"MIT"
] | permissive | hyriver/pygeohydro | 2a2e206e55f980bd4689f0b87d13b1915e63871d | c44bb3a102f9f1e7df5e6d896cb4e4ddb3c7c008 | refs/heads/main | 2023-08-31T17:37:50.482127 | 2023-08-28T21:27:14 | 2023-08-28T21:27:14 | 237,573,928 | 12 | 6 | NOASSERTION | 2023-09-04T15:59:47 | 2020-02-01T06:37:12 | Python | UTF-8 | Python | false | false | 29,522 | py | test_pygeohydro.py | """Tests for PyGeoHydro package."""
import io
import shutil
import geopandas as gpd
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from pyproj import CRS
from pyproj.exceptions import CRSError
from shapely.geometry import Polygon
import pygeohydro as gh
from pygeohydro import NID, NWIS, WBD
... |
28d66515a084309bc15b52489814316e2a42682e | 4da9c19d9839c670fda30a45a7e223da624eee4a | /Codechef Problem solutions/CHFPARTY.py | 550f7232e389ce9cddb3ed71bd3d09f9c473fb3d | [] | no_license | JineshKamdar98/Codchef-Problem-Solutions | 3e1737669cc0657ccc224e06f800b587130f5787 | 4447679aa3fb45a2d57f93bf3f724f6223049506 | refs/heads/master | 2020-05-05T06:38:10.306619 | 2019-04-06T06:16:10 | 2019-04-06T06:16:10 | 179,795,902 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 266 | py | CHFPARTY.py | for t in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
a.sort()
total=0
count=0
for i in a:
#print(total,count,i)
if(total>=i):
count+=1
total+=1
print(count)
|
b83d710881f793495f4188d8b422a01168ce134b | 9ffe3fb797a9b61d0a26d8252da31fb8d0003300 | /bash.py | d3efea5fa7eebe410786ac7708a4e4ce46e87559 | [] | no_license | arvidjohansen/unixemulator | a6b6b4f1beb731b76ba3248e7cc8498ef67fffab | e309f2535a19a0957e4370c6c2231078777feb3e | refs/heads/master | 2023-03-28T05:49:25.241508 | 2021-03-31T04:56:50 | 2021-03-31T04:56:50 | 351,889,829 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,888 | py | bash.py | #*encoding: utf-8
import os
import shutil
import sys
import types
from getpass import getuser
from socket import gethostname
from varinfo import *
DEBUG = False
settings = {
'smallcwd' : True #changes the cwd to only the last dir
}
apptranslate = {
'nano':'notepad',
}
def ls(path=None):
"""List files an... |
8d34b3c58c99b57eaaec44b0cd25467d0a71cb73 | 2b967a9934fa628add830976533b94d415dfaf99 | /SiteBlog/admin.py | 5ade9d847511e91d9663844394f03bfee82789c9 | [] | no_license | AthmanZiri/DjangoWebApp | 749d1ca1ce6d8c7add5ea7896e3c79c7c8273911 | a2503acef21cc442f4287638a10c06336e8403b0 | refs/heads/master | 2020-07-27T13:15:48.903139 | 2016-11-10T22:51:43 | 2016-11-10T22:51:43 | 73,427,713 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 217 | py | admin.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib import admin
from django import forms
from SiteBlog.models import Post
admin.site.register(Post)
|
ac63022a84cf96bda2f55b1a5bc4289e70cebd48 | eb6046ef5b595f5d585ea78b96dd101ff8da5065 | /GuoAssignments/SquareRoots/Squareroot.py | 147bd1a586270e02d37fa86a217a9715ff05efe3 | [] | no_license | KevinZWong/Kevin2 | 56229f148913d626f4a6fb4a5e12cb529b98503f | fc4425132bceaa8a3a48ef773fe7350e6195e346 | refs/heads/master | 2020-06-24T08:02:27.924811 | 2020-04-03T20:21:18 | 2020-04-03T20:21:18 | 198,905,693 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 233 | py | Squareroot.py | #Takes an input and finds the squareroot
import math
def squareroot(var1, ans):
ans = math.sqrt(var1)
print(ans)
# Usage:
print('Please enter a number: ')
var1 = int(input())
ans = 1
# to call function:
squareroot(var1, ans)
|
75c57283e839458899b779b47651dcb6573a4174 | 49c77c869e83c9116eb57b9ed392f2841c11ac7d | /tests/challenges/test_linked_list.py | 718e6b94ef302a663466af39399bb93e8e2d5d72 | [] | no_license | sallytareq/data-structures-and-algorithms-python | d072d6245b7bea5cbb7df8889c5e3bb03319fac3 | 61d392636b4e6ab1845dba8ca7e3b781498a9dfd | refs/heads/main | 2023-02-21T21:20:59.558102 | 2021-01-26T17:37:01 | 2021-01-26T17:37:01 | 316,985,708 | 1 | 1 | null | 2021-01-26T17:56:22 | 2020-11-29T15:48:33 | Python | UTF-8 | Python | false | false | 5,137 | py | test_linked_list.py | """
Challenge - 05:
Write tests to prove the following functionality:
- Can successfully instantiate an empty linked list
- Can properly insert into the linked list
- The head property will properly point to the first node in the linked list
- Can properly insert multiple nodes into ... |
e407dcfcd05842ad7c96f4a224325cca4236fe81 | d47d853a4f3c20fa7f18cec4fe6a51685f250d34 | /orders/migrations/0011_auto_20200530_2229.py | 8b75a1f8736ba4136298e6f28f35a3881174f048 | [] | no_license | aircode610/project3 | 63732ce7f73b28ce25eb966d2c85bbf46cfd4ec0 | 25b0c55c26fe9df954308751b4e99fe1ecc6e729 | refs/heads/master | 2023-05-27T12:34:38.366472 | 2020-06-07T07:57:35 | 2020-06-07T07:57:35 | 262,758,606 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 507 | py | 0011_auto_20200530_2229.py | # Generated by Django 3.0.6 on 2020-05-30 17:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0010_auto_20200528_1003'),
]
operations = [
migrations.AddField(
model_name='food',
name='toppings',
... |
7cf71bc4949ef4a188dbf0eaf6f56176260e08da | 970b63a4dbd4fdbc3135370c26def18889f8564c | /python/process_history_data.py | a5d100e08d9e4fdb981a1873b8eed04340ea4c90 | [] | no_license | HaoyangLee/kddcup2018-of-fresh-air | 8caa4ca3583041d6fd7046c8ecfc049a71ab1db3 | 444ea50f8d1c9f7794a0e4fb3b9c0db8c09b1204 | refs/heads/master | 2020-04-07T03:02:38.100980 | 2018-05-31T16:02:38 | 2018-05-31T16:02:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,842 | py | process_history_data.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Ren Zhang @ ryanzjlib dot gmail dot com
import pandas as pd
from util import download_aq_data, normalize_datetime, get_date, fwbwmean_impute
from constants import AQ_COL_NAMES
bj_his_1 = pd.read_csv('../input/beijing_17_18_aq.csv', parse_dates=['utc_time'])
bj_his_2 = pd... |
4ee6f08cc989ad1279ab871005a8ba5a3e9d4e8e | 9492e1d296c88fea85628fb182290ec3a1c95268 | /brainstorm/migrations/0004_auto_20180105_1720.py | 2f470639f9ae9836ab9ea530c7ef1411157d2dd0 | [] | no_license | pycoderli/quiz | 691908169c79fc88cae9beb6c5acc3abf46ebfcc | 62dd12983ac1f0fb74d434bd576beb2e0140f08a | refs/heads/master | 2020-03-20T01:33:22.692374 | 2018-06-12T14:03:53 | 2018-06-12T14:03:53 | 137,080,196 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 522 | py | 0004_auto_20180105_1720.py | # Generated by Django 2.0 on 2018-01-05 11:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('brainstorm', '0003_level_pic'),
]
operations = [
migrations.AlterField(
model_name='level',
name='ans',
fi... |
645bf4b5b5f867cfba17558b69a9a9bbb97aed5e | 03d4e53c057b6f95bade652ecabffb96227e9f42 | /Basic_Data_Types/finding_the_percentage.py | 8b446ea5f5eff5fdb2058a39cb56543263e77891 | [] | no_license | akik22/hackerRank | 04f69dda6782c82163df20cf5565e6d2476c7276 | 08a999b0323ef376b6620667eee317ef82752b0f | refs/heads/master | 2021-08-16T00:45:07.407628 | 2017-11-18T17:55:33 | 2017-11-18T17:55:33 | 110,553,469 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 277 | py | finding_the_percentage.py | #!/usr/bin/python3
student_info = dict()
for _ in range(int(input())):
name, *number = input().split()
number = tuple(map(float,number))
student_info[name]=number
student_query = student_info[input()]
print('{:.2f}'.format(sum(student_query)/len(student_query))) |
c1f1626b5e10f15f625b4e0c722012d9c1bd74cd | 4c8fc9ba23bce20573101cc97a237f73b6d236d1 | /opencc with GUI-V1.0.py | db8f843767ad64787dbaad1b1d4756428aadb247 | [
"MIT"
] | permissive | WimHan/opencc-with-GUI | 9b17b1b1fe4f917769c63c72601fce5b01ff45b5 | 3ed602fc7388f687818354864362987bdc96d178 | refs/heads/master | 2021-07-19T21:23:24.777544 | 2021-02-02T19:09:38 | 2021-02-02T19:09:38 | 238,391,140 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,840 | py | opencc with GUI-V1.0.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# written by Wim Han
"""
* 1. GUI added
* 2. only convert UTF-8 plain text files (.txt, .srt, .ass, subtitle files) to chs & cht by using opencc@byvoid
* 3. run in Python 3 under windows 10, not ubuntu
* 4. download python 3: https://www.python.org/downloads/
... |
23d8843c1c1f1dd7cd6b2e7c08332b94983836f9 | eaf792e94c14628f6a3720cd4daa1d0430612864 | /tasktwo.py | cd92b48ce319c8450812687df3bff1de33295677 | [
"MIT"
] | permissive | inwk6312fall2018/programmingtask2-sushmithaabdullapur | 1ba51b79dec4257cae914ea4c234a8c3e8684386 | d287090988db45842968b675b6e3cb161b469008 | refs/heads/master | 2020-03-30T17:53:18.717803 | 2018-10-04T21:47:28 | 2018-10-04T21:47:28 | 151,473,932 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,713 | py | tasktwo.py | #import string module to use string.punctuation method'
import string
#creating five list to append the values and count the values.
list1=[]
list2=[]
list3=[]
list4=[]
list5=[]
#creating the file in reading mode
with open("Crime.csv",'r') as fin:
#for loop is used for traverse the words
for line in fin:
#strip metho... |
3bfc074e9f8de9f22b0bfe84c47ded7b6d3a432d | 617f21b2385f5c2ec8ca8d319bd6091ef2ddd83c | /assignments/ling_570_h1_english_tokenizer/hw1_tok.py | e9b11606eff7075022c19b13d375e7f166e4f8d8 | [] | no_license | zepam/uw_nlt_ling570_shallow_nlp | d62603faf1c2b916607aa39b9e4f469071e01327 | 6005bda59d16ca8986cf0cef9b2b97fa109907ef | refs/heads/master | 2022-04-08T17:09:45.314678 | 2020-01-15T18:29:45 | 2020-01-15T18:29:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,975 | py | hw1_tok.py | #!/usr/bin/python
"""#### LING 570: Homework #1 - Ryan Timbrook ############
English Tokenizer
Author: Ryan Timbrook
Date: 10/4/2018
INPUT FILE COMMAND ARG: ex2
INPUT FILE COMMAND ARG: abbrev_list
OUTPUT FILE COMMAND ARG: ex2.tok
"""
import os, sys, re, collections
#Local Test
isTest = False
isLocal = False
e... |
5002b01294c5602aa65d216bcc25506cbdfce928 | 66d0ac4faa54426f2d113f2bca140cd177dcbabc | /model.py | 22a588aa9a43f307af99c2eaf27509bee71ad5b4 | [] | no_license | xbbu/bing_20180816 | caf4133049aebf9c7bb3aa69b6a4eb8208455d28 | 5cf2ccc4fc9c2a7c9bec8276347166237c735bff | refs/heads/master | 2020-07-05T19:53:28.562235 | 2019-08-16T17:42:18 | 2019-08-16T17:42:18 | 202,755,753 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,615 | py | model.py | """
Build model to predict probability for top 25 car makes
"""
import pandas as pd
import requests
import time
import math
from scipy.stats import chi2_contingency, chi2
import re
from sklearn.preprocessing import OrdinalEncoder, OneHotEncoder, LabelEncoder
from sklearn.feature_selection import f_classif, mutual_info_... |
48abc95ad3179a2668a07923c79b645e1f158fcc | 743da2017617b5c9b1b36e3e5cfa67960dbaf78e | /ecg_autoencoder.py | f88d26a06f8ed1b9a5e15ddc4b6b927f2fd0e25e | [] | no_license | Ach113/Kaggle-heartbeat | a8ef37e5d32dd0712fb420cad3407afde68dd527 | 74564e750110c82b5a3813d2aa747a1f8dfd5682 | refs/heads/master | 2021-01-03T21:08:25.263916 | 2020-03-01T14:06:58 | 2020-03-01T14:06:58 | 240,236,750 | 0 | 0 | null | 2020-02-29T18:44:43 | 2020-02-13T10:45:19 | Python | UTF-8 | Python | false | false | 2,355 | py | ecg_autoencoder.py | # -*- coding: utf-8 -*-
import numpy as np
import wfdb, random
from tensorflow.keras.layers import Input, Conv1D, MaxPooling1D, UpSampling1D
from tensorflow.keras import Model
from tensorflow.keras.optimizers import RMSprop
import tensorflow.keras as keras
import matplotlib.pyplot as plt
def plot_result... |
f099b2f6703bc6155754f3b94f7beba45d7568e8 | 458873dcd530591e9c738cb84bc5c923bf324153 | /networks/omicnet.py | 1e32551106f34f0e6e52297e86cfbada25681450 | [
"BSD-2-Clause-Patent"
] | permissive | dhimmel/serg-pycode | d6206e09b3f0e1f2751b58ba53ded54cf2779df8 | 075de0ba470e4fbda5e33dfc23cb9ecd86ec53b7 | refs/heads/main | 2022-12-29T04:16:52.698397 | 2020-10-17T15:59:11 | 2020-10-17T17:17:47 | 304,333,967 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,557 | py | omicnet.py | import os
from neo4j_graph import Graph
import hgnc
import umls
import drugbank
import metamap
import gwas_catalog
import nature_predict
import frimp
import omictools
class OmicNet(Graph):
node_kinds = ['drug', 'disease', 'gene']
rel_kinds = ['disease2gene_gwas', 'disease2gene_expr', 'drug2gene_target',
... |
3f46be960d2b9b1dbbf2196a05bfac2180e05686 | 32712bbd3be1d0ba25f690e394485c873cfae7ae | /python_football/team.py | adb23d3dc953c3a5982ae642c005b12535fe5147 | [] | no_license | gvpeek/python_football | c11b8d5540b30565f6d828e904895fccd380422b | c2e03751f09a52b52a27b13b7790fb7b753f0200 | refs/heads/master | 2020-02-26T13:58:46.992160 | 2015-01-07T06:38:50 | 2015-01-07T06:38:50 | 27,281,754 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,922 | py | team.py | '''
Created on Mar 30, 2013
@author: George
'''
from random import randint, shuffle
from playbook import Playbook
from stats import StatBook
from coach import Coach
global team_id
team_id = 0
class Team():
"Team"
def __init__(self,
city,
nickname,
... |
e53da77c2611136b37b67aa61c0cc61d2055d1c3 | a8ab7ee13371b4535c3b34bb639948facb7a33f8 | /week16/ML/preprocessing.py | ed56818f65b29fd780ddfa60eac7614a039a46f3 | [] | no_license | sogoodnow/python-study | f31c1a141b0f77c043c1886abe5dcbb5f5c71d11 | a4aad72a7ea2e6c9dea670e1b7607aecf53f80fa | refs/heads/master | 2021-04-09T09:01:02.428692 | 2019-02-20T09:15:35 | 2019-02-20T09:15:35 | 125,389,672 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 671 | py | preprocessing.py | import numpy as np
class StandardScaler:
def __init__(self):
self.mean_ = None
self.scale_ = None
def fit(self, X):
self.mean_ = np.mean(X, axis=0)
self.scale_ = np.std(X, axis=0)
return self
def transform(self,X):
assert self.mean_ is not None,"均值不能为none... |
f7e1656b68e41707282caae3324c9d8eb8c7c310 | 8f40748893242df3bdc5e9055efd051148c0dbf1 | /Project2_Day2_Tip_Calculator/tip_calculator_project.py | 5031d126e78628cf33cf695a6e8281900e1b6607 | [
"Apache-2.0"
] | permissive | ariv14/python | 1ba8cfcabce57b6474d54c4c0916ddc5b6bd5c64 | 6a649d19669a3952aa55509754a91afebe215066 | refs/heads/main | 2023-08-28T02:39:53.655986 | 2021-10-05T23:17:26 | 2021-10-05T23:17:26 | 404,797,390 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 743 | py | tip_calculator_project.py | # If the bill was $150.00, split between 5 people, with 12% tip.
# Each person should pay (150.00 / 5) * 1.12 = 33.6
# Format the result to 2 decimal places = 33.60
print("Welcome to tip calculator !")
bill = float(input("What was the bill amount : "))
persons = int(input("What is the number of persons : "))
tip_percen... |
794585d4b2a50b1e091a7ff5a8b88122810d7e8e | b11153adc2563c92f022c910e273447a62f184b1 | /valgrind_parser/utils/decorators.py | d6e74541c5ecfb4361434375f2960b883a05fc11 | [
"MIT",
"GPL-3.0-only"
] | permissive | siddheshsathe/Valgrind-Log-Parser | cab0a879cc2f97331c89986d9e25a877797a9fa2 | 13a7dadd5aa0c5b102198ca9013af0a9bc4d15d9 | refs/heads/master | 2023-05-25T07:26:31.639696 | 2019-11-05T09:49:30 | 2019-11-05T09:49:30 | 180,952,553 | 7 | 3 | MIT | 2023-05-17T08:20:50 | 2019-04-12T07:17:21 | Python | UTF-8 | Python | false | false | 514 | py | decorators.py | import logging
import functools
def trycatch(func):
"""
Decorator for try-catch-finally block
Usage:
@trycatch
def func(*args, **kwargs):
# Function body
"""
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
retVal = False
retV... |
3a4ca6656f953ad8ce653e964ca3e850c748392f | 735dfc85723c91446980454659a5a655215cd22c | /DigitalImageProcessing_Courses/GrayscaleTransformation/MultiLinearGrayTransf.py | 5c7fe1cde35b413ae077a28a034a605c9314344c | [] | no_license | Jacky-H-uang/Courses-in-Python | facb524819e271b6ac66975b7226f68d1ad880c2 | c784545299ecd43d6f344840d28f07d112ec98b1 | refs/heads/master | 2023-04-26T13:29:16.574887 | 2021-05-30T03:20:50 | 2021-05-30T03:20:50 | 310,772,105 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,128 | py | MultiLinearGrayTransf.py | # Created By Jacky on 2021/5/28
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
# 分段灰度线性变换
def multi_linear(img,a,b,c,d,L = 256):
height , width = img.shape[0] , img.shape[1]
out_img = np.zeros((height,width),np.uint8)
# 一般来分三段处理
for i in range(height):
for j in range(wi... |
5dc55dcdc68477f5ccf04362f0149ad8ab03e309 | ef23551f07d19c620cda6b27cfa12ffa1d20d06f | /recipe_project/recipe_project/apps/recipes/views.py | b5d8a7dff0e5b95e840d123ac171336b78da0cdb | [
"MIT"
] | permissive | isaac152/recipe-calculator-Django | 22593aee21d553c4ce43cdcdbc24d6e6801c5e6d | 95c94a1d85a7d6603318ed085802edadc1111e27 | refs/heads/main | 2023-09-04T07:34:31.248742 | 2021-10-20T02:22:47 | 2021-10-20T02:22:47 | 410,401,019 | 1 | 1 | MIT | 2021-10-11T02:30:22 | 2021-09-25T23:11:31 | Python | UTF-8 | Python | false | false | 3,250 | py | views.py | #General import
from django.shortcuts import redirect
#View import
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic.base import TemplateView
from django.views.generic import FormView
from .forms import RecipeForm,IngredientCreationFormSet
#url
from django.urls import reverse_lazy
#Mo... |
36de8f0eda7877cdac596dbae3b4c2df6626cd97 | 34e0156b3c92674ff6198de3eaea27a7777861cd | /bentso/constants.py | b66e1eceff89d8b53da0c2eda05f1f218fe74262 | [
"BSD-3-Clause"
] | permissive | hungchristine/ReDyFEV | d0b2fa71b303fd956bf61af1a31a157f20b370ef | b40d9df43c7b2611fba9f34501e69c2df6b5b5b2 | refs/heads/master | 2023-04-11T20:35:37.036410 | 2021-12-04T14:05:30 | 2021-12-04T14:05:30 | 257,874,846 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,488 | py | constants.py | COUNTRIES = ['AT','BE','BA','BG','HR','CY','CZ','DK','EE','FI','FR',
'DE','GR','HU','IE','IS','IT','LV','LU','MK','ME','NL',
'NI','NO','PL','PT','RO','RS','SK','SI','SE','CH']
RENEWABLES = {
'Solar',
'Wind Onshore',
'Wind Offshore',
'Hydro Water Reservoir',
'Hydro Run-of-r... |
0815d753cb7bbec96fe59c1dbf38525065832d4c | 6590cae121feab68673211e5ab5ecc3072afa109 | /tethysapp/hydraviewer/controllers.py | 8056b119e7fc8bc1c69b57078056e8da6dcfaa10 | [
"MIT"
] | permissive | yangxhcaf/tethysapp-hydraviewer | b04793a5f05e8f415ed0bcf543374c32e0d4eef2 | 9e7a943ffedb3ec15e92e2e65d4306d2ceada3f7 | refs/heads/master | 2022-02-24T18:36:48.944042 | 2019-10-09T00:35:35 | 2019-10-09T00:35:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,058 | py | controllers.py | from django.shortcuts import render, reverse
from django.contrib.auth.decorators import login_required
from tethys_sdk.gizmos import MapView, Button, SelectInput, MVView, DatePicker, RangeSlider, ToggleSwitch
import ee
from ee.ee_exception import EEException
import datetime
from . import config
from . import geeutils... |
4ebbd86118194ac7556547ceb39371ac68a1be92 | 776fbdafa46c4ad20a205fbdb0bcf0c3bbaed597 | /bangumi/dto/user_spider_version_dto.py | b82b98332229ee2e3849c5940b52f8ea8e5eb380 | [] | no_license | typetree/bangumi_spider | 1f9e328388f7eedec00f232d84b0017a1ea228a7 | ec376591c942bd683d8c0167ca6c4ef46c4ac299 | refs/heads/master | 2021-05-16T14:56:41.957545 | 2018-03-12T09:02:23 | 2018-03-12T09:02:23 | 118,716,544 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,456 | py | user_spider_version_dto.py | # *_*coding:utf-8 *_*
# author: hoicai
class UserSpiderVersionDTO(object):
def __init__(self, row=None):
if row is None:
self.id = None
self.optimistic = None
self.user_id = None
self.user_code = None
self.bangumi_user_id = None
... |