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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
455696f0c014cac3647a77723784dd28be19d946 | 7,915 | py | Python | utils.py | nguyetn89/Gait-recognition-single-camera-for-MVLP | 7511e04228ba5bcfe4a63b2656522e4290e8c635 | [
"BSD-2-Clause"
] | 2 | 2021-02-18T15:07:22.000Z | 2021-06-02T13:26:19.000Z | utils.py | nguyetn89/Gait-recognition-single-camera-for-MVLP | 7511e04228ba5bcfe4a63b2656522e4290e8c635 | [
"BSD-2-Clause"
] | null | null | null | utils.py | nguyetn89/Gait-recognition-single-camera-for-MVLP | 7511e04228ba5bcfe4a63b2656522e4290e8c635 | [
"BSD-2-Clause"
] | null | null | null | """
Utilities for gait recognition
Licence: BSD 2-Clause "Simplified"
Author : Trong Nguyen Nguyen
"""
import torch
import os
import sys
import re
import numpy as np
import torchvision.transforms as transforms
from PIL import Image
np.random.seed(3011)
mean = torch.tensor([0.485, 0.456, 0.406])
std = torch.tensor([... | 45.228571 | 135 | 0.582186 |
dc1f9a9fe1782b804d697d95f181d0dd396702d4 | 1,292 | py | Python | main.py | hotchya/REST-pytorch | a6c8d03c07d3705a6110b29b381b04ed600296c1 | [
"MIT"
] | null | null | null | main.py | hotchya/REST-pytorch | a6c8d03c07d3705a6110b29b381b04ed600296c1 | [
"MIT"
] | 1 | 2021-04-17T04:49:34.000Z | 2021-04-17T04:57:42.000Z | main.py | hotchya/REST-pytorch | a6c8d03c07d3705a6110b29b381b04ed600296c1 | [
"MIT"
] | null | null | null | import io
import torch
from torchvision import transforms
from torchvision.transforms.transforms import Resize
import models
from PIL import Image
from flask import Flask, render_template, request
app = Flask (__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/predict_mnist... | 30.761905 | 181 | 0.70743 |
a5318d578942bf7589f8b01a56f5cc5deb378af2 | 423 | py | Python | manage.py | NgugiMuthoni/The-news | 3e2970e33e1d3e26becabf397ac5df20d33f9846 | [
"Unlicense"
] | 3 | 2018-10-03T07:59:18.000Z | 2020-02-06T19:25:57.000Z | manage.py | Evohmike/News-Highlights | 6f93fba34672bb3619df929561a44068edf887cc | [
"MIT"
] | null | null | null | manage.py | Evohmike/News-Highlights | 6f93fba34672bb3619df929561a44068edf887cc | [
"MIT"
] | null | null | null | from app import create_app
from flask_script import Manager, Server
# create app instance
app = create_app('production')
manager = Manager(app)
manager.add_command('server', Server)
@manager.command
def test():
'''
Runs the unittest
'''
import unittest
tests = unittest.TestLoader().discover('tes... | 18.391304 | 51 | 0.704492 |
0b9ed88272afbc8b940310a183b386d9416dbd87 | 1,173 | py | Python | caproto_sandbox/io_camera_client.py | vstadnytskyi/caproto-sandbox | 712d44a15770b0a51503fba1068a68b3286d8ee5 | [
"BSD-3-Clause"
] | null | null | null | caproto_sandbox/io_camera_client.py | vstadnytskyi/caproto-sandbox | 712d44a15770b0a51503fba1068a68b3286d8ee5 | [
"BSD-3-Clause"
] | 11 | 2019-10-08T18:37:08.000Z | 2020-05-01T20:18:42.000Z | caproto_sandbox/io_camera_client.py | vstadnytskyi/caproto-sandbox | 712d44a15770b0a51503fba1068a68b3286d8ee5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
from logging import debug,warn,info,error
import epics
from time import time
from caproto.threading.client import Context
from pdb import pm
default_prefix='camera:'
print('epics Client')
image = epics.PV(pvname = default_prefix+'image', connection_timeout = 20)
... | 28.609756 | 163 | 0.709292 |
04de77133753517a13b94ea26bcddaec2ccc6ce9 | 1,543 | py | Python | pyro/ops/welford.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | pyro/ops/welford.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | pyro/ops/welford.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
class WelfordCovariance(object):
"""
Implements Welford's online scheme for estimating (co)variance (see :math:`[1]`).
Useful for adapting diagonal and dense mass structures for HMC.
**References**
... | 30.254902 | 85 | 0.585872 |
ff73849535b5a4ec6c9b27fd6e95a946784584ea | 294 | py | Python | Exercises/exercise-29.py | shoriwe-upb/TallerEjercicios | ba37eb6cd673a8d38a1dfac87c5efac3f728da21 | [
"MIT"
] | null | null | null | Exercises/exercise-29.py | shoriwe-upb/TallerEjercicios | ba37eb6cd673a8d38a1dfac87c5efac3f728da21 | [
"MIT"
] | null | null | null | Exercises/exercise-29.py | shoriwe-upb/TallerEjercicios | ba37eb6cd673a8d38a1dfac87c5efac3f728da21 | [
"MIT"
] | null | null | null | def main():
number = int(input("Number: "))
if number > 0:
print("Positive")
elif number < 0:
print("Negative")
else:
print("Is Zero")
if number % 2:
print("Es impar")
else:
print("Es par")
if __name__ == '__main__':
main()
| 17.294118 | 35 | 0.493197 |
a31a7b02952fd135d6ed508812b0b444ce4949ba | 219 | py | Python | dbtemplate/tests/app/urls.py | subuk/django-dbtemplate | cd8e3d6e548438297c8de96a3f1e9e47cf191ecf | [
"MIT"
] | null | null | null | dbtemplate/tests/app/urls.py | subuk/django-dbtemplate | cd8e3d6e548438297c8de96a3f1e9e47cf191ecf | [
"MIT"
] | null | null | null | dbtemplate/tests/app/urls.py | subuk/django-dbtemplate | cd8e3d6e548438297c8de96a3f1e9e47cf191ecf | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.shortcuts import render_to_response
def test_view(request):
return render_to_response('test.html', {'username': 'test'})
urlpatterns = [
url(r'^$', test_view),
]
| 18.25 | 64 | 0.716895 |
c9ee6c1e6f0f76e7d0e22c73580bef52dcff5a8d | 4,217 | py | Python | discord/team.py | MinerChAI/discord.py | eeabb8ebb6eb5b6af2dea02c8d66c19c0e0e5dff | [
"MIT"
] | null | null | null | discord/team.py | MinerChAI/discord.py | eeabb8ebb6eb5b6af2dea02c8d66c19c0e0e5dff | [
"MIT"
] | null | null | null | discord/team.py | MinerChAI/discord.py | eeabb8ebb6eb5b6af2dea02c8d66c19c0e0e5dff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2019 Rapptz
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 without limitation
the rights to u... | 31.706767 | 96 | 0.649751 |
f7b1b565a8a1a39e2363429222ea160372487def | 2,071 | py | Python | src/pyramid_torque_engine_notifications/auth.py | opendesk/pyramid_torque_engine_notifications | 330124fdfe9d015b5d35e0db0e81246cae7e2dc3 | [
"Unlicense"
] | 1 | 2015-06-23T12:51:43.000Z | 2015-06-23T12:51:43.000Z | src/pyramid_torque_engine_notifications/auth.py | opendesk/pyramid_torque_engine_notifications | 330124fdfe9d015b5d35e0db0e81246cae7e2dc3 | [
"Unlicense"
] | 3 | 2019-12-26T16:36:59.000Z | 2022-03-21T22:16:06.000Z | src/pyramid_torque_engine_notifications/auth.py | opendesk/pyramid_torque_engine_notifications | 330124fdfe9d015b5d35e0db0e81246cae7e2dc3 | [
"Unlicense"
] | 3 | 2015-06-24T10:25:35.000Z | 2015-12-19T18:28:44.000Z | # -*- coding: utf-8 -*-
"""Provides a base ``ACLContainer`` class that wraps any context in a
generic API key aware ``ACLWrapper`` and a
"""
__all__ = [
'APIKeyAuthenticationPolicy',
'APIKeyAuthorizationPolicy',
]
import logging
logger = logging.getLogger(__name__)
import re
import zope.interface as zi
f... | 29.169014 | 78 | 0.673588 |
cde0d4eb2285c53a2858796aa372d00f2f6a338e | 1,849 | py | Python | test/functional/test_f_park.py | mattsb42/pypi-parker | e4f2303927810f12d16dceb4b3125b447a3ee796 | [
"Apache-2.0"
] | 15 | 2017-10-08T18:02:34.000Z | 2021-04-12T07:46:21.000Z | test/functional/test_f_park.py | mattsb42/pypi-parker | e4f2303927810f12d16dceb4b3125b447a3ee796 | [
"Apache-2.0"
] | 4 | 2017-10-09T03:35:47.000Z | 2017-11-21T16:51:35.000Z | test/functional/test_f_park.py | mattsb42/pypi-parker | e4f2303927810f12d16dceb4b3125b447a3ee796 | [
"Apache-2.0"
] | 1 | 2019-06-26T17:18:36.000Z | 2019-06-26T17:18:36.000Z | """Functional test suite for :class:`pypi_parker.Park`."""
import os
import shlex
import subprocess
import sys
import pytest
from .functional_helpers import HERE, read, TEST_PACKAGE_NAMES
@pytest.mark.parametrize('config_filename, suffix', (
('park.cfg', ''),
('A_DIFFERENT_FILENAME', ' --park=A_DIFFERENT_FI... | 33.618182 | 104 | 0.721471 |
1aa0f852e34e1e866cb12ba08f7710b373f323a7 | 2,299 | py | Python | tilt_python/job_sub_for_data_gather.py | FinMacDov/PhD_codes | 44e781c270fa9822a8137ef271f35c6e945c5828 | [
"MIT"
] | null | null | null | tilt_python/job_sub_for_data_gather.py | FinMacDov/PhD_codes | 44e781c270fa9822a8137ef271f35c6e945c5828 | [
"MIT"
] | null | null | null | tilt_python/job_sub_for_data_gather.py | FinMacDov/PhD_codes | 44e781c270fa9822a8137ef271f35c6e945c5828 | [
"MIT"
] | null | null | null | #import sys
#import os
import numpy as np
import glob
from pathlib import Path
#import pandas as pd
def bash_writter(qsub_names_list):
file_bash = open('data_gather_tilt_qsub', 'w')
file_bash.write('#!/bin/bash\n')
for i_list in range(len(qsub_names_list)):
file_bash.write('qsub '+qsub_names_list[i... | 34.833333 | 101 | 0.622445 |
9509cebefee0a72be3158844f71428c64c7c8e35 | 1,179 | py | Python | lists/forms.py | ejpreciado/superlists | c2bddc0319503f9f84fac68bf6053601ec37c2f4 | [
"MIT"
] | null | null | null | lists/forms.py | ejpreciado/superlists | c2bddc0319503f9f84fac68bf6053601ec37c2f4 | [
"MIT"
] | null | null | null | lists/forms.py | ejpreciado/superlists | c2bddc0319503f9f84fac68bf6053601ec37c2f4 | [
"MIT"
] | null | null | null | from django.core.exceptions import ValidationError
from django import forms
from lists.models import Item
EMPTY_ITEM_ERROR = "You can't have an empty list item"
DUPLICATE_ITEM_ERROR = "You've already got this in your list"
class ItemForm(forms.models.ModelForm):
class Meta:
model = Item
fields = ... | 28.071429 | 61 | 0.606446 |
06909d5b796e05d330dc37c36d3309e8835eefc1 | 8,034 | py | Python | networks.py | MinGyuGwon/RL_Trader | 5956d17546dd283ae8b01ac2d8df622feb5c55d0 | [
"MIT"
] | 1 | 2021-11-08T14:41:25.000Z | 2021-11-08T14:41:25.000Z | networks.py | MinGyuGwon/RL_Trader | 5956d17546dd283ae8b01ac2d8df622feb5c55d0 | [
"MIT"
] | null | null | null | networks.py | MinGyuGwon/RL_Trader | 5956d17546dd283ae8b01ac2d8df622feb5c55d0 | [
"MIT"
] | null | null | null | import os
import threading
import numpy as np
if os.environ['KERAS_BACKEND'] == 'tensorflow':
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Dense, LSTM, Conv2D, \
BatchNormalization, Dropout, MaxPooling2D, Flatten
from tensorflow.keras.optimizers import SGD
... | 39.382353 | 122 | 0.626711 |
69423c280ed042e850c6b6f8c80e25ca9df1de09 | 33,565 | py | Python | py/resolution/sequence_graph/path_graph_multik.py | AntonBankevich/LJA | 979d7929bf0b39fd142ec6465dc0c17814465ef9 | [
"BSD-3-Clause"
] | 53 | 2021-10-10T22:16:27.000Z | 2022-03-23T06:21:06.000Z | py/resolution/sequence_graph/path_graph_multik.py | AntonBankevich/LJA | 979d7929bf0b39fd142ec6465dc0c17814465ef9 | [
"BSD-3-Clause"
] | 20 | 2021-05-10T07:44:24.000Z | 2022-03-24T13:23:58.000Z | py/resolution/sequence_graph/path_graph_multik.py | AntonBankevich/DR | 73450ad3b25f90a3c7747aaf17fe60d13d9692d3 | [
"BSD-3-Clause"
] | 6 | 2022-01-27T01:45:56.000Z | 2022-03-18T04:23:33.000Z | # (c) 2020 by Authors
# This file is a part of centroFlye program.
# Released under the BSD license (see LICENSE file)
import argparse
from collections import defaultdict
import logging
import math
import os
import subprocess
import sys
this_dirname = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.pat... | 39.958333 | 156 | 0.526382 |
f7ea46bbea56b6d52b4da58f637445f646443bea | 19,245 | py | Python | examples/tensorflow/multiple-choice/run_swag.py | Knarik1/transformers | c2a7d7280250addae38a49c31a57ddd897be2065 | [
"Apache-2.0"
] | 2 | 2021-09-16T01:24:38.000Z | 2021-09-29T18:45:34.000Z | examples/tensorflow/multiple-choice/run_swag.py | Knarik1/transformers | c2a7d7280250addae38a49c31a57ddd897be2065 | [
"Apache-2.0"
] | null | null | null | examples/tensorflow/multiple-choice/run_swag.py | Knarik1/transformers | c2a7d7280250addae38a49c31a57ddd897be2065 | [
"Apache-2.0"
] | 2 | 2021-08-15T14:42:10.000Z | 2021-09-25T15:40:49.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright The HuggingFace Team and The HuggingFace Inc. team. 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.ap... | 41.746204 | 119 | 0.675448 |
cb8607c834da7e75b673ff46953926bccd6fd5d9 | 552 | py | Python | floem/programs/inc2_function_ext.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | 21 | 2018-10-10T18:52:32.000Z | 2022-02-16T12:23:51.000Z | floem/programs/inc2_function_ext.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | null | null | null | floem/programs/inc2_function_ext.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | 3 | 2020-04-22T23:09:26.000Z | 2021-09-30T01:35:34.000Z | from floem import *
class Inc(Element):
def configure(self):
self.inp = Input(Int)
self.out = Output(Int)
def impl(self):
self.run_c("int x = inp() + 1; output { out(x); }")
class inc2(CallableSegment):
def configure(self):
self.inp = Input(Int)
self.out = Output... | 20.444444 | 59 | 0.608696 |
9ddc4b42e10363942e14f601c60f31a4d088250d | 181 | py | Python | src/water_management/exceptionclass.py | viswan29/watermanagement | ba5d3215d3799c0f56ceca96d26fef71f0238891 | [
"MIT"
] | null | null | null | src/water_management/exceptionclass.py | viswan29/watermanagement | ba5d3215d3799c0f56ceca96d26fef71f0238891 | [
"MIT"
] | null | null | null | src/water_management/exceptionclass.py | viswan29/watermanagement | ba5d3215d3799c0f56ceca96d26fef71f0238891 | [
"MIT"
] | null | null | null | """
Exception class to raise exception
"""
class NotAllowed(Exception):
def __init__(self, m):
self.message = m
def __str__(self):
return self.message | 22.625 | 35 | 0.624309 |
7c444482693018e16692dc279e14b1d1e0457cb0 | 29,058 | py | Python | smac/epm/gp_kernels.py | TheVinhLuong102/AutoML-SMAC3 | d4cb7ed76e0fbdd9edf6ab5360ff75de67ac2195 | [
"BSD-3-Clause"
] | 711 | 2016-08-22T14:23:29.000Z | 2022-03-29T21:56:12.000Z | smac/epm/gp_kernels.py | TheVinhLuong102/AutoML-SMAC3 | d4cb7ed76e0fbdd9edf6ab5360ff75de67ac2195 | [
"BSD-3-Clause"
] | 770 | 2016-08-17T14:39:07.000Z | 2022-03-31T11:35:58.000Z | smac/epm/gp_kernels.py | TheVinhLuong102/AutoML-SMAC3 | d4cb7ed76e0fbdd9edf6ab5360ff75de67ac2195 | [
"BSD-3-Clause"
] | 210 | 2016-08-20T15:14:29.000Z | 2022-03-30T08:04:34.000Z | from inspect import signature, Signature
import math
from typing import Optional, Union, Tuple, List, Callable, Dict, Any
import numpy as np
import sklearn.gaussian_process.kernels as kernels
import scipy.optimize
import scipy.spatial.distance
import scipy.special
from smac.epm.gp_base_prior import Prior
__copyright... | 38.744 | 143 | 0.585381 |
965dd39191fb85a1cd5cc660b762a93ec4b7f71e | 578 | py | Python | dots_connect_deta/board/signal.py | Sinha-Ujjawal/dots-connect-deta | cdb9ab69a22b8623a1265d565ee2e9dd91b1f1fe | [
"MIT"
] | null | null | null | dots_connect_deta/board/signal.py | Sinha-Ujjawal/dots-connect-deta | cdb9ab69a22b8623a1265d565ee2e9dd91b1f1fe | [
"MIT"
] | null | null | null | dots_connect_deta/board/signal.py | Sinha-Ujjawal/dots-connect-deta | cdb9ab69a22b8623a1265d565ee2e9dd91b1f1fe | [
"MIT"
] | null | null | null | from typing import Set
from django import dispatch
from asgiref.sync import async_to_sync
from .channel import CHANNEL_LAYER
from .models import Room
BROADCAST_JOINED_USERS = dispatch.Signal(providing_args=["rooms"])
@dispatch.receiver(BROADCAST_JOINED_USERS)
def handle_broadcast_joined_users_signal(rooms: Set[Room]... | 28.9 | 70 | 0.685121 |
15b9c8cc14eea593c05cab912d60c7c442f54630 | 10,541 | py | Python | odps/df/backends/pd/engine.py | Emersonxuelinux/aliyun-odps-python-sdk | 0b38c777711c95ed1775fa67822febf88fc3d642 | [
"Apache-2.0"
] | null | null | null | odps/df/backends/pd/engine.py | Emersonxuelinux/aliyun-odps-python-sdk | 0b38c777711c95ed1775fa67822febf88fc3d642 | [
"Apache-2.0"
] | null | null | null | odps/df/backends/pd/engine.py | Emersonxuelinux/aliyun-odps-python-sdk | 0b38c777711c95ed1775fa67822febf88fc3d642 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding 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/LICENS... | 36.985965 | 108 | 0.598425 |
43f854c3d6aec2fc4d0873e91996f858f6ef0f12 | 347 | py | Python | setup.py | cpartington/bio-info | 698e8d14d14493fbb03727e08c282a49ef4c62e8 | [
"MIT"
] | null | null | null | setup.py | cpartington/bio-info | 698e8d14d14493fbb03727e08c282a49ef4c62e8 | [
"MIT"
] | null | null | null | setup.py | cpartington/bio-info | 698e8d14d14493fbb03727e08c282a49ef4c62e8 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(name="bio_info",
version="0.1",
description="Basic algorithms for DNA manipulation.",
url="http://github.com/cpartington/bio-info",
author="Christie Partington",
packages=find_packages(),
install_requires=[
"progressbar2",
... | 26.692308 | 59 | 0.634006 |
ea072951b9b00bb00588746d36c54cfb17c50c9b | 2,068 | py | Python | APIS/hn_submissions.py | portelaoliveira/CSV_e_JSON | 0c8c5b93f7a2ed4433d3133c93d004687aa4c497 | [
"MIT"
] | 2 | 2020-05-16T20:42:47.000Z | 2020-05-16T20:42:50.000Z | APIS/hn_submissions.py | portelaoliveira/CSV_e_JSON | 0c8c5b93f7a2ed4433d3133c93d004687aa4c497 | [
"MIT"
] | null | null | null | APIS/hn_submissions.py | portelaoliveira/CSV_e_JSON | 0c8c5b93f7a2ed4433d3133c93d004687aa4c497 | [
"MIT"
] | null | null | null | import requests
from operator import itemgetter
# Faz uma chamada de API e armazena a resposta.
url = 'https://hacker-news.firebaseio.com/v0/topstories.json'
''' Essa chamada de API devolve uma lista contendo os IDs dos 500 artigos mais populares do Hacker News
no momento em que a chamada é feita. '''
r = request... | 54.421053 | 164 | 0.738878 |
b78d556f91281dedab632b10471f4901fbe112b5 | 5,021 | py | Python | paddle/args.py | yongbowin/DuReader_annotation | 138f60558f3a4810c0f83d2e8fcac150220bab60 | [
"Apache-2.0"
] | null | null | null | paddle/args.py | yongbowin/DuReader_annotation | 138f60558f3a4810c0f83d2e8fcac150220bab60 | [
"Apache-2.0"
] | null | null | null | paddle/args.py | yongbowin/DuReader_annotation | 138f60558f3a4810c0f83d2e8fcac150220bab60 | [
"Apache-2.0"
] | null | null | null | # 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 appl... | 52.852632 | 96 | 0.63334 |
d60166f7cf1209dc961c5e3cf4a5db104789e471 | 13,219 | py | Python | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Tool/packaging/rpm.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | 9 | 2016-08-17T06:52:10.000Z | 2020-04-28T04:20:07.000Z | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Tool/packaging/rpm.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Tool/packaging/rpm.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | 1 | 2021-03-03T23:20:25.000Z | 2021-03-03T23:20:25.000Z | """SCons.Tool.Packaging.rpm
The rpm packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"... | 36.924581 | 125 | 0.603677 |
0966f0f37958359787704841a80dd130a6fe4ce0 | 201 | py | Python | Files.py/1035.py | gomes-gabriel/URI | 5c79eccb37cd0633c2ed58144e876013bfad679a | [
"MIT"
] | null | null | null | Files.py/1035.py | gomes-gabriel/URI | 5c79eccb37cd0633c2ed58144e876013bfad679a | [
"MIT"
] | null | null | null | Files.py/1035.py | gomes-gabriel/URI | 5c79eccb37cd0633c2ed58144e876013bfad679a | [
"MIT"
] | null | null | null | inp = list(map(int, input().split(' ')))
A, B, C, D = inp
if B > C and D > A and C + D > A + B and C > 0 and D > 0 and A % 2 == 0:
print('Valores aceitos')
else:
print('Valores nao aceitos')
| 22.333333 | 72 | 0.532338 |
78976e1146cb8cbd45848d4712610dbe13ec03d0 | 1,318 | py | Python | telebot/plugins/fleaveme.py | IloveOrbiter/TinyBot | 1b89757859f2c493f8405120b2b8e848e5c6b554 | [
"MIT"
] | null | null | null | telebot/plugins/fleaveme.py | IloveOrbiter/TinyBot | 1b89757859f2c493f8405120b2b8e848e5c6b554 | [
"MIT"
] | null | null | null | telebot/plugins/fleaveme.py | IloveOrbiter/TinyBot | 1b89757859f2c493f8405120b2b8e848e5c6b554 | [
"MIT"
] | null | null | null | # Credit: @r4v4n4
"""Emoji
Available Commands:
.fleave"""
import asyncio
from telebot import CMD_HELP
from telebot.utils import admin_cmd
@telebot.on(admin_cmd(pattern=r"(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 1
animation_ttl = range(0, 17)... | 23.122807 | 75 | 0.473445 |
866b30b219eb7d2fb9addc1d7524192cf8e94ceb | 4,889 | py | Python | data/train/python/866b30b219eb7d2fb9addc1d7524192cf8e94cebtest_install_repositories.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/866b30b219eb7d2fb9addc1d7524192cf8e94cebtest_install_repositories.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/866b30b219eb7d2fb9addc1d7524192cf8e94cebtest_install_repositories.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | import new, logging
import install_and_test_tool_shed_repositories.base.test_db_util as test_db_util
from install_and_test_tool_shed_repositories.base.twilltestcase import InstallTestRepository
log = logging.getLogger(__name__)
class InstallTestRepositories( InstallTestRepository ):
"""Abstract test case that ins... | 59.621951 | 139 | 0.701575 |
9bb62096bbcc81a262d4e34d1ef0f87d836bfc0f | 2,256 | py | Python | Source/Oyooni/Color Recognition/detect.py | Oyooni5245/Oyooni | a00b845ac97eaee74d40cab563b9532fdeca97c8 | [
"MIT"
] | null | null | null | Source/Oyooni/Color Recognition/detect.py | Oyooni5245/Oyooni | a00b845ac97eaee74d40cab563b9532fdeca97c8 | [
"MIT"
] | null | null | null | Source/Oyooni/Color Recognition/detect.py | Oyooni5245/Oyooni | a00b845ac97eaee74d40cab563b9532fdeca97c8 | [
"MIT"
] | null | null | null | import binascii
from PIL import Image
import numpy as np
import scipy
import scipy.misc
import scipy.cluster
def get_color_dict():
colorDict = dict()
colorDict['أسود'] = [0, 0, 0]
colorDict['رمادي'] = [127, 127, 127]
colorDict['خمري'] = [136, 0, 21]
colorDict['أحمر'] = [237, 28, 36]
colorDict['... | 33.176471 | 78 | 0.619681 |
7e3f39a20285dda504f52467117cfdd1bfe705c6 | 909 | py | Python | setup.py | jmfilipe/baselines | 8c7df56f6b74a7eb4915c0dda4b8ad5b0699fff2 | [
"MIT"
] | null | null | null | setup.py | jmfilipe/baselines | 8c7df56f6b74a7eb4915c0dda4b8ad5b0699fff2 | [
"MIT"
] | null | null | null | setup.py | jmfilipe/baselines | 8c7df56f6b74a7eb4915c0dda4b8ad5b0699fff2 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import sys
if sys.version_info.major != 3:
print('This Python is only compatible with Python 3, but you are running '
'Python {}. The installation will likely fail.'.format(sys.version_info.major))
setup(name='baselines',
packages=[package for package i... | 30.3 | 104 | 0.59516 |
1f2691723e4351ed2c6aa5bea6d289ffbafb5c72 | 2,692 | py | Python | see/classifier_helpers/fetch_data.py | emmaline11235/see-segment | df4b8f1524114c92b9fc16a5f751d9f60c0ee2fc | [
"MIT"
] | 2 | 2020-06-01T23:21:58.000Z | 2020-06-12T19:07:33.000Z | see/classifier_helpers/fetch_data.py | chenqili2020/see-segment | f8b9f2376e0b1713e287152bf6797282036d1579 | [
"MIT"
] | 27 | 2020-06-12T13:07:36.000Z | 2020-09-11T17:44:21.000Z | see/classifier_helpers/fetch_data.py | chenqili2020/see-segment | f8b9f2376e0b1713e287152bf6797282036d1579 | [
"MIT"
] | 12 | 2020-09-08T18:34:33.000Z | 2022-01-14T19:35:12.000Z | """The purpose of this file is to fetch or create data for benchmarking purposes."""
import numpy as np
import pandas as pd
from sklearn.datasets import make_moons, make_circles, make_classification
from sklearn.preprocessing import label_binarize, StandardScaler
def fetch_wisconsin_data():
"""Fetches Breast Can... | 30.247191 | 103 | 0.653789 |
0d9f3d7d41c7ea29dd838a75fcb322f8bf4d733e | 731 | py | Python | register.py | amane-katagiri/pykick | 6b59ac8c1fc101b66d6b2b5890b9a47b87436571 | [
"MIT"
] | null | null | null | register.py | amane-katagiri/pykick | 6b59ac8c1fc101b66d6b2b5890b9a47b87436571 | [
"MIT"
] | 1 | 2019-10-04T02:13:04.000Z | 2019-10-04T02:13:04.000Z | register.py | amane-katagiri/maruberu | dec81e6ac97022e0f99090a0b9919c60736e2445 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Convert from Markdown to reST before upload to PyPI."""
import doctest
from logging import DEBUG
from logging import getLogger
from logging import StreamHandler
import os
import pypandoc
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
lo... | 22.151515 | 58 | 0.686731 |
2af51ec5ea39fc9e05e60d75a518cb973e3de7e1 | 6,584 | py | Python | ostinato/statemachine/core.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 5 | 2015-01-28T09:56:48.000Z | 2020-05-22T21:07:30.000Z | ostinato/statemachine/core.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 18 | 2015-02-03T15:37:22.000Z | 2020-06-05T16:41:15.000Z | ostinato/statemachine/core.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 2 | 2015-02-23T19:34:59.000Z | 2017-01-22T02:10:12.000Z | class SMException(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return self.value
class InvalidState(SMException):
pass
class InvalidTransition(SMException):
pass
class InvalidStateMachine(SMException):
pass
class State(object):
verbose_nam... | 31.203791 | 88 | 0.581561 |
9c1bd6fd52ddf9bab9e3790370fbd21cbc791949 | 8,685 | py | Python | termsaverlib/screen/base/urlfetcher.py | EddieDover/termsaver | cf2410ba9159988dcb283f5885b8cfada4b81400 | [
"Apache-2.0"
] | 67 | 2015-01-27T07:06:20.000Z | 2022-03-27T11:24:27.000Z | termsaverlib/screen/base/urlfetcher.py | EddieDover/termsaver | cf2410ba9159988dcb283f5885b8cfada4b81400 | [
"Apache-2.0"
] | 31 | 2015-08-20T06:09:15.000Z | 2022-03-23T03:10:37.000Z | termsaverlib/screen/base/urlfetcher.py | EddieDover/termsaver | cf2410ba9159988dcb283f5885b8cfada4b81400 | [
"Apache-2.0"
] | 22 | 2015-07-15T17:25:11.000Z | 2021-06-03T10:39:42.000Z | ###############################################################################
#
# file: urlfetcher.py
#
# Purpose: refer to module documentation for details
#
# Note: This file is part of Termsaver application, and should not be used
# or executed separately.
#
#####################################... | 35.304878 | 80 | 0.602533 |
9c7f95a226448d29f02d4a7473e3114d2d79f8a4 | 5,819 | py | Python | concur/testing.py | potocpav/python-concur | 31b0a21f9fc64a517b139c3f2d050c8e17f50ca7 | [
"MIT"
] | 40 | 2019-10-24T12:58:23.000Z | 2020-12-13T20:22:41.000Z | concur/testing.py | potocpav/python-concur | 31b0a21f9fc64a517b139c3f2d050c8e17f50ca7 | [
"MIT"
] | 33 | 2020-01-27T18:42:06.000Z | 2020-11-19T22:13:46.000Z | concur/testing.py | potocpav/python-concur | 31b0a21f9fc64a517b139c3f2d050c8e17f50ca7 | [
"MIT"
] | 4 | 2019-11-25T14:37:29.000Z | 2021-12-22T13:49:41.000Z | """ Routines for automated testing.
The current automation/testing setup is work-in-progress, and the interface may change radically
in future versions. There are some usability issues that I am not entirely happy with.
See the [tests directory](https://github.com/potocpav/python-concur/tree/master/tests) for usage e... | 29.841026 | 111 | 0.612133 |
1d5e1b736ec1a7cc2d193c6cc9f0a1df94e06cf7 | 794 | py | Python | core/urls.py | Romski19/recipe-app-api | 6387e17bf9397c8bd0eb3d508e3076fc8cc68bca | [
"MIT"
] | null | null | null | core/urls.py | Romski19/recipe-app-api | 6387e17bf9397c8bd0eb3d508e3076fc8cc68bca | [
"MIT"
] | null | null | null | core/urls.py | Romski19/recipe-app-api | 6387e17bf9397c8bd0eb3d508e3076fc8cc68bca | [
"MIT"
] | null | null | null | """core URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | 30.538462 | 77 | 0.700252 |
bbdfd88d53f330b4f840e6e3a03b0e23f9b30190 | 13,908 | py | Python | mobilenet_emotions/train.py | HikkaV/OAHEGA | 0396cac52a360940234fdb64f5ea9ee55dab579c | [
"MIT"
] | 1 | 2021-10-04T07:43:58.000Z | 2021-10-04T07:43:58.000Z | mobilenet_emotions/train.py | HikkaV/OAHEGA | 0396cac52a360940234fdb64f5ea9ee55dab579c | [
"MIT"
] | 3 | 2021-02-08T13:30:46.000Z | 2022-02-10T03:59:35.000Z | mobilenet_emotions/train.py | HikkaV/OAHEGA | 0396cac52a360940234fdb64f5ea9ee55dab579c | [
"MIT"
] | null | null | null | import datetime
import os
import random
from math import ceil
import cv2
import keras
import pandas as pd
from skimage import transform
from custom_callbacks import AdditionalMetrics
from helper import *
from keras.callbacks import ReduceLROnPlateau
from keras_preprocessing.image import ImageDataGenerator
from sklearn.... | 49.319149 | 126 | 0.5348 |
e1b7bb8be128ddbd82b5432d9ee8750ebe989e10 | 1,149 | py | Python | tests/bisque/test_dome.py | ASTROGBAE/POCS | ddbc716ba375be92c7af1c8ebd536f9cdbc899da | [
"MIT"
] | 69 | 2015-08-27T01:17:26.000Z | 2022-01-05T19:11:09.000Z | tests/bisque/test_dome.py | ASTROGBAE/POCS | ddbc716ba375be92c7af1c8ebd536f9cdbc899da | [
"MIT"
] | 1,094 | 2016-01-19T18:18:06.000Z | 2022-03-17T04:28:38.000Z | tests/bisque/test_dome.py | ASTROGBAE/POCS | ddbc716ba375be92c7af1c8ebd536f9cdbc899da | [
"MIT"
] | 65 | 2015-08-27T01:17:28.000Z | 2021-02-24T04:12:03.000Z | import os
import pytest
from panoptes.pocs.dome.bisque import Dome
from panoptes.pocs.utils.theskyx import TheSkyX
pytestmark = pytest.mark.skipif(TheSkyX().is_connected is False, reason="TheSkyX is not connected")
@pytest.fixture(scope="function")
def dome(config):
try:
del os.environ['POCSTIME']
e... | 21.679245 | 99 | 0.70322 |
54230b9623ccab7c9100b84d99e4c30066cf5374 | 474 | py | Python | src/django-nonrel/tests/regressiontests/syndication/models.py | adamjmcgrath/glancydesign | 826ede7c639879d5b79ee730eb5e91422768cb02 | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | tests/regressiontests/syndication/models.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | tests/regressiontests/syndication/models.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | from django.db import models
class Entry(models.Model):
title = models.CharField(max_length=200)
date = models.DateTimeField()
class Meta:
ordering = ('date',)
def __unicode__(self):
return self.title
def get_absolute_url(self):
return "/blog/%s/" % self.pk
class Articl... | 19.75 | 44 | 0.654008 |
bdb3c87f5a919c78455ab2dfc478c4d9a5475ae7 | 3,204 | py | Python | tests/test_issues/output/issue_80.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 25 | 2019-07-05T01:16:18.000Z | 2021-03-22T20:49:25.000Z | tests/test_issues/output/issue_80.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 299 | 2019-03-05T15:15:30.000Z | 2021-04-08T23:25:41.000Z | tests/test_issues/output/issue_80.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 19 | 2019-05-23T17:46:47.000Z | 2021-03-25T06:45:55.000Z | # Auto generated from issue_80.yaml by pythongen.py version: 0.9.0
# Generation date: 2021-01-04 21:53
# Schema: Issue_80_test_case
#
# id: http://example.org/issues/80
# description: Example identifier
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
import re
from typing im... | 33.030928 | 90 | 0.724095 |
7f9f4799105a225a6ea04adeef35b0b90930536c | 1,617 | py | Python | generate.py | rubarb666/ebay-listings | 115a0dd24fe8f48727880bb2c71b6d0dbadbbd12 | [
"CC0-1.0"
] | 13 | 2015-10-31T05:09:25.000Z | 2022-01-23T14:02:31.000Z | generate.py | rubarb666/ebay-listings | 115a0dd24fe8f48727880bb2c71b6d0dbadbbd12 | [
"CC0-1.0"
] | 1 | 2015-04-26T22:54:34.000Z | 2015-04-26T22:54:34.000Z | generate.py | rubarb666/ebay-listings | 115a0dd24fe8f48727880bb2c71b6d0dbadbbd12 | [
"CC0-1.0"
] | 14 | 2015-04-26T20:57:30.000Z | 2021-08-10T02:02:09.000Z | #!/usr/bin/env python
# encoding: utf-8
import os
import logging
logger = logging.getLogger(__name__)
from jinja2 import Environment, FileSystemLoader
def get_args():
from argparse import ArgumentParser
parser = ArgumentParser(description="TODO: description of the utility")
parser.add_argument("-v", "--... | 29.944444 | 134 | 0.649969 |
2c9ffa69c9ed458ca0f4b5d9bf560c8fc25a06fe | 4,029 | py | Python | alipay/aop/api/request/AlipayEbppIndustryBizinfoQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppIndustryBizinfoQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppIndustryBizinfoQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayEbppIndustryBizinfoQueryModel import AlipayEbppIndustryBizinfoQueryModel
class AlipayEbppIndustryBizinfoQueryReq... | 27.786207 | 166 | 0.647803 |
c69640f4be2a2ba9a21c5374db6a94711e50784a | 1,075 | py | Python | aspdotnet/datadog_checks/aspdotnet/config_models/defaults.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | aspdotnet/datadog_checks/aspdotnet/config_models/defaults.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | aspdotnet/datadog_checks/aspdotnet/config_models/defaults.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.base.utils.models.fields import get_default_field_value
def shared_service(field, value):
return get_default_field_value(field, value)
def instance_additional_metrics(field, val... | 21.938776 | 75 | 0.782326 |
855f6c3d13ea323f94f6d77571e5ce1fd32711ee | 347 | py | Python | mezaext/admin.py | PixxxeL/mezaext | 7b2c437af567bd7c515ac67d2966dc7b1d41123a | [
"MIT"
] | null | null | null | mezaext/admin.py | PixxxeL/mezaext | 7b2c437af567bd7c515ac67d2966dc7b1d41123a | [
"MIT"
] | null | null | null | mezaext/admin.py | PixxxeL/mezaext | 7b2c437af567bd7c515ac67d2966dc7b1d41123a | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
from django.contrib import admin
from django.contrib.admin.decorators import register
from .models import EditableBlock
@register(EditableBlock)
class EditableBlockAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('title',), }
list_display = ('title', 'slug', 'enabled',)
li... | 24.785714 | 52 | 0.714697 |
efa3b0ab4f5130620c60dc9ab036f1216574323e | 698 | py | Python | ex100.py | Jordemar-D-Bousquet/Exercicios_Python | 705d4c83720db033841f01aa843e4dbab08f1423 | [
"MIT"
] | null | null | null | ex100.py | Jordemar-D-Bousquet/Exercicios_Python | 705d4c83720db033841f01aa843e4dbab08f1423 | [
"MIT"
] | null | null | null | ex100.py | Jordemar-D-Bousquet/Exercicios_Python | 705d4c83720db033841f01aa843e4dbab08f1423 | [
"MIT"
] | null | null | null | # Faça um programa que tenha uma lista chamada números e duas funções chamadas sorteia() e somaPar().
# A primeira função vai sortear 5 números e vai colocá-los dentro da lista
# e a segunda função vai mostrar a soma entre todos os valores pares sorteados pela função anterior.
from random import randint
def sortei... | 18.368421 | 101 | 0.647564 |
195d2e973b5d87fc84d40576c276efb54761fa99 | 15,990 | py | Python | pyspectools/routines.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 22 | 2018-03-14T10:44:17.000Z | 2022-01-10T15:02:37.000Z | pyspectools/routines.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 21 | 2019-07-27T01:43:50.000Z | 2021-11-15T14:57:15.000Z | pyspectools/routines.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 3 | 2020-08-03T16:22:00.000Z | 2021-11-01T15:31:55.000Z | """ Routines to:
Parse cat files
Run SPFIT and/or SPCAT
"""
import os
import subprocess
import shutil
import json
import types
from typing import List, Any, Union, Dict, Tuple
from glob import glob
from warnings import warn
import ruamel.yaml as yaml
import numpy as np
import joblib
import paramiko
def run_... | 31.230469 | 112 | 0.62339 |
d4f32a171e56d5c67e77eb56401b6053ad674fd6 | 337 | py | Python | ibl_fiberfluo_pilot_01/tasks/_iblrig_NPH_tasks_trainingChoiceWorld/scratch.py | int-brain-lab/personal_project_protocols | c20f923c1596384ba585164d65c3a40d58d8cbb1 | [
"MIT"
] | null | null | null | ibl_fiberfluo_pilot_01/tasks/_iblrig_NPH_tasks_trainingChoiceWorld/scratch.py | int-brain-lab/personal_project_protocols | c20f923c1596384ba585164d65c3a40d58d8cbb1 | [
"MIT"
] | null | null | null | ibl_fiberfluo_pilot_01/tasks/_iblrig_NPH_tasks_trainingChoiceWorld/scratch.py | int-brain-lab/personal_project_protocols | c20f923c1596384ba585164d65c3a40d58d8cbb1 | [
"MIT"
] | null | null | null | import pandas as pd
import scipy as sp
f = 'C:\\iblrig_data\\Subjects\\_iblrig_calibration\\2018-12-04\\4\\raw_behavior_data\\_iblrig_calibration_water_function.csv'
df1 = pd.read_csv(f)
time2vol = sp.interpolate.pchip(df1["open_time"], df1["weight_perdrop"])
x=0
while np.round(time2vol(x),... | 33.7 | 126 | 0.682493 |
41962bedfd252e8e534cc6fab2b83e2856dcb17f | 49,507 | py | Python | TurtleArt/taprimitive.py | sugar-activities/4742-activity | f1827d2f7e3363cb09211c7b190ee9f8ec4b124f | [
"MIT"
] | null | null | null | TurtleArt/taprimitive.py | sugar-activities/4742-activity | f1827d2f7e3363cb09211c7b190ee9f8ec4b124f | [
"MIT"
] | null | null | null | TurtleArt/taprimitive.py | sugar-activities/4742-activity | f1827d2f7e3363cb09211c7b190ee9f8ec4b124f | [
"MIT"
] | null | null | null | #Copyright (c) 2013 Marion Zepf
#Copyright (c) 2014 Walter Bender
#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 without limitation the rights
#to use, copy, mod... | 40.282343 | 79 | 0.5619 |
958410d4da1d15ee447645aa34382ef730ce3626 | 2,445 | py | Python | utils/data_utils.py | enricomeloni/covid-tools | 6920b8cfa0eb89bdb7e0ba96ecc74831185c44a7 | [
"MIT"
] | 1 | 2020-10-06T16:03:01.000Z | 2020-10-06T16:03:01.000Z | utils/data_utils.py | enricomeloni/covid-tools | 6920b8cfa0eb89bdb7e0ba96ecc74831185c44a7 | [
"MIT"
] | 3 | 2022-02-13T20:21:56.000Z | 2022-02-27T10:19:23.000Z | utils/data_utils.py | sailab-code/learning-sidarthe | 6920b8cfa0eb89bdb7e0ba96ecc74831185c44a7 | [
"MIT"
] | null | null | null | import pandas as pd
def select_regions(df, regions, col_name="denominazione_regione"):
"""
Select rows by values in regions from column col_name
:param df: pandas dataFrame
:param regions: a list of values
:param col_name: a string indicating the column
:return: a new DataFrame with only the s... | 35.955882 | 105 | 0.666258 |
5835925f843940a3ebbd8324c0629c340190ffd4 | 2,219 | py | Python | koans/about_sets.py | gtl-nitin-thakkar/koans-playground-master | 3701a71c8e1d498c0ebdb62d1c8b026da345f2c9 | [
"MIT"
] | null | null | null | koans/about_sets.py | gtl-nitin-thakkar/koans-playground-master | 3701a71c8e1d498c0ebdb62d1c8b026da345f2c9 | [
"MIT"
] | null | null | null | koans/about_sets.py | gtl-nitin-thakkar/koans-playground-master | 3701a71c8e1d498c0ebdb62d1c8b026da345f2c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutSets(Koan):
def test_sets_make_keep_lists_unique(self):
highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas', 'MacLeod', 'Malcolm', 'MacLeod']
there_can_only_be_only_one = set(highlanders)
self.assert... | 39.625 | 99 | 0.59982 |
77ea87e82bb6548a1e6c5ce65f8a883229f00bb0 | 2,288 | py | Python | csm4cobra/manipulate.py | migp11/csm4cobra | af1b9ed03935180e936d3faa3b2cb0bf77764255 | [
"MIT"
] | 1 | 2019-07-22T10:08:01.000Z | 2019-07-22T10:08:01.000Z | csm4cobra/manipulate.py | migp11/csm4cobra | af1b9ed03935180e936d3faa3b2cb0bf77764255 | [
"MIT"
] | null | null | null | csm4cobra/manipulate.py | migp11/csm4cobra | af1b9ed03935180e936d3faa3b2cb0bf77764255 | [
"MIT"
] | 1 | 2021-07-02T10:43:51.000Z | 2021-07-02T10:43:51.000Z | import warnings
from cobra.core import Reaction
from cobra.core import Metabolite
from cobra.flux_analysis.deletion import find_gene_knockout_reactions
def set_medium(model, medium, skip_absent=True, inplace=False):
if not inplace:
model = model.copy()
def set_active_bound(reaction, bound):
i... | 29.333333 | 120 | 0.653409 |
ab2c1b1c702a7bb04612d2f98cdd8a5cbce765c3 | 1,967 | py | Python | task/migrations/0001_initial.py | toladata/TolaProfile | 0e8e904ef518a1835e815999e1015ff692d48cad | [
"Apache-2.0"
] | null | null | null | task/migrations/0001_initial.py | toladata/TolaProfile | 0e8e904ef518a1835e815999e1015ff692d48cad | [
"Apache-2.0"
] | 16 | 2017-07-12T09:44:34.000Z | 2017-07-31T14:51:45.000Z | task/migrations/0001_initial.py | toladata/TolaProfile | 0e8e904ef518a1835e815999e1015ff692d48cad | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-04 12:52
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | 49.175 | 222 | 0.628876 |
4f7a2600ed206762b73d2e3ee0edeedc44338d8b | 6,993 | py | Python | fairseq/tasks/language_modeling.py | zjumml/multilingual-kd-pytorch | a369a3edb08e255ba024cf76b00cc5a8d057bd2c | [
"BSD-3-Clause"
] | 77 | 2019-04-29T01:56:04.000Z | 2022-03-19T08:05:55.000Z | fairseq/tasks/language_modeling.py | zjumml/multilingual-kd-pytorch | a369a3edb08e255ba024cf76b00cc5a8d057bd2c | [
"BSD-3-Clause"
] | 6 | 2019-04-29T05:36:16.000Z | 2021-12-06T02:41:12.000Z | fairseq/tasks/language_modeling.py | zjumml/multilingual-kd-pytorch | a369a3edb08e255ba024cf76b00cc5a8d057bd2c | [
"BSD-3-Clause"
] | 22 | 2019-04-28T04:39:41.000Z | 2022-03-19T03:13:16.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import itertools
import numpy as n... | 39.286517 | 120 | 0.611898 |
1b60117ebdd7beb9c69d1ee7662ec8d4a18ca818 | 3,416 | py | Python | lib/SetAPI/genome/GenomeSetInterfaceV1.py | slebras/SetAPI | 95fb805d8b5c2deba62c3bd89c47b379c802995f | [
"MIT"
] | null | null | null | lib/SetAPI/genome/GenomeSetInterfaceV1.py | slebras/SetAPI | 95fb805d8b5c2deba62c3bd89c47b379c802995f | [
"MIT"
] | 18 | 2016-10-25T23:28:01.000Z | 2021-07-14T18:48:51.000Z | lib/SetAPI/genome/GenomeSetInterfaceV1.py | slebras/SetAPI | 95fb805d8b5c2deba62c3bd89c47b379c802995f | [
"MIT"
] | 14 | 2016-10-24T21:46:39.000Z | 2021-03-12T15:25:31.000Z | from SetAPI.generic.SetInterfaceV1 import SetInterfaceV1
class GenomeSetInterfaceV1:
def __init__(self, workspace_client):
self.ws = workspace_client
self.setInterface = SetInterfaceV1(workspace_client)
def save_genome_set(self, ctx, params):
"""
by default save 'KBaseSets.Ge... | 35.957895 | 107 | 0.608314 |
630094049d7ae527d08aba5d512a4e5626037861 | 128 | py | Python | app/server/auth/jwt_handler.py | CSE-510-Aarogya/DP-Backend | 1192689d1db29269b54c2c3f23db3eced0bd35c7 | [
"MIT"
] | null | null | null | app/server/auth/jwt_handler.py | CSE-510-Aarogya/DP-Backend | 1192689d1db29269b54c2c3f23db3eced0bd35c7 | [
"MIT"
] | null | null | null | app/server/auth/jwt_handler.py | CSE-510-Aarogya/DP-Backend | 1192689d1db29269b54c2c3f23db3eced0bd35c7 | [
"MIT"
] | null | null | null | version https://git-lfs.github.com/spec/v1
oid sha256:80f9103b2cfae7ab16652a7c65849a6474fbda672d008e1ff6a0902ff8b91ec7
size 723
| 32 | 75 | 0.882813 |
960b072feadd053bac41c7a58587f8225944e145 | 11,081 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/redis.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/redis.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/redis.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: redis
short_description: Various re... | 33.477341 | 137 | 0.603104 |
26de70ed7cb894c60fdce2b60715aeedc72d05ba | 1,439 | py | Python | cc_pseudo_crawl/get_stats.py | edugp/data_tooling | bfa94bc916bcaa2c341586b2d14dd783be7d1972 | [
"Apache-2.0"
] | null | null | null | cc_pseudo_crawl/get_stats.py | edugp/data_tooling | bfa94bc916bcaa2c341586b2d14dd783be7d1972 | [
"Apache-2.0"
] | null | null | null | cc_pseudo_crawl/get_stats.py | edugp/data_tooling | bfa94bc916bcaa2c341586b2d14dd783be7d1972 | [
"Apache-2.0"
] | null | null | null | import logging
from argparse import ArgumentParser
from pathlib import Path
from datasets import concatenate_datasets, load_dataset, load_from_disk
from datasets.utils.logging import set_verbosity_info
set_verbosity_info()
logger = logging.getLogger(__name__)
def get_args():
parser = ArgumentParser()
parser... | 30.617021 | 141 | 0.691452 |
3218b63fa10474eb6a3d38c414453f241a5f62dc | 12,198 | py | Python | lib/galaxy/managers/collections_util.py | common-workflow-language/galaxy | fd644561a80c682d99105a45294c8938b05f2ef6 | [
"CC-BY-3.0"
] | 10 | 2016-05-04T22:03:18.000Z | 2019-05-28T23:34:06.000Z | lib/galaxy/managers/collections_util.py | common-workflow-language/galaxy | fd644561a80c682d99105a45294c8938b05f2ef6 | [
"CC-BY-3.0"
] | 125 | 2015-10-19T20:20:33.000Z | 2021-11-11T17:04:38.000Z | lib/galaxy/managers/collections_util.py | common-workflow-language/galaxy | fd644561a80c682d99105a45294c8938b05f2ef6 | [
"CC-BY-3.0"
] | 3 | 2017-05-30T19:23:31.000Z | 2021-11-08T20:07:24.000Z | import logging
import math
from galaxy import exceptions, model, web
from galaxy.util import string_as_bool
log = logging.getLogger(__name__)
ERROR_MESSAGE_UNKNOWN_SRC = "Unknown dataset source (src) %s."
ERROR_MESSAGE_NO_NESTED_IDENTIFIERS = "Dataset source new_collection requires nested element_identifiers for new... | 43.409253 | 151 | 0.704706 |
3d1407cb5e16c3b69f2e4425efcafbb15c473247 | 6,025 | py | Python | engine.py | PrismaH/tetrisRL | 5678751dde5aabcd4518c68103bbec9ef72306a7 | [
"MIT"
] | null | null | null | engine.py | PrismaH/tetrisRL | 5678751dde5aabcd4518c68103bbec9ef72306a7 | [
"MIT"
] | null | null | null | engine.py | PrismaH/tetrisRL | 5678751dde5aabcd4518c68103bbec9ef72306a7 | [
"MIT"
] | null | null | null | #from __future__ import print_function
import numpy as np
import random
shapes = {
'T': [(0, 0), (-1, 0), (1, 0), (0, -1)],
'J': [(0, 0), (-1, 0), (0, -1), (0, -2)],
'L': [(0, 0), (1, 0), (0, -1), (0, -2)],
'Z': [(0, 0), (-1, 0), (0, -1), (1, -1)],
'S': [(0, 0), (-1, -1), (0, -1), (1, 0)],
'I'... | 30.897436 | 107 | 0.542241 |
73797e7dd9f15de84a80928ee26101c3637e2381 | 5,796 | py | Python | ginga/cairow/ImageViewCanvasTypesCairo.py | sosey/ginga | cbcd6b88f58a8327d8dfb3cde4a50df68b184974 | [
"BSD-3-Clause"
] | null | null | null | ginga/cairow/ImageViewCanvasTypesCairo.py | sosey/ginga | cbcd6b88f58a8327d8dfb3cde4a50df68b184974 | [
"BSD-3-Clause"
] | null | null | null | ginga/cairow/ImageViewCanvasTypesCairo.py | sosey/ginga | cbcd6b88f58a8327d8dfb3cde4a50df68b184974 | [
"BSD-3-Clause"
] | null | null | null | #
# ImageViewCanvasTypesCairo.py -- drawing classes for ImageViewCanvas widget
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import math
import cairo
from ginga impor... | 29.876289 | 90 | 0.578675 |
e0cc7a825508ee86d377ba87a1aef719e5628aba | 22,147 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_authorizations_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_authorizations_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_authorizations_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # 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 ... | 51.504651 | 232 | 0.680453 |
a1e6771d743295873aabe4bcce51ec0cae5efe05 | 1,885 | py | Python | AB/pythonfunctions/search/lambda_function.py | PatrickJD/AWS | c7f976c0c5795ac43803ac201dbb57d584308bb0 | [
"MIT"
] | null | null | null | AB/pythonfunctions/search/lambda_function.py | PatrickJD/AWS | c7f976c0c5795ac43803ac201dbb57d584308bb0 | [
"MIT"
] | null | null | null | AB/pythonfunctions/search/lambda_function.py | PatrickJD/AWS | c7f976c0c5795ac43803ac201dbb57d584308bb0 | [
"MIT"
] | null | null | null | import json
import requests
import boto3
import os
from elasticsearch import Elasticsearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
url = os.environ.get("SEARCH_ENDPOINT", None)
# Process DynamoDB Stream records and insert the object in ElasticSearch
# Use the Table name as index and doc_type n... | 32.5 | 143 | 0.65252 |
11986e39937d7ac1fa7d35246cc3dfeeab01e4b1 | 6,554 | py | Python | demo.py | Kazuhito00/iris-detection-using-py-mediapipe | 85ead970598017967937d3f5d7ffe6238aa3fe9b | [
"Apache-2.0"
] | 26 | 2021-02-06T09:47:29.000Z | 2022-02-22T07:26:16.000Z | demo.py | Kazuhito00/iris-detection-using-py-mediapipe | 85ead970598017967937d3f5d7ffe6238aa3fe9b | [
"Apache-2.0"
] | 1 | 2021-12-09T12:11:46.000Z | 2021-12-09T12:23:38.000Z | demo.py | Kazuhito00/iris-detection-using-py-mediapipe | 85ead970598017967937d3f5d7ffe6238aa3fe9b | [
"Apache-2.0"
] | 12 | 2021-04-02T02:41:45.000Z | 2021-12-06T05:25:25.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import argparse
import cv2 as cv
import numpy as np
from utils import CvFpsCalc
from face_mesh.face_mesh import FaceMesh
from iris_landmark.iris_landmark import IrisLandmark
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--d... | 31.661836 | 79 | 0.561489 |
c3f7e6570cfddccaa1b153a44c093eedd8a3627c | 7,151 | py | Python | user_interface/test/test_dakota_class.py | ukaea/ALC_UQ | a2747c94036b04f1279abb5683c6a225a878aea3 | [
"Apache-2.0"
] | 2 | 2021-11-24T10:43:50.000Z | 2021-12-07T20:02:38.000Z | user_interface/test/test_dakota_class.py | ukaea/ALC_UQ | a2747c94036b04f1279abb5683c6a225a878aea3 | [
"Apache-2.0"
] | null | null | null | user_interface/test/test_dakota_class.py | ukaea/ALC_UQ | a2747c94036b04f1279abb5683c6a225a878aea3 | [
"Apache-2.0"
] | null | null | null | from dakota_class import DakotaClass
from exceptions import *
import unittest
import xarray as xr
import numpy as np
import os
class TestDakotaClass(unittest.TestCase):
# Try and create an instance of the dakota class
def test_create_dakota_template(self):
my_dakota = DakotaClass()
s... | 34.379808 | 116 | 0.583974 |
4d00cd3d2aba5f017b6beb2e85eb69d78bdeea1e | 1,835 | py | Python | api/dependencies.py | Ju99ernaut/mailer | 9ae97bcc1979a022a22f92631946754e8e77e5a8 | [
"MIT"
] | null | null | null | api/dependencies.py | Ju99ernaut/mailer | 9ae97bcc1979a022a22f92631946754e8e77e5a8 | [
"MIT"
] | null | null | null | api/dependencies.py | Ju99ernaut/mailer | 9ae97bcc1979a022a22f92631946754e8e77e5a8 | [
"MIT"
] | null | null | null | import data.users as data
from typing import Optional
from fastapi import Depends, HTTPException, status
from fastapi.security import OAuth2PasswordBearer
from jose import JWTError, jwt
from models import TokenData, User
from constants import SECRET_KEY, ALGORITHM, ACTIVE_KEY, ROLE_KEY
oauth2_scheme = OAuth2Password... | 32.192982 | 88 | 0.712807 |
731ddc33ed519a924d5721b4dbdb9356b6d338d0 | 13,480 | py | Python | intervalBatchLearn.py | lukinio/Continual-Learning-Benchmark | f971d98b42230f5a0a0bec3e772da2c96e1be10f | [
"MIT"
] | null | null | null | intervalBatchLearn.py | lukinio/Continual-Learning-Benchmark | f971d98b42230f5a0a0bec3e772da2c96e1be10f | [
"MIT"
] | null | null | null | intervalBatchLearn.py | lukinio/Continual-Learning-Benchmark | f971d98b42230f5a0a0bec3e772da2c96e1be10f | [
"MIT"
] | 2 | 2021-04-11T13:53:18.000Z | 2021-04-26T11:27:46.000Z | import os
import sys
import argparse
import torch
from torch.utils.data import DataLoader
import numpy as np
from random import shuffle
from collections import OrderedDict
import dataloaders.base
from dataloaders.datasetGen import SplitGen, PermutedGen
import agents
import gc
def run(args):
# Prepare dataloaders
... | 56.166667 | 188 | 0.632864 |
5b4b3a6f978c0fd15bd5a67c3b47a46e5ae0e357 | 24,814 | py | Python | tensorflow/python/distribute/cross_device_utils.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | 2 | 2019-01-07T03:20:51.000Z | 2019-01-07T07:11:48.000Z | tensorflow/python/distribute/cross_device_utils.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/cross_device_utils.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | 2 | 2019-12-17T09:27:07.000Z | 2020-05-24T13:09:49.000Z | # Copyright 2018 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 applica... | 36.925595 | 102 | 0.699404 |
1c63a15ee781acc702bdc4233b7bf46e1d128f96 | 161 | py | Python | NFTmash/blueprints/main.py | cvasqxz/NFTmash | 451af3a7f6cfa78f51b3a6897e653a6fd1b50fc3 | [
"MIT"
] | null | null | null | NFTmash/blueprints/main.py | cvasqxz/NFTmash | 451af3a7f6cfa78f51b3a6897e653a6fd1b50fc3 | [
"MIT"
] | null | null | null | NFTmash/blueprints/main.py | cvasqxz/NFTmash | 451af3a7f6cfa78f51b3a6897e653a6fd1b50fc3 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template
bp = Blueprint('main', __name__, url_prefix='/')
@bp.route("/")
def index():
return render_template("about.html") | 23 | 48 | 0.726708 |
da3faa01b594dfdadc453d1230226dcb7c72b44d | 3,343 | py | Python | aiida/plugins/utils.py | joepvd/aiida_core | 6e9711046753332933f982971db1d7ac7e7ade58 | [
"BSD-2-Clause"
] | null | null | null | aiida/plugins/utils.py | joepvd/aiida_core | 6e9711046753332933f982971db1d7ac7e7ade58 | [
"BSD-2-Clause"
] | null | null | null | aiida/plugins/utils.py | joepvd/aiida_core | 6e9711046753332933f982971db1d7ac7e7ade58 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 30.953704 | 83 | 0.635657 |
62f65090dd8e5c6dfaf77f13f899ca27f67b3e1e | 929 | py | Python | test/test_update_list_object.py | imissyouso/textmagic-rest-python | 172c4c2bd588119eb97cdfaab3d8ba24bf3f3e09 | [
"MIT"
] | 2 | 2020-10-21T09:44:33.000Z | 2021-06-29T20:58:57.000Z | test/test_update_list_object.py | imissyouso/textmagic-rest-python | 172c4c2bd588119eb97cdfaab3d8ba24bf3f3e09 | [
"MIT"
] | null | null | null | test/test_update_list_object.py | imissyouso/textmagic-rest-python | 172c4c2bd588119eb97cdfaab3d8ba24bf3f3e09 | [
"MIT"
] | 1 | 2021-12-02T12:15:56.000Z | 2021-12-02T12:15:56.000Z | # coding: utf-8
"""
TextMagic API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unit... | 22.658537 | 119 | 0.709365 |
d2ac47a7a2da7cca001189e8d7feda0f89e9ffc5 | 134 | py | Python | apps/polls/admin.py | vanderland/vdl_site | 43b9ad3e5e7b9a2d35fc3cbb6a378cc8374699f1 | [
"MIT"
] | null | null | null | apps/polls/admin.py | vanderland/vdl_site | 43b9ad3e5e7b9a2d35fc3cbb6a378cc8374699f1 | [
"MIT"
] | null | null | null | apps/polls/admin.py | vanderland/vdl_site | 43b9ad3e5e7b9a2d35fc3cbb6a378cc8374699f1 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Question, Choice
admin.site.register(Question)
admin.site.register(Choice) | 22.333333 | 37 | 0.791045 |
e8312a019877c4e6a6cf4f44e083a3b761812316 | 1,763 | py | Python | towers/core/validation.py | sys-git/towers | 1b654620ba7a87b09d563e3b846180149860fb81 | [
"MIT"
] | null | null | null | towers/core/validation.py | sys-git/towers | 1b654620ba7a87b09d563e3b846180149860fb81 | [
"MIT"
] | 243 | 2017-09-13T07:18:13.000Z | 2022-03-31T12:31:24.000Z | towers/core/validation.py | sys-git/towers | 1b654620ba7a87b09d563e3b846180149860fb81 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# @module towers.core.validation
# @version 0.1
# @copyright (c) 2017-present Francis Horsman.
import abc
import six
from .errors import InvalidMoves, InvalidRods, InvalidTowerHeight
__all__ = [
'Validatable',
'validate_height',
'validate_rods',
'va... | 22.0375 | 69 | 0.621668 |
3b16ac2822a83bda6209950b55c561675504a040 | 2,302 | py | Python | examples/plot_spam.py | emptymalei/forest-confidence-interval | b8bd6c92b3035df9eaafd213b621086264959953 | [
"MIT"
] | 250 | 2016-07-19T11:50:39.000Z | 2022-03-21T18:30:10.000Z | examples/plot_spam.py | emptymalei/forest-confidence-interval | b8bd6c92b3035df9eaafd213b621086264959953 | [
"MIT"
] | 72 | 2016-07-19T16:16:22.000Z | 2022-03-14T16:32:58.000Z | examples/plot_spam.py | emptymalei/forest-confidence-interval | b8bd6c92b3035df9eaafd213b621086264959953 | [
"MIT"
] | 45 | 2016-07-19T18:40:47.000Z | 2021-11-23T03:25:02.000Z | """
=========================================
Plotting Classification Forest Error Bars
=========================================
This example demonstrates the calculation of confidence intervals for
:class:`sklearn.ensemble.RandomForestClassifier` objects.
The data used here are synthetically generated to simulate a... | 35.415385 | 78 | 0.688966 |
3dd5b64560b48ac517151b3fa72802f7f80d8afc | 12,176 | py | Python | mmdet/datasets/cityscapes.py | zehuichen123/mmdet2.0 | a491935af7b9e42ded1e44045b550171fec76deb | [
"Apache-2.0"
] | 13 | 2021-04-26T08:33:00.000Z | 2022-03-30T03:29:36.000Z | mmdet/datasets/cityscapes.py | rechardgu0816/Instance-segmentation-tianchi | 1d950cfd92ea9b4861fa189709d1cee3fc1b59aa | [
"MIT"
] | 14 | 2021-06-24T07:02:38.000Z | 2022-03-18T21:25:47.000Z | mmdet/datasets/cityscapes.py | rechardgu0816/Instance-segmentation-tianchi | 1d950cfd92ea9b4861fa189709d1cee3fc1b59aa | [
"MIT"
] | 3 | 2021-10-21T11:42:32.000Z | 2022-03-26T08:30:34.000Z | # Modified from https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/datasets/cityscapes.py # noqa
# and https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/evaluation/evalInstanceLevelSemanticLabeling.py # noqa
import glob
import os
import os.path as osp
import tempfile
i... | 41.414966 | 135 | 0.574819 |
4b645000c3191c1ae2c81a305b6c17dd26da6d76 | 415 | py | Python | RateMySchoolProject/RateMySchoolProject/wsgi.py | Tesfa-eth/web_application | 90c062b18de39ed2a53367da4641b4ef942ea70b | [
"MIT"
] | null | null | null | RateMySchoolProject/RateMySchoolProject/wsgi.py | Tesfa-eth/web_application | 90c062b18de39ed2a53367da4641b4ef942ea70b | [
"MIT"
] | null | null | null | RateMySchoolProject/RateMySchoolProject/wsgi.py | Tesfa-eth/web_application | 90c062b18de39ed2a53367da4641b4ef942ea70b | [
"MIT"
] | null | null | null | """
WSGI config for RateMySchoolProject 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/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('... | 24.411765 | 79 | 0.79759 |
4c17786d0788b6d262c209f20a45e503bdd52d3b | 896 | py | Python | examples/ttgo/axp202_pek_sleep.py | OPHoperHPO/lv_micropython | 64389d2b51ea7e0c998d67dc89821d1ce280c267 | [
"MIT"
] | 49 | 2020-07-22T14:41:53.000Z | 2022-01-24T00:27:58.000Z | examples/ttgo/axp202_pek_sleep.py | OPHoperHPO/lv_micropython | 64389d2b51ea7e0c998d67dc89821d1ce280c267 | [
"MIT"
] | 12 | 2020-08-01T03:09:00.000Z | 2021-12-06T16:13:13.000Z | examples/ttgo/axp202_pek_sleep.py | OPHoperHPO/lv_micropython | 64389d2b51ea7e0c998d67dc89821d1ce280c267 | [
"MIT"
] | 13 | 2020-07-27T17:52:31.000Z | 2022-02-20T21:28:40.000Z | import lvgl as lv
import machine
import esp32
import ttgo
def axp_callback(pin):
power.clearIRQ()
print("PEK was pressed! Go to sleep!!!!")
watch.tft.backlight_fade(0)
watch.tft.display_sleep()
watch.power_off()
power.setPowerOutPut(ttgo.axp202.AXP202_LDO2, False)
esp32.wake_on_ext1((machi... | 20.837209 | 65 | 0.735491 |
8347ddea23290086517effe80e9875a48b893899 | 421 | py | Python | tweetguru/migrations/0007_auto_20190122_1818.py | MaciejWWojcik/twitter-influencer-searcher | 0b8b05aaa3540eeefcb2a728c5bce2fc5913446e | [
"MIT"
] | null | null | null | tweetguru/migrations/0007_auto_20190122_1818.py | MaciejWWojcik/twitter-influencer-searcher | 0b8b05aaa3540eeefcb2a728c5bce2fc5913446e | [
"MIT"
] | 9 | 2018-11-15T15:30:13.000Z | 2019-01-20T01:40:05.000Z | tweetguru/migrations/0007_auto_20190122_1818.py | MaciejWWojcik/twitter-influencer-searcher | 0b8b05aaa3540eeefcb2a728c5bce2fc5913446e | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2019-01-22 18:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tweetguru', '0006_auto_20190121_1623'),
]
operations = [
migrations.AddField(
model_name='userrank',
name='score',
... | 21.05 | 49 | 0.598575 |
f455d101077213feddd1c2e03eef3f19062c002e | 3,032 | py | Python | s3_scripts/sensor_test.py | garciart/SmartSensor | 9aef5b7d47ee56f249ba22ab3d8c61ef9c62e6e9 | [
"MIT"
] | null | null | null | s3_scripts/sensor_test.py | garciart/SmartSensor | 9aef5b7d47ee56f249ba22ab3d8c61ef9c62e6e9 | [
"MIT"
] | null | null | null | s3_scripts/sensor_test.py | garciart/SmartSensor | 9aef5b7d47ee56f249ba22ab3d8c61ef9c62e6e9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Sensor and LCD output test.
Python version used: 3.6.8
See requirements.txt for additional dependencies
Styling guide: PEP 8 -- Style Guide for Python Code
(https://www.python.org/dev/peps/pep-0008/) and
PEP 257 -- Docstring Conventions
(https://www.python.org/... | 31.915789 | 82 | 0.569921 |
bf4ff72c26db6ace4996f9265681c46a165b1427 | 4,264 | py | Python | ggjxx/src/game/game.py | Jbat1Jumper/GGJ2020 | 49dbbced90b235fd2e3a036a170a619aa6bb1830 | [
"CC0-1.0"
] | null | null | null | ggjxx/src/game/game.py | Jbat1Jumper/GGJ2020 | 49dbbced90b235fd2e3a036a170a619aa6bb1830 | [
"CC0-1.0"
] | 1 | 2020-02-02T05:53:14.000Z | 2020-02-02T05:53:14.000Z | ggjxx/src/game/game.py | Jbat1Jumper/GGJ2020 | 49dbbced90b235fd2e3a036a170a619aa6bb1830 | [
"CC0-1.0"
] | null | null | null | from .cell import Cell
from .constants import UP, DOWN, RIGHT, LEFT, MOVEMENT_NOT_ALLOWED, MOVEMENT_DONE, KILL_ROBOT
from ..structure.levels.base_level import BaseLevel
from .map import Map
from copy import deepcopy
class Game:
def __init__(self, gameLevel):
self.initialGameLevel = gameLevel
self.... | 26.987342 | 93 | 0.611163 |
6e21ab3fea8e31841c188b088f28448b521ccef0 | 26,486 | py | Python | src/sage/modular/local_comp/type_space.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | src/sage/modular/local_comp/type_space.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | src/sage/modular/local_comp/type_space.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | r"""
Type spaces of newforms
Let `f` be a new modular eigenform of level `\Gamma_1(N)`, and `p` a prime
dividing `N`, with `N = Mp^r` (`M` coprime to `p`). Suppose the power of `p`
dividing the conductor of the character of `f` is `p^c` (so `c \le r`).
Then there is an integer `u`, which is `\operatorname{min}([r/2],... | 36.837274 | 233 | 0.551008 |
49dcc20dfc2db8f3d051660d2365ed41f17707b0 | 1,004 | py | Python | nhk.py | daite/crawl | 7ffe3e9daf8956f959ca5258ece60c86217e727f | [
"MIT"
] | 2 | 2020-12-25T09:29:02.000Z | 2020-12-27T07:25:07.000Z | nhk.py | daite/crawl | 7ffe3e9daf8956f959ca5258ece60c86217e727f | [
"MIT"
] | null | null | null | nhk.py | daite/crawl | 7ffe3e9daf8956f959ca5258ece60c86217e727f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
import sys
import os
headers = {'User-Agent':
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3)"\
"AppleWebKit/537.36 (KHTML, like Gecko) "\
"Chrome/66.0.3359.181 Safari/537.36"}
ffmpeg_command = 'ffmpeg -i "{}" ... | 27.888889 | 66 | 0.614542 |
bd598c9985c1c3b8c29ec2a444cf7b99543efb7f | 1,628 | py | Python | numba/cuda/tests/cudapy/test_debuginfo.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/tests/cudapy/test_debuginfo.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/tests/cudapy/test_debuginfo.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | from __future__ import print_function, absolute_import
from numba.tests.support import override_config, TestCase
from numba.cuda.testing import skip_on_cudasim
from numba import unittest_support as unittest
from numba import cuda, types
from numba.cuda.testing import SerialMixin
@skip_on_cudasim('Simulator does not ... | 28.561404 | 66 | 0.621007 |
07bdadd43d6a23e11203a7f693bbd7f031e9e93e | 3,195 | py | Python | cloud/cloud/doctype/cloud_company_group/cloud_company_group.py | srdgame/symlink_cloud | 0df41d9cd9c9757cf5e96f6bea841c3b86de8ee1 | [
"MIT"
] | 1 | 2021-07-25T08:53:01.000Z | 2021-07-25T08:53:01.000Z | cloud/cloud/doctype/cloud_company_group/cloud_company_group.py | srdgame/symlink_cloud | 0df41d9cd9c9757cf5e96f6bea841c3b86de8ee1 | [
"MIT"
] | null | null | null | cloud/cloud/doctype/cloud_company_group/cloud_company_group.py | srdgame/symlink_cloud | 0df41d9cd9c9757cf5e96f6bea841c3b86de8ee1 | [
"MIT"
] | 6 | 2017-04-02T04:01:08.000Z | 2021-12-22T10:43:29.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Dirk Chang and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _dict, throw, _
from frappe.model.document import Document
from cloud.cloud.doctype.cloud_company.cloud_company import lis... | 31.633663 | 119 | 0.692645 |
0b05e635c25a3ed622bbf56ed86cd201a9be8b7e | 4,942 | py | Python | ml_model.py | Calsowah/testingAzurePython | 9c046490b3a37e90e9c73b3b483f33f82034bf64 | [
"MIT"
] | null | null | null | ml_model.py | Calsowah/testingAzurePython | 9c046490b3a37e90e9c73b3b483f33f82034bf64 | [
"MIT"
] | null | null | null | ml_model.py | Calsowah/testingAzurePython | 9c046490b3a37e90e9c73b3b483f33f82034bf64 | [
"MIT"
] | null | null | null | import pandas as pd
import re
import numpy as np
import math
from sklearn.naive_bayes import BernoulliNB
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection import ShuffleSplit
from collections import Counter, defaultdict
#
data = '/Users/bryankamau/Documents/SPRING 2019/CS 5412/testingAzurePyth... | 30.134146 | 107 | 0.726427 |
13d7ea5ccf93465aee1b87e7d4ff9e7180bdadc2 | 9,640 | py | Python | install.py | HuskyHacks/O-Course | aa6faa93f391bf6a30784cba6e66a18f316a6401 | [
"MIT"
] | 12 | 2020-11-10T22:40:57.000Z | 2022-01-14T03:35:19.000Z | install.py | HuskyHacks/O-Course | aa6faa93f391bf6a30784cba6e66a18f316a6401 | [
"MIT"
] | null | null | null | install.py | HuskyHacks/O-Course | aa6faa93f391bf6a30784cba6e66a18f316a6401 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
###############################################################################
# #
# HuskyHacks | HackerOne | The O-Course #
# ... | 38.870968 | 143 | 0.333091 |
96d974cb83c864017afdfd935e44bd91b17deaa0 | 13,432 | py | Python | generated/intermediate/ansible-module-sdk/azure_rm_azurefirewall_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/intermediate/ansible-module-sdk/azure_rm_azurefirewall_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/intermediate/ansible-module-sdk/azure_rm_azurefirewall_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 28.762313 | 288 | 0.562239 |
ad73466591099ef862437b050bf1b9bb1f862570 | 1,434 | py | Python | grifo/snippets/models.py | pavelsimo/Grifo | aff3c6e2c2d5ad7598e5c6d022b444d3ed78e0d2 | [
"MIT"
] | null | null | null | grifo/snippets/models.py | pavelsimo/Grifo | aff3c6e2c2d5ad7598e5c6d022b444d3ed78e0d2 | [
"MIT"
] | null | null | null | grifo/snippets/models.py | pavelsimo/Grifo | aff3c6e2c2d5ad7598e5c6d022b444d3ed78e0d2 | [
"MIT"
] | null | null | null | import logging
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext as _
logger = logging.getLogger(__name__)
class SnippetCategory(models.Model):
name = models.CharField(max_length=255, blank=False, verbose_name=_('Name'))
created_at = model... | 34.142857 | 95 | 0.723152 |
e3dafcac2831ff9e3b48ced286eff2313eeca3b1 | 1,159 | py | Python | examples-turtle/fractal-tree.py | data-octo/python_by_examples | e67b037f5051802e6aef7e0be3cca7e426a07bae | [
"MIT"
] | null | null | null | examples-turtle/fractal-tree.py | data-octo/python_by_examples | e67b037f5051802e6aef7e0be3cca7e426a07bae | [
"MIT"
] | null | null | null | examples-turtle/fractal-tree.py | data-octo/python_by_examples | e67b037f5051802e6aef7e0be3cca7e426a07bae | [
"MIT"
] | null | null | null | import turtle
WIDTH = 15
BRANCH_LENGTH = 120
ROTATION_LENGTH = 27
class Tree_Fractal(turtle.Turtle):
def __init__(self, level):
super(Tree_Fractal, self).__init__()
self.level = level
self.hideturtle()
self.speed('fastest')
self.left(90)
self.width(WIDTH)
s... | 25.195652 | 52 | 0.604832 |
448183a516311fe26c30e916b8da81cf3b6177f4 | 6,117 | py | Python | PongG.py | lilJDoesntknow/CSC290-Pong | cea2a0d3d0d11ccee6e3987834424f97cb7ffc37 | [
"MIT"
] | null | null | null | PongG.py | lilJDoesntknow/CSC290-Pong | cea2a0d3d0d11ccee6e3987834424f97cb7ffc37 | [
"MIT"
] | null | null | null | PongG.py | lilJDoesntknow/CSC290-Pong | cea2a0d3d0d11ccee6e3987834424f97cb7ffc37 | [
"MIT"
] | null | null | null | import pygame
pygame.init()
win = pygame.display.set_mode((1300,700))
pygame.display.set_caption("Pong")
player1x = 0
player1y = 300
player2x = 1280
player2y = 300
ballx = 650
bally = 350
ballSpeedy = 3
ballSpeedx = 3
width = 20
height = 100
speedy = 5
vel = 5
screen_h = 500
screen_w = 700
# class of setups
clas... | 30.893939 | 115 | 0.566618 |
8471aca774dcabfdf3fa18f8c2c36e6aabaa8a15 | 6,007 | py | Python | test/test_lean_minhash.py | sergiiz/datasketch | 52f7d6ab575e7a3bf72417301170f141e3e66fe2 | [
"MIT"
] | 1,771 | 2015-04-07T18:06:02.000Z | 2022-03-31T17:45:24.000Z | test/test_lean_minhash.py | sergiiz/datasketch | 52f7d6ab575e7a3bf72417301170f141e3e66fe2 | [
"MIT"
] | 159 | 2015-08-15T09:47:58.000Z | 2022-03-22T12:55:21.000Z | test/test_lean_minhash.py | sergiiz/datasketch | 52f7d6ab575e7a3bf72417301170f141e3e66fe2 | [
"MIT"
] | 278 | 2015-04-08T13:50:27.000Z | 2022-03-02T13:00:33.000Z | import unittest
import struct
import pickle
import numpy as np
from datasketch import MinHash
from datasketch import LeanMinHash
from test.utils import fake_hash_func
class TestLeanMinHash(unittest.TestCase):
def test_init(self):
m1 = MinHash(4, 1, hashfunc=fake_hash_func)
m2 = MinHash(4, 1, hashf... | 31.450262 | 76 | 0.592975 |
4ba0ce5eec3e7db362e26eb57dd2691239363aae | 2,875 | py | Python | gammapy/spectrum/tests/test_simulation.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | gammapy/spectrum/tests/test_simulation.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | gammapy/spectrum/tests/test_simulation.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_allclose
import astropy.units as u
from ...utils.energy import EnergyBounds
from ...irf import EnergyDispersion, EffectiveAreaTable
from .. import SpectrumExtraction, SpectrumSimulation
from ..models impo... | 38.333333 | 84 | 0.665739 |
162237756458723ff0e4c63858aa3ed42445e5fb | 5,204 | py | Python | python/realbeam_experiments/clamped_beam_Case_B.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | 4 | 2022-02-10T02:28:42.000Z | 2022-02-10T07:28:35.000Z | python/realbeam_experiments/clamped_beam_Case_B.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | null | null | null | python/realbeam_experiments/clamped_beam_Case_B.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Benchmark against real beam (3cm x 3cm x 10cm) - Case B
# ------------------------------------------------------------------------------
### Import some useful functions
import sys
sys.path.append('../')
from pathlib import Path
import... | 32.525 | 163 | 0.623559 |
9d1c3b91016d7d2bf1a8c6f301cf0edf36199f0f | 1,298 | py | Python | tests/changes/vcs/test_base.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | 1 | 2015-11-08T13:00:44.000Z | 2015-11-08T13:00:44.000Z | tests/changes/vcs/test_base.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | tests/changes/vcs/test_base.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from changes.models import Revision
from changes.vcs.base import RevisionResult
from changes.testutils.cases import TestCase
class RevisionResultTestCase(TestCase):
def test_simple(self):
repo = self.create_repo()
result = RevisionResult(
id='c' * 40,
... | 36.055556 | 75 | 0.61094 |
f30b2d0b45ec15060fb348e33aff51e7a5c90d94 | 15,382 | py | Python | glance/tests/unit/api/test_cmd_cache_manage.py | wkoathp/glance | eb0c47047ddc28371f546437118986ed904f41d3 | [
"Apache-2.0"
] | null | null | null | glance/tests/unit/api/test_cmd_cache_manage.py | wkoathp/glance | eb0c47047ddc28371f546437118986ed904f41d3 | [
"Apache-2.0"
] | null | null | null | glance/tests/unit/api/test_cmd_cache_manage.py | wkoathp/glance | eb0c47047ddc28371f546437118986ed904f41d3 | [
"Apache-2.0"
] | null | null | null | # 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, software
# d... | 42.96648 | 79 | 0.638994 |
968692208f5dc7cb4600cc6f1b7b256f30dc6df3 | 6,918 | py | Python | tests/python/unittest/test_arith_const_int_bound.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | 1 | 2021-03-07T15:30:16.000Z | 2021-03-07T15:30:16.000Z | tests/python/unittest/test_arith_const_int_bound.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_arith_const_int_bound.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | 1 | 2020-02-09T10:42:31.000Z | 2020-02-09T10:42:31.000Z | import tvm
def test_dtype_bound():
analyzer = tvm.arith.Analyzer()
x = tvm.var("x", dtype="int64")
bd = analyzer.const_int_bound(x)
assert bd.min_value == bd.NEG_INF
assert bd.max_value == bd.POS_INF
x = tvm.var("x", dtype="int8")
bd = analyzer.const_int_bound(x)
assert bd.min_value =... | 31.445455 | 86 | 0.655103 |
3ea324d3b9714799658908b07c4b68292621f9be | 26 | py | Python | assetsy/constants.py | syrusakbary/assetsy | f7b7a9eeab858b0950bcf86113dead6b2c9972ab | [
"BSD-3-Clause"
] | 1 | 2017-06-27T05:10:51.000Z | 2017-06-27T05:10:51.000Z | assetsy/constants.py | syrusakbary/assetsy | f7b7a9eeab858b0950bcf86113dead6b2c9972ab | [
"BSD-3-Clause"
] | null | null | null | assetsy/constants.py | syrusakbary/assetsy | f7b7a9eeab858b0950bcf86113dead6b2c9972ab | [
"BSD-3-Clause"
] | null | null | null | DEFAULT_ALIAS = 'default'
| 13 | 25 | 0.769231 |
cf302f8b0ad3e6d99868e810b0b644665fd76b98 | 3,566 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # 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 ... | 46.921053 | 151 | 0.65816 |
286b85389e55a25dd2beb39a3607f3290c48217b | 8,056 | py | Python | twisted/plugins/cowrie_plugin.py | matricali/cowrie | 720cbd5065d890d261aa54b54c61b840f24e7ec0 | [
"BSD-3-Clause"
] | 1 | 2018-08-11T18:29:07.000Z | 2018-08-11T18:29:07.000Z | twisted/plugins/cowrie_plugin.py | anitazhaochen/cowrie | 6f5edd3b77163976208acf932513355a7e424b9b | [
"BSD-3-Clause"
] | null | null | null | twisted/plugins/cowrie_plugin.py | anitazhaochen/cowrie | 6f5edd3b77163976208acf932513355a7e424b9b | [
"BSD-3-Clause"
] | 1 | 2019-12-20T20:07:39.000Z | 2019-12-20T20:07:39.000Z | # Copyright (c) 2015 Michel Oosterhof <michel@oosterhof.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, th... | 36.785388 | 120 | 0.653426 |
0f10ca0e10c1c9ea5310c7ff86d31536d7dbc2cd | 2,384 | py | Python | setup.py | crazy-penguins/raft | 3eb829f1c0d90608743cadac4c5a04017c93c607 | [
"BSD-2-Clause"
] | null | null | null | setup.py | crazy-penguins/raft | 3eb829f1c0d90608743cadac4c5a04017c93c607 | [
"BSD-2-Clause"
] | null | null | null | setup.py | crazy-penguins/raft | 3eb829f1c0d90608743cadac4c5a04017c93c607 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# Support setuptools only, distutils has a divergent and more annoying API and
# few folks will lack setuptools.
from setuptools import setup, find_packages
import sys
# Version info -- read without importing
_locals = {}
with open("raft/_version.py") as fp:
exec(fp.read(), None, _locals)
ve... | 33.577465 | 78 | 0.651846 |
9b711051461c35952291ec76ef7e2173413f6a71 | 23,178 | py | Python | submodules/ethio/kivy/trace_plot.py | BerkeleyLab/CMOC | 79601fc64afde369a8e0534c3e87eb29cd927299 | [
"BSD-3-Clause-LBNL"
] | 3 | 2018-12-07T06:01:36.000Z | 2022-02-07T17:56:15.000Z | submodules/ethio/kivy/trace_plot.py | BerkeleyLab/CMOC | 79601fc64afde369a8e0534c3e87eb29cd927299 | [
"BSD-3-Clause-LBNL"
] | null | null | null | submodules/ethio/kivy/trace_plot.py | BerkeleyLab/CMOC | 79601fc64afde369a8e0534c3e87eb29cd927299 | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-12-05T07:15:41.000Z | 2019-12-05T07:15:41.000Z | from __future__ import division
import numpy as np
from scipy import signal
from collections import deque
from kivy.uix.boxlayout import BoxLayout
from kivy.logger import Logger
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvas
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.tic... | 39.218274 | 108 | 0.605186 |
f0f5ef476a079b6bf81e2a611af46084178fe0d8 | 1,512 | py | Python | scripts/sdk/gn/test_project/tests/e2e/test.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 210 | 2019-02-05T12:45:09.000Z | 2022-03-28T07:59:06.000Z | scripts/sdk/gn/test_project/tests/e2e/test.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 56 | 2021-06-03T03:16:25.000Z | 2022-03-20T01:07:44.000Z | scripts/sdk/gn/test_project/tests/e2e/test.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 73 | 2019-03-06T18:55:23.000Z | 2022-03-26T12:04:51.000Z | #!/usr/bin/env python2.7
import os
import sys
import unittest
import testing
# The path to GN SDK devtools. This is set in main()
TOOLS_DIR = None
class TestTesting(unittest.TestCase):
def test_popen(self):
"""A Smoke test to verify testing.popen() works as expected"""
with testing.popen(['echo', 'hello']... | 28 | 77 | 0.652778 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.