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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3d2c530a340a5037b4af9c6e8892a90cd0dd50c3 | 275 | py | Python | tests/support.py | icetemple/genrss | 25d210a8b61feab0e57efc441c9a63f56989b075 | [
"MIT"
] | 16 | 2019-07-23T20:43:39.000Z | 2022-03-13T12:22:16.000Z | tests/support.py | icetemple/genrss | 25d210a8b61feab0e57efc441c9a63f56989b075 | [
"MIT"
] | 10 | 2019-07-25T16:39:25.000Z | 2021-04-07T15:09:55.000Z | tests/support.py | icetemple/genrss | 25d210a8b61feab0e57efc441c9a63f56989b075 | [
"MIT"
] | 1 | 2019-07-25T19:33:07.000Z | 2019-07-25T19:33:07.000Z | from genrss import GenRSS
def create_rss(**kwargs):
return GenRSS(title='SmartFridge', site_url='https://smartfridge.me/',
feed_url='https://smartfridge.me/rss.xml', **kwargs)
def create_item(feed, **kwargs):
feed.item(title='Recipe', **kwargs)
| 25 | 74 | 0.661818 |
71c1c3506c7cd72e6e1f8481f0455bdcefd92c88 | 28 | py | Python | Python/Tests/TestData/Repl/Program.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 404 | 2019-05-07T02:21:57.000Z | 2022-03-31T17:03:04.000Z | Python/Tests/TestData/Repl/Program.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 1,672 | 2019-05-06T21:09:38.000Z | 2022-03-31T23:16:04.000Z | Python/Tests/TestData/Repl/Program.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 186 | 2019-05-13T03:17:37.000Z | 2022-03-31T16:24:05.000Z | def f():
return 42
100
| 5.6 | 13 | 0.535714 |
11ecb78375fad3f21e998fed859629051c5be0e9 | 5,009 | py | Python | python/cugraph/dask/community/louvain.py | drobison00/cugraph | 0ad18e7be0e5b294b070f7062fd5a58b135b180f | [
"Apache-2.0"
] | null | null | null | python/cugraph/dask/community/louvain.py | drobison00/cugraph | 0ad18e7be0e5b294b070f7062fd5a58b135b180f | [
"Apache-2.0"
] | 1 | 2020-12-01T17:34:57.000Z | 2020-12-01T17:34:57.000Z | python/cugraph/dask/community/louvain.py | drobison00/cugraph | 0ad18e7be0e5b294b070f7062fd5a58b135b180f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2020, NVIDIA CORPORATION.
# 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... | 38.530769 | 79 | 0.607107 |
d1918ed3555f99574addc93c9e2a3e7481e1e40c | 287 | py | Python | src/package/archive.py | purmirl/ProbeArrow | 7c2c7d0765130d61ccd0c998d0b305b660708d56 | [
"BSD-3-Clause"
] | 5 | 2021-04-15T03:14:27.000Z | 2021-11-11T06:38:49.000Z | src/package/archive.py | purmirl/ProbeArrow | 7c2c7d0765130d61ccd0c998d0b305b660708d56 | [
"BSD-3-Clause"
] | 5 | 2021-01-16T12:52:15.000Z | 2021-06-29T14:43:54.000Z | src/package/archive.py | purmirl/ProbeArrow | 7c2c7d0765130d61ccd0c998d0b305b660708d56 | [
"BSD-3-Clause"
] | null | null | null | """
ProbeArrow
Copyright 2020~ PeTrA. All rights reserved.
. Python Project Structure Repository;
Probe Arrow Project by PeTrA. 2020~
ProbeArrow 1.0
Language : Python3.8.2
Library : Scapy2.4.3
Advanced Trace Route
------
@ archive.py
* utility data python code file
"""
| 16.882353 | 44 | 0.700348 |
f2fe4c07c8149657b70f0893a67b87fab7e9e25d | 77,536 | py | Python | fhirclient/r4models/elementdefinition.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/elementdefinition.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/elementdefinition.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2019-05-07.
# 2019, SMART Health IT.
from . import backboneelement
class ElementDefinition(backboneelement.BackboneElement):
""" Definition of an eleme... | 44.38237 | 155 | 0.587779 |
fc4cd29cac3df3372927af1d42b4131f56ba1d48 | 4,190 | py | Python | app.py | tiagofsv95/trabalho_final_docs | 1842f73d1a627a4c08d6b4da321e2bf381151857 | [
"MIT"
] | null | null | null | app.py | tiagofsv95/trabalho_final_docs | 1842f73d1a627a4c08d6b4da321e2bf381151857 | [
"MIT"
] | null | null | null | app.py | tiagofsv95/trabalho_final_docs | 1842f73d1a627a4c08d6b4da321e2bf381151857 | [
"MIT"
] | null | null | null | import werkzeug
from flask.scaffold import _endpoint_from_view_func
from werkzeug.utils import cached_property
import flask
flask.helpers._endpoint_from_view_func = _endpoint_from_view_func
werkzeug.cached_property = cached_property
from flask import Flask, make_response, jsonify, request
from flask_restplus import... | 22.771739 | 75 | 0.642959 |
d25b81625e025da44045907c78d48e62d294e11f | 2,294 | py | Python | exact_solvers/acoustics.py | haraldschilly/riemann_book | 46698d695c43da1ad51cd10249240b2531ee578e | [
"BSD-3-Clause"
] | null | null | null | exact_solvers/acoustics.py | haraldschilly/riemann_book | 46698d695c43da1ad51cd10249240b2531ee578e | [
"BSD-3-Clause"
] | null | null | null | exact_solvers/acoustics.py | haraldschilly/riemann_book | 46698d695c43da1ad51cd10249240b2531ee578e | [
"BSD-3-Clause"
] | null | null | null | """
Exact Riemann solver for the acoustics wave equation in 1D,
including some plotting functionality.
"""
import sys, os
import numpy as np
from utils import riemann_tools
def lambda1(q, xi, aux):
"""Characteristic speed for 1-waves."""
rho, bulk = aux
return -np.sqrt(bulk/rho)
def lambda2(q, xi, aux):
... | 29.792208 | 100 | 0.531386 |
e410705ec73b295c0eb2a30f81beaece34f5684e | 20,274 | py | Python | pyro/infer/mcmc/nuts.py | jrmcornish/pyro | 38914d5eb596dc140e226031534ff4ea7903dc35 | [
"MIT"
] | null | null | null | pyro/infer/mcmc/nuts.py | jrmcornish/pyro | 38914d5eb596dc140e226031534ff4ea7903dc35 | [
"MIT"
] | null | null | null | pyro/infer/mcmc/nuts.py | jrmcornish/pyro | 38914d5eb596dc140e226031534ff4ea7903dc35 | [
"MIT"
] | null | null | null | from collections import namedtuple
import torch
import pyro
import pyro.distributions as dist
from pyro.distributions.util import scalar_like
from pyro.infer.mcmc.hmc import HMC
from pyro.ops.integrator import velocity_verlet
from pyro.util import optional, torch_isnan
def _logaddexp(x, y):
minval, maxval = (x,... | 50.558603 | 101 | 0.61897 |
ccc1ba80585701e9f57e96a909b20e20a9d7bc2c | 3,231 | py | Python | carla/recourse_methods/catalog/clue/library/clue_ml/AE_models/AE/models.py | jayanthyetukuri/CARLA | c3f3aaf11a5a8499c4bec5065e0c17ec8e6f5950 | [
"MIT"
] | 140 | 2021-08-03T21:53:32.000Z | 2022-03-20T08:52:02.000Z | carla/recourse_methods/catalog/clue/library/clue_ml/AE_models/AE/models.py | jayanthyetukuri/CARLA | c3f3aaf11a5a8499c4bec5065e0c17ec8e6f5950 | [
"MIT"
] | 54 | 2021-03-07T18:22:16.000Z | 2021-08-03T12:06:31.000Z | carla/recourse_methods/catalog/clue/library/clue_ml/AE_models/AE/models.py | jayanthyetukuri/CARLA | c3f3aaf11a5a8499c4bec5065e0c17ec8e6f5950 | [
"MIT"
] | 16 | 2021-08-23T12:14:58.000Z | 2022-03-01T00:52:58.000Z | from __future__ import division
import torch.nn as nn
from carla.recourse_methods.catalog.clue.library.clue_ml.src.layers import (
MLPBlock,
ResBlock,
SkipConnection,
leaky_MLPBlock,
preact_leaky_MLPBlock,
)
# MLP based model
class MLP_recognition_net(nn.Module):
def __init__(self, input_di... | 28.095652 | 76 | 0.587125 |
2248a48dafeceacb317fb6693dc480e3617abd9d | 1,828 | py | Python | superset/data/sf_population_polygons.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 108 | 2018-01-22T11:09:59.000Z | 2021-01-15T10:53:04.000Z | superset/data/sf_population_polygons.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 112 | 2018-01-25T22:57:21.000Z | 2019-08-22T20:08:48.000Z | superset/data/sf_population_polygons.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 24 | 2018-01-19T22:54:39.000Z | 2020-11-12T13:04:25.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.236364 | 70 | 0.704595 |
fcae04122a8fae2f785e7a2832115b71c9351cc2 | 17,918 | py | Python | leo/plugins/python_terminal.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 1,550 | 2015-01-14T16:30:37.000Z | 2022-03-31T08:55:58.000Z | leo/plugins/python_terminal.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 2,009 | 2015-01-13T16:28:52.000Z | 2022-03-31T18:21:48.000Z | leo/plugins/python_terminal.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 200 | 2015-01-05T15:07:41.000Z | 2022-03-07T17:05:01.000Z | #@+leo-ver=5-thin
#@+node:peckj.20150428142633.1: * @file ../plugins/python_terminal.py
#@@language python
#@@tabwidth -4
# **Warning**: Use at your own risk.
# Numerous significant problems have been reported, including segfaults.
# This code from http://stackoverflow.com/questions/12431555
# with modifications from... | 40.630385 | 111 | 0.551233 |
5b7db24815a8816262db17a014f1fbd5696b7f9d | 1,826 | py | Python | run_bpm_example.py | nahman/lightbeam | f521feba5501a12e9db0f02d2025c9f4ad28541f | [
"MIT"
] | 1 | 2021-10-07T21:57:11.000Z | 2021-10-07T21:57:11.000Z | run_bpm_example.py | nahman/lightbeam | f521feba5501a12e9db0f02d2025c9f4ad28541f | [
"MIT"
] | null | null | null | run_bpm_example.py | nahman/lightbeam | f521feba5501a12e9db0f02d2025c9f4ad28541f | [
"MIT"
] | null | null | null | ''' example script for running the beamprop code in prop.py'''
import numpy as np
from mesh import RectMesh3D
from prop import Prop3D
from misc import normalize,overlap,getslices,overlap_nonu,norm_nonu
import LPmodes
import matplotlib.pyplot as plt
from config_example import *
if __name__ == "__main__":
# mesh in... | 29.934426 | 175 | 0.671413 |
4cef3b01f24f8c5a012e6e5f6e7ef5bb5eaa3444 | 428 | py | Python | code/example1_4.py | jk/jekyll-mermaid-blog | afe77485c9594fdcbe33bce70cde5557fb185807 | [
"MIT"
] | 3 | 2015-06-28T23:45:30.000Z | 2016-07-12T13:16:56.000Z | code/example1_4.py | jk/jekyll-mermaid-blog | afe77485c9594fdcbe33bce70cde5557fb185807 | [
"MIT"
] | null | null | null | code/example1_4.py | jk/jekyll-mermaid-blog | afe77485c9594fdcbe33bce70cde5557fb185807 | [
"MIT"
] | 5 | 2017-01-13T04:58:50.000Z | 2018-11-20T13:10:47.000Z | # import sys
# print sys.argv
class firstn(object):
def __init__(self, n):
self.n = n
self.num, self.nums = 0, []
def __iter__(self):
return self
# Python 3 compatibility
def __next__(self):
return self.next()
def next(self):
if self.num < self.n:
... | 23.777778 | 48 | 0.53972 |
14ae6677a13c7155e86be1d6afcaf7681a5fa7f3 | 3,390 | py | Python | D02_Pdf_Render/D02_Pdf_Render/settings.py | Hari-Krishna-Moorthy/Django-daily | 90801cc89d979e70e594ba07dbb7178ffeddac33 | [
"Apache-2.0"
] | null | null | null | D02_Pdf_Render/D02_Pdf_Render/settings.py | Hari-Krishna-Moorthy/Django-daily | 90801cc89d979e70e594ba07dbb7178ffeddac33 | [
"Apache-2.0"
] | null | null | null | D02_Pdf_Render/D02_Pdf_Render/settings.py | Hari-Krishna-Moorthy/Django-daily | 90801cc89d979e70e594ba07dbb7178ffeddac33 | [
"Apache-2.0"
] | null | null | null | """
Django settings for D02_Pdf_Render project.
Generated by 'django-admin startproject' using Django 3.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from ... | 25.877863 | 91 | 0.702655 |
47a652fc204e1f80dcd6d8f36f6dee727f89c1c0 | 3,626 | py | Python | app/models.py | lin-wish/random-name | 91bae70aad4547e06388105136573a7c18525ed0 | [
"MIT"
] | null | null | null | app/models.py | lin-wish/random-name | 91bae70aad4547e06388105136573a7c18525ed0 | [
"MIT"
] | null | null | null | app/models.py | lin-wish/random-name | 91bae70aad4547e06388105136573a7c18525ed0 | [
"MIT"
] | null | null | null |
from flask_bcrypt import Bcrypt
import jwt
from datetime import datetime, timedelta
class RandomNames(db.Model):
""" This class represents the test table. """
__tablename__ = "random_names"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255), nullable=False, unique=... | 34.207547 | 80 | 0.597628 |
0cc70e51e077ca8107d5685d2d13717e18e3de97 | 3,913 | py | Python | test/test_python_basic.py | devnexen/unit | d65a66f9d813294917822554311281c5e1a7126b | [
"Apache-2.0"
] | 10 | 2018-11-14T10:58:41.000Z | 2021-12-11T01:43:51.000Z | test/test_python_basic.py | devnexen/unit | d65a66f9d813294917822554311281c5e1a7126b | [
"Apache-2.0"
] | null | null | null | test/test_python_basic.py | devnexen/unit | d65a66f9d813294917822554311281c5e1a7126b | [
"Apache-2.0"
] | 3 | 2018-10-31T12:10:05.000Z | 2019-02-14T14:09:48.000Z | from unit.control import TestControl
class TestPythonBasic(TestControl):
prerequisites = {'modules': {'python': 'any'}}
conf_app = {
"app": {
"type": "python",
"processes": {"spare": 0},
"path": "/app",
"module": "wsgi",
}
}
conf_basic ... | 31.813008 | 78 | 0.541784 |
38816655ef3e9a2c8b04a8d1905cb27da6409d8a | 6,209 | py | Python | mlflow/entities/run_info.py | yutannihilation/mlflow | a4386c3f87923e395ba8f523e1a90749e888a541 | [
"Apache-2.0"
] | 2 | 2020-03-21T17:32:54.000Z | 2020-07-22T06:11:55.000Z | mlflow/entities/run_info.py | yutannihilation/mlflow | a4386c3f87923e395ba8f523e1a90749e888a541 | [
"Apache-2.0"
] | 5 | 2020-04-30T00:36:16.000Z | 2022-03-02T02:51:29.000Z | mlflow/entities/run_info.py | mlaradji/mlflow | 4edde91d0fa9909f5894bf84529b3416d52d83f6 | [
"Apache-2.0"
] | null | null | null | from mlflow.entities._mlflow_object import _MLflowObject
from mlflow.exceptions import MlflowException
from mlflow.protos.service_pb2 import RunInfo as ProtoRunInfo
def check_run_is_active(run_info):
if run_info.lifecycle_stage != RunInfo.ACTIVE_LIFECYCLE:
raise MlflowException('The run {} must be in an ... | 34.115385 | 97 | 0.63569 |
8014b94237eae713c5a8c0ec74bccb22ea2177d4 | 17,246 | py | Python | src/msdss_data_api/routers.py | rrwen/msdss-data-api | f2f82d1137c46d729fea2651b213b087467496b0 | [
"MIT"
] | null | null | null | src/msdss_data_api/routers.py | rrwen/msdss-data-api | f2f82d1137c46d729fea2651b213b087467496b0 | [
"MIT"
] | null | null | null | src/msdss_data_api/routers.py | rrwen/msdss-data-api | f2f82d1137c46d729fea2651b213b087467496b0 | [
"MIT"
] | null | null | null | from copy import deepcopy
from datetime import datetime
from fastapi import APIRouter, Body, Depends, Query
from typing import Any, Dict, List, Literal, Optional
from .managers import *
from .models import *
from .tools import *
async def _no_current_user():
return None
def get_data_router(
users_api=None,
... | 49.700288 | 340 | 0.616375 |
032ea94ee2a777064d9e102da56759e39ee27a36 | 19,299 | py | Python | venv/Lib/site-packages/mpl_toolkits/mplot3d/axis3d.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | venv/Lib/site-packages/mpl_toolkits/mplot3d/axis3d.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | venv/Lib/site-packages/mpl_toolkits/mplot3d/axis3d.py | AdarshSai/Final_project | f966834ca72dd232102ed500ef47ef2b3bdbed5b | [
"MIT"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | # axis3d.py, original mplot3d version by John Porter
# Created: 23 Sep 2005
# Parts rewritten by Reinier Heeres <reinier@heeres.eu>
import numpy as np
import matplotlib.transforms as mtransforms
from matplotlib import (
artist, lines as mlines, axis as maxis, patches as mpatches, rcParams)
from . import ... | 39.466258 | 80 | 0.548733 |
380972d7f1abcdc57bbcab2b1b680088f2bd1072 | 1,971 | py | Python | python_util/parser/xml/page/page_constants.py | CITlabRostock/citlab-article-separation-new | 814364bf81552eefbe0ce60bbb9ec9e8ca63baf4 | [
"OLDAP-2.7"
] | 8 | 2021-05-03T11:53:25.000Z | 2022-03-31T13:07:42.000Z | python_util/parser/xml/page/page_constants.py | CITlabRostock/citlab-article-separation-new | 814364bf81552eefbe0ce60bbb9ec9e8ca63baf4 | [
"OLDAP-2.7"
] | null | null | null | python_util/parser/xml/page/page_constants.py | CITlabRostock/citlab-article-separation-new | 814364bf81552eefbe0ce60bbb9ec9e8ca63baf4 | [
"OLDAP-2.7"
] | null | null | null | """
This file contains all important names related to the PAGE-XML format.
"""
# Creators name
sCREATOR = "CITlab"
# Namespace for PageXml
NS_PAGE_XML = "http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15"
NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"
XSILOCATION = "http://schema.primaresearch.or... | 26.28 | 95 | 0.737697 |
77c27250f42f99a280a1a5621c80a14db7401788 | 10,234 | py | Python | nvtabular/ops/join_groupby.py | L0Z1K/NVTabular | b4dfcc63f7621fcb577833d75b21bc4dd7120d3a | [
"Apache-2.0"
] | null | null | null | nvtabular/ops/join_groupby.py | L0Z1K/NVTabular | b4dfcc63f7621fcb577833d75b21bc4dd7120d3a | [
"Apache-2.0"
] | null | null | null | nvtabular/ops/join_groupby.py | L0Z1K/NVTabular | b4dfcc63f7621fcb577833d75b21bc4dd7120d3a | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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 ... | 38.04461 | 96 | 0.62351 |
66d0f0472be47ab87c5b4616c9c941ae26278ffd | 2,483 | py | Python | src/odyssey_tests/type_converter_tests/convert_tests.py | GodwinneLorayne/odyssey | b5576818d70bea011772b944a4dd947777a5ac2f | [
"MIT"
] | 1 | 2020-06-01T20:52:37.000Z | 2020-06-01T20:52:37.000Z | src/odyssey_tests/type_converter_tests/convert_tests.py | GodwinneLorayne/odyssey | b5576818d70bea011772b944a4dd947777a5ac2f | [
"MIT"
] | 4 | 2020-06-06T04:50:24.000Z | 2021-02-03T07:14:49.000Z | src/odyssey_tests/type_converter_tests/convert_tests.py | python-odyssey/odyssey | b5576818d70bea011772b944a4dd947777a5ac2f | [
"MIT"
] | 1 | 2020-05-30T21:59:11.000Z | 2020-05-30T21:59:11.000Z | import pytest
from odyssey.type_converter.convert import (
to_string,
to_int,
to_float,
to_complex,
to_bool,
to_tuple,
to_list,
to_dict,
)
def test_to_string_string():
expected = "Hello, World!"
value = expected
result = to_string(value)
assert expected == result
de... | 16.891156 | 73 | 0.611357 |
0c606ed1bfa2a22347abd9bde03bf6ce80684d5a | 616 | py | Python | telethon/tl/functions/test.py | yande-eghosa/Telegram-Click-Bot | d2905373b93475ea3b4562128f84a66aee0eb7a0 | [
"MIT"
] | 1 | 2020-11-22T20:30:27.000Z | 2020-11-22T20:30:27.000Z | telethon/tl/functions/test.py | yande-eghosa/Telegram-Click-Bot | d2905373b93475ea3b4562128f84a66aee0eb7a0 | [
"MIT"
] | null | null | null | telethon/tl/functions/test.py | yande-eghosa/Telegram-Click-Bot | d2905373b93475ea3b4562128f84a66aee0eb7a0 | [
"MIT"
] | null | null | null | """File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject
from ...tl.tlobject import TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
from datetime import datetime
class DummyFunctionRequest(TLRequest):
CONSTRUCTOR_ID = 0x... | 22 | 72 | 0.659091 |
5f4319ff87c30ae549a63f3f6616115e63c17303 | 51 | py | Python | src/dynamic_fixtures/fixtures/__init__.py | duct-tape/django-dynamic-fixtures | da99b4b12b11be28ea4b36b6cf2896ca449c73c1 | [
"MIT"
] | 11 | 2016-05-18T18:02:25.000Z | 2019-08-21T09:10:34.000Z | src/dynamic_fixtures/fixtures/__init__.py | duct-tape/django-dynamic-fixtures | da99b4b12b11be28ea4b36b6cf2896ca449c73c1 | [
"MIT"
] | 16 | 2016-05-18T06:31:56.000Z | 2020-12-30T16:38:10.000Z | src/dynamic_fixtures/fixtures/__init__.py | Peter-Slump/django-factory-boy-fixtures | 630182bd2a2b45833d29fa34134d6b68ff7a4349 | [
"MIT"
] | 7 | 2017-04-22T18:30:37.000Z | 2021-12-22T11:14:38.000Z | from .basefixture import BaseFixture # noqa: F401
| 25.5 | 50 | 0.784314 |
5bce06418b1da1b4049414a9106671edbc243f41 | 3,189 | py | Python | kochira/services/core/account.py | nolanlum/kochira | 0158a6877930f45ff6946770a3fb8a041117fe54 | [
"MS-PL"
] | null | null | null | kochira/services/core/account.py | nolanlum/kochira | 0158a6877930f45ff6946770a3fb8a041117fe54 | [
"MS-PL"
] | 1 | 2019-05-13T22:02:18.000Z | 2019-05-13T22:02:18.000Z | kochira/services/core/account.py | nol888/kochira | 0158a6877930f45ff6946770a3fb8a041117fe54 | [
"MS-PL"
] | 1 | 2019-05-13T21:22:02.000Z | 2019-05-13T21:22:02.000Z | """
Account management.
Allows users to manage their account information.
"""
from pydle.asynchronous import Future
from kochira.service import Service, coroutine
from kochira.userdata import UserData
service = Service(__name__, __doc__)
@service.setup
def init_confirmations(ctx):
ctx.storage.confirmations = ... | 27.973684 | 110 | 0.661336 |
a6a8ef28435e8e720f9d2c6b5643fd1b7a3bf189 | 66 | py | Python | pyswmap/__init__.py | ejordangottlieb/pyswmap | 60df74b249eeeda87e23be9cad3c736757e9f72f | [
"MIT"
] | 12 | 2015-02-02T01:32:28.000Z | 2022-02-23T15:52:06.000Z | pyswmap/__init__.py | ejordangottlieb/pyswmap | 60df74b249eeeda87e23be9cad3c736757e9f72f | [
"MIT"
] | null | null | null | pyswmap/__init__.py | ejordangottlieb/pyswmap | 60df74b249eeeda87e23be9cad3c736757e9f72f | [
"MIT"
] | 2 | 2020-01-14T22:02:08.000Z | 2021-11-13T21:31:46.000Z | from pyswmap.mapalgs import (
MapCalc,
DmrCalc,
)
| 13.2 | 29 | 0.575758 |
2390814f8be09a1c4d8e3697a62215b153da1f86 | 95,137 | py | Python | app.py | BiRD-project/BiRD_view | 47122b0f2e977f136d9ef5ff5878f58c53a68be1 | [
"MIT"
] | 1 | 2020-05-18T01:55:04.000Z | 2020-05-18T01:55:04.000Z | app.py | BiRD-project/BiRD_view | 47122b0f2e977f136d9ef5ff5878f58c53a68be1 | [
"MIT"
] | 3 | 2021-06-08T21:20:35.000Z | 2021-07-11T12:55:46.000Z | app.py | BiRD-project/BiRD_view | 47122b0f2e977f136d9ef5ff5878f58c53a68be1 | [
"MIT"
] | null | null | null | import base64
import json
import dash_gif_component as gif
# import colour as clr
import dash
import dash_core_components as dcc
import dash_html_components as html
# import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State, MATCH, ALL
from dash.exceptions import PreventUpdate
from par... | 51.176439 | 287 | 0.503022 |
e1f80125dfabc6a2cdb553136f43d6389d4adfdc | 3,466 | py | Python | spyre/spyre/widgets/repository_widget.py | zhong-lab/optics | 9de1942d9a128183ecb3d360b160b27126e7b8f0 | [
"BSD-2-Clause"
] | 1 | 2022-03-27T07:47:19.000Z | 2022-03-27T07:47:19.000Z | spyre/spyre/widgets/repository_widget.py | zhong-lab/optics | 9de1942d9a128183ecb3d360b160b27126e7b8f0 | [
"BSD-2-Clause"
] | null | null | null | spyre/spyre/widgets/repository_widget.py | zhong-lab/optics | 9de1942d9a128183ecb3d360b160b27126e7b8f0 | [
"BSD-2-Clause"
] | 4 | 2019-11-08T22:39:04.000Z | 2021-11-05T02:39:37.000Z | from PyQt5 import QtWidgets
from spyre.repository import Repository, Node
from spyre.plotting import BasePlotWidget
import time
class RepositoryWidget(QtWidgets.QWidget):
def __init__(self, spyrelet, parent=None):
super().__init__(parent=parent)
self.spyrelet = spyrelet
self.filename = Non... | 40.302326 | 186 | 0.665897 |
110d1c720ebf754b6a404b20c3dc30a1889e23fa | 1,070 | py | Python | tests/generate_config_test.py | grimmy/git-code-debt | ebb68f2b30745e59fa33c7e3e56ed31ae3faf7c1 | [
"MIT"
] | null | null | null | tests/generate_config_test.py | grimmy/git-code-debt | ebb68f2b30745e59fa33c7e3e56ed31ae3faf7c1 | [
"MIT"
] | null | null | null | tests/generate_config_test.py | grimmy/git-code-debt | ebb68f2b30745e59fa33c7e3e56ed31ae3faf7c1 | [
"MIT"
] | null | null | null | import re
import cfgv
import pytest
from git_code_debt.generate_config import GenerateOptions
def test_empty_config_invalid():
with pytest.raises(cfgv.ValidationError):
GenerateOptions.from_yaml({})
def test_with_all_options_specified():
ret = GenerateOptions.from_yaml({
'skip_default_metr... | 24.883721 | 78 | 0.616822 |
a59593061fa496b4020c2b5009d7b7c882fe43ef | 1,835 | py | Python | django/contrib/gis/tests/geoapp/feeds.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | 1 | 2015-11-08T11:42:08.000Z | 2015-11-08T11:42:08.000Z | django/contrib/gis/tests/geoapp/feeds.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/tests/geoapp/feeds.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... | 27.38806 | 71 | 0.663215 |
3d7895a0755b810ab056bdfe4288dbfca2f19ee8 | 999 | py | Python | py/problem_110.py | curtislb/ProjectEuler | 7baf8d7b7ac0e8697d4dec03458b473095a45da4 | [
"MIT"
] | null | null | null | py/problem_110.py | curtislb/ProjectEuler | 7baf8d7b7ac0e8697d4dec03458b473095a45da4 | [
"MIT"
] | null | null | null | py/problem_110.py | curtislb/ProjectEuler | 7baf8d7b7ac0e8697d4dec03458b473095a45da4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""problem_110.py
Problem 110: Diophantine reciprocals II
In the following equation x, y, and n are positive integers.
1/x + 1/y = 1/n
It can be verified that when n = 1260 there are 113 distinct solutions and this
is the least value of n for which the total number of distinct solutions
... | 23.232558 | 79 | 0.647648 |
cb3e26d055186b2b401f8106f043cb35f35ba6c9 | 6,169 | py | Python | main.py | minkyu119/segan | 4e62edf26e1e7910abf97fb2c457a4c5bc470e57 | [
"MIT"
] | 1 | 2019-06-30T17:58:44.000Z | 2019-06-30T17:58:44.000Z | main.py | minkyu119/segan | 4e62edf26e1e7910abf97fb2c457a4c5bc470e57 | [
"MIT"
] | null | null | null | main.py | minkyu119/segan | 4e62edf26e1e7910abf97fb2c457a4c5bc470e57 | [
"MIT"
] | null | null | null | from __future__ import print_function
import tensorflow as tf
import numpy as np
from model import SEGAN, SEAE
import os
from tensorflow.python.client import device_lib
from scipy.io import wavfile
from data_loader import pre_emph
devices = device_lib.list_local_devices()
flags = tf.app.flags
flags.DEFINE_integer("s... | 50.154472 | 96 | 0.600421 |
021a0d5a0a0c271658b47a9332d26e3ca15950d8 | 5,190 | py | Python | tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer_test.py | Sonata-Wang/tensorflow | 8bbef0cd77879d05ed69bf30e76087847a8ca4a2 | [
"Apache-2.0"
] | 36 | 2016-12-17T15:25:25.000Z | 2022-01-29T21:50:53.000Z | tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer_test.py | YaoYaoZhi/tensorflow | 83903c9dd9b5235996ec9158c30a1607fcfb4c73 | [
"Apache-2.0"
] | 30 | 2016-10-04T15:38:08.000Z | 2020-07-16T12:09:33.000Z | tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer_test.py | YaoYaoZhi/tensorflow | 83903c9dd9b5235996ec9158c30a1607fcfb4c73 | [
"Apache-2.0"
] | 36 | 2017-07-27T21:12:40.000Z | 2022-02-03T16:45:56.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.854839 | 90 | 0.734297 |
bbfc37e2b1218081d766ab02cc2f4f69c190ca8e | 144 | py | Python | app/appcore/services/__init__.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | app/appcore/services/__init__.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | app/appcore/services/__init__.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | from .base_service import BaseService
from .bootstrap import Bootstrap
from .factory import Factory
from .storage_service import StorageService
| 28.8 | 43 | 0.861111 |
fd0f1dd7deb93ddadfb1b0eecc6daa68561d62db | 3,506 | py | Python | login/forms.py | ScheinovOleja/RollerSite | bd2ae6ac9a8889876924ff536d57be8653c82945 | [
"MIT"
] | null | null | null | login/forms.py | ScheinovOleja/RollerSite | bd2ae6ac9a8889876924ff536d57be8653c82945 | [
"MIT"
] | null | null | null | login/forms.py | ScheinovOleja/RollerSite | bd2ae6ac9a8889876924ff536d57be8653c82945 | [
"MIT"
] | null | null | null | import requests
from django import forms
from django.contrib.auth import password_validation
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from social_treatment.mailing import send_register_use... | 42.240964 | 118 | 0.617228 |
0dbbd99c4443a706f43fda1c4d9d5f53b2aabaaf | 19,654 | py | Python | _build/jupyter_execute/Lab4/Lab4_solutions.py | Astro-330/Astro-330.github.io | e7ba5d1db0f369a110419e939d9ed2d29c9d7020 | [
"MIT"
] | 4 | 2021-08-28T23:26:14.000Z | 2022-03-27T14:35:17.000Z | _build/jupyter_execute/Lab4/Lab4_solutions.py | mgebran/Astro-330.github.io | e7ba5d1db0f369a110419e939d9ed2d29c9d7020 | [
"MIT"
] | null | null | null | _build/jupyter_execute/Lab4/Lab4_solutions.py | mgebran/Astro-330.github.io | e7ba5d1db0f369a110419e939d9ed2d29c9d7020 | [
"MIT"
] | 2 | 2021-12-18T00:53:51.000Z | 2022-03-21T14:53:12.000Z | #!/usr/bin/env python
# coding: utf-8
# # Lab 4: Solutions
#
# In this lab, we will begin to build various tools to fit a model to data. The goal is to understand, implement and compare chi2 and MCMC fitting routines to fake data. In Lab 5, we will apply these tools to real spectroscopic data from Keck / DEIMOS.... | 26.667571 | 650 | 0.629897 |
5fd2dd97dc8e629bda04134f5179d1fcfb87851c | 4,708 | py | Python | py3plex/algorithms/community_detection/community_wrapper.py | SkBlaz/supertest | 5d99034af820cc10c8f70271b55cc90c42328709 | [
"BSD-3-Clause"
] | 79 | 2018-10-22T14:54:04.000Z | 2020-03-05T05:34:35.000Z | py3plex/algorithms/community_detection/community_wrapper.py | SkBlaz/supertest | 5d99034af820cc10c8f70271b55cc90c42328709 | [
"BSD-3-Clause"
] | 6 | 2019-02-19T16:33:14.000Z | 2019-12-16T10:23:25.000Z | py3plex/algorithms/community_detection/community_wrapper.py | SkBlaz/Py3Plex | 5d99034af820cc10c8f70271b55cc90c42328709 | [
"BSD-3-Clause"
] | 16 | 2019-02-19T16:30:29.000Z | 2020-02-13T05:57:16.000Z | # high level interface for community detection algorithms
from .community_louvain import *
try:
from .NoRC import *
except:
pass
def run_infomap(infile,
multiplex=True,
overlapping=False,
binary="./infomap",
verbose=True,
iteratio... | 29.242236 | 79 | 0.484282 |
cd13c135741610f2333b3ea860dd6265561e4809 | 14,457 | py | Python | scripts/run_mypy_checks.py | sidkhuntia/oppia | ac185819c62bcc487f858420892ad9056516558b | [
"Apache-2.0"
] | null | null | null | scripts/run_mypy_checks.py | sidkhuntia/oppia | ac185819c62bcc487f858420892ad9056516558b | [
"Apache-2.0"
] | null | null | null | scripts/run_mypy_checks.py | sidkhuntia/oppia | ac185819c62bcc487f858420892ad9056516558b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | 36.974425 | 79 | 0.709552 |
07421a3f45b5dd7b6bd661a8ee8367ea83f21090 | 302 | py | Python | src/python/kornia/losses/__init__.py | pjessesco/DeProCams | be89e8aacbefe988225ca4969902803863a29dc4 | [
"CC-BY-3.0"
] | 10 | 2021-01-26T05:25:01.000Z | 2022-02-08T06:10:41.000Z | kornia/losses/__init__.py | sounakdey/kornia | 6a0df6dee7b213572ff3441bb6eb0e07a23f0ef3 | [
"Apache-2.0"
] | 3 | 2021-05-03T10:34:15.000Z | 2022-02-17T04:25:26.000Z | kornia/losses/__init__.py | sounakdey/kornia | 6a0df6dee7b213572ff3441bb6eb0e07a23f0ef3 | [
"Apache-2.0"
] | 4 | 2021-04-30T01:51:38.000Z | 2022-01-27T05:06:04.000Z | from .ssim import SSIM, ssim
from .dice import DiceLoss, dice_loss
from .tversky import TverskyLoss, tversky_loss
from .focal import FocalLoss, focal_loss
from .depth_smooth import (
InverseDepthSmoothnessLoss, inverse_depth_smoothness_loss
)
from .divergence import kl_div_loss_2d, js_div_loss_2d
| 33.555556 | 61 | 0.834437 |
cf18a59751c6ef733e1ca0bd67664abe8420ac59 | 3,392 | py | Python | trinity/rpc/modules/admin.py | AYCH-Inc/aych.eth.client | 1c8be83cebffd889c1c98d48605bba741743f31d | [
"MIT"
] | null | null | null | trinity/rpc/modules/admin.py | AYCH-Inc/aych.eth.client | 1c8be83cebffd889c1c98d48605bba741743f31d | [
"MIT"
] | null | null | null | trinity/rpc/modules/admin.py | AYCH-Inc/aych.eth.client | 1c8be83cebffd889c1c98d48605bba741743f31d | [
"MIT"
] | null | null | null | from typing import Tuple, Iterable, Dict
from eth.constants import GENESIS_BLOCK_NUMBER
from eth_typing import BlockNumber
from eth_utils import encode_hex, to_dict
from lahja import EndpointAPI
from p2p.kademlia import Node
from p2p.typing import Capabilities
from p2p.validation import validate_enode_uri
from trini... | 36.085106 | 91 | 0.67954 |
73c5cd0de310dc0f8da4b9780ed6318fc5d92c4e | 688 | py | Python | ballons.py | yacinedev19/fall-18-m1 | 359996788e1bafcc2dfe8a3b817a65d9184db100 | [
"MIT"
] | null | null | null | ballons.py | yacinedev19/fall-18-m1 | 359996788e1bafcc2dfe8a3b817a65d9184db100 | [
"MIT"
] | null | null | null | ballons.py | yacinedev19/fall-18-m1 | 359996788e1bafcc2dfe8a3b817a65d9184db100 | [
"MIT"
] | null | null | null | import turtle
# This code doesn't work!
# The indentation is broken.
# Fix it!
def balloon(t, color):
t.speed(0)
t.color(color)
# Draw balloon body.
for side in range(30):
t.forward(10)
t.left(12)
# Draw balloon knot.
t.right(60)
for side in range(3):
... | 14.333333 | 29 | 0.543605 |
05de8272e3b4b636e22ac85e0dbc1572b8770bbc | 783 | py | Python | binance_d/model/longshortpositions.py | vinayakpathak/Binance_Futures_python | e4c4071f6776af162ae8a87690b7d92a87608a94 | [
"MIT"
] | 640 | 2020-01-16T05:00:13.000Z | 2022-03-30T08:40:26.000Z | binance_d/model/longshortpositions.py | vinayakpathak/Binance_Futures_python | e4c4071f6776af162ae8a87690b7d92a87608a94 | [
"MIT"
] | 140 | 2020-01-19T20:27:35.000Z | 2022-03-28T08:28:43.000Z | binance_d/model/longshortpositions.py | vinayakpathak/Binance_Futures_python | e4c4071f6776af162ae8a87690b7d92a87608a94 | [
"MIT"
] | 391 | 2020-01-15T07:12:26.000Z | 2022-03-31T14:24:19.000Z |
class LongShortPositions:
def __init__(self):
self.pair = ""
self.longShortRatio = 0.0 # long/short account num ratio of top traders
self.longPosition = 0.0 # long account num ratio of top traders
self.shortPosition = 0.0 # short account num ratio of top traders
... | 35.590909 | 82 | 0.650064 |
6ef7f42ab5dcdfaff6055ae9e8841a876de0b3ca | 11,901 | py | Python | DexiNed-TF2/dataset_manager.py | ranajit1996/DexiNed | 639f5d724e5d028b106afbf112af9cea7245a261 | [
"MIT"
] | 1 | 2020-08-07T12:07:33.000Z | 2020-08-07T12:07:33.000Z | DexiNed-TF2/dataset_manager.py | ranajit1996/DexiNed | 639f5d724e5d028b106afbf112af9cea7245a261 | [
"MIT"
] | null | null | null | DexiNed-TF2/dataset_manager.py | ranajit1996/DexiNed | 639f5d724e5d028b106afbf112af9cea7245a261 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import h5py, os
import random
import cv2 as cv
AUTOTUNE = tf.data.experimental.AUTOTUNE
BUFFER_SIZE = 1024
img_shape =None
class DataLoader(tf.keras.utils.Sequence):
def __init__(self,data_name,arg=None, is_val=False):
self.is_training = True if arg.model_sta... | 42.655914 | 99 | 0.493152 |
216e0771a81a9167c2a06a65ffab0fd9838f851d | 7,602 | py | Python | integration/sawtooth_integration/tests/test_events_and_receipts.py | mealchain/beta | 7dc1a1aea175bfb3f1008939f098a1d58bb455a6 | [
"Apache-2.0"
] | null | null | null | integration/sawtooth_integration/tests/test_events_and_receipts.py | mealchain/beta | 7dc1a1aea175bfb3f1008939f098a1d58bb455a6 | [
"Apache-2.0"
] | null | null | null | integration/sawtooth_integration/tests/test_events_and_receipts.py | mealchain/beta | 7dc1a1aea175bfb3f1008939f098a1d58bb455a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 35.858491 | 80 | 0.667587 |
cffecd9bde2b6a07072f2bf860f1c38607703206 | 1,961 | py | Python | contrib/opencensus-ext-prometheus/setup.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | null | null | null | contrib/opencensus-ext-prometheus/setup.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | null | null | null | contrib/opencensus-ext-prometheus/setup.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 37.711538 | 130 | 0.675166 |
e5dc2bd28369399cb49299ec4da7b53bd42ad3f4 | 129,460 | py | Python | salt/utils/parsers.py | johnj/salt | b23656fa5ee24047c43ac702d6796a700570f749 | [
"Apache-2.0"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | salt/utils/parsers.py | johnj/salt | b23656fa5ee24047c43ac702d6796a700570f749 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/utils/parsers.py | johnj/salt | b23656fa5ee24047c43ac702d6796a700570f749 | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.utils.parsers
~~~~~~~~~~~~~~~~~~
This is where all the black magic happens on all of salt's CLI tools.
'''
# pylint: disable=missing-docstring,protected-access,too-many-ancestors,too-few-public-methods
# pylint: disable=... | 39.277913 | 121 | 0.548733 |
0a20a25b1bd3c040c1463417134adfd5fdc0a8db | 9,193 | py | Python | SiameseZero/SiameseZero_TrainSupport.py | hermes2507/Birdsong-Phrase-Clasification | fc74cb77113c6f70328c33d9bb4c64de45060d6c | [
"MIT"
] | null | null | null | SiameseZero/SiameseZero_TrainSupport.py | hermes2507/Birdsong-Phrase-Clasification | fc74cb77113c6f70328c33d9bb4c64de45060d6c | [
"MIT"
] | null | null | null | SiameseZero/SiameseZero_TrainSupport.py | hermes2507/Birdsong-Phrase-Clasification | fc74cb77113c6f70328c33d9bb4c64de45060d6c | [
"MIT"
] | null | null | null | import numpy as np
from keras.models import Model
from keras.layers import Dense, Activation, Input, Lambda,LSTM,Dropout,Bidirectional, Flatten, Conv2D, Reshape, MaxPooling2D
from keras.initializers import RandomNormal
from sklearn.model_selection import train_test_split
import keras.optimizers as ko
from keras.utils i... | 37.218623 | 153 | 0.703361 |
3d4d65d03d12d8fbd88923a5e303a3761aafda7a | 1,918 | py | Python | src/sanger_sequencing/analysis/sample.py | biosustain/sanger-sequencing | eefedd79b625062f919910e4b3df8a4c428662c7 | [
"Apache-2.0"
] | 1 | 2021-10-04T13:46:45.000Z | 2021-10-04T13:46:45.000Z | src/sanger_sequencing/analysis/sample.py | biosustain/sanger-sequencing | eefedd79b625062f919910e4b3df8a4c428662c7 | [
"Apache-2.0"
] | null | null | null | src/sanger_sequencing/analysis/sample.py | biosustain/sanger-sequencing | eefedd79b625062f919910e4b3df8a4c428662c7 | [
"Apache-2.0"
] | 3 | 2020-01-16T11:32:46.000Z | 2021-08-04T01:08:07.000Z | # Copyright (c) 2018-2020 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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
#
# https://www.apache.o... | 30.444444 | 79 | 0.677268 |
d511848899c5c747e1f4f1e3976b0817e0b5da1c | 11,347 | py | Python | ctypesgen/main.py | DJAndries/ctypesgen | 0bdd4a8d6486bc8e873d5a3a6ee3ebca988ab4d9 | [
"BSD-2-Clause"
] | 10 | 2017-09-11T22:30:42.000Z | 2021-03-24T08:35:21.000Z | ctypesgen/main.py | DJAndries/ctypesgen | 0bdd4a8d6486bc8e873d5a3a6ee3ebca988ab4d9 | [
"BSD-2-Clause"
] | 3 | 2017-04-12T06:12:36.000Z | 2019-11-24T02:04:07.000Z | ctypesgen/main.py | DJAndries/ctypesgen | 0bdd4a8d6486bc8e873d5a3a6ee3ebca988ab4d9 | [
"BSD-2-Clause"
] | 8 | 2017-04-12T05:38:33.000Z | 2019-08-01T16:22:36.000Z | # -*- coding: us-ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
"""
Main loop for ctypesgen.
"""
import optparse, sys
from . import options as core_options
from . import parser as core_parser
from . import printer_python, printer_json, processor
from . import messages as msgs
from . import version
def f... | 28.946429 | 100 | 0.569754 |
370eb3db478526d33abd6ce5881a710bbb6af57f | 8,780 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/htpasswd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/htpasswd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/htpasswd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nimbis Services, 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',
... | 31.927273 | 110 | 0.633371 |
0295f272be893159818a933ae3333e5fb7932f24 | 231 | py | Python | inn/inn_hotels/doctype/inn_folio_transaction_bundle/test_inn_folio_transaction_bundle.py | vinhnguyent090/front-desk | 7384642e9206e30855986465a7ef63c8fd76ef2a | [
"MIT"
] | 4 | 2021-08-19T03:33:36.000Z | 2021-08-28T16:37:52.000Z | inn/inn_hotels/doctype/inn_folio_transaction_bundle/test_inn_folio_transaction_bundle.py | vinhnguyent090/front-desk | 7384642e9206e30855986465a7ef63c8fd76ef2a | [
"MIT"
] | 98 | 2020-02-24T08:12:47.000Z | 2021-08-21T07:54:03.000Z | inn/inn_hotels/doctype/inn_folio_transaction_bundle/test_inn_folio_transaction_bundle.py | vinhnguyent090/front-desk | 7384642e9206e30855986465a7ef63c8fd76ef2a | [
"MIT"
] | 13 | 2021-01-24T18:08:43.000Z | 2022-03-29T09:23:25.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Core Initiative and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestInnFolioTransactionBundle(unittest.TestCase):
pass
| 21 | 55 | 0.787879 |
b0e199dbedb2b04acd8090c8cf56fc47233d0c06 | 2,212 | py | Python | setup.py | hroncok/towncrier | 2841c12f2e7ebfc40d9cc3228ca468d339225549 | [
"MIT"
] | null | null | null | setup.py | hroncok/towncrier | 2841c12f2e7ebfc40d9cc3228ca468d339225549 | [
"MIT"
] | null | null | null | setup.py | hroncok/towncrier | 2841c12f2e7ebfc40d9cc3228ca468d339225549 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
from setuptools import setup, find_packages
# If incremental is not present then setuptools just silently uses v0.0.0 so
# let's import it and fail instead.
import incremental
setup(
name="towncrier",
maintainer="Amber B... | 40.218182 | 88 | 0.648282 |
58a1b656563adee8716d20abc2619d93df54a083 | 37,908 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import pytest
import platform
import functools
import json
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.crede... | 43.672811 | 242 | 0.654585 |
7e2d9f3c3e80473379275081769263ff9c62ba29 | 130,530 | py | Python | demisto_sdk/commands/find_dependencies/tests/find_dependencies_test.py | lesleyxyz/demisto-sdk | 188199bda6fd56f611f204e4e487d1c912f323aa | [
"MIT"
] | null | null | null | demisto_sdk/commands/find_dependencies/tests/find_dependencies_test.py | lesleyxyz/demisto-sdk | 188199bda6fd56f611f204e4e487d1c912f323aa | [
"MIT"
] | null | null | null | demisto_sdk/commands/find_dependencies/tests/find_dependencies_test.py | lesleyxyz/demisto-sdk | 188199bda6fd56f611f204e4e487d1c912f323aa | [
"MIT"
] | null | null | null | from typing import List
from unittest.mock import patch
import networkx as nx
import pytest
import demisto_sdk.commands.create_id_set.create_id_set as cis
from demisto_sdk.commands.common.constants import (DEFAULT_JOB_FROM_VERSION,
FileType)
from demisto_sdk.commands... | 41.150694 | 158 | 0.522462 |
04f62a40edd2d238f9a0a9bbe64899048f437c64 | 5,457 | py | Python | contrib/seeds/makeseeds.py | CryptoDJ/Feathercoin | d61a127ba728e9790d0d4f0dac5cda43eee724d0 | [
"MIT"
] | 1 | 2021-07-16T09:46:54.000Z | 2021-07-16T09:46:54.000Z | contrib/seeds/makeseeds.py | CryptoDJ/Feathercoin | d61a127ba728e9790d0d4f0dac5cda43eee724d0 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | CryptoDJ/Feathercoin | d61a127ba728e9790d0d4f0dac5cda43eee724d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
import re
import sys
import dns.resolver
import collect... | 32.676647 | 186 | 0.571926 |
a634a4b731c4372a4ee5e9f3168e5dcd4e0a2fff | 10,673 | py | Python | scripts/tweak_attn/align_pos.py | Lucas-Gui/OpenNMT-tf | 3a4d303503f03ed1784f32e20b3f92a4d758860a | [
"MIT"
] | null | null | null | scripts/tweak_attn/align_pos.py | Lucas-Gui/OpenNMT-tf | 3a4d303503f03ed1784f32e20b3f92a4d758860a | [
"MIT"
] | null | null | null | scripts/tweak_attn/align_pos.py | Lucas-Gui/OpenNMT-tf | 3a4d303503f03ed1784f32e20b3f92a4d758860a | [
"MIT"
] | null | null | null | """'Align' a tokenized corpus with the corresponding POS,
by repeating the POS as many times as there are subparts of a word"""
import argparse
from datetime import datetime
from contextlib import ExitStack
from unicodedata import category
punc = list("""()"{}/=+*%:;.,?!&[]#°""") #no apostrophe or minus
assert (... | 40.736641 | 142 | 0.548393 |
d9bba18ce5ea9a2a8b7ef67a6ae3b65ddb47748b | 15,121 | py | Python | horovod/spark/common/params.py | Infi-zc/horovod | 94cd8561a21d449fc8c80c8fef422025b84dfc22 | [
"Apache-2.0"
] | null | null | null | horovod/spark/common/params.py | Infi-zc/horovod | 94cd8561a21d449fc8c80c8fef422025b84dfc22 | [
"Apache-2.0"
] | null | null | null | horovod/spark/common/params.py | Infi-zc/horovod | 94cd8561a21d449fc8c80c8fef422025b84dfc22 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Uber Technologies, Inc. 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 applica... | 37.614428 | 125 | 0.650684 |
6d72532d2f6562f5de4721e77cd7f0c0dfcf86d2 | 12,017 | py | Python | tornado/escape.py | globocom/tornado | 73c0aee4a5898ef3fb7d67e753ae8d47e400b570 | [
"Apache-2.0"
] | 1 | 2019-12-27T00:36:48.000Z | 2019-12-27T00:36:48.000Z | tornado/escape.py | globocom/tornado | 73c0aee4a5898ef3fb7d67e753ae8d47e400b570 | [
"Apache-2.0"
] | null | null | null | tornado/escape.py | globocom/tornado | 73c0aee4a5898ef3fb7d67e753ae8d47e400b570 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | 35.448378 | 182 | 0.645918 |
b3d081fbddac642a087abed2b1266b09f2f0db82 | 847 | py | Python | mode.py | EricJKei/LO-GAN | e5329008fea3e09583eaeb977b5bc4f824431c30 | [
"Apache-2.0"
] | null | null | null | mode.py | EricJKei/LO-GAN | e5329008fea3e09583eaeb977b5bc4f824431c30 | [
"Apache-2.0"
] | null | null | null | mode.py | EricJKei/LO-GAN | e5329008fea3e09583eaeb977b5bc4f824431c30 | [
"Apache-2.0"
] | null | null | null | import os
import tensorflow as tf
from PIL import Image
import numpy as np
import time
# import util
from skimage.measure import compare_ssim as ssim
from tqdm import tqdm
def test_only(args, model, sess, saver):
saver.restore(sess,args.pre_trained_model)
print("saved model is loaded for test only!")
pri... | 30.25 | 104 | 0.695396 |
8d75c0e87e14fc0edf470cb03f8094037cc9580f | 4,607 | py | Python | counter/counter.py | MichaelMW/crispy | 44a076bd90078f773a58c1e83e8d0185ac2eebfd | [
"MIT"
] | 1 | 2019-06-28T21:14:07.000Z | 2019-06-28T21:14:07.000Z | counter/counter.py | MichaelMW/crispy | 44a076bd90078f773a58c1e83e8d0185ac2eebfd | [
"MIT"
] | null | null | null | counter/counter.py | MichaelMW/crispy | 44a076bd90078f773a58c1e83e8d0185ac2eebfd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
####### todo:
# reverse compliment #
### input fasta file
### input gRNA.bed, design file
### output count number for next step.
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE,SIG_DFL)
from sys import stdin, stderr
import argparse
parser = argparse.ArgumentParser... | 32.443662 | 452 | 0.681789 |
d216102c27d07ac2c996c21c9858f09986776fbf | 25,851 | py | Python | sympy/tensor/array/tests/test_arrayop.py | yupbank/sympy | 66d7aef9dc1b26055af22e27ba42004c40b95d7c | [
"BSD-3-Clause"
] | 1 | 2021-11-19T03:38:42.000Z | 2021-11-19T03:38:42.000Z | sympy/tensor/array/tests/test_arrayop.py | yupbank/sympy | 66d7aef9dc1b26055af22e27ba42004c40b95d7c | [
"BSD-3-Clause"
] | null | null | null | sympy/tensor/array/tests/test_arrayop.py | yupbank/sympy | 66d7aef9dc1b26055af22e27ba42004c40b95d7c | [
"BSD-3-Clause"
] | null | null | null | import itertools
import random
from sympy.combinatorics import Permutation
from sympy.combinatorics.permutations import _af_invert
from sympy.testing.pytest import raises
from sympy.core.function import diff
from sympy.core.symbol import symbols
from sympy.functions.elementary.complexes import (adjoint, conjugate, tr... | 71.411602 | 1,443 | 0.411125 |
57af48c7c6ce730f18de8225a93c02bfa45f922d | 1,741 | py | Python | src/pkg/caendr/caendr/models/sql/wormbase_gene_summary.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 3 | 2022-02-09T07:04:37.000Z | 2022-03-11T02:46:35.000Z | src/pkg/caendr/caendr/models/sql/wormbase_gene_summary.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 4 | 2022-01-28T22:28:08.000Z | 2022-02-11T21:47:15.000Z | src/pkg/caendr/caendr/models/sql/wormbase_gene_summary.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 1 | 2022-01-11T03:39:02.000Z | 2022-01-11T03:39:02.000Z | from caendr.services.cloud.postgresql import db
from caendr.models.sql.dict_serializable import DictSerializable
from sqlalchemy import func, or_
from sqlalchemy.ext.hybrid import hybrid_property
class WormbaseGeneSummary(DictSerializable, db.Model):
"""
This is a condensed version of the WormbaseGene model;
... | 37.847826 | 90 | 0.711086 |
8bcf93ed726343e934781853a836e3e04dbecb1c | 3,323 | py | Python | simpleapi/client/client.py | ghuntley/simpleapi | e64e05e9b2276098d3442db174a4d0204be56b39 | [
"MIT"
] | 1 | 2019-06-27T11:41:03.000Z | 2019-06-27T11:41:03.000Z | simpleapi/client/client.py | ghuntley/simpleapi | e64e05e9b2276098d3442db174a4d0204be56b39 | [
"MIT"
] | null | null | null | simpleapi/client/client.py | ghuntley/simpleapi | e64e05e9b2276098d3442db174a4d0204be56b39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__all__ = ('Client', 'ClientException', 'ConnectionException', 'RemoteException', )
import socket
import urllib
import cPickle
from simpleapi.message import formatters, wrappers
class ClientException(Exception): pass
class ConnectionException(ClientException): pass
class RemoteException(Clien... | 33.908163 | 83 | 0.585615 |
019e9cf9297194b84f5986b87bf1bbb2b6a09538 | 3,487 | py | Python | Lib/site-packages/botocore/__init__.py | nilknarfgnow/mypython | 6966e149aa50d6477ecfdd7490efd63d7c217dc8 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/botocore/__init__.py | nilknarfgnow/mypython | 6966e149aa50d6477ecfdd7490efd63d7c217dc8 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/botocore/__init__.py | nilknarfgnow/mypython | 6966e149aa50d6477ecfdd7490efd63d7c217dc8 | [
"bzip2-1.0.6"
] | null | null | null | # Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http... | 37.494624 | 78 | 0.704044 |
bd7df0b18b89b6b4712cf8a513802bb4c35f8178 | 6,456 | py | Python | rastervision2/core/data/label_store/semantic_segmentation_label_store.py | csaybar/raster-vision | 617ca15f64e3b8a391432306a743f7d0dfff352f | [
"Apache-2.0"
] | 1 | 2020-10-10T12:32:43.000Z | 2020-10-10T12:32:43.000Z | rastervision2/core/data/label_store/semantic_segmentation_label_store.py | alvintuitoek/raster-vision | ec6c8309f89c404513862369bb93dd9e6a70b455 | [
"Apache-2.0"
] | null | null | null | rastervision2/core/data/label_store/semantic_segmentation_label_store.py | alvintuitoek/raster-vision | ec6c8309f89c404513862369bb93dd9e6a70b455 | [
"Apache-2.0"
] | 1 | 2021-12-02T08:07:21.000Z | 2021-12-02T08:07:21.000Z | import numpy as np
import rasterio
from rastervision2.pipeline.filesystem import (get_local_path, make_dir,
upload_or_copy, file_exists)
from rastervision2.core.data.label import SemanticSegmentationLabels
from rastervision2.core.data.label_store import LabelStore
from ra... | 38.891566 | 85 | 0.571871 |
28d86f5049d625a5a5178537c34d8c5b236f25b1 | 36,126 | py | Python | tornado/ioloop.py | bgerrity/tornado | 208672f3bf6cbb7e37f54c356e02a71ca29f1e02 | [
"Apache-2.0"
] | 15,056 | 2015-01-01T03:08:16.000Z | 2022-03-31T14:44:56.000Z | tornado/ioloop.py | bgerrity/tornado | 208672f3bf6cbb7e37f54c356e02a71ca29f1e02 | [
"Apache-2.0"
] | 1,645 | 2015-01-05T08:15:32.000Z | 2022-03-24T20:30:10.000Z | tornado/ioloop.py | bgerrity/tornado | 208672f3bf6cbb7e37f54c356e02a71ca29f1e02 | [
"Apache-2.0"
] | 5,098 | 2015-01-02T15:43:36.000Z | 2022-03-30T06:04:43.000Z | #
# Copyright 2009 Facebook
#
# 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, s... | 37.553015 | 88 | 0.619748 |
410190765f55813e843e0b84bfaa8dbe8ec44353 | 865 | py | Python | frc_characterization/elevator_characterization/templates/Talon/robotconfig.py | prateekma/frc-characterization | cfb9af35a2bf1f1e3dc8a743a9482997034305e2 | [
"Apache-2.0"
] | null | null | null | frc_characterization/elevator_characterization/templates/Talon/robotconfig.py | prateekma/frc-characterization | cfb9af35a2bf1f1e3dc8a743a9482997034305e2 | [
"Apache-2.0"
] | null | null | null | frc_characterization/elevator_characterization/templates/Talon/robotconfig.py | prateekma/frc-characterization | cfb9af35a2bf1f1e3dc8a743a9482997034305e2 | [
"Apache-2.0"
] | null | null | null | {
# Class names of motor controllers used.
# Options:
# 'WPI_TalonSRX'
# 'WPI_TalonFX'
# 'WPI_VictorSPX'
# Note: The first motor should always be a TalonSRX/FX, as the VictorSPX
# does not support encoder connections.
"controllerTypes": ["WPI_TalonSRX"],
# Ports for the motors
"m... | 30.892857 | 80 | 0.650867 |
54474b375635b0f06bfdc62fdc3b61b522b431b7 | 3,109 | py | Python | frontera/contrib/backends/remote/messagebus.py | TeamHG-Memex/frontera | 06ab4002428528a2d8b67c1e82368cc5988b2228 | [
"BSD-3-Clause"
] | 3 | 2015-11-11T19:37:16.000Z | 2017-03-15T13:33:54.000Z | frontera/contrib/backends/remote/messagebus.py | TeamHG-Memex/frontera | 06ab4002428528a2d8b67c1e82368cc5988b2228 | [
"BSD-3-Clause"
] | null | null | null | frontera/contrib/backends/remote/messagebus.py | TeamHG-Memex/frontera | 06ab4002428528a2d8b67c1e82368cc5988b2228 | [
"BSD-3-Clause"
] | 2 | 2016-09-08T08:30:24.000Z | 2018-10-02T22:00:47.000Z | # -*- coding: utf-8 -*-
from frontera import Backend
from frontera.core import OverusedBuffer
from codecs.msgpack import Encoder, Decoder
from frontera.utils.misc import load_object
import logging
class MessageBusBackend(Backend):
def __init__(self, manager):
settings = manager.settings
messagebus... | 40.376623 | 119 | 0.681891 |
93fc6743a2c3d354b72e7b889f4a8a320320221a | 25 | py | Python | cd2h_repo_project/modules/contact_us/__init__.py | galterlibrary/InvenioRDM-at-NU | 5aff6ac7c428c9a61bdf221627bfc05f2280d1a3 | [
"MIT"
] | 6 | 2019-09-02T00:01:50.000Z | 2021-11-04T08:23:40.000Z | cd2h_repo_project/modules/contact_us/__init__.py | galterlibrary/InvenioRDM-at-NU | 5aff6ac7c428c9a61bdf221627bfc05f2280d1a3 | [
"MIT"
] | 72 | 2019-09-04T18:52:35.000Z | 2020-07-21T19:58:15.000Z | cd2h_repo_project/modules/contact_us/__init__.py | galterlibrary/InvenioRDM-at-NU | 5aff6ac7c428c9a61bdf221627bfc05f2280d1a3 | [
"MIT"
] | null | null | null | """Contact us module."""
| 12.5 | 24 | 0.6 |
dccefe230b7d1ccfe05b97e0b8790d1820fc7a92 | 1,514 | py | Python | backend/admingym/users/models/users.py | ManuelRivera98/AdminGym | caf2b6f5e9a0ed9e98567a036bec9a34b44ecf13 | [
"MIT"
] | 1 | 2020-09-14T04:23:07.000Z | 2020-09-14T04:23:07.000Z | backend/admingym/users/models/users.py | ManuelRivera98/AdminGym | caf2b6f5e9a0ed9e98567a036bec9a34b44ecf13 | [
"MIT"
] | null | null | null | backend/admingym/users/models/users.py | ManuelRivera98/AdminGym | caf2b6f5e9a0ed9e98567a036bec9a34b44ecf13 | [
"MIT"
] | null | null | null | """Owner model."""
# Django
from django.db import models
from django.contrib.auth.models import AbstractUser
# Validators => Allows us to validate a field against a regular expression.
from django.core.validators import RegexValidator
# Utilities
from admingym.utils.models import BaseModel
class User(BaseModel, Ab... | 25.661017 | 137 | 0.638705 |
8329f86c406aa9559f7a4e0e902ff53373e4797e | 803 | py | Python | treeqn/models/encoding.py | botcs/treeqn | e2ebc46a99483fa188dd229b1a5828459167ccae | [
"MIT"
] | 107 | 2018-03-09T14:28:21.000Z | 2022-03-23T08:24:48.000Z | treeqn/models/encoding.py | botcs/treeqn | e2ebc46a99483fa188dd229b1a5828459167ccae | [
"MIT"
] | 3 | 2018-05-01T16:31:41.000Z | 2018-10-04T15:57:41.000Z | treeqn/models/encoding.py | botcs/treeqn | e2ebc46a99483fa188dd229b1a5828459167ccae | [
"MIT"
] | 22 | 2018-03-09T23:17:27.000Z | 2020-12-11T20:53:05.000Z | import torch.nn as nn
import numpy as np
from treeqn.utils.pytorch_utils import nn_init
def atari_encoder(in_channels):
encoder = nn.Sequential(
nn_init(nn.Conv2d(in_channels, 16, kernel_size=8, stride=4), w_scale=np.sqrt(2)),
nn.ReLU(True),
nn_init(nn.Conv2d(16, 32, kernel_size=4, stride=... | 32.12 | 89 | 0.652553 |
b9cc7431174769b9f85de4daa2809d1eadcb547e | 729 | py | Python | algorithms/bfs-dfs/BFS.py | 1tanwang/graph-and-graph-algorithms | 0bf7d54630eaec56ccef9c224bbe86d4a2a63ebe | [
"Apache-2.0"
] | null | null | null | algorithms/bfs-dfs/BFS.py | 1tanwang/graph-and-graph-algorithms | 0bf7d54630eaec56ccef9c224bbe86d4a2a63ebe | [
"Apache-2.0"
] | null | null | null | algorithms/bfs-dfs/BFS.py | 1tanwang/graph-and-graph-algorithms | 0bf7d54630eaec56ccef9c224bbe86d4a2a63ebe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from graph import Graph, read_adj_list
def bfs_shortest_path(graph, start, goal):
queue = [(start, [start])]
while queue:
(vertex, path) = queue.pop(0)
for next in set(graph.get_neighbors(vertex)) - set(path):
if next == goal:
return path + [ne... | 27 | 65 | 0.580247 |
fd470b3868a4c1df77263111f04d0a1b0f6edb3e | 669 | py | Python | aiogram/types/animation.py | victorusachev/aiogram | 9571669ca4b06165031d8f9830130f3c638b60d8 | [
"MIT"
] | 3 | 2020-12-06T16:55:53.000Z | 2021-11-19T19:25:57.000Z | aiogram/types/animation.py | Kylmakalle/aiogram | 550c41e1752aa08c493d7cb4ec5fec402d8e849c | [
"MIT"
] | 1 | 2019-10-18T19:33:20.000Z | 2019-10-18T19:33:20.000Z | aiogram/types/animation.py | Kylmakalle/aiogram | 550c41e1752aa08c493d7cb4ec5fec402d8e849c | [
"MIT"
] | 2 | 2020-12-30T09:51:30.000Z | 2021-11-10T16:50:28.000Z | from . import base
from . import fields
from . import mixins
from .photo_size import PhotoSize
class Animation(base.TelegramObject, mixins.Downloadable):
"""
You can provide an animation for your game so that it looks stylish in chats
(check out Lumberjack for an example).
This object represents an an... | 31.857143 | 94 | 0.724963 |
f9af4dd11f586d2ee77855be8be05bfd044b05d3 | 1,314 | py | Python | app/migrations/0011_notifica_notifica_vista.py | mapoetto/group2_CTFLab | 5b492ce46875ea37a57701686897bd9613e2dd13 | [
"MIT"
] | 1 | 2021-10-15T14:37:33.000Z | 2021-10-15T14:37:33.000Z | app/migrations/0011_notifica_notifica_vista.py | mapoetto/group2_CTFLab | 5b492ce46875ea37a57701686897bd9613e2dd13 | [
"MIT"
] | null | null | null | app/migrations/0011_notifica_notifica_vista.py | mapoetto/group2_CTFLab | 5b492ce46875ea37a57701686897bd9613e2dd13 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-09-02 09:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0010_auto_20200901_0951'),
]
operations = [
migrations.CreateModel(
name='Notifica',
... | 39.818182 | 180 | 0.606545 |
a73be8d0f3ce4711660c1034776079c4d23aa2dd | 16,516 | py | Python | merlion/models/automl/autosarima.py | jimgoo/Merlion | 2239f4ba6fc4fc08b3f88be842908851ee17ddbf | [
"BSD-3-Clause"
] | 1 | 2022-01-16T01:18:31.000Z | 2022-01-16T01:18:31.000Z | merlion/models/automl/autosarima.py | jimgoo/Merlion | 2239f4ba6fc4fc08b3f88be842908851ee17ddbf | [
"BSD-3-Clause"
] | null | null | null | merlion/models/automl/autosarima.py | jimgoo/Merlion | 2239f4ba6fc4fc08b3f88be842908851ee17ddbf | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2021 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import logging
import warnings
from collections import Iterator
from typing import Tuple, Any, Optio... | 37.79405 | 117 | 0.577077 |
65eb35b294406a618f86393a1fed6ce207422438 | 38,442 | py | Python | dns/zone.py | mbakke/dnspython | 2d6630c50663e9cd55d7485642bac2eda02e96a0 | [
"ISC"
] | null | null | null | dns/zone.py | mbakke/dnspython | 2d6630c50663e9cd55d7485642bac2eda02e96a0 | [
"ISC"
] | null | null | null | dns/zone.py | mbakke/dnspython | 2d6630c50663e9cd55d7485642bac2eda02e96a0 | [
"ISC"
] | null | null | null | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and ... | 37.17795 | 79 | 0.606654 |
0d0ce87fa8ac7eaa3d9abf7849044d59d1524871 | 6,889 | py | Python | tests/h/views/admin/organizations_test.py | bibliotechie/h | 16e275f79ef7d1086971bd30ef403501c6b93beb | [
"BSD-2-Clause"
] | null | null | null | tests/h/views/admin/organizations_test.py | bibliotechie/h | 16e275f79ef7d1086971bd30ef403501c6b93beb | [
"BSD-2-Clause"
] | null | null | null | tests/h/views/admin/organizations_test.py | bibliotechie/h | 16e275f79ef7d1086971bd30ef403501c6b93beb | [
"BSD-2-Clause"
] | null | null | null | from unittest.mock import Mock
import pytest
from h_matchers import Any
from h.models import Organization
from h.traversal import OrganizationContext
from h.views.admin.organizations import (
OrganizationCreateController,
OrganizationEditController,
index,
)
class FakeForm:
def set_appstruct(self, a... | 31.893519 | 84 | 0.647119 |
df1dc2a9c474994e706aefd2e38fd8d99926282d | 777 | py | Python | ws2122-lspm/Lib/site-packages/pm4py/algo/analysis/marking_equation/__init__.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2022-01-19T04:02:46.000Z | 2022-01-19T04:02:46.000Z | ws2122-lspm/Lib/site-packages/pm4py/algo/analysis/marking_equation/__init__.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2021-11-19T07:21:48.000Z | 2021-11-19T07:21:48.000Z | ws2122-lspm/Lib/site-packages/pm4py/algo/analysis/marking_equation/__init__.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2022-01-14T17:15:38.000Z | 2022-01-14T17:15:38.000Z | '''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py 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 late... | 43.166667 | 76 | 0.740026 |
dcdf07dba04956cdb01779f370cc4d37efdedb90 | 1,473 | py | Python | Chapter13/Example13-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | 1 | 2018-08-27T10:09:06.000Z | 2018-08-27T10:09:06.000Z | Chapter13/Example13-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | null | null | null | Chapter13/Example13-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
def true_state_value(probability):
"""
compute the true value of the first state according to dynamics
:param probability: the probability of right action
:return: the true value
V(S1)=p*1*(-1+V(S2))+(1-p)*1*(-1+V(S1))
... | 35.071429 | 104 | 0.638153 |
da6700b3cd59dccf7d4018e54d8275e7a115d795 | 7,449 | py | Python | consumers/venv/lib/python3.7/site-packages/faust/transport/producer.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | consumers/venv/lib/python3.7/site-packages/faust/transport/producer.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | consumers/venv/lib/python3.7/site-packages/faust/transport/producer.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | """Producer.
The Producer is responsible for:
- Holds reference to the transport that created it
- ... and the app via ``self.transport.app``.
- Sending messages.
"""
import asyncio
from asyncio import QueueEmpty
from typing import Any, Awaitable, Mapping, Optional, cast
from mode import Seconds, Service
fro... | 34.971831 | 78 | 0.595113 |
17ca26e36bf0e3956bdf1f0aeaba467bf8ba1ccb | 6,792 | py | Python | tests/unit/utils/test_dpb.py | urban48/debpackager | 08efda2ffcb89286d802893c25ada35eed7f432d | [
"MIT"
] | 66 | 2016-07-09T15:02:26.000Z | 2020-06-15T07:01:36.000Z | tests/unit/utils/test_dpb.py | urban48/debpackager | 08efda2ffcb89286d802893c25ada35eed7f432d | [
"MIT"
] | 2 | 2016-07-10T06:46:45.000Z | 2021-09-08T19:20:53.000Z | tests/unit/utils/test_dpb.py | urban48/debpackager | 08efda2ffcb89286d802893c25ada35eed7f432d | [
"MIT"
] | 7 | 2016-07-10T06:17:26.000Z | 2021-02-27T01:20:18.000Z | import os
import tempfile
import shutil
import pytest
from debpackager.utils.debain_package_manager import Dpm
@pytest.mark.unit
class TestDpb(object):
"""
unit tests for debian package builder module
"""
def setup_method(self, method):
""" setup any state tied to the execution of the give... | 36.713514 | 79 | 0.632509 |
9b1fe320ed633b49b2c2634868cafc289eac3b95 | 190 | py | Python | tests/test_api.py | eoranged/squash | 9fb088e419ab0b0a16dbde126b12051ea2dc4bab | [
"MIT"
] | null | null | null | tests/test_api.py | eoranged/squash | 9fb088e419ab0b0a16dbde126b12051ea2dc4bab | [
"MIT"
] | 13 | 2019-08-06T00:39:44.000Z | 2019-10-28T21:55:16.000Z | tests/test_api.py | eoranged/squash | 9fb088e419ab0b0a16dbde126b12051ea2dc4bab | [
"MIT"
] | 1 | 2019-08-21T17:20:22.000Z | 2019-08-21T17:20:22.000Z | async def test_api_hello(test_cli):
resp = await test_cli.get('/api/v1/hello')
assert resp.status == 200
json_data = await resp.json()
assert json_data == {'hello': 'world'}
| 31.666667 | 46 | 0.663158 |
dcb85a555a8e65cb3a8028a5043f5ddd82d2df24 | 243 | py | Python | tests/stats/test_rv_base.py | EUB-LE/domain-adaptation | 8e548cf99663b12b9fac322ee1c7668118cb1ade | [
"MIT"
] | null | null | null | tests/stats/test_rv_base.py | EUB-LE/domain-adaptation | 8e548cf99663b12b9fac322ee1c7668118cb1ade | [
"MIT"
] | 5 | 2021-05-22T07:58:28.000Z | 2021-05-23T10:58:37.000Z | tests/stats/test_rv_base.py | EUB-LE/domain-adaptation | 8e548cf99663b12b9fac322ee1c7668118cb1ade | [
"MIT"
] | null | null | null | import unittest
from daproperties.stats.rv_base import rv_base
class TestRVBase(unittest.TestCase):
# TODO: Implement
def test_divergence_from_distribution(self):
class rv_subclass(rv_base):
pass
pass | 18.692308 | 49 | 0.699588 |
6ff4d235b410cecb74e5e0e00ced025dab1d0a2a | 1,473 | py | Python | ha-na-ma-nextstrain/scripts/filter_ha_ma.py | blab/cartography | 36ef6408e7bdb73b59003166ad7725662fd8fbe6 | [
"MIT"
] | 1 | 2021-11-19T14:23:29.000Z | 2021-11-19T14:23:29.000Z | ha-na-nextstrain/scripts/filter_ha_ma.py | blab/cartography | 36ef6408e7bdb73b59003166ad7725662fd8fbe6 | [
"MIT"
] | 17 | 2021-07-14T17:44:02.000Z | 2022-02-11T18:43:46.000Z | ha-na-ma-nextstrain/scripts/filter_ha_ma.py | blab/cartography | 36ef6408e7bdb73b59003166ad7725662fd8fbe6 | [
"MIT"
] | 1 | 2020-04-11T15:23:09.000Z | 2020-04-11T15:23:09.000Z | import argparse
import numpy as np
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import re
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--sequence", nargs=3, help="sequences to filter, the one to filter first and one to filter by second... | 32.733333 | 127 | 0.68296 |
603f769847f843d4609ce5cbaeb8eec9f635d354 | 10,154 | py | Python | examples/BigBoy_refactor/players/MediumQPlayer.py | attraylor/poke-env | 05eb57800c16229ec683762e628aacb0b6dd9cc3 | [
"MIT"
] | 4 | 2020-09-15T15:24:57.000Z | 2021-03-02T19:48:24.000Z | examples/BigBoy_refactor/players/MediumQPlayer.py | attraylor/poke-env | 05eb57800c16229ec683762e628aacb0b6dd9cc3 | [
"MIT"
] | 10 | 2021-11-01T10:20:30.000Z | 2022-03-29T10:27:25.000Z | examples/BigBoy_refactor/players/MediumQPlayer.py | attraylor/poke-env | 05eb57800c16229ec683762e628aacb0b6dd9cc3 | [
"MIT"
] | 1 | 2021-03-08T16:02:46.000Z | 2021-03-08T16:02:46.000Z | from poke_env.player.env_player import (
Gen8EnvSinglePlayer,
)
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
import torch
import torch.optim as optim
from players.BigBoyEncoderPlayer import BigBoyEncoderPlayer
class MediumQPlayer(BigBoyEncoderPlayer):
def __init__(self,
name,
... | 39.509728 | 217 | 0.749163 |
88a900407ac4ce72bd69838788d22714a9c77bab | 27,799 | py | Python | mindspore/ops/composite/multitype_ops/_constexpr_utils.py | i4oolish/mindspore | dac3be31d0f2c0a3516200f47af30980e566601b | [
"Apache-2.0"
] | 2 | 2020-08-12T16:14:40.000Z | 2020-12-04T03:05:57.000Z | mindspore/ops/composite/multitype_ops/_constexpr_utils.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | mindspore/ops/composite/multitype_ops/_constexpr_utils.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., 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... | 36.338562 | 118 | 0.628224 |
3ddf61f65f00b55f16b75b1f36c7ca9aa75a022f | 277 | py | Python | Python3/0492-Construct-The-Rectangle/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0492-Construct-The-Rectangle/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0492-Construct-The-Rectangle/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def constructRectangle(self, area):
"""
:type area: int
:rtype: List[int]
"""
return min([(area // W, W) for W in range(1, int(math.sqrt(area)) + 1)
if area % W == 0], key=lambda pair : pair[0] - pair[1])
| 30.777778 | 78 | 0.501805 |
904125b789494129532aeb53d6a26c29bc2d0d71 | 6,428 | py | Python | homie/models/homie_device.py | timpur/homie-discovery-python | f157e3843cae7b1ad3e4fd810b340c35c34473eb | [
"MIT"
] | null | null | null | homie/models/homie_device.py | timpur/homie-discovery-python | f157e3843cae7b1ad3e4fd810b340c35c34473eb | [
"MIT"
] | null | null | null | homie/models/homie_device.py | timpur/homie-discovery-python | f157e3843cae7b1ad3e4fd810b340c35c34473eb | [
"MIT"
] | null | null | null | """Homie Device module"""
import logging
from ..tools import (constants, helpers, HomieDiscoveryBase, STAGE_0, STAGE_1, STAGE_2)
from .homie_node import HomieNode
_LOGGER = logging.getLogger(__name__)
class HomieDevice(HomieDiscoveryBase):
"""A definition of a Homie Device"""
def __init__(self, base_topic... | 32.14 | 120 | 0.625078 |
02d240f6a834fda027f1f50b5866fe7b76b9c260 | 120 | py | Python | files2md/structure_objects/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | 1 | 2020-02-22T00:41:04.000Z | 2020-02-22T00:41:04.000Z | files2md/structure_objects/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | null | null | null | files2md/structure_objects/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | null | null | null | from .file import FileObj
from .structureObject import StructureObject
from .structurable_directory import DirectoryObj
| 30 | 48 | 0.875 |
452282944fc40ee2a33ce6080140e8f1e27cad69 | 4,384 | py | Python | tests/agents/test_nfsp.py | Res260/rlcard | c0fc9fe70c4ec1c726e5e66b62866086491f5dbf | [
"MIT"
] | 2 | 2020-08-24T21:30:44.000Z | 2020-10-27T03:44:04.000Z | tests/agents/test_nfsp.py | Res260/rlcard | c0fc9fe70c4ec1c726e5e66b62866086491f5dbf | [
"MIT"
] | null | null | null | tests/agents/test_nfsp.py | Res260/rlcard | c0fc9fe70c4ec1c726e5e66b62866086491f5dbf | [
"MIT"
] | 2 | 2020-02-23T17:26:14.000Z | 2020-12-22T15:34:13.000Z | import unittest
import tensorflow as tf
import numpy as np
from rlcard.agents.nfsp_agent import NFSPAgent, ReservoirBuffer
class TestNFSP(unittest.TestCase):
def test_init(self):
sess = tf.InteractiveSession()
tf.Variable(0, name='global_step', trainable=False)
agent = NFSPAgent(sess=se... | 35.354839 | 178 | 0.547673 |
39e43f51627b2b4a362d75fa1a9ec41db4a63113 | 3,539 | py | Python | kubernetes_asyncio/client/models/v1_node_selector.py | dineshsonachalam/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | 1 | 2021-02-25T04:36:18.000Z | 2021-02-25T04:36:18.000Z | kubernetes_asyncio/client/models/v1_node_selector.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_node_selector.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | 30.247863 | 119 | 0.601865 |
5f81f5c12c6060f1f3d7e3d4e85c7b6904454af0 | 1,598 | py | Python | testing/tests/001-main/001-empty/002-authenticated/006-news.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 216 | 2015-01-05T12:48:10.000Z | 2022-03-08T00:12:23.000Z | testing/tests/001-main/001-empty/002-authenticated/006-news.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 55 | 2015-02-28T12:10:26.000Z | 2020-11-18T17:45:16.000Z | testing/tests/001-main/001-empty/002-authenticated/006-news.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 34 | 2015-05-02T15:15:10.000Z | 2020-06-15T19:20:37.000Z | with_class = testing.expect.with_class
extract_text = testing.expect.extract_text
with frontend.signin():
frontend.page(
"news",
expect={ "document_title": testing.expect.document_title(u"News"),
"content_title": testing.expect.paleyellow_title(0, u"News"),
"pagehe... | 45.657143 | 90 | 0.58761 |
686085a72f209fb7de60b7e6d8913dcd45c916f1 | 673 | py | Python | leetcode/medium/word-break.py | vtemian/interviews-prep | ddef96b5ecc699a590376a892a804c143fe18034 | [
"Apache-2.0"
] | 8 | 2019-05-14T12:50:29.000Z | 2022-03-01T09:08:27.000Z | leetcode/medium/word-break.py | vtemian/interviews-prep | ddef96b5ecc699a590376a892a804c143fe18034 | [
"Apache-2.0"
] | 46 | 2019-03-24T20:59:29.000Z | 2019-04-09T16:28:43.000Z | leetcode/medium/word-break.py | vtemian/interviews-prep | ddef96b5ecc699a590376a892a804c143fe18034 | [
"Apache-2.0"
] | 1 | 2022-01-28T12:46:29.000Z | 2022-01-28T12:46:29.000Z | class Solution:
def wordBreak(self, s: str, wordDict: List[str]) -> bool:
if not s or not wordDict:
return False
wordDict = set(wordDict)
queue = [0]
visited = [False] * len(s)
while queue:
current = queue.pop(0)
if visited[current]:
... | 21.709677 | 61 | 0.444279 |
46a34778f8420ce822d5a9c20476de6fd2d6a129 | 113 | py | Python | SLKlib/mapper/protein/__init__.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | SLKlib/mapper/protein/__init__.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | SLKlib/mapper/protein/__init__.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'NetBiolGroup'
__email__ = 'netbiol@netbiol.elte.hu'
__version__ = '0.1.0'
| 18.833333 | 37 | 0.663717 |
782fdf68569a57a2d81048739b768076179c22ea | 8,450 | py | Python | deep_sdf/mesh.py | Kaminyou/DeepImplicitTemplates | cb6b65c198cdce2851c24e181f444864c61a8689 | [
"MIT"
] | 120 | 2020-12-01T13:25:00.000Z | 2022-03-30T02:49:33.000Z | deep_sdf/mesh.py | Kaminyou/DeepImplicitTemplates | cb6b65c198cdce2851c24e181f444864c61a8689 | [
"MIT"
] | 3 | 2021-03-11T12:33:17.000Z | 2021-07-09T05:32:08.000Z | deep_sdf/mesh.py | Kaminyou/DeepImplicitTemplates | cb6b65c198cdce2851c24e181f444864c61a8689 | [
"MIT"
] | 12 | 2020-12-20T08:15:59.000Z | 2022-02-09T08:50:47.000Z | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import logging
import numpy as np
import plyfile
import skimage.measure
import time
import torch
import deep_sdf.utils
def create_mesh(
decoder, latent_vec, filename, N=256, max_batch=(32 ** 3 * 4), offset=None, scale=None, volume_si... | 33.665339 | 107 | 0.600828 |
c58dcb8c8b7ac791cd4b506b3cf40541b1847133 | 755 | py | Python | tensorflow_hub/version.py | DEVESHTARASIA/hub | b203945ebcb5c29f4115d2bdcb3d21d387a59f0c | [
"Apache-2.0"
] | 6 | 2018-10-25T17:31:18.000Z | 2022-02-12T15:24:12.000Z | tensorflow_hub/version.py | syed-ahmed/hub | ac2a47051dac4a2e9bd0c93eaa8dac550c350608 | [
"Apache-2.0"
] | null | null | null | tensorflow_hub/version.py | syed-ahmed/hub | ac2a47051dac4a2e9bd0c93eaa8dac550c350608 | [
"Apache-2.0"
] | 2 | 2019-01-24T04:58:03.000Z | 2021-08-24T02:16:07.000Z | # Copyright 2018 The TensorFlow Hub 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... | 41.944444 | 80 | 0.675497 |
36c12e88851f2517ef90365be6c6f4ad6b132c35 | 1,247 | py | Python | test/test_target_policies.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_target_policies.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_target_policies.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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 l... | 25.44898 | 75 | 0.729751 |
7d84a2859d11aa269fd6ad8e5c32deca34204d36 | 23,599 | py | Python | azure-mgmt-logic/azure/mgmt/logic/operations/workflow_triggers_operations.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-logic/azure/mgmt/logic/operations/workflow_triggers_operations.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2021-06-02T00:24:51.000Z | 2021-06-02T00:24:51.000Z | azure-mgmt-logic/azure/mgmt/logic/operations/workflow_triggers_operations.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2020-07-25T20:36:02.000Z | 2020-07-25T20:36:02.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 ... | 48.063136 | 200 | 0.668461 |
9c1ff9f1a5e0e35cce12a22d494fc369efc95e9f | 26,833 | py | Python | openmdao/core/test/test_units.py | colinxs/OpenMDAO | a9a52be29281a23a102c64b577066ee5fc70f4b4 | [
"Apache-2.0"
] | null | null | null | openmdao/core/test/test_units.py | colinxs/OpenMDAO | a9a52be29281a23a102c64b577066ee5fc70f4b4 | [
"Apache-2.0"
] | null | null | null | openmdao/core/test/test_units.py | colinxs/OpenMDAO | a9a52be29281a23a102c64b577066ee5fc70f4b4 | [
"Apache-2.0"
] | null | null | null | """ Tests the ins and outs of automatic unit conversion in OpenMDAO."""
import unittest
from six import iteritems
from six.moves import cStringIO
import numpy as np
from openmdao.api import IndepVarComp, Component, Group, Problem, ExecComp
from openmdao.test.util import assert_rel_error
class SrcComp(Component):
... | 36.858516 | 116 | 0.527634 |
ec6e246da714c454427400b1e1ed447318783ad5 | 4,116 | py | Python | benchmark/startQiskit_noisy2464.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2464.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2464.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=37
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 34.3 | 140 | 0.652818 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.