repo_name stringlengths 7 111 | __id__ int64 16.6k 19,705B | blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 5 151 | content_id stringlengths 40 40 | detected_licenses list | license_type stringclasses 2
values | repo_url stringlengths 26 130 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 42 | visit_date timestamp[ns] | revision_date timestamp[ns] | committer_date timestamp[ns] | github_id int64 14.6k 687M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 12
values | gha_fork bool 2
classes | gha_event_created_at timestamp[ns] | gha_created_at timestamp[ns] | gha_updated_at timestamp[ns] | gha_pushed_at timestamp[ns] | gha_size int64 0 10.2M ⌀ | gha_stargazers_count int32 0 178k ⌀ | gha_forks_count int32 0 88.9k ⌀ | gha_open_issues_count int32 0 2.72k ⌀ | gha_language stringlengths 1 16 ⌀ | gha_archived bool 1
class | gha_disabled bool 1
class | content stringlengths 10 2.95M | src_encoding stringclasses 5
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 10 2.95M | extension stringclasses 19
values | num_repo_files int64 1 202k | filename stringlengths 4 112 | num_lang_files int64 1 202k | alphanum_fraction float64 0.26 0.89 | alpha_fraction float64 0.2 0.89 | hex_fraction float64 0 0.09 | num_lines int32 1 93.6k | avg_line_length float64 4.57 103 | max_line_length int64 7 931 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deng0515001/jsonml | 4,183,298,180,805 | 743af2b2b155b26f4749802eb4f9cebfc51c4e2c | 6f9ed9292208c78299e18f04ef9ec75fd72bc2ba | /jsonml/start.py | 618f01f7199b03730ff3ad8623ff6f0f96e17126 | [
"Apache-2.0"
] | permissive | https://github.com/deng0515001/jsonml | 0496bac1440e9e4f49cc93e2252f4a32d9e01c67 | a28c3a4b102c37243b63d39ff4a5de1e8a414c21 | refs/heads/master | 2022-12-16T16:31:30.611759 | 2020-09-21T09:01:03 | 2020-09-21T09:01:03 | 297,275,557 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from jsonml import source
from pandas import DataFrame
import json
from jsonml import dataprocess
from jsonml.dataprocess import MDataFrame
import numpy as np
import importlib
from jsonml import datautil
from jsonml import datesutil
import copy
import time
import jsonml.model as mmodel
from jsonml.model import ModelPro... | UTF-8 | Python | false | false | 32,852 | py | 14 | start.py | 11 | 0.543854 | 0.539646 | 0 | 738 | 42.4729 | 152 |
novonordisk-research/ProcessOptimizer | 5,480,378,294,435 | 2619e627fae36b22a77bdd519f000c59eb88beb0 | 4db1ea8dcbc995edc45e4c773fed75b99ec99f80 | /ProcessOptimizer/utils/get_rng.py | 9d6cbb44483b058286399dd2fbd25f869aa15346 | [
"BSD-3-Clause"
] | permissive | https://github.com/novonordisk-research/ProcessOptimizer | 5396e22abf86a202b819e48dd9687b55c42373d2 | c39e16b13c36f026827a861d2738bd248325af09 | refs/heads/develop | 2023-08-30T21:01:59.555144 | 2023-08-21T07:56:29 | 2023-08-21T07:56:29 | 311,978,669 | 33 | 9 | NOASSERTION | false | 2023-09-10T20:26:05 | 2020-11-11T13:27:36 | 2023-08-11T07:05:22 | 2023-09-10T20:26:05 | 40,282 | 24 | 9 | 16 | Jupyter Notebook | false | false | from typing import Union
import numpy as np
def get_random_generator(
input: Union[int, np.random.RandomState, np.random.Generator, None]
) -> np.random.Generator:
"""Get a random generator from an input.
Parameters
----------
* `input` [int, float, RandomState instance, Generator instance, or N... | UTF-8 | Python | false | false | 1,148 | py | 69 | get_rng.py | 43 | 0.658537 | 0.644599 | 0 | 35 | 31.8 | 108 |
darae07/test-ui | 7,421,703,524,141 | 951bfd9b871a60d79d5368bdbd1aefb8fa9c1269 | b7c14b21d55779fa721046b4c4b87ce173d67edb | /algorithm/book_icote/07.럭키스트레이트.py | 80c3678766a859d9f7f672697485f1a645758489 | [] | no_license | https://github.com/darae07/test-ui | 762c5567a10c5a30276bf996e19df6848a8eda76 | bb9e0f198bcc8fd4217c572bdb9da105bc21ce21 | refs/heads/master | 2022-11-28T22:34:55.259828 | 2022-10-24T12:48:37 | 2022-10-24T12:48:37 | 287,263,133 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding:utf-8 -*-
#
n = input()
left = 0
right = 0
for i in range(len(n)):
if i < len(n)//2:
left += int(n[i])
else:
right += int(n[i])
print('LUCKY' if left == right else 'READY')
| UTF-8 | Python | false | false | 211 | py | 120 | 07.럭키스트레이트.py | 94 | 0.488152 | 0.469194 | 0 | 12 | 16.583333 | 44 |
binking/PythonAndAlgorithms | 16,655,883,196,880 | 11f70454eb68e5a47ff0f3cb43ebf3d10c3b1968 | 1cf18a662c222756013d62eaf68b66e781b6aef3 | /threads/threadings_pool.py | 78443c157c762a7c6c6d4e2d19c3c1ff1446d957 | [] | no_license | https://github.com/binking/PythonAndAlgorithms | 159156650bb6f5d620ce5748955acbf4af53f0c0 | 8616d71bfed25dbaad3ec0d1d250992aebc65e97 | refs/heads/master | 2017-12-23T18:12:35.263019 | 2017-09-08T10:44:56 | 2017-09-08T10:44:56 | 72,450,209 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import time
import threading
from multiprocessing.pool import ThreadPool
def print_num(n):
ct = threading.current_thread()
print "Process %s prints %d" % (ct.name, n)
time.sleep(5)
print "hey hey beautiful"
def main():
#import ipdb; ipdb.set_trace()
for i in range(5):
# print "Create %... | UTF-8 | Python | false | false | 731 | py | 32 | threadings_pool.py | 30 | 0.611491 | 0.606019 | 0 | 29 | 24.172414 | 89 |
asamn/javathehardway | 9,526,237,463,150 | 5c92c5dfc7c9f519dbac5ea4812d04d7e63ff726 | 1bbbbc7bf6d6667a12ffe9fb6bee033db8699aa4 | /environment/chapter6/sentimental/greedy.py | 1f2537bd71ca069e677571c9046e64290a3d977d | [] | no_license | https://github.com/asamn/javathehardway | f1004d1fc3cb79b2203ef1b59e2cccb756540278 | 69a2598279e0969ef8ad188a7901181aac7ae022 | refs/heads/master | 2020-07-28T04:24:36.645460 | 2020-02-04T14:16:28 | 2020-02-04T14:16:28 | 209,308,325 | 0 | 0 | null | false | 2019-09-24T16:55:44 | 2019-09-18T12:55:14 | 2019-09-24T16:54:06 | 2019-09-24T16:55:43 | 7,319 | 0 | 0 | 0 | C | false | false | # :( input of 23 yields output of 92, cs50 does not take in account half dollar coins
# include <stdio.h>
# include <cs50.h>
# include <math.h>
import cs50
import math
def main():
print("THIS PROGRAM DOES NOT COUNT HALF DOLLAR COINS BECASUE CS50 IS MEGALOMANIAC TRASH\n\n")
print("Enter Amount\n") # prevent... | UTF-8 | Python | false | false | 2,021 | py | 173 | greedy.py | 121 | 0.582385 | 0.535379 | 0 | 68 | 28.735294 | 184 |
robertmetcalf/chia-log | 13,683,765,853,169 | 16eb88f98e0b4dc403ba59f38573cb31dfa362d6 | 26f27b63386bacfd7d8350b07cecb7f52663046a | /src/plots.py | 35259f42c966d350257f7d5af0f41a61792d67b0 | [
"Apache-2.0"
] | permissive | https://github.com/robertmetcalf/chia-log | 906811ca83bbebc13212999c8c83541ac2e8ceed | d1160f0fe8920e581a3a0ffd242f70597b5061fd | refs/heads/main | 2023-05-25T20:40:06.586044 | 2021-06-07T02:13:46 | 2021-06-07T02:13:46 | 361,777,874 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # system packages
from pathlib import Path
from typing import List
import re
# local packages
from src.config import Config
from src.plot import Plot
class Plots:
'''
Process plots in log files. A log file may contain more than one plot entry.
'''
def __init__ (self, config:Config) -> None:
self._config ... | UTF-8 | Python | false | false | 2,715 | py | 16 | plots.py | 12 | 0.661878 | 0.64825 | 0 | 94 | 27.882979 | 77 |
MasahiroK/TSTP | 11,536,282,177,427 | 2537e5bdd1e94af5242a10c2e45d1bd1132b589f | 84571c99d5789c5f55a17462cae9bcbcaddb8759 | /14_c3.py | ec84c24a6ce2d439150ed3285dad05c9998931aa | [] | no_license | https://github.com/MasahiroK/TSTP | 68a1e034a9b2147d518e8d9f7fe52d6556d4ddaa | e3881f2e60b594644f1fb7489808d8761c80e163 | refs/heads/master | 2020-05-19T06:11:41.884420 | 2019-05-04T08:05:53 | 2019-05-04T08:05:53 | 184,867,978 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | class Jojo:
"""docstring fo Jojo."""
def __init__(self, name):
self.name = name
def compare(object1, object2):
return object1 is object2
jony = Jojo("jony")
same_jony = jony
print(compare(jony, same_jony))
another_jony = Jojo("jonathan")
print(compare(jony, another_jony))
| UTF-8 | Python | false | false | 297 | py | 18 | 14_c3.py | 18 | 0.656566 | 0.643098 | 0 | 15 | 18.8 | 34 |
robertocml/Python_Scripting | 8,521,215,142,759 | 1d00447c9249acef7552572eb83b506f92d089fe | 102b1b2c8feb063eb9c6ac5cde7dfd9837f5c9d7 | /Keras_ANN.py | 31d471cc52f3db9c4594f23f21e66b55bb843e3e | [] | no_license | https://github.com/robertocml/Python_Scripting | 06c7b19e4fd118e9a2be602e0e677842f708569e | 3256228f17a11ef06d5bc4718584f4691461909f | refs/heads/master | 2020-12-07T13:23:48.415830 | 2020-04-23T00:57:21 | 2020-04-23T00:57:21 | 232,730,983 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import keras
from keras import backend as K
from keras.models import Sequential
from keras.layers import Activation
from keras.layers.core import Dense
from keras.optimizers import Adam
from keras.metrics import categorical_crossentropy
#linear stack of layers, accept an array and within has elements , each one repre... | UTF-8 | Python | false | false | 508 | py | 15 | Keras_ANN.py | 12 | 0.765748 | 0.75 | 0 | 14 | 35.285714 | 93 |
circleupx/PythonGui | 15,582,141,388,975 | 3383966a1b1621fb26e7e5386b033a4a8a77a1ed | 25880dae073dffce46709ed9321df19c80ed5d2d | /Tkinter/Example08a.py | f38d2187015975d236b40a7cafa3629cd859ff57 | [] | no_license | https://github.com/circleupx/PythonGui | 89748180197149328acfc8df6d547799c120747e | 724552a30b577dda51ebb6c73edb0c7f5dfb3606 | refs/heads/master | 2018-01-08T18:19:50.164536 | 2015-10-30T16:23:38 | 2015-10-30T16:23:38 | 45,259,421 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
Adding a toolbar to our GUI
"""
def drop():
print("New Project")
def drop2():
print("New")
from tkinter import *
gui_object = Tk()
# create a menu object using Menu class
menu = Menu(gui_object)
# configure the menu
gui_object.config(menu=menu)
# Tkinter already knows what a meny is, there is no n... | UTF-8 | Python | false | false | 1,021 | py | 17 | Example08a.py | 17 | 0.70715 | 0.703232 | 0 | 51 | 19.019608 | 88 |
Elimut/GIG-PROG1 | 14,860,586,879,686 | b12ec1bdf8f128272eea19d6c06d6a6ea8ca950a | b2e888205df2316104c9c1b42c59dddfb4ffed9e | /prog/cv2/bignumber.py | 117b319a5e1ed9ea605e592c2dd0fb8925b4fb31 | [] | no_license | https://github.com/Elimut/GIG-PROG1 | e706ef35605a31fb591c7ea757210102ef0b46bf | e95a961a858c725868ac7d25281c0b92c705ae0a | refs/heads/master | 2016-09-05T17:43:47.239305 | 2015-04-12T06:08:22 | 2015-04-12T06:08:22 | 33,805,485 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | number = float(input("Input number: "))
if number > 10:
print("Number is big.")
else:
print("Number si small.")
| UTF-8 | Python | false | false | 120 | py | 118 | bignumber.py | 108 | 0.625 | 0.608333 | 0 | 5 | 23 | 39 |
adonSh/rpn | 4,544,075,407,781 | e0c073525eb2d9de3c5c1431d82e84b346b5f07c | 83481fa1dd956481c634d780b9db964a233d4b6e | /intstack.py | 6c5c5617e795efe84fff4214a0030b70fa9a5505 | [] | no_license | https://github.com/adonSh/rpn | d2ed6d0bdaf17dd578a6ff4715c8776e2123d88f | d72804d80bd7106f7d29e8e0e0adc445ecbe265e | refs/heads/master | 2021-08-16T10:17:42.842383 | 2020-07-16T14:10:41 | 2020-07-16T14:10:41 | 204,026,796 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """ Implementation of an immutable integer stack for RPN calculator.
Always contains at least one value (0).
"""
from typing import List
Stack = List
INIT = 0
def new() -> Stack[int]:
return [INIT]
def print(s: Stack[int]) -> Stack[int]:
print(s)
return s
def peek(s: Stack[int]) -> int:
return s... | UTF-8 | Python | false | false | 478 | py | 6 | intstack.py | 2 | 0.608787 | 0.598326 | 0 | 23 | 19.782609 | 68 |
puppy0608/odoo | 8,443,905,751,667 | 530b85f6bdf2995597636b8040addecc27b836de | 340e8cd8d047f666f9e7c865ad86ce055690e2cb | /home/models.py | 3fa1014ed6a5e810022fd18136a6131e8c1d633d | [] | no_license | https://github.com/puppy0608/odoo | d744062709619565dca6fe821e62bfbe7ca2ed3c | 7ebb1b6ffc22fea05e2c38510adf37337febdf22 | refs/heads/master | 2023-02-06T05:08:33.479918 | 2020-12-24T07:34:16 | 2020-12-24T07:34:16 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.db import models
# Create your models here.
class Template(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255)
category = models.CharField(max_length=255)
structure = models.TextField(max_length=255)
class User(models.Model):
id = models.AutoFi... | UTF-8 | Python | false | false | 1,932 | py | 15 | models.py | 8 | 0.725155 | 0.673913 | 0 | 45 | 41.933333 | 56 |
thgeorgiou/uniwa-cloud-todoapp | 1,254,130,500,599 | df1e723b7446147b2cdf73471cae3f78aca4c8d9 | 0b82e286081e1b60102ddcb89ded2e61b84e5a65 | /todoapp/__init__.py | 113a5be0fc9c13662526f96a8d59eb2a8cba3db7 | [
"Unlicense"
] | permissive | https://github.com/thgeorgiou/uniwa-cloud-todoapp | d11929497f981b4af929a761dd30ea4fdfc4890b | be595fb2d94a353a86b906d74879fe7a70af18bf | refs/heads/master | 2023-01-06T11:27:50.175522 | 2020-08-29T18:01:20 | 2020-08-29T18:01:20 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from datetime import datetime, date
from flask import Flask, render_template, request, redirect
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///local_store.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False # To surpress warning
db = SQLAlchemy(a... | UTF-8 | Python | false | false | 2,860 | py | 7 | __init__.py | 2 | 0.622028 | 0.613287 | 0 | 106 | 25.981132 | 75 |
cloudmesh-deprecated/deprecated-teefaa | 3,307,124,822,884 | f0ff92253d6576a072862904174c647770f2c7c7 | 26c813665041f62d21c41af57715d99c8be4ed04 | /teefaa/init.py | 37cd50b5f588b06e86eaa7089191000bf71fb252 | [
"Apache-2.0"
] | permissive | https://github.com/cloudmesh-deprecated/deprecated-teefaa | 5535956f0199fbe6df4a4d7fb02dc68c473b3042 | 51685c4b06920c1d6591723aac9b9ef4514c976e | refs/heads/master | 2021-05-26T20:54:20.043224 | 2014-01-28T15:42:32 | 2014-01-28T15:42:32 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
import os
import time
import argparse
import subprocess
from .libexec.common import print_logo
class TeefaaInit(object):
def setup(self, parser):
init = parser.add_parser(
'init',
help="Initialize Teefaa environment")
init.set_defaults(func... | UTF-8 | Python | false | false | 439 | py | 8 | init.py | 1 | 0.630979 | 0.630979 | 0 | 22 | 18.954545 | 53 |
agustinhenze/mibs.snmplabs.com | 3,015,067,064,461 | 2669cf2bb1fddad0d877e6ba2750056c9d1a5e9c | 85a9ffeccb64f6159adbd164ff98edf4ac315e33 | /pysnmp/BIANCA-BRICK-BINARY-MIB.py | 1b429de32c627e77905583251f9ce7fdde1da765 | [
"Apache-2.0"
] | permissive | https://github.com/agustinhenze/mibs.snmplabs.com | 5d7d5d4da84424c5f5a1ed2752f5043ae00019fb | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | refs/heads/master | 2020-12-26T12:41:41.132395 | 2019-08-16T15:51:41 | 2019-08-16T15:53:57 | 237,512,469 | 0 | 0 | Apache-2.0 | true | 2020-01-31T20:41:36 | 2020-01-31T20:41:35 | 2019-09-20T14:09:17 | 2019-08-19T15:06:57 | 234,316 | 0 | 0 | 0 | null | false | false | #
# PySNMP MIB module BIANCA-BRICK-BINARY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BIANCA-BRICK-BINARY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:21:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... | UTF-8 | Python | false | false | 5,626 | py | 24,656 | BIANCA-BRICK-BINARY-MIB.py | 19,915 | 0.754533 | 0.680412 | 0 | 54 | 103.185185 | 634 |
yanghr/SVD_Prune_EDLCV | 14,121,852,519,019 | 9c9e469c48907aa9ba26cab689ae0b6a6e749bad | b52acc6831f031e2a1814ec1a0401a608c7ff07e | /CNN/imagenet/Regularization.py | b56d998fff96dbb52de7c07e8e2ddb5d57e2d224 | [] | no_license | https://github.com/yanghr/SVD_Prune_EDLCV | f51eab5e61242acab8cdb2f37bf7790e7dce04d9 | f17f9b29b6425f918e3b9ff0b799818b1f12922a | refs/heads/master | 2022-05-30T23:16:53.736433 | 2020-04-18T20:58:20 | 2020-04-18T20:58:20 | 256,533,767 | 15 | 6 | null | null | null | null | null | null | null | null | null | null | null | null | null | import torch
def Reg_Loss(parameters,reg_type = 'Hoyer'):
"""
type can be : Hoyer,Hoyer-Square,L1
"""
reg = 0.0
for param in parameters:
if param.requires_grad and torch.sum(torch.abs(param))>0:
if reg_type == "Hoyer":
reg += torch.sum(torch.abs(param))... | UTF-8 | Python | false | false | 1,617 | py | 14 | Regularization.py | 9 | 0.536178 | 0.513296 | 0 | 44 | 34.795455 | 111 |
RadoslawBylica/DiscordBot | 4,595,615,056,561 | 8499ab61b75ecf4108e33cb231119cb78d97faad | de2a590028974a65b59426c8bf114810044d6f69 | /BakerChanData.py | 1ba89dec846034a6432a0cd40a66174078a44cfe | [] | no_license | https://github.com/RadoslawBylica/DiscordBot | 3e0fc52042924c9af3fbdf4715b52117d593ead5 | ed98c0976155663aa628ae326c05a4baf287f9ca | refs/heads/master | 2022-11-29T11:24:30.760834 | 2020-07-29T20:35:10 | 2020-07-29T20:35:10 | 283,593,676 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from os import path
class __Messages__():
__Language__ = None
__LanguageEnabled__ = ["Poland", "English"]
__PolandMessages__ = {
"OpenExtension":"Poprawnie załadowano rozszerzenie.",
"CloseExtension":"Poprawnie rozłączono rozszerzenie.",
"RestartExtension":"Poprawnie przeładowano ro... | UTF-8 | Python | false | false | 2,943 | py | 7 | BakerChanData.py | 7 | 0.602327 | 0.600958 | 0 | 81 | 35.08642 | 82 |
mr-ping/statwords | 13,898,514,184,160 | 59e8ed22e2d317980bfc11646c40d837e42719a9 | 7d71f5a4cedefea7a0b35b2800fdf5904a05dfea | /statwords/parser/parser.py | b2461deea689e52c7b774ba413bb1108d17d22c1 | [] | no_license | https://github.com/mr-ping/statwords | 4cff820fe0ac71b338682b09dc0dfab5885a7a1c | e2f0b7ec5336ef32f88f41b79919b496e5c57397 | refs/heads/master | 2016-05-30T02:02:19.706219 | 2014-11-23T18:22:58 | 2014-11-23T18:22:58 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from xml.etree import ElementTree as ET
import re
from StringIO import StringIO
from matplotlib import pyplot as plt
class XmlParser(object):
""" Parsing a xml file into a Element generator
methods:
stat_words: count the matching words in the original file with your\
offering.
... | UTF-8 | Python | false | false | 1,730 | py | 12 | parser.py | 8 | 0.569364 | 0.568208 | 0 | 57 | 29.350877 | 76 |
mcalanog/projects | 14,173,392,093,890 | 2e98f063b5090a5160f9fb1cc39dc4f12239c44e | 2bd23901f7419301a6963f5af38572c3ee211fdc | /project2/exp_eval.py | 09cca144ccff64e7336b708eda864140b903b667 | [] | no_license | https://github.com/mcalanog/projects | 892400a39f4860c21160a5e54e8e5f0d95f5b6bb | 262adbef8e5717a8bd8bdfb7972c82c0d9f30b38 | refs/heads/master | 2020-12-27T20:06:38.778675 | 2020-02-03T19:13:40 | 2020-02-03T19:13:40 | 238,036,278 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #Name: Maeve Calanog
#CPE 202-05
#Project 2:
#Reformating algebraic expression; using stacks, prioritization of operators
from stack_array import Stack
# You do not need to change this class
class PostfixFormatException(Exception):
pass
def postfix_eval(input_str):
"""Evaluates a postfix expres... | UTF-8 | Python | false | false | 7,124 | py | 16 | exp_eval.py | 14 | 0.516002 | 0.508001 | 0 | 148 | 46.135135 | 128 |
varunvv/Projects | 3,238,405,365,177 | 149d4a4912b8a5360556454a3cf5f9de46f58cef | ce42ef49295893b1883e999688f4a055be3a4aa2 | /Utilities/Contrast_adjustment/adj-contrast.py | 5c095cd8757ef110bd8427bb2b844d588de9e028 | [] | no_license | https://github.com/varunvv/Projects | a94e0817cbbbe8707e3de22e2cc5f74b8f413459 | 86ea17692e344ddab8d73742f8a9f76e1a550d26 | refs/heads/master | 2020-05-30T23:02:40.629059 | 2019-06-04T05:31:14 | 2019-06-04T05:31:14 | 190,007,483 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import cv2
import numpy as np
def adjust_brightness(img):
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) #convert it to hsv
h, s, v = cv2.split(hsv)
x = v - v*.65
x = x.astype('uint8')
final_hsv = cv2.merge((h, s, x))
img = cv2.cvtColor(final_hsv, cv2.COLOR_HSV2BGR)
return img
#cv2.imwrite(... | UTF-8 | Python | false | false | 1,609 | py | 13 | adj-contrast.py | 4 | 0.625233 | 0.586078 | 0 | 65 | 23.753846 | 65 |
privateHmmmm/leetcode | 15,367,393,032,460 | c4ba1a67c91e09e64c7ac998555295207892aea7 | 056adbbdfb968486ecc330f913f0de6f51deee33 | /065-valid-number/valid-number.py | 7eb4fe9b2f25120e2035e88853e0c365410d7c4d | [] | no_license | https://github.com/privateHmmmm/leetcode | b84453a1a951cdece2dd629c127da59a4715e078 | cb303e610949e953b689fbed499f5bb0b79c4aea | refs/heads/master | 2021-05-12T06:21:07.727332 | 2018-01-12T08:54:52 | 2018-01-12T08:54:52 | 117,215,642 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding:utf-8 -*-
# Validate if a given string is numeric.
#
#
# Some examples:
# "0" => true
# " 0.1 " => true
# "abc" => false
# "1 a" => false
# "2e10" => true
#
#
# Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one.
... | UTF-8 | Python | false | false | 1,567 | py | 292 | valid-number.py | 291 | 0.474793 | 0.44799 | 0 | 60 | 24.95 | 190 |
zackster/HipHopGoblin | 16,209,206,607,770 | 7cee32acdfc0b90b0e1a2afc7307739ef6648721 | 6f7b37dd5876dad69fd259cd91c8e00db23b0912 | /examples/artist_reviews.py | 75fda4a7de35890d223e9ae9ddd8b8f5c983c71b | [
"BSD-3-Clause"
] | permissive | https://github.com/zackster/HipHopGoblin | 78f98e161124f487a784e505dcddd26cfdbfc170 | d994759906e581f365fd954837c3f29a5266dcd8 | refs/heads/master | 2021-01-16T20:55:24.877152 | 2011-08-23T01:42:11 | 2011-08-23T01:42:11 | 2,250,398 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Uncomment to set the API key explicitly. Otherwise Pyechonest will
# look in the ECHO_NEST_API_KEY environment variable for the key.
#from pyechonest import config
#config.ECHO_NEST_API_KEY='YOUR API KEY'
from pyechonest import artist
td_results = artist.search(name='The Decemberists')
if td_results:
td = td_r... | UTF-8 | Python | false | false | 587 | py | 88 | artist_reviews.py | 58 | 0.67632 | 0.674617 | 0 | 17 | 33.529412 | 80 |
amoux/david | 11,338,713,696,207 | 82d906584890ef809565e278ccc6b936548b63d6 | 7a3ef0e0643cbf23defd3d48b8496037b0373500 | /david/lang/spelling.py | 469561747371cc3696094dabf5d47d1cca815024 | [] | no_license | https://github.com/amoux/david | d1ef452ebdc31d99555cab15cbbb472c35612a94 | 825f30806696e5c77f669ec936fda0e8db7829f3 | refs/heads/master | 2023-08-03T22:42:51.332841 | 2021-10-06T18:57:37 | 2021-10-06T18:57:37 | 199,486,952 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """Spelling Corrector in Python 3; see http://norvig.com/spell-correct.html.
Copyright (c) 2007-2016 Peter Norvig MIT license:
www.opensource.org/licenses/mit-license.php
"""
import re
from collections import Counter
from typing import Dict, List, Pattern
class Speller:
"""Spell correction based on Peter Norvig... | UTF-8 | Python | false | false | 3,599 | py | 73 | spelling.py | 53 | 0.583773 | 0.575438 | 0 | 105 | 33.27619 | 82 |
felixinho/element | 4,011,499,493,818 | f99268b9e45d098c6314d026f14050c579cedcc3 | b31bb5f77bdd33e6f4ae4424d4e28517a50ff0e1 | /pyfiles/elegant/elegantcomputation.py | f344e724d30f9c38c664434dce5792fe5bf74061 | [] | no_license | https://github.com/felixinho/element | e847170b0db7c1255237c597ab8467b8671c83c7 | 9bf5898afa4466b1e2d0a7f17d7e85fef3962e02 | refs/heads/master | 2018-04-22T22:03:35.610490 | 2017-10-22T18:05:46 | 2017-10-22T18:05:46 | 91,264,898 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from __future__ import division, print_function
import numpy as np
import os, time
import subprocess
from getbasiclatticedata import getlatticedata
from sdds import SDDS
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = sel... | UTF-8 | Python | false | false | 5,108 | py | 33 | elegantcomputation.py | 25 | 0.6574 | 0.651331 | 0 | 135 | 36.837037 | 106 |
aurianeb/projet | 3,788,161,197,381 | 28175ee4fec8e2072be0117185a1744fd248e8c3 | 3db67b16a77bf03cd54d571eca6e726d6b76f09e | /conseil_de_films/conseil_de_films/urls.py | 08e6aeda44c31778cdf4bb3802e2cc6a07e000a0 | [] | no_license | https://github.com/aurianeb/projet | 07d9b3c69434b3f68c39d5b196def4c001f685e9 | d10ec7243ed041a4374f5603c6432c397ca60813 | refs/heads/master | 2016-08-12T02:42:59.674609 | 2016-02-02T08:51:10 | 2016-02-02T08:51:10 | 47,886,121 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^films/', include('films.urls')),
url(r'^admin/', include(admin.site.urls)), # La section admin permet notament de gérer facilement à la main la base de données
]
| UTF-8 | Python | false | false | 273 | py | 10 | urls.py | 7 | 0.718519 | 0.718519 | 0 | 7 | 37.428571 | 130 |
rishi-hi-5/codes | 15,410,342,672,724 | ffae573504c165e8c347339b033a1a2c4ecac0a4 | 22ad2ffe61066572fd3c09e0d242bf8e88391a34 | /hackearth/anagram.py | c5de9cf6317dd0364ad1ddfd8d3abda360744baf | [] | no_license | https://github.com/rishi-hi-5/codes | 5e52e7c55dcda365f7daf9fb108fde62f2408065 | 9ab8b11a702fd7a39a694a3bfa3fa5641fe61400 | refs/heads/master | 2021-01-10T05:14:02.091265 | 2018-02-22T14:53:13 | 2018-02-22T14:53:13 | 52,864,061 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | t=int(input())
while t!=0:
s1=input()
s2=input()
h1=[0 for i in range(0,26)]
h2=[0 for i in range(0,26)]
for i in s1:
h1[ord(i)-97]+=1
for i in s2:
h2[ord(i)-97]+=1
cnt=0
for i in range(0,26):
cnt+=(abs(h1[i]-h2[i]))
print(cnt)
t-=1
| UTF-8 | Python | false | false | 303 | py | 253 | anagram.py | 230 | 0.455446 | 0.356436 | 0 | 17 | 16.823529 | 31 |
rhaehfaos23/jijinalimi_backend_photo | 16,423,954,964,181 | b8c738e8859c1c49e7b34d9c26676caa3c370842 | 267e77683f7f8a3e0e6fe388c0368093a0c052bd | /custom_logging_handler.py | 569932483e654d2e579ab5434cd06008527b892e | [] | no_license | https://github.com/rhaehfaos23/jijinalimi_backend_photo | df62ec033e10c24fcc747ba4beb7ced967ea485e | efb71a429d5accf7f48b70f075a8254b767427c3 | refs/heads/master | 2021-05-23T08:34:23.847681 | 2020-04-05T09:50:26 | 2020-04-05T09:50:26 | 253,201,380 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import logging.handlers
import traceback
import requests
import informations as i
from datetime import datetime
from setting_management import MailgunSetting
class MailgunLogHandler(logging.handlers.HTTPHandler):
def __init__(self, subject: str, setting: MailgunSetting):
super().__init__('', '')
... | UTF-8 | Python | false | false | 1,100 | py | 15 | custom_logging_handler.py | 9 | 0.536832 | 0.536832 | 0 | 30 | 35.166667 | 80 |
Yasir-Tec/Code-PYTHON-Django- | 8,048,768,736,070 | c128bc2edf35646d05626d444d781dde959ea2b9 | 1ffabbbe36902cb4ab50a868a42501b986ec84c7 | /migrations/0035_auto_20200113_1041.py | ed66c78885a6dc029bc34ba1df83d0c06762d3ed | [] | no_license | https://github.com/Yasir-Tec/Code-PYTHON-Django- | fe209b114c1d0400d2ce65c4fe0fc508adb4075b | b3224732f0862a51201ce862575291e26999ea94 | refs/heads/master | 2022-11-26T09:44:33.369429 | 2020-07-29T08:28:58 | 2020-07-29T08:28:58 | 283,441,653 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Generated by Django 3.0 on 2020-01-13 18:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('management', '0034_auto_20200111_0346'),
]
operations = [
migrations.AlterField(
model_name='document',
name='username... | UTF-8 | Python | false | false | 589 | py | 58 | 0035_auto_20200113_1041.py | 34 | 0.578947 | 0.519525 | 0 | 23 | 24.608696 | 85 |
spitis/stable-baselines | 2,989,297,265,045 | b29145bf9fdfd19d6df81b1e57cc6b07edab629c | 4e86a5c284e8f9944af9ff24ab2d82454861c8ce | /stable_baselines/common/replay_buffer.py | 2682b7d9593930633d533c6dca161873994f28a5 | [
"MIT"
] | permissive | https://github.com/spitis/stable-baselines | fa899a3667b87d2f5db868a90ba68fa114b55c74 | f62cd6698b2427c0fb5ac452b9059a59b22cde81 | refs/heads/master | 2020-04-02T08:11:30.875827 | 2018-12-18T12:10:02 | 2018-12-18T12:10:02 | 154,233,254 | 0 | 0 | MIT | true | 2018-10-24T22:04:34 | 2018-10-23T00:00:25 | 2018-10-24T19:11:32 | 2018-10-24T22:04:34 | 7,393 | 0 | 0 | 0 | Python | false | null | import numpy as np, random
from collections import OrderedDict, deque
import multiprocessing as mp
from stable_baselines.common.vec_env import CloudpickleWrapper
def worker_init(process_trajectory_fn_wrapper):
global process_trajectory
process_trajectory = process_trajectory_fn_wrapper.var
def worker_fn(trajector... | UTF-8 | Python | false | false | 16,074 | py | 82 | replay_buffer.py | 20 | 0.675999 | 0.668844 | 0 | 412 | 38.01699 | 111 |
semenko/linux-rdp-gateway | 4,277,787,448,652 | ff7a40b128fcd20a48acfe62fde4ea4529bf898f | cb2c0834d63cd3eaaca34ea16bdabc60e22b85d0 | /app.py | 1f6bfe1f5983db95fa3caf1f00974732df1618ca | [
"MIT"
] | permissive | https://github.com/semenko/linux-rdp-gateway | 5d79e75f102c777d419e93f98e21941734ad9d81 | 8fd62a7c8c7a9465ba99a9395bf9505fc4c12670 | refs/heads/master | 2016-09-08T10:40:41.963646 | 2014-02-09T02:54:23 | 2014-02-09T02:54:23 | 16,055,547 | 4 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
"""
A poor man's RDP gateway for linux.
NOTE: THIS IS NOT A REAL RDP GATEWAY!
By: Nick Semenkovich <semenko@alum.mit.edu> http://nick.semenkovich.com
License: MIT
Google auth code derived from Flask-Oauthlib / Bruno Rocha / https://github.com/rochacbruno
"""
from flask import Flask, redirect,... | UTF-8 | Python | false | false | 4,986 | py | 7 | app.py | 1 | 0.630967 | 0.626755 | 0 | 152 | 31.802632 | 164 |
noltron000/cartesian-product | 18,537,078,860,729 | b3e8fc15245993057360f5de96db9dfe4ad00a82 | 0c17e1618b728b1821b8158773029a7a63cef766 | /cartesian.py | 78cfaa21823ddbc0ec9a97d9e43475b290043bf3 | [] | no_license | https://github.com/noltron000/cartesian-product | c4deb99e65a42d2c6f378e9c1c79d2cfdb0bcde6 | 6387ffa9538f9adfc7889f4d2d3ab0682b4d2326 | refs/heads/master | 2020-05-16T14:30:18.447493 | 2019-05-10T16:03:31 | 2019-05-10T16:03:31 | 183,105,415 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def cartesian_product(array):
'''
Vocabulary:
- a collection is an array of arrays
- a group is an array within a collection
- old is the user's input
- new is the transformed output
- tmp is data not added to new for technical reasons
Variable Names:
- old_collection is the user's input
- old_group is a nes... | UTF-8 | Python | false | false | 2,249 | py | 2 | cartesian.py | 1 | 0.703424 | 0.70209 | 0 | 78 | 27.833333 | 58 |
4140/bl1 | 1,322,849,929,785 | da68bcc5b292db122fd0957a81545d733d8a55ca | fc6f4abd0ec1ef77a02e4c56d75567475f96fd87 | /bl1/matches/migrations/0001_initial.py | db718bacf7fdaa5d10a69aac40c6293dc1b6d48a | [] | no_license | https://github.com/4140/bl1 | c2c70eff8fb3fe50a5b3423b25dfa6f5e954946d | e02f4ddc7da9935a751bfb75b067e7f51cc492c7 | refs/heads/master | 2020-03-06T07:04:16.965178 | 2017-03-27T08:23:00 | 2017-03-27T08:23:00 | 86,173,051 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-24 16:36
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]... | UTF-8 | Python | false | false | 3,029 | py | 13 | 0001_initial.py | 6 | 0.563552 | 0.550347 | 0 | 74 | 39.932432 | 146 |
ERAU2020/my-first-binder | 14,070,312,900,529 | 078d754fed51d3400de63a3ee4b2ce58d6e508b4 | 800574cb726931e45fdfdb9d09b7896768ca7ce5 | /linear_regression_sept2020.py | 47bd054b61d4c2ec729923ce4816315dfa70917d | [] | no_license | https://github.com/ERAU2020/my-first-binder | 4a59bbe78c2b035eb464809fa8a36d2a8d73a097 | 769e7f1dacd64a13a4afe2ae8138cf077d8d427d | refs/heads/master | 2023-01-07T07:14:47.669421 | 2020-11-03T18:41:59 | 2020-11-03T18:41:59 | 286,777,790 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 22 14:14:44 2020
@author: lehrs
"""
import numpy as np
# %matplotlib inline
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
# represents the heights of a group of people in metres
heights = [[1.6], [1.65], [1.7], [1.73], [1.8... | UTF-8 | Python | false | false | 3,042 | py | 22 | linear_regression_sept2020.py | 17 | 0.608481 | 0.563445 | 0 | 112 | 25.125 | 109 |
YashAgarwalDev/Learn-Python | 13,262,859,033,338 | f3296070845b027b63aa6694aa70a53ce9f01b0b | bcab933a9c679ebbe83f5658f0a6f36fc069329d | /Break2.py | e412a44fb07637020e247b0d81e5ed0789e1fb3c | [] | no_license | https://github.com/YashAgarwalDev/Learn-Python | 3c8d8db6cf260de52db24de01cafb6ef317d90ef | 02e2d3fc814783258abf27bde4041d90b2320229 | refs/heads/master | 2020-06-24T01:58:42.095074 | 2020-05-08T06:47:36 | 2020-05-08T06:47:36 | 198,815,934 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | Number = [34,207,99,89,77]
for n in Number:
if(n%5==0):
print(n)
break;
else:
print("didn't find any number which is not divisible with 5")
| UTF-8 | Python | false | false | 179 | py | 34 | Break2.py | 32 | 0.536313 | 0.458101 | 0 | 7 | 22.428571 | 65 |
bskaggs/rk | 16,561,393,895,560 | bc809cd8613be94056d367b31f14c453eac03302 | a05b9b819cced81c1a7a4852dd07c5dc36c36a6b | /scripts/rkscript | 9773fdeeaeacfea71b8c69af17d8c890bd9ef4fe | [
"Unlicense"
] | permissive | https://github.com/bskaggs/rk | 0ef5f263242d5003863960253efb81bd578d7941 | 505f37cf07a831f2a09f68b16e38e484c9cbd9fd | refs/heads/master | 2020-07-11T16:41:36.351985 | 2016-05-28T15:33:52 | 2016-05-28T15:33:52 | 59,901,115 | 1 | 0 | null | true | 2016-05-28T15:27:38 | 2016-05-28T15:27:38 | 2016-04-20T08:26:22 | 2015-10-23T21:19:44 | 374 | 0 | 0 | 0 | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Remote jupyter kernel via SSH
Make sure that you can login to a remote machine without entering password.
"""
from datetime import datetime
from errno import EACCES, ENOTDIR
from getpass import getuser
from json import load
from os import chmod, getcwd, getpid, maked... | UTF-8 | Python | false | false | 12,029 | 9 | rkscript | 4 | 0.590905 | 0.582925 | 0 | 309 | 37.928803 | 79 | |
bernardbeckerman/spark | 13,743,895,369,248 | e5c14eea6037f81653905fe80ecbe44cd09990e2 | f14b1cc501b88442468b6a52f3bc1117970216cd | /src/upvote_percentage_by_favorites.py | b36163737a0c99dd332b2b9b74c08dc5b9fec882 | [] | no_license | https://github.com/bernardbeckerman/spark | f546764a34d24f11a9c27d3eb8c79763cf79ed80 | 5f85e9fbd6bfb0f1b5eb46f3d678a20df2709aa8 | refs/heads/master | 2021-06-09T00:23:18.509750 | 2016-12-13T23:27:50 | 2016-12-13T23:27:50 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from __future__ import print_function
from collections import Counter
from lxml import etree
import gzip
from pyspark import SparkContext
sc = SparkContext("local[*]", "temp")
import os
from collections import defaultdict
def localpath(path):
return 'file://' + str(os.path.abspath(os.path.curdir)) + '/' + path
de... | UTF-8 | Python | false | false | 1,395 | py | 9 | upvote_percentage_by_favorites.py | 7 | 0.558423 | 0.5319 | 0 | 59 | 22.644068 | 72 |
masMAY/Latihan-Dasar-Python | 16,114,717,319,257 | f2b87e16859faedb33374f1e297e60c3f37c079e | 515c527e53b5a0c39365c491cdf9ce46c7ca5eb4 | /python/latihan python dasar/nested_for.py | ba815aca37d7a467c44dbf44564be88a50c1d256 | [] | no_license | https://github.com/masMAY/Latihan-Dasar-Python | e1627326b94d939c879670ed77bede237a1be2d6 | 820ae7d092039f234b1a718ce247d627841d2f63 | refs/heads/master | 2021-01-11T20:14:17.031034 | 2017-01-17T03:37:26 | 2017-01-17T03:37:26 | 79,073,019 | 0 | 1 | null | false | 2017-01-17T03:37:26 | 2017-01-16T01:49:16 | 2017-01-16T02:06:53 | 2017-01-17T03:37:26 | 15 | 0 | 1 | 0 | Python | null | null | print "nested foo on prime number case among 1 t0 20"
for i in range(1,20):
count_zero_remainder = 0
for j in range (1, i+1):
num_remainder = i%j
print num_remainder
if num_remainder == 0:
count_zero_remainder = count_zero_remainder + 1
if count zero_remainder == 2:
print i, "is a prime number"
else:
... | UTF-8 | Python | false | false | 357 | py | 18 | nested_for.py | 17 | 0.67507 | 0.638655 | 0 | 13 | 26.461538 | 53 |
tangermi/nlp | 13,718,125,549,375 | 2ca6a38da8b53553c68c67588a19630182572d76 | c06d18ac5b87b3b82fc486454c422b119d6c1ee9 | /src/evaluation/similarity/siamese.py | 7e5ef4540df15b7b374f58e3bdea4c59b0b8bd38 | [] | no_license | https://github.com/tangermi/nlp | b3a4c9612e6049463bf12bc9abb7aff06a084ace | aa36b8b20e8c91807be73a252ff7799789514302 | refs/heads/master | 2022-12-09T12:33:15.009413 | 2020-04-03T04:03:24 | 2020-04-03T04:03:24 | 252,056,010 | 0 | 0 | null | false | 2022-12-08T07:26:55 | 2020-04-01T02:55:05 | 2020-04-03T04:03:27 | 2022-12-08T07:26:55 | 37,923 | 0 | 0 | 7 | Jupyter Notebook | false | false | # -*- coding:utf-8 -*-
from ..base import Base
import os
import numpy as np
import tensorflow as tf
from utils.similarity.siamese import Similarity as s
class Siamese(Base):
def __init__(self, dic_config={}, dic_engine={}, dic_score={}):
self.dic_engine = dic_engine
self.dic_score = dic_score
... | UTF-8 | Python | false | false | 2,633 | py | 342 | siamese.py | 330 | 0.546944 | 0.520575 | 0 | 68 | 35.808824 | 98 |
Bye-lemon/DUT-CS-Homework | 6,296,422,086,009 | cdb49db1451a87acb6982ca72f5d663f76903748 | 69ceee163e8ed655840a2dd026c5de185991fe35 | /Operating System/Memory Schedule/Scheduler.py | 8f20c1a55f5aa8914bcb82a1d7f55cbf450d4226 | [] | no_license | https://github.com/Bye-lemon/DUT-CS-Homework | 1b3dfaa44af66f04ba51707670a78ef96401a308 | 5437002925a22a644b15afca0394f24532ec3ab5 | refs/heads/master | 2021-06-12T11:02:11.009339 | 2020-12-27T02:52:14 | 2020-12-27T02:52:14 | 152,850,552 | 2 | 0 | null | false | 2021-03-20T00:49:55 | 2018-10-13T08:16:56 | 2020-12-27T02:52:19 | 2021-03-20T00:49:54 | 18,113 | 1 | 0 | 2 | C | false | false | from DataStructure import PageTable
class AbstractMemoryScheduler(object):
def __init__(self, maxsize):
super().__init__()
self.pageTable = PageTable(maxsize)
self.requestTimes = 0
self.hitTimes = 0
def hit(self):
self.requestTimes += 1
self.hitTimes += 1
... | UTF-8 | Python | false | false | 2,573 | py | 128 | Scheduler.py | 52 | 0.541061 | 0.52888 | 0 | 87 | 28.252874 | 81 |
jung9156/studies | 8,220,567,412,418 | f12b52c95b25a8b9fd742003967d8ddd349d8685 | ee1e5cd7b3c04e6ac848287938b1698ca7b578a4 | /lecture/algorithm/problem/4731.항구에 들어오는 배.py | 609ee98c5fbb064a85755c9a4a9bb481811d9e50 | [] | no_license | https://github.com/jung9156/studies | d2a3aea773c3c54764232c077293e5a107e57e3a | 7dd20bb5e4098c54168ca846d7f73d391564f72f | refs/heads/master | 2023-01-04T14:54:51.986609 | 2020-10-22T06:01:21 | 2020-10-22T06:01:21 | 296,518,221 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | tn = int(input())
for ir in range(tn):
print('#{} '.format(ir + 1), end='')
n = int(input())
a = []
a += [int(input()) for ii in range(n)]
A = set()
ma = a[-1]
A.add(1)
if len(a) == 1:
cnt = 1
else:
cnt = 0
for i in a:
if i not in A:
A.add(i)
... | UTF-8 | Python | false | false | 550 | py | 462 | 4731.항구에 들어오는 배.py | 310 | 0.334545 | 0.32 | 0 | 28 | 18.678571 | 42 |
msherwood10/python | 12,146,167,555,641 | 645cd2cb84e54a1c0efda7fd6eea3a5ae28389ad | 8aa6940df17aca0ab69fffaae9c86becdd32d458 | /assn-7.2-2.py | ff1aa33acfc6c53e6dc01fac86f31290661cc275 | [] | no_license | https://github.com/msherwood10/python | fc8fbbacbd86f776e1a0fb9d107aa7b4bcc2b993 | 1ce3fe4de5b87e0ba29828d59a453f0b51678e7d | refs/heads/master | 2021-01-25T10:07:27.286821 | 2017-02-16T03:03:29 | 2017-02-16T03:03:29 | 28,399,696 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Use the file name mbox-short.txt as the file name
fname = "C:\Python27\mbox-short.txt"
fh = open(fname)
xspam = list()
count = 0
for line in fh:
if line.startswith("X-DSPAM-Confidence:"):
zeropos = line.find("0")
eol = line.find("\n")
spamtext = line[zeropos:eol]
spamval = float(sp... | UTF-8 | Python | false | false | 453 | py | 26 | assn-7.2-2.py | 23 | 0.635762 | 0.624724 | 0 | 15 | 29.266667 | 51 |
wendazhou/reversible-inductive-construction | 5,703,716,599,888 | 2b50687c157990d5adc0e15bb4a6e24771d19602 | c584941c8c6005ed27d770f72b4ef4693cfeeff5 | /code/genric/laman/_data.py | 93606ea9c78563c61340e54165037c2e1a9983f1 | [
"MIT"
] | permissive | https://github.com/wendazhou/reversible-inductive-construction | 2820b5e560d1cb127d653fd39db7d804de5e76db | 14815d1b5ef5a35a569c0793888bc5548acd64be | refs/heads/master | 2021-01-03T01:29:36.746897 | 2020-02-12T08:22:57 | 2020-02-12T08:22:57 | 239,858,618 | 0 | 0 | MIT | true | 2020-02-11T20:32:46 | 2020-02-11T20:32:45 | 2019-12-12T09:11:20 | 2019-12-10T22:11:26 | 38,821 | 0 | 0 | 0 | null | false | false | import typing
class LamanSamplerConfig(typing.NamedTuple):
expected_corruption_steps: int
use_revisit: bool
num_steps: int
max_denoising_steps: int = 20
| UTF-8 | Python | false | false | 171 | py | 73 | _data.py | 66 | 0.725146 | 0.71345 | 0 | 8 | 20.375 | 44 |
fabiano-teichmann/interfaces | 3,083,786,550,703 | c1b090692a35ccd84bb81da1f41d7e46a1428ef3 | 5d408cf33f025c3230f1ea033ba7a42fb31dc20d | /tests/test_dispatch_message_abc.py | 3c0229b2b31ac78a50eaa53afdaa08f9df6a2d74 | [] | no_license | https://github.com/fabiano-teichmann/interfaces | 91854d554405567f90ed6e31c778f479b1b1119e | e6fdb42141c05c1e15652010348be33b5c233af0 | refs/heads/main | 2023-08-30T11:31:25.693564 | 2021-11-15T00:12:10 | 2021-11-15T00:12:10 | 427,717,001 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import pytest
from dispatch_message_abc import DispatchSMS, DispatchEmail
from schema import MessageSMS, MessageEmail
class TestDispatchMessageABC:
def test_send_sms_should_return_none(self):
assert DispatchSMS(
MessageSMS(to="479984848", sender="2102", message="Protocol is nice !!!")
... | UTF-8 | Python | false | false | 871 | py | 6 | test_dispatch_message_abc.py | 5 | 0.552239 | 0.537313 | 0 | 27 | 31.259259 | 104 |
Hapattaja/ruuvi-hass.io | 13,297,218,787,611 | e185bb87f78c06481cc9fc0d1a0fd6c5bee69f48 | 4ae89f73a913d090de3485059b25ce9027a898f9 | /tests/test_basic_setup.py | 0cb9b45896c1873d5ba0dc8dd908405a6b26cb18 | [
"MIT"
] | permissive | https://github.com/Hapattaja/ruuvi-hass.io | 4f9c1cd668f59962518dbb24eec8f8f06d80c8f7 | f6cd9e214c380fcea56f2158d38a3eeb222bc77a | refs/heads/master | 2023-08-11T01:49:10.389053 | 2021-09-19T09:01:48 | 2021-09-19T09:01:48 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """The basic setup of the platform."""
from unittest.mock import MagicMock, patch
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from pytest_homeassistant_custom_component.common import MockConfigEntry
from custom_components.ruuvi.sensor import (
SENSOR_TYPES
)
fr... | UTF-8 | Python | false | false | 2,364 | py | 15 | test_basic_setup.py | 7 | 0.676819 | 0.674281 | 0 | 69 | 33.246377 | 95 |
dianedef/P3-Aidez-MacGyver | 3,831,110,859,075 | 40754524e880b836c22ce514fca6830ef1b48f24 | 9f80a393208574d636483101c8ed2db4ff1d5862 | /models/labyrinth.py | f10eeb74f33959cdd0e93487390141425e1edcaf | [] | no_license | https://github.com/dianedef/P3-Aidez-MacGyver | 4331e0a6e135d5133ef6268e55e4d1d5d30f923d | f448f896e7bd915aada672f7b0dd73d6dcf6e54b | refs/heads/master | 2020-09-01T00:10:25.968244 | 2020-04-21T12:10:34 | 2020-04-21T12:10:34 | 218,823,380 | 0 | 2 | null | false | 2020-02-07T18:55:43 | 2019-10-31T17:35:47 | 2020-02-07T18:25:13 | 2020-02-07T18:25:11 | 2,740 | 0 | 1 | 1 | Python | false | false | """This module defines classes and functions related to the labyrinth in the game."""
import random
from models.position import Position
class Labyrinth:
def __init__(self):
"""This function initialize a labyrinth with paths, departure, end, and
walls."""
self.paths = []
self.st... | UTF-8 | Python | false | false | 1,610 | py | 16 | labyrinth.py | 12 | 0.521118 | 0.518634 | 0 | 47 | 33.255319 | 85 |
vahid75/File-Server | 584,115,564,965 | 7bc8c3e0060683392977687c4e6bc651c616786a | 1692c13ff5b8b99107cfd0bf20dd056490736c28 | /File_Server/middleware.py | 833b1f153d7387aec238a6941542ea802a81dff1 | [] | no_license | https://github.com/vahid75/File-Server | fc3e0e1710c7bb0568e3dc318f486b8d03753ac6 | 13e5d5b467d62b5203bb58e0f8c1213b76e3b4e8 | refs/heads/master | 2022-10-20T15:20:42.415322 | 2020-06-28T18:27:14 | 2020-06-28T18:27:14 | 275,101,251 | 4 | 1 | null | false | 2020-06-28T18:32:03 | 2020-06-26T07:45:40 | 2020-06-28T18:27:18 | 2020-06-28T18:27:24 | 19 | 4 | 1 | 0 | Python | false | false | from django.http import HttpResponseForbidden
import os
from django.conf import settings
from django.urls import reverse
from . import utils
def ip_middleware(get_response):
def middleware(request):
client_ip_address = request.META.get("HTTP_X_REAL_IP")
request.client_ip_address = client_ip_addres... | UTF-8 | Python | false | false | 732 | py | 11 | middleware.py | 6 | 0.699454 | 0.699454 | 0 | 21 | 33.714286 | 123 |
maraujo/pynmet | 9,809,705,345,838 | 9c900a4bc4ba7e18d250d53ef00f8be07a06e164 | 08b2642e6748745378bda7dd117f54b6b6bb31ed | /Tests/default_metpy.py | 105b1b8639f8cf1027766834e79897a2d559c32a | [] | no_license | https://github.com/maraujo/pynmet | f47344d61b17ddd1d4098874d5030a5b99c84ad2 | 4c214042d23ec7ab09d874712a6b71f73b612c7c | refs/heads/master | 2020-03-20T00:51:08.986661 | 2018-06-12T11:24:41 | 2018-06-12T11:24:41 | 137,057,897 | 0 | 0 | null | true | 2018-06-12T10:46:32 | 2018-06-12T10:46:32 | 2018-05-08T21:20:03 | 2018-01-15T02:53:12 | 219 | 0 | 0 | 0 | null | false | null | import cartopy
import cartopy.crs as ccrs
from matplotlib.colors import BoundaryNorm
import matplotlib.pyplot as plt
import numpy as np
from metpy.cbook import get_test_data
from metpy.gridding.gridding_functions import (interpolate, remove_nan_observations,
remove_repeat... | UTF-8 | Python | false | false | 2,858 | py | 9 | default_metpy.py | 6 | 0.56718 | 0.544787 | 0 | 74 | 37.635135 | 95 |
SWE4103-Team1/UnitTestDemo | 3,453,153,752,596 | 298d6988e7baa7573930655aecbf0df176ed1dff | 86eb218f6d75f97010e47e1bbb0cd143c01f4cd0 | /DemoApp/tests.py | fb68bacda54f9292ddfc72d89f1fa7fc5f365c1e | [] | no_license | https://github.com/SWE4103-Team1/UnitTestDemo | cf50ec04db4c09d7a6bf45ba13d892447e932782 | 943292d512d6e23a50e0885c63fb3a41f076c749 | refs/heads/master | 2023-08-27T17:37:38.256427 | 2021-10-31T04:47:41 | 2021-10-31T04:47:41 | 411,110,449 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.test import TestCase
# Unit test class inherits from django.test.TestCase
# which inherits from unittest.TestCase
class DemoAppUnitTests(TestCase):
def test_true_is_true(self):
isTrue = True
self.assertTrue(isTrue)
def test_false_is_false(self):
isFalse = False
self.assertFalse(isFalse)
| UTF-8 | Python | false | false | 312 | py | 4 | tests.py | 2 | 0.772436 | 0.772436 | 0 | 12 | 25 | 52 |
henchhing-limbu/Daily-Coding-Problems | 12,463,995,098,435 | c83587a53381468f840ca5cdc3eabfa76591beee | 8eaaf6d5b40fee8e37cf0b8cdc30f83545d66308 | /problem2.py | 004ef1ee27e149ce77f77ec226fb40a6d6d3e385 | [] | no_license | https://github.com/henchhing-limbu/Daily-Coding-Problems | 1c858cc4255051e02af49904cee9ac852818f609 | 9553e71333102be7a78dc63cc62b2c6ab778927c | refs/heads/master | 2020-07-06T15:40:14.990903 | 2019-09-11T04:32:44 | 2019-09-11T04:32:44 | 203,070,225 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array execpt the one at i.
For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected ... | UTF-8 | Python | false | false | 1,014 | py | 14 | problem2.py | 14 | 0.663708 | 0.614398 | 0 | 25 | 39.56 | 174 |
pyfarm/pyfarm-master | 13,709,535,658,655 | 7a22b777e540a24eb5e53b9f6a083ebddb04d253 | a439511176625ea34aa6b19a9bd39926e2f0bcda | /tests/test_master/test_jobs_api.py | 708569d914c52a20d6c48a4b2bd815674ac6e479 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | https://github.com/pyfarm/pyfarm-master | bb6983f198d814ce40e77f5b843806d9e8e9ae9e | ea04bbcb807eb669415c569417b4b1b68e75d29d | refs/heads/master | 2021-06-04T11:55:05.458239 | 2017-12-22T18:13:23 | 2017-12-22T18:13:23 | 12,912,885 | 2 | 3 | null | false | 2016-02-04T13:41:50 | 2013-09-18T03:10:36 | 2015-05-08T10:28:14 | 2016-02-04T13:41:50 | 7,059 | 4 | 3 | 33 | Python | null | null | # No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
#
# 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
#
... | UTF-8 | Python | false | false | 65,871 | py | 157 | test_jobs_api.py | 80 | 0.402286 | 0.385784 | 0 | 1,676 | 38.302506 | 81 |
AmirTavakol/ICT-IN-TS | 16,647,293,281,088 | 92dca0f4d766ff59248e723321fc22614e3dab5f | 1c0c6c7d5cbbc183c057ea3ece331610505f0127 | /Step3_1.py | c1c325f8f4fe84ea0fdbded54a8f8decbd6b3caa | [] | no_license | https://github.com/AmirTavakol/ICT-IN-TS | c436744602f2cb43e55f1202db9379d63c3f9693 | 70c75e74567787e96655fbfff4145356875f3ce1 | refs/heads/master | 2023-02-02T19:11:22.251292 | 2020-12-18T19:05:31 | 2020-12-18T19:05:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[56]:
import pymongo as pm #import MongoClient only
import pprint
import datetime as dt
import time
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import pandas as pd
#3 lines of code to get the database ready
client = pm.MongoClient('b... | UTF-8 | Python | false | false | 3,755 | py | 6 | Step3_1.py | 6 | 0.585619 | 0.573103 | 0 | 122 | 29.745902 | 119 |
yougth/IRDM2017 | 6,442,450,991,476 | 00c84d9aefa1947abe40f29bbd28b5d728959def | b6039b58907e5b489bc7fdd89ac32cd8af2bc257 | /python/RunMe.py | 165b5a4f79017f625d8d371007b42aca1a2b9d25 | [] | no_license | https://github.com/yougth/IRDM2017 | a227d7a954ccc52280771ec1d633421aab23bea2 | 875bb03e7cecc2269b06115b2730644bec0b5e19 | refs/heads/master | 2020-03-28T13:50:36.764409 | 2017-04-20T11:55:05 | 2017-04-20T11:55:05 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import pandas as pd
import numpy as np
from HomeDepotCSVReader import HomeDepotReader
from FeatureEngineering import HomeDepotFeature
from HomeDepotCSVWriter import HomeDepotCSVWriter
from XGBoostRanker import XGBoostRanker
from OrdinalRegressionRanker import OrdinalRegressionRanker
import LogisticRegressionRanker
from... | UTF-8 | Python | false | false | 6,682 | py | 61 | RunMe.py | 22 | 0.693655 | 0.685424 | 0 | 158 | 41.291139 | 268 |
MarcelRaschke/netbox | 9,775,345,608,548 | 6f78fca1a9a7f207c018916f6e3cc2efce190691 | 3d1aacb0ce641a1d96cb4a4b1363b0d03bc3f87c | /netbox/users/migrations/0003_token_permissions.py | a8a1f2a6e978ed00d6bd5da245405609a84d5d9b | [
"Apache-2.0"
] | permissive | https://github.com/MarcelRaschke/netbox | 242e30909c8cdcc6cbfb1e5beb7fc29752d5025e | 8206e46991498616bd9fdc5f40b57e66067b674a | refs/heads/develop | 2023-09-05T18:59:32.540609 | 2022-08-12T02:26:58 | 2022-08-12T02:26:58 | 160,838,955 | 1 | 1 | Apache-2.0 | true | 2023-04-30T00:40:43 | 2018-12-07T15:08:25 | 2023-04-15T12:32:00 | 2023-04-30T00:40:42 | 8,689 | 1 | 1 | 33 | Python | false | false | # Generated by Django 2.0.8 on 2018-10-05 14:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_api_tokens_squashed_0002_unicode_literals'),
]
operations = [
migrations.AlterModelOptions(
name='token',
opti... | UTF-8 | Python | false | false | 345 | py | 235 | 0003_token_permissions.py | 136 | 0.594203 | 0.527536 | 0 | 17 | 19.294118 | 68 |
GustavoGB/APS_LOGICA | 12,549,894,466,787 | 88d441a5e9dfeeaf33b78a056087c55d4e7455aa | e1c284c6e4605e1f33b057e7fc437c68cf4e1dc9 | /APS_FINAL/preprocess.py | 0585bb019379627258e0b896f237c1bcf9fd6d4f | [] | no_license | https://github.com/GustavoGB/APS_LOGICA | bbf77a718ca72203c32d3602b5af347722b27c97 | 243b56f7018b7c46fc56a64ae3b2e86b30ff83d8 | refs/heads/master | 2022-11-06T20:33:04.641363 | 2020-06-29T22:24:15 | 2020-06-29T22:24:15 | 248,819,174 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import sys
import re
from main import *
class PrePro:
@staticmethod
def filter(codigo):
codigo_filtrado = re.sub(re.compile("/\*.*?\*/", re.DOTALL), "",codigo)
codigo_filtrado = re.sub("\n", "", codigo_filtrado)
return codigo_filtrado
| UTF-8 | Python | false | false | 272 | py | 7 | preprocess.py | 5 | 0.606618 | 0.606618 | 0 | 10 | 26.2 | 79 |
cofax48/FluentCityAnagrams | 6,674,379,209,847 | bd1b39fd1c2829eb1a212a2de38569d7b79c7eb6 | 64654af5eb28f2be51fee9332e79e9c8e48374b9 | /DjangoHeroku/hello/views.py | 6aa9190810b7c692730969be63319f7b29c11dfc | [] | no_license | https://github.com/cofax48/FluentCityAnagrams | 74c0ac1fe9c6c58e7d62e8ce503ff5001560fbe3 | abc2ecd671198354cc6f435c24e532fd24b0dff9 | refs/heads/master | 2020-03-21T19:12:15.537016 | 2018-06-27T22:07:28 | 2018-06-27T22:07:28 | 138,935,050 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from django.http import FileResponse
from django.http import JsonResponse
#Don't want to deal with CSRF
from django.views.decorators.csrf import csrf_exempt
#El classico
import json
from sqlalchemy import create_engine
#fancy dictionary sorting
fr... | UTF-8 | Python | false | false | 1,468 | py | 11 | views.py | 8 | 0.773161 | 0.732289 | 0 | 40 | 35.7 | 194 |
itisianlee/hawk-facedet | 4,286,377,374,323 | b953e66f180e14b1db2cc005fd239cbe7c10c6f8 | 2f82e063549626463b4febdc588360a8d51234b3 | /hawkdet/dataset/transformers.py | a86ab6894db4939b7b687a294448c9e44447c480 | [
"Apache-2.0"
] | permissive | https://github.com/itisianlee/hawk-facedet | a235bde2d1d05557d94a2accbccb9eb53df24678 | 55774ac5619f9a4c76a3a872ff11940a874b32d1 | refs/heads/main | 2023-04-06T01:39:33.052760 | 2021-06-12T15:53:58 | 2021-06-12T15:53:58 | 353,374,546 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import cv2
import numpy as np
import random
from ..lib.box_utils import matrix_iof
class RandomCrop:
def __init__(self, image_size=(640, 640), iof_factor=1.0, min_face=16):
self.image_size = image_size
self.iof_factor = iof_factor # iof(IoF(forgrand))
self.min_face = min_face
sel... | UTF-8 | Python | false | false | 8,421 | py | 25 | transformers.py | 23 | 0.490441 | 0.464078 | 0 | 268 | 30.425373 | 115 |
Frexiona/SQL-ASSIGNMENT | 16,381,005,310,661 | 3f9c620d215bc7cb10cf12cd6368535ba95ffa0c | 1efa822034054b743f7f2a4402bc074e7f086300 | /CSV_Split.py | 3074738414c608a7830a4002a471a19141170d65 | [] | no_license | https://github.com/Frexiona/SQL-ASSIGNMENT | db50e76d5e8f3e082a1597915bc10910fbd055d8 | d7d0a1ed92f57faf1a1b34964f646fd45a7f768c | refs/heads/master | 2020-04-26T12:56:03.678985 | 2019-03-31T11:45:44 | 2019-03-31T11:45:44 | 173,565,056 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
Author: Haolin Zhang
Date: 20-02-2019
"""
import mysql.connector as sql
import pandas as pd
import os
import csv
__location__ = 'path'
# Connect mysql function
def connectSql():
conn = sql.connect(host = '127.0.0.1', user = 'root', password = "password", database = "books_studentID")
return conn
def csv... | UTF-8 | Python | false | false | 2,814 | py | 4 | CSV_Split.py | 3 | 0.548685 | 0.540512 | 0 | 82 | 33.317073 | 114 |
pyrfume/pyrfume | 12,017,318,509,642 | 24e0e6a8bc160aa1d1e7a077726b5a7aa26fee86 | a873ed639369c60a1653048bc1481af0bad14b03 | /notebooks/snitz-dragon-selection.py | 53057ec4c1edf0fb678c8e53a2cc2213f3851c58 | [
"MIT"
] | permissive | https://github.com/pyrfume/pyrfume | 636243df2ae1daec21977369fad4d914bbb35e73 | f9a1261edd207a6e726470bcc6285ac1fa1b1982 | refs/heads/main | 2023-08-08T10:25:38.783613 | 2023-07-31T01:22:09 | 2023-07-31T01:22:09 | 112,794,726 | 39 | 13 | MIT | false | 2023-07-31T01:22:10 | 2017-12-01T22:53:40 | 2023-07-04T14:23:30 | 2023-07-31T01:22:09 | 10,073 | 32 | 7 | 4 | Python | false | false | # ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.10.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import pickle
import matplotl... | UTF-8 | Python | false | false | 6,147 | py | 132 | snitz-dragon-selection.py | 98 | 0.662437 | 0.645193 | 0 | 210 | 28.271429 | 99 |
brunorasteiro/birdie_psel_ds | 3,461,743,647,571 | 18daecd04b139cdc486c1be393aef4727b3b9c03 | e9b95b9fe1abe139750640c371cce46a39f8f328 | /etapa_1/etapa_1.py | b80df9e48d82eaac2d738d34e3caab810192f0c7 | [] | no_license | https://github.com/brunorasteiro/birdie_psel_ds | a50f3603b6ffa537e10a1ec7651387597e94801f | 70e867a8aa0006357b4d9d8c2fcd9ec64261a9f7 | refs/heads/master | 2020-04-12T05:20:37.579987 | 2019-01-04T00:53:56 | 2019-01-04T00:53:56 | 162,323,557 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
# coding: utf-8
# In[200]:
import pandas as pd
import sys
# In[201]:
# tenta ler o arquivo de produtos pelo primeiro parâmetro do terminal
# se não conseguir tenta abrir com o nome 'data_estag_ds.tsv'
try:
path = sys.argv[1]
data = pd.read_csv(path, sep='\t')
except Exception as e:
try:
dat... | UTF-8 | Python | false | false | 3,316 | py | 12 | etapa_1.py | 3 | 0.55894 | 0.55163 | 0 | 127 | 24.834646 | 103 |
peterzhaoc/Edu123Kid | 11,991,548,734,321 | c6edfc90cabb252f5c28b5c86303b6e819644edc | a585acb0a98f19b803df62697dfd49c661b37aaa | /writings/admin.py | ea0599a87df24672a1da71b91ab39279af9b5887 | [] | no_license | https://github.com/peterzhaoc/Edu123Kid | 19b0ab5761faf37a3015e6bb2b9b42ce5c763cba | b3f823b2c1820fe335869d719b78a80f83bc8121 | refs/heads/master | 2021-09-17T11:04:21.757951 | 2018-07-01T06:09:01 | 2018-07-01T06:09:01 | 111,057,348 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from writings.models import *
class WritingTaskAdmin(admin.ModelAdmin):
list_display = ('title', 'author', 'publish_date', 'mentor_end_date', 'editor', 'finaleditor', 'pay', 'state', )
admin.site.register(Book)
admin... | UTF-8 | Python | false | false | 390 | py | 60 | admin.py | 36 | 0.769231 | 0.769231 | 0 | 10 | 38 | 116 |
kkang2097/GP-Derivatives-Variational-Inference | 962,072,710,117 | 32c283364a814de9c7b731d0680afbebfc796781 | 359dcdb32288a300d3dcd9402532e4433c1b0c81 | /experiments/rover/random_search.py | f5193a9c0d51dc158be05cb9d98361228f81704e | [] | no_license | https://github.com/kkang2097/GP-Derivatives-Variational-Inference | 7d94cec6171a20587887282724dd87ec37f2131f | 0699c5ef20132f92e0bd4f41525eb09f6fd2c118 | refs/heads/main | 2023-08-20T10:43:31.166748 | 2021-10-25T20:46:21 | 2021-10-25T20:46:21 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import numpy as np
from rover import rover_obj
import sys
if __name__ == '__main__':
dim = 200
max_evals = 2000
lb = -5 * np.ones(dim)
ub = 5 * np.ones(dim)
batch_size = 5
num_epochs = 30
from datetime import datetime
now = datetime.now()
seed = int("%d%.2d%.2d%.2d%.2d"%(now.month,now.day,... | UTF-8 | Python | false | false | 769 | py | 62 | random_search.py | 54 | 0.617685 | 0.590377 | 0 | 31 | 23.709677 | 96 |
alejandropages/CSCE411 | 6,493,990,597,713 | 513bfc7ceb13936d7dae28e79e949a6cb1c15d5f | 65522d34316c37a35093c543ef8e10f25ad5fe4d | /Assignment3/Stage1/Stage1_Stepb/dataParser/parser.py | 4fe9f5a4ef8e3325c22480d15a359f4bffc64678 | [] | no_license | https://github.com/alejandropages/CSCE411 | 218599ccad399539aa426f150da4d4703186327c | 665648b6fa39c454a650cbaddfda801c0ff441d1 | refs/heads/master | 2020-04-02T02:56:12.055957 | 2018-12-04T14:38:17 | 2018-12-04T14:38:17 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
def main():
# data = loadData("data3.txt")
# data = loadData("data2.txt")
data = loadData("data.txt")
for entry in data:
print(entry["id"] + ": " + entry["name"])
if "state" in entry:
print(entry["state"] + " - " + entry["city"])
# for message in entry["messages... | UTF-8 | Python | false | false | 3,120 | py | 39 | parser.py | 20 | 0.542949 | 0.534936 | 0 | 116 | 25.887931 | 61 |
vertexproject/synapse | 5,454,608,493,252 | a303a6f7bcd00b094a57de4e575d0abd286bb345 | c5f7019c52cd91a3d9505943b9d866539f2fb0bc | /synapse/lib/cli.py | 0155ccf59d03a6c1d0ced10b751218664e8d7fef | [
"Apache-2.0"
] | permissive | https://github.com/vertexproject/synapse | ce31699fcb10cb2c870d448915f4d4524247e2d0 | 1808dff78921b4bfdb451a12ee5d03427a5295b9 | refs/heads/master | 2023-09-03T23:48:26.584015 | 2023-08-31T20:34:35 | 2023-08-31T20:34:35 | 37,228,107 | 307 | 63 | Apache-2.0 | false | 2023-09-14T21:53:32 | 2015-06-10T23:29:41 | 2023-09-14T20:07:23 | 2023-09-14T21:53:31 | 27,459 | 310 | 69 | 20 | Python | false | false | import os
import json
import signal
import asyncio
import logging
import traceback
import collections
import regex
from prompt_toolkit import PromptSession, print_formatted_text
from prompt_toolkit.formatted_text import FormattedText
from prompt_toolkit.history import FileHistory
from prompt_toolkit.patch_stdout impo... | UTF-8 | Python | false | false | 14,389 | py | 508 | cli.py | 421 | 0.520954 | 0.519494 | 0 | 530 | 26.149057 | 104 |
5783354/awokado | 11,287,174,089,944 | 4a4393a7ae99b936b5171ed8bb00ed590e6e75dd | 41c7bb7e14475d92faa2a023ee489f73e4371d86 | /awokado/response.py | 029930a22b3e1174930814e2d64452fb0a3d0f7f | [
"MIT"
] | permissive | https://github.com/5783354/awokado | 4b024c4d96758545f7fb1c16deecc8528612c3b0 | 9454067f005fd8905409902fb955de664ba3d5b6 | refs/heads/master | 2022-12-21T13:00:02.853859 | 2021-05-21T12:22:21 | 2021-05-21T12:22:21 | 165,822,421 | 6 | 1 | MIT | false | 2022-12-08T07:44:33 | 2019-01-15T09:26:59 | 2021-05-21T12:22:26 | 2022-12-08T07:44:33 | 1,464 | 6 | 1 | 5 | Python | false | false | from typing import Dict, Optional, List
if False:
from awokado.resource import BaseResource
class Response:
"""
Response class helps to collect your data
and prepare it in a readable format for the Frontend (or another API Client)
You can override it in your resource to change response format::
... | UTF-8 | Python | false | false | 2,724 | py | 80 | response.py | 64 | 0.552496 | 0.548458 | 0 | 105 | 24.942857 | 80 |
HeptaKos/bluetooth_speaker | 3,195,455,708,620 | 9c6e3a47d4af43149d9f52b7a89d930a2b632d17 | 1588e3b48dfda7801430b71493ab039bb8c378dd | /spider/papapapa.py | 39ef4e280b2e3e21c6f6c53f6b1f6f4d9be48de9 | [] | no_license | https://github.com/HeptaKos/bluetooth_speaker | 4b2fe7032197d49c753bf4c67268f8323eec5cf6 | 2ddb31c34c142305cfc8be77bc41d80f116f30dc | refs/heads/master | 2020-07-04T10:00:50.696272 | 2019-08-14T01:32:39 | 2019-08-14T01:32:39 | 202,249,694 | 1 | 0 | null | true | 2019-08-14T01:28:02 | 2019-08-14T01:28:01 | 2019-08-14T01:26:08 | 2019-08-14T01:26:07 | 0 | 0 | 0 | 0 | null | false | false | import re
import requests
from urllib import error
from bs4 import BeautifulSoup
import os
import json
from PIL import Image
import os.path
import glob
num = 0
numPicture = 0
file = ''
List = []
def Find(url):
global List
print('正在检测图片总数,请稍等.....')
t = 0
i = 1
s = 0
while t < 1000:
Ur... | UTF-8 | Python | false | false | 3,779 | py | 2 | papapapa.py | 1 | 0.490106 | 0.479208 | 0 | 134 | 25.022388 | 96 |
maresh88/projects_tracker | 8,856,222,601,820 | acf5880683b888b7986acdb4a02b75480b5c9cbf | 28aac09a102d68d88a7ca5c4fffb84bced7c5fab | /projects/migrations/0004_auto_20210525_1605.py | c2ad9ed5c6082ed40287365d12ad55d061d7255d | [] | no_license | https://github.com/maresh88/projects_tracker | 3f6fbb11398765ae46a6d4ef34fd1e0fe964cbdb | 2c5bf6485b4f4766b20abde6f135550fe207746b | refs/heads/master | 2023-05-07T11:47:14.932618 | 2021-06-01T08:34:33 | 2021-06-01T08:34:33 | 368,487,894 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Generated by Django 3.2.3 on 2021-05-25 13:05
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0003_comment_profile'),
]
operations = [
migrations.AlterModelOptions(
name='comment',
options={'ordering': ('cr... | UTF-8 | Python | false | false | 422 | py | 29 | 0004_auto_20210525_1605.py | 23 | 0.561611 | 0.516588 | 0 | 20 | 20.1 | 50 |
jergusg/keyboard-tester-app | 14,594,298,890,803 | 00a683f131b320bd6248a89469c2cc98771babfc | e7e79b41bf01c7f970a081387a0f7b7223ad450a | /python-generator/words.py | d81d8f4fedb851b79745f2ebbaf4acaeb29ecaf6 | [] | no_license | https://github.com/jergusg/keyboard-tester-app | 92f0af1907945aa6376b685609c0dd288cb78943 | ee9a1717f588a25b1e610194cbd2094e04caa53d | refs/heads/master | 2020-03-18T00:00:13.458255 | 2018-06-05T14:36:21 | 2018-06-05T14:36:21 | 134,072,963 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
words = [
'organizácia',
'schopnosť',
'rozhodnutie',
'prehrávač',
'efektívnosť',
'inštrukcia',
'bývanie',
'chlieb',
'iniciatíva',
'sloboda',
'filozofia',
'príbeh',
'vysvetlenie',
'recept',
'aspekt',
'výsledok',
'rieka',
'pieseň',
'jednotka',
'kapitola',
'systém',
'zmät... | UTF-8 | Python | false | false | 915 | py | 13 | words.py | 11 | 0.569966 | 0.56314 | 0 | 68 | 11.294118 | 54 |
manifolded/five-bit-poskitt | 15,642,270,920,685 | 7721d8f67b249e520b03b2cf08ccfd1fad6c82d9 | 908541b1ec06d6117b3f133e659a26e4701f4f24 | /cipher-grid/genCipherGrid.py | 7d7bdc0c6e358959db68494ca0393914f9575808 | [
"MIT"
] | permissive | https://github.com/manifolded/five-bit-poskitt | d52c4aed7bf4e9a1e27dddf4f13140abb2d782c8 | 7fc5e5470b6158694ee62198473ead547051efa5 | refs/heads/master | 2021-01-22T02:13:07.618301 | 2020-09-17T05:11:51 | 2020-09-17T05:11:51 | 92,338,154 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/Users/keith/anaconda/bin/python2.7
from string import ascii_lowercase
from prettytable import PrettyTable
# pylint: disable=C0103
# http://www.sitesbay.com/python-program/python-print-alphabet-pattern-in-python
def ciphertext(offset):
ciphertext = [str(offset)]
for i in range(0, 26):
ciphertext.app... | UTF-8 | Python | false | false | 1,003 | py | 7 | genCipherGrid.py | 4 | 0.6999 | 0.675972 | 0 | 39 | 24.717949 | 80 |
NeTatsu/video-diff | 1,683,627,223,074 | 31a32943e6e75d49faa2d86c4de641d68fcbb447 | b30c31f07a3eaa3d0822bcb15d5ea9024929c8ed | /Python/ReadVideo.py | 3af9c809c8c6c4bbc2d121c6afd7bf2f84832c25 | [
"BSD-3-Clause"
] | permissive | https://github.com/NeTatsu/video-diff | 238f9a980c0193fc8459719c04d3fec54f06a3f4 | c2eb75373d20aefc82a0d8d198eddd7eb9b9675a | refs/heads/master | 2023-01-24T19:49:05.492759 | 2020-12-08T07:42:47 | 2020-12-08T07:42:47 | 269,405,610 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import cv2
import os
import traceback
import shutil
import sys
# Find max number of matched features with Simulated annealing
import common
import config
if config.OCV_OLD_PY_BINDINGS == True:
import cv
if config.USE_EVANGELIDIS_ALGO == False:
import MatchFrames
import SimAnneal
captureQ = None
frame... | UTF-8 | Python | false | false | 16,701 | py | 12 | ReadVideo.py | 10 | 0.630501 | 0.614993 | 0 | 465 | 34.913978 | 141 |
CoronaCircles/coronacircles-django | 11,905,649,372,177 | 5c14329221a81b786397f5498d495138fe73a623 | 7a4761243b563e203b507facefdf3382ce63dbb5 | /main_app/migrations/0003_auto_20200413_0115.py | 4ba8756df00a5758425620f63c2453d37d686d3a | [] | no_license | https://github.com/CoronaCircles/coronacircles-django | f8dcc8a1c0ebd027fe0c96f920b0c12c00c6070e | f3091f239307bd25557944e5c51ed26546e308d7 | refs/heads/master | 2022-04-19T03:20:21.498595 | 2020-04-20T13:25:34 | 2020-04-20T13:25:34 | 254,603,787 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Generated by Django 2.2.12 on 2020-04-12 23:15
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('main_app', '0002_auto_20200413_0112'),
]
operations = [
migrations.AlterField(
model_name='event',... | UTF-8 | Python | false | false | 629 | py | 16 | 0003_auto_20200413_0115.py | 9 | 0.605723 | 0.554849 | 0 | 24 | 25.208333 | 74 |
JKChenFZ/EAS-ETL | 16,569,983,828,473 | 1971ecf2a7d0c7bbdfefd886004a997137e58c83 | ce29771a146cce0121a73a14033bae9e9d1fb4d1 | /run_crontab_load.py | b636e8015a968b7dc4a0ebfd7da66cdb1ce24010 | [] | no_license | https://github.com/JKChenFZ/EAS-ETL | 874c31b46e4541b062ef8cd07f13e54a3eadb8d0 | f8aa02fc5c4a645143761a2f804a9ce77539863a | refs/heads/master | 2021-06-11T05:14:38.735418 | 2018-04-14T04:25:26 | 2018-04-14T04:25:26 | 128,496,060 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from load_history.crontab import EASCrontabUtil
import datetime
if __name__ == '__main__':
print('--------------Start-----------------------------')
print(datetime.datetime.utcnow())
loader = EASCrontabUtil()
loader.run_loader()
print('--------------Done------------------------------')
| UTF-8 | Python | false | false | 309 | py | 9 | run_crontab_load.py | 7 | 0.475728 | 0.475728 | 0 | 9 | 33.222222 | 61 |
ThenTech/NIIP-Labo | 12,601,434,048,430 | 101a43c815115ad028c1e393bbacce3b1ff03581 | ff4d3189252012640fe264a49012403820157dd8 | /Lab3/Opdracht_1/broker/mqtt/mqtt_packet.py | 2d1b4fc657311eb060f81628a6f50f76ad45d9aa | [] | no_license | https://github.com/ThenTech/NIIP-Labo | 60aaaa6a0b269949123f38d88583c12dd64f0284 | e71b423c612f0847357976ce469668d00099e8b5 | refs/heads/master | 2022-08-21T15:58:31.858152 | 2020-05-28T10:09:01 | 2020-05-28T10:09:01 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from mqtt.bits import Bits
from mqtt.colours import *
from mqtt.mqtt_packet_types import *
from mqtt.mqtt_exceptions import *
from mqtt.mqtt_subscription import TopicSubscription
from mqtt.topic_matcher import TopicMatcher
class MQTTPacket:
PROTOCOL_NAME = b"MQTT"
def __init__(self, raw=b""):
super().... | UTF-8 | Python | false | false | 25,624 | py | 76 | mqtt_packet.py | 46 | 0.573017 | 0.557914 | 0.000117 | 643 | 38.8507 | 163 |
woniuxiaoan/naas | 7,988,639,215,109 | b4b569ff29435ef72edc40e0048c7541e121332f | 43992ff03c5401b12eaa6b2095dcbebd6aecdb84 | /naas/agent/version.py | 7016d823c81d69cbb67b5c0abf57d20ce03aa6e2 | [] | no_license | https://github.com/woniuxiaoan/naas | d8c0b85cc4c8316e383aa73655979addffd58631 | d1f16c06c393053194a64ff87c8db1f1c7fbb50d | refs/heads/master | 2016-06-12T04:41:01.438056 | 2016-04-13T05:23:59 | 2016-04-13T05:23:59 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """NAAS Agent Version Define."""
NAAS_AGENT_VENDOR = "nass"
NAAS_AGENT_PRODUCT = "agent"
NAAS_AGENT_VERSION = "1.0"
def version_string():
return "%s:%s:%s"\
% (NAAS_AGENT_VENDOR, NAAS_AGENT_PRODUCT, NAAS_AGENT_VERSION)
| UTF-8 | Python | false | false | 233 | py | 98 | version.py | 87 | 0.652361 | 0.643777 | 0 | 9 | 24.888889 | 69 |
fin/cocoaether | 12,034,498,380,432 | e4668da27cf503c06d077cdba6884af0f23879b6 | 957c7f222073f262cf3cc66ace77c470325abcbb | /plugin/src/xcController.py | 54159c89169001fb4a4279331ceec1be04cd04ed | [] | no_license | https://github.com/fin/cocoaether | 69f086042ab4eb26ce6825358009f12a59876166 | aeb7d462e71e68d1ad61e551863b40b65666ae7c | refs/heads/master | 2020-04-27T21:04:13.382431 | 2011-02-03T15:10:15 | 2011-02-03T15:10:15 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #
# xcController.py
# aethercocoa
#
# Created by fin on 6/21/10.
# Copyright (c) 2010 __MyCompanyName__. All rights reserved.
#
from objc import YES, NO, IBAction, IBOutlet
from Foundation import *
from AppKit import *
import Cocoa
import objc
class xcController(NSWindowController):
computers = objc.IBOutlet(... | UTF-8 | Python | false | false | 1,040 | py | 10 | xcController.py | 8 | 0.663462 | 0.652885 | 0 | 32 | 31.46875 | 97 |
jirikuncar/analysis-preservation.cern.ch | 10,445,360,468,846 | f7a7c538051bc00a61222d68c3bf72de11ba0220 | 786f8a61774581de0d09b2e84be724d2e2fda6ff | /cap/modules/access/views.py | 495121483e0d8e0286838e796652679cc94d78af | [] | no_license | https://github.com/jirikuncar/analysis-preservation.cern.ch | a17e28ad73b12654fd08ba8ca763fb780a9544ca | 50e7de692c82cfe3724da8b523fd7bdbabf13cc9 | refs/heads/master | 2021-01-23T00:56:31.976634 | 2016-08-25T12:18:28 | 2016-08-25T12:18:28 | 67,034,322 | 0 | 0 | null | true | 2016-08-31T12:14:08 | 2016-08-31T12:14:06 | 2016-08-31T12:14:07 | 2016-08-30T14:04:27 | 3,425 | 0 | 0 | 0 | JavaScript | null | null | """Access blueprint in order to dispatch the login request."""
from __future__ import absolute_import, print_function
from flask import Blueprint
access_blueprint = Blueprint('cap_access', __name__,
url_prefix='/access',
template_folder='templates')
| UTF-8 | Python | false | false | 311 | py | 3 | views.py | 2 | 0.607717 | 0.607717 | 0 | 9 | 33.555556 | 62 |
Floweryu/HappyPython | 1,915,555,451,408 | e8cca0880572cb568331516a429845e6ffcdecb1 | 332b1394845226008d5dc3bae888b10b6a384edd | /WebSpider/VideoSpider/baotu.py | 049647ff1a1a11687ccb7e1bd3c9b6bf49cd392c | [] | no_license | https://github.com/Floweryu/HappyPython | 397f748aaefe75319061582d4ae348db46cd9713 | 3807214895d166402e143c2c193b770e17f4ce1c | refs/heads/master | 2022-03-25T23:51:04.451175 | 2019-12-18T07:54:54 | 2019-12-18T07:54:54 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding:utf-8 -*-
# _author_='Zhang JunFeng'
import requests
from lxml import etree
response = requests.get("https://ibaotu.com/shipin/")
html = etree.HTML(response.text)
title_list = html.xpath('//span[@class="video-title"]/text()')
src_list = html.xpath('//div[@class="video-play"]/video/@src')
for title, src i... | UTF-8 | Python | false | false | 555 | py | 58 | baotu.py | 28 | 0.649907 | 0.646182 | 0 | 16 | 32.625 | 62 |
abhisek176/py-cloudy | 1,245,540,516,982 | b29f80ca4539b50e8e168e3c695dd3ac30e5fab8 | d0fff767c26e9d07ffee5b1b76070c460f1f27dd | /cloudy/mcmc.py | 8efe95efb3c66fd6b684f012fce41270445fcc94 | [] | no_license | https://github.com/abhisek176/py-cloudy | d65f6f297f58a0c0c6e696162881fd8941812d32 | 024a57c5bcdabae671ecae8d018a43f638ae1432 | refs/heads/main | 2023-04-29T06:06:33.728847 | 2021-05-24T01:55:37 | 2021-05-24T01:55:37 | 370,198,449 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import numpy as np
import astropy.table as tab
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
import emcee
import corner
#----data
def get_true_model(model_Q, Q= 18):
"""
:param model: The data where Q18 model is stored
:return: a row of ion column densities at n_H = 1e-4 cm^-2
... | UTF-8 | Python | false | false | 5,848 | py | 28 | mcmc.py | 20 | 0.618844 | 0.593365 | 0 | 175 | 32.405714 | 117 |
Holinc19/Python-Demo | 13,443,247,662,260 | 074be3fd8dce3deb2bb4d1c242b87ae7b549ce2c | b6bfa98239955e4fcbe92850be4ce4ea9802f9b6 | /exception_demo.py | 217124801bc40f6785bfccfba4fbea1ab48449e0 | [
"MIT"
] | permissive | https://github.com/Holinc19/Python-Demo | e5b99821b0133cc632c50b37ca3b755812f30d7d | 8f771d29b4a73f9d76e2cd8bf30e7b3f9bf712dd | refs/heads/master | 2020-03-26T17:41:15.811518 | 2018-08-18T00:04:11 | 2018-08-18T00:04:11 | 145,174,546 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | class Networkerror(RuntimeError):
def __init__(self, arg):
self.args = arg
try:
# 1 / 0
raise Networkerror("Bad hostname")
except Networkerror as err:
print("自定义异常")
print(err.args)
except Exception as e:
'''异常的父类,可以捕获所有的异常'''
print("0不能被除")
else:
'''保护不抛出异常的代码'''
print("没... | UTF-8 | Python | false | false | 449 | py | 22 | exception_demo.py | 22 | 0.607843 | 0.59944 | 0 | 20 | 16.85 | 38 |
laranea/Decaf-Compiler | 16,063,177,703,956 | 36dc41eb7a951f2370cfd3bd22786c99449e6264 | 4d7d8840908ab10a0a96b9fc445059f1e76a7ce1 | /src/ast/Expressions/MethodInvocationExpr.py | a0e83a8f5a65c9c0f08ca841c424adb5f65805e9 | [] | no_license | https://github.com/laranea/Decaf-Compiler | 8a7d53d624a1bf76ac7a650b4f86f85b83e13916 | 4766024b871a8f5c3ad476190ec4e88c90d03171 | refs/heads/master | 2021-05-20T12:41:28.001718 | 2017-09-24T18:17:19 | 2017-09-24T18:17:19 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from Expr import *
from ast.ast_helpers import *
from ast.Type import *
from ast.Class import *
import ast.Config as Config
class MethodInvocationExpr(Expr):
def __init__(self, field, args, lines):
self.lines = lines
self.base = field.base
self.mname = field.fname
self.args = args
... | UTF-8 | Python | false | false | 1,816 | py | 39 | MethodInvocationExpr.py | 38 | 0.464207 | 0.462004 | 0 | 46 | 38.5 | 124 |
Gitnameisname/DLED-NACA-4 | 4,758,823,802,927 | 9aea632a54645a5273db95fdc241252bfaf76444 | e2ad80bba88ec0ae4047a4fe8a2a13ef3929ee15 | /NACA4_Config.py | 31cf2ba5e06132b60dfbc938f9ab146ebb72c030 | [] | no_license | https://github.com/Gitnameisname/DLED-NACA-4 | 2bb38a97916ef4c2e4e57d7c22fb66bcab19fc48 | 4458032996c334960fa3f72154f56263f5d091f3 | refs/heads/master | 2022-01-07T00:28:37.991949 | 2019-06-17T13:30:23 | 2019-06-17T13:30:23 | 191,868,159 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 12:28:14 2017
@author: Muuky
@author: K_LAB
"""
"""
Info
=====
Generate NACA 4 digit
"""
import numpy as np
import os
import sys
import matplotlib.pyplot as plt
workdirect=os.getcwd()
codedirect=os.path.dirname(os.path.realpath(__file__))
sys.path... | UTF-8 | Python | false | false | 4,484 | py | 65 | NACA4_Config.py | 16 | 0.523417 | 0.475245 | 0 | 165 | 25.187879 | 82 |
martinmcbride/python-for-gcse-maths | 489,626,314,013 | f2de1631f07f5130274c3868b1ee0a016fc62ffc | c23600a1dc68f88ed57e42a09c2a683e99b3c3c0 | /geometry/cairobase.py | 086196e43a33d76c3fb78b24831162ee6622c02e | [
"MIT"
] | permissive | https://github.com/martinmcbride/python-for-gcse-maths | 097797182a1dac7c937c19426a5f1051e4da1554 | 502daf85d045036655be44864db86ba78c83f6b2 | refs/heads/master | 2020-04-03T09:52:34.700751 | 2016-06-10T23:23:41 | 2016-06-10T23:23:41 | 60,217,112 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | ####
#
# cairobase.py
#
# Author martin.mcbride@axlesoft.com
# Copyright schoolcoders.com 2016
# MIT licence
#
####
import cairo
def save(draw, filename, width=500, height=500, fill=(1, 1, 1),
scale=25):
surface = cairo.ImageSurface (cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context (sur... | UTF-8 | Python | false | false | 1,278 | py | 3 | cairobase.py | 2 | 0.525822 | 0.48748 | 0 | 49 | 25.081633 | 69 |
SCARLETRAIN511/Python | 11,141,145,209,188 | 83c3011b36ddbe70ddb7ec672515f399588b6d41 | 0de8df3875beb874e9691e798aa7c2d199461519 | /leetcode/marshallWace.py | 2a9a16d9cdeaadf541b61ba1ca58b6e9798ddcb1 | [] | no_license | https://github.com/SCARLETRAIN511/Python | 695e6b7e823183e1f59a32ac4d26cfcfb23f4412 | 4d8a6e03a81322cb215e3989840549faf98fd71e | refs/heads/master | 2021-06-12T14:55:21.806772 | 2021-04-13T10:06:30 | 2021-04-13T10:06:30 | 180,573,108 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def solution(s):
# write your code in Python 3.6
letters = dict()
for i in s:
if i not in letters.keys():
letters[i] = 1
else:
letters[i] += 1
deleteNum = 0;
for j in letters.keys():
if letters[j] %2 != 0:
deleteNum += 1
... | UTF-8 | Python | false | false | 1,533 | py | 238 | marshallWace.py | 230 | 0.451402 | 0.429224 | 0 | 70 | 20.914286 | 42 |
anup5889/AnalyzingNYCDataSet | 14,216,341,785,306 | f6f09213d7f5af1fe287ab868d8d9f9e2ad4bfbc | 712acf1e7c48d839a4e211a73434f1ee17f71edf | /TitanicDataSetExercise/SimpleHueristic.py | 6c9a497e46ef4f4dceef11afa21e128951d93f22 | [] | no_license | https://github.com/anup5889/AnalyzingNYCDataSet | c5d62852556178b1559735bb20feff584b99d74b | 5136b410e735f936fb67d54a2bbc84f9a6f13314 | refs/heads/master | 2021-01-21T04:35:42.545849 | 2016-06-11T22:53:56 | 2016-06-11T22:53:56 | 40,094,916 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import numpy
import pandas
import statsmodels.api as sm
def simple_heuristic(file_path):
predictions = {}
df = pandas.read_csv(file_path)
for passenger_index, passenger in df.iterrows():
passenger_id = passenger['PassengerId']
if passenger['Sex']=='male':
predictions[passenger... | UTF-8 | Python | false | false | 696 | py | 3 | SimpleHueristic.py | 2 | 0.600575 | 0.594828 | 0 | 24 | 27.916667 | 57 |
kielejocain/AM_2015_06_15 | 14,817,637,203,170 | 3b65995961e3224fe4cce017bfc25b8ddb243b3f | 17e496f9b28dfcf25608994276d4fb36aaa2de9e | /StudentWork/bestevez32/Week_3/Name in Ascii.py | 39adf69af10c1f81290b58dbffe0fc19570aec48 | [] | no_license | https://github.com/kielejocain/AM_2015_06_15 | b29a6a9be3f20c11dfe723343913936441df4270 | 0b2955582a6fdbc98db2cb39e8f4f2f0c44ba65a | refs/heads/master | 2021-07-16T12:51:30.485125 | 2020-06-16T23:28:59 | 2020-06-16T23:28:59 | 37,479,388 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | s = "BJE"
for c in s:
print c
print ord(c)
for string_to_ascii in (s):
output = []
for c in s:
v = ord(c)
# opposite of chr
output.append(v)
print(bin(v))
return output
print(string_to_ascii("BJE"))
print(string_to_ascii("Brandon"))
| UTF-8 | Python | false | false | 300 | py | 541 | Name in Ascii.py | 304 | 0.52 | 0.52 | 0 | 17 | 16.647059 | 33 |
Tashunya/Inspection2 | 9,216,999,867,488 | 0bd0782996ca39cf0f54d5a41ebcbf92fc1ee8ae | ac628ae0ec7c715197da432974a3705ef1a46ec0 | /app/api_1_0/errors.py | c49ba269f23ad8f25753658866cae43868ccfc47 | [] | no_license | https://github.com/Tashunya/Inspection2 | 22c2540cc476563400bf52c558d3555efab84823 | 3a2d81bef8dfe58ef9de6757664cbb858e34f607 | refs/heads/master | 2023-03-05T03:15:55.211056 | 2022-04-24T16:25:52 | 2022-04-24T16:25:52 | 187,200,501 | 1 | 1 | null | false | 2023-02-15T21:52:20 | 2019-05-17T10:55:41 | 2023-01-11T14:56:15 | 2023-02-15T21:52:16 | 573 | 1 | 1 | 6 | Python | false | false | """
The module is used to handle errors for api
"""
from flask import jsonify
def forbidden(message):
"""
Returns error response if route is forbidden
:param message:
:return:
"""
response = jsonify({'error': 'forbidden', 'message': message})
response.status_code = 403
return response... | UTF-8 | Python | false | false | 819 | py | 44 | errors.py | 25 | 0.644689 | 0.6337 | 0 | 38 | 20.552632 | 69 |
maths22/trawl | 1,099,511,638,771 | 8c6119262541edc685aa39542542c68d6702032d | a2156e3a66e16ece72fcabc2feb4dd215080aa5c | /phishing/forms.py | b20cfa9113e53e2dfca52df7b463f3d4177cbb0d | [] | no_license | https://github.com/maths22/trawl | 7837fa52161433d7d44c23ddcd26bcddf5ad32fc | 1160c6fd816175f374289738b5553707cd3b9267 | refs/heads/master | 2020-03-15T22:28:19.320188 | 2018-06-02T03:12:06 | 2018-06-02T03:12:06 | 132,374,126 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import datetime
import boto3
from django import forms
from .models import Submission, MTurkUser, EvaluationTask
# import the logging library
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
create_hits_in_live = False
environments = {
"live": {
"endpoint": "ht... | UTF-8 | Python | false | false | 3,461 | py | 11 | forms.py | 8 | 0.589425 | 0.578734 | 0 | 108 | 31.037037 | 131 |
chan3256995/vueproject | 17,746,804,871,809 | 7e6b45b7f78c989b21882816fee6d7fe8924aa9a | 75c3ce2153613a0ff754f51062beec325aa2bb26 | /xiaoEdaifa/backstage/urls.py | 0b7210faa95464c4925223189119455b2ea00e81 | [] | no_license | https://github.com/chan3256995/vueproject | a3c600ea2880b694a53b6f346bcb840581a7d1fc | 681d5a943f8699750ced49b40097bb7f24c810aa | refs/heads/master | 2023-02-21T04:21:01.964410 | 2023-02-10T11:14:13 | 2023-02-10T11:14:13 | 198,947,244 | 0 | 0 | null | false | 2022-12-11T20:30:08 | 2019-07-26T04:39:25 | 2022-01-08T05:58:58 | 2022-12-11T20:30:07 | 4,053 | 0 | 0 | 40 | JavaScript | false | false | """xxdaina URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | UTF-8 | Python | false | false | 7,985 | py | 148 | urls.py | 87 | 0.667053 | 0.66198 | 0 | 138 | 48.992754 | 112 |
dmaclay/vumi | 3,367,254,388,124 | 6b93ee2011e46651399ea1604dce3d825ec08206 | 1fb80842534d8c810610d2996a2950814810a3e0 | /vumi/workers/smpp/client.py | 7a2b11ef5fb2dfc569c5987dfc17d549fb7b0939 | [
"BSD-2-Clause"
] | permissive | https://github.com/dmaclay/vumi | e31779d92478e3ff52f7cf1fd31f803f81098ba0 | 0d44e435bd01606f6fe168e7ed4906a63bca9003 | refs/heads/master | 2021-01-18T09:56:07.030517 | 2011-09-19T14:36:09 | 2011-09-19T14:36:09 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import re
import json
import uuid
import redis
from twisted.python import log
from twisted.internet.protocol import Protocol, ReconnectingClientFactory
from twisted.internet.task import LoopingCall
import binascii
from smpp.pdu import unpack_pdu
from smpp.pdu_builder import (BindTransceiver,
... | UTF-8 | Python | false | false | 26,369 | py | 74 | client.py | 57 | 0.552391 | 0.55004 | 0 | 638 | 40.330721 | 120 |
carsonk/betrayal-utils | 2,448,131,367,199 | dcb3f927e6e57d9d5a9bcbe6f598a622d29ff198 | 4799f7af76c51c7cd081f0ee73d4e4c47306a73b | /game_tracker/migrations/0003_auto_20151229_2229.py | ac387e0234281dc04efd38d1da15109a42782a27 | [] | no_license | https://github.com/carsonk/betrayal-utils | 02983c290255f290a925397eaa2f20f183db8747 | 61018c29d874b54863bf0f7829e74cb9b847a867 | refs/heads/master | 2021-01-10T13:30:39.581594 | 2015-12-31T03:20:54 | 2015-12-31T03:20:54 | 48,719,284 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-30 03:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('game_tracker', '0002_character_name'),
]
operations = [
migrations.RenameField... | UTF-8 | Python | false | false | 1,731 | py | 11 | 0003_auto_20151229_2229.py | 7 | 0.53264 | 0.514731 | 0 | 59 | 28.338983 | 63 |
charles-freitas/2018.2-ProgComp | 773,094,160,284 | f25ba493a65667dd248b5a492541679b971e04be | bcbaec1422a84aebdd1c307114b43c33fb12fa1a | /20181018 - Cartela Bingo/cartela_bingo_v2.py | f19aed56989ea7a0ec9386118cf5b9d6e88338e6 | [] | no_license | https://github.com/charles-freitas/2018.2-ProgComp | 80a5581745840c153783632c053b3f550d3e4751 | b8a5f509522a572d243ac5976aac2e3b42145fb9 | refs/heads/master | 2018-11-02T08:45:30.432189 | 2018-11-02T00:09:41 | 2018-11-02T00:09:41 | 145,893,635 | 0 | 4 | null | null | null | null | null | null | null | null | null | null | null | null | null | import random
lista_B = []
lista_I = []
lista_N = []
lista_G = []
lista_O = []
for contador in range(1, 6):
# Gerando um número inteiro aleatório entre 1 e 15
numero_B = random.randint(1,15)
# Adicionando o número gerado na lista se ele não já estiver nela
if numero_B not in lista_B: lista_B.append(numero... | UTF-8 | Python | false | false | 1,349 | py | 58 | cartela_bingo_v2.py | 56 | 0.708145 | 0.680995 | 0 | 40 | 32.125 | 68 |
briandrawert/stochss | 11,338,713,688,004 | b288a8e251ef8a7efd66296f851aabbb111517f7 | 5d1655135be351c42cd0f856fe94a410296a61ec | /app/backend/bin/sccpy.py | 3c8ea3217b7a3c366f2f394c057ca12ed9f56308 | [
"BSD-3-Clause"
] | permissive | https://github.com/briandrawert/stochss | 5570cfcbd4614a17f5ffd72d1c285d6f61c2741a | 61cebc8cc4c5d00225845c60442906cf7a0bc7e1 | refs/heads/master | 2021-01-16T19:36:10.527465 | 2018-04-26T14:50:20 | 2018-04-26T14:50:20 | 12,758,360 | 0 | 0 | NOASSERTION | true | 2018-09-28T14:58:01 | 2013-09-11T14:26:25 | 2018-04-26T14:51:04 | 2018-09-28T14:58:01 | 347,007 | 0 | 0 | 0 | Python | false | null | #!/usr/bin/env python
import sys
import logging
import os
import argparse
import boto
import boto.s3
from boto.s3.lifecycle import Lifecycle, Expiration
def get_scp_command(user, ip, keyfile, target, source):
return 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {keyfile} {source} {user}@{ip... | UTF-8 | Python | false | false | 4,679 | py | 260 | sccpy.py | 178 | 0.60483 | 0.596922 | 0 | 124 | 36.725806 | 127 |
pinieco23/energiaEvoluciona | 3,556,232,950,842 | 97511df42be334771897a2e3317650b9b2b47040 | ae267c6177190ba25e737a966dbc0a48caf0b628 | /energias/admin.py | ba1ec34900119ec28f43224f6400437124df7788 | [] | no_license | https://github.com/pinieco23/energiaEvoluciona | eb56aa70a0d52b3b4b36cb93f952a647ce7b51fb | cd3a9622cfa3cfa0900235a2372772b223c43386 | refs/heads/master | 2023-04-07T12:25:56.529014 | 2019-02-15T20:04:07 | 2019-02-15T20:04:07 | 355,335,372 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.contrib import admin
from energias.models import contenedor_1, contenedor_2, contenedor_3,imagenes_c3, experto, redes, contenedor_5, comision, fuentes
admin.site.register(contenedor_1)
admin.site.register(contenedor_2)
admin.site.register(contenedor_3)
admin.site.register(imagenes_c3)
admin.site.register... | UTF-8 | Python | false | false | 449 | py | 18 | admin.py | 12 | 0.817372 | 0.7951 | 0 | 14 | 31.142857 | 129 |
swastishreya/HelloFriend | 3,521,873,216,327 | 8bb06f8aa4f9d8cde68240d9d308cd5a38d4fe53 | 13eea0f00071355d93806d359e2b6a0270774802 | /backend/hello_friend_db_api/tests/__init__.py | 8b7d702d42a230f69cdac31667760b6cab82830e | [] | no_license | https://github.com/swastishreya/HelloFriend | 8ddf1ffafe868916cb0e87458b1125b6099710c9 | 16064de5f0615a279b58c1a547cdf10ec7a91c67 | refs/heads/main | 2023-04-30T06:18:06.989752 | 2021-05-19T15:04:43 | 2021-05-19T15:04:43 | 359,912,927 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | from hello_friend_db_api.tests.model_test import *
from hello_friend_db_api.tests.view_test import * | UTF-8 | Python | false | false | 100 | py | 19 | __init__.py | 13 | 0.79 | 0.79 | 0 | 2 | 49.5 | 50 |
ntnu-ai-lab/HUNT4-HAR | 6,305,012,029,900 | 9733935d31ead85278e179aebe98d432aafdb11b | f31b8b5a0777c25f55d9156b44043b821f225728 | /HAR_PostProcessing/playground/weekdays.py | c95f43349737c18532f56002b7e563af0a929bcb | [] | no_license | https://github.com/ntnu-ai-lab/HUNT4-HAR | 49805508aa312ab2f079b6cdabafa4d8085fc680 | 9bd72ebe21b1b6234297536981a5d737962ff470 | refs/heads/master | 2023-03-20T04:57:04.879176 | 2019-09-27T07:46:38 | 2019-09-27T07:46:38 | 136,932,423 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pandas as pd
import Dictinaries
data_raw = pd.read_csv("../output/1176_summary.csv", parse_dates=[0])
data = data_raw[['date','lying']]
data = data.set_index('date')
data = data.divide(60 * 60)
x_lab_data = data
x_lab_data['weekday'] = data.i... | UTF-8 | Python | false | false | 571 | py | 68 | weekdays.py | 63 | 0.660245 | 0.642732 | 0 | 22 | 25 | 80 |
ursgal/ursgal | 12,146,167,518,942 | 741639dffa43ed790f6d15b93308a21a5737555b | 5fe963f6ecd0db1e7800c78d29737f4bab92ea8c | /ursgal/resources/platform_independent/arc_independent/get_ftp_files_1_0_0/get_ftp_files_1_0_0.py | b16e3dade0fd85eeae5193c6e8bb0ed787f5a662 | [
"MIT",
"LGPL-3.0-only"
] | permissive | https://github.com/ursgal/ursgal | 746c30d7eeb7e83dc520adc9b47c74b6ee1f5503 | 25ed2fc75cbb4bd6656aa11df95023cb6acd1929 | refs/heads/dev | 2022-10-13T06:28:02.572027 | 2022-07-08T12:57:39 | 2022-07-08T12:57:39 | 44,454,082 | 39 | 54 | MIT | false | 2023-09-04T14:04:38 | 2015-10-17T20:49:38 | 2023-07-30T06:35:21 | 2023-09-04T14:04:38 | 13,693 | 41 | 31 | 4 | Python | false | false | #!/usr/bin/env python
# encoding: utf-8
"""
Retrieve data from ftp server
usage:
get_ftp_files_1_0_0.py <ftp_address> <login> <password> <filter_entension>
"""
# import glob
import ftplib
from ftplib import FTP
import os
import tempfile
def main(
ftp_url=None,
folder=None,
login=None,
passwor... | UTF-8 | Python | false | false | 4,743 | py | 288 | get_ftp_files_1_0_0.py | 216 | 0.473329 | 0.466582 | 0 | 145 | 31.710345 | 110 |
bowdenk7/yago | 1,322,849,936,898 | 13a7ae241b4fc407a88ed7a0a42c4c1c28b1e178 | 68029c4d4282ea55a14280ab33a32de31a3ed6d9 | /feed/admin.py | c7420597399aef2a6369ba8f9132b272042b2ed2 | [] | no_license | https://github.com/bowdenk7/yago | 7c020b589a57864e5c2caaa526178444ccce1eea | 40df55022b16d5eae12f2e888a904aecab6dfd43 | refs/heads/master | 2020-12-25T14:08:24.341516 | 2015-04-17T00:40:12 | 2015-04-17T00:40:12 | 30,390,747 | 5 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.contrib import admin
from feed.models import VenueClassification, Venue, District
admin.site.register(VenueClassification)
admin.site.register(Venue)
admin.site.register(District) | UTF-8 | Python | false | false | 195 | py | 32 | admin.py | 28 | 0.835897 | 0.835897 | 0 | 9 | 20.777778 | 60 |
xmxoxo/Text-Opinion-Mining | 17,325,898,107,360 | e705383c046951987ce2fed82a18ab21191fe2f5 | 462232447fc046828a26dbc8a2225835bc812c1e | /modelscore.py | 10961847e252039a0d5993267d0ee7a4550ae888 | [] | no_license | https://github.com/xmxoxo/Text-Opinion-Mining | 74e6bef618a8c55fa20a114f8b68b426269e984f | 3b6b2a14070eb3cf9446260f87d21a32ef5ed185 | refs/heads/master | 2023-02-22T22:58:04.496770 | 2021-01-29T01:52:50 | 2021-01-29T01:52:50 | 204,389,839 | 40 | 18 | null | true | 2019-08-26T03:38:39 | 2019-08-26T03:38:39 | 2019-08-23T08:42:42 | 2019-08-23T08:42:41 | 0 | 0 | 0 | 0 | null | false | false | #!/usr/bin/env python3
#coding:utf-8
# update : 2019/8/30 8:31
# version: 0.2.0
__author__ = 'xmxoxo<xmxoxo@qq.com>'
'''
模型评价工具 modelscore.py
电商评论观点挖掘 比赛 https://zhejianglab.aliyun.com/entrance/231731/introduction
四、评分标准
1、相同ID内逐一匹配各四元组,若AspectTerm,OpinionTerm,Category,Polarity四个字段均正确,则该四元组正确;
2、预测的四元组总个数记为P;真实标注的四元组... | UTF-8 | Python | false | false | 4,929 | py | 68 | modelscore.py | 7 | 0.60572 | 0.585676 | 0 | 147 | 26.829932 | 84 |
sandeepkumar8713/pythonapps | 6,365,141,564,207 | e61b336a2e5024b7151bd88eed475c34fc301019 | 8a83bb7acb9b62183fca817e1f196dd8075630a4 | /22_secondFolder/26_min_diff_subset.py | eba3c37b37d37a631194de25459884ff11cfd4af | [] | no_license | https://github.com/sandeepkumar8713/pythonapps | ff5ad3da854aa58e60f2c14d27359f8b838cac57 | 5dcb5ad4873124fed2ec3a717bfa379a4bbd197d | refs/heads/main | 2023-09-01T04:12:03.865755 | 2023-08-31T07:04:58 | 2023-08-31T07:04:58 | 234,762,925 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # https://leetcode.com/discuss/interview-experience/343949/Google-or-L4-or-Bay-Area-or-July-2019
# Question : Given an array of intergers divide them into n subsets such that difference
# between sum of each subset is minimum.
#
# Example : input [1,1,4,2,8] and n=2
# output = [1,1,4,2] and [8]
#
# input [1,1,4,2,8] an... | UTF-8 | Python | false | false | 657 | py | 757 | 26_min_diff_subset.py | 741 | 0.680365 | 0.625571 | 0 | 16 | 40.0625 | 110 |
ehan831/coding_study | 4,191,888,100,780 | bf9dc115380b3662f1373eec2c9968dd40167d7e | 0ca0471d6457d8dcacc5f3433af586bed44cb7af | /python/aBasic/c_module_class/myfile.py | b2f0df7fa561e59c216034d7c419b07a2ba8ff1d | [] | no_license | https://github.com/ehan831/coding_study | 61f47a8b5a7fe448fc71a868637590821d988729 | 14958b6b4642e6488156091293e854cc36cf9411 | refs/heads/master | 2022-12-21T20:29:10.265425 | 2019-09-05T04:07:22 | 2019-09-05T04:07:22 | 181,843,058 | 0 | 0 | null | false | 2022-12-16T00:45:37 | 2019-04-17T07:50:37 | 2019-09-05T04:07:56 | 2022-12-16T00:45:33 | 116,081 | 0 | 0 | 7 | Jupyter Notebook | false | false | # 1. 모듈 전체를 참조할 때에는 import
# import mymodule
#
# today = mymodule.get_weather()
# print('오늘의 날씨는', today)
# print(mymodule.get_date(), '요일입니다.')
# 2. 모듈에 별칭 부여
# import mymodule as my
# today = my.get_weather()
# print('오늘의 날씨는', today)
# print(my.get_date(), '요일입니다.')
# 3. 모듈에서 필요한 부분만 import
from mymodule import g... | UTF-8 | Python | false | false | 558 | py | 433 | myfile.py | 280 | 0.667431 | 0.66055 | 0 | 21 | 19.761905 | 38 |
Khelgrin/pytest_tutorial | 5,566,277,618,359 | 131038ca922801dda325c37f583c0e2aabc35b32 | 188e0d3fad2fa1afad7e7e6eb92152440a8544db | /tests/fileReader_tests/test_FileReader_Mocking.py | 6840c6bf646a35b9a83fa352fcb349ef26b3c48c | [] | no_license | https://github.com/Khelgrin/pytest_tutorial | 3a186875e36c557ffac22a2c1a40804c287a3ad2 | c1dd2efe0b3591cfc3e5b204446a366eff020287 | refs/heads/master | 2022-04-11T01:05:02.239298 | 2020-04-03T23:15:59 | 2020-04-03T23:27:27 | 252,861,711 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
from Filereader import read_from_file
from unittest.mock import MagicMock
import pytest
# def test_can_call_read_from_file():
# read_from_file("myfile")
@pytest.fixture()
def mock_open(monkeypatch):
mockfile = MagicMock()
mockfile.readline = MagicMock(return_value="test line")
mock_open = MagicMock(re... | UTF-8 | Python | false | false | 934 | py | 9 | test_FileReader_Mocking.py | 7 | 0.714133 | 0.714133 | 0 | 28 | 32.357143 | 63 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.