hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fd7ddf414c153d91f9749982752c427d082f2d2f | 6,313 | py | Python | src/models/optimizer_bank.py | ChihHsuLin/cellular_image_classification | 5ea81b4a0f42d17ecb95c41ff4349ef610841394 | [
"MIT"
] | null | null | null | src/models/optimizer_bank.py | ChihHsuLin/cellular_image_classification | 5ea81b4a0f42d17ecb95c41ff4349ef610841394 | [
"MIT"
] | null | null | null | src/models/optimizer_bank.py | ChihHsuLin/cellular_image_classification | 5ea81b4a0f42d17ecb95c41ff4349ef610841394 | [
"MIT"
] | 1 | 2021-09-24T12:22:28.000Z | 2021-09-24T12:22:28.000Z | import math
import torch
import torchcontrib
from torch.optim.optimizer import Optimizer
import itertools as it
class StochasticWeightAverage(torchcontrib.optim.SWA):
def __init__(self, optimizer, swa_start=None, swa_freq=None, swa_lr=None):
super(StochasticWeightAverage, self).__init__(optimizer, sw... | 38.03012 | 132 | 0.545699 |
0d7687ea57c2206103bf0f5dd9a10c2ea2f50369 | 6,472 | py | Python | tests/mechanic/launcher_test.py | paulcoghlan/rally | 76f82265814836565ccf53edda3d5426e4c2db8a | [
"Apache-2.0"
] | null | null | null | tests/mechanic/launcher_test.py | paulcoghlan/rally | 76f82265814836565ccf53edda3d5426e4c2db8a | [
"Apache-2.0"
] | null | null | null | tests/mechanic/launcher_test.py | paulcoghlan/rally | 76f82265814836565ccf53edda3d5426e4c2db8a | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase, mock
from esrally import config, exceptions
from esrally.utils import opts
from esrally.mechanic import launcher
class MockMetricsStore:
def add_meta_info(self, scope, scope_key, key, value):
pass
class MockClientFactory:
def __init__(self, hosts, client_options):
... | 40.198758 | 122 | 0.612021 |
a21a9d6c77a9a4b3b388e91b2ff2c17fc6c3c815 | 9,065 | py | Python | scripts/comb_model.py | fpl-analytics/gr_crypto | 2b0ab451c9c205a9f572c4bca23fffbb68ca188f | [
"MIT"
] | null | null | null | scripts/comb_model.py | fpl-analytics/gr_crypto | 2b0ab451c9c205a9f572c4bca23fffbb68ca188f | [
"MIT"
] | null | null | null | scripts/comb_model.py | fpl-analytics/gr_crypto | 2b0ab451c9c205a9f572c4bca23fffbb68ca188f | [
"MIT"
] | null | null | null | # G-Research Crypto Kaggle Project
# Running tf model based on vwap.
# I want to try this a couple of different ways :
# - Normalised (whole column)
# - Normalised (by each "row" in the 3d array)
# I think row based will be better, as Target is Growth not absolute
# Setup
import os
import matplotlib.pyplot as pl... | 31.919014 | 94 | 0.677882 |
444a69435675d1abac498373dfdc6f793bda43f7 | 3,462 | py | Python | api/admin/controller/cdn_services.py | aseefahmed/circulation | 17cbc9186ab3cde9606912559f92b393ac18ecaa | [
"Apache-2.0"
] | null | null | null | api/admin/controller/cdn_services.py | aseefahmed/circulation | 17cbc9186ab3cde9606912559f92b393ac18ecaa | [
"Apache-2.0"
] | 44 | 2022-01-20T01:31:32.000Z | 2022-03-31T01:50:41.000Z | api/admin/controller/cdn_services.py | jonathangreen/circulation | 118866f8257e2a97431a28ea5ba8e34e5bd393eb | [
"Apache-2.0"
] | null | null | null | import flask
from flask import Response
from flask_babel import lazy_gettext as _
from api.admin.problem_details import *
from core.model import Configuration, ExternalIntegration
from core.util.problem_detail import ProblemDetail
from . import SettingsController
class CDNServicesController(SettingsController):
... | 31.472727 | 85 | 0.561236 |
c5512f0e5d970c7647efe67ebc0959b8f8a9a047 | 102,258 | py | Python | montepython/analyze.py | syasini/montepython_public | d33537664b9719c172dab72273939f4301f2f3ba | [
"MIT"
] | 2 | 2021-01-11T13:15:09.000Z | 2022-03-04T00:44:59.000Z | montepython/analyze.py | syasini/montepython_public | d33537664b9719c172dab72273939f4301f2f3ba | [
"MIT"
] | 1 | 2019-08-10T00:54:28.000Z | 2019-08-10T00:54:28.000Z | montepython/analyze.py | syasini/montepython_public | d33537664b9719c172dab72273939f4301f2f3ba | [
"MIT"
] | 1 | 2019-06-26T10:38:21.000Z | 2019-06-26T10:38:21.000Z | """
.. module:: analyze
:synopsis: Extract data from chains and produce plots
.. moduleauthor:: Karim Benabed <benabed@iap.fr>
.. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch>
Collection of functions needed to analyze the Markov chains.
This module defines as well a class :class:`Information`, that sto... | 44.928822 | 237 | 0.536056 |
7f20a9b827484444a291861e56b197b9a601ca91 | 466 | py | Python | backend/group/migrations/0003_auto_20200829_1930.py | cjc7373/hackergame | 86971b4cf8a2761044d417b4c8bd934c3309d6fd | [
"MIT"
] | 2 | 2020-07-12T13:11:43.000Z | 2020-07-14T08:12:17.000Z | backend/group/migrations/0003_auto_20200829_1930.py | cjc7373/hackergame | 86971b4cf8a2761044d417b4c8bd934c3309d6fd | [
"MIT"
] | 1 | 2020-08-13T13:56:18.000Z | 2020-09-29T12:39:08.000Z | backend/group/migrations/0003_auto_20200829_1930.py | cjc7373/hackergame | 86971b4cf8a2761044d417b4c8bd934c3309d6fd | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-29 11:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('group', '0002_auto_20200812_2011'),
]
operations = [
migrations.AlterField(
model_name='application',
name='status',
... | 24.526316 | 129 | 0.609442 |
9ee4359f215d9507c158cdc207f2be19e67ed873 | 261 | py | Python | Plotting/Standard/Pandas/Scatter plot.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | Plotting/Standard/Pandas/Scatter plot.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | Plotting/Standard/Pandas/Scatter plot.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | # Directly plot a scatter-plot from a pandas DataFrame
attribute1 = ''
attribute2 = ''
data.plot.scatter(x=attribute1, y=attribute2, figsize=(10,6), alpha=0.5, s=50)
ax = plt.gca()
ax.set_xlabel(attribute1, fontsize=14)
ax.set_ylabel(attribute2, fontsize=14); | 29 | 78 | 0.739464 |
fc3f0bae1fdb96441d5be8afd33686f1016d308a | 805 | py | Python | Reading/manage.py | SnowmanZhang/CharacterTest | c4936174557594fca93a747b3a9893446e9afd67 | [
"MIT"
] | null | null | null | Reading/manage.py | SnowmanZhang/CharacterTest | c4936174557594fca93a747b3a9893446e9afd67 | [
"MIT"
] | null | null | null | Reading/manage.py | SnowmanZhang/CharacterTest | c4936174557594fca93a747b3a9893446e9afd67 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Reading.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | 35 | 77 | 0.642236 |
44e8971d46e5d5896fea6c265508a5bd004cb952 | 16,883 | py | Python | qa/rpc-tests/pruning.py | realzzt/BitCoin2013 | a8e6863dd39570db449318296c0809fb8476174d | [
"MIT"
] | null | null | null | qa/rpc-tests/pruning.py | realzzt/BitCoin2013 | a8e6863dd39570db449318296c0809fb8476174d | [
"MIT"
] | null | null | null | qa/rpc-tests/pruning.py | realzzt/BitCoin2013 | a8e6863dd39570db449318296c0809fb8476174d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test pruning code
# ********
# WARNING:
# This test uses 4GB of disk space.
# This test tak... | 49.365497 | 168 | 0.573239 |
f27e97ed8084150b94c02d541e89ddc9fbc8ce1a | 5,770 | py | Python | tests/integrational/native_threads/test_channel_groups.py | 17media/pubnub-python | ee372eec82f16d3a80a4cd027bca8976755b817f | [
"MIT"
] | null | null | null | tests/integrational/native_threads/test_channel_groups.py | 17media/pubnub-python | ee372eec82f16d3a80a4cd027bca8976755b817f | [
"MIT"
] | null | null | null | tests/integrational/native_threads/test_channel_groups.py | 17media/pubnub-python | ee372eec82f16d3a80a4cd027bca8976755b817f | [
"MIT"
] | null | null | null | import logging
import threading
import time
import unittest
import pubnub
from pubnub.models.consumer.channel_group import PNChannelGroupsAddChannelResult, PNChannelGroupsListResult, \
PNChannelGroupsRemoveChannelResult, PNChannelGroupsRemoveGroupResult
from pubnub.pubnub import PubNub
from tests.helper import pnc... | 30.855615 | 110 | 0.638128 |
b9b511a07527d05beb6d79489f4bd928241160d7 | 966 | py | Python | awwards_users/urls.py | andyjohn23/awwards-clone | 6f4297f37dbc15e95e845d837149d7f4d97eecad | [
"MIT"
] | null | null | null | awwards_users/urls.py | andyjohn23/awwards-clone | 6f4297f37dbc15e95e845d837149d7f4d97eecad | [
"MIT"
] | null | null | null | awwards_users/urls.py | andyjohn23/awwards-clone | 6f4297f37dbc15e95e845d837149d7f4d97eecad | [
"MIT"
] | null | null | null | from django.urls import path
from .views import CategoryListView, PostDeleteView, PostListView, PostCreateView, PersonalPostListView, UserPostListView, PostUpdateView, PostDetailView
from . import views
urlpatterns = [
path('', PostListView.as_view(), name='index'),
path('rates/', views.rating_project, name='... | 50.842105 | 153 | 0.716356 |
abbf1e9fceca32a098bb5178c2d6d4421a679168 | 1,560 | py | Python | trinity/plugins/registry.py | stringray55/trinity | d14ad79bfb679d7a8430f5a73605c2c57e542fb0 | [
"MIT"
] | null | null | null | trinity/plugins/registry.py | stringray55/trinity | d14ad79bfb679d7a8430f5a73605c2c57e542fb0 | [
"MIT"
] | null | null | null | trinity/plugins/registry.py | stringray55/trinity | d14ad79bfb679d7a8430f5a73605c2c57e542fb0 | [
"MIT"
] | null | null | null | import pkg_resources
from typing import (
Tuple,
)
from trinity.extensibility import (
BasePlugin,
)
from trinity.plugins.builtin.attach.plugin import (
AttachPlugin
)
from trinity.plugins.builtin.ethstats.plugin import (
EthstatsPlugin,
)
from trinity.plugins.builtin.fix_unclean_shutdown.plugin import... | 24.761905 | 98 | 0.741667 |
aacc47078076a0cbfd37b382390a1557d587faa1 | 32,013 | py | Python | game.py | Xe-Xo/Catan | f34b82b88bc58b1e698b576bb7e771bf36b4390c | [
"MIT"
] | 1 | 2022-01-13T20:07:46.000Z | 2022-01-13T20:07:46.000Z | game.py | Xe-Xo/Catan | f34b82b88bc58b1e698b576bb7e771bf36b4390c | [
"MIT"
] | null | null | null | game.py | Xe-Xo/Catan | f34b82b88bc58b1e698b576bb7e771bf36b4390c | [
"MIT"
] | null | null | null |
import pygame
import random
import math
from grid import *
from players import *
## TO DO -- BETTER WAY TO TREAT GLOBALS THAT CAN BE ACCESSED BY MAIN AND GAME
class GAME_GLOBALS():
WHITE = (255,255,255)
LIGHT_GRAY = (200,200,200)
GRAY = (150,150,150)
DARK_GRAY = (100,100,100)
BLACK = (50,50,50)
... | 39.86675 | 224 | 0.613001 |
e850dc18a522715904d99e972558fa9712fb49a5 | 12,823 | py | Python | src/whop/whopclient/model/create_checkout_log_request.py | whopio/whop-python-sdk | 9b4da585bf81065a9a435cf6651d9a0cd206088c | [
"MIT"
] | null | null | null | src/whop/whopclient/model/create_checkout_log_request.py | whopio/whop-python-sdk | 9b4da585bf81065a9a435cf6651d9a0cd206088c | [
"MIT"
] | null | null | null | src/whop/whopclient/model/create_checkout_log_request.py | whopio/whop-python-sdk | 9b4da585bf81065a9a435cf6651d9a0cd206088c | [
"MIT"
] | null | null | null | """
Whop API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.10
Contact: support@whop.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa:... | 44.992982 | 124 | 0.567028 |
9907edefe8393736c52bbad19f029e86a1b29115 | 1,896 | py | Python | login/views.py | nitinankad/diet-tracker | e21afc578e0c2575a7b6168a488e123e9a319c19 | [
"MIT"
] | 4 | 2020-10-13T18:42:48.000Z | 2021-08-10T13:57:00.000Z | login/views.py | nitinankad/diet-tracker | e21afc578e0c2575a7b6168a488e123e9a319c19 | [
"MIT"
] | null | null | null | login/views.py | nitinankad/diet-tracker | e21afc578e0c2575a7b6168a488e123e9a319c19 | [
"MIT"
] | 3 | 2019-12-13T23:32:10.000Z | 2020-06-02T22:42:28.000Z | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from login.forms import LoginForm
def register(request):
if request.method == "... | 27.882353 | 86 | 0.672996 |
8585d3d969eb2df6f59daea7aa65925c3a46a8d5 | 2,371 | py | Python | core.py | kmlmhnn/ren | fcf83bd16193fc15f27a8b3234ac0e150bd27ce3 | [
"MIT"
] | null | null | null | core.py | kmlmhnn/ren | fcf83bd16193fc15f27a8b3234ac0e150bd27ce3 | [
"MIT"
] | null | null | null | core.py | kmlmhnn/ren | fcf83bd16193fc15f27a8b3234ac0e150bd27ce3 | [
"MIT"
] | null | null | null | import os
def prefixfn(string, _, new):
return new + string
def suffixfn(string, _, new):
return string + new
def insertfn(string, substring, new):
if not new or not substring or substring not in string:
return string
before, sep, after = string.partition(substring)
return ''.join([bef... | 25.223404 | 73 | 0.592155 |
dee87e2cd732e0965365e9cdbfcf155f0d78d6f0 | 22,397 | py | Python | tools/converter.py | htwangtw/pydra-fsl | 84b18e32eb181f61780bff75240be7fa05efa637 | [
"Apache-2.0"
] | 1 | 2021-06-17T09:58:06.000Z | 2021-06-17T09:58:06.000Z | tools/converter.py | htwangtw/pydra-fsl | 84b18e32eb181f61780bff75240be7fa05efa637 | [
"Apache-2.0"
] | 16 | 2020-11-03T13:56:12.000Z | 2022-01-31T17:07:13.000Z | tools/converter.py | htwangtw/pydra-fsl | 84b18e32eb181f61780bff75240be7fa05efa637 | [
"Apache-2.0"
] | 4 | 2020-06-16T17:40:37.000Z | 2021-02-18T09:42:48.000Z | from attr import has
from nipype.interfaces import fsl
from nipype.interfaces.base import traits_extension
from pydra.engine import specs
from pydra.engine.helpers import ensure_list
import os, sys, yaml, black, imp
import traits
from pathlib import Path
import typing as ty
import inspect
import click
import warnings
... | 41.170956 | 143 | 0.594901 |
6786cd7847fa50ff7e6fe51240d177a0c7515538 | 4,483 | py | Python | devtools/mk/create_resources.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | devtools/mk/create_resources.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | devtools/mk/create_resources.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | #!/usr/bin/env python3
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility to create 'resource' files for Chromium OS factory build system.
This utility scans for *.rsrc, and creates the resourc... | 32.963235 | 88 | 0.68124 |
ebfe22dad69d3fb9671bcdfd49387b22de140a59 | 9,446 | py | Python | internal-enrichment/hygiene/src/hygiene.py | tiiibs/connectors | 65349790813a1d49f4536662725d99d8bfa08481 | [
"Apache-2.0"
] | 132 | 2019-06-28T23:23:18.000Z | 2022-03-30T07:47:55.000Z | internal-enrichment/hygiene/src/hygiene.py | tiiibs/connectors | 65349790813a1d49f4536662725d99d8bfa08481 | [
"Apache-2.0"
] | 472 | 2019-06-26T12:14:54.000Z | 2022-03-31T13:49:53.000Z | internal-enrichment/hygiene/src/hygiene.py | tiiibs/connectors | 65349790813a1d49f4536662725d99d8bfa08481 | [
"Apache-2.0"
] | 185 | 2019-07-01T09:32:14.000Z | 2022-03-28T05:29:12.000Z | import os
import yaml
from pymispwarninglists import WarningLists
from pycti import OpenCTIConnectorHelper, get_config_variable
# At the moment it is not possible to map lists to their upstream path.
# Thus we need to have our own mapping here.
# Reference: https://github.com/MISP/misp-warninglists/issues/142
# To ge... | 52.187845 | 137 | 0.653187 |
978f499978b1b72de6b0de2378200641a3a7591b | 921 | py | Python | sa/profiles/HP/Comware/get_chassis_id.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | sa/profiles/HP/Comware/get_chassis_id.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | sa/profiles/HP/Comware/get_chassis_id.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# HP.Comware.get_chassis_id
# ---------------------------------------------------------------------
# Copyright (C) 2007-2016 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Pytho... | 34.111111 | 92 | 0.54506 |
b3b1605b206912ee968bd3a65a6ab1469759411d | 60,629 | py | Python | tensorflow/python/tpu/tensor_tracer.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/tpu/tensor_tracer.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/tpu/tensor_tracer.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # 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... | 42.103472 | 116 | 0.663478 |
7268a93b653f4f6560499c60351ef846046b26a0 | 3,236 | py | Python | gobigger/hyper/configs/config_2f2s.py | jayyoung0802/GoBigger | f7cf14ee4208e041295035342ecee70026f268d9 | [
"Apache-2.0"
] | 189 | 2021-10-08T07:55:10.000Z | 2022-03-31T23:49:43.000Z | gobigger/hyper/configs/config_2f2s.py | jayyoung0802/GoBigger | f7cf14ee4208e041295035342ecee70026f268d9 | [
"Apache-2.0"
] | 25 | 2021-11-01T06:59:30.000Z | 2022-03-22T11:22:27.000Z | gobigger/hyper/configs/config_2f2s.py | jayyoung0802/GoBigger | f7cf14ee4208e041295035342ecee70026f268d9 | [
"Apache-2.0"
] | 28 | 2021-10-14T12:23:14.000Z | 2022-03-31T23:49:45.000Z | # 分身合球,分身吃球
server_default_config = dict(
team_num=2,
player_num_per_team=2,
map_width=300,
map_height=300,
match_time=10,
state_tick_per_second=10, # frame
action_tick_per_second=5, # frame
collision_detection_type='precision',
save_video=False,
save_quality='high', # ['high'... | 35.173913 | 102 | 0.542954 |
b486343e3e524177322949219cae4c7b4728f679 | 163 | py | Python | analysis/test.py | njchiang/analogy-fmri | 90a6870a7c15dc71d3ea193b6dfea91fc7295108 | [
"MIT"
] | 2 | 2019-12-11T02:46:36.000Z | 2021-07-02T08:29:16.000Z | analysis/test.py | njchiang/analogy-fmri | 90a6870a7c15dc71d3ea193b6dfea91fc7295108 | [
"MIT"
] | null | null | null | analysis/test.py | njchiang/analogy-fmri | 90a6870a7c15dc71d3ea193b6dfea91fc7295108 | [
"MIT"
] | null | null | null | import os
from fmri.analogy_rsa import *
from fmri.analogy_utils import *
def main():
assert True, "something's broken"
if __name__ == "__main__":
main() | 18.111111 | 37 | 0.705521 |
4c7476e36b1f3d0f009a8671bdb4f20dd8780ff5 | 2,933 | py | Python | parlai/scripts/build_candidates.py | omry/ParlAI | 61703c7b76dce45bc7f7282b20a35be64c6a0880 | [
"MIT"
] | 9 | 2020-01-17T09:34:00.000Z | 2021-11-19T07:46:52.000Z | parlai/scripts/build_candidates.py | omry/ParlAI | 61703c7b76dce45bc7f7282b20a35be64c6a0880 | [
"MIT"
] | 5 | 2019-12-29T07:52:39.000Z | 2022-03-12T00:10:03.000Z | parlai/scripts/build_candidates.py | omry/ParlAI | 61703c7b76dce45bc7f7282b20a35be64c6a0880 | [
"MIT"
] | 2 | 2020-01-28T01:41:52.000Z | 2020-12-27T07:22:07.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Build the candidate responses for a retrieval model.
Examples
--------
.. code-block:: shell
python build_candida... | 30.552083 | 87 | 0.617457 |
39ce4fa6784d926edf82192f9146f5b179fec43f | 24,564 | py | Python | safe_control_gym/controllers/lqr/ilqr.py | catgloss/safe-control-gym | b3f69bbed8577f64fc36d23677bf50027e991b2d | [
"MIT"
] | null | null | null | safe_control_gym/controllers/lqr/ilqr.py | catgloss/safe-control-gym | b3f69bbed8577f64fc36d23677bf50027e991b2d | [
"MIT"
] | null | null | null | safe_control_gym/controllers/lqr/ilqr.py | catgloss/safe-control-gym | b3f69bbed8577f64fc36d23677bf50027e991b2d | [
"MIT"
] | null | null | null | """Linear Quadratic Regulator (LQR)
[1] https://studywolf.wordpress.com/2016/02/03/the-iterative-linear-quadratic-regulator-method/
[2] https://arxiv.org/pdf/1708.09342.pdf
Example:
run ilqr on cartpole balance:
python3 experiments/main.py --func test --tag ilqr_pendulum --algo ilqr --task cartpole
... | 39.11465 | 137 | 0.532202 |
393dffcf9e04df00974024a1d02d23daa2a05bb8 | 2,956 | py | Python | docs/conf.py | dmyersturnbull/sauronx | 5c0cd4a0602dcd3224f799701f95f48d5ddf2fc0 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | dmyersturnbull/sauronx | 5c0cd4a0602dcd3224f799701f95f48d5ddf2fc0 | [
"Apache-2.0"
] | 27 | 2021-02-22T06:49:46.000Z | 2022-03-14T09:15:55.000Z | docs/conf.py | dmyersturnbull/sauronx | 5c0cd4a0602dcd3224f799701f95f48d5ddf2fc0 | [
"Apache-2.0"
] | null | null | null | """
Sphinx config file.
Uses several extensions to get API docs and sourcecode.
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""
from pathlib import Path
from typing import Optional, Type, TypeVar
import tomlkit
# This assumes that we have the full project root above, containing pyproject.toml
_root... | 32.844444 | 87 | 0.721583 |
25198d8b8d4beda066b30989fdc21735cb50c1c4 | 4,120 | py | Python | chartify/_core/options.py | rechenchen/PycharmProjects | 9e5dd9e3795bc440738d2d9df4ec55eb9f902f08 | [
"Apache-2.0"
] | 1 | 2019-01-03T00:36:08.000Z | 2019-01-03T00:36:08.000Z | chartify/_core/options.py | gabriel-rcpereira/chartify | 6dbe996e847d9c37ebe1b712eb9791ab96c8387a | [
"Apache-2.0"
] | 4 | 2021-09-08T03:06:21.000Z | 2022-03-12T00:55:48.000Z | chartify/_core/options.py | gabriel-rcpereira/chartify | 6dbe996e847d9c37ebe1b712eb9791ab96c8387a | [
"Apache-2.0"
] | 1 | 2019-05-22T20:11:16.000Z | 2019-05-22T20:11:16.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017-2018 Spotify AB
#
# 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... | 33.495935 | 74 | 0.625485 |
7e1fc58e7d813e9c8e11ec3b66eadc0433fd2f6a | 1,960 | py | Python | day2/day2.py | tomp/AOC-2020 | c7b8313f883b6285f118d281d99c4b32b0497289 | [
"MIT"
] | null | null | null | day2/day2.py | tomp/AOC-2020 | c7b8313f883b6285f118d281d99c4b32b0497289 | [
"MIT"
] | null | null | null | day2/day2.py | tomp/AOC-2020 | c7b8313f883b6285f118d281d99c4b32b0497289 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Advent of Code 2020 - Day N
#
from pathlib import Path
from collections import Counter
import re
LINE_RE = re.compile(r"(\d+)-(\d+) (\w): (\w+)$")
INPUTFILE = 'input.txt'
def sample_input():
return filter_blank_lines("""
1-3 a: abcde
1-3 b: cdefg
2-9 c: ccccccccc
""".split("\n"))
# U... | 21.075269 | 73 | 0.592347 |
31c17378634a74755a77a40ade0b50f6004b3f3d | 205 | py | Python | python_pd/work/syntax/fizzbuzz/fizzbuzz.py | SerLap-ctrl/python-bp | 1db0446bc95989ac23083e277806a2942c8d124f | [
"MIT"
] | 17 | 2020-12-02T08:37:10.000Z | 2022-03-11T11:58:57.000Z | python_pd/work/syntax/fizzbuzz/fizzbuzz.py | SerLap-ctrl/python-bp | 1db0446bc95989ac23083e277806a2942c8d124f | [
"MIT"
] | 6 | 2021-07-01T04:39:24.000Z | 2021-11-03T19:04:43.000Z | python_pd/work/syntax/fizzbuzz/fizzbuzz.py | SerLap-ctrl/python-bp | 1db0446bc95989ac23083e277806a2942c8d124f | [
"MIT"
] | 15 | 2021-07-01T04:41:15.000Z | 2022-03-04T15:49:15.000Z | def fizzbuzz(number):
# разместите здесь реализацию основной логики программы.
pass
def main():
# разместите здесь проверку входных значений.
pass
if __name__ == '__main__':
main()
| 15.769231 | 60 | 0.682927 |
7927271ed1659b7348835fc54abf7fb3cd146395 | 339 | py | Python | day1.py | davide-butera/advent-of-code-2020 | 1cc67992caaa24200ee3c379f6558b46a2b5fcc7 | [
"MIT"
] | null | null | null | day1.py | davide-butera/advent-of-code-2020 | 1cc67992caaa24200ee3c379f6558b46a2b5fcc7 | [
"MIT"
] | null | null | null | day1.py | davide-butera/advent-of-code-2020 | 1cc67992caaa24200ee3c379f6558b46a2b5fcc7 | [
"MIT"
] | null | null | null | from load import load
data = list(map(lambda l: int(l), load()))
def part1():
for i in data:
if (2020 - i) in data:
return i * (2020 - i)
def part2():
for i in data:
for j in data:
if (2020 - i - j) in data:
return i * j * (2020 - i - j)
print(part1... | 16.142857 | 45 | 0.480826 |
cb5881f2477edd3c915a34e30533fe364a5b0276 | 3,152 | py | Python | MachineLearning/Server_Prediction3.py | SKravitsky/MachineLearningServer | 170081fe1ea53be7394e35ce208bd665ae002b73 | [
"Apache-2.0"
] | null | null | null | MachineLearning/Server_Prediction3.py | SKravitsky/MachineLearningServer | 170081fe1ea53be7394e35ce208bd665ae002b73 | [
"Apache-2.0"
] | null | null | null | MachineLearning/Server_Prediction3.py | SKravitsky/MachineLearningServer | 170081fe1ea53be7394e35ce208bd665ae002b73 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import os
import sys
import pydot
import mysql.connector
from sklearn import tree
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.externals.six import StringIO
config = {
'user': 'ECE32',
'password': 'seniordesign'... | 23.878788 | 131 | 0.678299 |
0b5a3bc86832a854920da1271aba439a1bbef913 | 7,419 | py | Python | library/ospf_element_facts.py | Forcepoint/fp-NGFW-SMC-ansible | 47cafea1bef162e75f3632b969e996d53d636374 | [
"Apache-2.0"
] | 5 | 2019-11-19T07:23:01.000Z | 2021-08-25T08:04:49.000Z | library/ospf_element_facts.py | Forcepoint/fp-NGFW-SMC-ansible | 47cafea1bef162e75f3632b969e996d53d636374 | [
"Apache-2.0"
] | 2 | 2020-03-24T20:30:32.000Z | 2020-09-15T09:02:44.000Z | library/ospf_element_facts.py | Forcepoint/fp-NGFW-SMC-ansible | 47cafea1bef162e75f3632b969e996d53d636374 | [
"Apache-2.0"
] | 3 | 2020-03-24T20:32:29.000Z | 2022-02-15T15:29:07.000Z | #!/usr/bin/python
# Copyright (c) 2017-2019 Forcepoint
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: ospf_element_facts
short_description: Facts about OSPF based elements in the SMC
description:
- BGP elements are... | 27.275735 | 93 | 0.560183 |
913479ed43dbdc561dc9fe7b69728da1da432d1d | 794 | py | Python | egs2/libritts/tts1/src/create_data_from_alex.py | ishine/Unsupervised-TTS | 6f89633228626100615bcbe21263d80aea6920c5 | [
"Apache-2.0"
] | 2 | 2022-02-25T13:27:36.000Z | 2022-03-18T21:11:35.000Z | egs2/libritts/tts1/src/create_data_from_alex.py | ishine/Unsupervised-TTS | 6f89633228626100615bcbe21263d80aea6920c5 | [
"Apache-2.0"
] | null | null | null | egs2/libritts/tts1/src/create_data_from_alex.py | ishine/Unsupervised-TTS | 6f89633228626100615bcbe21263d80aea6920c5 | [
"Apache-2.0"
] | 1 | 2022-02-26T23:54:53.000Z | 2022-02-26T23:54:53.000Z | import os
import argparse
def create_data_dir(phn_seq_file, text_file):
with open(phn_seq_file, 'r') as f:
content = f.readlines()
content = [x.strip('\n') for x in content]
id2phn_seq = {x.split()[0]:' '.join(x.split()[1:]) for x in content}
with open(text_file, 'r') as f:
content = ... | 29.407407 | 72 | 0.618388 |
18375165a526a780f2e602a3800e12833dbb3e67 | 14,121 | py | Python | alphafold/data/mmcif_parsing.py | thenotcompany/alphafold | 1d43aaff941c84dc56311076b58795797e49107b | [
"Apache-2.0"
] | 45 | 2022-01-12T04:39:36.000Z | 2022-03-25T12:33:36.000Z | alphafold/data/mmcif_parsing.py | thenotcompany/alphafold | 1d43aaff941c84dc56311076b58795797e49107b | [
"Apache-2.0"
] | 6 | 2022-01-15T16:48:39.000Z | 2022-03-15T16:20:34.000Z | alphafold/data/mmcif_parsing.py | thenotcompany/alphafold | 1d43aaff941c84dc56311076b58795797e49107b | [
"Apache-2.0"
] | 10 | 2022-01-12T11:28:03.000Z | 2022-03-30T11:36:41.000Z | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | 36.677922 | 84 | 0.691665 |
260d3c5cecb37be3378fd1d3816fd08ad94a64a8 | 6,570 | py | Python | modules/feedparser/util.py | whanderley/eden | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | [
"MIT"
] | 2 | 2019-11-25T20:34:52.000Z | 2021-06-04T20:05:46.000Z | modules/feedparser/util.py | whanderley/eden | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | [
"MIT"
] | 1 | 2020-01-29T15:33:17.000Z | 2020-01-29T15:33:17.000Z | modules/feedparser/util.py | whanderley/eden | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | [
"MIT"
] | 3 | 2019-11-30T20:25:55.000Z | 2022-02-03T17:12:16.000Z | # Copyright 2010-2019 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistrib... | 39.341317 | 115 | 0.591629 |
43585adbcbc8761b49ed87aecc2093b1534422eb | 10,580 | py | Python | tests/connectors/pony/test_statement_filter.py | gvasold/papilotte | 7683da0a56daf77450f962caaf58b7cfe3acf408 | [
"Apache-2.0"
] | 3 | 2019-10-28T08:27:32.000Z | 2021-03-01T02:30:26.000Z | tests/connectors/pony/test_statement_filter.py | gvasold/papilotte | 7683da0a56daf77450f962caaf58b7cfe3acf408 | [
"Apache-2.0"
] | null | null | null | tests/connectors/pony/test_statement_filter.py | gvasold/papilotte | 7683da0a56daf77450f962caaf58b7cfe3acf408 | [
"Apache-2.0"
] | null | null | null | """Tests filtering (searching) for papilotte.connectors.pony.statement
"""
import copy
import datetime
import pytest
from pony import orm
from papilotte.connectors.pony import statement
def test_filter_by_factoid_id(db200final_cfg):
"Test the factoidId filter."
connector = statement.StatementConnector(db20... | 48.53211 | 102 | 0.703875 |
a8bef0dbbb17486c7114c09d850536406924295c | 20,808 | py | Python | blender/render_bodies.py | ivantishchenko/RefRESH | 08dd7a323ab62abcbf16b1cd13d48b787fbc878b | [
"MIT"
] | 1 | 2020-02-12T10:37:40.000Z | 2020-02-12T10:37:40.000Z | blender/render_bodies.py | ivantishchenko/RefRESH | 08dd7a323ab62abcbf16b1cd13d48b787fbc878b | [
"MIT"
] | null | null | null | blender/render_bodies.py | ivantishchenko/RefRESH | 08dd7a323ab62abcbf16b1cd13d48b787fbc878b | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2018 Zhaoyang Lv
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, modify, merge, publish, d... | 40.247582 | 167 | 0.621588 |
53683e5667d608ca22d96dd2e0c1d70999f55e9b | 294 | py | Python | jurisdictions/united-states/downloaddate_function.py | DiarmuidM/charity-dissolution | 17ddaa2177ec97661516bb46f773e7fb32178a29 | [
"MIT"
] | null | null | null | jurisdictions/united-states/downloaddate_function.py | DiarmuidM/charity-dissolution | 17ddaa2177ec97661516bb46f773e7fb32178a29 | [
"MIT"
] | null | null | null | jurisdictions/united-states/downloaddate_function.py | DiarmuidM/charity-dissolution | 17ddaa2177ec97661516bb46f773e7fb32178a29 | [
"MIT"
] | 2 | 2020-03-26T12:38:59.000Z | 2020-04-22T19:43:40.000Z | from time import sleep
from datetime import datetime
# Define a function that identifies the data the script was run; derived from datatime. Call on this function from other scripts.
def downloaddate():
ddate = datetime.today().strftime('%Y%m%d')
print(ddate)
return ddate
#downloaddate() | 29.4 | 129 | 0.768707 |
8dd5c507d7da342fde880fdbf2deb8b0ab3a95ee | 7,173 | py | Python | homeassistant/components/tibber/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 4 | 2020-07-29T17:47:10.000Z | 2020-09-16T13:39:13.000Z | homeassistant/components/tibber/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-11-08T19:40:10.000Z | 2022-03-01T11:11:07.000Z | homeassistant/components/tibber/sensor.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Support for Tibber sensors."""
import asyncio
from datetime import timedelta
import logging
import aiohttp
from homeassistant.const import POWER_WATT
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle, dt as dt_util
from .c... | 30.523404 | 88 | 0.632511 |
bc67a947ec5d3b7bd326a55d3b9cf1e39817f1b7 | 15,411 | py | Python | dependencies/rdflib/namespace.py | situx/geowebannotation | 1c4f27226913ae45f8943ee5fb2cabed494f3273 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | dependencies/rdflib/namespace.py | situx/geowebannotation | 1c4f27226913ae45f8943ee5fb2cabed494f3273 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | dependencies/rdflib/namespace.py | situx/geowebannotation | 1c4f27226913ae45f8943ee5fb2cabed494f3273 | [
"MIT"
] | 4 | 2021-06-10T18:54:16.000Z | 2021-10-25T00:42:22.000Z | from rdflib.py3compat import format_doctest_out
__doc__ = format_doctest_out("""
===================
Namespace Utilities
===================
RDFLib provides mechanisms for managing Namespaces.
In particular, there is a :class:`~rdflib.namespace.Namespace` class
that takes as its argument the base URI of the namespac... | 30.638171 | 132 | 0.577445 |
2ad490768db3777f6472de436030686eaa44944b | 2,583 | py | Python | ote_sdk/ote_sdk/usecases/exportable_code/visualization.py | pfinashx/training_extensions | 6b9d085900c0f8c0742a477ebf04f55987edd241 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/usecases/exportable_code/visualization.py | pfinashx/training_extensions | 6b9d085900c0f8c0742a477ebf04f55987edd241 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/usecases/exportable_code/visualization.py | pfinashx/training_extensions | 6b9d085900c0f8c0742a477ebf04f55987edd241 | [
"Apache-2.0"
] | null | null | null | # INTEL CONFIDENTIAL
#
# Copyright (C) 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and
# your use of them is governed by the express license under which they were provided to
# you ("License"). Unless the License provides otherwise, you may not use, modify, copy,
... | 36.380282 | 88 | 0.69338 |
98ff682c19a81c98f8897b0a20c2e6e30bcf587e | 670 | py | Python | api/util/escape.py | edisonlz/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | api/util/escape.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | null | null | null | api/util/escape.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 9 | 2019-12-23T12:59:25.000Z | 2022-03-15T05:12:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import simplejson as __json
except ImportError:
import json as __json
def to_str(value):
"""unicode->str"""
if isinstance(value, (str, type(None))):
return value
assert isinstance(value, unicode)
return value.encode("utf-8")
def to_... | 19.142857 | 53 | 0.622388 |
b20bd4d5269618989c3d8751b85a713941a0ccdb | 1,415 | py | Python | solum/tests/api/camp/test_platform_endpoints.py | ed-/solum | 2d23edb7fb53e1bdeff510710824658575d166c4 | [
"Apache-2.0"
] | null | null | null | solum/tests/api/camp/test_platform_endpoints.py | ed-/solum | 2d23edb7fb53e1bdeff510710824658575d166c4 | [
"Apache-2.0"
] | null | null | null | solum/tests/api/camp/test_platform_endpoints.py | ed-/solum | 2d23edb7fb53e1bdeff510710824658575d166c4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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, soft... | 38.243243 | 75 | 0.75053 |
225321c0bd21e3f7235ca52e56130ee6921043ed | 822 | py | Python | src/z3c/celery/logging.py | agroszer/z3c.celery | b64504c78a4b8d60f90208970167c3932c0aa919 | [
"BSD-3-Clause"
] | null | null | null | src/z3c/celery/logging.py | agroszer/z3c.celery | b64504c78a4b8d60f90208970167c3932c0aa919 | [
"BSD-3-Clause"
] | null | null | null | src/z3c/celery/logging.py | agroszer/z3c.celery | b64504c78a4b8d60f90208970167c3932c0aa919 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from celery._state import get_current_task
import zope.exceptions.log
class TaskFormatter(zope.exceptions.log.Formatter):
"""Provides `task_id` and `task_name` variables for the log format.
We want to have a general formatter so we want to get rid of '???' which
are... | 34.25 | 76 | 0.667883 |
835430777bb2dc5a56129928167fbec1d8ed13be | 4,927 | py | Python | clickTheBall.py | tommccallum/python-simple-games | f3a4e02c14ee200f7d20f816367668315fed42f6 | [
"MIT"
] | null | null | null | clickTheBall.py | tommccallum/python-simple-games | f3a4e02c14ee200f7d20f816367668315fed42f6 | [
"MIT"
] | null | null | null | clickTheBall.py | tommccallum/python-simple-games | f3a4e02c14ee200f7d20f816367668315fed42f6 | [
"MIT"
] | null | null | null | #!/usr/bin/python
## python script for a simple game
## where the person has to click on a round circle
## when they do their score goes up
## every n points the speed of movement increases
import pygame
import sys
import math
import random
import time
timeAllowed=10 ## seconds
level=1
width=640
height=480
initialRa... | 31.787097 | 105 | 0.527907 |
6c99c8379c86057607da638af82b3463e170302a | 1,043 | py | Python | oscarBuild/ContainerLauncher.py | PatrickKutch/minioncontainers | 018a9644199b4ec00348065519674eb775cc1d92 | [
"Apache-2.0"
] | null | null | null | oscarBuild/ContainerLauncher.py | PatrickKutch/minioncontainers | 018a9644199b4ec00348065519674eb775cc1d92 | [
"Apache-2.0"
] | null | null | null | oscarBuild/ContainerLauncher.py | PatrickKutch/minioncontainers | 018a9644199b4ec00348065519674eb775cc1d92 | [
"Apache-2.0"
] | null | null | null | import argparse
import subprocess
import os
def main():
parser = argparse.ArgumentParser(description='Minion Launcher.')
parser.add_argument("-t","--target",help='specifies the IP:PORT of target Oscar or Marvin',required=True,type=str)
parser.add_argument("-p","--port",help="the UDP port to listen on defau... | 30.676471 | 127 | 0.667306 |
169b2eeed2adb366abf620fa777ed2660e7b3b9d | 5,700 | py | Python | tests/test_pipeline3.py | gvwilson/nitinat | 48d95e27301af955c09d3757507f8fd66ce204d7 | [
"MIT"
] | null | null | null | tests/test_pipeline3.py | gvwilson/nitinat | 48d95e27301af955c09d3757507f8fd66ce204d7 | [
"MIT"
] | 14 | 2022-03-22T22:48:14.000Z | 2022-03-31T11:18:53.000Z | tests/test_pipeline3.py | gvwilson/nitinat | 48d95e27301af955c09d3757507f8fd66ce204d7 | [
"MIT"
] | null | null | null | """Test provenance pipeline."""
from datetime import datetime
from textwrap import dedent
from unittest.mock import patch
import pandas as pd
import yaml
from pytest import fixture
from nitinat.pipeline3 import pipeline
READ_CONFIG = "nitinat.pipeline3._read_config"
NOW = "nitinat.pipeline3._now"
READER_SHORTENED_L... | 28.787879 | 79 | 0.569123 |
de284f9dc9535c3eed51076b4eeae5f734ada46d | 2,630 | py | Python | src/jama/api_caller.py | taishengG/jama-slack-integration | 746b7186ceaf955ca81e9e0ad4862141ce35eb8d | [
"MIT"
] | 1 | 2019-07-17T22:39:21.000Z | 2019-07-17T22:39:21.000Z | src/jama/api_caller.py | taishengG/jama-slack-integration | 746b7186ceaf955ca81e9e0ad4862141ce35eb8d | [
"MIT"
] | 4 | 2018-11-16T05:56:06.000Z | 2018-11-29T05:07:52.000Z | src/jama/api_caller.py | taishengG/jama-slack-integration | 746b7186ceaf955ca81e9e0ad4862141ce35eb8d | [
"MIT"
] | 6 | 2018-11-08T03:49:28.000Z | 2019-04-29T19:53:25.000Z | from jama import oauth
import os
import json
import requests
def is_using_oauth():
return "DB_HOST" in os.environ
def post(team_id, user_id, url, payload):
"""
Using post method to get data from given Jama url
Args:
team_id (string): Slack team ID
user_id (string): Slack User ID
... | 32.073171 | 110 | 0.61635 |
fb28fd1ffef02a96e84c8adfeb706ddfa69ff423 | 9,706 | py | Python | recommender.py | cmpgamer/Sprint2 | 5f9aadb4b3450cfa3db34484b52ef0614e6abc6b | [
"MIT"
] | null | null | null | recommender.py | cmpgamer/Sprint2 | 5f9aadb4b3450cfa3db34484b52ef0614e6abc6b | [
"MIT"
] | null | null | null | recommender.py | cmpgamer/Sprint2 | 5f9aadb4b3450cfa3db34484b52ef0614e6abc6b | [
"MIT"
] | null | null | null | import codecs
from math import sqrt
class recommender:
def __init__(self, k=1, n=5):
self.k = k
self.n = n
self.data = {}
self.username2id = {}
self.userid2name = {}
self.productid2name = {}
self.cardinality = {}
self.slopeOneDeviations = {}
... | 39.295547 | 110 | 0.524624 |
583d97c3d484a8a0f89b4bf6bf98102e90f42d66 | 5,857 | py | Python | python/drydock_provisioner/drivers/kubernetes/promenade_driver/driver.py | Vjrx/airship-drydock | 315fb9864e6d55a66d5266f76c160be55d22c98b | [
"Apache-2.0"
] | null | null | null | python/drydock_provisioner/drivers/kubernetes/promenade_driver/driver.py | Vjrx/airship-drydock | 315fb9864e6d55a66d5266f76c160be55d22c98b | [
"Apache-2.0"
] | 1 | 2021-06-01T23:08:49.000Z | 2021-06-01T23:08:49.000Z | python/drydock_provisioner/drivers/kubernetes/promenade_driver/driver.py | Vjrx/airship-drydock | 315fb9864e6d55a66d5266f76c160be55d22c98b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 AT&T Intellectual Property. All other 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 b... | 37.787097 | 79 | 0.555062 |
5b66444d5bb885c6ab5920db6f1c193b3c2cf253 | 422 | py | Python | pajbot/modules/clr_overlay/__init__.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | 145 | 2019-06-08T15:38:40.000Z | 2022-03-29T22:51:47.000Z | pajbot/modules/clr_overlay/__init__.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | 671 | 2019-05-26T22:19:08.000Z | 2022-03-31T06:00:49.000Z | pajbot/modules/clr_overlay/__init__.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | 105 | 2019-05-25T18:22:13.000Z | 2022-02-23T00:57:27.000Z | import logging
from pajbot.modules import BaseModule
from pajbot.modules.base import ModuleType
log = logging.getLogger(__name__)
class CLROverlayModule(BaseModule):
ID = "clroverlay-group"
NAME = "CLR Overlay"
DESCRIPTION = "A collection of overlays that can be used in the streaming software of choice"... | 26.375 | 97 | 0.760664 |
d90475c08dca53f116aa6a9949c6a75e0aec556f | 16,971 | py | Python | sharpy/utils/settings.py | ostodieck/sharpy | b85aa1c001a0ec851af4eb259cce7c01dfa68b9e | [
"BSD-3-Clause"
] | 1 | 2020-07-27T05:15:35.000Z | 2020-07-27T05:15:35.000Z | sharpy/utils/settings.py | briandesilva/sharpy | aed86428ff88fd14d36cabd91cf7e04b5fc9a39a | [
"BSD-3-Clause"
] | null | null | null | sharpy/utils/settings.py | briandesilva/sharpy | aed86428ff88fd14d36cabd91cf7e04b5fc9a39a | [
"BSD-3-Clause"
] | null | null | null | """
Settings Generator Utilities
"""
import configparser
import ctypes as ct
import numpy as np
import sharpy.utils.exceptions as exceptions
import sharpy.utils.cout_utils as cout
import ast
class DictConfigParser(configparser.ConfigParser):
def as_dict(self):
d = dict(self._sections)
for k in d:
... | 39.013793 | 122 | 0.574981 |
47a2f0ce4b0fd2b720912c617794374f1c2ffa71 | 1,267 | py | Python | pyscf/nao/test/test_0045_tddft_load_kernel_nao.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 3 | 2021-02-28T00:52:53.000Z | 2021-03-01T06:23:33.000Z | pyscf/nao/test/test_0045_tddft_load_kernel_nao.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 36 | 2018-08-22T19:44:03.000Z | 2020-05-09T10:02:36.000Z | pyscf/nao/test/test_0045_tddft_load_kernel_nao.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 4 | 2018-02-14T16:28:28.000Z | 2019-08-12T16:40:30.000Z | from __future__ import print_function, division
import os,unittest,numpy as np
from pyscf.nao import tddft_iter
import h5py
dname = os.path.dirname(os.path.abspath(__file__))
td = tddft_iter(label='water', cd=dname, jcutoff=7, iter_broadening=1e-2, xc_code='RPA')
np.savetxt("kernel.txt", td.kernel)
np.save("kernel.npy... | 37.264706 | 188 | 0.706393 |
2675b097cf5e9478dcad9486baea6499b7103e03 | 15,343 | py | Python | YOLO/.history/pytorch-yolo-v3/video_demo_20201105163826.py | jphacks/D_2003 | 60a5684d549862e85bdf758069518702d9925a48 | [
"MIT"
] | 1 | 2020-11-07T07:58:13.000Z | 2020-11-07T07:58:13.000Z | YOLO/.history/pytorch-yolo-v3/video_demo_20201105163826.py | jphacks/D_2003 | 60a5684d549862e85bdf758069518702d9925a48 | [
"MIT"
] | null | null | null | YOLO/.history/pytorch-yolo-v3/video_demo_20201105163826.py | jphacks/D_2003 | 60a5684d549862e85bdf758069518702d9925a48 | [
"MIT"
] | 4 | 2020-11-02T02:51:45.000Z | 2020-11-07T02:54:47.000Z | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from util import *
from darknet import Darknet
from preprocess import prep_image, inp_to_image
import pandas as pd
import random
import argparse
import pickle as pkl
import r... | 35.516204 | 126 | 0.524148 |
47754147f12902b92fac59a09938726f6b10a5be | 9,170 | py | Python | hack/gen.py | akutz/go-interface-values-and-malloc | 2077a43f46036a397d546f2858f54a7995231607 | [
"Apache-2.0"
] | 24 | 2022-02-17T19:05:21.000Z | 2022-03-27T10:20:04.000Z | hack/gen.py | x448/go-interface-values | 478b2428e64a411baa6a2a574bb3585b61528029 | [
"Apache-2.0"
] | 2 | 2022-02-08T08:28:31.000Z | 2022-02-09T18:07:15.000Z | hack/gen.py | x448/go-interface-values | 478b2428e64a411baa6a2a574bb3585b61528029 | [
"Apache-2.0"
] | 4 | 2022-02-08T08:16:54.000Z | 2022-02-20T12:14:09.000Z | #!/usr/bin/env python3
"""
Copyright 2022
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,... | 27.87234 | 217 | 0.545474 |
71c64def6ef5ea5dd0401d07fbcaf8c4b291cce1 | 2,362 | py | Python | src/config.py | youngerous/transformer | 7b849dbca813ceff140f7261ad739c72a045faaa | [
"Apache-2.0"
] | 3 | 2021-05-21T03:58:49.000Z | 2021-07-13T06:00:36.000Z | src/config.py | youngerous/transformer | 7b849dbca813ceff140f7261ad739c72a045faaa | [
"Apache-2.0"
] | null | null | null | src/config.py | youngerous/transformer | 7b849dbca813ceff140f7261ad739c72a045faaa | [
"Apache-2.0"
] | null | null | null | import argparse
def load_config():
parser = argparse.ArgumentParser()
# default hparams
parser.add_argument("--root-path", type=str, default="./src/data")
parser.add_argument("--ckpt-path", type=str, default="./src/checkpoints/")
parser.add_argument("--result-path", type=str, default="./src/resul... | 40.033898 | 88 | 0.657494 |
2fe91c96f87a19b617285cd2409bd9c0519ed67b | 3,638 | py | Python | HARK/tests/test_core.py | HsinYiHung/HARK_HY | 086c46af5bd037fe1ced6906c6ea917ed58b134f | [
"Apache-2.0"
] | null | null | null | HARK/tests/test_core.py | HsinYiHung/HARK_HY | 086c46af5bd037fe1ced6906c6ea917ed58b134f | [
"Apache-2.0"
] | null | null | null | HARK/tests/test_core.py | HsinYiHung/HARK_HY | 086c46af5bd037fe1ced6906c6ea917ed58b134f | [
"Apache-2.0"
] | null | null | null | """
This file implements unit tests for interpolation methods
"""
from HARK.core import HARKobject, distanceMetric, AgentType
import numpy as np
import unittest
class testdistanceMetric(unittest.TestCase):
def setUp(self):
self.list_a = [1.0, 2.1, 3]
self.list_b = [3.1, 4, -1.4]
self.list... | 38.702128 | 88 | 0.630566 |
0d005040f44129d4069b7bd9d2eabfee08d462b7 | 665 | py | Python | paper/tools/mse_gf.py | toros-astro/corral | 75474b38ff366330d33644461a902d07374a5bbc | [
"BSD-3-Clause"
] | 4 | 2015-11-19T16:04:30.000Z | 2021-05-13T06:42:27.000Z | paper/tools/mse_gf.py | toros-astro/corral | 75474b38ff366330d33644461a902d07374a5bbc | [
"BSD-3-Clause"
] | 27 | 2015-10-20T16:28:02.000Z | 2018-08-21T20:48:45.000Z | paper/tools/mse_gf.py | toros-astro/corral | 75474b38ff366330d33644461a902d07374a5bbc | [
"BSD-3-Clause"
] | 5 | 2015-11-20T00:03:07.000Z | 2019-07-15T00:39:53.000Z | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context(context='paper', font_scale=1.8)
mse = np.arange(40)
f20 = np.exp(mse/20.)
f13 = np.exp(mse/13.)
f10 = np.exp(mse/10.)
f5 = np.exp(mse/5.)
gf10 = 2./(1+f10)
gf13 = 2./(1+f13)
gf5 = 2./(1+f5)
gf20 = 2./(1+f20)
plt.rc('text', us... | 21.451613 | 48 | 0.619549 |
56563ea32089e25c1db3365ebf229670134f3418 | 5,198 | py | Python | src/mce_irl.py | andyruddh/irl-maxent | f1644ec4a2a31e3d99aa5d22c8f441c395da1de0 | [
"MIT"
] | null | null | null | src/mce_irl.py | andyruddh/irl-maxent | f1644ec4a2a31e3d99aa5d22c8f441c395da1de0 | [
"MIT"
] | null | null | null | src/mce_irl.py | andyruddh/irl-maxent | f1644ec4a2a31e3d99aa5d22c8f441c395da1de0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import gridworld as W
import maxent as M
import plot as P
import trajectory as T
import solver as S
import optimizer as O
import numpy as np
import matplotlib.pyplot as plt
import os
def setup_mdp(GRID_SIZE, p_slip, avoid_states):
"""
Set-up our MDP/GridWorld
"""
# create our wo... | 30.046243 | 102 | 0.691227 |
4e85cfd4865cd2504e0383c6886e4007bdaa0655 | 435 | py | Python | scripts/planck_data_info.py | veragluscevic/npoint-fgs | 911a7c998cc2d8303bf7b59f028d194bb5ce2b09 | [
"MIT"
] | null | null | null | scripts/planck_data_info.py | veragluscevic/npoint-fgs | 911a7c998cc2d8303bf7b59f028d194bb5ce2b09 | [
"MIT"
] | null | null | null | scripts/planck_data_info.py | veragluscevic/npoint-fgs | 911a7c998cc2d8303bf7b59f028d194bb5ce2b09 | [
"MIT"
] | null | null | null |
# for beam_file='HFI_RIMO_Beams-100pc_R2.00.fits'
BEAM_INDEX = {
'100': 3,
'143': 4,
'217': 5,
'353': 6,
'100P': 7,
'143P': 8,
'217P': 9,
'353P': 10,
}
#for maskfile='HFI_Mask_GalPlane-apo{}_2048_R2.00.fits'
MASK_FIELD = {
20: 0,
40: 1,
60: 2,
70: 3,
80: 4,... | 12.794118 | 55 | 0.441379 |
765495ec01abb0e8a98c2e2274626f69e46fd483 | 2,953 | py | Python | pygazebo/msg/world_reset_pb2.py | CryptoCopter/pygazebo | f16704f3b59cb50a1390ef92fde283558fd71f8f | [
"Apache-2.0"
] | null | null | null | pygazebo/msg/world_reset_pb2.py | CryptoCopter/pygazebo | f16704f3b59cb50a1390ef92fde283558fd71f8f | [
"Apache-2.0"
] | null | null | null | pygazebo/msg/world_reset_pb2.py | CryptoCopter/pygazebo | f16704f3b59cb50a1390ef92fde283558fd71f8f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: world_reset.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | 34.741176 | 236 | 0.758212 |
c476aea2890fe203a58963632f6592591e1c7a1c | 569 | py | Python | src/scion/service/test/orb_sources.py | scion-network/scion | 9a778eeb3e4e690d1b1ebd19e5349314cbf7b0fc | [
"BSD-2-Clause"
] | null | null | null | src/scion/service/test/orb_sources.py | scion-network/scion | 9a778eeb3e4e690d1b1ebd19e5349314cbf7b0fc | [
"BSD-2-Clause"
] | null | null | null | src/scion/service/test/orb_sources.py | scion-network/scion | 9a778eeb3e4e690d1b1ebd19e5349314cbf7b0fc | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import subprocess
from pyon.public import CFG
antelope_path = CFG.get_safe("scion.antelope.path", "/opt/antelope/5.6")
cmd = ". " + antelope_path + "/setup.sh;orbstat -s ceusnexport.ucsd.edu:usarray | grep M40 | grep seconds | cut -d' ' -f1"
max_sources = 5
res = subprocess.check_output(cmd,... | 22.76 | 122 | 0.718805 |
13e356bab1f32bd858c618450780d7e66011e0de | 7,428 | py | Python | kitti_eval/depth_evaluation_utils.py | sakshikakde/sfm_dl | d39d7068e23fe44394a3d5694bba074f2f05edaf | [
"MIT"
] | null | null | null | kitti_eval/depth_evaluation_utils.py | sakshikakde/sfm_dl | d39d7068e23fe44394a3d5694bba074f2f05edaf | [
"MIT"
] | null | null | null | kitti_eval/depth_evaluation_utils.py | sakshikakde/sfm_dl | d39d7068e23fe44394a3d5694bba074f2f05edaf | [
"MIT"
] | null | null | null | # Mostly based on the code written by Clement Godard:
# https://github.com/mrharicot/monodepth/blob/master/utils/evaluation_utils.py
import numpy as np
# import pandas as pd
import os
import cv2
from collections import Counter
import pickle
def compute_errors(gt, pred):
thresh = np.maximum((gt / pred), (pred / gt... | 32.578947 | 98 | 0.599623 |
9407a11ad6881e63f368e757cc5e9b0e8685cf29 | 8,914 | py | Python | utils_pg.py | ruotianluo/neural-summ-cnndm-pytorch | 027b63107b748bc56356bd119b243cfdda684aa2 | [
"MIT"
] | 3 | 2018-10-22T23:03:40.000Z | 2018-10-23T09:45:32.000Z | utils_pg.py | ruotianluo/neural-summ-cnndm-pytorch | 027b63107b748bc56356bd119b243cfdda684aa2 | [
"MIT"
] | null | null | null | utils_pg.py | ruotianluo/neural-summ-cnndm-pytorch | 027b63107b748bc56356bd119b243cfdda684aa2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#pylint: skip-file
import numpy as np
from numpy.random import random as rand
import cPickle as pickle
import sys
import os
import shutil
from copy import deepcopy
import random
import torch
from torch import nn
def init_seeds():
random.seed(123)
torch.manual_seed(123)
if torch.cu... | 33.137546 | 129 | 0.4954 |
4a8bea19b4c3c8588c3bf0158c1afe9b34871a0c | 12,872 | py | Python | google/cloud/errorreporting_v1beta1/services/error_group_service/transports/grpc_asyncio.py | LaudateCorpus1/python-error-reporting | b207f2cec4f5f3196e775ed35cd429f34f9c0bd1 | [
"Apache-2.0"
] | 17 | 2020-09-19T17:48:32.000Z | 2022-03-09T06:40:39.000Z | google/cloud/errorreporting_v1beta1/services/error_group_service/transports/grpc_asyncio.py | LaudateCorpus1/python-error-reporting | b207f2cec4f5f3196e775ed35cd429f34f9c0bd1 | [
"Apache-2.0"
] | 67 | 2020-02-11T13:24:20.000Z | 2022-03-18T15:27:25.000Z | google/cloud/errorreporting_v1beta1/services/error_group_service/transports/grpc_asyncio.py | LaudateCorpus1/python-error-reporting | b207f2cec4f5f3196e775ed35cd429f34f9c0bd1 | [
"Apache-2.0"
] | 6 | 2020-02-07T00:29:36.000Z | 2022-02-16T07:27:09.000Z | # -*- 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... | 44.233677 | 93 | 0.639372 |
d99b69cd7e1b049fe6663ea634a948e0e7b74755 | 3,197 | py | Python | canon.py | ipa-tys/ockeghem | a30ffa9e7ea7cf86b376ff5a9976a792bc725276 | [
"MIT"
] | null | null | null | canon.py | ipa-tys/ockeghem | a30ffa9e7ea7cf86b376ff5a9976a792bc725276 | [
"MIT"
] | null | null | null | canon.py | ipa-tys/ockeghem | a30ffa9e7ea7cf86b376ff5a9976a792bc725276 | [
"MIT"
] | null | null | null | from music21 import *
from midi2audio import FluidSynth
import random
import pdb
import sys
import argparse
import textwrap
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='generate canon antecedents.',
prog='canon.py',
formatter_class=argparse.RawDescriptionHelpFormatter,
... | 33.652632 | 114 | 0.618392 |
0c786a5b9646824715d086306d165d9e0d44c2fa | 8,725 | py | Python | python/doc/conf.py | industrial-sloth/thunder | ea2a6b3cfdefb8d09441865e15ac65c6e2f01151 | [
"Apache-2.0"
] | null | null | null | python/doc/conf.py | industrial-sloth/thunder | ea2a6b3cfdefb8d09441865e15ac65c6e2f01151 | [
"Apache-2.0"
] | null | null | null | python/doc/conf.py | industrial-sloth/thunder | ea2a6b3cfdefb8d09441865e15ac65c6e2f01151 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Thunder documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 16 17:00:45 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 31.384892 | 80 | 0.714842 |
df22bcb9cd272e5d8175cde97861a1cd0c68c0ef | 4,703 | py | Python | MSS_points.py | U-Shift/circuity-lisbon | fb55e201d336c5a10af989cd1e4ed2c3052fbeb7 | [
"MIT"
] | null | null | null | MSS_points.py | U-Shift/circuity-lisbon | fb55e201d336c5a10af989cd1e4ed2c3052fbeb7 | [
"MIT"
] | null | null | null | MSS_points.py | U-Shift/circuity-lisbon | fb55e201d336c5a10af989cd1e4ed2c3052fbeb7 | [
"MIT"
] | null | null | null | import pandas as pd
import geopandas as gpd
from tqdm import tqdm, trange
import random
from shapely.geometry import Point, Polygon
def generate_random(number, polygon):
points = []
aux = polygon.bounds
minx = aux['minx']
miny = aux['miny']
maxx = aux['maxx']
maxy = aux['maxy']
while len(p... | 36.457364 | 103 | 0.613863 |
d7bb7313465f6c274eaad5056521f69857e0d1dc | 81,664 | py | Python | manim/mobject/types/vectorized_mobject.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | 2 | 2022-03-31T08:31:00.000Z | 2022-03-31T08:31:43.000Z | manim/mobject/types/vectorized_mobject.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | null | null | null | manim/mobject/types/vectorized_mobject.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | null | null | null | """Mobjects that use vector graphics."""
__all__ = [
"VMobject",
"VGroup",
"VDict",
"VectorizedPoint",
"CurvesAsSubmobjects",
"DashedVMobject",
]
import itertools as it
import sys
import typing
from typing import Optional, Sequence, Union
import colour
import numpy as np
from PIL.Image impo... | 33.496308 | 162 | 0.568439 |
b40cfd4d1c2fdb6112a7bb776e25c15d983598ff | 889 | py | Python | lldb/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | lldb/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | lldb/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | """
Fuzz tests an object after the default construction to make sure it does not crash lldb.
"""
import lldb
def fuzz_obj(obj):
obj.AddEvent(lldb.SBEvent())
obj.StartListeningForEvents(lldb.SBBroadcaster(), 0xffffffff)
obj.StopListeningForEvents(lldb.SBBroadcaster(), 0xffffffff)
event = lldb.SBEvent(... | 37.041667 | 88 | 0.777278 |
c679731725cf02fdeb21808aa6b0562cceaedca6 | 400 | py | Python | tests/apps/app1/overrides/orm/metaclass.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 11 | 2021-03-22T22:07:49.000Z | 2022-03-08T16:18:33.000Z | tests/apps/app1/overrides/orm/metaclass.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 12 | 2021-03-04T05:51:24.000Z | 2021-09-22T05:16:18.000Z | tests/apps/app1/overrides/orm/metaclass.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 2 | 2021-03-25T14:49:56.000Z | 2021-11-17T23:20:29.000Z | from typing import Any
from uvicore.support.dumper import dd, dump
from uvicore.orm.query import QueryBuilder
# Parent
from uvicore.orm.metaclass import ModelMetaclass as X
class ModelMetaclass(X):
async def find(entity, id: Any) -> Any:
"""Query builder passthrough"""
dump('find override--------... | 28.571429 | 63 | 0.66 |
f820eaa3528b4620f596e0cf982d4639e6e1d25f | 9,726 | py | Python | paz/evaluation/detection.py | niqbal996/paz | f27205907367415d5b21f90e1a1d1d1ce598e889 | [
"MIT"
] | 300 | 2020-10-29T08:02:05.000Z | 2022-03-30T21:47:32.000Z | paz/evaluation/detection.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 30 | 2020-10-29T12:40:32.000Z | 2022-03-31T14:06:35.000Z | paz/evaluation/detection.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 62 | 2020-10-29T12:34:13.000Z | 2022-03-29T05:21:45.000Z | import numpy as np
from ..backend.boxes import compute_ious
from ..backend.image import load_image
def compute_matches(dataset, detector, class_to_arg, iou_thresh=0.5):
"""
Arguments:
dataset: List of dictionaries containing 'image' as key and a
numpy array representing an image as value.
... | 47.213592 | 77 | 0.634176 |
0a76edbd926d66f160f7e9865fee900d8ea34ce0 | 936 | py | Python | freeCodeCamp/01-scientific-computing-with-python/src/04-strings.py | aysedemirel/python-journey | 16abd1729c2d999aedb2b4db5ade6c14aca7a23f | [
"MIT"
] | 1 | 2021-02-27T14:22:53.000Z | 2021-02-27T14:22:53.000Z | freeCodeCamp/01-scientific-computing-with-python/src/04-strings.py | aysedemirel/python-journey | 16abd1729c2d999aedb2b4db5ade6c14aca7a23f | [
"MIT"
] | null | null | null | freeCodeCamp/01-scientific-computing-with-python/src/04-strings.py | aysedemirel/python-journey | 16abd1729c2d999aedb2b4db5ade6c14aca7a23f | [
"MIT"
] | null | null | null | hello = "Hello"
world = "World"
hello_world = hello + " " + world
print(hello_world)
num = '123'
num = int(num) + 1
print(num)
text = "Sample Text For Python"
print(text[0:6])
print(text[7:11])
print(text[12:15])
print(text[16:22])
fruit = "banana"
print('n' in fruit)
print('m' in fruit)
print("Hello Wolrd".lower(... | 16.714286 | 43 | 0.665598 |
49ed777f2fb60bb228c99ec5ce931550c38380c9 | 2,036 | py | Python | pyports.py | dunker4o/PyPortS | 394e155c681764fd263aa667f9645264629bd071 | [
"MIT"
] | null | null | null | pyports.py | dunker4o/PyPortS | 394e155c681764fd263aa667f9645264629bd071 | [
"MIT"
] | null | null | null | pyports.py | dunker4o/PyPortS | 394e155c681764fd263aa667f9645264629bd071 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 3 23:05:47 2019
@author: Borko
"""
# 1. Parse input from the console:
# 1) IP Address
# 2) Port range - optional
# 3) IPv - optional
# 4) TCP/UDP - optional
import argparse
import ipaddress
import socket
parser = argparse.ArgumentParser(descript... | 33.377049 | 85 | 0.611493 |
77b0ac2ef14accf667b6c72d4de635696eb68e42 | 1,271 | py | Python | bann/b_test_train_prepare/functions/test/one_cl_stats/acc_calc.py | arturOnRails/BANN | 027af04349304941fb73c2ede502aca4b76f1ad1 | [
"MIT"
] | null | null | null | bann/b_test_train_prepare/functions/test/one_cl_stats/acc_calc.py | arturOnRails/BANN | 027af04349304941fb73c2ede502aca4b76f1ad1 | [
"MIT"
] | null | null | null | bann/b_test_train_prepare/functions/test/one_cl_stats/acc_calc.py | arturOnRails/BANN | 027af04349304941fb73c2ede502aca4b76f1ad1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
.. moduleauthor:: Artur Lissin
.. moduleauthor:: Fabian Tann
"""
from typing import Tuple, List, Dict
from bann.b_test_train_prepare.container.test.rttff_c import RtTfF
from bann.b_test_train_prepare.functions.test.one_cl_stats.merge_rttff import calc_one_class_stats
def _acc_calc(fp_c: ... | 31 | 98 | 0.583792 |
1e8f48a070611060d25e3fbb8844c49eb0751e6b | 901 | py | Python | spikeinterface/extractors/neoextractors/spike2.py | khl02007/spikeinterface | a29739a2ecc1d27af0fdb7adfed895aa9fdd0be4 | [
"MIT"
] | 116 | 2019-07-12T14:33:43.000Z | 2022-03-29T01:10:00.000Z | spikeinterface/extractors/neoextractors/spike2.py | khl02007/spikeinterface | a29739a2ecc1d27af0fdb7adfed895aa9fdd0be4 | [
"MIT"
] | 424 | 2019-07-15T13:29:34.000Z | 2022-03-30T13:30:45.000Z | spikeinterface/extractors/neoextractors/spike2.py | khl02007/spikeinterface | a29739a2ecc1d27af0fdb7adfed895aa9fdd0be4 | [
"MIT"
] | 60 | 2019-08-26T11:59:07.000Z | 2022-03-24T20:05:38.000Z | from .neobaseextractor import NeoBaseRecordingExtractor, NeoBaseSortingExtractor
class Spike2RecordingExtractor(NeoBaseRecordingExtractor):
"""
Class for reading spike2 smr files.
smrx are not supported with this, prefer CedRecordingExtractor instead.
Based on neo.rawio.Spike2RawIO
Param... | 27.30303 | 83 | 0.705882 |
ccd3f2d84a301cf43ea7cbd885d3d8dc149547ff | 3,805 | bzl | Python | bazel/dependency_imports.bzl | Zerpet/envoy | 1533857904db361de3ab7d10167f12310c6e6abf | [
"Apache-2.0"
] | null | null | null | bazel/dependency_imports.bzl | Zerpet/envoy | 1533857904db361de3ab7d10167f12310c6e6abf | [
"Apache-2.0"
] | null | null | null | bazel/dependency_imports.bzl | Zerpet/envoy | 1533857904db361de3ab7d10167f12310c6e6abf | [
"Apache-2.0"
] | null | null | null | load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@envoy_build_tools//toolchains:rbe_toolchains_config.bzl", "rbe_toolchains_config")
load("@bazel_toolchains//rules/exec_properties:exec_... | 41.358696 | 129 | 0.716426 |
868a0863ffecc9c4156a7e2dfd05bb2ff74a28fa | 1,423 | py | Python | main.py | nathanjmcdougall/convergence-plot | 0f2173094549d107de0b86a7d3e2bafc9bba70b9 | [
"MIT"
] | null | null | null | main.py | nathanjmcdougall/convergence-plot | 0f2173094549d107de0b86a7d3e2bafc9bba70b9 | [
"MIT"
] | null | null | null | main.py | nathanjmcdougall/convergence-plot | 0f2173094549d107de0b86a7d3e2bafc9bba70b9 | [
"MIT"
] | null | null | null | """A script to create nice animations of Julia sets for families of functions.
"""
from matplotlib.animation import ArtistAnimation
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
from plotting import plot_recursions_convergence
if __name__ == '__main__':
xlim = [-2, 2]
ylim = [-2, 2... | 27.901961 | 83 | 0.624034 |
a082fe4d9a593477a3e9ed582e36bb9a13e715da | 4,371 | py | Python | prune/pruning_method_transposable_block_l1.py | itayhubara/AcceleratedSparseNeuralTraining | 425897dec9c7ef185841d7000c4418ebb1c95896 | [
"Apache-2.0"
] | 3 | 2021-11-24T12:46:11.000Z | 2021-11-25T01:45:14.000Z | prune/pruning_method_transposable_block_l1.py | itayhubara/AcceleratedSparseNeuralTraining | 425897dec9c7ef185841d7000c4418ebb1c95896 | [
"Apache-2.0"
] | null | null | null | prune/pruning_method_transposable_block_l1.py | itayhubara/AcceleratedSparseNeuralTraining | 425897dec9c7ef185841d7000c4418ebb1c95896 | [
"Apache-2.0"
] | null | null | null | from pulp import *
from tqdm import tqdm
from multiprocessing import Pool
from common.timer import Timer
from prune.pruning_method_utils import *
import numpy as np
import torch.nn.utils.prune as prune
class PruningMethodTransposableBlockL1(prune.BasePruningMethod):
PRUNING_TYPE = 'unstructured' # pruning type ... | 39.026786 | 120 | 0.616106 |
23a3bae65bfa7b4b4888b40642f0506cc7173b75 | 1,097 | py | Python | kubernetes/test/test_v2beta1_cross_version_object_reference.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 2 | 2020-06-21T08:03:18.000Z | 2020-06-21T09:53:29.000Z | kubernetes/test/test_v2beta1_cross_version_object_reference.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v2beta1_cross_version_object_reference.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 1 | 2020-12-10T07:28:08.000Z | 2020-12-10T07:28:08.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.16
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import... | 27.425 | 132 | 0.758432 |
0a6a8ad142eda6a4f975fd848ab05b249e2dac30 | 168 | py | Python | mara_superset/cli.py | leo-schick/mara-superset | 359adcab3c2ac32283bd465901ceeb768d436557 | [
"MIT"
] | 3 | 2021-12-14T18:01:57.000Z | 2022-01-01T10:17:42.000Z | mara_superset/cli.py | leo-schick/mara-superset | 359adcab3c2ac32283bd465901ceeb768d436557 | [
"MIT"
] | null | null | null | mara_superset/cli.py | leo-schick/mara-superset | 359adcab3c2ac32283bd465901ceeb768d436557 | [
"MIT"
] | null | null | null | import click
@click.command()
def update_metadata():
"""Sync schema definitions from Mara to Superset"""
from . import metadata
metadata.update_metadata() | 21 | 55 | 0.720238 |
2d2cbeb79f650476ca7348776e39f0b55c32e0e9 | 1,136 | py | Python | setup.py | cycomanic/pelican-perpagepublications | 75657a708996fee8ad47759a0d92a3498a05f50a | [
"Unlicense"
] | null | null | null | setup.py | cycomanic/pelican-perpagepublications | 75657a708996fee8ad47759a0d92a3498a05f50a | [
"Unlicense"
] | null | null | null | setup.py | cycomanic/pelican-perpagepublications | 75657a708996fee8ad47759a0d92a3498a05f50a | [
"Unlicense"
] | null | null | null | import pelican_bibtex
from distutils.core import setup
CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: Public Domain
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Software Development
Operating... | 30.702703 | 190 | 0.765845 |
92a53e19f501124e4a55f27ca617dbf03d3931d0 | 4,429 | py | Python | app/recipe/tests/test_ingredients_api.py | AndreWicaksono/recipe-app-api | a134306ece5b74ff83b3aea4d8a64225caeaa07c | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | AndreWicaksono/recipe-app-api | a134306ece5b74ff83b3aea4d8a64225caeaa07c | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | AndreWicaksono/recipe-app-api | a134306ece5b74ff83b3aea4d8a64225caeaa07c | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recip... | 33.55303 | 78 | 0.658162 |
86ff11f0c9cf93e9e206f9d7ee5a6ffb6643a0b3 | 6,376 | py | Python | faang-codingexercises/codechallenge_017.py | veilair/code-development | 953eef62204809f3ea0715a6ace5c5b7c1ff5115 | [
"MIT"
] | 1 | 2022-02-20T00:48:20.000Z | 2022-02-20T00:48:20.000Z | faang-codingexercises/codechallenge_017.py | exajobs/coding-interview-collection | 3daa3863b4a72d8959530edb9ecc9161a93ee99e | [
"MIT"
] | null | null | null | faang-codingexercises/codechallenge_017.py | exajobs/coding-interview-collection | 3daa3863b4a72d8959530edb9ecc9161a93ee99e | [
"MIT"
] | null | null | null | '''
Date: 12/29/2018
Problem description:
===================
This problem was asked by Jane Street.
Suppose you are given a table of currency exchange rates, represented as a 2D array.
Determine whether there is a possible arbitrage: that is, whether there is some sequence
of trades you can make, starting with som... | 36.227273 | 112 | 0.638331 |
6776a9e1a90e18fdc5722cb3e8e4959c79771638 | 2,108 | py | Python | core/models.py | Armestrong/resale_api | 75a798f2aa95b7d316e145f3811fa05537c606df | [
"MIT"
] | null | null | null | core/models.py | Armestrong/resale_api | 75a798f2aa95b7d316e145f3811fa05537c606df | [
"MIT"
] | null | null | null | core/models.py | Armestrong/resale_api | 75a798f2aa95b7d316e145f3811fa05537c606df | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import BaseUserManager, \
AbstractBaseUser, PermissionsMixin
from django.conf import settings
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and saves a new user"""
if no... | 31.462687 | 76 | 0.686433 |
e29cc2c51658b00bdbc2b22c8cd108383155a434 | 3,113 | py | Python | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/tests/python/unittest/test_autotvm_measure.py | mengkai94/training_results_v0.6 | 43dc3e250f8da47b5f8833197d74cb8cf1004fc9 | [
"Apache-2.0"
] | 64 | 2021-05-02T14:42:34.000Z | 2021-05-06T01:35:03.000Z | tests/python/unittest/test_autotvm_measure.py | clhne/tvm | d59320c764bd09474775e1b292f3c05c27743d24 | [
"Apache-2.0"
] | 23 | 2019-07-29T05:21:52.000Z | 2020-08-31T18:51:42.000Z | tests/python/unittest/test_autotvm_measure.py | clhne/tvm | d59320c764bd09474775e1b292f3c05c27743d24 | [
"Apache-2.0"
] | 51 | 2019-07-12T05:10:25.000Z | 2021-07-28T16:19:06.000Z | """Test builder and runner"""
import logging
import time
import numpy as np
import tvm
from tvm import autotvm
from test_autotvm_common import get_sample_task, bad_matmul
from tvm.autotvm.measure.measure import Runner, MeasureResult, MeasureErrorNo
def test_task_tuner_without_measurement():
"""test task and tune... | 31.765306 | 84 | 0.668166 |
f646ddf258814d6277ec173cf1f790481709dd22 | 30,980 | py | Python | pymc3_ext/variational/inference.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/variational/inference.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/variational/inference.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | import logging
import warnings
import collections
import numpy as np
from fastprogress.fastprogress import progress_bar
import pymc3_ext as pm
from pymc3_ext.variational import test_functions
from pymc3_ext.variational.approximations import (
MeanField,
FullRank,
Empirical,
NormalizingFlow,
)
from pym... | 37.460701 | 120 | 0.595997 |
6a4befedd903104c8718d7218a09d36bcf076cd7 | 3,465 | py | Python | terrascript/data/rancher/rancher2.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/data/rancher/rancher2.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/data/rancher/rancher2.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/data/rancher/rancher2.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:25:37 UTC)
import terrascript
class rancher2_app(terrascript.Data):
pass
class rancher2_catalog(terrascript.Data):
pass
class rancher2_catalog_v2(terrascript.Data):
pass
class rancher2_certificate(t... | 17.953368 | 73 | 0.765657 |
1fa313065b367fbacede0465502d8e1fd14d89d1 | 21,000 | py | Python | baselines/cifar/rank1_bnn.py | y0ast/uncertainty-baselines | 8d32c77ba0803ed715c1406378adf10ebd61ab74 | [
"Apache-2.0"
] | null | null | null | baselines/cifar/rank1_bnn.py | y0ast/uncertainty-baselines | 8d32c77ba0803ed715c1406378adf10ebd61ab74 | [
"Apache-2.0"
] | null | null | null | baselines/cifar/rank1_bnn.py | y0ast/uncertainty-baselines | 8d32c77ba0803ed715c1406378adf10ebd61ab74 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Uncertainty Baselines 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 ap... | 44.491525 | 80 | 0.672619 |
7496bc0a5db11df897273bbc4d797dbfbcb6d33d | 2,134 | py | Python | airbyte-integrations/connectors/source-greenhouse/source_greenhouse/source.py | vagrantism/airbyte | b072a6d7bd6ea0b843ad7e98ff8f98dd3b8aa824 | [
"MIT"
] | 6,215 | 2020-09-21T13:45:56.000Z | 2022-03-31T21:21:45.000Z | airbyte-integrations/connectors/source-greenhouse/source_greenhouse/source.py | vitoravancini/airbyte | a7ddd167f6c42905af16b6dac744bcf18354de19 | [
"MIT"
] | 8,448 | 2020-09-21T00:43:50.000Z | 2022-03-31T23:56:06.000Z | airbyte-integrations/connectors/source-greenhouse/source_greenhouse/source.py | vitoravancini/airbyte | a7ddd167f6c42905af16b6dac744bcf18354de19 | [
"MIT"
] | 1,251 | 2020-09-20T05:48:47.000Z | 2022-03-31T10:41:29.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from typing import Any, List, Mapping, Tuple
from airbyte_cdk import AirbyteLogger
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from requests.auth import HTTPBasicAuth
... | 31.382353 | 110 | 0.656514 |
1c0aa1604f519962a11a563803754ae30395d547 | 3,452 | py | Python | src/oscar/profiling/middleware.py | akiyoko/oscar_sandbox | b384f1c0b5f297fd4b84509a575f6766a48630a5 | [
"BSD-3-Clause"
] | 68 | 2016-11-06T05:07:57.000Z | 2021-12-17T09:17:38.000Z | src/oscar/profiling/middleware.py | akiyoko/oscar_sandbox | b384f1c0b5f297fd4b84509a575f6766a48630a5 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/profiling/middleware.py | akiyoko/oscar_sandbox | b384f1c0b5f297fd4b84509a575f6766a48630a5 | [
"BSD-3-Clause"
] | 28 | 2016-12-04T07:12:50.000Z | 2021-02-06T21:13:15.000Z | import cProfile
import hotshot
import hotshot.stats
import pstats
import sys
import tempfile
from cStringIO import StringIO
def profile_this(fn):
def profiled_fn(*args, **kwargs):
filepath = "/tmp/%s.profile" % fn.__name__
prof = cProfile.Profile()
ret = prof.runcall(fn, *args, **kwargs)
... | 30.017391 | 95 | 0.595886 |
4b24e0aad366f70b2ec047e627ab24b6616a571d | 165 | py | Python | recipes/Python/473788_processing_options_program_that_runs_another/recipe-473788.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/473788_processing_options_program_that_runs_another/recipe-473788.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/473788_processing_options_program_that_runs_another/recipe-473788.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | optparser = OptionParser()
...
optparser.disable_interspersed_args()
(opts, argv) = optparser.parse_args()
## argv now has the options to pass to the second program
| 27.5 | 57 | 0.763636 |
33d9906d1c5d703e926954736995e5ab6bd0c980 | 2,193 | py | Python | hc/api/management/commands/sendalerts.py | aMugabi/healthchecks | df137bfdad57cb53bcf31bdc92056cb4f316f921 | [
"BSD-3-Clause"
] | 2 | 2018-06-21T18:11:04.000Z | 2018-06-22T14:52:42.000Z | hc/api/management/commands/sendalerts.py | aMugabi/healthchecks | df137bfdad57cb53bcf31bdc92056cb4f316f921 | [
"BSD-3-Clause"
] | 34 | 2019-09-05T06:41:12.000Z | 2021-06-25T15:25:28.000Z | hc/api/management/commands/sendalerts.py | aMugabi/healthchecks | df137bfdad57cb53bcf31bdc92056cb4f316f921 | [
"BSD-3-Clause"
] | 30 | 2017-04-22T07:09:56.000Z | 2019-06-30T08:24:01.000Z | import logging
import time
from concurrent.futures import ThreadPoolExecutor
from django.core.management.base import BaseCommand
from django.db import connection
from django.utils import timezone
from hc.api.models import Check
executor = ThreadPoolExecutor(max_workers=10)
logger = logging.getLogger(__name__)
class... | 30.887324 | 79 | 0.616507 |
d686ec9a38c3ca481092bfdfa076187e420af7e6 | 2,359 | py | Python | src/rembg/cmd/server.py | prostakov/rembg | bc2680e7b7f3065b6a56d5b1f444c5a326a7fc4a | [
"MIT"
] | 1 | 2021-03-18T18:41:18.000Z | 2021-03-18T18:41:18.000Z | src/rembg/cmd/server.py | SSardorf/rembg | 125adc690abfce2eb7094f92e6bcca79e8b097c6 | [
"MIT"
] | null | null | null | src/rembg/cmd/server.py | SSardorf/rembg | 125adc690abfce2eb7094f92e6bcca79e8b097c6 | [
"MIT"
] | 1 | 2021-05-14T09:37:40.000Z | 2021-05-14T09:37:40.000Z | import argparse
from io import BytesIO
from urllib.parse import unquote_plus
from urllib.request import urlopen
from flask import Flask, request, send_file
from waitress import serve
from ..bg import remove
app = Flask(__name__)
@app.route("/", methods=["GET", "POST"])
def index():
file_content = ""
if re... | 26.505618 | 67 | 0.570581 |
2e459beeaed959342dfedcab5d8a6271c8091eef | 443 | py | Python | tests/functests.py | epigos/data-explorer | d90be65fe046b49025dc6fa422baa5c127dcb734 | [
"MIT"
] | 1 | 2017-01-18T08:40:40.000Z | 2017-01-18T08:40:40.000Z | tests/functests.py | epigos/data-explorer | d90be65fe046b49025dc6fa422baa5c127dcb734 | [
"MIT"
] | null | null | null | tests/functests.py | epigos/data-explorer | d90be65fe046b49025dc6fa422baa5c127dcb734 | [
"MIT"
] | null | null | null | import unittest
from tornado.testing import AsyncHTTPTestCase
from dexplorer import DataExplorer
class TestDataServer(AsyncHTTPTestCase):
def get_app(self):
dte = DataExplorer()
return dte.make_app()
def test_homepage(self):
response = self.fetch('/')
self.assertEqual(respo... | 20.136364 | 58 | 0.68623 |
f6a5212bab65f8494f2a60b7d03eedaca35bc11e | 36 | py | Python | session/example.py | Navya-PampariRaghu/cis-demo | 298da7918689e3716ad558be2dcb197381654657 | [
"MIT"
] | null | null | null | session/example.py | Navya-PampariRaghu/cis-demo | 298da7918689e3716ad558be2dcb197381654657 | [
"MIT"
] | null | null | null | session/example.py | Navya-PampariRaghu/cis-demo | 298da7918689e3716ad558be2dcb197381654657 | [
"MIT"
] | 1 | 2021-12-05T02:57:02.000Z | 2021-12-05T02:57:02.000Z | print("Hey, I am practicing this!!") | 36 | 36 | 0.694444 |
746c0db4693ab751a24d7ab97e88601db714cf88 | 3,312 | py | Python | gui/merge.py | mokojm/townshell | 3cb209892c63742ed4e20066e29a178a04c4f7ee | [
"MIT"
] | 34 | 2021-02-02T09:16:32.000Z | 2022-02-28T22:45:40.000Z | gui/merge.py | mokojm/townshell | 3cb209892c63742ed4e20066e29a178a04c4f7ee | [
"MIT"
] | 1 | 2021-04-26T21:12:36.000Z | 2021-05-09T15:38:42.000Z | gui/merge.py | mokojm/townshell | 3cb209892c63742ed4e20066e29a178a04c4f7ee | [
"MIT"
] | 1 | 2021-02-21T19:58:33.000Z | 2021-02-21T19:58:33.000Z | from kivy.app import App
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import Screen
Builder.load_file(r"gui\merge.kv")
class BoxClip(FloatLayout):
def __init__(self, **kwargs):
self.util = App.get_running_app().uti... | 30.666667 | 86 | 0.519626 |
e3d41d21a38beb9011fa8deb8f36620ac027210e | 9,341 | py | Python | angola_erp/angola_erpnext/report/user_item_wise_sales_register/user_item_wise_sales_register.py | smehata/angola_erp | 51614992709476e353aef1c03099d78f2a7cedb2 | [
"MIT"
] | 4 | 2019-06-12T06:54:10.000Z | 2021-08-28T06:07:42.000Z | angola_erp/angola_erpnext/report/user_item_wise_sales_register/user_item_wise_sales_register.py | smehata/angola_erp | 51614992709476e353aef1c03099d78f2a7cedb2 | [
"MIT"
] | 4 | 2017-08-24T17:33:45.000Z | 2017-09-24T16:54:01.000Z | angola_erp/angola_erpnext/report/user_item_wise_sales_register/user_item_wise_sales_register.py | smehata/angola_erp | 51614992709476e353aef1c03099d78f2a7cedb2 | [
"MIT"
] | 4 | 2018-02-10T21:08:10.000Z | 2021-08-28T06:08:11.000Z | # Copyright (c) 2013, Helio de Jesus and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.utils import flt
from frappe.model.meta import get_field_precision
from frappe.utils.xlsxutils import handle_html
from ... | 37.514056 | 129 | 0.716626 |
14c112ca41ff83d6b0a74de3d4799bd0ccc44b07 | 563 | py | Python | tests/conf_zephyr_tests.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 24 | 2018-08-21T18:04:48.000Z | 2022-02-07T22:50:06.000Z | tests/conf_zephyr_tests.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 16 | 2018-08-21T18:03:52.000Z | 2022-03-01T17:15:42.000Z | tests/conf_zephyr_tests.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 29 | 2018-08-22T19:40:59.000Z | 2021-12-21T11:13:23.000Z | #! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# We only use single BSP BSP models here, because with QEMU targets
# otherwise we have to muck around which is the right console
ttbl.config.target_add(tt_qemu_zephyr("za-01", [ "x86" ]),
tar... | 33.117647 | 67 | 0.630551 |
ae810d130874396842e2e9b0430580f1fcc2e7d9 | 1,846 | py | Python | datapack/data/scripts/ai/individual/nurka.py | DigitalCoin1/L2SPERO | f9ec069804d7bf13f9c4bfb508db2eb6ce37ab94 | [
"Unlicense"
] | null | null | null | datapack/data/scripts/ai/individual/nurka.py | DigitalCoin1/L2SPERO | f9ec069804d7bf13f9c4bfb508db2eb6ce37ab94 | [
"Unlicense"
] | null | null | null | datapack/data/scripts/ai/individual/nurka.py | DigitalCoin1/L2SPERO | f9ec069804d7bf13f9c4bfb508db2eb6ce37ab94 | [
"Unlicense"
] | null | null | null | import sys
from com.l2jfrozen.gameserver.ai import CtrlIntention
from com.l2jfrozen.gameserver.model.entity.siege.clanhalls import FortressOfResistance
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython impo... | 30.766667 | 86 | 0.733478 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.