hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fc4d605e78160efc52f4b06887dc39344513d730 | 627 | py | Python | setup.py | 404notfound-3/rpad | d1a80b0c6ce1088292eb008da5c1188866dc84e3 | [
"MIT"
] | 1 | 2020-04-27T22:52:38.000Z | 2020-04-27T22:52:38.000Z | setup.py | 404notfound-3/rpad | d1a80b0c6ce1088292eb008da5c1188866dc84e3 | [
"MIT"
] | null | null | null | setup.py | 404notfound-3/rpad | d1a80b0c6ce1088292eb008da5c1188866dc84e3 | [
"MIT"
] | null | null | null | import os, sys, cx_Freeze
base = None
if sys.platform == 'win32':
base = "Win32GUI"
os.environ['TCL_LIBRARY'] = r"C:\Users\sword\AppData\Local\Programs\Python\Python38\tcl\tcl8.6"
os.environ['TK_LIBRARY'] = r"C:\Users\sword\AppData\Local\Programs\Python\Python38\tcl\tk8.6"
executables = [cx_Freeze.Executable("r... | 29.857143 | 112 | 0.679426 |
d206122e39ca743eabe0ed7637cf121348c803a2 | 57,048 | py | Python | sdks/python/apache_beam/runners/portability/fn_api_runner_transforms.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/portability/fn_api_runner_transforms.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/portability/fn_api_runner_transforms.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 39.3706 | 84 | 0.668945 |
0fe8a2542bbbfaf7ffd216cd9fabc496659f2f4b | 14,140 | py | Python | ocrd_cis/ocropy/resegment.py | bertsky/cis-ocrd-py | c3fad1a8b04dc5a305460e8bb3c54cb79cd75515 | [
"MIT"
] | 26 | 2019-10-23T22:40:17.000Z | 2022-03-04T11:32:51.000Z | ocrd_cis/ocropy/resegment.py | cisocrgroup/ocrd_cis | c3fad1a8b04dc5a305460e8bb3c54cb79cd75515 | [
"MIT"
] | 64 | 2019-08-29T14:27:40.000Z | 2022-03-25T15:23:21.000Z | ocrd_cis/ocropy/resegment.py | bertsky/ocrd_cis | c3fad1a8b04dc5a305460e8bb3c54cb79cd75515 | [
"MIT"
] | 7 | 2019-09-23T13:32:04.000Z | 2021-04-15T11:46:48.000Z | from __future__ import absolute_import
import os.path
import numpy as np
from skimage import draw
import cv2
from shapely.geometry import Polygon
from scipy.ndimage import filters
from ocrd_modelfactory import page_from_file
from ocrd_models.ocrd_page import (
to_xml, AlternativeImageType
)
from ocrd import Proce... | 51.231884 | 103 | 0.614144 |
79c697bb95e0fd72033cc01247d7e672ccf1fc7e | 6,907 | py | Python | youtube.py | wdwnt/fastpass | 781dff4fb34f8aa7b3b4c59f1e8c010dfcc0981b | [
"MIT"
] | 3 | 2018-12-03T20:51:40.000Z | 2019-01-28T20:11:03.000Z | youtube.py | wdwnt/fastpass | 781dff4fb34f8aa7b3b4c59f1e8c010dfcc0981b | [
"MIT"
] | 26 | 2018-06-10T11:02:18.000Z | 2020-02-22T16:43:02.000Z | youtube.py | wdwnt/fastpass | 781dff4fb34f8aa7b3b4c59f1e8c010dfcc0981b | [
"MIT"
] | null | null | null | import argparse
# import functools
from pprint import pprint
from datetime import datetime, timedelta, timezone
from dateutil.parser import parse
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
class YoutubeBroadcasts(object):... | 39.924855 | 112 | 0.609527 |
4c091a3440748850dc60ac85f0ee1ac838159232 | 7,953 | py | Python | strengthaerobics.py | shulinye/yoga | cde4a9a12ea444f760b938e6ed1e6380e9d62c16 | [
"MIT"
] | 2 | 2015-07-02T08:50:33.000Z | 2019-11-13T20:55:40.000Z | strengthaerobics.py | shulinye/yoga | cde4a9a12ea444f760b938e6ed1e6380e9d62c16 | [
"MIT"
] | 19 | 2015-06-24T22:58:40.000Z | 2015-07-25T04:50:43.000Z | strengthaerobics.py | shulinye/yoga | cde4a9a12ea444f760b938e6ed1e6380e9d62c16 | [
"MIT"
] | null | null | null | #/usr/bin/python3
from models import Move
def linkAerobics(movesGraph, difficulty = 1, aerobics = 0):
"""Adds in aerobics moves"""
movesGraph['jumpingJacks'] = Move("Jumping Jacks", 0, "Jumping Jacks!", 40 + 20*difficulty, movesGraph['mountain'], countReps=True, countdown=True)
movesGraph['runInPlace'] = ... | 72.963303 | 169 | 0.706274 |
3ff511be44a67e324bdb05332f74d044f6d52efd | 56,251 | py | Python | Lib/asyncio/base_events.py | Golfist/cpython | c4750959acbfc3057f12aaec832483ba30898d1c | [
"PSF-2.0"
] | null | null | null | Lib/asyncio/base_events.py | Golfist/cpython | c4750959acbfc3057f12aaec832483ba30898d1c | [
"PSF-2.0"
] | null | null | null | Lib/asyncio/base_events.py | Golfist/cpython | c4750959acbfc3057f12aaec832483ba30898d1c | [
"PSF-2.0"
] | null | null | null | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... | 38.422814 | 80 | 0.560843 |
a4510bb293695289da31035e119b034127c0c402 | 9,931 | py | Python | main.py | luyanger1799/torchcv | 6414f5acb41c2f35f8e79e477a57eaba65591c66 | [
"Apache-2.0"
] | 1 | 2019-10-18T06:56:53.000Z | 2019-10-18T06:56:53.000Z | main.py | shanhedian2017/torchcv | 6414f5acb41c2f35f8e79e477a57eaba65591c66 | [
"Apache-2.0"
] | null | null | null | main.py | shanhedian2017/torchcv | 6414f5acb41c2f35f8e79e477a57eaba65591c66 | [
"Apache-2.0"
] | 1 | 2021-12-24T09:16:37.000Z | 2021-12-24T09:16:37.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com)
# Main Scripts for computer vision.
import os
import json
import time
import random
import argparse
import torch
import torch.backends.cudnn as cudnn
from runner.runner_selector import RunnerSelector
from runner.tools.controller i... | 52.544974 | 104 | 0.616252 |
6f29c9bb60767a2cf6ee410308069b32e8938718 | 667 | py | Python | manage.py | realsaeedhassani/model2excel | 46d6a772b3c607d14a71dab6047432e929e2bcc8 | [
"MIT"
] | null | null | null | manage.py | realsaeedhassani/model2excel | 46d6a772b3c607d14a71dab6047432e929e2bcc8 | [
"MIT"
] | null | null | null | manage.py | realsaeedhassani/model2excel | 46d6a772b3c607d14a71dab6047432e929e2bcc8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'model2excel.settings')
try:
from django.core.management import execute_from_command_line
except ... | 29 | 75 | 0.68066 |
58acaa820dba3d2588f54a5c10535d333b399dab | 25,513 | py | Python | uproot_skyhook/layout.py | diana-hep/uproot-skyhook | a5681a34567d72465b9bef7ea58992f8cda8826b | [
"BSD-3-Clause"
] | null | null | null | uproot_skyhook/layout.py | diana-hep/uproot-skyhook | a5681a34567d72465b9bef7ea58992f8cda8826b | [
"BSD-3-Clause"
] | null | null | null | uproot_skyhook/layout.py | diana-hep/uproot-skyhook | a5681a34567d72465b9bef7ea58992f8cda8826b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019, IRIS-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the fo... | 49.830078 | 339 | 0.705915 |
a68ece50665fcc8ca164f0669a0894f26f9705c8 | 3,088 | py | Python | test/mobile/model_test/builtin_ops.py | tenpercent/pytorch | 7f996b855c5070ab4a6bea0f451c8a22c0ce2394 | [
"Intel"
] | 1 | 2022-03-29T00:44:31.000Z | 2022-03-29T00:44:31.000Z | test/mobile/model_test/builtin_ops.py | tenpercent/pytorch | 7f996b855c5070ab4a6bea0f451c8a22c0ce2394 | [
"Intel"
] | null | null | null | test/mobile/model_test/builtin_ops.py | tenpercent/pytorch | 7f996b855c5070ab4a6bea0f451c8a22c0ce2394 | [
"Intel"
] | 1 | 2022-03-28T21:49:41.000Z | 2022-03-28T21:49:41.000Z | import torch
# https://pytorch.org/docs/stable/jit_builtin_functions.html#builtin-functions
class TSBuiltinOpsModule(torch.nn.Module):
def __init__(self):
super(TSBuiltinOpsModule, self).__init__()
def forward(self):
x = torch.tensor(1)
y = torch.tensor(0.5)
b = float(1)
... | 24.903226 | 78 | 0.349093 |
49274be7b6ffffbbf2a48193df5b7f7d387529c7 | 1,129 | py | Python | solutions/2101.py | pacokwon/leetcode | 37c943d371c106d1e6f24e065700e5edd1c3f9f9 | [
"MIT"
] | 2 | 2022-01-18T08:57:13.000Z | 2022-01-18T15:49:06.000Z | solutions/2101.py | pacokwon/leetcode | 37c943d371c106d1e6f24e065700e5edd1c3f9f9 | [
"MIT"
] | null | null | null | solutions/2101.py | pacokwon/leetcode | 37c943d371c106d1e6f24e065700e5edd1c3f9f9 | [
"MIT"
] | null | null | null | # Detonate the Maximum Bombs
from typing import List
class Solution:
def maximumDetonation(self, bombs: List[List[int]]) -> int:
length = len(bombs)
reachable = [[False] * length for _ in range(length)]
for i in range(length):
for j in range(i + 1, length):
[x1... | 29.710526 | 63 | 0.477414 |
f606ce254ab6a041aa15ff3214aba84bf1d917a3 | 54,724 | py | Python | msgraph/cli/command_modules/usersfunctions/azext_usersfunctions/vendored_sdks/usersfunctions/models/__init__.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | msgraph/cli/command_modules/usersfunctions/azext_usersfunctions/vendored_sdks/usersfunctions/models/__init__.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph/cli/command_modules/usersfunctions/azext_usersfunctions/vendored_sdks/usersfunctions/models/__init__.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 53.756385 | 96 | 0.80853 |
ecef7d2e2182437a9011b3c7ec99dde2046b5b5d | 1,815 | py | Python | build-system/conan/recipes/cppfs/conanfile.py | curoky/my-own-x | 825273af2d73dff76562422ca87a077635ee870b | [
"Apache-2.0"
] | null | null | null | build-system/conan/recipes/cppfs/conanfile.py | curoky/my-own-x | 825273af2d73dff76562422ca87a077635ee870b | [
"Apache-2.0"
] | null | null | null | build-system/conan/recipes/cppfs/conanfile.py | curoky/my-own-x | 825273af2d73dff76562422ca87a077635ee870b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2022 curoky(cccuroky@gmail.com).
#
# This file is part of my-own-x.
# See https://github.com/curoky/my-own-x for further info.
#
# 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 Licens... | 29.754098 | 74 | 0.663912 |
270620317bd61029c7d8c21f62175c80abb0b42c | 295 | py | Python | data/train_valid_split.py | MykhaiIo/heart-attention | 44d4760bd3f571e5080c25156d53ac5cc57921af | [
"MIT"
] | null | null | null | data/train_valid_split.py | MykhaiIo/heart-attention | 44d4760bd3f571e5080c25156d53ac5cc57921af | [
"MIT"
] | null | null | null | data/train_valid_split.py | MykhaiIo/heart-attention | 44d4760bd3f571e5080c25156d53ac5cc57921af | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.model_selection import train_test_split
data = pd.read_csv('data\healthcare-dataset-stroke-data.csv')
train, valid = train_test_split(data, train_size=.8, stratify=data.iloc[:,-1])
train.to_csv('data\\train.csv')
valid.to_csv('data\\val.csv')
del train, valid | 29.5 | 78 | 0.769492 |
d6ffb33a30731780c4131550a84ba1a03bcc3165 | 6,353 | py | Python | dolosse/analysis/binary_data_reader/binary_data_reader.py | Tobias2023/dolosse | 7e56a84d7da2a3f0d6d409f1cb7ea5accb12cac5 | [
"Apache-2.0"
] | null | null | null | dolosse/analysis/binary_data_reader/binary_data_reader.py | Tobias2023/dolosse | 7e56a84d7da2a3f0d6d409f1cb7ea5accb12cac5 | [
"Apache-2.0"
] | null | null | null | dolosse/analysis/binary_data_reader/binary_data_reader.py | Tobias2023/dolosse | 7e56a84d7da2a3f0d6d409f1cb7ea5accb12cac5 | [
"Apache-2.0"
] | null | null | null | """
file: binary_data_reader.py
brief: Reads data from a PLD file.
author: S. V. Paulauskas
date: January 22, 2019
"""
from io import BytesIO
from json import dumps
from multiprocessing import Pool
from os.path import isdir, splitext, basename
from os import mkdir, stat
from struct import unpack
import time
from panda... | 37.591716 | 100 | 0.560523 |
5b9da9ccb0f0900921ca224acc610c1d1a32ff6b | 4,235 | py | Python | tic_tac_toe_5_4/network.py | TobiasBrx/AlphaToe | a5447066fd6f3df70e4f463456c2463937565b15 | [
"MIT"
] | null | null | null | tic_tac_toe_5_4/network.py | TobiasBrx/AlphaToe | a5447066fd6f3df70e4f463456c2463937565b15 | [
"MIT"
] | null | null | null | tic_tac_toe_5_4/network.py | TobiasBrx/AlphaToe | a5447066fd6f3df70e4f463456c2463937565b15 | [
"MIT"
] | null | null | null | import tensorflow as tf
from common.benchmark import benchmark
from games.tic_tac_toe_x import TicTacToeXGameSpec
tic_tac_toe_5_4_game_spec = TicTacToeXGameSpec(5, 4)
def create_convolutional_network():
input_layer = tf.input_layer = tf.placeholder("float",
(Non... | 50.416667 | 124 | 0.701063 |
18b952b5daf9e2abc67d179c4bebad2fb9116124 | 3,108 | py | Python | experiments/MICCAI-release-version/driver_256.py | voanna/slices-to-3d-brain-vae | 0036e5d68f86a52c266f7406c09607eac35d7565 | [
"MIT"
] | 11 | 2020-07-21T09:52:48.000Z | 2021-11-29T04:50:25.000Z | experiments/MICCAI-release-version/driver_256.py | voanna/slices-to-3d-brain-vae | 0036e5d68f86a52c266f7406c09607eac35d7565 | [
"MIT"
] | null | null | null | experiments/MICCAI-release-version/driver_256.py | voanna/slices-to-3d-brain-vae | 0036e5d68f86a52c266f7406c09607eac35d7565 | [
"MIT"
] | 5 | 2020-12-28T03:22:38.000Z | 2022-02-07T10:33:38.000Z | __author__ = 'voanna'
import os
import stat
learning_rates = [1e-3]
latent_dimensions = [512]
reconstruction_data_loss_weights = [1.0]
kl_latent_loss_weights = [0.2]
standardize_latent_curve_fit_losses = [True]
batch_sizes= [256]
seen_dict = {}
EXPERIMENT = 'MICCAI-release-version'
gen_dir = os.path.join('experim... | 33.06383 | 117 | 0.521557 |
27bea27c41d2535014bb3648f4c58eafcffcd97f | 2,596 | py | Python | test/torch/model/test_torch_predictor.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 2,648 | 2019-06-03T17:18:27.000Z | 2022-03-31T08:29:22.000Z | test/torch/model/test_torch_predictor.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 1,220 | 2019-06-04T09:00:14.000Z | 2022-03-31T10:45:43.000Z | test/torch/model/test_torch_predictor.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 595 | 2019-06-04T01:04:31.000Z | 2022-03-30T10:40:26.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 31.658537 | 75 | 0.714946 |
2d282effa1cd212f01abbbbec4b4a75cb6d87a84 | 18,150 | py | Python | darr/readcodearray.py | gjlbeckers-uu/DiskArray | 4433e6b1ddfbf1e568d15049521a6f65e79f6a0a | [
"BSD-3-Clause"
] | 1 | 2018-10-22T21:02:41.000Z | 2018-10-22T21:02:41.000Z | darr/readcodearray.py | gjlbeckers-uu/DiskArray | 4433e6b1ddfbf1e568d15049521a6f65e79f6a0a | [
"BSD-3-Clause"
] | null | null | null | darr/readcodearray.py | gjlbeckers-uu/DiskArray | 4433e6b1ddfbf1e568d15049521a6f65e79f6a0a | [
"BSD-3-Clause"
] | null | null | null | """This module contains functions to produce code in various programming
languages to read the numeric information of a Darr array.
"""
# Reading binary files:
# ---------------------
# mathematica: https://reference.wolfram.com/language/ref/BinaryRead.html
# Octave: https://octave.org/doc/v4.2.0/Binary-I_002fO.html
#... | 39.370933 | 105 | 0.535317 |
b14ba955983680dcff4ea527654e5eb9f03b560c | 1,285 | py | Python | gradient/api_sdk/repositories/storage_providers.py | luojiguicai/gradient-cli | 16fad0c2dfc36cd0e0455e3ca1ce4cfb243cec8a | [
"ISC"
] | 52 | 2019-06-10T04:20:00.000Z | 2021-12-06T01:13:26.000Z | gradient/api_sdk/repositories/storage_providers.py | luojiguicai/gradient-cli | 16fad0c2dfc36cd0e0455e3ca1ce4cfb243cec8a | [
"ISC"
] | 125 | 2019-06-05T16:34:19.000Z | 2022-03-30T18:46:06.000Z | gradient/api_sdk/repositories/storage_providers.py | luojiguicai/gradient-cli | 16fad0c2dfc36cd0e0455e3ca1ce4cfb243cec8a | [
"ISC"
] | 11 | 2019-07-16T06:48:55.000Z | 2021-12-15T12:41:51.000Z | from .common import AlterResource, CreateResource, DeleteResource, GetResource, ListResources
from .. import config, serializers
class StorageProviderMixin(object):
SERIALIZER_CLS = serializers.StorageProviderSchema
@staticmethod
def _get_api_url(**kwargs):
return config.config.CONFIG_HOST
@... | 26.22449 | 93 | 0.670817 |
0097813aafb180cb42d5d7fc4c17c322aa8c8565 | 367 | py | Python | data/indicator/GE3/process.py | simonzabrocki/Anticipe | ad0e0aa39217a7e38ed10e1b3eb5be8e47d0e965 | [
"MIT"
] | null | null | null | data/indicator/GE3/process.py | simonzabrocki/Anticipe | ad0e0aa39217a7e38ed10e1b3eb5be8e47d0e965 | [
"MIT"
] | 1 | 2022-01-27T07:44:44.000Z | 2022-01-27T07:44:44.000Z | data/indicator/GE3/process.py | simonzabrocki/Anticipe | ad0e0aa39217a7e38ed10e1b3eb5be8e47d0e965 | [
"MIT"
] | null | null | null | computation_config = {
'Variable': 'GE3',
'files': ['GE3.1_CW.csv', 'GE3.0_WB.csv'],
'From': ['CW API', 'WB API'],
'function': lambda df, var: df[var[0]] / df[var[1]],
'sub_variables': ['CH4 N2O Agriculture and Land-Use Change and Forestry Tons',
'Population, total'],
'Desc... | 36.7 | 82 | 0.555858 |
b24a5951c29501249b0ef7bca9d31ecdaa72127d | 485 | py | Python | backend/models.py | Dev-Elie/Flask-React-CRUD | 53496b116834db014cb84b5efee94f19875ee5f2 | [
"MIT"
] | 1 | 2021-12-09T12:22:42.000Z | 2021-12-09T12:22:42.000Z | backend/models.py | Dev-Elie/Flask-React-CRUD | 53496b116834db014cb84b5efee94f19875ee5f2 | [
"MIT"
] | null | null | null | backend/models.py | Dev-Elie/Flask-React-CRUD | 53496b116834db014cb84b5efee94f19875ee5f2 | [
"MIT"
] | null | null | null | from app import db,ma
from datetime import datetime
class Articles(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(100),nullable=False)
body = db.Column(db.Text, nullable=False)
date = db.Column(db.DateTime(), default=datetime.utcnow)
def __repr__(self):
... | 23.095238 | 60 | 0.653608 |
dbcf6b1028f78e2aa762fdab4ed3d25ae506b70d | 12,999 | py | Python | vb_simulation_pkgs/example_pkgs/pkg_moveit_examples/scripts/node_eg6_save_trajectory.py | 1arshan/Eyantra_Virgi-bot | 30ebe99fec6a0d4767fe94468b21bc00091bc527 | [
"MIT"
] | 1 | 2021-09-09T04:41:28.000Z | 2021-09-09T04:41:28.000Z | vb_simulation_pkgs/example_pkgs/pkg_moveit_examples/scripts/node_eg6_save_trajectory.py | 1arshan/Eyantra_Virgi-bot | 30ebe99fec6a0d4767fe94468b21bc00091bc527 | [
"MIT"
] | null | null | null | vb_simulation_pkgs/example_pkgs/pkg_moveit_examples/scripts/node_eg6_save_trajectory.py | 1arshan/Eyantra_Virgi-bot | 30ebe99fec6a0d4767fe94468b21bc00091bc527 | [
"MIT"
] | null | null | null | #! /usr/bin/env python2.7
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
import actionlib
import rospkg
from pkg_vb_sim.srv import vacuumGripper
import yaml
import os
import math
import time
import sys
import copy
from std_srvs.srv import Empty
class Ur5Moveit:
# Constructo... | 35.516393 | 179 | 0.61097 |
8192fccf83459849ee04c6958d903747b124bf50 | 644 | py | Python | data_structure/binaryTree/postorder/postoder_traversal_items.py | russellgao/algorithm | ad5e724d20a8492b8eba03fc0f24e4ff5964b3ea | [
"Apache-2.0"
] | 3 | 2020-05-18T00:47:18.000Z | 2020-06-08T01:57:13.000Z | data_structure/binaryTree/postorder/postoder_traversal_items.py | russellgao/algorithm | ad5e724d20a8492b8eba03fc0f24e4ff5964b3ea | [
"Apache-2.0"
] | null | null | null | data_structure/binaryTree/postorder/postoder_traversal_items.py | russellgao/algorithm | ad5e724d20a8492b8eba03fc0f24e4ff5964b3ea | [
"Apache-2.0"
] | null | null | null |
# 二叉树的中序遍历
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
# 迭代
def postorderTraversal(root: TreeNode) ->[int]:
result = []
queue = [root]
while queue:
root = queue.pop()
if root:
result.append(root.val)
... | 20.125 | 47 | 0.548137 |
52c4c823aa8df19fae688770c87b9c8f4fb1bdd6 | 483 | py | Python | tests/workflows/test_fake_afos_dump.py | akrherz/pyWWA | 011526f459db00d117e59f570535ac42ca267d83 | [
"MIT"
] | 9 | 2015-03-27T22:43:07.000Z | 2020-04-10T04:19:47.000Z | tests/workflows/test_fake_afos_dump.py | akrherz/pyWWA | 011526f459db00d117e59f570535ac42ca267d83 | [
"MIT"
] | 76 | 2015-03-05T18:20:07.000Z | 2022-03-24T02:04:25.000Z | tests/workflows/test_fake_afos_dump.py | akrherz/pyWWA | 011526f459db00d117e59f570535ac42ca267d83 | [
"MIT"
] | 3 | 2020-11-05T17:38:03.000Z | 2022-03-04T17:39:40.000Z | """Test fake_afos_dump."""
# 3rd Party
import pytest
from pyiem.util import utc
# Local
import pywwa
from pywwa.workflows import fake_afos_dump
from pywwa.testing import get_example_file
@pytest.mark.parametrize("database", ["afos"])
def test_processor(cursor):
"""Test basic parsing."""
data = get_example_fi... | 25.421053 | 57 | 0.714286 |
69ffd9ce155554927f7870892d6a9a1e4b122614 | 2,342 | py | Python | 2015-04/opcode0x90/day4_bad_parallel.py | opcode0x90/adventofcode | 50b037dbc90e74b2aa2c1ebe04e0636ffa859e34 | [
"BSD-3-Clause"
] | 3 | 2018-12-01T07:11:32.000Z | 2021-11-26T16:23:52.000Z | 2015-04/opcode0x90/day4_bad_parallel.py | opcode0x90/adventofcode | 50b037dbc90e74b2aa2c1ebe04e0636ffa859e34 | [
"BSD-3-Clause"
] | 3 | 2017-12-15T10:24:04.000Z | 2018-12-02T18:37:55.000Z | 2015-04/opcode0x90/day4_bad_parallel.py | opcode0x90/adventofcode | 50b037dbc90e74b2aa2c1ebe04e0636ffa859e34 | [
"BSD-3-Clause"
] | 3 | 2017-12-15T08:33:31.000Z | 2018-12-02T14:38:29.000Z | #!/usr/bin/env python3
import logging
import time
import sys
import functools
import multiprocessing
def adventcoin(key, i=0, difficulty=5):
import hashlib
digest = hashlib.md5(("%s%d" % (key, i)).encode('utf8')).hexdigest()
return (digest.startswith('0' * difficulty), i, digest)
#######################... | 31.226667 | 80 | 0.558924 |
65af45e374d67b54d4b9e7cc38ea5de0a371e7fc | 167 | py | Python | celery_once/__init__.py | alkymi-io/celery-once | adcb91d393569703b560c863305746b2e0e12d28 | [
"BSD-2-Clause"
] | null | null | null | celery_once/__init__.py | alkymi-io/celery-once | adcb91d393569703b560c863305746b2e0e12d28 | [
"BSD-2-Clause"
] | null | null | null | celery_once/__init__.py | alkymi-io/celery-once | adcb91d393569703b560c863305746b2e0e12d28 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'Cameron Maske'
__email__ = 'cameronmaske@gmail.com'
__version__ = '3.0.1-alkymi0'
from .tasks import QueueOnce, AlreadyQueued
| 18.555556 | 43 | 0.712575 |
a9d31db1dfb9ecc359a96564bfcad508d0bea897 | 2,173 | py | Python | tests/libp2p/p2pclient/test_datastructures.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | tests/libp2p/p2pclient/test_datastructures.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | tests/libp2p/p2pclient/test_datastructures.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | import pytest
from multiaddr import (
Multiaddr,
)
from libp2p.p2pclient.p2pclient import (
PeerID,
PeerInfo,
StreamInfo,
)
import libp2p.p2pclient.pb.p2pd_pb2 as p2pd_pb
@pytest.fixture('module')
def peer_id_string():
return "QmS5QmciTXXnCUCyxud5eWFenUMAmvAWSDa1c7dvdXRMZ7"
@pytest.fixture('m... | 26.180723 | 96 | 0.693511 |
52c25df0bfddbd04c89c739b3b9c0dcd3369add0 | 13,958 | py | Python | sdk/identity/azure-identity/tests/test_managed_identity_async.py | kahinton/azure-sdk-for-python | 7f67fd752ec77ef0de9507e9293a377c17c3162f | [
"MIT"
] | 1 | 2021-09-07T18:35:07.000Z | 2021-09-07T18:35:07.000Z | sdk/identity/azure-identity/tests/test_managed_identity_async.py | kahinton/azure-sdk-for-python | 7f67fd752ec77ef0de9507e9293a377c17c3162f | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/tests/test_managed_identity_async.py | kahinton/azure-sdk-for-python | 7f67fd752ec77ef0de9507e9293a377c17c3162f | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import time
from unittest import mock
from azure.core.credentials import AccessToken
from azure.identity.aio import ManagedIdentityCredential
from azure.identity._const... | 35.426396 | 111 | 0.588838 |
90d2e62f1e11be1fb5fd7ab9b6755528d5f637a7 | 2,293 | py | Python | trial.py | akhilkh2000/cercatrova | a07a9e49734d845dde3fcfea0afea2ee2ca2e389 | [
"MIT"
] | 1 | 2020-01-26T07:00:08.000Z | 2020-01-26T07:00:08.000Z | trial.py | akhilkh2000/cercatrova | a07a9e49734d845dde3fcfea0afea2ee2ca2e389 | [
"MIT"
] | null | null | null | trial.py | akhilkh2000/cercatrova | a07a9e49734d845dde3fcfea0afea2ee2ca2e389 | [
"MIT"
] | 2 | 2020-01-26T07:00:14.000Z | 2020-01-26T07:33:16.000Z | from googleplaces import GooglePlaces, types, lang
import requests
import json
# This is the way to make api requests
# using python requests library
# send_url = 'http://freegeoip.net/json'
# r = requests.get(send_url)
# j = json.loads(r.text)
# print(j)
# lat = j['latitude']
# lon = j['longitude']
# Gen... | 28.6625 | 83 | 0.69734 |
e60a31fb1a04085015d3c01b0e1297a9117b89ff | 2,221 | py | Python | Imagenes/vdWColumnHT_2D/CasoB/getData.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/vdWColumnHT_2D/CasoB/getData.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/vdWColumnHT_2D/CasoB/getData.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | import vdWColumn as vdw
import vdWColumn.postLBRun as post
import numpy as np
import argparse
import os
from paraview.simple import *
# Extraccion de arreglos en linea desde el centro (xmax/2) hasta xmax
def get_array_from_case( case_file, array_name = 'rho', xmax = 300.0 ):
# Carga del caso con arrays... | 19.313043 | 118 | 0.595678 |
45376d87171485b7d7587df777d5271a2647a532 | 5,463 | py | Python | EmotionDetection/EmotionDetector.py | shekkizh/TensorflowProjects | 5bd5563a5310df0b87725d989e84d49da0ea8c00 | [
"MIT"
] | 204 | 2016-04-05T03:29:43.000Z | 2022-03-07T11:44:54.000Z | EmotionDetection/EmotionDetector.py | aseftajwargithub/TensorflowProjects | 5bd5563a5310df0b87725d989e84d49da0ea8c00 | [
"MIT"
] | 4 | 2016-08-24T03:52:14.000Z | 2018-03-22T09:44:20.000Z | EmotionDetection/EmotionDetector.py | aseftajwargithub/TensorflowProjects | 5bd5563a5310df0b87725d989e84d49da0ea8c00 | [
"MIT"
] | 74 | 2016-06-30T14:18:47.000Z | 2021-05-08T20:14:57.000Z | import tensorflow as tf
import numpy as np
import os, sys, inspect
from datetime import datetime
lib_path = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
if lib_path not in sys.path:
sys.path.insert(0, lib_path)
import TensorflowUtils as util... | 40.169118 | 120 | 0.680945 |
d70fac34fd9cde09d1106103f806f0c4e3e698b8 | 4,378 | py | Python | contrib/seeds/generate-seeds.py | icocoinproject/icocoin | 0fbc434a848ef2d40c9a12438d2f148d947ed8f6 | [
"MIT"
] | 3 | 2018-03-31T00:15:04.000Z | 2018-04-30T03:56:16.000Z | contrib/seeds/generate-seeds.py | icocoinproject/icocoin | 0fbc434a848ef2d40c9a12438d2f148d947ed8f6 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | icocoinproject/icocoin | 0fbc434a848ef2d40c9a12438d2f148d947ed8f6 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... | 31.496403 | 98 | 0.582458 |
69069f63a8079b3d67a6c55d9106aa16cf5699cb | 1,414 | py | Python | ProjectApplication/project_core/migrations/0117_add_call_finance_year_and_project_key.py | code-review-doctor/project-application | d85b40b69572efbcda24ce9c40803f76d8ffd192 | [
"MIT"
] | 5 | 2020-07-29T10:00:11.000Z | 2022-02-19T11:00:34.000Z | ProjectApplication/project_core/migrations/0117_add_call_finance_year_and_project_key.py | code-review-doctor/project-application | d85b40b69572efbcda24ce9c40803f76d8ffd192 | [
"MIT"
] | 471 | 2019-09-20T14:37:28.000Z | 2022-03-25T14:16:34.000Z | ProjectApplication/project_core/migrations/0117_add_call_finance_year_and_project_key.py | code-review-doctor/project-application | d85b40b69572efbcda24ce9c40803f76d8ffd192 | [
"MIT"
] | 5 | 2020-03-15T12:42:47.000Z | 2022-02-15T18:06:52.000Z | # Generated by Django 3.0.3 on 2020-04-02 09:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0116_makes_funding_instrument_short_name_not_nullable'),
]
operations = [
migrations.AddField(
model_name='call'... | 37.210526 | 152 | 0.626591 |
d0fe7bf9fc2d2b9cfc0aef94c46f91c850f5815a | 6,819 | py | Python | pandas/tests/window/moments/test_moments_consistency_expanding.py | thesamesam/pandas | 3aeba78b58257b2fee9dad68bdeaeccb067d6658 | [
"BSD-3-Clause"
] | 1 | 2021-12-03T02:30:23.000Z | 2021-12-03T02:30:23.000Z | pandas/tests/window/moments/test_moments_consistency_expanding.py | thesamesam/pandas | 3aeba78b58257b2fee9dad68bdeaeccb067d6658 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/window/moments/test_moments_consistency_expanding.py | thesamesam/pandas | 3aeba78b58257b2fee9dad68bdeaeccb067d6658 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
from pandas import Series
import pandas._testing as tm
@pytest.mark.parametrize("min_periods", [0, 1, 2, 3, 4])
@pytest.mark.parametrize("f", [lambda v: Series(v).sum(), np.nansum])
def test_expanding_apply_consistency_sum_nans(consistency_data, min_periods, f):
x, is_constant, n... | 38.744318 | 84 | 0.673413 |
d74db8a59a6dc811196586bf1800f119ee0782b0 | 2,562 | py | Python | test/adapters/test_ipprovider_opendns.py | fbouliane/ddns-updater-aws | 0ca435e5045d15554d26599b840556c98840dea3 | [
"MIT"
] | 3 | 2016-03-28T23:11:03.000Z | 2021-02-17T05:49:36.000Z | test/adapters/test_ipprovider_opendns.py | fbouliane/ddns-updater-aws | 0ca435e5045d15554d26599b840556c98840dea3 | [
"MIT"
] | 2 | 2016-04-05T15:49:22.000Z | 2016-08-22T16:06:48.000Z | test/adapters/test_ipprovider_opendns.py | fbouliane/ddns-updater-aws | 0ca435e5045d15554d26599b840556c98840dea3 | [
"MIT"
] | 1 | 2021-02-17T06:02:35.000Z | 2021-02-17T06:02:35.000Z | from unittest import TestCase
import ipaddress
from ddns_updater_aws.adapters import IpProviderFailure
from ddns_updater_aws.adapters import ipprovider_opendns
from flexmock import flexmock
from mock import patch, MagicMock, Mock
class TestGetIp(TestCase):
def test_getIp(self):
actual_ip = ipprovider_ope... | 42.7 | 98 | 0.708041 |
1c051e0c55fbe3f232891ef1ecc26d26fcbe892f | 1,152 | py | Python | third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 1 | 2016-01-29T00:54:49.000Z | 2016-01-29T00:54:49.000Z | third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module wraps the Android Asset Packaging Tool."""
import os
from devil.utils import cmd_helper
from pylib import constants
_AAPT_PATH = os.path.jo... | 27.428571 | 75 | 0.688368 |
3c76678243722407fe606ddf2cf5515537babe9e | 7,895 | py | Python | drf_turbo/meta.py | banagale/drf-turbo | e9a878117936d162b0646b20c39d11fef1088ce0 | [
"MIT"
] | null | null | null | drf_turbo/meta.py | banagale/drf-turbo | e9a878117936d162b0646b20c39d11fef1088ce0 | [
"MIT"
] | null | null | null | drf_turbo/meta.py | banagale/drf-turbo | e9a878117936d162b0646b20c39d11fef1088ce0 | [
"MIT"
] | null | null | null | from django.db import models
from drf_turbo.fields import (
Field,IntField,BoolField,StrField,DateField,TimeField,DateTimeField,EmailField,FileField,FloatField,URLField,IPField,UUIDField,RelatedField,ManyRelatedField,ChoiceField,DecimalField,ArrayField,JSONField
)
try:
from django.contrib.postgres import field... | 39.873737 | 206 | 0.588474 |
b29623668cef02f8c5fc81e81d333753c2d7010e | 1,304 | py | Python | scripts/utils-convertColormapImagesToJson.py | dhaase-de/dh-python-dh | 40b04407e5f67ec261f559263718ec2b2588dabb | [
"MIT"
] | null | null | null | scripts/utils-convertColormapImagesToJson.py | dhaase-de/dh-python-dh | 40b04407e5f67ec261f559263718ec2b2588dabb | [
"MIT"
] | null | null | null | scripts/utils-convertColormapImagesToJson.py | dhaase-de/dh-python-dh | 40b04407e5f67ec261f559263718ec2b2588dabb | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import argparse
import cv2
import json
import numpy as np
import re
def imageToColormap(filename):
print("Loading image '{filename}'...".format(filename=filename))
I = cv2.imread(filename, cv2.IMREAD_COLOR)
# check image dimensions
if (len(I.shape) != 3) or (I.shape[1:] != (256, 3... | 38.352941 | 160 | 0.679448 |
937c331f8191c367c9c5cbdebad45ab361713210 | 720 | py | Python | .venv/Scripts/django-admin.py | Samio-Santos/Projeto_blog_Django | 3664063276491c4cde4f46a66339accb4b9dfff3 | [
"MIT"
] | null | null | null | .venv/Scripts/django-admin.py | Samio-Santos/Projeto_blog_Django | 3664063276491c4cde4f46a66339accb4b9dfff3 | [
"MIT"
] | null | null | null | .venv/Scripts/django-admin.py | Samio-Santos/Projeto_blog_Django | 3664063276491c4cde4f46a66339accb4b9dfff3 | [
"MIT"
] | null | null | null | #!c:\users\lenovo\documents\meusprojetos\projeto_blog_django\.venv\scripts\python.exe
# When the django-admin.py deprecation ends, remove this script.
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
... | 32.727273 | 85 | 0.734722 |
5c77a8dfd74e23c119bd74c0673d188601d9425c | 3,344 | py | Python | theme_files.py | xiaoleiy/otaku-yy | 0660ab003f6ea86944d22be2a2ce73b146cd7dfa | [
"MIT"
] | 1 | 2016-05-08T18:38:46.000Z | 2016-05-08T18:38:46.000Z | theme_files.py | xiaoleiy/otaku-yy | 0660ab003f6ea86944d22be2a2ce73b146cd7dfa | [
"MIT"
] | null | null | null | theme_files.py | xiaoleiy/otaku-yy | 0660ab003f6ea86944d22be2a2ce73b146cd7dfa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os,stat
import sys
import logging
import wsgiref.handlers
from mimetypes import types_map
from datetime import datetime, timedelta
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.api import memcache
sys.path.append... | 32.466019 | 106 | 0.677632 |
a64657034c1051659a7038a0dd2049c3ef294ee8 | 460 | py | Python | save_time.py | RogerTsai917/attention-is-all-you-need-pytorch | 64197e55d275e5c819bc786a9ff19849cdf2f6b9 | [
"MIT"
] | null | null | null | save_time.py | RogerTsai917/attention-is-all-you-need-pytorch | 64197e55d275e5c819bc786a9ff19849cdf2f6b9 | [
"MIT"
] | null | null | null | save_time.py | RogerTsai917/attention-is-all-you-need-pytorch | 64197e55d275e5c819bc786a9ff19849cdf2f6b9 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
base_line_time = 18.95
compare_list = [19.82,
19.70,
18.73,
18.36,
18.00,
17.62,
17.00,
16.28,
15.24,
14.11,
13.09,
11.00,
9.49
]
print("base line time: ", base_line_time)
x = 0
for comapre_time in compare_list:
added_time = comapre_time + x
time_save ... | 16.428571 | 87 | 0.623913 |
95079476edfc709735b38a85a2a1fbd821dab9c8 | 1,015 | py | Python | pay_demo/contrib/sites/migrations/0003_set_site_domain_and_name.py | StrongRoy/pay_demo | aa2a01c3e121d1604a9c4e8c7d2463381aa1e061 | [
"MIT"
] | null | null | null | pay_demo/contrib/sites/migrations/0003_set_site_domain_and_name.py | StrongRoy/pay_demo | aa2a01c3e121d1604a9c4e8c7d2463381aa1e061 | [
"MIT"
] | null | null | null | pay_demo/contrib/sites/migrations/0003_set_site_domain_and_name.py | StrongRoy/pay_demo | aa2a01c3e121d1604a9c4e8c7d2463381aa1e061 | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | 29 | 129 | 0.687685 |
6ffcecd63f96a0072d12139e977cd7a030178d83 | 3,836 | py | Python | src/utils/plot.py | andi611/CS-Tacotron | 8a0d61899e95802b18024cdf0710ea405bc08878 | [
"MIT"
] | 20 | 2019-03-07T13:19:37.000Z | 2022-03-27T22:00:55.000Z | src/utils/plot.py | andi611/CS-Tacotron | 8a0d61899e95802b18024cdf0710ea405bc08878 | [
"MIT"
] | 5 | 2020-01-28T22:20:22.000Z | 2022-02-09T23:36:55.000Z | src/utils/plot.py | samirsahoo007/CS-Tacotron-Pytorch | fe63ef5ddcfc83345cc9c3d128b72a1c4de12682 | [
"MIT"
] | 8 | 2019-12-18T07:12:40.000Z | 2021-12-21T08:54:38.000Z | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ plot.py ]
# Synopsis [ plot utility functions ]
# Author [ Ting-Wei Liu (Andi611) ]
# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]
"""****************... | 26.638889 | 99 | 0.612617 |
915497439d0aab59e69dc28914d7e5b29dc359ed | 80 | py | Python | const.py | hechi/bt-mqtt-gateway | c6373e71116fb562ac8bf7c2d204e6504751c96f | [
"MIT"
] | null | null | null | const.py | hechi/bt-mqtt-gateway | c6373e71116fb562ac8bf7c2d204e6504751c96f | [
"MIT"
] | null | null | null | const.py | hechi/bt-mqtt-gateway | c6373e71116fb562ac8bf7c2d204e6504751c96f | [
"MIT"
] | null | null | null | DEFAULT_COMMAND_TIMEOUT = 35 # In seconds
PER_DEVICE_TIMEOUT = 6 # In seconds
| 26.666667 | 42 | 0.775 |
11e381ca53cddece65ac474fcf68c185237b9a50 | 6,475 | py | Python | venv/Lib/site-packages/matplotlib/tests/test_skew.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | venv/Lib/site-packages/matplotlib/tests/test_skew.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | venv/Lib/site-packages/matplotlib/tests/test_skew.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | """
Testing that skewed axes properly work.
"""
from contextlib import ExitStack
import itertools
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison
from matplotlib.axes import Axes
import matplotlib.transforms as transforms
import matplotlib.axis as maxis
import ... | 38.088235 | 80 | 0.63305 |
2af98259dcc6192ac53400ef4a1c31f235380332 | 2,001 | py | Python | GFF_update/gff2gtf.py | sotuamax/Tetur_eQTL | 9144da7c6bf2afab34be5cafce0a87d8dadd96f1 | [
"MIT"
] | null | null | null | GFF_update/gff2gtf.py | sotuamax/Tetur_eQTL | 9144da7c6bf2afab34be5cafce0a87d8dadd96f1 | [
"MIT"
] | null | null | null | GFF_update/gff2gtf.py | sotuamax/Tetur_eQTL | 9144da7c6bf2afab34be5cafce0a87d8dadd96f1 | [
"MIT"
] | null | null | null | import pandas as pd
import csv
gff3 = "Clark_2019/Tetranychus_urticae_v7.gff3"
gtf = "Clark_2019/Tetranychus_urticae_v7.gtf"
gff3 = pd.read_table(gff3, sep = "\t", header = None, comment = "#")
gff3 = gff3.rename(columns = {0:"tig", 1:"source", 2:"feature", 3:"start", 4:"end", 5:"score", 6:"strand", 7:"phase", 8:"at... | 41.6875 | 134 | 0.591704 |
e8b8aadf284a9f222be9cd7834ca1659b080d15c | 10,730 | py | Python | error_analysis.py | AhmedAlboabidallah/other-analysis | d659e809fc060efc1cea26392440bad9ed87536f | [
"Unlicense"
] | null | null | null | error_analysis.py | AhmedAlboabidallah/other-analysis | d659e809fc060efc1cea26392440bad9ed87536f | [
"Unlicense"
] | null | null | null | error_analysis.py | AhmedAlboabidallah/other-analysis | d659e809fc060efc1cea26392440bad9ed87536f | [
"Unlicense"
] | null | null | null | from __future__ import division
from tkinter import *
from tkinter.filedialog import *
from tkinter.messagebox import showerror
from tkinter import messagebox
from tkinter import ttk
import os
import numpy as np
import pandas as pd
from pandas import *
import gdal
from gdal import *
import cython
from cython.parallel i... | 39.160584 | 181 | 0.591333 |
269a071a159f21968e997860aa23a25139d4585a | 4,614 | py | Python | hs_core/management/commands/solr_versions.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/management/commands/solr_versions.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/management/commands/solr_versions.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | # -*- coding: utf-8 -*-
# Debug discovery code on actual resources.
from django.core.management.base import BaseCommand
from hs_core.models import BaseResource
from hs_core.hydroshare.utils import get_resource_by_shortkey
def check_displayed(resource, isreplacedby, replaces):
""" create a depiction of what is di... | 43.942857 | 95 | 0.542913 |
90a34a12259b764dd1f1390117568b80728aa2f2 | 1,466 | py | Python | test/programytest/utils/geo/test_geonames.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | null | null | null | test/programytest/utils/geo/test_geonames.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | null | null | null | test/programytest/utils/geo/test_geonames.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 4 | 2019-04-01T15:42:23.000Z | 2020-11-05T08:14:27.000Z | import unittest
import os
from programy.utils.geo.geonames import GeoNamesApi
from programy.utils.license.keys import LicenseKeys
from programytest.client import TestClient
#############################################################################
#
class GeoNamesTests(unittest.TestCase):
def test_geonames_n... | 34.093023 | 120 | 0.680082 |
0cb6dcf5c140d5b65fb852ba7c00cfd902fec957 | 22,395 | py | Python | tests/functional/branching/test_branching.py | christopher-beckham/orion | fc4aa14dd58bf50196aa6ad3a2869e3d86ca1a45 | [
"BSD-3-Clause"
] | null | null | null | tests/functional/branching/test_branching.py | christopher-beckham/orion | fc4aa14dd58bf50196aa6ad3a2869e3d86ca1a45 | [
"BSD-3-Clause"
] | null | null | null | tests/functional/branching/test_branching.py | christopher-beckham/orion | fc4aa14dd58bf50196aa6ad3a2869e3d86ca1a45 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Perform a functional test for branching."""
import os
import pytest
import orion.core.cli
from orion.core.io.evc_builder import EVCBuilder
from orion.core.worker.experiment import ExperimentView
@pytest.fixture
def init_full_x(clean_db, monkeypatch):
"""Init ori... | 45.425963 | 98 | 0.559634 |
d7c1bf37f2cfd291c95d06caabf086b1b1da48d1 | 6,367 | py | Python | src/spyd/authentication/services/maestro/protocol_factory.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | null | null | null | src/spyd/authentication/services/maestro/protocol_factory.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | null | null | null | src/spyd/authentication/services/maestro/protocol_factory.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | null | null | null | import itertools
import logging
from twisted.internet import defer, reactor
from twisted.internet.protocol import ReconnectingClientFactory
from cube2common.constants import AUTHCHALLEN
from spyd.authentication.exceptions import AuthFailedException
from spyd.authentication.services.maestro.auth_success import Maestro... | 41.888158 | 108 | 0.720276 |
21ae8039bd7963ce6edf6b042b83e332c5ec98fd | 2,345 | py | Python | engine/api/libcloud_client.py | neicnordic/cloud-watch | 0667cc365ec87852b85ca61f69765bff571dbdc9 | [
"MIT"
] | null | null | null | engine/api/libcloud_client.py | neicnordic/cloud-watch | 0667cc365ec87852b85ca61f69765bff571dbdc9 | [
"MIT"
] | null | null | null | engine/api/libcloud_client.py | neicnordic/cloud-watch | 0667cc365ec87852b85ca61f69765bff571dbdc9 | [
"MIT"
] | null | null | null | import sys
import os
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from config import CloudConfig
import libcloud.security
PY3 = sys.version_info[0] == 3
if PY3:
BinaryType = bytes
else:
BinaryType = str
class InvalidDataFormat(Exception):
"""Invalid data e... | 22.76699 | 77 | 0.646482 |
47329097d604f585774a458a61213f729bdd43d9 | 924 | bzl | Python | third_party/llvm/workspace.bzl | nieziwen/tensorflow | dcc9ac194230db094786204ece76bb9e6f8a6b6a | [
"Apache-2.0"
] | null | null | null | third_party/llvm/workspace.bzl | nieziwen/tensorflow | dcc9ac194230db094786204ece76bb9e6f8a6b6a | [
"Apache-2.0"
] | null | null | null | third_party/llvm/workspace.bzl | nieziwen/tensorflow | dcc9ac194230db094786204ece76bb9e6f8a6b6a | [
"Apache-2.0"
] | null | null | null | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "bcad20bc6591c8b503923402038c735a77373f99"
LLVM_SHA256 = "0f2927a8765184c4ff58d7749e943ccf4fa52e5224ccdc7ea2aedd0bc6d6b804"
tf_http_archive(
... | 42 | 149 | 0.676407 |
2813f2e75420c2bbb5d54eef34da4bcdb0e79877 | 5,011 | py | Python | debug_toolbar/toolbar.py | psacawa/django-debug-toolbar | 9b6aae4d96a9ed2e80bc173b198243f6119bc97b | [
"BSD-3-Clause"
] | null | null | null | debug_toolbar/toolbar.py | psacawa/django-debug-toolbar | 9b6aae4d96a9ed2e80bc173b198243f6119bc97b | [
"BSD-3-Clause"
] | null | null | null | debug_toolbar/toolbar.py | psacawa/django-debug-toolbar | 9b6aae4d96a9ed2e80bc173b198243f6119bc97b | [
"BSD-3-Clause"
] | null | null | null | """
The main DebugToolbar class that loads and renders the Toolbar.
"""
import uuid
from collections import OrderedDict
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateSyntaxError
from django.template.loader import render_to_string
from django.u... | 31.917197 | 86 | 0.628817 |
9d878534d87d8419b27661e1e59d03aa4449cef8 | 26,439 | py | Python | src/UI_design_1.py | fahim19dipu/Batch-image-processor | b8c494f97c59dac6069eb5235f6dd9c20a30f66d | [
"MIT"
] | null | null | null | src/UI_design_1.py | fahim19dipu/Batch-image-processor | b8c494f97c59dac6069eb5235f6dd9c20a30f66d | [
"MIT"
] | null | null | null | src/UI_design_1.py | fahim19dipu/Batch-image-processor | b8c494f97c59dac6069eb5235f6dd9c20a30f66d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 3 01:25:56 2019
@author: fahim
"""
import os
import convertion as conv
import resize as rsz
import shadow_remove as sr
import roations as rot
import noise_removal as nr
import sys
from tkinter import messagebox
from tkinter import filedialog
try:
import Tki... | 43.271686 | 101 | 0.653429 |
d3f874c061f2d8afdff89d846ccb6c1473fad9ac | 594 | py | Python | tests/test_format_pyjs.py | lexygon/django-bootstrap-datepicker-plus | f7dda7b76b77394a43e75616231d0f479a9b20f0 | [
"Apache-2.0"
] | null | null | null | tests/test_format_pyjs.py | lexygon/django-bootstrap-datepicker-plus | f7dda7b76b77394a43e75616231d0f479a9b20f0 | [
"Apache-2.0"
] | null | null | null | tests/test_format_pyjs.py | lexygon/django-bootstrap-datepicker-plus | f7dda7b76b77394a43e75616231d0f479a9b20f0 | [
"Apache-2.0"
] | 1 | 2020-01-17T18:49:38.000Z | 2020-01-17T18:49:38.000Z | from django.test import SimpleTestCase
from bootstrap_datepicker_plus._base import BasePickerInput
class TestDateFormatConversion(SimpleTestCase):
def test_format_py2js(self):
self.assertEqual(BasePickerInput.format_py2js(
'%Y-%m-%d'), 'YYYY-MM-DD')
self.assertEqual(BasePickerInput.f... | 31.263158 | 59 | 0.659933 |
aeb69098b45c57419c02af904c9ab0ea1e506a3b | 16,082 | py | Python | tests/testUtils.py | bgeorge0/pyradiomics | f87abcf39c5eeddce55cb5fd93ea5111c5bea82c | [
"BSD-3-Clause"
] | 1 | 2018-12-15T07:50:06.000Z | 2018-12-15T07:50:06.000Z | tests/testUtils.py | maojingyi/pyradiomics | f0e18c19163923a3c1d5aa5eb197553f52df582d | [
"BSD-3-Clause"
] | null | null | null | tests/testUtils.py | maojingyi/pyradiomics | f0e18c19163923a3c1d5aa5eb197553f52df582d | [
"BSD-3-Clause"
] | null | null | null |
import ast
import csv
import logging
import math
import os
from nose_parameterized import parameterized
import numpy
import SimpleITK as sitk
import six
from radiomics import featureextractor, getTestCase, imageoperations, testCases
# Get the logger. This is done outside the class, as it is needed by both the class... | 36.46712 | 126 | 0.692451 |
a79bd42aaeecd00e65fad5de428b8e6b37594b29 | 2,133 | py | Python | setup.py | fAndreuzzi/BisPy | a6c1c5e70dc7c85f76b5f5112fc3dae4344245bf | [
"MIT"
] | 3 | 2021-07-06T08:37:59.000Z | 2022-01-04T14:18:48.000Z | setup.py | fAndreuzzi/BisPy | a6c1c5e70dc7c85f76b5f5112fc3dae4344245bf | [
"MIT"
] | 19 | 2021-03-27T22:47:18.000Z | 2021-10-09T12:15:03.000Z | setup.py | fAndreuzzi/Bisimulation-Algorithms | a6c1c5e70dc7c85f76b5f5112fc3dae4344245bf | [
"MIT"
] | 3 | 2021-07-17T11:00:07.000Z | 2021-09-28T13:03:28.000Z | import setuptools
long_description = """
 <a href='https://coveralls.io/github/fAndreuzzi/BisPy'><img src='https://coveralls.io/repos/github/fAndreuzzi/BisPy/badge.svg' alt='Coverage Status' /></a>
[![GitHub licen... | 43.530612 | 404 | 0.724332 |
a3d5c25ab6414aed4dc68b2a0a05c9a6180b2564 | 11,677 | py | Python | applications/init/languages/zh-tw.py | xiejiafang/phone_report | ab86c66fcc1189fb2c78b7afad5d3a4a9c715e80 | [
"BSD-3-Clause"
] | 2 | 2018-04-27T08:44:38.000Z | 2021-11-24T05:58:42.000Z | applications/init/languages/zh-tw.py | xiejiafang/phone_report | ab86c66fcc1189fb2c78b7afad5d3a4a9c715e80 | [
"BSD-3-Clause"
] | null | null | null | applications/init/languages/zh-tw.py | xiejiafang/phone_report | ab86c66fcc1189fb2c78b7afad5d3a4a9c715e80 | [
"BSD-3-Clause"
] | 2 | 2018-06-28T03:14:39.000Z | 2019-05-06T16:26:24.000Z | # -*- coding: utf-8 -*-
{
'!langcode!': 'zh-cn',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%s %%{row} deleted': '已刪除 %s 筆',
'%s %%{row} updated': '已更新 %s ... | 40.545139 | 253 | 0.645457 |
dbbe7b86bebd6bb3ef47203c33d5dcccae9553d2 | 904 | py | Python | mlflow/store/db_migrations/versions/df50e92ffc5e_add_experiment_tags_table.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 10,351 | 2018-07-31T02:52:49.000Z | 2022-03-31T23:33:13.000Z | mlflow/store/db_migrations/versions/df50e92ffc5e_add_experiment_tags_table.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 3,733 | 2018-07-31T01:38:51.000Z | 2022-03-31T23:56:25.000Z | mlflow/store/db_migrations/versions/df50e92ffc5e_add_experiment_tags_table.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 2,596 | 2018-07-31T06:38:39.000Z | 2022-03-31T23:56:32.000Z | """Add Experiment Tags Table
Revision ID: df50e92ffc5e
Revises: 181f10493468
Create Date: 2019-07-15 17:46:42.704214
"""
from alembic import op
import sqlalchemy as sa
from mlflow.store.tracking.dbmodels.models import SqlExperimentTag
# revision identifiers, used by Alembic.
revision = "df50e92ffc5e"
down_revision =... | 24.432432 | 82 | 0.672566 |
91e08de809c2fc3685cda208d263de4701da6ffb | 584 | py | Python | tests/export_delegates/mongodb/__init__.py | ericmharris/gc3-query | 0bf5226130aafbb1974aeb96d93ee1996833e87d | [
"MIT"
] | null | null | null | tests/export_delegates/mongodb/__init__.py | ericmharris/gc3-query | 0bf5226130aafbb1974aeb96d93ee1996833e87d | [
"MIT"
] | null | null | null | tests/export_delegates/mongodb/__init__.py | ericmharris/gc3-query | 0bf5226130aafbb1974aeb96d93ee1996833e87d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
gc3-query.__init__.py [8/23/2018 5:38 PM]
~~~~~~~~~~~~~~~~
<DESCR SHORT>
<DESCR>
"""
################################################################################
## Standard Library Imports
import sys, os
###########################################################################... | 24.333333 | 80 | 0.390411 |
3f877dd13cdb8821a46f26502c26b34ae2a60838 | 16,725 | py | Python | probabilistic/multitask_args.py | chrhenning/posterior_replay_cl | f2d8cbe1256216a4718574061de45cf750344097 | [
"Apache-2.0"
] | 9 | 2021-03-03T08:47:55.000Z | 2021-11-25T13:54:53.000Z | probabilistic/multitask_args.py | chrhenning/posterior_replay_cl | f2d8cbe1256216a4718574061de45cf750344097 | [
"Apache-2.0"
] | null | null | null | probabilistic/multitask_args.py | chrhenning/posterior_replay_cl | f2d8cbe1256216a4718574061de45cf750344097 | [
"Apache-2.0"
] | 1 | 2021-05-09T10:50:47.000Z | 2021-05-09T10:50:47.000Z | #!/usr/bin/env python3
# Copyright 2021 Christian Henning
#
# 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 l... | 49.62908 | 81 | 0.60562 |
36286fd900c1feba65c0eacec703933d77816fbe | 16,163 | py | Python | gs_api_client/swagger/models/deleted_networks_get_response.py | gridscale/gridscale_api_client_python | 755b8e8a017784a4f5c6b3a577338ff988c41a9a | [
"MIT"
] | 7 | 2019-07-12T13:59:45.000Z | 2021-03-16T08:46:20.000Z | gs_api_client/swagger/models/deleted_networks_get_response.py | gridscale/gridscale_api_client_python | 755b8e8a017784a4f5c6b3a577338ff988c41a9a | [
"MIT"
] | 13 | 2020-01-23T07:50:29.000Z | 2022-03-21T14:32:40.000Z | gs_api_client/swagger/models/deleted_networks_get_response.py | gridscale/gridscale_api_client_python | 755b8e8a017784a4f5c6b3a577338ff988c41a9a | [
"MIT"
] | null | null | null | # coding: utf-8
"""
API Specification
# Introduction Welcome to gridscales API documentation. A REST API is a programming interface that allows you to access and send data directly to our systems using HTTPS requests, without the need to use a web GUI. All the functionality you are already familiar with in y... | 136.974576 | 12,787 | 0.713667 |
66022cfaa18d405185f05388d06c4205877c0dae | 602 | py | Python | peekingduck/pipeline/nodes/model/mtcnnv1/mtcnn_files/__init__.py | chngzyk/PeekingDuck | 299dbbda9104c40822ff1076e98b2d45f9974302 | [
"Apache-2.0"
] | 79 | 2021-06-04T04:11:33.000Z | 2022-03-31T17:46:38.000Z | peekingduck/pipeline/nodes/model/mtcnnv1/mtcnn_files/__init__.py | JeromeWYCB/PeekingDuck | 4be8dfe100cea965c8d0bcad4691aab266d68ebf | [
"Apache-2.0"
] | 248 | 2021-06-04T07:19:52.000Z | 2022-03-30T08:03:35.000Z | peekingduck/pipeline/nodes/model/mtcnnv1/mtcnn_files/__init__.py | JeromeWYCB/PeekingDuck | 4be8dfe100cea965c8d0bcad4691aab266d68ebf | [
"Apache-2.0"
] | 25 | 2021-06-22T03:48:57.000Z | 2022-03-16T04:33:52.000Z | # Copyright 2021 AI Singapore
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 33.444444 | 74 | 0.755814 |
62ac12986ca673bec84e3e6e219e1f24fce5b926 | 1,938 | py | Python | src/executor/load_executor.py | jarulraj/eva | 58919d5c523820dcc9e2549d979f578803cff766 | [
"Apache-2.0"
] | 1 | 2020-01-20T10:22:36.000Z | 2020-01-20T10:22:36.000Z | src/executor/load_executor.py | jarulraj/eva | 58919d5c523820dcc9e2549d979f578803cff766 | [
"Apache-2.0"
] | null | null | null | src/executor/load_executor.py | jarulraj/eva | 58919d5c523820dcc9e2549d979f578803cff766 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018-2020 EVA
#
# 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 to ... | 38.76 | 79 | 0.718266 |
ea9fceb8256fe4aaf822de62b9d821a1b874cd1d | 2,743 | py | Python | tools/run_interface.py | carlohamalainen/nipype | 0c4f587946f48277de471b1801b60bd18fdfb775 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | tools/run_interface.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | tools/run_interface.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2020-02-19T13:47:05.000Z | 2020-02-19T13:47:05.000Z | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
from optparse import OptionParser
import sys
def listClasses(module=None):
if module:
__import__(mo... | 30.820225 | 78 | 0.548669 |
54dfb646573697c03a6e8d8d0f5bd7780ebcb0d1 | 929 | py | Python | pythonforandroid/recipes/pyleveldb/__init__.py | syrykh/python-for-android | dea23e8c6d11cfad0554f3e846cbe245578781fd | [
"MIT"
] | 6,278 | 2015-01-02T16:34:05.000Z | 2022-03-31T10:24:45.000Z | pythonforandroid/recipes/pyleveldb/__init__.py | ganeshgandhiTN/python-for-android | 690dd18bcf9bbd3ff5a245ac1e7296cc266e5543 | [
"MIT"
] | 1,877 | 2015-01-01T16:16:10.000Z | 2022-03-27T17:34:34.000Z | pythonforandroid/recipes/pyleveldb/__init__.py | ganeshgandhiTN/python-for-android | 690dd18bcf9bbd3ff5a245ac1e7296cc266e5543 | [
"MIT"
] | 1,565 | 2015-01-02T19:35:37.000Z | 2022-03-31T15:37:06.000Z | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe
class PyLevelDBRecipe(CppCompiledComponentsPythonRecipe):
version = '0.194'
url = ('https://pypi.python.org/packages/source/l/leveldb/'
'leveldb-{version}.tar.gz')
depends = ['snappy', 'leveldb', 'setuptools']
patches = [... | 33.178571 | 75 | 0.682454 |
2c2b1acde5a458a63855011e9466e6286efe5949 | 1,062 | py | Python | dataSetGenerator.py | sarthak25/Face-Recognition | da329ee32361ed04c7c4e6f61c376d6d900ac461 | [
"MIT"
] | null | null | null | dataSetGenerator.py | sarthak25/Face-Recognition | da329ee32361ed04c7c4e6f61c376d6d900ac461 | [
"MIT"
] | null | null | null | dataSetGenerator.py | sarthak25/Face-Recognition | da329ee32361ed04c7c4e6f61c376d6d900ac461 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
cam = cv2.VideoCapture(0)
detector=cv2.CascadeClassifier('Classifiers/face.xml')
i=0
offset=50
name_person = input('Enter registration number of person : ')
with open("id_count.txt", "r") as file:
name = file.read()
with open("id_count.txt", "w") as file:
file.write(str(int(name... | 30.342857 | 125 | 0.634652 |
61ad95352f134bda97580cce0a826caedaaf3c5d | 21,885 | py | Python | Sketches/AB/backup/Bookmarks/TwitterStream.oauth.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/AB/backup/Bookmarks/TwitterStream.oauth.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/AB/backup/Bookmarks/TwitterStream.oauth.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #! /usr/bin/python
# Interface to Twitter streaming API
# - Grabs JSON data based on chosen keywords
# - Currently also relays PIDs - this really needs moving elsewhere
# TODO: Add watching for in-stream rate limiting / error messages
# - Doesn't currently honour tweet deletion messages (TODO)
import time
import urll... | 49.513575 | 158 | 0.48764 |
0e6e2603aff9c845ea4e168dddc4357d0268ecc8 | 389 | py | Python | estore/wsgi.py | ujjawal30/online-electronic-store-django-postgresql | 14744066bba9d75c932cbf09e45ab7a4188bbfff | [
"MIT"
] | 1 | 2021-08-21T11:30:02.000Z | 2021-08-21T11:30:02.000Z | estore/wsgi.py | ujjawal30/online-electronic-store-django-postgresql | 14744066bba9d75c932cbf09e45ab7a4188bbfff | [
"MIT"
] | null | null | null | estore/wsgi.py | ujjawal30/online-electronic-store-django-postgresql | 14744066bba9d75c932cbf09e45ab7a4188bbfff | [
"MIT"
] | 1 | 2021-08-21T11:30:04.000Z | 2021-08-21T11:30:04.000Z | """
WSGI config for estore project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
98a8fa89c90ca04d1bab0d4dfa3ffdd1cf01f613 | 17,657 | py | Python | tests/sca_package/test_output.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | tests/sca_package/test_output.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | tests/sca_package/test_output.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | from packaging import version as packaging_version
from checkov.common.bridgecrew.severities import BcSeverities, Severities
from checkov.common.models.enums import CheckResult
from checkov.runner_filter import RunnerFilter
from checkov.sca_package.output import (
calculate_lowest_compliant_version,
create_cli... | 45.625323 | 146 | 0.493006 |
7ca2a0e25c7d805ee4a282f2c67939f4d35e015e | 683 | py | Python | selfsupmotion/utils/reproducibility_utils.py | sbrodeur/selfsupmotion | 32ba34a090e7e575b43a6a6f14c52c0a5f363d40 | [
"Apache-2.0"
] | null | null | null | selfsupmotion/utils/reproducibility_utils.py | sbrodeur/selfsupmotion | 32ba34a090e7e575b43a6a6f14c52c0a5f363d40 | [
"Apache-2.0"
] | 5 | 2021-02-12T02:51:04.000Z | 2021-03-10T20:16:54.000Z | selfsupmotion/utils/reproducibility_utils.py | sbrodeur/selfsupmotion | 32ba34a090e7e575b43a6a6f14c52c0a5f363d40 | [
"Apache-2.0"
] | 2 | 2021-02-06T15:52:34.000Z | 2021-03-10T18:16:28.000Z | import pytorch_lightning
def set_seed(
seed,
set_deterministic=False, # False = optimal performance
set_benchmark=True, # True = optimal performance, unless input tensor shapes vary
): # pragma: no cover
"""Set the provided seed in python/numpy/DL framework.
:param seed: (int) the ... | 31.045455 | 90 | 0.702782 |
dfa0d0364cb518831058930a2c33cf01c172d681 | 263 | py | Python | ffbinaries/const.py | tropicoo/ffbinaries-api-client | a1d0d60d3b4adbac296044c15d36ec5a1f0fb693 | [
"MIT"
] | 1 | 2019-10-26T14:38:46.000Z | 2019-10-26T14:38:46.000Z | ffbinaries/const.py | tropicoo/ffbinaries-api-client | a1d0d60d3b4adbac296044c15d36ec5a1f0fb693 | [
"MIT"
] | null | null | null | ffbinaries/const.py | tropicoo/ffbinaries-api-client | a1d0d60d3b4adbac296044c15d36ec5a1f0fb693 | [
"MIT"
] | null | null | null | """Constants Module."""
class _HTTPMethods:
"""HTTP Methods Class."""
__slots__ = ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')
def __init__(self):
for method in self.__slots__:
setattr(self, method, method)
HTTP = _HTTPMethods()
| 18.785714 | 57 | 0.593156 |
a9879045cfc27323499b428cd322db5d3e5d86bf | 35,272 | py | Python | wavespy/client.py | DPInvaders/wavespy | 8cdf06023bf4caa08dc0d714a88ffb66bbb6eb71 | [
"MIT"
] | null | null | null | wavespy/client.py | DPInvaders/wavespy | 8cdf06023bf4caa08dc0d714a88ffb66bbb6eb71 | [
"MIT"
] | null | null | null | wavespy/client.py | DPInvaders/wavespy | 8cdf06023bf4caa08dc0d714a88ffb66bbb6eb71 | [
"MIT"
] | null | null | null | """
wavespy.client
~~~~~~~~~~~~~~~~
This module provides API client class
"""
import logging
from urllib.parse import urljoin
import requests
DEFAULT_NODE_ADDRESS = 'https://nodes.wavesplatform.com'
DEFAULT_MATCHER_ADDRESS = 'https://matcher.waves.exchange'
DEFAULT_CHAIN_ID = "W"
CHAIN_ID_NAMES = (('W', 'mainnet'),... | 27.83899 | 120 | 0.598492 |
8983e51774820ad393e0f2de1742020e6570de0b | 1,322 | py | Python | nasman/snapshots/admin.py | wengole/nasman | 3087d425a264d093acd1d4f8bdf48dc194a91019 | [
"BSD-3-Clause"
] | 4 | 2015-04-20T17:09:38.000Z | 2015-12-05T22:47:09.000Z | nasman/snapshots/admin.py | wengole/nasman | 3087d425a264d093acd1d4f8bdf48dc194a91019 | [
"BSD-3-Clause"
] | 1 | 2015-03-25T09:17:44.000Z | 2015-03-31T15:41:41.000Z | nasman/snapshots/admin.py | wengole/wizfs | 3087d425a264d093acd1d4f8bdf48dc194a91019 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from sitetree.admin import TreeItemAdmin, override_item_admin
from .models import File, IconMapping
from .forms import FileForm
@admin.register(File)
class FileAdmin(admin.ModelAdmin):
list_display = ('original_path', 'snaps... | 31.47619 | 78 | 0.618003 |
f28b7a4c9bde148089adca0dd14098fec62b9286 | 124,420 | py | Python | Lib/email/test/test_email_renamed.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | 42 | 2018-12-12T01:00:59.000Z | 2022-03-27T07:32:29.000Z | python27/1.0/lib/email/test/test_email_renamed.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | 13 | 2020-11-06T13:50:45.000Z | 2022-01-25T07:17:37.000Z | python27/1.0/lib/email/test/test_email_renamed.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | 8 | 2020-11-14T04:30:26.000Z | 2021-01-16T17:55:19.000Z | # Copyright (C) 2001-2007 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests
import os
import sys
import time
import base64
import difflib
import unittest
import warnings
from cStringIO import StringIO
import email
from email.charset import Charset
from email.header... | 37.419549 | 461 | 0.60823 |
b9d2a18882312bd7048ba29a3d615ee753094929 | 743 | py | Python | monk/tf_keras_1/schedulers/retrieve_scheduler.py | Shreyashwaghe/monk_v1 | 4ee4d9483e8ffac9b73a41f3c378e5abf5fc799b | [
"Apache-2.0"
] | 2 | 2020-09-16T06:05:50.000Z | 2021-04-07T12:05:20.000Z | monk/tf_keras_1/schedulers/retrieve_scheduler.py | Shreyashwaghe/monk_v1 | 4ee4d9483e8ffac9b73a41f3c378e5abf5fc799b | [
"Apache-2.0"
] | null | null | null | monk/tf_keras_1/schedulers/retrieve_scheduler.py | Shreyashwaghe/monk_v1 | 4ee4d9483e8ffac9b73a41f3c378e5abf5fc799b | [
"Apache-2.0"
] | null | null | null | from tf_keras_1.schedulers.imports import *
from system.imports import *
@accepts(dict, post_trace=True)
@TraceFunction(trace_args=False, trace_rv=False)
def retrieve_scheduler(system_dict):
'''
Retrieve schedulers in validation, testing, copy-from and resume states
Args:
system_dict (dict): Syste... | 35.380952 | 125 | 0.718708 |
04b7b4662b20476dca82dd192e5a5e9bc73fcfd5 | 5,297 | py | Python | gateway_testcases/python_lib/selenium/test/test_time.py | sandmars/web | f301bce6ecd018709efd6d76167d47cdbdaab21e | [
"CC0-1.0"
] | null | null | null | gateway_testcases/python_lib/selenium/test/test_time.py | sandmars/web | f301bce6ecd018709efd6d76167d47cdbdaab21e | [
"CC0-1.0"
] | null | null | null | gateway_testcases/python_lib/selenium/test/test_time.py | sandmars/web | f301bce6ecd018709efd6d76167d47cdbdaab21e | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.support.ui import Select
import sys, unittest, time, datetime, HTMLTestRunner, ConfigParser
reload(sys)
sys.setdefaultencoding('utf-8')
class test_time(unittest.TestCase):
def setUp(self):
u'''初始化参数'''
... | 37.835714 | 109 | 0.667736 |
59da5388afa3af3985602973930c331bcf0f7d52 | 11,961 | py | Python | main.py | Mibblez/a-star-with-python | 04cbf14546cda1dd021ce7b9684e2cf83df6e207 | [
"MIT"
] | null | null | null | main.py | Mibblez/a-star-with-python | 04cbf14546cda1dd021ce7b9684e2cf83df6e207 | [
"MIT"
] | null | null | null | main.py | Mibblez/a-star-with-python | 04cbf14546cda1dd021ce7b9684e2cf83df6e207 | [
"MIT"
] | null | null | null | import enum
from typing import List
import pygame
from sprites import *
from game_settings import *
class TileType(enum.Enum):
FLOOR = 0
WALL = 1
NAV_START = 2
NAV_END = 3
NAV_PATH = 4
NAV_OPEN_SET = 5
NAV_CLOSED_SET = 6
class Tile(object):
# Navigation point singletons
nav_sta... | 36.803077 | 117 | 0.592676 |
f4ff3cda15801de20e8c07fee781c08189b9d81c | 74 | py | Python | Modulo1/scripts/argumento.py | angiequispe/PythonFundamentos | 4bb1bf599225ab2d07f191405cd9f5fce4004514 | [
"Apache-2.0"
] | null | null | null | Modulo1/scripts/argumento.py | angiequispe/PythonFundamentos | 4bb1bf599225ab2d07f191405cd9f5fce4004514 | [
"Apache-2.0"
] | null | null | null | Modulo1/scripts/argumento.py | angiequispe/PythonFundamentos | 4bb1bf599225ab2d07f191405cd9f5fce4004514 | [
"Apache-2.0"
] | null | null | null | import sys
arg = sys.argv
print('primer valor ingresado es: ', arg[1]) | 12.333333 | 45 | 0.675676 |
133e4cfff169220c27c5c05c4a2bb70d8f1461da | 398 | py | Python | calliope_app/api/migrations/0011_timeseries_meta_is_uploading.py | jmorrisnrel/engage | 250ecc24c0225d48363afe4e40335a89dd9b6a44 | [
"BSD-3-Clause"
] | 3 | 2021-01-25T18:13:00.000Z | 2021-04-30T12:17:42.000Z | calliope_app/api/migrations/0011_timeseries_meta_is_uploading.py | jmorrisnrel/engage | 250ecc24c0225d48363afe4e40335a89dd9b6a44 | [
"BSD-3-Clause"
] | 8 | 2020-12-11T22:28:17.000Z | 2022-03-05T02:08:27.000Z | calliope_app/api/migrations/0011_timeseries_meta_is_uploading.py | jmorrisnrel/engage | 250ecc24c0225d48363afe4e40335a89dd9b6a44 | [
"BSD-3-Clause"
] | 1 | 2021-09-15T22:15:12.000Z | 2021-09-15T22:15:12.000Z | # Generated by Django 2.1.4 on 2019-08-01 21:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0010_auto_20190730_1726'),
]
operations = [
migrations.AddField(
model_name='timeseries_meta',
name='is_uploa... | 20.947368 | 53 | 0.610553 |
75d5f847bb20e8c27f46468efc8ba12b7d70e152 | 6,669 | py | Python | solumclient/tests/common/test_github.py | openstack/python-solumclient | d6635aecd640cbe91a83c87f709ac4ebbeac979c | [
"Apache-2.0"
] | 14 | 2015-09-30T21:41:56.000Z | 2022-03-13T18:46:57.000Z | solumclient/tests/common/test_github.py | openstack/python-solumclient | d6635aecd640cbe91a83c87f709ac4ebbeac979c | [
"Apache-2.0"
] | null | null | null | solumclient/tests/common/test_github.py | openstack/python-solumclient | d6635aecd640cbe91a83c87f709ac4ebbeac979c | [
"Apache-2.0"
] | 2 | 2015-10-25T18:06:13.000Z | 2017-04-18T08:44:58.000Z | # Copyright (c) 2015 Rackspace
#
# 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 to in writing,... | 40.418182 | 77 | 0.594992 |
446a133ed38615cb1a93d32b7c00ddfa30ba3e0d | 53,401 | py | Python | protos/gen/python/protos/public/modeldb/ExperimentRunService_pb2_grpc.py | nhatsmrt/modeldb | 4cf54a9e821816b961b58dd92a77af1ceb25bd47 | [
"Apache-2.0"
] | null | null | null | protos/gen/python/protos/public/modeldb/ExperimentRunService_pb2_grpc.py | nhatsmrt/modeldb | 4cf54a9e821816b961b58dd92a77af1ceb25bd47 | [
"Apache-2.0"
] | null | null | null | protos/gen/python/protos/public/modeldb/ExperimentRunService_pb2_grpc.py | nhatsmrt/modeldb | 4cf54a9e821816b961b58dd92a77af1ceb25bd47 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from ..modeldb import CommonService_pb2 as modeldb_dot_CommonService__pb2
from ..modeldb import ExperimentRunService_pb2 as modeldb_dot_ExperimentRunService__pb2
class ExperimentRunServiceStub(object):
# missing associated documentat... | 54.324517 | 131 | 0.789966 |
eacc0ed70442a1bbb6defca2bd51de7034c81094 | 1,503 | py | Python | backend/api/python_http_client/test/test_api_get_healthz_response.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | backend/api/python_http_client/test/test_api_get_healthz_response.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | backend/api/python_http_client/test/test_api_get_healthz_response.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | # coding: utf-8
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import ... | 28.358491 | 124 | 0.70326 |
ff91c3dbf6d2f53828ddd3d28c270f64e8ab9288 | 3,217 | py | Python | tests/integration_test.py | njam/tinycards-python-api | 7381efbc75feeed4d7aaa25f78c192af6bf1d011 | [
"MIT"
] | null | null | null | tests/integration_test.py | njam/tinycards-python-api | 7381efbc75feeed4d7aaa25f78c192af6bf1d011 | [
"MIT"
] | null | null | null | tests/integration_test.py | njam/tinycards-python-api | 7381efbc75feeed4d7aaa25f78c192af6bf1d011 | [
"MIT"
] | null | null | null | import os
import unittest
from tinycards import Tinycards
from tinycards.model import Deck
class TestIntegration(unittest.TestCase):
def _clean_up(self):
"""Before tests are run, make sure we start from a clean slate."""
all_decks = self.tinycards.get_decks()
for d in all_decks:
... | 31.539216 | 79 | 0.661486 |
455c8cfcbdd8ec975352133a4ce4d029b061b8eb | 768 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_7_Datetime_Module/89. subtract five days from a given date.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_7_Datetime_Module/89. subtract five days from a given date.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_7_Datetime_Module/89. subtract five days from a given date.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that chooses random values for the year, month and day within the specified valid ranges
and then subtract five days from this date.
Example:
chosen_date = datetime.date(3683, 12, 16)
Expected output = datetime.date(3683, 12, 11)
"""
import datetime
import random
def subtract_days():
... | 25.6 | 113 | 0.722656 |
6a1ba373815178d242551c1a38f2fa068359b388 | 1,914 | py | Python | code/707.Design-Linked-List.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | 1 | 2019-09-22T03:08:14.000Z | 2019-09-22T03:08:14.000Z | code/707.Design-Linked-List.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | null | null | null | code/707.Design-Linked-List.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | null | null | null | class ListNode:
def __init__(self, val, next=None):
self.val = val
self.next = next
class MyLinkedList:
def __init__(self):
self.head = ListNode(0) # dummy header
self.size = 0 # size of the linked list
def get(self, index: int) -> int:
if index + 1 > self.size o... | 28.147059 | 67 | 0.512017 |
2db8d65236d24c3f3a69f793b3cd46fc272f544f | 1,785 | py | Python | aliyun-python-sdk-nas/aliyunsdknas/request/v20170626/DescribeStoragePackagesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-nas/aliyunsdknas/request/v20170626/DescribeStoragePackagesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-nas/aliyunsdknas/request/v20170626/DescribeStoragePackagesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.428571 | 81 | 0.770868 |
0d37043c138ee50ff06aa80475169a1146921218 | 5,059 | py | Python | supervisor/docker/network.py | vighnesh-kadam/supervisor | 15f62837c8d78ec0928a1a77b6508ff20618e126 | [
"Apache-2.0"
] | null | null | null | supervisor/docker/network.py | vighnesh-kadam/supervisor | 15f62837c8d78ec0928a1a77b6508ff20618e126 | [
"Apache-2.0"
] | 310 | 2020-03-12T16:02:13.000Z | 2022-03-31T06:01:49.000Z | supervisor/docker/network.py | foreign-sub/home-assistant-supervisor | 15f62837c8d78ec0928a1a77b6508ff20618e126 | [
"Apache-2.0"
] | null | null | null | """Internal network manager for Supervisor."""
from contextlib import suppress
from ipaddress import IPv4Address
import logging
from typing import Optional
import docker
import requests
from ..const import DOCKER_NETWORK, DOCKER_NETWORK_MASK, DOCKER_NETWORK_RANGE
from ..exceptions import DockerError
_LOGGER: logging... | 32.22293 | 88 | 0.634315 |
b98cbd97b5ca94dc550e860c58a5d767c05e55a5 | 21,681 | py | Python | medium_to_ghost/medium_post_parser.py | ageitgey/medium_to_ghost | 0403e8e7b005e1b5af78b4ae58199d3b513416cc | [
"MIT"
] | 120 | 2018-08-30T02:38:49.000Z | 2021-11-09T10:16:33.000Z | medium_to_ghost/medium_post_parser.py | ageitgey/medium_to_ghost | 0403e8e7b005e1b5af78b4ae58199d3b513416cc | [
"MIT"
] | 17 | 2018-08-29T12:40:31.000Z | 2021-01-04T13:14:27.000Z | medium_to_ghost/medium_post_parser.py | ageitgey/medium_to_ghost | 0403e8e7b005e1b5af78b4ae58199d3b513416cc | [
"MIT"
] | 15 | 2018-08-29T15:55:09.000Z | 2021-12-17T06:00:39.000Z | from html.parser import HTMLParser
import json
from medium_to_ghost.image_downloader import download_image_with_local_cache
from bs4 import BeautifulSoup
import logging
from pathlib import Path
def parse_medium_filename(filename):
status = "published"
date, slug = filename.split("_")
slug = slug.split(".... | 42.595285 | 127 | 0.586458 |
1024f4c381c6d2af7d2e552bc2304a2143a5d912 | 1,343 | py | Python | py/rpn/data/transforms/color/random_lighting_noise.py | object-detection-algorithm/RPN | f08a6a6ac3baf80dcd47f01f3352bf5aef89ae18 | [
"Apache-2.0"
] | 1 | 2022-01-21T05:41:33.000Z | 2022-01-21T05:41:33.000Z | py/rpn/data/transforms/color/random_lighting_noise.py | object-detection-algorithm/RPN | f08a6a6ac3baf80dcd47f01f3352bf5aef89ae18 | [
"Apache-2.0"
] | 3 | 2021-06-08T21:36:05.000Z | 2022-03-12T00:30:57.000Z | py/rpn/data/transforms/color/random_lighting_noise.py | object-detection-algorithm/RPN | f08a6a6ac3baf80dcd47f01f3352bf5aef89ae18 | [
"Apache-2.0"
] | 1 | 2020-08-12T15:02:17.000Z | 2020-08-12T15:02:17.000Z | # -*- coding: utf-8 -*-
"""
@date: 2020/5/9 下午8:17
@file: random_lighting_noise.py
@author: zj
@description:
"""
from numpy import random
import rpn.data.transforms.color as color
class RandomLightingNoise(object):
def __init__(self):
self.perms = ((0, 1, 2), (0, 2, 1),
(1, 0, 2),... | 25.826923 | 66 | 0.553239 |
c3db6699e1561bdb020382fa40e1b0eb1e7de3ff | 7,707 | py | Python | vendor/packages/translate-toolkit/translate/storage/pocommon.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/translate-toolkit/translate/storage/pocommon.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | 1 | 2021-12-13T20:55:07.000Z | 2021-12-13T20:55:07.000Z | vendor/packages/translate-toolkit/translate/storage/pocommon.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2011 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2... | 34.873303 | 106 | 0.634488 |
3e41a3d23f1cd5e224926d0f23ef2a864d4c94cb | 5,654 | py | Python | rrl-sysadmin/sysadmin.py | HyeokjuJang/sr-drl | 01fa8264c7b36f34f721303f455f37545dbce1fe | [
"MIT"
] | 14 | 2020-10-02T17:14:04.000Z | 2022-02-26T19:26:58.000Z | rrl-sysadmin/sysadmin.py | HyeokjuJang/sr-drl | 01fa8264c7b36f34f721303f455f37545dbce1fe | [
"MIT"
] | 1 | 2022-02-26T08:23:13.000Z | 2022-02-26T08:23:13.000Z | rrl-sysadmin/sysadmin.py | jaromiru/sr-drl | 01fa8264c7b36f34f721303f455f37545dbce1fe | [
"MIT"
] | 6 | 2021-05-04T13:24:12.000Z | 2021-12-06T12:51:30.000Z | import gym, random, copy, string, uuid
import numpy as np
rddl_template = string.Template('''
non-fluents nf_sysadmin_inst_$uid {
domain = sysadmin_mdp;
objects {
computer : {$objects};
};
non-fluents {
REBOOT-PROB = $reboot_prob;
$connections
};
}
instance sysadmin_inst_$uid {
domain = sysadmin_mdp;
non... | 25.241071 | 194 | 0.662363 |
d2dee3ba626d266b00440d6460fec5bdc1c812bf | 1,366 | py | Python | Prototype_2/web/blueprints/pages.py | amal66/Kawm | 3bf442ea1f4b572f4ec840e0ee6ec7d96ae23133 | [
"MIT"
] | null | null | null | Prototype_2/web/blueprints/pages.py | amal66/Kawm | 3bf442ea1f4b572f4ec840e0ee6ec7d96ae23133 | [
"MIT"
] | null | null | null | Prototype_2/web/blueprints/pages.py | amal66/Kawm | 3bf442ea1f4b572f4ec840e0ee6ec7d96ae23133 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template
from flask import current_app as app
from flask_login import (
LoginManager,
current_user,
login_required,
login_user,
logout_user,
UserMixin
)
from ..models import Class, File
pages_template = Blueprint('pages', __name__, template_folder='../templat... | 30.355556 | 126 | 0.7306 |
972d1efc3945b46d13384bbf31aacd117112d41c | 1,455 | py | Python | machine_learning_scikit_learn/02_poly_reg.py | luisespino/ia | ab161546919058dbd42cc34c59d98616adf018d3 | [
"MIT"
] | 2 | 2021-07-26T15:32:29.000Z | 2021-12-06T14:11:47.000Z | machine_learning_scikit_learn/02_poly_reg.py | luisespino/artificial_intelligence | ccd7c0b01dfe5128ed663109cfa36f3f154055d4 | [
"MIT"
] | null | null | null | machine_learning_scikit_learn/02_poly_reg.py | luisespino/artificial_intelligence | ccd7c0b01dfe5128ed663109cfa36f3f154055d4 | [
"MIT"
] | 4 | 2020-11-27T13:15:06.000Z | 2022-01-09T04:53:56.000Z | # 2020 Luis Espino
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.metrics import mean_squared_error, r2_score
import matplotlib.pyplot as plt
import numpy as np
# data
x = np.asarray([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23... | 29.693878 | 120 | 0.735395 |
5e42d749cfe8550c446d2cbd829597ebd43710b1 | 2,923 | py | Python | tests/test_immutable_mutant.py | t184256/mutants | efb53df88a4700297937b6e75235fd323bd18923 | [
"MIT"
] | 1 | 2018-04-04T17:29:46.000Z | 2018-04-04T17:29:46.000Z | tests/test_immutable_mutant.py | t184256/mutants | efb53df88a4700297937b6e75235fd323bd18923 | [
"MIT"
] | null | null | null | tests/test_immutable_mutant.py | t184256/mutants | efb53df88a4700297937b6e75235fd323bd18923 | [
"MIT"
] | 1 | 2022-02-11T17:12:12.000Z | 2022-02-11T17:12:12.000Z | import mutants
class Duck:
def quack(self):
return 'quack'
class Wolf:
def quack(self):
return 'no quack'
def test_basic_duckwolf():
def duckwolf_generator():
yield Duck()
yield Duck()
while True:
yield Wolf()
duckwolf_iter = iter(duckwolf_genera... | 26.816514 | 78 | 0.5987 |
819a6a5eca19d808cc07a133f52e807bde895163 | 4,872 | py | Python | LeetCode/medium/top_k_frequent_elements.py | hnc01/online-judge | d306dc32c9d8600a987affbe4e4b80809f0b0982 | [
"MIT"
] | null | null | null | LeetCode/medium/top_k_frequent_elements.py | hnc01/online-judge | d306dc32c9d8600a987affbe4e4b80809f0b0982 | [
"MIT"
] | null | null | null | LeetCode/medium/top_k_frequent_elements.py | hnc01/online-judge | d306dc32c9d8600a987affbe4e4b80809f0b0982 | [
"MIT"
] | null | null | null | '''
https://leetcode.com/problems/top-k-frequent-elements/
347. Top K Frequent Elements
Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.
'''
'''
Accepted: Similar to Heap approach in solution but instead of using a Heap to sort... | 31.230769 | 137 | 0.604885 |
8a0efdae894704f85193208324dd2a4411d75364 | 2,488 | py | Python | bims/api_views/spatial_scale_filter.py | Christiaanvdm/django-bims | f92a63156c711b2d53c5f8ea06867cd64cee9eb9 | [
"MIT"
] | null | null | null | bims/api_views/spatial_scale_filter.py | Christiaanvdm/django-bims | f92a63156c711b2d53c5f8ea06867cd64cee9eb9 | [
"MIT"
] | null | null | null | bims/api_views/spatial_scale_filter.py | Christiaanvdm/django-bims | f92a63156c711b2d53c5f8ea06867cd64cee9eb9 | [
"MIT"
] | null | null | null | # coding=utf-8
import copy
from rest_framework.views import APIView, Response
from bims.models import SpatialScale, SpatialScaleGroup
from bims.views.fish_form import RIVER_CATCHMENT_ORDER
class SpatialScaleFilterList(APIView):
"""API for listing all spatial scale filter"""
def get_spatial_scale(self, spatia... | 35.542857 | 70 | 0.561495 |
6d44f0126467188e11ea4fae993bdad77d8e7bd0 | 3,146 | py | Python | src/visualization.py | pwhjy/CNN-Visualization | 539d3d432bc08110fab3df8fc5aa076130d2a2e3 | [
"MIT"
] | null | null | null | src/visualization.py | pwhjy/CNN-Visualization | 539d3d432bc08110fab3df8fc5aa076130d2a2e3 | [
"MIT"
] | null | null | null | src/visualization.py | pwhjy/CNN-Visualization | 539d3d432bc08110fab3df8fc5aa076130d2a2e3 | [
"MIT"
] | null | null | null | import torchvision.models as models
import cv2
import torch
import torchvision.transforms as t
import numpy as np
import torch.nn as nn
from PIL import Image
def preprocess_image(img, resize_im=True):
"""
Processes image for CNNs
Args:
PIL_img (PIL_img): Image to process
resize_im (boo... | 27.12069 | 90 | 0.632549 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.