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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8a027dd43afd4eb1921cbb07a07753533cd6fa2b | 3,208 | py | Python | lib/stacks/api/api/main.py | sierrezinal/api-l3x-in | 0c5122a29ecd8f94cb9b99909499c330969d26ee | [
"Apache-2.0"
] | 1 | 2021-02-04T23:42:43.000Z | 2021-02-04T23:42:43.000Z | lib/stacks/api/api/main.py | sierrezinal/api-l3x-in | 0c5122a29ecd8f94cb9b99909499c330969d26ee | [
"Apache-2.0"
] | null | null | null | lib/stacks/api/api/main.py | sierrezinal/api-l3x-in | 0c5122a29ecd8f94cb9b99909499c330969d26ee | [
"Apache-2.0"
] | null | null | null | import json
from os import environ as env
from typing import (Dict, List, Mapping)
import utils
import utils.aws as aws
import utils.handlers as handlers
def social_report(event: utils.LambdaEvent) -> Mapping: # pylint: disable=unused-argument
"""Get all events from CloudWatch REPORT_LOG_GROUP_NAME group."""
... | 29.981308 | 90 | 0.602868 |
3003936dd5189d126774b76012a04f52f6140437 | 4,394 | py | Python | manipulators/geometric_product_handler.py | spencerparkin/MathTree | 4aa286248c2dc6a34ad2ef3e56d48b60838f3b72 | [
"MIT"
] | null | null | null | manipulators/geometric_product_handler.py | spencerparkin/MathTree | 4aa286248c2dc6a34ad2ef3e56d48b60838f3b72 | [
"MIT"
] | null | null | null | manipulators/geometric_product_handler.py | spencerparkin/MathTree | 4aa286248c2dc6a34ad2ef3e56d48b60838f3b72 | [
"MIT"
] | null | null | null | # geometric_product_handler.py
from math_tree import MathTreeManipulator, MathTreeNode
class GeometricProductHandler(MathTreeManipulator):
def __init__(self):
super().__init__()
def _manipulate_subtree(self, node):
new_node = self._manipulate_subtree_internal(node, False)
if new_node:... | 60.191781 | 116 | 0.378015 |
0730da80b3610a980fdae021af3d8b5cb1d1cafe | 12,660 | py | Python | kivy/core/video/video_ffpyplayer.py | VICTORVICKIE/kivy | 55abc963fe9099c078a3a2253397de70c2ee17b1 | [
"MIT"
] | null | null | null | kivy/core/video/video_ffpyplayer.py | VICTORVICKIE/kivy | 55abc963fe9099c078a3a2253397de70c2ee17b1 | [
"MIT"
] | null | null | null | kivy/core/video/video_ffpyplayer.py | VICTORVICKIE/kivy | 55abc963fe9099c078a3a2253397de70c2ee17b1 | [
"MIT"
] | null | null | null | '''
FFmpeg based video abstraction
==============================
To use, you need to install ffpyplayer and have a compiled ffmpeg shared
library.
https://github.com/matham/ffpyplayer
The docs there describe how to set this up. But briefly, first you need to
compile ffmpeg using the shared flags while disabling... | 33.850267 | 79 | 0.560506 |
164061afa1041d90483242e0c7d9c84a88c915a5 | 145 | py | Python | simple_api_server_test/get_by_douban/urls.py | dollarkillerx/PythonReview | ee896ee702a6c854f599d7e73e2ceef4eecd4c40 | [
"MIT"
] | null | null | null | simple_api_server_test/get_by_douban/urls.py | dollarkillerx/PythonReview | ee896ee702a6c854f599d7e73e2ceef4eecd4c40 | [
"MIT"
] | 3 | 2020-06-06T00:45:41.000Z | 2022-02-10T11:40:18.000Z | simple_api_server_test/get_by_douban/urls.py | dollarkillerx/PythonReview | ee896ee702a6c854f599d7e73e2ceef4eecd4c40 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import Music,Book
urlpatterns = [
path('music/',Music.as_view()),
path('book/',Book.as_view())
] | 24.166667 | 35 | 0.682759 |
f98f735a943d8d3032625531ba3beb919e6818d4 | 2,003 | py | Python | tests/test_group/test_liegroup.py | npapapietro/liesym | 56bce3290e35d111b86413191516c41a09f0a07d | [
"MIT"
] | 2 | 2021-09-09T22:25:25.000Z | 2022-01-22T01:15:47.000Z | tests/test_group/test_liegroup.py | npapapietro/liesym | 56bce3290e35d111b86413191516c41a09f0a07d | [
"MIT"
] | 1 | 2021-12-20T00:15:26.000Z | 2021-12-20T01:54:07.000Z | tests/test_group/test_liegroup.py | npapapietro/liesym | 56bce3290e35d111b86413191516c41a09f0a07d | [
"MIT"
] | 1 | 2021-09-09T22:25:31.000Z | 2021-09-09T22:25:31.000Z | from sympy import Matrix, I, LeviCivita, sympify
from liesym import SU, SO, Sp, A, B, C, D
def test_su():
su2 = SU(2)
assert su2.dimension == 2
assert su2.group == "SU"
assert su2.generators() == [
Matrix([
[0, 1],
[1, 0]]) / 2,
Matrix([
[0, -I],
... | 21.308511 | 78 | 0.403894 |
0ffa157db11076631e2fd03965e12f8fb5c01da2 | 537 | py | Python | manage.py | estagiodois/rooms | 225b4a854db3dc57f928aae0ac5f2946fabd116d | [
"MIT"
] | 4 | 2019-06-20T02:01:15.000Z | 2020-08-17T21:28:31.000Z | manage.py | estagiodois/rooms | 225b4a854db3dc57f928aae0ac5f2946fabd116d | [
"MIT"
] | 32 | 2018-09-16T14:31:13.000Z | 2021-06-10T17:42:31.000Z | manage.py | estagiodois/rooms | 225b4a854db3dc57f928aae0ac5f2946fabd116d | [
"MIT"
] | 4 | 2019-04-27T19:14:17.000Z | 2021-03-08T01:15:10.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rooms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are yo... | 33.5625 | 73 | 0.685289 |
d25446e0a95a4fe18af4165a714442d056cb42c5 | 2,074 | py | Python | src/sqlint/cli.py | berset/sqlint | fb23e800a8b2a642f87d0398cae428ad75571318 | [
"MIT"
] | null | null | null | src/sqlint/cli.py | berset/sqlint | fb23e800a8b2a642f87d0398cae428ad75571318 | [
"MIT"
] | null | null | null | src/sqlint/cli.py | berset/sqlint | fb23e800a8b2a642f87d0398cae428ad75571318 | [
"MIT"
] | null | null | null | import click
import logging
import os
from typing import Dict
from .checker import check as check_tree
from .config import Config
from .formatter import format as format_tree
from .syntax_tree import SyntaxTree
# setting logger
logger = logging.getLogger(__name__)
@click.command(context_settings={'ign... | 28.805556 | 98 | 0.581003 |
db56d291bb2d7e1e6f472a6ef26b1c8ba85b51c2 | 808 | py | Python | src/hparams/__init__.py | luciencho/jddc_solo | efddf0885d5e3c640835874f70d57d25123de141 | [
"BSD-3-Clause"
] | null | null | null | src/hparams/__init__.py | luciencho/jddc_solo | efddf0885d5e3c640835874f70d57d25123de141 | [
"BSD-3-Clause"
] | null | null | null | src/hparams/__init__.py | luciencho/jddc_solo | efddf0885d5e3c640835874f70d57d25123de141 | [
"BSD-3-Clause"
] | null | null | null | # coding:utf-8
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
import os
from src.hparams import solo_hparam
from src.utils import utils
registry_hparams = dict(
solo_base=solo_hparam.solo_base(),
solo_drop=solo_hparam.solo_rnn(),
solo_cnn=solo... | 29.925926 | 81 | 0.695545 |
b780684e918d146608fa053a0cbed503e686068d | 8,731 | py | Python | modest/utils/accessPSC.py | jtrunnels91/ModularEstimator | 1088f91440abd5a82d094311f51d0250ecca52e1 | [
"MIT"
] | null | null | null | modest/utils/accessPSC.py | jtrunnels91/ModularEstimator | 1088f91440abd5a82d094311f51d0250ecca52e1 | [
"MIT"
] | null | null | null | modest/utils/accessPSC.py | jtrunnels91/ModularEstimator | 1088f91440abd5a82d094311f51d0250ecca52e1 | [
"MIT"
] | null | null | null | import requests
import pandas as pd
import numpy as np
from tempfile import NamedTemporaryFile
import os
import subprocess
from astropy.io import fits
import matplotlib.pyplot as plt
from . import spacegeometry
def getChandraObs(
obsID,
fileList
):
pass
def getHeaderInfo(
key,
... | 31.634058 | 101 | 0.554919 |
4a45dbbde48f5ccb5a48b4e92a365c48c3470759 | 97 | py | Python | scraper_extractor/components/helpers.py | jakjus/csgomath_engine | c7fd113f6ce63fa070798ea01b39088bc555fc55 | [
"MIT"
] | null | null | null | scraper_extractor/components/helpers.py | jakjus/csgomath_engine | c7fd113f6ce63fa070798ea01b39088bc555fc55 | [
"MIT"
] | null | null | null | scraper_extractor/components/helpers.py | jakjus/csgomath_engine | c7fd113f6ce63fa070798ea01b39088bc555fc55 | [
"MIT"
] | null | null | null | def text_to_price(text):
return int(text.replace('$', '').replace(',', '').replace('.', ''))
| 32.333333 | 71 | 0.556701 |
82a55b9b13a8674d6f326d940e83cfcff3f48307 | 18,808 | py | Python | pysnmp-with-texts/ASCEND-MIBVRTR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/ASCEND-MIBVRTR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/ASCEND-MIBVRTR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ASCEND-MIBVRTR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBVRTR-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:28:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... | 150.464 | 2,303 | 0.816727 |
e39e4048791d919e6f54d580e4fcb393a3b1aa5d | 292 | py | Python | homeassistant/components/rdw/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/rdw/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/rdw/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Constants for the RDW integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Final
DOMAIN: Final = "rdw"
LOGGER = logging.getLogger(__package__)
SCAN_INTERVAL = timedelta(hours=1)
CONF_LICENSE_PLATE: Final = "license_plate"
| 20.857143 | 43 | 0.794521 |
38da9285fa8cc3423bc21847e15ac2f068694827 | 826 | py | Python | core/migrations/0005_auto_20170209_1745.py | grapesmoker/prograces | 466c3ec7061574f9147e13b5d505761efe15cd3b | [
"MIT"
] | 2 | 2017-02-09T14:10:18.000Z | 2017-03-13T01:09:47.000Z | core/migrations/0005_auto_20170209_1745.py | grapesmoker/prograces | 466c3ec7061574f9147e13b5d505761efe15cd3b | [
"MIT"
] | null | null | null | core/migrations/0005_auto_20170209_1745.py | grapesmoker/prograces | 466c3ec7061574f9147e13b5d505761efe15cd3b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-09 17:45
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20170209_1558'),
]
operations ... | 26.645161 | 94 | 0.606538 |
ffd1e143ce8b4e13861310d9ae0db3b365a4a6a9 | 7,108 | py | Python | Session.py | bopopescu/plib | 9786ccff65f1c745639899f2f6f81ec8aa82d828 | [
"Apache-2.0"
] | null | null | null | Session.py | bopopescu/plib | 9786ccff65f1c745639899f2f6f81ec8aa82d828 | [
"Apache-2.0"
] | null | null | null | Session.py | bopopescu/plib | 9786ccff65f1c745639899f2f6f81ec8aa82d828 | [
"Apache-2.0"
] | null | null | null | # coding=utf8
""" Session Module
Handles sessions used by the services to keep track of login users
"""
# Import future
from __future__ import print_function, absolute_import
__author__ = "Chris Nasr"
__copyright__ = "OuroborosCoding"
__maintainer__ = "Chris Nasr"
__email__ = "ouroboroscode@gmail.com"
__created__ ... | 18.656168 | 74 | 0.629854 |
c6c27652960a11db25ee327adea9982f314ea790 | 53 | py | Python | maci/replay_buffers/__init__.py | Faiz/mapr2 | 30fb37e1807d47f3678b5cab80ac60c74c4e37f7 | [
"Apache-2.0"
] | 1 | 2021-09-03T16:33:12.000Z | 2021-09-03T16:33:12.000Z | maci/replay_buffers/__init__.py | Faiz/mapr2 | 30fb37e1807d47f3678b5cab80ac60c74c4e37f7 | [
"Apache-2.0"
] | null | null | null | maci/replay_buffers/__init__.py | Faiz/mapr2 | 30fb37e1807d47f3678b5cab80ac60c74c4e37f7 | [
"Apache-2.0"
] | null | null | null | from .simple_replay_buffer import SimpleReplayBuffer
| 26.5 | 52 | 0.90566 |
6e2199f2c294bd95831bb7566aecc36004dc5c6a | 5,550 | py | Python | server/tasks.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | null | null | null | server/tasks.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | 6 | 2021-08-06T16:30:03.000Z | 2021-12-11T05:30:02.000Z | server/tasks.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | null | null | null | import json
import os
import re
import requests
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
app = Celery('task')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks
@app.task
def backup_pos... | 36.513158 | 155 | 0.538198 |
5af8e2f3a39a7f7f68c7047cce936866bd38823b | 2,464 | py | Python | supreme/resolve/tests/test_operators.py | KirillDZR/supreme | c296722599363bd0cbcce6877bd9de9b066cb74b | [
"BSD-3-Clause"
] | 95 | 2015-01-17T09:48:20.000Z | 2021-11-07T16:02:38.000Z | supreme/resolve/tests/test_operators.py | KirillDZR/supreme | c296722599363bd0cbcce6877bd9de9b066cb74b | [
"BSD-3-Clause"
] | 4 | 2015-10-23T15:13:34.000Z | 2019-09-23T22:47:10.000Z | supreme/resolve/tests/test_operators.py | KirillDZR/supreme | c296722599363bd0cbcce6877bd9de9b066cb74b | [
"BSD-3-Clause"
] | 34 | 2015-02-22T20:54:40.000Z | 2022-02-27T13:39:32.000Z | import numpy as np
from numpy.testing import *
import scipy.ndimage as ndi
import scipy.linalg
import scipy.sparse as sparse
from supreme.geometry.window import gauss
from supreme.resolve.operators import bilinear, convolve, block_diag
from supreme.io import imread
import os
HR = imread(os.path.join(os.path.dirname... | 28 | 71 | 0.525974 |
c8a1fea820496c23232c34c914affd2ceb7ab2c2 | 16,915 | py | Python | resources/lib/services/msl/msl_handler.py | locutus32/plugin.video.netflix | 68ed615e362fd8687f6bc678dd9efb1aa27f65a8 | [
"MIT"
] | null | null | null | resources/lib/services/msl/msl_handler.py | locutus32/plugin.video.netflix | 68ed615e362fd8687f6bc678dd9efb1aa27f65a8 | [
"MIT"
] | null | null | null | resources/lib/services/msl/msl_handler.py | locutus32/plugin.video.netflix | 68ed615e362fd8687f6bc678dd9efb1aa27f65a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: trummerjo
# Module: MSLHttpRequestHandler
# Created on: 26.01.2017
# License: MIT https://goo.gl/5bMj3H
"""Proxy service to convert manifest and provide license data"""
from __future__ import absolute_import, division, unicode_literals
import re
import zlib
import json
import time
imp... | 41.055825 | 100 | 0.628259 |
d3cada72860e1b3276633b196a194a70b8658418 | 1,749 | py | Python | problems/EE/auto/problem7_EE.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 5 | 2020-10-15T14:40:03.000Z | 2021-08-20T17:45:41.000Z | problems/EE/auto/problem7_EE.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | null | null | null | problems/EE/auto/problem7_EE.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 2 | 2020-10-15T07:06:14.000Z | 2020-10-15T17:33:01.000Z | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | 30.155172 | 247 | 0.480274 |
e3cf88b2840dd63aeeabf8199345d58ee06116b8 | 64,790 | py | Python | project/view_finder/transformations.py | PYSFE/PySFE | 8fd7be869ed7196882405e98849b5b2b81e97517 | [
"MIT"
] | 2 | 2017-11-08T10:23:34.000Z | 2018-08-01T14:39:25.000Z | project/view_finder/transformations.py | PYSFE/pySFE | 8fd7be869ed7196882405e98849b5b2b81e97517 | [
"MIT"
] | null | null | null | project/view_finder/transformations.py | PYSFE/pySFE | 8fd7be869ed7196882405e98849b5b2b81e97517 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# transformations.py
# Copyright (c) 2006-2015, Christoph Gohlke
# Copyright (c) 2006-2015, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... | 34.499468 | 80 | 0.587498 |
1e86e73fcfad0804cc41814c17985d11b159642b | 889 | py | Python | Bitchat/urls.py | thanasispe/Bitchat | 5f1162282c69dc087fc93af29bc353b7e01a07f7 | [
"Apache-2.0"
] | 2 | 2022-03-13T15:30:08.000Z | 2022-03-13T15:30:24.000Z | Bitchat/urls.py | thanasispe/Bitchat | 5f1162282c69dc087fc93af29bc353b7e01a07f7 | [
"Apache-2.0"
] | null | null | null | Bitchat/urls.py | thanasispe/Bitchat | 5f1162282c69dc087fc93af29bc353b7e01a07f7 | [
"Apache-2.0"
] | null | null | null | """Bitchat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 34.192308 | 77 | 0.700787 |
8fd494b9b0f01cc32af4f6a0dcce097deb3d6f18 | 4,352 | py | Python | tests/test_init.py | ju-sh/tzview | 2ad930bf8a3de37697042b05eba332e282626d62 | [
"MIT"
] | null | null | null | tests/test_init.py | ju-sh/tzview | 2ad930bf8a3de37697042b05eba332e282626d62 | [
"MIT"
] | null | null | null | tests/test_init.py | ju-sh/tzview | 2ad930bf8a3de37697042b05eba332e282626d62 | [
"MIT"
] | null | null | null | """
Test cases for code in src/tzview/__init__.py
"""
import datetime
import pytest
import pytz
import tzlocal
import tzcity
import tzview
class TestParseDT:
@pytest.mark.parametrize('dt_str, dt_format, expected', [
# Without dt_format
("2019-02-28 11:23:42", None,
datetime.datetime(20... | 30.865248 | 79 | 0.57307 |
37359fb7536ee6baf379d71533f816f67dcb9a35 | 25,897 | py | Python | packages/python/plotly/plotly/graph_objs/layout/yaxis/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 3 | 2020-02-04T21:39:20.000Z | 2020-11-17T19:07:07.000Z | packages/python/plotly/plotly/graph_objs/layout/yaxis/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 5 | 2021-03-10T05:39:37.000Z | 2022-02-13T04:56:40.000Z | packages/python/plotly/plotly/graph_objs/layout/yaxis/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Title(_BaseLayoutHierarchyType):
# font
# ----
@property
def font(self):
"""
Sets this axis' title font. Note that the title's font used to
be customized by the now ... | 35.282016 | 85 | 0.57022 |
70208e1fbd1a2457d72c08f072536822f22d0127 | 477 | py | Python | SimpleGAN/resize_image.py | Pixir/Pixir | 63a6fc0728403af92eadf188f532f9f41cd9f912 | [
"MIT"
] | null | null | null | SimpleGAN/resize_image.py | Pixir/Pixir | 63a6fc0728403af92eadf188f532f9f41cd9f912 | [
"MIT"
] | 1 | 2020-02-10T08:11:23.000Z | 2020-02-10T08:11:23.000Z | SimpleGAN/resize_image.py | Pixir/Pixir | 63a6fc0728403af92eadf188f532f9f41cd9f912 | [
"MIT"
] | 3 | 2020-02-09T11:14:33.000Z | 2020-04-11T16:10:17.000Z | from SimpleGAN.Read_data import read_images
import numpy as np
def resize_image(width=128, height=128):
original_image = read_images()
resized_image_set = []
i = 0
for image in original_image:
i += 1
resized_image = image.resize((width, height))
resized_image.save(f'resized_imag... | 28.058824 | 57 | 0.691824 |
5663ffc02775893c769bc29c28af56f23fdbefea | 3,246 | py | Python | RoboticsCV/app.py | FinneganHunter/RoboticsCV | 443fcf914770ed6c18d6a0c41b287e265ae30763 | [
"MIT"
] | null | null | null | RoboticsCV/app.py | FinneganHunter/RoboticsCV | 443fcf914770ed6c18d6a0c41b287e265ae30763 | [
"MIT"
] | null | null | null | RoboticsCV/app.py | FinneganHunter/RoboticsCV | 443fcf914770ed6c18d6a0c41b287e265ae30763 | [
"MIT"
] | null | null | null | # open cv module
# arduino communication module
# remote control?
# wifi camera stream
from typing import List, Any
from .ArduinoComm.class_test import ArduinoCommClass
from RoboticsCV.ComputerVision import computer_vision, face_recog
import cv2 as cv
def main():
"""
# 1: Run the camera (module or script) Wi... | 39.108434 | 120 | 0.679298 |
5b6b3f7338219ee6a611caa8ffd695e341bc76b9 | 16,693 | py | Python | saleor/graphql/views.py | atellezsazo/saleor | 71c51c4d5076d4774c6f88d329eb8627f7963351 | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/views.py | atellezsazo/saleor | 71c51c4d5076d4774c6f88d329eb8627f7963351 | [
"CC-BY-4.0"
] | 99 | 2021-07-12T04:28:37.000Z | 2022-03-28T04:51:18.000Z | saleor/graphql/views.py | atellezsazo/saleor | 71c51c4d5076d4774c6f88d329eb8627f7963351 | [
"CC-BY-4.0"
] | null | null | null | import fnmatch
import hashlib
import json
import logging
import traceback
from typing import Any, Dict, List, Optional, Tuple, Union
import opentracing
import opentracing.tags
from django.conf import settings
from django.core.cache import cache
from django.db import connection
from django.db.backends.postgresql.base i... | 39.556872 | 88 | 0.606841 |
c638c9a8a092afe2f062d8c1f531452959acd10d | 2,885 | py | Python | Engine/Communication/sender/serial_command_sender.py | RoboCupULaval/StrategyAI | ccddde144f2c0a67113d2e5ffe7c75ed9d4a3d19 | [
"MIT"
] | 13 | 2018-03-14T10:20:10.000Z | 2021-12-10T05:36:47.000Z | Engine/Communication/sender/serial_command_sender.py | RoboCupULaval/StrategyIA | ccddde144f2c0a67113d2e5ffe7c75ed9d4a3d19 | [
"MIT"
] | 200 | 2016-04-29T23:13:01.000Z | 2018-03-13T14:36:39.000Z | Engine/Communication/sender/serial_command_sender.py | RoboCupULaval/StrategyIA | ccddde144f2c0a67113d2e5ffe7c75ed9d4a3d19 | [
"MIT"
] | 45 | 2015-07-04T18:57:39.000Z | 2018-01-11T16:11:13.000Z | # Under MIT License, see LICENSE.txt
from typing import Union
from pyhermes import McuCommunicator
from Engine.Communication.sender.sender_base_class import Sender
from Engine.Controller.robot import MAX_LINEAR_SPEED, MAX_ANGULAR_SPEED
from Util.constant import KickForce, DribbleState
from Util.geometry import clamp
... | 46.532258 | 110 | 0.577816 |
68775106033d261843f6f84b3776a79b2fb9080a | 1,633 | py | Python | Audio Processing/led_driver.py | wyager/LEDStrip | 552179dbadadf4360a13ce452a922b4935b8e402 | [
"BSD-2-Clause"
] | 42 | 2015-01-01T00:28:28.000Z | 2021-12-01T03:56:08.000Z | Audio Processing/led_driver.py | wyager/LEDStrip | 552179dbadadf4360a13ce452a922b4935b8e402 | [
"BSD-2-Clause"
] | 4 | 2015-01-12T21:48:29.000Z | 2016-05-09T23:55:35.000Z | Audio Processing/led_driver.py | wyager/LEDStrip | 552179dbadadf4360a13ce452a922b4935b8e402 | [
"BSD-2-Clause"
] | 7 | 2015-01-18T19:50:06.000Z | 2017-09-22T03:17:33.000Z | # Will Yager
# This Python script sends color/brightness data based on
# ambient sound frequencies to the LEDs.
import pyaudio as pa
import numpy as np
import sys
import serial
# Output values max at 1.0
import notes_scaled_nosaturation
import lavalamp_colors
audio_stream = pa.PyAudio().open(format=pa.paInt16, \
... | 30.811321 | 97 | 0.695652 |
2904ac42894c9acaadc8d3ada5d7227eb182bd61 | 20,889 | py | Python | src/pybit/connection.py | stealth-startup/pybit | 4447303813138dee0b7768c92db7c7781128bed3 | [
"MIT"
] | null | null | null | src/pybit/connection.py | stealth-startup/pybit | 4447303813138dee0b7768c92db7c7781128bed3 | [
"MIT"
] | null | null | null | src/pybit/connection.py | stealth-startup/pybit | 4447303813138dee0b7768c92db7c7781128bed3 | [
"MIT"
] | null | null | null | # Copyright (c) 2013 Rex <fdrex1987@gmail.com>
# Copyright (c) 2010 Witchspace <witchspace81@gmail.com>
"""
Connect to Bitcoin server via JSON-RPC.
"""
from pybit.proxy import AuthServiceProxy
from pybit.exceptions import wrap_exception, BitcoinException, WalletPassphraseIncorrect, WalletAlreadyUnlocked
from pybit.type... | 35.166667 | 118 | 0.630954 |
572d43f645d213342b79a33a8babc2cd98de58f0 | 408 | py | Python | oi/loj/P6433/hack.py | Riteme/test | b511d6616a25f4ae8c3861e2029789b8ee4dcb8d | [
"BSD-Source-Code"
] | 3 | 2018-08-30T09:43:20.000Z | 2019-12-03T04:53:43.000Z | oi/loj/P6433/hack.py | Riteme/test | b511d6616a25f4ae8c3861e2029789b8ee4dcb8d | [
"BSD-Source-Code"
] | null | null | null | oi/loj/P6433/hack.py | Riteme/test | b511d6616a25f4ae8c3861e2029789b8ee4dcb8d | [
"BSD-Source-Code"
] | null | null | null | #!/usr/bin/env pypy
from os import *
def sh(x):
assert not system(x)
sh('cp brute.cpp /tmp')
sh('cp main.cpp /tmp')
sh('cp gen.py /tmp')
chdir('/tmp')
sh('g++ main.cpp -O3 -o a.out')
sh('g++ brute.cpp -O3 -o b.out')
cnt = 0
while True:
cnt += 1
print cnt
sh('./gen.py 9 100 > data.in')
sh('./a.out... | 18.545455 | 35 | 0.541667 |
a8a549260fca4ab33778fb072a160631e7ec227f | 427 | py | Python | ginger/scripts/templates/project_templates/project_name/urls.py | vivsh/django-ginger | d293109becc72845a23f2aeb732ed808a7a67d69 | [
"MIT"
] | null | null | null | ginger/scripts/templates/project_templates/project_name/urls.py | vivsh/django-ginger | d293109becc72845a23f2aeb732ed808a7a67d69 | [
"MIT"
] | null | null | null | ginger/scripts/templates/project_templates/project_name/urls.py | vivsh/django-ginger | d293109becc72845a23f2aeb732ed808a7a67d69 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.conf import settings
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include("{{project_name}}.registration.urls")),
url(r'',... | 35.583333 | 70 | 0.735363 |
74ee5b7b57bda48ea65bd7cc70672e7de3e48b7b | 12,424 | py | Python | precon_project/precon/models.py | kevinr/precon-project | 12975c6c21cfc4b4114c6b88b10ae114a0cf5e89 | [
"MIT"
] | null | null | null | precon_project/precon/models.py | kevinr/precon-project | 12975c6c21cfc4b4114c6b88b10ae114a0cf5e89 | [
"MIT"
] | null | null | null | precon_project/precon/models.py | kevinr/precon-project | 12975c6c21cfc4b4114c6b88b10ae114a0cf5e89 | [
"MIT"
] | null | null | null | import string, random
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.utils.safestring import mark_safe
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
class Parti... | 42.258503 | 256 | 0.721265 |
5758e56521d675cf05a3f30368bddcb2ed79c429 | 924 | py | Python | app/main/forms.py | cecibarasa/JVUNE | 6fb8d40538852f12b4b683a45d8f4457a85a3657 | [
"MIT"
] | 2 | 2020-06-19T18:48:47.000Z | 2021-06-12T22:08:12.000Z | app/main/forms.py | cecibarasa/JVUNE | 6fb8d40538852f12b4b683a45d8f4457a85a3657 | [
"MIT"
] | null | null | null | app/main/forms.py | cecibarasa/JVUNE | 6fb8d40538852f12b4b683a45d8f4457a85a3657 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField,SelectField
from wtforms.validators import Required, Email, Length
class BlogForm(FlaskForm):
author = StringField('Author', validators = [Required()])
text = TextAreaField('Blog',validators = [Required()])
submit = S... | 42 | 89 | 0.713203 |
f42a2c66d69161d42c0e397980388505590e78b0 | 18,305 | py | Python | sdk/python/pulumi_azure_native/network/virtual_network_peering.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/virtual_network_peering.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/virtual_network_peering.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities, _tables
from ... | 70.949612 | 5,163 | 0.727178 |
f50c3bca2d549b75454aab78cbf6ae29310ef460 | 4,380 | py | Python | exercise2.py | ILS-Z399/05b-Exercises-pygame-physics | b8807ae1eedabe41e9e69e29b1a87cacb444b948 | [
"MIT"
] | 1 | 2020-12-30T12:15:52.000Z | 2020-12-30T12:15:52.000Z | exercise2.py | ILS-Z399/05b-Exercises-pygame-physics | b8807ae1eedabe41e9e69e29b1a87cacb444b948 | [
"MIT"
] | null | null | null | exercise2.py | ILS-Z399/05b-Exercises-pygame-physics | b8807ae1eedabe41e9e69e29b1a87cacb444b948 | [
"MIT"
] | 9 | 2018-03-30T17:05:40.000Z | 2018-04-18T00:55:24.000Z | #!/usr/bin/env python
'''
For every line in the collide method (lines 58-91), please add a comment describing what it does.
Try to describe each line within the context of the program as a whole, rather than just mechanically
Feel free to alter the parameters to see how things change. That can be a great way to be ... | 31.06383 | 137 | 0.681963 |
1212371e350bc3f756f520e2e4e508df3d05cee5 | 7,871 | py | Python | contracts/vote.py | lucas7788/decentralized-voting-box | 62af6561bf917b7732e6c671463dcc1305b46e0c | [
"MIT"
] | null | null | null | contracts/vote.py | lucas7788/decentralized-voting-box | 62af6561bf917b7732e6c671463dcc1305b46e0c | [
"MIT"
] | null | null | null | contracts/vote.py | lucas7788/decentralized-voting-box | 62af6561bf917b7732e6c671463dcc1305b46e0c | [
"MIT"
] | 1 | 2018-11-18T03:13:46.000Z | 2018-11-18T03:13:46.000Z | """
A sample of OEP5 smart contract
"""
from boa.interop.System.Storage import GetContext, Get, Put, Delete
from boa.interop.System.Runtime import CheckWitness, Notify, Serialize, Deserialize
from boa.interop.System.ExecutionEngine import GetExecutingScriptHash
from boa.builtins import ToScriptHash, sha256, concat
# ... | 28.31295 | 83 | 0.628383 |
0302c30914b65e0703879324e022207a119be610 | 33,258 | py | Python | Lib/mhlib.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-07-09T20:02:48.000Z | 2021-11-21T20:00:37.000Z | Lib/mhlib.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | Lib/mhlib.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """MH interface -- purely object-oriented (well, almost)
Executive summary:
import mhlib
mh = mhlib.MH() # use default mailbox directory and profile
mh = mhlib.MH(mailbox) # override mailbox location (default from profile)
mh = mhlib.MH(mailbox, profile) # override mailbox and profile
mh.error(format, ...)... | 33.125498 | 79 | 0.530699 |
8b18fc9f1a3234399d95889f3726aa325f5cd189 | 2,227 | py | Python | pydis_site/apps/api/models/bot/message.py | Hotdogszbg/site | 8071847742f39258781105bb3cfe19fc8c8c967c | [
"MIT"
] | null | null | null | pydis_site/apps/api/models/bot/message.py | Hotdogszbg/site | 8071847742f39258781105bb3cfe19fc8c8c967c | [
"MIT"
] | 10 | 2021-03-19T12:46:42.000Z | 2022-03-12T00:52:11.000Z | pydis_site/apps/api/models/bot/message.py | wookie184/site | 923cbeae0079b4a542fffda19bf3bce3daf15205 | [
"MIT"
] | null | null | null | from datetime import datetime
from django.contrib.postgres import fields as pgfields
from django.core.validators import MinValueValidator
from django.db import models
from django.utils import timezone
from pydis_site.apps.api.models.bot.tag import validate_tag_embed
from pydis_site.apps.api.models.bot.user import Use... | 30.506849 | 95 | 0.633139 |
b768d4ad53cf5b9139d925df51ce8b06ee3c3af0 | 3,317 | py | Python | applications/FluidDynamicsApplication/python_scripts/check_and_prepare_model_process_fluid.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 2 | 2020-04-30T19:13:08.000Z | 2021-04-14T19:40:47.000Z | applications/FluidDynamicsApplication/python_scripts/check_and_prepare_model_process_fluid.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-04-30T19:19:09.000Z | 2020-05-02T14:22:36.000Z | applications/FluidDynamicsApplication/python_scripts/check_and_prepare_model_process_fluid.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-06-12T08:51:24.000Z | 2020-06-12T08:51:24.000Z | import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication
def Factory(settings, Model):
if(type(settings) != KratosMultiphysics.Parameters):
raise Exception("expected input shall be a Parameters object, encapsulating a json string")
return CheckAndPrepareModelProcess(Model, settings[... | 46.069444 | 120 | 0.730479 |
7d816d76a54e59cd05a1faf61e243701b9c832a6 | 81,227 | py | Python | venv/lib/python3.6/site-packages/tensorflow_core/compiler/tf2xla/ops/gen_xla_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | 2 | 2020-09-30T00:11:09.000Z | 2021-10-04T13:00:38.000Z | venv/lib/python3.6/site-packages/tensorflow_core/compiler/tf2xla/ops/gen_xla_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/tensorflow_core/compiler/tf2xla/ops/gen_xla_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | null | null | null | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: gen_xla_ops.cc
"""
import collections
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core... | 42.064733 | 232 | 0.689487 |
7eb6fbe8096107c9f6a8116bfdeadb94cf5f1c75 | 855 | py | Python | Database/SQLIte/14.ADD/U1.py | sarincr/Business-analytics-Course-with-Python- | 10e577fdb3cf90bb87c97cd23ee3ecd6a083bfc4 | [
"MIT"
] | 3 | 2022-01-18T05:35:52.000Z | 2022-03-25T06:13:54.000Z | Database/SQLIte/14.ADD/U1.py | sarincr/Business-analytics-Course-with-Python- | 10e577fdb3cf90bb87c97cd23ee3ecd6a083bfc4 | [
"MIT"
] | null | null | null | Database/SQLIte/14.ADD/U1.py | sarincr/Business-analytics-Course-with-Python- | 10e577fdb3cf90bb87c97cd23ee3ecd6a083bfc4 | [
"MIT"
] | 2 | 2022-01-17T08:23:59.000Z | 2022-01-17T08:28:18.000Z | import sqlite3
X = sqlite3.connect('NeDB.db')
Y = X.cursor()
Y.execute('''CREATE TABLE IF NOT EXISTS EMPLOYEE (
ID integer,
Name text NOT NULL,
Date_Join text,
Place text,
Age integer,
Salary real);''')
Y.execute("INSERT INTO ... | 19.883721 | 167 | 0.495906 |
8596085ce781bc8005fe85b04050a2d44b3ea943 | 3,868 | py | Python | python/test/lib/main_test.py | cyrill-k/netsec-scion | 4698f6057d1f4851d6bd24d9c925f9e6201ce371 | [
"Apache-2.0"
] | null | null | null | python/test/lib/main_test.py | cyrill-k/netsec-scion | 4698f6057d1f4851d6bd24d9c925f9e6201ce371 | [
"Apache-2.0"
] | null | null | null | python/test/lib/main_test.py | cyrill-k/netsec-scion | 4698f6057d1f4851d6bd24d9c925f9e6201ce371 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 ETH Zurich
#
# 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, sof... | 34.535714 | 85 | 0.661841 |
f87567114b0b1a04aec24bfe9b304276960c32ef | 5,198 | py | Python | feline/jobposts/migrations/0001_initial.py | Jeanluis019/feline | f802f7a57490b9425b32d88fa10d9cd7234e3a1f | [
"MIT"
] | 6 | 2021-10-13T01:05:27.000Z | 2021-11-10T03:15:15.000Z | feline/jobposts/migrations/0001_initial.py | Jeanluis019/feline | f802f7a57490b9425b32d88fa10d9cd7234e3a1f | [
"MIT"
] | 1 | 2022-03-30T21:26:16.000Z | 2022-03-30T21:26:16.000Z | feline/jobposts/migrations/0001_initial.py | Jeanluis019/feline | f802f7a57490b9425b32d88fa10d9cd7234e3a1f | [
"MIT"
] | 1 | 2021-11-10T13:32:21.000Z | 2021-11-10T13:32:21.000Z | # Generated by Django 3.1.13 on 2021-10-15 04:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
import django_extensions.db.fields
import taggit.managers
class Migration(migrations.Migration):
initial = True
dependen... | 60.44186 | 184 | 0.620623 |
ef9beb0bf67db79893b7b966d7de5583cf6dc557 | 817 | py | Python | tests/test_api_v1_services_dpinger_start.py | jaredhendrickson13/pfsense-api | 72d85801673eaba66bdc4a698fbed561c61130d6 | [
"Apache-2.0"
] | 311 | 2020-04-13T16:38:56.000Z | 2022-03-28T12:56:12.000Z | tests/test_api_v1_services_dpinger_start.py | jaredhendrickson13/pfsense-api | 72d85801673eaba66bdc4a698fbed561c61130d6 | [
"Apache-2.0"
] | 171 | 2020-04-23T21:41:06.000Z | 2022-03-31T19:55:12.000Z | tests/test_api_v1_services_dpinger_start.py | jaredhendrickson13/pfsense-api | 72d85801673eaba66bdc4a698fbed561c61130d6 | [
"Apache-2.0"
] | 48 | 2020-07-19T22:43:42.000Z | 2022-03-25T16:20:17.000Z | # Copyright 2022 Jared Hendrickson
#
# 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 wri... | 37.136364 | 74 | 0.772338 |
cdf96353664206ccfbeae1cad0e6470f8345de30 | 1,697 | py | Python | scripts/train_yaml.py | Ramsha04/kits19-2d-reproduce | 66678f1eda3688d6dc64389e9a80ae0b754a3052 | [
"Apache-2.0"
] | null | null | null | scripts/train_yaml.py | Ramsha04/kits19-2d-reproduce | 66678f1eda3688d6dc64389e9a80ae0b754a3052 | [
"Apache-2.0"
] | null | null | null | scripts/train_yaml.py | Ramsha04/kits19-2d-reproduce | 66678f1eda3688d6dc64389e9a80ae0b754a3052 | [
"Apache-2.0"
] | null | null | null | from catalyst.dl import SupervisedRunner
import sys
sys.path.append(".")
from kits19cnn.experiments import TrainSegExperiment2D, seed_everything
from kits19cnn.visualize import plot_metrics, save_figs
def main(config):
"""
Main code for training a classification/seg/classification+seg model.
Args:
... | 31.425926 | 77 | 0.657631 |
79dff137e5cbee9d0806dbae4dd69ac205eecb3e | 15,066 | py | Python | venv/Lib/site-packages/pip/_vendor/urllib3/connection.py | RiccardoCherchi/Barcode-Stock | 699b977fa70ea14a7ac4d33bb7bb2f107aa2ca20 | [
"MIT"
] | 1 | 2020-10-21T04:51:46.000Z | 2020-10-21T04:51:46.000Z | venv/Lib/site-packages/pip/_vendor/urllib3/connection.py | RiccardoCherchi/Barcode-Stock | 699b977fa70ea14a7ac4d33bb7bb2f107aa2ca20 | [
"MIT"
] | 2 | 2020-10-23T06:51:04.000Z | 2020-11-12T07:03:37.000Z | venv/Lib/site-packages/pip/_vendor/urllib3/connection.py | RiccardoCherchi/Barcode-Stock | 699b977fa70ea14a7ac4d33bb7bb2f107aa2ca20 | [
"MIT"
] | 1 | 2020-10-24T05:21:20.000Z | 2020-10-24T05:21:20.000Z | from __future__ import absolute_import
import datetime
import logging
import os
import socket
from socket import error as SocketError, timeout as SocketTimeout
import warnings
from .packages import six
from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection
from .packages.six.moves.http_client imp... | 36.129496 | 99 | 0.634209 |
e8867c469b6f2bda131b5b68c40b498378ba6277 | 165 | py | Python | tutorial/snippets/urls.py | itaweb/DRF_Doc_Project | 3806b94123f36e36f84de9f73bbfd8500d0814e4 | [
"MIT"
] | null | null | null | tutorial/snippets/urls.py | itaweb/DRF_Doc_Project | 3806b94123f36e36f84de9f73bbfd8500d0814e4 | [
"MIT"
] | null | null | null | tutorial/snippets/urls.py | itaweb/DRF_Doc_Project | 3806b94123f36e36f84de9f73bbfd8500d0814e4 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('snippets/', views.snippet_list),
path('snippets/<int:pk>/', views.snippet_detail),
]
| 20.625 | 53 | 0.69697 |
f0c8b53e162ffc6b66282adb777dbfe91a203804 | 1,008 | py | Python | com/LimePencil/Q25097/Controlled_Inflation.py | LimePencil/baekjoonProblems | 61eeeeb875585d165d9e39ecdb3d905b4ba6aa87 | [
"MIT"
] | null | null | null | com/LimePencil/Q25097/Controlled_Inflation.py | LimePencil/baekjoonProblems | 61eeeeb875585d165d9e39ecdb3d905b4ba6aa87 | [
"MIT"
] | null | null | null | com/LimePencil/Q25097/Controlled_Inflation.py | LimePencil/baekjoonProblems | 61eeeeb875585d165d9e39ecdb3d905b4ba6aa87 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
for t in range(int(input())):
n,m=list(map(int,input().split()))
costom=[]
for i in range(n):
a=sorted(list(map(int,input().split())))
costom.append((a[0],a[-1],a[-1]-a[0]))
m=float('inf')
amount_first=costom[0][1]
amount_second=costom[0][1]... | 37.333333 | 73 | 0.550595 |
0dc66ab298917ff532da131b3936a41fa48ac3f3 | 1,619 | py | Python | modules/dbnd/src/targets/config.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | modules/dbnd/src/targets/config.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | modules/dbnd/src/targets/config.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | import abc
import logging
import os.path
import random
import tempfile
from dbnd._core.current import try_get_databand_context, try_get_databand_run
logger = logging.getLogger(__name__)
_CONFIG_PARSER = None
_DEFAULT_VALUE_PREVIEW_MAX_LEN = 10000
class TargetConfigProvider(object):
@abc.abstractmethod
def... | 23.808824 | 88 | 0.726992 |
0b387469ffde1d2bbe5af1877d830ec430b51694 | 614 | py | Python | tests/chart_tests/test_nginx_networkpolicy.py | astronomerio/astronomer | 939a71f097f3ca1491273a3dce40bdbe04a09a4a | [
"Apache-2.0"
] | 81 | 2018-01-15T21:48:39.000Z | 2018-11-15T07:35:11.000Z | tests/chart_tests/test_nginx_networkpolicy.py | astronomerio/astronomer | 939a71f097f3ca1491273a3dce40bdbe04a09a4a | [
"Apache-2.0"
] | 127 | 2018-01-15T21:13:34.000Z | 2018-11-13T17:19:58.000Z | tests/chart_tests/test_nginx_networkpolicy.py | astronomerio/astronomer | 939a71f097f3ca1491273a3dce40bdbe04a09a4a | [
"Apache-2.0"
] | 15 | 2018-01-19T18:39:57.000Z | 2018-10-26T06:00:12.000Z | from tests.chart_tests.helm_template_generator import render_chart
class TestNginxNetworkPolicy:
def test_nginx_networkpolicy_basics(self):
docs = render_chart(
show_only=[
"charts/nginx/templates/nginx-metrics-networkpolicy.yaml",
"charts/nginx/templates/nginx-... | 36.117647 | 79 | 0.609121 |
1bec40ac29c29bb51765a501e8b3f4f784a17add | 733 | py | Python | metadata_service/api/utils.py | ferras/metaflow-service | c5a45e915aca58f346e91de576240854c1742af6 | [
"Apache-2.0"
] | null | null | null | metadata_service/api/utils.py | ferras/metaflow-service | c5a45e915aca58f346e91de576240854c1742af6 | [
"Apache-2.0"
] | null | null | null | metadata_service/api/utils.py | ferras/metaflow-service | c5a45e915aca58f346e91de576240854c1742af6 | [
"Apache-2.0"
] | null | null | null | import json
import sys
import traceback
async def read_body(request_content):
byte_array = bytearray()
while not request_content.at_eof():
data = await request_content.read(4)
byte_array.extend(data)
return json.loads(byte_array.decode("utf-8"))
def get_traceback_str():
"""Get the t... | 24.433333 | 61 | 0.631651 |
e147819a12137b1a0ec6ff733e57609c4c02619f | 560 | py | Python | gui/compile_gui.py | marty0678/BT-Auto-Patcher | 4930407d0fefa35d78e357234f70e93bd2ed507d | [
"MIT"
] | 1 | 2020-09-10T05:09:49.000Z | 2020-09-10T05:09:49.000Z | gui/compile_gui.py | marty0678/BT-Auto-Patcher | 4930407d0fefa35d78e357234f70e93bd2ed507d | [
"MIT"
] | null | null | null | gui/compile_gui.py | marty0678/BT-Auto-Patcher | 4930407d0fefa35d78e357234f70e93bd2ed507d | [
"MIT"
] | null | null | null | import subprocess
ui_file = "gui\\mainwindow.ui"
ui_python = "gui\\mainwindow.py"
subprocess.call(['pyside2-uic', ui_file, ">", ui_python], shell=True)
resource_path = "gui\\resources.qrc"
resource_python = "gui\\resources_rc.py"
subprocess.call(["pyside2-rcc", "-o", resource_python, resource_path], shell=True)
# Up... | 32.941176 | 82 | 0.719643 |
aaed479bddab5a079447c5939f55c6ad3e8d1a85 | 2,784 | py | Python | lib/python2.7/site-packages/pyami/fileutil.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/pyami/fileutil.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/pyami/fileutil.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | #!/usr/bin/env python
import inspect
import os
import sys
import errno
def getMyFilename(up=1):
'''
return the filename of the caller or the caller's caller, etc depending
on the "up" argument. up=1 (default) means the caller. up=2 means the
caller's caller, etc.
'''
frame_record = inspect.stack()[up]
calling... | 32 | 108 | 0.748204 |
3b192a4d5631125e99d6c59b57820e5e5364793e | 14,105 | py | Python | python/tests/test_client.py | 18730298725/darabonba-openapi-util | d3f91d5a43bc6de732f4ea0a69d253460962c3eb | [
"Apache-2.0"
] | 1 | 2021-07-13T08:18:16.000Z | 2021-07-13T08:18:16.000Z | python/tests/test_client.py | 18730298725/darabonba-openapi-util | d3f91d5a43bc6de732f4ea0a69d253460962c3eb | [
"Apache-2.0"
] | null | null | null | python/tests/test_client.py | 18730298725/darabonba-openapi-util | d3f91d5a43bc6de732f4ea0a69d253460962c3eb | [
"Apache-2.0"
] | null | null | null | import unittest
import os
import binascii
from alibabacloud_openapi_util.client import Client, signature_method, get_canonical_query_string
from Tea.request import TeaRequest
from Tea.model import TeaModel
module_path = os.path.dirname(__file__)
class TestClient(unittest.TestCase):
class TestConvert... | 38.538251 | 117 | 0.563843 |
ea03390b18a8a7743bdf7fb4bc38fd715c5b2ac1 | 7,283 | py | Python | trankit/adapter_transformers/hf_argparser.py | jsteggink/trankit | 61ef593999bfa29751990d0d4bcf259daed05db4 | [
"Apache-2.0"
] | 613 | 2021-01-12T14:21:13.000Z | 2022-03-29T19:51:47.000Z | trankit/adapter_transformers/hf_argparser.py | jsteggink/trankit | 61ef593999bfa29751990d0d4bcf259daed05db4 | [
"Apache-2.0"
] | 38 | 2021-01-13T12:01:15.000Z | 2022-03-31T14:13:44.000Z | trankit/adapter_transformers/hf_argparser.py | jsteggink/trankit | 61ef593999bfa29751990d0d4bcf259daed05db4 | [
"Apache-2.0"
] | 77 | 2021-01-13T07:33:26.000Z | 2022-03-29T19:51:50.000Z | import dataclasses
import json
import sys
from argparse import ArgumentParser
from enum import Enum
from pathlib import Path
from typing import Any, Iterable, List, NewType, Tuple, Union
DataClass = NewType("DataClass", Any)
DataClassType = NewType("DataClassType", Any)
class HfArgumentParser(ArgumentP... | 45.805031 | 117 | 0.581354 |
5c226ce9cbc5503ecb03ba0ec1b45ece3162760e | 916 | py | Python | helper/misc.py | pasan1992/Human-Pose-Transfer | a7febc632d4fbf627ba05740d2048accb25575f2 | [
"MIT"
] | 64 | 2019-06-13T01:01:44.000Z | 2022-03-20T08:09:18.000Z | helper/misc.py | pasan1992/Human-Pose-Transfer | a7febc632d4fbf627ba05740d2048accb25575f2 | [
"MIT"
] | 10 | 2019-06-20T15:07:42.000Z | 2021-11-13T11:47:31.000Z | helper/misc.py | pasan1992/Human-Pose-Transfer | a7febc632d4fbf627ba05740d2048accb25575f2 | [
"MIT"
] | 17 | 2019-08-01T02:28:30.000Z | 2022-02-03T10:27:33.000Z | from torchvision.utils import make_grid
def custom_global_step_transform(custom_period):
"""
customize a global_step_transform for `ignite.contrib.handlers.BaseOutputHandler`,
used to restore correct iteration or epoch when using CustomPeriodicEvent.
:return: func:global_step_transform
"""
de... | 35.230769 | 100 | 0.741266 |
7e0612095a7f0875721c79d9bf3027829a4ad17a | 911 | py | Python | example_project/app/migrations/0001_initial.py | EugeneFadeev/django3-robokassa | caeb61c3a55d9e73529869ae39facba43b624241 | [
"MIT"
] | 10 | 2018-05-04T07:28:47.000Z | 2021-07-19T10:55:08.000Z | example_project/app/migrations/0001_initial.py | EugeneFadeev/django3-robokassa | caeb61c3a55d9e73529869ae39facba43b624241 | [
"MIT"
] | null | null | null | example_project/app/migrations/0001_initial.py | EugeneFadeev/django3-robokassa | caeb61c3a55d9e73529869ae39facba43b624241 | [
"MIT"
] | 6 | 2018-10-24T08:37:16.000Z | 2021-06-22T21:16:59.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-26 13:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Order',
... | 32.535714 | 114 | 0.60483 |
ba1d5e50cc5c60d0006fba99661eb817d06ca1fe | 8,358 | py | Python | scripts/voice_change_with_second_stage.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 139 | 2018-02-24T21:33:47.000Z | 2022-03-19T03:59:05.000Z | scripts/voice_change_with_second_stage.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 73 | 2018-02-17T14:27:11.000Z | 2021-06-05T18:11:09.000Z | scripts/voice_change_with_second_stage.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 31 | 2018-03-05T18:08:18.000Z | 2022-03-28T05:23:16.000Z | import argparse
import glob
import multiprocessing
import re
from functools import partial
from pathlib import Path
import librosa
import matplotlib.pyplot as plt
import numpy
from become_yukarin import SuperResolution
from become_yukarin.config.sr_config import create_from_json as create_sr_config
from become_yukarin... | 39.990431 | 119 | 0.715363 |
d584445a3a90558e6178a5a900a9511a2b8b8d61 | 3,911 | py | Python | b_train_ae.py | MiguelSimao/UC2017_Classification | 024c003571e3fc75fadf4430c069c284b18a032b | [
"MIT"
] | 1 | 2021-05-11T09:43:59.000Z | 2021-05-11T09:43:59.000Z | b_train_ae.py | MiguelSimao/UC2017_Classification | 024c003571e3fc75fadf4430c069c284b18a032b | [
"MIT"
] | null | null | null | b_train_ae.py | MiguelSimao/UC2017_Classification | 024c003571e3fc75fadf4430c069c284b18a032b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
SCRIPT TO TEST NOVELTY DETECTION FUNCTIONALITY
@author: simao
"""
import h5py
import numpy as np
from matplotlib import pyplot as plt
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn import preprocessing
np.random.seed(1337)
from keras.mode... | 22.738372 | 99 | 0.700077 |
1005504b888dcf3cf744ce3668e4b5332cf06c83 | 1,919 | py | Python | setup.py | jamieleecho/milliluk-tools | 9d77fd1640956723dbdd43f6675c01ce700b445b | [
"ClArtistic"
] | 3 | 2018-01-03T02:12:41.000Z | 2019-05-28T02:33:00.000Z | setup.py | jamieleecho/milliluk-tools | 9d77fd1640956723dbdd43f6675c01ce700b445b | [
"ClArtistic"
] | null | null | null | setup.py | jamieleecho/milliluk-tools | 9d77fd1640956723dbdd43f6675c01ce700b445b | [
"ClArtistic"
] | 2 | 2016-12-03T02:22:12.000Z | 2021-04-17T15:38:47.000Z | #!/usr/bin/env python
import setuptools
# VERSION MUST be defined on line 6
VERSION = "0.1"
test_deps = [
"black",
"pycodestyle",
"pylint",
"pytest",
"pytest-cov",
"tox",
]
extras = {
"test": test_deps,
}
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.set... | 28.220588 | 77 | 0.634706 |
1aa2d6de681b6a36d07f72b3e11f7132208fed3e | 742 | py | Python | profiles_project/profiles_api/permissions.py | amin72/profiles-rest-api | 8800e11a574f7330c2d8b7cd814da1c85f3d926e | [
"MIT"
] | null | null | null | profiles_project/profiles_api/permissions.py | amin72/profiles-rest-api | 8800e11a574f7330c2d8b7cd814da1c85f3d926e | [
"MIT"
] | 5 | 2021-03-19T09:28:00.000Z | 2022-02-10T13:54:51.000Z | profiles_project/profiles_api/permissions.py | amin72/profiles-rest-api | 8800e11a574f7330c2d8b7cd814da1c85f3d926e | [
"MIT"
] | null | null | null | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
"""Allow user to edit their own profile"""
def has_object_permission(self, request, view, obj):
"""Check user is trying to edit their own profile"""
if request.method in permissions.SAFE_METHODS:
... | 29.68 | 60 | 0.672507 |
cd5a7501d45be784dabfb939ed8343b86b01bac6 | 4,187 | py | Python | virl/cli/ssh/commands.py | tombry/virlutils | e98136b4e88c456828f2d0496c14f851f2627a46 | [
"MIT"
] | 133 | 2018-07-01T06:08:49.000Z | 2022-03-26T15:22:21.000Z | virl/cli/ssh/commands.py | tombry/virlutils | e98136b4e88c456828f2d0496c14f851f2627a46 | [
"MIT"
] | 76 | 2018-06-28T16:41:57.000Z | 2022-03-26T17:23:06.000Z | virl/cli/ssh/commands.py | tombry/virlutils | e98136b4e88c456828f2d0496c14f851f2627a46 | [
"MIT"
] | 43 | 2018-06-27T20:40:52.000Z | 2022-02-22T06:16:11.000Z | import click
from virl.api import VIRLServer
from subprocess import call
from virl import helpers
from virl.helpers import get_mgmt_lxc_ip, get_node_from_roster, get_cml_client, get_current_lab, safe_join_existing_lab, get_node_mgmt_ip
from virl2_client.exceptions import NodeNotFound
@click.command()
@click.argument(... | 36.72807 | 137 | 0.537139 |
5f7b62430be24daa84c58a45aa13d87ad8e3d245 | 3,787 | py | Python | server.py | kylehiroyasu/bert-extractive-summarizer | 71d122aeb91db64336a2ae4b017532f74387be5f | [
"MIT"
] | null | null | null | server.py | kylehiroyasu/bert-extractive-summarizer | 71d122aeb91db64336a2ae4b017532f74387be5f | [
"MIT"
] | null | null | null | server.py | kylehiroyasu/bert-extractive-summarizer | 71d122aeb91db64336a2ae4b017532f74387be5f | [
"MIT"
] | 1 | 2020-03-25T18:12:26.000Z | 2020-03-25T18:12:26.000Z | from flask import Flask
from flask import request, jsonify, abort, make_response
from flask_cors import CORS
import nltk
nltk.download('punkt')
from nltk import tokenize
from typing import List
import argparse
from summarizer import Summarizer, TransformerSummarizer
app = Flask(__name__)
CORS(app)
class Parser(obje... | 33.8125 | 113 | 0.627938 |
bccae0a22e1d71771e7c7f126936fd5528fff405 | 51 | py | Python | samples/lint/__init__.py | btrekkie/file-builder | e85726ed647ad7a73839c7410618ef3f118c96c9 | [
"MIT"
] | 1 | 2020-05-29T17:13:26.000Z | 2020-05-29T17:13:26.000Z | samples/lint/__init__.py | btrekkie/file-builder | e85726ed647ad7a73839c7410618ef3f118c96c9 | [
"MIT"
] | 4 | 2021-06-14T18:42:55.000Z | 2022-03-27T13:36:54.000Z | samples/lint/__init__.py | btrekkie/file-builder | e85726ed647ad7a73839c7410618ef3f118c96c9 | [
"MIT"
] | null | null | null | from .lint import lint_dir
__all__ = ['lint_dir']
| 12.75 | 26 | 0.72549 |
c8f00af828cea4b4fe96a961a6085e4081adc4ac | 2,422 | py | Python | components/manager/scripts/configure_manager.py | cloudify-cosmo/cloudify-manager-blueprints | 1908c1a0615fb15cbb118335aa2f9e055b9e5779 | [
"Apache-2.0"
] | 35 | 2015-03-07T13:30:58.000Z | 2022-02-14T11:44:48.000Z | components/manager/scripts/configure_manager.py | cloudify-cosmo/cloudify-manager-blueprints | 1908c1a0615fb15cbb118335aa2f9e055b9e5779 | [
"Apache-2.0"
] | 101 | 2015-03-18T03:07:57.000Z | 2019-02-07T12:06:42.000Z | components/manager/scripts/configure_manager.py | cloudify-cosmo/cloudify-manager-blueprints | 1908c1a0615fb15cbb118335aa2f9e055b9e5779 | [
"Apache-2.0"
] | 76 | 2015-01-08T10:33:03.000Z | 2021-05-11T08:45:50.000Z | #!/usr/bin/env python
#########
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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/... | 31.454545 | 79 | 0.71924 |
5e9c60a466fba874adedeab35be75fce5c5b5271 | 9,343 | py | Python | buildAdvGear2.py | BurcinSayin/pf2 | bcd362dc0a750b8ee59cd19ecff9cf5be4f34b19 | [
"MIT"
] | 25 | 2019-09-13T19:30:24.000Z | 2022-03-14T21:57:17.000Z | buildAdvGear2.py | BurcinSayin/pf2 | bcd362dc0a750b8ee59cd19ecff9cf5be4f34b19 | [
"MIT"
] | 13 | 2019-09-26T20:03:04.000Z | 2021-09-14T23:21:03.000Z | buildAdvGear2.py | BurcinSayin/pf2 | bcd362dc0a750b8ee59cd19ecff9cf5be4f34b19 | [
"MIT"
] | 12 | 2019-09-13T19:47:57.000Z | 2022-03-13T03:46:16.000Z | from bs4 import BeautifulSoup
import requests
import json
import datetime
import codecs
import time
wornHolder = {}
wornHolder['name'] = 'Pathfinder 2.0 Adventuring Gear list'
wornHolder['date'] = datetime.date.today().strftime("%B %d, %Y")
def get_multi(link):
items = []
res2 = requests.get(link)
res... | 33.487455 | 131 | 0.458846 |
7d8ee95bf5b933dc766678f4fce23796f07a9299 | 12,753 | py | Python | zoopt/algos/opt_algorithms/racos/racos_common.py | hongkahjun/ZOOpt-1 | 3dd0f81076f7b464ac1ec77117021621d314cdcb | [
"MIT"
] | null | null | null | zoopt/algos/opt_algorithms/racos/racos_common.py | hongkahjun/ZOOpt-1 | 3dd0f81076f7b464ac1ec77117021621d314cdcb | [
"MIT"
] | null | null | null | zoopt/algos/opt_algorithms/racos/racos_common.py | hongkahjun/ZOOpt-1 | 3dd0f81076f7b464ac1ec77117021621d314cdcb | [
"MIT"
] | null | null | null | """
This module contains the class RacosCommon, which is a common part in Racos, SRacos and SSRacos.
Author:
Yu-Ren Liu
Updated by:
Ze-Wen Li
"""
import copy, math
from zoopt.utils.tool_function import ToolFunction
from zoopt.solution import Solution
from multiprocessing import Queue
class RacosCommon:
... | 36.965217 | 113 | 0.569827 |
8a6b44dab0a69ec86d56c3cb1dc944ab24a6e4da | 8,216 | py | Python | code/Experiments/neon-master/examples/nmt/data.py | matthijsvk/convNets | 7e65db7857a4e6abfbcab264953eb7741319de6c | [
"Apache-2.0"
] | 53 | 2017-04-18T10:06:20.000Z | 2021-12-29T21:26:07.000Z | examples/nmt/data.py | anlthms/neon | cba318c9f0a2acf2ab8a3d7725b588b2a8b17cb9 | [
"Apache-2.0"
] | null | null | null | examples/nmt/data.py | anlthms/neon | cba318c9f0a2acf2ab8a3d7725b588b2a8b17cb9 | [
"Apache-2.0"
] | 20 | 2017-05-03T03:27:09.000Z | 2022-03-24T07:07:45.000Z | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2016 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 38.754717 | 94 | 0.591529 |
d8d65a25726ecba4e1f09c149c777992e32a5cab | 1,281 | py | Python | examples/debug_converter.py | anthonykgross/ffmpeg-streams-manager | 417e48370f9454ac45ccac73f8742d065a0b00d6 | [
"MIT"
] | null | null | null | examples/debug_converter.py | anthonykgross/ffmpeg-streams-manager | 417e48370f9454ac45ccac73f8742d065a0b00d6 | [
"MIT"
] | null | null | null | examples/debug_converter.py | anthonykgross/ffmpeg-streams-manager | 417e48370f9454ac45ccac73f8742d065a0b00d6 | [
"MIT"
] | null | null | null | from ffmpeg_streams_manager import *
input1 = Input("../fixtures/sintel.mp4")
input2 = Input("../fixtures/en.srt")
input3 = Input("../fixtures/es.srt")
converter = Converter('output.mkv')
converter.add_input(input1)
converter.add_input(input2)
converter.add_input(input3)
converter.debug()
# converter.run()
"""
Resul... | 26.142857 | 51 | 0.589383 |
4e66810370ac85b76bcf1e5fc9092490d1fd53d7 | 2,922 | py | Python | setup.py | eumiro/osmnx | 8d9e6af04a380931f0426b6ac3ab8cc0d708cfff | [
"MIT"
] | null | null | null | setup.py | eumiro/osmnx | 8d9e6af04a380931f0426b6ac3ab8cc0d708cfff | [
"MIT"
] | null | null | null | setup.py | eumiro/osmnx | 8d9e6af04a380931f0426b6ac3ab8cc0d708cfff | [
"MIT"
] | null | null | null | """
OSMnx setup script.
See license in LICENSE.txt.
"""
import os
from setuptools import setup
# provide a long description using reStructuredText
LONG_DESCRIPTION = r"""
**OSMnx** is a Python package that lets you download spatial geometries and
model, project, visualize, and analyze real-world street networks fro... | 34.785714 | 171 | 0.708077 |
f17aa680f344a7fbec8c88d91ac0ca797b73e011 | 333 | py | Python | head_first_python/set/vowels4.py | goxhaj/python | c4dd40d69062444361ca0cd81722c491b989a1cd | [
"Apache-2.0"
] | null | null | null | head_first_python/set/vowels4.py | goxhaj/python | c4dd40d69062444361ca0cd81722c491b989a1cd | [
"Apache-2.0"
] | null | null | null | head_first_python/set/vowels4.py | goxhaj/python | c4dd40d69062444361ca0cd81722c491b989a1cd | [
"Apache-2.0"
] | null | null | null | vowels = ['a', 'e', 'i', 'o', 'u']
word = input("Provide a word to search for vowels: ")
found = {}
found['a'] = 0
found['e'] = 0
found['i'] = 0
found['o'] = 0
found['u'] = 0
for letter in word:
if letter in vowels:
found[letter]+=1
for k, v in sorted(found.items()):
print (k, 'was found', v, '... | 22.2 | 53 | 0.528529 |
32146291c72aae31fa51014036152deb3a8a4fd7 | 23,035 | py | Python | awsume/awsumepy/default_plugins.py | icyfork/awsume | 524c667599b8bfba521f0397214bb363f1b706fa | [
"MIT"
] | null | null | null | awsume/awsumepy/default_plugins.py | icyfork/awsume | 524c667599b8bfba521f0397214bb363f1b706fa | [
"MIT"
] | null | null | null | awsume/awsumepy/default_plugins.py | icyfork/awsume | 524c667599b8bfba521f0397214bb363f1b706fa | [
"MIT"
] | null | null | null | import argparse
import configparser
import json
import os
import colorama
from . lib import exceptions
from . hookimpl import hookimpl
from .. import __data__
from ..autoawsume.process import kill
from . lib import aws as aws_lib
from . lib import aws_files as aws_files_lib
from . lib.logger import logger
from . lib.... | 42.188645 | 200 | 0.671587 |
114dac7083f6c1a189a68e4a3c6f234587513895 | 8,319 | py | Python | rrl.py | johnnyp2587/rrl-cpp | da2a72420f3cb80ebf7e77f727110ea21619e0af | [
"MIT"
] | 2 | 2020-10-05T05:04:32.000Z | 2021-03-08T07:24:47.000Z | rrl.py | johnnyp2587/rrl-cpp | da2a72420f3cb80ebf7e77f727110ea21619e0af | [
"MIT"
] | null | null | null | rrl.py | johnnyp2587/rrl-cpp | da2a72420f3cb80ebf7e77f727110ea21619e0af | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import pickle
import numpy as np
import pandas as pd
from datetime import datetime as dt
import matplotlib.pyplot as plt
def main():
fname = "../data/USDJPY30.csv"
init_t = 6000
T = 1000
M = 200
mu = 10000
sigma = 0.04
rho = 1.0
n_epoch = 10000
... | 34.953782 | 194 | 0.566655 |
014693251ad19ad0dd0293c84414eb78069ab003 | 980 | py | Python | kubernetes/test/test_v1_api_service_status.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | 1 | 2018-10-20T19:37:57.000Z | 2018-10-20T19:37:57.000Z | kubernetes/test/test_v1_api_service_status.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_api_service_status.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | 2 | 2018-07-27T19:39:34.000Z | 2020-12-25T02:48:27.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 21.777778 | 105 | 0.714286 |
5b9c1518912b62dca902075eb3a10dd13b88d82a | 13,785 | py | Python | sdk/python/pulumi_azure_native/maintenance/configuration_assignment.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/maintenance/configuration_assignment.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/maintenance/configuration_assignment.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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, overload
from .. import _utilities
from... | 43.213166 | 484 | 0.661299 |
eaeed10c8863674de20dc3bcb00ac750650316fa | 42,485 | py | Python | test/test_utils/__init__.py | Lokiiiiii/deep-learning-containers | f54b733567fd741b12362dc71cf93a72b5da1c82 | [
"Apache-2.0"
] | 1 | 2021-07-10T14:01:23.000Z | 2021-07-10T14:01:23.000Z | test/test_utils/__init__.py | Lokiiiiii/deep-learning-containers | f54b733567fd741b12362dc71cf93a72b5da1c82 | [
"Apache-2.0"
] | null | null | null | test/test_utils/__init__.py | Lokiiiiii/deep-learning-containers | f54b733567fd741b12362dc71cf93a72b5da1c82 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import re
import subprocess
import sys
import time
import boto3
import git
import pytest
from botocore.exceptions import ClientError
from glob import glob
from invoke import run
from invoke.context import Context
from packaging.version import LegacyVersion, Version, parse
from pac... | 40.193945 | 133 | 0.681229 |
7acfe1038370ad06323a017c95820888f95dccc5 | 152 | py | Python | Inheritance/class_Inheritance/project_zoo/reptile.py | vasetousa/OOP | e4fedc497dd149c9800613ea11846e0e770d122c | [
"MIT"
] | null | null | null | Inheritance/class_Inheritance/project_zoo/reptile.py | vasetousa/OOP | e4fedc497dd149c9800613ea11846e0e770d122c | [
"MIT"
] | null | null | null | Inheritance/class_Inheritance/project_zoo/reptile.py | vasetousa/OOP | e4fedc497dd149c9800613ea11846e0e770d122c | [
"MIT"
] | null | null | null | from Inheritance.class_Inheritance.project_zoo.animal import Animal
class Reptile(Animal):
def __init__(self, name):
super().__init__(name) | 30.4 | 67 | 0.756579 |
fb26b16bfbee441b76347521fb05dae83dedbc92 | 4,390 | py | Python | core/test/database/postgresql/mixin/test_pg_group_member.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | 3 | 2021-06-20T02:24:10.000Z | 2022-01-26T23:55:33.000Z | core/test/database/postgresql/mixin/test_pg_group_member.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | core/test/database/postgresql/mixin/test_pg_group_member.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from unittest import main
from recc.database.struct.group_join_member import GroupJoinGroupMember
from tester.unittest.postgresql_test_case import PostgresqlTestCase
class PgGroupMemberTestCase(PostgresqlTestCase):
async def setUp(self):
await super().setUp()
self.guest =... | 45.729167 | 88 | 0.719818 |
97700a2b41a02706a37d6bc8a35409a8d731f2e5 | 130,037 | py | Python | flopy/mf6/data/mfdata.py | gyanz/flopy | 282703716a01721e07905da65aa54e6017452a5a | [
"CC0-1.0",
"BSD-3-Clause"
] | 1 | 2019-11-01T00:34:14.000Z | 2019-11-01T00:34:14.000Z | flopy/mf6/data/mfdata.py | gyanz/flopy | 282703716a01721e07905da65aa54e6017452a5a | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/mf6/data/mfdata.py | gyanz/flopy | 282703716a01721e07905da65aa54e6017452a5a | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | from operator import itemgetter
from copy import deepcopy
import sys
import inspect
from shutil import copyfile
from collections import OrderedDict
from enum import Enum
import struct
import numpy as np
from ..mfbase import MFDataException, VerbosityLevel, \
MFInvalidTransientBlockHeaderE... | 47.615159 | 86 | 0.511639 |
6a430b8687bd533c2fc1e516f0cc66374b817736 | 2,400 | py | Python | python/gui.py | caioseda/audio-reactive-led-strip | 0264ad64b5fed4ed8fe0090ea8ea102a7c9afdda | [
"MIT"
] | null | null | null | python/gui.py | caioseda/audio-reactive-led-strip | 0264ad64b5fed4ed8fe0090ea8ea102a7c9afdda | [
"MIT"
] | null | null | null | python/gui.py | caioseda/audio-reactive-led-strip | 0264ad64b5fed4ed8fe0090ea8ea102a7c9afdda | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import division
import time
import numpy as np
from pyqtgraph.Qt import QtGui
import pyqtgraph as pg
# from GradientEditorItem.dockarea import *
import config
class GUI:
plot = []
curve = []
def __init__(self, width=800, height=450, title=''):
... | 32.876712 | 78 | 0.625 |
7dbb758cffcac675eb83d32aee5bfa10a5665003 | 5,765 | py | Python | saleor/plugins/webhook/plugin.py | enesustundag/saleor | 95ce4b577ca06110f4702e61f554e9d165ef5fd4 | [
"CC-BY-4.0"
] | 1 | 2021-01-13T15:55:33.000Z | 2021-01-13T15:55:33.000Z | saleor/plugins/webhook/plugin.py | enesustundag/saleor | 95ce4b577ca06110f4702e61f554e9d165ef5fd4 | [
"CC-BY-4.0"
] | 5 | 2021-06-10T20:57:04.000Z | 2022-03-12T01:04:33.000Z | saleor/plugins/webhook/plugin.py | enesustundag/saleor | 95ce4b577ca06110f4702e61f554e9d165ef5fd4 | [
"CC-BY-4.0"
] | 1 | 2021-02-03T09:34:04.000Z | 2021-02-03T09:34:04.000Z | from typing import TYPE_CHECKING, Any, Optional
from ...webhook.event_types import WebhookEventType
from ...webhook.payloads import (
generate_checkout_payload,
generate_customer_payload,
generate_fulfillment_payload,
generate_invoice_payload,
generate_order_payload,
generate_product_payload,
)... | 38.952703 | 88 | 0.701301 |
f27b861216f6bfec8581aa1e710ef4723e38e6dc | 4,545 | py | Python | src/transformers/models/reformer/tokenization_reformer_fast.py | MarcelGM/transformers | aad1d9b6d5c58fd974618ac0aead1c5bd1119467 | [
"Apache-2.0"
] | 101 | 2021-12-22T00:03:51.000Z | 2022-03-30T07:39:09.000Z | src/transformers/models/reformer/tokenization_reformer_fast.py | MarcelGM/transformers | aad1d9b6d5c58fd974618ac0aead1c5bd1119467 | [
"Apache-2.0"
] | 7 | 2021-07-16T21:47:19.000Z | 2022-03-18T20:26:53.000Z | src/transformers/models/reformer/tokenization_reformer_fast.py | MarcelGM/transformers | aad1d9b6d5c58fd974618ac0aead1c5bd1119467 | [
"Apache-2.0"
] | 30 | 2021-04-30T07:11:22.000Z | 2022-03-15T19:34:58.000Z | # coding=utf-8
# Copyright 2020 The Trax Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | 37.875 | 137 | 0.693949 |
ccbb513831b4e5a7f157b66f852b6deecb86f747 | 555 | py | Python | src/restaurants/migrations/0001_initial.py | shihlinlu/django-web-app | 26c2d2f6f0c7cf0e0eb7aa3d298cb25d84955496 | [
"Apache-2.0"
] | null | null | null | src/restaurants/migrations/0001_initial.py | shihlinlu/django-web-app | 26c2d2f6f0c7cf0e0eb7aa3d298cb25d84955496 | [
"Apache-2.0"
] | null | null | null | src/restaurants/migrations/0001_initial.py | shihlinlu/django-web-app | 26c2d2f6f0c7cf0e0eb7aa3d298cb25d84955496 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-31 19:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Restau... | 23.125 | 114 | 0.594595 |
ec97e793f1dc00773c99ee16651084e3e36c84f0 | 18,623 | py | Python | dataprep/clean/clean_lat_long.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | 1 | 2022-02-14T07:18:00.000Z | 2022-02-14T07:18:00.000Z | dataprep/clean/clean_lat_long.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | null | null | null | dataprep/clean/clean_lat_long.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | null | null | null | """
Clean and validate a DataFrame column containing geographic coordinates.
"""
import re
from operator import itemgetter
from typing import Any, Optional, Tuple, Union
import dask
import dask.dataframe as dd
import numpy as np
import pandas as pd
from ..progress_bar import ProgressBar
from .utils import NULL_VALUES... | 36.091085 | 99 | 0.582183 |
a03fcb0fdce18745ba74e2ece6d79eea4ab23a72 | 341 | py | Python | python-algorithm/leetcode/problem_476.py | isudox/leetcode-solution | 60085e64deaf396a171367affc94b18114565c43 | [
"MIT"
] | 5 | 2017-06-11T09:19:34.000Z | 2019-01-16T16:58:31.000Z | python-algorithm/leetcode/problem_476.py | isudox/leetcode-solution | 60085e64deaf396a171367affc94b18114565c43 | [
"MIT"
] | null | null | null | python-algorithm/leetcode/problem_476.py | isudox/leetcode-solution | 60085e64deaf396a171367affc94b18114565c43 | [
"MIT"
] | 1 | 2019-03-02T15:50:43.000Z | 2019-03-02T15:50:43.000Z | """476. Number Complement
https://leetcode.com/problems/number-complement/
"""
class Solution:
def findComplement(self, num: int) -> int:
ans = 0
i = 0
while num:
bit = num & 0b1
if bit == 0:
ans += 1 << i
num = num >> 1
i += ... | 20.058824 | 48 | 0.451613 |
bb60e863958241d3ebac5ce4084bd3f4d6c47b27 | 522 | py | Python | tests/int_tests/test_le.py | lycantropos/rithm | 61ae1614411ab0ce7feb403fdf93b71f49231ec1 | [
"MIT"
] | null | null | null | tests/int_tests/test_le.py | lycantropos/rithm | 61ae1614411ab0ce7feb403fdf93b71f49231ec1 | [
"MIT"
] | null | null | null | tests/int_tests/test_le.py | lycantropos/rithm | 61ae1614411ab0ce7feb403fdf93b71f49231ec1 | [
"MIT"
] | null | null | null | from hypothesis import given
from tests.utils import (IntWithBuiltin,
equivalence)
from . import strategies
@given(strategies.ints_with_builtins, strategies.ints_with_builtins)
def test_connection_with_builtin(first_with_builtin: IntWithBuiltin,
second_with_b... | 34.8 | 78 | 0.729885 |
851f5b1fdfc73cb79296c6dd7f59f484caddfd5b | 2,446 | py | Python | localflavor/za/forms.py | ifanrx/django-localflavor | 38328bbb127a33cb06eaea82288cd70821b2bad6 | [
"BSD-3-Clause"
] | null | null | null | localflavor/za/forms.py | ifanrx/django-localflavor | 38328bbb127a33cb06eaea82288cd70821b2bad6 | [
"BSD-3-Clause"
] | null | null | null | localflavor/za/forms.py | ifanrx/django-localflavor | 38328bbb127a33cb06eaea82288cd70821b2bad6 | [
"BSD-3-Clause"
] | null | null | null | """
South Africa-specific Form helpers
"""
from __future__ import unicode_literals
import re
from datetime import date
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import CharField, RegexField, Select
from django.utils.checksums import luhn
from dja... | 30.962025 | 88 | 0.641864 |
9869ef549ccefe2949b690ed81856e4209a0ddf1 | 9,835 | py | Python | neighborhood_development_18/migrations/0006_bikecount_bikedailyestimate_bikegreenway_bikelane_blockgroup_busstop_campreport_campsweep_communityg.py | AraOshin/civic-sandbox-backend | 7f864cd829927e5cbe99f252ba54c488ed4dedb6 | [
"MIT"
] | 1 | 2018-11-16T21:57:25.000Z | 2018-11-16T21:57:25.000Z | neighborhood_development_18/migrations/0006_bikecount_bikedailyestimate_bikegreenway_bikelane_blockgroup_busstop_campreport_campsweep_communityg.py | nam20485/civic-sandbox-backend | 7f864cd829927e5cbe99f252ba54c488ed4dedb6 | [
"MIT"
] | null | null | null | neighborhood_development_18/migrations/0006_bikecount_bikedailyestimate_bikegreenway_bikelane_blockgroup_busstop_campreport_campsweep_communityg.py | nam20485/civic-sandbox-backend | 7f864cd829927e5cbe99f252ba54c488ed4dedb6 | [
"MIT"
] | 1 | 2019-03-07T17:24:26.000Z | 2019-03-07T17:24:26.000Z | # Generated by Django 2.0.1 on 2018-08-15 18:18
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('neighborhood_development_18', '0005_bikeparking_demolition'),
]
operations = [
migrations.CreateM... | 39.497992 | 107 | 0.504525 |
d7fb5ce0cbfbbacd38f2d144c7e1e2553d89f032 | 5,787 | py | Python | controller/response.py | pondchamp/among_bots | d57eea79d0672aa596fcde6c58a0e636d04511ed | [
"Apache-2.0"
] | 4 | 2020-12-15T05:21:25.000Z | 2021-04-30T04:25:55.000Z | controller/response.py | pondchamp/among_bots | d57eea79d0672aa596fcde6c58a0e636d04511ed | [
"Apache-2.0"
] | null | null | null | controller/response.py | pondchamp/among_bots | d57eea79d0672aa596fcde6c58a0e636d04511ed | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional, Dict
import random
import re
from controller.substitute import SubstituteHelper
from data import consts, dialogs, enums
from data.dialogs import Dialog
from data.enums import KeyCommand, AUMap, ResponseFlags, Substitution
from state.game import GameState
from state.context import con... | 43.840909 | 119 | 0.676689 |
3dafaef0b992ecdc93495da228f43e1098ccb3e5 | 582 | py | Python | asteroids/__main__.py | rohinivsenthil/Asteroids | 75baf2c65515002c72088695eda54c66bc963eb9 | [
"MIT"
] | 8 | 2019-05-25T19:11:46.000Z | 2019-07-04T14:59:20.000Z | asteroids/__main__.py | rohinivsenthil/Asteroids | 75baf2c65515002c72088695eda54c66bc963eb9 | [
"MIT"
] | null | null | null | asteroids/__main__.py | rohinivsenthil/Asteroids | 75baf2c65515002c72088695eda54c66bc963eb9 | [
"MIT"
] | null | null | null | import json
import random
import pygame
from pygame.locals import *
from .pages import game
with open("config.json") as configfile:
config = json.load(configfile)
SCREEN_SIZE = config["screenSize"]
FRAMERATE = config["framerate"]
def main():
pygame.mixer.pre_init(buffer=1024)
pygame.i... | 17.636364 | 50 | 0.652921 |
7a4c65b2f7ebeabd0b80fde0c87914edc8dae337 | 1,303 | py | Python | tasks/agent/observation/cv/panorama_encoder.py | NCTUMLlab/Je-Wei-Jang-AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation | 3c3cf1ce4ce0935516abf880f0a06210923eb081 | [
"MIT"
] | null | null | null | tasks/agent/observation/cv/panorama_encoder.py | NCTUMLlab/Je-Wei-Jang-AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation | 3c3cf1ce4ce0935516abf880f0a06210923eb081 | [
"MIT"
] | null | null | null | tasks/agent/observation/cv/panorama_encoder.py | NCTUMLlab/Je-Wei-Jang-AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation | 3c3cf1ce4ce0935516abf880f0a06210923eb081 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
class PanoramaEncoder(nn.Module):
def __init__(
self,
config: dict,
vision_feature_size: int
) -> None:
super(PanoramaEncoder, self).__init__()
query_dim = config['state_tracker']['obs']['vision']['attn']['query_dim']
self.que... | 28.955556 | 99 | 0.568688 |
63f51649592962fe141c943cd3aac219080dd44e | 564 | py | Python | wsgi/iportalen_django/events/migrations/0044_auto_20160306_1546.py | I-sektionen/i-portalen | 1713e5814d40c0da1bf3278d60a561e7d3df3550 | [
"MIT"
] | 4 | 2016-09-21T17:06:01.000Z | 2018-02-06T16:36:44.000Z | wsgi/iportalen_django/events/migrations/0044_auto_20160306_1546.py | I-sektionen/i-portalen | 1713e5814d40c0da1bf3278d60a561e7d3df3550 | [
"MIT"
] | 149 | 2016-03-07T23:50:47.000Z | 2022-03-11T23:16:33.000Z | wsgi/iportalen_django/events/migrations/0044_auto_20160306_1546.py | I-sektionen/i-portalen | 1713e5814d40c0da1bf3278d60a561e7d3df3550 | [
"MIT"
] | 1 | 2016-03-07T23:02:06.000Z | 2016-03-07T23:02:06.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0043_auto_20160306_1419'),
]
operations = [
migrations.AlterField(
model_name='event',
nam... | 28.2 | 214 | 0.586879 |
727d87df93072276c71ba65d7f6ff70e5eb75aa8 | 402 | py | Python | setup.py | tveebot/communication | 33f92f6027cb812c887d8a9d7b9ce8b1543adfa8 | [
"MIT"
] | null | null | null | setup.py | tveebot/communication | 33f92f6027cb812c887d8a9d7b9ce8b1543adfa8 | [
"MIT"
] | null | null | null | setup.py | tveebot/communication | 33f92f6027cb812c887d8a9d7b9ce8b1543adfa8 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='tveebot-communication',
version='0.1',
description='Set of packages and modules to enable communication '
'between clients and daemons',
url='https://github.com/tveebot/communication',
license='MIT',
author='David Fialho',... | 26.8 | 70 | 0.686567 |
0a02a561c18189b59e1f27fd9281796b1675466a | 1,902 | py | Python | docs/core/examples/udpbroadcast.py | hawkowl/twisted | c413aac3888dea2202c0dc26f978d7f88b4b837a | [
"Unlicense",
"MIT"
] | 2 | 2015-11-08T12:59:22.000Z | 2018-10-19T01:06:40.000Z | docs/core/examples/udpbroadcast.py | hawkowl/twisted | c413aac3888dea2202c0dc26f978d7f88b4b837a | [
"Unlicense",
"MIT"
] | 5 | 2020-06-05T18:16:39.000Z | 2022-01-13T00:45:49.000Z | docs/core/examples/udpbroadcast.py | hawkowl/twisted | c413aac3888dea2202c0dc26f978d7f88b4b837a | [
"Unlicense",
"MIT"
] | 1 | 2020-12-18T11:13:15.000Z | 2020-12-18T11:13:15.000Z | #!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An example demonstrating how to send and receive UDP broadcast messages.
Every second, this application will send out a PING message with a unique ID.
It will respond to all PING messages with a PONG (including ones sen... | 25.36 | 77 | 0.673502 |
befc722db06b69c0b2485ae3dc98487c305e4901 | 8,899 | py | Python | second/protos/box_coder_pb2.py | yukke42/SECOND | e4d52f590844c4c53c25ec1688fdc6a045ebbf13 | [
"MIT"
] | null | null | null | second/protos/box_coder_pb2.py | yukke42/SECOND | e4d52f590844c4c53c25ec1688fdc6a045ebbf13 | [
"MIT"
] | null | null | null | second/protos/box_coder_pb2.py | yukke42/SECOND | e4d52f590844c4c53c25ec1688fdc6a045ebbf13 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: second/protos/box_coder.proto
import sys
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symb... | 32.59707 | 616 | 0.627374 |
5adb869006e29bda6ad1ff4cc0663ce6e5c63286 | 2,870 | py | Python | percolation/analysis/percolating_cluster_strength.py | cerisola/fiscomp | 28c2b4cf5e356c67df983ad393011ad6a1e4a654 | [
"MIT"
] | null | null | null | percolation/analysis/percolating_cluster_strength.py | cerisola/fiscomp | 28c2b4cf5e356c67df983ad393011ad6a1e4a654 | [
"MIT"
] | null | null | null | percolation/analysis/percolating_cluster_strength.py | cerisola/fiscomp | 28c2b4cf5e356c67df983ad393011ad6a1e4a654 | [
"MIT"
] | null | null | null | import importlib
import numpy as np
from scipy.stats import linregress
import matplotlib.pyplot as plt
import load_data
import common
import clusters
importlib.reload(load_data)
importlib.reload(common)
importlib.reload(clusters)
def fit_beta_percolating_cluster_strength(size, count, percolated, L, p_occupation):
... | 38.266667 | 113 | 0.710801 |
ade4a623d4ffedc744e8771e52233908cd8bf41b | 501 | py | Python | desafios/iniciante/diferenca.py | monikode/ipc-python | 34570d45658e6943c78815fc71072f7fee0e7a02 | [
"MIT"
] | 9 | 2021-08-31T04:25:51.000Z | 2021-09-16T06:40:30.000Z | desafios/iniciante/diferenca.py | monikode/ipc-python | 34570d45658e6943c78815fc71072f7fee0e7a02 | [
"MIT"
] | 2 | 2021-09-05T20:49:01.000Z | 2021-09-06T23:34:37.000Z | desafios/iniciante/diferenca.py | monikode/ipc-python | 34570d45658e6943c78815fc71072f7fee0e7a02 | [
"MIT"
] | 8 | 2021-08-31T23:55:18.000Z | 2021-09-29T23:33:49.000Z | '''
Leia quatro valores inteiros A, B, C e D. A seguir, calcule e mostre a diferença do produto de A e B pelo produto de C e D segundo a fórmula: DIFERENCA = (A * B - C * D).
Entrada
O arquivo de entrada contém 4 valores inteiros.
Saída
Imprima a mensagem DIFERENCA com todas as letras maiúsculas, conforme exemplo aba... | 27.833333 | 170 | 0.692615 |
fad8d014c1c58132a8d74a6bc09c6b22f969874d | 4,088 | py | Python | rapid7vmconsole/models/resources_policy_override.py | kiblik/vm-console-client-python | 038f6d33e8b2654a558326c6eb87f09ee23e0e22 | [
"MIT"
] | 61 | 2018-05-17T05:57:09.000Z | 2022-03-08T13:59:21.000Z | rapid7vmconsole/models/resources_policy_override.py | kiblik/vm-console-client-python | 038f6d33e8b2654a558326c6eb87f09ee23e0e22 | [
"MIT"
] | 33 | 2018-06-26T16:21:14.000Z | 2022-03-03T20:55:47.000Z | rapid7vmconsole/models/resources_policy_override.py | kiblik/vm-console-client-python | 038f6d33e8b2654a558326c6eb87f09ee23e0e22 | [
"MIT"
] | 43 | 2018-02-24T05:45:53.000Z | 2022-03-31T22:15:16.000Z | # coding: utf-8
"""
Python InsightVM API Client
OpenAPI spec version: 3
Contact: support@rapid7.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ResourcesPolicyOverride(object):
"""NOTE: This class is auto generate... | 28.388889 | 86 | 0.578767 |
8c63c5eae509b42d89dc38e55e3f3387c44a3631 | 30,570 | py | Python | cookbook/deployment/cluster/auth_setup.py | scarf-sh/flytesnacks | d873d891869133ad60685fa205937448a2b7178e | [
"Apache-2.0"
] | 1 | 2021-08-20T17:28:42.000Z | 2021-08-20T17:28:42.000Z | cookbook/deployment/cluster/auth_setup.py | jeevb/flytesnacks | f32f32482088d717b399864c5470ae546ebcba7d | [
"Apache-2.0"
] | null | null | null | cookbook/deployment/cluster/auth_setup.py | jeevb/flytesnacks | f32f32482088d717b399864c5470ae546ebcba7d | [
"Apache-2.0"
] | null | null | null | """
Authentication in Flyte
-----------------------
Flyte ships with a canonical implementation of OpenIDConnect client and OAuth2 Server, integrating seamlessly into an organization's existing identity provider.
This section includes:
- :ref:`Overview <auth-overview>`
- :ref:`Authentication Setup <auth-setup>`
- :r... | 58.901734 | 1,298 | 0.770396 |
832ce2a6fdd9b1253e118982e0407dbebb7d9657 | 2,926 | py | Python | stellar_sdk/xdr/stellar_value_ext.py | MartinThoma/py-stellar-base | 07ab28cde7a7040f2262b224f9af8a3416c0e5ab | [
"Apache-2.0"
] | 1 | 2021-07-06T01:34:08.000Z | 2021-07-06T01:34:08.000Z | stellar_sdk/xdr/stellar_value_ext.py | MartinThoma/py-stellar-base | 07ab28cde7a7040f2262b224f9af8a3416c0e5ab | [
"Apache-2.0"
] | 36 | 2021-08-23T17:31:52.000Z | 2022-03-28T01:39:00.000Z | stellar_sdk/xdr/stellar_value_ext.py | MartinThoma/py-stellar-base | 07ab28cde7a7040f2262b224f9af8a3416c0e5ab | [
"Apache-2.0"
] | 1 | 2021-07-06T01:33:40.000Z | 2021-07-06T01:33:40.000Z | # This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from xdrlib import Packer, Unpacker
from .ledger_close_value_signature import LedgerCloseValueSignature
from .stellar_value_type import StellarValueType
from ..exceptions import ValueError
__all__ = ["StellarValu... | 33.25 | 88 | 0.619959 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.