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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9b710777f920eefd3c308238ecf035afa9798731 | 2,585 | py | Python | roadsandlibraries.py | rresender/python-samples | 2fb2330f59f3cc0c6b975381e22268a758773b69 | [
"MIT"
] | null | null | null | roadsandlibraries.py | rresender/python-samples | 2fb2330f59f3cc0c6b975381e22268a758773b69 | [
"MIT"
] | null | null | null | roadsandlibraries.py | rresender/python-samples | 2fb2330f59f3cc0c6b975381e22268a758773b69 | [
"MIT"
] | null | null | null | from collections import defaultdict
class Graph:
def __init__(self, size):
# self.graph = defaultdict(list)
self.graph = {x: list() for x in range(1, size + 1)}
def addEdge(self, u, v):
self.graph[u].append(v)
self.graph[v].append(u)
def dfs_util(self, v, visit... | 19.007353 | 67 | 0.49942 |
e92a3f6a71c7225b293a941020749046d2c628d5 | 12,558 | py | Python | fairseq/model_parallel/modules/multihead_attention.py | lukeiscoding/fairseq | 3748359f597a4785b7769af588b4d939138b177a | [
"MIT"
] | 651 | 2015-03-14T23:18:44.000Z | 2022-01-19T14:08:28.000Z | fairseq/model_parallel/modules/multihead_attention.py | lukeiscoding/fairseq | 3748359f597a4785b7769af588b4d939138b177a | [
"MIT"
] | 362 | 2015-01-26T16:20:28.000Z | 2022-01-26T06:19:23.000Z | fairseq/model_parallel/modules/multihead_attention.py | lukeiscoding/fairseq | 3748359f597a4785b7769af588b4d939138b177a | [
"MIT"
] | 169 | 2015-09-28T17:06:28.000Z | 2021-12-18T16:02:49.000Z | # 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.
from typing import Dict, Optional, Tuple
import torch
import torch.nn.functional as F
from fairseq import utils
from torch import Tensor, nn
... | 40.121406 | 98 | 0.616659 |
9171e7a453ab5b2b56f0f5146063b8fc5aa6c842 | 5,944 | py | Python | sdk/python/pulumi_sumologic/get_collector.py | pulumi/pulumi-sumologic | 962fa056ee4b96e61a200e7bf2308bfad723c3af | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-10-13T03:50:41.000Z | 2021-10-13T03:50:41.000Z | sdk/python/pulumi_sumologic/get_collector.py | pulumi/pulumi-sumologic | 962fa056ee4b96e61a200e7bf2308bfad723c3af | [
"ECL-2.0",
"Apache-2.0"
] | 28 | 2021-05-21T11:00:45.000Z | 2022-03-31T15:47:13.000Z | sdk/python/pulumi_sumologic/get_collector.py | pulumi/pulumi-sumologic | 962fa056ee4b96e61a200e7bf2308bfad723c3af | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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 ... | 33.393258 | 131 | 0.658816 |
0a49cfde7d4289ca21ab22bfecd48c932d068308 | 233 | py | Python | app/main/errors.py | joseck12/one-minute-pitch | 2b74500c08b60bbf08b94c0b400479b2c6ef594a | [
"MIT",
"Unlicense"
] | null | null | null | app/main/errors.py | joseck12/one-minute-pitch | 2b74500c08b60bbf08b94c0b400479b2c6ef594a | [
"MIT",
"Unlicense"
] | null | null | null | app/main/errors.py | joseck12/one-minute-pitch | 2b74500c08b60bbf08b94c0b400479b2c6ef594a | [
"MIT",
"Unlicense"
] | null | null | null | from flask import render_template
from . import main
from ..import db
@main.app_errorhandler(404)
def four_Ow_four(error):
'''
Function to render the 404 error page
'''
return render_template('fourOwfour.html'), 404
| 21.181818 | 50 | 0.72103 |
5103ce5a77c8e8d29d92c5dd654ec1e4c2a90896 | 6,979 | py | Python | examples/contrib/gp/sv-dkl.py | fehiepsi/pyro | c2a88c3c3c2ff58802026377c08be7f7c8e59785 | [
"MIT"
] | null | null | null | examples/contrib/gp/sv-dkl.py | fehiepsi/pyro | c2a88c3c3c2ff58802026377c08be7f7c8e59785 | [
"MIT"
] | 1 | 2017-12-15T14:01:01.000Z | 2017-12-17T03:09:06.000Z | examples/contrib/gp/sv-dkl.py | fehiepsi/pyro | c2a88c3c3c2ff58802026377c08be7f7c8e59785 | [
"MIT"
] | null | null | null | """
An example to use Gaussian Process (GP) module to classify MNIST. Follow the idea
from reference [1], we will combine a convolutional neural network with a RBF kernel
to create a "deep" kernel. Then we train a SparseVariationalGP model using SVI. Note
that the model is trained end-to-end in mini-batch.
With defaul... | 43.893082 | 99 | 0.622152 |
acf179ff5d99bf7448a00e61737a029c826e656f | 3,333 | py | Python | src/unv/deploy/components/app/__init__.py | c137digital/unv_deploy | 7cb8e6902f4b3eff7e095f83e71d10582f023ab9 | [
"MIT"
] | null | null | null | src/unv/deploy/components/app/__init__.py | c137digital/unv_deploy | 7cb8e6902f4b3eff7e095f83e71d10582f023ab9 | [
"MIT"
] | null | null | null | src/unv/deploy/components/app/__init__.py | c137digital/unv_deploy | 7cb8e6902f4b3eff7e095f83e71d10582f023ab9 | [
"MIT"
] | null | null | null | import asyncio
from pathlib import Path
from typing import Generator
from watchgod import awatch
from ...tasks import DeployTasks, nohost, register
from ...settings import DeployComponentSettings
from ..systemd import SystemdTasksMixin
class AppSettings(DeployComponentSettings):
NAME = 'app'
SCHEMA = {
... | 28.008403 | 73 | 0.533753 |
807d0a01a46ffbd00440a5c498d0682c7d537cdc | 3,446 | py | Python | lib/python/frugal/tests/gae/server/test_webapp2_handler.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 144 | 2017-08-17T15:51:58.000Z | 2022-01-14T21:36:55.000Z | lib/python/frugal/tests/gae/server/test_webapp2_handler.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 930 | 2017-08-17T17:53:30.000Z | 2022-03-28T14:04:49.000Z | lib/python/frugal/tests/gae/server/test_webapp2_handler.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 77 | 2017-08-17T15:54:31.000Z | 2021-12-25T15:18:34.000Z | # Copyright 2017 Workiva
# 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
#... | 41.02381 | 77 | 0.676146 |
374d51f5f0b88f07e77e4d9374be85d7bf14ffdf | 1,425 | py | Python | preprocess/video.py | NTHU-CVLab/ActivityProps | 68392fb38d87afdc92f6f054e83e9166121401a5 | [
"Apache-2.0"
] | 1 | 2017-10-31T15:36:55.000Z | 2017-10-31T15:36:55.000Z | preprocess/video.py | NTHU-CVLab/ActivityProps | 68392fb38d87afdc92f6f054e83e9166121401a5 | [
"Apache-2.0"
] | null | null | null | preprocess/video.py | NTHU-CVLab/ActivityProps | 68392fb38d87afdc92f6f054e83e9166121401a5 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
from scipy.misc import imresize
class Video:
def __init__(self, path):
self.path = path
self.cap = cv2.VideoCapture(self.path)
self.frames = None
def __enter__(self):
if not self.cap.isOpened():
raise Exception('Cannot open video: {}'... | 24.568966 | 80 | 0.569825 |
cd99b818f93e31d49ef01ce8a00e530ea6da7233 | 3,031 | py | Python | toolchain/riscv/MSYS/python/Lib/test/time_hashlib.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 207 | 2018-10-01T08:53:01.000Z | 2022-03-14T12:15:54.000Z | toolchain/riscv/MSYS/python/Lib/test/time_hashlib.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 8 | 2019-06-29T14:18:51.000Z | 2022-02-19T07:30:27.000Z | toolchain/riscv/MSYS/python/Lib/test/time_hashlib.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 53 | 2019-03-12T16:50:21.000Z | 2022-03-15T23:16:18.000Z | # It's intended that this script be run by hand. It runs speed tests on
# hashlib functions; it does not test for correctness.
import sys
import time
import hashlib
def creatorFunc():
raise RuntimeError("eek, creatorFunc not overridden")
def test_scaled_msg(scale, name):
iterations = 106201//sc... | 34.05618 | 92 | 0.649291 |
429973bbdb851c6a56f3b3e80eb5c9cf8419312c | 625 | py | Python | personal/Tommaso/Scripts/pos_example.py | edervishaj/spotify-recsys-challenge | 4077201ac7e4ed9da433bd10a92c183614182437 | [
"Apache-2.0"
] | 3 | 2018-10-12T20:19:57.000Z | 2019-12-11T01:11:38.000Z | personal/Tommaso/Scripts/pos_example.py | kiminh/spotify-recsys-challenge | 5e7844a77ce3c26658400f161d2d74d682f30e69 | [
"Apache-2.0"
] | null | null | null | personal/Tommaso/Scripts/pos_example.py | kiminh/spotify-recsys-challenge | 5e7844a77ce3c26658400f161d2d74d682f30e69 | [
"Apache-2.0"
] | 4 | 2018-10-27T20:30:18.000Z | 2020-10-14T07:43:27.000Z | import sys
from scipy import sparse
import numpy as np
import utils.pre_processing as pre
from utils.definitions import *
from utils.datareader import Datareader
from utils.evaluator import Evaluator
from utils.pre_processing import *
from utils.post_processing import *
from fast_import import *
dr = Datareader(mode='... | 25 | 66 | 0.7888 |
74fbf84065944b7c89e6e425dee26346b6f93983 | 3,539 | py | Python | src/richie/apps/courses/models/role.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | src/richie/apps/courses/models/role.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | src/richie/apps/courses/models/role.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | """
Declare and configure the models for the courses application
"""
from django.contrib.auth.models import Group
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.api import Page
from filer.models import Folder
from ..defaults import ROLE_CHOICES
class PageRole(models.Mo... | 33.386792 | 96 | 0.604973 |
c4acd2c57e4dda34d235bfde736d1de8ea32b6e2 | 1,501 | py | Python | pelicanconf.py | hatdropper1977/john.sobanski.io | 78c42e7b8976816b25df2ff4a31ca8e4f33146a6 | [
"Apache-2.0"
] | null | null | null | pelicanconf.py | hatdropper1977/john.sobanski.io | 78c42e7b8976816b25df2ff4a31ca8e4f33146a6 | [
"Apache-2.0"
] | null | null | null | pelicanconf.py | hatdropper1977/john.sobanski.io | 78c42e7b8976816b25df2ff4a31ca8e4f33146a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
SITENAME = 'Coins N\' Clouds'
SITEURL = 'https://john.sobanski.io'
#SITEURL = 'http://52.54.218.55:8000'
#HEADER_COVER = 'images/sobanski.jpg'
COLOR_SCHEME_CSS = 'monokai.css'
PATH = 'content'
TIMEZONE = 'America/New_York'
DEFAU... | 31.270833 | 283 | 0.65956 |
294e873142e897d5300de0ba2ed163761dd01aeb | 3,866 | py | Python | disco/postprocess/plots.py | NREL/disco | 19afa1c397c6c24e37222f6cbf027eb88833beda | [
"BSD-3-Clause"
] | 2 | 2022-03-11T20:04:34.000Z | 2022-03-14T22:25:29.000Z | disco/postprocess/plots.py | NREL/disco | 19afa1c397c6c24e37222f6cbf027eb88833beda | [
"BSD-3-Clause"
] | 4 | 2022-03-11T17:48:50.000Z | 2022-03-17T21:39:47.000Z | disco/postprocess/plots.py | NREL/disco | 19afa1c397c6c24e37222f6cbf027eb88833beda | [
"BSD-3-Clause"
] | null | null | null | import logging
import os
import sys
import pandas as pd
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
def plot_voltage(output_dir, scenario=None):
"""
Create 3 plots based on the first feeder,
1. compare voltage primary and secondary.
2. compare pf1 and volt-var
3. heatma... | 32.216667 | 102 | 0.65701 |
7e72178e419bccd22e473e396ac8e4e5040ac4c2 | 9,845 | py | Python | brainite/utils.py | neurospin-deepinsight/brainite | 18aafe5d1522f1a4a4081d43f120464afe6cd0a7 | [
"CECILL-B"
] | null | null | null | brainite/utils.py | neurospin-deepinsight/brainite | 18aafe5d1522f1a4a4081d43f120464afe6cd0a7 | [
"CECILL-B"
] | null | null | null | brainite/utils.py | neurospin-deepinsight/brainite | 18aafe5d1522f1a4a4081d43f120464afe6cd0a7 | [
"CECILL-B"
] | 1 | 2021-09-16T08:29:19.000Z | 2021-09-16T08:29:19.000Z | # -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2021
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... | 39.697581 | 79 | 0.653022 |
92a2b1e4f5445217fa03131db6d7262bce62a5cf | 4,055 | py | Python | delivery/delivery/ext/auth/controller.py | raiizoor/Web-delivery | 67a61c9d5c31cb25b6090128f374adc18e2d541d | [
"Unlicense"
] | null | null | null | delivery/delivery/ext/auth/controller.py | raiizoor/Web-delivery | 67a61c9d5c31cb25b6090128f374adc18e2d541d | [
"Unlicense"
] | 3 | 2021-02-11T02:31:31.000Z | 2021-12-29T22:13:18.000Z | delivery/delivery/ext/auth/controller.py | raiizoor/Web-delivery | 67a61c9d5c31cb25b6090128f374adc18e2d541d | [
"Unlicense"
] | 1 | 2021-01-20T20:23:12.000Z | 2021-01-20T20:23:12.000Z | import os
import click
import cv2
import numpy as np
import warnings
from flask import redirect, url_for
from flask_login import current_user
from werkzeug.security import generate_password_hash
from werkzeug.utils import secure_filename
from flask import current_app as app
from delivery.ext.db.models import User, Cat... | 25.34375 | 122 | 0.664365 |
b7ddefcd720fd0e7f2ab3afb08240314a7fe618d | 3,226 | py | Python | tutorial/tutotrial/settings.py | aiueocode/djangorest | fa408050a44d58e47929b4183c89bb6b5890702e | [
"BSD-3-Clause"
] | null | null | null | tutorial/tutotrial/settings.py | aiueocode/djangorest | fa408050a44d58e47929b4183c89bb6b5890702e | [
"BSD-3-Clause"
] | null | null | null | tutorial/tutotrial/settings.py | aiueocode/djangorest | fa408050a44d58e47929b4183c89bb6b5890702e | [
"BSD-3-Clause"
] | null | null | null | """
Django settings for tutotrial project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib... | 25.401575 | 91 | 0.699628 |
c870581096484aea2e288fd30d459497ffa189d3 | 2,369 | py | Python | pygoogle/src/google.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | pygoogle/src/google.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | pygoogle/src/google.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python3
#coding:utf-8
from googlesearch import search
import time
from datetime import datetime
import argparse
import os
import requests
banner = '''
\033[1;96m dP""b8 \033[1;91m dP"Yb \033[1;93m dP"Yb \033[1;96m dP""b8 \033[1;92m88 \033[1;91m888888\033[00m
\033[1;96mdP ... | 33.366197 | 126 | 0.55382 |
32871b18de390e2612dc77a309757246c5768a00 | 14,685 | py | Python | library/iworkflow_service_template.py | Larsende/f5_ansible | 93b0747ba663128e2c8dfc456dad4653cdde4f38 | [
"Apache-2.0"
] | 12 | 2016-12-29T16:09:21.000Z | 2019-06-29T14:12:17.000Z | library/iworkflow_service_template.py | Larsende/f5_ansible | 93b0747ba663128e2c8dfc456dad4653cdde4f38 | [
"Apache-2.0"
] | 24 | 2017-05-24T07:56:56.000Z | 2017-11-30T09:31:56.000Z | library/iworkflow_service_template.py | Larsende/f5_ansible | 93b0747ba663128e2c8dfc456dad4653cdde4f38 | [
"Apache-2.0"
] | 26 | 2017-05-31T17:15:32.000Z | 2021-03-29T03:45:06.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'status': ['preview'],
'supp... | 31.512876 | 93 | 0.573647 |
91e41d06f430a7c3d2c150abee5bd2db3ab25c2d | 2,836 | py | Python | ros/src/tl_detector/light_classification/tl_classifier.py | toonday/CarND-Capstone | 467ce65c761f552511588987f573e32d4ee135ca | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | toonday/CarND-Capstone | 467ce65c761f552511588987f573e32d4ee135ca | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | toonday/CarND-Capstone | 467ce65c761f552511588987f573e32d4ee135ca | [
"MIT"
] | null | null | null | import rospy
import numpy as np
import tensorflow as tf
from styx_msgs.msg import TrafficLight
class TLClassifier(object):
def __init__(self, file_path):
#TODO load classifier
self.classifier_model = tf.Graph()
self.min_score_threshold = 0.5
with self.classifier_model.as_default():
... | 44.3125 | 92 | 0.599788 |
806c9f33da63d55d8e9794a74beeb643f273eb56 | 3,156 | py | Python | sap/cli/strust.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | 42 | 2019-01-16T13:16:09.000Z | 2022-03-23T20:13:00.000Z | sap/cli/strust.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | 59 | 2019-02-23T07:16:56.000Z | 2022-02-28T09:34:47.000Z | sap/cli/strust.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | 22 | 2019-03-12T08:15:44.000Z | 2022-01-10T03:56:47.000Z | """
Uploads X.509 Base64 certificates into SAP to enable SSL peer verification
of remote servers
"""
import logging
import sap.cli.core
from sap.errors import SAPCliError
from sap.rfc.strust import (
SSLCertStorage,
CLIENT_ANONYMOUS,
CLIENT_STANDART,
IDENTITY_MAPPING,
Identity,
notify_icm_chan... | 34.304348 | 120 | 0.648289 |
3272849c65cc2905a1f8a96d48f3d6840221c4d3 | 4,612 | py | Python | parl/plutils/common.py | awesome-archive/PARL | 7a7583ab6ff2371a190c683386e0103b91cf0903 | [
"Apache-2.0"
] | 1 | 2019-01-18T10:01:40.000Z | 2019-01-18T10:01:40.000Z | parl/plutils/common.py | JerryMAzhaizhai/PARL | 7a7583ab6ff2371a190c683386e0103b91cf0903 | [
"Apache-2.0"
] | null | null | null | parl/plutils/common.py | JerryMAzhaizhai/PARL | 7a7583ab6ff2371a190c683386e0103b91cf0903 | [
"Apache-2.0"
] | null | null | null | # 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... | 34.41791 | 102 | 0.665004 |
1c7457f44779f81fd2a29a21d4a209095000a627 | 665 | py | Python | sharpy-sc2/sharpy/managers/combat2/protoss/__init__.py | etzhang416/sharpy-bot-eco | badc68ad1aa903dfa1bbc33f6225608e433ff353 | [
"Unlicense"
] | null | null | null | sharpy-sc2/sharpy/managers/combat2/protoss/__init__.py | etzhang416/sharpy-bot-eco | badc68ad1aa903dfa1bbc33f6225608e433ff353 | [
"Unlicense"
] | null | null | null | sharpy-sc2/sharpy/managers/combat2/protoss/__init__.py | etzhang416/sharpy-bot-eco | badc68ad1aa903dfa1bbc33f6225608e433ff353 | [
"Unlicense"
] | null | null | null | from .micro_stalkers import MicroStalkers
from .micro_zealots import MicroZealots
from .micro_carriers import MicroCarriers
from .micro_colossi import MicroColossi
from .micro_adepts import MicroAdepts
from .micro_voidrays import MicroVoidrays
from .micro_disruptor import MicroDisruptor, MicroPurificationNova
from .mic... | 41.5625 | 66 | 0.884211 |
02560728918e83670ec8d88d9fd19f62ed3cbdeb | 4,577 | py | Python | ego/decomposition/positive_and_negative.py | fabriziocosta/EGO | d89e88183cce1ff24dca9333c09fa11597a45c7a | [
"MIT"
] | null | null | null | ego/decomposition/positive_and_negative.py | fabriziocosta/EGO | d89e88183cce1ff24dca9333c09fa11597a45c7a | [
"MIT"
] | null | null | null | ego/decomposition/positive_and_negative.py | fabriziocosta/EGO | d89e88183cce1ff24dca9333c09fa11597a45c7a | [
"MIT"
] | 1 | 2022-01-24T09:53:20.000Z | 2022-01-24T09:53:20.000Z | #!/usr/bin/env python
"""Provides scikit interface."""
from toolz import curry
import numpy as np
from ego.component import GraphComponent, serialize, get_subgraphs_from_node_components
@curry
def positive_and_negative(graph, ktop=0, part_importance_estimator=None):
codes, fragments = part_importance_estimator.... | 36.616 | 93 | 0.719685 |
191d316998efc51b58e4c3b28b3d0075ed32d996 | 739 | py | Python | webfront/migrations/0009_entry_annotation_changes.py | ProteinsWebTeam/project-skeleton | 7aeb971ba2d9bfe272e0590bd4484afb61336b96 | [
"Apache-2.0"
] | 6 | 2020-05-25T17:35:52.000Z | 2022-03-26T00:45:55.000Z | webfront/migrations/0009_entry_annotation_changes.py | ProteinsWebTeam/project-skeleton | 7aeb971ba2d9bfe272e0590bd4484afb61336b96 | [
"Apache-2.0"
] | 76 | 2016-07-29T09:22:34.000Z | 2022-03-15T07:57:17.000Z | webfront/migrations/0009_entry_annotation_changes.py | ProteinsWebTeam/project-skeleton | 7aeb971ba2d9bfe272e0590bd4484afb61336b96 | [
"Apache-2.0"
] | 1 | 2017-04-09T20:08:30.000Z | 2017-04-09T20:08:30.000Z | # Generated by Django 3.0.7 on 2020-06-08 10:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("webfront", "0008_dw_changes")]
operations = [
migrations.AddField(
model_name="entryannotation",
... | 26.392857 | 61 | 0.571042 |
4ac4555387ed45d39e58c9e1a606ae16e1df94d1 | 3,055 | py | Python | tests/api/test_api_init.py | scailfin/benchmark-engine | 7ee5a841c1de873e8cafe2f10da4a23652395f29 | [
"MIT"
] | null | null | null | tests/api/test_api_init.py | scailfin/benchmark-engine | 7ee5a841c1de873e8cafe2f10da4a23652395f29 | [
"MIT"
] | null | null | null | tests/api/test_api_init.py | scailfin/benchmark-engine | 7ee5a841c1de873e8cafe2f10da4a23652395f29 | [
"MIT"
] | null | null | null | """Test initializing the engine API."""
import os
import shutil
from unittest import TestCase
from benchengine.api.base import EngineApi
from benchengine.api.route import UrlFactory
from benchengine.db import DatabaseDriver
import benchengine.api.serialize.hateoas as hateoas
import benchengine.api.serialize.labels ... | 38.1875 | 79 | 0.686416 |
d821e00d7afef158af284991512d88c38669904b | 169 | py | Python | ex007.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex007.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex007.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | nota1 = float(input('Primeira nota do aluno: '))
nota2 = float(input('Segunda nota do aluno: '))
print(f'A média entre {nota1} e {nota2} é {(nota1 + nota2) / 2 :.1f}.')
| 42.25 | 71 | 0.64497 |
14b55c5265f9b3652dbb1e5ef4307b3bf3f71ac8 | 430 | py | Python | app/core/migrations/0005_recipe_image.py | ezmani/recipe-app-api | 68771472a2f0f4756f282075c34601f25053ea4a | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | ezmani/recipe-app-api | 68771472a2f0f4756f282075c34601f25053ea4a | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | ezmani/recipe-app-api | 68771472a2f0f4756f282075c34601f25053ea4a | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-28 12:45
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.5 | 93 | 0.62093 |
80b04bae505544650b6310b9ebdc29d9b6597e71 | 579 | py | Python | aws_mock/requests/create_security_group.py | enaydanov/aws_mock | 4ad3dca270ad164693e85741d5e92f845c34aa01 | [
"Apache-2.0"
] | null | null | null | aws_mock/requests/create_security_group.py | enaydanov/aws_mock | 4ad3dca270ad164693e85741d5e92f845c34aa01 | [
"Apache-2.0"
] | 1 | 2021-10-21T21:06:29.000Z | 2021-10-21T21:06:29.000Z | aws_mock/requests/create_security_group.py | bentsi/aws_mock | d6c1b963e02b4cd3602722e7135f4d65f6a71d3e | [
"Apache-2.0"
] | 1 | 2021-11-08T14:20:36.000Z | 2021-11-08T14:20:36.000Z | import logging
from aws_mock.lib import get_collection_by_resource_id, generate_resource_id, aws_response
LOGGER = logging.getLogger(__name__)
@aws_response
def create_security_group(group_name: str) -> dict:
security_group_id = generate_resource_id(resource_type="sg")
LOGGER.debug("Add security group `%s... | 28.95 | 90 | 0.756477 |
fbeb36d5bc60238255c779cae8e8ed35dbbc7679 | 4,025 | py | Python | launchpad/examples/consumer_producers/launch.py | leloykun/launchpad | f591b5931cbba89bc94050a126d86cd1bda312f5 | [
"Apache-2.0"
] | 1 | 2021-05-02T22:03:23.000Z | 2021-05-02T22:03:23.000Z | launchpad/examples/consumer_producers/launch.py | leloykun/launchpad | f591b5931cbba89bc94050a126d86cd1bda312f5 | [
"Apache-2.0"
] | null | null | null | launchpad/examples/consumer_producers/launch.py | leloykun/launchpad | f591b5931cbba89bc94050a126d86cd1bda312f5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 DeepMind Technologies Limited. 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 ... | 32.723577 | 80 | 0.71205 |
c83996c39f42a1e149d875dccfe384937f607f11 | 5,146 | py | Python | alf/networks/network_test.py | www2171668/alf | 6e3731fc559d3b4e6b5b9ed6251fff728a560d64 | [
"Apache-2.0"
] | null | null | null | alf/networks/network_test.py | www2171668/alf | 6e3731fc559d3b4e6b5b9ed6251fff728a560d64 | [
"Apache-2.0"
] | null | null | null | alf/networks/network_test.py | www2171668/alf | 6e3731fc559d3b4e6b5b9ed6251fff728a560d64 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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... | 36.239437 | 80 | 0.662456 |
6ba28e55bee6223a9b51ff38bf41be9d34c01e6d | 558 | py | Python | src/canisterpy/errors.py | cnstr/canister.py | c383cf1b8feb2d604dc0fa42933822b84ead83ad | [
"Apache-2.0"
] | 4 | 2022-01-14T01:15:22.000Z | 2022-01-14T13:58:32.000Z | src/canisterpy/errors.py | cnstr/canister.py | c383cf1b8feb2d604dc0fa42933822b84ead83ad | [
"Apache-2.0"
] | null | null | null | src/canisterpy/errors.py | cnstr/canister.py | c383cf1b8feb2d604dc0fa42933822b84ead83ad | [
"Apache-2.0"
] | 2 | 2022-02-18T04:01:58.000Z | 2022-03-13T19:32:58.000Z | '''Defines all error types for canister.py.'''
# errors.py
class ClosedError(Exception):
'''Error thrown when a client is trying to be used after it is closed..'''
pass
class InitializationError(Exception):
'''Error thrown when something goes wrong with the initialization of the Canister class.'''
pas... | 31 | 95 | 0.724014 |
1621d63a2d7c1d7a8ee1385a2b8f50df086d7a31 | 141,153 | py | Python | IA_tool/views.py | HN-Le/Impact-Assessment-Tool | 564fe45f3dd3382237ec8dd32758db266dfcf32e | [
"MIT"
] | null | null | null | IA_tool/views.py | HN-Le/Impact-Assessment-Tool | 564fe45f3dd3382237ec8dd32758db266dfcf32e | [
"MIT"
] | null | null | null | IA_tool/views.py | HN-Le/Impact-Assessment-Tool | 564fe45f3dd3382237ec8dd32758db266dfcf32e | [
"MIT"
] | null | null | null |
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
from . import widgets as w
from . import constants as c
import os
import webbrowser
from tkinter.scrolledtext import ScrolledText
class ProjectPurposeScreen(tk.Frame):
def __init__(self):
tk.Frame.__init__(self)
self.p... | 47.638542 | 188 | 0.466033 |
4317303d48d6875960d8793e612ca745361d9f64 | 1,678 | py | Python | var/spack/repos/builtin/packages/cereal/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/cereal/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/cereal/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 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 Cereal(CMakePackage):
"""cereal is a header-only C++11 serialization library. cereal takes... | 38.136364 | 76 | 0.684744 |
31394ab41a95cb1f416b7464d4bf7ef3df74943f | 3,818 | py | Python | assignment4/run_experiment.py | fbrubacher/assignment23 | 007e3d54a58f1654137c177af6095ce64724471c | [
"MIT"
] | 148 | 2018-12-18T21:14:04.000Z | 2022-03-04T09:13:21.000Z | assignment4/run_experiment.py | fbrubacher/assignment23 | 007e3d54a58f1654137c177af6095ce64724471c | [
"MIT"
] | 22 | 2019-01-20T00:11:06.000Z | 2021-05-01T17:21:58.000Z | assignment4/run_experiment.py | fbrubacher/assignment23 | 007e3d54a58f1654137c177af6095ce64724471c | [
"MIT"
] | 172 | 2019-01-09T06:01:54.000Z | 2022-03-25T22:53:19.000Z | import argparse
from datetime import datetime
import logging
import random as rand
import numpy as np
import environments
import experiments
from experiments import plotting
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.ge... | 36.361905 | 113 | 0.63934 |
ffdde4590b7ca7db6d5b6ca73cc0f5e2cb629a0b | 1,451 | py | Python | tests/test_config.py | iliadmitriev/auth-fapi | a219efd5a8daa9d5f876355cde6b974021ca7890 | [
"MIT"
] | null | null | null | tests/test_config.py | iliadmitriev/auth-fapi | a219efd5a8daa9d5f876355cde6b974021ca7890 | [
"MIT"
] | 131 | 2021-09-29T06:07:18.000Z | 2022-03-31T08:29:30.000Z | tests/test_config.py | iliadmitriev/auth-fapi | a219efd5a8daa9d5f876355cde6b974021ca7890 | [
"MIT"
] | null | null | null | import importlib
import os
from unittest import mock
def test_import_config():
with mock.patch.dict(os.environ, {
'DATABASE_NAME': 'database',
'DATABASE_USER': 'user',
'DATABASE_PASSWORD': 'pass',
'DATABASE_HOST': 'host',
'DATABASE_PORT': '5432',
'DATABASE_DRIVER': ... | 31.543478 | 93 | 0.643694 |
bca1d723a2e0d6ef4c2039b822cce2b0b260f383 | 376 | py | Python | asyncfileserver/model/confirm_command.py | tarc/echo_server | 3517778b97f13bce47ef8c7fb919e9f0925f4784 | [
"MIT"
] | 1 | 2021-05-02T03:49:20.000Z | 2021-05-02T03:49:20.000Z | asyncfileserver/model/confirm_command.py | tarc/echo_server | 3517778b97f13bce47ef8c7fb919e9f0925f4784 | [
"MIT"
] | 20 | 2020-03-30T00:00:27.000Z | 2022-01-21T19:12:16.000Z | asyncfileserver/model/confirm_command.py | tarc/echo_server | 3517778b97f13bce47ef8c7fb919e9f0925f4784 | [
"MIT"
] | null | null | null | import re
class ConfirmCommand(object):
_pattern = re.compile(b'\W')
def __init__(self, data: bytearray):
self._data = self._format(data)
def go_on(self):
return self._data == b"C"
def yes(self):
return self._data == b"Y"
def _format(self, data):
upper = data.up... | 19.789474 | 49 | 0.587766 |
9e6efbdb1ba8e3dda89b4b6c878ff73bbca83450 | 1,389 | py | Python | setup.py | miesli/mopidy-mqtt | 5442d3b371f225c4fc981bb095485d6639bea46f | [
"Apache-2.0"
] | 16 | 2017-11-19T13:54:20.000Z | 2021-02-02T09:52:02.000Z | setup.py | miesli/mopidy-mqtt | 5442d3b371f225c4fc981bb095485d6639bea46f | [
"Apache-2.0"
] | 7 | 2017-11-21T14:43:37.000Z | 2020-09-20T08:46:52.000Z | setup.py | miesli/mopidy-mqtt | 5442d3b371f225c4fc981bb095485d6639bea46f | [
"Apache-2.0"
] | 16 | 2017-08-30T20:30:22.000Z | 2021-01-15T21:54:28.000Z | # future imports
from __future__ import unicode_literals
# stdlib imports
import re
from setuptools import find_packages
from setuptools import setup
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
se... | 26.207547 | 68 | 0.605472 |
0fde0a78b7c99fb2fe6c5facff75c3300ddc00ab | 10,812 | py | Python | fluid/PaddleCV/object_detection/main_quant.py | JiabinYang/models | 2c4a77ed79a18844a38b0bf19d6a92d16ce7eda3 | [
"Apache-2.0"
] | null | null | null | fluid/PaddleCV/object_detection/main_quant.py | JiabinYang/models | 2c4a77ed79a18844a38b0bf19d6a92d16ce7eda3 | [
"Apache-2.0"
] | null | null | null | fluid/PaddleCV/object_detection/main_quant.py | JiabinYang/models | 2c4a77ed79a18844a38b0bf19d6a92d16ce7eda3 | [
"Apache-2.0"
] | null | null | null | import os
import time
import numpy as np
import argparse
import functools
import shutil
import math
import paddle
import paddle.fluid as fluid
import reader
from mobilenet_ssd import mobile_net
from utility import add_arguments, print_arguments
from train import build_program
from train import train_parameters
from in... | 38.340426 | 125 | 0.641602 |
6f99682ff9425be9de7808f408037d8f53e75868 | 281 | py | Python | detector/utils/bbox/setup.py | AnandK27/English_OCR | 136e4ccf69f8162787f5002c1f989c76f8785217 | [
"MIT"
] | null | null | null | detector/utils/bbox/setup.py | AnandK27/English_OCR | 136e4ccf69f8162787f5002c1f989c76f8785217 | [
"MIT"
] | null | null | null | detector/utils/bbox/setup.py | AnandK27/English_OCR | 136e4ccf69f8162787f5002c1f989c76f8785217 | [
"MIT"
] | null | null | null | from distutils.core import setup
import setuptools
import numpy as np
from Cython.Build import cythonize
numpy_include = np.get_include()
setup(ext_modules=cythonize("bbox.pyx"), include_dirs=[numpy_include])
setup(ext_modules=cythonize("nms.pyx"), include_dirs=[numpy_include])
| 31.222222 | 70 | 0.811388 |
1c382f14053fc6ec2c7e73bebc1a8bdd0037777f | 333 | py | Python | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 08:37:19 2020
@author: nmei
"""
import os
import gc
from glob import glob
from tqdm import tqdm
import numpy as np
import pandas as pd
import seaborn as sns
working_dir = '../stability'
working_data = glob(os.path.join(working_dir,'*','stabil... | 15.136364 | 67 | 0.6997 |
4e29b93460cf8c57db12b873e398cd2f37a73df2 | 1,809 | py | Python | tutorial.py | Harsha470007/PIZZA2 | 73e146af9a233c0b4be13436c2ad566980a0062d | [
"MIT"
] | 1 | 2020-09-30T09:35:45.000Z | 2020-09-30T09:35:45.000Z | tutorial.py | Harsha470007/PIZZA2 | 73e146af9a233c0b4be13436c2ad566980a0062d | [
"MIT"
] | null | null | null | tutorial.py | Harsha470007/PIZZA2 | 73e146af9a233c0b4be13436c2ad566980a0062d | [
"MIT"
] | null | null | null | from pizzapy import Customer, StoreLocator, Order, ConsoleInput
def searchMenu(menu):
print("You are now searching the menu...")
item = input("Type an item to look for: ").strip().lower()
if len(item) > 1:
item = item[0].upper() + item[1:]
print(f"Results for: {item}\n")
menu.search(Name=item)
print()
el... | 24.445946 | 80 | 0.678275 |
3391eff2fe0f0ea6b285fd4fabf567edc5dfa932 | 949 | py | Python | ReSpider/extend/redis/spider.py | zaoxg/ReSpiderFramework | bd49ffb79867f5cd0eceb5f820498fbbf8611a60 | [
"MIT"
] | 1 | 2022-03-27T15:03:36.000Z | 2022-03-27T15:03:36.000Z | ReSpider/extend/redis/spider.py | zaoxg/ReSpiderFramework | bd49ffb79867f5cd0eceb5f820498fbbf8611a60 | [
"MIT"
] | null | null | null | ReSpider/extend/redis/spider.py | zaoxg/ReSpiderFramework | bd49ffb79867f5cd0eceb5f820498fbbf8611a60 | [
"MIT"
] | null | null | null | import ReSpider.setting as setting
from ReSpider.core.spiders import Crawler
# from ...extend import SettingLoader
class RedisSpider(Crawler):
"""
redis spider
实现一个函数用来解析队列的任务
"""
name = 'redis_spider'
redis_key = None
# settings = SettingLoader.from_crawler()
def __init__(self, redis... | 24.333333 | 76 | 0.632244 |
dd3c974659b437c58ece18079bdbb8679c257fab | 320 | py | Python | challenge_1/python/hkl0902/challenge_1.py | rchicoli/2017-challenges | 44f0b672e5dea34de1dde131b6df837d462f8e29 | [
"Apache-2.0"
] | 271 | 2017-01-01T22:58:36.000Z | 2021-11-28T23:05:29.000Z | challenge_1/python/hkl0902/challenge_1.py | AakashOfficial/2017Challenges | a8f556f1d5b43c099a0394384c8bc2d826f9d287 | [
"Apache-2.0"
] | 283 | 2017-01-01T23:26:05.000Z | 2018-03-23T00:48:55.000Z | challenge_1/python/hkl0902/challenge_1.py | AakashOfficial/2017Challenges | a8f556f1d5b43c099a0394384c8bc2d826f9d287 | [
"Apache-2.0"
] | 311 | 2017-01-01T22:59:23.000Z | 2021-09-23T00:29:12.000Z | import sys
'''
Given a string S, returns the reverse of S
'''
def reverse(s):
r = ""
for i in range(len(s)):
r += s[len(s) - i - 1]
return r
if __name__ == "__main__":
args = sys.argv
if len(args) > 1:
print(reverse(args[1]))
else:
print("Give me string to reverse")
| 15.238095 | 42 | 0.53125 |
a3451ec3e47c95fa42334794a9e5c5191155cec0 | 629 | py | Python | everscan.py | kkerwin1/everscan | 413012ceee22be1580fcf552fbb25def0aed32f0 | [
"BSD-2-Clause"
] | null | null | null | everscan.py | kkerwin1/everscan | 413012ceee22be1580fcf552fbb25def0aed32f0 | [
"BSD-2-Clause"
] | null | null | null | everscan.py | kkerwin1/everscan | 413012ceee22be1580fcf552fbb25def0aed32f0 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# everscan/everscan.py
from modules.scanning import ScanningManager
from modules.evernote import EvernoteManager
from modules.interface import InterfaceManager
from modules.imaging import ImagingManager
class EverscanMaster:
"""
Everscan master class.
Facilitates communicati... | 31.45 | 52 | 0.710652 |
db2688e607c06244ffd31b8c5864347ba4c3c0b5 | 3,070 | py | Python | migrations/versions/a22bbe42b9e3_migrate_model_classes.py | Munene19/IP9-Pitch | 840e8f1ecf42f39f0467d875f35402c8eaeb5d28 | [
"MIT"
] | null | null | null | migrations/versions/a22bbe42b9e3_migrate_model_classes.py | Munene19/IP9-Pitch | 840e8f1ecf42f39f0467d875f35402c8eaeb5d28 | [
"MIT"
] | null | null | null | migrations/versions/a22bbe42b9e3_migrate_model_classes.py | Munene19/IP9-Pitch | 840e8f1ecf42f39f0467d875f35402c8eaeb5d28 | [
"MIT"
] | null | null | null | """migrate model classes
Revision ID: a22bbe42b9e3
Revises:
Create Date: 2020-01-17 08:48:32.493810
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a22bbe42b9e3'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands a... | 36.117647 | 72 | 0.656678 |
43be48b36f185b6ac2c7df31394a8b771e9dc49b | 1,813 | py | Python | moto/cloudwatch/models.py | EvaSDK/moto | 8095f31772fb144f2045c0991f4c8ed17f324b91 | [
"Apache-2.0"
] | null | null | null | moto/cloudwatch/models.py | EvaSDK/moto | 8095f31772fb144f2045c0991f4c8ed17f324b91 | [
"Apache-2.0"
] | null | null | null | moto/cloudwatch/models.py | EvaSDK/moto | 8095f31772fb144f2045c0991f4c8ed17f324b91 | [
"Apache-2.0"
] | null | null | null | from moto.core import BaseBackend
class Dimension(object):
def __init__(self, name, value):
self.name = name
self.value = value
class FakeAlarm(object):
def __init__(self, name, comparison_operator, evaluation_periods, period,
threshold, statistic, description, dimensions, a... | 35.54902 | 104 | 0.666851 |
1bdb747f5554aba5bb0d63b52d398e4de9694503 | 1,414 | py | Python | experiments/point_cloud/plot_data.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 262 | 2020-07-05T20:57:44.000Z | 2022-03-28T02:24:43.000Z | experiments/point_cloud/plot_data.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 17 | 2020-08-15T05:43:34.000Z | 2022-01-31T12:24:21.000Z | experiments/point_cloud/plot_data.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 35 | 2020-08-24T06:55:37.000Z | 2022-02-11T05:17:58.000Z | import torch
import argparse
# Plot
import matplotlib.pyplot as plt
# Data
from data import get_data, dataset_choices
###########
## Setup ##
###########
parser = argparse.ArgumentParser()
# Data params
parser.add_argument('--dataset', type=str, default='spatial_mnist', choices=dataset_choices)
# Plotting params
... | 25.25 | 115 | 0.647808 |
98501d245fd73160e50418925d438d1cfd3a1dcd | 305 | py | Python | 2017/06/diarrheal-deaths-20170615/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2017/06/diarrheal-deaths-20170615/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2017/06/diarrheal-deaths-20170615/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1Oy7rPtd7qSWXhiUiTytI3OLjZsqO391tepFJXcU7Hzs'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.819672 |
29c1b4fa9862f494c36e34d77f0838a46c20f3ca | 614 | py | Python | dephell_pythons/_constants.py | jayvdb/dephell_pythons | 17afb28bd89652718410998dcd13bfdde9dfd865 | [
"MIT"
] | 2 | 2019-03-20T14:39:55.000Z | 2019-04-21T15:48:36.000Z | dephell_pythons/_constants.py | jayvdb/dephell_pythons | 17afb28bd89652718410998dcd13bfdde9dfd865 | [
"MIT"
] | 4 | 2019-07-24T13:51:09.000Z | 2020-05-28T14:28:14.000Z | dephell_pythons/_constants.py | jayvdb/dephell_pythons | 17afb28bd89652718410998dcd13bfdde9dfd865 | [
"MIT"
] | 3 | 2019-12-19T01:38:56.000Z | 2021-09-28T02:43:43.000Z | # built-in
import os
import platform
IS_WINDOWS = (os.name == 'nt' or platform.system() == 'Windows')
PYTHONS_DEPRECATED = ('2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4')
PYTHONS_POPULAR = ('3.5', '3.6', '3.7')
PYTHONS_UNRELEASED = ('3.8', '4.0')
PYTHONS = PYTHONS_POPULAR + tuple(reversed(PYTHONS_DEPRECATED)) + PY... | 18.606061 | 84 | 0.535831 |
ad7aa2d7a1f4d075711d96766d00f0705e0ab4d2 | 2,334 | py | Python | medet/users/migrations/0016_auto_20210803_1049.py | ayushri117/MEDET | 11941c89a44f9e49939710ad23ff85378b89c5a9 | [
"MIT"
] | null | null | null | medet/users/migrations/0016_auto_20210803_1049.py | ayushri117/MEDET | 11941c89a44f9e49939710ad23ff85378b89c5a9 | [
"MIT"
] | null | null | null | medet/users/migrations/0016_auto_20210803_1049.py | ayushri117/MEDET | 11941c89a44f9e49939710ad23ff85378b89c5a9 | [
"MIT"
] | 1 | 2021-08-07T15:57:40.000Z | 2021-08-07T15:57:40.000Z | # Generated by Django 3.0.6 on 2021-08-03 10:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('users', '0015_auto_20210... | 38.9 | 118 | 0.598543 |
13f9ab762a4b0510561c7b30058c5b7154542047 | 11,072 | py | Python | pyzoo/zoo/examples/orca/learn/tf/ncf/ncf.py | ankitdobhal/analytics-zoo | b8374bcd6c73bba49fe0b0ab075528cdd94cf2af | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/examples/orca/learn/tf/ncf/ncf.py | ankitdobhal/analytics-zoo | b8374bcd6c73bba49fe0b0ab075528cdd94cf2af | [
"Apache-2.0"
] | 1 | 2021-01-20T15:41:01.000Z | 2021-01-20T15:41:01.000Z | pyzoo/zoo/examples/orca/learn/tf/ncf/ncf.py | ankitdobhal/analytics-zoo | b8374bcd6c73bba49fe0b0ab075528cdd94cf2af | [
"Apache-2.0"
] | 1 | 2020-12-21T11:48:49.000Z | 2020-12-21T11:48:49.000Z | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.262411 | 95 | 0.567287 |
3cbb6dbe7c91aa24c7a5d89d627ca321cf84d32a | 1,170 | py | Python | tests/test_authentication_base.py | artreven/fastapi-users | f4fa72328e476a4dbf74c4403572bc1247b1c319 | [
"MIT"
] | null | null | null | tests/test_authentication_base.py | artreven/fastapi-users | f4fa72328e476a4dbf74c4403572bc1247b1c319 | [
"MIT"
] | null | null | null | tests/test_authentication_base.py | artreven/fastapi-users | f4fa72328e476a4dbf74c4403572bc1247b1c319 | [
"MIT"
] | null | null | null | import pytest
from fastapi import Response
from fastapi_users.authentication import BaseAuthentication
@pytest.fixture
def base_authentication():
return BaseAuthentication()
@pytest.mark.authentication
class TestAuthenticate:
@pytest.mark.asyncio
async def test_not_implemented(self, base_authentication... | 30 | 85 | 0.801709 |
fa3a852b41850f154380e24a79c5d071db18bc7e | 16 | py | Python | second.py | woorim960/coding-exam | 02eb16ad4d5d5a989dfa8e9a5c2e76b198788012 | [
"MIT"
] | null | null | null | second.py | woorim960/coding-exam | 02eb16ad4d5d5a989dfa8e9a5c2e76b198788012 | [
"MIT"
] | null | null | null | second.py | woorim960/coding-exam | 02eb16ad4d5d5a989dfa8e9a5c2e76b198788012 | [
"MIT"
] | null | null | null | print("작업한 코드")
| 8 | 15 | 0.625 |
9b516c0641d30ab0248d323e015a04b041b8da22 | 3,954 | py | Python | Questionnaire2/Questionnaire/Api/admin.py | riverstation/project-all | c56f1879e1303d561e95a3ff3a70f94fb5fa2191 | [
"Apache-2.0"
] | 2 | 2020-11-09T06:20:45.000Z | 2021-05-10T07:03:35.000Z | Questionnaire2/Questionnaire/Api/admin.py | riverstation/project-all | c56f1879e1303d561e95a3ff3a70f94fb5fa2191 | [
"Apache-2.0"
] | null | null | null | Questionnaire2/Questionnaire/Api/admin.py | riverstation/project-all | c56f1879e1303d561e95a3ff3a70f94fb5fa2191 | [
"Apache-2.0"
] | 1 | 2020-02-21T09:37:01.000Z | 2020-02-21T09:37:01.000Z | import math
from datetime import datetime
from Api.utils import *
from Api.resources import Rest
from Question.models import *
from Api.decorators import *
class AdminQuestionnaire(Rest):
@admin_required
def get(self,request,*args,**kwargs):
user = request.user
# customer = user.customer
... | 33.794872 | 85 | 0.541224 |
17556efc18e7ff4143a7defe48d7a3cfe0caf292 | 2,691 | py | Python | openpyxl/pivot/tests/test_record.py | CargobaseDev/openpyxl | 782ba90d26be452379fc06f45227e12bca9bade4 | [
"MIT"
] | 1 | 2022-01-02T02:58:03.000Z | 2022-01-02T02:58:03.000Z | openpyxl/pivot/tests/test_record.py | CargobaseDev/openpyxl | 782ba90d26be452379fc06f45227e12bca9bade4 | [
"MIT"
] | 1 | 2022-01-01T15:08:26.000Z | 2022-01-01T15:08:36.000Z | openpyxl/pivot/tests/test_record.py | CargobaseDev/openpyxl | 782ba90d26be452379fc06f45227e12bca9bade4 | [
"MIT"
] | 1 | 2021-04-04T09:38:38.000Z | 2021-04-04T09:38:38.000Z | # Copyright (c) 2010-2021 openpyxl
import pytest
from io import BytesIO
from zipfile import ZipFile
from openpyxl.packaging.manifest import Manifest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
from .test_fields import (
Index,
Number,
Text,
)
@py... | 23.814159 | 92 | 0.528056 |
dbea75a4103c50d9deb6ceb61d81db4d1b4dbb20 | 202 | py | Python | components/mlserve/mlpm/app.py | xzyaoi/AID | 4eef0e261038ffa71552c5dcc55ee5d76b40d3d9 | [
"MIT"
] | null | null | null | components/mlserve/mlpm/app.py | xzyaoi/AID | 4eef0e261038ffa71552c5dcc55ee5d76b40d3d9 | [
"MIT"
] | null | null | null | components/mlserve/mlpm/app.py | xzyaoi/AID | 4eef0e261038ffa71552c5dcc55ee5d76b40d3d9 | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Xiaozhe Yao & AICAMP.CO.,LTD
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
#coding:utf-8
from sanic import Sanic
aidserver = Sanic()
| 20.2 | 50 | 0.732673 |
d20d6db08c57c2d5409145c7a68f9fe3982dec6b | 6,597 | py | Python | tests/lookups/handlers/test_ssm.py | paul-duffy/runway | a0c22eb7ca7b55df5317bdda92c08c4bb39569d2 | [
"Apache-2.0"
] | 1 | 2020-02-25T21:08:00.000Z | 2020-02-25T21:08:00.000Z | tests/lookups/handlers/test_ssm.py | paul-duffy/runway | a0c22eb7ca7b55df5317bdda92c08c4bb39569d2 | [
"Apache-2.0"
] | 2 | 2020-01-07T15:00:55.000Z | 2020-01-07T15:03:25.000Z | tests/lookups/handlers/test_ssm.py | voodooGQ/runway | 8a744f33b39f1342022f1b57db996bb843e4556c | [
"Apache-2.0"
] | null | null | null | """Test runway.lookups.handlers.ssm."""
# pylint: disable=no-self-use,unused-import
import json
from datetime import datetime
import pytest
import yaml
from runway.cfngin.exceptions import FailedVariableLookup
from runway.variables import Variable
def get_parameter_response(name, value, value_type='String', label=N... | 36.65 | 89 | 0.524329 |
4c0618166fff07b4c6d0bed125977a8b6588ef00 | 9,320 | py | Python | tests/aioneo4j/test_driver.py | bbc/rd-cloudfit-python-aiocypher | eb6ce85ee1045ed715bbc4f2b5e033688f7fb5f2 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-11-09T20:48:18.000Z | 2021-11-12T07:45:39.000Z | tests/aioneo4j/test_driver.py | bbc/rd-cloudfit-python-aiocypher | eb6ce85ee1045ed715bbc4f2b5e033688f7fb5f2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/aioneo4j/test_driver.py | bbc/rd-cloudfit-python-aiocypher | eb6ce85ee1045ed715bbc4f2b5e033688f7fb5f2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #
#
# Copyright 2020-21 British Broadcasting Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 37.429719 | 117 | 0.578004 |
5ac3ef800afcdf2182194670858b4bd20e86238e | 33,230 | py | Python | sendgrid/helpers/mail/mail.py | itismichael/sendgrid-python | 09f787662e247f102494ce43091503daecc4f86a | [
"MIT"
] | null | null | null | sendgrid/helpers/mail/mail.py | itismichael/sendgrid-python | 09f787662e247f102494ce43091503daecc4f86a | [
"MIT"
] | 5 | 2020-06-19T05:13:55.000Z | 2022-03-12T00:36:17.000Z | virtual/lib/python3.6/site-packages/sendgrid/helpers/mail/mail.py | rosekairu/KairuBlog | 3a5f737f64b8146ff64aad6e516a1147aecb0363 | [
"MIT"
] | 2 | 2020-06-18T15:41:36.000Z | 2020-06-18T18:29:09.000Z | """Twilio SendGrid v3/mail/send response body builder"""
from .bcc_email import Bcc
from .cc_email import Cc
from .content import Content
from .custom_arg import CustomArg
from .dynamic_template_data import DynamicTemplateData
from .email import Email
from .from_email import From
from .header import Header
from .mime_t... | 33.565657 | 80 | 0.591333 |
b8cb3b8a78780be2ae66c680c345ee12e526f127 | 2,076 | py | Python | klifs_utils/local/kinases.py | volkamerlab/klifs_utils | 3cca66b449ea9999c2687f9b1321faca9b5aa63e | [
"MIT"
] | 6 | 2020-06-23T14:44:25.000Z | 2022-02-25T05:18:38.000Z | klifs_utils/local/kinases.py | hlzfoxcn/klifs_utils | d7fe549e8b66674444c19513af26d661ae157a47 | [
"MIT"
] | 11 | 2020-03-12T13:57:11.000Z | 2021-09-17T18:20:33.000Z | klifs_utils/local/kinases.py | dominiquesydow/klifs_utils | 3cca66b449ea9999c2687f9b1321faca9b5aa63e | [
"MIT"
] | 3 | 2020-04-22T15:45:10.000Z | 2021-01-04T03:30:48.000Z | """
klifs_utils
Utility functions to work with KLIFS data (local)
Kinase details.
"""
def kinase_groups(klifs_metadata):
"""
Get all kinase groups.
Returns
-------
list of str
Kinase group names.
"""
kinase_groups = klifs_metadata.group.unique().tolist()
return kinase_group... | 20.969697 | 118 | 0.63921 |
d4125a6ab01578825f522f40572a7895defc219c | 20,104 | py | Python | hubspot/crm/extensions/accounting/models/accounting_app_urls.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/extensions/accounting/models/accounting_app_urls.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/extensions/accounting/models/accounting_app_urls.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Accounting Extension
These APIs allow you to interact with HubSpot's Accounting Extension. It allows you to: * Specify the URLs that HubSpot will use when making webhook requests to your external accounting system. * Respond to webhook calls made to your external accounting system by HubSp... | 38.88588 | 430 | 0.67499 |
ed8cb385ed41bae75d6d1c20ec3610c20fce9d37 | 2,574 | py | Python | topomc/symbol.py | ryan-mooore/topomc | 049bc0642c6c75ffe615ab86638d8848bf1a79d8 | [
"MIT"
] | 7 | 2020-05-21T02:50:22.000Z | 2022-02-06T13:39:41.000Z | topomc/symbol.py | ryan-mooore/topomc | 049bc0642c6c75ffe615ab86638d8848bf1a79d8 | [
"MIT"
] | 6 | 2020-04-07T09:48:11.000Z | 2022-02-20T22:59:58.000Z | topomc/symbol.py | ryan-mooore/topomc | 049bc0642c6c75ffe615ab86638d8848bf1a79d8 | [
"MIT"
] | 3 | 2021-01-18T04:28:26.000Z | 2021-11-26T11:19:47.000Z | import logging
from enum import Enum
from topomc.common.coordinates import Coordinates
from matplotlib import pyplot as plt
from svgpath2mpl import parse_path
from xml.dom import minidom
from os import path
from topomc.common.logger import Logger
class Symbol:
settings = []
def render(self, settings):
... | 27.382979 | 88 | 0.590132 |
b7c7a74d0ee7a309f09fdf026a6bf1aa27bd2529 | 2,745 | py | Python | dm_pix/_src/patch_test.py | LaudateCorpus1/dm_pix | a75741220b8c3ead32ff3e9d7d38eb315d5f0ed9 | [
"Apache-2.0"
] | 219 | 2021-07-15T12:00:08.000Z | 2022-03-28T01:48:22.000Z | dm_pix/_src/patch_test.py | tkhan3/dm_pix | a75741220b8c3ead32ff3e9d7d38eb315d5f0ed9 | [
"Apache-2.0"
] | 4 | 2021-08-06T17:59:30.000Z | 2022-01-03T11:20:22.000Z | dm_pix/_src/patch_test.py | tkhan3/dm_pix | a75741220b8c3ead32ff3e9d7d38eb315d5f0ed9 | [
"Apache-2.0"
] | 12 | 2021-07-16T08:32:07.000Z | 2021-12-19T08:36:45.000Z | # Copyright 2021 DeepMind Technologies Limited. 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 ... | 27.45 | 74 | 0.630601 |
cfb529398a718d79324ec7f0ff98db0e09ca84a8 | 2,281 | py | Python | frontend/location.py | nezihsunman/CS350ProjectCreatingALinuxCommand | 7be4139adffc3446d0b518f383cd566e3436dc68 | [
"Apache-2.0"
] | null | null | null | frontend/location.py | nezihsunman/CS350ProjectCreatingALinuxCommand | 7be4139adffc3446d0b518f383cd566e3436dc68 | [
"Apache-2.0"
] | null | null | null | frontend/location.py | nezihsunman/CS350ProjectCreatingALinuxCommand | 7be4139adffc3446d0b518f383cd566e3436dc68 | [
"Apache-2.0"
] | 1 | 2021-03-06T22:08:23.000Z | 2021-03-06T22:08:23.000Z | #!/usr/bin/env python2
"""
location.py - Library to get source location info from nodes.
This makes syntax errors nicer.
TODO: Move some of osh/word_ here.
"""
from __future__ import print_function
from _devbuild.gen.syntax_asdl import (
command_e, command_t, command__Pipeline, command__AndOr,
command__DoGro... | 28.5125 | 72 | 0.704954 |
de868fb3162a30c7e73d796386c7a6fb9272187c | 1,222 | py | Python | koku/api/report/azure/openshift/view.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 157 | 2018-04-30T16:27:53.000Z | 2022-03-31T08:17:21.000Z | koku/api/report/azure/openshift/view.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 3,250 | 2018-04-26T14:14:25.000Z | 2022-03-31T23:49:15.000Z | koku/api/report/azure/openshift/view.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 65 | 2018-05-10T14:11:50.000Z | 2022-03-18T19:22:58.000Z | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""View for OpenShift on Azure Usage Reports."""
from api.common.permissions.azure_access import AzureAccessPermission
from api.common.permissions.openshift_access import OpenShiftAccessPermission
from api.models import Provider
from api.report.azu... | 29.804878 | 79 | 0.788052 |
98edd2c7e9ca34cfa9069a91739725d9530d400f | 1,285 | py | Python | handlers/base.py | WXSD-Sales/ZoomToWebex | 16cc663620e2ef2904b0e2857d709aee96b78eb7 | [
"MIT"
] | null | null | null | handlers/base.py | WXSD-Sales/ZoomToWebex | 16cc663620e2ef2904b0e2857d709aee96b78eb7 | [
"MIT"
] | null | null | null | handlers/base.py | WXSD-Sales/ZoomToWebex | 16cc663620e2ef2904b0e2857d709aee96b78eb7 | [
"MIT"
] | null | null | null | import json
import tornado.web
class BaseHandler(tornado.web.RequestHandler):
def get_current_user(self):
cookie = self.get_secure_cookie("ZoomToWebex-User", max_age_days=1, min_version=2)
return cookie
def get_fedramp_user(self):
cookie = self.get_secure_cookie("MoveToFedRamp-User... | 40.15625 | 109 | 0.610895 |
fc80de1012eedf4e196a956cdc0ce7c719d2c5f4 | 142 | py | Python | tests/context.py | ToddBenson/sample | 81108f8966c9193b2c11790f6055b4543bc0efac | [
"BSD-2-Clause"
] | null | null | null | tests/context.py | ToddBenson/sample | 81108f8966c9193b2c11790f6055b4543bc0efac | [
"BSD-2-Clause"
] | null | null | null | tests/context.py | ToddBenson/sample | 81108f8966c9193b2c11790f6055b4543bc0efac | [
"BSD-2-Clause"
] | null | null | null | import sys
import os
from kata.exercise import pick_peaks
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
| 23.666667 | 82 | 0.753521 |
a10b2ebd4e1a4148e83b74394f2fbc9c9c404af0 | 2,273 | py | Python | src/chia_log/handlers/condition_checkers/time_since_last_farm_event.py | IgorVoiT/chiadog | f45b811828d5ee9e0afca114efb842d1541439a4 | [
"MIT"
] | 1 | 2021-08-18T13:04:16.000Z | 2021-08-18T13:04:16.000Z | src/chia_log/handlers/condition_checkers/time_since_last_farm_event.py | IgorVoiT/chiadog | f45b811828d5ee9e0afca114efb842d1541439a4 | [
"MIT"
] | null | null | null | src/chia_log/handlers/condition_checkers/time_since_last_farm_event.py | IgorVoiT/chiadog | f45b811828d5ee9e0afca114efb842d1541439a4 | [
"MIT"
] | null | null | null | # std
import logging
from typing import Optional
# project
from src.notifier import Event, EventService, EventType, EventPriority
from . import HarvesterConditionChecker
from ...parsers.harvester_activity_parser import HarvesterActivityMessage
from UI_Manager import UIManager, InfoType
class TimeSinceLastFarmEvent(H... | 43.711538 | 197 | 0.704355 |
bec30b7f181142c9a887aac4daf161f1b645830b | 692 | py | Python | swaps/model/market/pricedepth_bbo_event.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | 1 | 2021-09-06T00:09:11.000Z | 2021-09-06T00:09:11.000Z | swaps/model/market/pricedepth_bbo_event.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | null | null | null | swaps/model/market/pricedepth_bbo_event.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | null | null | null | from swaps.model.market import PriceDepthBbo
class PriceDepthBboEvent:
"""
The price depth received by subscription of price depth.
:member
symbol: The symbol you subscribed.
timestamp: The UNIX formatted timestamp generated by server in UTC.
data: The price depth.
"""
d... | 27.68 | 75 | 0.663295 |
2bc8a8e97c9bf0fef8c811b58a840a824bf67514 | 3,277 | py | Python | contrib/zmq/zmq_sub3.4.py | xlkulu/SHTcoin | e8e50991583a3530211025cd48191bf274798555 | [
"MIT"
] | 1 | 2019-08-25T13:07:02.000Z | 2019-08-25T13:07:02.000Z | contrib/zmq/zmq_sub3.4.py | xlkulu/SHTcoin | e8e50991583a3530211025cd48191bf274798555 | [
"MIT"
] | 1 | 2019-08-25T13:11:54.000Z | 2019-08-25T13:11:54.000Z | contrib/zmq/zmq_sub3.4.py | xlkulu/SHTcoin | e8e50991583a3530211025cd48191bf274798555 | [
"MIT"
] | 1 | 2019-08-25T13:07:25.000Z | 2019-08-25T13:07:25.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Shtcoin should be started with the command line argument... | 36.411111 | 107 | 0.648764 |
fa879c75d7e018e6dea0adbf4d03f0709ff50d26 | 3,344 | py | Python | insights/parsers/tests/test_ls_lib_firmware.py | lhuett/insights-core | 1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8 | [
"Apache-2.0"
] | 121 | 2017-05-30T20:23:25.000Z | 2022-03-23T12:52:15.000Z | insights/parsers/tests/test_ls_lib_firmware.py | lhuett/insights-core | 1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8 | [
"Apache-2.0"
] | 1,977 | 2017-05-26T14:36:03.000Z | 2022-03-31T10:38:53.000Z | insights/parsers/tests/test_ls_lib_firmware.py | lhuett/insights-core | 1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8 | [
"Apache-2.0"
] | 244 | 2017-05-30T20:22:57.000Z | 2022-03-26T10:09:39.000Z | import doctest
from insights.parsers import ls_lib_firmware
from insights.parsers.ls_lib_firmware import LsLibFW
from insights.tests import context_wrap
LS_LIB_FW = """
/lib/firmware:
total 37592
drwxr-xr-x. 83 0 0 8192 Aug 14 02:43 .
dr-xr-xr-x. 26 0 0 4096 Aug 14 02:22 ..
drwxr-xr-x. 2 0 0 40 Aug 14 02:... | 37.155556 | 170 | 0.630682 |
5906be3aeb87cd34ff470d2125255bd74e00bcd6 | 1,261 | py | Python | examples/quickstart.py | yopknopixx/dffml | 7f295bb01b235a915c9f8015564b97a708cd5325 | [
"MIT"
] | null | null | null | examples/quickstart.py | yopknopixx/dffml | 7f295bb01b235a915c9f8015564b97a708cd5325 | [
"MIT"
] | null | null | null | examples/quickstart.py | yopknopixx/dffml | 7f295bb01b235a915c9f8015564b97a708cd5325 | [
"MIT"
] | null | null | null | from dffml import Features, Feature
from dffml.noasync import train, accuracy, predict
from dffml_model_scikit import LinearRegressionModel
from dffml.accuracy import MeanSquaredErrorAccuracy
model = LinearRegressionModel(
features=Features(
Feature("Years", int, 1),
Feature("Expertise", int, 1),
... | 27.413043 | 66 | 0.596352 |
c372d5ac2bb8f9d05dd271109c5f1989b39700c5 | 80,226 | py | Python | flink-python/pyflink/datastream/data_stream.py | FrommyMind/flink | 589a566784451ef3943ee024d46fdd8d33d30a66 | [
"Apache-2.0"
] | 1 | 2022-02-16T07:59:13.000Z | 2022-02-16T07:59:13.000Z | flink-python/pyflink/datastream/data_stream.py | FrommyMind/flink | 589a566784451ef3943ee024d46fdd8d33d30a66 | [
"Apache-2.0"
] | 2 | 2022-03-09T12:58:57.000Z | 2022-03-29T12:23:39.000Z | flink-python/pyflink/datastream/data_stream.py | FrommyMind/flink | 589a566784451ef3943ee024d46fdd8d33d30a66 | [
"Apache-2.0"
] | 1 | 2022-03-09T08:50:37.000Z | 2022-03-09T08:50:37.000Z | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 45.428086 | 100 | 0.66001 |
538ba6bb2b40070eb6e528827d7752d34c656b7c | 1,316 | py | Python | docs/conf.py | cirospat/paniere-dataset-enti-locali | 58213e8414c291befad5932b283ff56fa18893e7 | [
"CC-BY-4.0"
] | null | null | null | docs/conf.py | cirospat/paniere-dataset-enti-locali | 58213e8414c291befad5932b283ff56fa18893e7 | [
"CC-BY-4.0"
] | null | null | null | docs/conf.py | cirospat/paniere-dataset-enti-locali | 58213e8414c291befad5932b283ff56fa18893e7 | [
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys, os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.append(os.path.abspath(os.pardir))
__version__ = '1.0'
# -- General configuration -----------------------------------------------------
source_suffix = '.rst'
master_doc =... | 25.803922 | 100 | 0.672492 |
bf902ad601de68e48495587f423b5e48e3fdf669 | 3,175 | py | Python | zun/objects/numa.py | magician03/zun | 4db10041fa4db0dd81f2e110b113172db3dc8f80 | [
"Apache-2.0"
] | 3 | 2018-09-07T02:31:05.000Z | 2018-10-17T10:30:47.000Z | zun/objects/numa.py | magician03/zun | 4db10041fa4db0dd81f2e110b113172db3dc8f80 | [
"Apache-2.0"
] | null | null | null | zun/objects/numa.py | magician03/zun | 4db10041fa4db0dd81f2e110b113172db3dc8f80 | [
"Apache-2.0"
] | 1 | 2018-09-07T02:26:23.000Z | 2018-09-07T02:26:23.000Z | # Copyright 2014 Red Hat Inc.
# Copyright 2017 IBM Corp
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 32.397959 | 78 | 0.59622 |
066cc889e2a40ac6f2336a57936af6688919604a | 4,795 | py | Python | optimizer3.py | brianjsl/ndf_mnist | 936b6616c5aca2d555cf88c134ff92f3ff57c08b | [
"MIT"
] | 1 | 2022-03-15T04:32:40.000Z | 2022-03-15T04:32:40.000Z | optimizer3.py | brianjsl/ndf_mnist | 936b6616c5aca2d555cf88c134ff92f3ff57c08b | [
"MIT"
] | null | null | null | optimizer3.py | brianjsl/ndf_mnist | 936b6616c5aca2d555cf88c134ff92f3ff57c08b | [
"MIT"
] | null | null | null | import torch
from dataloader_ndf import OverlapMNISTNDF
import torchvision.transforms as transforms
import torchvision.transforms
from torch.utils.data import DataLoader
import torch.nn as nn
import torch.nn.functional as F
from neural_field import NeuralField
from constants import IMG_DIR
import matplotlib.pyplot as p... | 33.068966 | 129 | 0.633368 |
ac87f1fdddf59b82434e0d3b3f4323801f9389dd | 44,276 | py | Python | pgmpy/readwrite/ProbModelXML.py | anaviltripathi/pgmpy | 24300984c66562219a09a3e9deb5e158bb021adb | [
"MIT"
] | null | null | null | pgmpy/readwrite/ProbModelXML.py | anaviltripathi/pgmpy | 24300984c66562219a09a3e9deb5e158bb021adb | [
"MIT"
] | null | null | null | pgmpy/readwrite/ProbModelXML.py | anaviltripathi/pgmpy | 24300984c66562219a09a3e9deb5e158bb021adb | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
For the student example the ProbModelXML file should be:
<?xml version=“1.0” encoding=“UTF-8”?>
<ProbModelXML formatVersion=“1.0”>
<ProbNet type="BayesianNetwork">
<AdditionalConstraints />
<Comment>
Student example model from Probabilistic Graphical Models:
... | 41.730443 | 120 | 0.542416 |
c1fce18938937dc80022b82a7bac16f319dfdbc5 | 18,283 | py | Python | pytorch3dunet/unet3d/trainer.py | vivian-wong/AM_defects_3dUNet | 91c3e42037e6af290b303b48c3d951c10832b2ab | [
"MIT"
] | null | null | null | pytorch3dunet/unet3d/trainer.py | vivian-wong/AM_defects_3dUNet | 91c3e42037e6af290b303b48c3d951c10832b2ab | [
"MIT"
] | null | null | null | pytorch3dunet/unet3d/trainer.py | vivian-wong/AM_defects_3dUNet | 91c3e42037e6af290b303b48c3d951c10832b2ab | [
"MIT"
] | null | null | null | import os
import torch
import torch.nn as nn
from tensorboardX import SummaryWriter
from torch.optim.lr_scheduler import ReduceLROnPlateau
from pytorch3dunet.unet3d.utils import get_logger
from . import utils
logger = get_logger('UNet3DTrainer')
class UNet3DTrainer:
"""3D UNet trainer.
Args:
model... | 43.739234 | 145 | 0.625116 |
9f7db5c73811c2f7b40332db5eba619d1de3231f | 1,060 | py | Python | smart_selects/views.py | DjangoAdminHackers/django-smart-selects | 50413ce7c7905fe3bdcda45308c23dc28dccab5b | [
"BSD-3-Clause"
] | 1 | 2017-07-12T07:51:29.000Z | 2017-07-12T07:51:29.000Z | smart_selects/views.py | DjangoAdminHackers/django-smart-selects | 50413ce7c7905fe3bdcda45308c23dc28dccab5b | [
"BSD-3-Clause"
] | null | null | null | smart_selects/views.py | DjangoAdminHackers/django-smart-selects | 50413ce7c7905fe3bdcda45308c23dc28dccab5b | [
"BSD-3-Clause"
] | null | null | null | from json import dumps
from django.http import HttpResponse
from .utils import get_filterchain_kwargs, get_filterchain_queryset, \
render_filterchain_choices
def filterchain(request, app, model, field, value, manager=None):
filter_kwargs = get_filterchain_kwargs(field, value)
filter_queryset = get_filter... | 46.086957 | 92 | 0.787736 |
63e0b79fb3fa2098d13d000dccdf5fced1f45078 | 3,234 | py | Python | LRUCache/cache.py | RomaA2000/SDCourse | 7e08686f6769c5fa309651396f465be049f06933 | [
"MIT"
] | null | null | null | LRUCache/cache.py | RomaA2000/SDCourse | 7e08686f6769c5fa309651396f465be049f06933 | [
"MIT"
] | null | null | null | LRUCache/cache.py | RomaA2000/SDCourse | 7e08686f6769c5fa309651396f465be049f06933 | [
"MIT"
] | null | null | null | import functools
from node import Node
class LRUCache:
def __init__(self, size_limit):
self.size_limit = size_limit
self.tail = None
self.head = None
self.dict = dict()
def _add_to_head(self, data):
if self.head is None:
self.tail = Node(data=data)
... | 32.666667 | 113 | 0.571119 |
493efee32190394a71a2492081a13033bc6ea342 | 28,504 | py | Python | tools/spelling/check_spelling_pedantic.py | dcillera/envoy | cb54ba8eec26f768f8c1ae412113b07bacde7321 | [
"Apache-2.0"
] | 17,703 | 2017-09-14T18:23:43.000Z | 2022-03-31T22:04:17.000Z | tools/spelling/check_spelling_pedantic.py | dcillera/envoy | cb54ba8eec26f768f8c1ae412113b07bacde7321 | [
"Apache-2.0"
] | 15,957 | 2017-09-14T16:38:22.000Z | 2022-03-31T23:56:30.000Z | tools/spelling/check_spelling_pedantic.py | dcillera/envoy | cb54ba8eec26f768f8c1ae412113b07bacde7321 | [
"Apache-2.0"
] | 3,780 | 2017-09-14T18:58:47.000Z | 2022-03-31T17:10:47.000Z | #! /usr/bin/env python3
from __future__ import print_function
import argparse
import locale
import math
import os
import re
import subprocess
import sys
from functools import partial
from itertools import chain
# Handle function rename between python 2/3.
try:
input = raw_input
except NameError:
pass
try:
... | 33.732544 | 111 | 0.568341 |
3b36a877f959f7d76e31584b75dfc80a0f1c4b86 | 1,631 | py | Python | 08_Introduction to Data Visualization with Matplotlib/01_Introduction to Matplotlib/06_Small multiples with shared y axis.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 5 | 2021-02-03T14:36:58.000Z | 2022-01-01T10:29:26.000Z | 08_Introduction to Data Visualization with Matplotlib/01_Introduction to Matplotlib/06_Small multiples with shared y axis.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | null | null | null | 08_Introduction to Data Visualization with Matplotlib/01_Introduction to Matplotlib/06_Small multiples with shared y axis.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 3 | 2021-02-08T00:31:16.000Z | 2022-03-17T13:52:32.000Z | '''
06 - Small multiples with shared y axis
When creating small multiples, it is often preferable to make sure that the different
plots are displayed with the same scale used on the y-axis. This can be configured by
setting the sharey key-word to True.
In this exercise, you will create a Figure with two Axes objec... | 50.96875 | 99 | 0.735745 |
eb8dc7222b73f7c8de9bcdcc201cd0be7545ddc5 | 521 | py | Python | sort/bubble_sort.py | oresam123/Algorithms | 6d46b939e27af7c084d305f9403285ab993423b2 | [
"MIT"
] | 8 | 2017-07-02T15:17:25.000Z | 2017-09-18T15:37:51.000Z | sort/bubble_sort.py | oresam123/Algorithms | 6d46b939e27af7c084d305f9403285ab993423b2 | [
"MIT"
] | null | null | null | sort/bubble_sort.py | oresam123/Algorithms | 6d46b939e27af7c084d305f9403285ab993423b2 | [
"MIT"
] | 3 | 2018-10-03T15:36:36.000Z | 2020-11-20T10:06:14.000Z | """
https://en.wikipedia.org/wiki/Bubble_sort
Complexity: O(N^2)
"""
def bubble_sort(arr):
def swap(i, j):
arr[i], arr[j] = arr[j], arr[i]
n = len(arr)
swapped = True
while swapped:
swapped = False
for i in range(1, n):
if arr[i - 1] > arr[i]:
s... | 17.965517 | 54 | 0.493282 |
4e778f4e46d51edc7f4cd95d427e4f6dceae620a | 3,638 | py | Python | API/model/utils.py | 7AM7/Arabic-dialects-segmenter-with-flask | a69e060fa25a5905864dae7d500c4f46436e0c40 | [
"MIT"
] | 1 | 2021-07-07T06:54:43.000Z | 2021-07-07T06:54:43.000Z | API/model/utils.py | 7AM7/Arabic-dialects-segmenter-with-flask | a69e060fa25a5905864dae7d500c4f46436e0c40 | [
"MIT"
] | null | null | null | API/model/utils.py | 7AM7/Arabic-dialects-segmenter-with-flask | a69e060fa25a5905864dae7d500c4f46436e0c40 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# this script uses pretrained model to segment Arabic dialect data.
# it takes the pretrained model trained on joint dialects and the
# training vocab and produces segmented text
#
# Copyright (C) 2017, Qatar Computing Research Institute, HBKU, Qatar
# Las Update: Sun Oct ... | 32.19469 | 149 | 0.658054 |
998d6ee343ee9e7a38b8b14e6393345f5e4088ae | 607 | py | Python | abc225/abc225_c.py | Vermee81/practice-coding-contests | 78aada60fa75f208ee0eef337b33b27b1c260d18 | [
"MIT"
] | null | null | null | abc225/abc225_c.py | Vermee81/practice-coding-contests | 78aada60fa75f208ee0eef337b33b27b1c260d18 | [
"MIT"
] | null | null | null | abc225/abc225_c.py | Vermee81/practice-coding-contests | 78aada60fa75f208ee0eef337b33b27b1c260d18 | [
"MIT"
] | null | null | null | # https://atcoder.jp/contests/abc225/tasks/abc225_c
N, M = map(int, input().split())
b_arr = []
for _ in range(N):
b_arr.append(list(map(lambda x: int(x) - 1, input().split())))
for i in range(N):
for j in range(M):
now_column = b_arr[i][j] % 7
if now_column != (b_arr[0][0] % 7) + j:
... | 26.391304 | 66 | 0.434926 |
7ee6df4c041009bc086cf6754e5fe2e11c3531a9 | 39,806 | py | Python | mpisppy/utils/sputils.py | vishalbelsare/mpi-sppy | 019fa1c04396a5bcadf758a31bc96217c17b43c9 | [
"BSD-3-Clause"
] | null | null | null | mpisppy/utils/sputils.py | vishalbelsare/mpi-sppy | 019fa1c04396a5bcadf758a31bc96217c17b43c9 | [
"BSD-3-Clause"
] | null | null | null | mpisppy/utils/sputils.py | vishalbelsare/mpi-sppy | 019fa1c04396a5bcadf758a31bc96217c17b43c9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2020 by B. Knueven, D. Mildebrath, C. Muir, J-P Watson, and D.L. Woodruff
# This software is distributed under the 3-clause BSD License.
# Base and utility functions for mpisppy
# Note to developers: things called spcomm are way more than just a comm; SPCommunicator
import pyomo.environ as pyo
import sys
i... | 41.507821 | 130 | 0.623122 |
8ae610866a3da8d5ceaa936b1f8b732d7443438b | 4,816 | py | Python | nilmtk_contrib/disaggregate/ModelTestS2S.py | research-at-scuiot/nilmtk-contrib | 1e9907313eaa8ab9906b8d0edaf85a8155317d82 | [
"Apache-2.0"
] | null | null | null | nilmtk_contrib/disaggregate/ModelTestS2S.py | research-at-scuiot/nilmtk-contrib | 1e9907313eaa8ab9906b8d0edaf85a8155317d82 | [
"Apache-2.0"
] | null | null | null | nilmtk_contrib/disaggregate/ModelTestS2S.py | research-at-scuiot/nilmtk-contrib | 1e9907313eaa8ab9906b8d0edaf85a8155317d82 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division
from nilmtk.disaggregate import Disaggregator
from keras.layers import Conv1D, Dense, Dropout, Reshape, Flatten
import pandas as pd
import numpy as np
from collections import OrderedDict
from keras.models import Sequential, load_model
from sklearn.model_selection import t... | 50.166667 | 124 | 0.623962 |
bca52aa12957cb0172122c8e7600b77acf7ac306 | 1,378 | py | Python | halocoin/ntwrk/message.py | Globetokenllc/halocoin | cc69cac05e0489e56c84492afdfcbc54d3b02bb2 | [
"Apache-2.0"
] | 68 | 2017-07-31T17:22:12.000Z | 2022-02-14T13:27:32.000Z | halocoin/ntwrk/message.py | Globetokenllc/halocoin | cc69cac05e0489e56c84492afdfcbc54d3b02bb2 | [
"Apache-2.0"
] | 6 | 2018-11-04T09:50:58.000Z | 2022-03-25T18:21:18.000Z | halocoin/ntwrk/message.py | Globetokenllc/halocoin | cc69cac05e0489e56c84492afdfcbc54d3b02bb2 | [
"Apache-2.0"
] | 26 | 2018-01-28T23:21:51.000Z | 2022-02-22T05:39:05.000Z | import uuid
import yaml
class Order:
def __init__(self, action, args, kwargs):
self.id = uuid.uuid4()
self.action = action
self.args = args
self.kwargs = kwargs
class Response:
def __init__(self, id, answer):
self.id = id
self.answer = answer
class Message:... | 22.225806 | 85 | 0.576923 |
84fb56ec6942543406ca350b219ad9e63024a79b | 4,600 | py | Python | examples/campaign_management/validate_text_ad.py | Insutanto/google-ads-python | f63e318ca39f2ecc6546fba69994456815727578 | [
"Apache-2.0"
] | null | null | null | examples/campaign_management/validate_text_ad.py | Insutanto/google-ads-python | f63e318ca39f2ecc6546fba69994456815727578 | [
"Apache-2.0"
] | null | null | null | examples/campaign_management/validate_text_ad.py | Insutanto/google-ads-python | f63e318ca39f2ecc6546fba69994456815727578 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 45.544554 | 89 | 0.667609 |
43d7ad52bd8f2935303dcb6aa2a3e48cf7df578c | 741 | py | Python | iris_pipeline/datamodels/flat.py | zonca/iris_pipeline | a4c20a362037a94f66427521bb5cd5da1c918dd7 | [
"BSD-3-Clause"
] | null | null | null | iris_pipeline/datamodels/flat.py | zonca/iris_pipeline | a4c20a362037a94f66427521bb5cd5da1c918dd7 | [
"BSD-3-Clause"
] | 38 | 2019-03-07T01:25:03.000Z | 2022-03-01T13:02:29.000Z | iris_pipeline/datamodels/flat.py | zonca/iris_pipeline | a4c20a362037a94f66427521bb5cd5da1c918dd7 | [
"BSD-3-Clause"
] | 1 | 2019-02-28T02:39:06.000Z | 2019-02-28T02:39:06.000Z | from .tmt_reference import TMTReferenceFileModel
from jwst.datamodels.dynamicdq import dynamic_mask
__all__ = ['TMTFlatModel']
class TMTFlatModel(TMTReferenceFileModel):
"""
A data model for 2D flat-field images.
Parameters
__________
data : numpy float32 array
The science data
dq... | 20.583333 | 50 | 0.645074 |
db8f1887733fad98ef9424dae76cc492679eebb5 | 4,591 | py | Python | src/entsoe/entsoe.py | olemagnp/entsoeAPI | 658b84c632299c8fc8f5a8289527904b2fc1a2ee | [
"MIT"
] | null | null | null | src/entsoe/entsoe.py | olemagnp/entsoeAPI | 658b84c632299c8fc8f5a8289527904b2fc1a2ee | [
"MIT"
] | null | null | null | src/entsoe/entsoe.py | olemagnp/entsoeAPI | 658b84c632299c8fc8f5a8289527904b2fc1a2ee | [
"MIT"
] | null | null | null | from typing import List, Optional
import aiohttp
import datetime
from .consts import DAY_AHEAD_DOCUMENT, DATE_FORMAT
from .xmlreader import day_ahead_price_list
from .forex import Forex
class Price:
def __init__(
self,
begin: datetime.datetime,
end: datetime.datetime,
price_orig... | 32.792857 | 216 | 0.595513 |
f8bed013a0e62e4856103d343a6a6169cdbd0ba9 | 121 | py | Python | federatedml/ftl/data_util/log_util.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 32 | 2020-06-12T08:39:58.000Z | 2022-03-20T06:57:08.000Z | federatedml/ftl/data_util/log_util.py | ErikSun2020/FATE | bdda535c7d8a974fc2c43102837964b7da199730 | [
"Apache-2.0"
] | 14 | 2019-11-13T11:25:36.000Z | 2021-12-14T21:31:59.000Z | federatedml/ftl/data_util/log_util.py | ErikSun2020/FATE | bdda535c7d8a974fc2c43102837964b7da199730 | [
"Apache-2.0"
] | 16 | 2020-06-12T06:51:46.000Z | 2022-03-29T10:23:42.000Z | def create_shape_msg(components):
msg = ""
for c in components:
msg += str(c.shape) + " "
return msg
| 20.166667 | 33 | 0.570248 |
b854e72ac1d23fb35b34405a6981f8596a56cdd5 | 1,729 | py | Python | Courses/Udacity/CS101/Lesson_3_Problem_Set/08-Sudoku/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2019-02-13T12:02:26.000Z | 2019-02-13T12:02:26.000Z | Courses/Udacity/CS101/Lesson_3_Problem_Set/08-Sudoku/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2018-08-13T15:58:33.000Z | 2018-08-13T15:58:33.000Z | Courses/Udacity/CS101/Lesson_3_Problem_Set/08-Sudoku/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 2 | 2017-08-10T20:01:29.000Z | 2021-07-01T08:39:13.000Z | # THREE GOLD STARS
# Sudoku [http://en.wikipedia.org/wiki/Sudoku]
# is a logic puzzle where a game
# is defined by a partially filled
# 9 x 9 square of digits where each square
# contains one of the digits 1,2,3,4,5,6,7,8,9.
# For this question we will generalize
# and simplify the game.
# Define a procedure, check_s... | 20.341176 | 59 | 0.568537 |
9019eadbce473f3836d5f71ae2288569cb90edd9 | 2,242 | py | Python | tests/unit/test_plugin_manager.py | jmcgill298/flake8 | 4439ea202526b50154d287f3e581222a4c86d782 | [
"MIT"
] | null | null | null | tests/unit/test_plugin_manager.py | jmcgill298/flake8 | 4439ea202526b50154d287f3e581222a4c86d782 | [
"MIT"
] | null | null | null | tests/unit/test_plugin_manager.py | jmcgill298/flake8 | 4439ea202526b50154d287f3e581222a4c86d782 | [
"MIT"
] | null | null | null | """Tests for flake8.plugins.manager.PluginManager."""
import mock
from flake8.plugins import manager
def create_entry_point_mock(name):
"""Create a mocked EntryPoint."""
ep = mock.Mock(spec=['name'])
ep.name = name
return ep
@mock.patch('pkg_resources.iter_entry_points')
def test_calls_pkg_resource... | 35.587302 | 77 | 0.751115 |
8663391b40caff605eff5865f9f4d4f5ea30a7d7 | 5,631 | py | Python | Dijkstra-AirportConnections-Lab2/20064993_lab_2_Daniyal Maniar/modifiedDijkstras_20064993.py | DanMan259/CMPE365 | 4f9ce90e1c289f173c99eba135d0a16df70523a4 | [
"Apache-2.0"
] | 1 | 2019-09-17T00:41:42.000Z | 2019-09-17T00:41:42.000Z | Dijkstra-AirportConnections-Lab2/20064993_lab_2_Daniyal Maniar/modifiedDijkstras_20064993.py | DanMan259/CMPE365_Algorithms | 4f9ce90e1c289f173c99eba135d0a16df70523a4 | [
"Apache-2.0"
] | null | null | null | Dijkstra-AirportConnections-Lab2/20064993_lab_2_Daniyal Maniar/modifiedDijkstras_20064993.py | DanMan259/CMPE365_Algorithms | 4f9ce90e1c289f173c99eba135d0a16df70523a4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 17 00:39:59 2019
@author: Daniyal Maniar
I certify that this submission contains my own work.
The modified algorithms was based upon the pseudo code provided in the definition of Lab 1.
"""
class graph:
# This definition of a graph allows to ... | 44.690476 | 130 | 0.609483 |
e87136101cf28498d759f5d3430b83a4857780d5 | 22,435 | py | Python | uws_server/provenance.py | mservillat/uws-server | 4f555bfbb18f31ae0a41f8bbaa92bf9fb4a964d5 | [
"MIT"
] | 1 | 2016-04-06T11:00:10.000Z | 2016-04-06T11:00:10.000Z | uws_server/provenance.py | mservillat/uws_server | 4f555bfbb18f31ae0a41f8bbaa92bf9fb4a964d5 | [
"MIT"
] | null | null | null | uws_server/provenance.py | mservillat/uws_server | 4f555bfbb18f31ae0a41f8bbaa92bf9fb4a964d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 by Mathieu Servillat
# Licensed under MIT (https://github.com/mservillat/uws-server/blob/master/LICENSE)
"""
Export UWS job description to a ProvDocument following the W3C PROV standard
"""
import prov
from voprov.models.model import VOProvDocument, VO... | 42.171053 | 142 | 0.526499 |
84e23ebf04bd79873abc9d5988a2bb631ace9bec | 4,571 | py | Python | implementations/VAE/utils.py | STomoya/animeface | 37b3cd26097d7874559d4c152e41e5712b7a1a42 | [
"MIT"
] | 61 | 2020-06-06T08:25:09.000Z | 2022-03-28T13:30:10.000Z | implementations/VAE/utils.py | OrigamiXx/animeface | 8724006df99ba7ef369e837d8294350ea733611b | [
"MIT"
] | 13 | 2020-07-02T02:41:14.000Z | 2021-05-09T14:24:58.000Z | implementations/VAE/utils.py | OrigamiXx/animeface | 8724006df99ba7ef369e837d8294350ea733611b | [
"MIT"
] | 8 | 2020-10-03T18:51:16.000Z | 2022-02-05T18:18:01.000Z |
import functools
from utils.argument import add_args
import torch
import torch.nn as nn
import torch.optim as optim
from torch.cuda.amp import autocast, GradScaler
from torchvision.utils import save_image
from dataset import AnimeFace, DanbooruPortrait
from utils import Status, save_args, add_args
from nnutils impor... | 32.190141 | 108 | 0.574491 |
070ce44832b267d9a562ce775e0c5c72e2b9de8b | 2,559 | py | Python | src/utils/model.py | hahmadraz/SqueezeDet-MultiHead | db8a9c19c633271eb1c90447558e14f4cd98f670 | [
"MIT"
] | 17 | 2020-04-20T06:16:07.000Z | 2022-02-28T13:04:04.000Z | src/utils/model.py | ELanning/SqueezeDet-PyTorch | b0d80daa0147c968d43f3c38bc416394419c4bcc | [
"MIT"
] | 8 | 2020-06-15T08:55:32.000Z | 2022-03-12T00:24:35.000Z | src/utils/model.py | ELanning/SqueezeDet-PyTorch | b0d80daa0147c968d43f3c38bc416394419c4bcc | [
"MIT"
] | 9 | 2020-06-09T07:17:07.000Z | 2022-03-04T05:42:02.000Z | import torch
import torch.nn as nn
def load_model(model, model_path):
checkpoint = torch.load(model_path, map_location=lambda storage, loc: storage)
print('loaded model {}, epoch {}'.format(model_path, checkpoint['epoch']))
state_dict_ = checkpoint['state_dict']
state_dict = {}
for k in state_dict... | 35.541667 | 88 | 0.651817 |
923666a69090bd364e7650a41cfb6b6978dd0b98 | 12,546 | py | Python | models/vnect_model.py | cDenius/VNect-tensorflow | 9bc2102359bd52e05be4fcce67670ebf1f9f5fac | [
"Apache-2.0"
] | null | null | null | models/vnect_model.py | cDenius/VNect-tensorflow | 9bc2102359bd52e05be4fcce67670ebf1f9f5fac | [
"Apache-2.0"
] | null | null | null | models/vnect_model.py | cDenius/VNect-tensorflow | 9bc2102359bd52e05be4fcce67670ebf1f9f5fac | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import tensorflow.contrib as tc
import pickle
import numpy as np
class VNect():
def __init__(self, input_size):
self.is_training = False
self.input_holder = tf.placeholder(dtype=tf.float32,
shape=(None, input_size, input_size, 3))... | 66.380952 | 192 | 0.72007 |
74af62e60399a4cb5b23de30d12203ab1ab673e5 | 17,152 | py | Python | nova/tests/api/openstack/compute/contrib/test_createserverext.py | dreamhost/nova | 066a3d4c410056689b5843d9520f43b2b6e7d127 | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/contrib/test_createserverext.py | dreamhost/nova | 066a3d4c410056689b5843d9520f43b2b6e7d127 | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/contrib/test_createserverext.py | dreamhost/nova | 066a3d4c410056689b5843d9520f43b2b6e7d127 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=5 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 43.755102 | 79 | 0.666744 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.