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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
411b611a9dbf8383421dbb8b21d4e2b13a72f968 | 5,301 | py | Python | authentication/forms.py | RSurya99/aplikasi-pembayaran-spp | be0fc85388d81d4bc2ca4e46e7086c17cbf43b76 | [
"MIT"
] | 2 | 2021-11-08T08:44:47.000Z | 2021-11-29T23:27:26.000Z | authentication/forms.py | RSurya99/aplikasi-pembayaran-spp | be0fc85388d81d4bc2ca4e46e7086c17cbf43b76 | [
"MIT"
] | null | null | null | authentication/forms.py | RSurya99/aplikasi-pembayaran-spp | be0fc85388d81d4bc2ca4e46e7086c17cbf43b76 | [
"MIT"
] | 1 | 2021-11-08T08:44:55.000Z | 2021-11-08T08:44:55.000Z | # -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.db import transaction
from authentication.models import Siswa, Petugas, User
from app.models import Kelas, Spp
class UserProfileForm(forms.ModelForm):
... | 29.126374 | 70 | 0.489719 |
f1b4a9085933871c88b2da36684eea79b19ae0c5 | 1,467 | py | Python | networkapi/config/models.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | networkapi/config/models.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | networkapi/config/models.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"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 "Lic... | 36.675 | 74 | 0.750511 |
afe88a594ed42ecf4c708a42d61381ee4359ff07 | 37,075 | py | Python | docs/rips/generated/PdmObject_pb2.py | OPM/ResInsight-UserDocumentation | 2af2c3a5ef297c0061d842944360a83bf8e49c36 | [
"MIT"
] | 1 | 2020-04-25T21:24:45.000Z | 2020-04-25T21:24:45.000Z | docs/rips/generated/PdmObject_pb2.py | OPM/ResInsight-UserDocumentation | 2af2c3a5ef297c0061d842944360a83bf8e49c36 | [
"MIT"
] | 7 | 2020-02-11T07:42:10.000Z | 2020-09-28T17:18:01.000Z | docs/rips/generated/PdmObject_pb2.py | OPM/ResInsight-UserDocumentation | 2af2c3a5ef297c0061d842944360a83bf8e49c36 | [
"MIT"
] | 2 | 2020-04-02T09:33:45.000Z | 2020-04-09T19:44:53.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: PdmObject.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.proto... | 40.697036 | 3,266 | 0.770223 |
568b5625c86f245edd9d8a4cfb5f4e5d0318a0c5 | 10,722 | py | Python | code/inference.py | gnunesm/CalibNet | 7ffbcbbdbeea56b24cb3c1a865443932164b1d99 | [
"MIT"
] | null | null | null | code/inference.py | gnunesm/CalibNet | 7ffbcbbdbeea56b24cb3c1a865443932164b1d99 | [
"MIT"
] | null | null | null | code/inference.py | gnunesm/CalibNet | 7ffbcbbdbeea56b24cb3c1a865443932164b1d99 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import scipy.misc as smc
import config_res as config
from common.cnn_utils_res import *
# from common import resnet_rgb_model as model
# from common import resnet_depth_model as model_depth
from common import all_transformer as at3
from common import global_agg_net
from comm... | 50.102804 | 348 | 0.678605 |
e6aa21cf6e460649caf79a03deea43fed894e67d | 24,326 | py | Python | cassiopeia/data.py | akarigar/cassiopeia | a027b55571646150d8df669968012de73754a42b | [
"MIT"
] | null | null | null | cassiopeia/data.py | akarigar/cassiopeia | a027b55571646150d8df669968012de73754a42b | [
"MIT"
] | null | null | null | cassiopeia/data.py | akarigar/cassiopeia | a027b55571646150d8df669968012de73754a42b | [
"MIT"
] | null | null | null | from enum import Enum
import arrow
class Region(Enum):
brazil = "BR"
europe_north_east = "EUNE"
europe_west = "EUW"
japan = "JP"
korea = "KR"
latin_america_north = "LAN"
latin_america_south = "LAS"
north_america = "NA"
oceania = "OCE"
turkey = "TR"
russia = "RU"
@prope... | 39.298869 | 449 | 0.670394 |
d6e04c55c654ef6460d6d9e7025b44ee856c6286 | 98,944 | py | Python | pysnmp-with-texts/INFORMANT-ISASERVER.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/INFORMANT-ISASERVER.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/INFORMANT-ISASERVER.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module INFORMANT-ISASERVER (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/INFORMANT-ISASERVER
# Produced by pysmi-0.3.4 at Wed May 1 13:53:37 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | 133.168237 | 12,286 | 0.808114 |
b0737c16d39a875f66720f82724d46e7bb9792b7 | 842 | py | Python | ALSNP_3rd/src/6.io_interface/socket/tcpsnder.py | nosy0411/Advanced_Linux_System_Network_Programming_for_Finance | d4596adeaa2692584b5011e55f01d6b6a8f24269 | [
"MIT"
] | null | null | null | ALSNP_3rd/src/6.io_interface/socket/tcpsnder.py | nosy0411/Advanced_Linux_System_Network_Programming_for_Finance | d4596adeaa2692584b5011e55f01d6b6a8f24269 | [
"MIT"
] | 3 | 2020-09-04T16:54:13.000Z | 2021-06-02T02:56:55.000Z | ALSNP_3rd/src/6.io_interface/socket/tcpsnder.py | nosy0411/ALSNP_for_Finance | d4596adeaa2692584b5011e55f01d6b6a8f24269 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# UDP sender
import socket
import sys
import string
import time
# ---------------------------[ End of Variable definition ]-------------------------------
# DESC : 사용법을 출력한다.
# ARGV : none
# RET : none
def usages():
print sys.argv[0], "<host> <port>"
sys.exit()
# ... | 22.756757 | 90 | 0.529691 |
f306a58faba46a5f6d272c4440f05bcfec9857c9 | 411 | py | Python | src/stactools/worldclim/__init__.py | stactools-packages/worldclim | da81809f610c802f40de101713f12f8433c20b44 | [
"Apache-2.0"
] | null | null | null | src/stactools/worldclim/__init__.py | stactools-packages/worldclim | da81809f610c802f40de101713f12f8433c20b44 | [
"Apache-2.0"
] | 6 | 2021-07-09T21:07:54.000Z | 2021-11-01T21:53:50.000Z | src/stactools/worldclim/__init__.py | stactools-packages/worldclim | da81809f610c802f40de101713f12f8433c20b44 | [
"Apache-2.0"
] | null | null | null | import stactools.core
from stactools.worldclim.cog import create_cog
from stactools.worldclim.stac import create_monthly_item
stactools.core.use_fsspec()
def register_plugin(registry):
from stactools.worldclim import commands
registry.register_subcommand(commands.create_worldclim_command)
__all__ = [creat... | 22.833333 | 67 | 0.815085 |
7da534f1430b07fee664adb3a5d2eafb07017b6d | 1,882 | py | Python | traversalkitexampleapp/views.py | kr41/TraversalKitExampleApp | 4fb0485c28a95cef84f6be8fab99f5e077b33daf | [
"WTFPL"
] | null | null | null | traversalkitexampleapp/views.py | kr41/TraversalKitExampleApp | 4fb0485c28a95cef84f6be8fab99f5e077b33daf | [
"WTFPL"
] | null | null | null | traversalkitexampleapp/views.py | kr41/TraversalKitExampleApp | 4fb0485c28a95cef84f6be8fab99f5e077b33daf | [
"WTFPL"
] | null | null | null | from pyramid.httpexceptions import HTTPNotFound
from pyramid.view import view_config
from . import resources
@view_config(context=resources.SiteRoot, renderer='/siteroot/home.mako')
def home(context, request):
""" Handles home page """
return {}
@view_config(context=resources.Authors, renderer='/authors/in... | 31.366667 | 75 | 0.656748 |
28bad0133bf46643c87bbbefa5791dfdccfe626b | 2,296 | py | Python | ansible/modules/windows/win_firewall.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | ansible/modules/windows/win_firewall.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | ansible/modules/windows/win_firewall.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Michael Eaton <meaton@iforium.com>
#
# This file is part of Ansible
#
# Ansible 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 Li... | 25.511111 | 88 | 0.697735 |
5aa6a79bdab5695b0def63f9e1bec1888b9c6f98 | 1,016 | py | Python | azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_result.py | bgsky/azure-sdk-for-python | ec18d0b25be10fddbde416b901b905dfb0896430 | [
"MIT"
] | null | null | null | azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_result.py | bgsky/azure-sdk-for-python | ec18d0b25be10fddbde416b901b905dfb0896430 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-kusto/azure/mgmt/kusto/models/event_hub_connection_validation_result.py | bgsky/azure-sdk-for-python | ec18d0b25be10fddbde416b901b905dfb0896430 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 33.866667 | 76 | 0.616142 |
96097f26b6e880b38087619e67c0880d6a155044 | 2,502 | py | Python | docs/conf.py | antarcticrainforest/esm_analysis | 9fda30e5fc50c5f9ee53639c28c41397398d7342 | [
"BSD-3-Clause"
] | 2 | 2020-09-03T09:24:36.000Z | 2021-05-26T12:25:16.000Z | docs/conf.py | antarcticrainforest/esm_analysis | 9fda30e5fc50c5f9ee53639c28c41397398d7342 | [
"BSD-3-Clause"
] | 1 | 2021-06-06T14:27:10.000Z | 2021-06-06T14:27:10.000Z | docs/conf.py | antarcticrainforest/esm_analysis | 9fda30e5fc50c5f9ee53639c28c41397398d7342 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup -----------------------------------------------... | 33.36 | 79 | 0.665468 |
2deae186d7b3b3cbcd6475b1e0fe82b0435b7570 | 389 | py | Python | app/users/migrations/0008_user_description.py | Valaraucoo/raven | 0157e193baf569be9479a78838dc26d77a11a99d | [
"BSD-3-Clause"
] | 3 | 2020-12-27T21:52:52.000Z | 2021-08-23T10:26:10.000Z | app/users/migrations/0008_user_description.py | Valaraucoo/raven | 0157e193baf569be9479a78838dc26d77a11a99d | [
"BSD-3-Clause"
] | 12 | 2020-12-22T22:36:28.000Z | 2021-01-18T13:39:34.000Z | app/users/migrations/0008_user_description.py | Valaraucoo/raven | 0157e193baf569be9479a78838dc26d77a11a99d | [
"BSD-3-Clause"
] | 2 | 2020-12-27T21:52:39.000Z | 2021-11-18T08:08:25.000Z | # Generated by Django 3.0.7 on 2020-11-01 15:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0007_user_is_online'),
]
operations = [
migrations.AddField(
model_name='user',
name='description',
... | 20.473684 | 58 | 0.59383 |
b3e3408c18020669d98e7eed4a2aeb4c0ab1b52a | 67,875 | py | Python | django/db/models/fields/related.py | yswai/django | 90c706e44fa1e640245ad4626f0e3ecb176acce2 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/models/fields/related.py | yswai/django | 90c706e44fa1e640245ad4626f0e3ecb176acce2 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/models/fields/related.py | yswai/django | 90c706e44fa1e640245ad4626f0e3ecb176acce2 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import warnings
from functools import partial
from django import forms
from django.apps import apps
from django.core import checks, exceptions
from django.db import connection, router
from django.db.backends import utils
from django.db.models import Q
from django.db.models.dele... | 41.69226 | 119 | 0.590011 |
cee5281a2bc4dff69500703c88561d50334c1fd2 | 553 | py | Python | common/helper.py | forecho/UItron | dbb82c9a9821f233aab678460815d2c6a25906b5 | [
"MIT"
] | null | null | null | common/helper.py | forecho/UItron | dbb82c9a9821f233aab678460815d2c6a25906b5 | [
"MIT"
] | 1 | 2017-04-07T09:39:24.000Z | 2017-04-07T09:39:24.000Z | common/helper.py | forecho/UItron | dbb82c9a9821f233aab678460815d2c6a25906b5 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
import yaml, os
class Helper:
def __init__(self):
pass
@staticmethod
def merge_two_dicts(x, y):
"""Given two dicts, merge them into a new dict as a shallow copy."""
z = x.copy()
z.update(y)
return z
@staticmethod
... | 21.269231 | 76 | 0.526221 |
21a1269a7b22458a794447b6ff8ca1a4010d3180 | 10,624 | py | Python | contest/views.py | TolimanStaR/Course-Work | 79dbfcbaef0ae79209295fe8d36b6fd9610e99b8 | [
"MIT"
] | 1 | 2020-03-31T22:09:34.000Z | 2020-03-31T22:09:34.000Z | contest/views.py | TolimanStaR/Course-Work | 79dbfcbaef0ae79209295fe8d36b6fd9610e99b8 | [
"MIT"
] | 8 | 2021-03-30T14:20:10.000Z | 2022-03-12T00:52:03.000Z | contest/views.py | TolimanStaR/Course-Work | 79dbfcbaef0ae79209295fe8d36b6fd9610e99b8 | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.utils impo... | 39.202952 | 120 | 0.606363 |
872510421359a8c037e3987b7706b4293fa7d607 | 9,330 | py | Python | models/unet/train_unet.py | sbhadra2020/fastMRI | a2b25fed53621c5d5c648993af13971b2d365fc3 | [
"MIT"
] | null | null | null | models/unet/train_unet.py | sbhadra2020/fastMRI | a2b25fed53621c5d5c648993af13971b2d365fc3 | [
"MIT"
] | null | null | null | models/unet/train_unet.py | sbhadra2020/fastMRI | a2b25fed53621c5d5c648993af13971b2d365fc3 | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import pathlib
import random
import numpy as np
import torch
from pytorch_lightning import Trainer
from torch.nn import functional as F
from... | 40.565217 | 108 | 0.633869 |
bc68b8214ab5882d873dd1b7abf53f2e2b1aa6ff | 2,662 | py | Python | day06/day06.py | dileep-kishore/advent-of-code-2020 | 197cd85a8f75dfb58fc46066fecba9f46ab63550 | [
"MIT"
] | 1 | 2021-03-28T13:10:39.000Z | 2021-03-28T13:10:39.000Z | day06/day06.py | dileep-kishore/advent-of-code-2020 | 197cd85a8f75dfb58fc46066fecba9f46ab63550 | [
"MIT"
] | 1 | 2021-01-13T02:32:12.000Z | 2021-01-13T02:32:12.000Z | day06/day06.py | dileep-kishore/advent-of-code-2020 | 197cd85a8f75dfb58fc46066fecba9f46ab63550 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import Counter
from typing import List, Set
class Person:
"""The class the represnts one person
Parameters
----------
question_string : str
The string of questions that the person answered "yes" to
Attributes
----------
answers : Set[str]... | 27.729167 | 75 | 0.590533 |
d7e352f8c692e664acf8588f6418bf7c225cf435 | 2,320 | py | Python | SilverSpoon.py | pforret/SilverSpoon | 30a0172a8655c38cfa0efa99ca5247c4f8b0b865 | [
"Apache-2.0"
] | null | null | null | SilverSpoon.py | pforret/SilverSpoon | 30a0172a8655c38cfa0efa99ca5247c4f8b0b865 | [
"Apache-2.0"
] | null | null | null | SilverSpoon.py | pforret/SilverSpoon | 30a0172a8655c38cfa0efa99ca5247c4f8b0b865 | [
"Apache-2.0"
] | null | null | null | #!flask/bin/python
from flask import Flask, jsonify, request
import ConfigParser, io, re, requests, os,subprocess
app = Flask(__name__)
cfile="config/services.ini"
# Load the configuration file
with open(cfile) as f:
sample_config = f.read()
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.readfp(... | 28.641975 | 128 | 0.634052 |
11bde796e4ba197678ca3ff150062a94d193e199 | 4,009 | py | Python | lab-12/mi-monitor/monitor/monitor.py | dalonsojimenez/openathon-2020-python | 9fc1850140cbbe10eaf5f03b42a8220ae4b27c42 | [
"BSD-3-Clause"
] | 6 | 2020-10-16T13:05:51.000Z | 2021-12-22T17:20:23.000Z | lab-12/mi-monitor/monitor/monitor.py | dalonsojimenez/openathon-2020-python | 9fc1850140cbbe10eaf5f03b42a8220ae4b27c42 | [
"BSD-3-Clause"
] | 1 | 2021-02-23T18:14:01.000Z | 2021-02-23T18:14:01.000Z | lab-12/mi-monitor/monitor/monitor.py | isabella232/openathon-2020-python | 9fc1850140cbbe10eaf5f03b42a8220ae4b27c42 | [
"BSD-3-Clause"
] | 9 | 2020-10-16T13:21:58.000Z | 2021-12-07T08:38:49.000Z | from PyQt5 import QtCore
from PyQt5.QtWidgets import QMainWindow, QVBoxLayout, QWidget, QLabel
import pyqtgraph as pg
from util import Extractor
import time
class Monitor(QMainWindow):
def __init__(self, refresh):
super(Monitor, self).__init__()
print('Se ha creado la clase Monitor')
se... | 32.860656 | 90 | 0.641307 |
2a06127e250c0b585f548f87ba9107adea638d20 | 330 | py | Python | pyFileFixity/_infos.py | lrq3000/rfigc | a68021a506fee1aabea6b2fb88e685de347d900f | [
"MIT"
] | 82 | 2015-03-20T18:43:37.000Z | 2022-03-05T13:23:12.000Z | pyFileFixity/_infos.py | lrq3000/rfigc | a68021a506fee1aabea6b2fb88e685de347d900f | [
"MIT"
] | 9 | 2015-12-05T17:32:14.000Z | 2021-06-11T15:51:38.000Z | pyFileFixity/_infos.py | hadi-f90/pyFileFixity | 2cb3dd6225a6b062a98fa2d61c4a0a29d8010428 | [
"MIT"
] | 10 | 2015-12-13T18:51:44.000Z | 2022-02-21T10:50:28.000Z | # -*- coding: utf-8 -*-
__author__ = 'Stephen Larroque'
__email__ = 'LRQ3000@gmail.com'
# Definition of the version number
version_info = 2, 3, 1 # major, minor, patch, extra
# Nice string for the version (mimic how IPython composes its version str)
__version__ = '-'.join(map(str, version_info)).replace('-', '.').s... | 30 | 75 | 0.684848 |
de1e5c8babade0717a864dba75318d95baa7b4b2 | 11,115 | py | Python | hedwig/utils/add_dataset.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | 3 | 2019-07-20T15:23:59.000Z | 2021-04-26T02:57:59.000Z | hedwig/utils/add_dataset.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | null | null | null | hedwig/utils/add_dataset.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | null | null | null | import os
try:
os.chdir(os.path.join(os.getcwd(), 'hedwig/utils'))
print(os.getcwd())
except:
pass
import pandas as pd
import numpy as np
from pathlib import Path
import ftfy
import textacy
import csv
from gensim.utils import simple_preprocess
import unicodedata
import swifter
from nltk.corpus import stopwords
from... | 42.102273 | 180 | 0.576518 |
9d303f50bebf1c2e1e165a75fd6b0752e31dea55 | 906 | py | Python | tools/multitest.py | CmdrMoozy/pwm | e0e6581ef3cb90ae90447c705f46106033fec7d3 | [
"Apache-2.0"
] | 1 | 2018-10-25T23:58:53.000Z | 2018-10-25T23:58:53.000Z | tools/multitest.py | CmdrMoozy/pwm | e0e6581ef3cb90ae90447c705f46106033fec7d3 | [
"Apache-2.0"
] | 37 | 2017-01-22T23:13:46.000Z | 2018-02-02T04:06:06.000Z | tools/multitest.py | CmdrMoozy/pwm | e0e6581ef3cb90ae90447c705f46106033fec7d3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# This script executes "cargo test" for each combination of features this crate
# supports. This is used to find bugs which only present for certain feature
# combinations.
import itertools
import os
import subprocess
import sys
_DIRECTORY = os.path.dirname(os.path.dirname(os.path.realpath(__... | 34.846154 | 184 | 0.695364 |
a17d34fa0c09ef80eb88c289eed1b0bce191886b | 915 | py | Python | examples/fill_selection.py | 13751742405/photoshop-python-api | 5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70 | [
"MIT"
] | null | null | null | examples/fill_selection.py | 13751742405/photoshop-python-api | 5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70 | [
"MIT"
] | null | null | null | examples/fill_selection.py | 13751742405/photoshop-python-api | 5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70 | [
"MIT"
] | null | null | null | # Fill the current selection with an RGB color.
from photoshop import Session
with Session() as ps:
start_ruler_units = ps.app.Preferences.RulerUnits
if len(ps.app.documents) < 1:
if start_ruler_units is not ps.Units.Pixels:
ps.app.Preferences.RulerUnits = ps.Units.Pixels
docRef ... | 33.888889 | 80 | 0.673224 |
c08844383c87a01c4f090de6ac643ceee547547b | 2,086 | py | Python | stdplugins/create.py | aashiq075/PepeBot | 5f40f4316c84ec3875bcbcd476e10448f9214f31 | [
"Apache-2.0"
] | 6 | 2020-04-21T04:52:42.000Z | 2020-06-19T09:33:02.000Z | stdplugins/create.py | aashiq075/PepeBot | 5f40f4316c84ec3875bcbcd476e10448f9214f31 | [
"Apache-2.0"
] | 1 | 2021-02-08T20:49:02.000Z | 2021-02-08T20:49:02.000Z | stdplugins/create.py | prono69/LazyAF-Pepe | b78d4b9f174a65b77b6b5f4969386aa6dd3359ce | [
"Apache-2.0"
] | 3 | 2020-04-21T05:45:54.000Z | 2020-05-01T15:03:40.000Z | """Create Private Groups
Available Commands:
.create (b|g|c(Chanel)) GroupName/Chanel name"""
from telethon.tl import functions
from uniborg import util
@borg.on(util.admin_cmd(pattern="create (b|g|c) (.*)")) # pylint:disable=E0602
async def _(event):
if event.fwd_from:
return
type_of_group = event.p... | 42.571429 | 106 | 0.603068 |
aabb86f1f341ad67117698b5d2e8459a1d7db064 | 64,544 | py | Python | src/olympia/addons/tests/test_serializers.py | renancleyson-dev/addons-server | 1db556b40260aa4c0c63e84c4d9e3c2d7609eb10 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/addons/tests/test_serializers.py | renancleyson-dev/addons-server | 1db556b40260aa4c0c63e84c4d9e3c2d7609eb10 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/addons/tests/test_serializers.py | renancleyson-dev/addons-server | 1db556b40260aa4c0c63e84c4d9e3c2d7609eb10 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf import settings
from django.test.utils import override_settings
from django.utils.translation import override
from rest_framework.test import APIRequestFactory
from olympia import amo
from olympia.accounts.tests.test_serializers import BaseTestUserMixin
from olympia.addons.mod... | 39.093882 | 88 | 0.605339 |
197ed79a85a146ff8aaa6db1fc022bd50cc3ab29 | 6,307 | py | Python | mmseg/datasets/builder.py | kencan7749/mmsegmentation | e0fe1cb56e5b91f85e33a3ecc3afbeaa31f647e8 | [
"Apache-2.0"
] | null | null | null | mmseg/datasets/builder.py | kencan7749/mmsegmentation | e0fe1cb56e5b91f85e33a3ecc3afbeaa31f647e8 | [
"Apache-2.0"
] | null | null | null | mmseg/datasets/builder.py | kencan7749/mmsegmentation | e0fe1cb56e5b91f85e33a3ecc3afbeaa31f647e8 | [
"Apache-2.0"
] | null | null | null | import copy
import platform
import random
from functools import partial
import numpy as np
import torch
from mmcv.parallel import collate
from mmcv.runner import get_dist_info
from mmcv.utils import Registry, build_from_cfg
from torch.utils.data import DataLoader, DistributedSampler
if platform.system() != 'Windows':... | 35.234637 | 79 | 0.632789 |
df3282c8d5198389e73ec9f9a43918d22dfed900 | 15,037 | py | Python | pysnmp/CISCO-ETHER-CFM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-ETHER-CFM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-ETHER-CFM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-ETHER-CFM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ETHER-CFM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:40:15 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | 151.888889 | 1,954 | 0.763583 |
0fc034433b81b5b8e28b2868359fac77f6fafa86 | 14,072 | py | Python | image_registration/register_images.py | Experimentica/image_registration | 79dd90a7f4e3700e8ad379febdfec5ec7a6e6cb0 | [
"MIT"
] | 122 | 2015-01-20T20:28:33.000Z | 2022-03-27T20:58:40.000Z | image_registration/register_images.py | Experimentica/image_registration | 79dd90a7f4e3700e8ad379febdfec5ec7a6e6cb0 | [
"MIT"
] | 30 | 2015-11-10T12:32:06.000Z | 2022-03-28T12:51:54.000Z | image_registration/register_images.py | Experimentica/image_registration | 79dd90a7f4e3700e8ad379febdfec5ec7a6e6cb0 | [
"MIT"
] | 51 | 2015-06-30T19:30:11.000Z | 2022-03-30T08:50:40.000Z | from .fft_tools import correlate2d, fast_ffts
from .fft_tools import dftups, upsample_image, shift
import warnings
import numpy as np
__all__ = ['register_images']
def register_images(im1, im2, usfac=1, return_registered=False,
return_error=False, zeromean=True, DEBUG=False, maxoff=None,
... | 42.902439 | 171 | 0.60226 |
7231ea382d864ae48aa1d8b9730f23087284d857 | 7,269 | py | Python | main.py | anithakv/ML-PROJECT | c852745f2ad4bbd5d485f93e2169155a652ba79b | [
"MIT"
] | null | null | null | main.py | anithakv/ML-PROJECT | c852745f2ad4bbd5d485f93e2169155a652ba79b | [
"MIT"
] | null | null | null | main.py | anithakv/ML-PROJECT | c852745f2ad4bbd5d485f93e2169155a652ba79b | [
"MIT"
] | 1 | 2020-11-03T17:18:56.000Z | 2020-11-03T17:18:56.000Z | import tkinter.messagebox
import webbrowser
import pygame
import time
from functools import partial
from tkinter import ttk
import imdb_recommendation_system as ims
from tkHyperlinkManager import *
def play_menu_sound(option):
"""
:type option: str
:return: None
Plays a sound based on the 'option' arg... | 44.054545 | 118 | 0.695281 |
77ceae58c0dc9ef7a853dbdda1997371e74e7290 | 4,386 | py | Python | array_lbaasv2_driver/v2/driver_v2.py | arraynetworks/array-lbaasv2-driver | 631bf65349ed0908bf1f2cd91a615d31b2434fe8 | [
"Apache-2.0"
] | null | null | null | array_lbaasv2_driver/v2/driver_v2.py | arraynetworks/array-lbaasv2-driver | 631bf65349ed0908bf1f2cd91a615d31b2434fe8 | [
"Apache-2.0"
] | null | null | null | array_lbaasv2_driver/v2/driver_v2.py | arraynetworks/array-lbaasv2-driver | 631bf65349ed0908bf1f2cd91a615d31b2434fe8 | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 32.731343 | 75 | 0.723438 |
ef3d295c9ad55b2ed2c1960341d54df0925573c6 | 7,062 | py | Python | Estudos e testes/Cubo com textura/opengl_tutorial.py | AlucardFAS/codigos | cbf80c8e539227dcc2f52a9652da3fec146ff491 | [
"MIT"
] | 2 | 2018-05-23T04:04:18.000Z | 2021-02-18T17:13:49.000Z | Estudos e testes/Cubo com textura/opengl_tutorial.py | AlucardFAS/codigos | cbf80c8e539227dcc2f52a9652da3fec146ff491 | [
"MIT"
] | null | null | null | Estudos e testes/Cubo com textura/opengl_tutorial.py | AlucardFAS/codigos | cbf80c8e539227dcc2f52a9652da3fec146ff491 | [
"MIT"
] | 1 | 2017-05-18T22:02:18.000Z | 2017-05-18T22:02:18.000Z | import pygame
from OpenGL.GL import *
from OpenGL.GLU import *
class Cube(object):
distance = 0
left_key = False
right_key = False
up_key = False
down_key = False
a_key = False
w_key = False
s_key = False
d_key = False
r_key = False
f_key = False
x_axis = 0
y_axis = ... | 27.585938 | 97 | 0.486973 |
cd1cad2f604b704088d9d68c862ea8ee99f27a44 | 1,534 | py | Python | tokenization_repair/utils/subdivide_files.py | bastiscode/trt | 4b32e36d427875417df58554b89fbe88d273e62c | [
"Apache-2.0"
] | null | null | null | tokenization_repair/utils/subdivide_files.py | bastiscode/trt | 4b32e36d427875417df58554b89fbe88d273e62c | [
"Apache-2.0"
] | null | null | null | tokenization_repair/utils/subdivide_files.py | bastiscode/trt | 4b32e36d427875417df58554b89fbe88d273e62c | [
"Apache-2.0"
] | null | null | null | import argparse
import os
from typing import IO
from tqdm import tqdm
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--files", type=str, nargs="+", required=True)
parser.add_argument("--lines-per-file", type=int, required=True)
parser.add_argument("--out-dir", type=str, req... | 31.306122 | 98 | 0.640808 |
d65ff0852fdb2281ceec38892484a7020979a829 | 1,613 | py | Python | tectosaur_topo/solve.py | tbenthompson/tectosaur_topo | e717f1baed8f9830e61e89802f45c43fde63f3be | [
"MIT"
] | 2 | 2017-08-17T21:24:53.000Z | 2017-11-09T03:51:58.000Z | tectosaur_topo/solve.py | tbenthompson/tectosaur_topo | e717f1baed8f9830e61e89802f45c43fde63f3be | [
"MIT"
] | 1 | 2019-11-25T17:24:25.000Z | 2019-11-25T17:24:25.000Z | tectosaur_topo/solve.py | tbenthompson/tectosaur_topo | e717f1baed8f9830e61e89802f45c43fde63f3be | [
"MIT"
] | 1 | 2020-06-29T05:59:55.000Z | 2020-06-29T05:59:55.000Z | import numpy as np
import scipy.sparse.linalg
import tectosaur_topo
from tectosaur.util.timer import Timer
import logging
logger = logging.getLogger(__name__)
defaults = dict(
solver_tol = 1e-8,
log_level = logging.DEBUG
)
def forward_solve(system, fault_slip, **kwargs):
cfg = tectosaur_topo.cfg.setup_c... | 28.803571 | 65 | 0.652201 |
ef12a85572ec3804cf207bd2fcac0ed5f15db57b | 3,267 | py | Python | src/pydoc_markdown/util/docspec.py | thedemons/pydoc-markdown | 83339893d403caa58c6810973efeb0415b0daa91 | [
"MIT"
] | 333 | 2015-10-27T12:27:41.000Z | 2022-03-23T01:09:22.000Z | src/pydoc_markdown/util/docspec.py | thedemons/pydoc-markdown | 83339893d403caa58c6810973efeb0415b0daa91 | [
"MIT"
] | 211 | 2015-08-11T14:31:33.000Z | 2022-03-30T21:21:33.000Z | src/pydoc_markdown/util/docspec.py | thedemons/pydoc-markdown | 83339893d403caa58c6810973efeb0415b0daa91 | [
"MIT"
] | 120 | 2016-02-09T00:27:44.000Z | 2022-03-29T10:53:22.000Z |
from abc import abstractproperty
import typing as t
import typing_extensions as te
import docspec
import docspec_python
from nr.stream import Stream
T = t.TypeVar('T')
def get_members_of_type(objs: t.Union[docspec.ApiObject, t.List[docspec.ApiObject]], type_: t.Type[T]) -> t.List[T]:
if isinstance(objs, docspec.... | 37.988372 | 116 | 0.709826 |
81078b98d952713f4a4613770835b7110d46a2e1 | 1,203 | py | Python | ctci/ch1/1-5.py | michaelmunje/algorithms | 3b8da8aa8bb541dcbdc4f408fc51efa043220517 | [
"MIT"
] | 1 | 2018-09-26T23:54:17.000Z | 2018-09-26T23:54:17.000Z | ctci/ch1/1-5.py | michaelmunje/algorithms | 3b8da8aa8bb541dcbdc4f408fc51efa043220517 | [
"MIT"
] | null | null | null | ctci/ch1/1-5.py | michaelmunje/algorithms | 3b8da8aa8bb541dcbdc4f408fc51efa043220517 | [
"MIT"
] | 1 | 2018-09-26T23:54:25.000Z | 2018-09-26T23:54:25.000Z | import unittest
def check_one_away(s1, s2): # O(n)
found_operation = False
if abs(len(s1) - len(s2)) > 1:
return False
i = 0
j = 0
while i < len(s1) and j < len(s2):
if s1[i] != s2[j]:
if found_operation is True:
return False
found_opera... | 26.152174 | 60 | 0.559435 |
944c5d81aa02eece56727e5f1be6d66d6c047eed | 5,942 | py | Python | 01-Lesson-Plans/03-Python-Pandas/1/Activities/04-condition-control-flow-02/Solved/condition-control-flow-02.py | tatianegercina/FinTech | b40687aa362d78674e223eb15ecf14bc59f90b62 | [
"ADSL"
] | 1 | 2021-04-13T07:14:34.000Z | 2021-04-13T07:14:34.000Z | 01-Lesson-Plans/03-Python-Pandas/1/Activities/04-condition-control-flow-02/Solved/condition-control-flow-02.py | tatianegercina/FinTech | b40687aa362d78674e223eb15ecf14bc59f90b62 | [
"ADSL"
] | 2 | 2021-06-02T03:14:19.000Z | 2022-02-11T23:21:24.000Z | 01-Lesson-Plans/03-Python-Pandas/1/Activities/04-condition-control-flow-02/Solved/condition-control-flow-02.py | tatianegercina/FinTech | b40687aa362d78674e223eb15ecf14bc59f90b62 | [
"ADSL"
] | 1 | 2021-05-07T13:26:50.000Z | 2021-05-07T13:26:50.000Z |
######################
# Create Character One
######################
# Make a variable called `c1_name` and have it equal a string of "Mr. Farley".
c1_name = "Mr. Farley"
# Make a variable called `c1_age` and have it equal to an integer of 65.
c1_age = 65
# Make a variable called `c1_profession` and have it equal t... | 47.919355 | 468 | 0.725513 |
1a7784cdc600cb403287ff524d6487ab868ca0c5 | 1,709 | py | Python | discovery-infra/tests/test_e2e_install.py | lranjbar/assisted-test-infra | 89cd4e16744afa646af88975f8038ca1774bcfa4 | [
"Apache-2.0"
] | null | null | null | discovery-infra/tests/test_e2e_install.py | lranjbar/assisted-test-infra | 89cd4e16744afa646af88975f8038ca1774bcfa4 | [
"Apache-2.0"
] | 30 | 2021-11-15T07:10:49.000Z | 2022-03-28T07:10:26.000Z | discovery-infra/tests/test_e2e_install.py | lranjbar/assisted-test-infra | 89cd4e16744afa646af88975f8038ca1774bcfa4 | [
"Apache-2.0"
] | null | null | null | import time
from contextlib import suppress
import pytest
from _pytest.fixtures import FixtureLookupError
from junit_report import JunitTestSuite
from test_infra.consts import OperatorStatus
from tests.base_test import BaseTest
from tests.config import ClusterConfig
from tests.conftest import get_available_openshift... | 37.977778 | 105 | 0.771796 |
1a8050d83eaca034aa6503b46ccc5368d0fe9f12 | 3,938 | py | Python | pybamm/models/submodels/electrolyte_diffusion/composite_diffusion.py | kinnala/PyBaMM | 3c4ef83d1ea06287a55ceac5f25e139e54599ea9 | [
"BSD-3-Clause"
] | 1 | 2021-03-06T15:10:34.000Z | 2021-03-06T15:10:34.000Z | pybamm/models/submodels/electrolyte_diffusion/composite_diffusion.py | kinnala/PyBaMM | 3c4ef83d1ea06287a55ceac5f25e139e54599ea9 | [
"BSD-3-Clause"
] | null | null | null | pybamm/models/submodels/electrolyte_diffusion/composite_diffusion.py | kinnala/PyBaMM | 3c4ef83d1ea06287a55ceac5f25e139e54599ea9 | [
"BSD-3-Clause"
] | null | null | null | #
# Class for composite electrolyte diffusion employing stefan-maxwell
#
import pybamm
from .base_electrolyte_diffusion import BaseElectrolyteDiffusion
class Composite(BaseElectrolyteDiffusion):
"""Class for conservation of mass in the electrolyte employing the
Stefan-Maxwell constitutive equations. (Composit... | 36.12844 | 88 | 0.653377 |
45a2a1cd7f83748d66abe8f90ef5d7a8827aa1d0 | 6,770 | py | Python | scripts/build_dlc.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | null | null | null | scripts/build_dlc.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | 2 | 2021-03-26T00:29:32.000Z | 2021-04-30T21:29:33.000Z | scripts/build_dlc.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to generate a DLC (Downloadable Content) artifact."""
from __future__ import print_function
import sys
from chromite.l... | 37.197802 | 80 | 0.663516 |
6b82bf221840391b14fd232f04118d89dc444119 | 104 | py | Python | event_log/channels/__init__.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | event_log/channels/__init__.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | event_log/channels/__init__.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | from . import email
from . import callback
channels = dict(
email=email,
callback=callback,
)
| 11.555556 | 22 | 0.682692 |
fe8629ede643af365680ab7808aa47297414664b | 1,512 | py | Python | backend/appengine/course/course_model.py | MarcosVn/turinginformatica | 21eba5f105ad052aa7505b6e77ca5871167a9dc2 | [
"MIT"
] | null | null | null | backend/appengine/course/course_model.py | MarcosVn/turinginformatica | 21eba5f105ad052aa7505b6e77ca5871167a9dc2 | [
"MIT"
] | null | null | null | backend/appengine/course/course_model.py | MarcosVn/turinginformatica | 21eba5f105ad052aa7505b6e77ca5871167a9dc2 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from gaeforms.base import StringField, IntegerField
from gaeforms.ndb.form import ModelForm
__author__ = 'marcos'
class Course(ndb.Model):
name = ndb.StringProperty(required=True)
duration = ndb.StringProperty(requir... | 29.647059 | 74 | 0.743386 |
c2302f276c536524f22f138433cdaada8c44b740 | 1,986 | py | Python | app/migrations/0001_initial.py | billowbashir/The-Gram | a887c2cb97c6a3e1f01ce7eb7c5ae0f808e005d6 | [
"Unlicense"
] | null | null | null | app/migrations/0001_initial.py | billowbashir/The-Gram | a887c2cb97c6a3e1f01ce7eb7c5ae0f808e005d6 | [
"Unlicense"
] | null | null | null | app/migrations/0001_initial.py | billowbashir/The-Gram | a887c2cb97c6a3e1f01ce7eb7c5ae0f808e005d6 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-08 16:51
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependencies ... | 38.192308 | 122 | 0.591641 |
a597363c9d7e0872f33f103691684e12037d1fbb | 8,435 | py | Python | electrum_btcc/tests/test_simple_config.py | Aaahh/electrum-btcc | 3cf0ee1803af9540334db21daa3817693994e9d0 | [
"MIT"
] | null | null | null | electrum_btcc/tests/test_simple_config.py | Aaahh/electrum-btcc | 3cf0ee1803af9540334db21daa3817693994e9d0 | [
"MIT"
] | 5 | 2018-10-12T04:44:06.000Z | 2018-10-12T04:58:10.000Z | electrum_btcc/tests/test_simple_config.py | Aaahh/electrum-btcc | 3cf0ee1803af9540334db21daa3817693994e9d0 | [
"MIT"
] | null | null | null | import ast
import sys
import os
import tempfile
import shutil
from io import StringIO
from electrum_btcc.simple_config import (SimpleConfig, read_user_config)
from . import SequentialTestCase
class Test_SimpleConfig(SequentialTestCase):
def setUp(self):
super(Test_SimpleConfig, self).setUp()
# ... | 45.349462 | 99 | 0.650978 |
21bf5453ff0503e341b37a38475ebdd4f3f0557e | 2,413 | py | Python | solutions/day06.py | nitekat1124/advent-of-code-2018 | a5db933b84f7df4a3b86d78787f89e739f06d881 | [
"WTFPL"
] | null | null | null | solutions/day06.py | nitekat1124/advent-of-code-2018 | a5db933b84f7df4a3b86d78787f89e739f06d881 | [
"WTFPL"
] | null | null | null | solutions/day06.py | nitekat1124/advent-of-code-2018 | a5db933b84f7df4a3b86d78787f89e739f06d881 | [
"WTFPL"
] | null | null | null | from utils.solution_base import SolutionBase
class Solution(SolutionBase):
def solve(self, part_num: int):
self.test_runner(part_num)
func = getattr(self, f"part{part_num}")
result = func(self.data)
return result
def test_runner(self, part_num):
test_inputs = self.get... | 36.014925 | 99 | 0.519685 |
852528fb3a52071872727a1dfb9fe48ddebba6cb | 9,247 | py | Python | homeassistant/components/frontier_silicon/media_player.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | homeassistant/components/frontier_silicon/media_player.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:13:11.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/frontier_silicon/media_player.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Support for Frontier Silicon Devices (Medion, Hama, Auna,...)."""
import logging
from afsapi import AFSAPI
import requests
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
... | 29.449045 | 87 | 0.633503 |
f39643879f612ec2b7a69a701c73805ecec728d4 | 1,167 | py | Python | cached_dnc/cached_memory.py | thaihungle/DMNC | 3ce17a9277bbeeb8125b588e86cc8aace67a0924 | [
"MIT"
] | 11 | 2018-04-26T10:56:03.000Z | 2021-03-20T08:46:25.000Z | cached_dnc/cached_memory.py | thaihungle/DMNC | 3ce17a9277bbeeb8125b588e86cc8aace67a0924 | [
"MIT"
] | 1 | 2018-07-21T19:29:57.000Z | 2018-08-03T06:14:52.000Z | cached_dnc/cached_memory.py | thaihungle/DMNC | 3ce17a9277bbeeb8125b588e86cc8aace67a0924 | [
"MIT"
] | 5 | 2019-02-20T23:51:38.000Z | 2019-12-05T05:41:55.000Z | import tensorflow as tf
import memory
class CachedMemory(memory.Memory):
def init_memory(self):
"""
returns the initial values for the memory Parameters
Returns: Tuple
"""
print('init cached mem')
return (
# each sample in batch has its own version of me... | 44.884615 | 105 | 0.627249 |
47fffdd44f4265dadb8806cc047899a6bf0a2d4d | 7,926 | py | Python | pyxform/tests/j2x_question_tests.py | loginphpcom/pyxform | 4da80774db25935d894fcbf42d2c423648205e80 | [
"BSD-2-Clause"
] | 10 | 2015-06-19T07:40:31.000Z | 2021-12-27T00:03:16.000Z | pyxform/tests/j2x_question_tests.py | loginphpcom/pyxform | 4da80774db25935d894fcbf42d2c423648205e80 | [
"BSD-2-Clause"
] | 1 | 2019-12-27T18:26:48.000Z | 2019-12-27T18:26:48.000Z | pyxform/tests/j2x_question_tests.py | loginphpcom/pyxform | 4da80774db25935d894fcbf42d2c423648205e80 | [
"BSD-2-Clause"
] | 21 | 2015-02-26T20:15:23.000Z | 2019-12-27T18:13:04.000Z | """
Testing creation of Surveys using verbose methods
"""
from unittest import TestCase
from pyxform import *
from pyxform.question import Question
from pyxform.builder import create_survey_element_from_dict
import json
from pyxform.utils import node
TESTING_BINDINGS = True
def ctw(control):
"""
ctw stands ... | 39.432836 | 388 | 0.595635 |
1cf8df3863e3ead9550ee7708966bcb035b33d83 | 4,587 | py | Python | env/lib/python3.7/site-packages/tests/attacks/evasion/test_imperceptible_asr_pytorch.py | GU-DataLab/fairness-and-missing-values | 36a900aa235d1d53bd57e11c89e3f73f9a585aca | [
"MIT"
] | 1 | 2021-09-09T13:19:34.000Z | 2021-09-09T13:19:34.000Z | tests/attacks/evasion/test_imperceptible_asr_pytorch.py | nelsonmanohar-umich/adversarial-robustness-toolbox | 065ac24e7f5ec124f6cfe39ce21f085f4c87a401 | [
"MIT"
] | 10 | 2021-10-04T23:25:53.000Z | 2022-03-24T23:20:38.000Z | tests/attacks/evasion/test_imperceptible_asr_pytorch.py | nelsonmanohar-umich/adversarial-robustness-toolbox | 065ac24e7f5ec124f6cfe39ce21f085f4c87a401 | [
"MIT"
] | 1 | 2021-09-09T13:19:35.000Z | 2021-09-09T13:19:35.000Z | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# r... | 38.872881 | 120 | 0.684979 |
45b7b23090b9c06b014f55b43ffa22d8b0767c77 | 2,006 | py | Python | var/spack/repos/builtin/packages/rccl/package.py | healther/spack | 389e9c11f6927ea27d629ed0e77ca0a52e402bc9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/rccl/package.py | abouteiller/spack | 95f54195021d3d32dec75bed6d8dbbaeac3d921f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/rccl/package.py | abouteiller/spack | 95f54195021d3d32dec75bed6d8dbbaeac3d921f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.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 Rccl(CMakePackage):
"""RCCL (pronounced "Rickle") is a stand-alone library
of standard... | 43.608696 | 95 | 0.654038 |
8b3a17203e61a5ce4dfdcd0310f8ffd992a0065d | 4,428 | py | Python | tests/test_web_application.py | bcb/aiohttp | 77638364958c74fff7719fdc028a79aa2281c3ad | [
"Apache-2.0"
] | null | null | null | tests/test_web_application.py | bcb/aiohttp | 77638364958c74fff7719fdc028a79aa2281c3ad | [
"Apache-2.0"
] | 2 | 2018-06-12T15:22:48.000Z | 2018-06-12T15:31:13.000Z | tests/test_web_application.py | bcb/aiohttp | 77638364958c74fff7719fdc028a79aa2281c3ad | [
"Apache-2.0"
] | 1 | 2020-01-17T00:33:59.000Z | 2020-01-17T00:33:59.000Z | import asyncio
from unittest import mock
import pytest
from aiohttp import helpers, log, web
def test_app_ctor(loop):
app = web.Application(loop=loop)
assert loop is app.loop
assert app.logger is log.web_logger
def test_app_call(loop):
app = web.Application(loop=loop)
assert app is app()
def... | 26.357143 | 74 | 0.687218 |
20a1e5e8c277475f3f094f4435795e2b05e986ef | 1,511 | py | Python | April/Week4/Powerful Integers.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | 1 | 2020-08-02T13:41:38.000Z | 2020-08-02T13:41:38.000Z | April/Week4/Powerful Integers.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | April/Week4/Powerful Integers.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | # Powerful Integers
'''
Given three integers x, y, and bound, return a list of all the powerful integers that have a value less than or equal to bound.
An integer is powerful if it can be represented as xi + yj for some integers i >= 0 and j >= 0.
You may return the answer in any order. In your answer, each value s... | 19.126582 | 127 | 0.417604 |
048d114d14f40bbb6d2c9359d4c56d8f210d388f | 530 | py | Python | exercises/test_01_08.py | rklymentiev/py-for-neuro | 6bb163347483642c79eac429e5a9289edff7ce09 | [
"MIT"
] | 7 | 2021-04-28T13:12:16.000Z | 2022-01-15T00:21:11.000Z | exercises/test_01_08.py | rklymentiev/py-for-neuro | 6bb163347483642c79eac429e5a9289edff7ce09 | [
"MIT"
] | 2 | 2021-04-02T18:42:55.000Z | 2021-05-20T08:43:06.000Z | exercises/test_01_08.py | rklymentiev/py-for-neuro | 6bb163347483642c79eac429e5a9289edff7ce09 | [
"MIT"
] | 2 | 2021-07-04T22:57:29.000Z | 2021-07-29T19:28:43.000Z | def test():
# Here we can either check objects created in the solution code, or the
# string value of the solution, available as __solution__. A helper for
# printing formatted messages is available as __msg__. See the testTemplate
# in the meta.json for details.
# If an assertion fails, the messag... | 44.166667 | 79 | 0.711321 |
f5540307c5c5bdbaca7c1ed68f2bd24c0e75c4e0 | 283 | py | Python | mayan/apps/appearance/tests/test_models.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/appearance/tests/test_models.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/appearance/tests/test_models.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | from mayan.apps.testing.tests.base import BaseTestCase
from .mixins import ThemeTestMixin
class ThemeTestCase(ThemeTestMixin, BaseTestCase):
def test_method_get_absolute_url(self):
self._create_test_theme()
self.assertTrue(self.test_theme.get_absolute_url())
| 25.727273 | 59 | 0.784452 |
e181d748e1501217aa8599274f53d82c053ecc30 | 8,497 | py | Python | python/GafferUI/PlugLayout.py | davidsminor/gaffer | 64f75654ce778105dd93fbaad0e4486a5577cd09 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/PlugLayout.py | davidsminor/gaffer | 64f75654ce778105dd93fbaad0e4486a5577cd09 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/PlugLayout.py | davidsminor/gaffer | 64f75654ce778105dd93fbaad0e4486a5577cd09 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Red... | 37.764444 | 173 | 0.712722 |
e00a32c6ede9ef7fb181b4d018f836767675634e | 3,263 | py | Python | populate.py | imane-boudell/pyhcovdb | fcbe651daf1fba819c04458d8919fd8f71531260 | [
"Apache-2.0"
] | 1 | 2021-11-10T13:34:40.000Z | 2021-11-10T13:34:40.000Z | populate.py | imane-boudell/pyhcovdb | fcbe651daf1fba819c04458d8919fd8f71531260 | [
"Apache-2.0"
] | null | null | null | populate.py | imane-boudell/pyhcovdb | fcbe651daf1fba819c04458d8919fd8f71531260 | [
"Apache-2.0"
] | null | null | null | import sqlalchemy
from sqlalchemy import String, Integer, Text
import pandas as pd
import numpy as np
import sys
from sqlalchemy_utils import create_database, database_exists
database_username = 'root'
database_password = 'rootpassword'
database_ip = 'localhost'
database_name = 'hcov'
url = 'mysql... | 42.934211 | 130 | 0.641434 |
49243ed3049a0de1224da3d16a839e29950828b8 | 222 | py | Python | api/utils/redirect.py | ferrumie/multi-pay | 3e6a6fc63de823c10b5c52ade73b8357ed8bfd48 | [
"MIT"
] | null | null | null | api/utils/redirect.py | ferrumie/multi-pay | 3e6a6fc63de823c10b5c52ade73b8357ed8bfd48 | [
"MIT"
] | null | null | null | api/utils/redirect.py | ferrumie/multi-pay | 3e6a6fc63de823c10b5c52ade73b8357ed8bfd48 | [
"MIT"
] | null | null | null | from django.conf import settings
def get_redirect_path():
""" Create the payment redirect route for callback"""
ui_domain = settings.UI_DOMAIN
ui_route = settings.UI_ROUTE
return f'{ui_domain}{ui_route}'
| 24.666667 | 57 | 0.72973 |
26de9e9c40a3663cba0b192a931aad7188ad035b | 15,634 | py | Python | tensorflow_probability/python/distributions/categorical.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/categorical.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/categorical.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | # 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.047393 | 81 | 0.678329 |
afd52f13c46109dd39aee89d926ddea718d48147 | 51,143 | py | Python | species/read/read_model.py | tomasstolker/SPECIES | f74483a334f36cbeafeaf372446ae1ea9f278d95 | [
"MIT"
] | null | null | null | species/read/read_model.py | tomasstolker/SPECIES | f74483a334f36cbeafeaf372446ae1ea9f278d95 | [
"MIT"
] | null | null | null | species/read/read_model.py | tomasstolker/SPECIES | f74483a334f36cbeafeaf372446ae1ea9f278d95 | [
"MIT"
] | null | null | null | """
Module with reading functionalities for atmospheric model spectra.
"""
import os
import math
import warnings
import configparser
from typing import Dict, List, Optional, Tuple
import h5py
import spectres
import numpy as np
from typeguard import typechecked
from scipy.interpolate import interp1d, interp2d, Regul... | 32.721049 | 88 | 0.539507 |
6da3a37d9553601fc945cb0c87b2520f950c5b47 | 146 | py | Python | src/py_scripts/fc_graph_to_utgs.py | peterjc/FALCON | ab80e88e1278879f28fe83b9fa0382249213444e | [
"BSD-3-Clause-Clear"
] | 216 | 2015-01-23T09:18:26.000Z | 2022-03-04T14:22:39.000Z | src/py_scripts/fc_graph_to_utgs.py | PacificBiosciences/FALCON | ab80e88e1278879f28fe83b9fa0382249213444e | [
"BSD-3-Clause-Clear"
] | 646 | 2015-01-07T18:16:50.000Z | 2022-03-14T20:50:12.000Z | src/py_scripts/fc_graph_to_utgs.py | peterjc/FALCON | ab80e88e1278879f28fe83b9fa0382249213444e | [
"BSD-3-Clause-Clear"
] | 118 | 2015-01-13T00:02:43.000Z | 2022-01-11T11:56:49.000Z | from __future__ import absolute_import
from falcon_kit.mains.graph_to_utgs import main
import sys
if __name__ == "__main__":
main(sys.argv)
| 18.25 | 47 | 0.787671 |
d8805d8dea9c4083f8b510ed14568ff32eaa14e5 | 21,942 | py | Python | .upip-deps/ansitable/table.py | CallumJHays/ubdsim | 1944461b95d356dc4892e154fd55228280ee52b1 | [
"MIT"
] | 1 | 2021-06-20T08:49:42.000Z | 2021-06-20T08:49:42.000Z | .upip-deps/ansitable/table.py | CallumJHays/ubdsim_realtime | 1944461b95d356dc4892e154fd55228280ee52b1 | [
"MIT"
] | null | null | null | .upip-deps/ansitable/table.py | CallumJHays/ubdsim_realtime | 1944461b95d356dc4892e154fd55228280ee52b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 18 21:43:18 2020
@author: corkep
"""
import sys
try:
from colored import fg, bg, attr
_colored = True
# print('using colored output')
except ImportError:
# print('colored not found')
_colored = False
# -------------------------... | 32.220264 | 136 | 0.473202 |
a45755966f962856d37753d4cfe93e15b6928bbc | 365 | py | Python | nomadgram/notifications/migrations/0004_auto_20180731_2138.py | HaeSeon0363/instaclone | fd65bb466769175dc607d369e10d01dbd077af06 | [
"MIT"
] | null | null | null | nomadgram/notifications/migrations/0004_auto_20180731_2138.py | HaeSeon0363/instaclone | fd65bb466769175dc607d369e10d01dbd077af06 | [
"MIT"
] | null | null | null | nomadgram/notifications/migrations/0004_auto_20180731_2138.py | HaeSeon0363/instaclone | fd65bb466769175dc607d369e10d01dbd077af06 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-07-31 12:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('notifications', '0003_notification_comment'),
]
operations = [
migrations.AlterModelOptions(
name='notification',
options={'... | 20.277778 | 55 | 0.610959 |
8800967f82a63427343ec031c06448e15bf01eae | 154 | py | Python | Exercicios em Python/teste.py | Raphael-Azevedo/Exercicios_Python | dece138f38edd02b0731aed78e44acccb021b3cb | [
"MIT"
] | null | null | null | Exercicios em Python/teste.py | Raphael-Azevedo/Exercicios_Python | dece138f38edd02b0731aed78e44acccb021b3cb | [
"MIT"
] | null | null | null | Exercicios em Python/teste.py | Raphael-Azevedo/Exercicios_Python | dece138f38edd02b0731aed78e44acccb021b3cb | [
"MIT"
] | null | null | null | lista = [
['p1', 13],
['p2', 3],
['p3', 23],
['p4', 43],
['p5', 8]
]
lista.sort(key=lambda item: item[1], reverse=True)
print(lista)
| 14 | 50 | 0.461039 |
4b33e64a2f4fb36468537841a052ae78887d2f0b | 20,535 | py | Python | sdk/python/pulumi_azure_native/network/v20190401/virtual_network_tap.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190401/virtual_network_tap.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190401/virtual_network_tap.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 53.616188 | 2,861 | 0.6972 |
a84cc5d2dfe5f1bb6500bc63dee58d942f92b5f7 | 3,201 | py | Python | mri/operators/proximity/weighted.py | paquiteau/pysap-mri | 7a90e1839953d53f205ed2175a51dfb3175cf76c | [
"CECILL-B"
] | 26 | 2019-03-21T15:28:22.000Z | 2022-02-13T19:14:57.000Z | mri/operators/proximity/weighted.py | chaithyagr/pysap-mri | 9174d742307c8060e997bbe4407743d52c4d25aa | [
"CECILL-B"
] | 128 | 2019-03-21T14:59:50.000Z | 2022-03-18T09:24:44.000Z | mri/operators/proximity/weighted.py | chaithyagr/pysap-mri | 9174d742307c8060e997bbe4407743d52c4d25aa | [
"CECILL-B"
] | 19 | 2019-03-21T15:49:55.000Z | 2022-03-07T10:14:49.000Z | import numpy as np
from modopt.opt.proximity import SparseThreshold
from modopt.opt.linear import Identity
class WeightedSparseThreshold(SparseThreshold):
"""This is a weighted version of `SparseThreshold` in ModOpt.
When chosen `scale_based`, it allows the users to specify an array of
weights W[i] and e... | 39.518519 | 78 | 0.605123 |
246c844540a1a20b84a0982a7a0eaf5e532c27f1 | 3,317 | py | Python | application.py | DZen90/cs50 | 4e60e96ebac846e58859db08dbf3ca8cea92b2a7 | [
"CC-BY-3.0"
] | null | null | null | application.py | DZen90/cs50 | 4e60e96ebac846e58859db08dbf3ca8cea92b2a7 | [
"CC-BY-3.0"
] | null | null | null | application.py | DZen90/cs50 | 4e60e96ebac846e58859db08dbf3ca8cea92b2a7 | [
"CC-BY-3.0"
] | null | null | null | import os
import re
from flask import Flask, jsonify, render_template, request, url_for
from flask_jsglue import JSGlue
from cs50 import SQL
from helpers import lookup
# configure application
app = Flask(__name__)
JSGlue(app)
# ensure responses aren't cached
if app.config["DEBUG"]:
@app.after_request
def aft... | 30.712963 | 113 | 0.606874 |
40ac3272cd05d598771e8a8dafbd57b4c92fd8fe | 10,218 | py | Python | hazelcast/listener.py | mdumandag/hazelcast-python-client | 1d6918b5d3b4e22f4f5d1400397d0308ad1e6aed | [
"Apache-2.0"
] | null | null | null | hazelcast/listener.py | mdumandag/hazelcast-python-client | 1d6918b5d3b4e22f4f5d1400397d0308ad1e6aed | [
"Apache-2.0"
] | null | null | null | hazelcast/listener.py | mdumandag/hazelcast-python-client | 1d6918b5d3b4e22f4f5d1400397d0308ad1e6aed | [
"Apache-2.0"
] | null | null | null | import logging
import sys
import threading
from uuid import uuid4
from hazelcast import six
from hazelcast.errors import HazelcastError, HazelcastClientNotActiveError, TargetDisconnectedError
from hazelcast.future import combine_futures, ImmediateFuture
from hazelcast.invocation import Invocation
from hazelcast.protoc... | 40.070588 | 99 | 0.665884 |
aebb92a0175ef4af6e9e11c38f1f9d9313180441 | 2,596 | py | Python | bot/menu/routs.py | Bloodielie/trip_counter | 9eacd0739dfb6f234b5d6609a297570c2efbca14 | [
"MIT"
] | null | null | null | bot/menu/routs.py | Bloodielie/trip_counter | 9eacd0739dfb6f234b5d6609a297570c2efbca14 | [
"MIT"
] | null | null | null | bot/menu/routs.py | Bloodielie/trip_counter | 9eacd0739dfb6f234b5d6609a297570c2efbca14 | [
"MIT"
] | null | null | null | from aiogram import Dispatcher
import bot.menu.text as menu_text
from bot.balance.services import get_user_transactions
from bot.menu.handlers import start, bad_history_input, menu_user_balance, menu_history, bad_menu_input
from bot.menu.services import formatting_trips, formatting_transactions
from bot.menu.states im... | 38.176471 | 118 | 0.751156 |
da8441b2f6e1280fbe10aef6bbad05bd48c73fc7 | 11,251 | py | Python | asyncpraw/models/reddit/user_subreddit.py | MaybeNetwork/asyncpraw | 2657a1aba091811d57ff949683de9389df2a45d2 | [
"BSD-2-Clause"
] | null | null | null | asyncpraw/models/reddit/user_subreddit.py | MaybeNetwork/asyncpraw | 2657a1aba091811d57ff949683de9389df2a45d2 | [
"BSD-2-Clause"
] | null | null | null | asyncpraw/models/reddit/user_subreddit.py | MaybeNetwork/asyncpraw | 2657a1aba091811d57ff949683de9389df2a45d2 | [
"BSD-2-Clause"
] | null | null | null | """Provide the UserSubreddit class."""
import inspect
from typing import TYPE_CHECKING, Dict, Union
from warnings import warn
from ...util.cache import cachedproperty
from .subreddit import Subreddit, SubredditModeration
if TYPE_CHECKING: # pragma: no cover
from .... import asyncpraw
class UserSubreddit(Subred... | 43.949219 | 88 | 0.621723 |
f8b139d73bac5670298715946b8ede794c9a11bb | 1,119 | py | Python | tensorflow/contrib/tpu/python/tpu/tpu.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/tpu/python/tpu/tpu.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/tpu/python/tpu/tpu.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # 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 app... | 43.038462 | 81 | 0.720286 |
6ca30b39a3da460451122b5aa105e215e35e0b0b | 754 | py | Python | utils/measure/playground/test_var.py | KrzysztofHajdamowicz/homeassistant-powercalc | 374312e21d1c21b28984990442ec56fc52177f4e | [
"MIT"
] | 219 | 2021-06-12T20:55:57.000Z | 2022-03-30T07:56:43.000Z | utils/measure/playground/test_var.py | KrzysztofHajdamowicz/homeassistant-powercalc | 374312e21d1c21b28984990442ec56fc52177f4e | [
"MIT"
] | 420 | 2021-06-09T20:22:03.000Z | 2022-03-31T15:35:45.000Z | utils/measure/playground/test_var.py | KrzysztofHajdamowicz/homeassistant-powercalc | 374312e21d1c21b28984990442ec56fc52177f4e | [
"MIT"
] | 84 | 2021-06-09T18:18:03.000Z | 2022-03-29T09:28:06.000Z | def get_ct_variations():
i = 0
for bri in inclusive_range(1, 255, 15):
for mired in inclusive_range(150, 500, 50):
i = i + 1
print("ct: " + str(i))
def get_hs_variations():
i = 0
for bri in inclusive_range(1, 255, 10):
for sat in inclusive_range(1, 254, 10):
... | 24.322581 | 55 | 0.570292 |
d00d17a695f0d6a3ee43da914eab49bb8591e171 | 6,242 | py | Python | project-euler/completed/euler13.py | davidxmoody/kata | d88569584c2390da0e8127258d8751f8a47b7d83 | [
"MIT"
] | null | null | null | project-euler/completed/euler13.py | davidxmoody/kata | d88569584c2390da0e8127258d8751f8a47b7d83 | [
"MIT"
] | null | null | null | project-euler/completed/euler13.py | davidxmoody/kata | d88569584c2390da0e8127258d8751f8a47b7d83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
nums = ( 37107287533902102798797998220837590246510135740250,
46376937677490009712648124896970078050417018260538,
74324986199524741059474233309513058123726617309629,
91942213363574161572522430563301811072406154908250,
230675882075393461711719803104210475137... | 59.447619 | 61 | 0.806152 |
1d732c3f244605a4ce37104b91e1cf6df728c182 | 15,770 | py | Python | gps_helper/test/test_kalman.py | Miguel-O-Matic/gps-helper | dae3f143281ef930de84a1b783d33aa6e4446040 | [
"MIT"
] | 1 | 2022-03-25T23:48:29.000Z | 2022-03-25T23:48:29.000Z | gps_helper/test/test_kalman.py | Miguel-O-Matic/gps-helper | dae3f143281ef930de84a1b783d33aa6e4446040 | [
"MIT"
] | 11 | 2018-07-14T22:11:26.000Z | 2020-06-21T21:23:15.000Z | gps_helper/test/test_kalman.py | Miguel-O-Matic/gps-helper | dae3f143281ef930de84a1b783d33aa6e4446040 | [
"MIT"
] | 5 | 2018-07-13T20:07:07.000Z | 2021-05-07T15:03:10.000Z | from .test_helper import GPSTest
from .. import kalman as kf
from .. import simulator as sim
import numpy as np
from numpy.linalg import norm
from numpy import testing as npt
class TestKalman(GPSTest):
"""
Test class for the kalman functions.
"""
_multiprocess_can_split_ = True
def test_simple_ka... | 39.131514 | 116 | 0.530501 |
e2bc1018111e2cf9f15e926fa37e38ec3fa67b59 | 2,719 | py | Python | discordbot.py | Erierit/discordpy-startup | 988feae472cd28e2c5ff6674f86a206ea3d2c218 | [
"MIT"
] | null | null | null | discordbot.py | Erierit/discordpy-startup | 988feae472cd28e2c5ff6674f86a206ea3d2c218 | [
"MIT"
] | null | null | null | discordbot.py | Erierit/discordpy-startup | 988feae472cd28e2c5ff6674f86a206ea3d2c218 | [
"MIT"
] | null | null | null | # インストールした discord.py を読み込む
import discord
from discord.ext import commands
import asyncio
# 自分のBotのアクセストークンに置き換えてください
TOKEN = 'DISCORD_BOT_TOKEN'
# 接続に必要なオブジェクトを生成
client = discord.Client()
client = commands.Bot(command_prefix=".")
# 起動時に動作する処理
@client.event
async def on_ready():
# 起動したらターミナルにログイン通知が表示される
p... | 36.253333 | 112 | 0.588452 |
9d98c6bea8376243ab4961ae8dea4fad4b69381d | 505 | py | Python | regexlib/python_re_test_file/regexlib_267.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | 1 | 2022-01-24T14:43:23.000Z | 2022-01-24T14:43:23.000Z | regexlib/python_re_test_file/regexlib_267.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | regexlib/python_re_test_file/regexlib_267.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | # 267
# username=(.*)&password=(.*)
# POLYNOMIAL
# nums:4
# POLYNOMIAL AttackString:""+"username="*5000+"! _1SLQ_2"
import re
from time import perf_counter
regex = """username=(.*)&password=(.*)"""
REGEX = re.compile(regex)
for i in range(0, 150000):
ATTACK = "" + "username=" * i * 10000 + "! _1SLQ_2"
LEN = l... | 26.578947 | 57 | 0.621782 |
2c85d77c468845994b3dbb36875f00c651914ddc | 13,716 | py | Python | mmpose/apis/inference_tracking.py | ALISCIFP/mmpose | 2433e3dbcc44baa2253e2a7c748ba0216937933e | [
"Apache-2.0"
] | null | null | null | mmpose/apis/inference_tracking.py | ALISCIFP/mmpose | 2433e3dbcc44baa2253e2a7c748ba0216937933e | [
"Apache-2.0"
] | null | null | null | mmpose/apis/inference_tracking.py | ALISCIFP/mmpose | 2433e3dbcc44baa2253e2a7c748ba0216937933e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import numpy as np
from mmpose.core import OneEuroFilter, oks_iou
def _compute_iou(bboxA, bboxB):
"""Compute the Intersection over Union (IoU) between two boxes .
Args:
bboxA (list): The first bbox info (left, top, right, bottom, score... | 37.889503 | 79 | 0.519904 |
8e55bbb55c0c45ccfa939a07487bc7820cbd8e82 | 7,605 | py | Python | roboverse/envs/widow250_pickplace.py | Asap7772/roboverse_curr | 291ae2c257b968f592fd1e4b1229c003262da7db | [
"MIT"
] | 17 | 2020-10-28T01:39:39.000Z | 2022-03-02T01:07:01.000Z | roboverse/envs/widow250_pickplace.py | Asap7772/roboverse_curr | 291ae2c257b968f592fd1e4b1229c003262da7db | [
"MIT"
] | null | null | null | roboverse/envs/widow250_pickplace.py | Asap7772/roboverse_curr | 291ae2c257b968f592fd1e4b1229c003262da7db | [
"MIT"
] | 8 | 2021-01-10T15:52:17.000Z | 2022-03-17T12:37:09.000Z | from roboverse.envs.widow250 import Widow250Env
from roboverse.bullet import object_utils
import roboverse.bullet as bullet
from roboverse.envs import objects
from .multi_object import MultiObjectEnv, MultiObjectMultiContainerEnv
from roboverse.assets.shapenet_object_lists import CONTAINER_CONFIGS
import os.path as osp... | 40.026316 | 96 | 0.641946 |
bd28e088981b8a97f215ecaeb5e17e491aa5448f | 1,320 | py | Python | hive/node.py | PhilipSkinner/PiR | 281dcf528d7120deeb42d28f284ea89b560c726d | [
"MIT"
] | null | null | null | hive/node.py | PhilipSkinner/PiR | 281dcf528d7120deeb42d28f284ea89b560c726d | [
"MIT"
] | null | null | null | hive/node.py | PhilipSkinner/PiR | 281dcf528d7120deeb42d28f284ea89b560c726d | [
"MIT"
] | null | null | null | from flask import flask
import api
api = None
app = Flask(__name__)
@app.route('/lights', methods=['GET'])
def getLights():
return ''
@app.route('/lights/<id>', methods=['GET'])
def getLight(id):
return ''
@app.route('/lights/<id>/state/on', methods=['PUT'])
def lightOn(id):
api.lightO... | 22.758621 | 82 | 0.566667 |
4f00ed83071b92cb8538339e26319a4db911c994 | 35,090 | py | Python | 2nd/BeforeEdit.py | Kim-Tae-Moo/2021_2nd_semester_teamproject | 1b60b200365c74da4001048cad6f0a131242dd88 | [
"MIT"
] | null | null | null | 2nd/BeforeEdit.py | Kim-Tae-Moo/2021_2nd_semester_teamproject | 1b60b200365c74da4001048cad6f0a131242dd88 | [
"MIT"
] | null | null | null | 2nd/BeforeEdit.py | Kim-Tae-Moo/2021_2nd_semester_teamproject | 1b60b200365c74da4001048cad6f0a131242dd88 | [
"MIT"
] | null | null | null | # Before Editing Code
from tkinter import *
from tkinter import ttk
def mountains(): #changing
toplevel=Toplevel()
toplevel.title("전북의 산")
toplevel.geometry("400x400")
toplevel.resizable(False, False)
button0 = Button(toplevel, width = 15, text = "모악산", command = moak)
but... | 31.78442 | 361 | 0.621459 |
5954a78166e2ec26fe5d4433ece46ab9631aa548 | 1,036 | py | Python | tools/pickle_reader.py | mayfieldmobster/DECI | c2c9165aeec7344048dd9479049dc490033881d5 | [
"MIT"
] | 1 | 2021-12-19T01:09:12.000Z | 2021-12-19T01:09:12.000Z | tools/pickle_reader.py | mayfieldmobster/DECI | c2c9165aeec7344048dd9479049dc490033881d5 | [
"MIT"
] | null | null | null | tools/pickle_reader.py | mayfieldmobster/DECI | c2c9165aeec7344048dd9479049dc490033881d5 | [
"MIT"
] | null | null | null | import pickle
import numpy as np
from ecdsa import SigningKey, VerifyingKey, SECP112r2
import itertools
"""
with open("../info/Test_Trans.pickle", "rb") as file:
Transactions = pickle.load(file)
print(str(Transactions).replace(" ",""))
print(type(Transactions))
print(type(str(Transactions)))
for t... | 29.6 | 93 | 0.658301 |
d92a68ac8ef02c6f5adc23b2c6bfc7e21e65ddd0 | 10,090 | py | Python | yetagain/utils.py | felixbrunner/yetagain | edae7b650d143b237fc02c3dd75dd9c2453d0e13 | [
"BSD-3-Clause"
] | null | null | null | yetagain/utils.py | felixbrunner/yetagain | edae7b650d143b237fc02c3dd75dd9c2453d0e13 | [
"BSD-3-Clause"
] | null | null | null | yetagain/utils.py | felixbrunner/yetagain | edae7b650d143b237fc02c3dd75dd9c2453d0e13 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import scipy as sp
import pandas as pd
def calculate_kolmogorov_smirnov_distance(mu0, mu1, sigma0, sigma1):
if np.isnan(mu0) or np.isnan(mu1) or np.isnan(sigma0) or np.isnan(sigma1):
KS = np.nan
else:
a = 1/(2*sigma0**2) - 1/(2*sigma1**2)
b = mu1/sigma1**... | 41.694215 | 203 | 0.695243 |
a01e9ab93ee8c0898094e65a76de5b2900064d6e | 19 | py | Python | algs/src/python/imagep/src/segmentation/__init__.py | sivikt/14m2-alg | 38a07ef26de0cc857a5ad389c2987d57a69d23d4 | [
"Unlicense"
] | 1 | 2015-02-13T19:05:30.000Z | 2015-02-13T19:05:30.000Z | algs/src/python/imagep/src/segmentation/__init__.py | sivikt/14m2-alg | 38a07ef26de0cc857a5ad389c2987d57a69d23d4 | [
"Unlicense"
] | null | null | null | algs/src/python/imagep/src/segmentation/__init__.py | sivikt/14m2-alg | 38a07ef26de0cc857a5ad389c2987d57a69d23d4 | [
"Unlicense"
] | null | null | null | from . import segon | 19 | 19 | 0.789474 |
476c4e03f85e34b128529e303b83113f6fb4ced1 | 5,609 | py | Python | tvm/Models/riptide/anneal/models/learning_schedules.py | cowanmeg/cgo-artifact-2020 | 4ad3e7e202428042799249d3dfe70faedcecddee | [
"BSD-3-Clause"
] | 16 | 2019-11-20T03:43:19.000Z | 2021-11-25T02:32:17.000Z | tvm/Models/riptide/anneal/models/learning_schedules.py | cowanmeg/cgo-artifact-2020 | 4ad3e7e202428042799249d3dfe70faedcecddee | [
"BSD-3-Clause"
] | 2 | 2020-02-20T10:01:48.000Z | 2021-08-21T02:23:57.000Z | tvm/Models/riptide/anneal/models/learning_schedules.py | cowanmeg/cgo-artifact-2020 | 4ad3e7e202428042799249d3dfe70faedcecddee | [
"BSD-3-Clause"
] | 5 | 2020-03-18T10:14:30.000Z | 2021-04-01T12:09:20.000Z | import numpy as np
import tensorflow as tf
from .clr import cyclic_learning_rate
_NUM_IMAGES = 1281167
def adjust_start_lr(lr, batch_size, num_gpus, batch_denom=128):
if num_gpus == 0:
num_gpus = 1
batch_size = batch_size * num_gpus
lr_adjustment = batch_size / batch_denom
starting_lr = lr ... | 36.660131 | 105 | 0.60189 |
97678fbc6ca7a2d44416cf49a716bb616b96f343 | 772 | py | Python | gmaps/__init__.py | gokussx4/eggwhites | e3ca94b8c6261ac7ef8387ec035e6e3864932cf5 | [
"MIT"
] | null | null | null | gmaps/__init__.py | gokussx4/eggwhites | e3ca94b8c6261ac7ef8387ec035e6e3864932cf5 | [
"MIT"
] | null | null | null | gmaps/__init__.py | gokussx4/eggwhites | e3ca94b8c6261ac7ef8387ec035e6e3864932cf5 | [
"MIT"
] | null | null | null | import json, urllib
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
from models import GeoCache, Settings
def geocode(address):
geo = GeoCache.get_by_address(address)
if (geo != None):
return geo.geo
geo = _request(address)
if (geo is None):
return None
... | 30.88 | 110 | 0.658031 |
2d6fb01b6e6bd5b2b3104188d493377d8ad5da52 | 1,203 | py | Python | functions/shared.py | Lynxtickler/rest-api-terraform | d8b8125de80228a4bee2d8ad4ff7593b77eff121 | [
"MIT"
] | null | null | null | functions/shared.py | Lynxtickler/rest-api-terraform | d8b8125de80228a4bee2d8ad4ff7593b77eff121 | [
"MIT"
] | 4 | 2021-10-16T06:37:28.000Z | 2022-01-05T19:49:44.000Z | functions/shared.py | Lynxtickler/rest-api-terraform | d8b8125de80228a4bee2d8ad4ff7593b77eff121 | [
"MIT"
] | 1 | 2021-11-22T14:24:17.000Z | 2021-11-22T14:24:17.000Z | import json
import traceback
import boto3
from boto3.dynamodb.conditions import Attr
TABLE_NAME = 'Quotes'
DAILY_RESOURCE_NAME = 'daily'
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(TABLE_NAME)
def response(code=200, headers=None, body='', encode=False):
if not headers:
headers = {'Conte... | 27.340909 | 81 | 0.677473 |
30968a5de46c9127b5c3e830ecad6fd79e47dba0 | 10,335 | py | Python | src/openfermion/hamiltonians/_hubbard_test.py | josh146/OpenFermion | e64c17a8043b2ad0a60695b581293bf903ad91a3 | [
"Apache-2.0"
] | null | null | null | src/openfermion/hamiltonians/_hubbard_test.py | josh146/OpenFermion | e64c17a8043b2ad0a60695b581293bf903ad91a3 | [
"Apache-2.0"
] | null | null | null | src/openfermion/hamiltonians/_hubbard_test.py | josh146/OpenFermion | e64c17a8043b2ad0a60695b581293bf903ad91a3 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 17.973913 | 76 | 0.420126 |
a1b693a6c04b974e91f4ffecdb2fc87cfeb8f05d | 913 | py | Python | nltk/translate/__init__.py | shashank31mar/nltk | 0bfe8812bc81d1d72590ceec242f3aa84934d952 | [
"Apache-2.0"
] | null | null | null | nltk/translate/__init__.py | shashank31mar/nltk | 0bfe8812bc81d1d72590ceec242f3aa84934d952 | [
"Apache-2.0"
] | 1 | 2021-05-02T13:51:35.000Z | 2021-05-02T13:51:35.000Z | nltk/translate/__init__.py | iliakur/nltk | f927e6f36bd175bacf90e9d09291e0eeeb6b255f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Machine Translation
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>, Tah Wei Hoon <hoon.tw@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Experimental features for machine translation.
These ... | 36.52 | 79 | 0.810515 |
4a11e10c5e26b44e9feb1dabc3664ddf0410685a | 12,252 | py | Python | plasTeX/Renderers/ManPage/__init__.py | perfectbark/LaTex2Docx | e32f9dcc59cce7bea4e7b114687b2300c623d8c0 | [
"MIT"
] | 23 | 2019-06-16T06:00:39.000Z | 2022-03-29T14:44:32.000Z | plasTeX/Renderers/ManPage/__init__.py | hao-han/LaTex2Docx | e32f9dcc59cce7bea4e7b114687b2300c623d8c0 | [
"MIT"
] | null | null | null | plasTeX/Renderers/ManPage/__init__.py | hao-han/LaTex2Docx | e32f9dcc59cce7bea4e7b114687b2300c623d8c0 | [
"MIT"
] | 12 | 2019-05-27T06:32:06.000Z | 2022-03-15T10:22:07.000Z | #!/usr/bin/env python
from plasTeX.Renderers import Renderer as BaseRenderer
import textwrap, re, string
class ManPageRenderer(BaseRenderer):
""" Renderer for UNIX man pages """
outputType = unicode
fileExtension = '.man'
aliases = {
'superscript': 'active::^',
'subscript': 'acti... | 27.046358 | 118 | 0.550522 |
5209bb669984564a7248cce83c86162296db7ffa | 10,708 | py | Python | function_demo.py | uclqcoo/colony-com | 6dde6b4a4631405b156783ca8b0dd5389c397fe6 | [
"MIT"
] | null | null | null | function_demo.py | uclqcoo/colony-com | 6dde6b4a4631405b156783ca8b0dd5389c397fe6 | [
"MIT"
] | null | null | null | function_demo.py | uclqcoo/colony-com | 6dde6b4a4631405b156783ca8b0dd5389c397fe6 | [
"MIT"
] | 3 | 2020-06-02T10:05:51.000Z | 2021-12-02T18:43:09.000Z | from functionsDiffusion import *
'''
Demo of the simulations in mainDiffusion.py using the new functions
'''
# fixed global parameters from Doong et. al. 2017
x_s = 20 # synthase production rate(au/min)
x_a = 0.1
x_g = .1
lambda_a = 2.3 # hill coeff ahl2
K_a = 40 ... | 26.904523 | 129 | 0.56752 |
4d47bd6498f870d0533b10baf4fadb7305c7a047 | 1,914 | bzl | Python | kotlin/internal/jvm/android.bzl | renovate-bot/rules_kotlin | 9d100403c084534d41a8b74cfe12dc40275f4dd0 | [
"Apache-2.0"
] | null | null | null | kotlin/internal/jvm/android.bzl | renovate-bot/rules_kotlin | 9d100403c084534d41a8b74cfe12dc40275f4dd0 | [
"Apache-2.0"
] | null | null | null | kotlin/internal/jvm/android.bzl | renovate-bot/rules_kotlin | 9d100403c084534d41a8b74cfe12dc40275f4dd0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Bazel 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 applicable la... | 36.807692 | 118 | 0.680773 |
4b58b37243f980b9904b05cbf62a29961d9757ad | 3,225 | py | Python | models.py | u7javed/Handwritten-Number-Generator | f8f9ee7d48702af0e9f582a7c8acaad2531ac842 | [
"MIT"
] | null | null | null | models.py | u7javed/Handwritten-Number-Generator | f8f9ee7d48702af0e9f582a7c8acaad2531ac842 | [
"MIT"
] | null | null | null | models.py | u7javed/Handwritten-Number-Generator | f8f9ee7d48702af0e9f582a7c8acaad2531ac842 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch
#Discriminator
class Discriminator(nn.Module):
def __init__(self, label_size):
super(Discriminator, self).__init__()
#label = [B]
self.embedding = nn.Embedding(label_size, 4*28*28)
#label after embed = [B, 4*28*28]
self.label_conv... | 35.43956 | 106 | 0.530233 |
0ba360e60dd10bdb55d24f034aaecc6c58077e80 | 3,236 | py | Python | dircopy.py | CLPeters/DeFFNetIzer | 3306ff4856606ea5a891ad70b14efe4bb7480ce0 | [
"Apache-2.0"
] | 3 | 2016-02-18T04:52:32.000Z | 2021-02-23T23:47:05.000Z | dircopy.py | CLPeters/DeFFNetIzer | 3306ff4856606ea5a891ad70b14efe4bb7480ce0 | [
"Apache-2.0"
] | 2 | 2016-03-26T05:49:24.000Z | 2020-12-21T02:34:45.000Z | dircopy.py | CLPeters/DeFFNetIzer | 3306ff4856606ea5a891ad70b14efe4bb7480ce0 | [
"Apache-2.0"
] | 2 | 2016-02-18T04:52:34.000Z | 2021-03-20T02:11:35.000Z | # dircopy.py - A module for copying directories
# Copyright (C) 2005 by Jonathan Rosebaugh
# Portions copyright 2005 by Stephen Chappell; see below for details
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
... | 33.360825 | 79 | 0.659765 |
c5b5fd5c8babaf878c514c9af706a8b066e5adcc | 1,678 | py | Python | tests/test_models.py | chudichudichudi/neuro-tedx-2 | 4ee8c4fc3e311a169d597deed9e3ddefff13709f | [
"BSD-3-Clause"
] | null | null | null | tests/test_models.py | chudichudichudi/neuro-tedx-2 | 4ee8c4fc3e311a169d597deed9e3ddefff13709f | [
"BSD-3-Clause"
] | null | null | null | tests/test_models.py | chudichudichudi/neuro-tedx-2 | 4ee8c4fc3e311a169d597deed9e3ddefff13709f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Model unit tests."""
import datetime as dt
import pytest
from tedx2.user.models import User, Role
from .factories import UserFactory
@pytest.mark.usefixtures('db')
class TestUser:
def test_get_by_id(self):
user = User('foo', 'foo@bar.com')
user.save()
retrieve... | 28.931034 | 63 | 0.628725 |
a9ee46181a221bc4113e1ea975a463c3c7d711b2 | 4,305 | py | Python | test/functional/mempool_expiry.py | tngc-one/tngcoin | 1382521c4f897cf798e840fee2ce9abd70bbb99b | [
"MIT"
] | null | null | null | test/functional/mempool_expiry.py | tngc-one/tngcoin | 1382521c4f897cf798e840fee2ce9abd70bbb99b | [
"MIT"
] | null | null | null | test/functional/mempool_expiry.py | tngc-one/tngcoin | 1382521c4f897cf798e840fee2ce9abd70bbb99b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020 The TNGC Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests that a mempool transaction expires after a given timeout and that its
children are removed as well.
Both... | 42.623762 | 79 | 0.690128 |
8da217c80e42d48db3eff140fc7b33e08033fee2 | 6,993 | py | Python | kubernetes_asyncio/client/models/v1alpha1_role_binding_list.py | playground-julia/kubernetes_asyncio | 91b2c41eedd282d9ebc059377fb7f207e220133d | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1alpha1_role_binding_list.py | playground-julia/kubernetes_asyncio | 91b2c41eedd282d9ebc059377fb7f207e220133d | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1alpha1_role_binding_list.py | playground-julia/kubernetes_asyncio | 91b2c41eedd282d9ebc059377fb7f207e220133d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.15.9
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | 33.946602 | 295 | 0.630488 |
17428e543f31e7ce518de1beace83d4461eb75b0 | 4,330 | py | Python | fbgemm_gpu/bench/quantize_ops_benchmark.py | stevenlysc/FBGEMM | e21f4d043bb5d8aea0b887bf71b28779edff48e4 | [
"BSD-3-Clause"
] | null | null | null | fbgemm_gpu/bench/quantize_ops_benchmark.py | stevenlysc/FBGEMM | e21f4d043bb5d8aea0b887bf71b28779edff48e4 | [
"BSD-3-Clause"
] | null | null | null | fbgemm_gpu/bench/quantize_ops_benchmark.py | stevenlysc/FBGEMM | e21f4d043bb5d8aea0b887bf71b28779edff48e4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import time
from typing import Callable, Tuple
import click
import torch
from torch import Tensor
... | 31.838235 | 93 | 0.627021 |
fefaf85158c91dc9a269b64e9cd06e726ba59f53 | 54 | py | Python | voiceplay/player/backend/__init__.py | tb0hdan/voiceplay | 3e35a25cfcf982a3871cf0d819bae4374ee31ecf | [
"Unlicense"
] | 2 | 2017-03-22T10:02:07.000Z | 2020-08-02T11:56:47.000Z | voiceplay/player/backend/__init__.py | tb0hdan/voiceplay | 3e35a25cfcf982a3871cf0d819bae4374ee31ecf | [
"Unlicense"
] | 69 | 2016-12-10T22:27:47.000Z | 2017-12-14T05:15:43.000Z | voiceplay/player/backend/__init__.py | tb0hdan/voiceplay | 3e35a25cfcf982a3871cf0d819bae4374ee31ecf | [
"Unlicense"
] | null | null | null | #-*- coding: utf-8 -*-
""" Player backend package """
| 18 | 30 | 0.555556 |
398f4482e64a8506861b6c2f376557c77750b882 | 2,871 | py | Python | rt1d/run/ComputeTimestep.py | astrojhgu/rt1d | cb49510ae9850d1491dcf9336e3994fb1b153438 | [
"MIT"
] | null | null | null | rt1d/run/ComputeTimestep.py | astrojhgu/rt1d | cb49510ae9850d1491dcf9336e3994fb1b153438 | [
"MIT"
] | null | null | null | rt1d/run/ComputeTimestep.py | astrojhgu/rt1d | cb49510ae9850d1491dcf9336e3994fb1b153438 | [
"MIT"
] | null | null | null | """
ComputeTimestep.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Thu Dec 27 14:12:50 2012
Description:
"""
import numpy as np
from ..util.Warnings import dt_error
huge_dt = 1e30 # seconds
class ComputeTimestep:
def __init__(self, grid, epsilon=0.1):
self.grid... | 32.258427 | 98 | 0.494601 |
d89c6a80b057e6d9caef25673063ee1fd09804d3 | 2,081 | py | Python | libs/gps.py | VinniciusGomes/Gps-Python | b7d3d7b5cfa59bd819a7bac695fa4275bdd483ca | [
"MIT"
] | 1 | 2019-11-04T01:36:45.000Z | 2019-11-04T01:36:45.000Z | libs/gps.py | VinniciusGomes/Gps-Python | b7d3d7b5cfa59bd819a7bac695fa4275bdd483ca | [
"MIT"
] | null | null | null | libs/gps.py | VinniciusGomes/Gps-Python | b7d3d7b5cfa59bd819a7bac695fa4275bdd483ca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
# O NetworkX é um pacote Python para a criação, manipulação e estudo da estrutura, dinâmica e funções de redes complexas.
import networkx as nx
def limpar_tela():
os.system('clear')
class GPS(object):
grafo = None
origem = None
destino = None
def ler_mapa(self, arquivo_mapa... | 35.87931 | 205 | 0.66987 |
a9af3b913e14c062e84333f4f8d17b6fab900abb | 107,228 | py | Python | toontown/toon/DistributedToon.py | DankMickey/Project-Altis-Educational-Source | 0a74999fb52d4e690a41b984703119f63c372d20 | [
"Apache-2.0"
] | 1 | 2021-06-25T02:56:32.000Z | 2021-06-25T02:56:32.000Z | toontown/toon/DistributedToon.py | kool601/Project-Altis-Educational-Source | 0a74999fb52d4e690a41b984703119f63c372d20 | [
"Apache-2.0"
] | null | null | null | toontown/toon/DistributedToon.py | kool601/Project-Altis-Educational-Source | 0a74999fb52d4e690a41b984703119f63c372d20 | [
"Apache-2.0"
] | 2 | 2017-12-20T17:46:56.000Z | 2021-06-25T02:56:36.000Z | import operator, copy, random, time, gc
from toontown.toon import Experience, InventoryNewOLD, TTEmote, Toon
from direct.controls.GravityWalker import GravityWalker
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.distributed import DistributedSmoothNode
fr... | 37.400767 | 682 | 0.628147 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.