hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2510cbb743f1f29e0bb13e1ae7ff3435645c3b4d | 184 | py | Python | libs/db_check.py | redpeacock78/bach_bot | 086efe4d6eef05fbdff6af34534e54e43fd9af88 | [
"MIT"
] | null | null | null | libs/db_check.py | redpeacock78/bach_bot | 086efe4d6eef05fbdff6af34534e54e43fd9af88 | [
"MIT"
] | null | null | null | libs/db_check.py | redpeacock78/bach_bot | 086efe4d6eef05fbdff6af34534e54e43fd9af88 | [
"MIT"
] | null | null | null | import mysql.connector as mydb
conn = mydb.connect(
host='mysql_container',
port='3306',
user='docker',
password='docker',
database='my_db'
)
conn.is_connected()
| 15.333333 | 30 | 0.657609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.25 |
2511753f88ea48953fbf7d9fff0197ffc5356c2e | 752 | py | Python | students/models/exams.py | samitnuk/studentsdb | 659c82f7bdc0d6a14074da14252384b9443e286c | [
"MIT"
] | null | null | null | students/models/exams.py | samitnuk/studentsdb | 659c82f7bdc0d6a14074da14252384b9443e286c | [
"MIT"
] | null | null | null | students/models/exams.py | samitnuk/studentsdb | 659c82f7bdc0d6a14074da14252384b9443e286c | [
"MIT"
] | null | null | null | from django.db import models
class Exam(models.Model):
"""Exam Model"""
class Meta(object):
verbose_name = 'Іспит'
verbose_name_plural = 'Іспити'
title = models.CharField(
max_length=256,
blank=False,
verbose_name='Назва предмету')
datetime = models.DateTimeF... | 22.117647 | 60 | 0.599734 | 786 | 0.96088 | 0 | 0 | 0 | 0 | 0 | 0 | 181 | 0.221271 |
25132e1264d30cca913fe293f3805c8d79177d9b | 2,201 | py | Python | club_crm/api/clubtour.py | VivekChamp/clubcrm | 82036360d867d3dc5406bc71445a98841b5bffbf | [
"MIT"
] | null | null | null | club_crm/api/clubtour.py | VivekChamp/clubcrm | 82036360d867d3dc5406bc71445a98841b5bffbf | [
"MIT"
] | null | null | null | club_crm/api/clubtour.py | VivekChamp/clubcrm | 82036360d867d3dc5406bc71445a98841b5bffbf | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
from frappe import _
from datetime import datetime, timedelta, date, time
from frappe.utils import getdate, get_time, flt, now_datetime
from frappe.utils import escape_html
from frappe import throw, msgprint, _
@frappe.whitelist()
def get_schedule():
time_sched... | 33.348485 | 116 | 0.606997 | 0 | 0 | 0 | 0 | 1,929 | 0.87642 | 0 | 0 | 462 | 0.209905 |
2513a6b22c946cb8b820c0695cdd317c638f6bf0 | 647 | py | Python | goalboost/model/__init__.py | JohnLockwood/Goalboost | 1556a15f766ab762243e5d198b00ee7239b20411 | [
"RSA-MD"
] | null | null | null | goalboost/model/__init__.py | JohnLockwood/Goalboost | 1556a15f766ab762243e5d198b00ee7239b20411 | [
"RSA-MD"
] | 10 | 2021-07-30T14:39:05.000Z | 2021-07-30T14:39:07.000Z | goalboost/model/__init__.py | JohnLockwood/Goalboost | 1556a15f766ab762243e5d198b00ee7239b20411 | [
"RSA-MD"
] | null | null | null | '''
goalboost.model package
The goalboost model package consists of MongoEngine models along with
Marshmallow schemas. MongoEngine is our database ORM to MongoDB,
and Marshmallow is a serialization library that helps us validate, consume,
and expose these Orm objects for clients that need it at the API layer.
For Mon... | 26.958333 | 75 | 0.789799 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 524 | 0.809892 |
2513a8a764760e74306e494219df1291ea86952f | 3,290 | py | Python | examples/block_store/snapshots.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/block_store/snapshots.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/block_store/snapshots.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 Huawei Technologies Co.,Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 29.115044 | 89 | 0.614286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 972 | 0.295441 |
2515ebed6d44cdb6e775f2b149da71a36b8ce3fa | 6,270 | py | Python | lambda_upload.py | elbursto/aws_lambda_upload | 62215a1efd7037cad2d099489c16fab905ccf2d3 | [
"Apache-2.0"
] | null | null | null | lambda_upload.py | elbursto/aws_lambda_upload | 62215a1efd7037cad2d099489c16fab905ccf2d3 | [
"Apache-2.0"
] | null | null | null | lambda_upload.py | elbursto/aws_lambda_upload | 62215a1efd7037cad2d099489c16fab905ccf2d3 | [
"Apache-2.0"
] | null | null | null |
import boto3
from zipfile import ZipFile
import argparse
import json
import os
import shutil
class LambdaMaker(object):
def __init__(self, config_file, working_dir):
# const vars
self.creator='TomLambdaCreator_v1.0.0'
os.chdir(working_dir)
self.process_config_file(config_file)
... | 33 | 79 | 0.601435 | 5,795 | 0.924242 | 0 | 0 | 0 | 0 | 0 | 0 | 1,286 | 0.205104 |
25166ab3132cfb837c187df9b62bcf91450b7109 | 6,260 | py | Python | official/vision/image_classification/callbacks.py | arayabrain/models | ceaa23c0ebecdb445d14f002cc66a39c50ac92e3 | [
"Apache-2.0"
] | null | null | null | official/vision/image_classification/callbacks.py | arayabrain/models | ceaa23c0ebecdb445d14f002cc66a39c50ac92e3 | [
"Apache-2.0"
] | 3 | 2020-08-12T06:16:40.000Z | 2020-08-17T05:44:26.000Z | official/vision/image_classification/callbacks.py | arayabrain/models | ceaa23c0ebecdb445d14f002cc66a39c50ac92e3 | [
"Apache-2.0"
] | 1 | 2020-08-04T01:56:03.000Z | 2020-08-04T01:56:03.000Z | # Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 36.184971 | 103 | 0.684824 | 3,476 | 0.555272 | 0 | 0 | 0 | 0 | 0 | 0 | 1,549 | 0.247444 |
2516f01f8f44e4e51781ce4ffc642a90318eac4f | 129 | py | Python | Lib/site-packages/git/index/__init__.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | Lib/site-packages/git/index/__init__.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 10 | 2017-05-10T08:10:23.000Z | 2020-03-23T10:23:37.000Z | Lib/site-packages/git/index/__init__.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 38 | 2017-04-26T14:13:37.000Z | 2021-06-24T11:36:38.000Z | """Initialize the index package"""
# flake8: noqa
from __future__ import absolute_import
from .base import *
from .typ import *
| 18.428571 | 38 | 0.751938 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 48 | 0.372093 |
2519a94caf6b2f931b487b3397703da9ddf2b842 | 885 | py | Python | EDyA_II/4_tree/python/4_default_parameter.py | jrg-sln/academy | 498c11dcfeab78dbbbb77045a13d7d6675c0d150 | [
"MIT"
] | null | null | null | EDyA_II/4_tree/python/4_default_parameter.py | jrg-sln/academy | 498c11dcfeab78dbbbb77045a13d7d6675c0d150 | [
"MIT"
] | null | null | null | EDyA_II/4_tree/python/4_default_parameter.py | jrg-sln/academy | 498c11dcfeab78dbbbb77045a13d7d6675c0d150 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class Saucer(object):
"""
Representa un plato de comida.
"""
def __init__(self, cadNombre, realPrecio, cadDescription=None,
cadImagen=None, boolVegetariano=False, entCoccion=1):
self.nombre = cadNombre
self.precio = realPrecio
self.des... | 34.038462 | 75 | 0.59661 | 709 | 0.80113 | 0 | 0 | 0 | 0 | 0 | 0 | 170 | 0.19209 |
2519e01a81d1d3e2c4f4e4fede4c19c82e764391 | 9,768 | py | Python | model/bdrar.py | Mhaiyang/iccv | 04a8ee52c2323d7ff5cdf03c0be1466e8180d2eb | [
"MIT"
] | 2 | 2019-01-10T03:44:03.000Z | 2019-05-24T08:50:14.000Z | model/bdrar.py | Mhaiyang/iccv | 04a8ee52c2323d7ff5cdf03c0be1466e8180d2eb | [
"MIT"
] | null | null | null | model/bdrar.py | Mhaiyang/iccv | 04a8ee52c2323d7ff5cdf03c0be1466e8180d2eb | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from torch import nn
from resnext.resnext101_regular import ResNeXt101
class _AttentionModule(nn.Module):
def __init__(self):
super(_AttentionModule, self).__init__()
self.block1 = nn.Sequential(
nn.Conv2d(64, 64, 1, bias=False), nn.BatchNo... | 51.141361 | 135 | 0.619676 | 9,645 | 0.987408 | 0 | 0 | 0 | 0 | 0 | 0 | 273 | 0.027948 |
251a755eafd6983caca29826a579cc38212144dd | 7,413 | py | Python | pgeng/font.py | Bouncehball/pgeng | 6f88991e16cfd744c8565b68b6348f313b4d75c0 | [
"MIT"
] | null | null | null | pgeng/font.py | Bouncehball/pgeng | 6f88991e16cfd744c8565b68b6348f313b4d75c0 | [
"MIT"
] | null | null | null | pgeng/font.py | Bouncehball/pgeng | 6f88991e16cfd744c8565b68b6348f313b4d75c0 | [
"MIT"
] | null | null | null | 'Classes and functions for creating fonts and text buttons'
#IMPORTS
import pygame
from pathlib import Path
from .core import clip_surface, load_image
from .colour import palette_swap
#IMPORTS
#VARIALBES
__all__ = ['create_font', 'TextButton']
path = Path(__file__).resolve().parent
#VARIABLES
#CREATE_FON... | 37.439394 | 356 | 0.673816 | 5,702 | 0.769189 | 0 | 0 | 293 | 0.039525 | 0 | 0 | 3,004 | 0.405234 |
251ac80cf768d166a984daeae7c4d2c5d7422487 | 1,814 | py | Python | pyguetzli/pil_image.py | wanadev/pyguetzli | 765cc89137e2f5fca80e5f894f4ec95c38995d96 | [
"Apache-2.0"
] | 28 | 2017-05-03T17:48:21.000Z | 2022-02-14T13:40:24.000Z | pyguetzli/pil_image.py | wanadev/pyguetzli | 765cc89137e2f5fca80e5f894f4ec95c38995d96 | [
"Apache-2.0"
] | 6 | 2017-08-21T07:52:18.000Z | 2020-07-17T16:41:44.000Z | pyguetzli/pil_image.py | wanadev/pyguetzli | 765cc89137e2f5fca80e5f894f4ec95c38995d96 | [
"Apache-2.0"
] | 3 | 2018-03-13T23:33:10.000Z | 2021-09-09T02:33:07.000Z | """
This modules contain helper function to deal with PIL / Pillow Images.
.. note::
Please note that the ``[PIL]`` (pillow) extra dependency must be installed
to allow functions from this module to work.
"""
from . import guetzli
def _to_pil_rgb_image(image):
"""Returns an PIL Image converted to the R... | 26.676471 | 79 | 0.656009 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,176 | 0.648291 |
251c85ca611047b1b27da7153669dd51f78397d6 | 1,034 | py | Python | 201.bitwise-and-of-numbers-range.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 201.bitwise-and-of-numbers-range.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 201.bitwise-and-of-numbers-range.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=201 lang=python
#
# [201] Bitwise AND of Numbers Range
#
# https://leetcode.com/problems/bitwise-and-of-numbers-range/description/
#
# algorithms
# Medium (35.44%)
# Total Accepted: 77.3K
# Total Submissions: 217.7K
# Testcase Example: '5\n7'
#
# Given a range [m, n] where 0 <= m <= n <= 214... | 19.509434 | 78 | 0.548356 | 541 | 0.523211 | 0 | 0 | 0 | 0 | 0 | 0 | 654 | 0.632495 |
251cba64cfe05ed7cdba8439be4d154984b803ea | 12,053 | py | Python | src/dip_main.py | BardiaMojra/dip | 201bd14c13052b81967e051444f4e5c08c72631a | [
"MIT"
] | null | null | null | src/dip_main.py | BardiaMojra/dip | 201bd14c13052b81967e051444f4e5c08c72631a | [
"MIT"
] | null | null | null | src/dip_main.py | BardiaMojra/dip | 201bd14c13052b81967e051444f4e5c08c72631a | [
"MIT"
] | null | null | null | ''' dip
@author Bardia Mojra - 1000766739
@brief ee-5323 - project -
@date 10/31/21
code based on below YouTube tutorial and Pymotw.com documentation for socket mod.
@link https://www.youtube.com/watch?v=3QiPPX-KeSc
@link https://pymotw.com/2/socket/tcp.html
python socket module documentation
@link ht... | 31.064433 | 118 | 0.652867 | 0 | 0 | 0 | 0 | 539 | 0.044719 | 0 | 0 | 3,407 | 0.282668 |
251d295ac1daf4f6c0aa7d07697c6e03ea7c9186 | 1,128 | py | Python | generator/apigen/CommandParser.py | grbd/GBD.Build.BlackJack | 3e8d027625b7528af3674a373fd9931e3feaaab4 | [
"Apache-2.0"
] | 1 | 2017-05-26T00:18:26.000Z | 2017-05-26T00:18:26.000Z | generator/apigen/CommandParser.py | grbd/GBD.Build.BlackJack | 3e8d027625b7528af3674a373fd9931e3feaaab4 | [
"Apache-2.0"
] | null | null | null | generator/apigen/CommandParser.py | grbd/GBD.Build.BlackJack | 3e8d027625b7528af3674a373fd9931e3feaaab4 | [
"Apache-2.0"
] | null | null | null | """
A Command parser to parse over each jinja template for a given cmake command
"""
import os
from apigen.Logger import Logger
from jinja2 import Environment, PackageLoader, FileSystemLoader
class CommandParser(object):
def __init__(self, cmdfile: str, env: Environment, outdir: str):
super().__init__()
... | 31.333333 | 76 | 0.675532 | 933 | 0.827128 | 0 | 0 | 0 | 0 | 0 | 0 | 220 | 0.195035 |
251d599be91a9d5e66da8bf669765945fc72709e | 299 | py | Python | 1_Sys_Module/sysIO.py | ericchou1/Top5PythonModulesForNetworkEngineers | c6aa92c3b7bf6668f049acc6d3ba295634b56027 | [
"Apache-2.0"
] | 5 | 2016-08-21T16:24:03.000Z | 2021-01-11T23:04:21.000Z | 1_Sys_Module/sysIO.py | ericchou1/Top5PythonModulesForNetworkEngineers | c6aa92c3b7bf6668f049acc6d3ba295634b56027 | [
"Apache-2.0"
] | null | null | null | 1_Sys_Module/sysIO.py | ericchou1/Top5PythonModulesForNetworkEngineers | c6aa92c3b7bf6668f049acc6d3ba295634b56027 | [
"Apache-2.0"
] | 5 | 2016-11-05T17:05:39.000Z | 2022-01-31T20:19:12.000Z | #!/usr/bin/env python
import sys
print("Please tell me your favorite color: ")
color = sys.stdin.readline()
animal = raw_input("Please tell me your favorite animal: ")
print(animal)
sys.stdout.write("Your favorite color is: " + color + " favorite animal is: " + animal + "\n")
print("*" * 10)
| 19.933333 | 94 | 0.67893 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 154 | 0.51505 |
251e7d6fbbff67cb94790461d92eb77f3f88ed53 | 111 | py | Python | comet/handler/__init__.py | shinybrar/Comet | 4229092fca74c130a7d4ecd4dbd22ae85f7e6308 | [
"BSD-2-Clause"
] | 15 | 2015-11-29T18:53:58.000Z | 2022-03-09T15:47:30.000Z | comet/handler/__init__.py | shinybrar/Comet | 4229092fca74c130a7d4ecd4dbd22ae85f7e6308 | [
"BSD-2-Clause"
] | 29 | 2016-01-21T18:10:45.000Z | 2021-10-01T16:41:12.000Z | comet/handler/__init__.py | shinybrar/Comet | 4229092fca74c130a7d4ecd4dbd22ae85f7e6308 | [
"BSD-2-Clause"
] | 11 | 2016-01-22T14:05:51.000Z | 2022-03-09T17:49:56.000Z | # Comet VOEvent Broker.
# Event handlers.
from comet.handler.relay import *
from comet.handler.spawn import *
| 18.5 | 33 | 0.765766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 40 | 0.36036 |
251efaea3581632f73c0223d75becaac1ffc7162 | 954 | py | Python | measure_mate/tests/api/test_template.py | niche-tester/measure-mate | c3acba57747bcb89fe0c6b9509ec90f04a581506 | [
"MIT"
] | 15 | 2015-12-14T02:20:31.000Z | 2022-01-30T04:36:39.000Z | measure_mate/tests/api/test_template.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 1,403 | 2017-02-16T01:00:04.000Z | 2022-03-15T21:12:13.000Z | measure_mate/tests/api/test_template.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 10 | 2015-12-18T01:30:46.000Z | 2022-01-30T04:36:41.000Z | from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from measure_mate.models import Template
from measure_mate.tests.factories import TemplateFactory
class TemplateAPITestCases(APITestCase):
def test_list_template(self):
"""
Lis... | 38.16 | 73 | 0.715933 | 731 | 0.766247 | 0 | 0 | 0 | 0 | 0 | 0 | 125 | 0.131027 |
251f5df96375dbae57ea9bdc6db0a3e28bc73439 | 658 | py | Python | ecommerce/shop_management/migrations/0003_shop_created_at_shop_last_updated.py | mhdirajabi/django-drf-e-commerce | 526044a728f9f073a21386ff7f67ac570f4755c6 | [
"MIT"
] | null | null | null | ecommerce/shop_management/migrations/0003_shop_created_at_shop_last_updated.py | mhdirajabi/django-drf-e-commerce | 526044a728f9f073a21386ff7f67ac570f4755c6 | [
"MIT"
] | null | null | null | ecommerce/shop_management/migrations/0003_shop_created_at_shop_last_updated.py | mhdirajabi/django-drf-e-commerce | 526044a728f9f073a21386ff7f67ac570f4755c6 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2021-12-29 11:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop_management', '0002_alter_shop_type_alter_shoptype_name'),
]
operations = [
migrations.AddField(
model_name='shop',
... | 27.416667 | 97 | 0.62462 | 591 | 0.866569 | 0 | 0 | 0 | 0 | 0 | 0 | 196 | 0.28739 |
252023af22ef5365f5e3d2b2d4c333240848fc36 | 4,085 | py | Python | lib/model.py | lanseyege/rl_algorithms | 5bdc5211b84fa4e9f16e68e1407825fdcacacec0 | [
"MIT"
] | null | null | null | lib/model.py | lanseyege/rl_algorithms | 5bdc5211b84fa4e9f16e68e1407825fdcacacec0 | [
"MIT"
] | null | null | null | lib/model.py | lanseyege/rl_algorithms | 5bdc5211b84fa4e9f16e68e1407825fdcacacec0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from lib.util import normal_log_density
class ModelActor(nn.Module):
def __init__(self, obs_size, act_size, active='tanh', hidden_size=128, lstd=-0.0):
super(ModelActor, self).__init__()
if active == 'tanh':
self.active = torch.tanh
else:
... | 31.183206 | 98 | 0.59388 | 3,999 | 0.978947 | 0 | 0 | 0 | 0 | 0 | 0 | 232 | 0.056793 |
252143e0b4bc8782465cc8f472bab67d3793cee0 | 1,129 | py | Python | python/test_2020_04_2.py | wensby/advent-of-code | 50cd7fa2d35674d868a79ac8c75be24a43267e2b | [
"MIT"
] | null | null | null | python/test_2020_04_2.py | wensby/advent-of-code | 50cd7fa2d35674d868a79ac8c75be24a43267e2b | [
"MIT"
] | null | null | null | python/test_2020_04_2.py | wensby/advent-of-code | 50cd7fa2d35674d868a79ac8c75be24a43267e2b | [
"MIT"
] | null | null | null | import importlib
import unittest
solution = importlib.import_module('2020_04_2')
class Test2020Day4Part1(unittest.TestCase):
def test_example1(self):
input = (
'eyr:1972 cid:100\n'
'hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926\n'
'\n'
'iyr:2019\n'
'hcl:#602927... | 29.710526 | 82 | 0.578388 | 1,045 | 0.925598 | 0 | 0 | 0 | 0 | 0 | 0 | 686 | 0.607617 |
252147a24fb71425db336b4bd835e50e021bad1a | 1,649 | py | Python | acme/agents/jax/ail/__init__.py | Tsaousis/acme | 14278693bcc5fef0839ac60792d452d3d80acfd7 | [
"Apache-2.0"
] | 2,650 | 2020-06-01T16:31:25.000Z | 2022-03-31T07:32:41.000Z | acme/agents/jax/ail/__init__.py | Tsaousis/acme | 14278693bcc5fef0839ac60792d452d3d80acfd7 | [
"Apache-2.0"
] | 199 | 2020-06-02T01:09:09.000Z | 2022-03-31T17:11:20.000Z | acme/agents/jax/ail/__init__.py | Tsaousis/acme | 14278693bcc5fef0839ac60792d452d3d80acfd7 | [
"Apache-2.0"
] | 344 | 2020-06-01T16:45:21.000Z | 2022-03-30T11:15:09.000Z | # Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 45.805556 | 74 | 0.814433 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 639 | 0.387508 |
2521a1ac6de3b8964ba83ce10e729714793f678d | 2,578 | py | Python | cineapp/push.py | ptitoliv/cineapp | 4b6a8c68144436c5497353135a013ea783cfd224 | [
"MIT"
] | 2 | 2016-12-02T02:29:01.000Z | 2019-03-03T15:48:50.000Z | cineapp/push.py | ptitoliv/cineapp | 4b6a8c68144436c5497353135a013ea783cfd224 | [
"MIT"
] | 128 | 2016-05-22T21:44:20.000Z | 2022-03-11T23:14:18.000Z | cineapp/push.py | ptitoliv/cineapp | 4b6a8c68144436c5497353135a013ea783cfd224 | [
"MIT"
] | 1 | 2017-08-20T14:14:52.000Z | 2017-08-20T14:14:52.000Z | from __future__ import print_function
from cineapp import app, db, lm
from flask_login import login_required
from flask import jsonify, session, g, url_for, request
from pywebpush import webpush, WebPushException
from cineapp.models import PushNotification
import json, traceback, sys, datetime, time
from cineapp.auth i... | 39.060606 | 202 | 0.747867 | 0 | 0 | 0 | 0 | 1,015 | 0.393716 | 0 | 0 | 862 | 0.334368 |
252492e17fae91abe1251ab7bb4d09c4949ed235 | 37,380 | py | Python | pacu/models/awsapi/iotanalytics.py | RyanJarv/Pacu2 | 27df4bcf296fc8f467d3dc671a47bf9519ce7a24 | [
"MIT"
] | 1 | 2022-03-09T14:51:54.000Z | 2022-03-09T14:51:54.000Z | pacu/models/awsapi/iotanalytics.py | RyanJarv/Pacu2 | 27df4bcf296fc8f467d3dc671a47bf9519ce7a24 | [
"MIT"
] | null | null | null | pacu/models/awsapi/iotanalytics.py | RyanJarv/Pacu2 | 27df4bcf296fc8f467d3dc671a47bf9519ce7a24 | [
"MIT"
] | null | null | null | # generated by datamodel-codegen:
# filename: openapi.yaml
# timestamp: 2021-12-31T02:50:50+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Annotated, Any, List, Optional
from pydantic import BaseModel, Extra, Field
class ResourceNotFoundExceptio... | 24.511475 | 640 | 0.736811 | 36,369 | 0.972953 | 0 | 0 | 0 | 0 | 0 | 0 | 9,017 | 0.241225 |
25249f6ffc68bd327fd5d0540e42e061ccc8880f | 4,577 | py | Python | Codes/trreemap.py | Pepeisadog/Project | 49d77b1590723f87111a0e3a64bd94fa4bb65986 | [
"Unlicense"
] | null | null | null | Codes/trreemap.py | Pepeisadog/Project | 49d77b1590723f87111a0e3a64bd94fa4bb65986 | [
"Unlicense"
] | 3 | 2015-01-12T09:33:30.000Z | 2015-01-29T22:56:47.000Z | Codes/trreemap.py | Pepeisadog/Project | 49d77b1590723f87111a0e3a64bd94fa4bb65986 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 25 15:48:52 2015
@author: Sofia
"""
import csv
import json
import os
sourceEncoding = "iso-8859-1"
targetEncoding = "utf-8"
# encode files to utf8 (source: http://stackoverflow.com/questions/191359/how-to-convert-a-file-to-utf-8-in-python)
csvfile = open('..\Data\AMFI.... | 31.136054 | 125 | 0.622023 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,321 | 0.288617 |
2526119172205dbcc83b912e56e47b1cfd9d139b | 3,751 | py | Python | test_haystack/whoosh_tests/test_whoosh_management_commands.py | cbows/django-haystack | 80c154b7b11fdcf99dd2ef0e82342ed13e26053a | [
"BSD-3-Clause"
] | 2,021 | 2015-02-06T07:45:08.000Z | 2022-03-30T12:26:39.000Z | test_haystack/whoosh_tests/test_whoosh_management_commands.py | cbows/django-haystack | 80c154b7b11fdcf99dd2ef0e82342ed13e26053a | [
"BSD-3-Clause"
] | 787 | 2015-02-03T20:06:04.000Z | 2022-03-30T09:00:38.000Z | test_haystack/whoosh_tests/test_whoosh_management_commands.py | cbows/django-haystack | 80c154b7b11fdcf99dd2ef0e82342ed13e26053a | [
"BSD-3-Clause"
] | 878 | 2015-02-04T15:29:50.000Z | 2022-03-28T16:51:44.000Z | import datetime
import os
import unittest
from io import StringIO
from tempfile import mkdtemp
from unittest.mock import patch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command as real_call_command
from django.core.management.base i... | 33.491071 | 84 | 0.691816 | 2,974 | 0.792433 | 0 | 0 | 0 | 0 | 0 | 0 | 382 | 0.101785 |
25282fa8805725b2acc31f9c959840083384e1e2 | 2,977 | py | Python | src/server.py | tyler-fishbone/http_server | 93a49090d356b31522acd5bc3a25a1c8a3b604e3 | [
"MIT"
] | null | null | null | src/server.py | tyler-fishbone/http_server | 93a49090d356b31522acd5bc3a25a1c8a3b604e3 | [
"MIT"
] | null | null | null | src/server.py | tyler-fishbone/http_server | 93a49090d356b31522acd5bc3a25a1c8a3b604e3 | [
"MIT"
] | null | null | null | from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlparse, parse_qs
from cowpy import cow
import json
import sys
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
parsed_path = urlparse(self.path)
parsed_qs = parse_qs(parsed_path.query)
... | 26.114035 | 76 | 0.543164 | 2,117 | 0.711119 | 0 | 0 | 0 | 0 | 0 | 0 | 565 | 0.189788 |
2529f17c13ced51c4629d6195cff0d46c5800cac | 7,033 | py | Python | Chapter06/6B_TrendFollowings/6B_3_RunCNN.py | uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking | 3a10a14194368478bb8b78d3d17e9c6a7b7253db | [
"MIT"
] | 115 | 2020-06-18T15:00:58.000Z | 2022-03-02T10:13:19.000Z | Chapter06/6B_TrendFollowings/6B_3_RunCNN.py | uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking | 3a10a14194368478bb8b78d3d17e9c6a7b7253db | [
"MIT"
] | 2 | 2020-11-06T11:02:31.000Z | 2021-01-22T12:44:35.000Z | Chapter06/6B_TrendFollowings/6B_3_RunCNN.py | uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking | 3a10a14194368478bb8b78d3d17e9c6a7b7253db | [
"MIT"
] | 60 | 2020-07-22T14:53:10.000Z | 2022-03-23T10:17:59.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 30 00:58:34 2018
@author: jeff
"""
'''*************************************
#1. Import libraries and key varable values
'''
import os
import quandl
import pandas as pd
import numpy as np
import keras
from PIL import Image
#folder path
folder_path =... | 32.560185 | 187 | 0.624485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,069 | 0.294185 |
252ac1c22921db6597accc034da434758be4405a | 2,589 | py | Python | lichee/dataset/field_parser/image_local_path.py | Tencent/Lichee | 7653becd6fbf8b0715f788af3c0507c012be08b4 | [
"Apache-2.0"
] | 91 | 2021-10-30T02:25:05.000Z | 2022-03-28T06:51:52.000Z | lichee/dataset/field_parser/image_local_path.py | zhaijunyu/Lichee | 7653becd6fbf8b0715f788af3c0507c012be08b4 | [
"Apache-2.0"
] | 1 | 2021-12-17T09:30:25.000Z | 2022-03-05T12:30:13.000Z | lichee/dataset/field_parser/image_local_path.py | zhaijunyu/Lichee | 7653becd6fbf8b0715f788af3c0507c012be08b4 | [
"Apache-2.0"
] | 17 | 2021-11-04T07:50:23.000Z | 2022-03-24T14:24:11.000Z | # -*- coding: utf-8 -*-
from lichee import plugin
from .field_parser_base import BaseFieldParser
import os
from PIL import Image
from torchvision import transforms
import torch
from lichee.utils import storage
@plugin.register_plugin(plugin.PluginType.FIELD_PARSER, "image_local_path")
class ImgDataFieldParser(BaseFie... | 30.821429 | 117 | 0.611047 | 2,300 | 0.888374 | 0 | 0 | 2,376 | 0.917729 | 0 | 0 | 1,034 | 0.399382 |
252b421527774d5fb18e906562e999ce4cef4de4 | 2,054 | py | Python | models/inception.py | ildoonet/kaggle-human-protein-atlas-image-classification | 9faedaf6e480712492ccfb36c7bdf5e9f7db8b41 | [
"Apache-2.0"
] | 35 | 2019-01-11T00:55:19.000Z | 2021-07-14T11:44:10.000Z | models/inception.py | ildoonet/kaggle-human-protein-atlas-image-classification | 9faedaf6e480712492ccfb36c7bdf5e9f7db8b41 | [
"Apache-2.0"
] | null | null | null | models/inception.py | ildoonet/kaggle-human-protein-atlas-image-classification | 9faedaf6e480712492ccfb36c7bdf5e9f7db8b41 | [
"Apache-2.0"
] | 9 | 2019-01-11T01:42:14.000Z | 2020-03-02T05:47:18.000Z | import torch
from torch import nn
import torch.nn.functional as F
import torchvision
from torchvision.models.inception import BasicConv2d, InceptionAux
import pretrainedmodels
from common import num_class
class InceptionV3(nn.Module):
def __init__(self, pre=True):
super().__init__()
self.encoder ... | 36.035088 | 108 | 0.595424 | 1,842 | 0.896787 | 0 | 0 | 0 | 0 | 0 | 0 | 141 | 0.068647 |
252c453ec6e9dc3416a26d47c38bcfb973477454 | 74 | py | Python | python/sequences.py | saedyousef/Python-scratch | ba4bf88d1ad86beddc8c7c5e2f43c4e837e2861e | [
"MIT"
] | 5 | 2020-07-20T17:47:08.000Z | 2021-08-17T18:26:25.000Z | python/sequences.py | saedyousef/CS-50 | ba4bf88d1ad86beddc8c7c5e2f43c4e837e2861e | [
"MIT"
] | null | null | null | python/sequences.py | saedyousef/CS-50 | ba4bf88d1ad86beddc8c7c5e2f43c4e837e2861e | [
"MIT"
] | 1 | 2021-06-29T19:49:46.000Z | 2021-06-29T19:49:46.000Z | name = "Saeed"
cordinates = (10.0, 20.0)
names = ["Saeed", "Bob", "Mousa"] | 24.666667 | 33 | 0.581081 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0.351351 |
252d0e1541c6bce0edda34974ac8e4c3861ecde4 | 2,622 | py | Python | scripts/create_fluseverity_figs/Supp_zOR_totalAR.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | 3 | 2018-03-29T23:02:43.000Z | 2020-08-10T12:01:50.000Z | scripts/create_fluseverity_figs/Supp_zOR_totalAR.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | null | null | null | scripts/create_fluseverity_figs/Supp_zOR_totalAR.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | null | null | null | #!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 9/2/14
###Function: mean peak-based retro zOR metric vs. total attack rate
###Import data: SQL_export/OR_allweeks_outpatient.csv, SQL_export/OR_allweeks.csv
###Command Line: python Supp_zOR_totalAR.... | 32.775 | 171 | 0.71167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,409 | 0.537376 |
252f0a3cb8c24df7cf5db2bc1599071146727275 | 1,238 | py | Python | Problem001.py | DimitrisMantas/ProjectEuler | 69b647232729a2d2a38ea08d1214616a861046cf | [
"Apache-2.0"
] | null | null | null | Problem001.py | DimitrisMantas/ProjectEuler | 69b647232729a2d2a38ea08d1214616a861046cf | [
"Apache-2.0"
] | null | null | null | Problem001.py | DimitrisMantas/ProjectEuler | 69b647232729a2d2a38ea08d1214616a861046cf | [
"Apache-2.0"
] | null | null | null | """This is the solution to Problem 1 of Project Euler."""
"""Copyright 2021 Dimitris Mantas"""
import time
def compute_all_multiples(of_number, below_number):
"""Compute all natural numbers, which are multiples of a natural number below a predefined number."""
# Register the list of said multiple... | 30.195122 | 109 | 0.673667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 728 | 0.588045 |
252f723efb0474d342e7055aa1aa0011f4760543 | 3,731 | py | Python | fuentes/Colecciones.py | victorricardo/tutorial-python | 5a49407e98c371b39d53993a8d5f63ed9f266353 | [
"OLDAP-2.5"
] | null | null | null | fuentes/Colecciones.py | victorricardo/tutorial-python | 5a49407e98c371b39d53993a8d5f63ed9f266353 | [
"OLDAP-2.5"
] | null | null | null | fuentes/Colecciones.py | victorricardo/tutorial-python | 5a49407e98c371b39d53993a8d5f63ed9f266353 | [
"OLDAP-2.5"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Colecciones - Listas
# In[1]:
l = [22, True, "una lista", [1, 2]]
mi_var = l[0] # mi_var vale 22
mi_var1 = l[3] # mi_var1 vale [1, 2]
print (mi_var)
print (mi_var1)
# In[50]:
# Si queremos acceder a un elemento de una lista incluida dentro de otra lista tendremos que
#... | 31.091667 | 123 | 0.703029 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,047 | 0.808437 |
2530a05e38dc4778931bafbbddc794641c581d85 | 28,045 | py | Python | tests/test_subnetlaplace.py | georgezefko/Laplace | c488f7bf739297bab5d771f65635352a07716ca0 | [
"MIT"
] | null | null | null | tests/test_subnetlaplace.py | georgezefko/Laplace | c488f7bf739297bab5d771f65635352a07716ca0 | [
"MIT"
] | null | null | null | tests/test_subnetlaplace.py | georgezefko/Laplace | c488f7bf739297bab5d771f65635352a07716ca0 | [
"MIT"
] | null | null | null | import pytest
from itertools import product
import torch
from torch import nn
from torch.nn.utils import parameters_to_vector
from torch.utils.data import DataLoader, TensorDataset
from torchvision.models import wide_resnet50_2
from laplace import Laplace, SubnetLaplace, FullSubnetLaplace, DiagSubnetLaplace
from lapl... | 46.976549 | 117 | 0.724764 | 135 | 0.004814 | 0 | 0 | 26,898 | 0.959101 | 0 | 0 | 5,355 | 0.190943 |
253330ec00e3e989dc1286f84a83a5c56cf85fc5 | 332 | py | Python | rylog/__init__.py | Ryan-Holben/rylog | 0f81fc8031b5c008f87ce367ebeabd443ef341f8 | [
"MIT"
] | null | null | null | rylog/__init__.py | Ryan-Holben/rylog | 0f81fc8031b5c008f87ce367ebeabd443ef341f8 | [
"MIT"
] | null | null | null | rylog/__init__.py | Ryan-Holben/rylog | 0f81fc8031b5c008f87ce367ebeabd443ef341f8 | [
"MIT"
] | null | null | null | """
rylog
Logging happening in a 3-dimensional Cartesian product of:
1. The logging level: [debug, info, warn, error]
2. The logging category: e.g. software event, action, output
3. The detected function/method: e.g. my_class.class_method or foo
"""
from .misc import *
from .server import *
from .clie... | 25.538462 | 70 | 0.701807 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 266 | 0.801205 |
253360f89cf58d0a39abb0d2f777c0a588b4ec22 | 243 | py | Python | typic/constraints/error.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 157 | 2019-03-20T19:12:28.000Z | 2022-03-25T08:57:53.000Z | typic/constraints/error.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 147 | 2019-07-03T20:00:52.000Z | 2022-02-10T11:38:39.000Z | typic/constraints/error.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 15 | 2019-03-21T11:01:03.000Z | 2022-01-08T10:38:15.000Z | class ConstraintSyntaxError(SyntaxError):
"""A generic error indicating an improperly defined constraint."""
pass
class ConstraintValueError(ValueError):
"""A generic error indicating a value violates a constraint."""
pass
| 22.090909 | 70 | 0.740741 | 239 | 0.983539 | 0 | 0 | 0 | 0 | 0 | 0 | 129 | 0.530864 |
2533ae4893b1c779f4471ef4511dd0dbc0e4068c | 3,701 | py | Python | 03_queue/queue_xrh.py | Xinrihui/Data-Structure-and-Algrithms | fa3a455f64878e42d033c1fd8d612f108c71fb72 | [
"Apache-2.0"
] | 1 | 2021-08-13T10:55:33.000Z | 2021-08-13T10:55:33.000Z | 03_queue/queue_xrh.py | Xinrihui/Data-Structure-and-Algrithms | fa3a455f64878e42d033c1fd8d612f108c71fb72 | [
"Apache-2.0"
] | null | null | null | 03_queue/queue_xrh.py | Xinrihui/Data-Structure-and-Algrithms | fa3a455f64878e42d033c1fd8d612f108c71fb72 | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import timeit
import numpy as np
import sys
import random as rand
class Queue_array:
"""
顺序队列
"""
def __init__(self,capacity):
self._items = [None]*(capacity+1) #最后一个位置 空置
self._capacity = capacity
self._head = 0
self._tail... | 19.276042 | 87 | 0.518779 | 2,953 | 0.746272 | 0 | 0 | 0 | 0 | 0 | 0 | 1,283 | 0.324236 |
253438c9cde5237ab336b6ebc0e8e1089525b6e7 | 1,703 | py | Python | domains/gym_craft/tests/plotting.py | AndrewPaulChester/sage-code | 9fe676bfbcbc6f642eca29b30a1027fba2a426a0 | [
"MIT"
] | null | null | null | domains/gym_craft/tests/plotting.py | AndrewPaulChester/sage-code | 9fe676bfbcbc6f642eca29b30a1027fba2a426a0 | [
"MIT"
] | null | null | null | domains/gym_craft/tests/plotting.py | AndrewPaulChester/sage-code | 9fe676bfbcbc6f642eca29b30a1027fba2a426a0 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import math
MAX_SPEED = 2
ACCELERATION = 0.5
DRAG = 0.3
TURN_SPEED=5
IMAGE = np.array([
[0,0,0,1,0,0,0],
[0,0,1,1,1,0,0],
[0,1,1,1,1,1,0],
[1,1,1,1,1,1,1],
[0,1,1,1,1,1,0],
[0,0,1,1,1,0,0],
[0,0,0,1,0,0,0]])
def main():
position=(42 ,42)
speed=0
bear... | 22.706667 | 81 | 0.613623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 78 | 0.045802 |
2536ce2ad28b7718b5111d981d1c1217ff573d5d | 1,868 | py | Python | 11_ContainerWithMostWater/container_with_most_water.py | xiaowei1118/leetcode-python | 24d4ccbbf9643100dd2de91afd5d30dca9b7ffe1 | [
"MIT"
] | 2 | 2017-10-09T16:59:01.000Z | 2017-10-10T08:38:08.000Z | 11_ContainerWithMostWater/container_with_most_water.py | xiaowei1118/leetcode-python | 24d4ccbbf9643100dd2de91afd5d30dca9b7ffe1 | [
"MIT"
] | null | null | null | 11_ContainerWithMostWater/container_with_most_water.py | xiaowei1118/leetcode-python | 24d4ccbbf9643100dd2de91afd5d30dca9b7ffe1 | [
"MIT"
] | null | null | null | # coding: utf-8
# 给定 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) 。
# 在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0)。
# 找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。
#
# 来源:力扣(LeetCode)
# 链接:https://leetcode-cn.com/problems/container-with-most-water
class Solution(object):
# 递归做法
def maxArea1(self, height):
"""
... | 20.527473 | 68 | 0.4197 | 1,633 | 0.772835 | 0 | 0 | 0 | 0 | 0 | 0 | 728 | 0.344534 |
253841f648fa7d855056a9bf18031761bbedfe7c | 561 | py | Python | app/system/migrations/0003_auto_20181206_1042.py | TennaGraph/TennaGraph | 002998d94300ee67168f1a8164c0e6bc86836e1f | [
"Apache-2.0"
] | 7 | 2018-11-13T17:39:15.000Z | 2019-03-27T04:55:24.000Z | app/system/migrations/0003_auto_20181206_1042.py | TennaGraph/TennaGraph | 002998d94300ee67168f1a8164c0e6bc86836e1f | [
"Apache-2.0"
] | 72 | 2018-11-09T14:20:25.000Z | 2020-06-05T19:28:19.000Z | app/system/migrations/0003_auto_20181206_1042.py | TennaGraph/TennaGraph | 002998d94300ee67168f1a8164c0e6bc86836e1f | [
"Apache-2.0"
] | 3 | 2018-11-19T19:10:39.000Z | 2019-08-23T20:52:23.000Z | # Generated by Django 2.1.3 on 2018-12-06 10:42
from django.db import migrations, models
import system.models.system_settings
class Migration(migrations.Migration):
dependencies = [
('system', '0002_systemsettings_contract_vot_manager_address'),
]
operations = [
migrations.AlterField(
... | 28.05 | 134 | 0.691622 | 431 | 0.768271 | 0 | 0 | 0 | 0 | 0 | 0 | 151 | 0.269162 |
25388135b2590bec6c24b4f712d9da835c81c62b | 4,338 | py | Python | pysplit/clusgroup.py | haochiche/pysplit | df6f8ebe93dd81ff8925529b8dfaaea2f446f2e5 | [
"BSD-3-Clause"
] | 110 | 2015-07-12T15:13:18.000Z | 2022-03-28T00:58:59.000Z | pysplit/clusgroup.py | haochiche/pysplit | df6f8ebe93dd81ff8925529b8dfaaea2f446f2e5 | [
"BSD-3-Clause"
] | 70 | 2016-02-23T03:19:55.000Z | 2022-03-14T09:12:43.000Z | pysplit/clusgroup.py | haochiche/pysplit | df6f8ebe93dd81ff8925529b8dfaaea2f446f2e5 | [
"BSD-3-Clause"
] | 66 | 2015-07-10T20:43:30.000Z | 2022-02-18T01:00:33.000Z | from __future__ import division, print_function
from .trajgroup import TrajectoryGroup
from .hypath import HyPath
from .hygroup import HyGroup
def print_clusterprocedure():
"""Print clustering guide."""
print("""
In ``PySPLIT``
1. Create ``TrajectoryGroup`` with desired set of trajectorie... | 27.807692 | 79 | 0.574919 | 3,484 | 0.803135 | 0 | 0 | 0 | 0 | 0 | 0 | 2,858 | 0.658829 |
253a183c509b499df726c22fb7b3ee45b370c6ff | 2,424 | py | Python | bin/lkft_notify_developer.py | roxell/lkft-tools | bd1981b1f616114cb260878fe7319753107e581b | [
"MIT"
] | 3 | 2018-12-14T02:37:10.000Z | 2020-04-30T19:07:01.000Z | bin/lkft_notify_developer.py | roxell/lkft-tools | bd1981b1f616114cb260878fe7319753107e581b | [
"MIT"
] | 25 | 2018-07-27T13:38:17.000Z | 2021-10-05T13:01:36.000Z | bin/lkft_notify_developer.py | roxell/lkft-tools | bd1981b1f616114cb260878fe7319753107e581b | [
"MIT"
] | 12 | 2018-07-09T22:52:32.000Z | 2021-11-29T19:45:33.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
import re
import requests
import sys
sys.path.append(os.path.join(sys.path[0], "../", "lib"))
import lkft_squad_client # noqa: E402
def get_branch_from_make_kernelversion(make_kernelversion):
"""
IN: "4.4.118"
OUT: "4.4"
... | 28.186047 | 86 | 0.664604 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 661 | 0.27269 |
253c3b4e7dd3233e756d0a0d7809bcec3e7f9d2a | 1,507 | py | Python | day_3.py | bastoche/adventofcode2017 | a93ecff1de78376b03d4c922c82dff96574f2466 | [
"MIT"
] | null | null | null | day_3.py | bastoche/adventofcode2017 | a93ecff1de78376b03d4c922c82dff96574f2466 | [
"MIT"
] | null | null | null | day_3.py | bastoche/adventofcode2017 | a93ecff1de78376b03d4c922c82dff96574f2466 | [
"MIT"
] | null | null | null | from math import ceil, sqrt
def part_one(input):
circle_index = get_circle_index(input)
circle_zero = get_circle_zero(circle_index)
cardinal_points = get_cardinal_points(circle_index, circle_zero)
distance_to_closest_cardinal_point = compute_distance_to_closest_cardinal_point(input, cardinal_points)
... | 25.542373 | 119 | 0.639681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.006636 |
253ce464d772dd296d3b8fca083e60adbb02df3d | 423 | py | Python | CeV - Gustavo Guanabara/exerc022.py | us19861229c/Meu-aprendizado-Python | 575c0714ac5377ff3122f4cb57952969e07ba89b | [
"Unlicense"
] | 1 | 2021-12-11T19:53:41.000Z | 2021-12-11T19:53:41.000Z | CeV - Gustavo Guanabara/exerc022.py | us19861229c/Meu-aprendizado-Python | 575c0714ac5377ff3122f4cb57952969e07ba89b | [
"Unlicense"
] | null | null | null | CeV - Gustavo Guanabara/exerc022.py | us19861229c/Meu-aprendizado-Python | 575c0714ac5377ff3122f4cb57952969e07ba89b | [
"Unlicense"
] | null | null | null | #022: Crie um programa que leia o nome completo de uma pessoa e mostre:
# - O nome com todas as letras maiúsculas e minúsculas.
# - Quantas letras ao tdo (sem considerar espaços).
# - Quantas letras tem o primeiro nome.
nome = input("Qual é o seu nome? ")
print(">>",nome.upper())
print(">>",nome.lower())
jnome = nome.... | 28.2 | 71 | 0.664303 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 260 | 0.608899 |
253e8b5989062bd43d076499f35aace1547716ff | 2,395 | py | Python | src/pysqldump/domain/manager.py | tongyeouki/sql-converter | 28039fe16b43f443925447d06d682f6aa8c3a909 | [
"MIT"
] | 1 | 2020-06-12T03:32:35.000Z | 2020-06-12T03:32:35.000Z | src/pysqldump/domain/manager.py | tongyeouki/sql-converter | 28039fe16b43f443925447d06d682f6aa8c3a909 | [
"MIT"
] | null | null | null | src/pysqldump/domain/manager.py | tongyeouki/sql-converter | 28039fe16b43f443925447d06d682f6aa8c3a909 | [
"MIT"
] | 1 | 2020-06-12T03:32:15.000Z | 2020-06-12T03:32:15.000Z | from typing import Optional
from pysqldump.domain.formatters import (
CSVFormatter,
DictFormatter,
JsonFormatter,
ConsoleFormatter,
)
from pysqldump.settings.base import get_config
config = get_config()
class File:
def __init__(self, filename):
self.filename = filename
def get_exten... | 29.567901 | 84 | 0.617954 | 2,168 | 0.905219 | 0 | 0 | 217 | 0.090605 | 0 | 0 | 83 | 0.034656 |
25405166ea1f14ffbb145a0fad72cb35236d7ab6 | 605 | py | Python | Mortgage Calculator.py | BokijonovM/Projects | 7c032f872aaa4bdf0fba100385019c6058c3c8fb | [
"BSD-2-Clause"
] | 1 | 2021-03-18T08:12:15.000Z | 2021-03-18T08:12:15.000Z | Mortgage Calculator.py | BokijonovM/Python_Projects | 7c032f872aaa4bdf0fba100385019c6058c3c8fb | [
"BSD-2-Clause"
] | null | null | null | Mortgage Calculator.py | BokijonovM/Python_Projects | 7c032f872aaa4bdf0fba100385019c6058c3c8fb | [
"BSD-2-Clause"
] | null | null | null | """**Mortgage Calculator** -
Calculate the monthly payments of a fixed term mortgage
over given Nth terms at a given interest rate. Also figure
out how long it will take the user to pay back the loan."""
months = int(input("Enter mortgage term (in months): "))
rate = float(input("Enter interest rate (in %): ... | 37.8125 | 127 | 0.661157 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 375 | 0.619835 |
2540e4b774668ff785e806c6ddc07e0e515e0f5f | 172 | py | Python | math_lib.py | cu-swe4s-fall-2020/version-control-rezgarshakeri | 859f863a71dbab5714a1f24e54933a0b4398790b | [
"MIT"
] | null | null | null | math_lib.py | cu-swe4s-fall-2020/version-control-rezgarshakeri | 859f863a71dbab5714a1f24e54933a0b4398790b | [
"MIT"
] | null | null | null | math_lib.py | cu-swe4s-fall-2020/version-control-rezgarshakeri | 859f863a71dbab5714a1f24e54933a0b4398790b | [
"MIT"
] | null | null | null | import numpy as np
def div(a, b):
if b == 0:
print("denominator iz zero!!!")
return np.inf
else:
return a/b
def add(a,b):
return (a+b) | 15.636364 | 39 | 0.511628 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.139535 |
25428819afdb8bcef5f733f483e2dfff517079e7 | 956 | py | Python | configs.py | rudyn2/visual-odometry | 1ee37ac6669e1429461f23ccc02d5ae9a349409c | [
"MIT"
] | null | null | null | configs.py | rudyn2/visual-odometry | 1ee37ac6669e1429461f23ccc02d5ae9a349409c | [
"MIT"
] | null | null | null | configs.py | rudyn2/visual-odometry | 1ee37ac6669e1429461f23ccc02d5ae9a349409c | [
"MIT"
] | null | null | null | import cv2
class StereoSGBMConfig:
min_disparity = 0
num_disparities = 16*10
sad_window_size = 3
uniqueness_ratio = 5
p1 = 16*sad_window_size*sad_window_size
p2 = 96*sad_window_size*sad_window_size
pre_filter_cap = 63
speckle_window_size = 0
speckle_range = 0
disp_max_diff = 1
... | 21.727273 | 47 | 0.65272 | 936 | 0.979079 | 0 | 0 | 0 | 0 | 0 | 0 | 77 | 0.080544 |
25446e5536422db53c3887d8fec73e5ede336aa7 | 5,460 | py | Python | test/test_tensor_reorganization.py | entn-at/BrnoLM | 9f8c62523382098809c1c0967f62a67d151eafe0 | [
"MIT"
] | 17 | 2020-02-04T16:42:40.000Z | 2021-11-11T14:37:32.000Z | test/test_tensor_reorganization.py | entn-at/BrnoLM | 9f8c62523382098809c1c0967f62a67d151eafe0 | [
"MIT"
] | null | null | null | test/test_tensor_reorganization.py | entn-at/BrnoLM | 9f8c62523382098809c1c0967f62a67d151eafe0 | [
"MIT"
] | 4 | 2020-02-04T12:59:04.000Z | 2021-05-30T14:10:54.000Z | from brnolm.runtime.tensor_reorganization import TensorReorganizer
import torch
from torch.autograd import Variable
from .common import TestCase
class Dummy_lstm():
def __init__(self, nb_hidden):
self._nb_hidden = nb_hidden
def init_hidden(self, batch_size):
return (
torch.FloatT... | 30.502793 | 86 | 0.540842 | 5,302 | 0.971062 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
254476669d60a9c34049aba84879aa1422202a6a | 25 | py | Python | latex.py | akdir/BachelorThesis | 07b5fe8b92c0b0eb21c1031e6415ac268ba27e7c | [
"MIT"
] | null | null | null | latex.py | akdir/BachelorThesis | 07b5fe8b92c0b0eb21c1031e6415ac268ba27e7c | [
"MIT"
] | null | null | null | latex.py | akdir/BachelorThesis | 07b5fe8b92c0b0eb21c1031e6415ac268ba27e7c | [
"MIT"
] | null | null | null | jobname="BachelorThesis"
| 12.5 | 24 | 0.84 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 0.64 |
25456b38415fb42cb49ec1c612d93c5272eac7b9 | 331 | py | Python | quantdsl/infrastructure/event_sourced_repos/contract_specification_repo.py | johnbywater/quantdsl | 81c1c69f27e094a6ed0542b28cf1ac8fcce5494a | [
"BSD-3-Clause"
] | 269 | 2015-01-09T00:56:41.000Z | 2022-03-30T17:09:46.000Z | quantdsl/infrastructure/event_sourced_repos/contract_specification_repo.py | johnbywater/quantdsl | 81c1c69f27e094a6ed0542b28cf1ac8fcce5494a | [
"BSD-3-Clause"
] | 22 | 2017-04-01T13:44:56.000Z | 2018-09-10T11:48:56.000Z | quantdsl/infrastructure/event_sourced_repos/contract_specification_repo.py | johnbywater/quantdsl | 81c1c69f27e094a6ed0542b28cf1ac8fcce5494a | [
"BSD-3-Clause"
] | 59 | 2015-01-09T00:56:50.000Z | 2022-03-13T23:52:27.000Z | from eventsourcing.infrastructure.event_sourced_repo import EventSourcedRepository
from quantdsl.domain.model.contract_specification import ContractSpecification, ContractSpecificationRepository
class ContractSpecificationRepo(ContractSpecificationRepository, EventSourcedRepository):
domain_class = ContractSpeci... | 33.1 | 111 | 0.89426 | 131 | 0.39577 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2545a6ce4bad291b2182fea9564fd36668358b01 | 660 | py | Python | scrapingData/scraping.py | karumo10/coursesel-helper | deb7e52a7bfe1fc41cd630d5a2cbe96fa089d986 | [
"MIT"
] | null | null | null | scrapingData/scraping.py | karumo10/coursesel-helper | deb7e52a7bfe1fc41cd630d5a2cbe96fa089d986 | [
"MIT"
] | null | null | null | scrapingData/scraping.py | karumo10/coursesel-helper | deb7e52a7bfe1fc41cd630d5a2cbe96fa089d986 | [
"MIT"
] | null | null | null | from requests_html import HTMLSession
import os
import sys
writeFileName = "courseLinks.out"
writeFileStream = open(writeFileName,'w',encoding='utf-8')
session = HTMLSession()
url = 'https://www.ji.sjtu.edu.cn/academics/courses/courses-by-number/'
r = session.get(url)
for i in range(2,100):
sel = '... | 24.444444 | 72 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 199 | 0.301515 |
254a5b1fda824a925564dbbe740873888025ca2b | 7,655 | py | Python | jukebot/cogs/gametime.py | Kommotion/Jukebot | 4e50342b914ff6b91fd78802900d1e24bee946db | [
"MIT"
] | 1 | 2021-07-26T02:44:00.000Z | 2021-07-26T02:44:00.000Z | jukebot/cogs/gametime.py | Kommotion/Jukebot | 4e50342b914ff6b91fd78802900d1e24bee946db | [
"MIT"
] | null | null | null | jukebot/cogs/gametime.py | Kommotion/Jukebot | 4e50342b914ff6b91fd78802900d1e24bee946db | [
"MIT"
] | null | null | null | import logging
import discord
from datetime import datetime
from discord.ext import tasks, commands
from discord.ext.commands import Cog
from cogs.utils.utils import json_io_dump, json_io_load
log = logging.getLogger(__name__)
STATUS = 'status'
TIME_STARTED = 'time_started'
NAME = 'name'
GAMES = 'games'
NONE = 'none'... | 40.502646 | 142 | 0.617897 | 6,761 | 0.883214 | 0 | 0 | 1,961 | 0.256172 | 5,218 | 0.681646 | 2,715 | 0.35467 |
254ca1af527eda83d904a3bb25f7ec725799bb3b | 2,578 | py | Python | transformy/conversion/_pyqtgraph.py | AllenInstitute/transformy | 17c769857d0cb05ad252ab684dec9eadb61a7c59 | [
"BSD-3-Clause"
] | 1 | 2021-06-22T18:06:06.000Z | 2021-06-22T18:06:06.000Z | transformy/conversion/_pyqtgraph.py | AllenInstitute/transformy | 17c769857d0cb05ad252ab684dec9eadb61a7c59 | [
"BSD-3-Clause"
] | null | null | null | transformy/conversion/_pyqtgraph.py | AllenInstitute/transformy | 17c769857d0cb05ad252ab684dec9eadb61a7c59 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from .converter import TransformConverter
from .. import linear
class PyqtgraphTransformConverter(TransformConverter):
name = 'pyqtgraph'
def __init__(self):
try:
import pyqtgraph
self._import_error = None
except ImportError as exc:
s... | 34.837838 | 114 | 0.564779 | 2,492 | 0.966641 | 0 | 0 | 0 | 0 | 0 | 0 | 259 | 0.100465 |
254d3022845aae3d1a9293a0181f060be7c09b6f | 28 | py | Python | pyqt/utils/__init__.py | TaoYang526/qt | 81ed776c67f2df0d07d8b7e964e6a25b9271b28b | [
"Apache-2.0"
] | null | null | null | pyqt/utils/__init__.py | TaoYang526/qt | 81ed776c67f2df0d07d8b7e964e6a25b9271b28b | [
"Apache-2.0"
] | null | null | null | pyqt/utils/__init__.py | TaoYang526/qt | 81ed776c67f2df0d07d8b7e964e6a25b9271b28b | [
"Apache-2.0"
] | null | null | null | from pyqt.utils import time
| 14 | 27 | 0.821429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
254d4a38068cbf495fc111202fbf1797b204e7fd | 491 | py | Python | recipe/exceptions.py | juiceinc/recipe | ef3c5af58e2d68892d54285a24b78565f6401ef4 | [
"MIT"
] | 5 | 2017-10-26T10:44:07.000Z | 2021-08-30T16:35:55.000Z | recipe/exceptions.py | juiceinc/recipe | ef3c5af58e2d68892d54285a24b78565f6401ef4 | [
"MIT"
] | 56 | 2017-10-23T14:01:37.000Z | 2022-02-17T17:07:41.000Z | recipe/exceptions.py | juiceinc/recipe | ef3c5af58e2d68892d54285a24b78565f6401ef4 | [
"MIT"
] | null | null | null | class BadIngredient(Exception):
""" Something is wrong with an ingredient """
class BadRecipe(Exception):
""" Something is wrong with a recipe """
class InvalidColumnError(Exception):
def __init__(self, *args, **kwargs):
self.column_name = kwargs.pop("column_name", None)
if not args:
... | 30.6875 | 67 | 0.651731 | 484 | 0.985743 | 0 | 0 | 0 | 0 | 0 | 0 | 146 | 0.297352 |
254f90068c187cfc444d126472019f1e35637c92 | 1,373 | py | Python | jack/io/read_semeval2017Task10.py | elyase/jack | a4f43a4012a540d55d2e05d8a904e6f8cc3002f1 | [
"MIT"
] | 192 | 2017-10-19T18:04:56.000Z | 2019-09-21T23:29:03.000Z | jack/io/read_semeval2017Task10.py | elyase/jack | a4f43a4012a540d55d2e05d8a904e6f8cc3002f1 | [
"MIT"
] | 120 | 2017-10-16T09:46:07.000Z | 2019-06-20T18:34:24.000Z | jack/io/read_semeval2017Task10.py | elyase/jack | a4f43a4012a540d55d2e05d8a904e6f8cc3002f1 | [
"MIT"
] | 50 | 2017-10-19T09:57:45.000Z | 2019-07-24T13:46:26.000Z | import os
def readAnn(textfolder="../data/SemEval2017Task10/"):
'''
Read .ann files and look up corresponding spans in .txt files
Args:
textfolder:
'''
flist = os.listdir(textfolder)
for f in flist:
if not f.endswith(".ann"):
continue
f_anno = open(os... | 32.690476 | 143 | 0.554261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 540 | 0.393299 |
25507a35dbe62df6d608b962eb29203e902472af | 5,018 | py | Python | src/means/io/sbml.py | nicktimko/means | fe164916a1d84ab2a4fa039871d38ccdf638b1db | [
"MIT"
] | 10 | 2016-05-25T08:28:39.000Z | 2020-06-04T03:19:50.000Z | src/means/io/sbml.py | nicktimko/means | fe164916a1d84ab2a4fa039871d38ccdf638b1db | [
"MIT"
] | 5 | 2015-12-08T14:01:15.000Z | 2020-01-10T22:42:18.000Z | src/means/io/sbml.py | nicktimko/means | fe164916a1d84ab2a4fa039871d38ccdf638b1db | [
"MIT"
] | 6 | 2015-12-10T17:24:11.000Z | 2021-03-22T16:12:17.000Z | from collections import namedtuple
import os
import sympy
import numpy as np
from means.core.model import Model
_Reaction = namedtuple('_REACTION', ['id', 'reactants', 'products', 'propensity', 'parameters'])
def _sbml_like_piecewise(*args):
if len(args) % 2 == 1:
# Add a final True element you can skip ... | 40.144 | 115 | 0.682742 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,176 | 0.234356 |
2551cc7f888a7265ce1f8beeca110b9348759577 | 1,123 | py | Python | clrenv/tests/test_path.py | color/clrenv | e11b67fcce129a4c828b6d7b421d9f2eac58785b | [
"MIT"
] | 2 | 2019-12-04T05:38:17.000Z | 2022-02-17T06:24:23.000Z | clrenv/tests/test_path.py | color/clrenv | e11b67fcce129a4c828b6d7b421d9f2eac58785b | [
"MIT"
] | 9 | 2019-11-11T20:01:11.000Z | 2021-09-30T00:41:52.000Z | clrenv/tests/test_path.py | color/clrenv | e11b67fcce129a4c828b6d7b421d9f2eac58785b | [
"MIT"
] | 4 | 2017-08-24T00:00:34.000Z | 2021-06-25T16:41:20.000Z | import pytest
import clrenv
@pytest.fixture(autouse=True)
def clear_overlay_path(monkeypatch):
monkeypatch.setenv("CLRENV_OVERLAY_PATH", "")
def test_custom_base(tmp_path, monkeypatch):
custom_path = tmp_path / "custom/path"
custom_path.parent.mkdir()
custom_path.write_text("data")
monkeypatch.... | 27.390244 | 81 | 0.715049 | 0 | 0 | 0 | 0 | 116 | 0.103295 | 0 | 0 | 181 | 0.161175 |
25536ba36fdcd55ea907e174eeadb755910513a2 | 2,583 | py | Python | utils/convert_codah.py | Longday0923/CODAH_Baseline | e9e331452a12c85e35969833cbfc824d6c0256c1 | [
"MIT"
] | null | null | null | utils/convert_codah.py | Longday0923/CODAH_Baseline | e9e331452a12c85e35969833cbfc824d6c0256c1 | [
"MIT"
] | null | null | null | utils/convert_codah.py | Longday0923/CODAH_Baseline | e9e331452a12c85e35969833cbfc824d6c0256c1 | [
"MIT"
] | null | null | null | import random
import pandas as pd
import numpy as np
import json
from tqdm import *
def split(full_list, shuffle=False, ratio=0.2):
n_total = len(full_list)
offset = int(n_total * ratio)
if n_total == 0 or offset < 1:
return [], full_list
if shuffle:
random.shuffle(full_list)
subli... | 37.434783 | 99 | 0.684863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 807 | 0.312427 |
25541a58e6ade5999bf8649b87e0a951c63912f5 | 3,237 | py | Python | new_imgt_scraping/new_imgt/new_imgt/spiders/new_imgt_spider.py | yaosichao0915/DeepImmuno | a2a7832f6cded9296735475c2e8fa5c9b62b3f8d | [
"MIT"
] | 20 | 2020-12-28T03:34:34.000Z | 2022-03-14T01:36:52.000Z | new_imgt_scraping/new_imgt/new_imgt/spiders/new_imgt_spider.py | zhangjiahuan17/DeepImmuno | 5ab182429bc3276fd43be2ec8d86b72e773992ef | [
"MIT"
] | 3 | 2021-04-23T19:21:11.000Z | 2021-08-22T00:39:01.000Z | new_imgt_scraping/new_imgt/new_imgt/spiders/new_imgt_spider.py | zhangjiahuan17/DeepImmuno | 5ab182429bc3276fd43be2ec8d86b72e773992ef | [
"MIT"
] | 11 | 2021-04-23T16:46:29.000Z | 2022-03-18T15:53:55.000Z | '''
pip install Scrapy
pip install selenium
In a folder:
scrapy startproject imgt
when running:
scrapy crawl new_imgt -o out.json
when using scrapy shell:
scrapy shell 'url'
in Ipython, you can use response.xpath or response.css to try out
object:
1. selectorlist if css('a') and there are ... | 33.030612 | 139 | 0.666976 | 1,921 | 0.593451 | 1,083 | 0.334569 | 0 | 0 | 0 | 0 | 1,835 | 0.566883 |
25582433fc1391299fee92277e679b595fa40a57 | 1,667 | py | Python | ooobuild/lo/script/provider/script_framework_error_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/script/provider/script_framework_error_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/script/provider/script_framework_error_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 30.87037 | 165 | 0.721656 | 878 | 0.526695 | 0 | 0 | 0 | 0 | 0 | 0 | 1,402 | 0.841032 |
25582a95ad549fbb53f7bc9394341328228fcce8 | 38,786 | py | Python | Base/opcode_tab.py | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 171 | 2020-01-30T16:58:07.000Z | 2022-03-27T22:12:17.000Z | Base/opcode_tab.py | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 14 | 2021-05-15T02:12:09.000Z | 2022-03-16T04:16:18.000Z | Base/opcode_tab.py | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 5 | 2021-03-01T20:52:13.000Z | 2022-03-07T06:35:03.000Z | #!/usr/bin/python3
# (c) Robert Muth - see LICENSE for more info
from typing import List, Dict
import enum
from Util import cgen
# maximum number of operands in an instruction
MAX_OPERANDS = 5
# maximum number of function parameters (or results)
MAX_PARAMETERS = 64
#################################################... | 36.113594 | 108 | 0.571443 | 6,029 | 0.155443 | 0 | 0 | 2,352 | 0.06064 | 0 | 0 | 14,232 | 0.366937 |
255944c391999d6773e34c522056f9b52e9a85c5 | 784 | py | Python | hexa/plugins/connector_airflow/migrations/0013_dag_run_states.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 4 | 2021-07-19T12:53:21.000Z | 2022-01-26T17:45:02.000Z | hexa/plugins/connector_airflow/migrations/0013_dag_run_states.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 20 | 2021-05-17T12:27:06.000Z | 2022-03-30T11:35:26.000Z | hexa/plugins/connector_airflow/migrations/0013_dag_run_states.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 2 | 2021-09-07T04:19:59.000Z | 2022-02-08T15:33:29.000Z | # Generated by Django 3.2.7 on 2021-10-27 09:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("connector_airflow", "0012_remove_airflow_run_message"),
]
operations = [
migrations.AlterModelOptions(
name="dagrun",
... | 25.290323 | 65 | 0.477041 | 691 | 0.881378 | 0 | 0 | 0 | 0 | 0 | 0 | 217 | 0.276786 |
2559a4a18ffbdf9ee00369efeb0eacf72905221a | 3,447 | py | Python | LAMARCK_ML/data_util/TypeShape_pb2.py | JonasDHomburg/LAMARCK | 0e372c908ff59effc6fd68e6477d04c4d89e6c26 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2019-09-20T08:03:47.000Z | 2021-05-10T11:02:09.000Z | LAMARCK_ML/data_util/TypeShape_pb2.py | JonasDHomburg/LAMARCK_ML | 0e372c908ff59effc6fd68e6477d04c4d89e6c26 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | LAMARCK_ML/data_util/TypeShape_pb2.py | JonasDHomburg/LAMARCK_ML | 0e372c908ff59effc6fd68e6477d04c4d89e6c26 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: LAMARCK_ML/data_util/TypeShape.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... | 38.730337 | 354 | 0.78387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 934 | 0.27096 |
255a4a642a2b2e33a26ec84bb18d2413e8e4b098 | 31,149 | py | Python | main/staff.py | YukiGao7718/Airline-Reservation-System | ecc75316ccbc6aa2db4d0378b938c0275fddb6d3 | [
"MIT"
] | null | null | null | main/staff.py | YukiGao7718/Airline-Reservation-System | ecc75316ccbc6aa2db4d0378b938c0275fddb6d3 | [
"MIT"
] | null | null | null | main/staff.py | YukiGao7718/Airline-Reservation-System | ecc75316ccbc6aa2db4d0378b938c0275fddb6d3 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, session, redirect, url_for
import pymysql.cursors
import datetime
from pyecharts import options as opts
from pyecharts.charts import Pie,Bar
from appdef import *
#Get the airline the staff member works for
def getStaffAirline():
username = session['username']
... | 40.400778 | 129 | 0.596969 | 0 | 0 | 0 | 0 | 29,853 | 0.958394 | 0 | 0 | 13,416 | 0.430704 |
255a812a0890850fc537c0377c504771edd7d281 | 261 | py | Python | app/main.py | athul/jimbru | bc22449dbfbea19d9605e6271a154dbc7037bafb | [
"MIT"
] | 42 | 2020-11-12T11:34:29.000Z | 2022-01-17T11:40:29.000Z | app/main.py | athul/jimbru | bc22449dbfbea19d9605e6271a154dbc7037bafb | [
"MIT"
] | 1 | 2021-06-09T11:41:49.000Z | 2021-06-09T11:41:49.000Z | app/main.py | athul/jimbru | bc22449dbfbea19d9605e6271a154dbc7037bafb | [
"MIT"
] | 2 | 2021-03-17T18:16:15.000Z | 2021-06-08T17:29:38.000Z | from fastapi import FastAPI
try:
from routes import analytics,templates,auth
except:
from .routes import analytics,templates,auth
app = FastAPI()
app.include_router(analytics.router)
app.include_router(templates.router)
app.include_router(auth.authr) | 21.75 | 48 | 0.800766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
255c0c175a4464c1c647d5f7bc88a0e78a8ca610 | 873 | py | Python | tests/test_query_releases.py | hysds/hysds-framework | 701fdf39f1fdb71bcb5c2f6fb6a81da2778fccc0 | [
"Apache-2.0"
] | 1 | 2020-02-09T14:15:11.000Z | 2020-02-09T14:15:11.000Z | tests/test_query_releases.py | hysds/hysds-framework | 701fdf39f1fdb71bcb5c2f6fb6a81da2778fccc0 | [
"Apache-2.0"
] | 12 | 2018-04-16T09:09:40.000Z | 2020-04-15T07:09:15.000Z | tests/test_query_releases.py | hysds/hysds-framework | 701fdf39f1fdb71bcb5c2f6fb6a81da2778fccc0 | [
"Apache-2.0"
] | 7 | 2018-04-07T01:43:48.000Z | 2020-07-23T08:12:37.000Z | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import str
from future import standard_library
standard_library.install_aliases()
import query_releases
import unittest
class TestQueryReleases(unittest.... | 27.28125 | 86 | 0.719359 | 536 | 0.613975 | 0 | 0 | 0 | 0 | 0 | 0 | 150 | 0.171821 |
255d364d93e590ec6297742e59e58cf8fe8ad6e3 | 1,211 | py | Python | products/Introduction_to_Computational_Science_Modules/02_System_Dynamics/iPythonSysDyn/simplePendulum.py | wmmurrah/computationalScience | a4d7df6b50f2ead22878ff68bfe39c5adb88bbbb | [
"W3C"
] | null | null | null | products/Introduction_to_Computational_Science_Modules/02_System_Dynamics/iPythonSysDyn/simplePendulum.py | wmmurrah/computationalScience | a4d7df6b50f2ead22878ff68bfe39c5adb88bbbb | [
"W3C"
] | null | null | null | products/Introduction_to_Computational_Science_Modules/02_System_Dynamics/iPythonSysDyn/simplePendulum.py | wmmurrah/computationalScience | a4d7df6b50f2ead22878ff68bfe39c5adb88bbbb | [
"W3C"
] | null | null | null | # simplePendulum.py
# Model of a simple pendulum
import math
def simplePendulum(length = 1, angle = math.pi/4, angular_velocity = 0, DT = 0.0001, simLength = 12):
numIterations = int(simLength/DT) + 1
g = 9.81
angle_change = angular_velocity
angular_acceleration = -g... | 1,211 | 1,211 | 0.560694 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,211 | 1 |
255d6b11cbe644a12928787786f04d1940067a84 | 303 | py | Python | setup.py | StrykerKKD/dropbox-backup | 8ee692ef1de5be1e3257a627dc268b331694b2b8 | [
"MIT"
] | null | null | null | setup.py | StrykerKKD/dropbox-backup | 8ee692ef1de5be1e3257a627dc268b331694b2b8 | [
"MIT"
] | null | null | null | setup.py | StrykerKKD/dropbox-backup | 8ee692ef1de5be1e3257a627dc268b331694b2b8 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='dropboxbackup',
version='0.1',
py_modules=['dropboxbackup'],
install_requires=[
'click',
'dropbox',
'simple-crypt'
],
entry_points='''
[console_scripts]
dropboxbackup=dropboxbackup:cli
''',
)
| 17.823529 | 39 | 0.574257 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 142 | 0.468647 |
255e4c40128d8dd3b9bb2375467740bbfa0ffbee | 6,896 | py | Python | scripts/example_tvm_tune.py | AndrewZhaoLuo/CenterFaceTVMDemo | 4c9d63d502b33b7b13666258a7da97e909de4b36 | [
"MIT"
] | 5 | 2021-12-25T10:18:07.000Z | 2022-02-20T00:24:41.000Z | scripts/example_tvm_tune.py | AndrewZhaoLuo/CenterFaceTVMDemo | 4c9d63d502b33b7b13666258a7da97e909de4b36 | [
"MIT"
] | 2 | 2022-01-16T10:12:07.000Z | 2022-03-22T00:34:26.000Z | scripts/example_tvm_tune.py | AndrewZhaoLuo/CenterFaceTVMDemo | 4c9d63d502b33b7b13666258a7da97e909de4b36 | [
"MIT"
] | null | null | null | from os import path
from shutil import copyfile
import tvm
from tvm import relay
from tvm.driver import tvmc
from tvm.driver.tvmc.model import TVMCModel
from tvm.relay.transform import InferType, ToMixedPrecision
"""Copy pasted mostly from:
https://github.com/AndrewZhaoLuo/TVM-Sandbox/blob/bb209e8845440ed9f40af1b258... | 32.074419 | 121 | 0.664588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,044 | 0.296404 |
255ead5625498b81a0e784e802611ba152b63d6e | 1,547 | py | Python | mod_flan_doodle.py | AndrewWayne/bot-flandre | 6c14c96e55c99ec7961216c8cafbc46f62700bbe | [
"Apache-2.0"
] | null | null | null | mod_flan_doodle.py | AndrewWayne/bot-flandre | 6c14c96e55c99ec7961216c8cafbc46f62700bbe | [
"Apache-2.0"
] | null | null | null | mod_flan_doodle.py | AndrewWayne/bot-flandre | 6c14c96e55c99ec7961216c8cafbc46f62700bbe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
XJB Generate Images Module (/doodle)
Created on Sun Sep 1 16:03:16 2019
@author: user
"""
import os
import asyncio
import uuid
import tg_connection
gen_path = "D:/AndroidProjects/ScarletKindom/flandre-generator/wgan/sample.png"
inp_base = "D:/AndroidProjects/ScarletKindom/flandre-genera... | 27.625 | 85 | 0.659341 | 0 | 0 | 0 | 0 | 0 | 0 | 1,051 | 0.679379 | 335 | 0.216548 |
255eb03b3149f28db58ee09e23382f4784f486dd | 362 | py | Python | leadmanager/leads/views.py | mydjangoandreactprojects/lead-manager | 844c655dcd1010fb0b1cd889ddc94872aa4f15a0 | [
"MIT"
] | 1 | 2020-03-26T06:25:47.000Z | 2020-03-26T06:25:47.000Z | leadmanager/leads/views.py | mydjangoandreactprojects/lead-manager | 844c655dcd1010fb0b1cd889ddc94872aa4f15a0 | [
"MIT"
] | null | null | null | leadmanager/leads/views.py | mydjangoandreactprojects/lead-manager | 844c655dcd1010fb0b1cd889ddc94872aa4f15a0 | [
"MIT"
] | null | null | null | from rest_framework import viewsets, permissions
from leads.serializers import LeadSerializer
from leads.models import Lead
class LeadViewSet(viewsets.ModelViewSet):
"""Manage CRUD operations for Leads in the database"""
queryset = Lead.objects.all()
permission_classes = [
permissions.AllowAny
... | 25.857143 | 58 | 0.756906 | 234 | 0.646409 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 0.149171 |
255edfec817ac332c0a59a30e33ffe4ca99dbfbc | 207 | py | Python | app/main/errors.py | BABAYAGI/newsapi | 6127d51e702983f2928849bef08c5920f7d06a96 | [
"MIT"
] | 1 | 2019-10-15T08:16:17.000Z | 2019-10-15T08:16:17.000Z | app/main/errors.py | BABAYAGI/newsapi | 6127d51e702983f2928849bef08c5920f7d06a96 | [
"MIT"
] | null | null | null | app/main/errors.py | BABAYAGI/newsapi | 6127d51e702983f2928849bef08c5920f7d06a96 | [
"MIT"
] | null | null | null | from flask import render_template
from . import main
@main.app_errorhandler(404)
def fo_O_fo(error):
"""
Function to render the 404 error page
"""
return render_template('fo_O_fo.html'), 404 | 23 | 47 | 0.714976 | 0 | 0 | 0 | 0 | 153 | 0.73913 | 0 | 0 | 67 | 0.323671 |
255f08813afc83e4a9438097dc0b9eb5bb612867 | 408 | py | Python | 2020/network/network/models.py | 133794m3r/cs50-web | 1f695cd7fb4ec368ec45e0d3154dd7eebc2c81e2 | [
"MIT"
] | null | null | null | 2020/network/network/models.py | 133794m3r/cs50-web | 1f695cd7fb4ec368ec45e0d3154dd7eebc2c81e2 | [
"MIT"
] | null | null | null | 2020/network/network/models.py | 133794m3r/cs50-web | 1f695cd7fb4ec368ec45e0d3154dd7eebc2c81e2 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
followers = models.ManyToManyField('self',symmetrical=False,related_name='following')
class Post(models.Model):
username = models.ForeignKey(User,on_delete=models.CASCADE,related_name='posts')
content = mode... | 31.384615 | 86 | 0.801471 | 322 | 0.789216 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.058824 |
255f1d23b8f394dc79d9946c976e6a08c2991d2e | 18,476 | py | Python | Collage_generator/_insertion.py | alexliyihao/AAPI_code | 81c6cc40a9efb4d4fedf6678c27aac83f5057a70 | [
"MIT"
] | 2 | 2020-11-29T17:00:52.000Z | 2022-01-06T19:24:23.000Z | Collage_generator/_insertion.py | alexliyihao/AAPI_code | 81c6cc40a9efb4d4fedf6678c27aac83f5057a70 | [
"MIT"
] | null | null | null | Collage_generator/_insertion.py | alexliyihao/AAPI_code | 81c6cc40a9efb4d4fedf6678c27aac83f5057a70 | [
"MIT"
] | null | null | null | import PIL.Image as Img
import numpy as np
from tqdm.notebook import tqdm
from PIL import ImageFilter
import tables
import time
import gc
"""
all the insert/append function for collage generator
_canvas_append takes the inserting operation, the rest are finding add_point logic
"""
class _insertion():
def _canvas_a... | 54.662722 | 120 | 0.500758 | 18,192 | 0.984629 | 0 | 0 | 0 | 0 | 0 | 0 | 6,492 | 0.351375 |
255fc1c3062c1fbdf6dc873744212e8248b03800 | 190,066 | py | Python | openshift/client/apis/build_openshift_io_v1_api.py | asetty/openshift-restclient-python | c6f2168d7a02a24c030fb67959919fd4a9eb260d | [
"Apache-2.0"
] | null | null | null | openshift/client/apis/build_openshift_io_v1_api.py | asetty/openshift-restclient-python | c6f2168d7a02a24c030fb67959919fd4a9eb260d | [
"Apache-2.0"
] | null | null | null | openshift/client/apis/build_openshift_io_v1_api.py | asetty/openshift-restclient-python | c6f2168d7a02a24c030fb67959919fd4a9eb260d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is... | 61.470246 | 3,325 | 0.643066 | 186,385 | 0.980633 | 0 | 0 | 0 | 0 | 0 | 0 | 118,582 | 0.623899 |
256135f3261bda49e4b410a35a4a8f8355d98ad8 | 722 | py | Python | rpi/tcp_server.py | nicolasGibaud7/App-domotic | aee4d80aa05a39388efd92ab9ecf9b5dd1460322 | [
"MIT"
] | 4 | 2020-01-01T15:22:55.000Z | 2020-01-10T09:34:26.000Z | rpi/tcp_server.py | nicolasGibaud7/App-domotic | aee4d80aa05a39388efd92ab9ecf9b5dd1460322 | [
"MIT"
] | 2 | 2020-01-01T15:16:02.000Z | 2020-01-02T13:56:29.000Z | rpi/tcp_server.py | nicolasGibaud7/App-domotic | aee4d80aa05a39388efd92ab9ecf9b5dd1460322 | [
"MIT"
] | null | null | null | import socket
import sys
IP_ADDR = "192.168.1.19"
TCP_PORT = 10000
if __name__ == "__main__":
# Create TCP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Associate the socket with the server address
server_address = (IP_ADDR, TCP_PORT)
print("Start TCP server at address {} on p... | 26.740741 | 100 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 182 | 0.252078 |
25630ec4579c4b69b7aa7ebcd6033338a4cfed43 | 269 | py | Python | pandas/pandasReading02.py | slowy07/pythonApps | 22f9766291dbccd8185035745950c5ee4ebd6a3e | [
"MIT"
] | 10 | 2020-10-09T11:05:18.000Z | 2022-02-13T03:22:10.000Z | pandas/pandasReading02.py | khairanabila/pythonApps | f90b8823f939b98f7bf1dea7ed35fe6e22e2f730 | [
"MIT"
] | null | null | null | pandas/pandasReading02.py | khairanabila/pythonApps | f90b8823f939b98f7bf1dea7ed35fe6e22e2f730 | [
"MIT"
] | 6 | 2020-11-26T12:49:43.000Z | 2022-03-06T06:46:43.000Z | import pandas as pd
countryInformation = pd.read_csv('resource/countryInformation.csv')
#looping row
#for index,row in countryInformation.iterrows():
#print(index, row['country_name'])
print(countryInformation.loc[countryInformation['country_name'] == 'india']) | 26.9 | 76 | 0.773234 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 0.550186 |
256327adbdadb9819f932122ab31855bfe822e1d | 2,011 | py | Python | List Comprehensions/examples.py | mervatkheir/kite-python-blog-post-code | 9a331e5d327cd27c6ecd72926f3e74afd252efb5 | [
"MIT"
] | 238 | 2018-10-10T18:50:40.000Z | 2022-02-09T21:26:24.000Z | List Comprehensions/examples.py | mrrizal/kite-python-blog-post-code | 597f2d75b2ad5dda97e9b19f6e9c7195642e1739 | [
"MIT"
] | 38 | 2019-12-04T22:42:45.000Z | 2022-03-12T00:04:57.000Z | List Comprehensions/examples.py | mrrizal/kite-python-blog-post-code | 597f2d75b2ad5dda97e9b19f6e9c7195642e1739 | [
"MIT"
] | 154 | 2018-11-11T22:48:09.000Z | 2022-03-22T07:12:18.000Z | """
List Comprehensions Examples
"""
my_list = []
# my_list.append()
# my_list.extend()
"""
When to use ListComps
"""
phones = [
{
'number': '111-111-1111',
'label': 'phone',
'extension': '1234',
},
{
'number': '222-222-2222',
'label': 'mobile',
'extension... | 15.960317 | 53 | 0.604674 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 492 | 0.244654 |
2564c2f1d6dd5e44be1def881988d5a419b3038e | 2,549 | py | Python | ImageDenoising/network/denoising.py | jiunbae/ITE4053 | 873d53493b7588f67406e0e6ed0e74e5e3f957bc | [
"MIT"
] | 5 | 2019-06-20T09:54:04.000Z | 2021-06-15T04:22:49.000Z | ImageDenoising/network/denoising.py | jiunbae/ITE4053 | 873d53493b7588f67406e0e6ed0e74e5e3f957bc | [
"MIT"
] | null | null | null | ImageDenoising/network/denoising.py | jiunbae/ITE4053 | 873d53493b7588f67406e0e6ed0e74e5e3f957bc | [
"MIT"
] | 1 | 2019-04-19T04:52:34.000Z | 2019-04-19T04:52:34.000Z | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras import models as KM
from tensorflow.keras import layers as KL
class DenoisingNetwork(object):
def __new__(cls, mode: str) \
-> KM.Model:
assert mode in ['base', 'skip', 'bn']
inputs = KL.Input(sha... | 33.986667 | 59 | 0.488035 | 2,396 | 0.939976 | 0 | 0 | 500 | 0.196155 | 0 | 0 | 255 | 0.100039 |
256670e4e127db5ef91b0b78cc07a367f32674c1 | 884 | py | Python | utils/timer.py | YorkSu/hat | b646b6689f3d81c985ed13f3d5c23b6c717fd07d | [
"Apache-2.0"
] | 1 | 2019-04-10T04:49:30.000Z | 2019-04-10T04:49:30.000Z | utils/timer.py | Suger131/HAT-tf2.0 | b646b6689f3d81c985ed13f3d5c23b6c717fd07d | [
"Apache-2.0"
] | null | null | null | utils/timer.py | Suger131/HAT-tf2.0 | b646b6689f3d81c985ed13f3d5c23b6c717fd07d | [
"Apache-2.0"
] | 1 | 2019-06-14T05:53:42.000Z | 2019-06-14T05:53:42.000Z | import time
class Timer(object):
def __init__(self, Log, *args, **kwargs):
self.Log = Log
return super().__init__(*args, **kwargs)
@property
def time(self):
return time.strftime('%Y-%m-%d-%H-%M-%S', time.localtime())
def mktime(self, timex):
return time.mktime(time.strptime(timex, '%Y-%m-%d... | 31.571429 | 65 | 0.623303 | 870 | 0.984163 | 0 | 0 | 91 | 0.102941 | 0 | 0 | 156 | 0.176471 |
2568aee40cfce9e5a8b21215e284c31ef6b2bd2a | 17,464 | py | Python | pySPACE/missions/nodes/data_selection/instance_selection.py | pyspace/pyspace | 763e62c0e7fa7cfcb19ccee1a0333c4f7e68ae62 | [
"BSD-3-Clause"
] | 32 | 2015-02-20T09:03:09.000Z | 2022-02-25T22:32:52.000Z | pySPACE/missions/nodes/data_selection/instance_selection.py | pyspace/pyspace | 763e62c0e7fa7cfcb19ccee1a0333c4f7e68ae62 | [
"BSD-3-Clause"
] | 5 | 2015-05-18T15:08:40.000Z | 2020-03-05T19:18:01.000Z | pySPACE/missions/nodes/data_selection/instance_selection.py | pyspace/pyspace | 763e62c0e7fa7cfcb19ccee1a0333c4f7e68ae62 | [
"BSD-3-Clause"
] | 18 | 2015-09-28T07:16:38.000Z | 2021-01-20T13:52:19.000Z | """ Select only a part of the instances
.. todo: group instance selectors
"""
import random
import logging
from collections import defaultdict
from pySPACE.missions.nodes.base_node import BaseNode
from pySPACE.tools.memoize_generator import MemoizeGenerator
class InstanceSelectionNode(BaseNode):
"""Retain only... | 43.334988 | 88 | 0.584918 | 17,047 | 0.976122 | 0 | 0 | 0 | 0 | 0 | 0 | 6,823 | 0.390689 |
256a8cd6b55c2a6f3936b57c2975d63cfcb67d9a | 4,050 | py | Python | tests/test_functional.py | tirkarthi/humpty | 8652cf7b18a09d1a1d73465afd38581ef4e2369e | [
"BSD-3-Clause"
] | 14 | 2015-09-05T20:20:50.000Z | 2021-04-08T08:53:20.000Z | tests/test_functional.py | tirkarthi/humpty | 8652cf7b18a09d1a1d73465afd38581ef4e2369e | [
"BSD-3-Clause"
] | 6 | 2017-05-12T20:46:40.000Z | 2020-02-08T05:05:03.000Z | tests/test_functional.py | tirkarthi/humpty | 8652cf7b18a09d1a1d73465afd38581ef4e2369e | [
"BSD-3-Clause"
] | 8 | 2017-02-13T15:38:53.000Z | 2020-11-11T20:16:58.000Z | # -*- coding: utf-8 -*-
"""
"""
from __future__ import absolute_import
from contextlib import contextmanager
import imp
import posixpath
from zipfile import ZipFile
from click.testing import CliRunner
import pkginfo
import pytest
from six import PY3
def test_pyfile_compiled(packages, tmpdir):
packages.require_e... | 27.739726 | 79 | 0.66716 | 0 | 0 | 74 | 0.018267 | 206 | 0.050852 | 0 | 0 | 1,063 | 0.262404 |
256b83c7f65a2f6d348541c27824ba4aba67696c | 1,649 | py | Python | policytools/master_list/actions_master_list_base.py | samkeen/policy-tools | 5183a710ac7b3816c6b6f3f8493d410712018873 | [
"Apache-2.0"
] | 1 | 2021-04-03T12:16:53.000Z | 2021-04-03T12:16:53.000Z | policytools/master_list/actions_master_list_base.py | samkeen/policy-tools | 5183a710ac7b3816c6b6f3f8493d410712018873 | [
"Apache-2.0"
] | 6 | 2019-05-07T03:36:58.000Z | 2021-02-02T22:49:53.000Z | policytools/master_list/actions_master_list_base.py | samkeen/policy-tools | 5183a710ac7b3816c6b6f3f8493d410712018873 | [
"Apache-2.0"
] | null | null | null | import logging
from abc import ABC, abstractmethod
logger = logging.getLogger(__name__)
class ActionsMasterListBase(ABC):
"""
Base class meant to hold the entire Set of IAM resource actions.
It is up to a concrete class to implement a source document parser (parse_actions_source)
"""
def __init_... | 28.431034 | 116 | 0.62644 | 1,556 | 0.943602 | 0 | 0 | 476 | 0.28866 | 0 | 0 | 741 | 0.449363 |
256b989b63c37dd38e854142d7a19f85d5f03b4f | 1,401 | py | Python | diy_gym/addons/debug/joint_trace.py | wassname/diy-gym | 83232ae6971341a86683d316feecf4d34d3caf47 | [
"MIT"
] | null | null | null | diy_gym/addons/debug/joint_trace.py | wassname/diy-gym | 83232ae6971341a86683d316feecf4d34d3caf47 | [
"MIT"
] | null | null | null | diy_gym/addons/debug/joint_trace.py | wassname/diy-gym | 83232ae6971341a86683d316feecf4d34d3caf47 | [
"MIT"
] | null | null | null | import pybullet as p
from gym import spaces
import pybullet_planning as pbp
import numpy as np
from diy_gym.addons.addon import Addon
class JointTrace(Addon):
"""
JointTrace
Trace the follows a joints movements
"""
def __init__(self, parent, config):
super().__init__(parent, config)
... | 31.133333 | 120 | 0.581727 | 1,263 | 0.901499 | 0 | 0 | 0 | 0 | 0 | 0 | 144 | 0.102784 |
256c5471eacba768e9791f30d6ef0762118cc682 | 181 | py | Python | codility/1_3.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 3 | 2019-03-09T05:19:23.000Z | 2019-04-06T09:26:36.000Z | codility/1_3.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2020-02-23T10:38:04.000Z | 2020-02-23T10:38:04.000Z | codility/1_3.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2019-05-22T13:47:53.000Z | 2019-05-22T13:47:53.000Z | def solution(S):
rs = ""
for i in S:
if i != " ":
rs += i
else:
rs += "%20"
return rs
S = "Mr John Smith"
print(solution(S))
| 12.066667 | 23 | 0.381215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 0.138122 |
256c54c224c3656056ad73a0292f2c0577a7fce0 | 1,612 | py | Python | ngraph/flex/flexargparser.py | NervanaSystems/ngraph-python | ac032c83c7152b615a9ad129d54d350f9d6a2986 | [
"Apache-2.0"
] | 18 | 2018-03-19T04:16:49.000Z | 2021-02-08T14:44:58.000Z | ngraph/flex/flexargparser.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 2 | 2019-04-16T06:41:49.000Z | 2019-05-06T14:08:13.000Z | ngraph/flex/flexargparser.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 11 | 2018-06-16T15:59:08.000Z | 2021-03-06T00:45:30.000Z | from __future__ import print_function
import ngraph.transformers as ngt
from ngraph.flex.names import flex_gpu_transformer_name
import argparse
class FlexNgraphArgparser():
"""
Flex specific command line args
"""
@staticmethod
def setup_flex_args(argParser):
"""
Add flex specific ... | 36.636364 | 97 | 0.614144 | 1,465 | 0.908809 | 0 | 0 | 1,373 | 0.851737 | 0 | 0 | 470 | 0.291563 |
256d49d818eb371b9cdddf6e67c307560654cf96 | 969 | py | Python | src/hydep/simplerom.py | CORE-GATECH-GROUP/hydep | 3cb65325eb03251629b3aaa8c3895a002e05d55d | [
"MIT"
] | 2 | 2020-11-12T03:08:07.000Z | 2021-10-04T22:09:48.000Z | src/hydep/simplerom.py | CORE-GATECH-GROUP/hydep | 3cb65325eb03251629b3aaa8c3895a002e05d55d | [
"MIT"
] | 2 | 2020-11-25T16:24:29.000Z | 2021-08-28T23:19:39.000Z | src/hydep/simplerom.py | CORE-GATECH-GROUP/hydep | 3cb65325eb03251629b3aaa8c3895a002e05d55d | [
"MIT"
] | 1 | 2020-11-12T03:08:10.000Z | 2020-11-12T03:08:10.000Z | """
Simple reduced order solver.
More of a no-op, in that it doesn't actually
perform a flux solution
"""
import numpy
from hydep.internal.features import FeatureCollection
from hydep.internal import TransportResult
from .lib import ReducedOrderSolver
class SimpleROSolver(ReducedOrderSolver):
"""The simplest r... | 26.916667 | 85 | 0.693498 | 711 | 0.733746 | 0 | 0 | 0 | 0 | 0 | 0 | 446 | 0.460268 |
25713c734ac79b5bf287eaff619cf02ebcde4535 | 449 | py | Python | TopQuarkAnalysis/TopEventProducers/python/sequences/ttGenEvent_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | TopQuarkAnalysis/TopEventProducers/python/sequences/ttGenEvent_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | TopQuarkAnalysis/TopEventProducers/python/sequences/ttGenEvent_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
#
# produce ttGenEvent with all necessary ingredients
#
from TopQuarkAnalysis.TopEventProducers.producers.TopInitSubset_cfi import *
from TopQuarkAnalysis.TopEventProducers.producers.TopDecaySubset_cfi import *
from TopQuarkAnalysis.TopEventProducers.producers.TtGenEvtProducer_... | 28.0625 | 79 | 0.830735 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.11804 |
2571f7e0a4f394d6c21f691f7de829e3237dd090 | 8,442 | py | Python | models/linnet.py | mengxiangke/bsn | df6458a44b8d8b442c086e158366dd296fab54cc | [
"Apache-2.0"
] | 5 | 2020-09-19T18:05:08.000Z | 2022-01-23T14:55:07.000Z | models/linnet.py | mengxiangke/bsn | df6458a44b8d8b442c086e158366dd296fab54cc | [
"Apache-2.0"
] | null | null | null | models/linnet.py | mengxiangke/bsn | df6458a44b8d8b442c086e158366dd296fab54cc | [
"Apache-2.0"
] | 7 | 2020-09-19T18:05:11.000Z | 2021-12-28T02:41:12.000Z | import os
from os.path import join as pjoin
import time
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torch.optim.lr_scheduler import CosineAnnealingLR
try:
from .radam import RAdam
except (ImportError, ModuleNotFoundError) as err:
from radam import RAdam
try:
... | 31.977273 | 98 | 0.47394 | 7,654 | 0.906657 | 0 | 0 | 248 | 0.029377 | 0 | 0 | 1,180 | 0.139777 |
c24fdcfaa37586667c8318eb6776d1204e6b7822 | 6,043 | py | Python | vendor/packages/nose/functional_tests/test_importer.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | vendor/packages/nose/functional_tests/test_importer.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/nose/functional_tests/test_importer.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 1 | 2019-11-02T23:29:13.000Z | 2019-11-02T23:29:13.000Z | import os
import sys
import unittest
from nose.importer import Importer
class TestImporter(unittest.TestCase):
def setUp(self):
self.dir = os.path.normpath(os.path.join(os.path.dirname(__file__),
'support'))
self.imp = Importer()
self._mods... | 35.757396 | 78 | 0.580837 | 5,848 | 0.967731 | 0 | 0 | 0 | 0 | 0 | 0 | 1,037 | 0.171604 |
c2516c459b4df1dceb074080d5a8ce6f229681ed | 16,278 | py | Python | mvmm/multi_view/SpectralPenSearchByBlockMVMM.py | idc9/mvmm | 64fce755a7cd53be9b08278484c7a4c77daf38d1 | [
"MIT"
] | 1 | 2021-08-17T13:22:54.000Z | 2021-08-17T13:22:54.000Z | mvmm/multi_view/SpectralPenSearchByBlockMVMM.py | idc9/mvmm | 64fce755a7cd53be9b08278484c7a4c77daf38d1 | [
"MIT"
] | null | null | null | mvmm/multi_view/SpectralPenSearchByBlockMVMM.py | idc9/mvmm | 64fce755a7cd53be9b08278484c7a4c77daf38d1 | [
"MIT"
] | null | null | null | from sklearn.base import clone
import pandas as pd
from abc import ABCMeta
from time import time
from datetime import datetime
import numpy as np
from sklearn.model_selection import ParameterGrid
from sklearn.base import BaseEstimator, MetaEstimatorMixin
from mvmm.utils import get_seeds
from mvmm.multi_view.utils impo... | 37.42069 | 128 | 0.531699 | 15,637 | 0.960622 | 0 | 0 | 1,058 | 0.064996 | 0 | 0 | 4,014 | 0.24659 |
c251ec2f4862db71edcfa85809de82aead64c14b | 812 | py | Python | tests/unit/providers/traversal/test_delegate_py3.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/traversal/test_delegate_py3.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/traversal/test_delegate_py3.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | """Delegate provider traversal tests."""
from dependency_injector import providers
def test_traversal_provider():
another_provider = providers.Provider()
provider = providers.Delegate(another_provider)
all_providers = list(provider.traverse())
assert len(all_providers) == 1
assert another_provi... | 24.606061 | 51 | 0.752463 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 40 | 0.049261 |
c2531eebc4b5c56768575d213a86688eb0c965b8 | 161 | py | Python | rhg_compute_tools/__init__.py | dpa9694/rhg_compute_tools | f111c380e3672983fa62795346be631e62c12611 | [
"MIT"
] | null | null | null | rhg_compute_tools/__init__.py | dpa9694/rhg_compute_tools | f111c380e3672983fa62795346be631e62c12611 | [
"MIT"
] | 2 | 2020-05-31T20:40:25.000Z | 2020-07-15T16:51:55.000Z | rhg_compute_tools/__init__.py | dpa9694/rhg_compute_tools | f111c380e3672983fa62795346be631e62c12611 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for RHG Compute Tools."""
__author__ = """Michael Delgado"""
__email__ = 'mdelgado@rhg.com'
__version__ = '0.2.1'
| 20.125 | 46 | 0.645963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 0.714286 |
c253281fece2f931537ba0aac860be0c88c05f35 | 481 | py | Python | grocers_panel/migrations/0005_alter_shop_food.py | delitamakanda/GroceryApp | 8b0eeb40197b480598928dd7e95e63ca180c9bf1 | [
"MIT"
] | 1 | 2021-05-25T02:46:42.000Z | 2021-05-25T02:46:42.000Z | grocers_panel/migrations/0005_alter_shop_food.py | delitamakanda/GroceryApp | 8b0eeb40197b480598928dd7e95e63ca180c9bf1 | [
"MIT"
] | null | null | null | grocers_panel/migrations/0005_alter_shop_food.py | delitamakanda/GroceryApp | 8b0eeb40197b480598928dd7e95e63ca180c9bf1 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-12-19 17:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('grocers_panel', '0004_shop_grocer'),
]
operations = [
migrations.AlterField(
model_name='shop',... | 24.05 | 117 | 0.640333 | 355 | 0.738046 | 0 | 0 | 0 | 0 | 0 | 0 | 112 | 0.232848 |
c2544d4b8163352d260ea54398086333ae611bb9 | 271 | py | Python | apps/core/models/colabore.py | bispojr/observatorio-ufj-covid19 | 8667fae1367b95a7dfa8558fbac3b1b0b708af8d | [
"MIT"
] | 3 | 2020-04-02T21:59:19.000Z | 2020-12-03T12:37:26.000Z | apps/core/models/colabore.py | bispojr/observatorio-ufj-covid19 | 8667fae1367b95a7dfa8558fbac3b1b0b708af8d | [
"MIT"
] | 68 | 2020-03-28T22:40:08.000Z | 2020-07-08T18:04:07.000Z | apps/core/models/colabore.py | bispojr/observatorio-ufj-covid19 | 8667fae1367b95a7dfa8558fbac3b1b0b708af8d | [
"MIT"
] | 5 | 2020-03-28T21:35:30.000Z | 2020-06-10T01:28:14.000Z |
class Colabore():
def getContext(self):
return self.__contextColabore(self)
def __contextColabore(self):
context = {
"grupo": "geral",
"grupo_link": "saiba_mais",
"titulo": "Observatório UFJ Covid-19 - Colabore"
}
return context | 20.846154 | 50 | 0.630996 | 271 | 0.996324 | 0 | 0 | 0 | 0 | 0 | 0 | 85 | 0.3125 |
c254aa30204c44e620331c5c8033c1497466fa14 | 6,339 | py | Python | tests/logic/order_history_test.py | rirwin/stock-analysis | d13b9be86265ad87c10847422a04f93409b0bf51 | [
"Apache-2.0"
] | null | null | null | tests/logic/order_history_test.py | rirwin/stock-analysis | d13b9be86265ad87c10847422a04f93409b0bf51 | [
"Apache-2.0"
] | 1 | 2020-06-24T04:41:59.000Z | 2020-06-24T04:41:59.000Z | tests/logic/order_history_test.py | rirwin/stock_analysis | d13b9be86265ad87c10847422a04f93409b0bf51 | [
"Apache-2.0"
] | null | null | null | import datetime
from sqlalchemy.orm import sessionmaker
from database import db
from database.order_history import OrderHistory
from stock_analysis.logic import order_history
from stock_analysis.logic.order_history import Order
from stock_analysis.logic.order_history import OrderHistoryLogic
from stock_analysis.logic.... | 31.073529 | 102 | 0.56602 | 5,943 | 0.93753 | 0 | 0 | 5,871 | 0.926171 | 0 | 0 | 132 | 0.020823 |
c256ecf86fa244e6c6873a974253c22509fa427e | 3,380 | py | Python | source_dir/densenet_3d_estimator.py | ffeijoo/3d-DenseNet | baec68af07294ac5e432096055909ff08ea2e81c | [
"MIT"
] | null | null | null | source_dir/densenet_3d_estimator.py | ffeijoo/3d-DenseNet | baec68af07294ac5e432096055909ff08ea2e81c | [
"MIT"
] | null | null | null | source_dir/densenet_3d_estimator.py | ffeijoo/3d-DenseNet | baec68af07294ac5e432096055909ff08ea2e81c | [
"MIT"
] | null | null | null | import os
import tensorflow as tf
from densenet_3d_model import DenseNet3D
def model_fn(features, labels, mode, params):
# Define the model
model = DenseNet3D(
video_clips=features['video_clips'], labels=labels, **params)
# Get the prediction result
if mode == tf.estimator.ModeKeys.PRED... | 34.845361 | 108 | 0.671598 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 638 | 0.188757 |