hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d3a0ba5d465e6a77d88cb835d53e05823df2e68c | 2,564 | py | Python | transformer/model/embedder.py | ViktorStagge/transformer | 39a331f41cafbfbe5fdf64ffdac5897b4d2aa319 | [
"MIT"
] | null | null | null | transformer/model/embedder.py | ViktorStagge/transformer | 39a331f41cafbfbe5fdf64ffdac5897b4d2aa319 | [
"MIT"
] | null | null | null | transformer/model/embedder.py | ViktorStagge/transformer | 39a331f41cafbfbe5fdf64ffdac5897b4d2aa319 | [
"MIT"
] | null | null | null | from typing import Optional
from keras.layers import Input, \
Embedding, \
Add, \
Dropout
from keras.models import Model
from transformer.model.layers import PositionalEncoding
class Embedder(Model):
def __init__(self,
s... | 36.112676 | 101 | 0.544462 |
48d0278264730d3fadafa0f93a0184c86802545b | 17,184 | py | Python | windows/winproxy/apis/advapi32.py | 1orenz0/PythonForWindows | f3de7b528b020b45ac6a871c975006fc1db1c3b0 | [
"BSD-3-Clause"
] | 1 | 2021-06-22T16:50:31.000Z | 2021-06-22T16:50:31.000Z | windows/winproxy/apis/advapi32.py | 1orenz0/PythonForWindows | f3de7b528b020b45ac6a871c975006fc1db1c3b0 | [
"BSD-3-Clause"
] | null | null | null | windows/winproxy/apis/advapi32.py | 1orenz0/PythonForWindows | f3de7b528b020b45ac6a871c975006fc1db1c3b0 | [
"BSD-3-Clause"
] | 1 | 2021-05-12T12:58:27.000Z | 2021-05-12T12:58:27.000Z | import ctypes
import windows.generated_def as gdef
from ..apiproxy import ApiProxy, NeededParameter
from ..error import fail_on_zero, succeed_on_zero, result_is_error_code
class Advapi32Proxy(ApiProxy):
APIDLL = "advapi32"
default_error_check = staticmethod(fail_on_zero)
# Process
@Advapi32Proxy()
def Creat... | 48 | 236 | 0.837465 |
106f039bec10519325ff720a1bb5e2e380da1266 | 561 | py | Python | docs/tutorial/python/flask/app.py | mrpotes/go-raml | f151e1e143c47282b294fe70c5e56f113988ed10 | [
"BSD-2-Clause"
] | 142 | 2016-02-11T06:23:34.000Z | 2022-03-24T06:05:22.000Z | docs/tutorial/python/flask/app.py | mrpotes/go-raml | f151e1e143c47282b294fe70c5e56f113988ed10 | [
"BSD-2-Clause"
] | 297 | 2016-02-04T06:23:13.000Z | 2020-08-20T13:23:22.000Z | docs/tutorial/python/flask/app.py | mrpotes/go-raml | f151e1e143c47282b294fe70c5e56f113988ed10 | [
"BSD-2-Clause"
] | 49 | 2016-02-01T10:59:50.000Z | 2021-05-20T15:04:01.000Z | # DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
from flask import Flask, send_from_directory, send_file
from users_api import users_api
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__)
app.register_blueprint(users_api)
@app.route('/apidocs/<pat... | 21.576923 | 79 | 0.721925 |
58debd7235d3f784db29fac50e97a164b384e9ac | 35,709 | py | Python | src/pretix/base/services/cart.py | MaxRink/pretix | f561ece9d1591673a495a6226db812e809ab3aec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/base/services/cart.py | MaxRink/pretix | f561ece9d1591673a495a6226db812e809ab3aec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/base/services/cart.py | MaxRink/pretix | f561ece9d1591673a495a6226db812e809ab3aec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from collections import Counter, defaultdict, namedtuple
from datetime import timedelta
from decimal import Decimal
from typing import List, Optional
from celery.exceptions import MaxRetriesExceededError
from django.db import transaction
from django.db.models import Q
from django.dispatch import receiver
from django.u... | 45.431298 | 132 | 0.600493 |
9a93b9f141102e81835d5740d69a32ba48e9ce66 | 700 | py | Python | var/spack/repos/builtin/packages/py-mysqldb1/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-mysqldb1/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/py-mysqldb1/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 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.package import *
class PyMysqldb1(PythonPackage):
"""Legacy mysql bindings for python"""
homepage = "... | 36.842105 | 95 | 0.728571 |
7d58e4682dcef910da11601740d1aff3a83642f3 | 19,333 | py | Python | src/virtual-wan/azext_vwan/vendored_sdks/v2020_05_01/v2020_05_01/operations/_express_route_circuit_connections_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2 | 2021-03-24T21:06:20.000Z | 2021-03-24T21:07:58.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2020_05_01/v2020_05_01/operations/_express_route_circuit_connections_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 3 | 2020-05-27T20:16:26.000Z | 2020-07-23T19:46:49.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2020_05_01/v2020_05_01/operations/_express_route_circuit_connections_operations.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-05-09T17:47:09.000Z | 2020-10-01T19:52:06.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.944304 | 224 | 0.681012 |
c95239e59f82976ab4acfe7e85bd943bf0840df8 | 751 | py | Python | tests/test_one_sample_server.py | dionresearch/hotelling | ac6ef7d3674f1e9af7511d3a1fb205ee40b321b7 | [
"MIT"
] | 12 | 2020-07-04T13:50:04.000Z | 2021-07-17T08:07:50.000Z | tests/test_one_sample_server.py | dionresearch/hotelling | ac6ef7d3674f1e9af7511d3a1fb205ee40b321b7 | [
"MIT"
] | 19 | 2021-01-15T10:07:24.000Z | 2021-07-30T13:34:13.000Z | tests/test_one_sample_server.py | dionresearch/hotelling | ac6ef7d3674f1e9af7511d3a1fb205ee40b321b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `hotelling` package."""
import numpy as np
import pytest
import pandas as pd
from hotelling.helpers import load_df
from hotelling.stats import hotelling_t2
try:
import distributed
def test_hotelling_test_csv_one_sample_server():
x = load_df... | 28.884615 | 78 | 0.671105 |
2213f2fafff58ffcbebe481561f8c32178533125 | 613 | py | Python | utils/get_norm.py | feevos/ceecnet | 9dc76f8cd16d44b264cae8c5846eefb8fcf6162d | [
"BSD-3-Clause",
"MIT"
] | 45 | 2020-09-07T01:19:44.000Z | 2022-03-15T14:44:20.000Z | FracTAL_ResUNet/utils/get_norm.py | m0rp43us/decode | bed6f6b4173f49362a5113207155cc103e8fd139 | [
"BSD-3-Clause",
"MIT"
] | 10 | 2020-10-02T10:14:47.000Z | 2021-10-19T09:34:14.000Z | FracTAL_ResUNet/utils/get_norm.py | m0rp43us/decode | bed6f6b4173f49362a5113207155cc103e8fd139 | [
"BSD-3-Clause",
"MIT"
] | 14 | 2020-09-29T02:46:18.000Z | 2021-09-27T07:13:47.000Z | import mxnet as mx
from mxnet import gluon
def get_norm(name, axis=1, norm_groups=None):
if (name == 'BatchNorm'):
return gluon.nn.BatchNorm(axis=axis)
elif (name == 'InstanceNorm'):
return gluon.nn.InstanceNorm(axis=axis)
elif (n... | 40.866667 | 86 | 0.564437 |
0c8029590cc579ff8d4bb1913923fc2c84382cb1 | 3,182 | py | Python | resources/usr/lib/python2.7/dist-packages/numpy/oldnumeric/compat.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/lib/python2.7/dist-packages/numpy/oldnumeric/compat.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/lib/python2.7/dist-packages/numpy/oldnumeric/compat.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 1 | 2020-05-28T23:01:44.000Z | 2020-05-28T23:01:44.000Z | # Compatibility module containing deprecated names
__all__ = ['NewAxis',
'UFuncType', 'UfuncType', 'ArrayType', 'arraytype',
'LittleEndian', 'arrayrange', 'matrixmultiply',
'array_constructor', 'pickle_array',
'DumpArray', 'LoadArray', 'multiarray',
# from cPickle... | 26.966102 | 80 | 0.637335 |
2c75c7156e7721bb0ecb0cb9fcc0322f08f72ebd | 12,963 | py | Python | lesson 7/cython/cython_compile.py | gtpedrosa/Python4WindEnergy | f8ad09018420cfb3a419173f97b129de7118d814 | [
"Apache-2.0"
] | 48 | 2015-01-19T18:21:10.000Z | 2021-11-27T22:41:06.000Z | lesson 7/cython/cython_compile.py | arash7444/Python4WindEnergy | 8f97a5f86e81ce01d80dafb6f8104165fd3ad397 | [
"Apache-2.0"
] | 1 | 2016-05-24T06:07:07.000Z | 2016-05-24T08:26:29.000Z | lesson 7/cython/cython_compile.py | arash7444/Python4WindEnergy | 8f97a5f86e81ce01d80dafb6f8104165fd3ad397 | [
"Apache-2.0"
] | 24 | 2015-06-26T14:44:07.000Z | 2021-06-07T18:36:52.000Z | '''
Created on 10/07/2013
@author: Mads M. Pedersen (mmpe@dtu.dk)
Wrapper functions and decorators for compiling functions using Cython
'''
import inspect
import os
import re
import shutil
import subprocess
import sys
import numpy as np
import warnings
def wrap(f, autodeclare, *args, **kwargs):
"""
Wra... | 35.809392 | 109 | 0.566767 |
e345cecbeaaeeeb1824dfc0fd92b57435d5a2148 | 4,816 | py | Python | chatgui.py | esh04/Intelligent-Chatbot | 8bd2d5e4f98d3bf57d2b4fc3e0fe681afdaaf4bb | [
"MIT"
] | null | null | null | chatgui.py | esh04/Intelligent-Chatbot | 8bd2d5e4f98d3bf57d2b4fc3e0fe681afdaaf4bb | [
"MIT"
] | null | null | null | chatgui.py | esh04/Intelligent-Chatbot | 8bd2d5e4f98d3bf57d2b4fc3e0fe681afdaaf4bb | [
"MIT"
] | null | null | null | import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import pickle
import numpy as np
from keras.models import load_model
model = load_model('./Data/chatbot_model.h5')
import json
import random
intents = json.loads(open('./Data/intents.json').read())
words = pickle.load(open(... | 34.647482 | 95 | 0.624792 |
ad90400afe5c2be41d9c87e78fd4ea603b69418f | 1,188 | py | Python | Exercise/exercise_queries.py | Mihai925/EduCoding-Legacy | 7c6de105deb186c3442f8d7f9f1b9f99708f8fb6 | [
"MIT"
] | null | null | null | Exercise/exercise_queries.py | Mihai925/EduCoding-Legacy | 7c6de105deb186c3442f8d7f9f1b9f99708f8fb6 | [
"MIT"
] | null | null | null | Exercise/exercise_queries.py | Mihai925/EduCoding-Legacy | 7c6de105deb186c3442f8d7f9f1b9f99708f8fb6 | [
"MIT"
] | null | null | null | from Class.models import Class
from Exercise.models import Exercise
def assign_exercise_to_class(ex_id, cls_id):
a_class = Class.objects.get(cls_id=cls_id)
exercise = Exercise.objects.get(ex_id=ex_id)
exercise.classes_assigned_to.add(a_class)
def get_exercises_for_reacher(teacher):
return Exercise.ob... | 36 | 129 | 0.765993 |
bb07c04eb09df99738240b88d531a7a6ed661b6c | 399 | py | Python | facebook_example/member/admin.py | BeshoyAtef/StudentsPortal | 2df13b92ff3bfb84cc4d5aa8fd844339dabf4643 | [
"BSD-3-Clause"
] | null | null | null | facebook_example/member/admin.py | BeshoyAtef/StudentsPortal | 2df13b92ff3bfb84cc4d5aa8fd844339dabf4643 | [
"BSD-3-Clause"
] | null | null | null | facebook_example/member/admin.py | BeshoyAtef/StudentsPortal | 2df13b92ff3bfb84cc4d5aa8fd844339dabf4643 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from member.models import *
from django_facebook import *
try:
from auth import User
except:
pass
try:
admin.site.register(member.UserProfile)
admin.site.register(memeber.MyCustomProfile)
except:
pass
try:
admin.site.register(django_facebook.FacebookCustomUser)... | 17.347826 | 59 | 0.734336 |
0a2f961eaaef24f69072c0a809b8c3f3f89bb4f0 | 4,694 | py | Python | texar/utils/mode.py | eff-kay/temp-texar-repo | 5c6ee6645c1d78f8294e2a07d111dbb02cd9547e | [
"Apache-2.0"
] | 87 | 2019-09-11T04:41:46.000Z | 2022-03-23T02:37:52.000Z | texar/utils/mode.py | ysglh/texar | 9c699e8143fd8ecb5d65a41ceef09c45832b9258 | [
"Apache-2.0"
] | 10 | 2019-10-01T16:09:17.000Z | 2021-10-19T21:20:11.000Z | texar/utils/mode.py | ysglh/texar | 9c699e8143fd8ecb5d65a41ceef09c45832b9258 | [
"Apache-2.0"
] | 20 | 2019-09-13T16:32:37.000Z | 2021-06-03T07:14:11.000Z | # Copyright 2018 The Texar 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 ... | 31.503356 | 79 | 0.659565 |
8896801c28c3e70ad8790ddf5e981903151fa98e | 24,191 | py | Python | tensor2tensor/utils/yellowfin.py | AgoloCuongHoang/tensor2tensor | 98903799fa442b5211eb6dfde997b229347f389a | [
"Apache-2.0"
] | 1 | 2019-12-21T21:26:11.000Z | 2019-12-21T21:26:11.000Z | tensor2tensor/utils/yellowfin.py | AgoloCuongHoang/tensor2tensor | 98903799fa442b5211eb6dfde997b229347f389a | [
"Apache-2.0"
] | null | null | null | tensor2tensor/utils/yellowfin.py | AgoloCuongHoang/tensor2tensor | 98903799fa442b5211eb6dfde997b229347f389a | [
"Apache-2.0"
] | 1 | 2020-07-13T03:15:32.000Z | 2020-07-13T03:15:32.000Z | # coding=utf-8
# Copyright 2019 The Tensor2Tensor 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... | 37.622084 | 95 | 0.64214 |
9c06c03313cbdee4703a75dd816d1964f8d4e7c9 | 1,170 | py | Python | p2p_options/test_options.py | sergiolib/pytorch-CycleGAN-and-pix2pix | cd3058a6a0522a0ed9178682b06cda538947e335 | [
"BSD-3-Clause"
] | null | null | null | p2p_options/test_options.py | sergiolib/pytorch-CycleGAN-and-pix2pix | cd3058a6a0522a0ed9178682b06cda538947e335 | [
"BSD-3-Clause"
] | null | null | null | p2p_options/test_options.py | sergiolib/pytorch-CycleGAN-and-pix2pix | cd3058a6a0522a0ed9178682b06cda538947e335 | [
"BSD-3-Clause"
] | null | null | null | from .base_options import BaseOptions
class TestOptions(BaseOptions):
"""This class includes test p2p_options.
It also includes shared p2p_options defined in BaseOptions.
"""
def initialize(self, parser):
parser = BaseOptions.initialize(self, parser) # define shared p2p_options
pars... | 48.75 | 108 | 0.692308 |
ebf0d0b3e7deb2634401403801bd929ff16e5a5f | 2,758 | py | Python | src/routers/user.py | snokpok/listlive-backend | 1bfffe3e3f137912646631a06e4054edd8c0fc4d | [
"MIT"
] | null | null | null | src/routers/user.py | snokpok/listlive-backend | 1bfffe3e3f137912646631a06e4054edd8c0fc4d | [
"MIT"
] | null | null | null | src/routers/user.py | snokpok/listlive-backend | 1bfffe3e3f137912646631a06e4054edd8c0fc4d | [
"MIT"
] | null | null | null | from typing import Any, Dict
from bson.json_util import dumps
from fastapi.routing import APIRouter
from pydantic.main import BaseModel
from mongo import user_col, list_col
from auth_repo import ar
from dependencies import verify_token_dependency
from bson.objectid import ObjectId
from fastapi import Depends
from fasta... | 31.340909 | 103 | 0.670776 |
91c837eed28b402746c8d77983006a86558d199b | 509 | py | Python | scraper.py | BatuhanOnder/Twitter-Bot | 62b33ea83971636d57e9d41a5c2c8aad54814817 | [
"MIT"
] | null | null | null | scraper.py | BatuhanOnder/Twitter-Bot | 62b33ea83971636d57e9d41a5c2c8aad54814817 | [
"MIT"
] | null | null | null | scraper.py | BatuhanOnder/Twitter-Bot | 62b33ea83971636d57e9d41a5c2c8aad54814817 | [
"MIT"
] | null | null | null | import twint
class tweetscraper:
def __init__(self,Config, ScrollCount):
self.Config = Config
self.scrape_all_tweets(ScrollCount)
def tweet_scraper(self):
''' Bu metot kullanici twitlerini çekmek için kullanilir'''
# Configuration
c = self.Config
# Run
... | 18.178571 | 67 | 0.620825 |
0afeca7626fbac2e7425ed8f8577637803747b9c | 4,963 | py | Python | client/verta/tests/test_dataset_versioning/test_dataset.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | 1 | 2021-03-26T05:41:34.000Z | 2021-03-26T05:41:34.000Z | client/verta/tests/test_dataset_versioning/test_dataset.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | null | null | null | client/verta/tests/test_dataset_versioning/test_dataset.py | stefan-petrov-toptal/modeldb | a8a9b9da6ed964c91351230b2f0d2703c75794de | [
"Apache-2.0"
] | 1 | 2021-05-04T13:52:09.000Z | 2021-05-04T13:52:09.000Z | import collections
import pytest
import requests
import verta
class TestMetadata:
def test_description(self, client, created_entities, strs):
first_desc, second_desc = strs[:2]
dataset = client.create_dataset(desc=first_desc)
created_entities.append(dataset)
assert dataset.get_d... | 35.963768 | 96 | 0.646988 |
6eec6b3b266e92d80ab9659df75da9cf433df9da | 3,113 | py | Python | flask_restly/serializer/__init__.py | gorzechowski/flask-restly | 54f28b66f35b0ab12ba4ee37bcd6d39aaf24111a | [
"MIT"
] | 16 | 2018-10-16T20:07:02.000Z | 2021-01-07T13:01:05.000Z | flask_restly/serializer/__init__.py | gorzechowski/flask-restly | 54f28b66f35b0ab12ba4ee37bcd6d39aaf24111a | [
"MIT"
] | 16 | 2018-10-16T14:09:55.000Z | 2020-01-16T07:52:22.000Z | flask_restly/serializer/__init__.py | gorzechowski/flask-restly | 54f28b66f35b0ab12ba4ee37bcd6d39aaf24111a | [
"MIT"
] | 1 | 2019-04-17T03:20:41.000Z | 2019-04-17T03:20:41.000Z | from flask import jsonify, current_app
try:
from google.protobuf.reflection import GeneratedProtocolMessageType
from google.protobuf.message import Message as ProtocolMessage
from google.protobuf.descriptor import FieldDescriptor
except ImportError:
pass
class SerializerBase:
def serialize(self, ... | 30.519608 | 73 | 0.628654 |
f644261e40dd6971176c7024cd583922bb929597 | 974 | py | Python | 基础教程/A2-神经网络基本原理/第1步 - 基本知识/src/ch02-BASIC/Level5_LearningRate.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 11,094 | 2019-05-07T02:48:50.000Z | 2022-03-31T08:49:42.000Z | 基础教程/A2-神经网络基本原理/第1步 - 基本知识/src/ch02-BASIC/Level5_LearningRate.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 157 | 2019-05-13T15:07:19.000Z | 2022-03-23T08:52:32.000Z | 基础教程/A2-神经网络基本原理/第1步 - 基本知识/src/ch02-BASIC/Level5_LearningRate.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 2,412 | 2019-05-07T02:55:15.000Z | 2022-03-30T06:56:52.000Z | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
import numpy as np
import matplotlib.pyplot as plt
def targetFunction(x):
y = (x-1)**2 + 0.1
return y
def derivativeFun(x):
y = 2*(x-1)
return y
def cr... | 19.877551 | 100 | 0.544148 |
0c2a926618bfd9c176a5b163db74cad44fd78ae2 | 19,127 | py | Python | google/cloud/aiplatform_v1beta1/types/explanation_metadata.py | dizcology/python-aiplatform | 1a135775966c8a2303ded529eba514dcf9db7205 | [
"Apache-2.0"
] | 2 | 2021-10-02T02:25:44.000Z | 2021-11-17T10:35:01.000Z | google/cloud/aiplatform_v1beta1/types/explanation_metadata.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | 1 | 2021-03-02T18:25:00.000Z | 2021-03-02T18:25:00.000Z | google/cloud/aiplatform_v1beta1/types/explanation_metadata.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 49.04359 | 129 | 0.619125 |
54fe4130942c90a7856ef386e252325c47408c86 | 1,201 | py | Python | apps/ingest/migrations/0001_squashed_0005_auto_20201027_1653.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 18 | 2017-06-12T09:58:02.000Z | 2021-10-01T11:14:34.000Z | apps/ingest/migrations/0001_squashed_0005_auto_20201027_1653.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 276 | 2019-04-26T20:13:01.000Z | 2022-03-31T10:26:28.000Z | apps/ingest/migrations/0001_squashed_0005_auto_20201027_1653.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 7 | 2018-03-13T23:44:26.000Z | 2021-09-15T17:54:55.000Z | # Generated by Django 2.2.10 on 2020-10-29 15:21
import apps.ingest.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
replaces = [('ingest', '0001_initial'), ('ingest', '0002_auto_20201021_1610'), ('ingest', '0003_auto_20201027_1452'), ('inge... | 38.741935 | 199 | 0.644463 |
c941153434bdc707eea163e86ebf1cabe765f7b8 | 9,817 | py | Python | code/analysis/trajectory_plotter.py | weidel-p/go-robot-nogo-robot | 026f1f753125089a03504320cc94a76888a0efc5 | [
"MIT"
] | 1 | 2020-09-23T22:16:10.000Z | 2020-09-23T22:16:10.000Z | code/analysis/trajectory_plotter.py | weidel-p/go-robot-nogo-robot | 026f1f753125089a03504320cc94a76888a0efc5 | [
"MIT"
] | null | null | null | code/analysis/trajectory_plotter.py | weidel-p/go-robot-nogo-robot | 026f1f753125089a03504320cc94a76888a0efc5 | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('Agg')
import numpy as np
import pylab as pl
import os
import pickle
import json
import rosbag
import sys
import transformations as trans
import math
import os
import scipy.signal as sciSig
import yaml
import colors
sys.path.append("code/striatal_model")
import params
from plot_tools2 i... | 31.264331 | 116 | 0.675563 |
5cf729ab3f85f5ea91d334540ff92782219d42d6 | 5,327 | py | Python | scrnatools/plotting/_gene_density_plot.py | j-germino/sc-rna-tools-git | 4e9a4fce40f6a303a1869e93a6e52e8db663bd06 | [
"BSD-3-Clause"
] | null | null | null | scrnatools/plotting/_gene_density_plot.py | j-germino/sc-rna-tools-git | 4e9a4fce40f6a303a1869e93a6e52e8db663bd06 | [
"BSD-3-Clause"
] | null | null | null | scrnatools/plotting/_gene_density_plot.py | j-germino/sc-rna-tools-git | 4e9a4fce40f6a303a1869e93a6e52e8db663bd06 | [
"BSD-3-Clause"
] | null | null | null | """
Creates gene density plots for scRNAseq datasets
From sc-rna-tools package
Created on Mon Jan 10 15:57:46 2022
@author: joe germino (joe.germino@ucsf.edu)
"""
# external package imports
from anndata import AnnData
from typing import List, Optional, Tuple
import seaborn as sns
import matplotlib.pyplot as plt
from ... | 35.278146 | 120 | 0.56636 |
d81c21363f4b377563d2ea00677dc146f8c9f8a8 | 2,547 | py | Python | knapsack.py | lefedoreichmann/pytorch-vsumm-reinforce | 3eddd54166fbdc5cec8ee93c54b98999aaf8f3f4 | [
"MIT"
] | 18 | 2019-10-17T02:05:40.000Z | 2021-05-08T15:39:49.000Z | knapsack.py | lefedoreichmann/pytorch-vsumm-reinforce | 3eddd54166fbdc5cec8ee93c54b98999aaf8f3f4 | [
"MIT"
] | null | null | null | knapsack.py | lefedoreichmann/pytorch-vsumm-reinforce | 3eddd54166fbdc5cec8ee93c54b98999aaf8f3f4 | [
"MIT"
] | 1 | 2020-07-27T20:46:14.000Z | 2020-07-27T20:46:14.000Z | import numpy as np
'''
------------------------------------------------
Use dynamic programming (DP) to solve 0/1 knapsack problem
Time complexity: O(nW), where n is number of items and W is capacity
Author: Kaiyang Zhou
Website: https://kaiyangzhou.github.io/
------------------------------------------------
knapsack... | 32.653846 | 85 | 0.616019 |
3f8ee53ac072b1a6c37890193278b6f6c31469c6 | 48,689 | py | Python | src/pfeifferpumps/pfeifferproto.py | tspspi/pfeifferpumps | 9776e5ff5a2386867da3c721daab74de38a6b071 | [
"BSD-3-Clause"
] | 1 | 2021-12-01T21:03:00.000Z | 2021-12-01T21:03:00.000Z | src/pfeifferpumps/pfeifferproto.py | tspspi/pfeifferpumps | 9776e5ff5a2386867da3c721daab74de38a6b071 | [
"BSD-3-Clause"
] | null | null | null | src/pfeifferpumps/pfeifferproto.py | tspspi/pfeifferpumps | 9776e5ff5a2386867da3c721daab74de38a6b071 | [
"BSD-3-Clause"
] | null | null | null | class SerialProtocolViolation(Exception):
pass
class SerialProtocolUnknownRegister(Exception):
pass
class SerialCommunicationError(Exception):
pass
class SerialSimulationDone(Exception):
pass
class PfeifferProtocol:
def __enter__(self):
return self
def __exit__(self, exc_type, exc_va... | 111.672018 | 819 | 0.551521 |
953c89c952d810fd9049199b6b71cca25092c14a | 14,437 | py | Python | grr/lib/lexer.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/lib/lexer.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | 1 | 2018-05-08T21:15:51.000Z | 2018-05-08T21:15:51.000Z | grr/lib/lexer.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""An LL(1) lexer. This lexer is very tolerant of errors and can resync."""
import logging
import re
from grr.lib import utils
class Token(object):
"""A token action."""
state_regex = None
def __init__(self, state_regex, regex, actions, next_state, flags=re.I):
"""Constructor.
... | 29.04829 | 80 | 0.626377 |
48103576b9d5c35345b18525aea187f3b526380d | 9,561 | py | Python | mmfewshot/detection/models/detectors/attention_rpn_detector.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 376 | 2021-11-23T13:29:57.000Z | 2022-03-30T07:22:14.000Z | mmfewshot/detection/models/detectors/attention_rpn_detector.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 51 | 2021-11-23T14:45:08.000Z | 2022-03-30T03:37:15.000Z | mmfewshot/detection/models/detectors/attention_rpn_detector.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 56 | 2021-11-23T14:02:27.000Z | 2022-03-31T09:01:50.000Z | # Copyright (c) OpenMMLab. All rights reserved.
from typing import Dict, List, Optional
import numpy as np
import torch
from mmcv.runner import auto_fp16
from mmcv.utils import ConfigDict
from mmdet.core import bbox2roi
from mmdet.models.builder import DETECTORS
from torch import Tensor
from .query_support_detector i... | 43.459091 | 78 | 0.599414 |
b85e5dcf363284d8d31371e8f449c931e0efe6f4 | 192 | py | Python | rllib/algorithms/alpha_star/__init__.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | rllib/algorithms/alpha_star/__init__.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | 41 | 2021-09-21T01:13:48.000Z | 2022-03-19T07:12:22.000Z | rllib/algorithms/alpha_star/__init__.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | from ray.rllib.algorithms.alpha_star.alpha_star import (
AlphaStar,
AlphaStarConfig,
DEFAULT_CONFIG,
)
__all__ = [
"AlphaStar",
"AlphaStarConfig",
"DEFAULT_CONFIG",
]
| 16 | 56 | 0.682292 |
aa9755c12e9faa4abbe16fc6701be6768d045131 | 2,979 | py | Python | scripts/tilestache-render.py | shoeberto/TileStache | 4526076e9326512a0542adaae86a946e08df8547 | [
"BSD-3-Clause"
] | 414 | 2015-01-05T19:29:22.000Z | 2022-03-26T03:39:42.000Z | scripts/tilestache-render.py | shoeberto/TileStache | 4526076e9326512a0542adaae86a946e08df8547 | [
"BSD-3-Clause"
] | 134 | 2015-01-15T08:25:55.000Z | 2021-09-02T16:06:00.000Z | scripts/tilestache-render.py | shoeberto/TileStache | 4526076e9326512a0542adaae86a946e08df8547 | [
"BSD-3-Clause"
] | 176 | 2015-01-09T14:43:25.000Z | 2022-03-04T16:53:27.000Z | #!/usr/bin/env python
"""tilestache-render.py will warm your cache.
This script is *deprecated* and will be removed in a future TileStache 2.0.
This script is intended to be run directly. This example will save two tiles
for San Francisco and Oakland to local temporary files:
tilestache-render.py -c ./config.jso... | 32.032258 | 166 | 0.664317 |
c7c891023b016e67fe34dc9cb34cb1f7222b9657 | 46,161 | py | Python | tests/unit/gapic/dialogflow_v2/test_sessions.py | martini9393/python-dialogflow | 69bf02c733c7116840b15992f505cc298ed55b86 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/dialogflow_v2/test_sessions.py | martini9393/python-dialogflow | 69bf02c733c7116840b15992f505cc298ed55b86 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/dialogflow_v2/test_sessions.py | martini9393/python-dialogflow | 69bf02c733c7116840b15992f505cc298ed55b86 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.72315 | 106 | 0.677022 |
e04d14fd29d1f84173279757815dad575ccf6699 | 147 | py | Python | 16.py | abphilip-codes/Codechef_DSA | ee93243fdd1c16ce8d8163e92f0764bd5a64436c | [
"MIT"
] | 1 | 2021-11-25T13:39:49.000Z | 2021-11-25T13:39:49.000Z | 16.py | abphilip-codes/Codechef_DSA | ee93243fdd1c16ce8d8163e92f0764bd5a64436c | [
"MIT"
] | null | null | null | 16.py | abphilip-codes/Codechef_DSA | ee93243fdd1c16ce8d8163e92f0764bd5a64436c | [
"MIT"
] | 1 | 2021-07-14T17:51:24.000Z | 2021-07-14T17:51:24.000Z | # https://www.codechef.com/LRNDSA01/problems/TEST
# Brute Force Approach
while True:
n = int(input())
if(n!=42): print(n)
else: break | 18.375 | 49 | 0.646259 |
ec6e2bd1a9d46117dbc08f323639192cfc7f1146 | 2,130 | py | Python | tests/brainview/test_atlasviewer.py | dfsp-spirit/brainview | fdb45fdb694b098c99e7d4db4aaeb56bb5902144 | [
"MIT"
] | 3 | 2019-01-20T05:58:04.000Z | 2020-09-02T12:37:14.000Z | tests/brainview/test_atlasviewer.py | dfsp-spirit/brainview | fdb45fdb694b098c99e7d4db4aaeb56bb5902144 | [
"MIT"
] | null | null | null | tests/brainview/test_atlasviewer.py | dfsp-spirit/brainview | fdb45fdb694b098c99e7d4db4aaeb56bb5902144 | [
"MIT"
] | null | null | null | # Tests for the atlasviewer script.
#
# These tests require the package `pytest-console-scripts`.
import os
import pytest
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(THIS_DIR, os.pardir, 'test_data')
def test_atlasviewer_help(script_runner):
ret = script_runner.run('atlasvi... | 40.188679 | 100 | 0.732864 |
774f04ecfbe56ed5980d2be94203ca83c5f51d46 | 2,669 | py | Python | chrono/refiners/en/merge_date_time.py | wanasit/chrono-python | 2e3bb44f876fc381a73050d9dda58de296306dc0 | [
"MIT"
] | 20 | 2016-07-21T11:27:46.000Z | 2022-01-30T16:12:46.000Z | chrono/refiners/en/merge_date_time.py | wanasit/chrono-python | 2e3bb44f876fc381a73050d9dda58de296306dc0 | [
"MIT"
] | 2 | 2016-11-21T05:46:19.000Z | 2019-03-23T06:41:21.000Z | chrono/refiners/en/merge_date_time.py | wanasit/chrono-python | 2e3bb44f876fc381a73050d9dda58de296306dc0 | [
"MIT"
] | 5 | 2015-06-28T07:21:31.000Z | 2020-07-28T19:54:29.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-
import re
from ..refiner import Refiner
from ..refiner import ParsedResult
from ..refiner import ParsedComponent
class ENMergeDateTimeRefiner(Refiner):
def refine(self, results, text, options):
if len(results) < 2: return results
merged_res... | 33.3625 | 107 | 0.650806 |
40880009cf8eccebefcdc58a5d39f7380138be17 | 552 | py | Python | src/ychaos/testplan/__init__.py | eisenhowerj/ychaos | de7572e35d89eedb5d7d2ad6a8e1fda52179eccc | [
"Apache-2.0"
] | 8 | 2021-07-21T15:37:48.000Z | 2022-03-03T14:43:09.000Z | src/ychaos/testplan/__init__.py | eisenhowerj/ychaos | de7572e35d89eedb5d7d2ad6a8e1fda52179eccc | [
"Apache-2.0"
] | 102 | 2021-07-20T16:08:29.000Z | 2022-03-25T07:28:37.000Z | src/ychaos/testplan/__init__.py | eisenhowerj/ychaos | de7572e35d89eedb5d7d2ad6a8e1fda52179eccc | [
"Apache-2.0"
] | 8 | 2021-07-20T13:37:46.000Z | 2022-02-18T01:44:52.000Z | # Copyright 2021, Yahoo
# Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms
from enum import Enum
from typing import Any, Dict
from pydantic import BaseModel
class SystemState(Enum):
STEADY = "STEADY"
CHAOS = "CHAOS"
RECOVERED = "RECOVERED"
class ... | 25.090909 | 105 | 0.663043 |
2d137edf48a4b769eb0d2f8c99aee125b00f47d5 | 16,409 | py | Python | tests/test_feedexport.py | kooy/scrapy | 776129a9513e2b6ab6f7e8cda1dd3de66cbbff44 | [
"BSD-3-Clause"
] | 1 | 2017-03-04T20:21:43.000Z | 2017-03-04T20:21:43.000Z | tests/test_feedexport.py | kooy/scrapy | 776129a9513e2b6ab6f7e8cda1dd3de66cbbff44 | [
"BSD-3-Clause"
] | null | null | null | tests/test_feedexport.py | kooy/scrapy | 776129a9513e2b6ab6f7e8cda1dd3de66cbbff44 | [
"BSD-3-Clause"
] | 1 | 2021-01-24T17:57:21.000Z | 2021-01-24T17:57:21.000Z | from __future__ import absolute_import
import os
import csv
import json
from io import BytesIO
import tempfile
import shutil
from six.moves.urllib.parse import urlparse
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.internet import defer
from scrapy.crawler import Crawle... | 36.464444 | 130 | 0.589372 |
6ac72ee8f0686714f026f863150b9a539fbb86e4 | 3,512 | py | Python | moto/cognitoidentity/responses.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | moto/cognitoidentity/responses.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | moto/cognitoidentity/responses.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | from moto.core.responses import BaseResponse
from .models import cognitoidentity_backends
from .utils import get_random_identity_id
class CognitoIdentityResponse(BaseResponse):
@property
def backend(self):
return cognitoidentity_backends[self.region]
def create_identity_pool(self):
identi... | 42.829268 | 87 | 0.725228 |
ab392f461e782fba348ea0cb6ee3efebe4f42526 | 2,181 | py | Python | grappelli/dashboard/templatetags/grp_dashboard_tags.py | fragaria/django-grappelli | 3bac1d1a63260d6df0bfa15ef7c23aef5e3e9b49 | [
"BSD-3-Clause"
] | null | null | null | grappelli/dashboard/templatetags/grp_dashboard_tags.py | fragaria/django-grappelli | 3bac1d1a63260d6df0bfa15ef7c23aef5e3e9b49 | [
"BSD-3-Clause"
] | null | null | null | grappelli/dashboard/templatetags/grp_dashboard_tags.py | fragaria/django-grappelli | 3bac1d1a63260d6df0bfa15ef7c23aef5e3e9b49 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Dashboard template tags, the following dashboard tags are available:
* ``{% grp_render_dashboard %}``
* ``{% grp_render_dashboard_module %}``
To load the dashboard tags: ``{% load grp_dashboard_tags %}``.
"""
# DJANGO IMPORTS
from django import template
from django.core.urlresolvers import reve... | 31.157143 | 87 | 0.695552 |
def094ccaabe2da0a71e6ad70a1f0a5126e7e21e | 4,327 | py | Python | contrib/seeds/generate-seeds.py | wealthsilo/WealthSilo | 318df3155e8ede3e2c34fd4b02bf4a7ee8d53e65 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | wealthsilo/WealthSilo | 318df3155e8ede3e2c34fd4b02bf4a7ee8d53e65 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | wealthsilo/WealthSilo | 318df3155e8ede3e2c34fd4b02bf4a7ee8d53e65 | [
"MIT"
] | 1 | 2018-08-10T23:57:27.000Z | 2018-08-10T23:57:27.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.355072 | 98 | 0.581465 |
c467220833b41e073acaf6043b8b6d2213aa3bf8 | 208 | py | Python | python/testData/quickFixes/PyRemoveParameterQuickFixTest/topLevelOverloadsAndImplementation.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/quickFixes/PyRemoveParameterQuickFixTest/topLevelOverloadsAndImplementation.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/quickFixes/PyRemoveParameterQuickFixTest/topLevelOverloadsAndImplementation.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from typing import overload
@overload
def foo() -> None:
pass
@overload
def foo(value: int) -> str:
pass
@overload
def foo(value: str) -> str:
pass
def foo(va<caret>lue=None):
return None | 12.235294 | 27 | 0.644231 |
e59255febc78ce9a7a46cbbb7a50761046cca30b | 2,667 | py | Python | custom_components/vapix/doors.py | jadson179/vapix | 152bd7d929a9d8dac0b5f35b02609bd46d7696fe | [
"MIT"
] | null | null | null | custom_components/vapix/doors.py | jadson179/vapix | 152bd7d929a9d8dac0b5f35b02609bd46d7696fe | [
"MIT"
] | 6 | 2021-02-15T21:47:25.000Z | 2021-06-22T11:48:41.000Z | custom_components/vapix/doors.py | jadson179/vapix | 152bd7d929a9d8dac0b5f35b02609bd46d7696fe | [
"MIT"
] | null | null | null | from requests import post
from requests.auth import HTTPDigestAuth
from homeassistant.core import HomeAssistant
import json
from homeassistant.core import ServiceCall
def open_remote_door(call: ServiceCall):
ip = call.data.get("ip", "")
username = call.data.get("username", "")
password = call.data.get("pa... | 25.160377 | 56 | 0.592801 |
673abf999d12db3c2144b3e2c6a38ae8091b218b | 8,532 | py | Python | examples/mnli_example/main.distill.py | mariushes/TextBrewer | 182397e80e08c4c794edd17e8406852474ffa157 | [
"Apache-2.0"
] | null | null | null | examples/mnli_example/main.distill.py | mariushes/TextBrewer | 182397e80e08c4c794edd17e8406852474ffa157 | [
"Apache-2.0"
] | null | null | null | examples/mnli_example/main.distill.py | mariushes/TextBrewer | 182397e80e08c4c794edd17e8406852474ffa157 | [
"Apache-2.0"
] | null | null | null | import logging
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
datefmt='%Y/%m/%d %H:%M:%S',
level=logging.INFO,
)
logger = logging.getLogger("Main")
import os,random
import numpy as np
import torch
from utils_glue import output_modes, processors
from transformers im... | 42.237624 | 179 | 0.680497 |
cc361938c9c7cb7763411bada91158fe8e10c01d | 3,743 | py | Python | test/test_parser/test_convert.py | skirpichev/Mathics | 318e06dea8f1c70758a50cb2f95c9900150e3a68 | [
"Apache-2.0"
] | 1,920 | 2015-01-06T17:56:26.000Z | 2022-03-24T14:33:29.000Z | test/test_parser/test_convert.py | skirpichev/Mathics | 318e06dea8f1c70758a50cb2f95c9900150e3a68 | [
"Apache-2.0"
] | 868 | 2015-01-04T06:19:40.000Z | 2022-03-14T13:39:38.000Z | test/test_parser/test_convert.py | skirpichev/Mathics | 318e06dea8f1c70758a50cb2f95c9900150e3a68 | [
"Apache-2.0"
] | 240 | 2015-01-16T13:31:26.000Z | 2022-03-12T12:52:46.000Z | import unittest
import random
import sys
from mathics_scanner import (
IncompleteSyntaxError,
InvalidSyntaxError,
ScanError,
SingleLineFeeder,
)
from mathics.core.definitions import Definitions
from mathics.core.parser import parse
from mathics.core.expression import (
Symbol,
Integer,
Int... | 29.706349 | 78 | 0.585627 |
3d368f7e32e71ab2cde5159066d780d058e3c1b6 | 22,512 | py | Python | fd/vectorisation.py | ZakariaELHAJOUY/field-delineation | 2bd13d09b1fb107603fe5ccb862584e01aa5b067 | [
"MIT"
] | 53 | 2021-01-20T16:32:16.000Z | 2022-03-30T21:42:12.000Z | fd/vectorisation.py | ZakariaELHAJOUY/field-delineation | 2bd13d09b1fb107603fe5ccb862584e01aa5b067 | [
"MIT"
] | 5 | 2021-02-13T17:41:53.000Z | 2022-03-29T14:45:11.000Z | fd/vectorisation.py | ZakariaELHAJOUY/field-delineation | 2bd13d09b1fb107603fe5ccb862584e01aa5b067 | [
"MIT"
] | 21 | 2021-02-19T16:15:43.000Z | 2022-03-23T09:21:37.000Z | #
# Copyright (c) Sinergise, 2019 -- 2021.
#
# This file belongs to subproject "field-delineation" of project NIVA (www.niva4cap.eu).
# All rights reserved.
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
#
import os
import time
import loggi... | 42.798479 | 129 | 0.640903 |
b54cc793ba5e8b11114599a3cb8bc1b0deea9a11 | 4,221 | py | Python | experiment_estimate_opt.py | xyguo/OnlineKZMedian | aa66be0406f7597d123c14bf72450dce432f965d | [
"MIT"
] | null | null | null | experiment_estimate_opt.py | xyguo/OnlineKZMedian | aa66be0406f7597d123c14bf72450dce432f965d | [
"MIT"
] | null | null | null | experiment_estimate_opt.py | xyguo/OnlineKZMedian | aa66be0406f7597d123c14bf72450dce432f965d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This code is for estimating the offline OPT on the data set.
"""
import numpy as np
from datetime import datetime
from sklearn.metrics import pairwise_distances
from time import time
from utils import compute_cost, kz_means, kzmedian_cost_, coreset
from utils import gaussian_mixture, add_ou... | 35.771186 | 116 | 0.680171 |
5db4d02afc2830d573341a78e81469b6de5b7896 | 10,927 | py | Python | venv/Lib/site-packages/websocket/_http.py | GuilhermeJC13/storIA | eeecbe9030426f70c6aa73ca0ce8382860c8495c | [
"MIT"
] | 4 | 2021-07-27T23:39:02.000Z | 2021-09-23T04:17:08.000Z | venv/Lib/site-packages/websocket/_http.py | GuilhermeJC13/storIA | eeecbe9030426f70c6aa73ca0ce8382860c8495c | [
"MIT"
] | 12 | 2021-04-11T19:46:06.000Z | 2021-06-18T16:08:37.000Z | venv/Lib/site-packages/websocket/_http.py | GuilhermeJC13/storIA | eeecbe9030426f70c6aa73ca0ce8382860c8495c | [
"MIT"
] | 3 | 2021-07-27T17:33:58.000Z | 2021-07-29T12:46:59.000Z | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, ... | 33.621538 | 118 | 0.619932 |
321a4e34e6018707364075d6c8f72522fe86c0bf | 793 | py | Python | aiogram/__init__.py | Latand/aiogram | 78aee861bb77601691916feb5a9c8efbdb65956b | [
"MIT"
] | 3 | 2020-12-06T16:55:53.000Z | 2021-11-19T19:25:57.000Z | aiogram/__init__.py | Latand/aiogram | 78aee861bb77601691916feb5a9c8efbdb65956b | [
"MIT"
] | null | null | null | aiogram/__init__.py | Latand/aiogram | 78aee861bb77601691916feb5a9c8efbdb65956b | [
"MIT"
] | 2 | 2020-12-30T09:51:30.000Z | 2021-11-10T16:50:28.000Z | import asyncio
import os
from . import bot
from . import contrib
from . import dispatcher
from . import types
from . import utils
from .bot import Bot
from .dispatcher import Dispatcher
from .dispatcher import filters
from .dispatcher import middlewares
from .utils import exceptions, executor, helper, markdown as md
... | 18.44186 | 63 | 0.675914 |
ebde7a07b9aea1f8999e65cc76f6ea31f99617a2 | 4,400 | py | Python | tests/enumerator_test.py | jnice-81/dace | 5211794a2d17b7189037ac485ab0b292fb02aa0d | [
"BSD-3-Clause"
] | 227 | 2019-03-15T23:39:06.000Z | 2022-03-30T07:49:08.000Z | tests/enumerator_test.py | jnice-81/dace | 5211794a2d17b7189037ac485ab0b292fb02aa0d | [
"BSD-3-Clause"
] | 834 | 2019-07-31T22:49:31.000Z | 2022-03-28T14:01:32.000Z | tests/enumerator_test.py | jnice-81/dace | 5211794a2d17b7189037ac485ab0b292fb02aa0d | [
"BSD-3-Clause"
] | 64 | 2019-03-19T05:40:37.000Z | 2022-03-11T15:02:42.000Z | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
from dace.transformation.estimator.enumeration.brute_force_enumerator import BruteForceEnumerator
from dace.transformation.estimator.enumeration.connected_enumerator import ConnectedEnumerator
import dace
import numpy as np
import pytest
from ... | 30.344828 | 97 | 0.651591 |
e31ed9df7907a79212a5dedff080bbea0e55dd8a | 2,851 | py | Python | app/views.py | Yashwantbokadia/blockchainproject | 74269e1cf86c42a159243842d0b1ce13454f3f49 | [
"Apache-2.0"
] | null | null | null | app/views.py | Yashwantbokadia/blockchainproject | 74269e1cf86c42a159243842d0b1ce13454f3f49 | [
"Apache-2.0"
] | null | null | null | app/views.py | Yashwantbokadia/blockchainproject | 74269e1cf86c42a159243842d0b1ce13454f3f49 | [
"Apache-2.0"
] | null | null | null | import datetime
import json
from hashlib import sha256
import requests
from flask import render_template, redirect, request
from app import app
# The node with which our application interacts, there can be multiple
# such nodes as well.
CONNECTED_NODE_ADDRESS = "http://0.0.0.0:8000"
posts = []
def fetch_posts():
... | 29.697917 | 193 | 0.612767 |
6d83ba7cfcd9411b4348c91ecf661bc58d85ea10 | 656 | py | Python | src/scripts/output.py | wnjustdoit/devops-py | 54dd722a577c4b3ecda45aa85c067130fd292ab9 | [
"Apache-2.0"
] | null | null | null | src/scripts/output.py | wnjustdoit/devops-py | 54dd722a577c4b3ecda45aa85c067130fd292ab9 | [
"Apache-2.0"
] | 6 | 2021-04-08T20:46:56.000Z | 2022-01-13T01:52:06.000Z | src/scripts/output.py | wnjustdoit/devops-py | 54dd722a577c4b3ecda45aa85c067130fd292ab9 | [
"Apache-2.0"
] | null | null | null | # !/usr/bin/python3
import sys
def output_all(msg, resp=0, exit=False):
print(msg if resp == 0 else f'{msg}, status_code: {resp}')
if exit:
sys.exit(resp)
else:
sys.stdout.flush()
def output_strict(msg, resp):
if resp != 0:
output_error(msg, resp)
else:
output_st... | 17.263158 | 62 | 0.599085 |
8ce40385b0814109bcc27fce85199ea3a1db93ae | 6,672 | py | Python | days/__init__.py | Kurocon/AdventOfCode2016 | 357e55025c763baa9d838b70025f968ca5e92ed7 | [
"BSD-3-Clause"
] | null | null | null | days/__init__.py | Kurocon/AdventOfCode2016 | 357e55025c763baa9d838b70025f968ca5e92ed7 | [
"BSD-3-Clause"
] | null | null | null | days/__init__.py | Kurocon/AdventOfCode2016 | 357e55025c763baa9d838b70025f968ca5e92ed7 | [
"BSD-3-Clause"
] | null | null | null | import os
import glob
import sys
import time
import traceback
from typing import Generator
import requests
from aocdays import AOCDays
modules = filter(lambda x: not x.startswith('_'), glob.glob(os.path.dirname(__file__) + "/*.py"))
__all__ = [os.path.basename(f)[:-3] for f in modules]
def day(day_number):
def... | 35.115789 | 121 | 0.508693 |
cbe773635576609b3f14606058b02d5345306388 | 103 | py | Python | Apps/StudentHousing/apps.py | ResidenciApp/ResidenciAppServidor | 7cc8c66bc07d198be37232fdc74d64227d14ce3d | [
"MIT"
] | 2 | 2019-10-31T03:21:07.000Z | 2019-12-11T16:25:33.000Z | Apps/StudentHousing/apps.py | ResidenciApp/ResidenciAppServidor | 7cc8c66bc07d198be37232fdc74d64227d14ce3d | [
"MIT"
] | 6 | 2021-03-19T02:43:26.000Z | 2022-02-10T10:42:00.000Z | Apps/StudentHousing/apps.py | lmbaeza/ResidenciAppServidor | 7cc8c66bc07d198be37232fdc74d64227d14ce3d | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class StudenthousingConfig(AppConfig):
name = 'StudentHousing'
| 17.166667 | 38 | 0.786408 |
3b5f58326a6aa6c38b6d39cfb38cbc9cfef91eda | 1,997 | py | Python | ingenico/direct/sdk/domain/get_hosted_tokenization_response.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | null | null | null | ingenico/direct/sdk/domain/get_hosted_tokenization_response.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | 1 | 2021-03-30T12:55:39.000Z | 2021-04-08T08:23:27.000Z | ingenico/direct/sdk/domain/get_hosted_tokenization_response.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
from ingenico.direct.sdk.data_object import DataObject
from ingenico.direct.sdk.domain.token_response import TokenResponse
class GetHostedTokenizationResponse... | 33.283333 | 98 | 0.654982 |
c89c1d461602400c605b6bd931a137353ceae761 | 7,013 | py | Python | reclist/metrics/distance_metrics.py | nsbits/reclist | 2a41e1de5c36626f8081468c89b96630d6127315 | [
"MIT"
] | 183 | 2021-11-16T13:29:58.000Z | 2022-03-28T08:31:52.000Z | reclist/metrics/distance_metrics.py | nsbits/reclist | 2a41e1de5c36626f8081468c89b96630d6127315 | [
"MIT"
] | 1 | 2021-11-30T13:33:42.000Z | 2021-12-05T15:29:50.000Z | reclist/metrics/distance_metrics.py | nsbits/reclist | 2a41e1de5c36626f8081468c89b96630d6127315 | [
"MIT"
] | 8 | 2021-12-10T22:50:32.000Z | 2022-03-27T22:09:14.000Z | from scipy.spatial.distance import cosine
import matplotlib.pyplot as plt
from reclist.current import current
import os
import json
import networkx as nx
from networkx.algorithms.shortest_paths.generic import shortest_path
from statistics import mean
from reclist.metrics.standard_metrics import sample_misses_at_k, samp... | 38.961111 | 114 | 0.592043 |
86fc6630d873bdd718740d1fe235fe1954e7cf67 | 461 | py | Python | evotor/query_manager/urls.py | trukanduk/evotor_hackathon | 5aeec1886c9ca5dbb2d08d535885701062464fb0 | [
"MIT"
] | null | null | null | evotor/query_manager/urls.py | trukanduk/evotor_hackathon | 5aeec1886c9ca5dbb2d08d535885701062464fb0 | [
"MIT"
] | null | null | null | evotor/query_manager/urls.py | trukanduk/evotor_hackathon | 5aeec1886c9ca5dbb2d08d535885701062464fb0 | [
"MIT"
] | null | null | null | from django.conf.urls import url
import query_manager.views
urlpatterns = [
url(r'^json/(?P<model_name>[a-zA-Z0-9_]{1,})/$', query_manager.views.json_query_view),
url(r'^html/(?P<model_name>[a-zA-Z0-9_]{1,})/$', query_manager.views.html_query_view),
url(r'^update/(?P<model_name>[a-zA-Z0-9_]{1,})/$', query_... | 46.1 | 99 | 0.694143 |
34d205a97755830046bd8dea8104ad7f85e8ee84 | 2,015 | py | Python | lib/surface/emulators/datastore/__init__.py | eyalev/gcloud | 421ee63a0a6d90a097e8530d53a6df5b905a0205 | [
"Apache-2.0"
] | null | null | null | lib/surface/emulators/datastore/__init__.py | eyalev/gcloud | 421ee63a0a6d90a097e8530d53a6df5b905a0205 | [
"Apache-2.0"
] | null | null | null | lib/surface/emulators/datastore/__init__.py | eyalev/gcloud | 421ee63a0a6d90a097e8530d53a6df5b905a0205 | [
"Apache-2.0"
] | 2 | 2020-11-04T03:08:21.000Z | 2020-11-05T08:14:41.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.583333 | 78 | 0.679901 |
780c656171bb67df04542fa31f6cef8b9e56f7c7 | 560 | py | Python | setup.py | dreamplatform/dream-profile | 6f9067db124f07aabd409b5f80d01db03655b85c | [
"BSD-3-Clause"
] | null | null | null | setup.py | dreamplatform/dream-profile | 6f9067db124f07aabd409b5f80d01db03655b85c | [
"BSD-3-Clause"
] | null | null | null | setup.py | dreamplatform/dream-profile | 6f9067db124f07aabd409b5f80d01db03655b85c | [
"BSD-3-Clause"
] | null | null | null |
from setuptools import setup, find_packages
def get_version():
try:
import subprocess
p = subprocess.Popen('hg id -t', shell=True, stdout=subprocess.PIPE)
tag = p.stdout.read()[1:].strip()
return tag
except:
return 'dev'
setup(
name = "dream-profile",
version =... | 21.538462 | 76 | 0.610714 |
7a130d0369cc14b6836d65dab3129fd8a64abefc | 22,952 | py | Python | main_decoder.py | okwrtdsh/3D-ResNets-PyTorch | f36a32ea8b283524d1d102937c49689b1f475b5f | [
"MIT"
] | null | null | null | main_decoder.py | okwrtdsh/3D-ResNets-PyTorch | f36a32ea8b283524d1d102937c49689b1f475b5f | [
"MIT"
] | null | null | null | main_decoder.py | okwrtdsh/3D-ResNets-PyTorch | f36a32ea8b283524d1d102937c49689b1f475b5f | [
"MIT"
] | null | null | null | import os
os.environ['PYTHONHASHSEED'] = '0'
import random
random.seed(12345)
import numpy as np
np.random.seed(42)
import torch
torch.manual_seed(123)
if torch.cuda.is_available():
torch.cuda.manual_seed_all(123)
torch.backends.cudnn.enabled = True
from torch.backends import cudnn
cudnn.benchmark = True
import ... | 38.253333 | 152 | 0.547229 |
527754431164a6dd17227d9119b53df9ea5e1d06 | 9,403 | py | Python | CalibCalorimetry/HcalPlugins/python/Hcal_Conditions_forGlobalTag_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | CalibCalorimetry/HcalPlugins/python/Hcal_Conditions_forGlobalTag_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | CalibCalorimetry/HcalPlugins/python/Hcal_Conditions_forGlobalTag_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
## Recalibration Parameters
from DataFormats.HcalCalibObjects.HFRecalibrationParameters_cff import *
hcal_db_producer = cms.ESProducer("HcalDbProducer",
dump = cms.untracked.vstring(''),
file = cms.untracked.string('')
)
#------------------------- HARDCODED conditions... | 45.425121 | 177 | 0.618526 |
796e16b3465b75c30746beb085526ab3cb413525 | 33,850 | py | Python | server/src/weblab/core/coordinator/redis/priority_queue_scheduler.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/weblab/core/coordinator/redis/priority_queue_scheduler.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/weblab/core/coordinator/redis/priority_queue_scheduler.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | 50.825826 | 271 | 0.668951 |
f97b41e00312ca8204eba6d5739637c181b6e245 | 6,181 | py | Python | opps/archives/migrations/0002_auto__add_field_file_archive_link__chg_field_file_archive.py | jeanmask/opps | 031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87 | [
"MIT"
] | 159 | 2015-01-03T16:36:35.000Z | 2022-03-29T20:50:13.000Z | opps/archives/migrations/0002_auto__add_field_file_archive_link__chg_field_file_archive.py | jeanmask/opps | 031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87 | [
"MIT"
] | 81 | 2015-01-02T21:26:16.000Z | 2021-05-29T12:24:52.000Z | opps/archives/migrations/0002_auto__add_field_file_archive_link__chg_field_file_archive.py | jeanmask/opps | 031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87 | [
"MIT"
] | 75 | 2015-01-23T13:41:03.000Z | 2021-09-24T03:45:23.000Z | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'File.archive_link'
d... | 61.81 | 218 | 0.577576 |
55b8c46dc892c5d632dcf48394f5d16cc7625a8c | 2,343 | py | Python | src/robotide/widgets/dialog.py | crylearner/RIDE3X | 767f45b0c908f18ecc7473208def8dc7489f43b0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-08-20T14:46:02.000Z | 2017-08-20T14:46:02.000Z | src/robotide/widgets/dialog.py | crylearner/RIDE3X | 767f45b0c908f18ecc7473208def8dc7489f43b0 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robotide/widgets/dialog.py | crylearner/RIDE3X | 767f45b0c908f18ecc7473208def8dc7489f43b0 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 appl... | 35.5 | 78 | 0.64618 |
327ed44d1b8451902b0d8e41593c6ef41e571ba6 | 7,417 | py | Python | azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.626437 | 144 | 0.629904 |
337faf5f0e6c67eef48cc5ed3f0bde2537760753 | 10,997 | py | Python | cradmin_legacy/viewhelpers/multiselect2/target_renderer.py | appressoas/cradmin_legacy | b9d024299333dd04c87c1031bd5be5778aa7f1f1 | [
"BSD-3-Clause"
] | null | null | null | cradmin_legacy/viewhelpers/multiselect2/target_renderer.py | appressoas/cradmin_legacy | b9d024299333dd04c87c1031bd5be5778aa7f1f1 | [
"BSD-3-Clause"
] | 17 | 2018-03-07T15:52:42.000Z | 2022-03-12T01:07:06.000Z | cradmin_legacy/viewhelpers/multiselect2/target_renderer.py | appressoas/cradmin_legacy | b9d024299333dd04c87c1031bd5be5778aa7f1f1 | [
"BSD-3-Clause"
] | 1 | 2018-07-23T22:13:45.000Z | 2018-07-23T22:13:45.000Z | import json
from xml.sax.saxutils import quoteattr
from crispy_forms import layout
from django.utils.translation import pgettext_lazy
from cradmin_legacy import renderable
from cradmin_legacy.crispylayouts import PrimarySubmitBlock, CradminFormHelper
from cradmin_legacy.viewhelpers.listfilter.base import abstractfilt... | 34.581761 | 116 | 0.624261 |
42c99778f25b524851505b3149b144227bcc8794 | 1,109 | py | Python | migrations/versions/0177_add_virus_scan_statuses.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 51 | 2016-04-03T23:36:17.000Z | 2022-03-21T20:04:52.000Z | migrations/versions/0177_add_virus_scan_statuses.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 1,335 | 2015-12-15T14:28:50.000Z | 2022-03-30T16:24:27.000Z | migrations/versions/0177_add_virus_scan_statuses.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 30 | 2016-01-08T19:05:32.000Z | 2021-12-20T16:37:23.000Z | """
Revision ID: 0177_add_virus_scan_statuses
Revises: 0176_alter_billing_columns
Create Date: 2018-02-21 14:05:04.448977
"""
from alembic import op
revision = '0177_add_virus_scan_statuses'
down_revision = '0176_alter_billing_columns'
def upgrade():
op.execute("INSERT INTO notification_status_types (name) VA... | 39.607143 | 139 | 0.77908 |
3ac8dffae4974d1a976b2d75f25144048f5ffdde | 2,787 | py | Python | pysteps/tests/test_plt_precipfields.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 285 | 2018-07-11T10:42:43.000Z | 2022-03-23T13:44:54.000Z | pysteps/tests/test_plt_precipfields.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 246 | 2018-07-16T06:17:12.000Z | 2022-03-22T15:45:08.000Z | pysteps/tests/test_plt_precipfields.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 97 | 2018-07-12T12:05:45.000Z | 2022-03-31T14:56:31.000Z | # -*- coding: utf-8 -*-
import pytest
from pysteps.visualization import plot_precip_field
from pysteps.utils import conversion
from pysteps.postprocessing import ensemblestats
from pysteps.tests.helpers import get_precipitation_fields
import matplotlib.pyplot as plt
import numpy as np
plt_arg_names = (
"source",... | 32.034483 | 83 | 0.640115 |
6985993848520d165285fca051c147433fd69a22 | 4,013 | py | Python | google/ads/google_ads/v0/proto/enums/frequency_cap_time_unit_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v0/proto/enums/frequency_cap_time_unit_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v0/proto/enums/frequency_cap_time_unit_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v0/proto/enums/frequency_cap_time_unit.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mess... | 38.961165 | 647 | 0.784949 |
c10580816309817aa7951dd982ec752ef4ec8a75 | 24,957 | py | Python | lib/tool_shed/webapp/controllers/upload.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 4 | 2015-05-12T20:36:41.000Z | 2017-06-26T15:34:02.000Z | lib/tool_shed/webapp/controllers/upload.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 52 | 2015-03-16T14:02:14.000Z | 2021-12-24T09:50:23.000Z | lib/tool_shed/webapp/controllers/upload.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 1 | 2016-03-21T12:54:06.000Z | 2016-03-21T12:54:06.000Z | import logging
import os
import shutil
import tarfile
import tempfile
import requests
from galaxy import (
util,
web
)
from galaxy.util import checkers
from galaxy.webapps.base.controller import BaseUIController
from tool_shed.dependencies import attribute_handlers
from tool_shed.galaxy_install import depende... | 62.08209 | 138 | 0.498177 |
36c30d7a59699462252726790a8041aa4a8c495d | 3,842 | py | Python | basic_combat_simulator.py | amanparmar17/combat-simulator | 3ef258a58f667be0afe566e45e101d3e3073aa2f | [
"MIT"
] | null | null | null | basic_combat_simulator.py | amanparmar17/combat-simulator | 3ef258a58f667be0afe566e45e101d3e3073aa2f | [
"MIT"
] | null | null | null | basic_combat_simulator.py | amanparmar17/combat-simulator | 3ef258a58f667be0afe566e45e101d3e3073aa2f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 00:16:43 2019
@author: aman
"""
#%%
import random
#%% formation of army of user 2 i.e. computer
#consists of atleast 1 member
def inputmem2():
user2 = []
t = random.randint(0,10)
for i in range(0,t):
u = random.randint(1,3)
... | 27.056338 | 95 | 0.557002 |
41c81327843d3cf76e230cf0969e5d23621f8451 | 827 | py | Python | couchdiscover/__init__.py | enyachoke/couchdiscover | 95b5d2dde9ee7e2255edfa9825ac5c1bf5cac8b5 | [
"Apache-2.0"
] | null | null | null | couchdiscover/__init__.py | enyachoke/couchdiscover | 95b5d2dde9ee7e2255edfa9825ac5c1bf5cac8b5 | [
"Apache-2.0"
] | null | null | null | couchdiscover/__init__.py | enyachoke/couchdiscover | 95b5d2dde9ee7e2255edfa9825ac5c1bf5cac8b5 | [
"Apache-2.0"
] | null | null | null | """
CouchDiscover
~~~~~~~~~~~~~
CouchDB 2.0 Autodiscovery for Kubernetes Environments.
Example:
>>> import couchdiscover
>>> couchdiscover.entrypoints.main()
"""
from . import config, util, exceptions, kube, couch, manage, entrypoints
from .kube import KubeHostname, KubeAPIClient, KubeInterface
from .couch i... | 25.84375 | 75 | 0.76179 |
34df0fec3386053088033e7d4b24b1354ca9aa94 | 8,447 | py | Python | msgraph-cli-extensions/v1_0/usersactions_v1_0/azext_usersactions_v1_0/vendored_sdks/usersactions/operations/_users_mail_folders_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/usersactions_v1_0/azext_usersactions_v1_0/vendored_sdks/usersactions/operations/_users_mail_folders_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/usersactions_v1_0/azext_usersactions_v1_0/vendored_sdks/usersactions/operations/_users_mail_folders_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"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 may ... | 46.927778 | 160 | 0.68545 |
26a9fbe8999a603cdf906290db9d03c8190fd2dd | 1,132 | py | Python | scripts/plotTotalBytesByProb.py | Sunnout/ECO-SYNC-Tree | 0112a861c456e29353bc81a82975586a9e4d23ea | [
"MIT"
] | 1 | 2021-12-06T16:23:20.000Z | 2021-12-06T16:23:20.000Z | scripts/plotTotalBytesByProb.py | Sunnout/ECO-SYNC-Tree | 0112a861c456e29353bc81a82975586a9e4d23ea | [
"MIT"
] | null | null | null | scripts/plotTotalBytesByProb.py | Sunnout/ECO-SYNC-Tree | 0112a861c456e29353bc81a82975586a9e4d23ea | [
"MIT"
] | null | null | null | import sys
import numpy as np
import matplotlib.pyplot as plt
from commonInformation import *
exp_name = sys.argv[1]
nodes = sys.argv[2]
protos = sys.argv[3]
payloads = sys.argv[4]
probs = sys.argv[5]
runs = sys.argv[6]
probs = probs.split(",")
protos = protos.split(",")
bytes = {}
for proto in protos:
bytes[pr... | 25.727273 | 122 | 0.672261 |
25a9e803eca1d93a5c202af67d8ced4956fb87e5 | 988 | py | Python | tests/unit/pipert/core/utils/dummy_routines/dummy_destination_routine.py | OperationalBina/PipeRT2 | 2033f7c55d4eeca4749f6a0cc151a65863d3dfde | [
"MIT"
] | 1 | 2021-11-23T17:20:11.000Z | 2021-11-23T17:20:11.000Z | tests/unit/pipert/core/utils/dummy_routines/dummy_destination_routine.py | OperationalBina/PipeRT2 | 2033f7c55d4eeca4749f6a0cc151a65863d3dfde | [
"MIT"
] | 124 | 2021-05-10T06:35:48.000Z | 2022-03-10T09:25:27.000Z | tests/unit/pipert/core/utils/dummy_routines/dummy_destination_routine.py | OperationalBina/PipeRT2 | 2033f7c55d4eeca4749f6a0cc151a65863d3dfde | [
"MIT"
] | 4 | 2021-09-12T08:10:10.000Z | 2021-11-29T12:10:20.000Z | from pipert2.core.base.routines import DestinationRoutine
from tests.unit.pipert.core.utils.dummy_routines.dummy_middle_routine import DUMMY_ROUTINE_EVENT
class DummyDestinationRoutine(DestinationRoutine):
def __init__(self, name="dummy_end_routine"):
super(DummyDestinationRoutine, self).__init__(nam... | 25.333333 | 96 | 0.673077 |
07a40a3f426c6bcfe63bf6dac79384d9025726b0 | 5,072 | py | Python | tests/engine.py | vasjapavlovic/eda5 | bc4b387b24239ea1dfb927657f05ddabbf707479 | [
"BSD-3-Clause"
] | null | null | null | tests/engine.py | vasjapavlovic/eda5 | bc4b387b24239ea1dfb927657f05ddabbf707479 | [
"BSD-3-Clause"
] | null | null | null | tests/engine.py | vasjapavlovic/eda5 | bc4b387b24239ea1dfb927657f05ddabbf707479 | [
"BSD-3-Clause"
] | null | null | null | from subprocess import call
from os import path
import hitchpostgres
import hitchselenium
import hitchpython
import hitchserve
import hitchredis
import hitchtest
import hitchsmtp
# Get directory above this file
PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..'))
class ExecutionEngine(hitchtest... | 34.040268 | 114 | 0.626774 |
85ce2a048c97713b649a703c4f3ecd2afd2894d3 | 1,635 | py | Python | examples/security/roles.py | checkaayush/eve | 8031797458d6edd17f85df92b340be368313f12d | [
"BSD-3-Clause"
] | 3,122 | 2017-03-08T12:47:07.000Z | 2022-03-31T10:55:19.000Z | examples/security/roles.py | checkaayush/eve | 8031797458d6edd17f85df92b340be368313f12d | [
"BSD-3-Clause"
] | 559 | 2017-03-08T08:51:40.000Z | 2022-03-29T09:33:40.000Z | examples/security/roles.py | checkaayush/eve | 8031797458d6edd17f85df92b340be368313f12d | [
"BSD-3-Clause"
] | 428 | 2017-03-07T16:03:16.000Z | 2022-03-18T02:05:23.000Z | # -*- coding: utf-8 -*-
"""
Auth-SHA1/HMAC-Roles
~~~~~~~~~~~~~~~~~~~~
Securing an Eve-powered API with Basic Authentication (RFC2617) and user
roles.
This script assumes that user accounts are stored in an 'accounts' MongoDB
collection, that passwords are stored as SHA1/HMAC hashes and that u... | 34.0625 | 79 | 0.699083 |
74c532babd56231afdea7221af82f9047266dc0a | 216 | py | Python | flaskwebapp/web/app.py | kurianbenoy/Docker-101 | 862d188d402e77be74994be0f07417b55d1b8dde | [
"MIT"
] | null | null | null | flaskwebapp/web/app.py | kurianbenoy/Docker-101 | 862d188d402e77be74994be0f07417b55d1b8dde | [
"MIT"
] | null | null | null | flaskwebapp/web/app.py | kurianbenoy/Docker-101 | 862d188d402e77be74994be0f07417b55d1b8dde | [
"MIT"
] | null | null | null | from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_whale():
return render_template("whale_hello.html")
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
| 18 | 46 | 0.694444 |
15a665b19c6687f8818b342c5274f9a2594ff993 | 5,249 | py | Python | clusterapp/features/audio.py | ealmuina/thesis | d436ae0c6f775c56b2072889ceafae1507291c74 | [
"MIT"
] | 1 | 2018-02-11T07:36:31.000Z | 2018-02-11T07:36:31.000Z | clusterapp/features/audio.py | ealmuina/thesis | d436ae0c6f775c56b2072889ceafae1507291c74 | [
"MIT"
] | null | null | null | clusterapp/features/audio.py | ealmuina/thesis | d436ae0c6f775c56b2072889ceafae1507291c74 | [
"MIT"
] | null | null | null | from librosa.feature import mfcc
from .FreqParameters.BandwidthFreqParameter import BandwidthFreqParameter
from .FreqParameters.EnergyFreqParameter import EnergyFreqParameter
from .FreqParameters.EntropyFreqParameter import EntropyFreqParameter
from .FreqParameters.FluxFreqParameter import FluxFreqParameter
from .Freq... | 42.330645 | 89 | 0.777862 |
604fd07f88ac325be6b00962aad9545c1d10edca | 8,206 | py | Python | art/attacks/projected_gradient_descent_unittest.py | jizongFox/adversarial-robustness-toolbox | 0649fe44d42bc7ba39a4b1a2ff95a31320fd1ae5 | [
"MIT"
] | null | null | null | art/attacks/projected_gradient_descent_unittest.py | jizongFox/adversarial-robustness-toolbox | 0649fe44d42bc7ba39a4b1a2ff95a31320fd1ae5 | [
"MIT"
] | null | null | null | art/attacks/projected_gradient_descent_unittest.py | jizongFox/adversarial-robustness-toolbox | 0649fe44d42bc7ba39a4b1a2ff95a31320fd1ae5 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) IBM Corporation 2018
#
# 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
# rights to use, copy, modify, merge... | 40.029268 | 120 | 0.662077 |
6c697716756762b9284a9ffe5f1e61e71bd61fd2 | 950 | py | Python | pridesport_work/sportgoods/models.py | Trifon87/pridesport_work | 9ab47d3c58915c2e791bf8a1fcb3ceee1d8de62c | [
"MIT"
] | null | null | null | pridesport_work/sportgoods/models.py | Trifon87/pridesport_work | 9ab47d3c58915c2e791bf8a1fcb3ceee1d8de62c | [
"MIT"
] | null | null | null | pridesport_work/sportgoods/models.py | Trifon87/pridesport_work | 9ab47d3c58915c2e791bf8a1fcb3ceee1d8de62c | [
"MIT"
] | null | null | null | # from django.db import models
#
#
# class Gear(models.Model):
# FIGHT = 'fight'
# FITNESS = 'fitness'
# CLOTHING = 'clothing'
# UN = 'unknown'
# SPORT_TYPES = (
# (FIGHT, "fight"),
# (FITNESS, "fitness"),
# (CLOTHING, 'clothing'),
# (UN, 'Unknown')
# )
# type... | 27.941176 | 77 | 0.6 |
b9c163758172bb02824805c579747969d8bda114 | 506 | py | Python | src/sortedArrayToBST/bst.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | null | null | null | src/sortedArrayToBST/bst.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | null | null | null | src/sortedArrayToBST/bst.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | 1 | 2021-04-28T18:17:55.000Z | 2021-04-28T18:17:55.000Z | # Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def sortedArrayToBST(self, nums: List[int]) -> TreeNode:
if not nums:
return None
mid =... | 24.095238 | 60 | 0.590909 |
bd0a728861e2c56ce95ea7bc28d983174f63baaf | 4,515 | py | Python | ped_dialog/file_browse.py | jpfxgood/ped | f753ca27e4462c321ed28f00e1ef47fbde62990e | [
"MIT"
] | null | null | null | ped_dialog/file_browse.py | jpfxgood/ped | f753ca27e4462c321ed28f00e1ef47fbde62990e | [
"MIT"
] | 21 | 2020-07-03T13:14:15.000Z | 2020-07-14T14:27:43.000Z | ped_dialog/file_browse.py | jpfxgood/ped | f753ca27e4462c321ed28f00e1ef47fbde62990e | [
"MIT"
] | null | null | null | # Copyright 2009 James P Goodwin ped tiny python editor
""" module to implement a file browse dialog component for the ped editor """
import curses
import curses.ascii
from ped_dialog import dialog
from ped_core import editor_common
from ped_core import keytab
class FileBrowseComponent(dialog.Component):
""" comp... | 35.551181 | 146 | 0.580952 |
59a7edc3dcd08f47352970f2c94d94131a45b106 | 1,713 | py | Python | server/api/models.py | yzhfury/ReserveMe | 1969626da931c335ec2ee3bf8708e2995131bb48 | [
"MIT"
] | 3 | 2020-11-15T05:09:13.000Z | 2020-11-16T13:27:10.000Z | server/api/models.py | yzhfury/ReserveMe | 1969626da931c335ec2ee3bf8708e2995131bb48 | [
"MIT"
] | null | null | null | server/api/models.py | yzhfury/ReserveMe | 1969626da931c335ec2ee3bf8708e2995131bb48 | [
"MIT"
] | 1 | 2020-11-15T05:21:46.000Z | 2020-11-15T05:21:46.000Z | import settings
import uuid
import jwt
from datetime import datetime, timedelta
from flask import g
from api.conf.auth import auth
from api.database.database import db
from sqlalchemy.dialects.postgresql import UUID, ARRAY
import api.errors as error
import os
class User(db.Model):
id = db.Column(db.Integer, prim... | 29.534483 | 86 | 0.649154 |
12d4ce5771ddf8db8c1025fac2efd43a416e4c89 | 2,048 | py | Python | python/akg/ops/math/abs_ad.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | python/akg/ops/math/abs_ad.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | python/akg/ops/math/abs_ad.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 37.925926 | 109 | 0.693359 |
4382a5647c555d3158ad868507f532daf3500cef | 7,853 | py | Python | augustus/system/models/base_series.py | jialuechen/augustus | d4fbda427e3d9c60896b0e22c06cd593b484ef9d | [
"MIT"
] | 2 | 2019-09-13T18:49:17.000Z | 2022-01-25T05:14:05.000Z | augustus/system/models/base_series.py | jialuechen/augustus | d4fbda427e3d9c60896b0e22c06cd593b484ef9d | [
"MIT"
] | null | null | null | augustus/system/models/base_series.py | jialuechen/augustus | d4fbda427e3d9c60896b0e22c06cd593b484ef9d | [
"MIT"
] | 2 | 2019-02-28T21:23:04.000Z | 2020-07-02T01:23:24.000Z | import abc
from collections import UserDict, UserList, deque
from typing import Deque, Dict, List, Union
import pandas as pd
from augustus.constants import ActionType
from augustus.system.metabase_env import augustusEnvBase
class SeriesBase(augustusEnvBase, UserDict, abc.ABC):
name: str = None
def __init__... | 31.538153 | 79 | 0.61607 |
4955f38a2f011ab324fd0dfa4c5c5d2e96edbf45 | 7,127 | py | Python | app/classes/http.py | runcitadel/crafty-web | 895dc1a8605825cf17a2cf87cfec416b8d258d09 | [
"Apache-2.0"
] | null | null | null | app/classes/http.py | runcitadel/crafty-web | 895dc1a8605825cf17a2cf87cfec416b8d258d09 | [
"Apache-2.0"
] | null | null | null | app/classes/http.py | runcitadel/crafty-web | 895dc1a8605825cf17a2cf87cfec416b8d258d09 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import json
import time
import secrets
import asyncio
import logging
import schedule
import threading
import tornado.web
import tornado.ioloop
import tornado.log
import tornado.template
import tornado.escape
import tornado.locale
import tornado.httpserver
from pathlib import Path
from app.classes.... | 38.733696 | 118 | 0.6575 |
1cf5b677de3a005a489585073464bee4498356fd | 1,709 | py | Python | app/core/migrations/0001_initial.py | arunjohn96/recipe_app_api | efc0a10cdd45c792f479089209d38f976c46b353 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | arunjohn96/recipe_app_api | efc0a10cdd45c792f479089209d38f976c46b353 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | arunjohn96/recipe_app_api | efc0a10cdd45c792f479089209d38f976c46b353 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.12 on 2019-09-18 11:45
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
7fd1d9aeca7dd46319b52af0cbfb4734840e9cfd | 13,696 | py | Python | scripts/extract_aa.py | davek44/Glimmer-MG | ced287371a118ff403e0a5c09735c154cffa34ec | [
"Artistic-1.0"
] | 5 | 2017-08-19T23:38:14.000Z | 2021-02-08T23:23:57.000Z | scripts/extract_aa.py | davek44/Glimmer-MG | ced287371a118ff403e0a5c09735c154cffa34ec | [
"Artistic-1.0"
] | 2 | 2015-10-31T19:54:37.000Z | 2018-06-05T21:47:12.000Z | scripts/extract_aa.py | davek44/Glimmer-MG | ced287371a118ff403e0a5c09735c154cffa34ec | [
"Artistic-1.0"
] | 5 | 2020-02-11T14:55:43.000Z | 2021-10-08T13:41:25.000Z | #!/usr/bin/env python
from optparse import OptionParser
import sys, string, pdb, sys, os
################################################################################
# extract_aa.py
#
# Make a fasta file of amino acid sequences from the Glimmer3 gene predictions.
###################################################... | 34.938776 | 126 | 0.405885 |
6fc32efb15b48459405abcbbcb7e1ec3de3dfef5 | 1,125 | py | Python | norns/room/tests/test_routes.py | dsnowb/norns | cd78dc1566da4a1b8ffc3ac99e3dd510aea21119 | [
"MIT"
] | null | null | null | norns/room/tests/test_routes.py | dsnowb/norns | cd78dc1566da4a1b8ffc3ac99e3dd510aea21119 | [
"MIT"
] | null | null | null | norns/room/tests/test_routes.py | dsnowb/norns | cd78dc1566da4a1b8ffc3ac99e3dd510aea21119 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.urls import reverse_lazy
from model_mommy import mommy
from gear.models import Weapon
from ..models import Room, Tile
class TestRoutes(TestCase):
"""Integration tests."""
def setUp(self):
self.room = mommy.make(Room)
self.tile = mommy.make(Tile, r... | 32.142857 | 74 | 0.614222 |
5cbec1616d22e96ac239afa5049a58fdc933898a | 411 | py | Python | PhysicsTools/HeppyCore/python/analyzers/Printer.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | PhysicsTools/HeppyCore/python/analyzers/Printer.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | PhysicsTools/HeppyCore/python/analyzers/Printer.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | from PhysicsTools.HeppyCore.framework.analyzer import Analyzer
class Printer(Analyzer):
def beginLoop(self, setup):
super(Printer, self).beginLoop(setup)
self.firstEvent = True
def process(self, event):
if self.firstEvent:
event.input.Print()
self.first... | 27.4 | 67 | 0.627737 |
ba75fbfe0bd99305feeac7a9b30158d603dca430 | 1,601 | py | Python | packages/facilities/rtdb/python/rtdb2_mon.py | Falcons-Robocup/code | 2281a8569e7f11cbd3238b7cc7341c09e2e16249 | [
"Apache-2.0"
] | 2 | 2021-01-15T13:27:19.000Z | 2021-08-04T08:40:52.000Z | packages/facilities/rtdb/python/rtdb2_mon.py | Falcons-Robocup/code | 2281a8569e7f11cbd3238b7cc7341c09e2e16249 | [
"Apache-2.0"
] | null | null | null | packages/facilities/rtdb/python/rtdb2_mon.py | Falcons-Robocup/code | 2281a8569e7f11cbd3238b7cc7341c09e2e16249 | [
"Apache-2.0"
] | 5 | 2018-05-01T10:39:31.000Z | 2022-03-25T03:02:35.000Z | # Copyright 2020 Jan Feitsma (Falcons)
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/python
import argparse
import rtdb2tools
# Main structure of the program
if __name__ == "__main__":
# Argument parsing.
descriptionTxt = 'This tool monitors a RtDB item, continuously displaying its value until CTRL-C is p... | 47.088235 | 144 | 0.722673 |
a69130c0257a336ab857201c45e0748ff559c271 | 449 | py | Python | jobs/timeseries/fundamentals_daily.py | bordumb/wsbtrading | 32cadab1d9e2f4d37e7d028cc30f4cd0e924be92 | [
"MIT"
] | 14 | 2021-01-25T00:01:39.000Z | 2021-08-12T09:20:39.000Z | jobs/timeseries/fundamentals_daily.py | bordumb/wsbtrading | 32cadab1d9e2f4d37e7d028cc30f4cd0e924be92 | [
"MIT"
] | 15 | 2021-01-24T20:18:13.000Z | 2021-02-04T21:54:27.000Z | jobs/timeseries/fundamentals_daily.py | bordumb/wsbtrading | 32cadab1d9e2f4d37e7d028cc30f4cd0e924be92 | [
"MIT"
] | 3 | 2021-01-27T14:03:02.000Z | 2021-08-29T04:13:26.000Z | """
This job initially populates the fundamentals_daily table in Postgress from a CSV
TODO: get this automated from Quandl's API
"""
from wsbtrading import data_io
csv_path = f'../../data/prod/fundamentals/daily/fundamentals_daily_20210210.csv'
def main():
# ---------------
# Insert Data |
# ---------... | 22.45 | 81 | 0.672606 |
c1d8ebc19c3b80b7f9c3065f6ea9093f3886ca5f | 216 | py | Python | django_proficiency_test/users/tests/test_models.py | RamParameswaran/Django_Proficiency_Test | b6838679b5ac2a570588d3769e966fb8188f88d0 | [
"MIT"
] | null | null | null | django_proficiency_test/users/tests/test_models.py | RamParameswaran/Django_Proficiency_Test | b6838679b5ac2a570588d3769e966fb8188f88d0 | [
"MIT"
] | null | null | null | django_proficiency_test/users/tests/test_models.py | RamParameswaran/Django_Proficiency_Test | b6838679b5ac2a570588d3769e966fb8188f88d0 | [
"MIT"
] | null | null | null | import pytest
from django_proficiency_test.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 21.6 | 64 | 0.787037 |
b36f72448c154156c4c7aace3c36d8a86f4de438 | 792 | py | Python | gestion/migrations/0002_departamento.py | aitorres/sip-online | 4a1e7a7363f394a5030a2fbe2085aff46fe52b81 | [
"MIT"
] | 3 | 2018-12-23T15:37:25.000Z | 2019-05-20T00:06:29.000Z | gestion/migrations/0002_departamento.py | aitorres/sip-online | 4a1e7a7363f394a5030a2fbe2085aff46fe52b81 | [
"MIT"
] | 3 | 2019-06-24T18:22:32.000Z | 2021-06-02T00:56:55.000Z | gestion/migrations/0002_departamento.py | aitorres/sip-online | 4a1e7a7363f394a5030a2fbe2085aff46fe52b81 | [
"MIT"
] | 3 | 2018-11-17T23:31:26.000Z | 2019-05-20T00:14:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-11-06 01:15
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('gestion', '0001_initial'),
]
operations = [
... | 30.461538 | 114 | 0.612374 |
3f560b5bf12c88cc4cd133d2663fa8003fe12e16 | 584 | py | Python | src/upload_file/forms.py | klaskaris11/gsoc2019-anonymization | 09a4ddd2bd74dc0eecded3e5e3f03c4fc4089ce1 | [
"MIT"
] | null | null | null | src/upload_file/forms.py | klaskaris11/gsoc2019-anonymization | 09a4ddd2bd74dc0eecded3e5e3f03c4fc4089ce1 | [
"MIT"
] | 1 | 2020-09-14T16:09:05.000Z | 2020-09-14T16:09:05.000Z | src/upload_file/forms.py | klaskaris11/gsoc2019-anonymization | 09a4ddd2bd74dc0eecded3e5e3f03c4fc4089ce1 | [
"MIT"
] | 1 | 2020-07-05T14:22:13.000Z | 2020-07-05T14:22:13.000Z | from django import forms
from .models import Document, UserDocuments
from django.forms import ClearableFileInput
class UploadDocumentForm(forms.ModelForm):
# path = forms.CharField(required=False)
class Meta:
model = Document
fields = ['file']
widgets = {
'file': Clearabl... | 23.36 | 65 | 0.630137 |
e0543959c5818df506a62a4b134c19629b25d20d | 2,145 | py | Python | tasks.py | JakeBrand/CMPUT410-E4 | 67e1454d83c35055f2b63f090c42af534b2c0018 | [
"Apache-2.0"
] | null | null | null | tasks.py | JakeBrand/CMPUT410-E4 | 67e1454d83c35055f2b63f090c42af534b2c0018 | [
"Apache-2.0"
] | null | null | null | tasks.py | JakeBrand/CMPUT410-E4 | 67e1454d83c35055f2b63f090c42af534b2c0018 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request, redirect, url_for
import sqlite3
app = Flask(__name__)
dbFile = 'db1.db'
conn = None
def get_conn():
global conn
if conn is None:
conn = sqlite3.connect(dbFile)
conn.row_factory = sqlite3.Row
return conn
@app.teardown_appcontext
def close_conn(exception):... | 27.5 | 122 | 0.584615 |
e60e3ff86285cabaa16e8619dcb025e9affc3cb5 | 4,557 | py | Python | espnet/nets/pytorch_backend/frontends/frontend.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/pytorch_backend/frontends/frontend.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/pytorch_backend/frontends/frontend.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional, Tuple, Union
import numpy
import torch
import torch.nn as nn
from torch_complex.tensor import ComplexTensor
from espnet.nets.pytorch_backend.frontends.dnn_beamformer import DNN_Beamformer
from espnet.nets.pytorch_backend.frontends.dnn_wpe import DNN_WPE
class Frontend(nn.Module):
... | 30.583893 | 88 | 0.53544 |
fe261dbe126d3b4bc56fa6e80d15c4fb7fd096fe | 1,513 | py | Python | tests/test_sitelocation.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 19 | 2015-12-08T23:33:51.000Z | 2022-01-31T04:41:10.000Z | tests/test_sitelocation.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 2 | 2019-10-04T10:57:00.000Z | 2021-10-01T06:46:17.000Z | tests/test_sitelocation.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 7 | 2015-11-04T02:25:01.000Z | 2021-12-08T03:14:28.000Z | import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.location_and_climate import SiteLocation
log = logging.getLogger(__name__)
class TestSiteLocation(unittest.TestCase):
def setUp(self):
self.fd, self.path = tempfile... | 28.018519 | 78 | 0.651685 |
1e22b0477c279da6bb1c08c225642e47d39bdf6e | 1,616 | py | Python | main.py | sgongar/Ping | abe8f4eea3562ba29ae9300f030c7f1b1ba94e9d | [
"MIT"
] | null | null | null | main.py | sgongar/Ping | abe8f4eea3562ba29ae9300f030c7f1b1ba94e9d | [
"MIT"
] | null | null | null | main.py | sgongar/Ping | abe8f4eea3562ba29ae9300f030c7f1b1ba94e9d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from bluetooth import *
from time import sleep
from firebase import send_time, set_up_firebase
import I2C_LCD_driver
from utils import get_time
class PingDetect:
def __init__(self):
"""
"""
self.db = set_up_firebase()
self.user_id = 'Morty'
self.m... | 24.484848 | 54 | 0.513614 |
c02d6c91bfc9e7b6e111b6619f4a5c824c402cb3 | 654 | py | Python | PythonScriptingEngine/TestScripts/TestScript.py | ayasman/PythonScriptingEngine | af0d12d42b6d00d81558405d2b559cc27725a0e9 | [
"MIT"
] | null | null | null | PythonScriptingEngine/TestScripts/TestScript.py | ayasman/PythonScriptingEngine | af0d12d42b6d00d81558405d2b559cc27725a0e9 | [
"MIT"
] | null | null | null | PythonScriptingEngine/TestScripts/TestScript.py | ayasman/PythonScriptingEngine | af0d12d42b6d00d81558405d2b559cc27725a0e9 | [
"MIT"
] | null | null | null | import clr
import System
clr.AddReference("System.Core")
clr.AddReference("System.Windows.Forms")
clr.ImportExtensions(System.Linq)
from System import String
from System import Guid
from TestIronPython.Scripting.Interfaces import IActionScript
class Script1(IActionScript):
def Load(this):
print "1"
de... | 28.434783 | 68 | 0.744648 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.