hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 972 | max_forks_repo_name stringlengths 6 130 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
99d90f0037bec0f478fe5d4636df8a2ae1954387 | 4,079 | py | Python | research/delf/delf/python/pooling_layers/pooling.py | w07wong/models | ca011eaa5a35adc46b92fe957f3e57bea53c9f69 | [
"Apache-2.0"
] | 2 | 2021-03-03T07:54:33.000Z | 2021-03-09T16:13:01.000Z | research/delf/delf/python/pooling_layers/pooling.py | w07wong/models | ca011eaa5a35adc46b92fe957f3e57bea53c9f69 | [
"Apache-2.0"
] | null | null | null | research/delf/delf/python/pooling_layers/pooling.py | w07wong/models | ca011eaa5a35adc46b92fe957f3e57bea53c9f69 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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 required by applicab... | 28.326389 | 80 | 0.648934 |
09539e0ca368b78938dad4516841b5e05cefb990 | 299 | py | Python | problems/3.py | christofferaakre/project-euler | 4b42802233be10e4a592798205171fb5156dae6b | [
"MIT"
] | null | null | null | problems/3.py | christofferaakre/project-euler | 4b42802233be10e4a592798205171fb5156dae6b | [
"MIT"
] | null | null | null | problems/3.py | christofferaakre/project-euler | 4b42802233be10e4a592798205171fb5156dae6b | [
"MIT"
] | null | null | null | from main import Solver
solver = Solver()
big = 600851475143
def largest_prime_factor(number):
b = 2
a = number
while a > b:
if int(a % b) == 0:
a /= b
b = 2
else:
b += 1
return int(a)
solver.solve(3, largest_prime_factor(big))
| 16.611111 | 42 | 0.518395 |
33bbe447bb44f229d8ceb14e9cd167a21fc7c1ad | 446 | py | Python | quotrapp/main/routes.py | joshbduncan/quotr | dc35cdffe3133f07e7d2471fa40d5291f16ceee2 | [
"MIT"
] | 1 | 2020-09-12T04:56:20.000Z | 2020-09-12T04:56:20.000Z | quotrapp/main/routes.py | joshbduncan/quotr | dc35cdffe3133f07e7d2471fa40d5291f16ceee2 | [
"MIT"
] | null | null | null | quotrapp/main/routes.py | joshbduncan/quotr | dc35cdffe3133f07e7d2471fa40d5291f16ceee2 | [
"MIT"
] | null | null | null | from flask import render_template, request, Blueprint, current_app
from sqlalchemy import func
from quotrapp.models import Quote, Author
main_bp = Blueprint('main_bp', __name__)
@main_bp.route('/')
@main_bp.route('/index')
def index():
quote = Quote.query.order_by(func.random()).first()
return render_templa... | 23.473684 | 66 | 0.733184 |
05a2e1662ddf1ad651bdca507b842eab3d478998 | 12,091 | py | Python | stack/stack/scp.py | leipan/ariamh | aa307ddad7d0f3f75303e9a5bb53d25ba171605e | [
"Apache-2.0"
] | null | null | null | stack/stack/scp.py | leipan/ariamh | aa307ddad7d0f3f75303e9a5bb53d25ba171605e | [
"Apache-2.0"
] | null | null | null | stack/stack/scp.py | leipan/ariamh | aa307ddad7d0f3f75303e9a5bb53d25ba171605e | [
"Apache-2.0"
] | null | null | null | # scp.py
# Copyright (C) 2008 James Bardin <jbardin@bu.edu>
"""
Utilities for sending files over ssh using the scp1 protocol.
"""
import os
import re
from socket import timeout as SocketTimeout
DEBUG = False
class SCPClient(object):
"""
An scp1 implementation, compatible with openssh scp.
Raises SCPExc... | 34.644699 | 78 | 0.565214 |
5c88d6baefe4affb74b244f1bcd279aff06f427e | 1,377 | py | Python | RPI/Wifi_old/WiFi_Socket_old.py | sguertl/Flying_Raspberry | d4f4ec82c4ceab7560d00265d7214aff84cbffd7 | [
"Apache-2.0"
] | 1 | 2018-03-10T10:50:29.000Z | 2018-03-10T10:50:29.000Z | RPI/Wifi_old/WiFi_Socket_old.py | sguertl/Flying_Pi | d4f4ec82c4ceab7560d00265d7214aff84cbffd7 | [
"Apache-2.0"
] | null | null | null | RPI/Wifi_old/WiFi_Socket_old.py | sguertl/Flying_Pi | d4f4ec82c4ceab7560d00265d7214aff84cbffd7 | [
"Apache-2.0"
] | null | null | null | ### This version is used for multiclients and python 3.4.x ###
import socket
import sys
from _thread import *
HOST = '' # Symbolic name meaning all available interfaces
PORT = 5050 # Abritray non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created')
# Bind socket to local h... | 29.297872 | 132 | 0.687727 |
b69c70f1b9bcd40e17ea582a03bf21b21d06eaf9 | 476 | py | Python | src/grepros/__init__.py | suurjaak/grepros | 4e719252858b6895d2ee071fcf0c332a3a5dafaa | [
"BSD-3-Clause"
] | 10 | 2021-11-05T12:43:21.000Z | 2022-03-17T06:08:30.000Z | src/grepros/__init__.py | suurjaak/grepros | 4e719252858b6895d2ee071fcf0c332a3a5dafaa | [
"BSD-3-Clause"
] | 1 | 2022-03-01T09:19:53.000Z | 2022-03-01T21:38:52.000Z | src/grepros/__init__.py | suurjaak/grepros | 4e719252858b6895d2ee071fcf0c332a3a5dafaa | [
"BSD-3-Clause"
] | 1 | 2022-01-24T23:46:00.000Z | 2022-01-24T23:46:00.000Z | # -*- coding: utf-8 -*-
"""
------------------------------------------------------------------------------
This file is part of grepros - grep for ROS bag files and live topics.
Released under the BSD License.
@author Erki Suurjaak
@created 31.10.2021
@modified 26.05.2022
----------------------------------... | 29.75 | 78 | 0.428571 |
bd3b8f3b6614c1af17096515e3d815d719a413b6 | 1,863 | py | Python | bandwitch/ClonesObservations/band_patterns_discrepancy.py | Edinburgh-Genome-Foundry/BandWitch | 23f7faee9a955313ade66c77ab474a12712e14fc | [
"MIT"
] | 12 | 2018-02-12T13:12:00.000Z | 2021-08-15T11:36:28.000Z | bandwitch/ClonesObservations/band_patterns_discrepancy.py | Edinburgh-Genome-Foundry/BandWitch | 23f7faee9a955313ade66c77ab474a12712e14fc | [
"MIT"
] | 2 | 2020-09-07T21:53:27.000Z | 2020-09-20T18:49:17.000Z | bandwitch/ClonesObservations/band_patterns_discrepancy.py | Edinburgh-Genome-Foundry/BandWitch | 23f7faee9a955313ade66c77ab474a12712e14fc | [
"MIT"
] | null | null | null | import numpy as np
from ..tools import max_min_distance
def band_patterns_discrepancy(
bands1,
bands2,
ladder,
relative_tolerance=0.1,
reference_and_gel=False,
zone=None,
):
"""Return a discrepancy indicating whether the band patterns are
perfectly matching (0) or dissimilar (>=1) or i... | 30.540984 | 79 | 0.678476 |
48cb94a0e298a0bddcd134b5a3174c3904d978b0 | 2,230 | py | Python | modules/video/classification/videotag_tsn_lstm/resource/utils/config_utils.py | chunzhang-hub/PaddleHub | c5cfd021f77fd59340fb26e223e09a592e6a345f | [
"Apache-2.0"
] | 8,360 | 2019-01-18T10:46:45.000Z | 2022-03-31T14:50:02.000Z | modules/video/classification/videotag_tsn_lstm/resource/utils/config_utils.py | dwuping/PaddleHub | 9a3b23295947e22149cc85c17cb4cf23c03f9e06 | [
"Apache-2.0"
] | 1,158 | 2019-04-11T09:22:43.000Z | 2022-03-31T12:12:09.000Z | modules/video/classification/videotag_tsn_lstm/resource/utils/config_utils.py | dwuping/PaddleHub | 9a3b23295947e22149cc85c17cb4cf23c03f9e06 | [
"Apache-2.0"
] | 1,677 | 2019-04-09T15:07:40.000Z | 2022-03-31T06:41:10.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#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... | 29.342105 | 81 | 0.615695 |
f1126fefbaeaa1ea0dabd1a4a9a79fda14c3c53a | 2,260 | py | Python | experiment_tests/basic_experiments.py | probablytom/bpi_13_python | ef042674d3d40857237511af1fbca59ede97e75e | [
"MIT"
] | null | null | null | experiment_tests/basic_experiments.py | probablytom/bpi_13_python | ef042674d3d40857237511af1fbca59ede97e75e | [
"MIT"
] | null | null | null | experiment_tests/basic_experiments.py | probablytom/bpi_13_python | ef042674d3d40857237511af1fbca59ede97e75e | [
"MIT"
] | null | null | null | import unittest
from theatre_au import Clock
from actor_au import Troupe
from domain_model import construct_universe, action_log, generate_XES, new_trace
class ExperimentalScratchpad(unittest.TestCase):
def setUp(self):
self.clock = Clock()
self.reps = Troupe()
self.specialists = Troupe()... | 29.350649 | 109 | 0.569027 |
1cf8262decc4c80d6d76a90447aac2554e27d5b7 | 15,868 | py | Python | mvqag/experiments/abnormality/2020.py | VirkSaab/Medical-VQA | 6d77963cc81940fc680a18d931e0d88a3264f5fa | [
"MIT"
] | null | null | null | mvqag/experiments/abnormality/2020.py | VirkSaab/Medical-VQA | 6d77963cc81940fc680a18d931e0d88a3264f5fa | [
"MIT"
] | null | null | null | mvqag/experiments/abnormality/2020.py | VirkSaab/Medical-VQA | 6d77963cc81940fc680a18d931e0d88a3264f5fa | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torchvision.transforms as T
import pandas as pd
from typing import Dict, List
from torchcontrib.optim import SWA
from pathlib import Path
from mvqag import CNF_PATH
from mvqag.utils import load_yaml, load_json, get_recent_githash, load_qa_file
from mvqag.data import (
VQADa... | 34.874725 | 78 | 0.564784 |
05406136bfe9824ae4cc599f52a81b536db42243 | 3,725 | py | Python | dechorate/utils/mds_utils.py | Chutlhu/DechorateDB | 378eda37ed296f2823e3306238101343c5f4084a | [
"MIT"
] | 7 | 2021-06-01T10:57:58.000Z | 2022-03-30T03:17:16.000Z | dechorate/utils/mds_utils.py | Chutlhu/DechorateDB | 378eda37ed296f2823e3306238101343c5f4084a | [
"MIT"
] | 3 | 2021-06-25T14:48:40.000Z | 2022-02-10T05:36:30.000Z | dechorate/utils/mds_utils.py | Chutlhu/DechorateDB | 378eda37ed296f2823e3306238101343c5f4084a | [
"MIT"
] | null | null | null | import numpy as np
import scipy as sp
from dechorate.externals.trilaterate import trilaterate
def edm(X, Y):
'''
Return Euclidean Distance Matrix
s.t. D[i,j] = np.linalg.norm(X[:, i] - Y[:, i])
'''
Dx, N = X.shape
Dy, M = Y.shape
assert (Dx == Dy == 3) or (Dx == Dy == 2)
# norm_X2 = s... | 32.964602 | 102 | 0.494497 |
b237bae3ff329fd372f9bc9676ce515ebc403656 | 3,304 | py | Python | pyramid_peewee_conn/tests/__init__.py | inpool/pyramid_peewee_conn | b576af85f81a992479454ca79bdcd585529e23db | [
"MIT"
] | 2 | 2017-10-20T06:53:05.000Z | 2021-01-14T03:38:56.000Z | pyramid_peewee_conn/tests/__init__.py | inpool/pyramid_peewee_conn | b576af85f81a992479454ca79bdcd585529e23db | [
"MIT"
] | null | null | null | pyramid_peewee_conn/tests/__init__.py | inpool/pyramid_peewee_conn | b576af85f81a992479454ca79bdcd585529e23db | [
"MIT"
] | null | null | null | '''
The unit test for pyramid_peewee_conn using pytest.
Author: Inpool
Email: inpool@126.com
'''
from os.path import abspath, dirname, join as pathjoin
from configparser import ConfigParser, ExtendedInterpolation
from pyramid.config import Configurator
from peewee import SqliteDatabase, PostgresqlDatabase, MySQLData... | 24.656716 | 75 | 0.720036 |
bc79219a2539ed78ac391580e4633eade37791b6 | 28,100 | py | Python | mtkclient/Library/xflash_ext.py | P-Salik/mtkclient | ca702a4ec84da4ec607f1e6484ff605e79a69f46 | [
"MIT"
] | null | null | null | mtkclient/Library/xflash_ext.py | P-Salik/mtkclient | ca702a4ec84da4ec607f1e6484ff605e79a69f46 | [
"MIT"
] | null | null | null | mtkclient/Library/xflash_ext.py | P-Salik/mtkclient | ca702a4ec84da4ec607f1e6484ff605e79a69f46 | [
"MIT"
] | null | null | null | import hmac
import os
from struct import unpack, pack
from mtkclient.config.payloads import pathconfig
from mtkclient.Library.error import ErrorHandler
from mtkclient.Library.hwcrypto import crypto_setup, hwcrypto
from mtkclient.Library.utils import LogBase, progress, logsetup, find_binary
from mtkclient.Library.seccf... | 43.90625 | 118 | 0.546335 |
37a341de6d547ca4ad9c80f542090b58b81faf18 | 1,110 | py | Python | questions/diameter-of-binary-tree/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 141 | 2017-12-12T21:45:53.000Z | 2022-03-25T07:03:39.000Z | questions/diameter-of-binary-tree/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 32 | 2015-10-05T14:09:52.000Z | 2021-05-30T10:28:41.000Z | questions/diameter-of-binary-tree/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 56 | 2015-09-30T05:23:28.000Z | 2022-03-08T07:57:11.000Z | '''
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.
Example:
Given a binary tree
1
/ \
2 3
/ \
... | 28.461538 | 225 | 0.552252 |
177059fec72cef65e3421848081499b0d3bbb5e7 | 808 | py | Python | tests/io/test_strava.py | GoldenCheetah/sweatpy | eed6b34ff75c16fcbad878caded8ee4d18dea589 | [
"MIT"
] | 58 | 2018-03-10T08:26:10.000Z | 2022-03-20T11:23:50.000Z | tests/io/test_strava.py | GoldenCheetah/sweatpy | eed6b34ff75c16fcbad878caded8ee4d18dea589 | [
"MIT"
] | 19 | 2018-03-10T13:09:49.000Z | 2022-03-18T10:31:19.000Z | tests/io/test_strava.py | GoldenCheetah/sweatpy | eed6b34ff75c16fcbad878caded8ee4d18dea589 | [
"MIT"
] | 20 | 2018-03-09T19:16:15.000Z | 2022-03-08T00:21:38.000Z | import pytest
import pandas as pd
import sweat
from sweat.io import strava
from .utils import sweatvcr
def test_top_level_import():
assert sweat.read_strava == strava.read_strava
@sweatvcr.use_cassette()
def test_read_strava():
activity = sweat.read_strava(
activity_id="3547667536", access_token="... | 21.263158 | 70 | 0.585396 |
14fea5a2599eec0873f3cbe8fe71592621087fe4 | 2,616 | py | Python | lldb/third_party/Python/module/unittest2/unittest2/__init__.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | third_party/Python/module/unittest2/unittest2/__init__.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | third_party/Python/module/unittest2/unittest2/__init__.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | """
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 P... | 33.113924 | 76 | 0.749618 |
bae842713d6f1d73dc1ca8cf79801cd3e2000ecf | 1,522 | py | Python | taskwpomo/pomo.py | fsimkovic/taskwarrior-pomodoro | fc867e4aa7fe7ed1f94566cd27b68edd6b2370a0 | [
"MIT"
] | null | null | null | taskwpomo/pomo.py | fsimkovic/taskwarrior-pomodoro | fc867e4aa7fe7ed1f94566cd27b68edd6b2370a0 | [
"MIT"
] | null | null | null | taskwpomo/pomo.py | fsimkovic/taskwarrior-pomodoro | fc867e4aa7fe7ed1f94566cd27b68edd6b2370a0 | [
"MIT"
] | null | null | null | __author__ = 'Felix Simkovic'
__date__ = '2019-05-11'
__license__ = 'MIT License'
import datetime
import enum
import logging
import time
from taskwpomo.misc import log_call
log = logging.getLogger(__name__)
@enum.unique
class PomodoroTimes(enum.Enum):
LONG_BREAK = 1_200
SHORT_BREAK = 300
WORK = 1_500
... | 20.567568 | 78 | 0.633377 |
30246f3b98e1db44853e0a65c158924504c22786 | 1,797 | py | Python | musictaxonomy/spotify/client.py | akurihara/music-taxonomy | 53eb2112e67b3ec9591411bc8117463af760adf8 | [
"MIT"
] | 3 | 2019-05-06T04:10:47.000Z | 2020-02-20T01:26:32.000Z | musictaxonomy/spotify/client.py | akurihara/music-taxonomy | 53eb2112e67b3ec9591411bc8117463af760adf8 | [
"MIT"
] | 3 | 2020-02-06T01:52:49.000Z | 2022-02-12T07:41:24.000Z | musictaxonomy/spotify/client.py | akurihara/musictaxonomy | 53eb2112e67b3ec9591411bc8117463af760adf8 | [
"MIT"
] | null | null | null | import json
import urllib.parse
from typing import Dict
from musictaxonomy.spotify import constants as spotify_constants
from settings import SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET
from tornado.httpclient import AsyncHTTPClient
__all__ = [
"get_access_token",
"get_current_user_profile",
"get_top_artists... | 31.526316 | 84 | 0.728436 |
347d22c7d3534952ea871c3f76371d339bd0b66f | 1,130 | py | Python | examples/example_2.py | normanrichardson/StructGlassCalcs | 0862560d926d7a6bc44c4762de53c516e01ed782 | [
"MIT"
] | 9 | 2021-12-21T16:15:41.000Z | 2022-02-27T05:16:54.000Z | examples/example_2.py | normanrichardson/StructGlassCalcs | 0862560d926d7a6bc44c4762de53c516e01ed782 | [
"MIT"
] | null | null | null | examples/example_2.py | normanrichardson/StructGlassCalcs | 0862560d926d7a6bc44c4762de53c516e01ed782 | [
"MIT"
] | 1 | 2021-12-24T05:31:28.000Z | 2021-12-24T05:31:28.000Z | # Example from NCSEA Engineering Structural Glass Design Guide chapter 8
# example 3
import structuralglass.equiv_thick_models as et
import structuralglass.layers as lay
from structuralglass import Q_
# Plate dimensions
a = Q_(1, "m")
t1nom = Q_(12, "mm")
t2nom = Q_(12, "mm")
# Interlayer PVB at 30degC for 1 day loa... | 34.242424 | 76 | 0.707965 |
cac63251f48982c5bdf461150e409c22a86d5ae1 | 27,743 | py | Python | src/pybreaker.py | mnguyenngo/pybreaker | 5c632a9278bfecbe96f820976551c081bb18baab | [
"BSD-3-Clause"
] | null | null | null | src/pybreaker.py | mnguyenngo/pybreaker | 5c632a9278bfecbe96f820976551c081bb18baab | [
"BSD-3-Clause"
] | null | null | null | src/pybreaker.py | mnguyenngo/pybreaker | 5c632a9278bfecbe96f820976551c081bb18baab | [
"BSD-3-Clause"
] | null | null | null | #-*- coding:utf-8 -*-
"""
Threadsafe pure-Python implementation of the Circuit Breaker pattern, described
by Michael T. Nygard in his book 'Release It!'.
For more information on this and other patterns and best practices, buy the
book at http://pragprog.com/titles/mnee/release-it
"""
import types
import time
import ... | 31.242117 | 117 | 0.610172 |
199bb9f42eaacfcfa748753210c8f6818db8735d | 607 | py | Python | pythod-demo/jichu/dict.py | gongchangwangpi/zb-demo | 8052860e7e3f4e3e9d9b1ce6e15747e574dd900a | [
"Apache-2.0"
] | 1 | 2018-05-11T04:30:05.000Z | 2018-05-11T04:30:05.000Z | pythod-demo/jichu/dict.py | gongchangwangpi/zb-demo | 8052860e7e3f4e3e9d9b1ce6e15747e574dd900a | [
"Apache-2.0"
] | 11 | 2020-06-08T09:52:52.000Z | 2022-02-26T00:46:25.000Z | pythod-demo/jichu/dict.py | 363230482/zb-demo | 8052860e7e3f4e3e9d9b1ce6e15747e574dd900a | [
"Apache-2.0"
] | null | null | null | #-*- coding = utf-8 -*-
# @author zhangbo
# @date 2021/3/27 18:59:20
zhang = {"name":"zhangsan", "age":18}
print(zhang)
print(zhang["name"])
# 直接访问不存在的key,报错,需要通过get访问
# print(zhang["sex"])
# 不存在,返回 None
print(zhang.get("sex"))
# 设置默认值
print(zhang.get("sex", "M"))
# 删除key,并返回指定key的value
# print(zhang.pop("age"))
# pr... | 14.804878 | 40 | 0.650741 |
6e48ab79227bb2c132a8f23588d320666a62293e | 2,550 | py | Python | lib/solutions/CHK/checkout.py | DPNT-Sourcecode/CHK-apll01 | cefd58c85575e8c775822837d8b445345d82e687 | [
"Apache-2.0"
] | null | null | null | lib/solutions/CHK/checkout.py | DPNT-Sourcecode/CHK-apll01 | cefd58c85575e8c775822837d8b445345d82e687 | [
"Apache-2.0"
] | null | null | null | lib/solutions/CHK/checkout.py | DPNT-Sourcecode/CHK-apll01 | cefd58c85575e8c775822837d8b445345d82e687 | [
"Apache-2.0"
] | null | null | null | import operator
class Checkout(object):
def __init__(self, shop):
self.shop = shop
self.items = dict()
def add_item(self, sku):
if sku in self.items:
self.items[sku] += 1
else:
self.items[sku] = 1
def remove_item(self, sku):
if sku in self.i... | 34.931507 | 119 | 0.488627 |
b1565868a42aa52eab226672cba375196a69658a | 8,276 | py | Python | modules/models/lseg_blocks.py | whiteking64/lang-seg | 9d063b126f1b64e38ddb20cc75fc74435bfdcbd3 | [
"MIT"
] | 202 | 2022-01-11T02:34:40.000Z | 2022-03-31T23:12:11.000Z | modules/models/lseg_blocks.py | whiteking64/lang-seg | 9d063b126f1b64e38ddb20cc75fc74435bfdcbd3 | [
"MIT"
] | 17 | 2022-01-11T19:51:03.000Z | 2022-03-30T03:14:37.000Z | modules/models/lseg_blocks.py | whiteking64/lang-seg | 9d063b126f1b64e38ddb20cc75fc74435bfdcbd3 | [
"MIT"
] | 19 | 2022-01-11T10:02:31.000Z | 2022-03-23T12:41:36.000Z | import torch
import torch.nn as nn
from .lseg_vit import (
_make_pretrained_clip_vitl16_384,
_make_pretrained_clip_vitb32_384,
_make_pretrained_clipRN50x16_vitl16_384,
forward_vit,
)
def _make_encoder(
backbone,
features,
use_pretrained=True,
groups=1,
expand=False,
exportable... | 22.988889 | 85 | 0.549903 |
a952b2cfcc61ff66e35b9ebf64af0c42944ee31c | 9,786 | py | Python | posts/models/post.py | lobotomoe/vas3k.club | 21786cc28072a816ca70b5b84247e8e63bd18b55 | [
"MIT"
] | null | null | null | posts/models/post.py | lobotomoe/vas3k.club | 21786cc28072a816ca70b5b84247e8e63bd18b55 | [
"MIT"
] | null | null | null | posts/models/post.py | lobotomoe/vas3k.club | 21786cc28072a816ca70b5b84247e8e63bd18b55 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from uuid import uuid4
from django.conf import settings
from django.db import models
from django.db.models import F
from django.template.defaultfilters import truncatechars
from django.urls import reverse
from django.utils.html import strip_tags
from simple_history.models impor... | 34.457746 | 116 | 0.62385 |
2c98a147fd5afe043edea802e0dbbe24093d2fa5 | 407 | py | Python | tests/fixtures/labels.py | ReeceHoffmann/virtool | f9befad060fe16fa29fb80124e674ac5a9c4f538 | [
"MIT"
] | 39 | 2016-10-31T23:28:59.000Z | 2022-01-15T00:00:42.000Z | tests/fixtures/labels.py | ReeceHoffmann/virtool | f9befad060fe16fa29fb80124e674ac5a9c4f538 | [
"MIT"
] | 1,690 | 2017-02-07T23:39:48.000Z | 2022-03-31T22:30:44.000Z | tests/fixtures/labels.py | ReeceHoffmann/virtool | f9befad060fe16fa29fb80124e674ac5a9c4f538 | [
"MIT"
] | 25 | 2017-02-08T18:25:31.000Z | 2021-09-20T22:55:25.000Z | import pytest
from sqlalchemy.ext.asyncio import AsyncSession
from virtool.labels.models import Label
@pytest.fixture
async def test_labels(pg):
label_1 = Label(id=1, name="Legacy")
label_2 = Label(id=2, name="Incomplete")
label_3 = Label(id=3, name="Complete")
async with AsyncSession(pg) as session... | 23.941176 | 52 | 0.707617 |
00483d027e7c22bb820c190c7fd22c5bb32b912f | 9,776 | py | Python | porcupine/plugins/run/dialog.py | Mannuel25/porcupine | c55969ea78249107d58e2d75e687f7c04b7e4b7b | [
"MIT"
] | null | null | null | porcupine/plugins/run/dialog.py | Mannuel25/porcupine | c55969ea78249107d58e2d75e687f7c04b7e4b7b | [
"MIT"
] | null | null | null | porcupine/plugins/run/dialog.py | Mannuel25/porcupine | c55969ea78249107d58e2d75e687f7c04b7e4b7b | [
"MIT"
] | null | null | null | from __future__ import annotations
import sys
import tkinter
from pathlib import Path
from tkinter import ttk
from typing import Callable, Generic, TypeVar
from porcupine import get_main_window, tabs, textutils, utils
from . import common, history
T = TypeVar("T")
class _FormattingEntryAndLabels(Generic[T]):
... | 38.948207 | 100 | 0.634002 |
1ec2d9077e8b4347616fb131ecc49188d7718565 | 5,935 | py | Python | src/sas/sasgui/guiframe/config.py | andyfaff/sasview | c00a797ab9c4ddc60f0fa8a64ae8a2067c225921 | [
"BSD-3-Clause"
] | null | null | null | src/sas/sasgui/guiframe/config.py | andyfaff/sasview | c00a797ab9c4ddc60f0fa8a64ae8a2067c225921 | [
"BSD-3-Clause"
] | null | null | null | src/sas/sasgui/guiframe/config.py | andyfaff/sasview | c00a797ab9c4ddc60f0fa8a64ae8a2067c225921 | [
"BSD-3-Clause"
] | null | null | null | """
Application settings
"""
from __future__ import print_function
import time
import os
from sas.sasgui.guiframe.gui_style import GUIFRAME
import sas.sasview
import logging
logger = logging.getLogger(__name__)
# Version of the application
__appname__ = "SasView"
__version__ = sas.sasview.__version__
__build__ ... | 37.09375 | 482 | 0.739511 |
43250ce2b0d9eaaef22964d4c43f1efbd33fc286 | 1,362 | py | Python | SystemTests/src/python/LifeCycleAnalysis/LifeCyclePlots/HistoManager.py | vkuznet/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 8 | 2015-08-14T04:01:32.000Z | 2021-06-03T00:56:42.000Z | SystemTests/src/python/LifeCycleAnalysis/LifeCyclePlots/HistoManager.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 162 | 2015-01-07T21:34:47.000Z | 2021-10-13T09:42:41.000Z | SystemTests/src/python/LifeCycleAnalysis/LifeCyclePlots/HistoManager.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 16 | 2015-01-22T15:27:29.000Z | 2021-04-28T09:23:28.000Z | from itertools import chain
class HistoManager(object):
def __init__(self, histos=[]):
###need ordering, therefore dict isn't used here
self._histos = list(histos)
self._histos_names = list()
for histo in histos:
self._histos_names = histo.name
def __add__(self, oth... | 29.608696 | 89 | 0.623348 |
752df58e2b40cdd18a33f9d1cbc598fb4765a729 | 4,717 | py | Python | src/prechecks/frr.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | null | null | null | src/prechecks/frr.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | 314 | 2020-02-26T12:37:17.000Z | 2021-08-02T00:32:32.000Z | src/prechecks/frr.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | 2 | 2020-11-12T16:07:48.000Z | 2020-11-16T09:14:48.000Z | # Functional Redundancy Resolution
from math import pi, ceil
from typing import List
import numpy as np
from src.kinematics.forward_kinematics import axang2tform
from src.kinematics.forward_kinematics import geometric_jacobian, right_generalized_inverse_jacobian, forward_kinematics
from src.kinematics.joints import B... | 37.436508 | 120 | 0.662073 |
4d364dc4a1f4ac80f71f0d13b434ccc489641929 | 7,535 | py | Python | ssd_liverdet/models/ssd_multiphase.py | L0SG/Liver_segmentation | 178b2367cf606ba7d704e96f855389be4c1abd14 | [
"MIT"
] | 34 | 2019-02-04T07:35:11.000Z | 2022-02-08T07:10:57.000Z | ssd_liverdet/models/ssd_multiphase.py | L0SG/Liver_segmentation | 178b2367cf606ba7d704e96f855389be4c1abd14 | [
"MIT"
] | null | null | null | ssd_liverdet/models/ssd_multiphase.py | L0SG/Liver_segmentation | 178b2367cf606ba7d704e96f855389be4c1abd14 | [
"MIT"
] | 8 | 2019-03-28T04:07:25.000Z | 2021-04-19T18:18:22.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import v2
import os
class SSD(nn.Module):
"""Single Shot Multibox Architecture
The network is composed of a base VGG network followed by the
added multibox conv layers. Eac... | 36.052632 | 96 | 0.560053 |
1e8fabb1ab203e367fd6092cdf4aa674d44950f4 | 762 | py | Python | test/nn/conv/test_pgat_conv.py | ecom-research/pytorch_geometric | bca73a6f0808cfcf7133548edfbb5628ad6e49fa | [
"MIT"
] | 1 | 2021-01-17T18:39:44.000Z | 2021-01-17T18:39:44.000Z | test/nn/conv/test_pgat_conv.py | ecom-research/pytorch_geometric | bca73a6f0808cfcf7133548edfbb5628ad6e49fa | [
"MIT"
] | null | null | null | test/nn/conv/test_pgat_conv.py | ecom-research/pytorch_geometric | bca73a6f0808cfcf7133548edfbb5628ad6e49fa | [
"MIT"
] | 2 | 2019-11-07T14:20:29.000Z | 2020-05-01T19:03:35.000Z | import torch
from torch_geometric.nn import PGATConv
def test_pgat_conv():
in_channels, out_channels = (16, 32)
edge_index = torch.tensor(
[
[0, 0, 0, 1, 2, 3],
[1, 2, 3, 0, 0, 0],
[3, 1, 2, 3, 3, 1]
]
)
num_nodes = edge_index.max().item() + 1
x ... | 29.307692 | 74 | 0.612861 |
38885d2c2c15b204bf3158d0b648389af7b935bc | 680 | py | Python | 2015/17/eggnog.py | lvaughn/advent | ff3f727b8db1fd9b2a04aad5dcda9a6c8d1c271e | [
"CC0-1.0"
] | null | null | null | 2015/17/eggnog.py | lvaughn/advent | ff3f727b8db1fd9b2a04aad5dcda9a6c8d1c271e | [
"CC0-1.0"
] | null | null | null | 2015/17/eggnog.py | lvaughn/advent | ff3f727b8db1fd9b2a04aad5dcda9a6c8d1c271e | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
amount = 150
# Load up the containers
with open('input.txt', 'r') as f:
containers = [int(l) for l in f]
memo_cache = {}
def n_combos(remaining, starting_loc):
if remaining == 0:
return 1
assert remaining > 0
if starting_loc == len(containers):
return 0
key... | 24.285714 | 86 | 0.635294 |
666dc7b108f7a1cd6cf7d8bc88d0e3e949446aaf | 242 | py | Python | back-end/test.py | PiperLiu/five-in-a-row-AI | 5bed666d483d89f9ceec348a29e6b2601dc8631f | [
"MIT"
] | null | null | null | back-end/test.py | PiperLiu/five-in-a-row-AI | 5bed666d483d89f9ceec348a29e6b2601dc8631f | [
"MIT"
] | null | null | null | back-end/test.py | PiperLiu/five-in-a-row-AI | 5bed666d483d89f9ceec348a29e6b2601dc8631f | [
"MIT"
] | null | null | null | import requests
proxies = {"http":None,"https":None}
response = requests.post(
'https://aichess.piperliu.xyz',
json={'player': 1, 'last_move': 20, 'states': {30: 1, 20: 2}},
# verify=False
proxies=proxies
)
print(response)
| 18.615385 | 66 | 0.632231 |
d5fd2a262158ded1437efd755a67eb79ffcb1da2 | 105 | py | Python | bis/apps/gepiandashboard/apps.py | AgustinMachiavello/business-incubation-system | 983e1308697771570891568f99d1b8ba74441d32 | [
"MIT"
] | 2 | 2021-03-03T16:16:42.000Z | 2021-03-08T22:43:10.000Z | bis/apps/gepiandashboard/apps.py | AgustinMachiavello/business-incubation-system | 983e1308697771570891568f99d1b8ba74441d32 | [
"MIT"
] | null | null | null | bis/apps/gepiandashboard/apps.py | AgustinMachiavello/business-incubation-system | 983e1308697771570891568f99d1b8ba74441d32 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class GepiandashboardConfig(AppConfig):
name = 'gepiandashboard'
| 17.5 | 39 | 0.790476 |
b02a6acb3707e641df0fdebebb13e6cbbcb7b5a0 | 7,953 | py | Python | tests/test_expression.py | buhanec/super-expressive-py | a19e8513492cf78ecd6f8ce741b3378e00c4b68a | [
"MIT"
] | null | null | null | tests/test_expression.py | buhanec/super-expressive-py | a19e8513492cf78ecd6f8ce741b3378e00c4b68a | [
"MIT"
] | null | null | null | tests/test_expression.py | buhanec/super-expressive-py | a19e8513492cf78ecd6f8ce741b3378e00c4b68a | [
"MIT"
] | null | null | null | """Test core expression functionality."""
import re
from typing import Optional
import unicodedata
from hypothesis import example, given
from hypothesis.strategies import integers, sampled_from
import pytest
from superexpressive import SuperExpressive
from tests.const import NAMED_UNICODE
def test_empty() -> None:... | 27.143345 | 75 | 0.562681 |
840e18c1feaf615a9da8bc0c05db94aef62fcfa8 | 867 | py | Python | 03_CNNs/03_Deep_NNs/quiz_03.py | ivanbgd/Udacity-Deep-Learning-ND101 | 05f8fe15654f51e4d770af39ee0195f22a84e65c | [
"MIT"
] | 1 | 2017-12-06T23:23:26.000Z | 2017-12-06T23:23:26.000Z | 03_CNNs/03_Deep_NNs/quiz_03.py | ivanbgd/Udacity-Deep-Learning-ND101 | 05f8fe15654f51e4d770af39ee0195f22a84e65c | [
"MIT"
] | null | null | null | 03_CNNs/03_Deep_NNs/quiz_03.py | ivanbgd/Udacity-Deep-Learning-ND101 | 05f8fe15654f51e4d770af39ee0195f22a84e65c | [
"MIT"
] | 2 | 2019-09-02T05:27:35.000Z | 2020-03-28T18:27:07.000Z | # Solution is available in the other "solution.py" tab
import tensorflow as tf
output = None
hidden_layer_weights = [
[0.1, 0.2, 0.4],
[0.4, 0.6, 0.6],
[0.5, 0.9, 0.1],
[0.8, 0.2, 0.8]]
out_weights = [
[0.1, 0.6],
[0.2, 0.1],
[0.7, 0.9]]
# Weights and biases
weights = [
tf.Variable(hid... | 24.083333 | 98 | 0.61707 |
21ac7d8b5c408f797f0ade7951d7982a051766b7 | 816 | py | Python | echo_lv/take_contour.py | zvvzuzin/us_left_ventricle | 0cb98bcab0e1405ea7aec8f20a15f8103494a6d2 | [
"MIT"
] | null | null | null | echo_lv/take_contour.py | zvvzuzin/us_left_ventricle | 0cb98bcab0e1405ea7aec8f20a15f8103494a6d2 | [
"MIT"
] | null | null | null | echo_lv/take_contour.py | zvvzuzin/us_left_ventricle | 0cb98bcab0e1405ea7aec8f20a15f8103494a6d2 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import lib_contour_LV as lib
#Чтение изображения с контуром
video_with_contour = cv2.VideoCapture('N120131007162257079.avi')
ret, frame = video_with_contour.read()
video_with_contour.release()
image_contour = lib.get_contour_image(frame)
cv2.imshow('image',image_contour)
#Чтение изобр... | 28.137931 | 68 | 0.764706 |
548fd07d9c8e9572a03c762de72f8db415fd11e4 | 1,666 | py | Python | setup.py | niwinz/django-sites | db0ede952273d587aa3509fe95c75e6c6827b650 | [
"BSD-3-Clause"
] | 15 | 2015-10-20T20:20:07.000Z | 2021-12-07T17:22:51.000Z | setup.py | CuriousLearner/django-sites | db0ede952273d587aa3509fe95c75e6c6827b650 | [
"BSD-3-Clause"
] | 12 | 2015-12-03T07:18:11.000Z | 2021-12-07T11:34:45.000Z | setup.py | niwinz/django-sites | db0ede952273d587aa3509fe95c75e6c6827b650 | [
"BSD-3-Clause"
] | 7 | 2015-12-02T14:55:30.000Z | 2021-07-15T14:24:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
README = readme.read()
INSTALL_REQUIRES = [
"django >=1.4",
]
if sys.version_info < (2, 7):
INSTALL_REQUIRES.append("importlib")
s... | 28.724138 | 75 | 0.584034 |
89d17660e9d8dfd8c1c8dc166aa1d07cff09df11 | 1,878 | py | Python | sciml_bench/benchmarks/em_denoise/data_loader.py | stfcsciml/sciml-benchmarks | 636aefb0089f79f57be3025b3acb902571117e6f | [
"MIT"
] | null | null | null | sciml_bench/benchmarks/em_denoise/data_loader.py | stfcsciml/sciml-benchmarks | 636aefb0089f79f57be3025b3acb902571117e6f | [
"MIT"
] | 6 | 2021-05-21T16:45:19.000Z | 2022-02-10T02:08:40.000Z | sciml_bench/benchmarks/em_denoise/data_loader.py | stfc-sciml/sciml-benchmarks-prerelease | 636aefb0089f79f57be3025b3acb902571117e6f | [
"MIT"
] | null | null | null | import h5py
import tensorflow as tf
import numpy as np
from pathlib import Path
import horovod.tensorflow as hvd
from sciml_bench.core.data_loader import DataLoader
from sciml_bench.benchmarks.em_denoise.constants import IMG_SIZE
class EMGrapheneDataset(DataLoader):
def __init__(self, data_dir, seed=None, batch... | 34.777778 | 71 | 0.565495 |
29f83c08118b9b5236457f3eeedc60f0d11661e6 | 2,647 | py | Python | pypiper/stage.py | fhalbritter/pypiper | 67908f2ee5f51fa5fdddb67eb6d7891aefeeda6a | [
"BSD-2-Clause"
] | 24 | 2017-12-15T13:48:59.000Z | 2022-01-30T19:07:21.000Z | pypiper/stage.py | fhalbritter/pypiper | 67908f2ee5f51fa5fdddb67eb6d7891aefeeda6a | [
"BSD-2-Clause"
] | 117 | 2017-12-19T20:27:59.000Z | 2022-01-25T22:30:25.000Z | pypiper/stage.py | vreuter/pypiper | 67908f2ee5f51fa5fdddb67eb6d7891aefeeda6a | [
"BSD-2-Clause"
] | 7 | 2017-12-14T16:59:09.000Z | 2020-01-08T12:30:17.000Z | """ Conceptualize a pipeline processing phase/stage. """
import copy
from .utils import translate_stage_name
__author__ = "Vince Reuter"
__email__ = "vreuter@virginia.edu"
__all__ = ["Stage"]
class Stage(object):
"""
Single stage/phase of a pipeline; a logical processing "unit". A stage is a
collect... | 30.425287 | 79 | 0.608991 |
097867d51213605f154a0d1cfd6daaafa9386604 | 2,651 | py | Python | Bot/cogs/members.py | AcidSkull/DiscordPythonBot | 91940b3a4fc2a043407bc1a8ad1fcd70faa6ef30 | [
"MIT"
] | null | null | null | Bot/cogs/members.py | AcidSkull/DiscordPythonBot | 91940b3a4fc2a043407bc1a8ad1fcd70faa6ef30 | [
"MIT"
] | null | null | null | Bot/cogs/members.py | AcidSkull/DiscordPythonBot | 91940b3a4fc2a043407bc1a8ad1fcd70faa6ef30 | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
class Members(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('\033[92m' + 'Bot is ready!' + '\033[0m')
await self.client.change_presence(activity=discord.Game('... | 39.567164 | 149 | 0.655224 |
816f7b6b7185cb13199d3edb926a3387c41075a8 | 5,671 | py | Python | src/ephemeris/sleep.py | cat-bro/ephemeris | 248ab13f846ec996a655bc02c5855291b45c7384 | [
"CC-BY-3.0"
] | 23 | 2016-06-15T18:34:44.000Z | 2021-09-06T00:30:38.000Z | src/ephemeris/sleep.py | cat-bro/ephemeris | 248ab13f846ec996a655bc02c5855291b45c7384 | [
"CC-BY-3.0"
] | 152 | 2016-06-15T18:58:00.000Z | 2022-03-23T08:45:59.000Z | src/ephemeris/sleep.py | cat-bro/ephemeris | 248ab13f846ec996a655bc02c5855291b45c7384 | [
"CC-BY-3.0"
] | 33 | 2016-06-16T13:08:29.000Z | 2021-02-12T23:27:33.000Z | #!/usr/bin/env python
'''Utility to do a blocking sleep until a Galaxy instance is responsive.
This is useful in docker images, in RUN steps, where one needs to wait
for a currently starting Galaxy to be alive, before API requests can be
made successfully.
The script functions by making repeated requests to
``http(s):/... | 35.44375 | 111 | 0.575913 |
35de0c48d003f33bf03969d56d7d469491243f3f | 81,945 | py | Python | src/azure-cli/azure/cli/command_modules/storage/_help.py | toki95/azure-cli | a221f49b9af6cf889cde20bbe4b42956900acd37 | [
"MIT"
] | 1 | 2021-02-02T13:28:03.000Z | 2021-02-02T13:28:03.000Z | src/azure-cli/azure/cli/command_modules/storage/_help.py | toki95/azure-cli | a221f49b9af6cf889cde20bbe4b42956900acd37 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/storage/_help.py | toki95/azure-cli | a221f49b9af6cf889cde20bbe4b42956900acd37 | [
"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.
# -----------------------------------------------------... | 51.343985 | 417 | 0.73326 |
685daef993301366508bd25931ffcc10c76e315a | 2,038 | py | Python | app/models/movie.py | SonGokussj4/fast-api-excercise | 15ae21fd2dba7cbf6bf42a2beee52a379e66c847 | [
"MIT"
] | null | null | null | app/models/movie.py | SonGokussj4/fast-api-excercise | 15ae21fd2dba7cbf6bf42a2beee52a379e66c847 | [
"MIT"
] | null | null | null | app/models/movie.py | SonGokussj4/fast-api-excercise | 15ae21fd2dba7cbf6bf42a2beee52a379e66c847 | [
"MIT"
] | null | null | null | from sqlalchemy import Integer, String, Column, Boolean, Text, Unicode, DateTime, JSON
from sqlalchemy.orm import relationship
from app.db.base_class import Base
class Movie(Base):
Id = Column(Integer, primary_key=True)
Url = Column(Unicode(255), unique=True, nullable=False)
Title = Column(Unicode(255), u... | 39.960784 | 86 | 0.672228 |
22eb8dcc6741b8a0aa3b15760eede1a5383a4744 | 1,049 | py | Python | pycnal_toolbox/setup.py | ESMG/PyCNAL_legacy | a4f6547bce872068a5bb5751231017bc3e4a4503 | [
"BSD-3-Clause"
] | null | null | null | pycnal_toolbox/setup.py | ESMG/PyCNAL_legacy | a4f6547bce872068a5bb5751231017bc3e4a4503 | [
"BSD-3-Clause"
] | 3 | 2018-01-23T23:23:24.000Z | 2018-02-07T22:37:28.000Z | pycnal_toolbox/setup.py | ESMG/PyCNAL_legacy | a4f6547bce872068a5bb5751231017bc3e4a4503 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
pycnal_toolbox is a suite of tools for working with ROMS.
Requires:
pycnal (https://github.com/ESMG/PyCNAL)
Contains:
many things...
"""
doclines = __doc__.split("\n")
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
... | 27.605263 | 60 | 0.621544 |
1cfbf45a24d0927b13fa08e409171b9e672d7c0e | 1,684 | py | Python | homeassistant/components/automation/template.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2016-07-14T05:20:54.000Z | 2016-07-14T05:20:54.000Z | homeassistant/components/automation/template.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | homeassistant/components/automation/template.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2018-11-22T13:55:23.000Z | 2018-11-22T13:55:23.000Z | """
Offer template automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#template-trigger
"""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_VALUE_TEMPLATE, CONF_PLATFORM, MATCH_ALL)
fro... | 31.185185 | 78 | 0.685273 |
b90d3103dce5b8ebac6c941be7301ecfb360a91a | 8,571 | py | Python | containerregistry/client/docker_creds_.py | suomitekai/fairing | 9ca6a1138529b3f0b21979d62c7cb1f303bc52e0 | [
"Apache-2.0"
] | 334 | 2018-09-03T23:10:02.000Z | 2022-03-07T23:12:24.000Z | containerregistry/client/docker_creds_.py | suomitekai/fairing | 9ca6a1138529b3f0b21979d62c7cb1f303bc52e0 | [
"Apache-2.0"
] | 562 | 2018-09-03T21:33:42.000Z | 2022-03-29T12:47:43.000Z | containerregistry/client/docker_creds_.py | suomitekai/fairing | 9ca6a1138529b3f0b21979d62c7cb1f303bc52e0 | [
"Apache-2.0"
] | 160 | 2018-11-06T17:55:32.000Z | 2022-02-15T09:59:10.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 31.054348 | 80 | 0.685101 |
b32004ed72f631ed8cd1b0ad08bf0e21f28ff0d0 | 17,205 | py | Python | gitlabfs/resolver.py | Overv/gitlabfs | 802f71abb671c8ac69bd6584800c4f151eea0bdf | [
"MIT"
] | 18 | 2019-07-14T22:06:39.000Z | 2022-01-22T16:52:38.000Z | gitlabfs/resolver.py | Overv/gitlabfs | 802f71abb671c8ac69bd6584800c4f151eea0bdf | [
"MIT"
] | 4 | 2020-03-24T17:40:50.000Z | 2021-06-02T00:09:25.000Z | gitlabfs/resolver.py | Overv/gitlabfs | 802f71abb671c8ac69bd6584800c4f151eea0bdf | [
"MIT"
] | 1 | 2021-03-24T17:10:56.000Z | 2021-03-24T17:10:56.000Z | # -*- coding: utf-8 -*-
"""File system abstraction of GitLab.
This module contains the implementation of abstracting GitLab as a file system
hierarchy.
"""
from enum import Enum
import os.path
import pathlib
import stat
import time
import gitlab
import iso8601
def create_file_attributes(permissions, time, size):
... | 31.112116 | 121 | 0.57925 |
5ef83b137175b631cb58e4fea8bd023f395b5de3 | 12,226 | py | Python | forml/flow/graph/node.py | mpearmain/forml | 3d69d27b1a64a237c739d2795512b6f9296d3874 | [
"Apache-2.0"
] | null | null | null | forml/flow/graph/node.py | mpearmain/forml | 3d69d27b1a64a237c739d2795512b6f9296d3874 | [
"Apache-2.0"
] | null | null | null | forml/flow/graph/node.py | mpearmain/forml | 3d69d27b1a64a237c739d2795512b6f9296d3874 | [
"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... | 31.673575 | 120 | 0.62089 |
278200888f4e8f753b778826d4f531246c06576c | 596 | py | Python | Week_3/EcommerceProject/ecommerce/views.py | girisagar46/DjangoTrainingClass | 373f4151b2ee46ea8f76ffa344603014e87d9764 | [
"MIT"
] | null | null | null | Week_3/EcommerceProject/ecommerce/views.py | girisagar46/DjangoTrainingClass | 373f4151b2ee46ea8f76ffa344603014e87d9764 | [
"MIT"
] | null | null | null | Week_3/EcommerceProject/ecommerce/views.py | girisagar46/DjangoTrainingClass | 373f4151b2ee46ea8f76ffa344603014e87d9764 | [
"MIT"
] | null | null | null | from django.utils import timezone
from django.shortcuts import render
from django.views.generic import ListView
from .models import Product
# def index(request):
# products = Product.objects.all()
# ctx = {
# "products": products
# }
# return render(request, 'index.html', context=ctx)
clas... | 23.84 | 77 | 0.644295 |
e87ac00b1c9872eea73d278e0b31aa2e99281609 | 51,981 | py | Python | kivymd/uix/textfield/textfield.py | KivyAcademy/KivyMD | ab3966914ff5f764b210d8ba44ec606b2db19490 | [
"MIT"
] | null | null | null | kivymd/uix/textfield/textfield.py | KivyAcademy/KivyMD | ab3966914ff5f764b210d8ba44ec606b2db19490 | [
"MIT"
] | null | null | null | kivymd/uix/textfield/textfield.py | KivyAcademy/KivyMD | ab3966914ff5f764b210d8ba44ec606b2db19490 | [
"MIT"
] | null | null | null | """
Components/TextField
====================
.. seealso::
`Material Design spec, Text fields <https://material.io/components/text-fields>`_
.. rubric:: Text fields let users enter and edit text.
.. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/text-fields.png
:align: center... | 31.753818 | 131 | 0.618995 |
4b8b37e60f289027f69fd1dd6aebac3326fc93bd | 3,563 | py | Python | pvops/timeseries/models/iec.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 2 | 2021-04-21T23:42:36.000Z | 2021-05-06T16:18:48.000Z | pvops/timeseries/models/iec.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 13 | 2021-03-16T17:52:31.000Z | 2021-05-20T21:19:56.000Z | pvops/timeseries/models/iec.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 4 | 2021-05-26T13:49:21.000Z | 2021-12-17T16:35:06.000Z | import numpy as np
def iec_calc(prod_df, prod_col_dict, meta_df, meta_col_dict,
gi_ref=1000.0):
"""
Calculates expected energy using measured irradiance
based on IEC calculations
Parameters
----------
prod_df: DataFrame
A data frame corresponding to the production data
... | 32.688073 | 88 | 0.63542 |
70ee6c3441c5064484ae81fb171d8e2a9cc96ec5 | 519 | py | Python | eng/tox/mypy_hard_failure_packages.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | eng/tox/mypy_hard_failure_packages.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | eng/tox/mypy_hard_failure_packages.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 37.071429 | 94 | 0.481696 |
9fd25b51fda9aee6ba12f3e8db5b2e2c87209282 | 965 | py | Python | relative_dominance.py | limanqing/crop_climate | bfc50fbf57ce3a96ba7d29de53a76fc7a1dc2d2f | [
"MIT"
] | null | null | null | relative_dominance.py | limanqing/crop_climate | bfc50fbf57ce3a96ba7d29de53a76fc7a1dc2d2f | [
"MIT"
] | null | null | null | relative_dominance.py | limanqing/crop_climate | bfc50fbf57ce3a96ba7d29de53a76fc7a1dc2d2f | [
"MIT"
] | null | null | null | #coding=utf-8
import pandas as pd
import glob
import numpy as np
if __name__ == '__main__':
base_dir = r'F:\crop-climate\maize&cru_scale\360\polyfit-additive\*.csv'
filelist = glob.glob(base_dir)
sum1=0
sum2=0
sum3=0
num=0
pre_list=[]
tmp_list=[]
maize_list=[]
... | 28.382353 | 106 | 0.615544 |
1efcf9e7d79ad4971afb2e12d158b799ff72de48 | 1,787 | py | Python | model_zoo/official/cv/lenet_quant/src/lenet.py | i4oolish/mindspore | dac3be31d0f2c0a3516200f47af30980e566601b | [
"Apache-2.0"
] | 2 | 2020-08-12T16:14:40.000Z | 2020-12-04T03:05:57.000Z | model_zoo/official/cv/lenet_quant/src/lenet.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | model_zoo/official/cv/lenet_quant/src/lenet.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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 to... | 29.295082 | 78 | 0.586458 |
a99d5d54a16ad61a626c279e7a76f4640b06ae15 | 927 | py | Python | general_tools/githubshell.py | PurpleGuitar/tools | 13152bb925b568ed4d4375065ed5a7dbdeee99de | [
"MIT"
] | 6 | 2015-07-27T21:50:39.000Z | 2020-06-25T14:32:35.000Z | general_tools/githubshell.py | PurpleGuitar/tools | 13152bb925b568ed4d4375065ed5a7dbdeee99de | [
"MIT"
] | 89 | 2015-06-24T09:35:40.000Z | 2022-02-13T14:40:31.000Z | general_tools/githubshell.py | PurpleGuitar/tools | 13152bb925b568ed4d4375065ed5a7dbdeee99de | [
"MIT"
] | 12 | 2015-07-13T17:31:04.000Z | 2021-08-06T06:50:21.000Z | #!/usr/bin/env python2
# -*- coding: utf8 -*-
#
# Copyright (c) 2014 unfoldingWord
# http://creativecommons.org/licenses/MIT/
# See LICENSE file for details.
#
# Contributors:
# Jesse Griffin <jesse@distantshores.org>
#
# Requires PyGithub.
'''
This provides easy access to the PyGithub API for testing and develo... | 24.394737 | 74 | 0.676375 |
6b8d9b7f2146c24bedb6e70c4ad09576d984bde9 | 4,758 | py | Python | python/pex/proxy.py | JiveHelix/pex | d3cbe0e437e803fb4af6fe153de0cf3f61a3a6d6 | [
"MIT"
] | null | null | null | python/pex/proxy.py | JiveHelix/pex | d3cbe0e437e803fb4af6fe153de0cf3f61a3a6d6 | [
"MIT"
] | null | null | null | python/pex/proxy.py | JiveHelix/pex | d3cbe0e437e803fb4af6fe153de0cf3f61a3a6d6 | [
"MIT"
] | null | null | null | ##
# @file proxy.py
#
# @brief Implements a proxy for callable references. While similar in
# functionality to weakref.proxy, there are some fundamental differences.
#
# Wraps either a function (with weakref.ref) or a method, with
# weakref.WeakMethod, and __eq__ and __hash__ are plumbed through to the
# underlying ref... | 31.302632 | 79 | 0.643548 |
b9f03c41fdafb388b63cc71276ac46a3197da648 | 5,903 | py | Python | django-crm/accounts/views.py | MsMaddyMac/django-crm | a7a1085f1acba8c6bd10865d5c680c43adefffed | [
"MIT"
] | null | null | null | django-crm/accounts/views.py | MsMaddyMac/django-crm | a7a1085f1acba8c6bd10865d5c680c43adefffed | [
"MIT"
] | null | null | null | django-crm/accounts/views.py | MsMaddyMac/django-crm | a7a1085f1acba8c6bd10865d5c680c43adefffed | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.forms import inlineformset_factory
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import authenticate, login, logout
# flash message
from django.contrib import messages
from django.contrib.a... | 33.350282 | 192 | 0.720989 |
48c5b784bf497d4e68c71cef5851a760b7b559a9 | 8,177 | py | Python | allennlp/semparse/worlds/wikitables_variable_free_world.py | ljch2018/allennlp | 63ba3fb28897578d4798039d1713e2b7995eb753 | [
"Apache-2.0"
] | 3 | 2019-06-17T21:09:07.000Z | 2022-03-18T05:19:31.000Z | allennlp/semparse/worlds/wikitables_variable_free_world.py | ljch2018/allennlp | 63ba3fb28897578d4798039d1713e2b7995eb753 | [
"Apache-2.0"
] | null | null | null | allennlp/semparse/worlds/wikitables_variable_free_world.py | ljch2018/allennlp | 63ba3fb28897578d4798039d1713e2b7995eb753 | [
"Apache-2.0"
] | 1 | 2020-03-12T06:53:53.000Z | 2020-03-12T06:53:53.000Z | """
We store the information related to context sensitive execution of logical forms here.
We assume that the logical forms are written in the variable-free language described in the paper
'Memory Augmented Policy Optimization for Program Synthesis with Generalization' by Liang et al.
The language is the main differenc... | 48.672619 | 102 | 0.635808 |
955d7b04d4d751cd95eac392f245cc47cade437f | 12,002 | py | Python | hmi_super/training/models_64_256.py | aasensio/DeepLearning | 71838115ce93e0ca96c8314cff3f07de1d64c235 | [
"MIT"
] | null | null | null | hmi_super/training/models_64_256.py | aasensio/DeepLearning | 71838115ce93e0ca96c8314cff3f07de1d64c235 | [
"MIT"
] | null | null | null | hmi_super/training/models_64_256.py | aasensio/DeepLearning | 71838115ce93e0ca96c8314cff3f07de1d64c235 | [
"MIT"
] | null | null | null | from keras.layers import Input, Conv2D, Activation, BatchNormalization, GaussianNoise, add, UpSampling2D
from keras.models import Model
from keras.regularizers import l2
import tensorflow as tf
from keras.engine.topology import Layer
from keras.engine import InputSpec
from keras.utils import conv_utils
def spatial_ref... | 41.965035 | 141 | 0.589235 |
e9cbadfef75af60fb7c8d46c3caf868853aba72e | 1,170 | py | Python | tests/storage/cases/test_KT1Cz7TyVFvHxXpxLS57RFePrhTGisUpPhvD_babylon.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-08-11T02:31:24.000Z | 2020-08-11T02:31:24.000Z | tests/storage/cases/test_KT1Cz7TyVFvHxXpxLS57RFePrhTGisUpPhvD_babylon.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | tests/storage/cases/test_KT1Cz7TyVFvHxXpxLS57RFePrhTGisUpPhvD_babylon.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2022-03-20T19:01:00.000Z | 2022-03-20T19:01:00.000Z | from unittest import TestCase
from tests import get_data
from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson
class StorageTestKT1Cz7TyVFvHxXpxLS57RFePrhTGisUpPhvD_babylon(TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = None
... | 41.785714 | 112 | 0.757265 |
d1b3b7ab31e4cd87134da914d659376f7f3fdb0b | 12,708 | py | Python | packages/girder/girder/constants.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | null | null | null | packages/girder/girder/constants.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | null | null | null | packages/girder/girder/constants.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware Inc.
#
# 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 cop... | 35.202216 | 83 | 0.687205 |
1b313bac3505d345f0d513d2599b7c70f24e130b | 488 | py | Python | 32_TrocoCompraEmNotas.py | JBCFurtado/Python | f9cdee54b8f5f1376693efeeef9b99fa2f78469b | [
"MIT"
] | null | null | null | 32_TrocoCompraEmNotas.py | JBCFurtado/Python | f9cdee54b8f5f1376693efeeef9b99fa2f78469b | [
"MIT"
] | null | null | null | 32_TrocoCompraEmNotas.py | JBCFurtado/Python | f9cdee54b8f5f1376693efeeef9b99fa2f78469b | [
"MIT"
] | null | null | null | cedula1 = 1
cedula2 = 10
cedula3 = 50
valor_compra = int(input('Digite o valor da compra: '))
valor_dinheiro = int(input('Digite o valor do dinheiro: '))
troco = abs(valor_compra - valor_dinheiro)
troco1 = troco // cedula3
troco_resto = troco % cedula3
troco2 = troco_resto // cedula2
troco3 = troco_resto % cedula2
prin... | 32.533333 | 59 | 0.729508 |
f04a615362de17310d7cc009b4be5d46e9f64415 | 1,863 | py | Python | dc-mixer/__main__.py | paunin/docker-compose-mixer | 414e9519d38098980bb8597c2f8d74c6ddcb1c29 | [
"MIT"
] | 19 | 2016-01-14T13:55:10.000Z | 2021-01-18T12:26:21.000Z | dc-mixer/__main__.py | paunin/docker-compose-mixer | 414e9519d38098980bb8597c2f8d74c6ddcb1c29 | [
"MIT"
] | 6 | 2015-10-01T10:33:50.000Z | 2016-04-13T03:12:11.000Z | dc-mixer/__main__.py | paunin/docker-compose-mixer | 414e9519d38098980bb8597c2f8d74c6ddcb1c29 | [
"MIT"
] | 3 | 2016-02-04T15:09:24.000Z | 2016-12-20T13:16:31.000Z | import os
import sys
import getopt
import logging
from dc_mixer import DcMixer
from dc_mixer import ScopesContainer
def main(argv):
def usage():
print(
'Compile docker-compose from several docker-compose.yml files\n\n'
'Usage:\n'
' dc-mixer [options]\n\n'
... | 30.540984 | 112 | 0.520666 |
129bbc6723f775dfde08ff4c06c5418d85d4903a | 1,534 | py | Python | output/models/nist_data/atomic/base64_binary/schema_instance/nistschema_sv_iv_atomic_base64_binary_enumeration_5_xsd/nistschema_sv_iv_atomic_base64_binary_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/base64_binary/schema_instance/nistschema_sv_iv_atomic_base64_binary_enumeration_5_xsd/nistschema_sv_iv_atomic_base64_binary_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/base64_binary/schema_instance/nistschema_sv_iv_atomic_base64_binary_enumeration_5_xsd/nistschema_sv_iv_atomic_base64_binary_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-base64Binary-enumeration-5-NS"
class NistschemaSvIvAtomicBase64BinaryEnumeration5Type(Enum):
ZWNKBM_VKCN_JH_ZG9M_YMPWB3_JWC25IC3C = b"ecdnedrradofbjporpsnbsw"
ZM_JK_Z3_FT_Y2H0D_... | 49.483871 | 186 | 0.837027 |
d98a61a995dca7b8aecaca047a41aa38fc3c0c09 | 15,442 | py | Python | slack/tests/test_sansio.py | autoferrit/slack-sansio | 3b4d25e0c96745657cffe13699bf74304c74b026 | [
"MIT"
] | null | null | null | slack/tests/test_sansio.py | autoferrit/slack-sansio | 3b4d25e0c96745657cffe13699bf74304c74b026 | [
"MIT"
] | null | null | null | slack/tests/test_sansio.py | autoferrit/slack-sansio | 3b4d25e0c96745657cffe13699bf74304c74b026 | [
"MIT"
] | null | null | null | import json
import time
import logging
import mock
import pytest
from slack import sansio, methods, exceptions
class TestRequest:
def test_prepare_request(self, token):
url, body, headers = sansio.prepare_request(
methods.AUTH_TEST, {}, {}, {}, token
)
assert url == "https://s... | 37.299517 | 195 | 0.6018 |
ebb06ff0f391f5031ef0a0cb866be0985325b93d | 430 | py | Python | usr/lib/lit/games/guess.py | KittenTechnologies/littleos | cb21ece4cfc131d780c83755816a95180b2f4d82 | [
"MIT"
] | 5 | 2021-04-09T09:21:29.000Z | 2021-08-29T17:50:28.000Z | usr/lib/lit/games/guess.py | KittenTechnologies/littleos | cb21ece4cfc131d780c83755816a95180b2f4d82 | [
"MIT"
] | null | null | null | usr/lib/lit/games/guess.py | KittenTechnologies/littleos | cb21ece4cfc131d780c83755816a95180b2f4d82 | [
"MIT"
] | null | null | null | #! /bin/python3
from random import randint
number = randint(1,20)
guesses = 0
print("Guess The Number!")
print("Made by Kitten Technologies in Python 3.")
guess = int(input("I'm thinking of a number from 1 to 20. What is it? "))
while number != guess:
if guess > number:
print("Too high!")
else:
print("Too small!"... | 26.875 | 73 | 0.676744 |
aeb0d00b448ac40894dd6b55e5760abd0b47a217 | 8,574 | py | Python | pyDRESCALk/data_io.py | lanl/pyDRESCALk | 25af3796442e5ec87fb54caa4344e8871a2abd15 | [
"BSD-3-Clause"
] | 2 | 2021-12-04T05:20:13.000Z | 2021-12-06T17:30:28.000Z | pyDRESCALk/data_io.py | lanl/pyDRESCALk | 25af3796442e5ec87fb54caa4344e8871a2abd15 | [
"BSD-3-Clause"
] | null | null | null | pyDRESCALk/data_io.py | lanl/pyDRESCALk | 25af3796442e5ec87fb54caa4344e8871a2abd15 | [
"BSD-3-Clause"
] | 2 | 2021-12-04T06:23:21.000Z | 2021-12-08T20:53:12.000Z | # @author: Manish Bhattarai
import glob
import os
import h5py
import pandas as pd
from scipy.io import loadmat
from .utils import *
import pickle
class data_read():
r"""Class for reading data.
Parameters:
args (class): Class which comprises following attributes
fpath (str): Directory path of... | 34.712551 | 150 | 0.597854 |
29a90de32ba84a853361d21ddaab1df690c820e9 | 144 | py | Python | stimuli/Python/one_file_per_item/jap/50_# math_if 14.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | 6 | 2020-04-24T08:16:51.000Z | 2021-11-01T09:50:46.000Z | stimuli/Python/one_file_per_item/jap/50_# math_if 14.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | null | null | null | stimuli/Python/one_file_per_item/jap/50_# math_if 14.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | 4 | 2021-02-17T20:21:31.000Z | 2022-02-14T12:43:23.000Z | yosoku = 8
jissai = 10
gosa = 3
if (yosoku - jissai < gosa) and (yosoku - jissai > -1*gosa):
print(yosoku - jissai)
else:
print(gosa)
| 14.4 | 60 | 0.611111 |
daa18a4a285623458cf85b16493f1b4d6ecfe9f1 | 3,197 | py | Python | members/admin.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-03-12T21:38:32.000Z | 2021-11-06T15:26:56.000Z | members/admin.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 33 | 2019-01-21T15:54:50.000Z | 2021-05-18T17:54:52.000Z | members/admin.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-01-21T15:47:26.000Z | 2021-09-22T07:14:34.000Z | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.forms import UserChangeForm
from search_admin_autocomplete.admin import SearchAutoCompleteAdmin
from import_export.admin import ImportExportModelAdmin
from import_export import resources
from imp... | 28.292035 | 120 | 0.568971 |
295659ee5df4e1e04d759fdb44d1c2937ae4d927 | 829 | py | Python | chemml/wrapper/sklearn_skl/train_test_split_wrapper.py | iamchetry/DataChallenge-Fall2021 | fa7748c9ea2f3c0f6bde8d0b094fc75463e28f33 | [
"BSD-3-Clause"
] | 108 | 2018-03-23T20:06:03.000Z | 2022-01-06T19:32:46.000Z | chemml/wrapper/sklearn_skl/train_test_split_wrapper.py | hachmannlab/ChemML | 42b152579872a57c834884596f700c76b9320280 | [
"BSD-3-Clause"
] | 18 | 2019-08-09T21:16:14.000Z | 2022-02-14T21:52:06.000Z | chemml/wrapper/sklearn_skl/train_test_split_wrapper.py | hachmannlab/ChemML | 42b152579872a57c834884596f700c76b9320280 | [
"BSD-3-Clause"
] | 28 | 2018-04-28T17:07:33.000Z | 2022-02-28T07:22:56.000Z | """
A wrapper for the sklearn.model_selection.train_test_split
"""
from chemml.wrapper.interfaces import evaluate_inputs
def train_test_split(block, stack):
# evaluate function inputs
inputs = evaluate_inputs(block['inputs'], stack)
# run function
from sklearn.model_selection import train_test_split... | 27.633333 | 76 | 0.659831 |
180a75c23c4afff27f24063adba0095ff9a8a1f9 | 724 | py | Python | test/test_change_group.py | Elissara/python_training | 91aecbd1b1442ba6a279a656fcee0e0b09c0cffb | [
"Apache-2.0"
] | null | null | null | test/test_change_group.py | Elissara/python_training | 91aecbd1b1442ba6a279a656fcee0e0b09c0cffb | [
"Apache-2.0"
] | null | null | null | test/test_change_group.py | Elissara/python_training | 91aecbd1b1442ba6a279a656fcee0e0b09c0cffb | [
"Apache-2.0"
] | null | null | null | from model.group import Group
import random
def test_change_some_group(app, db, check_ui):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
old_groups = db.get_group_list()
isGroup = random.choice(old_groups)
group = Group(name="New_name", header="New_header", footer="New... | 38.105263 | 113 | 0.714088 |
eddbcf67726d6332249778522fe2ab284cd3e5a1 | 8,519 | py | Python | main.py | mfleader/doe | 2c3a0cec2710f4bcc68a1d326ef3989ce764a479 | [
"Apache-2.0"
] | null | null | null | main.py | mfleader/doe | 2c3a0cec2710f4bcc68a1d326ef3989ce764a479 | [
"Apache-2.0"
] | null | null | null | main.py | mfleader/doe | 2c3a0cec2710f4bcc68a1d326ef3989ce764a479 | [
"Apache-2.0"
] | null | null | null | import time
from pprint import pprint
import asyncio
from functools import partial
import datetime as dt
import pytz
import typer
from kubernetes import client, config, watch
from kubernetes.dynamic import DynamicClient
from kubernetes.client.models.v1_job_status import V1JobStatus
from kubernetes.client.api.batch_v1_... | 33.940239 | 144 | 0.669327 |
c9c3b99508151de95afab6bc4448e129ac693d59 | 9,869 | py | Python | swift/test/unit/common/middleware/test_keystoneauth.py | DmitryMezhensky/Hadoop-and-Swift-integration | 00c2c9cf404f7480ec2c24f918c4b4c055b23800 | [
"Apache-1.1"
] | 5 | 2015-01-07T10:29:18.000Z | 2021-03-30T11:12:39.000Z | swift/test/unit/common/middleware/test_keystoneauth.py | steveloughran/Hadoop-and-Swift-integration | 667c39a3754a8bfeeb883dd9be497cac6e4ab852 | [
"Apache-1.1"
] | null | null | null | swift/test/unit/common/middleware/test_keystoneauth.py | steveloughran/Hadoop-and-Swift-integration | 667c39a3754a8bfeeb883dd9be497cac6e4ab852 | [
"Apache-1.1"
] | 5 | 2015-01-07T10:29:27.000Z | 2017-04-15T13:56:45.000Z | # Copyright (c) 2012 OpenStack, LLC.
#
# 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 wr... | 42.722944 | 79 | 0.663897 |
46297209b695f44825fae6e8441abc9feb1d14ac | 745 | py | Python | 7.py | sinasiruosnejad/leetcode | 8fe5a400bc03a5e129835e380ff9fe72af681d8a | [
"MIT"
] | null | null | null | 7.py | sinasiruosnejad/leetcode | 8fe5a400bc03a5e129835e380ff9fe72af681d8a | [
"MIT"
] | null | null | null | 7.py | sinasiruosnejad/leetcode | 8fe5a400bc03a5e129835e380ff9fe72af681d8a | [
"MIT"
] | null | null | null | x=int(input("\nplease enter an integer "))
number=[]
x_sign="positive"
if x<0:
x*=-1
x_sign="negative"
while x!=0:
temp=x%10
number.append(temp)
x=x//10
for i in range(len(number)-1,-1,-1):
if number[i]>0:
break
if number[i]==0:
number.pop(i)
for i in range(len... | 13.070175 | 42 | 0.558389 |
03ef27e7bac84dee4fdce494541338797692f554 | 786 | py | Python | validation/observable/port.py | ukncsc/edge-mod | 95737e71945f4a8823f20a554e5efb9841183a26 | [
"Unlicense"
] | 2 | 2016-08-23T07:55:01.000Z | 2016-09-27T15:13:32.000Z | validation/observable/port.py | ukncsc/edge-mod | 95737e71945f4a8823f20a554e5efb9841183a26 | [
"Unlicense"
] | null | null | null | validation/observable/port.py | ukncsc/edge-mod | 95737e71945f4a8823f20a554e5efb9841183a26 | [
"Unlicense"
] | 2 | 2020-10-02T13:27:10.000Z | 2021-04-11T09:45:16.000Z |
from adapters.certuk_mod.validation import ValidationStatus, FieldValidationInfo
from observable import ObservableValidationInfo
class PortValidationInfo(ObservableValidationInfo):
TYPE = 'PortObjectType'
def __init__(self, observable_data, **field_validation):
super(PortValidationInfo, self).__ini... | 34.173913 | 110 | 0.740458 |
f6e4c66bc225bad7ad3f4ae95f2ebd251539f6a6 | 8,282 | py | Python | eli5/base.py | ophiry/eli5 | 5513bb93469e948790ee8e48364573e1103c6383 | [
"MIT"
] | 2 | 2020-06-09T14:20:27.000Z | 2020-10-14T05:24:36.000Z | eli5/base.py | mdjabc/eli5 | 4cd66ac5e0ffde0c002d8f46dc64d7091f49445f | [
"MIT"
] | null | null | null | eli5/base.py | mdjabc/eli5 | 4cd66ac5e0ffde0c002d8f46dc64d7091f49445f | [
"MIT"
] | 1 | 2020-04-19T05:45:11.000Z | 2020-04-19T05:45:11.000Z | # -*- coding: utf-8 -*-
from typing import Any, List, Tuple, Union, Optional
import numpy as np # type: ignore
from .base_utils import attrs
from .formatters.features import FormattedFeatureName
# @attrs decorator used in this file calls @attr.s(slots=True),
# creating attr.ib entries based on the signature of __in... | 34.65272 | 86 | 0.585607 |
fcce04dc369a096372a2c9239072faf214858317 | 863 | py | Python | xunit-autolabeler-v2/ast_parser/core/test_data/parser/nested_tags/nested_tags.py | GoogleCloudPlatform/repo-automation-playground | a4c8f104c246ede002f6c18fcebfc0496c8abb94 | [
"Apache-2.0"
] | 5 | 2019-07-11T17:35:44.000Z | 2021-10-09T01:49:04.000Z | xunit-autolabeler-v2/ast_parser/core/test_data/parser/nested_tags/nested_tags.py | GoogleCloudPlatform/repo-automation-playground | a4c8f104c246ede002f6c18fcebfc0496c8abb94 | [
"Apache-2.0"
] | 36 | 2019-08-27T18:20:21.000Z | 2022-01-12T21:29:00.000Z | xunit-autolabeler-v2/ast_parser/core/test_data/parser/nested_tags/nested_tags.py | GoogleCloudPlatform/repo-automation-playground | a4c8f104c246ede002f6c18fcebfc0496c8abb94 | [
"Apache-2.0"
] | 13 | 2019-10-30T19:39:51.000Z | 2021-04-04T09:31:52.000Z | # Copyright 2020 Google LLC.
#
# 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, ... | 24.657143 | 74 | 0.73117 |
ae12d66ef700de699763c2374cf2418cfac3fd1e | 2,747 | py | Python | backup/www/apis.py | monkeychen/python-tutorial | a24785da6b4d857200b819ad4d960885b1ef7a20 | [
"Apache-2.0"
] | null | null | null | backup/www/apis.py | monkeychen/python-tutorial | a24785da6b4d857200b819ad4d960885b1ef7a20 | [
"Apache-2.0"
] | null | null | null | backup/www/apis.py | monkeychen/python-tutorial | a24785da6b4d857200b819ad4d960885b1ef7a20 | [
"Apache-2.0"
] | null | null | null | class Page(object):
"""
Page object for display pages.
"""
def __init__(self, item_count, page_index=1, page_size=10):
"""
Init Pagination by item_count, page_index and page_size.
>>> p1 = Page(100, 1)
>>> p1.page_count
10
>>> p1.offset
0
... | 26.413462 | 105 | 0.560976 |
047d3e5f9b977e118efe78905db4849a4157b033 | 902 | py | Python | python-example/elastic_search_query.py | scirag/elastic-search-hamming-distance-plugin | ba4ede2bbb2f9aef0f834236d806b356de0a9374 | [
"Apache-2.0"
] | 8 | 2017-02-21T04:34:57.000Z | 2021-07-12T09:22:00.000Z | python-example/elastic_search_query.py | scirag/elastic-search-hamming-distance-plugin | ba4ede2bbb2f9aef0f834236d806b356de0a9374 | [
"Apache-2.0"
] | 1 | 2021-04-21T12:11:03.000Z | 2021-04-21T12:11:03.000Z | python-example/elastic_search_query.py | scirag/elastic-search-hamming-distance-plugin | ba4ede2bbb2f9aef0f834236d806b356de0a9374 | [
"Apache-2.0"
] | 2 | 2017-11-22T12:03:11.000Z | 2018-06-20T10:02:43.000Z | from elasticsearch import Elasticsearch
ES_INDEX_NAME = 'tr.awakening'
ES_DOC_TYPE = 'image_info'
es = Elasticsearch()
def search_image(phash, min_score):
search_results = es.search(index=ES_INDEX_NAME, doc_type=ES_DOC_TYPE, body={
"query": {
"function_score": {
"min_score": ... | 26.529412 | 80 | 0.372506 |
f1af1d5d6217937424d3c7816c1765c24ec18c75 | 6,228 | py | Python | src/transformers/configuration_mbart.py | Liang813/transformers | 08f534d2da47875a4b7eb1c125cfa7f0f3b79642 | [
"Apache-2.0"
] | null | null | null | src/transformers/configuration_mbart.py | Liang813/transformers | 08f534d2da47875a4b7eb1c125cfa7f0f3b79642 | [
"Apache-2.0"
] | null | null | null | src/transformers/configuration_mbart.py | Liang813/transformers | 08f534d2da47875a4b7eb1c125cfa7f0f3b79642 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Fairseq Authors and The HuggingFace Inc. team.
#
# 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
#
# Unles... | 59.314286 | 127 | 0.679512 |
a3d43e30437db3376e0a1f198fc9eb2d5072e25b | 72 | py | Python | superset/run.py | neilchencn/incubator-superset | 5f9742afa215c0f906fec498e9f3910d74b85347 | [
"Apache-2.0"
] | null | null | null | superset/run.py | neilchencn/incubator-superset | 5f9742afa215c0f906fec498e9f3910d74b85347 | [
"Apache-2.0"
] | null | null | null | superset/run.py | neilchencn/incubator-superset | 5f9742afa215c0f906fec498e9f3910d74b85347 | [
"Apache-2.0"
] | 1 | 2019-11-07T13:23:03.000Z | 2019-11-07T13:23:03.000Z | from superset import app
app.run(debug=True, host='0.0.0.0', port=8088)
| 24 | 46 | 0.722222 |
a809f50faf5249e24daf29b0782c97a3cfe85940 | 32,017 | py | Python | python-shell/src/test/test_gaffer_functions.py | sw96411/gaffer-tools | 2dd4ff64cf6afa1dd3f9529977d7170370b11f58 | [
"Apache-2.0"
] | null | null | null | python-shell/src/test/test_gaffer_functions.py | sw96411/gaffer-tools | 2dd4ff64cf6afa1dd3f9529977d7170370b11f58 | [
"Apache-2.0"
] | null | null | null | python-shell/src/test/test_gaffer_functions.py | sw96411/gaffer-tools | 2dd4ff64cf6afa1dd3f9529977d7170370b11f58 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2016-2019 Crown Copyright
#
# 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 i... | 28.637746 | 118 | 0.361089 |
1e9317ac898de155060ef6acb321b2dd6808c57a | 2,477 | py | Python | consult/factory.py | guillaumepiot/cotidia-demo | 497177fa63942ee22288e93ed7d4867854110dd0 | [
"BSD-3-Clause"
] | null | null | null | consult/factory.py | guillaumepiot/cotidia-demo | 497177fa63942ee22288e93ed7d4867854110dd0 | [
"BSD-3-Clause"
] | 7 | 2020-02-11T23:47:40.000Z | 2022-03-11T23:42:02.000Z | consult/factory.py | guillaumepiot/cotidia-demo | 497177fa63942ee22288e93ed7d4867854110dd0 | [
"BSD-3-Clause"
] | null | null | null | import pytz
import factory
import factory.fuzzy
from faker import Faker
from faker.providers import profile, address, geo, python, date_time
from django.utils import timezone
from cotidia.team.models import Member
from consult.models import Customer, ServiceType
fake = Faker("en_GB")
fake.add_provider(profile)
fak... | 31.35443 | 85 | 0.697214 |
5fd4f7c15a73051641acf21c82648794473f0249 | 57,771 | py | Python | mne/dipole.py | rylaw/mne-python | aa526c8ed7049046734ca28493d99e841672b0eb | [
"BSD-3-Clause"
] | 1 | 2022-01-04T21:37:36.000Z | 2022-01-04T21:37:36.000Z | mne/dipole.py | rylaw/mne-python | aa526c8ed7049046734ca28493d99e841672b0eb | [
"BSD-3-Clause"
] | null | null | null | mne/dipole.py | rylaw/mne-python | aa526c8ed7049046734ca28493d99e841672b0eb | [
"BSD-3-Clause"
] | 1 | 2021-04-01T15:56:39.000Z | 2021-04-01T15:56:39.000Z | # -*- coding: utf-8 -*-
"""Single-dipole functions and classes."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
from copy import deepcopy
import functools
from functools import partial
import re
import numpy as np
from .cov ... | 37.93237 | 82 | 0.561354 |
a5032e4771bf47da93952fc650a3495859fa7937 | 697 | py | Python | day5/day5.py | agnul/AdventOfCode2020 | d645ebc83757b75ddddf57d6ced1969b5a063708 | [
"Unlicense"
] | 2 | 2020-12-04T13:13:38.000Z | 2020-12-08T17:24:08.000Z | day5/day5.py | agnul/AdventOfCode2020 | d645ebc83757b75ddddf57d6ced1969b5a063708 | [
"Unlicense"
] | null | null | null | day5/day5.py | agnul/AdventOfCode2020 | d645ebc83757b75ddddf57d6ced1969b5a063708 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
def find_seat_id(boarding_pass):
lo, hi = 0, 1024
for c in boarding_pass:
m = int((lo + hi) / 2)
(lo, hi) = (lo, m) if c == 'F' or c == 'L' else (m, hi)
return lo
def solve_part_1(boarding_passes):
return max([find_seat_id(p) for p in boarding_passes])
def solve... | 26.807692 | 64 | 0.585366 |
6ebe22811b764c7e255b79131e3fb6679fd8086c | 2,229 | py | Python | gammapy/scripts/image_coordinates.py | grburgess/gammapy | 609e460698caca7223afeef5e71826c7b32728d1 | [
"BSD-3-Clause"
] | 3 | 2019-01-28T12:21:14.000Z | 2019-02-10T19:58:07.000Z | gammapy/scripts/image_coordinates.py | grburgess/gammapy | 609e460698caca7223afeef5e71826c7b32728d1 | [
"BSD-3-Clause"
] | null | null | null | gammapy/scripts/image_coordinates.py | grburgess/gammapy | 609e460698caca7223afeef5e71826c7b32728d1 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from ..utils.scripts import get_parser
__all__ = ['image_coordinates']
log = logging.getLogger(__name__)
def image_coordinates_main(args=None):
parser... | 34.828125 | 82 | 0.645132 |
ffd656b74ba0a8bdf1ecb54264f9b19a930331f4 | 21,615 | py | Python | electrum_sum/gui/qt/network_dialog.py | jakesum/electrum-sum | f34ac3c042cf73e90acd0771b87f60b750b6c799 | [
"MIT"
] | 3 | 2020-09-02T08:49:37.000Z | 2021-11-05T12:31:47.000Z | electrum_sum/gui/qt/network_dialog.py | jakesum/electrum-sum | f34ac3c042cf73e90acd0771b87f60b750b6c799 | [
"MIT"
] | 1 | 2021-05-04T13:47:57.000Z | 2021-05-04T13:47:57.000Z | electrum_sum/gui/qt/network_dialog.py | jakesum/electrum-sum | f34ac3c042cf73e90acd0771b87f60b750b6c799 | [
"MIT"
] | 3 | 2020-09-21T02:55:02.000Z | 2021-04-07T06:05:13.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | 39.228675 | 146 | 0.634097 |
60f63a5e948bde84d5c95f611fee6209c2f98832 | 517 | py | Python | curricula/templatetags/level_embed.py | code-dot-org/curriculumbuilder | e40330006145b8528f777a8aec2abff5b309d1c7 | [
"Apache-2.0"
] | 3 | 2019-10-22T20:21:15.000Z | 2022-01-12T19:38:48.000Z | curricula/templatetags/level_embed.py | code-dot-org/curriculumbuilder | e40330006145b8528f777a8aec2abff5b309d1c7 | [
"Apache-2.0"
] | 67 | 2019-09-27T17:04:52.000Z | 2022-03-21T22:16:23.000Z | curricula/templatetags/level_embed.py | code-dot-org/curriculumbuilder | e40330006145b8528f777a8aec2abff5b309d1c7 | [
"Apache-2.0"
] | 1 | 2019-10-18T16:06:31.000Z | 2019-10-18T16:06:31.000Z | import re
from django import template
register = template.Library()
URL_RE = '^/(?P<sub>\w+)(?P<path>.+$)'
@register.filter(name='level_embed')
def level_embed(link):
match = re.match(URL_RE, link)
if match is not None:
try:
sub = match.group('sub')
path = match.group('path')
... | 24.619048 | 59 | 0.572534 |
f06b8aaa49907df5ba0ca1b5526b5a06cc4301a6 | 1,974 | py | Python | {{ cookiecutter.namespace }}/setup.py | TheChymera/ndx-template | 44ee210181d5770d037106acff345fe1d30e0477 | [
"BSD-3-Clause-LBNL"
] | 3 | 2020-02-06T01:18:47.000Z | 2022-01-05T21:21:38.000Z | {{ cookiecutter.namespace }}/setup.py | TheChymera/ndx-template | 44ee210181d5770d037106acff345fe1d30e0477 | [
"BSD-3-Clause-LBNL"
] | 38 | 2019-05-15T19:07:12.000Z | 2022-01-27T01:26:57.000Z | {{ cookiecutter.namespace }}/setup.py | TheChymera/ndx-template | 44ee210181d5770d037106acff345fe1d30e0477 | [
"BSD-3-Clause-LBNL"
] | 4 | 2019-05-15T18:03:42.000Z | 2020-05-08T11:38:53.000Z | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
from shutil import copy2
# load README.md/README.rst file
try:
if os.path.exists('README.md'):
with open('README.md', 'r') as fp:
readme = fp.read()
readme_type = 'text/markdown; charset=UTF-8'
elif ... | 29.909091 | 97 | 0.607396 |
c7e5e218473d8d278940cf5484d37c56bc0cdc5f | 226 | py | Python | mfr3dcore/math/__init__.py | cmoestl/3DCORE | 7c76b4bdd7e16dc87d876ff75e9441cb48061819 | [
"MIT"
] | 3 | 2020-04-28T09:10:22.000Z | 2021-01-26T15:15:36.000Z | mfr3dcore/math/__init__.py | cmoestl/3DCORE | 7c76b4bdd7e16dc87d876ff75e9441cb48061819 | [
"MIT"
] | null | null | null | mfr3dcore/math/__init__.py | cmoestl/3DCORE | 7c76b4bdd7e16dc87d876ff75e9441cb48061819 | [
"MIT"
] | 1 | 2020-06-18T04:35:58.000Z | 2020-06-18T04:35:58.000Z | # -*- coding: utf-8 -*-
from .csys_polar import csys_polar_to_xyz
from .csys_torus_v1 import csys_xyz_to_torusv1, csys_torusv1_to_xyz, csys_torusv1_to_xyz_jacobian
from .euler_rodrigues import errot, errot_compose, errot_get
| 37.666667 | 97 | 0.831858 |
3b4735a2a894fb9dae5673312488b950f04fbb36 | 7,643 | py | Python | IPython/utils/pickleutil.py | flexlee/ipython | 7528fbd76073c90262b9ac127de57c4c59b23a5c | [
"BSD-3-Clause-Clear"
] | 1 | 2017-02-09T20:01:11.000Z | 2017-02-09T20:01:11.000Z | IPython/utils/pickleutil.py | flexlee/ipython | 7528fbd76073c90262b9ac127de57c4c59b23a5c | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/utils/pickleutil.py | flexlee/ipython | 7528fbd76073c90262b9ac127de57c4c59b23a5c | [
"BSD-3-Clause-Clear"
] | null | null | null | # encoding: utf-8
"""Pickle related utilities. Perhaps this should be called 'can'."""
__docformat__ = "restructuredtext en"
#-------------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. ... | 27.492806 | 86 | 0.533168 |
a513b6bef4a0629c9cba7ea183dd6d5810e20d3f | 13,453 | py | Python | pandapower/test/shortcircuit/test_all_currents.py | ZhengLiu1119/pandapower | 4356a2e8fdc6afc5a8449c903d09d90d8fee5530 | [
"BSD-3-Clause"
] | null | null | null | pandapower/test/shortcircuit/test_all_currents.py | ZhengLiu1119/pandapower | 4356a2e8fdc6afc5a8449c903d09d90d8fee5530 | [
"BSD-3-Clause"
] | null | null | null | pandapower/test/shortcircuit/test_all_currents.py | ZhengLiu1119/pandapower | 4356a2e8fdc6afc5a8449c903d09d90d8fee5530 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2022 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
import pytest
import pandapower as pp
import pandapower.shortcircuit as sc
def three_bus_exampl... | 45.60339 | 118 | 0.639634 |
f1e046d9e53c2a3a81d71e2654f6c65a1b20420c | 5,265 | py | Python | imcsdk/mometa/bios/BiosVfSgx.py | ecoen66/imcsdk | b10eaa926a5ee57cea7182ae0adc8dd1c818b0ab | [
"Apache-2.0"
] | 31 | 2016-06-14T07:23:59.000Z | 2021-09-12T17:17:26.000Z | imcsdk/mometa/bios/BiosVfSgx.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 109 | 2016-05-25T03:56:56.000Z | 2021-10-18T02:58:12.000Z | imcsdk/mometa/bios/BiosVfSgx.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 67 | 2016-05-17T05:53:56.000Z | 2022-03-24T15:52:53.000Z | """This module contains the general information for BiosVfSgx ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfSgxConsts:
VP_ENABLE_SGX_DISABLED = "Disabled"
VP_ENABLE_SGX_ENABLED = "Enabled"
_VP_ENABLE_S... | 53.181818 | 294 | 0.699525 |
065f5ed2b644efe80a23f0f101ff309d30af19d3 | 1,601 | py | Python | test/utils_tests/opencas-py-tests/test_casadm_01.py | CAS-Linux-Jenkins/open-cas-linux | 6ef7195950abf6aa239a21963cdd2eca4779bdac | [
"BSD-3-Clause-Clear"
] | 2 | 2021-08-13T14:44:45.000Z | 2022-01-10T07:41:40.000Z | test/utils_tests/opencas-py-tests/test_casadm_01.py | josehu07/open-cas-linux-mf | 5c6870be8bbb6816645955b6e479c9b5c7c0074d | [
"BSD-3-Clause-Clear"
] | null | null | null | test/utils_tests/opencas-py-tests/test_casadm_01.py | josehu07/open-cas-linux-mf | 5c6870be8bbb6816645955b6e479c9b5c7c0074d | [
"BSD-3-Clause-Clear"
] | null | null | null | #
# Copyright(c) 2012-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import pytest
import subprocess
import unittest.mock as mock
from opencas import casadm
from helpers import get_process_mock
@mock.patch("subprocess.run")
def test_run_cmd_01(mock_run):
mock_run.return_value = get_proce... | 27.603448 | 70 | 0.693317 |
dc333d22f9933b692c7be60f53987bb71d434ec5 | 1,599 | py | Python | utils.py | JueLin/textureSynthesis-stylegan2-pytorch | 60ecc5a5ae184a76ab63dc58b9d624e7895fdcef | [
"MIT"
] | 3 | 2022-03-25T02:46:16.000Z | 2022-03-28T17:31:27.000Z | utils.py | JueLin/textureSynthesis-stylegan2-pytorch | 60ecc5a5ae184a76ab63dc58b9d624e7895fdcef | [
"MIT"
] | 1 | 2022-03-29T17:02:29.000Z | 2022-03-30T08:05:36.000Z | utils.py | JueLin/textureSynthesis-stylegan2-pytorch | 60ecc5a5ae184a76ab63dc58b9d624e7895fdcef | [
"MIT"
] | null | null | null | import torch
import os
from PIL import Image
def load_image(filename, size=None, scale=None):
img = Image.open(filename)
if size is not None:
img = img.resize((size, size), Image.ANTIALIAS)
elif scale is not None:
img = img.resize((int(img.size[0] / scale), int(img.size[1] / scale)), Image.... | 34.021277 | 95 | 0.646654 |
cf7c35c5336b91da4bd31940d15268cee621b0cb | 1,147 | py | Python | Mundo 3/ex113.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | Mundo 3/ex113.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | Mundo 3/ex113.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | # Reescreva a função leiaInt() que fizemos no desafio 104, incluindo agora a possibilidade da digitação de
# um número de tipo inválido. Aproveite e crie também uma função leiaFloat() com a mesma funcionalidade.
def leiaInt(msg):
while True:
try:
n = int(input(msg))
except (ValueError, T... | 33.735294 | 106 | 0.605057 |
d763304c9ef85dbe0239a64727999c72f6be353d | 8,237 | py | Python | pyod/models/mcd.py | paragon520/cascoKNN | 1de6ce6ca6615ef4cde4b6111727a55a26998594 | [
"BSD-2-Clause"
] | 2 | 2020-11-04T13:45:17.000Z | 2021-08-06T02:03:51.000Z | pyod/models/mcd.py | LiDan456/Pyod | 1bee06200c5e8c86977bbdec896b624af2c2e05a | [
"BSD-2-Clause"
] | null | null | null | pyod/models/mcd.py | LiDan456/Pyod | 1bee06200c5e8c86977bbdec896b624af2c2e05a | [
"BSD-2-Clause"
] | 1 | 2021-03-03T08:45:04.000Z | 2021-03-03T08:45:04.000Z | # -*- coding: utf-8 -*-
"""Outlier Detection with Minimum Covariance Determinant (MCD)
"""
# Author: Yue Zhao <yuezhao@cs.toronto.edu>
# License: BSD 2 clause
from __future__ import division
from __future__ import print_function
from sklearn.covariance import MinCovDet
from sklearn.utils.validation import check_is_fi... | 38.311628 | 79 | 0.690785 |
f9179f07a8248fe3e43971850615d21b4ded8df2 | 2,210 | py | Python | giftrocket/http.py | GiftRocket/giftrocket-python | dd761b869145b2a91faad344ac26147a2e2c3a97 | [
"MIT"
] | 3 | 2017-04-04T13:17:29.000Z | 2020-07-21T15:23:11.000Z | giftrocket/http.py | GiftRocket/giftrocket-python | dd761b869145b2a91faad344ac26147a2e2c3a97 | [
"MIT"
] | null | null | null | giftrocket/http.py | GiftRocket/giftrocket-python | dd761b869145b2a91faad344ac26147a2e2c3a97 | [
"MIT"
] | 1 | 2019-12-01T06:45:27.000Z | 2019-12-01T06:45:27.000Z | ##############################################################################
# Helper module that encapsulates the HTTPS request so that it can be used
# with multiple runtimes. PK Mar. 14
##############################################################################
import os
import json
try:
from urllib.parse ... | 27.283951 | 89 | 0.577828 |
8e4ff8be01311544bc9f807da1bc252bc189b618 | 15,603 | py | Python | airbyte-cdk/python/airbyte_cdk/sources/singer/singer_helpers.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 2 | 2022-03-02T13:46:05.000Z | 2022-03-05T12:31:28.000Z | airbyte-cdk/python/airbyte_cdk/sources/singer/singer_helpers.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 5 | 2022-02-22T14:49:48.000Z | 2022-03-19T10:43:08.000Z | airbyte-cdk/python/airbyte_cdk/sources/singer/singer_helpers.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 1 | 2022-03-11T06:21:24.000Z | 2022-03-11T06:21:24.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import json
import os
import selectors
import subprocess
from dataclasses import dataclass
from datetime import datetime
from io import TextIOWrapper
from typing import Any, DefaultDict, Dict, Iterator, List, Mapping, Optional, Tuple
from airbyte_cdk.logge... | 51.157377 | 151 | 0.648209 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.