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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d7c6c7b4aecd7b5e5e03ecbf705e1cd1df022fe7 | 4,036 | py | Python | tests/basics/Branching.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | null | null | null | tests/basics/Branching.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | null | null | null | tests/basics/Branching.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | 1 | 2018-12-16T23:51:18.000Z | 2018-12-16T23:51:18.000Z | # Copyright 2018, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 21.698925 | 92 | 0.563677 |
147ac3c79758847718ccf4809b924d665aab2263 | 2,273 | py | Python | app/views/users/messages/views.py | FundingCircle/DjanGoat | 013c7367294682955daf9eba205270bd2f9725cd | [
"MIT"
] | 1 | 2019-05-07T09:49:25.000Z | 2019-05-07T09:49:25.000Z | app/views/users/messages/views.py | FundingCircle/DjanGoat | 013c7367294682955daf9eba205270bd2f9725cd | [
"MIT"
] | null | null | null | app/views/users/messages/views.py | FundingCircle/DjanGoat | 013c7367294682955daf9eba205270bd2f9725cd | [
"MIT"
] | null | null | null |
from django.http import HttpResponse
from django.contrib import messages
from django.views.decorators.http import require_http_methods
from django.shortcuts import render, redirect
from django.utils import timezone
from app.decorators import user_is_authenticated
from app.models import User, Message
from app.views i... | 36.66129 | 75 | 0.623405 |
379721dc94f9a66eaa9247b10c7c63220f02bf26 | 222 | py | Python | setup.py | stuartasims/paycheck_protection_program_eda | cf290e0b10e6a72e43d764c47a128676875ca2e4 | [
"FTL"
] | null | null | null | setup.py | stuartasims/paycheck_protection_program_eda | cf290e0b10e6a72e43d764c47a128676875ca2e4 | [
"FTL"
] | null | null | null | setup.py | stuartasims/paycheck_protection_program_eda | cf290e0b10e6a72e43d764c47a128676875ca2e4 | [
"FTL"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='Digging into the released ppp loan data',
author='Stuart Sims',
license='',
)
| 20.181818 | 58 | 0.666667 |
3130006a91058eaa56b7ac8ea4fcaa305be259e4 | 780 | py | Python | virl/cli/definitions/images/ls/commands.py | ttafsir/virlutils | 5cb0e5410023b30d49515be5e3cb731dbd6cbeef | [
"MIT"
] | null | null | null | virl/cli/definitions/images/ls/commands.py | ttafsir/virlutils | 5cb0e5410023b30d49515be5e3cb731dbd6cbeef | [
"MIT"
] | null | null | null | virl/cli/definitions/images/ls/commands.py | ttafsir/virlutils | 5cb0e5410023b30d49515be5e3cb731dbd6cbeef | [
"MIT"
] | null | null | null | import click
from virl.api import VIRLServer
from virl.cli.views import image_list_table
from virl.helpers import get_cml_client
@click.command()
@click.option("--image", default=None)
def ls(**kwargs):
"""
list all images or the details of a specific image
"""
image = kwargs.get("image")
server ... | 26 | 64 | 0.641026 |
e15554737b9f3fa36382dde15ded928271679538 | 7,564 | py | Python | python/paddle/fluid/tests/unittests/test_prior_box_op.py | jerrywgz/Paddle | 85c4912755b783dd7554a9d6b9dae4a7e40371bc | [
"Apache-2.0"
] | 1 | 2018-08-03T03:33:52.000Z | 2018-08-03T03:33:52.000Z | python/paddle/fluid/tests/unittests/test_prior_box_op.py | jerrywgz/Paddle | 85c4912755b783dd7554a9d6b9dae4a7e40371bc | [
"Apache-2.0"
] | 3 | 2017-07-15T14:20:08.000Z | 2019-05-06T03:16:54.000Z | python/paddle/fluid/tests/unittests/test_prior_box_op.py | jerrywgz/Paddle | 85c4912755b783dd7554a9d6b9dae4a7e40371bc | [
"Apache-2.0"
] | 1 | 2018-07-20T07:13:31.000Z | 2018-07-20T07:13:31.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... | 39.810526 | 78 | 0.49762 |
7101cbfbbec4818d3c2c0a998f8d9ae677e3cf5b | 1,845 | py | Python | setup.py | waltherg/PubChemPy | e3fd6cc401bfbe605082911911763c54cc02276a | [
"MIT"
] | 1 | 2015-02-18T10:01:17.000Z | 2015-02-18T10:01:17.000Z | setup.py | waltherg/PubChemPy | e3fd6cc401bfbe605082911911763c54cc02276a | [
"MIT"
] | null | null | null | setup.py | waltherg/PubChemPy | e3fd6cc401bfbe605082911911763c54cc02276a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup
import pubchempy
if os.path.exists('README.rst'):
long_description = open('README.rst').read()
else:
long_description = '''PubChemPy is a wrapper around the PubChem PUG REST API that provides a way to interact
with PubChem in Python. It al... | 37.653061 | 118 | 0.668293 |
c1e8abf4e62b8efc5c7349b99aabcac94e8186e4 | 5,692 | py | Python | coloring/solver.py | WittgensteinInHisYouth/Discrete-Optimization | 07f30058b51eace6a8b12a4a996bb92de99876e1 | [
"CNRI-Python"
] | 1 | 2022-01-20T06:41:34.000Z | 2022-01-20T06:41:34.000Z | coloring/solver.py | waitaminutewhoareyou/Coursera-Discrete-Optimization | 07f30058b51eace6a8b12a4a996bb92de99876e1 | [
"CNRI-Python"
] | null | null | null | coloring/solver.py | waitaminutewhoareyou/Coursera-Discrete-Optimization | 07f30058b51eace6a8b12a4a996bb92de99876e1 | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# from mip import *
import random
from csp import *
import gurobipy as gp
from gurobipy import GRB
# def mip_solver(node_count, edge_count, edges):
# m = Model(solver_name=GRB)
# M = node_count * 2
# x = [m.add_var(var_type=INTEGER, lb=0, ub=node_count) for _ in ra... | 35.575 | 188 | 0.611384 |
a85c9fb696feb93674797708f6af445f89b427fa | 77,731 | py | Python | bin/ADFRsuite/CCSBpckgs/PmvApp/secondaryStructureCmds.py | AngelRuizMoreno/Jupyter_Dock_devel | 6d23bc174d5294d1e9909a0a1f9da0713042339e | [
"MIT"
] | null | null | null | bin/ADFRsuite/CCSBpckgs/PmvApp/secondaryStructureCmds.py | AngelRuizMoreno/Jupyter_Dock_devel | 6d23bc174d5294d1e9909a0a1f9da0713042339e | [
"MIT"
] | null | null | null | bin/ADFRsuite/CCSBpckgs/PmvApp/secondaryStructureCmds.py | AngelRuizMoreno/Jupyter_Dock_devel | 6d23bc174d5294d1e9909a0a1f9da0713042339e | [
"MIT"
] | 1 | 2021-11-04T21:48:14.000Z | 2021-11-04T21:48:14.000Z | ################################################################################
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your op... | 46.741431 | 1,042 | 0.523935 |
4ac6c95e47f7e0c117f8f3e7d54da78c9fea5a88 | 32,265 | py | Python | truffe2/accounting_tools/migrations/0026_auto__del_field_invoice_unit__del_field_cashbook_unit__del_field_withd.py | JonathanCollaud/truffe2 | 5cbb055ac1acf7e7dc697340618fcb56c67fbd91 | [
"BSD-2-Clause"
] | 9 | 2016-09-14T02:19:19.000Z | 2020-10-18T14:52:14.000Z | truffe2/accounting_tools/migrations/0026_auto__del_field_invoice_unit__del_field_cashbook_unit__del_field_withd.py | JonathanCollaud/truffe2 | 5cbb055ac1acf7e7dc697340618fcb56c67fbd91 | [
"BSD-2-Clause"
] | 19 | 2016-11-09T21:28:51.000Z | 2021-02-10T22:37:31.000Z | truffe2/accounting_tools/migrations/0026_auto__del_field_invoice_unit__del_field_cashbook_unit__del_field_withd.py | JonathanCollaud/truffe2 | 5cbb055ac1acf7e7dc697340618fcb56c67fbd91 | [
"BSD-2-Clause"
] | 13 | 2016-12-31T14:22:09.000Z | 2020-12-27T19:43:19.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Invoice.unit'
db.delete_column(u'accounting_tools_invoi... | 82.308673 | 195 | 0.571083 |
83dc32f5197cacb81dec4d373e0ef0bdac36eb85 | 15,976 | py | Python | src/map_model.py | akolishchak/doom-net-pytorch | 96bad5b15c9c5267d494cd5791481801cd6d2107 | [
"MIT"
] | 143 | 2017-01-30T01:43:58.000Z | 2021-11-15T07:53:22.000Z | src/map_model.py | akolishchak/doom-net-pytorch | 96bad5b15c9c5267d494cd5791481801cd6d2107 | [
"MIT"
] | 7 | 2017-12-28T02:42:08.000Z | 2020-05-23T23:12:33.000Z | src/map_model.py | akolishchak/doom-net-pytorch | 96bad5b15c9c5267d494cd5791481801cd6d2107 | [
"MIT"
] | 27 | 2017-02-03T09:20:10.000Z | 2020-07-19T21:35:28.000Z | #
# map_model.py, doom-net
#
# Created by Andrey Kolishchak on 03/03/18.
#
import torch.nn as nn
import torch.nn.functional as F
class ObjectModel(nn.Module):
def __init__(self, args):
super().__init__()
self.conv1 = nn.Conv2d(3, 16, kernel_size=7, stride=(1, 1), dilation=(1, 1), padding=(0, 3))
... | 42.376658 | 114 | 0.593953 |
873d7c8a682f0590f140a3a59058647296da7b14 | 25,473 | py | Python | src/pretalx/orga/views/event.py | chriswolfdesign/pretalx | fb6bcf090a5c92e55a79851d60dfc716309da557 | [
"Apache-2.0"
] | null | null | null | src/pretalx/orga/views/event.py | chriswolfdesign/pretalx | fb6bcf090a5c92e55a79851d60dfc716309da557 | [
"Apache-2.0"
] | null | null | null | src/pretalx/orga/views/event.py | chriswolfdesign/pretalx | fb6bcf090a5c92e55a79851d60dfc716309da557 | [
"Apache-2.0"
] | null | null | null | import json
from contextlib import suppress
from pathlib import Path
from csp.decorators import csp_update
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login
from django.core.files.storage import FileSystemStorage
from django.db import transaction
from django.db.... | 34.70436 | 156 | 0.593256 |
96e3fe5b369e81e2300fa94697e053928e6a1658 | 542 | py | Python | cloudaux/__about__.py | Deepak1100/cloudaux | 322b26b9c47e5f4fcd5cd11fc4aa5fa830c050f9 | [
"Apache-2.0"
] | null | null | null | cloudaux/__about__.py | Deepak1100/cloudaux | 322b26b9c47e5f4fcd5cd11fc4aa5fa830c050f9 | [
"Apache-2.0"
] | null | null | null | cloudaux/__about__.py | Deepak1100/cloudaux | 322b26b9c47e5f4fcd5cd11fc4aa5fa830c050f9 | [
"Apache-2.0"
] | null | null | null | __all__ = [
'__title__',
'__summary__',
'__uri__',
'__version__',
'__author__',
'__email__',
'__license__',
'__copyright__'
]
__title__ = 'cloudaux'
__summary__ = 'Cloud Auxiliary is a python wrapper and orchestration module for interacting with cloud providers'
__uri__ = 'https://githu... | 23.565217 | 113 | 0.706642 |
711272a29e309d0368aa59cd19ec68d01df72892 | 1,040 | py | Python | leetcode/number_of_submatrices_that_sum_to_target/number_of_submatrices_that_sum_to_target.py | sagasu/python-algorithms | d630777a3f17823165e4d72ab780ede7b10df752 | [
"MIT"
] | null | null | null | leetcode/number_of_submatrices_that_sum_to_target/number_of_submatrices_that_sum_to_target.py | sagasu/python-algorithms | d630777a3f17823165e4d72ab780ede7b10df752 | [
"MIT"
] | null | null | null | leetcode/number_of_submatrices_that_sum_to_target/number_of_submatrices_that_sum_to_target.py | sagasu/python-algorithms | d630777a3f17823165e4d72ab780ede7b10df752 | [
"MIT"
] | null | null | null | class Solution:
def numSubmatrixSumTarget(self, matrix: List[List[int]], target: int) -> int:
rows = len(matrix)
cols = len(matrix[0])
prefix = [[0] * (cols + 1) for _ in range(rows + 1)]
for r in range(rows):
for c in range(cols):
prefix[r + 1][c+ 1] = m... | 31.515152 | 98 | 0.447115 |
67ab8681787575ceb510c757b407af173e428376 | 2,901 | py | Python | DataStructures/Stack/Stack.py | chrisphil335/structlinks | 61aee24ec15c7caab9ce99e1f97ce30e7f21157c | [
"MIT"
] | 9 | 2021-04-09T21:20:46.000Z | 2022-03-25T12:14:43.000Z | DataStructures/Stack/Stack.py | chrisphil335/structlinks | 61aee24ec15c7caab9ce99e1f97ce30e7f21157c | [
"MIT"
] | 19 | 2021-03-22T07:52:39.000Z | 2021-04-07T20:04:05.000Z | DataStructures/Stack/Stack.py | chrisphil335/structlinks | 61aee24ec15c7caab9ce99e1f97ce30e7f21157c | [
"MIT"
] | 7 | 2021-04-10T21:08:12.000Z | 2022-03-20T12:55:23.000Z | """
This is an implementation of the stack data structure, with code pulled from the
University of Toronto's CSC110 course notes.
"""
from __future__ import annotations
from typing import Any, Optional, Callable, Sequence
class Stack:
"""
This class represents a stack data structure
"""
def __init__(... | 26.614679 | 83 | 0.567046 |
798966c28e6ad03ae4ebc8f6597b896df7d759f3 | 9,528 | py | Python | devel/lib/python2.7/dist-packages/costmap_prohibition_layer/srv/_GetProhibitedPoints.py | Jam-cpu/Masters-Project---Final | 0b266b1f117a579b96507249f0a128d0e3cc082a | [
"BSD-3-Clause-Clear"
] | null | null | null | devel/lib/python2.7/dist-packages/costmap_prohibition_layer/srv/_GetProhibitedPoints.py | Jam-cpu/Masters-Project---Final | 0b266b1f117a579b96507249f0a128d0e3cc082a | [
"BSD-3-Clause-Clear"
] | null | null | null | devel/lib/python2.7/dist-packages/costmap_prohibition_layer/srv/_GetProhibitedPoints.py | Jam-cpu/Masters-Project---Final | 0b266b1f117a579b96507249f0a128d0e3cc082a | [
"BSD-3-Clause-Clear"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from costmap_prohibition_layer/GetProhibitedPointsRequest.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class GetProhibitedPointsRequest(genpy.Message):
... | 34.150538 | 145 | 0.651448 |
8200a1d71664903771a6575ebea3f92a9515b957 | 5,621 | py | Python | stanza/models/mwt/trainer.py | turtlesoupy/stanza | 8511620010ba22123f29ea1a7ec3606ec96aaf69 | [
"Apache-2.0"
] | null | null | null | stanza/models/mwt/trainer.py | turtlesoupy/stanza | 8511620010ba22123f29ea1a7ec3606ec96aaf69 | [
"Apache-2.0"
] | null | null | null | stanza/models/mwt/trainer.py | turtlesoupy/stanza | 8511620010ba22123f29ea1a7ec3606ec96aaf69 | [
"Apache-2.0"
] | null | null | null | """
A trainer class to handle training and testing of models.
"""
import sys
import numpy as np
from collections import Counter
import logging
import torch
from torch import nn
import torch.nn.init as init
import stanza.models.common.seq2seq_constant as constant
from stanza.models.common.trainer import Trainer as Bas... | 36.5 | 102 | 0.595446 |
da8df67cb8f662318407cbf704123e31c5895238 | 12,584 | py | Python | tensorflow/python/layers/core.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 1 | 2018-11-15T08:44:10.000Z | 2018-11-15T08:44:10.000Z | tensorflow/python/layers/core.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/layers/core.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 1 | 2020-07-20T18:02:33.000Z | 2020-07-20T18:02:33.000Z | # Copyright 2015 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... | 40.857143 | 79 | 0.681739 |
3566024b052f30b3746eca7d117e413e0afc46d9 | 134,832 | py | Python | tests/models/validators/v1_3_0/jsd_7ab9a8bd4f3b86a4.py | daxm/dnacentersdk | 5baa0cb151fb9e72cf7af1ae29e7541d89c3f06b | [
"MIT"
] | null | null | null | tests/models/validators/v1_3_0/jsd_7ab9a8bd4f3b86a4.py | daxm/dnacentersdk | 5baa0cb151fb9e72cf7af1ae29e7541d89c3f06b | [
"MIT"
] | null | null | null | tests/models/validators/v1_3_0/jsd_7ab9a8bd4f3b86a4.py | daxm/dnacentersdk | 5baa0cb151fb9e72cf7af1ae29e7541d89c3f06b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNA Center Retrieves previous Pathtrace data model.
Copyright (c) 2019 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction,... | 24.631348 | 78 | 0.189176 |
4f0028bfdc39633b26fe4910dd0e09c9293c9928 | 2,533 | py | Python | backend/opnreco/models/dbmeta.py | OpenPaymentNetwork/opnreco | 99c8955d7e200fe11fc23c3568879c543940b168 | [
"MIT"
] | null | null | null | backend/opnreco/models/dbmeta.py | OpenPaymentNetwork/opnreco | 99c8955d7e200fe11fc23c3568879c543940b168 | [
"MIT"
] | null | null | null | backend/opnreco/models/dbmeta.py | OpenPaymentNetwork/opnreco | 99c8955d7e200fe11fc23c3568879c543940b168 | [
"MIT"
] | null | null | null |
from opnreco.render import get_json_default
from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import configure_mappers
import json
import os
import zope.sqlalchemy
# import or define all models here to ensure they are attached to the
# Base.metadata prior to any ini... | 29.453488 | 78 | 0.72878 |
f4ca004cbafc8c4521bde01f0bd6bb227a41f93e | 1,741 | py | Python | memodrop/urls.py | mhndlsz/memodrop | 7ba39143c8e4fbe67881b141accedef535e936e6 | [
"MIT"
] | 18 | 2018-04-15T14:01:25.000Z | 2022-03-16T14:57:28.000Z | memodrop/urls.py | mhndlsz/memodrop | 7ba39143c8e4fbe67881b141accedef535e936e6 | [
"MIT"
] | null | null | null | memodrop/urls.py | mhndlsz/memodrop | 7ba39143c8e4fbe67881b141accedef535e936e6 | [
"MIT"
] | 4 | 2018-04-15T14:16:12.000Z | 2020-08-10T14:31:48.000Z | """memodrop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 44.641026 | 87 | 0.693854 |
ab4a75c04a0fe9097c592c76275e2b7a52a27174 | 28,660 | py | Python | wemake_python_styleguide/violations/refactoring.py | toennifer/wemake-python-styleguide | 12f942035aec4a34d38e24df89b150b88f35e021 | [
"MIT"
] | null | null | null | wemake_python_styleguide/violations/refactoring.py | toennifer/wemake-python-styleguide | 12f942035aec4a34d38e24df89b150b88f35e021 | [
"MIT"
] | null | null | null | wemake_python_styleguide/violations/refactoring.py | toennifer/wemake-python-styleguide | 12f942035aec4a34d38e24df89b150b88f35e021 | [
"MIT"
] | null | null | null | """
These checks ensure that you don't have patterns that can be refactored.
There are so many ways of doing the same thing in Python.
Here we collect know patterns that can be rewritten into
much easier or just more pythonic version.
.. currentmodule:: wemake_python_styleguide.violations.refactoring
Summary
-------... | 23.225284 | 80 | 0.612247 |
8b66471d95f20132753bef73defd69edb21ae489 | 1,202 | py | Python | ott/core/__init__.py | meyerscetbon/ott | 7f9aede929b8f202cb56d60bc7bf9d731bd94645 | [
"Apache-2.0"
] | null | null | null | ott/core/__init__.py | meyerscetbon/ott | 7f9aede929b8f202cb56d60bc7bf9d731bd94645 | [
"Apache-2.0"
] | null | null | null | ott/core/__init__.py | meyerscetbon/ott | 7f9aede929b8f202cb56d60bc7bf9d731bd94645 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 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 agreed ... | 34.342857 | 80 | 0.785358 |
513255dc3f549b45b87b3d0a9de57ee2557de556 | 2,323 | py | Python | tests/test_ratelimit.py | komuw/xyzabc | 80a3aafc6d098cc7af7e08d8ebdea7d55cef50b0 | [
"MIT"
] | 4 | 2019-07-23T20:40:46.000Z | 2019-08-16T15:30:54.000Z | tests/test_ratelimit.py | komuw/wiji | 80a3aafc6d098cc7af7e08d8ebdea7d55cef50b0 | [
"MIT"
] | 73 | 2019-02-28T10:16:12.000Z | 2019-07-25T00:53:38.000Z | tests/test_ratelimit.py | komuw/xyzabc | 80a3aafc6d098cc7af7e08d8ebdea7d55cef50b0 | [
"MIT"
] | 1 | 2019-08-16T15:31:06.000Z | 2019-08-16T15:31:06.000Z | import time
import asyncio
from unittest import TestCase, mock
import wiji
def AsyncMock(*args, **kwargs):
"""
see: https://blog.miguelgrinberg.com/post/unit-testing-asyncio-code
"""
m = mock.MagicMock(*args, **kwargs)
async def mock_coro(*args, **kwargs):
return m(*args, **kwargs)
... | 32.71831 | 97 | 0.658631 |
98b1982dd87dc971ddad5b7fbdad15627c83848a | 1,877 | py | Python | gist/cli.py | thisisibrahimd/gist | 846248afdcb4ca6b0990c358f70c600a31659386 | [
"Apache-2.0"
] | null | null | null | gist/cli.py | thisisibrahimd/gist | 846248afdcb4ca6b0990c358f70c600a31659386 | [
"Apache-2.0"
] | null | null | null | gist/cli.py | thisisibrahimd/gist | 846248afdcb4ca6b0990c358f70c600a31659386 | [
"Apache-2.0"
] | null | null | null | import os
import logging
import click
import os
from gist.core import get_gist_score
from gist.repo import CritRepo, EhrRepo
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
logger = logging.getLogger(__name__)
@click.command()
@click.option('-d', '--debug', is_flag=True, envvar="GIST_DEBUG", he... | 43.651163 | 165 | 0.733617 |
a23996e5dee23e0a712ecd799abbfaf136634840 | 11,152 | py | Python | sk_dsp_comm/coeff2header.py | toddrme2178/scikit-dsp-comm | e08427dfcf75d8389e921ab4d01ea3d2c7173a52 | [
"BSD-2-Clause"
] | null | null | null | sk_dsp_comm/coeff2header.py | toddrme2178/scikit-dsp-comm | e08427dfcf75d8389e921ab4d01ea3d2c7173a52 | [
"BSD-2-Clause"
] | null | null | null | sk_dsp_comm/coeff2header.py | toddrme2178/scikit-dsp-comm | e08427dfcf75d8389e921ab4d01ea3d2c7173a52 | [
"BSD-2-Clause"
] | null | null | null | """
Digital Filter Coefficient Conversion to C Header Files
Copyright (c) March 2017, Mark Wickert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain... | 38.857143 | 93 | 0.483411 |
fce784836dbbb9d0f9dd9db1c3315c65c4afaabf | 65,342 | py | Python | ceilometer/tests/network/test_notifications.py | shahbazn/ceilometer | 6308a46f14b21fb39c0e728c150ab4efde5b532a | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/network/test_notifications.py | shahbazn/ceilometer | 6308a46f14b21fb39c0e728c150ab4efde5b532a | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/network/test_notifications.py | shahbazn/ceilometer | 6308a46f14b21fb39c0e728c150ab4efde5b532a | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | 43.15852 | 79 | 0.632411 |
cf243ca279e7e3c030132451950c5ecae0407d67 | 1,332 | py | Python | api/todo.py | lambda-lambda/todo_list | d8334929ec1407c771aa473e4ee056c5cff6a646 | [
"MIT"
] | null | null | null | api/todo.py | lambda-lambda/todo_list | d8334929ec1407c771aa473e4ee056c5cff6a646 | [
"MIT"
] | null | null | null | api/todo.py | lambda-lambda/todo_list | d8334929ec1407c771aa473e4ee056c5cff6a646 | [
"MIT"
] | null | null | null | from models.todo import Todo
from models.session import current_user
from response import Response
from auth import (
login_required,
same_user_required,
)
def add(request):
user = current_user(request)
form = request.data
form['user_id'] = user.id
todo = Todo.new(**form)
response = Respo... | 23.785714 | 77 | 0.66967 |
2ec964d73b93f510eabc2de668684feb6dd470c3 | 4,529 | py | Python | yocto/poky/bitbake/lib/bb/checksum.py | libreswitch/libreswitch | 1bb99e4bbc55aff46048453e28a1466b08d338aa | [
"Apache-2.0"
] | 16 | 2017-01-17T15:20:43.000Z | 2021-03-19T05:45:14.000Z | yocto/poky/bitbake/lib/bb/checksum.py | libreswitch/libreswitch | 1bb99e4bbc55aff46048453e28a1466b08d338aa | [
"Apache-2.0"
] | 415 | 2016-12-20T17:20:45.000Z | 2018-09-23T07:59:23.000Z | yocto/poky/bitbake/lib/bb/checksum.py | libreswitch/libreswitch | 1bb99e4bbc55aff46048453e28a1466b08d338aa | [
"Apache-2.0"
] | 10 | 2016-12-20T13:24:50.000Z | 2021-03-19T05:46:43.000Z | # Local file checksum cache implementation
#
# Copyright (C) 2012 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that i... | 32.35 | 108 | 0.57187 |
cc60806515b3fecb406ebc1589f23a5bd303acb5 | 3,288 | py | Python | yarn/datadog_checks/yarn/config_models/instance.py | codylerum/integrations-core | aee18148cebf5026099abde7bc218d3ba8d2e75c | [
"BSD-3-Clause"
] | null | null | null | yarn/datadog_checks/yarn/config_models/instance.py | codylerum/integrations-core | aee18148cebf5026099abde7bc218d3ba8d2e75c | [
"BSD-3-Clause"
] | null | null | null | yarn/datadog_checks/yarn/config_models/instance.py | codylerum/integrations-core | aee18148cebf5026099abde7bc218d3ba8d2e75c | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations
from typing import Any, Mapping, Optional, Sequence
from pydantic import BaseModel, root_validator, validator
from datadog_checks.base.utils.functions import identity
... | 31.314286 | 110 | 0.725973 |
f2aef2cc62dc9fb283d78d436c9f7054552da463 | 18,843 | py | Python | demo_project/demo/utils.py | idearun/django-graphos | a096fb76a9759d958fdf6fbb88becab50a7c80f1 | [
"BSD-2-Clause"
] | 257 | 2015-01-01T13:59:06.000Z | 2022-03-19T12:44:32.000Z | demo_project/demo/utils.py | idearun/django-graphos | a096fb76a9759d958fdf6fbb88becab50a7c80f1 | [
"BSD-2-Clause"
] | 64 | 2015-01-13T10:11:24.000Z | 2022-01-08T15:26:26.000Z | demo_project/demo/utils.py | idearun/django-graphos | a096fb76a9759d958fdf6fbb88becab50a7c80f1 | [
"BSD-2-Clause"
] | 98 | 2015-01-13T17:38:05.000Z | 2022-01-20T11:07:18.000Z | from .models import Account
DB_HOST = ["localhost"]
DB_PORT = 27017
def get_db(db_name):
import pymongo
DB_HOST = ["localhost"]
DB_PORT = 27017
db = pymongo.Connection(DB_HOST, DB_PORT)[db_name]
return db
def get_mongo_cursor(db_name, collection_name, max_docs=100):
import pymongo
db =... | 27.073276 | 99 | 0.345433 |
57b52ba3fc6514eebfb144a68eb62b62ea05a0ef | 6,509 | py | Python | astoria/managers/astprocd/process_manager.py | srobo/astoria | 7bdefd91254b154aadf63b574c8b767d17a2e5d4 | [
"MIT"
] | 1 | 2021-02-03T02:54:54.000Z | 2021-02-03T02:54:54.000Z | astoria/managers/astprocd/process_manager.py | srobo/astoria | 7bdefd91254b154aadf63b574c8b767d17a2e5d4 | [
"MIT"
] | 72 | 2020-12-15T18:29:18.000Z | 2022-03-08T09:42:53.000Z | astoria/managers/astprocd/process_manager.py | srobo/astoria | 7bdefd91254b154aadf63b574c8b767d17a2e5d4 | [
"MIT"
] | 2 | 2022-02-05T23:00:51.000Z | 2022-03-09T21:40:49.000Z | """Process Manager Application."""
import asyncio
import logging
from typing import Dict, Optional
from astoria.common.broadcast_event import UsercodeLogBroadcastEvent
from astoria.common.manager import StateManager
from astoria.common.manager_requests import (
RequestResponse,
UsercodeKillManagerRequest,
... | 36.982955 | 89 | 0.608696 |
545be62f44ed6217e3e2a77b3b5c50bb6e7f5b94 | 2,015 | py | Python | migrations/versions/14b840151c2f_character_table.py | jimmybutton/moviedb | 61028ac4db7f58a671ab3a1c2afd3bfb53372773 | [
"MIT"
] | null | null | null | migrations/versions/14b840151c2f_character_table.py | jimmybutton/moviedb | 61028ac4db7f58a671ab3a1c2afd3bfb53372773 | [
"MIT"
] | null | null | null | migrations/versions/14b840151c2f_character_table.py | jimmybutton/moviedb | 61028ac4db7f58a671ab3a1c2afd3bfb53372773 | [
"MIT"
] | null | null | null | """character table
Revision ID: 14b840151c2f
Revises: 5f1654c61a38
Create Date: 2020-06-16 18:07:44.967078
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '14b840151c2f'
down_revision = '5f1654c61a38'
branch_labels = None
depends_on = None
def upgrade():
... | 39.509804 | 111 | 0.698759 |
0dc38fa59b31a2e9fbee37dec7b69be947dacf38 | 5,957 | py | Python | numpy/_pytesttester.py | bdvd/numpy | cea994fac86dbc5af7bee3f15fc5b475a99163fa | [
"BSD-3-Clause"
] | 1 | 2020-12-07T17:25:19.000Z | 2020-12-07T17:25:19.000Z | numpy/_pytesttester.py | sahanabalappa/numpy | cea994fac86dbc5af7bee3f15fc5b475a99163fa | [
"BSD-3-Clause"
] | 20 | 2020-02-14T11:37:52.000Z | 2020-02-18T21:18:45.000Z | numpy/_pytesttester.py | sahanabalappa/numpy | cea994fac86dbc5af7bee3f15fc5b475a99163fa | [
"BSD-3-Clause"
] | 1 | 2020-03-20T00:22:37.000Z | 2020-03-20T00:22:37.000Z | """
Pytest test running.
This module implements the ``test()`` function for NumPy modules. The usual
boiler plate for doing that is to put the following in the module
``__init__.py`` file::
from numpy._pytesttester import PytestTester
test = PytestTester(__name__).test
del PytestTester
Warnings filterin... | 30.706186 | 79 | 0.612221 |
0fc9bcb527d5fe44323aef0ac7bfc93b4daf6ca8 | 3,476 | py | Python | config/settings/base.py | TeamORIT/WhatsUpAddis-BE | 702d14eff969673ce88dbd6f4cad690cbb580c30 | [
"MIT"
] | null | null | null | config/settings/base.py | TeamORIT/WhatsUpAddis-BE | 702d14eff969673ce88dbd6f4cad690cbb580c30 | [
"MIT"
] | 3 | 2018-11-30T22:18:39.000Z | 2018-11-30T23:46:03.000Z | config/settings/base.py | TeamORIT/WhatsUpAddis-BE | 702d14eff969673ce88dbd6f4cad690cbb580c30 | [
"MIT"
] | null | null | null | """
Django settings for config project.
Generated by 'django-admin startproject' using Django 2.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
fro... | 24.652482 | 91 | 0.686709 |
f76988636febcc33fb36775812da45e5abffae6b | 214 | py | Python | benchmark/overhead.py | keithyipkw/InSync | 3744b45f31f713de2dfc8c30507e67db96915e07 | [
"MIT"
] | null | null | null | benchmark/overhead.py | keithyipkw/InSync | 3744b45f31f713de2dfc8c30507e67db96915e07 | [
"MIT"
] | null | null | null | benchmark/overhead.py | keithyipkw/InSync | 3744b45f31f713de2dfc8c30507e67db96915e07 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import pandas as pd
def main():
df = pd.read_csv(sys.argv[1], names=["Method", "Time"])
print(df.groupby("Method").describe().to_csv())
if __name__ == "__main__":
main() | 19.454545 | 59 | 0.64486 |
56c3f29d7d2fd08275474e893db5a4e895d61469 | 1,073 | py | Python | bin/sa_haveibeenpwned/aob_py3/future/moves/urllib/parse.py | hRun/SA-haveibeenpwned | 2a8ae3dedc405dc3c8dac1cb6a705a70f574afdb | [
"Apache-2.0"
] | 2 | 2020-08-17T07:52:48.000Z | 2020-12-18T16:39:32.000Z | bin/sa_haveibeenpwned/aob_py3/future/moves/urllib/parse.py | hRun/SA-haveibeenpwned | 2a8ae3dedc405dc3c8dac1cb6a705a70f574afdb | [
"Apache-2.0"
] | 5 | 2020-12-15T23:40:14.000Z | 2022-02-23T15:43:18.000Z | bin/sa_haveibeenpwned/aob_py3/future/moves/urllib/parse.py | hRun/SA-haveibeenpwned | 2a8ae3dedc405dc3c8dac1cb6a705a70f574afdb | [
"Apache-2.0"
] | 4 | 2019-05-16T09:57:33.000Z | 2021-07-14T12:31:21.000Z | from __future__ import absolute_import
from future.standard_library import suspend_hooks
from future.utils import PY3
if PY3:
from urllib.parse import *
else:
__future_module__ = True
from urlparse import (ParseResult, SplitResult, parse_qs, parse_qsl,
urldefrag, urljoi... | 37 | 79 | 0.591799 |
5080baf08d27bd22d35addc82db0281b4c3a17f2 | 7,879 | py | Python | napari/utils/misc.py | hectormz/napari | c53051ed3e3693ae74c86a5c4611f057293bd21d | [
"BSD-3-Clause"
] | null | null | null | napari/utils/misc.py | hectormz/napari | c53051ed3e3693ae74c86a5c4611f057293bd21d | [
"BSD-3-Clause"
] | null | null | null | napari/utils/misc.py | hectormz/napari | c53051ed3e3693ae74c86a5c4611f057293bd21d | [
"BSD-3-Clause"
] | null | null | null | """Miscellaneous utility functions.
"""
import collections.abc
import inspect
import itertools
import re
from enum import Enum, EnumMeta
from os import PathLike, fspath, path
from typing import Optional, Sequence, Type, TypeVar
import numpy as np
ROOT_DIR = path.dirname(path.dirname(__file__))
def str_to_rgb(arg):... | 26.618243 | 79 | 0.595634 |
278f542169ee3982e74f11451af4f09a61b7a2e2 | 1,302 | py | Python | examples/plot_implied_timescales.py | smsaladi/msmexplorer | 7880545c239c8f33ababdd111f58fd553b8bbdde | [
"MIT"
] | 6 | 2018-03-02T21:02:32.000Z | 2020-05-26T08:23:24.000Z | examples/plot_implied_timescales.py | smsaladi/msmexplorer | 7880545c239c8f33ababdd111f58fd553b8bbdde | [
"MIT"
] | 9 | 2018-03-02T21:19:26.000Z | 2021-07-26T13:54:30.000Z | examples/plot_implied_timescales.py | smsaladi/msmexplorer | 7880545c239c8f33ababdd111f58fd553b8bbdde | [
"MIT"
] | 5 | 2018-02-07T18:42:23.000Z | 2021-04-29T07:01:50.000Z | """
Implied Timescales Plot
===============
"""
from msmbuilder.example_datasets import FsPeptide
from msmbuilder.featurizer import DihedralFeaturizer
from msmbuilder.decomposition import tICA
from msmbuilder.cluster import MiniBatchKMeans
from msmbuilder.msm import MarkovStateModel
import numpy as np
import msmexplo... | 28.933333 | 67 | 0.736559 |
b88f412abd7df462d6b3c8b747a9272747cf0d18 | 1,304 | py | Python | geopandas/io/sql.py | dimitri-justeau/geopandas | 1731e44b2df88d08adfbc09260dda86d3d35e91d | [
"BSD-3-Clause"
] | 3 | 2015-03-03T21:08:39.000Z | 2015-12-14T23:22:47.000Z | geopandas/io/sql.py | dimitri-justeau/geopandas | 1731e44b2df88d08adfbc09260dda86d3d35e91d | [
"BSD-3-Clause"
] | 1 | 2021-06-02T00:37:10.000Z | 2021-06-02T00:37:10.000Z | geopandas/io/sql.py | dimitri-justeau/geopandas | 1731e44b2df88d08adfbc09260dda86d3d35e91d | [
"BSD-3-Clause"
] | 2 | 2021-01-02T02:25:31.000Z | 2021-01-10T16:41:32.000Z | import binascii
from pandas import read_sql
import shapely.wkb
from geopandas import GeoSeries, GeoDataFrame
def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None,
coerce_float=True, params=None):
"""
Returns a GeoDataFrame corresponding to the result of the query
string... | 27.744681 | 84 | 0.681748 |
445d18e9455c1203ec5db6e43b8ac9fd1f2dd4b7 | 4,595 | py | Python | GAN/coupled_gan/cogan_pytorch.py | eastonhou/generative-models | 02f19ff8f8980afea44ed0a8834bc5e1c4322b4d | [
"Unlicense"
] | 7,386 | 2016-12-15T06:54:40.000Z | 2022-03-31T16:21:47.000Z | GAN/coupled_gan/cogan_pytorch.py | milanhzj/generative-models | b930d5fa9e2f69adfd4ea8ec759f38f6ce6da4c2 | [
"Unlicense"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | GAN/coupled_gan/cogan_pytorch.py | milanhzj/generative-models | b930d5fa9e2f69adfd4ea8ec759f38f6ce6da4c2 | [
"Unlicense"
] | 2,247 | 2017-01-12T04:20:12.000Z | 2022-03-27T00:42:14.000Z | import torch
import torch.nn
import torch.nn.functional as nn
import torch.autograd as autograd
import torch.optim as optim
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
from torch.autograd import Variable
from tensorflow.examples.tutorials.mnist import input_data
i... | 22.52451 | 72 | 0.604788 |
9412d7df98fae6e7e783eee6e49ebc07dbbbcf4b | 6,752 | py | Python | mycroft/audio/speech.py | damorosodaragona/mycroft-core | 367542b5504c4ab3c9e5c46e3c8e3b150c01d3d0 | [
"Apache-2.0"
] | 2 | 2021-04-05T22:28:37.000Z | 2021-06-16T00:24:41.000Z | mycroft/audio/speech.py | damorosodaragona/mycroft-core | 367542b5504c4ab3c9e5c46e3c8e3b150c01d3d0 | [
"Apache-2.0"
] | 4 | 2021-06-08T22:45:08.000Z | 2022-03-12T00:51:26.000Z | mycroft/audio/speech.py | mjkaye/mycroft-core-deb | f3ae5327a4d45a7e2e1d5511850097472b755c53 | [
"Apache-2.0"
] | 2 | 2020-09-28T01:38:34.000Z | 2020-12-03T03:14:32.000Z | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 34.10101 | 79 | 0.631961 |
3ec693d78e4b5e0a1f18ad421790ac2ef6c8b94c | 3,682 | py | Python | example/utils.py | maresb/keras-transformer | e7374b43625dc6e8997a1882ad94c886377bee74 | [
"MIT"
] | null | null | null | example/utils.py | maresb/keras-transformer | e7374b43625dc6e8997a1882ad94c886377bee74 | [
"MIT"
] | null | null | null | example/utils.py | maresb/keras-transformer | e7374b43625dc6e8997a1882ad94c886377bee74 | [
"MIT"
] | null | null | null | import math
import warnings
import h5py
from keras import Model
def load_optimizer_weights(model: Model, model_save_path: str):
"""
Loads optimizer's weights for the model from an HDF5 file.
"""
with h5py.File(model_save_path, mode='r') as f:
if 'optimizer_weights' in f:
# Build t... | 35.747573 | 79 | 0.606735 |
a1b86159bccf26403c849c48e529828e7aef1a84 | 407 | py | Python | myInsta_project/asgi.py | inziani/myInsta | 3f564f8a0240fc02665b06b4032214046771d3ef | [
"Unlicense"
] | null | null | null | myInsta_project/asgi.py | inziani/myInsta | 3f564f8a0240fc02665b06b4032214046771d3ef | [
"Unlicense"
] | null | null | null | myInsta_project/asgi.py | inziani/myInsta | 3f564f8a0240fc02665b06b4032214046771d3ef | [
"Unlicense"
] | null | null | null | """
ASGI config for myInsta_project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJAN... | 23.941176 | 78 | 0.793612 |
ecc94a99f9d592417cb092b2ab4e0969a234edaa | 6,114 | py | Python | fabfile.py | Sibyx/dbs2019-project-assignment-nightgaunt | 6c65364ef04b413a734dd495fba85569e2648d73 | [
"Apache-2.0"
] | 1 | 2020-03-21T16:44:48.000Z | 2020-03-21T16:44:48.000Z | fabfile.py | Sibyx/dbs2019-project-assignment-nightgaunt | 6c65364ef04b413a734dd495fba85569e2648d73 | [
"Apache-2.0"
] | 9 | 2019-05-17T09:26:59.000Z | 2022-03-11T23:46:51.000Z | fabfile.py | Sibyx/mdns | 6c65364ef04b413a734dd495fba85569e2648d73 | [
"Apache-2.0"
] | null | null | null | import datetime
import json
import os
import warnings
from fabric import Connection, task
from invoke import Context
warnings.filterwarnings(action='ignore', module='.*paramiko.*')
PROJECT_NAME = "mdns"
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
REPO_URL = "https://github.com/Sibyx/mdns.git"
KEEP_RELEASES... | 30.878788 | 95 | 0.636572 |
5a9599d08a335223ff4a239fa9350dd7894a2917 | 41,614 | py | Python | pychron/graph/graph.py | WiscAr/pychron | 8d335d53ba7a5fc70760d9a7cb60540ad169ae84 | [
"Apache-2.0"
] | null | null | null | pychron/graph/graph.py | WiscAr/pychron | 8d335d53ba7a5fc70760d9a7cb60540ad169ae84 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/graph/graph.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... | 28.878557 | 106 | 0.507113 |
22960c92547dae1db378ae82742536316ed9fab4 | 2,837 | py | Python | pylearn2/sandbox/cuda_convnet/tests/test_stochastic_pool.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 3 | 2018-04-05T21:24:54.000Z | 2021-09-14T01:48:36.000Z | pylearn2/sandbox/cuda_convnet/tests/test_stochastic_pool.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | null | null | null | pylearn2/sandbox/cuda_convnet/tests/test_stochastic_pool.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 2 | 2018-02-18T14:46:57.000Z | 2019-05-03T11:51:45.000Z | import copy
import numpy
from theano.compat.six.moves import xrange
import theano
from theano.compat.python2x import Counter
from pylearn2.sandbox.cuda_convnet.stochastic_pool import (stochastic_max_pool_c01b,
weighted_max_pool_c01b)
from pylearn2.testing.ski... | 32.609195 | 84 | 0.606274 |
e8aeef3d4079afcf76860e114b402c6388ca3ea7 | 1,838 | py | Python | monai/deploy/utils/fileutil.py | jlvahldiek/monai-deploy-app-sdk | 050aeabec581067a11566f59a2970b075d36ae7c | [
"Apache-2.0"
] | 28 | 2021-09-17T18:16:42.000Z | 2022-03-31T16:32:36.000Z | monai/deploy/utils/fileutil.py | jlvahldiek/monai-deploy-app-sdk | 050aeabec581067a11566f59a2970b075d36ae7c | [
"Apache-2.0"
] | 109 | 2021-09-17T18:34:31.000Z | 2022-03-31T21:04:35.000Z | monai/deploy/utils/fileutil.py | jlvahldiek/monai-deploy-app-sdk | 050aeabec581067a11566f59a2970b075d36ae7c | [
"Apache-2.0"
] | 11 | 2021-09-17T20:23:31.000Z | 2022-03-29T08:55:19.000Z | # Copyright 2021 MONAI Consortium
# 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... | 31.689655 | 102 | 0.669206 |
81101f98a4398945ef106d7b3646bcf59e88573e | 9,810 | py | Python | src/sklearn_evaluation/training/selector.py | abcnishant007/sklearn-evaluation | 77ff2da43097b0451d8cf6f95c534409f612bf6a | [
"MIT"
] | 351 | 2016-01-27T19:15:27.000Z | 2022-03-09T15:40:56.000Z | src/sklearn_evaluation/training/selector.py | abcnishant007/sklearn-evaluation | 77ff2da43097b0451d8cf6f95c534409f612bf6a | [
"MIT"
] | 37 | 2016-03-16T03:57:59.000Z | 2021-06-26T14:02:33.000Z | src/sklearn_evaluation/training/selector.py | abcnishant007/sklearn-evaluation | 77ff2da43097b0451d8cf6f95c534409f612bf6a | [
"MIT"
] | 30 | 2016-01-27T19:27:08.000Z | 2022-03-31T06:09:59.000Z | """
When training models, it is common to try out different
subsets of features or subpopulations. ``DataSelector`` allows you to define
a series of transformations on your data so you can succinctly define a
subsetting pipeline as a series of dictionaries.
"""
from copy import copy, deepcopy
import abc
import inspect
... | 29.459459 | 79 | 0.601427 |
76a6db428459ea5739eacde9f14bdbe015b4b3bf | 1,779 | py | Python | test/unit/devices/test_default.py | mikiec84/ncclient | 7662666aac957fcf6aeb50c05f6b9816179cfd23 | [
"Apache-2.0"
] | 3 | 2015-11-03T17:11:42.000Z | 2016-12-09T14:47:44.000Z | test/unit/devices/test_default.py | mikiec84/ncclient | 7662666aac957fcf6aeb50c05f6b9816179cfd23 | [
"Apache-2.0"
] | null | null | null | test/unit/devices/test_default.py | mikiec84/ncclient | 7662666aac957fcf6aeb50c05f6b9816179cfd23 | [
"Apache-2.0"
] | null | null | null | import unittest
from ncclient.devices.default import DefaultDeviceHandler
capabilities = ['urn:ietf:params:netconf:base:1.0',
'urn:ietf:params:netconf:base:1.1',
'urn:ietf:params:netconf:capability:writable-running:1.0',
'urn:ietf:params:netconf:capability:candidate:1.0... | 41.372093 | 93 | 0.678471 |
74f3f72d9087f66a6b3e425e04bb69e0c815a9bb | 2,535 | py | Python | hear_me_django_app/accounts/api/views.py | kamil1marczak/hear_me_django_app | 2a567c15acddbf6bf183c6c637a3785c2a9c9c5c | [
"MIT"
] | null | null | null | hear_me_django_app/accounts/api/views.py | kamil1marczak/hear_me_django_app | 2a567c15acddbf6bf183c6c637a3785c2a9c9c5c | [
"MIT"
] | null | null | null | hear_me_django_app/accounts/api/views.py | kamil1marczak/hear_me_django_app | 2a567c15acddbf6bf183c6c637a3785c2a9c9c5c | [
"MIT"
] | null | null | null | from rest_framework.generics import ListAPIView
from hear_me_django_app.accounts.models import Account, Card, Transaction, AccountOwner, Company
from hear_me_django_app.accounts.api.serializers import AccountSerializer, TransactionSerializer, \
TransactionReadSerializer
from hear_me_django_app.accounts.api.filters... | 39.609375 | 114 | 0.774359 |
5afe4624ca380858eaf23d69d883bced8526a76f | 1,393 | py | Python | server.py | JuveriyaFarheen/video-record | 580869ffebd41dcf253c0a8c50862e2be0de91ad | [
"MIT"
] | null | null | null | server.py | JuveriyaFarheen/video-record | 580869ffebd41dcf253c0a8c50862e2be0de91ad | [
"MIT"
] | null | null | null | server.py | JuveriyaFarheen/video-record | 580869ffebd41dcf253c0a8c50862e2be0de91ad | [
"MIT"
] | null | null | null | from flask import Flask, render_template, Response, jsonify, request
from camera import VideoCamera
app = Flask(__name__)
video_camera = None
global_frame = None
@app.route('/')
def index():
return render_template('index.html')
@app.route('/record_status', methods=['POST'])
def record_status():
global video... | 25.796296 | 93 | 0.60804 |
50cf8881a23805180243ba4df2efdd115dee375f | 356 | py | Python | 0-run-with-images.py | GunarakulanGunaretnam/face-detection-in-python | 76cb91559a88cb32448ee3f6cca942dbef554089 | [
"Apache-2.0"
] | null | null | null | 0-run-with-images.py | GunarakulanGunaretnam/face-detection-in-python | 76cb91559a88cb32448ee3f6cca942dbef554089 | [
"Apache-2.0"
] | null | null | null | 0-run-with-images.py | GunarakulanGunaretnam/face-detection-in-python | 76cb91559a88cb32448ee3f6cca942dbef554089 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
faceModel = cv2.CascadeClassifier("haarcascade-frontalface-default.xml")
img = cv2.imread("image-3.jpg")
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
faces = faceModel.detectMultiScale(gray,1.3,5)
#rgb
#BGR
for(x,y,w,h) in faces:
cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)
cv2.... | 17.8 | 72 | 0.716292 |
c8b091025f0b178462f0a2081b0c70fc65ee6438 | 344 | py | Python | bilal/app/__init__.py | ibrahimediz/flaskrest | e0d52d35dc5b3aff8a7a15832c84e1c3882c4f36 | [
"MIT"
] | null | null | null | bilal/app/__init__.py | ibrahimediz/flaskrest | e0d52d35dc5b3aff8a7a15832c84e1c3882c4f36 | [
"MIT"
] | null | null | null | bilal/app/__init__.py | ibrahimediz/flaskrest | e0d52d35dc5b3aff8a7a15832c84e1c3882c4f36 | [
"MIT"
] | null | null | null | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app,db)
from app.api import bp as api_bp
app.register_blueprint(api_bp, url_prefix='/api')
from app... | 19.111111 | 49 | 0.799419 |
8000c447737e0a95f1850e04e56fa2c5394166d1 | 44 | py | Python | lennybot/__main__.py | Squaar/LennyBot | 184113535e1fbbf1a507ddda7a878f72db4114b8 | [
"MIT"
] | 1 | 2019-11-09T12:48:56.000Z | 2019-11-09T12:48:56.000Z | lennybot/__main__.py | Squaar/LennyBot | 184113535e1fbbf1a507ddda7a878f72db4114b8 | [
"MIT"
] | 5 | 2018-04-22T20:29:28.000Z | 2020-07-25T19:20:30.000Z | lennybot/__main__.py | Squaar/LennyBot | 184113535e1fbbf1a507ddda7a878f72db4114b8 | [
"MIT"
] | null | null | null | from . import lennyrunner
lennyrunner.main() | 22 | 25 | 0.818182 |
48f52fa34d45050ff8fdea499e886cace69ae691 | 463 | py | Python | astute-dashboard/astutedashboard/dashboards/billing/image_report/panel.py | sreenathmmenon/astttproject | 464fe20c8acf14afdfe03d1e4758e3df2b06196e | [
"Apache-2.0"
] | null | null | null | astute-dashboard/astutedashboard/dashboards/billing/image_report/panel.py | sreenathmmenon/astttproject | 464fe20c8acf14afdfe03d1e4758e3df2b06196e | [
"Apache-2.0"
] | null | null | null | astute-dashboard/astutedashboard/dashboards/billing/image_report/panel.py | sreenathmmenon/astttproject | 464fe20c8acf14afdfe03d1e4758e3df2b06196e | [
"Apache-2.0"
] | 1 | 2018-02-24T10:32:41.000Z | 2018-02-24T10:32:41.000Z | #
# Copyright 2017 NephoScale
#
from django.utils.translation import ugettext_lazy as _
import horizon
from astutedashboard.dashboards.billing import dashboard
class WindowsInstanceReport(horizon.Panel):
name = _("Windows/SQL Instance Report")
slug = "windows_instance_report"
#Only the following roles ... | 24.368421 | 66 | 0.784017 |
900875c1d95ba466bd3d3f4989af63cfad17917e | 964 | py | Python | models/universal_sentence_encoder_multilingual_large/v1/utils.py | rhangelxs/russian_embeddings | 64821cdff03ff97752b6c80621bedf9e2227a0ba | [
"MIT"
] | null | null | null | models/universal_sentence_encoder_multilingual_large/v1/utils.py | rhangelxs/russian_embeddings | 64821cdff03ff97752b6c80621bedf9e2227a0ba | [
"MIT"
] | 5 | 2020-09-26T00:18:44.000Z | 2022-02-10T00:22:42.000Z | models/universal_sentence_encoder_multilingual_large/v1/utils.py | rhangelxs/russian_embeddings | 64821cdff03ff97752b6c80621bedf9e2227a0ba | [
"MIT"
] | null | null | null | import numpy
import tensorflow as tf
import tensorflow_hub as hub
import tf_sentencepiece
class EmbeddingWrapper:
def __init__(self):
module_url = "https://tfhub.dev/google/universal-sentence-encoder-multilingual-large/1"
# Set up graph.
g = tf.Graph()
with g.as_default():
... | 32.133333 | 98 | 0.63278 |
f1bbb1bf5bba46022785f624cfacb33204de940d | 1,874 | py | Python | addons/l10n_ch/models/account_journal.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/l10n_ch/models/account_journal.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/l10n_ch/models/account_journal.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api
from odoo.exceptions import ValidationError
from odoo.addons.base_iban.models.res_partner_bank import validate_iban
from odoo.addons.base.models.res_bank import sanitize_account_num... | 36.745098 | 134 | 0.691569 |
82ec93fd6697b169d9054a8445289d161a88901c | 8,293 | py | Python | gpio/rpi_gpio.py | jamesgoodhouse/sensorReporter | 925868982cb0571f2d2204f0474d8f8d714f3087 | [
"Apache-2.0"
] | 99 | 2016-02-24T00:17:59.000Z | 2022-02-19T08:07:26.000Z | gpio/rpi_gpio.py | jamesgoodhouse/sensorReporter | 925868982cb0571f2d2204f0474d8f8d714f3087 | [
"Apache-2.0"
] | 68 | 2016-05-06T18:28:34.000Z | 2022-03-31T16:40:32.000Z | gpio/rpi_gpio.py | jamesgoodhouse/sensorReporter | 925868982cb0571f2d2204f0474d8f8d714f3087 | [
"Apache-2.0"
] | 43 | 2016-05-28T13:22:45.000Z | 2021-12-12T02:17:08.000Z | # Copyright 2020 Richard Koshak
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 41.054455 | 115 | 0.604365 |
e8fb7005a2d2a061e7ae0a8a1df9004504412ed2 | 4,325 | py | Python | python/detectionAlgorithm/offlineVideo/icub/main.py | NunoDuarte/openCVdevelop | 43204a903a3c96758332a86c7d6b10c285d6ed37 | [
"MIT"
] | null | null | null | python/detectionAlgorithm/offlineVideo/icub/main.py | NunoDuarte/openCVdevelop | 43204a903a3c96758332a86c7d6b10c285d6ed37 | [
"MIT"
] | null | null | null | python/detectionAlgorithm/offlineVideo/icub/main.py | NunoDuarte/openCVdevelop | 43204a903a3c96758332a86c7d6b10c285d6ed37 | [
"MIT"
] | null | null | null | # import files
from findNearest import findNearest
from balltracking import Ball
from faceDetector import FaceDetector
from gazeBehaviour import GazeBehaviour
# import necessary libraries
from collections import deque
import numpy as np
import cv2
import csv
import os
import argparse
import imutils
import logging as lo... | 33.789063 | 113 | 0.619422 |
36284889381f8cc328ad0ed9990cd406d1c3442b | 1,432 | py | Python | stix_shifter_modules/qradar/stix_transmission/results_connector.py | pyromaneact/stix-shifter | 431c6f66513cd0db8e338a4e2952a40666bc294b | [
"Apache-2.0"
] | 1 | 2021-10-05T19:26:04.000Z | 2021-10-05T19:26:04.000Z | stix_shifter_modules/qradar/stix_transmission/results_connector.py | pyromaneact/stix-shifter | 431c6f66513cd0db8e338a4e2952a40666bc294b | [
"Apache-2.0"
] | 1 | 2020-09-08T17:26:43.000Z | 2020-09-08T17:26:43.000Z | stix_shifter_modules/qradar/stix_transmission/results_connector.py | pyromaneact/stix-shifter | 431c6f66513cd0db8e338a4e2952a40666bc294b | [
"Apache-2.0"
] | 1 | 2020-11-25T13:24:25.000Z | 2020-11-25T13:24:25.000Z | from stix_shifter_utils.modules.base.stix_transmission.base_results_connector import BaseResultsConnector
from stix_shifter_utils.utils.error_response import ErrorResponder
from stix_shifter_utils.utils import logger
import json
class ResultsConnector(BaseResultsConnector):
def __init__(self, api_client):
... | 37.684211 | 106 | 0.685056 |
dc7797baeb9b58b5b5906c389616798747d5dd43 | 2,587 | py | Python | lib/connectivity_lib/webtest.py | seunomosowon/TA-connectivity | 40244c5fb2ba7f8f32fd250fb1abf85fbfcb9114 | [
"CC-BY-3.0"
] | 4 | 2016-06-19T11:49:50.000Z | 2019-10-28T09:18:42.000Z | lib/connectivity_lib/webtest.py | seunomosowon/TA-connectivity | 40244c5fb2ba7f8f32fd250fb1abf85fbfcb9114 | [
"CC-BY-3.0"
] | 8 | 2016-10-21T00:22:29.000Z | 2021-01-26T13:04:57.000Z | lib/connectivity_lib/webtest.py | seunomosowon/TA-connectivity | 40244c5fb2ba7f8f32fd250fb1abf85fbfcb9114 | [
"CC-BY-3.0"
] | 4 | 2016-06-19T11:49:52.000Z | 2019-11-14T10:10:49.000Z | """
This includes functions to be used for web connectivity tests to a given URL.
Functions here support the 'webping://' modular input
"""
from future.standard_library import install_aliases
install_aliases()
import re
from urllib.request import urlopen
from urllib.parse import urlparse
from http.client import HTTPEx... | 34.959459 | 115 | 0.649787 |
bcbfecc2340425dec4314675c221abe592f227d4 | 416 | py | Python | climatetalk/node_types/heat_pump.py | kdschlosser/ClimateTalk | 3b09a45c295cf5228283d7095834e8f133ed7de3 | [
"MIT"
] | 3 | 2021-04-30T20:12:16.000Z | 2022-03-09T11:53:12.000Z | climatetalk/node_types/heat_pump.py | kdschlosser/ClimateTalk | 3b09a45c295cf5228283d7095834e8f133ed7de3 | [
"MIT"
] | null | null | null | climatetalk/node_types/heat_pump.py | kdschlosser/ClimateTalk | 3b09a45c295cf5228283d7095834e8f133ed7de3 | [
"MIT"
] | 2 | 2021-04-08T18:29:39.000Z | 2021-04-30T20:13:55.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Kevin Schlosser
from . import NodeType, Node
from ..mdi import heat_pump, sensors
NODE_TYPE_HEAT_PUMP = NodeType(0x05).set_desc('Heat Pump')
class HeatPump(Node, heat_pump.HeatPumpMDI):
node_type = NODE_TYPE_HEAT_PUMP
@property
def outdoor_temperature(self):
... | 26 | 98 | 0.75 |
b7b3f9bfa55dc232277365cb410826e8324ace9f | 1,679 | py | Python | practice/practice_1.2/linked_list.py | Electro98/aads | 89607910856600b38349c31665f43fbb33df71c5 | [
"MIT"
] | 7 | 2021-07-24T05:37:07.000Z | 2022-03-15T05:17:25.000Z | practice/practice_1.2/linked_list.py | Electro98/aads | 89607910856600b38349c31665f43fbb33df71c5 | [
"MIT"
] | 2 | 2021-08-05T14:09:46.000Z | 2021-08-21T14:12:03.000Z | practice/practice_1.2/linked_list.py | Electro98/aads | 89607910856600b38349c31665f43fbb33df71c5 | [
"MIT"
] | 8 | 2021-08-20T17:17:02.000Z | 2022-03-15T05:17:27.000Z | """Модуль "заглушка" для тестов"""
class LinkedListItem:
"""Узел связного списка"""
def __init__(self, data=None):
raise NotImplementedError()
@property
def next_item(self):
"""Следующий элемент"""
raise NotImplementedError()
@next_item.setter
def next_item(self, valu... | 22.386667 | 40 | 0.627159 |
59f759770b4107eae796f4c5bd72a5a4e517dcd0 | 22,644 | py | Python | knowledge_repo/app/models.py | dmaljovec/knowledge-repo | 09e1e9e63fa86817db00341bb589a27bd35c5199 | [
"Apache-2.0"
] | null | null | null | knowledge_repo/app/models.py | dmaljovec/knowledge-repo | 09e1e9e63fa86817db00341bb589a27bd35c5199 | [
"Apache-2.0"
] | 1 | 2020-10-26T22:38:18.000Z | 2020-10-26T22:38:18.000Z | knowledge_repo/app/models.py | recursionpharma/knowledge-repo-package | 09e1e9e63fa86817db00341bb589a27bd35c5199 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import datetime
import logging
import traceback
from flask import current_app, request
from flask_login import UserMixin
from flask_sqlalchemy import SQLAlchemy
from collections import defaultdict
from sqlalchemy import func, distinct, and_, select, Index, UniqueConstraint
from knowledge_repo._ve... | 34.257186 | 339 | 0.615527 |
1f607c43cf8c38fb9a212cd579cb479db8ef6421 | 1,507 | py | Python | Yuanjunling1/Hello word/TestFlask.py | yuanjunling/PycharmProjects | 087b1a30818bbe2bf3972c9340f61ca4b792eb7d | [
"bzip2-1.0.6"
] | null | null | null | Yuanjunling1/Hello word/TestFlask.py | yuanjunling/PycharmProjects | 087b1a30818bbe2bf3972c9340f61ca4b792eb7d | [
"bzip2-1.0.6"
] | null | null | null | Yuanjunling1/Hello word/TestFlask.py | yuanjunling/PycharmProjects | 087b1a30818bbe2bf3972c9340f61ca4b792eb7d | [
"bzip2-1.0.6"
] | null | null | null | # -*- coding:utf-8 -*-
import time
import calendar
list1 = ['python','java','php','C++','C#']
list2 = ['jjj','ppp','lll','ddd']
print "list1[1]:",list1[1]
print list1+list2
list2.append('append')
print list2
del list2[3]
print list2*4
print len(list2)
list2.reverse()
print list2
tikce = time.strftime("%Y-%m-%d %H:%M:%S... | 18.8375 | 60 | 0.64499 |
6d18ffe529cad2b614b18b91cb34896d29ec85d8 | 99,921 | py | Python | tests/core.py | antoncohen/incubator-airflow | 71954a52fc13accf1130d3d2a00263d7ec369b02 | [
"Apache-2.0"
] | null | null | null | tests/core.py | antoncohen/incubator-airflow | 71954a52fc13accf1130d3d2a00263d7ec369b02 | [
"Apache-2.0"
] | null | null | null | tests/core.py | antoncohen/incubator-airflow | 71954a52fc13accf1130d3d2a00263d7ec369b02 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 39.82503 | 109 | 0.612984 |
3aeb69028b43018bd7c0c9a352e77898be418539 | 16,154 | py | Python | comb/tf_model_v1.py | kastnerkyle/tf_and_torch_speechmatch | e9bfa11c741c6955ff8cafcc2afd730cd69f7ab8 | [
"BSD-3-Clause"
] | 1 | 2019-07-31T00:47:46.000Z | 2019-07-31T00:47:46.000Z | comb/tf_model_v1.py | kastnerkyle/tf_and_torch_speechmatch | e9bfa11c741c6955ff8cafcc2afd730cd69f7ab8 | [
"BSD-3-Clause"
] | null | null | null | comb/tf_model_v1.py | kastnerkyle/tf_and_torch_speechmatch | e9bfa11c741c6955ff8cafcc2afd730cd69f7ab8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import os
import argparse
import numpy as np
import tensorflow as tf
from collections import namedtuple
import logging
import shutil
from tfbldr.datasets import rsync_fetch, fetch_ljspeech
from tfbldr.datasets import wavfile_caching_mel_tbptt_iterator
from tfbldr.utils import next... | 36.965675 | 185 | 0.558314 |
7c5e33d7d151941010f4798ebd32fc89793b3af0 | 51 | py | Python | pywos/__init__.py | refraction-ray/wos-statistics | bb3a23bdcdb588046df1e852d0b2625071d15634 | [
"MIT"
] | 8 | 2019-04-08T09:20:01.000Z | 2021-09-09T12:38:18.000Z | pywos/__init__.py | refraction-ray/wos-statistics | bb3a23bdcdb588046df1e852d0b2625071d15634 | [
"MIT"
] | null | null | null | pywos/__init__.py | refraction-ray/wos-statistics | bb3a23bdcdb588046df1e852d0b2625071d15634 | [
"MIT"
] | 3 | 2019-09-20T01:23:57.000Z | 2021-09-09T12:38:19.000Z | __author__ = "refraction-ray"
__version__ = "0.0.1" | 25.5 | 29 | 0.72549 |
5abe2e15772ec6a27f606fbfd3789f2ecebfe7a3 | 269 | py | Python | language-based/cpp/cpp-rf24-test/transposer/RF24/RPi/pyRF24/setup.py | fjctp/random_code | 5cbf73fc34b8f51a093ed47e0db676cadc5cb03a | [
"MIT"
] | 5 | 2017-07-17T21:56:33.000Z | 2021-01-17T17:31:10.000Z | language-based/cpp/cpp-rf24-test/transposer/RF24/RPi/pyRF24/setup.py | fjctp/random_code | 5cbf73fc34b8f51a093ed47e0db676cadc5cb03a | [
"MIT"
] | null | null | null | language-based/cpp/cpp-rf24-test/transposer/RF24/RPi/pyRF24/setup.py | fjctp/random_code | 5cbf73fc34b8f51a093ed47e0db676cadc5cb03a | [
"MIT"
] | 1 | 2017-07-18T20:11:50.000Z | 2017-07-18T20:11:50.000Z | #!/usr/bin/env python
from distutils.core import setup, Extension
module_RF24 = Extension('RF24',
libraries = ['rf24-bcm', 'boost_python'],
sources = ['pyRF24.cpp'])
setup(name='RF24',
version='1.0',
ext_modules=[module_RF24]
)
| 20.692308 | 53 | 0.609665 |
6924ae8775a1c0635ba576ffcec4f0c0d5d420eb | 24,322 | py | Python | mangadex_openapi/models/order1.py | ongyx/mangadex_openapi | 56a244cf90d884b2589ab2466b44442409a296d7 | [
"MIT"
] | null | null | null | mangadex_openapi/models/order1.py | ongyx/mangadex_openapi | 56a244cf90d884b2589ab2466b44442409a296d7 | [
"MIT"
] | null | null | null | mangadex_openapi/models/order1.py | ongyx/mangadex_openapi | 56a244cf90d884b2589ab2466b44442409a296d7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
MangaDex API
MangaDex is an ad-free manga reader offering high-quality images! This document details our API as it is right now. It is in no way a promise to never change it, although we will endeavour to publicly notify any major change. # Authentication You can login with the `/auth/l... | 93.187739 | 17,143 | 0.527259 |
8f5da364a5fd29ef7de20891e0e64a3ca3624985 | 3,863 | py | Python | quorumtoolbox/raft.py | chainstack/quorum-toolbox | e9d25b1118891d27b27bb6f3c8907a805183f873 | [
"Apache-2.0"
] | 1 | 2021-06-24T18:03:40.000Z | 2021-06-24T18:03:40.000Z | quorumtoolbox/raft.py | chainstack/quorum-toolbox | e9d25b1118891d27b27bb6f3c8907a805183f873 | [
"Apache-2.0"
] | 5 | 2019-12-10T03:28:14.000Z | 2020-05-28T15:49:59.000Z | quorumtoolbox/raft.py | chainstack/quorum-toolbox | e9d25b1118891d27b27bb6f3c8907a805183f873 | [
"Apache-2.0"
] | null | null | null | import json
import os
from quorumtoolbox.utils import templating
from quorumtoolbox.utils.enode_utils import make_enode_id2
from quorumtoolbox.utils.node_utils import make_node_param
class Raft:
raft_dir_name = 'raft'
raft_id_file_name = 'raftid.json'
def __init__(self,
context,
... | 31.92562 | 120 | 0.613513 |
0971a1a0947763425a7ae66b9ca836cdb8e3e95c | 7,563 | py | Python | script/old/compare_vcf-0.0.1.py | genepii/seqmet | 89fdab79131c861d4a5aae364ecdbeb3a9e0ae23 | [
"MIT"
] | null | null | null | script/old/compare_vcf-0.0.1.py | genepii/seqmet | 89fdab79131c861d4a5aae364ecdbeb3a9e0ae23 | [
"MIT"
] | null | null | null | script/old/compare_vcf-0.0.1.py | genepii/seqmet | 89fdab79131c861d4a5aae364ecdbeb3a9e0ae23 | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import sys
import getopt
##Count the number of minor variants in a target vcf reported as major variant in a reference vcf
#v0.0.1
def main(argv):
global ref
global var
global con
global oup
global oud
global mode
global bed
... | 38.005025 | 224 | 0.492662 |
32c9df6086648fadb4c805373b98205b72ccf085 | 263 | py | Python | applications/MeshMovingApplication/tests/run_cpp_unit_tests.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/MeshMovingApplication/tests/run_cpp_unit_tests.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/MeshMovingApplication/tests/run_cpp_unit_tests.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z | from KratosMultiphysics import *
from KratosMultiphysics.MeshMovingApplication import *
def run():
Tester.SetVerbosity(Tester.Verbosity.PROGRESS) # TESTS_OUTPUTS
Tester.RunTestSuite("MeshMovingApplicationFastSuite")
if __name__ == '__main__':
run()
| 26.3 | 66 | 0.78327 |
e11b0a9986536f0a40f34d3edd5b249b71b48c00 | 742 | py | Python | {{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/routers/default.py | triaxtec/fastapi-serverless-cookiecutter | fe5ca7ebb0fbe47ee55adbe93431b02862e62544 | [
"MIT"
] | 15 | 2020-05-09T16:34:29.000Z | 2021-06-05T14:26:34.000Z | example/example/routers/default.py | triaxtec/fastapi-serverless-cookiecutter | fe5ca7ebb0fbe47ee55adbe93431b02862e62544 | [
"MIT"
] | null | null | null | example/example/routers/default.py | triaxtec/fastapi-serverless-cookiecutter | fe5ca7ebb0fbe47ee55adbe93431b02862e62544 | [
"MIT"
] | 1 | 2020-08-13T18:40:55.000Z | 2020-08-13T18:40:55.000Z | from functools import lru_cache
from pathlib import Path
from fastapi import APIRouter, Depends, FastAPI
from markdown import markdown
from starlette.responses import HTMLResponse
router = APIRouter()
def register_router(app: FastAPI) -> None:
""" Register this router against the application """
app.include... | 27.481481 | 72 | 0.762803 |
992ae8fc9f3ab9f4a8c386747556ffa62ed5e7d1 | 17,748 | py | Python | abs_templates_ec/routing/fill.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 1 | 2020-06-02T22:41:46.000Z | 2020-06-02T22:41:46.000Z | abs_templates_ec/routing/fill.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 12 | 2018-10-23T18:08:37.000Z | 2022-02-24T10:51:34.000Z | abs_templates_ec/routing/fill.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 18 | 2018-07-14T01:36:09.000Z | 2021-05-25T18:38:00.000Z | # -*- coding: utf-8 -*-
"""This module defines dummy/power fill related templates."""
from typing import TYPE_CHECKING, Dict, Set, Any, Tuple, List
import numpy as np
from bag.util.search import BinaryIterator
from bag.layout.util import BBox
from bag.layout.template import TemplateBase
from ..analog_core.base imp... | 37.842217 | 94 | 0.557809 |
d17eb7e052c5058835c8b47a0dee17e359633385 | 2,396 | py | Python | gae/tests/FIXTURES.py | benletchford/stratego.io | 040d8d0775594f531d588700128e86f744be2dff | [
"MIT"
] | 29 | 2015-12-03T04:11:05.000Z | 2022-01-21T15:34:37.000Z | gae/tests/FIXTURES.py | benletchford/stratego.io | 040d8d0775594f531d588700128e86f744be2dff | [
"MIT"
] | 10 | 2020-04-12T16:01:40.000Z | 2022-02-26T07:56:55.000Z | gae/tests/FIXTURES.py | benletchford/stratego.io | 040d8d0775594f531d588700128e86f744be2dff | [
"MIT"
] | 9 | 2016-03-13T11:54:02.000Z | 2021-11-28T04:28:51.000Z | import json
import copy
SETUP = [
[
{'rank': '1', 'side': 3},
{'rank': '2', 'side': 3},
{'rank': '3', 'side': 3},
{'rank': '3', 'side': 3},
{'rank': '4', 'side': 3},
{'rank': '4', 'side': 3},
{'rank': '4', 'side': 3},
{'rank': '5', 'side': 3},
... | 18.015038 | 39 | 0.34975 |
45051d34467ef1e78cf83176b967ab4504b0a086 | 627 | py | Python | backend/manage.py | ecto0310/groupware | e1c9f76b19e6d1f6782f8e2b287ff75d1351fa83 | [
"MIT"
] | 3 | 2020-03-23T19:18:00.000Z | 2021-04-12T04:01:17.000Z | backend/manage.py | ecto0310/groupware | e1c9f76b19e6d1f6782f8e2b287ff75d1351fa83 | [
"MIT"
] | 95 | 2020-03-07T12:29:38.000Z | 2022-02-17T22:44:07.000Z | backend/manage.py | ecto0310/groupware | e1c9f76b19e6d1f6782f8e2b287ff75d1351fa83 | [
"MIT"
] | 2 | 2021-12-27T16:50:36.000Z | 2021-12-27T16:53:12.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'digigru.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | 28.5 | 73 | 0.682616 |
8a86e9dedef1815cfb6f54f846da9292da04752e | 333 | py | Python | ics_demo/main.py | lielongxingkong/ics-demo | 21a08945f3983eb409916a7380549f74e3ba5171 | [
"MIT"
] | null | null | null | ics_demo/main.py | lielongxingkong/ics-demo | 21a08945f3983eb409916a7380549f74e3ba5171 | [
"MIT"
] | null | null | null | ics_demo/main.py | lielongxingkong/ics-demo | 21a08945f3983eb409916a7380549f74e3ba5171 | [
"MIT"
] | null | null | null | import tornado.ioloop
import tornado.web
from ics_demo.dao import init_db
from ics_demo.remote_services import init_proxy
from ics_demo.routes import urls
application = tornado.web.Application(urls)
if __name__ == "__main__":
init_db()
init_proxy()
application.listen(8888)
tornado.ioloop.IOLoop.instan... | 23.785714 | 47 | 0.774775 |
99b2a7994bb66178b4ae8e195e8a71e4ee9137c0 | 7,111 | py | Python | Lab/4/Dynamics/lagrangian_dynamics_example.py | rparak/Programming-for-robots-and-manipulators-VRM | 40157b39de410a3daa8a59bdce11d865d14f321c | [
"MIT"
] | 1 | 2021-04-09T20:38:52.000Z | 2021-04-09T20:38:52.000Z | Lab/4/Dynamics/lagrangian_dynamics_example.py | rparak/Programming-for-robots-and-manipulators-VRM | 40157b39de410a3daa8a59bdce11d865d14f321c | [
"MIT"
] | null | null | null | Lab/4/Dynamics/lagrangian_dynamics_example.py | rparak/Programming-for-robots-and-manipulators-VRM | 40157b39de410a3daa8a59bdce11d865d14f321c | [
"MIT"
] | 5 | 2021-04-30T17:56:01.000Z | 2022-03-30T10:09:00.000Z | """
## =========================================================================== ##
MIT License
Copyright (c) 2020 Roman Parak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction... | 43.895062 | 249 | 0.577697 |
0cb6495e0f846d64a917c60cd170b9e1e48764af | 868 | py | Python | python/soma_workflow/clean_server.py | denisri/soma-workflow | bc6f2f50d34437e86e850cb0d05ff26b041d560d | [
"CECILL-B"
] | null | null | null | python/soma_workflow/clean_server.py | denisri/soma-workflow | bc6f2f50d34437e86e850cb0d05ff26b041d560d | [
"CECILL-B"
] | null | null | null | python/soma_workflow/clean_server.py | denisri/soma-workflow | bc6f2f50d34437e86e850cb0d05ff26b041d560d | [
"CECILL-B"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
'''
@author: Jinpeng LI
@contact: mr.li.jinpeng@gmail.com
@organization: I2BM, Neurospin, Gif-sur-Yvette, France
@organization: CATI, France
@organization: U{IFR 49<http://www.ifr49.org>}
@license: U{CeCILL version 2<http://www.ce... | 20.186047 | 88 | 0.644009 |
6a2b82ca881c58611fff3bca5df1fee1f5c86a2f | 418 | py | Python | configs/mobilenet_v2/pspnet_m-v2-d8_512x1024_80k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/mobilenet_v2/pspnet_m-v2-d8_512x1024_80k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/mobilenet_v2/pspnet_m-v2-d8_512x1024_80k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | _base_ = '../pspnet/pspnet_r101-d8_512x1024_80k_cityscapes.py'
model = dict(
pretrained='mmcls://mobilenet_v2',
backbone=dict(
_delete_=True,
type='MobileNetV2',
widen_factor=1.,
strides=(1, 2, 2, 1, 1, 1, 1),
dilations=(1, 1, 1, 2, 2, 4, 4),
out_indices=... | 32.153846 | 63 | 0.583732 |
8a8d0ed340effd4b711673ee77a305bf0989fdc6 | 1,186 | py | Python | simple_linear_regression/utils.py | awesome-archive/Machine-Learning-with-Python | 898ebbf2d7c780cb5a89bad51d0b7e043e25879f | [
"MIT"
] | 942 | 2019-01-19T18:56:49.000Z | 2022-03-31T19:09:56.000Z | simple_linear_regression/utils.py | skylaronomics/Machine-Learning-with-Python | 186a6f38f6719e5610e0143aecdf170c842ff107 | [
"MIT"
] | 4 | 2019-01-22T15:17:47.000Z | 2019-08-25T14:02:44.000Z | simple_linear_regression/utils.py | skylaronomics/Machine-Learning-with-Python | 186a6f38f6719e5610e0143aecdf170c842ff107 | [
"MIT"
] | 176 | 2019-01-21T10:19:52.000Z | 2022-03-02T20:10:27.000Z | from helpers.stats import correlation, standard_deviation, mean, de_mean
def predict(alpha, beta, x_i):
return beta * x_i + alpha
def error(alpha, beta, x_i, y_i):
return y_i - predict(alpha, beta, x_i)
def sum_of_squared_errors(alpha, beta, x, y):
return sum(error(alpha, beta, x_i, y_i) ** 2
... | 26.355556 | 82 | 0.653457 |
b6f3a07f10a9cf08ac0889af13af388ba2842c7d | 9,533 | py | Python | var/spack/repos/builtin/packages/py-dask/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-08-13T15:24:33.000Z | 2021-10-18T18:38:19.000Z | var/spack/repos/builtin/packages/py-dask/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-02-26T11:44:34.000Z | 2022-03-12T12:14:50.000Z | var/spack/repos/builtin/packages/py-dask/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-15T02:37:59.000Z | 2020-09-21T04:34:38.000Z | # Copyright 2013-2020 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 spack import *
class PyDask(PythonPackage):
"""Dask is a flexible parallel computing library for analytics."""
... | 56.744048 | 111 | 0.584916 |
0e64d8059adcdcc5e280a38434e13289a75819ad | 87 | py | Python | haas/tests/compat.py | itziakos/haas | 93a2e886f66d7fb40f39305032cad6614fcc52a1 | [
"BSD-3-Clause"
] | 4 | 2017-10-10T06:45:35.000Z | 2021-02-27T09:44:16.000Z | haas/tests/compat.py | itziakos/haas | 93a2e886f66d7fb40f39305032cad6614fcc52a1 | [
"BSD-3-Clause"
] | 34 | 2015-02-24T17:04:15.000Z | 2017-01-05T12:35:14.000Z | haas/tests/compat.py | itziakos/haas | 93a2e886f66d7fb40f39305032cad6614fcc52a1 | [
"BSD-3-Clause"
] | 4 | 2018-03-05T19:05:19.000Z | 2019-12-11T08:42:22.000Z | try:
from unittest import mock # noqa
except ImportError:
import mock # noqa
| 17.4 | 37 | 0.689655 |
15730b993c708ebe347397c0edc36e778cad4dbb | 1,663 | py | Python | Tests/test_EMBL_unittest.py | amblina/biopython | 5045a7a3e86d5b32e0eaab941ab35daac86c59f8 | [
"PostgreSQL"
] | 3 | 2021-08-17T15:28:41.000Z | 2022-02-12T06:43:22.000Z | Tests/test_EMBL_unittest.py | amblina/biopython | 5045a7a3e86d5b32e0eaab941ab35daac86c59f8 | [
"PostgreSQL"
] | 32 | 2016-11-21T07:38:21.000Z | 2017-08-16T13:00:03.000Z | Tests/test_EMBL_unittest.py | amblina/biopython | 5045a7a3e86d5b32e0eaab941ab35daac86c59f8 | [
"PostgreSQL"
] | 8 | 2016-11-24T18:57:35.000Z | 2022-01-16T08:15:25.000Z | # Copyright 2015 by Kai Blin.
# 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.
import unittest
import warnings
from os import path
from Bio import SeqIO
class EMBLTests(unittest.TestCase):
def ... | 38.674419 | 116 | 0.677691 |
1c1b841469504e5cc7702e81177d0526d85bac19 | 3,629 | py | Python | .history/Missions_to_Mars/scrape_mars_20200812112856.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | .history/Missions_to_Mars/scrape_mars_20200812112856.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | .history/Missions_to_Mars/scrape_mars_20200812112856.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | 2 | 2020-11-02T08:12:16.000Z | 2021-05-17T21:45:42.000Z | from splinter import Browser
from bs4 import BeautifulSoup as bs
import pandas as pd
import time
import re
# This is for debugging
def savetofile(contents):
file = open('_temporary.txt',"w",encoding="utf-8")
file.write(contents)
file.close()
def scrape():
executable_path = {"executable_path": "chrom... | 28.131783 | 155 | 0.63213 |
1d6017390c3c32c6b03e85d4ce8f8875cf229c0e | 3,708 | py | Python | pilot/control/payloads/eventservice.py | yesw2000/pilot2 | 96228c886e36913c141c4e95722dabb4b6733932 | [
"Apache-2.0"
] | null | null | null | pilot/control/payloads/eventservice.py | yesw2000/pilot2 | 96228c886e36913c141c4e95722dabb4b6733932 | [
"Apache-2.0"
] | null | null | null | pilot/control/payloads/eventservice.py | yesw2000/pilot2 | 96228c886e36913c141c4e95722dabb4b6733932 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# 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
#
# Authors:
# - Wen Guan, wen.guan@cern.ch, 2017-2018
# - Paul Nilsson, paul.... | 31.423729 | 123 | 0.607335 |
4e48b56268cd5de32e8a29e856002b3c0e6d3482 | 9,509 | py | Python | src/SGAN.py | PranavEranki/Semi-Supervised-GANs | 705c59a07bd1aeefeec86dfa85f9fcee78e5c78f | [
"MIT"
] | 1 | 2021-01-18T14:40:35.000Z | 2021-01-18T14:40:35.000Z | src/SGAN.py | PranavEranki/Semi-Supervised-GANs | 705c59a07bd1aeefeec86dfa85f9fcee78e5c78f | [
"MIT"
] | null | null | null | src/SGAN.py | PranavEranki/Semi-Supervised-GANs | 705c59a07bd1aeefeec86dfa85f9fcee78e5c78f | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[25]:
import argparse
import os
import numpy as np
import math
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.fu... | 28.133136 | 123 | 0.612157 |
780b04fad752e44bfbf8f8470f4b674f1838cb0a | 1,195 | py | Python | multiprocessing_queue.py | Bartoshko/python_playground | a9a609e6b90303b0b15af52f48c500573627a822 | [
"MIT"
] | null | null | null | multiprocessing_queue.py | Bartoshko/python_playground | a9a609e6b90303b0b15af52f48c500573627a822 | [
"MIT"
] | null | null | null | multiprocessing_queue.py | Bartoshko/python_playground | a9a609e6b90303b0b15af52f48c500573627a822 | [
"MIT"
] | null | null | null | from multiprocessing import Process, Queue
import time
def reader_proc(queue):
print('starting new read')
## Read from the queue; this will be spawned as a separate Process
while True:
msg = queue.get()
# Read from the queue and do nothing
if (msg == 'DONE'):
break
de... | 33.194444 | 77 | 0.615063 |
c55d39c751718cdb4e63aa3da65bf7a16d16bbdf | 1,751 | py | Python | pomp/example_problems/doubleintegrator.py | Aand1/pyOptimalMotionPlanning | 5f06b4331149b86538e1ecfa7ccb9915c8cb510a | [
"Apache-2.0"
] | null | null | null | pomp/example_problems/doubleintegrator.py | Aand1/pyOptimalMotionPlanning | 5f06b4331149b86538e1ecfa7ccb9915c8cb510a | [
"Apache-2.0"
] | null | null | null | pomp/example_problems/doubleintegrator.py | Aand1/pyOptimalMotionPlanning | 5f06b4331149b86538e1ecfa7ccb9915c8cb510a | [
"Apache-2.0"
] | 1 | 2021-07-07T16:15:52.000Z | 2021-07-07T16:15:52.000Z | from OpenGL.GL import *
from geometric import *
from ..spaces.objective import *
from ..spaces.statespace import *
from ..spaces.configurationspace import *
from ..spaces.edgechecker import *
from ..spaces.metric import *
from ..planners.problem import PlanningProblem
class DoubleIntegratorVisualizer:
de... | 30.189655 | 74 | 0.606511 |
8bb18bb68c796b4377cc238b3450fd493b581ee4 | 2,324 | py | Python | src/checks.py | DiscordLiz/salamander | 87e8dbddacd4d55672491685007237493295cf5a | [
"Apache-2.0"
] | null | null | null | src/checks.py | DiscordLiz/salamander | 87e8dbddacd4d55672491685007237493295cf5a | [
"Apache-2.0"
] | 1 | 2021-03-23T05:13:57.000Z | 2021-03-23T05:41:41.000Z | src/checks.py | DiscordLiz/salamander | 87e8dbddacd4d55672491685007237493295cf5a | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-present Michael Hall
#
# 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... | 27.666667 | 87 | 0.673838 |
b2277b4f72a74777c9f4a1b8015389e459391965 | 2,082 | py | Python | CTFd/forms/self.py | DevLuce/CTFd-Korean | 3e45d640c7cab9fd4d4d869e443334ae4fe97e22 | [
"Apache-2.0"
] | null | null | null | CTFd/forms/self.py | DevLuce/CTFd-Korean | 3e45d640c7cab9fd4d4d869e443334ae4fe97e22 | [
"Apache-2.0"
] | null | null | null | CTFd/forms/self.py | DevLuce/CTFd-Korean | 3e45d640c7cab9fd4d4d869e443334ae4fe97e22 | [
"Apache-2.0"
] | null | null | null | from flask import session
from wtforms import PasswordField, SelectField, StringField
from wtforms.fields.html5 import DateField, URLField
from CTFd.forms import BaseForm
from CTFd.forms.fields import SubmitField
from CTFd.forms.users import attach_custom_user_fields, build_custom_user_fields
from CTFd.utils.countries... | 35.288136 | 80 | 0.654659 |
f5661af2f7898698ec56ca1aceb2df3a18f18de2 | 14,510 | py | Python | lib/rucio/api/replica.py | arisfkiaras/rucio | 275793a04aa85f25bf84705a893ef18679bd305a | [
"Apache-2.0"
] | null | null | null | lib/rucio/api/replica.py | arisfkiaras/rucio | 275793a04aa85f25bf84705a893ef18679bd305a | [
"Apache-2.0"
] | null | null | null | lib/rucio/api/replica.py | arisfkiaras/rucio | 275793a04aa85f25bf84705a893ef18679bd305a | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... | 38.08399 | 159 | 0.68856 |
67be05e673335e54502248514101b477feb7a01b | 2,344 | py | Python | care/facility/api/viewsets/facility_capacity.py | MaharashtraStateInnovationSociety/care | 6e7794d2ecb08fa17f2fcea6a4bb0c829f8e48a2 | [
"MIT"
] | 1 | 2021-07-03T14:07:50.000Z | 2021-07-03T14:07:50.000Z | care/facility/api/viewsets/facility_capacity.py | albernsrya/care | d7c971371dd557953d8e35e23f9c4c36aa05facb | [
"MIT"
] | null | null | null | care/facility/api/viewsets/facility_capacity.py | albernsrya/care | d7c971371dd557953d8e35e23f9c4c36aa05facb | [
"MIT"
] | null | null | null | from dry_rest_permissions.generics import DRYPermissions
from rest_framework.decorators import action
from rest_framework.generics import get_object_or_404
from rest_framework.mixins import ListModelMixin
from rest_framework.permissions import IsAuthenticated
from care.facility.api.serializers.facility_capacity import... | 41.122807 | 102 | 0.74744 |
00979c408a0c2ef2f26556bad3f92bd55cf409df | 1,548 | py | Python | 095-solano/results/parse_solano_pres.py | worace/california-2016-election-precinct-maps | 39e9a6e797aca1b5b5f5129294807dfadb5a795d | [
"MIT"
] | 82 | 2016-12-30T02:07:31.000Z | 2022-02-26T00:39:38.000Z | 095-solano/results/parse_solano_pres.py | worace/california-2016-election-precinct-maps | 39e9a6e797aca1b5b5f5129294807dfadb5a795d | [
"MIT"
] | 3 | 2017-01-16T19:12:31.000Z | 2017-04-03T03:07:29.000Z | 095-solano/results/parse_solano_pres.py | worace/california-2016-election-precinct-maps | 39e9a6e797aca1b5b5f5129294807dfadb5a795d | [
"MIT"
] | 29 | 2017-01-02T08:45:30.000Z | 2021-11-17T15:19:31.000Z | import sys
import os
import re
import csv
filepath = sys.argv[1]
if not os.path.exists('results/'):
os.makedirs('results/')
f = open(filepath,'r')
precincts = f.read().split('\n\n')
headers = ['pct16','pres_clinton','pres_trump','pres_johnson','pres_stein','pres_lariva','pres_other']
output = open('results/%s.cs... | 26.689655 | 102 | 0.644703 |
0d138a1cf2a97e16b74b964687af6b0f24e4faa1 | 6,018 | py | Python | ibis/backends/pandas/__init__.py | gforsyth/ibis | 25db64c5afe18a21e60a999d25a741b32f7b2c3e | [
"Apache-2.0"
] | null | null | null | ibis/backends/pandas/__init__.py | gforsyth/ibis | 25db64c5afe18a21e60a999d25a741b32f7b2c3e | [
"Apache-2.0"
] | null | null | null | ibis/backends/pandas/__init__.py | gforsyth/ibis | 25db64c5afe18a21e60a999d25a741b32f7b2c3e | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import importlib
from typing import Any, MutableMapping
import pandas as pd
from pydantic import Field
import ibis.common.exceptions as com
import ibis.config
import ibis.expr.operations as ops
import ibis.expr.schema as sch
import ibis.expr.types as ir
from ibis.backends.base impo... | 29.940299 | 78 | 0.608175 |
40a48c20fde253a8d8f2a92d818f9e294c299a74 | 6,386 | py | Python | tensorflow_probability/python/bijectors/sigmoid_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 3,670 | 2018-02-14T03:29:40.000Z | 2022-03-30T01:19:52.000Z | tensorflow_probability/python/bijectors/sigmoid_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,395 | 2018-02-24T02:28:49.000Z | 2022-03-31T16:12:06.000Z | tensorflow_probability/python/bijectors/sigmoid_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,135 | 2018-02-14T01:51:10.000Z | 2022-03-28T02:24:11.000Z | # Copyright 2018 The TensorFlow Probability 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 o... | 37.127907 | 78 | 0.67695 |
8e00a0e2d2eb46bee20f22ac8df97c3147301d3a | 264 | py | Python | twitteruser/models.py | DeanNevins/twitterclone | e713627f352f8a7d34b493384fbc86818db841c6 | [
"MIT"
] | null | null | null | twitteruser/models.py | DeanNevins/twitterclone | e713627f352f8a7d34b493384fbc86818db841c6 | [
"MIT"
] | null | null | null | twitteruser/models.py | DeanNevins/twitterclone | e713627f352f8a7d34b493384fbc86818db841c6 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class TwitterUser(AbstractUser):
following = models.ManyToManyField('self', symmetrical=False)
def __str__(self):
return self.username
| 20.307692 | 65 | 0.753788 |
dbcb97ec3a237a5ca2fa4b9ae0433549654d3eca | 32,747 | py | Python | archive/cl_examples_sparsity.py | DMIU-ShELL/deeprl-shell | a7845ab1c4967ba2af9486625086c3d0b176d293 | [
"Apache-2.0"
] | null | null | null | archive/cl_examples_sparsity.py | DMIU-ShELL/deeprl-shell | a7845ab1c4967ba2af9486625086c3d0b176d293 | [
"Apache-2.0"
] | null | null | null | archive/cl_examples_sparsity.py | DMIU-ShELL/deeprl-shell | a7845ab1c4967ba2af9486625086c3d0b176d293 | [
"Apache-2.0"
] | null | null | null | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | 44.858904 | 104 | 0.701194 |
b851a06a29f955a1b9d6a141d992dfe9cfca9b06 | 2,077 | py | Python | pytests/bucket_collections/collection_ops_specs/volume_test_load_1_percent_dgm_lower_ops.py | bkumaran/TAF | 27f39eb913fa89b55cdd88ee1c7ef0bb8c094407 | [
"Apache-2.0"
] | null | null | null | pytests/bucket_collections/collection_ops_specs/volume_test_load_1_percent_dgm_lower_ops.py | bkumaran/TAF | 27f39eb913fa89b55cdd88ee1c7ef0bb8c094407 | [
"Apache-2.0"
] | null | null | null | pytests/bucket_collections/collection_ops_specs/volume_test_load_1_percent_dgm_lower_ops.py | bkumaran/TAF | 27f39eb913fa89b55cdd88ee1c7ef0bb8c094407 | [
"Apache-2.0"
] | 1 | 2019-05-22T09:10:44.000Z | 2019-05-22T09:10:44.000Z | from collections_helper.collections_spec_constants import MetaCrudParams
spec = {
# Scope/Collection ops params
MetaCrudParams.COLLECTIONS_TO_FLUSH: 0,
MetaCrudParams.COLLECTIONS_TO_DROP: 5,
MetaCrudParams.SCOPES_TO_DROP: 3,
MetaCrudParams.SCOPES_TO_ADD_PER_BUCKET: 0,
MetaCrudParams.COLLECTION... | 39.188679 | 72 | 0.767453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.