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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e5adc61d48ceb1a66a453a40b2dfbc7e3b71c63 | 2,391 | py | Python | src/components/roll_padding_2d_layer.py | morgannewellsun/Reverse-Conway | 1750bf6ab96b8d6ccc1d8905264097e091adb82c | [
"Unlicense"
] | 1 | 2022-03-13T22:44:53.000Z | 2022-03-13T22:44:53.000Z | src/components/roll_padding_2d_layer.py | morgannewellsun/Reverse-Conway | 1750bf6ab96b8d6ccc1d8905264097e091adb82c | [
"Unlicense"
] | null | null | null | src/components/roll_padding_2d_layer.py | morgannewellsun/Reverse-Conway | 1750bf6ab96b8d6ccc1d8905264097e091adb82c | [
"Unlicense"
] | null | null | null | import tensorflow as tf
class RollPadding2DLayer(tf.keras.layers.Layer):
def __init__(self, padding: int):
super(RollPadding2DLayer, self).__init__()
self._padding = padding
self._left_begin_arg = None
self._left_size_arg = None
self._right_begin_arg = None
self._r... | 50.87234 | 131 | 0.679214 |
781de0ee0a125c78df965d3af5495763cc850f0a | 5,227 | py | Python | assignments/assignment2/layers.py | NadyaStrogankova/dlcourse_ai | d03e3123b9f801fa3d801ab08e7327df5d48be43 | [
"MIT"
] | null | null | null | assignments/assignment2/layers.py | NadyaStrogankova/dlcourse_ai | d03e3123b9f801fa3d801ab08e7327df5d48be43 | [
"MIT"
] | null | null | null | assignments/assignment2/layers.py | NadyaStrogankova/dlcourse_ai | d03e3123b9f801fa3d801ab08e7327df5d48be43 | [
"MIT"
] | null | null | null | import numpy as np
def l2_regularization(W, reg_strength):
"""
Computes L2 regularization loss on weights and its gradient
Arguments:
W, np array - weights
reg_strength - float value
Returns:
loss, single value - l2 regularization loss
gradient, np.array same shape as W - gra... | 30.213873 | 109 | 0.619476 |
c445c834b4ffdeac10b5abd9a8513d8b99852eec | 952 | py | Python | ucb_cs61A/homework/hw07/tests/ordered.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | null | null | null | ucb_cs61A/homework/hw07/tests/ordered.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2017-07-31T08:15:26.000Z | 2017-07-31T08:15:26.000Z | ucb_cs61A/homework/hw07/tests/ordered.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2019-10-06T16:52:31.000Z | 2019-10-06T16:52:31.000Z | test = {
'name': 'ordered?',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (ordered? '(1 2 3 4 5)) ; True or False
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
scm> (order... | 19.833333 | 55 | 0.320378 |
a53a49aeb0420bd952ba0e4c9644602416921aaf | 211 | py | Python | 30_days/day_9_recursion.py | hsm207/hackerrank | 776e2f84036b5103c5fbb4d9855568ace0cdd042 | [
"Unlicense"
] | null | null | null | 30_days/day_9_recursion.py | hsm207/hackerrank | 776e2f84036b5103c5fbb4d9855568ace0cdd042 | [
"Unlicense"
] | null | null | null | 30_days/day_9_recursion.py | hsm207/hackerrank | 776e2f84036b5103c5fbb4d9855568ace0cdd042 | [
"Unlicense"
] | null | null | null | import sys
def factorial(n):
if n <= 1:
return 1
else:
return n * factorial(n - 1)
if __name__ == "__main__":
n = int(input().strip())
result = factorial(n)
print(result)
| 14.066667 | 35 | 0.540284 |
38cd4cf4c7f8c78775ecfe54cb26d47f43e90e21 | 1,695 | py | Python | examples/example_with_sound.py | bobatsar/moviepy | 17028410205a56f2937011e08ae0e91971e49318 | [
"MIT"
] | 3 | 2021-03-14T09:33:36.000Z | 2021-03-14T09:33:43.000Z | examples/example_with_sound.py | bobatsar/moviepy | 17028410205a56f2937011e08ae0e91971e49318 | [
"MIT"
] | 10 | 2016-08-27T04:01:32.000Z | 2017-10-30T06:43:49.000Z | examples/example_with_sound.py | bobatsar/moviepy | 17028410205a56f2937011e08ae0e91971e49318 | [
"MIT"
] | 2 | 2020-02-19T13:16:49.000Z | 2020-03-11T16:19:57.000Z | """
Description of the video:
The screen is split in two parts showing Carry and Audrey at the phone,
talking at the same time, because it is actually two scenes of a same
movie put together.
"""
from moviepy.editor import *
from moviepy.video.tools.drawing import color_split
duration = 6 # duration of the final cli... | 27.786885 | 71 | 0.545133 |
57e9fae5bf205bf80b84635bb9435ae7f109bad8 | 31,801 | py | Python | cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py | pci/kubernetes | 6a0d3c74949385494e42e5f9142925e851991ac8 | [
"Apache-2.0"
] | 1 | 2020-04-05T20:05:45.000Z | 2020-04-05T20:05:45.000Z | cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py | pci/kubernetes | 6a0d3c74949385494e42e5f9142925e851991ac8 | [
"Apache-2.0"
] | null | null | null | cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py | pci/kubernetes | 6a0d3c74949385494e42e5f9142925e851991ac8 | [
"Apache-2.0"
] | 1 | 2020-04-05T20:05:48.000Z | 2020-04-05T20:05:48.000Z | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | 36.344 | 101 | 0.689884 |
6617105cf3aa67f78b6b9eec23f38b5096a2bc0e | 1,706 | py | Python | sounds_data/fuck_fuck_data.py | MeetDevin/WebCrawler | 5cd4546c1a25fbe1466fafd0fcc3f050a69b44a8 | [
"Apache-2.0"
] | 3 | 2019-03-07T03:43:17.000Z | 2020-02-25T08:18:11.000Z | sounds_data/fuck_fuck_data.py | MeetDevin/ProjectX | 5cd4546c1a25fbe1466fafd0fcc3f050a69b44a8 | [
"Apache-2.0"
] | null | null | null | sounds_data/fuck_fuck_data.py | MeetDevin/ProjectX | 5cd4546c1a25fbe1466fafd0fcc3f050a69b44a8 | [
"Apache-2.0"
] | null | null | null | from PIL import Image
import numpy as np
import os
def windows(length, window_size):
start = 0
i = 0
while start < length:
yield start, start + window_size, i
start += int(window_size*0.5)
i += 1
def fuck_data(window_size=600):
files_path = 'images'
for train_class in o... | 29.413793 | 102 | 0.481243 |
d52ec64321ca0ebe0f9646dff56d9449604ee953 | 3,158 | py | Python | nikola/plugins/compile/rest/youtube.py | asmeurer/nikola | ea1c651bfed0fd6337f1d22cf8dd99899722912c | [
"MIT"
] | null | null | null | nikola/plugins/compile/rest/youtube.py | asmeurer/nikola | ea1c651bfed0fd6337f1d22cf8dd99899722912c | [
"MIT"
] | null | null | null | nikola/plugins/compile/rest/youtube.py | asmeurer/nikola | ea1c651bfed0fd6337f1d22cf8dd99899722912c | [
"MIT"
] | 1 | 2021-07-07T11:32:42.000Z | 2021-07-07T11:32:42.000Z | # -*- coding: utf-8 -*-
# Copyright © 2012-2020 Roberto Alsina and others.
# 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 t... | 32.895833 | 79 | 0.662445 |
063675fe71336d1faa28ddab3249b327d6aa567f | 801 | py | Python | Project/proj/blend.py | Zankhana1995/feature-detection-and-matching | 5a67fd4495232b6f8a38899194a6c87e2275619c | [
"MIT"
] | 1 | 2020-10-28T07:46:08.000Z | 2020-10-28T07:46:08.000Z | Project/proj/blend.py | Zankhana1995/feature-detection-and-matching | 5a67fd4495232b6f8a38899194a6c87e2275619c | [
"MIT"
] | null | null | null | Project/proj/blend.py | Zankhana1995/feature-detection-and-matching | 5a67fd4495232b6f8a38899194a6c87e2275619c | [
"MIT"
] | null | null | null | from proj.ransac import *
# this function will blend images
def blend(image2, homography, minX, minY, stitchedImage):
h = stitchedImage.shape[0]
w = stitchedImage.shape[1]
for i in range(h):
for j in range(w):
x1 = j - minX
y1 = i - minY
x2, y2 = project(x1, y1,... | 36.409091 | 109 | 0.524345 |
49c7c03e3d7250bcb7d8e8b26d7ca2565fc4dcd7 | 2,659 | py | Python | {{cookiecutter.python_name}}/setup.py | fcollonval/theme-cookiecutter | e95554b339bec0b4d44ee265a9d861f27e7db276 | [
"BSD-3-Clause"
] | 50 | 2019-02-21T08:11:57.000Z | 2022-03-30T21:22:45.000Z | {{cookiecutter.python_name}}/setup.py | fcollonval/theme-cookiecutter | e95554b339bec0b4d44ee265a9d861f27e7db276 | [
"BSD-3-Clause"
] | 14 | 2019-07-09T11:29:32.000Z | 2022-01-25T10:36:49.000Z | {{cookiecutter.python_name}}/setup.py | fcollonval/theme-cookiecutter | e95554b339bec0b4d44ee265a9d861f27e7db276 | [
"BSD-3-Clause"
] | 22 | 2019-07-09T11:30:08.000Z | 2022-01-12T09:27:46.000Z | """
{{ cookiecutter.python_name }} setup
"""
import json
import os
from jupyter_packaging import (
create_cmdclass, install_npm, ensure_targets,
combine_commands, skip_if_exists,
)
import setuptools
HERE = os.path.abspath(os.path.dirname(__file__))
# The name of the project
name = "{{ cookiecutter.python_nam... | 26.59 | 75 | 0.659646 |
4b82c970c0ad4a34c53bfad7f2d3db53344ec7f6 | 3,777 | py | Python | contrib/macdeploy/custom_dsstore.py | MCLXI/AceDOrig | ccd5cfefeaedaf1df18f72855ef304c26c54afd8 | [
"MIT"
] | 5 | 2018-07-02T20:00:11.000Z | 2019-08-06T13:34:58.000Z | contrib/macdeploy/custom_dsstore.py | MCLXI/AceDOrig | ccd5cfefeaedaf1df18f72855ef304c26c54afd8 | [
"MIT"
] | 9 | 2018-05-22T20:20:26.000Z | 2020-02-28T09:25:32.000Z | contrib/macdeploy/custom_dsstore.py | MCLXI/AceDOrig | ccd5cfefeaedaf1df18f72855ef304c26c54afd8 | [
"MIT"
] | 5 | 2019-03-28T17:55:21.000Z | 2020-05-05T16:50:08.000Z | #!/usr/bin/env python
# Copyright (c) 2013-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 61.918033 | 1,817 | 0.727562 |
0e82af05b7446f1c5794f7aee5045491b8ee4f6e | 12,915 | py | Python | tests/test_geocoder.py | ravik/mapbox-baseSDK | 2e24ff6e2b69db92f08f435f56021c0b65016277 | [
"MIT"
] | null | null | null | tests/test_geocoder.py | ravik/mapbox-baseSDK | 2e24ff6e2b69db92f08f435f56021c0b65016277 | [
"MIT"
] | null | null | null | tests/test_geocoder.py | ravik/mapbox-baseSDK | 2e24ff6e2b69db92f08f435f56021c0b65016277 | [
"MIT"
] | null | null | null | # coding=utf-8
import json
import re
import responses
import pytest
import mapbox
def test_geocoder_default_name():
"""Default name is set"""
geocoder = mapbox.Geocoder()
assert geocoder.name == 'mapbox.places'
def test_geocoder_name():
"""Named dataset name is set"""
geocoder = mapbox.Geocode... | 36.586402 | 226 | 0.66535 |
389ff68f5c61510cfd937c48b01a5f78bfd31731 | 8,355 | py | Python | venv/lib/python3.7/site-packages/nltk/cluster/kmeans.py | VighneshHarihar/Newsify | 321f5f65bb6983c0ca5a3864900b27ce36a32717 | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | venv/lib/python3.7/site-packages/nltk/cluster/kmeans.py | VighneshHarihar/Newsify | 321f5f65bb6983c0ca5a3864900b27ce36a32717 | [
"MIT"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | venv/lib/python3.7/site-packages/nltk/cluster/kmeans.py | VighneshHarihar/Newsify | 321f5f65bb6983c0ca5a3864900b27ce36a32717 | [
"MIT"
] | 7 | 2015-09-30T03:00:44.000Z | 2021-06-04T05:34:39.000Z | # Natural Language Toolkit: K-Means Clusterer
#
# Copyright (C) 2001-2020 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
import copy
import random
import sys
try:
import numpy
except ImportError:
pass
from nltk.cluster.util import... | 36.012931 | 88 | 0.590664 |
e965f9440012cbe0e542023ae99cce885454848e | 3,742 | py | Python | rqt_speech_status/src/rqt_speech_status/rqt_speech_status.py | mhri/mhri_tools | 329bdf3bd4939aab65262b1135d07c7e866a3892 | [
"Apache-2.0"
] | null | null | null | rqt_speech_status/src/rqt_speech_status/rqt_speech_status.py | mhri/mhri_tools | 329bdf3bd4939aab65262b1135d07c7e866a3892 | [
"Apache-2.0"
] | null | null | null | rqt_speech_status/src/rqt_speech_status/rqt_speech_status.py | mhri/mhri_tools | 329bdf3bd4939aab65262b1135d07c7e866a3892 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- encoding: utf8 -*-
import rospy
import rospkg
import os
import time
from qt_gui.plugin import Plugin
from python_qt_binding import loadUi
from python_qt_binding.QtWidgets import QWidget, QFrame, QListWidgetItem, QVBoxLayout, QHBoxLayout, QLabel, QLayout, QSizePolicy, QSpacerItem, QShortcut
... | 39.389474 | 152 | 0.719669 |
9863846d419af1635f56f4e76cfdfe972c716bae | 2,645 | py | Python | accelbyte_py_sdk/core/_config_repository.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/core/_config_repository.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/core/_config_repository.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | from __future__ import annotations
import json
from abc import ABC, abstractmethod
from os import environ
from pathlib import Path
from typing import Dict, Optional, Tuple, Union
class ConfigRepository(ABC):
@abstractmethod
def get_base_url(self) -> str:
pass
@abstractmethod
def get_client_i... | 25.679612 | 61 | 0.65293 |
c707b480d2182a0c3dfde1347e3e780eeb0c2da2 | 5,802 | py | Python | celer/tests/test_enet.py | Badr-MOUFAD/celer | 75e3a4c05a067574a7a75925e239310e97110e54 | [
"BSD-3-Clause"
] | null | null | null | celer/tests/test_enet.py | Badr-MOUFAD/celer | 75e3a4c05a067574a7a75925e239310e97110e54 | [
"BSD-3-Clause"
] | null | null | null | celer/tests/test_enet.py | Badr-MOUFAD/celer | 75e3a4c05a067574a7a75925e239310e97110e54 | [
"BSD-3-Clause"
] | null | null | null | from itertools import product
import pytest
import numpy as np
from numpy.linalg import norm
from numpy.testing import (assert_allclose, assert_array_less, assert_equal)
from sklearn.linear_model import (
enet_path, ElasticNet as sk_ElasticNet, ElasticNetCV as sk_ElasticNetCV)
from celer import Lasso, ElasticNet... | 32.965909 | 86 | 0.677008 |
debdbe5c50411acf4416b1fdc303d8d6042add40 | 1,670 | py | Python | applications/CoSimulationApplication/python_scripts/base_classes/co_simulation_convergence_criteria.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/CoSimulationApplication/python_scripts/base_classes/co_simulation_convergence_criteria.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/CoSimulationApplication/python_scripts/base_classes/co_simulation_convergence_criteria.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z | # Importing the Kratos Library
import KratosMultiphysics as KM
# CoSimulation imports
import KratosMultiphysics.CoSimulationApplication.co_simulation_tools as cs_tools
import KratosMultiphysics.CoSimulationApplication.colors as colors
class CoSimulationConvergenceCriteria:
"""Baseclass for the convergence criteri... | 29.298246 | 119 | 0.685629 |
3131d948edb26ef2b59ea8b15f45317018ede508 | 233 | py | Python | run.py | rafael1717y/dashboard_flask | 5eaa00d89b7d6ae46649c1e6e90c188025f7cc40 | [
"Apache-2.0"
] | null | null | null | run.py | rafael1717y/dashboard_flask | 5eaa00d89b7d6ae46649c1e6e90c188025f7cc40 | [
"Apache-2.0"
] | null | null | null | run.py | rafael1717y/dashboard_flask | 5eaa00d89b7d6ae46649c1e6e90c188025f7cc40 | [
"Apache-2.0"
] | null | null | null | from config import app_config, app_active
from app import create_app
config = app_config[app_active]
print(app_active)
if __name__ == '__main__':
create_app(config)
config.APP.run(host=config.IP_HOST, port=config.PORT_HOST) | 25.888889 | 62 | 0.781116 |
ad9da0cc0324bf08a7fdc13e3b3c6ddff6e66da9 | 5,292 | py | Python | sdk/python/pulumi_aws/securityhub/invite_accepter.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/securityhub/invite_accepter.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/securityhub/invite_accepter.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 41.023256 | 185 | 0.654573 |
227c62391caf338482f9203fc4200531b943502d | 9,016 | py | Python | reo/tests/test_tiered_energy_rate_and_profiler.py | sakshi-testing-reopt/REopt_Lite_API | 42040ed96998901d411ae87096420ae48cf5c01a | [
"BSD-3-Clause"
] | null | null | null | reo/tests/test_tiered_energy_rate_and_profiler.py | sakshi-testing-reopt/REopt_Lite_API | 42040ed96998901d411ae87096420ae48cf5c01a | [
"BSD-3-Clause"
] | null | null | null | reo/tests/test_tiered_energy_rate_and_profiler.py | sakshi-testing-reopt/REopt_Lite_API | 42040ed96998901d411ae87096420ae48cf5c01a | [
"BSD-3-Clause"
] | 1 | 2021-05-02T05:36:37.000Z | 2021-05-02T05:36:37.000Z | # *********************************************************************************
# REopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions a... | 91.070707 | 3,280 | 0.578971 |
5a2a2f242ff5861aa06b7ac8bedbea59a488a8ee | 4,660 | py | Python | back-propagation/bp-with-weightedCE/bp.py | shinmao/ML-_-DL | 9a378454502635d6b29a7bb8e85d849da154a114 | [
"MIT"
] | 2 | 2021-09-24T02:05:15.000Z | 2021-09-24T02:05:21.000Z | back-propagation/bp-with-weightedCE/bp.py | shinmao/ML-_-DL | 9a378454502635d6b29a7bb8e85d849da154a114 | [
"MIT"
] | null | null | null | back-propagation/bp-with-weightedCE/bp.py | shinmao/ML-_-DL | 9a378454502635d6b29a7bb8e85d849da154a114 | [
"MIT"
] | null | null | null | import numpy as np
import sklearn.datasets as sd
import matplotlib.pyplot as plt
from sklearn.linear_model import Perceptron
from sklearn.model_selection import train_test_split
'''
dataset:
X to be input with two features
y to be k = 2
'''
X, y = sd.make_moons(500, noise=0.4)
def plot(X1, X2, y):
color = {0: 'bl... | 33.049645 | 109 | 0.549356 |
eb84dd42d8add97a2ed6c889cff33a520d102298 | 2,031 | py | Python | optimism/test/testDofManager.py | btalamini/optimism | 023e1b2a0b137900a7517e4c7ac5056255cf7bbe | [
"MIT"
] | null | null | null | optimism/test/testDofManager.py | btalamini/optimism | 023e1b2a0b137900a7517e4c7ac5056255cf7bbe | [
"MIT"
] | 1 | 2022-03-12T00:01:12.000Z | 2022-03-12T00:01:12.000Z | optimism/test/testDofManager.py | btalamini/optimism | 023e1b2a0b137900a7517e4c7ac5056255cf7bbe | [
"MIT"
] | 3 | 2021-12-23T19:53:31.000Z | 2022-03-27T23:12:03.000Z | from optimism.JaxConfig import *
from optimism import Mesh
from optimism.test import MeshFixture
class DofManagerTest(MeshFixture.MeshFixture):
def setUp(self):
self.Nx = 4
self.Ny = 5
xRange = [0.,1.]
yRange = [0.,1.]
#self.targetDispGrad = np.array([[0.1, -... | 33.85 | 84 | 0.597243 |
50be3049a3933f4303e30fc9be0b3374df11e241 | 118 | py | Python | tests/fixtures/internal/subpackage_a/module_1.py | gitter-badger/dependenpy | db411b7bbd466b79064cbb419049f17cd3bff4c1 | [
"ISC"
] | 10 | 2020-01-08T10:42:32.000Z | 2021-07-08T01:58:08.000Z | tests/fixtures/internal/subpackage_a/module_1.py | gitter-badger/dependenpy | db411b7bbd466b79064cbb419049f17cd3bff4c1 | [
"ISC"
] | 18 | 2015-03-13T11:55:49.000Z | 2017-06-20T11:56:46.000Z | tests/fixtures/internal/subpackage_a/module_1.py | gitter-badger/dependenpy | db411b7bbd466b79064cbb419049f17cd3bff4c1 | [
"ISC"
] | 1 | 2019-12-10T18:32:05.000Z | 2019-12-10T18:32:05.000Z | import internal.subpackage_a.subpackage_1.module_i
class Class1(object):
def function(self):
import sys
| 16.857143 | 50 | 0.737288 |
6ba36e4304275749d37e8000ac203d05025f1129 | 6,578 | py | Python | furniture/demo_rl.py | clvrai/furniture | ed4a905e7beb1daf3af7717d979e0ba93421077a | [
"MIT"
] | 364 | 2019-11-20T16:28:39.000Z | 2022-03-28T23:00:19.000Z | furniture/demo_rl.py | whiteBerryJ/furniture | ed4a905e7beb1daf3af7717d979e0ba93421077a | [
"MIT"
] | 22 | 2019-11-24T08:27:22.000Z | 2022-03-31T23:30:25.000Z | furniture/demo_rl.py | whiteBerryJ/furniture | ed4a905e7beb1daf3af7717d979e0ba93421077a | [
"MIT"
] | 52 | 2019-11-21T01:01:01.000Z | 2022-03-02T11:52:53.000Z | """
Demonstration for RL experiments with new environment design.
This script tells you how to use our IKEA furniture assembly environment for RL
experiments and design your own reward function and task.
First, FurnitureExampleEnv shows you how to define a new task.
* `__init__`: sets environment- and task-specific c... | 29.630631 | 88 | 0.610368 |
f535105052079ab65987d0168ab0bea5d78c33e4 | 633 | py | Python | information_web/info/modules/admin/__init__.py | Fulaiy/information | 8b98072dffda3cbf4d30145f244ac8bf05e9cd96 | [
"MIT"
] | null | null | null | information_web/info/modules/admin/__init__.py | Fulaiy/information | 8b98072dffda3cbf4d30145f244ac8bf05e9cd96 | [
"MIT"
] | 3 | 2021-03-18T20:46:28.000Z | 2022-01-13T00:49:07.000Z | information_web/info/modules/admin/__init__.py | Fulaiy/information | 8b98072dffda3cbf4d30145f244ac8bf05e9cd96 | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask import redirect
from flask import request
from flask import session
from flask import url_for
admin_blu = Blueprint("admin",__name__,url_prefix='/admin')
from . import views
@admin_blu.before_request
def before_request():
# 判断如果不是登录页面的请求
if request.url.endswith(url_for... | 27.521739 | 59 | 0.693523 |
7f894aabb110b70f083bda11960bbc0d19f78c51 | 7,246 | py | Python | validation/scaler_validation.py | anonymous-profet2/profet | 902f8ea03a650f078a21722f5fe44ebfc5cfad41 | [
"MIT"
] | 1 | 2022-02-24T01:35:10.000Z | 2022-02-24T01:35:10.000Z | validation/scaler_validation.py | anonymous-profet/profet | cbe4991eb2282db8b94f6697c68434217742dbf7 | [
"MIT"
] | null | null | null | validation/scaler_validation.py | anonymous-profet/profet | cbe4991eb2282db8b94f6697c68434217742dbf7 | [
"MIT"
] | 13 | 2021-10-14T02:24:43.000Z | 2022-03-14T03:16:17.000Z | # profet: validate scaler prediction model
import pandas as pd
import numpy as np
import pickle
import math
from tqdm import tqdm
from sklearn.metrics import mean_absolute_percentage_error, r2_score, mean_squared_error
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--target_instance', type=st... | 51.757143 | 166 | 0.669197 |
f2262ccf67d9f3f1af5e6938a89d8dfbf49386fe | 1,332 | py | Python | src/debugbar/providers/DebugProvider.py | girardinsamuel/debugbar | 0a528be1b5ec06836a253264f1ae620d33eda42e | [
"MIT"
] | null | null | null | src/debugbar/providers/DebugProvider.py | girardinsamuel/debugbar | 0a528be1b5ec06836a253264f1ae620d33eda42e | [
"MIT"
] | null | null | null | src/debugbar/providers/DebugProvider.py | girardinsamuel/debugbar | 0a528be1b5ec06836a253264f1ae620d33eda42e | [
"MIT"
] | null | null | null | from masonite.providers import Provider
from ..Debugger import Debugger
from ..collectors.MessageCollector import MessageCollector
from ..collectors.PythonCollector import PythonCollector
from ..collectors.QueryCollector import QueryCollector
from ..collectors.KeyValueCollector import KeyValueCollector
from ..collector... | 41.625 | 101 | 0.728979 |
c2f869ab9bf6c9baa4eed6140b34d9a67e518e80 | 7,155 | py | Python | nltk/chat/eliza.py | SamuraiT/nltk3-alpha | 18a1a0ff8697eaeeb5d3c0bc6dad251d5b8fe931 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | nltk/chat/eliza.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | null | null | null | nltk/chat/eliza.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | 2 | 2019-10-28T01:33:22.000Z | 2019-10-30T06:43:43.000Z | # Natural Language Toolkit: Eliza
#
# Copyright (C) 2001-2014 NLTK Project
# Authors: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
# Based on an Eliza implementation by Joe Strout <joe@strout.net>,
# Jeff Epler <jep... | 29.204082 | 83 | 0.581831 |
c67dad9ff5cc6a872229f9b752825a6115c12720 | 1,647 | py | Python | app/app.py | amazingguni/flask-ddd | 8a789c1db96a8ad4079fdd2957f64b7af710b5b3 | [
"Apache-2.0"
] | 1 | 2022-02-06T14:00:02.000Z | 2022-02-06T14:00:02.000Z | app/app.py | amazingguni/flask-ddd | 8a789c1db96a8ad4079fdd2957f64b7af710b5b3 | [
"Apache-2.0"
] | null | null | null | app/app.py | amazingguni/flask-ddd | 8a789c1db96a8ad4079fdd2957f64b7af710b5b3 | [
"Apache-2.0"
] | null | null | null | from contextlib import contextmanager
import os
from flask import Flask, request, render_template
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
from flask_login import LoginManager
from .common.event.event_dispatcher import EventDispatcher
db = SQLAlchemy()
log... | 26.564516 | 77 | 0.738312 |
8e1f64f4346da9e2a5303306ca5027b3e8f0acbf | 2,322 | py | Python | webapp/models/mlva.py | fasemoreakinyemi/coxbase_webapp | 6217c095eff02af7356116d1eade316cc6707ca1 | [
"0BSD"
] | null | null | null | webapp/models/mlva.py | fasemoreakinyemi/coxbase_webapp | 6217c095eff02af7356116d1eade316cc6707ca1 | [
"0BSD"
] | null | null | null | webapp/models/mlva.py | fasemoreakinyemi/coxbase_webapp | 6217c095eff02af7356116d1eade316cc6707ca1 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String, DECIMAL, Float
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy.dialects.mysql import Y... | 33.171429 | 79 | 0.702842 |
150b3b7d9330c20b9b59fe09fa5e329bdd34356b | 4,014 | py | Python | airflow/operators/http_operator.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 5 | 2020-07-17T07:33:58.000Z | 2022-03-02T06:23:47.000Z | airflow/operators/http_operator.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 20 | 2017-04-18T19:47:46.000Z | 2020-01-13T04:19:24.000Z | airflow/operators/http_operator.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 12 | 2020-01-09T14:02:39.000Z | 2022-01-24T07:18:51.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 41.8125 | 105 | 0.665421 |
48641bfd24f313dd595fe1d1fe422b23b780a2fb | 16,965 | py | Python | src/reference_model/poseidon_python/poseidon_ff.py | datenlord/poseidon-spinalhdl | 1e4ce3f0ae06d6c264e103629dd28a75c119a548 | [
"MIT"
] | null | null | null | src/reference_model/poseidon_python/poseidon_ff.py | datenlord/poseidon-spinalhdl | 1e4ce3f0ae06d6c264e103629dd28a75c119a548 | [
"MIT"
] | null | null | null | src/reference_model/poseidon_python/poseidon_ff.py | datenlord/poseidon-spinalhdl | 1e4ce3f0ae06d6c264e103629dd28a75c119a548 | [
"MIT"
] | 1 | 2021-12-18T08:44:10.000Z | 2021-12-18T08:44:10.000Z | import random
import basic
import finite_field as ff
import constants
import os
# poseidon hash function
def transform_array(array):
"""transform array of int into array of PrimeField"""
array_ff = []
for element in array:
array_ff.append(ff.PrimeField(element))
return array_f... | 35.197095 | 128 | 0.603949 |
47a30479062d8b20a87e2e976dc8b6c2299152b5 | 1,515 | py | Python | proteus/tests/cylinder2D/conforming_rans3p/pressureincrement_n.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | null | null | null | proteus/tests/cylinder2D/conforming_rans3p/pressureincrement_n.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 13 | 2018-02-08T23:22:59.000Z | 2020-12-06T19:40:32.000Z | proteus/tests/cylinder2D/conforming_rans3p/pressureincrement_n.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 1 | 2020-02-17T03:25:34.000Z | 2020-02-17T03:25:34.000Z | from __future__ import absolute_import
from proteus import *
from proteus.default_n import *
try:
from .pressureincrement_p import *
except:
from pressureincrement_p import *
triangleOptions = triangleOptions
femSpaces = {0:pbasis}
stepController=FixedStep
numericalFluxType = PresInc.NumericalFlux
matr... | 28.055556 | 100 | 0.780858 |
6c189e90782a13466ef220250ae8c6def2f980b9 | 6,411 | py | Python | low_level_simulation/devel/lib/python2.7/dist-packages/costum_msgs/msg/_GlobalSegmentResultsMsg.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | null | null | null | low_level_simulation/devel/lib/python2.7/dist-packages/costum_msgs/msg/_GlobalSegmentResultsMsg.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | null | null | null | low_level_simulation/devel/lib/python2.7/dist-packages/costum_msgs/msg/_GlobalSegmentResultsMsg.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from costum_msgs/GlobalSegmentResultsMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class GlobalSegmentResultsMsg(genpy.Message):
_md5sum = "c71ff6a13e6428908623da... | 39.331288 | 270 | 0.691468 |
160d2c5d7e4ba03339c130df7ec53a6b82c55332 | 379 | py | Python | robots/build/rrbot_gazebo/catkin_generated/pkg.develspace.context.pc.py | eiphy/lita | 262d6ccabde8467db47278dc39574e5ea34abda2 | [
"BSD-3-Clause"
] | 4 | 2019-01-11T02:56:06.000Z | 2019-03-27T14:26:25.000Z | robots/build/gazebo_ros_demos/rrbot_gazebo/catkin_generated/pkg.develspace.context.pc.py | eiphy/lita | 262d6ccabde8467db47278dc39574e5ea34abda2 | [
"BSD-3-Clause"
] | 5 | 2019-01-10T11:18:54.000Z | 2019-03-03T09:33:40.000Z | robots/build/rrbot_gazebo/catkin_generated/pkg.develspace.context.pc.py | eiphy/lita | 262d6ccabde8467db47278dc39574e5ea34abda2 | [
"BSD-3-Clause"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "rrbot_gazebo"
PROJECT_SPACE_DIR = "/h... | 42.111111 | 68 | 0.704485 |
6402c400e328b52a73dd8360b5f6b9be6c249788 | 418 | py | Python | misc/api.py | alexpickering/dota_webscraper | 930c17f5563e6c778a820097517e7bb37e36bfe8 | [
"MIT"
] | null | null | null | misc/api.py | alexpickering/dota_webscraper | 930c17f5563e6c778a820097517e7bb37e36bfe8 | [
"MIT"
] | null | null | null | misc/api.py | alexpickering/dota_webscraper | 930c17f5563e6c778a820097517e7bb37e36bfe8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
return 'This is the home page'
@app.route('/heroes')
def display_hero_data():
with open('heroes.csv', 'r') as f:
csv_data = f.read()
return render_template('heroes.html', csv_data=csv... | 23.222222 | 60 | 0.684211 |
314534841262420627abaa44d23ce722192d3b0c | 521 | py | Python | user_scripts/merge_IEC.py | OceanNuclear/PeakFinding | dd82589201496b8c46cbd8ae28c2dabbfba7fed1 | [
"MIT"
] | 2 | 2021-10-31T08:49:18.000Z | 2021-11-04T13:12:36.000Z | user_scripts/merge_IEC.py | OceanNuclear/PeakFinding | dd82589201496b8c46cbd8ae28c2dabbfba7fed1 | [
"MIT"
] | null | null | null | user_scripts/merge_IEC.py | OceanNuclear/PeakFinding | dd82589201496b8c46cbd8ae28c2dabbfba7fed1 | [
"MIT"
] | null | null | null | from peakfinding.spectrum import RealSpectrumInteractive, RealSpectrum
import sys
print(*sys.argv[1:-1])
print(sys.argv[-1]+".IEC")
"""
Note: inside ipython, the using * (wildcard) in sys.argv will give an UNSORTED (disorderd!) list of the files grepped by wildcard.
But outside of ipython sys.argv will give a sorted s... | 40.076923 | 130 | 0.765835 |
8c1006bdfcd28c6fff5a39d33d1988f4e7a4a521 | 8,121 | py | Python | src/reports/report_configs.py | william-cass-wright/twl_bigcommerce_api | d674193db7dd46e1922c06d22c2da7a6aa07b8b8 | [
"Apache-2.0"
] | null | null | null | src/reports/report_configs.py | william-cass-wright/twl_bigcommerce_api | d674193db7dd46e1922c06d22c2da7a6aa07b8b8 | [
"Apache-2.0"
] | null | null | null | src/reports/report_configs.py | william-cass-wright/twl_bigcommerce_api | d674193db7dd46e1922c06d22c2da7a6aa07b8b8 | [
"Apache-2.0"
] | null | null | null | """
## (1) MONTHLY REPORT OF SALES FOR SALES TAX PURPOSES BY PAYMENT METHOD
- using [BigCommerce Orders v2 API](https://developer.bigcommerce.com/api-reference/store-management/orders/orders/getallorders) in BigCommOrdersAPI class
## (2) MONTHLY REPORTS FOR INVENTORY VALUATION
- using [BigCommerce Catalog/Products v3... | 31.722656 | 168 | 0.643517 |
65e51f301e6f0138e74121c7e450a09ca8640c97 | 805 | py | Python | blackbelt/slack.py | apiaryio/black-belt | d28d7022605bfd0c6814e591da21729f6aa0eecf | [
"MIT"
] | 3 | 2015-06-02T20:46:53.000Z | 2019-07-16T20:15:38.000Z | blackbelt/slack.py | apiaryio/black-belt | d28d7022605bfd0c6814e591da21729f6aa0eecf | [
"MIT"
] | 113 | 2015-01-13T15:27:51.000Z | 2018-09-12T09:06:45.000Z | blackbelt/slack.py | apiaryio/black-belt | d28d7022605bfd0c6814e591da21729f6aa0eecf | [
"MIT"
] | 1 | 2015-06-02T20:47:14.000Z | 2015-06-02T20:47:14.000Z | from slacker import Slacker
from blackbelt.config import config
class Slack(object):
def __init__(self, token=None):
if not token:
token = config['slack']['access_token']
slack = Slacker(token)
self.slack = slack
if not token:
raise ValueError("Can't ... | 30.961538 | 111 | 0.636025 |
789c4c8a486a3baf95018464d6d015f34de6367c | 1,599 | py | Python | musi/base.py | sixohsix/musi | 231801895583c19375ad51f3e259c8621b1db923 | [
"MIT"
] | 1 | 2015-11-14T17:22:53.000Z | 2015-11-14T17:22:53.000Z | musi/base.py | sixohsix/musi | 231801895583c19375ad51f3e259c8621b1db923 | [
"MIT"
] | null | null | null | musi/base.py | sixohsix/musi | 231801895583c19375ad51f3e259c8621b1db923 | [
"MIT"
] | null | null | null | from __future__ import print_function
from types import FunctionType, ClassType
import logging
logging.basicConfig()
log = logging.getLogger("musi")
def Constant(val):
def val_f(now):
return val
return val_f
C = Constant
class Buffer(object):
def __init__(self):
self.val = None
de... | 20.240506 | 58 | 0.587242 |
6edd1bf80b7ff5fa9e9c82ca715154986cd56570 | 1,081 | py | Python | legipy/parsers/legislature_list_parser.py | vermavinay8948/legipy | f82ae8db82a53fe28a193ea16d05b07316ffc5b9 | [
"MIT"
] | 6 | 2016-05-16T21:08:53.000Z | 2021-06-28T16:50:08.000Z | legipy/parsers/legislature_list_parser.py | vermavinay8948/legipy | f82ae8db82a53fe28a193ea16d05b07316ffc5b9 | [
"MIT"
] | 6 | 2018-02-10T23:00:54.000Z | 2021-11-17T23:09:10.000Z | legipy/parsers/legislature_list_parser.py | vermavinay8948/legipy | f82ae8db82a53fe28a193ea16d05b07316ffc5b9 | [
"MIT"
] | 9 | 2018-02-03T10:56:37.000Z | 2021-04-28T12:24:41.000Z | # coding: utf-8
from __future__ import unicode_literals
import re
from bs4 import BeautifulSoup
from legipy.common import parse_date
from legipy.common import parse_roman
from legipy.models.legislature import Legislature
def parse_legislature_list(url, html):
soup = BeautifulSoup(html, 'html5lib', from_encodin... | 27.717949 | 78 | 0.565217 |
e34b07ce7ab6a1b37facb27b319a5e5a4a491428 | 22,681 | py | Python | contrib/utils/perf/deploy-gce-perf-cluster.py | samyzh/ambari | ff73620da41697ed2ca9ece676f71ec9ba28a7d5 | [
"Apache-2.0"
] | 1,664 | 2015-01-03T09:35:21.000Z | 2022-03-31T04:55:24.000Z | contrib/utils/perf/deploy-gce-perf-cluster.py | samyzh/ambari | ff73620da41697ed2ca9ece676f71ec9ba28a7d5 | [
"Apache-2.0"
] | 3,018 | 2015-02-19T20:16:10.000Z | 2021-11-13T20:47:48.000Z | contrib/utils/perf/deploy-gce-perf-cluster.py | samyzh/ambari | ff73620da41697ed2ca9ece676f71ec9ba28a7d5 | [
"Apache-2.0"
] | 1,673 | 2015-01-06T14:14:42.000Z | 2022-03-31T07:22:30.000Z | #!/usr/bin/env python
"""
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");... | 42.157993 | 237 | 0.679952 |
9a9e5108a78a87be32bc12fa8a574505ad7827cc | 9,538 | py | Python | test.py | CheungBH/yolov3-channel-and-layer-pruning | 457f81386cbc54ace0ad677581e383c516305ba9 | [
"Apache-2.0"
] | null | null | null | test.py | CheungBH/yolov3-channel-and-layer-pruning | 457f81386cbc54ace0ad677581e383c516305ba9 | [
"Apache-2.0"
] | null | null | null | test.py | CheungBH/yolov3-channel-and-layer-pruning | 457f81386cbc54ace0ad677581e383c516305ba9 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
from torch.utils.data import DataLoader
from models import *
from utils.datasets import *
from utils.utils import *
def test(cfg,
data,
weights=None,
batch_size=16,
img_size=416,
iou_thres=0.5,
conf_thres=0.001,
... | 40.760684 | 119 | 0.538373 |
d60a6e3b0a67d742b6a22928bbb0aeead470848d | 395 | py | Python | scheduler/wsgi.py | arpit456jain/Interview-Scheduler | b8b93e319c3a8a7c2ae72f8082e0ffced6e05f42 | [
"MIT"
] | null | null | null | scheduler/wsgi.py | arpit456jain/Interview-Scheduler | b8b93e319c3a8a7c2ae72f8082e0ffced6e05f42 | [
"MIT"
] | 1 | 2022-03-16T19:08:43.000Z | 2022-03-17T15:59:01.000Z | scheduler/wsgi.py | arpit456jain/Interview-Scheduler | b8b93e319c3a8a7c2ae72f8082e0ffced6e05f42 | [
"MIT"
] | null | null | null | """
WSGI config for scheduler project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
de2570089c438f6383e1ae403d6432866bdebbd2 | 2,602 | py | Python | test/testcontrolfile.py | Jangzq/u-postgres-tool | 10578bdf338b14d63b19264a772830ef894a2b91 | [
"Unlicense"
] | null | null | null | test/testcontrolfile.py | Jangzq/u-postgres-tool | 10578bdf338b14d63b19264a772830ef894a2b91 | [
"Unlicense"
] | null | null | null | test/testcontrolfile.py | Jangzq/u-postgres-tool | 10578bdf338b14d63b19264a772830ef894a2b91 | [
"Unlicense"
] | null | null | null | import unittest
import logging.config
import shutil
from upgtool.controlfile import ControlFile
from upgtool.upgexception import UPgException
from upgtool import pgstruct
from upgtool import upgcrc
logging.config.fileConfig('cfg/logging.conf')
class TestControlFile(unittest.TestCase):
def setUp(self):
pg... | 44.101695 | 83 | 0.701768 |
2c4bce2d9c6f988b4802b85123f3b88e1466582e | 1,166 | py | Python | src/tashi/dfs/diskimageinterface.py | apache/tashi | 87f55e4d30800c085ea786bf40c9412b816969e6 | [
"Apache-2.0"
] | 6 | 2015-02-26T22:52:15.000Z | 2021-11-10T16:04:40.000Z | src/tashi/dfs/diskimageinterface.py | stroucki/tashi | 6888a865c184ea80f10e70981addc73a262a81b7 | [
"Apache-2.0"
] | null | null | null | src/tashi/dfs/diskimageinterface.py | stroucki/tashi | 6888a865c184ea80f10e70981addc73a262a81b7 | [
"Apache-2.0"
] | 6 | 2015-06-29T19:03:20.000Z | 2021-11-10T16:04:30.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.4375 | 62 | 0.77187 |
5c5d72655ea366d43c3f41a8ac8f7530e656aa09 | 2,911 | py | Python | tests/whatsapp/models/test_location_message.py | infobip-community/infobip-api-python-sdk | 5ffc5ab877ee1748aa29391f991c8c5324387487 | [
"MIT"
] | null | null | null | tests/whatsapp/models/test_location_message.py | infobip-community/infobip-api-python-sdk | 5ffc5ab877ee1748aa29391f991c8c5324387487 | [
"MIT"
] | null | null | null | tests/whatsapp/models/test_location_message.py | infobip-community/infobip-api-python-sdk | 5ffc5ab877ee1748aa29391f991c8c5324387487 | [
"MIT"
] | null | null | null | import pytest
from pydantic.error_wrappers import ValidationError
from infobip_channels.whatsapp.models.body.core import MessageBody
from infobip_channels.whatsapp.models.body.location_message import LocationMessageBody
from tests.conftest import get_random_string
from tests.whatsapp.conftest import LocationMessageBod... | 34.247059 | 86 | 0.63449 |
27e1d835295f6a7aa3d544bbcb1a06eb9c089ba4 | 19,829 | py | Python | google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py | bingatgoogle/python-videointelligence | 000e9bc7c1d1498eff75fa12e9ee4a111ebcf830 | [
"Apache-2.0"
] | null | null | null | google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py | bingatgoogle/python-videointelligence | 000e9bc7c1d1498eff75fa12e9ee4a111ebcf830 | [
"Apache-2.0"
] | null | null | null | google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py | bingatgoogle/python-videointelligence | 000e9bc7c1d1498eff75fa12e9ee4a111ebcf830 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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... | 43.772627 | 185 | 0.647032 |
bb991f59079aa0ffb64cbd0df7ba4ea8ffa73a80 | 4,619 | py | Python | sentry/plugins/sentry_redmine/models.py | optimal-outsource/django-sentry | 1b55011f1474cde8707a9febaf0c64c8142496d2 | [
"BSD-3-Clause"
] | null | null | null | sentry/plugins/sentry_redmine/models.py | optimal-outsource/django-sentry | 1b55011f1474cde8707a9febaf0c64c8142496d2 | [
"BSD-3-Clause"
] | null | null | null | sentry/plugins/sentry_redmine/models.py | optimal-outsource/django-sentry | 1b55011f1474cde8707a9febaf0c64c8142496d2 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.plugins.sentry_redmine.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django import forms
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
fr... | 41.241071 | 115 | 0.558129 |
0368ea315314cad76e74e691091a5d364daf62f0 | 38,269 | py | Python | pytests/backuptests.py | pavithra-mahamani/testrunner | d204491caa23f1fbe90505646534ed7810d96289 | [
"Apache-2.0"
] | 1 | 2020-08-31T18:51:45.000Z | 2020-08-31T18:51:45.000Z | pytests/backuptests.py | pavithra-mahamani/testrunner | d204491caa23f1fbe90505646534ed7810d96289 | [
"Apache-2.0"
] | null | null | null | pytests/backuptests.py | pavithra-mahamani/testrunner | d204491caa23f1fbe90505646534ed7810d96289 | [
"Apache-2.0"
] | 2 | 2020-07-24T07:12:01.000Z | 2022-03-17T23:43:28.000Z | import time
import unittest
import uuid
import crc32
from TestInput import TestInputSingleton
import logger
import mc_bin_client
from membase.api.rest_client import RestConnection, RestHelper
from membase.helper.bucket_helper import BucketOperationHelper
from membase.helper.cluster_helper import ClusterOperationHelper
... | 51.436828 | 150 | 0.609998 |
c85f82b7093153bad6ba620351543a2478108a6a | 2,165 | py | Python | openmdao/docs/_exts/embed_options.py | toddrme2178/OpenMDAO | 379cc6216d13d380e11cb3a46f03960981de4660 | [
"Apache-2.0"
] | 1 | 2016-05-10T17:01:17.000Z | 2016-05-10T17:01:17.000Z | openmdao/docs/_exts/embed_options.py | toddrme2178/OpenMDAO | 379cc6216d13d380e11cb3a46f03960981de4660 | [
"Apache-2.0"
] | 3 | 2016-05-10T16:55:46.000Z | 2018-10-22T23:28:52.000Z | openmdao/docs/_exts/embed_options.py | toddrme2178/OpenMDAO | 379cc6216d13d380e11cb3a46f03960981de4660 | [
"Apache-2.0"
] | 2 | 2018-04-05T15:53:54.000Z | 2018-10-22T22:48:00.000Z |
import importlib
from six import iteritems
from docutils import nodes
from docutils.statemachine import ViewList
import sphinx
from docutils.parsers.rst import Directive
from sphinx.util.nodes import nested_parse_with_titles
from openmdao.utils.options_dictionary import OptionsDictionary, _undefined
class EmbedOpt... | 30.069444 | 96 | 0.68776 |
f8d1622ae92d453b9c720704bbb0a9b319763d24 | 18,476 | py | Python | homeassistant/components/xiaomi_aqara/binary_sensor.py | MaxG88/core | 827711bcd153279ec56527927eaba4815bcde1d4 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/xiaomi_aqara/binary_sensor.py | MaxG88/core | 827711bcd153279ec56527927eaba4815bcde1d4 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/xiaomi_aqara/binary_sensor.py | MaxG88/core | 827711bcd153279ec56527927eaba4815bcde1d4 | [
"Apache-2.0"
] | null | null | null | """Support for Xiaomi aqara binary sensors."""
import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OPENING,
BinarySensorEntity,
)
from homeassistant.core import callback
from homeassistant.helpers.event import async_call_later
from . import XiaomiDevice
from .const import DOMAIN, ... | 32.471002 | 87 | 0.549686 |
1582d7e4a5fecdf64ea528629b21a276fe0fe927 | 19,332 | py | Python | tests/micro/zephyr/test_zephyr.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 90 | 2021-11-30T11:58:10.000Z | 2022-03-31T02:24:04.000Z | tests/micro/zephyr/test_zephyr.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 64 | 2021-11-22T23:58:23.000Z | 2022-03-31T03:19:22.000Z | tests/micro/zephyr/test_zephyr.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 27 | 2021-12-09T22:39:27.000Z | 2022-03-24T23:21:48.000Z | # 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... | 38.055118 | 100 | 0.661287 |
8d89ed43b92bb367e8c5815387b57d2c9acb0a75 | 398 | py | Python | packages/python/plotly/plotly/validators/histogram2d/ybins/_start.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/histogram2d/ybins/_start.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/histogram2d/ybins/_start.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class StartValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="start", parent_name="histogram2d.ybins", **kwargs):
super(StartValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 33.166667 | 87 | 0.670854 |
36ea7a64e124a7ec50e2bbb436ee507eb9b14dd6 | 8,149 | py | Python | security_scripts/controls/buttons.py | loftwah/security-scripts | eb75b67499d3cb8d87eac114efdc9988a0f56511 | [
"MIT"
] | 1 | 2021-12-23T05:02:51.000Z | 2021-12-23T05:02:51.000Z | security_scripts/controls/buttons.py | loftwah/security-scripts | eb75b67499d3cb8d87eac114efdc9988a0f56511 | [
"MIT"
] | null | null | null | security_scripts/controls/buttons.py | loftwah/security-scripts | eb75b67499d3cb8d87eac114efdc9988a0f56511 | [
"MIT"
] | 1 | 2021-12-23T05:02:57.000Z | 2021-12-23T05:02:57.000Z | #!/usr/bin/env python
"""
Make requests to deprivilege a role, stop all ec2 units,
or reprivilege a role.
Options available via <command> --help
"""
from security_scripts.information.lib import shlog
import logging
import boto3
logging.getLogger('boto3').setLevel(logging.CRITICAL)
logging.getLogger('botocore').setLev... | 40.745 | 131 | 0.665726 |
52e39bd51853358e3831d48264dfe8796688346b | 4,966 | py | Python | mailman2/models.py | edinburghhacklab/hackdb | 3ec7d66039705aa511dd6559196fa51a53b3a110 | [
"MIT"
] | null | null | null | mailman2/models.py | edinburghhacklab/hackdb | 3ec7d66039705aa511dd6559196fa51a53b3a110 | [
"MIT"
] | null | null | null | mailman2/models.py | edinburghhacklab/hackdb | 3ec7d66039705aa511dd6559196fa51a53b3a110 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2022 Tim Hawes <me@timhawes.com>
#
# SPDX-License-Identifier: MIT
import re
from allauth.account.models import EmailAddress
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.core.exceptions import ValidationError
from django.db import mod... | 31.630573 | 85 | 0.646597 |
dbc48766a3d16b55567c1c72582b51dbcb86d882 | 1,321 | py | Python | connection_checker/connection_checker.py | igushev/HomeUtils | 763f540cfbc22d354ec9497b10652bd83f3f5a5d | [
"MIT"
] | 2 | 2019-07-27T19:10:38.000Z | 2019-08-31T11:32:33.000Z | connection_checker/connection_checker.py | igushev/home_tools | 763f540cfbc22d354ec9497b10652bd83f3f5a5d | [
"MIT"
] | null | null | null | connection_checker/connection_checker.py | igushev/home_tools | 763f540cfbc22d354ec9497b10652bd83f3f5a5d | [
"MIT"
] | null | null | null | from datetime import datetime
import os
import time
class Status(object):
Success = 0
Fail = 1
hostnames = ["www.google.com", "www.facebook.com", "www.yandex.ru"]
interval = 1
def WriteToLog(message, append_date_time=True, draw_line=True):
if append_date_time:
message += ' '+str(date... | 23.175439 | 68 | 0.644209 |
fee13c8950aba978afea4153ebaab8139f09f78c | 6,093 | py | Python | tests/integration_tests/conftest.py | 7vikpeculiar/superset | 800ced5e257d5d83d6dbe4ced0e7318ac40d026f | [
"Apache-2.0"
] | 2 | 2021-12-21T15:57:16.000Z | 2022-01-31T02:22:02.000Z | tests/integration_tests/conftest.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 19 | 2022-01-29T03:16:22.000Z | 2022-03-25T23:50:16.000Z | tests/integration_tests/conftest.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 2 | 2021-12-21T13:41:18.000Z | 2021-12-26T22:16:43.000Z | # 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... | 33.295082 | 103 | 0.682422 |
033c4f748f3d0e865f123157056e5557ec38e79d | 442 | py | Python | client.py | Zhiwei5/flask_getting_started | 67c6f4a24bd12e5716ad2d384b152be77738a1e4 | [
"MIT"
] | null | null | null | client.py | Zhiwei5/flask_getting_started | 67c6f4a24bd12e5716ad2d384b152be77738a1e4 | [
"MIT"
] | null | null | null | client.py | Zhiwei5/flask_getting_started | 67c6f4a24bd12e5716ad2d384b152be77738a1e4 | [
"MIT"
] | null | null | null | import requests
def main():
r = requests.get("http://vcm-3572.vm.duke.edu:5000/name")
name = r.json()
print(name)
r2 = requests.get("http://vcm-3572.vm.duke.edu:5000/hello/zhiwei")
message = r2.json()
print(message)
r3 = requests.post("http://vcm-3572.vm.duke.edu:5000/distance", json = {"... | 24.555556 | 100 | 0.613122 |
dfbc43195cb30c64703b155147c98d5f77e81b40 | 1,471 | py | Python | nextcloud/views.py | Aytuar/librephotos | 1d888fd9f49fcb82cce43412b87f9f9736ad5f47 | [
"MIT"
] | 1 | 2021-01-12T16:59:29.000Z | 2021-01-12T16:59:29.000Z | nextcloud/views.py | Aytuar/librephotos | 1d888fd9f49fcb82cce43412b87f9f9736ad5f47 | [
"MIT"
] | 4 | 2021-09-08T03:28:23.000Z | 2022-03-12T00:59:15.000Z | nextcloud/views.py | Aytuar/librephotos | 1d888fd9f49fcb82cce43412b87f9f9736ad5f47 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated, IsAdminUser, AllowAny
from api.models import *
import owncloud as nextcloud
from api.api_util import get_current_job
from nextcloud.directory... | 31.297872 | 77 | 0.662814 |
611a40302dfcb2501b3e552c06f4e4110b0946ad | 432 | py | Python | sqltemplate/contrib/django/settings.py | marcinn/sqltemplate | e083f5262ae4439843210e32843b9b644604fdf1 | [
"BSD-2-Clause"
] | 3 | 2019-12-22T22:44:28.000Z | 2021-04-26T04:03:26.000Z | sqltemplate/contrib/django/settings.py | marcinn/sqltemplate | e083f5262ae4439843210e32843b9b644604fdf1 | [
"BSD-2-Clause"
] | null | null | null | sqltemplate/contrib/django/settings.py | marcinn/sqltemplate | e083f5262ae4439843210e32843b9b644604fdf1 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
from django.conf import settings
TEMPLATES = getattr(settings, 'SQL_TEMPLATES', [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': False,
'OPTIONS': {
'loaders': [
'django.template.loaders.filesystem.Load... | 24 | 72 | 0.625 |
63a4fdab7a7899f0b0d9cfc86fa4fd598fe9c531 | 9,359 | py | Python | environments/particle/particle.py | wx-b/ibc | 2c9202e50cfee1abdcd955d3ac1b9d68b5d81e53 | [
"Apache-2.0"
] | null | null | null | environments/particle/particle.py | wx-b/ibc | 2c9202e50cfee1abdcd955d3ac1b9d68b5d81e53 | [
"Apache-2.0"
] | null | null | null | environments/particle/particle.py | wx-b/ibc | 2c9202e50cfee1abdcd955d3ac1b9d68b5d81e53 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Reach ML Authors.
#
# 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 ... | 34.791822 | 79 | 0.674324 |
23613ccb0bd19a27ffed1bc3f335ab978be24796 | 7,659 | py | Python | contrib/devtools/update-translations.py | boozioRi/stelo | d29a2041b1a682f7e60d4fd1aac8027fc486743b | [
"MIT"
] | 2 | 2019-11-18T22:06:02.000Z | 2020-05-16T19:07:49.000Z | contrib/devtools/update-translations.py | boozioRi/stelo | d29a2041b1a682f7e60d4fd1aac8027fc486743b | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | boozioRi/stelo | d29a2041b1a682f7e60d4fd1aac8027fc486743b | [
"MIT"
] | 2 | 2019-01-31T10:41:04.000Z | 2020-06-23T21:46:02.000Z | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... | 37.544118 | 124 | 0.629325 |
1fb70d5625784a3d19acb83a82abce55e9b34a6d | 2,630 | py | Python | aws_dataclasses/cf_event.py | hypoport/LaWip | 30bfe90457a83957d10ec18fe7d61439b5b74280 | [
"Apache-2.0"
] | 4 | 2018-10-27T05:38:54.000Z | 2021-04-09T14:49:23.000Z | aws_dataclasses/cf_event.py | hypoport/LaWip | 30bfe90457a83957d10ec18fe7d61439b5b74280 | [
"Apache-2.0"
] | 6 | 2018-10-01T17:11:14.000Z | 2019-06-04T07:58:29.000Z | aws_dataclasses/cf_event.py | bweigel/python-aws-dataclasses | 8e37d39bc8b7b7b48908d78286c0b6dea7fd90d2 | [
"Apache-2.0"
] | 3 | 2018-08-03T21:20:26.000Z | 2021-08-12T13:06:15.000Z | from collections import namedtuple
from typing import Dict, List, Optional
from dataclasses import InitVar, field, dataclass
from aws_dataclasses.base import GenericDataClass, EventClass
KVPair = namedtuple("KVPair", ['key', 'value'])
def _parse_headers(headers) -> Dict[str, List[KVPair]]:
out = {}
for hdr... | 33.717949 | 115 | 0.726616 |
b28947d0b6f97f362c21f680a53eb68056959970 | 1,215 | py | Python | tests_classla/test_tagger.py | IgorTavcar/classla | 5a1246b62eb352af631d4f4593f467e9ccbd3777 | [
"Apache-2.0"
] | 12 | 2019-11-25T14:51:21.000Z | 2021-02-21T16:59:38.000Z | tests_classla/test_tagger.py | IgorTavcar/classla | 5a1246b62eb352af631d4f4593f467e9ccbd3777 | [
"Apache-2.0"
] | 23 | 2021-03-12T13:17:17.000Z | 2022-02-14T08:56:53.000Z | tests_classla/test_tagger.py | IgorTavcar/classla | 5a1246b62eb352af631d4f4593f467e9ccbd3777 | [
"Apache-2.0"
] | 7 | 2021-04-04T15:04:27.000Z | 2022-02-20T17:33:39.000Z | """
Basic testing of part of speech tagging
"""
import classla
from tests_classla import *
SL_DOC = "France Prešeren se je rodil v vrbi."
SL_DOC_GOLD = """
<Token id=1;words=[<Word id=1;text=France;upos=PROPN;xpos=Npmsn;feats=Case=Nom|Gender=Masc|Number=Sing>]>
<Token id=2;words=[<Word id=2;text=Prešeren;upos=PROP... | 43.392857 | 136 | 0.714403 |
e3bc99f1cae4ed04beba1ed159ce3a33cd8dbf89 | 83 | py | Python | examen/p4/p4.py | Ale-Torrico/computacion_para_ingenieria | 919205e485ddd0a40adcf543a8ef675712354024 | [
"Apache-2.0"
] | null | null | null | examen/p4/p4.py | Ale-Torrico/computacion_para_ingenieria | 919205e485ddd0a40adcf543a8ef675712354024 | [
"Apache-2.0"
] | null | null | null | examen/p4/p4.py | Ale-Torrico/computacion_para_ingenieria | 919205e485ddd0a40adcf543a8ef675712354024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 9 07:44:47 2022
@author: AMD
"""
| 10.375 | 35 | 0.542169 |
e8071634d1019c0eeec4cf933fc5a5e335fd85d1 | 2,140 | py | Python | plotjog.py | mostlyuseful/marlin-plotjog | f188a9351b4a4188d92a4865e6b5199b4065adf9 | [
"MIT"
] | null | null | null | plotjog.py | mostlyuseful/marlin-plotjog | f188a9351b4a4188d92a4865e6b5199b4065adf9 | [
"MIT"
] | null | null | null | plotjog.py | mostlyuseful/marlin-plotjog | f188a9351b4a4188d92a4865e6b5199b4065adf9 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import sys
import joystick
import serial
import threading
import numpy as np
from rx import Observable
from rx.subjects import Subject
from rx.concurrency import NewThreadScheduler
FEEDRATE = 400 # mm / minute
MAX_REACH = 0.2 # mm / feedrate
MIN_NORM = 0.2
device_fn = sys.argv[1] if len(sys.ar... | 24.883721 | 107 | 0.705607 |
fcf82356b52a680b9972850e01df3873afd13ba8 | 12,980 | py | Python | zfit/models/physics.py | kailiu77/zfit | 00eed81fb34e0eb2e4bae5ddc9ebf38699e107ca | [
"BSD-3-Clause"
] | 1 | 2022-01-15T13:38:12.000Z | 2022-01-15T13:38:12.000Z | zfit/models/physics.py | kailiu77/zfit | 00eed81fb34e0eb2e4bae5ddc9ebf38699e107ca | [
"BSD-3-Clause"
] | null | null | null | zfit/models/physics.py | kailiu77/zfit | 00eed81fb34e0eb2e4bae5ddc9ebf38699e107ca | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019 zfit
from typing import Type, Any
import tensorflow as tf
import tensorflow_probability.python.distributions as tfd
import numpy as np
import zfit
from zfit import ztf
from ..core.basepdf import BasePDF
from ..core.limits import ANY_UPPER, ANY_LOWER, Space
from ..settings import ztypes
from .... | 36.256983 | 118 | 0.545455 |
ca546b8edec8439712e578285a1e1b1750ddc5bc | 1,071 | py | Python | boto3_type_annotations/boto3_type_annotations/dynamodbstreams/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 119 | 2018-12-01T18:20:57.000Z | 2022-02-02T10:31:29.000Z | boto3_type_annotations/boto3_type_annotations/dynamodbstreams/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 15 | 2018-11-16T00:16:44.000Z | 2021-11-13T03:44:18.000Z | boto3_type_annotations/boto3_type_annotations/dynamodbstreams/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 11 | 2019-05-06T05:26:51.000Z | 2021-09-28T15:27:59.000Z | from typing import Optional
from botocore.client import BaseClient
from botocore.waiter import Waiter
from typing import Union
from typing import Dict
from botocore.paginate import Paginator
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
pass
def describe_stream(self, S... | 32.454545 | 131 | 0.694678 |
03d924307bb6a727d3d7b445f200a655a6b3e04d | 324 | py | Python | Model.py | tuantvk/flask-mongodb-quiz-app | 54a0b214332294517cfe759e76e7904e6f2f2e7a | [
"MIT"
] | 2 | 2019-10-03T08:03:33.000Z | 2022-03-27T13:30:26.000Z | Model.py | tuantvk/flask-mongodb-quiz-app | 54a0b214332294517cfe759e76e7904e6f2f2e7a | [
"MIT"
] | null | null | null | Model.py | tuantvk/flask-mongodb-quiz-app | 54a0b214332294517cfe759e76e7904e6f2f2e7a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from pymongo import MongoClient, errors
from config import HOST_DB
try:
client = MongoClient(HOST_DB, serverSelectionTimeoutMS=10)
db = client.quizapp
except errors.ServerSelectionTimeoutError as err:
print("DB error", err)
# create db user
user_list = db.user
# create db room
room = db.... | 20.25 | 60 | 0.765432 |
c5eaeabcabd4ff96dc4ed7deac7ed457a1d7a351 | 17,223 | py | Python | src/poio/ui/Ui_MainAnalyzerQML.py | cidles/poio-analyzer | 64fd7327164d7d67a3615c10b047a95d5f34a2cd | [
"Apache-2.0"
] | 3 | 2017-04-07T08:20:27.000Z | 2021-01-07T20:32:24.000Z | src/poio/ui/Ui_MainAnalyzerQML.py | cidles/poio-analyzer | 64fd7327164d7d67a3615c10b047a95d5f34a2cd | [
"Apache-2.0"
] | null | null | null | src/poio/ui/Ui_MainAnalyzerQML.py | cidles/poio-analyzer | 64fd7327164d7d67a3615c10b047a95d5f34a2cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainAnalyzerQML.ui'
#
# Created: Tue May 28 11:30:41 2013
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except... | 60.010453 | 125 | 0.733438 |
94f53b225ade52d44373bd510ab5dc0c66ca6cd4 | 4,250 | py | Python | newassess.py | Juzhang18/assessmentV1.1 | 13862450a31cbc34db960c76d5040b8517d90c78 | [
"MIT"
] | 1 | 2019-08-15T17:52:33.000Z | 2019-08-15T17:52:33.000Z | newassess.py | Juzhang18/assessmentV1.1 | 13862450a31cbc34db960c76d5040b8517d90c78 | [
"MIT"
] | null | null | null | newassess.py | Juzhang18/assessmentV1.1 | 13862450a31cbc34db960c76d5040b8517d90c78 | [
"MIT"
] | null | null | null | import csv
import smtplib
import flask
from flask import Flask, render_template,request, jsonify
#-------------CSV functions ported over--------
def csver(myDict):
writefile = 'masterDatabase.csv'
header = ['name', 'email', 'company', 'emailing', 'messaging', 'calendar', 'video', 'voice', 'secure', 'collab',... | 40.865385 | 268 | 0.619294 |
c1e9b65af41b6d227a7602dd1d81fd2b9b5bbe79 | 19,226 | py | Python | chrome/common/extensions/docs/server2/api_data_source.py | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-02-03T05:19:48.000Z | 2021-11-15T15:07:21.000Z | chrome/common/extensions/docs/server2/api_data_source.py | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/common/extensions/docs/server2/api_data_source.py | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import logging
import os
from collections import defaultdict, Mapping
import third_party.json_schema_compiler.json_parse as json_parse
impor... | 37.624266 | 80 | 0.66899 |
af0b3fe32ac45a9ad0685fd1434b62d385fd260d | 34 | py | Python | Rooms/tiger.py | ventin75/house | 99c9e34f4f6c03593eb7a95f70877fdbf13b07e7 | [
"MIT"
] | null | null | null | Rooms/tiger.py | ventin75/house | 99c9e34f4f6c03593eb7a95f70877fdbf13b07e7 | [
"MIT"
] | null | null | null | Rooms/tiger.py | ventin75/house | 99c9e34f4f6c03593eb7a95f70877fdbf13b07e7 | [
"MIT"
] | null | null | null | print("Have a roar-some Year!!!")
| 17 | 33 | 0.647059 |
1a3e7ee1ee16727dae7eb217f1e43bfa80670912 | 710 | py | Python | dataspace/transform/dataframe.py | Sam-prog-sudo/dataspace | 2bab85c4dfa713deb835a46e9214c43a3a674082 | [
"MIT"
] | 3 | 2021-06-28T09:45:51.000Z | 2022-01-10T15:38:07.000Z | dataspace/transform/dataframe.py | Sam-prog-sudo/dataspace | 2bab85c4dfa713deb835a46e9214c43a3a674082 | [
"MIT"
] | null | null | null | dataspace/transform/dataframe.py | Sam-prog-sudo/dataspace | 2bab85c4dfa713deb835a46e9214c43a3a674082 | [
"MIT"
] | 1 | 2021-07-01T08:50:32.000Z | 2021-07-01T08:50:32.000Z | import pandas as pd
from ..utils.messages import msg_warning, msg_info
def _drop(df: pd.DataFrame, *cols) -> pd.DataFrame:
try:
index = df.columns.values
for col in cols:
if col not in index:
msg_warning("Column", col, "not found. Aborting")
return
... | 28.4 | 78 | 0.601408 |
5cbdfc7e9e9a67f1053114b3e73f8205d99024be | 2,286 | py | Python | api/api/tests.py | erik-sn/mako | f64644dacb132b0063805ccafc3f485bdb62595b | [
"MIT"
] | null | null | null | api/api/tests.py | erik-sn/mako | f64644dacb132b0063805ccafc3f485bdb62595b | [
"MIT"
] | 12 | 2020-02-11T23:12:23.000Z | 2022-02-26T13:08:40.000Z | api/api/tests.py | erik-sn/mako | f64644dacb132b0063805ccafc3f485bdb62595b | [
"MIT"
] | 2 | 2018-08-10T08:14:31.000Z | 2018-10-01T16:46:37.000Z | from django.test import TestCase, Client
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from api.models import Software, FileUploadEvent, File
class TestRun(TestCase):
def setUp(self):
user = User.objects.create(username='testuser')
user.s... | 44.823529 | 119 | 0.646544 |
bbb45d883d7489e4cf66ef3a6a962c35e12e0a0e | 151 | py | Python | jp.atcoder/abc136/abc136_a/11409946.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc136/abc136_a/11409946.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc136/abc136_a/11409946.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
a, b, c = map(int, sys.stdin.readline().split())
def main():
print(max(0, b + c - a))
if __name__ == '__main__':
main()
| 15.1 | 49 | 0.529801 |
06159a4d350b46ecbbaee7c309b5b8261486c15d | 9,300 | py | Python | scripts/python/findTADs.py | sergpolly/cworld-dekker | 7557bbe873e623e9059482722922faca4e784ad0 | [
"Apache-2.0"
] | 43 | 2016-10-28T06:24:47.000Z | 2022-03-20T09:39:23.000Z | scripts/python/findTADs.py | sergpolly/cworld-dekker | 7557bbe873e623e9059482722922faca4e784ad0 | [
"Apache-2.0"
] | 13 | 2017-12-02T20:00:11.000Z | 2022-03-18T16:28:34.000Z | scripts/python/findTADs.py | sergpolly/cworld-dekker | 7557bbe873e623e9059482722922faca4e784ad0 | [
"Apache-2.0"
] | 24 | 2016-12-05T06:03:08.000Z | 2021-11-24T12:43:03.000Z | #!/usr/local/bin/python
"""
***********************************************
- PROGRAM: findTADs.py
- CONTACT: Bryan lajoie (bryan.lajoie@umassmed.edu)
***********************************************
"""
from __future__ import print_function
# Built in modules
import argparse
import os.path
import sys
import gzip
impo... | 28.012048 | 193 | 0.600968 |
0f21d20edf219f360834c8955d1b46514bc3a892 | 5,857 | py | Python | gaphor/RAAML/fta/ftatoolbox.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | 867 | 2018-01-09T00:19:09.000Z | 2022-03-31T02:49:23.000Z | gaphor/RAAML/fta/ftatoolbox.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | 790 | 2018-01-13T23:47:07.000Z | 2022-03-31T16:04:27.000Z | gaphor/RAAML/fta/ftatoolbox.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | 117 | 2018-01-09T02:24:49.000Z | 2022-03-23T08:07:42.000Z | """The definition for the FTA section of the RAAML toolbox."""
from gaphor.diagram.diagramtoolbox import ToolDef, ToolSection, namespace_config
from gaphor.diagram.diagramtools import new_item_factory
from gaphor.i18n import gettext
from gaphor.RAAML import diagramitems, raaml
from gaphor.UML import diagramitems as um... | 29.882653 | 85 | 0.483695 |
8a9a21f081f1b210d1c7ce0e3e41eb1ab0a27065 | 20,162 | py | Python | tests/sc/test_organizations.py | 39biradar/pyTenable | a055140bc864bb950fd1053ab598ff2da12cf408 | [
"MIT"
] | null | null | null | tests/sc/test_organizations.py | 39biradar/pyTenable | a055140bc864bb950fd1053ab598ff2da12cf408 | [
"MIT"
] | null | null | null | tests/sc/test_organizations.py | 39biradar/pyTenable | a055140bc864bb950fd1053ab598ff2da12cf408 | [
"MIT"
] | null | null | null | import pytest
from ..checker import check
from tenable.errors import APIError, UnexpectedValueError
from tests.pytenable_log_handler import log_exception
def test_organizations_constructor_name_typeerror(sc):
with pytest.raises(TypeError):
sc.organizations._constructor(name=1)
def test_organizations_con... | 34.58319 | 108 | 0.664865 |
ef931fe95d2677068e6c6de9e34da199d71dee70 | 3,606 | py | Python | mturk/models.py | Kyeongan/crowdsource-platform | af34363158ff30ebfdade4a543648bf26a3c9698 | [
"MIT"
] | 138 | 2015-04-17T20:07:12.000Z | 2017-05-03T17:58:47.000Z | mturk/models.py | cescgie/crowdi | c16ab625f27915919e21f7eec93c45af551d9022 | [
"MIT"
] | 657 | 2015-04-19T04:54:51.000Z | 2017-06-26T18:07:42.000Z | mturk/models.py | cescgie/crowdi | c16ab625f27915919e21f7eec93c45af551d9022 | [
"MIT"
] | 311 | 2015-04-16T19:20:55.000Z | 2017-06-13T05:32:01.000Z | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.postgres.fields import JSONField, ArrayField
from django.db import models
from crowdsourcing.models import Task, TaskWorker
class Timed(models.Model):
created_at = models.DateTimeField(auto_now_add=True, auto... | 38.361702 | 118 | 0.751248 |
a9e8d5bdf36e36a3ba9fd8138e7168125ba932d9 | 23,052 | py | Python | bin/cpu_monitor.py | MarbleInc/ros-system-monitor | 39d8ca3368c34483e71eb69f38452050d58b865c | [
"BSD-3-Clause"
] | null | null | null | bin/cpu_monitor.py | MarbleInc/ros-system-monitor | 39d8ca3368c34483e71eb69f38452050d58b865c | [
"BSD-3-Clause"
] | 2 | 2019-01-16T19:03:34.000Z | 2019-09-30T18:57:39.000Z | bin/cpu_monitor.py | MarbleInc/ros-system-monitor | 39d8ca3368c34483e71eb69f38452050d58b865c | [
"BSD-3-Clause"
] | 1 | 2019-01-11T21:49:27.000Z | 2019-01-11T21:49:27.000Z | #!/usr/bin/env python
############################################################################
# Copyright (C) 2009, Willow Garage, Inc. #
# Copyright (C) 2013 by Ralf Kaestner #
# ralf.kaestner@gmail.com ... | 39.744828 | 135 | 0.556394 |
8a0207c5553c2fa89c0006390261e3844cc2c2a8 | 4,964 | py | Python | tf_agents/policies/q_policy.py | arryyao/agents | 011351f234f0e73eb2dbcbc6d6c5796875ab7b31 | [
"Apache-2.0"
] | null | null | null | tf_agents/policies/q_policy.py | arryyao/agents | 011351f234f0e73eb2dbcbc6d6c5796875ab7b31 | [
"Apache-2.0"
] | null | null | null | tf_agents/policies/q_policy.py | arryyao/agents | 011351f234f0e73eb2dbcbc6d6c5796875ab7b31 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# 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... | 39.396825 | 80 | 0.713135 |
fb7d5311487dbb4b64505992562e185aff671deb | 2,804 | py | Python | kornia/feature/__init__.py | lferraz/kornia | c30ef6149bd92054d482339a2b0cd18f8272f5f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/feature/__init__.py | lferraz/kornia | c30ef6149bd92054d482339a2b0cd18f8272f5f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/feature/__init__.py | lferraz/kornia | c30ef6149bd92054d482339a2b0cd18f8272f5f5 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-05-15T03:22:24.000Z | 2021-05-15T03:22:24.000Z | from .responses import (CornerHarris,
CornerGFTT,
BlobHessian,
BlobDoG,
harris_response,
gftt_response,
hessian_response,
dog_response)
from .nms import... | 29.515789 | 101 | 0.625892 |
adbeb796d099684013032a39baa56849ac54a35c | 8,354 | py | Python | lib/jnpr/healthbot/swagger/models/rule_schema_field.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | lib/jnpr/healthbot/swagger/models/rule_schema_field.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | lib/jnpr/healthbot/swagger/models/rule_schema_field.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Healthbot APIs
API interface for Healthbot application # noqa: E501
OpenAPI spec version: 1.0.0
Contact: healthbot-hackers@juniper.net
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RuleSchemaFi... | 29.108014 | 141 | 0.582715 |
6ec2bc2205e6365abca64285e92e1d386825e17a | 834 | py | Python | tests/programs/multiprocessing_using/foo/__main__.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | null | null | null | tests/programs/multiprocessing_using/foo/__main__.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | 1 | 2019-03-01T11:33:40.000Z | 2019-03-01T11:33:40.000Z | tests/programs/multiprocessing_using/foo/__main__.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | 1 | 2019-03-26T16:56:21.000Z | 2019-03-26T16:56:21.000Z | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 36.26087 | 79 | 0.714628 |
e8305b129c5799a86d6b6457b918a7b877794cd8 | 568 | py | Python | services/card/cards/platform.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | services/card/cards/platform.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | services/card/cards/platform.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# Platform card
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC modules
fr... | 28.4 | 72 | 0.43838 |
d76fb73f8daabd3ab785706f13baf94bff025069 | 9,463 | py | Python | baselines/gail/run_mujoco.py | syllogismos/wandb_baselines | c0b0e5d5d9b2db3797e3fddfa07c3299df7523d5 | [
"MIT"
] | 1 | 2020-03-06T13:37:05.000Z | 2020-03-06T13:37:05.000Z | baselines/gail/run_mujoco.py | cvphelps/wandb_baselines | 140011d40570f6f213650ea720cfe9374191786f | [
"MIT"
] | null | null | null | baselines/gail/run_mujoco.py | cvphelps/wandb_baselines | 140011d40570f6f213650ea720cfe9374191786f | [
"MIT"
] | 1 | 2018-07-15T03:36:16.000Z | 2018-07-15T03:36:16.000Z | '''
Disclaimer: this code is highly based on trpo_mpi at @openai/baselines and @openai/imitation
'''
import wandb
wandb.init()
import argparse
import os.path as osp
import logging
from mpi4py import MPI
from tqdm import tqdm
import numpy as np
import gym, roboschool
from baselines.gail import mlp_policy
from baselin... | 38.782787 | 119 | 0.640283 |
50db3de9d89a041b272d3a28d84cbffc9cbb298f | 2,268 | py | Python | examples/paging-predicate/paging_predicate_example.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 98 | 2015-12-08T14:26:27.000Z | 2022-03-23T17:44:11.000Z | examples/paging-predicate/paging_predicate_example.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 396 | 2016-02-23T11:07:55.000Z | 2022-03-31T14:26:34.000Z | examples/paging-predicate/paging_predicate_example.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 62 | 2015-12-09T11:20:53.000Z | 2022-01-28T01:30:54.000Z | import random
import hazelcast
from hazelcast import predicate
from hazelcast.core import HazelcastJsonValue
from hazelcast.serialization.api import IdentifiedDataSerializable
class AgeComparator(IdentifiedDataSerializable):
"""
This is just a marker class that identifies which comparator
to use on the m... | 26.372093 | 66 | 0.716931 |
d8c9910bad542251562209f0596856735d80ea78 | 2,601 | py | Python | python/sdk/client/models/endpoint_status.py | ashwinath/merlin | 087a7fa6fb21e4c771d64418bd58873175226ca1 | [
"Apache-2.0"
] | null | null | null | python/sdk/client/models/endpoint_status.py | ashwinath/merlin | 087a7fa6fb21e4c771d64418bd58873175226ca1 | [
"Apache-2.0"
] | null | null | null | python/sdk/client/models/endpoint_status.py | ashwinath/merlin | 087a7fa6fb21e4c771d64418bd58873175226ca1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Merlin
API Guide for accessing Merlin's model management, deployment, and serving functionalities # noqa: E501
OpenAPI spec version: 0.7.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Endpoin... | 26.814433 | 108 | 0.55248 |
5da3cbdde39618ebc9fb57f1847583f4603bb71d | 383 | py | Python | src/hataraku/migrations/0004_auto_20190614_1323.py | HNJ755329/Hatarako | 253d107db7a15caaf63794d9b8a4acc99168fba0 | [
"MIT"
] | null | null | null | src/hataraku/migrations/0004_auto_20190614_1323.py | HNJ755329/Hatarako | 253d107db7a15caaf63794d9b8a4acc99168fba0 | [
"MIT"
] | null | null | null | src/hataraku/migrations/0004_auto_20190614_1323.py | HNJ755329/Hatarako | 253d107db7a15caaf63794d9b8a4acc99168fba0 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2019-06-14 04:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hataraku', '0003_auto_20190614_1319'),
]
operations = [
migrations.AlterField(
model_name='post',
name='color',
... | 20.157895 | 49 | 0.5953 |
37df33e7c099cf9f88b7ee4261db32a420f885b9 | 1,934 | py | Python | assault/cli.py | joseph-mcdaniel/load-testing | 159c083cc9c0981837ff9f21b9d9ddaa4df4fe6f | [
"MIT"
] | null | null | null | assault/cli.py | joseph-mcdaniel/load-testing | 159c083cc9c0981837ff9f21b9d9ddaa4df4fe6f | [
"MIT"
] | 3 | 2020-03-24T18:26:32.000Z | 2021-02-02T22:38:13.000Z | assault/cli.py | joseph-mcdaniel/load-testing | 159c083cc9c0981837ff9f21b9d9ddaa4df4fe6f | [
"MIT"
] | null | null | null | import click
import sys
import json
from typing import TextIO
from .http import assault
from .stats import Results
@click.command()
@click.option("--requests", "-r", default=500, help="Number of requests")
@click.option("--concurrency", "-c", default=1, help="Number of concurrent requests")
@click.option("--json-fil... | 34.535714 | 85 | 0.599793 |
c26ac1a91dabdb0034c28b5241ea7cfad78d438f | 3,375 | py | Python | jscatter/jscatter_test.py | flekschas/jupyter-scatter | 550eceb2311b0394caad83dbb399ed2f29e55af6 | [
"Apache-2.0"
] | 23 | 2021-02-03T02:05:47.000Z | 2022-03-17T14:53:39.000Z | jscatter/jscatter_test.py | manzt/jupyter-scatter | c38f94abfb655e03f407e7fcec80a883439796b5 | [
"Apache-2.0"
] | 5 | 2021-02-04T22:19:35.000Z | 2022-03-07T04:49:31.000Z | jscatter/jscatter_test.py | manzt/jupyter-scatter | c38f94abfb655e03f407e7fcec80a883439796b5 | [
"Apache-2.0"
] | 1 | 2021-06-15T14:14:47.000Z | 2021-06-15T14:14:47.000Z | import numpy as np
import pandas as pd
from .jscatter import Scatter, component_idx_to_name
from .utils import minmax_scale
def test_component_idx_to_name():
assert 'valueA' == component_idx_to_name(2)
assert 'valueB' == component_idx_to_name(3)
assert None == component_idx_to_name(4)
assert None == c... | 31.25 | 105 | 0.647704 |
2af8a1e22dfbc99a5cf33569f3a1a48ef476b490 | 730 | py | Python | weather-station/bme280_sensor.py | jeremyhamm/pi-weather-dashboard | ada4441f72251f7238c1d86f1e5b69af089c7baa | [
"MIT"
] | null | null | null | weather-station/bme280_sensor.py | jeremyhamm/pi-weather-dashboard | ada4441f72251f7238c1d86f1e5b69af089c7baa | [
"MIT"
] | null | null | null | weather-station/bme280_sensor.py | jeremyhamm/pi-weather-dashboard | ada4441f72251f7238c1d86f1e5b69af089c7baa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import bme280
import smbus2
# RaspberryPi Logic
port = 1
address = 0x76 # Adafruit BME280 address. Other BME280s may be different
bus = smbus2.SMBus(port)
bme280.load_calibration_params(bus,address)
def read_all():
bme280_data = bme280.sample(bus,address)
humidity = bme280_data.humidity
... | 26.071429 | 72 | 0.716438 |
809521775abac2ec5b2d1b84ebaa91bd00dc6a93 | 7,843 | py | Python | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.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 ... | 55.624113 | 111 | 0.865485 |
5a4a7d0b916bf074e121c3e0ff1cc12975b2bf82 | 641 | py | Python | export_example.py | WorldException/jira2gitlab | bae0d2a5912f1e7e4569a534f1b1f4177eda9449 | [
"MIT"
] | null | null | null | export_example.py | WorldException/jira2gitlab | bae0d2a5912f1e7e4569a534f1b1f4177eda9449 | [
"MIT"
] | null | null | null | export_example.py | WorldException/jira2gitlab | bae0d2a5912f1e7e4569a534f1b1f4177eda9449 | [
"MIT"
] | null | null | null | from jira2gitlab import jira
# Example export project to local files (issues database and attachments)
# name from url https://{name}.atlassian.net/
# token from https://id.atlassian.com/manage-profile/security/api-tokens
jira.configure('name', 'you_mail@gmail.com', 'jira_token')
# export all projects
jira.export_pr... | 32.05 | 80 | 0.75663 |
5d64c2b2bd29c80c79ed1a24f90b2b2e45a6bb8b | 910 | py | Python | src/som/primitives/object_primitives.py | SOM-st/RPySOM | 2dcfc71786a3bd5be5a842c649645f71d6c35f89 | [
"MIT"
] | 12 | 2016-01-07T14:20:57.000Z | 2019-10-13T06:56:20.000Z | src/som/primitives/object_primitives.py | SOM-st/RPySOM | 2dcfc71786a3bd5be5a842c649645f71d6c35f89 | [
"MIT"
] | 2 | 2016-05-26T06:53:33.000Z | 2020-09-02T15:58:28.000Z | src/som/primitives/object_primitives.py | SOM-st/RPySOM | 2dcfc71786a3bd5be5a842c649645f71d6c35f89 | [
"MIT"
] | 2 | 2016-05-25T06:07:52.000Z | 2019-10-02T16:52:25.000Z | from rlib.objectmodel import compute_identity_hash
from som.primitives.primitives import Primitives
from som.vm.globals import trueObject, falseObject
from som.vmobjects.primitive import UnaryPrimitive, BinaryPrimitive
def _equals(op1, op2):
if op1 is op2:
return trueObject
else:
return false... | 29.354839 | 95 | 0.759341 |
c19297d0ca95b632a8b470de953f10811a111927 | 1,738 | py | Python | land_planning_and_allocation/api.py | the-bantoo/Land-Planning-And-Allocation | 67a6b57c7c4ddc40a51691f94cacb5e28b1c5cd5 | [
"MIT"
] | null | null | null | land_planning_and_allocation/api.py | the-bantoo/Land-Planning-And-Allocation | 67a6b57c7c4ddc40a51691f94cacb5e28b1c5cd5 | [
"MIT"
] | 1 | 2020-10-05T15:50:33.000Z | 2020-10-07T10:28:31.000Z | land_planning_and_allocation/api.py | the-bantoo/Land-Planning-And-Allocation | 67a6b57c7c4ddc40a51691f94cacb5e28b1c5cd5 | [
"MIT"
] | 2 | 2020-10-29T17:38:08.000Z | 2021-09-07T10:59:27.000Z | import frappe
from frappe import _
def create_item(plot, method):
settings = frappe.get_doc('Land Settings')
plot_item = frappe.get_doc({
"doctype": "Item",
"item_group": settings.land_for_sale_group,
"default_warehouse": settings.sales_land_warehouse,
"item_code": "Plot " + ... | 36.208333 | 251 | 0.611047 |
5ab348c162bd9c449f42f0a2e999c7c6876ec2d5 | 415 | py | Python | thinkpython_allen_downey/exercise_5_3.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_5_3.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_5_3.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | def check_fermat(a, b, c, n):
if a**n + b**n == c**n:
print('Holy smokes, Fermat was wrong!')
else:
print("No, that doesn't work")
def get_input():
a = int(input('Please enter a value for a:'))
b = int(input('Please enter a value for b:'))
c = int(input('Please enter a value for c:'... | 27.666667 | 49 | 0.573494 |
ff650ed250f94b07d5e1891a08f9a2fd7c37d4c2 | 929 | py | Python | imagegallery/migrations/0002_post.py | Vincent-Juma/Django-Portfolio | 53dd6a811f04b66c99d4985c3cb97d2bc5a86cc5 | [
"MIT"
] | 1 | 2021-05-28T14:16:59.000Z | 2021-05-28T14:16:59.000Z | imagegallery/migrations/0002_post.py | Vincent-Juma/Django-Portfolio | 53dd6a811f04b66c99d4985c3cb97d2bc5a86cc5 | [
"MIT"
] | null | null | null | imagegallery/migrations/0002_post.py | Vincent-Juma/Django-Portfolio | 53dd6a811f04b66c99d4985c3cb97d2bc5a86cc5 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-05 12:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 33.178571 | 120 | 0.636168 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.