hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7956fd0fb520a59d5e2337c5959a149babd708b1 | 110 | py | Python | dsbox/ml/neural_networks/processing/__init__.py | Pandinosaurus/dsbox | aea56049025ed7e6e66427f8636286f8be1b6e03 | [
"Apache-2.0"
] | 16 | 2020-05-11T09:10:15.000Z | 2021-04-13T08:43:28.000Z | dsbox/ml/neural_networks/processing/__init__.py | Pandinosaurus/dsbox | aea56049025ed7e6e66427f8636286f8be1b6e03 | [
"Apache-2.0"
] | 1 | 2020-12-03T20:02:32.000Z | 2020-12-03T20:02:32.000Z | dsbox/ml/neural_networks/processing/__init__.py | Pandinosaurus/dsbox | aea56049025ed7e6e66427f8636286f8be1b6e03 | [
"Apache-2.0"
] | 1 | 2020-05-11T17:22:20.000Z | 2020-05-11T17:22:20.000Z | from .text_classification import Text2Sequence
from . import text_classification
__all__ = ["Text2Sequence"] | 22 | 46 | 0.827273 |
7956fd2bf520297c6f02d03b4e6cc3086fa9f160 | 815 | py | Python | skhep/utils/py23.py | AdvaitDhingra/scikit-hep | 1e08901447c3e42e4c4b703ea6c09e3bd0db25af | [
"BSD-3-Clause"
] | 150 | 2016-11-14T14:09:29.000Z | 2022-03-18T16:37:03.000Z | skhep/utils/py23.py | AdvaitDhingra/scikit-hep | 1e08901447c3e42e4c4b703ea6c09e3bd0db25af | [
"BSD-3-Clause"
] | 123 | 2017-01-30T10:03:04.000Z | 2022-03-31T06:26:09.000Z | skhep/utils/py23.py | AdvaitDhingra/scikit-hep | 1e08901447c3e42e4c4b703ea6c09e3bd0db25af | [
"BSD-3-Clause"
] | 41 | 2017-01-11T11:42:56.000Z | 2021-12-06T22:38:32.000Z | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license, see LICENSE.
"""
Trivial module to deal with Python 2 and 3 compatibility.
"""
# -----------------------------------------------------------------------------
# Import statements
# -------------------------------------------------------------------... | 25.46875 | 79 | 0.381595 |
7956fd4470e3c0033beaf38695f2807bead782c9 | 5,323 | py | Python | HanderCode/aidaiwangApp/aidaiwangApp/BaseMonitor.py | mocne/PycharmProjects | b009e530f4f01e5b1826bbe2364d86b65bcd66e3 | [
"MIT"
] | null | null | null | HanderCode/aidaiwangApp/aidaiwangApp/BaseMonitor.py | mocne/PycharmProjects | b009e530f4f01e5b1826bbe2364d86b65bcd66e3 | [
"MIT"
] | null | null | null | HanderCode/aidaiwangApp/aidaiwangApp/BaseMonitor.py | mocne/PycharmProjects | b009e530f4f01e5b1826bbe2364d86b65bcd66e3 | [
"MIT"
] | null | null | null | #coding:utf8
import subprocess
import os
import re
from wsgiref.validate import validator
import platform
cpu = []
men = []
flow = [[], []]
fps = []
battery = []
def get_cpu(pkg_name):
if platform.system() == 'Windows': # windows操作系统
cmd = "adb shell dumpsys cpuinfo | findstr " + pkg_name
# ... | 35.724832 | 117 | 0.547999 |
7956fdddd8766fffb317279fe7454aa25aa5cbe8 | 2,582 | py | Python | d4rl/gym_minigrid/envs/fourrooms.py | xfdywy/d4rl | d15b165c1e68d8c04d19faf44cd387046a4988a2 | [
"Apache-2.0"
] | 552 | 2020-04-20T01:07:02.000Z | 2022-03-31T16:47:39.000Z | d4rl/d4rl/gym_minigrid/envs/fourrooms.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | 103 | 2020-04-20T14:18:32.000Z | 2022-03-30T14:33:45.000Z | d4rl/d4rl/gym_minigrid/envs/fourrooms.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | 135 | 2020-04-21T16:57:52.000Z | 2022-03-30T14:29:55.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from d4rl.gym_minigrid.minigrid import *
from d4rl.gym_minigrid.register import register
class FourRoomsEnv(MiniGridEnv):
"""
Classic 4 rooms gridworld environment.
Can specify agent and goal position, if not it set at random.
"""
def __init__(self, ... | 30.738095 | 84 | 0.559644 |
7956fdfb583e40dd6d78fc346493e11e392dead6 | 4,928 | py | Python | experimental/python/gui/selectbox.py | Drahflow/Embroidermodder | 5fe2bed6407845e9d183aee40095b3f778a5b559 | [
"Zlib"
] | null | null | null | experimental/python/gui/selectbox.py | Drahflow/Embroidermodder | 5fe2bed6407845e9d183aee40095b3f778a5b559 | [
"Zlib"
] | null | null | null | experimental/python/gui/selectbox.py | Drahflow/Embroidermodder | 5fe2bed6407845e9d183aee40095b3f778a5b559 | [
"Zlib"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=============================
|module_summary| selectbox.py
=============================
TOWRITE
Classes summary:
================
============================ ============================
:class:`~SelectBox` TOWRITE
============================ ==========... | 29.159763 | 104 | 0.551339 |
7956fe9e2ac504aff6c7f5966ba0f97325685f4c | 3,147 | py | Python | awardsApp/models.py | MutuaFranklin/App-Awards | 020c85db144156ec02f12815cd675245d4ad9db3 | [
"MIT"
] | null | null | null | awardsApp/models.py | MutuaFranklin/App-Awards | 020c85db144156ec02f12815cd675245d4ad9db3 | [
"MIT"
] | null | null | null | awardsApp/models.py | MutuaFranklin/App-Awards | 020c85db144156ec02f12815cd675245d4ad9db3 | [
"MIT"
] | null | null | null | from django.db import models
from cloudinary.models import CloudinaryField
from django.contrib.auth.models import User
from profiles.models import Profile
from tinymce.models import HTMLField
# Create your models here.
class Project(models.Model):
title = models.CharField(max_length = 30)
project_image = Cl... | 27.605263 | 101 | 0.690181 |
7956feea8818cdfe883aa90017e7538dcecb44ad | 12,329 | py | Python | docusign_esign/models/access_code_format.py | joekohlsdorf/docusign-esign-python-client | 40407544f79c88716d36fabf36f65c3ef1a5c3ba | [
"MIT"
] | 58 | 2017-10-18T23:06:57.000Z | 2021-04-15T23:14:58.000Z | docusign_esign/models/access_code_format.py | joekohlsdorf/docusign-esign-python-client | 40407544f79c88716d36fabf36f65c3ef1a5c3ba | [
"MIT"
] | 49 | 2017-10-27T05:54:09.000Z | 2021-04-29T22:06:17.000Z | docusign_esign/models/access_code_format.py | joekohlsdorf/docusign-esign-python-client | 40407544f79c88716d36fabf36f65c3ef1a5c3ba | [
"MIT"
] | 49 | 2017-09-16T07:23:41.000Z | 2021-05-07T20:21:20.000Z | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | 34.438547 | 140 | 0.665747 |
7956ffa4a8ee873de0e971ecc1e4646e5813dd1c | 1,537 | py | Python | venv/Lib/site-packages/numpy/core/tests/test__exceptions.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | venv/Lib/site-packages/numpy/core/tests/test__exceptions.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | venv/Lib/site-packages/numpy/core/tests/test__exceptions.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | """
Tests of the ._exceptions module. Primarily for exercising the __str__ methods.
"""
import numpy as np
_ArrayMemoryError = np.core._exceptions._ArrayMemoryError
class TestArrayMemoryError:
def test_str(self):
e = _ArrayMemoryError((1023,), np.dtype(np.uint8))
str(e) # not crashing i... | 35.744186 | 80 | 0.573845 |
7957002bc673987f6efe5ce2574a3b90ed36cbeb | 275 | py | Python | tests/integration/conftest.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | 1 | 2019-10-23T01:00:08.000Z | 2019-10-23T01:00:08.000Z | tests/integration/conftest.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | null | null | null | tests/integration/conftest.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | 1 | 2019-06-19T17:53:10.000Z | 2019-06-19T17:53:10.000Z | import os
import pytest
from hcloud import Client
@pytest.fixture(autouse=True, scope='function')
def hetzner_client():
hetzner_client = Client(token="test-token", api_endpoint=os.getenv("FAKE_API_ENDPOINT", default="http://localhost:4000"))
return hetzner_client
| 25 | 125 | 0.767273 |
7957015c2e4d9c377f921c599efeccf8b3a943ab | 5,744 | py | Python | model.py | jrrr/emr-semantic-representations | 361330f16ce4aaba47641216af49886cc1c45623 | [
"MIT"
] | null | null | null | model.py | jrrr/emr-semantic-representations | 361330f16ce4aaba47641216af49886cc1c45623 | [
"MIT"
] | null | null | null | model.py | jrrr/emr-semantic-representations | 361330f16ce4aaba47641216af49886cc1c45623 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys, os, pickle
import pandas as pd
import numpy as np
from sklearn import linear_model, ensemble, metrics, impute, preprocessing
def load_listfile(path):
names = []
labels = []
with open(path, 'r') as f:
f.readline() # first line is header
for line in f:
... | 39.613793 | 87 | 0.674443 |
79570248fa2894799cb4053f28eefdfff863d9c7 | 2,073 | py | Python | lib/restapi/maclookapi.py | svalqui/NR | 5b6e665fb1166e010ae64b15dde7eb039ca1af64 | [
"MIT"
] | null | null | null | lib/restapi/maclookapi.py | svalqui/NR | 5b6e665fb1166e010ae64b15dde7eb039ca1af64 | [
"MIT"
] | null | null | null | lib/restapi/maclookapi.py | svalqui/NR | 5b6e665fb1166e010ae64b15dde7eb039ca1af64 | [
"MIT"
] | null | null | null | #
# http://www.macvendorlookup.com/api/v2/{MAC_Address}
# note 2017
# copied to sysad as is of more general use, should be removed from here later when sysad matures
import requests
import lib.restapimaster
import time
class QueryMac(lib.restapimaster.RestApi):
def __init__(self):
super(QueryMac, self).... | 25.9125 | 97 | 0.630005 |
795703967d789ee6321754e4ccaff2246198c72e | 22,303 | py | Python | tests/crypto/test_keyring.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | tests/crypto/test_keyring.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | tests/crypto/test_keyring.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 New Vector 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 la... | 37.171667 | 89 | 0.631754 |
795703b4edfffad4922e9d63810618e0d66bcefd | 4,494 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/decorators_1_20210714130158.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/decorators_1_20210714130158.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/decorators_1_20210714130158.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """Decorators
Recall the simple closure example we did which allowed us to maintain a count of ho9w many times a function was called:
def counter(fn):
count = 0
def inner(*args, **kwargs): # using *args. **kwargs means we can call any function fn with any combination of positional and keyword arguments
... | 37.764706 | 205 | 0.576547 |
795703c081a6af2c870a60e1b76c2cdf5832f961 | 869 | py | Python | migrations/versions/88ebd18ef240_.py | Anioko/market-research | cdd5c1a2fafd206443ba3ebc112d68d101d8c2b5 | [
"MIT"
] | null | null | null | migrations/versions/88ebd18ef240_.py | Anioko/market-research | cdd5c1a2fafd206443ba3ebc112d68d101d8c2b5 | [
"MIT"
] | null | null | null | migrations/versions/88ebd18ef240_.py | Anioko/market-research | cdd5c1a2fafd206443ba3ebc112d68d101d8c2b5 | [
"MIT"
] | 1 | 2021-03-15T19:24:38.000Z | 2021-03-15T19:24:38.000Z | """empty message
Revision ID: 88ebd18ef240
Revises: 51f8f2ef9d06
Create Date: 2021-03-11 11:20:35.999599
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '88ebd18ef240'
down_revision = '51f8f2ef9d06'
branch_labels = None
depends_on = None
def upgrade():
# ... | 28.032258 | 111 | 0.710012 |
7957049cde542f3678a7d35c49e8554aff61e11c | 8,713 | py | Python | main.py | matanki-saito/VIC2JPModCore | 03cf60db1188ea485cfe63238ad257ee73878768 | [
"MIT"
] | null | null | null | main.py | matanki-saito/VIC2JPModCore | 03cf60db1188ea485cfe63238ad257ee73878768 | [
"MIT"
] | null | null | null | main.py | matanki-saito/VIC2JPModCore | 03cf60db1188ea485cfe63238ad257ee73878768 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import hashlib
import json
import os
import shutil
import tempfile
import urllib.request
import zipfile
from os.path import join
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
_ = join
def upload_mod_to_google_drive(upload_file_path,
... | 32.755639 | 98 | 0.582693 |
7957050ff8f3c8358643747fc79af99a1b0fa90d | 34,172 | py | Python | src/analyse.py | htrenquier/ml-attribute-based-testing | 838ac29829b5fdd23cdac6413843c764c5934dce | [
"MIT"
] | null | null | null | src/analyse.py | htrenquier/ml-attribute-based-testing | 838ac29829b5fdd23cdac6413843c764c5934dce | [
"MIT"
] | null | null | null | src/analyse.py | htrenquier/ml-attribute-based-testing | 838ac29829b5fdd23cdac6413843c764c5934dce | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
from sklearn import metrics as sk_metrics
import metrics
import metrics_color
import plotting
import model_trainer as mt
import data_tools as dt
import tests_logging as t_log
import initialise
import bdd100k_utils as bu
import cv2
import os.path
import json
from iterto... | 43.642401 | 117 | 0.621562 |
79570700ee6de05bf8f7b980c48e10a0087bec64 | 3,775 | py | Python | dmifnet/psgn/training.py | leilimaster/DmifNet | cad50bb7a3762745f72b2498c2eef5ad5b21e4c6 | [
"MIT"
] | 25 | 2020-07-24T08:24:09.000Z | 2022-02-22T07:08:54.000Z | dmifnet/psgn/training.py | leilimaster/DmifNet | cad50bb7a3762745f72b2498c2eef5ad5b21e4c6 | [
"MIT"
] | 2 | 2021-01-28T09:54:02.000Z | 2021-02-02T09:08:11.000Z | dmifnet/psgn/training.py | leilimaster/DmifNet | cad50bb7a3762745f72b2498c2eef5ad5b21e4c6 | [
"MIT"
] | 1 | 2021-06-19T08:47:48.000Z | 2021-06-19T08:47:48.000Z | import os
from tqdm import trange
import torch
from dmifnet.common import chamfer_distance
from dmifnet.training import BaseTrainer
from dmifnet.utils import visualize as vis
class Trainer(BaseTrainer):
r''' Trainer object for the Point Set Generation Network.
The PSGN network is trained on Chamfer distance.... | 31.458333 | 76 | 0.61351 |
795707483fc5efb4e04a4df507c8993cc33001be | 11,907 | py | Python | GlyphBrowser.roboFontExt/lib/unicodeRanges.py | LettError/glyphBrowser | e080b38ff10e1957818bacc0565ac91c434e652f | [
"BSD-3-Clause"
] | 13 | 2016-02-28T16:58:34.000Z | 2022-03-26T01:33:30.000Z | lib/unicodeRanges.py | LettError/glyphBrowser | e080b38ff10e1957818bacc0565ac91c434e652f | [
"BSD-3-Clause"
] | 15 | 2016-02-29T11:29:13.000Z | 2021-12-08T20:12:38.000Z | lib/unicodeRanges.py | LettError/glyphBrowser | e080b38ff10e1957818bacc0565ac91c434e652f | [
"BSD-3-Clause"
] | 5 | 2018-01-26T11:53:37.000Z | 2021-03-29T16:33:58.000Z | # -*- coding: UTF-8 -*-
# Generated from glyphNameFormatter range names
# Generated on 2021 12 08 20:55:40
unicodeRangeNames ={ (0, 127): 'Basic Latin',
(128, 255): 'Latin-1 Supplement',
(256, 383): 'Latin Extended-A',
(384, 591): 'Latin Extended-B',
(592, 687): 'IPA Extensions',
(688, 767): 'Spac... | 39.29703 | 67 | 0.616192 |
795707f06e7886c858c9a14831e2f85f8340f3cd | 364 | py | Python | store/urls.py | ruhulaminparvez/HomeFood | f2e83bb057fbdac1f4f552ee84ab16915162942d | [
"MIT"
] | 5 | 2021-09-10T07:43:31.000Z | 2022-03-26T10:34:29.000Z | store/urls.py | MahamudM90/eCommerce | 82d64891254966048362d73247ee8e24ee0156c9 | [
"MIT"
] | null | null | null | store/urls.py | MahamudM90/eCommerce | 82d64891254966048362d73247ee8e24ee0156c9 | [
"MIT"
] | 2 | 2021-09-11T19:42:47.000Z | 2021-12-06T17:48:50.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.store, name="store"),
path('cart/', views.cart, name="cart"),
path('checkout/', views.checkout, name="checkout"),
path('update_item/', views.updateItem, name="update_item"),
path('process_order/', v... | 30.333333 | 73 | 0.634615 |
795708336f9075f566264b13c8a3bb4299d835d1 | 2,841 | py | Python | flambe/runnable/cluster_runnable.py | ethan-asapp/flambe | 70257167058c7b82ee39f74167a6161bd264ad18 | [
"MIT"
] | 148 | 2019-08-29T21:19:03.000Z | 2022-03-18T06:13:53.000Z | flambe/runnable/cluster_runnable.py | cle-ros/flambe | 0dc2f5b2b286694defe8abf450fe5be9ae12c097 | [
"MIT"
] | 108 | 2019-09-03T14:36:10.000Z | 2020-05-13T15:53:14.000Z | flambe/runnable/cluster_runnable.py | cle-ros/flambe | 0dc2f5b2b286694defe8abf450fe5be9ae12c097 | [
"MIT"
] | 21 | 2019-09-08T14:09:45.000Z | 2020-12-27T04:12:33.000Z | from abc import abstractmethod
from typing import Optional, Dict, Callable
from flambe.runnable import Runnable
from flambe.cluster import Cluster
from flambe.runnable.environment import RemoteEnvironment
class ClusterRunnable(Runnable):
"""Base class for all runnables that are able to run on cluster.
This ... | 34.646341 | 85 | 0.641675 |
79570868eef1b8c080e13f307dd08ef8d0597da5 | 785 | py | Python | pyxley/charts/mg/figure.py | snowind/pyxley | cff9e50b8d80b9794c6907355e541f166959cd6c | [
"MIT"
] | 2,536 | 2015-06-26T20:12:30.000Z | 2022-03-01T07:26:44.000Z | pyxley/charts/mg/figure.py | zhiaozhou/pyxley | 2dab00022d977d986169cd8a629b3a2f91be893f | [
"MIT"
] | 51 | 2015-07-17T14:16:43.000Z | 2021-07-09T21:34:36.000Z | pyxley/charts/mg/figure.py | zhiaozhou/pyxley | 2dab00022d977d986169cd8a629b3a2f91be893f | [
"MIT"
] | 335 | 2015-07-16T20:22:00.000Z | 2022-02-25T07:18:15.000Z | from .axes import Axes
from .layout import Layout
from .graphic import Graphic
class Figure(object):
""" Metricsgraphics Figure class.
This class is a composition of Axes, Graphic, and Layout options.
Args:
url (str): name of the endpoint to create.
chart_id (str): html el... | 25.322581 | 73 | 0.573248 |
795708792b2f196d7353a83a8b4b30f0474ca574 | 6,101 | py | Python | datafeeds/jqdatafeeds/stockfeedsjqdata.py | liuqiuxi/datafeeds | 50d1615a96f7d17d3ecd8ab661c4e1d5f43b9e8d | [
"MIT"
] | 1 | 2021-03-16T03:12:44.000Z | 2021-03-16T03:12:44.000Z | datafeeds/jqdatafeeds/stockfeedsjqdata.py | liuqiuxi/datafeeds | 50d1615a96f7d17d3ecd8ab661c4e1d5f43b9e8d | [
"MIT"
] | null | null | null | datafeeds/jqdatafeeds/stockfeedsjqdata.py | liuqiuxi/datafeeds | 50d1615a96f7d17d3ecd8ab661c4e1d5f43b9e8d | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time : 2019-12-27 15:48
# @Author : liuqiuxi
# @Email : liuqiuxi1990@gmail.com
# @File : stockfeedsjqdata.py
# @Project : datafeeds
# @Software: PyCharm
# @Remark : This is class of stock market
import datetime
import pandas as pd
import numpy as np
from datafeeds.jqdata... | 41.222973 | 119 | 0.62334 |
795709a758ab24bfead9e8f78c5bac62065e6b9f | 970 | py | Python | app/controllers/products/get_one.py | Brunoro811/api_dangels | 21c064eaa4f5009412dddc9676044d6cc08a5b65 | [
"MIT"
] | null | null | null | app/controllers/products/get_one.py | Brunoro811/api_dangels | 21c064eaa4f5009412dddc9676044d6cc08a5b65 | [
"MIT"
] | null | null | null | app/controllers/products/get_one.py | Brunoro811/api_dangels | 21c064eaa4f5009412dddc9676044d6cc08a5b65 | [
"MIT"
] | null | null | null | from flask import jsonify
from http import HTTPStatus
from sqlalchemy.orm.exc import NoResultFound
from app.controllers.products.products_helpers import help_normalize_variations
from app.models.product.products_model import ProductModel
def get_one_product(id: int):
try:
product: ProductModel = Produ... | 27.714286 | 79 | 0.661856 |
79570ab526d12bb74cd4c30658cf229cae2a02dc | 812 | py | Python | tests/test_stats.py | bibsAPB/pathways-analysis | b3a094b98e3022b7a7d959f93e62101483117372 | [
"MIT"
] | null | null | null | tests/test_stats.py | bibsAPB/pathways-analysis | b3a094b98e3022b7a7d959f93e62101483117372 | [
"MIT"
] | null | null | null | tests/test_stats.py | bibsAPB/pathways-analysis | b3a094b98e3022b7a7d959f93e62101483117372 | [
"MIT"
] | 3 | 2018-04-24T14:28:43.000Z | 2018-05-11T12:18:10.000Z | from models import Sample, SampleCollection, Experiment
import pandas as pd
from stats import ttest
def test_ttest():
data1 = {'BAD': 1.2345, 'FUCA2': 6.5432}
data2 = {'BAD': 2.3456, 'FUCA2': 7.6543}
data3 = {'BAD': 6.3456, 'FUCA2': 11.6543}
data4 = {'BAD': 7.1111, 'FUCA2': 9.9711}
tumour_samples... | 36.909091 | 97 | 0.689655 |
79570ac8d41e94b03a3e5cf4282109696826b97d | 6,708 | py | Python | forms.py | kirankumarsripati/udacity-nd0044-01-fyyur | 23cbef9725286adb86f0bcb0fc027e9a7161f1b2 | [
"MIT"
] | null | null | null | forms.py | kirankumarsripati/udacity-nd0044-01-fyyur | 23cbef9725286adb86f0bcb0fc027e9a7161f1b2 | [
"MIT"
] | null | null | null | forms.py | kirankumarsripati/udacity-nd0044-01-fyyur | 23cbef9725286adb86f0bcb0fc027e9a7161f1b2 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask_wtf import Form
from wtforms import StringField, SelectField, SelectMultipleField, DateTimeField, BooleanField, TextAreaField, ValidationError, IntegerField
from wtforms.validators import DataRequired, AnyOf, URL, Length, NumberRange, Regexp
import phonenumbers
facebook_regex =... | 29.813333 | 140 | 0.576327 |
79570bc2e433bbaf1287b4c23efd053db9945688 | 7,246 | py | Python | lib/setuptools-0.6c11/setuptools/command/build_py.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/setuptools-0.6c11/setuptools/command/build_py.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/setuptools-0.6c11/setuptools/command/build_py.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | import os.path, sys, fnmatch
from distutils.command.build_py import build_py as _build_py
from distutils.util import convert_path
from glob import glob
class build_py(_build_py):
"""Enhanced 'build_py' command that includes data files with packages
The data files are specified via a 'package_data' argument to... | 35.174757 | 80 | 0.606956 |
79570c77e7e9ce9a79754dd08641160241729387 | 1,444 | py | Python | main/models.py | PhobosXIII/qc | a025e25f9d3fddad1565819010362eb8672c0fa9 | [
"Apache-2.0"
] | null | null | null | main/models.py | PhobosXIII/qc | a025e25f9d3fddad1565819010362eb8672c0fa9 | [
"Apache-2.0"
] | null | null | null | main/models.py | PhobosXIII/qc | a025e25f9d3fddad1565819010362eb8672c0fa9 | [
"Apache-2.0"
] | null | null | null | from ckeditor.fields import RichTextField
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
class News(models.Model):
title = models.CharField('заголовок', max_length=255)
text = RichTextField('текст новости')
is_published = models.BooleanField('опубликов... | 30.723404 | 109 | 0.676593 |
79570cf0ea624170568cc1004eef343cc2c97d78 | 1,241 | py | Python | Python/Searching/2/binary_search.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | 5 | 2017-08-03T06:33:49.000Z | 2021-08-06T13:20:57.000Z | Python/Searching/2/binary_search.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | null | null | null | Python/Searching/2/binary_search.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | 6 | 2017-04-27T13:30:49.000Z | 2020-11-01T20:28:55.000Z | #!/usr/bin/env python
__author__ = "bt3"
def binary_search(array, item, hi=None, lo=0):
'''
>>> binary_search([2,3,5,6,8,10,15,23], 15)
6
>>> binary_search([2,3,5,6,8,10,15,23], 4)
False
>>> binary_search([1,3,4,5,7,8 ,10,12,23], 10)
6
>>> binary_search([1,3,4,5,7,8 ,10,12,23], 22)
... | 18.522388 | 58 | 0.518936 |
79570d5048023e009e26bdaaf5034d152b38219e | 12,332 | py | Python | frappe/core/doctype/data_export/exporter.py | arslangzr/frappe | 4ff86e1d63cd6887d0b90d8fbf6be284ff6ec21b | [
"MIT"
] | 1 | 2021-12-11T04:06:44.000Z | 2021-12-11T04:06:44.000Z | frappe/core/doctype/data_export/exporter.py | cpdeethree/frappe | fe4a317861a5fd7cc0a4489285c22c9af1ce0167 | [
"MIT"
] | 1 | 2021-10-01T13:08:45.000Z | 2021-10-01T13:08:45.000Z | frappe/core/doctype/data_export/exporter.py | cpdeethree/frappe | fe4a317861a5fd7cc0a4489285c22c9af1ce0167 | [
"MIT"
] | 1 | 2019-07-05T09:02:16.000Z | 2019-07-05T09:02:16.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
import frappe.permissions
import re, csv, os
from frappe.utils.csvutils import UnicodeWriter
from frappe.utils import cstr, formatdate, format_datetime, parse_json, cint, format_duration
... | 32.797872 | 133 | 0.70686 |
79570f496dc5985e26cf5a114b506619d8b87fac | 66,649 | py | Python | tests/e2e/advanced/spatial_consistency/wpa2_personal/test_bridge_spatial.py | dutta-rohan/wlan-testing | 77264245b62e21dff5f38c7eae74c22e0cdeefbb | [
"BSD-3-Clause"
] | 7 | 2020-08-19T16:45:46.000Z | 2022-02-10T09:55:22.000Z | tests/e2e/advanced/spatial_consistency/wpa2_personal/test_bridge_spatial.py | dutta-rohan/wlan-testing | 77264245b62e21dff5f38c7eae74c22e0cdeefbb | [
"BSD-3-Clause"
] | 47 | 2020-12-20T16:06:03.000Z | 2022-03-23T03:01:22.000Z | tests/e2e/advanced/spatial_consistency/wpa2_personal/test_bridge_spatial.py | dutta-rohan/wlan-testing | 77264245b62e21dff5f38c7eae74c22e0cdeefbb | [
"BSD-3-Clause"
] | 9 | 2021-02-04T22:32:06.000Z | 2021-12-14T17:45:51.000Z | import pytest
import allure
import os
import time
import pandas as pd
pytestmark = [pytest.mark.advance, pytest.mark.spatial_consistency, pytest.mark.bridge]
setup_params_general = {
"mode": "BRIDGE",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"],... | 51.786325 | 162 | 0.547135 |
79570f53e45e8f4ce74b78e944be4e9b3e2e9a2e | 506 | py | Python | parse_scanners.py | RyPeck/Remote-VA-Scanners | 2643c07dcad01d4b8e013d01f2bd3d154646eedf | [
"MIT"
] | null | null | null | parse_scanners.py | RyPeck/Remote-VA-Scanners | 2643c07dcad01d4b8e013d01f2bd3d154646eedf | [
"MIT"
] | null | null | null | parse_scanners.py | RyPeck/Remote-VA-Scanners | 2643c07dcad01d4b8e013d01f2bd3d154646eedf | [
"MIT"
] | 1 | 2018-03-06T23:55:02.000Z | 2018-03-06T23:55:02.000Z | #!/usr/bin/env python3
import csv
import ipaddress
scanners = []
with open("scanners.csv") as f:
scan_reader = csv.DictReader(f)
scanners = list(scan_reader)
# Verify that we have a list of valid IP Addresses/CIDRs
for line in scanners:
ip_object = ipaddress.IPv4Network(line['cidr'])
line['ip_object... | 22 | 56 | 0.701581 |
7957106f5e8375adc0200c2c1e859cbf1b23b17b | 3,901 | py | Python | dexp/processing/filters/kernels/wiener_butterworth.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 16 | 2021-04-21T14:09:19.000Z | 2022-03-22T02:30:59.000Z | dexp/processing/filters/kernels/wiener_butterworth.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 28 | 2021-04-15T17:43:08.000Z | 2022-03-29T16:08:35.000Z | dexp/processing/filters/kernels/wiener_butterworth.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 3 | 2022-02-08T17:41:30.000Z | 2022-03-18T15:32:27.000Z | import math
from typing import Tuple, Union
from dexp.processing.filters.butterworth_filter import butterworth_kernel
from dexp.processing.filters.kernels.wiener import wiener_kernel
from dexp.utils.backends import Backend
def wiener_butterworth_kernel(
kernel,
alpha: float = 1e-3,
beta: float = 1e-1,
... | 27.666667 | 88 | 0.60241 |
795710d282d041513e2a4dd7864a88d957e508dd | 1,409 | py | Python | src/decode_number_to_letter.py | redfast00/daily-algorithm-challenge | 3507164d5ec58abe68a6e820120625e100dee96c | [
"MIT"
] | null | null | null | src/decode_number_to_letter.py | redfast00/daily-algorithm-challenge | 3507164d5ec58abe68a6e820120625e100dee96c | [
"MIT"
] | null | null | null | src/decode_number_to_letter.py | redfast00/daily-algorithm-challenge | 3507164d5ec58abe68a6e820120625e100dee96c | [
"MIT"
] | null | null | null | def logger(function):
'''Wrapper to inspect recursive functions.'''
def inner(*args, **kwargs):
result = function(*args, **kwargs)
print(f'"{args[0]}" -> {result}')
return result
return inner
def num_combinations(code):
'''Returns the number of possible ways to decode a numbers... | 28.18 | 88 | 0.546487 |
795712a5ec40591312fe1f2cefaa9445cba134d4 | 5,614 | py | Python | local_backend/server.py | redis-developer/crowsnest | c38d59d6b332b9232f0fae9ce5abc2449d836372 | [
"MIT"
] | null | null | null | local_backend/server.py | redis-developer/crowsnest | c38d59d6b332b9232f0fae9ce5abc2449d836372 | [
"MIT"
] | null | null | null | local_backend/server.py | redis-developer/crowsnest | c38d59d6b332b9232f0fae9ce5abc2449d836372 | [
"MIT"
] | null | null | null | # RedisEdge realtime video analytics web server
import argparse
import cv2
import io
import numpy as np
import redis
from urllib.parse import urlparse
from PIL import Image, ImageDraw
from flask import Flask, render_template, Response, request
from flask_cors import CORS, cross_origin
import capture
#import init
import... | 35.987179 | 109 | 0.594585 |
795712c503350599b2defa4bd7f1c2e179015ac7 | 21,455 | py | Python | tests/test_sklearn_glm_regressor_converter.py | RTHMaK/sklearn-onnx | dbbd4a04f0a395549b1e5465c5d65ceaef07a726 | [
"MIT"
] | null | null | null | tests/test_sklearn_glm_regressor_converter.py | RTHMaK/sklearn-onnx | dbbd4a04f0a395549b1e5465c5d65ceaef07a726 | [
"MIT"
] | null | null | null | tests/test_sklearn_glm_regressor_converter.py | RTHMaK/sklearn-onnx | dbbd4a04f0a395549b1e5465c5d65ceaef07a726 | [
"MIT"
] | null | null | null | """Tests GLMRegressor converter."""
import unittest
from distutils.version import StrictVersion
import numpy
from sklearn import linear_model
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.neural_network import MLPRegressor
from sklearn.svm import LinearSVR
from skl2onnx import convert_sklearn
fro... | 35.172131 | 79 | 0.57003 |
795713612a9b2695829ffed07fdbfc57fe6aad1d | 1,206 | py | Python | basics/mnistspecificimage.py | johnolafenwa/DeepVision | 3b76fb6fcb6f6374c7faf1f8372e3f3091817505 | [
"MIT"
] | 7 | 2018-08-03T04:51:12.000Z | 2020-01-10T19:27:35.000Z | basics/mnistspecificimage.py | johnolafenwa/DeepVision | 3b76fb6fcb6f6374c7faf1f8372e3f3091817505 | [
"MIT"
] | null | null | null | basics/mnistspecificimage.py | johnolafenwa/DeepVision | 3b76fb6fcb6f6374c7faf1f8372e3f3091817505 | [
"MIT"
] | 2 | 2018-08-03T05:36:52.000Z | 2018-11-03T14:37:19.000Z | #import needed classes
import keras
from keras.datasets import mnist
from keras.layers import Dense,Dropout
from keras.models import Sequential
from keras.optimizers import SGD
import matplotlib.pyplot as plt
#load the mnist dataset
(train_x, train_y) , (test_x, test_y) = mnist.load_data()
#Define the mode... | 25.125 | 89 | 0.741294 |
795713e608a74ce46683253055403a50eccb330c | 1,316 | py | Python | Medium/513.FindBottomLeftTreeValue.py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 39 | 2020-07-04T11:15:13.000Z | 2022-02-04T22:33:42.000Z | Medium/513.FindBottomLeftTreeValue.py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 1 | 2020-07-15T11:53:37.000Z | 2020-07-15T11:53:37.000Z | Medium/513.FindBottomLeftTreeValue.py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 20 | 2020-07-14T19:12:53.000Z | 2022-03-02T06:28:17.000Z | """
Given a binary tree, find the leftmost value in the last row of the tree.
Example:
Input:
1
/ \
2 3
/ / \
4 5 6
/
7
Output: 7
Note: You may assume the tree (i.e., the given root node) is not NULL.
"""
#Difficulty: M... | 26.857143 | 104 | 0.530395 |
795714f1488545329bfe1a36fe7fc2b9b43b8840 | 2,122 | py | Python | functions.py | joolsa/Binary-Classifier-for-Online-Hate-Detection-in-Multiple-Social-Media-Platforms | a3ed3d40d16b04e451146688e78a3d3eed373ba5 | [
"MIT"
] | 5 | 2020-04-16T09:38:19.000Z | 2021-05-05T21:28:22.000Z | functions.py | ZhEnLEK/Binary-Classifier-for-Online-Hate-Detection-in-Multiple-Social-Media-Platforms | a3ed3d40d16b04e451146688e78a3d3eed373ba5 | [
"MIT"
] | 2 | 2020-01-26T19:39:30.000Z | 2021-08-17T22:29:36.000Z | functions.py | ZhEnLEK/Binary-Classifier-for-Online-Hate-Detection-in-Multiple-Social-Media-Platforms | a3ed3d40d16b04e451146688e78a3d3eed373ba5 | [
"MIT"
] | 2 | 2020-04-28T13:02:03.000Z | 2021-03-30T16:31:49.000Z | # Import packages and change some pandas display options
import pandas as pd
import numpy as np
import re
import warnings
import xgboost as xgb
import matplotlib.pyplot as plt
from sklearn.metrics import auc, f1_score, roc_curve, roc_auc_score
def get_simple_features(data):
""" Creates simple features from the c... | 39.296296 | 105 | 0.618756 |
795715a0d14ee03059fad62653ae583d80fc761c | 170 | py | Python | cnn/gradEstimators/__init__.py | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 | [
"Apache-2.0"
] | 6 | 2019-04-28T05:30:00.000Z | 2020-01-21T08:16:13.000Z | cnn/gradEstimators/__init__.py | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 | [
"Apache-2.0"
] | null | null | null | cnn/gradEstimators/__init__.py | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 | [
"Apache-2.0"
] | 5 | 2019-04-29T05:57:04.000Z | 2021-04-21T00:19:11.000Z | from .random_path import RandomPath as random_path
from .layer_same_path import LayerSamePath as layer_same_path
from .triple_alphas import TripleAlphas as triple_alphas
| 42.5 | 61 | 0.876471 |
7957161e44746afb33f98bcc12d9f60029f6c195 | 656 | py | Python | normality/constants.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | normality/constants.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | normality/constants.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null |
WS = ' '
# Unicode character classes, see:
# http://www.fileformat.info/info/unicode/category/index.htm
# https://en.wikipedia.org/wiki/Unicode_character_property
# http://www.unicode.org/charts/beta/script/
UNICODE_CATEGORIES = {
'Cc': None,
'Cf': None,
'Cs': None,
'Co': None,
'Cn': None,
'Lm... | 16.4 | 60 | 0.489329 |
79571720d92f455dbee68dee73f147588d7fdd55 | 3,149 | py | Python | examples/debugging/simple_spread/feedforward/decentralised/run_mad4pg.py | mnguyen0226/Mava | 80c583253d769b35491407e3fbbec812b7a085e1 | [
"Apache-2.0"
] | null | null | null | examples/debugging/simple_spread/feedforward/decentralised/run_mad4pg.py | mnguyen0226/Mava | 80c583253d769b35491407e3fbbec812b7a085e1 | [
"Apache-2.0"
] | null | null | null | examples/debugging/simple_spread/feedforward/decentralised/run_mad4pg.py | mnguyen0226/Mava | 80c583253d769b35491407e3fbbec812b7a085e1 | [
"Apache-2.0"
] | null | null | null | # python3
# Copyright 2021 InstaDeep 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/LICENSE-2.0
#
# Unless required by applic... | 29.157407 | 75 | 0.709749 |
795717affe2e5517755db52592e2a288e8b9641a | 1,141 | py | Python | developement_code/truncate_val_to_test.py | darongliu/Input_Method | 28055937fc777cbba8cbc4c87ba5a2670da7d4e2 | [
"MIT"
] | 1 | 2018-07-03T07:42:42.000Z | 2018-07-03T07:42:42.000Z | developement_code/truncate_val_to_test.py | darongliu/Input_Method | 28055937fc777cbba8cbc4c87ba5a2670da7d4e2 | [
"MIT"
] | null | null | null | developement_code/truncate_val_to_test.py | darongliu/Input_Method | 28055937fc777cbba8cbc4c87ba5a2670da7d4e2 | [
"MIT"
] | null | null | null | import os
import random
import re
val_file = "../data/all_chinese_char_seperate_val.ptt.corpus.20140906.txt"
test_file= "../data/all_chinese_char_seperate_test.ptt.corpus.20140906.txt"
test_file_ans = "../data/all_chinese_char_seperate_test_ans.ptt.corpus.20140906.txt"
with open(val_file , 'r') as f_read , open(test_... | 28.525 | 108 | 0.509202 |
79571b5c80111e578a3f2e61e6aefd2666bbe0f8 | 28,155 | py | Python | run_ner_span.py | 20000607-lxc/BERT-NER-Pytorch-master | 47f2e1291ab53674986eb91abdb72693eafe9b61 | [
"MIT"
] | null | null | null | run_ner_span.py | 20000607-lxc/BERT-NER-Pytorch-master | 47f2e1291ab53674986eb91abdb72693eafe9b61 | [
"MIT"
] | null | null | null | run_ner_span.py | 20000607-lxc/BERT-NER-Pytorch-master | 47f2e1291ab53674986eb91abdb72693eafe9b61 | [
"MIT"
] | null | null | null | import argparse
import glob
import logging
import os
import json
import time
import torch
from torch.nn import CrossEntropyLoss
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
from torch.utils.data.distributed import DistributedSampler
from callback.optimizater.adamw import Adam... | 55.532544 | 150 | 0.630368 |
79571b712fdaec75f7c387b10aad8be64dfc3df3 | 2,253 | py | Python | statistik_api.py | ophcode/sormasapi | 01da5b362608568d8881af85177e1928a46b2715 | [
"CC0-1.0"
] | 4 | 2021-05-23T21:13:52.000Z | 2021-09-06T20:58:13.000Z | statistik_api.py | ophcode/sormasapi | 01da5b362608568d8881af85177e1928a46b2715 | [
"CC0-1.0"
] | null | null | null | statistik_api.py | ophcode/sormasapi | 01da5b362608568d8881af85177e1928a46b2715 | [
"CC0-1.0"
] | null | null | null | """
Work in progress:
- Does a database dump of all cases / persons in database
- When restarted, only updates cases / persons that have been changed since last use
- Potentially useful for automated statistics
"""
import sormasapi
import config
import time
import os
import json
from pprint import pprint
... | 32.185714 | 88 | 0.616511 |
79571b904051900eb6ed297d64f2d4102a9ba932 | 10,075 | py | Python | src/superpoint.py | haoningwu3639/EE229_Project_VideoStabilization | 74603e9dc5f10b3deffb2f4e0753c15dc8b9a92d | [
"MIT"
] | 1 | 2021-06-13T06:32:29.000Z | 2021-06-13T06:32:29.000Z | src/superpoint.py | haoningwu3639/EE229_Project_VideoStabilization | 74603e9dc5f10b3deffb2f4e0753c15dc8b9a92d | [
"MIT"
] | null | null | null | src/superpoint.py | haoningwu3639/EE229_Project_VideoStabilization | 74603e9dc5f10b3deffb2f4e0753c15dc8b9a92d | [
"MIT"
] | null | null | null | import numpy as np
import torch
class SuperPointNet(torch.nn.Module):
"""
SuperPoint Network
Thanks to https://github.com/magicleap/SuperPointPretrainedNetwork
"""
def __init__(self):
super(SuperPointNet, self).__init__()
self.relu = torch.nn.ReLU(inplace=True)
self.pool =... | 42.87234 | 94 | 0.564367 |
79571c65423eb3a56d91f1c82f56cd4de13bb6ea | 8,608 | py | Python | handler.py | dudeitssm/aws-billing-to-slack | 9d807247315a08d74f7000740621cdda7d70b40c | [
"MIT"
] | 123 | 2019-10-08T02:17:18.000Z | 2022-03-27T19:15:37.000Z | handler.py | dudeitssm/aws-billing-to-slack | 9d807247315a08d74f7000740621cdda7d70b40c | [
"MIT"
] | 13 | 2019-11-08T11:58:51.000Z | 2022-03-27T17:15:47.000Z | handler.py | dudeitssm/aws-billing-to-slack | 9d807247315a08d74f7000740621cdda7d70b40c | [
"MIT"
] | 54 | 2019-10-15T14:17:08.000Z | 2022-03-29T09:58:06.000Z | from collections import defaultdict
import boto3
import datetime
import os
import requests
import sys
n_days = 7
yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
week_ago = yesterday - datetime.timedelta(days=n_days)
# It seems that the sparkline symbols don't line up (probalby based on font?) so pu... | 38.257778 | 126 | 0.603625 |
79571dfa7e748d1f814800a975a79c38a5651883 | 691 | py | Python | test_package/conanfile.py | ArsenStudio/conan-llvm | dd6cd5566ef399c6ee0cbaf6e990861eac7f8616 | [
"MIT"
] | null | null | null | test_package/conanfile.py | ArsenStudio/conan-llvm | dd6cd5566ef399c6ee0cbaf6e990861eac7f8616 | [
"MIT"
] | null | null | null | test_package/conanfile.py | ArsenStudio/conan-llvm | dd6cd5566ef399c6ee0cbaf6e990861eac7f8616 | [
"MIT"
] | null | null | null | import os
from conans import ConanFile, CMake, tools
class LlvmTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
# in "test_packa... | 26.576923 | 78 | 0.57453 |
79571e2304255e90ca1b1756040055c1b39308a9 | 17,635 | py | Python | wagtail-repository/wagtail/images/models.py | TobiasSkovgaardJepsen/wagtail-on-heroku | 17e4720f86023225e0704890688998a80bb87a17 | [
"BSD-3-Clause"
] | null | null | null | wagtail-repository/wagtail/images/models.py | TobiasSkovgaardJepsen/wagtail-on-heroku | 17e4720f86023225e0704890688998a80bb87a17 | [
"BSD-3-Clause"
] | 4 | 2020-06-05T17:00:01.000Z | 2021-06-17T20:15:01.000Z | wagtail-repository/wagtail/images/models.py | TobiasSkovgaardJepsen/wagtail-on-heroku | 17e4720f86023225e0704890688998a80bb87a17 | [
"BSD-3-Clause"
] | 1 | 2019-04-16T14:14:55.000Z | 2019-04-16T14:14:55.000Z | import hashlib
import os.path
from collections import OrderedDict
from contextlib import contextmanager
from io import BytesIO
from django.conf import settings
from django.core import checks
from django.core.files import File
from django.db import models
from django.forms.utils import flatatt
from django.urls import ... | 34.110251 | 111 | 0.616331 |
79571e313745fe5e8f743647c9e8bfff7e036f4d | 6,857 | py | Python | spyder_pylint/pylint.py | stonebig/spyder | 3556172888d8bb5dcc5f735676868a0d78d7d604 | [
"MIT"
] | 1 | 2016-05-26T13:26:21.000Z | 2016-05-26T13:26:21.000Z | spyder_pylint/pylint.py | ShenggaoZhu/spyder | 3556172888d8bb5dcc5f735676868a0d78d7d604 | [
"MIT"
] | null | null | null | spyder_pylint/pylint.py | ShenggaoZhu/spyder | 3556172888d8bb5dcc5f735676868a0d78d7d604 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Pylint Code Analysis Plugin."""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
# Standard library im... | 37.675824 | 80 | 0.601575 |
79571ec46799167719696ed8de7a1fb09e763929 | 6,647 | py | Python | common/wgain_.py | nokia/integratedimputation | ca72bda54cb66e99d79ff0b174cf8f99ccb554ba | [
"BSD-3-Clause"
] | 2 | 2022-01-13T13:05:38.000Z | 2022-01-17T10:06:58.000Z | common/wgain_.py | nokia/integratedimputation | ca72bda54cb66e99d79ff0b174cf8f99ccb554ba | [
"BSD-3-Clause"
] | null | null | null | common/wgain_.py | nokia/integratedimputation | ca72bda54cb66e99d79ff0b174cf8f99ccb554ba | [
"BSD-3-Clause"
] | null | null | null | # © 2021 Nokia
#
# Licensed under the BSD 3 Clause license
# SPDX-License-Identifier: BSD-3-Clause
# http://proceedings.mlr.press/v80/yoon18a/yoon18a.pdf
from defaults import *
import utils
import numpy as np
import torch
import torch.autograd as autograd
# =====================================================... | 34.087179 | 108 | 0.529412 |
79571f285de18d684b88ed9b1dd2751afdce597c | 2,138 | py | Python | cradmin_legacy/demo/project/demo/urls.py | appressoas/cradmin_legacy | b9d024299333dd04c87c1031bd5be5778aa7f1f1 | [
"BSD-3-Clause"
] | null | null | null | cradmin_legacy/demo/project/demo/urls.py | appressoas/cradmin_legacy | b9d024299333dd04c87c1031bd5be5778aa7f1f1 | [
"BSD-3-Clause"
] | 17 | 2018-03-07T15:52:42.000Z | 2022-03-12T01:07:06.000Z | cradmin_legacy/demo/project/demo/urls.py | appressoas/cradmin_legacy | b9d024299333dd04c87c1031bd5be5778aa7f1f1 | [
"BSD-3-Clause"
] | 1 | 2018-07-23T22:13:45.000Z | 2018-07-23T22:13:45.000Z | from __future__ import unicode_literals
from django.conf import settings
from django.urls import path, include
from django.contrib import admin
from django.views import static
from cradmin_legacy.demo.listfilterdemo.cradmin import ListfilterDemoCrAdminInstance
from cradmin_legacy.demo.login_not_required_demo.cradmin ... | 57.783784 | 116 | 0.804022 |
79571fa2d047ee9d6be3b812af21bef2c023596a | 7,216 | py | Python | nova/api/openstack/compute/contrib/cloudpipe.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-02-21T19:19:11.000Z | 2020-02-21T19:19:11.000Z | nova/api/openstack/compute/contrib/cloudpipe.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/contrib/cloudpipe.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-07-24T09:15:58.000Z | 2020-07-24T09:15:58.000Z | # Copyright 2011 OpenStack Foundation
#
# 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 a... | 38.588235 | 79 | 0.625 |
7957216755a247acca13b837ab6622179b03d514 | 2,882 | py | Python | tests/integration/backward_compatible/smart_listener_test.py | pabloingino/hazelcast-python-client | 96be8576f404ef3bdae263e68b82295a4387aa4e | [
"Apache-2.0"
] | null | null | null | tests/integration/backward_compatible/smart_listener_test.py | pabloingino/hazelcast-python-client | 96be8576f404ef3bdae263e68b82295a4387aa4e | [
"Apache-2.0"
] | null | null | null | tests/integration/backward_compatible/smart_listener_test.py | pabloingino/hazelcast-python-client | 96be8576f404ef3bdae263e68b82295a4387aa4e | [
"Apache-2.0"
] | null | null | null | from tests.base import HazelcastTestCase
from tests.util import random_string, event_collector
from time import sleep
class SmartListenerTest(HazelcastTestCase):
@classmethod
def setUpClass(cls):
cls.rc = cls.create_rc()
cls.cluster = cls.create_cluster(cls.rc, None)
cls.m1 = cls.clust... | 36.025 | 83 | 0.656142 |
79572189589cbd1019da5370252a79e5b69de813 | 1,229 | py | Python | tools/MakeAllIntoOne.py | Nadern96/Realtime-Action-Recognition | 63db3f650909b0428acff94d59b3d3dd1803c676 | [
"MIT"
] | null | null | null | tools/MakeAllIntoOne.py | Nadern96/Realtime-Action-Recognition | 63db3f650909b0428acff94d59b3d3dd1803c676 | [
"MIT"
] | null | null | null | tools/MakeAllIntoOne.py | Nadern96/Realtime-Action-Recognition | 63db3f650909b0428acff94d59b3d3dd1803c676 | [
"MIT"
] | null | null | null | import os
import json
path = r"../data_proc/raw_skeletons/numbered/"
f= open("../data_proc/raw_skeletons/skeletons_info.txt", 'w+')
Classes = {'clap':1,
'hit':2,
'jump':3,
'kick':4,
'punch':5,
'push':6,
'run':7,
'shake':8,
'sit':9,
... | 22.759259 | 76 | 0.497152 |
795722381a7ef827c9276d3096b13566e9606f57 | 177 | py | Python | 50.powx-n/solution.py | tsonglew/leetcode-solution | abce0c36def55a8d3bf86fca531246a29920e771 | [
"Unlicense"
] | null | null | null | 50.powx-n/solution.py | tsonglew/leetcode-solution | abce0c36def55a8d3bf86fca531246a29920e771 | [
"Unlicense"
] | null | null | null | 50.powx-n/solution.py | tsonglew/leetcode-solution | abce0c36def55a8d3bf86fca531246a29920e771 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
class Solution:
def myPow(self, x, n):
"""
:type x: float
:type n: int
:rtype: float
"""
return pow(x, n) | 17.7 | 26 | 0.446328 |
795722b4c9d6ba838606113cae7e20e4a2dddb48 | 56,726 | py | Python | google/cloud/compute_v1/services/reservations/client.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | 19 | 2021-02-10T21:17:20.000Z | 2022-02-20T03:16:36.000Z | google/cloud/compute_v1/services/reservations/client.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | 121 | 2021-01-08T23:46:58.000Z | 2022-03-26T04:34:36.000Z | google/cloud/compute_v1/services/reservations/client.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | 20 | 2021-01-08T23:14:16.000Z | 2022-02-25T01:27:20.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.525903 | 107 | 0.600871 |
79572325fe643242e7bbec75c340edd2d1e870d4 | 5,088 | py | Python | care/facility/models/patient_consultation.py | biwin/care | 45063dc8f37272cbb27c69db9157a3aad4181e53 | [
"MIT"
] | null | null | null | care/facility/models/patient_consultation.py | biwin/care | 45063dc8f37272cbb27c69db9157a3aad4181e53 | [
"MIT"
] | null | null | null | care/facility/models/patient_consultation.py | biwin/care | 45063dc8f37272cbb27c69db9157a3aad4181e53 | [
"MIT"
] | null | null | null | from django.db import models
from multiselectfield import MultiSelectField
from care.facility.models import CATEGORY_CHOICES, PatientBaseModel
from care.facility.models.mixins.permissions.patient import PatientRelatedPermissionMixin
from care.facility.models.patient_base import ADMIT_CHOICES, CURRENT_HEALTH_CHOICES, S... | 47.551402 | 119 | 0.705582 |
795723714301151d6c05e622070708442b560840 | 4,867 | py | Python | src/selfcoin/common/ellipticcurve/math.py | wangyubin112/selfcoin | f53528645f7d500108c7a258f07a2551f933ce7b | [
"MIT"
] | null | null | null | src/selfcoin/common/ellipticcurve/math.py | wangyubin112/selfcoin | f53528645f7d500108c7a258f07a2551f933ce7b | [
"MIT"
] | null | null | null | src/selfcoin/common/ellipticcurve/math.py | wangyubin112/selfcoin | f53528645f7d500108c7a258f07a2551f933ce7b | [
"MIT"
] | null | null | null | from binascii import hexlify
def multiply(Xp, Yp, n, N, A, P):
"""
Fast way to multily point and scalar in elliptic curves
:param (Xp,Yp,Zp): First Point to mutiply
:param n: Scalar to mutiply
:param N: Order of the elliptic curve
:param P: Prime number in the module of the equation Y^2 = X^3... | 31.4 | 122 | 0.564619 |
795723f6f9b51fb56b78e60538a7ac01f0b3d67e | 367 | py | Python | crowdsourcing/serializers/requester.py | ramcn/demo2 | e5115d2354c2890ba004abedfe0d60c1bf602d5d | [
"MIT"
] | null | null | null | crowdsourcing/serializers/requester.py | ramcn/demo2 | e5115d2354c2890ba004abedfe0d60c1bf602d5d | [
"MIT"
] | null | null | null | crowdsourcing/serializers/requester.py | ramcn/demo2 | e5115d2354c2890ba004abedfe0d60c1bf602d5d | [
"MIT"
] | null | null | null | __author__ = 'elsabakiu'
from crowdsourcing import models
from datetime import datetime
from rest_framework import serializers
import json
class RequesterSerializer(serializers.ModelSerializer):
class Meta:
model = models.Requester
class RequesterRankingSerializer(serializers.ModelSerializer):
class... | 22.9375 | 62 | 0.792916 |
7957262be48f74d4e3b44c13532b3717a36da54a | 7,421 | py | Python | blink/biencoder/biencoder.py | pbmstrk/BLINK | 7380cf7d63ff76563f017adc39fa5729ba36742a | [
"MIT"
] | 865 | 2019-10-02T21:30:49.000Z | 2022-03-30T08:02:31.000Z | blink/biencoder/biencoder.py | pbmstrk/BLINK | 7380cf7d63ff76563f017adc39fa5729ba36742a | [
"MIT"
] | 96 | 2019-12-01T02:22:51.000Z | 2022-03-11T15:32:16.000Z | blink/biencoder/biencoder.py | pbmstrk/BLINK | 7380cf7d63ff76563f017adc39fa5729ba36742a | [
"MIT"
] | 167 | 2019-10-12T00:34:28.000Z | 2022-03-27T14:24:44.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm import tqdm
fro... | 35.004717 | 88 | 0.642232 |
79572651c46b30171ac8fa063dce50393c0efb2c | 22,513 | py | Python | Lib/site-packages/django/db/backends/base/operations.py | ashutoshsuman99/Web-Blog-D19 | a01a0ccc40e8823110c01ebe4f43d9351df57295 | [
"bzip2-1.0.6"
] | 123 | 2015-01-15T06:56:45.000Z | 2022-03-19T22:18:55.000Z | Lib/site-packages/django/db/backends/base/operations.py | ashutoshsuman99/Web-Blog-D19 | a01a0ccc40e8823110c01ebe4f43d9351df57295 | [
"bzip2-1.0.6"
] | 21 | 2015-03-25T18:00:33.000Z | 2019-08-12T17:11:10.000Z | Lib/site-packages/django/db/backends/base/operations.py | ashutoshsuman99/Web-Blog-D19 | a01a0ccc40e8823110c01ebe4f43d9351df57295 | [
"bzip2-1.0.6"
] | 72 | 2015-01-14T16:29:47.000Z | 2021-10-09T16:31:47.000Z | import datetime
import decimal
import warnings
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duration
from django.utils.dep... | 38.028716 | 117 | 0.649314 |
795726afa77176a53ffe9d8950105c7bc5fa77ec | 1,521 | py | Python | neural_mmo/jsuarez/oldMobs.py | jyotishp/neural-mmo | a51187b922957921cacce64ebbda34e26ee4253e | [
"MIT"
] | null | null | null | neural_mmo/jsuarez/oldMobs.py | jyotishp/neural-mmo | a51187b922957921cacce64ebbda34e26ee4253e | [
"MIT"
] | null | null | null | neural_mmo/jsuarez/oldMobs.py | jyotishp/neural-mmo | a51187b922957921cacce64ebbda34e26ee4253e | [
"MIT"
] | null | null | null | #NPC definitions with AI overrides per NPC, as required.
from neural_mmo.forge.blade.entity import NPC
from neural_mmo.forge.blade.item import Item, RawMeat, Sword
from neural_mmo.forge.blade.lib import AI
from neural_mmo.forge.blade.lib.Enums import Material
from neural_mmo.forge.blade.modules import DropTable, Skill... | 31.6875 | 71 | 0.671269 |
795728859e4e39399dfc7ec104be7902219b7b01 | 830 | py | Python | code/generic/updates.py | ElliotMunro200/reinforcement_learning_an_introduction | c4fccb46a4bb00955549be3505144ec49f0132e5 | [
"MIT"
] | 234 | 2018-09-01T00:26:29.000Z | 2022-03-21T03:55:50.000Z | code/generic/updates.py | 15779235038/reinforcement_learning_an_introduction | a0ac9e5da6eaeae14d297a560c499d1a6e579c2a | [
"MIT"
] | 7 | 2018-11-29T21:04:36.000Z | 2021-12-13T17:11:50.000Z | code/generic/updates.py | 15779235038/reinforcement_learning_an_introduction | a0ac9e5da6eaeae14d297a560c499d1a6e579c2a | [
"MIT"
] | 63 | 2018-07-31T04:53:21.000Z | 2022-03-24T04:03:43.000Z | #!/usr/bin/env python
"""
--------------------------------
project: code
created: 27/06/2018 11:43
---------------------------------
update action-value dictionaries in-place
"""
from generic.policies import greedy
def sarsa(action_values, old_state, action, reward, new_state, new_action, alpha, gamma):
"""upda... | 29.642857 | 100 | 0.650602 |
795728879ef5694bd3e33f38c9827de0f4d853fa | 1,750 | py | Python | tools/perf/page_sets/simple_mobile_sites.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | tools/perf/page_sets/simple_mobile_sites.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | tools/perf/page_sets/simple_mobile_sites.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class SimplePage(page_module.Page):
... | 32.407407 | 80 | 0.729143 |
795728bbbf4c5976f3f7407491f379c65a702939 | 6,143 | py | Python | data_processing/ted_reader.py | cordercorder/NMT | cbc5ad010ce04da7a82f05ad1a3b6c16f8467266 | [
"MIT"
] | 6 | 2020-08-17T16:11:18.000Z | 2020-10-10T12:26:03.000Z | data_processing/ted_reader.py | cordercorder/NMT | cbc5ad010ce04da7a82f05ad1a3b6c16f8467266 | [
"MIT"
] | 1 | 2020-07-11T16:42:55.000Z | 2020-07-12T12:58:18.000Z | data_processing/ted_reader.py | cordercorder/NMT | cbc5ad010ce04da7a82f05ad1a3b6c16f8467266 | [
"MIT"
] | 2 | 2020-10-10T12:22:46.000Z | 2021-11-12T15:39:27.000Z | import itertools
import os
import csv
from collections import defaultdict
from six.moves import zip
class MultiLingualAlignedCorpusReader(object):
"""A class to read TED talk dataset
"""
def __init__(self, corpus_path, delimiter='\t',
target_token=True, bilingual=True, corpus_type='file'... | 37.457317 | 92 | 0.555103 |
79572962d250ab5526c6532836d18a6650053b9d | 16,108 | py | Python | fluids/state.py | iandewancker/Urban_Driving_Simulator | fff001cb7a58a3e4ef84415de6244e520af8ec55 | [
"MIT"
] | null | null | null | fluids/state.py | iandewancker/Urban_Driving_Simulator | fff001cb7a58a3e4ef84415de6244e520af8ec55 | [
"MIT"
] | null | null | null | fluids/state.py | iandewancker/Urban_Driving_Simulator | fff001cb7a58a3e4ef84415de6244e520af8ec55 | [
"MIT"
] | null | null | null | import numpy as np
import json
import os
from six import iteritems
import random
import pygame
import hashlib
from fluids.consts import *
from fluids.assets import *
from fluids.utils import *
from fluids.version import __version__
basedir = os.path.dirname(__file__)
id_index = 0
def get_id():
global id_index
... | 40.987277 | 95 | 0.529364 |
79572a728663c943add2d6c7486bc9bea8f8ecae | 2,712 | py | Python | examples/plan_marginal.py | thibsej/unbalanced-ot-functionals | bfd098e98ed10b90a36e0dbe7b099c1c31770931 | [
"MIT"
] | 14 | 2019-12-04T12:41:12.000Z | 2022-03-30T11:37:00.000Z | examples/plan_marginal.py | thibsej/unbalanced-ot-functionals | bfd098e98ed10b90a36e0dbe7b099c1c31770931 | [
"MIT"
] | 1 | 2022-01-14T16:35:18.000Z | 2022-01-18T09:15:03.000Z | examples/plan_marginal.py | thibsej/unbalanced-ot-functionals | bfd098e98ed10b90a36e0dbe7b099c1c31770931 | [
"MIT"
] | 3 | 2020-10-09T08:24:22.000Z | 2022-02-18T15:48:35.000Z | import os
import torch
import numpy as np
import matplotlib.pyplot as plt
from unbalancedot.utils import euclidean_cost
from unbalancedot.sinkhorn import BatchVanillaSinkhorn
from unbalancedot.entropy import (
KullbackLeibler,
Balanced,
TotalVariation,
Range,
PowerEntropy,
)
path = os.getcwd() + ... | 25.584906 | 69 | 0.586283 |
79572b5dc9ef668d065237c374c2b619290992c2 | 1,329 | py | Python | IMU/VTK-6.2.0/Imaging/Core/Testing/Python/TestShiftScale.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 4 | 2016-03-30T14:31:52.000Z | 2019-02-02T05:01:32.000Z | IMU/VTK-6.2.0/Imaging/Core/Testing/Python/TestShiftScale.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | null | null | null | IMU/VTK-6.2.0/Imaging/Core/Testing/Python/TestShiftScale.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Shift and scale an image (in that order)
# This filter is useful for converting to a lower precision data type.
reader = vtk.vtkImageReader()
reader.GetExecutive().SetRelea... | 34.076923 | 71 | 0.787058 |
79572bc889d58cdb4e78e11fea2674c0a9662dab | 1,320 | py | Python | aliyun-python-sdk-csb/aliyunsdkcsb/request/v20171118/GetProjectRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-csb/aliyunsdkcsb/request/v20171118/GetProjectRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-csb/aliyunsdkcsb/request/v20171118/GetProjectRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.675676 | 69 | 0.759091 |
79572d319cb9ac6a60fa0748e39983dedd2cc62f | 1,929 | py | Python | Cfg/cfg.py | cedo1995/GenRS | a63a2d694b38e3e14727f55220afcbbd020afd55 | [
"MIT"
] | null | null | null | Cfg/cfg.py | cedo1995/GenRS | a63a2d694b38e3e14727f55220afcbbd020afd55 | [
"MIT"
] | null | null | null | Cfg/cfg.py | cedo1995/GenRS | a63a2d694b38e3e14727f55220afcbbd020afd55 | [
"MIT"
] | null | null | null | import sys
import json
# Configuration class
class Cfg:
def __init__(self):
pass
@staticmethod
def load_conf(path="./cfg.JSON"):
"""
Loads a .JSON file, used for framework configuration or hyperparam configuration
:param path: path to .JSON file
:return settings: ... | 30.140625 | 122 | 0.617937 |
79572dd0e97cb1c57d23ce5a7dd7adbc8a9237ca | 3,895 | py | Python | utils.py | mbroso/constraintnet_foc | c0c4e3674c6fde87d41118cef3cae8a3a5e22a17 | [
"MIT"
] | null | null | null | utils.py | mbroso/constraintnet_foc | c0c4e3674c6fde87d41118cef3cae8a3a5e22a17 | [
"MIT"
] | null | null | null | utils.py | mbroso/constraintnet_foc | c0c4e3674c6fde87d41118cef3cae8a3a5e22a17 | [
"MIT"
] | null | null | null | """Utils. Containing several helper function and classes.
"""
import numpy as np
import torch
import signal
import matplotlib
import matplotlib.pyplot as plt
import gym
from AccFocEnv.plotter import Plotter
# Allows to change training device.
device = torch.device("cpu")
def load_env(opts, dont_rende... | 30.669291 | 88 | 0.61027 |
79572e4b098b8a6b1a1f181adcaa0951c47cc78e | 3,891 | py | Python | VLC_Multicell/lifi_multicell/views.py | openvlc/OpenVLC | b627beac46dfc8ab8e741ed71df3dff4a18bf955 | [
"BSD-3-Clause"
] | 52 | 2018-10-13T16:39:35.000Z | 2022-03-19T18:16:54.000Z | VLC_Multicell/lifi_multicell/views.py | Sadaina/OpenVLC | c6b745960a94ef15074b7802931ac63180a9a529 | [
"BSD-3-Clause"
] | 6 | 2021-06-25T14:42:29.000Z | 2021-06-25T21:37:43.000Z | VLC_Multicell/lifi_multicell/views.py | Sadaina/SadainaVLC | c6b745960a94ef15074b7802931ac63180a9a529 | [
"BSD-3-Clause"
] | 28 | 2018-10-13T16:39:52.000Z | 2022-03-28T19:19:51.000Z | import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from lifi_multicell.constants import *
import lifi_multicell.widgets as w
from lifi_multicell.controller import Controller
class MainView(tk.Frame):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.c = Contr... | 36.707547 | 127 | 0.621177 |
79572eb7b598edd00d2b3a2ee976438f7f7a423e | 643 | py | Python | py-faster-rcnn/lib/fast_rcnn/nms_wrapper.py | pierre-ecarlat/food_detection | c23f328d1b04c4a97bbfdaa49846507115bd2c7e | [
"BSD-2-Clause"
] | null | null | null | py-faster-rcnn/lib/fast_rcnn/nms_wrapper.py | pierre-ecarlat/food_detection | c23f328d1b04c4a97bbfdaa49846507115bd2c7e | [
"BSD-2-Clause"
] | null | null | null | py-faster-rcnn/lib/fast_rcnn/nms_wrapper.py | pierre-ecarlat/food_detection | c23f328d1b04c4a97bbfdaa49846507115bd2c7e | [
"BSD-2-Clause"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from fast_rcnn.config import cfg
from nms.gpu_nms import gpu_nms
from n... | 30.619048 | 60 | 0.575428 |
79572f77eded687a173638e5d3f730d69c32d42e | 9,408 | py | Python | uw_spotseeker/tests/test_spot.py | devights/uw-restclients-spotseeker | d692773b4b3b6057c94748f35ba7d602cd53d016 | [
"Apache-2.0"
] | 1 | 2018-05-03T00:45:07.000Z | 2018-05-03T00:45:07.000Z | uw_spotseeker/tests/test_spot.py | devights/uw-restclients-spotseeker | d692773b4b3b6057c94748f35ba7d602cd53d016 | [
"Apache-2.0"
] | 4 | 2019-12-16T19:49:21.000Z | 2022-01-19T01:59:44.000Z | uw_spotseeker/tests/test_spot.py | uw-it-aca/uw-restclients-spotseeker | 42b5dae637bcde875b27b32a37fe4dd9f867c537 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from uw_spotseeker import Spotseeker
from uw_spotseeker.utilities import fdao_spotseeker_override
from restclients_core.exceptions import (
DataFailureException)
from unittest import TestCase
from PIL import Image
import dateuti... | 42.958904 | 77 | 0.633291 |
79572fba8586691f8f62990e086c77d0fdcaa37e | 3,877 | py | Python | mushr_rhc_ros/src/mingpt/model_resnetdirect.py | rogeriobonatti/mushr_rhc | 8316cad6544997c1742cc5f5b539f5886eb00e7f | [
"BSD-3-Clause"
] | null | null | null | mushr_rhc_ros/src/mingpt/model_resnetdirect.py | rogeriobonatti/mushr_rhc | 8316cad6544997c1742cc5f5b539f5886eb00e7f | [
"BSD-3-Clause"
] | null | null | null | mushr_rhc_ros/src/mingpt/model_resnetdirect.py | rogeriobonatti/mushr_rhc | 8316cad6544997c1742cc5f5b539f5886eb00e7f | [
"BSD-3-Clause"
] | null | null | null | """
GPT model:
- the initial stem consists of a combination of token encoding and a positional encoding
- the meat of it is a uniform sequence of Transformer blocks
- each Transformer is a sequential combination of a 1-hidden-layer MLP block and a self-attention block
- all blocks feed into a central residual p... | 34.616071 | 125 | 0.66082 |
79572ff9f733a4ca33f1dd4ba2c1a114c25cacdf | 3,614 | py | Python | PaddleCV/metric_learning/eval.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 5 | 2021-09-28T13:28:01.000Z | 2021-12-21T07:25:44.000Z | PaddleCV/metric_learning/eval.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | null | null | null | PaddleCV/metric_learning/eval.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 3 | 2021-09-28T15:33:45.000Z | 2021-09-29T01:44:32.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 32.854545 | 94 | 0.683177 |
795730b00ff3293429e80e108e77b0238982f206 | 625 | py | Python | invenio_subjects_gnd/writer.py | ulbmuenster/invenio-subjects-gnd | 20fc042df2675ee59d9def4b96e77ceb7035841c | [
"MIT"
] | null | null | null | invenio_subjects_gnd/writer.py | ulbmuenster/invenio-subjects-gnd | 20fc042df2675ee59d9def4b96e77ceb7035841c | [
"MIT"
] | 2 | 2022-01-27T09:46:26.000Z | 2022-02-03T12:03:59.000Z | invenio_subjects_gnd/writer.py | ulbmuenster/invenio-subjects-gnd | 20fc042df2675ee59d9def4b96e77ceb7035841c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Northwestern University.
# Copyright (C) 2022 University of Münster.
#
# invenio-subjects-gnd is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""GND subjects_gnd.yaml writer."""
from pa... | 21.551724 | 73 | 0.688 |
7957319283ec8e1c961dcbf617e8d00eb10094b4 | 85,839 | py | Python | Bio/Restriction/Restriction.py | rchurt/biopython | 4e9a15172ba26bae104eaa7f05819cd6d41d0da8 | [
"BSD-3-Clause"
] | 2 | 2020-06-25T12:52:03.000Z | 2020-07-11T09:47:34.000Z | Bio/Restriction/Restriction.py | EmmanuelOwusu/biopython | 4e9a15172ba26bae104eaa7f05819cd6d41d0da8 | [
"BSD-3-Clause"
] | null | null | null | Bio/Restriction/Restriction.py | EmmanuelOwusu/biopython | 4e9a15172ba26bae104eaa7f05819cd6d41d0da8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Restriction Analysis Libraries.
# Copyright (C) 2004. Frederic Sohm.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
"""Restriction Enzyme classes.
Notes abou... | 31.721729 | 87 | 0.559909 |
795731e8b34c63fd3198fba82e6ae88c169d68e0 | 6,127 | py | Python | work_dirs/deeplabv3_r50-d8_512x512_4x4_80k_coco_stuff10k/deeplabv3_r50-d8_512x512_4x4_80k_coco_stuff10k.py | Junjun2016/COCO-Stuff_benchmark | d303d4606798b746bacc6a7f6df0274e6ce2fb21 | [
"Apache-2.0"
] | 3 | 2021-08-31T05:49:13.000Z | 2021-12-05T13:03:44.000Z | work_dirs/deeplabv3_r50-d8_512x512_4x4_80k_coco_stuff10k/deeplabv3_r50-d8_512x512_4x4_80k_coco_stuff10k.py | Junjun2016/COCO-Stuff_benchmark | d303d4606798b746bacc6a7f6df0274e6ce2fb21 | [
"Apache-2.0"
] | null | null | null | work_dirs/deeplabv3_r50-d8_512x512_4x4_80k_coco_stuff10k/deeplabv3_r50-d8_512x512_4x4_80k_coco_stuff10k.py | Junjun2016/COCO-Stuff_benchmark | d303d4606798b746bacc6a7f6df0274e6ce2fb21 | [
"Apache-2.0"
] | null | null | null | norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=(1, 2, 1, 1),
... | 35.830409 | 79 | 0.551167 |
7957323299a587c9d991359973b60295d8de3d17 | 40,263 | py | Python | tests/file_storage/tests.py | cdunn6754/django | 1e87c9fe71703fab23039aa63fafe4f6aac98bbc | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-16T05:38:54.000Z | 2020-09-16T05:38:54.000Z | tests/file_storage/tests.py | cdunn6754/django | 1e87c9fe71703fab23039aa63fafe4f6aac98bbc | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/file_storage/tests.py | cdunn6754/django | 1e87c9fe71703fab23039aa63fafe4f6aac98bbc | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-10-29T22:04:21.000Z | 2019-10-29T22:04:21.000Z | import os
import shutil
import sys
import tempfile
import threading
import time
import unittest
from datetime import datetime, timedelta
from io import StringIO
from urllib.request import urlopen
from django.core.cache import cache
from django.core.exceptions import SuspiciousFileOperation
from django.core.files.base ... | 40.343687 | 113 | 0.653081 |
7957323a1b2d918cf0de85a6a1a0b87814fa0c01 | 3,478 | py | Python | Ago-Dic-2019/Horacio Góngora/Practica 1/3-4 a 3-7.py | Andremm303/DAS_Sistemas | 0163505737e2b24365ea8b4e8135773a6801add4 | [
"MIT"
] | null | null | null | Ago-Dic-2019/Horacio Góngora/Practica 1/3-4 a 3-7.py | Andremm303/DAS_Sistemas | 0163505737e2b24365ea8b4e8135773a6801add4 | [
"MIT"
] | null | null | null | Ago-Dic-2019/Horacio Góngora/Practica 1/3-4 a 3-7.py | Andremm303/DAS_Sistemas | 0163505737e2b24365ea8b4e8135773a6801add4 | [
"MIT"
] | null | null | null | '''3-4. Guest List: If you could invite anyone, living or deceased, to dinner, who
would you invite? Make a list that includes at least three people you’d like to
invite to dinner. Then use your list to print a message to each person, inviting
them to dinner.'''
guests = ['Angelina Jolie', 'Jennifer Aniston', 'Adam Sa... | 48.305556 | 125 | 0.747269 |
7957325d21552aa53367ca42b788f1e77c0cd438 | 725 | py | Python | var/spack/repos/builtin.mock/packages/dev-build-test-install-phases/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-03-05T10:54:32.000Z | 2021-03-05T14:14:52.000Z | var/spack/repos/builtin.mock/packages/dev-build-test-install-phases/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin.mock/packages/dev-build-test-install-phases/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from time import sleep
class DevBuildTestInstallPhases(Package):
homepage = "example.com"
url = "fake.com"
... | 23.387097 | 73 | 0.637241 |
795732a8c0e281cdfac7da10096227b4e0e8a06e | 1,318 | py | Python | smallab/runner_implementations/main_process_runner.py | imrf6/smallab | 519530c798e5eb0df8227f65a444afdb4ab1daad | [
"BSD-2-Clause"
] | 5 | 2019-11-01T20:55:40.000Z | 2021-06-17T06:15:32.000Z | smallab/runner_implementations/main_process_runner.py | imrf6/smallab | 519530c798e5eb0df8227f65a444afdb4ab1daad | [
"BSD-2-Clause"
] | 58 | 2019-11-01T18:02:20.000Z | 2021-08-31T21:54:41.000Z | smallab/runner_implementations/main_process_runner.py | imrf6/smallab | 519530c798e5eb0df8227f65a444afdb4ab1daad | [
"BSD-2-Clause"
] | 2 | 2020-05-06T23:29:05.000Z | 2020-10-07T05:07:09.000Z | import logging
import typing
from tqdm import tqdm
from smallab.runner_implementations.abstract_runner import SimpleAbstractRunner
from smallab.smallab_types import Specification
from smallab.utilities.tqdm_to_logger import TqdmToLogger
class MainRunner(SimpleAbstractRunner):
"""
The simplest runner which r... | 37.657143 | 102 | 0.695751 |
7957331e2ee767048e7f60fbcae6dcdac17fcbaa | 12,796 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_quotas.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-22T01:04:39.000Z | 2020-03-22T01:04:39.000Z | .v/lib/python3.6/site-packages/ansible/modules/storage/netapp/na_ontap_quotas.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | null | null | null | .v/lib/python3.6/site-packages/ansible/modules/storage/netapp/na_ontap_quotas.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],... | 37.089855 | 114 | 0.592685 |
79573410fbdc7696120118aa533d8294268ccad0 | 4,869 | py | Python | payabbhi/resources/virtual_account.py | ppm-avinder/payabbhi-python | 0f84f01349e365753f4b83eee584618e1a855567 | [
"MIT"
] | 1 | 2018-03-06T08:30:38.000Z | 2018-03-06T08:30:38.000Z | payabbhi/resources/virtual_account.py | ppm-avinder/payabbhi-python | 0f84f01349e365753f4b83eee584618e1a855567 | [
"MIT"
] | null | null | null | payabbhi/resources/virtual_account.py | ppm-avinder/payabbhi-python | 0f84f01349e365753f4b83eee584618e1a855567 | [
"MIT"
] | 5 | 2018-10-08T05:56:44.000Z | 2020-05-22T11:31:07.000Z | from ..error import InvalidRequestError
from .api_resource import APIResource
class VirtualAccount(APIResource):
def __init__(self, client=None):
super(VirtualAccount, self).__init__(client)
def all(self, data=None, **kwargs):
""""
Get all Virtual Accounts.
Args:
... | 52.354839 | 189 | 0.62559 |
7957348f87371d3b2bccbdd8269aacf90a5fbf9c | 3,088 | py | Python | pytorch_dqn/visualize.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | null | null | null | pytorch_dqn/visualize.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | 6 | 2021-03-18T21:24:56.000Z | 2022-03-11T23:34:25.000Z | pytorch_dqn/visualize.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
vis = None
cum_rwd_f = None
goal_f = None
avg_rwd_f = None
last_epsilon_f = None
steps_goal = None
expected_q_value = None
cum_rwd_e = None
def visdom_plot(what, x, x_label, y, y_label, where='main'):
from visdom import Visdom
global vis
global cum_rwd_f
global goal_f
global ... | 22.215827 | 60 | 0.435557 |
795734b7e0dee3908488124c867ebe95445652f6 | 1,915 | py | Python | benchmark/tests/test_14.py | trxw/qutip | b923c973edd9a071d86eb849650661549f73585f | [
"BSD-3-Clause"
] | 1 | 2015-11-06T06:35:06.000Z | 2015-11-06T06:35:06.000Z | benchmark/tests/test_14.py | trxw/qutip | b923c973edd9a071d86eb849650661549f73585f | [
"BSD-3-Clause"
] | null | null | null | benchmark/tests/test_14.py | trxw/qutip | b923c973edd9a071d86eb849650661549f73585f | [
"BSD-3-Clause"
] | null | null | null | from qutip import *
from numpy import *
from time import time
def test_14(runs=1):
"""
mcsolve evolution of 8-spin chain
"""
test_name='8-spin MC [256]'
N = 6# number of spins
# uniform parameters
h = 1.0 * 2 * pi * ones(N)
Jz = 0.1 * 2 * pi * ones(N)
Jx = 0.1 * 2 * pi * ones(N)
... | 25.533333 | 66 | 0.543603 |
7957358944f3c0d20f1ee1459cec3381ef00f625 | 765 | py | Python | test/conftest.py | cybergarage/uecho-py | 6b0dc72b9c3770d79b812bad75ea201c820b089a | [
"Apache-2.0"
] | null | null | null | test/conftest.py | cybergarage/uecho-py | 6b0dc72b9c3770d79b812bad75ea201c820b089a | [
"Apache-2.0"
] | null | null | null | test/conftest.py | cybergarage/uecho-py | 6b0dc72b9c3770d79b812bad75ea201c820b089a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021 Satoshi Konno. 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 law... | 30.6 | 74 | 0.746405 |
795736587201c3ebcb597e1370ec5a7861c883ec | 648 | py | Python | autograder-master/autograder/checks/required_files_present_check.py | Diana1320622/AILabs | 315a6f4b8f8dd60e4f53d348e06e23b4d827d179 | [
"MIT"
] | null | null | null | autograder-master/autograder/checks/required_files_present_check.py | Diana1320622/AILabs | 315a6f4b8f8dd60e4f53d348e06e23b4d827d179 | [
"MIT"
] | null | null | null | autograder-master/autograder/checks/required_files_present_check.py | Diana1320622/AILabs | 315a6f4b8f8dd60e4f53d348e06e23b4d827d179 | [
"MIT"
] | null | null | null | from base_check import BaseCheck
import os
class RequiredFilesPresentCheck(BaseCheck):
def __init__(self, context):
super(RequiredFilesPresentCheck, self).__init__(context)
def run(self):
required_files = ['report.pdf']
for required_file in required_files:
self.check_presen... | 34.105263 | 77 | 0.674383 |
7957367cb6ac56650c2ce0f6ddc135fab3831208 | 3,833 | py | Python | python/demos/linear_quadratic_partial.py | machines-in-motion/dynamic_game_optimizer | 5849ae11918f68f346aa4a869d57fc8242162f5c | [
"BSD-3-Clause"
] | null | null | null | python/demos/linear_quadratic_partial.py | machines-in-motion/dynamic_game_optimizer | 5849ae11918f68f346aa4a869d57fc8242162f5c | [
"BSD-3-Clause"
] | null | null | null | python/demos/linear_quadratic_partial.py | machines-in-motion/dynamic_game_optimizer | 5849ae11918f68f346aa4a869d57fc8242162f5c | [
"BSD-3-Clause"
] | null | null | null | import os, sys, time
from cv2 import solve
src_path = os.path.abspath("../")
sys.path.append(src_path)
import numpy as np
import crocoddyl
from models import lin_quad_action as lin_quad
import matplotlib.pyplot as plt
from utils.measurements import FullStateMeasurement, MeasurementTrajectory
from solvers.partial impo... | 38.33 | 120 | 0.669189 |
7957369f10d91dd5389ee6410c5847cbbb2d8c1b | 10,567 | py | Python | clk/alias.py | Konubinix/click_project | be0d52e8babb2df4bcf58208d067609ed3bf20d6 | [
"MIT"
] | 9 | 2021-08-12T08:49:47.000Z | 2021-11-10T17:23:34.000Z | clk/alias.py | Konubinix/click_project | be0d52e8babb2df4bcf58208d067609ed3bf20d6 | [
"MIT"
] | 1 | 2022-01-21T20:49:20.000Z | 2022-01-24T21:23:15.000Z | clk/alias.py | Konubinix/click_project | be0d52e8babb2df4bcf58208d067609ed3bf20d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import shlex
import click
from clk.commandresolver import CommandResolver
from clk.config import config
from clk.core import get_ctx, run
from clk.decorators import pass_context
from clk.flow import clean_flow_arguments, flowdeps
from clk.lib import ordered_unique, quote... | 42.608871 | 118 | 0.581433 |
795736d5ae279c4934533ca155028dbd9dd18a7e | 62,631 | py | Python | tests/common.py | cyyynthia/emscripten | 9ee232c0eb562cb1fed229a6ece80645d0ab4db5 | [
"MIT"
] | 10 | 2021-09-13T20:36:34.000Z | 2021-10-19T10:46:25.000Z | tests/common.py | cyyynthia/emscripten | 9ee232c0eb562cb1fed229a6ece80645d0ab4db5 | [
"MIT"
] | null | null | null | tests/common.py | cyyynthia/emscripten | 9ee232c0eb562cb1fed229a6ece80645d0ab4db5 | [
"MIT"
] | null | null | null | # Copyright 2021 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from enum import Enum
from functools import wraps
from pathlib import... | 37.638822 | 205 | 0.648145 |
7957397709d9c058dd519f8dbbb734869b6cb252 | 15,433 | py | Python | ndmg/scripts/ndmg_cloud.py | luochuankai-JHU/ndmg | 1307cc4dbaf84e33d61b13a6f83f9bcc4e5cfad6 | [
"Apache-2.0"
] | null | null | null | ndmg/scripts/ndmg_cloud.py | luochuankai-JHU/ndmg | 1307cc4dbaf84e33d61b13a6f83f9bcc4e5cfad6 | [
"Apache-2.0"
] | 14 | 2018-09-12T15:02:01.000Z | 2019-11-13T16:13:56.000Z | ndmg/scripts/ndmg_cloud.py | luochuankai-JHU/ndmg | 1307cc4dbaf84e33d61b13a6f83f9bcc4e5cfad6 | [
"Apache-2.0"
] | 2 | 2018-10-23T21:47:09.000Z | 2019-10-30T00:43:05.000Z | #!/usr/bin/env python
# Copyright 2016 NeuroData (http://neurodata.io)
#
# 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 ... | 31.952381 | 129 | 0.57403 |
79573a8bb6e9d2c63db90cbe052b63d2b566ce22 | 644 | py | Python | basics/lamdaFunctions.py | pktippa/python-basics | 329f048dc312cc2bcc308934142b0aa766d77307 | [
"MIT"
] | 1 | 2018-02-01T10:07:18.000Z | 2018-02-01T10:07:18.000Z | basics/lamdaFunctions.py | pktippa/python-basics | 329f048dc312cc2bcc308934142b0aa766d77307 | [
"MIT"
] | 1 | 2018-10-02T12:27:41.000Z | 2018-10-02T12:27:41.000Z | basics/lamdaFunctions.py | pktippa/python-basics | 329f048dc312cc2bcc308934142b0aa766d77307 | [
"MIT"
] | 1 | 2018-10-02T02:20:36.000Z | 2018-10-02T02:20:36.000Z | # Lambdas are functions without names, in other words they are anonymous functions.
# They take inputs and return outputs but do not have a name.
# They are shortcuts to create simple temporary functions.
# Like functions Lambda expressions cannot have multiple statements
h = lambda x: x >40 and x< 50
print(h(45))... | 23 | 84 | 0.67236 |
79573ab752bf0bd702a6a0cc7878acb3c5efd9d6 | 1,280 | py | Python | wsdetect/settings.py | Marcnuth/white-screenshot-detection | 8ff75d8e2b91eeed499d232a5967c1e6c20fd6b5 | [
"Apache-2.0"
] | null | null | null | wsdetect/settings.py | Marcnuth/white-screenshot-detection | 8ff75d8e2b91eeed499d232a5967c1e6c20fd6b5 | [
"Apache-2.0"
] | null | null | null | wsdetect/settings.py | Marcnuth/white-screenshot-detection | 8ff75d8e2b91eeed499d232a5967c1e6c20fd6b5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# coding=utf-8
import os
from pathlib import Path
import logging
from logging.config import dictConfig
# Constant directory & files
DIR_BASE = Path(os.path.dirname(os.path.realpath(__file__))).parent
RESOURCE_DIR = DIR_BASE / 'resources'
LOGGING_FILE = Path('/tmp/wsdetect.log')
# Logging
dictConfig... | 28.444444 | 141 | 0.551563 |
79573b7933fdcae7c9793ef1e76eb9002290e3cd | 12,791 | py | Python | src/unit_parse/core.py | dylanwal/unit_parse | 07a74d43b9f161bd7ad6ef12ab0f362f1bf6a90d | [
"BSD-3-Clause"
] | 1 | 2022-01-29T17:14:40.000Z | 2022-01-29T17:14:40.000Z | src/unit_parse/core.py | dylanwal/unit_parse | 07a74d43b9f161bd7ad6ef12ab0f362f1bf6a90d | [
"BSD-3-Clause"
] | null | null | null | src/unit_parse/core.py | dylanwal/unit_parse | 07a74d43b9f161bd7ad6ef12ab0f362f1bf6a90d | [
"BSD-3-Clause"
] | null | null | null | """
Core
This code does the heavy lifting of turning strings into Quantities. Its the functions that need to deal with the
most mess.
"""
from typing import List, Union
import re
from unit_parse.config import Unit, Quantity, config
from unit_parse.pre_processing_substitution import sub_general
from unit_parse.utils ... | 25.179134 | 113 | 0.543898 |
79573c6177847546cbaea38eefe03f75023b7ecc | 16,266 | py | Python | exe/portable-python/App/Lib/email/_parseaddr.py | jaredmusil/iawsc-data-toolbox | 65b97d45e13813935017f8b3c5726784027b065f | [
"MIT"
] | null | null | null | exe/portable-python/App/Lib/email/_parseaddr.py | jaredmusil/iawsc-data-toolbox | 65b97d45e13813935017f8b3c5726784027b065f | [
"MIT"
] | 1 | 2018-04-15T22:59:15.000Z | 2018-04-15T22:59:15.000Z | exe/portable-python/App/Lib/email/_parseaddr.py | jaredmusil/iawsc-data-toolbox | 65b97d45e13813935017f8b3c5726784027b065f | [
"MIT"
] | null | null | null | # Copyright (C) 2002-2007 Python Software Foundation
# Contact: email-sig@python.org
"""Email address parsing code.
Lifted directly from rfc822.py. This should eventually be rewritten.
"""
__all__ = [
'mktime_tz',
'parsedate',
'parsedate_tz',
'quote',
]
import time, calendar
SPACE = ' '
EMPTYS... | 31.769531 | 79 | 0.529878 |
79573c8322db1e9a8981a6a69ac3a343273b0ad1 | 2,819 | py | Python | workers/test-delay/python/workerTestDelay.py | getgearbox/gearbox | 7366083a2fa03fd7a020bfb63331c44c0c470ece | [
"Artistic-1.0-Perl",
"BSD-3-Clause"
] | 1 | 2015-04-24T16:47:43.000Z | 2015-04-24T16:47:43.000Z | workers/test-delay/python/workerTestDelay.py | getgearbox/gearbox | 7366083a2fa03fd7a020bfb63331c44c0c470ece | [
"Artistic-1.0-Perl",
"BSD-3-Clause"
] | null | null | null | workers/test-delay/python/workerTestDelay.py | getgearbox/gearbox | 7366083a2fa03fd7a020bfb63331c44c0c470ece | [
"Artistic-1.0-Perl",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
from gearbox import Worker
def file_get_contents(filename):
with open(filename, 'r') as f:
contents = f.read()
return contents
def file_put_contents(filename, contents):
with open(filename, 'wb') as f:
f.write(contents)
class WorkerTestDelay... | 32.77907 | 72 | 0.645974 |
79573cd29f813a75888eb49d6fd55b26d18f882f | 4,447 | py | Python | colour/models/rgb/transfer_functions/itur_bt_1886.py | jchwei/colour | 2b2ad0a0f2052a1a0b4b076b489687235e804fdf | [
"BSD-3-Clause"
] | null | null | null | colour/models/rgb/transfer_functions/itur_bt_1886.py | jchwei/colour | 2b2ad0a0f2052a1a0b4b076b489687235e804fdf | [
"BSD-3-Clause"
] | null | null | null | colour/models/rgb/transfer_functions/itur_bt_1886.py | jchwei/colour | 2b2ad0a0f2052a1a0b4b076b489687235e804fdf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ITU-R BT.1886
=============
Defines *Recommendation ITU-R BT.1886* electro-optical transfer function
(EOTF / EOCF) and its inverse:
- :func:`colour.models.eotf_inverse_BT1886`
- :func:`colour.models.eotf_BT1886`
References
----------
- :cite:`InternationalTelecommunicationUnion2011h... | 28.50641 | 79 | 0.489319 |
79573dccf41abab241b93bc5dc8aee1ba3ca797a | 9,269 | py | Python | transcript/extra_app/xadmin/plugins/auth.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | 1 | 2019-02-25T23:17:18.000Z | 2019-02-25T23:17:18.000Z | transcript/extra_app/xadmin/plugins/auth.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | null | null | null | transcript/extra_app/xadmin/plugins/auth.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from django import forms
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
AdminPasswordChangeForm, PasswordChangeForm)
from django.contrib.auth.models import Group, Permission
from django.core.exceptions import PermissionDenied
from django.co... | 34.32963 | 136 | 0.63653 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.