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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b1b037006db3a060579d4c109cbdf688ca3beca1 | 12,930 | py | Python | tests/replication/slave/storage/test_events.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | 2 | 2020-04-30T18:38:02.000Z | 2020-07-08T21:38:28.000Z | tests/replication/slave/storage/test_events.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | null | null | null | tests/replication/slave/storage/test_events.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | 1 | 2020-01-27T23:33:39.000Z | 2020-01-27T23:33:39.000Z | # Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 35.424658 | 89 | 0.613998 |
cf4a1f58bc3f0a53992c6ff9033e1b6edee71fe6 | 219 | py | Python | Python 3 - Fundamentos/Desafio 31.py | Paimonz/Python-Estudos | bbc4d7abb2eebff7f160eac54a290fd9ea7a1cff | [
"MIT"
] | null | null | null | Python 3 - Fundamentos/Desafio 31.py | Paimonz/Python-Estudos | bbc4d7abb2eebff7f160eac54a290fd9ea7a1cff | [
"MIT"
] | null | null | null | Python 3 - Fundamentos/Desafio 31.py | Paimonz/Python-Estudos | bbc4d7abb2eebff7f160eac54a290fd9ea7a1cff | [
"MIT"
] | null | null | null | v = int(input ('\nQual a distância da viagem em KM?: '))
if v >= 200:
pv = 0.5 * v
print (f'O preço para essa viagem será de {pv}')
else:
pv = 0.45 * v
print (f'O preço para essa viagem será de R$:{pv}') | 31.285714 | 56 | 0.575342 |
81928363da052a13b9cf7bdde677113f1e551b82 | 3,172 | py | Python | hospital/models.py | djdays/hms | ef82611497c5503c37ea1077fd6c843e49eafe2b | [
"MIT"
] | null | null | null | hospital/models.py | djdays/hms | ef82611497c5503c37ea1077fd6c843e49eafe2b | [
"MIT"
] | null | null | null | hospital/models.py | djdays/hms | ef82611497c5503c37ea1077fd6c843e49eafe2b | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
departments=[('Cardiologist','Cardiologist'),
('Dermatologists','Dermatologists'),
('Emergency Medicine Specialists','Emergency Medicine Specialists'),
('Allergists/Immunologists','Allergists/Immunologists'),
('Anesthesiologists','Anes... | 38.216867 | 100 | 0.741803 |
a9940fda977d1746f3783ecb44b4a036f2869095 | 9,177 | py | Python | ophyd/utils/epics_pvs.py | mattclarke/ophyd | ffa67739f850f70f3bff9be9df30e9046f29534e | [
"BSD-3-Clause"
] | null | null | null | ophyd/utils/epics_pvs.py | mattclarke/ophyd | ffa67739f850f70f3bff9be9df30e9046f29534e | [
"BSD-3-Clause"
] | 4 | 2015-08-13T21:45:43.000Z | 2016-01-17T03:56:10.000Z | ophyd/utils/epics_pvs.py | mattclarke/ophyd | ffa67739f850f70f3bff9be9df30e9046f29534e | [
"BSD-3-Clause"
] | 1 | 2015-06-11T17:29:02.000Z | 2015-06-11T17:29:02.000Z | # vi: ts=4 sw=4 sts=4 expandtab
from enum import IntEnum
import time as ttime
import logging
import functools
import numpy as np
import typing
from .errors import DisconnectedError, OpException
__all__ = ['split_record_field',
'strip_field',
'record_field',
'set_and_wait',
... | 25.350829 | 79 | 0.564455 |
9edf3061caa64bc1a203c768065d2a06a1e95b49 | 1,378 | py | Python | setup.py | pfmoore/placeholder | d70e1d43a477f0864e8861bc300109eab7c0eb59 | [
"Apache-2.0"
] | null | null | null | setup.py | pfmoore/placeholder | d70e1d43a477f0864e8861bc300109eab7c0eb59 | [
"Apache-2.0"
] | null | null | null | setup.py | pfmoore/placeholder | d70e1d43a477f0864e8861bc300109eab7c0eb59 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, Extension
setup(
name='placeholder',
version='1.2',
description='Operator overloading for fast anonymous functions.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
author='Aric Coady',
author_email='aric.coady@gmail.c... | 39.371429 | 80 | 0.650218 |
661dcffdffc446ff9d233b32adde819453b213b1 | 1,762 | py | Python | config.py | philblower/jupyterlab_flask_sqlalchemy_pattern | 81c99d5a53a2b0abac8f28c71fab190b32ad5d78 | [
"MIT"
] | null | null | null | config.py | philblower/jupyterlab_flask_sqlalchemy_pattern | 81c99d5a53a2b0abac8f28c71fab190b32ad5d78 | [
"MIT"
] | null | null | null | config.py | philblower/jupyterlab_flask_sqlalchemy_pattern | 81c99d5a53a2b0abac8f28c71fab190b32ad5d78 | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
WTF_CSRF_ENABLED = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
# This allows the application to customize the configuration.
# Add appropriate code if want... | 30.912281 | 122 | 0.677639 |
6bfaf97bc788c4b6e14458bbd2ca8171fda987b8 | 271 | py | Python | Examples/AppKit/CurrencyConverter/setup.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | Examples/AppKit/CurrencyConverter/setup.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | Examples/AppKit/CurrencyConverter/setup.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | """
Script for building the example.
Usage:
python3 setup.py py2app
"""
from setuptools import setup
setup(
name="CurrencyConverter",
app=["CurrencyConverter.py"],
data_files=["English.lproj"],
setup_requires=["py2app", "pyobjc-framework-Cocoa"],
)
| 18.066667 | 56 | 0.690037 |
66a1ffc9987725f9cf49163122cb485d49bc2d81 | 29,110 | py | Python | gym_miniworld/miniworld.py | bdsaglam/gym-westworld | e588b7a394d1cb49ab5e24e806ebc8c136608492 | [
"Apache-2.0"
] | null | null | null | gym_miniworld/miniworld.py | bdsaglam/gym-westworld | e588b7a394d1cb49ab5e24e806ebc8c136608492 | [
"Apache-2.0"
] | null | null | null | gym_miniworld/miniworld.py | bdsaglam/gym-westworld | e588b7a394d1cb49ab5e24e806ebc8c136608492 | [
"Apache-2.0"
] | null | null | null | from enum import IntEnum
import gym
from gym import spaces
from gym_miniworld.entity import *
from gym_miniworld.math_utils import *
from gym_miniworld.params import *
from gym_miniworld.random_utils import *
from gym_miniworld.room import Room
class MiniWorldEnv(gym.Env):
"""
Base class for MiniWorld enviro... | 28.539216 | 90 | 0.555857 |
e0033de323bfbb6e11303c2e9b72b24a9a353a63 | 288 | py | Python | tests/urls.py | benjo456/django-admin-honeypot | 38eac724c42cd40ffd2628f1f74c5e30cf286dd6 | [
"MIT"
] | 758 | 2015-01-08T07:46:44.000Z | 2022-03-31T03:51:19.000Z | tests/urls.py | benjo456/django-admin-honeypot | 38eac724c42cd40ffd2628f1f74c5e30cf286dd6 | [
"MIT"
] | 61 | 2015-01-03T23:28:24.000Z | 2022-03-28T10:39:51.000Z | tests/urls.py | benjo456/django-admin-honeypot | 38eac724c42cd40ffd2628f1f74c5e30cf286dd6 | [
"MIT"
] | 132 | 2015-02-07T13:19:27.000Z | 2022-03-13T13:57:30.000Z | from django.conf.urls import include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
url(r'^secret/', admin.site.urls),
]
| 26.181818 | 80 | 0.729167 |
35f8dfd35be4a239dcb2463b469f2e065abcd63d | 1,428 | py | Python | API/API/urls.py | snguyen64/StuddyBuddy | c11a8daec3827847a1b350434e2ea62eaed78f7e | [
"MIT"
] | null | null | null | API/API/urls.py | snguyen64/StuddyBuddy | c11a8daec3827847a1b350434e2ea62eaed78f7e | [
"MIT"
] | null | null | null | API/API/urls.py | snguyen64/StuddyBuddy | c11a8daec3827847a1b350434e2ea62eaed78f7e | [
"MIT"
] | null | null | null | """API URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | 43.272727 | 101 | 0.657563 |
bac639bb199f95ee57da7d3b6bb7ae10802938f1 | 14,002 | py | Python | env/lib/python3.5/site-packages/sklearn/tests/test_random_projection.py | Udolf15/recommedMeMovies | be5ae74acd98e3f93beaaa5bb55623974fb24247 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | venv/lib/python3.7/site-packages/sklearn/tests/test_random_projection.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | venv/lib/python3.7/site-packages/sklearn/tests/test_random_projection.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 3 | 2019-06-13T07:10:54.000Z | 2020-09-11T06:01:40.000Z | from __future__ import division
import functools
import numpy as np
import scipy.sparse as sp
import pytest
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection ... | 39.111732 | 79 | 0.654121 |
2170fdf9ed9a2d095664f5b03d63a6cf9b3c9979 | 4,470 | py | Python | tests/test_builder.py | NCAR/ecg | 0f217ace1ac93532a5a6c5f3435db6074965dd65 | [
"Apache-2.0"
] | null | null | null | tests/test_builder.py | NCAR/ecg | 0f217ace1ac93532a5a6c5f3435db6074965dd65 | [
"Apache-2.0"
] | 2 | 2020-06-01T23:18:24.000Z | 2020-06-01T23:23:56.000Z | tests/test_builder.py | ncar-xdev/ecgtools | 007e9d11c4211d819c96797612395eacd7fb70b4 | [
"Apache-2.0"
] | 1 | 2020-06-02T04:15:17.000Z | 2020-06-02T04:15:17.000Z | import os
import pathlib
import intake
import pandas as pd
import pytest
from ecgtools import Builder, RootDirectory, glob_to_regex
from ecgtools.parsers.cesm import parse_cesm_history
sample_data_dir = pathlib.Path(os.path.dirname(__file__)).parent / 'sample_data'
@pytest.mark.parametrize(
'path, depth, stora... | 29.602649 | 97 | 0.591499 |
876d7e28ac8c8c6e8e08392f119b3c2b3a37333b | 617 | py | Python | packages/hagrid/hagrid/auth.py | vishalbelsare/PySyft | fb04404fcfbef82fad1fb47407b35a24e9afb599 | [
"Apache-1.1"
] | 8,428 | 2017-08-10T09:17:49.000Z | 2022-03-31T08:20:14.000Z | packages/hagrid/hagrid/auth.py | vishalbelsare/PySyft | fb04404fcfbef82fad1fb47407b35a24e9afb599 | [
"Apache-1.1"
] | 4,779 | 2017-08-09T23:19:00.000Z | 2022-03-29T11:49:36.000Z | packages/hagrid/hagrid/auth.py | vishalbelsare/PySyft | fb04404fcfbef82fad1fb47407b35a24e9afb599 | [
"Apache-1.1"
] | 2,307 | 2017-08-10T08:52:12.000Z | 2022-03-30T05:36:07.000Z | # stdlib
from typing import Optional
class AuthCredentials:
def __init__(
self,
username: str,
key_path: Optional[str] = None,
password: Optional[str] = None,
) -> None:
self.username = username
self.key_path = key_path
self.password = password
@pro... | 22.851852 | 56 | 0.622366 |
87f9a4ea2305750d53062608a0058d447379a174 | 7,473 | py | Python | python-trunk/sfapi2/sflib/ZSI/__init__.py | raychorn/svn_molten-magma | 8aa2ff2340707eecae6514943e86f5afba9cd54a | [
"CC0-1.0"
] | null | null | null | python-trunk/sfapi2/sflib/ZSI/__init__.py | raychorn/svn_molten-magma | 8aa2ff2340707eecae6514943e86f5afba9cd54a | [
"CC0-1.0"
] | null | null | null | python-trunk/sfapi2/sflib/ZSI/__init__.py | raychorn/svn_molten-magma | 8aa2ff2340707eecae6514943e86f5afba9cd54a | [
"CC0-1.0"
] | null | null | null | #! /usr/bin/env python
# $Header: /CVS/sfsrc/sfapi2/sflib/ZSI/__init__.py,v 1.1 2004/07/14 16:47:38 sfscript Exp $
'''ZSI: Zolera Soap Infrastructure.
Copyright 2001, Zolera Systems, Inc. All Rights Reserved.
'''
_copyright = """ZSI: Zolera Soap Infrastructure.
Copyright 2001, Zolera Systems, Inc. All R... | 32.920705 | 92 | 0.666399 |
bce43292baed8403343d093bef07d6f64fd67872 | 281 | py | Python | main.py | michaelscales88/irrigation-site | 847bfb5b874d3813b71ea2939fd83459a6a1f991 | [
"MIT"
] | null | null | null | main.py | michaelscales88/irrigation-site | 847bfb5b874d3813b71ea2939fd83459a6a1f991 | [
"MIT"
] | null | null | null | main.py | michaelscales88/irrigation-site | 847bfb5b874d3813b71ea2939fd83459a6a1f991 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
"""
Start the server by running:
python main.py 8080 development.cfg
"""
import sys
from server import create_server
port = sys.argv[1]
args = sys.argv[1:]
server = create_server(*args)
server.run(port=int(port))
| 21.615385 | 39 | 0.626335 |
c578ccfaeb23a6c00ec198cec15711117f9e1983 | 5,381 | py | Python | setup.py | lamhoangtung/dvc | 291eba153637eef0925677c729c5a1a3ca8804a9 | [
"Apache-2.0"
] | null | null | null | setup.py | lamhoangtung/dvc | 291eba153637eef0925677c729c5a1a3ca8804a9 | [
"Apache-2.0"
] | null | null | null | setup.py | lamhoangtung/dvc | 291eba153637eef0925677c729c5a1a3ca8804a9 | [
"Apache-2.0"
] | null | null | null | import importlib.util
import os
from pathlib import Path
from setuptools import find_packages, setup
from setuptools.command.build_py import build_py as _build_py
# Prevents pkg_resources import in entry point script,
# see https://github.com/ninjaaron/fast-entry_points.
# This saves about 200 ms on startup time for ... | 33.01227 | 79 | 0.642817 |
f9752dd2d7c4d11c21146838c03b4b641767ddd4 | 410 | py | Python | tests/urls.py | andytwoods/django-gitabix | c72867675364072d32be94d31c197430c1d46ae4 | [
"MIT"
] | null | null | null | tests/urls.py | andytwoods/django-gitabix | c72867675364072d32be94d31c197430c1d46ae4 | [
"MIT"
] | null | null | null | tests/urls.py | andytwoods/django-gitabix | c72867675364072d32be94d31c197430c1d46ae4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from django.contrib import admin
from django.urls import path
from django.views.generic import TemplateView
urlpatterns = [
path('admin/', admin.site.urls),
path('', TemplateView.as_view(... | 29.285714 | 75 | 0.734146 |
77ec0651a813832953f8129ca6d4e84343560f41 | 5,955 | py | Python | eggs/ZODB-4.1.0-py2.7.egg/ZODB/scripts/fsrefs.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | null | null | null | eggs/ZODB-4.1.0-py2.7.egg/ZODB/scripts/fsrefs.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | null | null | null | eggs/ZODB-4.1.0-py2.7.egg/ZODB/scripts/fsrefs.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this di... | 38.419355 | 78 | 0.664819 |
862c0703f58a1565e2a0e9b088df5afd35363f31 | 2,962 | py | Python | ouroboros/snake.py | RatJuggler/ouroboros | 99471f4e9513d21b6ade59c99f939022d0e855bd | [
"MIT"
] | null | null | null | ouroboros/snake.py | RatJuggler/ouroboros | 99471f4e9513d21b6ade59c99f939022d0e855bd | [
"MIT"
] | 2 | 2020-04-05T11:45:03.000Z | 2020-06-19T20:05:16.000Z | ouroboros/snake.py | RatJuggler/ouroboros | 99471f4e9513d21b6ade59c99f939022d0e855bd | [
"MIT"
] | null | null | null | import pygame
from typing import List, Optional
from ouroboros.cell import Cell, RIGHT
from ouroboros.display import Display
from ouroboros.sounds import Sounds
from ouroboros.sprite_images import SpriteImages
from ouroboros.utils import Point
class Head(Cell):
def __init__(self, display: Display, images: Spri... | 34.045977 | 115 | 0.674544 |
7b1ff4f41640e9a586e597c6d0ff18626a0dd82a | 1,233 | py | Python | tests/unit/havok_header_test.py | zephenryus/botw-havok | 9665555551ba0b5b864efb168da402c7f73ff365 | [
"MIT"
] | 1 | 2020-10-11T07:07:43.000Z | 2020-10-11T07:07:43.000Z | tests/unit/havok_header_test.py | zephenryus/botw-havok | 9665555551ba0b5b864efb168da402c7f73ff365 | [
"MIT"
] | null | null | null | tests/unit/havok_header_test.py | zephenryus/botw-havok | 9665555551ba0b5b864efb168da402c7f73ff365 | [
"MIT"
] | 1 | 2020-10-11T07:07:45.000Z | 2020-10-11T07:07:45.000Z | import unittest
import havok
class TestHavokHeader(unittest.TestCase):
def test_it_can_decompile_a_header(self):
""" @test it can decompile a header
Given the file G-6-2.hksc
When the file is passed to the Havok Header class
Then the header should contain the file signature, corre... | 37.363636 | 103 | 0.635036 |
81dd2b7c804bb60eb7d3d49b08bebcb731f3c130 | 915 | py | Python | test/test_constant_agent.py | CAVED123/Tensorforce | 823177f77f9047b1e71eccfffc08315ed1636878 | [
"Apache-2.0"
] | 1 | 2019-10-18T17:36:28.000Z | 2019-10-18T17:36:28.000Z | test/test_constant_agent.py | CAVED123/Tensorforce | 823177f77f9047b1e71eccfffc08315ed1636878 | [
"Apache-2.0"
] | null | null | null | test/test_constant_agent.py | CAVED123/Tensorforce | 823177f77f9047b1e71eccfffc08315ed1636878 | [
"Apache-2.0"
] | 1 | 2020-07-13T03:00:34.000Z | 2020-07-13T03:00:34.000Z | # Copyright 2018 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 33.888889 | 80 | 0.695082 |
a81a6e5e122804f6b0826931706c6d8a3a069869 | 3,263 | py | Python | twkit/visualization/tweetsperuser.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 5 | 2018-12-06T16:14:14.000Z | 2020-05-22T07:36:45.000Z | twkit/visualization/tweetsperuser.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | null | null | null | twkit/visualization/tweetsperuser.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 3 | 2020-04-20T07:20:18.000Z | 2021-08-19T17:31:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################
# (c) 2016-2020 Polyvios Pratikakis
# polyvios@ics.forth.gr
###########################################
'''
Tool for generating tweet distributions
Flag "--vectorized" works with uservectors only, subset of users, but faster
Oth... | 31.375 | 124 | 0.63224 |
3e36b25e169e7860b1dab4873cd6de78cc1f4471 | 484 | py | Python | plotly/validators/scatterternary/marker/colorbar/titlefont/_size.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/scatterternary/marker/colorbar/titlefont/_size.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/scatterternary/marker/colorbar/titlefont/_size.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='size',
parent_name='scatterternary.marker.colorbar.titlefont',
**kwargs
):
super(SizeValidator, self).__init__(
plotly_na... | 24.2 | 66 | 0.595041 |
f19845461f725a13ff2f4608436120e9dc301085 | 2,092 | py | Python | fpb/base/common.py | cloudmercato/python-fpb | 5da2773e3bb7068bfb9cde920c5b754eecdf342e | [
"BSD-3-Clause"
] | 3 | 2021-12-29T20:39:53.000Z | 2021-12-29T23:53:02.000Z | fpb/base/common.py | cloudspectatordevelopment/python-fpb | 5da2773e3bb7068bfb9cde920c5b754eecdf342e | [
"BSD-3-Clause"
] | null | null | null | fpb/base/common.py | cloudspectatordevelopment/python-fpb | 5da2773e3bb7068bfb9cde920c5b754eecdf342e | [
"BSD-3-Clause"
] | null | null | null | import sys
import time
import math
import random
import logging
logger = logging.getLogger('fpb.runner')
class TypeTooSmall(Exception):
pass
class Runner:
"""Base class for all runner."""
random = random
math = math
extra_data = {}
_dtype = None
TypeTooSmall = TypeTooSmall
def __i... | 22.73913 | 58 | 0.57935 |
53cb7bbdb6b9b3ebdc82991237df334f1034184d | 3,665 | py | Python | run_afferent_stimulation.py | FormentoEmanuele/BioS | 81219019ef47f1b6515791e8cdd4e0c1e2a81e3d | [
"MIT"
] | 1 | 2021-02-18T17:06:25.000Z | 2021-02-18T17:06:25.000Z | run_afferent_stimulation.py | FormentoEmanuele/BioS | 81219019ef47f1b6515791e8cdd4e0c1e2a81e3d | [
"MIT"
] | null | null | null | run_afferent_stimulation.py | FormentoEmanuele/BioS | 81219019ef47f1b6515791e8cdd4e0c1e2a81e3d | [
"MIT"
] | 1 | 2020-07-19T07:28:28.000Z | 2020-07-19T07:28:28.000Z | import argparse
from simulations.afferent_stimulation import AfferentStimulation
from simulations.parameters import StimParameters, FiberParameters, FIBERS_LENGTH_UM, PROPAGATION_DELAY_MS, \
FASCICLE_RADIUS_UM, MEAN_DIAMETER_UM, STD_DIAMETER
def main():
""" Main script running an AfferentStimulation simulatio... | 54.701493 | 120 | 0.718417 |
482b5921c1699087510a15dc01b315078c2fd70e | 2,061 | py | Python | miniad/tensor.py | basicv8vc/miniautodiff | 1ce038276df45760ab3cb7875b35b46d5ee0b27f | [
"MIT"
] | 1 | 2021-09-01T09:05:14.000Z | 2021-09-01T09:05:14.000Z | miniad/tensor.py | shaoyf9/miniautodiff | 1ce038276df45760ab3cb7875b35b46d5ee0b27f | [
"MIT"
] | null | null | null | miniad/tensor.py | shaoyf9/miniautodiff | 1ce038276df45760ab3cb7875b35b46d5ee0b27f | [
"MIT"
] | 1 | 2021-08-10T09:29:35.000Z | 2021-08-10T09:29:35.000Z | # encoding: utf-8
import numpy as np
import miniad.functional as F
class Tensor:
def __init__(self, data, children=None, grad_fn=None):
if isinstance(data, np.ndarray):
self.data = data
if isinstance(data, (list, tuple)):
self.data = np.array(data)
else:
... | 25.7625 | 116 | 0.558467 |
b7499b06c23802cc8a7671faa376cb928a221108 | 859 | py | Python | conu/apidefs/__init__.py | QuirianCordova/reto-ejercicio3 | 56d006fd2f5feeb6d88891cf4d2f90ba3bc60dd5 | [
"MIT"
] | null | null | null | conu/apidefs/__init__.py | QuirianCordova/reto-ejercicio3 | 56d006fd2f5feeb6d88891cf4d2f90ba3bc60dd5 | [
"MIT"
] | null | null | null | conu/apidefs/__init__.py | QuirianCordova/reto-ejercicio3 | 56d006fd2f5feeb6d88891cf4d2f90ba3bc60dd5 | [
"MIT"
] | 1 | 2019-11-14T20:27:38.000Z | 2019-11-14T20:27:38.000Z | # -*- coding: utf-8 -*-
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope th... | 40.904762 | 97 | 0.76135 |
cdb74d515efd5c4af0603718e8d4c1a59c3c5601 | 1,278 | py | Python | api/stress_test.py | stevenman42/architus | 86f0c065172e27ae02603d6ef4e7d4eedfb6dbe4 | [
"MIT"
] | null | null | null | api/stress_test.py | stevenman42/architus | 86f0c065172e27ae02603d6ef4e7d4eedfb6dbe4 | [
"MIT"
] | null | null | null | api/stress_test.py | stevenman42/architus | 86f0c065172e27ae02603d6ef4e7d4eedfb6dbe4 | [
"MIT"
] | null | null | null | from threading import Thread
from collections import Counter
import requests
from datetime import datetime
import time
results = []
def get(url):
global results
now = datetime.now()
r = requests.get(url)
results.append((r, (datetime.now() - now).total_seconds(), now))
if __name__ == '__main__':
... | 27.782609 | 87 | 0.611111 |
3a64e7e96526868e21ac7c3c3955e73a877e87c2 | 774 | py | Python | gquant/plugin_nodes/transform/sortNode.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | 2 | 2021-08-13T03:02:22.000Z | 2022-03-13T15:00:01.000Z | gquant/plugin_nodes/transform/sortNode.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | 3 | 2020-10-06T16:07:34.000Z | 2021-04-28T20:30:14.000Z | gquant/plugin_nodes/transform/sortNode.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | 1 | 2021-03-22T19:54:38.000Z | 2021-03-22T19:54:38.000Z | from gquant.dataframe_flow import Node
class SortNode(Node):
def process(self, inputs):
"""
Sort the input frames based on a list of columns, which are defined
in the `keys` of the node's conf
Arguments
-------
inputs: list
list of input dataframes.
... | 23.454545 | 75 | 0.578811 |
804e59e38a9e380d0c909d33251434ed181415eb | 2,799 | py | Python | Subscription/migrations/0001_initial.py | xzengCB/FreeFishMaster | 14418e108d1a25c56ff2e9801f4256f05f154c67 | [
"MIT"
] | null | null | null | Subscription/migrations/0001_initial.py | xzengCB/FreeFishMaster | 14418e108d1a25c56ff2e9801f4256f05f154c67 | [
"MIT"
] | null | null | null | Subscription/migrations/0001_initial.py | xzengCB/FreeFishMaster | 14418e108d1a25c56ff2e9801f4256f05f154c67 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-07-20 09:06
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | 40.565217 | 123 | 0.578778 |
32d457b9418eed87899e5525b4364777248329ef | 5,965 | py | Python | tests/data/azure/storage.py | ryohare/cartography | 3829a97289bc2b28d041e6d7860678e2375dcee1 | [
"Apache-2.0"
] | 2,322 | 2019-03-02T01:07:20.000Z | 2022-03-31T20:39:12.000Z | tests/data/azure/storage.py | ryohare/cartography | 3829a97289bc2b28d041e6d7860678e2375dcee1 | [
"Apache-2.0"
] | 462 | 2019-03-07T18:38:11.000Z | 2022-03-31T14:55:20.000Z | tests/data/azure/storage.py | ryohare/cartography | 3829a97289bc2b28d041e6d7860678e2375dcee1 | [
"Apache-2.0"
] | 246 | 2019-03-03T02:39:23.000Z | 2022-02-24T09:46:38.000Z | DESCRIBE_STORAGE_ACCOUNTS = [
{
"id": "/subscriptions/00-00-00-00/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/testSG1",
"kind": "Storage",
"location": "Central India",
"name": "testSG1",
"is_hns_enabled": True,
"creation_time": "2017-05-24T13:24:... | 31.394737 | 117 | 0.591282 |
732d7120366c2308ced81fe74b798a6b13114103 | 1,201 | py | Python | exercise_04/exercise_code/networks/optimizer.py | stanley-chang/I2DL | 78740460e1f52ce7643358fc548281f1bbe73a42 | [
"RSA-MD"
] | null | null | null | exercise_04/exercise_code/networks/optimizer.py | stanley-chang/I2DL | 78740460e1f52ce7643358fc548281f1bbe73a42 | [
"RSA-MD"
] | null | null | null | exercise_04/exercise_code/networks/optimizer.py | stanley-chang/I2DL | 78740460e1f52ce7643358fc548281f1bbe73a42 | [
"RSA-MD"
] | null | null | null | # Naive Optimizer using full batch gradient descent
import os
import pickle
import numpy as np
from exercise_code.networks.linear_model import *
class Optimizer(object):
def __init__ (self, model, learning_rate=5e-5):
self.model = model
self.lr = learning_rate
def step(self, dw)... | 42.892857 | 85 | 0.381349 |
62de31c9c809bccc6c280d2428c51549bf10789d | 492 | py | Python | ex03.py | Rajab322/lpthw | bde26ca21bd1c72807c93fff15a45a1154ba59d7 | [
"MIT"
] | 329 | 2017-02-25T15:06:58.000Z | 2022-03-31T18:22:21.000Z | ex3.py | dkorzhevin/learn-python3-thw-code | bea1e954d52ed845c3ade7ed87d7bef7de1651ad | [
"MIT"
] | 10 | 2017-02-26T13:55:38.000Z | 2020-02-20T06:10:26.000Z | ex3.py | dkorzhevin/learn-python3-thw-code | bea1e954d52ed845c3ade7ed87d7bef7de1651ad | [
"MIT"
] | 180 | 2017-02-25T20:42:03.000Z | 2022-02-09T05:21:40.000Z | print("I will now count my chickens:")
print("Hens", 25 + 30 / 6)
print("Roosters", 100 - 25 * 3 % 4)
print("Now I will count the eggs:")
print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
print("Is it true that 3 + 2 < 5 - 7?")
print(3 + 2 < 5 - 7)
print("What is 3 + 2?", 3 + 2)
print("What is 5 - 7?", 5 - 7)
print("Oh, ... | 18.923077 | 41 | 0.54878 |
5b5e55e1c88290786e6e42263383014bfa60d5e5 | 21,798 | py | Python | app/eval/dtree_parse.py | ForomePlatform/anfisa | c5bf9ad3200fc4e9cf7be21648b7ee5beb3eb35c | [
"Apache-2.0"
] | 8 | 2019-03-26T16:07:46.000Z | 2021-12-30T13:38:06.000Z | app/eval/dtree_parse.py | ForomePlatform/anfisa | c5bf9ad3200fc4e9cf7be21648b7ee5beb3eb35c | [
"Apache-2.0"
] | 13 | 2018-11-07T19:37:20.000Z | 2022-02-21T17:11:45.000Z | app/eval/dtree_parse.py | ForomePlatform/anfisa | c5bf9ad3200fc4e9cf7be21648b7ee5beb3eb35c | [
"Apache-2.0"
] | 15 | 2018-10-16T08:15:11.000Z | 2022-02-21T14:07:29.000Z | # Copyright (c) 2019. Partners HealthCare and other members of
# Forome Association
#
# Developed by Sergey Trifonov based on contributions by Joel Krier,
# Michael Bouzinier, Shamil Sunyaev and other members of Division of
# Genetics, Brigham and Women's Hospital
#
# Licensed under the Apache License, Version 2.... | 39.13465 | 79 | 0.516194 |
9b422f0496b1ba6d0a41e99ce5c5b57543c17a7b | 291 | py | Python | src/main.py | AnnekinMeyburgh/lol-spreadsheets | dff24b2d99c968228f1870788fc2bb69eb36a148 | [
"MIT"
] | null | null | null | src/main.py | AnnekinMeyburgh/lol-spreadsheets | dff24b2d99c968228f1870788fc2bb69eb36a148 | [
"MIT"
] | null | null | null | src/main.py | AnnekinMeyburgh/lol-spreadsheets | dff24b2d99c968228f1870788fc2bb69eb36a148 | [
"MIT"
] | null | null | null | from riot_api import setup_lol_watcher
from sheets import setup_service
from dotenv import load_dotenv
import server
def main():
load_dotenv()
lol_watcher = setup_lol_watcher()
service = setup_service()
server.run(lol_watcher, service)
if __name__ == '__main__':
main() | 22.384615 | 38 | 0.749141 |
4490425c3de5f6a7f4954b76bda0ea4925c891c6 | 3,568 | py | Python | neutron_lib/api/definitions/base.py | rubasov/neutron-lib | 8664953c5a17e8abf5c5a52832e63885108aa818 | [
"Apache-2.0"
] | null | null | null | neutron_lib/api/definitions/base.py | rubasov/neutron-lib | 8664953c5a17e8abf5c5a52832e63885108aa818 | [
"Apache-2.0"
] | null | null | null | neutron_lib/api/definitions/base.py | rubasov/neutron-lib | 8664953c5a17e8abf5c5a52832e63885108aa818 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 21.493976 | 79 | 0.621917 |
516769780da1ceb02aa6386d8e7a61f9b056bc52 | 2,561 | py | Python | Yone/Database/reporting_sql.py | Kavindupramudita/YoneRobot | 3e8ea471171b4552e373d28df85c1062cdaf1597 | [
"BSD-2-Clause"
] | 1 | 2022-03-04T07:47:45.000Z | 2022-03-04T07:47:45.000Z | Yone/Database/reporting_sql.py | Kavindupramudita/YoneRobot | 3e8ea471171b4552e373d28df85c1062cdaf1597 | [
"BSD-2-Clause"
] | 1 | 2022-02-04T13:27:52.000Z | 2022-02-04T13:27:52.000Z | Yone/Database/reporting_sql.py | Kavindupramudita/YoneRobot | 3e8ea471171b4552e373d28df85c1062cdaf1597 | [
"BSD-2-Clause"
] | 2 | 2022-03-04T16:58:21.000Z | 2022-03-09T09:38:55.000Z | import threading
from typing import Union
from Yone.Database import BASE, SESSION
from sqlalchemy import Boolean, Column, BigInteger, String
class ReportingUserSettings(BASE):
__tablename__ = "user_report_settings"
user_id = Column(BigInteger, primary_key=True)
should_report = Column(Boolean, default=Tru... | 28.455556 | 77 | 0.685279 |
8c0d21fff0e7309d4af59c35c4f20109e8d65a7d | 1,386 | py | Python | AntPathExample.py | BatteryWater/PythonDPAntExample | 37a129655fdfbfc40382b7a22545fe094f0f7c8a | [
"Unlicense"
] | null | null | null | AntPathExample.py | BatteryWater/PythonDPAntExample | 37a129655fdfbfc40382b7a22545fe094f0f7c8a | [
"Unlicense"
] | null | null | null | AntPathExample.py | BatteryWater/PythonDPAntExample | 37a129655fdfbfc40382b7a22545fe094f0f7c8a | [
"Unlicense"
] | null | null | null | '''
DP example for ant pathing problem
'''
def CalcDistance(maxX, maxY, x, y):
return abs(x/maxX - y/maxY)
def DictCombine(currentDict, otherDict, d):
for D, count in otherDict.items():
if D > d:
if D not in currentDict:
currentDict[D] = 0
currentDict[... | 28.875 | 61 | 0.510823 |
a80a6d2246a9c5bdba199f33415ec2ca6042107e | 4,478 | py | Python | tests/test_objmod.py | csningli/MultiAgent | cabfeab3ea8cf19559e06c354247f8f25739d6b1 | [
"Apache-2.0"
] | 1 | 2018-03-21T02:17:01.000Z | 2018-03-21T02:17:01.000Z | tests/test_objmod.py | csningli/MultiAgent | cabfeab3ea8cf19559e06c354247f8f25739d6b1 | [
"Apache-2.0"
] | null | null | null | tests/test_objmod.py | csningli/MultiAgent | cabfeab3ea8cf19559e06c354247f8f25739d6b1 | [
"Apache-2.0"
] | null | null | null |
# MultiAgent 2.0
# (c) 2017-2018, NiL, csningli@gmail.com
import sys, os, time
import doctest
sys.path.append("..")
from mas.multiagent import *
def test_objmod_basic() :
'''
>>> test_objmod_basic()
Initialization.
ObjectModule: <<multiagent.ObjectModule memory_size=0>>
'''
print("Initializ... | 38.93913 | 137 | 0.590889 |
7c9cb9aaa2dd68bf8de1beb80bfdf271f6ee789d | 2,621 | py | Python | clburlison_scripts/reset_location_services/reset_location_services.py | hackerman518/scripts | f1a234b1d12996ee278a1a3030e57df974758054 | [
"MIT"
] | null | null | null | clburlison_scripts/reset_location_services/reset_location_services.py | hackerman518/scripts | f1a234b1d12996ee278a1a3030e57df974758054 | [
"MIT"
] | null | null | null | clburlison_scripts/reset_location_services/reset_location_services.py | hackerman518/scripts | f1a234b1d12996ee278a1a3030e57df974758054 | [
"MIT"
] | 1 | 2019-09-09T17:46:37.000Z | 2019-09-09T17:46:37.000Z | #!/usr/bin/python
"""Reset location services to factory settings."""
import os
import platform
import subprocess
from distutils.version import LooseVersion
def root_check():
"""Check for root access."""
if not os.geteuid() == 0:
exit("This must be run with root access.")
def os_vers():
"""Retr... | 31.202381 | 79 | 0.5971 |
64eadaf51d0170225b6948faeab2a46b60d39217 | 3,280 | py | Python | tfx/dsl/component/experimental/executor_specs.py | nikelite/tfx | 76ca6d65868058f9e9b144a8a16ed88213d28d99 | [
"Apache-2.0"
] | null | null | null | tfx/dsl/component/experimental/executor_specs.py | nikelite/tfx | 76ca6d65868058f9e9b144a8a16ed88213d28d99 | [
"Apache-2.0"
] | null | null | null | tfx/dsl/component/experimental/executor_specs.py | nikelite/tfx | 76ca6d65868058f9e9b144a8a16ed88213d28d99 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2020 Google LLC. 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 req... | 35.652174 | 80 | 0.733537 |
4c5b1261d0029474f061a9551350134e4a70e62c | 10,696 | py | Python | qa/eth_refund_moderated.py | rodkeys/openbazaar-go | 57340cdef95d5c07403aabe4d7d31ac3ec3b3562 | [
"MIT"
] | null | null | null | qa/eth_refund_moderated.py | rodkeys/openbazaar-go | 57340cdef95d5c07403aabe4d7d31ac3ec3b3562 | [
"MIT"
] | null | null | null | qa/eth_refund_moderated.py | rodkeys/openbazaar-go | 57340cdef95d5c07403aabe4d7d31ac3ec3b3562 | [
"MIT"
] | null | null | null | import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class EthRefundModeratedTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
def run_test(self):
... | 47.537778 | 113 | 0.629768 |
fb0bb25765080e6cff2d5d4de6f164ba9bbaae3e | 4,827 | py | Python | fashionmnist/sample.py | liuyangdh/multimodal-vae-public | ba5941d010b0164094f5818b93baad9df546494e | [
"MIT"
] | 98 | 2018-05-28T17:07:36.000Z | 2022-03-16T03:54:11.000Z | fashionmnist/sample.py | jannik-w/multimodal-vae-public | 2a358eb3593e9942e0846eb0095519acef462fa6 | [
"MIT"
] | 4 | 2019-04-15T00:40:21.000Z | 2020-03-04T06:24:56.000Z | fashionmnist/sample.py | jannik-w/multimodal-vae-public | 2a358eb3593e9942e0846eb0095519acef462fa6 | [
"MIT"
] | 36 | 2018-08-07T05:02:03.000Z | 2022-03-28T05:21:42.000Z | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import sys
import numpy as np
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import transforms
from torchvision.utils import save_image
from train import loa... | 38.616 | 82 | 0.649679 |
454c4644cc05a773de4de9d231ae56786bc51b3f | 1,930 | py | Python | density_funcs.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | density_funcs.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | density_funcs.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from astropy import units as u
def rho_baryon(r,z,th,q):
A = 0.04*u.solMass/(u.parsec**3)
hr = 3000.0*u.parsec
R0 = 8200.0*u.parsec
hz = 400.0*u.parsec
return A*np.exp(-1*(r - R0)/hr)*np.exp(-1*np.abs(z)/hz)
def rho_mirrordisk(r,z,th,q): #dark version of the baryonic disk
#u... | 32.166667 | 111 | 0.568912 |
c25bc629b2b30263bb09fadb5d61bab121524e61 | 1,091 | py | Python | max2/inference_player.py | thexa4/Spades | 1b6c5003d5bec13421418e1e563db435fac18286 | [
"MIT"
] | 1 | 2018-01-27T16:45:51.000Z | 2018-01-27T16:45:51.000Z | max2/inference_player.py | thexa4/Spades | 1b6c5003d5bec13421418e1e563db435fac18286 | [
"MIT"
] | null | null | null | max2/inference_player.py | thexa4/Spades | 1b6c5003d5bec13421418e1e563db435fac18286 | [
"MIT"
] | 1 | 2018-01-27T16:45:56.000Z | 2018-01-27T16:45:56.000Z | from i_player import IPlayer
from max2.gamestate import GameState
class InferencePlayer(IPlayer):
""""Constitutes the very bare necessity to be called a player"""
def __init__(self, model):
self.state = None
self.round = 0
self.score = None
self.model = model
self.samples = ([[] for i in range(70)], [[] f... | 25.372093 | 66 | 0.718607 |
f651acccb50b59dcac0694cbedb50515ae648210 | 475 | py | Python | src/march_madness/settings.py | mattrwyrick/March-Madness-Predictor | be45a91c5206f902c8ddcbc7b90d768e63427614 | [
"Apache-2.0"
] | 1 | 2022-03-17T07:10:10.000Z | 2022-03-17T07:10:10.000Z | src/march_madness/settings.py | mattrwyrick/March-Madness-Predictor | be45a91c5206f902c8ddcbc7b90d768e63427614 | [
"Apache-2.0"
] | null | null | null | src/march_madness/settings.py | mattrwyrick/March-Madness-Predictor | be45a91c5206f902c8ddcbc7b90d768e63427614 | [
"Apache-2.0"
] | null | null | null | import os
from pathlib import Path
PROJ_DIR = os.path.dirname(os.path.realpath(__file__))
ROOT_DIR = Path(Path(PROJ_DIR).parent).parent
DATA_DIR = os.path.join(ROOT_DIR, "data")
BRACKET_DIR = os.path.join(DATA_DIR, "brackets")
CONFERENCE_WITH_TEAM_DIR = os.path.join(DATA_DIR, "conferences")
CONFERENCE_OVERALL_DIR = ... | 27.941176 | 64 | 0.766316 |
dbd15d2088c6746a35fecd23acfd8614e3ef2541 | 386 | py | Python | python/qitest/test/projects/testme/test/test_bar.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 51 | 2015-01-05T14:35:13.000Z | 2021-07-27T06:46:59.000Z | python/qitest/test/projects/testme/test/test_bar.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 104 | 2015-04-09T10:48:42.000Z | 2020-09-16T16:33:29.000Z | python/qitest/test/projects/testme/test/test_bar.py | aldebaran/qibuild | efea6fa3744664348717fe5e8df708a3cf392072 | [
"BSD-3-Clause"
] | 46 | 2015-01-05T14:35:16.000Z | 2022-02-13T20:39:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test Bar """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import prin... | 27.571429 | 84 | 0.725389 |
0781d4e1b47037e6e5b44c1eadd8e0c4fdc1d61d | 9,582 | py | Python | smnsdkcore/client.py | xunmeibuyue/IntelligentPeephole | c3bebf8792f019c859539607846971f33fee7cc2 | [
"Apache-2.0"
] | null | null | null | smnsdkcore/client.py | xunmeibuyue/IntelligentPeephole | c3bebf8792f019c859539607846971f33fee7cc2 | [
"Apache-2.0"
] | null | null | null | smnsdkcore/client.py | xunmeibuyue/IntelligentPeephole | c3bebf8792f019c859539607846971f33fee7cc2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright (C) 2017. Huawei Technologies Co., LTD. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Apache License, Version 2.0.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without e... | 35.753731 | 142 | 0.596118 |
b495159a29383c02a6ed562f7770144790a32830 | 6,655 | py | Python | main.py | wtyuan96/PSMNet | 974750530d243e5fbf8ed9974b86c255707e51c9 | [
"MIT"
] | null | null | null | main.py | wtyuan96/PSMNet | 974750530d243e5fbf8ed9974b86c255707e51c9 | [
"MIT"
] | null | null | null | main.py | wtyuan96/PSMNet | 974750530d243e5fbf8ed9974b86c255707e51c9 | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
import time
import math
from dataloader import listflowfile as lt
from dataloader import Sec... | 34.481865 | 235 | 0.602855 |
106e24a874c6a62328dea2694bce22fd57cf4947 | 4,752 | py | Python | mcts_pure.py | moddent/Gomoku_Deep | 5d9bca97e6b30db4f99a4686152bcef7a6160ac6 | [
"MIT"
] | null | null | null | mcts_pure.py | moddent/Gomoku_Deep | 5d9bca97e6b30db4f99a4686152bcef7a6160ac6 | [
"MIT"
] | null | null | null | mcts_pure.py | moddent/Gomoku_Deep | 5d9bca97e6b30db4f99a4686152bcef7a6160ac6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
A pure implementation of the Monte Carlo Tree Search (MCTS)
@author: Junxiao Song
"""
import numpy as np
import copy
from operator import itemgetter
from tree import TreeNode
def rollout_policy_fn(board):
"""a coarse, fast version of policy_fn used in the rollout phase."""
# roll... | 33.942857 | 83 | 0.617214 |
80cdabdc294bec6cbc008910a29629502c9a4e2f | 7,051 | py | Python | digitalComponent/dice.py | GLHolmstroff/digitalComponent | 974aa13eae70aa96fb12d8c9724a30d3d7d1236e | [
"Apache-2.0"
] | 1 | 2020-01-16T12:19:00.000Z | 2020-01-16T12:19:00.000Z | digitalComponent/dice.py | uev52/digitalComponent | 974aa13eae70aa96fb12d8c9724a30d3d7d1236e | [
"Apache-2.0"
] | null | null | null | digitalComponent/dice.py | uev52/digitalComponent | 974aa13eae70aa96fb12d8c9724a30d3d7d1236e | [
"Apache-2.0"
] | 1 | 2019-03-29T12:56:57.000Z | 2019-03-29T12:56:57.000Z | from items import*
import random
class dice(clickable):
def __init__(self,x,y,w,h,name, val ,backgroundColor = color(255)):
super(dice, self).__init__(x,y,w,h,name,backgroundColor = backgroundColor)
self.val=val
def display(self):
fill(255)
if self.val == 1:
... | 34.563725 | 92 | 0.527585 |
f975b7c167451e42b28d50ff52d0dcd07215985e | 682 | py | Python | _config_example.py | wastedsummer/weedlings | 7f27f08455fd7e40587a38a03694bda171e2d360 | [
"MIT"
] | null | null | null | _config_example.py | wastedsummer/weedlings | 7f27f08455fd7e40587a38a03694bda171e2d360 | [
"MIT"
] | null | null | null | _config_example.py | wastedsummer/weedlings | 7f27f08455fd7e40587a38a03694bda171e2d360 | [
"MIT"
] | null | null | null | """
This is template on how to configurate your setup for the weedlings model.
You may create a copy of this script and name it "_conf.py" so it will be not be tracked by the ".gitignore"
and is stored only locally.
The "_conf.py" than can be used in other scripts.
"""
PATH = "/home/yourname/projects/weedlings/" # ove... | 56.833333 | 108 | 0.750733 |
9afe6bb6d6d927862b2bab5cf66a17a6b029c98b | 15,125 | py | Python | addons/blender.NodeOSC/server/_base.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 2 | 2021-12-21T16:38:58.000Z | 2022-01-08T00:56:35.000Z | addons/blender.NodeOSC/server/_base.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 1 | 2022-01-29T05:46:50.000Z | 2022-01-29T05:46:50.000Z | addons/blender.NodeOSC/server/_base.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 1 | 2021-11-07T19:41:34.000Z | 2021-11-07T19:41:34.000Z | import bpy
import types
import sys
from select import select
import socket
import errno
import mathutils
import traceback
from math import radians
from bpy.props import *
from ast import literal_eval as make_tuple
from .callbacks import *
from ..nodes.nodes import *
def make_osc_messages(myOscKeys, myOscMsg):
env... | 46.826625 | 165 | 0.492496 |
c62f577f56ac303db1d6295a6c9a2b137dbd95b3 | 256 | py | Python | 0x04-python-more_data_structures/10-best_score.py | JRodriguez9510/holbertonschool-higher_level_programming-2 | 50e788cc0b03de308ed9bc90007dd19edb2efed5 | [
"MIT"
] | 1 | 2021-01-27T03:13:32.000Z | 2021-01-27T03:13:32.000Z | 0x04-python-more_data_structures/10-best_score.py | JRodriguez9510/holbertonschool-higher_level_programming-2 | 50e788cc0b03de308ed9bc90007dd19edb2efed5 | [
"MIT"
] | null | null | null | 0x04-python-more_data_structures/10-best_score.py | JRodriguez9510/holbertonschool-higher_level_programming-2 | 50e788cc0b03de308ed9bc90007dd19edb2efed5 | [
"MIT"
] | 2 | 2021-01-09T04:45:30.000Z | 2021-07-13T04:23:47.000Z | #!/usr/bin/python3
def best_score(a_dictionary):
if a_dictionary is None:
return None
maxval = 0
maxkey = None
for k, v in a_dictionary.items():
if v > maxval:
maxval = v
maxkey = k
return maxkey
| 21.333333 | 37 | 0.5625 |
1b1153c04a89d5443e4881c56376dd42a3a8bad7 | 2,508 | py | Python | builder/builder.py | napnac/napnac.fr | 2df4e2428c7a6be9e5a4f0a3cae7d89e78f8a368 | [
"MIT"
] | 1 | 2017-10-18T17:19:31.000Z | 2017-10-18T17:19:31.000Z | builder/builder.py | napnac/napnac.fr | 2df4e2428c7a6be9e5a4f0a3cae7d89e78f8a368 | [
"MIT"
] | 1 | 2015-10-14T16:20:19.000Z | 2015-10-14T16:21:53.000Z | builder/builder.py | napnac/napnac.fr | 2df4e2428c7a6be9e5a4f0a3cae7d89e78f8a368 | [
"MIT"
] | 1 | 2015-10-12T18:00:46.000Z | 2015-10-12T18:00:46.000Z | import logging
import os
import traceback
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import List
import jinja2
from page import Page
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader("templates"))
# To get rid of useless empty lines in the html output
jinj... | 31.746835 | 86 | 0.615231 |
eadf694985761f79a5d7e3599c7209ab1bc09e31 | 773 | py | Python | notebooks/tutorial.py | webteckie/iJupyterNotebooks | 028351ad525d22f48a9795e8cca48a7b8a9d4bc3 | [
"MIT"
] | 1 | 2020-08-24T13:37:04.000Z | 2020-08-24T13:37:04.000Z | notebooks/tutorial.py | webteckie/iJupyterNotebooks | 028351ad525d22f48a9795e8cca48a7b8a9d4bc3 | [
"MIT"
] | null | null | null | notebooks/tutorial.py | webteckie/iJupyterNotebooks | 028351ad525d22f48a9795e8cca48a7b8a9d4bc3 | [
"MIT"
] | null | null | null | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
from datetime import datetime
print ("Today is:" + str(datetime.now()))
# %%
def say_hello(recipient):
return 'Hi, {}!'.format(recipient)
say_hello('Curious') + " Welcome to the Jupyter Notebooks tutorial!"
# %%
import nu... | 17.976744 | 68 | 0.653299 |
90851723b29fc9a099f7684981690e3e90cef938 | 2,167 | py | Python | cliprt/tests/destination_worksheet_test.py | mhodgesatuh/cliprt | 1410f54bdab0cf3d3f418b059b5a298a401926c1 | [
"Apache-2.0"
] | 1 | 2021-08-29T02:15:22.000Z | 2021-08-29T02:15:22.000Z | cliprt/tests/destination_worksheet_test.py | mhodgesatuh/cliprt | 1410f54bdab0cf3d3f418b059b5a298a401926c1 | [
"Apache-2.0"
] | null | null | null | cliprt/tests/destination_worksheet_test.py | mhodgesatuh/cliprt | 1410f54bdab0cf3d3f418b059b5a298a401926c1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Project: CLIPRT - Client Information Parsing and Reporting Tool.
@author: mhodges
Copyright 2021 Michael Hodges
"""
from cliprt.classes.client_information_workbook import ClientInformationWorkbook
from cliprt.classes.cliprt_settings import CliprtSettings
from cliprt.classes.destination... | 35.52459 | 86 | 0.669589 |
d134e3c3b04dfc11ba186cad71e0cdb835b283e8 | 35,515 | py | Python | Lib/test/test_importlib/test_util.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 3 | 2019-04-23T11:06:38.000Z | 2021-03-03T12:17:16.000Z | Lib/test/test_importlib/test_util.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 4 | 2020-04-02T14:59:42.000Z | 2021-02-10T14:30:18.000Z | Lib/test/test_importlib/test_util.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 2 | 2018-05-03T01:08:13.000Z | 2019-12-02T03:03:43.000Z | from . import util
abc = util.import_importlib('importlib.abc')
init = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
importlib_util = util.import_importlib('importlib.util')
import contextlib
import importlib.util
import os
import pathlib
import string
import sys
from tes... | 40.129944 | 88 | 0.631142 |
018defa379602aebfbeae9db33d09c124b968d4c | 481 | py | Python | hooks/post_gen_project.py | e-k-m/cookiecutter-python-package | a9ff33084177ed14785b0b961c0ebe4825059d26 | [
"MIT"
] | 1 | 2021-01-23T22:07:53.000Z | 2021-01-23T22:07:53.000Z | hooks/post_gen_project.py | e-k-m/cookiecutter-python-package | a9ff33084177ed14785b0b961c0ebe4825059d26 | [
"MIT"
] | null | null | null | hooks/post_gen_project.py | e-k-m/cookiecutter-python-package | a9ff33084177ed14785b0b961c0ebe4825059d26 | [
"MIT"
] | null | null | null | import os
import shutil
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove(path):
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(os.path.join(PROJECT_DIRECTORY, path))
if __name__ == "__main__":
if "y" not in "{{ cookiecutter.command_line_interface|lower }}":
... | 24.05 | 73 | 0.650728 |
e42fc49ae6a48d153c3224ccafd1ccc1fbbce8f1 | 5,429 | py | Python | tests/parts/test_story.py | revvsales/python-docx-1 | 5b3ff2b828cc30f1567cb1682a8cb399143732d7 | [
"MIT"
] | 3,031 | 2015-01-02T11:11:24.000Z | 2022-03-30T00:57:17.000Z | tests/parts/test_story.py | revvsales/python-docx-1 | 5b3ff2b828cc30f1567cb1682a8cb399143732d7 | [
"MIT"
] | 934 | 2015-01-06T20:53:56.000Z | 2022-03-28T10:08:03.000Z | tests/parts/test_story.py | revvsales/python-docx-1 | 5b3ff2b828cc30f1567cb1682a8cb399143732d7 | [
"MIT"
] | 901 | 2015-01-07T18:22:07.000Z | 2022-03-31T18:38:51.000Z | # encoding: utf-8
"""Unit test suite for the docx.parts.story module"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
from docx.enum.style import WD_STYLE_TYPE
from docx.image.image import Image
from docx.opc.constants import RELATIONSHIP_TYPE as RT
from docx.packa... | 35.717105 | 87 | 0.678394 |
d5e15f12b6ea6a4a73ffdd64e1a92bac8acf3bf0 | 8,048 | py | Python | sdk/storage/azure-storage-blob/tests/test_blob_samples_common_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-blob/tests/test_blob_samples_common_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | 1 | 2020-03-06T05:57:16.000Z | 2020-03-06T05:57:16.000Z | sdk/storage/azure-storage-blob/tests/test_blob_samples_common_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | 37.432558 | 111 | 0.682654 |
7f56dd6875391442da339265a0137ffa5b25d027 | 14,214 | py | Python | AlphaZero/game.py | aipromote/reinforcement-learning-master | 0d2fe7be5b50d12fd212483f9c71a1b846d02c49 | [
"MIT"
] | null | null | null | AlphaZero/game.py | aipromote/reinforcement-learning-master | 0d2fe7be5b50d12fd212483f9c71a1b846d02c49 | [
"MIT"
] | null | null | null | AlphaZero/game.py | aipromote/reinforcement-learning-master | 0d2fe7be5b50d12fd212483f9c71a1b846d02c49 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import pygame
from pygame.locals import *
# windows font location
FONT_PATH = 'C:/Windows/Fonts/simkai.ttf'
class Board(object):
'''
Board game logic control
'''
def __init__(self, **kwargs):
self.width = int(kwargs.get('width... | 36.634021 | 208 | 0.535247 |
63122e859fa8b171327b0b59ef115367628491dc | 6,557 | py | Python | python/ray/tune/tests/test_tune_save_restore.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 3 | 2020-12-03T17:48:45.000Z | 2022-01-22T08:09:46.000Z | python/ray/tune/tests/test_tune_save_restore.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 72 | 2021-02-06T08:07:16.000Z | 2022-03-26T07:17:49.000Z | python/ray/tune/tests/test_tune_save_restore.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 2 | 2020-05-22T15:36:27.000Z | 2020-05-22T15:52:03.000Z | # coding: utf-8
import os
import pickle
import shutil
import tempfile
import unittest
import ray
from ray import tune
from ray.rllib import _register_all
from ray.tune import Trainable
from ray.tune.utils import validate_save_restore
class SerialTuneRelativeLocalDirTest(unittest.TestCase):
local_mode = True
... | 35.830601 | 79 | 0.635504 |
42b982662a9f31ecadaec9453c458f4844d0a4d5 | 10,944 | py | Python | modules/8.Cal_gdp_benefit_ctry_Dell.py | YixuanZheng/Aerosol_Inequality_2019 | 029b198311f192dbb98b96053ce0fbc55a3ab392 | [
"MIT"
] | 3 | 2020-02-19T12:27:38.000Z | 2020-03-11T12:19:47.000Z | modules/8.Cal_gdp_benefit_ctry_Dell.py | YixuanZheng/Aerosol_Inequality_2019 | 029b198311f192dbb98b96053ce0fbc55a3ab392 | [
"MIT"
] | null | null | null | modules/8.Cal_gdp_benefit_ctry_Dell.py | YixuanZheng/Aerosol_Inequality_2019 | 029b198311f192dbb98b96053ce0fbc55a3ab392 | [
"MIT"
] | 2 | 2020-04-19T22:19:10.000Z | 2021-03-04T15:04:28.000Z | # -*- coding: utf-8 -*-
'''
This code calculates impacts of temperature changes induced by aerosols on GDP
apply the Dell et al. damage function
distribution of Dell et al. parameter was sampled (1000 times) based on the provided median and standard error
by Yixuan Zheng (yxzheng@carnegiescience.edu)
'''
from n... | 41.142857 | 479 | 0.734192 |
7aec7c228e6fcaa0f832153274461daa2042b997 | 11,934 | py | Python | mtp_noms_ops/apps/security/views/check.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | mtp_noms_ops/apps/security/views/check.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | mtp_noms_ops/apps/security/views/check.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | from typing import Optional
from django.contrib import messages
from django.http import Http404, HttpResponseRedirect
from django.urls import reverse, reverse_lazy
from django.utils.translation import gettext_lazy
from django.views.generic.edit import BaseFormView, FormView
from mtp_common.api import retrieve_all_page... | 36.273556 | 119 | 0.634825 |
3e6ad627ed290f32e2d0953d244b98945050f5d9 | 693 | py | Python | afm/flight/auth_handlers.py | shlomitk1/arrow-flight-module | 81377d448af4abfac4038dfd256534c56a7422f9 | [
"Apache-2.0"
] | 4 | 2020-11-08T04:39:07.000Z | 2021-05-12T20:44:44.000Z | afm/flight/auth_handlers.py | shlomitk1/arrow-flight-module | 81377d448af4abfac4038dfd256534c56a7422f9 | [
"Apache-2.0"
] | 23 | 2021-09-14T10:09:38.000Z | 2022-03-31T09:56:12.000Z | afm/flight/auth_handlers.py | shlomitk1/arrow-flight-module | 81377d448af4abfac4038dfd256534c56a7422f9 | [
"Apache-2.0"
] | 6 | 2021-08-02T07:38:49.000Z | 2022-03-09T11:56:33.000Z | #
# Copyright 2020 IBM Corp.
# SPDX-License-Identifier: Apache-2.0
#
from pyarrow import flight
# taken from https://github.com/apache/arrow/blob/master/python/pyarrow/tests/test_flight.py#L450
class HttpBasicClientAuthHandler(flight.ClientAuthHandler):
"""An example implementation of HTTP basic authentication.""... | 28.875 | 97 | 0.701299 |
f384b67d59e186e9423247eeef4b1b87bf214186 | 35,651 | py | Python | desktop/libs/hadoop/gen-py/hadoop/api/hdfs/ttypes.py | digideskio/hortonworks-sandbox | dd8e95c91faee3daa094707baeb94c3953b41efa | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/libs/hadoop/gen-py/hadoop/api/hdfs/ttypes.py | digideskio/hortonworks-sandbox | dd8e95c91faee3daa094707baeb94c3953b41efa | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/libs/hadoop/gen-py/hadoop/api/hdfs/ttypes.py | hortonworks/hortonworks-sandbox | dd8e95c91faee3daa094707baeb94c3953b41efa | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | #
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
import hadoop.api.common.ttypes
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
... | 32.617566 | 192 | 0.636448 |
be0832b301fa9d4bb3e4afc2693b711e4cad10f1 | 6,620 | py | Python | venv/share/pyshared/pyx/dvi/tfmfile.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/share/pyshared/pyx/dvi/tfmfile.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/share/pyshared/pyx/dvi/tfmfile.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
#
#
# Copyright (C) 2007-2011 Jörg Lehmann <joergl@users.sourceforge.net>
# Copyright (C) 2007-2011 André Wobst <wobsta@users.sourceforge.net>
#
# This file is part of PyX (http://pyx.sourceforge.net/).
#
# PyX is free software; you can redistribute it and/or modify
# it under the terms of the... | 31.079812 | 80 | 0.550302 |
87821f0341bd64940ede1f02184eb2f9b6e99b08 | 3,645 | py | Python | site_scons/site_tools/auto_install_binaries.py | GeertBosch/mongo | 884d232473dca72e0872f0e540d4c3108c1e0b3d | [
"Apache-2.0"
] | 1 | 2018-03-07T22:12:35.000Z | 2018-03-07T22:12:35.000Z | site_scons/site_tools/auto_install_binaries.py | GeertBosch/mongo | 884d232473dca72e0872f0e540d4c3108c1e0b3d | [
"Apache-2.0"
] | 4 | 2019-02-22T10:05:59.000Z | 2021-03-26T00:20:23.000Z | site_scons/site_tools/auto_install_binaries.py | GeertBosch/mongo | 884d232473dca72e0872f0e540d4c3108c1e0b3d | [
"Apache-2.0"
] | 10 | 2018-11-29T07:17:30.000Z | 2022-03-07T01:33:41.000Z | import SCons
def exists(env):
return True
def generate(env):
env.Tool('install')
suffix_map = {
env.subst('$PROGSUFFIX') : 'bin',
'.dylib' : 'lib',
'.so' : 'lib',
}
def auto_install(env, target, source, **kwargs):
prefixDir = env.Dir('$INSTALL_DIR')
acti... | 36.45 | 107 | 0.611797 |
558e8d15dabb273639912ccb592f3299fb92f89d | 168 | py | Python | todoist_oauth2/urls.py | travisjungroth/todoer | af5cae5b63db685086d2237a6ffa4be704de3f08 | [
"MIT"
] | 2 | 2020-11-18T21:20:58.000Z | 2020-11-19T14:40:25.000Z | todoist_oauth2/urls.py | travisjungroth/todoer | af5cae5b63db685086d2237a6ffa4be704de3f08 | [
"MIT"
] | 6 | 2021-02-26T21:48:17.000Z | 2022-02-26T15:32:47.000Z | todoist_oauth2/urls.py | travisjungroth/todoer | af5cae5b63db685086d2237a6ffa4be704de3f08 | [
"MIT"
] | null | null | null | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import TodoistProvider
urlpatterns = default_urlpatterns(TodoistProvider)
| 24 | 75 | 0.869048 |
095fb2696eb5705c6090ae50d5ccbd7c25954256 | 1,275 | py | Python | src/langumo/parsers/jsonstring.py | fossabot/langumo | 2d8b30979878bb27fb07cc31879c13c5c186582c | [
"Apache-2.0"
] | null | null | null | src/langumo/parsers/jsonstring.py | fossabot/langumo | 2d8b30979878bb27fb07cc31879c13c5c186582c | [
"Apache-2.0"
] | null | null | null | src/langumo/parsers/jsonstring.py | fossabot/langumo | 2d8b30979878bb27fb07cc31879c13c5c186582c | [
"Apache-2.0"
] | null | null | null | import re
import json
from langumo.building import Parser
from langumo.utils import AuxiliaryFile
from typing import Iterable
class EscapedJSONStringParser(Parser):
single_quotes_pattern = re.compile('[\x60\xb4\u2018\u2019]')
double_quotes_pattern = re.compile('[\u201c\u201d]')
def extract(self, raw: Aux... | 29.651163 | 76 | 0.556078 |
be93f88f07e46567573384b03414bb4f1353de8a | 2,448 | py | Python | models/memnet.py | Subrata-Chattopadhyay/memnet | bb382ce0cc3d0a4af29a704d090532b5d2ee00eb | [
"MIT"
] | null | null | null | models/memnet.py | Subrata-Chattopadhyay/memnet | bb382ce0cc3d0a4af29a704d090532b5d2ee00eb | [
"MIT"
] | null | null | null | models/memnet.py | Subrata-Chattopadhyay/memnet | bb382ce0cc3d0a4af29a704d090532b5d2ee00eb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# file: memnet.py
# author: songyouwei <youwei0314@gmail.com>
# Copyright (C) 2018. All Rights Reserved.
from layers.attention import Attention
import torch
import torch.nn as nn
from numpy.random import seed
#torch.manual_seed(10)
#seed(4)
from layers.squeeze_embedding import SqueezeEmbedding
... | 40.131148 | 100 | 0.655229 |
0d715a64f66f713efa7be3b8d5cbc093c2440ff1 | 180 | py | Python | privagal/wsgi.py | ychab/privagal | 118197c8fdeb7e32c95cf9672b87fb0350a5a874 | [
"BSD-3-Clause"
] | 6 | 2016-06-06T15:27:24.000Z | 2016-07-14T01:26:42.000Z | privagal/wsgi.py | ychab/privagal | 118197c8fdeb7e32c95cf9672b87fb0350a5a874 | [
"BSD-3-Clause"
] | null | null | null | privagal/wsgi.py | ychab/privagal | 118197c8fdeb7e32c95cf9672b87fb0350a5a874 | [
"BSD-3-Clause"
] | null | null | null | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "privagal.settings.production")
application = get_wsgi_application()
| 22.5 | 79 | 0.833333 |
90882091ba1ae3b8dd024dff01eb7701d68d6fee | 1,852 | py | Python | code/denoising_event_lm/training/metrics/squad_em_and_f1.py | Willyoung2017/event-process-tracie | cc582facea64c096aa7f4d14156e43a19136151e | [
"Apache-2.0"
] | 6 | 2021-04-19T12:18:16.000Z | 2021-10-20T06:47:40.000Z | denoising_event_lm/training/metrics/squad_em_and_f1.py | allenai/TemporalBART | 180bdd1b86a1cad361158f5e78b5901498471d78 | [
"MIT"
] | null | null | null | denoising_event_lm/training/metrics/squad_em_and_f1.py | allenai/TemporalBART | 180bdd1b86a1cad361158f5e78b5901498471d78 | [
"MIT"
] | 2 | 2021-01-27T18:31:29.000Z | 2021-08-30T15:57:22.000Z | from typing import Tuple
from allennlp.training.metrics.metric import Metric
from overrides import overrides
from denoising_event_lm.utils import squad_eval
@Metric.register("squad")
class SquadEmAndF1(Metric):
"""
This :class:`Metric` takes the best span string computed by a model, along with the answer
... | 29.870968 | 97 | 0.62851 |
e3f704bd1acaccfe477d4709a8349da52ed15697 | 160 | py | Python | abinit/__init__.py | wirawan0/pyqmc | 8d641ba2b91d1d7a05a90574d0787fb991ee15e2 | [
"Apache-2.0"
] | null | null | null | abinit/__init__.py | wirawan0/pyqmc | 8d641ba2b91d1d7a05a90574d0787fb991ee15e2 | [
"Apache-2.0"
] | null | null | null | abinit/__init__.py | wirawan0/pyqmc | 8d641ba2b91d1d7a05a90574d0787fb991ee15e2 | [
"Apache-2.0"
] | null | null | null | # $Id: __init__.py,v 1.1 2010-02-10 23:11:54 wirawan Exp $
#
# pyqmc.abinit module
# Created: 20100208
# Wirawan Purwanto
#
# Namespace for abinit stuff.
pass
| 16 | 58 | 0.70625 |
5b013f989ac46eadc39660c67d3ab3edb8ea2235 | 609 | py | Python | tests/pyre.pkg/calc/node_instance.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 25 | 2018-04-23T01:45:39.000Z | 2021-12-10T06:01:23.000Z | tests/pyre.pkg/calc/node_instance.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 53 | 2018-05-31T04:55:00.000Z | 2021-10-07T21:41:32.000Z | tests/pyre.pkg/calc/node_instance.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 12 | 2018-04-23T22:50:40.000Z | 2022-02-20T17:27:23.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
"""
Check that the refcount is zero after all nodes have gone out of scope
"""
def test():
# get the package
import pyre.calc
# make a node class
class node(metaclass=pyre.calc.... | 16.026316 | 70 | 0.633826 |
b18ed9e86528dcb1cc0318dfd780806dba36fe0e | 2,067 | py | Python | zun/network/network.py | PradeepSingh1988/zun | 0e691ad6d6499bcfa7bbd03030415485396ff2d1 | [
"Apache-2.0"
] | null | null | null | zun/network/network.py | PradeepSingh1988/zun | 0e691ad6d6499bcfa7bbd03030415485396ff2d1 | [
"Apache-2.0"
] | null | null | null | zun/network/network.py | PradeepSingh1988/zun | 0e691ad6d6499bcfa7bbd03030415485396ff2d1 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 31.318182 | 78 | 0.671505 |
b1165a3b105680ddabff43a47abfd4dc3e4e73f4 | 1,219 | py | Python | python_fundamentals/Filter by Type/index.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | null | null | null | python_fundamentals/Filter by Type/index.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | 8 | 2020-06-06T01:02:06.000Z | 2022-03-12T00:24:13.000Z | python_fundamentals/Filter by Type/index.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | null | null | null | # Write a program that, given some value, tests that value for its type. Here's what you should do for each type:
# Integer
# If the integer is greater than or equal to 100, print "That's a big number!" If the integer is less than 100, print "That's a small number"
sI = 45
bI = 200
if sI <= 100:
print("That's a sma... | 32.078947 | 148 | 0.658737 |
bf51ac30439e7d7693d5ef5e22556d98a77ba3fe | 1,514 | py | Python | app/bin/TA_mts_federal_reserve_rh_fred_series.py | dmuegge/TA_mts_federal_reserve | 6ea8dca8906ba69042b9070cc0c37b5df2674f71 | [
"Apache-2.0"
] | null | null | null | app/bin/TA_mts_federal_reserve_rh_fred_series.py | dmuegge/TA_mts_federal_reserve | 6ea8dca8906ba69042b9070cc0c37b5df2674f71 | [
"Apache-2.0"
] | null | null | null | app/bin/TA_mts_federal_reserve_rh_fred_series.py | dmuegge/TA_mts_federal_reserve | 6ea8dca8906ba69042b9070cc0c37b5df2674f71 | [
"Apache-2.0"
] | null | null | null |
import ta_mts_federal_reserve_declare
from splunktaucclib.rest_handler.endpoint import (
field,
validator,
RestModel,
DataInputModel,
)
from splunktaucclib.rest_handler import admin_external, util
from splunk_aoblib.rest_migration import ConfigMigrationHandler
util.remove_http_proxy_env_vars()
fiel... | 19.164557 | 63 | 0.567371 |
268f40e9cbabcb0bb82d44060b0a129eb50cb3cc | 3,190 | py | Python | src/main/python/afp_resource_maker/rolemaker.py | ImmobilienScout24/add_aws_roles | 1bd9233ea091646312d64c7453b28a3f7647c408 | [
"Apache-2.0"
] | 1 | 2015-10-10T09:57:34.000Z | 2015-10-10T09:57:34.000Z | src/main/python/afp_resource_maker/rolemaker.py | ImmobilienScout24/add_aws_roles | 1bd9233ea091646312d64c7453b28a3f7647c408 | [
"Apache-2.0"
] | null | null | null | src/main/python/afp_resource_maker/rolemaker.py | ImmobilienScout24/add_aws_roles | 1bd9233ea091646312d64c7453b28a3f7647c408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import traceback
import boto
class LimitExceededException(Exception):
pass
class CanNotContinueException(Exception):
pass
class InvalidClientTokenIdException(Exception):
pass
class RoleMaker(object):
"""Create a role with policies to allow cross ac... | 37.97619 | 79 | 0.638871 |
f00e3d6aefd2f1264257053e5d3464a819960035 | 19,011 | py | Python | dataLoader/fused_utils.py | NVIDIA-AI-IOT/centernet_kinect | 92438e9f1469d1d8deffb33569068d2b635f99b6 | [
"MIT"
] | 17 | 2020-12-21T04:10:16.000Z | 2022-02-03T18:12:42.000Z | dataLoader/fused_utils.py | NVIDIA-AI-IOT/centernet_kinect | 92438e9f1469d1d8deffb33569068d2b635f99b6 | [
"MIT"
] | null | null | null | dataLoader/fused_utils.py | NVIDIA-AI-IOT/centernet_kinect | 92438e9f1469d1d8deffb33569068d2b635f99b6 | [
"MIT"
] | 3 | 2020-12-24T02:55:31.000Z | 2021-05-22T02:27:21.000Z | '''
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
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, ... | 40.277542 | 460 | 0.662564 |
0acb260fd135efe7de36ab39717d2bed27428776 | 10,117 | py | Python | app/tests/pages_tests/test_pages.py | comic/comic-django | 4f534fae2c7d2102e94991667398aef12394e32e | [
"Apache-2.0"
] | 7 | 2016-11-05T07:16:30.000Z | 2017-11-23T03:38:03.000Z | app/tests/pages_tests/test_pages.py | comic/comic-django | 4f534fae2c7d2102e94991667398aef12394e32e | [
"Apache-2.0"
] | 113 | 2015-05-26T09:27:59.000Z | 2018-03-21T10:45:56.000Z | app/tests/pages_tests/test_pages.py | comic/comic-django | 4f534fae2c7d2102e94991667398aef12394e32e | [
"Apache-2.0"
] | 7 | 2015-07-16T20:11:22.000Z | 2017-06-06T02:41:24.000Z | from itertools import chain
import pytest
from django.db.models import BLANK_CHOICE_DASH
from grandchallenge.pages.models import Page
from tests.factories import PageFactory
from tests.utils import get_view_for_user, validate_admin_only_view
@pytest.mark.django_db
@pytest.mark.parametrize(
"view", ["pages:list"... | 32.847403 | 81 | 0.666008 |
75111b6e9d490b0a49c0024c1dd9ed4a6189b55e | 4,307 | py | Python | tempest/api/object_storage/test_object_version.py | rishabh20111990/tempest | df15531cd4231000b0da016f5cd8641523ce984e | [
"Apache-2.0"
] | 2 | 2015-08-13T00:07:49.000Z | 2020-08-07T06:38:44.000Z | tempest/api/object_storage/test_object_version.py | rishabh20111990/tempest | df15531cd4231000b0da016f5cd8641523ce984e | [
"Apache-2.0"
] | 1 | 2019-08-08T10:36:44.000Z | 2019-08-09T05:58:23.000Z | tempest/api/object_storage/test_object_version.py | rishabh20111990/tempest | df15531cd4231000b0da016f5cd8641523ce984e | [
"Apache-2.0"
] | 3 | 2016-08-30T06:53:54.000Z | 2021-03-22T16:54:39.000Z | # Copyright 2012 OpenStack Foundation
# 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 requ... | 46.815217 | 79 | 0.630369 |
597581b0fbfea1c9bb630519e6f93d103ff1fd1c | 2,429 | py | Python | Data_Analysis_with_Python/medical_data_visualizer.py | gusleak/freeCodeCamp | 2a9e8ae5c1d8a1c738071f6ce26ef61b64ce5b65 | [
"MIT"
] | null | null | null | Data_Analysis_with_Python/medical_data_visualizer.py | gusleak/freeCodeCamp | 2a9e8ae5c1d8a1c738071f6ce26ef61b64ce5b65 | [
"MIT"
] | null | null | null | Data_Analysis_with_Python/medical_data_visualizer.py | gusleak/freeCodeCamp | 2a9e8ae5c1d8a1c738071f6ce26ef61b64ce5b65 | [
"MIT"
] | null | null | null | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
# Import data
df = pd.read_csv('medical_examination.csv')
# Add 'overweight' column
def overweight_check(row):
if row.weight / (row.height / 100) ** 2 > 25:
return 1
return 0
df['overweight'] = df.apply(lambda... | 37.369231 | 242 | 0.660354 |
436a208a64da069c59a2212e61d0de70274c6f26 | 491 | py | Python | mp/mp09valuearray.py | showa-yojyo/bin | 8ddd29b3c629634212b3708904cf615c42a6eaf5 | [
"MIT"
] | 1 | 2017-04-27T19:58:41.000Z | 2017-04-27T19:58:41.000Z | mp/mp09valuearray.py | showa-yojyo/bin | 8ddd29b3c629634212b3708904cf615c42a6eaf5 | [
"MIT"
] | 8 | 2016-10-30T17:16:45.000Z | 2018-05-15T15:01:45.000Z | mp/mp09valuearray.py | showa-yojyo/bin | 8ddd29b3c629634212b3708904cf615c42a6eaf5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""mp9valuearray.py: Use multiprocessing.Value and multiprocessing.Array.
Usage:
mp9valuearray.py
"""
import multiprocessing as mp
def f(n, a):
n.value = 3.1415927
for i in range(len(a)):
a[i] = -a[i]
def main():
num = mp.Value('d', 0.0)
arr = mp.Array('i', range(10))
... | 18.185185 | 73 | 0.596741 |
82671cd8e72f84733f5a28acdb4b5fb9d56a0a03 | 454 | py | Python | numpy/f2py/tests/test_quoted_character.py | andrewkwolek/numpy | cbccbe9dee293ff2bf0167e37443ce4975781562 | [
"BSD-3-Clause"
] | 2 | 2022-01-20T18:13:17.000Z | 2022-03-25T04:30:01.000Z | numpy/f2py/tests/test_quoted_character.py | andrewkwolek/numpy | cbccbe9dee293ff2bf0167e37443ce4975781562 | [
"BSD-3-Clause"
] | 60 | 2021-06-14T08:54:35.000Z | 2022-01-13T01:34:27.000Z | numpy/f2py/tests/test_quoted_character.py | andrewkwolek/numpy | cbccbe9dee293ff2bf0167e37443ce4975781562 | [
"BSD-3-Clause"
] | 2 | 2021-08-21T13:22:45.000Z | 2022-01-20T10:08:43.000Z | """See https://github.com/numpy/numpy/pull/10676.
"""
import sys
import pytest
from . import util
class TestQuotedCharacter(util.F2PyTest):
sources = [util.getpath("tests", "src", "quoted_character", "foo.f")]
@pytest.mark.skipif(sys.platform == "win32",
reason="Fails with MinGW64 G... | 26.705882 | 75 | 0.610132 |
adef93b65fb1b14aee9661178fab5ba44a198e23 | 342 | py | Python | tests/test_scripts.py | toots/sinagot | f2d274d6475a3cee316ecf3b5d73d051e70e6c1c | [
"BSD-3-Clause"
] | 1 | 2020-12-21T16:19:31.000Z | 2020-12-21T16:19:31.000Z | tests/test_scripts.py | toots/sinagot | f2d274d6475a3cee316ecf3b5d73d051e70e6c1c | [
"BSD-3-Clause"
] | null | null | null | tests/test_scripts.py | toots/sinagot | f2d274d6475a3cee316ecf3b5d73d051e70e6c1c | [
"BSD-3-Clause"
] | null | null | null | """Test scripts"""
from pathlib import Path
def test_path(dataset, ID):
script = dataset.behavior.get(ID).steps.first().script
assert script.path.input == Path(dataset._data_path, "HDC", ID, "Trial1_report.txt")
assert script.path.output == Path(
dataset._data_path, "PROCESSED", ID, "HDC", "behav... | 28.5 | 88 | 0.678363 |
d35d0b33e173e654cebfb112a1746d8263ba1217 | 1,906 | py | Python | setup.py | freddi301/spid-cie-oidc-django | 7cfa8d775ee46e24efdc5ecfd32f7f39fb018149 | [
"Apache-2.0"
] | null | null | null | setup.py | freddi301/spid-cie-oidc-django | 7cfa8d775ee46e24efdc5ecfd32f7f39fb018149 | [
"Apache-2.0"
] | null | null | null | setup.py | freddi301/spid-cie-oidc-django | 7cfa8d775ee46e24efdc5ecfd32f7f39fb018149 | [
"Apache-2.0"
] | null | null | null | import re
import os
import re
import sys
from glob import glob
from setuptools import setup, find_packages
SRC_FOLDER = '.'
PKG_NAME = 'spid_cie_oidc'
INSTALL_REQUIRES = [
"Django>=4.0",
"oidcmsg>=1.5.4",
"pydantic>=1.8.2",
"pytz>=2021.3",
"aiohttp",
"requests",
"pydantic",
"pydantic[... | 27.228571 | 74 | 0.591291 |
f3a3f049fa223a351236728b1df4656be16e8e0d | 959 | py | Python | pptx/replace.py | aleksiej-ostrowski/py_tools | d47eef6f9897d3412613e66730c34cd1d24faa84 | [
"MIT"
] | null | null | null | pptx/replace.py | aleksiej-ostrowski/py_tools | d47eef6f9897d3412613e66730c34cd1d24faa84 | [
"MIT"
] | null | null | null | pptx/replace.py | aleksiej-ostrowski/py_tools | d47eef6f9897d3412613e66730c34cd1d24faa84 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#----------------------------#
# #
# Version 0.0.1 #
# Ostrovsky Alexey, 2016 #
# 0x0all@gmail.com #
# #
#----------------------------#
filename = "ideal.pptx"
out_filename = "ideal_new.pptx"
import os
fn_ =... | 22.833333 | 91 | 0.475495 |
1fac879bd66b4152a1bb065a2bc0c9c5bca14251 | 483 | py | Python | python-student/exercise-02/timer.py | yahav876/Yahav-DevOps | 308a10758150824061f14cc2589738355dec91e8 | [
"CNRI-Python"
] | null | null | null | python-student/exercise-02/timer.py | yahav876/Yahav-DevOps | 308a10758150824061f14cc2589738355dec91e8 | [
"CNRI-Python"
] | null | null | null | python-student/exercise-02/timer.py | yahav876/Yahav-DevOps | 308a10758150824061f14cc2589738355dec91e8 | [
"CNRI-Python"
] | null | null | null | #!/bin/python3
#import time
# To use time function without using the time word before calling the method.
from time import localtime, mktime, strftime
start_time = localtime()
print(f"Timer Starts at {strftime('%X',start_time)}")
# Wait for user to stop timer
input("Press 'Enter' to stop the timer")
stop_time = l... | 23 | 77 | 0.73706 |
6eb69ac5ef38dc11ffa93eac4943d62673b81287 | 87 | py | Python | liif/datasets/__init__.py | NejcHirci/material-addon | c08e2081413c3319b712c2f7193ac8013f601382 | [
"MIT"
] | 4 | 2022-01-31T14:26:39.000Z | 2022-02-06T06:34:27.000Z | liif/datasets/__init__.py | NejcHirci/material_addon | c08e2081413c3319b712c2f7193ac8013f601382 | [
"MIT"
] | 2 | 2022-01-30T10:35:04.000Z | 2022-01-30T10:35:04.000Z | liif/datasets/__init__.py | NejcHirci/material-addon | c08e2081413c3319b712c2f7193ac8013f601382 | [
"MIT"
] | null | null | null | from .datasets import register, make
from . import image_folder
from . import wrappers
| 21.75 | 36 | 0.804598 |
13705a521e39d353497e5a9f33c0306d8f5ae803 | 15,333 | py | Python | qiskit/pulse/transforms/alignments.py | wshanks/qiskit-terra | 580bc7dd61921c3e784aea5fb86fb3054c1d6a29 | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/transforms/alignments.py | wshanks/qiskit-terra | 580bc7dd61921c3e784aea5fb86fb3054c1d6a29 | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/transforms/alignments.py | wshanks/qiskit-terra | 580bc7dd61921c3e784aea5fb86fb3054c1d6a29 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 34.378924 | 98 | 0.659101 |
28dd6ea2a4bd4fe854e6d7e4be03cc6988dc88bd | 9,590 | py | Python | openmdao.lib/src/openmdao/lib/doegenerators/optlh.py | mjfwest/OpenMDAO-Framework | a5521f47ad7686c25b203de74e1c7dff5fd7a52b | [
"Apache-2.0"
] | 69 | 2015-01-02T19:10:08.000Z | 2021-11-14T04:42:28.000Z | openmdao.lib/src/openmdao/lib/doegenerators/optlh.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 3 | 2015-01-15T23:08:18.000Z | 2015-03-11T16:57:35.000Z | openmdao.lib/src/openmdao/lib/doegenerators/optlh.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 31 | 2015-09-16T00:37:35.000Z | 2022-01-10T06:27:55.000Z | # This implementation is based on a matlab implementation that has the
# following license:
#
# Copyright 2007 A Sobester
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version... | 30.935484 | 97 | 0.623462 |
c45a8e5133d6365732f2b9f340248ad629996bab | 2,093 | py | Python | app/backend/wells/migrations/0110_delete_legacy_dupes_20200401_2244.py | bcgov/gwells | 7d69e65e993d37070961e06e6ce9c58a02d79363 | [
"Apache-2.0"
] | 37 | 2017-06-30T18:08:51.000Z | 2022-02-13T18:04:10.000Z | app/backend/wells/migrations/0110_delete_legacy_dupes_20200401_2244.py | bcgov/gwells | 7d69e65e993d37070961e06e6ce9c58a02d79363 | [
"Apache-2.0"
] | 544 | 2017-06-21T00:29:20.000Z | 2022-02-01T21:37:38.000Z | app/backend/wells/migrations/0110_delete_legacy_dupes_20200401_2244.py | bcgov/gwells | 7d69e65e993d37070961e06e6ce9c58a02d79363 | [
"Apache-2.0"
] | 59 | 2017-03-10T17:55:02.000Z | 2021-11-16T19:20:08.000Z | # Generated by Django 2.2.12 on 2020-04-01 22:44
from django.db import migrations, connection, transaction
SELECT_DUPLICATE_LEGACY_RECORDS = """
SELECT MAX(filing_number) FROM activity_submission WHERE well_tag_number IN (
SELECT well_tag_number
FROM activity_submission
WHERE well... | 32.703125 | 88 | 0.732919 |
014ed28749049a65f94796c92518d5c87f7da594 | 2,006 | py | Python | src/k8s-extension/setup.py | santosh02iiit/azure-cli-extensions | 24247cfa19e2a5894937f19e17fbdc8308b28ef6 | [
"MIT"
] | 1 | 2021-08-03T18:32:54.000Z | 2021-08-03T18:32:54.000Z | src/k8s-extension/setup.py | santosh02iiit/azure-cli-extensions | 24247cfa19e2a5894937f19e17fbdc8308b28ef6 | [
"MIT"
] | 1 | 2020-03-09T22:34:27.000Z | 2020-03-09T22:34:27.000Z | src/k8s-extension/setup.py | santosh02iiit/azure-cli-extensions | 24247cfa19e2a5894937f19e17fbdc8308b28ef6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 34.586207 | 94 | 0.638584 |
acc704de739c40fd9ec7920f40d58bbb206596a5 | 351 | py | Python | website/website/website/urls.py | Ferdous-Al-Imran/Aqualizer | 5a718f81183c82bf9d82abdd00fe4baeb0bf9c71 | [
"MIT"
] | null | null | null | website/website/website/urls.py | Ferdous-Al-Imran/Aqualizer | 5a718f81183c82bf9d82abdd00fe4baeb0bf9c71 | [
"MIT"
] | null | null | null | website/website/website/urls.py | Ferdous-Al-Imran/Aqualizer | 5a718f81183c82bf9d82abdd00fe4baeb0bf9c71 | [
"MIT"
] | null | null | null | from django.conf.urls import include,url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
#url(r'^sensorValue/', include(sensorValue.urls)),
url(r'^home/',include('home.urls')),
url(r'^userAuthentication/',include('userAuthentication.urls')),
url(r'^sensorValue/',i... | 31.909091 | 68 | 0.692308 |
8b58ad1ae29f1c734e5020217a6e735802c4505f | 75,196 | py | Python | sympy/printing/mathml.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 2 | 2021-01-09T23:11:25.000Z | 2021-01-11T15:04:22.000Z | sympy/printing/mathml.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 3 | 2021-02-28T03:58:40.000Z | 2021-03-07T06:12:47.000Z | sympy/printing/mathml.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 2 | 2021-01-08T23:03:23.000Z | 2021-01-13T18:57:02.000Z | """
A MathML printer.
"""
from typing import Any, Dict
from sympy import sympify, S, Mul
from sympy.core.compatibility import default_sort_key
from sympy.core.function import _coeff_isneg
from sympy.printing.conventions import split_super_sub, requires_partial
from sympy.printing.precedence import \
precedence_tr... | 35.369708 | 85 | 0.565921 |
127f1b45b02580c60bd4bc64c9528d653bbe5bf2 | 14,545 | py | Python | src/synapse/azext_synapse/vendored_sdks/azure_mgmt_synapse/operations/_sql_pool_vulnerability_assessment_scans_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | src/synapse/azext_synapse/vendored_sdks/azure_mgmt_synapse/operations/_sql_pool_vulnerability_assessment_scans_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | src/synapse/azext_synapse/vendored_sdks/azure_mgmt_synapse/operations/_sql_pool_vulnerability_assessment_scans_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-05-09T17:47:09.000Z | 2020-10-01T19:52:06.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 50.155172 | 267 | 0.67659 |
d6bf84a8f17ebc5e649220e880269fcc7d2204f5 | 2,181 | py | Python | tests/metrics/test_ksd.py | michaeldeistler/sbibm-1 | 8e9875f79beb828c07fbf4820b30413914d1ceca | [
"MIT"
] | 2 | 2021-05-06T06:19:27.000Z | 2022-02-20T19:49:55.000Z | tests/metrics/test_ksd.py | mackelab/sbibm | b9781c610a1a80d2de014ee46a29cf061fb6074a | [
"MIT"
] | null | null | null | tests/metrics/test_ksd.py | mackelab/sbibm | b9781c610a1a80d2de014ee46a29cf061fb6074a | [
"MIT"
] | 1 | 2022-01-23T15:54:06.000Z | 2022-01-23T15:54:06.000Z | from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pyro
import scipy.stats as stats
import torch
import torch.distributions.transforms as transforms
import sbibm
import sbibm.third_party.kgof
import sbibm.third_party.kgof.data as data
import sbibm.third_party.kgof.den... | 30.291667 | 84 | 0.714351 |
74ecc813780ce5550b0d73f4e488a126c35ab3c6 | 1,024 | py | Python | harbinger/list_frameworks.py | att-comdev/harbinger | 75371fcb8dfbfab211359f94300f7fb25fb63e9e | [
"Apache-2.0"
] | null | null | null | harbinger/list_frameworks.py | att-comdev/harbinger | 75371fcb8dfbfab211359f94300f7fb25fb63e9e | [
"Apache-2.0"
] | 1 | 2018-10-05T16:47:38.000Z | 2018-10-05T19:15:22.000Z | harbinger/list_frameworks.py | att-comdev/harbinger | 75371fcb8dfbfab211359f94300f7fb25fb63e9e | [
"Apache-2.0"
] | 4 | 2018-09-19T14:16:29.000Z | 2018-09-25T18:42:33.000Z | """
ListFrameworks class:
- Lists all the frameworks that have been provided
through the provided yaml file
"""
from oslo_config import cfg
from oslo_log import log as logging
from prettytable import PrettyTable
from harbinger import base
from harbinger.common.utils import Utils
LOG = logging.getLogger(__nam... | 26.947368 | 68 | 0.733398 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.