hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79443627b2173b936471c2159718d2cc5536b029 | 1,000 | py | Python | jinstagram/users/admin.py | cjy1521/jinstagram | 82e08388418cb787996e119b73bf70c98c349283 | [
"MIT"
] | null | null | null | jinstagram/users/admin.py | cjy1521/jinstagram | 82e08388418cb787996e119b73bf70c98c349283 | [
"MIT"
] | null | null | null | jinstagram/users/admin.py | cjy1521/jinstagram | 82e08388418cb787996e119b73bf70c98c349283 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from jinstagram.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin... | 28.571429 | 74 | 0.557 |
794436946adcbc3165bb4d9c0d708b88f9aad200 | 13,122 | py | Python | src/sage/functions/transcendental.py | felix-salfelder/sage | 5d8b2ff4794c44c7fa7a9d86ec567ecfa337e566 | [
"BSL-1.0"
] | 2 | 2021-08-20T00:30:35.000Z | 2021-11-17T10:54:00.000Z | src/sage/functions/transcendental.py | felix-salfelder/sage | 5d8b2ff4794c44c7fa7a9d86ec567ecfa337e566 | [
"BSL-1.0"
] | null | null | null | src/sage/functions/transcendental.py | felix-salfelder/sage | 5d8b2ff4794c44c7fa7a9d86ec567ecfa337e566 | [
"BSL-1.0"
] | null | null | null | """
Transcendental Functions
"""
#*****************************************************************************
# Copyright (C) 2005 William Stein <wstein@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope that it will be useful,
# b... | 32.641791 | 220 | 0.568663 |
794437c81d6dfefc70f7e97fa81894a5f0da6c48 | 344 | py | Python | ceml/backend/jax/preprocessing/normalizer.py | andreArtelt/ceml | 364d4630d6a01592c2ab86f2d53dbb7feb682381 | [
"MIT"
] | 24 | 2019-07-12T08:11:25.000Z | 2021-12-09T19:24:53.000Z | ceml/backend/jax/preprocessing/normalizer.py | andreArtelt/ceml | 364d4630d6a01592c2ab86f2d53dbb7feb682381 | [
"MIT"
] | 6 | 2020-09-28T04:42:44.000Z | 2021-09-27T06:59:36.000Z | ceml/backend/jax/preprocessing/normalizer.py | andreArtelt/ceml | 364d4630d6a01592c2ab86f2d53dbb7feb682381 | [
"MIT"
] | 7 | 2019-09-11T13:54:57.000Z | 2021-01-14T13:13:26.000Z | # -*- coding: utf-8 -*-
import jax.numpy as npx
from ....model import Model
class Normalizer(Model):
"""
Wrapper for the normalizer.
"""
def __init__(self, **kwds):
super().__init__(**kwds)
def predict(self, x):
"""
Computes the forward pass.
"""
retur... | 19.111111 | 37 | 0.540698 |
79443a7995e20178f45494c1b2d3b3686dee92de | 1,988 | py | Python | accounts/migrations/0027_auto_20200407_1928.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | 2 | 2022-01-24T23:30:18.000Z | 2022-01-26T00:21:22.000Z | accounts/migrations/0027_auto_20200407_1928.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | accounts/migrations/0027_auto_20200407_1928.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2020-04-08 00:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0026_auto_20200402_1822'),
]
operations = [
migrations.CreateMod... | 53.72973 | 285 | 0.666499 |
79443bfd01d78429bbfe256fd754a73ff796e553 | 2,574 | py | Python | python/common/acllite/cameracapture.py | Ascend/samples | 5e060ddf8c502cf0e248ecbe1c8986e95351cbbd | [
"Apache-2.0"
] | 25 | 2020-11-20T09:01:35.000Z | 2022-03-29T10:35:38.000Z | python/common/acllite/cameracapture.py | Ascend/samples | 5e060ddf8c502cf0e248ecbe1c8986e95351cbbd | [
"Apache-2.0"
] | 5 | 2021-02-28T20:49:37.000Z | 2022-03-04T21:50:27.000Z | python/common/acllite/cameracapture.py | Ascend/samples | 5e060ddf8c502cf0e248ecbe1c8986e95351cbbd | [
"Apache-2.0"
] | 16 | 2020-12-06T07:26:13.000Z | 2022-03-01T07:51:55.000Z | # !/usr/bin/env python
# -*- coding:utf-8 -*-
#
from ctypes import *
import os
import time
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
from lib.acllite_so import libacllite
import constants as const
from acllite_image import AclLiteImage
from acllite_logger import log_err... | 27.978261 | 74 | 0.590132 |
79443c67244ee4bb21ce0697a64ea89949999116 | 3,786 | py | Python | test/model/test_deepvar.py | tqdo/gluon-ts | 4628cd928177ca47d173f7da780b8aa03e545238 | [
"Apache-2.0"
] | 1 | 2020-02-16T12:05:43.000Z | 2020-02-16T12:05:43.000Z | test/model/test_deepvar.py | naftalic/gluon-ts | be7125321db1d39fced8b26a36f5f4ffe5989747 | [
"Apache-2.0"
] | null | null | null | test/model/test_deepvar.py | naftalic/gluon-ts | be7125321db1d39fced8b26a36f5f4ffe5989747 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 29.123077 | 75 | 0.656894 |
79443d66d212c7e94cb999a0db1d6b68227922a6 | 2,703 | py | Python | _assignments/basics/types/type_bool_b.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _assignments/basics/types/type_bool_b.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _assignments/basics/types/type_bool_b.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | """
* Assignment: Type Bool Simple
* Required: yes
* Complexity: easy
* Lines of code: 9 lines
* Time: 5 min
English:
1. What you need to put in expressions to get the expected outcome?
2. In place of ellipsis (`...`) insert only `True` or `False`
3. Run doctests - all must succeed
Polish:
1. Co należ... | 31.068966 | 79 | 0.627081 |
79443e5a4e57574603ae76c742f8ad7e238b0053 | 814 | py | Python | countess/tests/data/plugins/bad_options.py | VariantEffect/Enrich2-py3 | 5f8534c8c9259d90d99d70e5bd9140fd0fdc8ea4 | [
"BSD-3-Clause"
] | 4 | 2020-01-14T19:24:07.000Z | 2020-01-16T18:11:35.000Z | countess/tests/data/plugins/bad_options.py | VariantEffect/CountESS | 5f8534c8c9259d90d99d70e5bd9140fd0fdc8ea4 | [
"BSD-3-Clause"
] | 3 | 2020-01-01T10:38:15.000Z | 2020-01-03T09:45:41.000Z | countess/tests/data/plugins/bad_options.py | VariantEffect/CountESS | 5f8534c8c9259d90d99d70e5bd9140fd0fdc8ea4 | [
"BSD-3-Clause"
] | 1 | 2022-02-20T00:35:24.000Z | 2022-02-20T00:35:24.000Z | from countess.plugins.scoring import BaseScorerPlugin
from countess.plugins.options import Options
options = Options()
options.add_option(
name="Normalization Method",
varname="logr_method",
dtype=bool,
default="Wild Type",
choices={"Wild Type": "wt", "Full": "full", "Complete": "complete"},
h... | 21.421053 | 72 | 0.668305 |
79443eaba1fb1360fd7e47eea2b5e06967557ab2 | 1,796 | py | Python | src/backend/common/environment/environment.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | null | null | null | src/backend/common/environment/environment.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | null | null | null | src/backend/common/environment/environment.py | guineawheek/ftc-data-take-2 | 337bff2077eadb3bd6bbebd153cbb6181c99516f | [
"MIT"
] | null | null | null | import enum
import os
from typing import Optional
from backend.common.environment.tasks import TasksRemoteConfig
@enum.unique
class EnvironmentMode(enum.Enum):
LOCAL = "local"
REMOTE = "remote"
# Mostly GAE env variables
# See https://cloud.google.com/appengine/docs/standard/python3/runtime#environment_var... | 28.967742 | 92 | 0.686526 |
79443f27835b478e98eca57225d2de723651a19e | 778 | py | Python | tests/unit/usecases/test_get_token.py | HathorNetwork/hathor-explorer-service | 81236deceac12ddfd813b33723481421a9064c82 | [
"MIT"
] | null | null | null | tests/unit/usecases/test_get_token.py | HathorNetwork/hathor-explorer-service | 81236deceac12ddfd813b33723481421a9064c82 | [
"MIT"
] | 51 | 2021-05-21T18:58:15.000Z | 2022-03-29T17:45:00.000Z | tests/unit/usecases/test_get_token.py | HathorNetwork/hathor-explorer-service | 81236deceac12ddfd813b33723481421a9064c82 | [
"MIT"
] | 1 | 2022-02-08T21:15:26.000Z | 2022-02-08T21:15:26.000Z | from unittest.mock import MagicMock
from pytest import fixture
from tests.fixtures.token_factory import TokenFactory
from usecases.get_token import GetToken
class TestGetToken:
@fixture
def token_gateway(self):
return MagicMock()
def test_get(self, token_gateway):
token = TokenFactory(... | 22.228571 | 63 | 0.699229 |
79443fcc5f82726d3cf1bdc8314b36697d46bfd0 | 17,550 | py | Python | hw3/dqn.py | Mckiev/homework | f2e05dce1571d3398c148376f1f31a28ef8f2c2f | [
"MIT"
] | null | null | null | hw3/dqn.py | Mckiev/homework | f2e05dce1571d3398c148376f1f31a28ef8f2c2f | [
"MIT"
] | null | null | null | hw3/dqn.py | Mckiev/homework | f2e05dce1571d3398c148376f1f31a28ef8f2c2f | [
"MIT"
] | null | null | null | import uuid
import os, inspect
import time
import pickle
import sys
import gym.spaces
import itertools
import numpy as np
import random
import tensorflow as tf
import tensorflow.contrib.layers as layers
from collections import namedtuple
from dqn_utils import *
import logz
OptimizerSpec = namedtuple("Op... | 42.909535 | 143 | 0.691054 |
79443fe1f64e835f3b62210524a30df1e01c9f3e | 2,478 | py | Python | main.py | bph-tuwien/bph_co2 | 042e22a91fc3dd56af713837b725e5367dbe579f | [
"MIT"
] | null | null | null | main.py | bph-tuwien/bph_co2 | 042e22a91fc3dd56af713837b725e5367dbe579f | [
"MIT"
] | null | null | null | main.py | bph-tuwien/bph_co2 | 042e22a91fc3dd56af713837b725e5367dbe579f | [
"MIT"
] | null | null | null | from bph_co2.solver import CO2_Simulation, ppm_to_mg_m3, mg_m3_to_ppm
from bph_co2.timeseries import Timeseries
from bph_co2.window import Window
try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources... | 39.967742 | 106 | 0.690476 |
794440aa4ffba94e194f66673d4484a422fe9fd8 | 849 | py | Python | fixture/mail.py | dondemonz/python_training_mantis | b327ba1c057685aa6381c3afd882d9dec58b0cfc | [
"Apache-2.0"
] | null | null | null | fixture/mail.py | dondemonz/python_training_mantis | b327ba1c057685aa6381c3afd882d9dec58b0cfc | [
"Apache-2.0"
] | null | null | null | fixture/mail.py | dondemonz/python_training_mantis | b327ba1c057685aa6381c3afd882d9dec58b0cfc | [
"Apache-2.0"
] | null | null | null | import poplib
import email
import time
class MailHelper:
def __init__(self, app):
self.app = app
def get_mail(self, username, password, subject):
for i in range(5):
pop = poplib.POP3(self.app.config["james"]["host"])
pop.user(username)
pop.pass_(password)
... | 31.444444 | 83 | 0.47232 |
7944410d9f441fa9c6cee1521402196999daee8f | 2,010 | py | Python | main.py | jpr2/01-Interactive-Fiction | f00aca64bdccb8d2ce6e6d02d5f9043340060eab | [
"MIT"
] | null | null | null | main.py | jpr2/01-Interactive-Fiction | f00aca64bdccb8d2ce6e6d02d5f9043340060eab | [
"MIT"
] | null | null | null | main.py | jpr2/01-Interactive-Fiction | f00aca64bdccb8d2ce6e6d02d5f9043340060eab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys,os,json,re
assert sys.version_info >= (3,9), "This script requires at least Python 3.9"
def load(l):
f = open(os.path.join(sys.path[0], l))
data = f.read()
j = json.loads(data)
return j
def find_passage(game_desc, pid):
for p in game_desc["passages"]:
if p... | 27.162162 | 81 | 0.568159 |
794441a423a5422e6375cb4957cfff4282f486de | 1,738 | py | Python | mbs_messaging_umb/conf.py | qixiang/mbs-messaging-umb | 54ef47bd8ad7ed3f119a68fdcf3589f383a0ac4e | [
"MIT"
] | 1 | 2017-09-20T15:59:37.000Z | 2017-09-20T15:59:37.000Z | mbs_messaging_umb/conf.py | qixiang/mbs-messaging-umb | 54ef47bd8ad7ed3f119a68fdcf3589f383a0ac4e | [
"MIT"
] | 10 | 2017-09-26T22:43:41.000Z | 2020-01-07T02:41:14.000Z | mbs_messaging_umb/conf.py | mikebonnet/mbs-messaging-umb | 60a8a50322057fdbf310fb9750080ea3301359c8 | [
"MIT"
] | 5 | 2017-09-27T21:52:11.000Z | 2019-12-11T04:43:50.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat, Inc.
#
# 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, modi... | 38.622222 | 80 | 0.740506 |
794442b19ff00f6e2c6f53e2459fa8fd49f0d118 | 9,106 | py | Python | quiz.py | MatheusDMD/TechWeb_QuizPlatform | ffc76ec2efe14fed8daf37d9fa4a096259f1770a | [
"MIT"
] | null | null | null | quiz.py | MatheusDMD/TechWeb_QuizPlatform | ffc76ec2efe14fed8daf37d9fa4a096259f1770a | [
"MIT"
] | null | null | null | quiz.py | MatheusDMD/TechWeb_QuizPlatform | ffc76ec2efe14fed8daf37d9fa4a096259f1770a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Flask, request, render_template, make_response, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
import os
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.In... | 39.081545 | 227 | 0.694926 |
794443d127b042461f725f066044500437db629f | 771 | py | Python | passenger_wsgi.py | chriswilson1982/bottle-blog-uploader | b17d3ab51fdc32fb81ecfcf06c7722aaa9bf6d1e | [
"MIT"
] | null | null | null | passenger_wsgi.py | chriswilson1982/bottle-blog-uploader | b17d3ab51fdc32fb81ecfcf06c7722aaa9bf6d1e | [
"MIT"
] | 2 | 2021-02-07T13:22:32.000Z | 2021-02-07T13:23:21.000Z | passenger_wsgi.py | chriswilson1982/bottle-blog-uploader | b17d3ab51fdc32fb81ecfcf06c7722aaa9bf6d1e | [
"MIT"
] | null | null | null | import os, sys
# Use Python 3.7.1 interpreter
INTERP = "/home/chriswilson1982/opt/python-3.7.1/bin/python3"
# INTERP is present twice so that the new Python interpreter knows the actual executable path
if sys.executable != INTERP:
os.execl(INTERP, INTERP, *sys.argv)
# Add current directory to path, if isn't already ... | 29.653846 | 93 | 0.758755 |
794443e4011377b8941e862e4b83cb001a5a17e6 | 686 | py | Python | migrations/versions/dff188188029_.py | stevenabadie/volunteercore | b797354aa52fbcfdca39925e6729263762a679ce | [
"MIT"
] | 2 | 2019-11-08T04:35:34.000Z | 2020-08-01T19:39:53.000Z | migrations/versions/dff188188029_.py | stevenabadie/volunteercore | b797354aa52fbcfdca39925e6729263762a679ce | [
"MIT"
] | 95 | 2018-09-29T22:50:51.000Z | 2019-05-27T16:37:46.000Z | migrations/versions/dff188188029_.py | stevenabadie/volunteercore | b797354aa52fbcfdca39925e6729263762a679ce | [
"MIT"
] | 4 | 2018-09-29T15:50:15.000Z | 2019-05-11T20:29:19.000Z | """empty message
Revision ID: dff188188029
Revises: a260230e29cb
Create Date: 2019-04-27 22:29:41.229608
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dff188188029'
down_revision = 'a260230e29cb'
branch_labels = None
depends_on = None
def upgrade():
# ... | 23.655172 | 98 | 0.704082 |
794443e6b3ccbe28e9eab30c44afd565a0375cf9 | 5,146 | py | Python | app/main/service/location_service.py | OdysseyMomentum/Cryptomice-Eonpeers | bc7f1cb0ef640662a04f0040603fde092cabe336 | [
"MIT"
] | null | null | null | app/main/service/location_service.py | OdysseyMomentum/Cryptomice-Eonpeers | bc7f1cb0ef640662a04f0040603fde092cabe336 | [
"MIT"
] | null | null | null | app/main/service/location_service.py | OdysseyMomentum/Cryptomice-Eonpeers | bc7f1cb0ef640662a04f0040603fde092cabe336 | [
"MIT"
] | null | null | null | import datetime
import uuid
from app.main.model.location import Location
from app.main.model.company import Company
from app.main.services import db
from app.main.util.tasks import make_gossip_call
from app.main.util.eonerror import EonError
from app.main.util.keymanagementutils import KeyManagementClient
from app.mai... | 39.282443 | 119 | 0.661096 |
79444465c7fddebb6183a141985edf3aeb883a4a | 1,577 | py | Python | Methods/Slot/HoleM50/comp_radius.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | 2 | 2020-06-29T13:48:37.000Z | 2021-06-15T07:34:05.000Z | Methods/Slot/HoleM50/comp_radius.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Methods/Slot/HoleM50/comp_radius.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""@package Methods.Slot.HoleM50.comp_radius
Compute the radius of the Slot method
@date Created on Fri Mar 18 09:51:15 2016
@copyright (C) 2015-2016 EOMYS ENGINEERING.
@author pierre_b
@todo unittest it
"""
from numpy import angle, arcsin, arctan, array, cos, exp
def comp_radius(self):
"... | 26.728814 | 81 | 0.578313 |
7944453980547c246fa8b1ed5fbddc97cd5067c6 | 6,705 | py | Python | bingads/v13/bulk/entities/ad_extensions/bulk_filterlink_ad_extensions.py | pawelulita/BingAds-Python-SDK | e7b5a618e87a43d0a5e2c79d9aa4626e208797bd | [
"MIT"
] | 86 | 2016-02-29T03:24:28.000Z | 2022-03-29T09:30:21.000Z | bingads/v13/bulk/entities/ad_extensions/bulk_filterlink_ad_extensions.py | pawelulita/BingAds-Python-SDK | e7b5a618e87a43d0a5e2c79d9aa4626e208797bd | [
"MIT"
] | 135 | 2016-04-12T13:31:28.000Z | 2022-03-29T02:18:51.000Z | bingads/v13/bulk/entities/ad_extensions/bulk_filterlink_ad_extensions.py | pawelulita/BingAds-Python-SDK | e7b5a618e87a43d0a5e2c79d9aa4626e208797bd | [
"MIT"
] | 154 | 2016-04-08T04:11:27.000Z | 2022-03-29T21:21:07.000Z | from bingads.v13.internal.bulk.mappings import _SimpleBulkMapping
from bingads.v13.internal.bulk.string_table import _StringTable
from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V13
from bingads.v13.internal.extensions import *
from .common import _BulkAdExtensionBase
from .common import _BulkCampaignAdExt... | 41.134969 | 128 | 0.726174 |
794447603e92de8cb82ee49b4bb228494e1cb9d7 | 4,164 | py | Python | tests/integration/cli/restart_test.py | gamechanger/dusty | dd9778e3a4f0c623209e53e98aa9dc1fe76fc309 | [
"MIT"
] | 421 | 2015-06-02T16:29:59.000Z | 2021-06-03T18:44:42.000Z | tests/integration/cli/restart_test.py | gamechanger/dusty | dd9778e3a4f0c623209e53e98aa9dc1fe76fc309 | [
"MIT"
] | 404 | 2015-06-02T20:23:42.000Z | 2019-08-21T16:59:41.000Z | tests/integration/cli/restart_test.py | gamechanger/dusty | dd9778e3a4f0c623209e53e98aa9dc1fe76fc309 | [
"MIT"
] | 16 | 2015-06-16T17:21:02.000Z | 2020-03-27T02:27:09.000Z | import datetime
import os
from subprocess import check_call
from tempfile import mkdtemp
import time
import dateutil.parser
from nose.tools import nottest
from dusty.compiler.spec_assembler import get_all_repos
from dusty import constants
from dusty.source import Repo
from dusty.subprocess import check_output_demoted... | 39.283019 | 117 | 0.705572 |
7944481f280df7add91ac92355de83332396b15e | 935 | py | Python | modules/data/dto/telegram_query_response.py | amirgraily7/tulo-chatbot | 493a20525eeca98003fb0fc63da18f5e4c3d4a6f | [
"MIT"
] | 3 | 2019-10-07T04:11:55.000Z | 2021-11-26T08:00:47.000Z | modules/data/dto/telegram_query_response.py | usriva2405/ml-bank-chatbot-telegram | 493a20525eeca98003fb0fc63da18f5e4c3d4a6f | [
"MIT"
] | 39 | 2019-09-25T03:14:57.000Z | 2022-03-11T23:59:56.000Z | modules/data/dto/telegram_query_response.py | usriva2405/ml-bank-chatbot-telegram | 493a20525eeca98003fb0fc63da18f5e4c3d4a6f | [
"MIT"
] | 2 | 2020-05-12T15:19:15.000Z | 2021-01-31T11:54:01.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 18 00:33:46 2019
@author: usrivastava
"""
import logging
import json
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
... | 28.333333 | 118 | 0.603209 |
79444859e3a1e824d5e6bf6f41ea05c817f1f120 | 11,094 | py | Python | examples/ui/ULAO04.py | Picarro-kskog/mcculw | 5a00dfbef2426772f0ec381f7795a2d5fd696a76 | [
"MIT"
] | null | null | null | examples/ui/ULAO04.py | Picarro-kskog/mcculw | 5a00dfbef2426772f0ec381f7795a2d5fd696a76 | [
"MIT"
] | null | null | null | examples/ui/ULAO04.py | Picarro-kskog/mcculw | 5a00dfbef2426772f0ec381f7795a2d5fd696a76 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import math
from builtins import * # @UnusedWildImport
from tkinter import messagebox
from mcculw import ul
from mcculw.enums import Status, FunctionType, ScanOptions
from examples.ui.uiexample import UIExample
from examples.props.ao import AnalogOutp... | 36.37377 | 78 | 0.59744 |
79444902828c472c8b639eaa69c2993a688e2b13 | 3,373 | py | Python | tests/test_parser.py | cocoaaa/ReprLearn | 58dc682aa62dbd59201ccc55b9b26480ff3d6773 | [
"MIT"
] | null | null | null | tests/test_parser.py | cocoaaa/ReprLearn | 58dc682aa62dbd59201ccc55b9b26480ff3d6773 | [
"MIT"
] | null | null | null | tests/test_parser.py | cocoaaa/ReprLearn | 58dc682aa62dbd59201ccc55b9b26480ff3d6773 | [
"MIT"
] | null | null | null | "See: https://mkaz.blog/code/python-argparse-cookbook/"
import argparse
from reprlearn.models.plmodules.conv_fc_gan import ConvGenerator
from reprlearn.models.plmodules.conv_fc_gan import ConvFCGAN
def test_parser_basic():
my_parser = argparse.ArgumentParser()
my_parser.add_argument('--gpu_ids', action='store... | 31.820755 | 84 | 0.69078 |
7944497bc29382263c0a5459b7f81f8c2e732d9a | 12,156 | py | Python | pollination_sdk/models/step_array_input.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | pollination_sdk/models/step_array_input.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | pollination_sdk/models/step_array_input.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
pollination-server
Pollination Server OpenAPI Definition # noqa: E501
The version of the OpenAPI document: 0.16.0
Contact: info@pollination.cloud
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from pollination_sdk.configu... | 32.244032 | 243 | 0.620105 |
794449a5ea17a490aafdffa2c65b54736ac0be8d | 12,303 | py | Python | pyrr/geometric_tests.py | asnt/Pyrr | 4bc98bc1abc72f860f97563e2a4459813d0bfd88 | [
"Unlicense"
] | null | null | null | pyrr/geometric_tests.py | asnt/Pyrr | 4bc98bc1abc72f860f97563e2a4459813d0bfd88 | [
"Unlicense"
] | null | null | null | pyrr/geometric_tests.py | asnt/Pyrr | 4bc98bc1abc72f860f97563e2a4459813d0bfd88 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""Defines a number of functions to test interactions between
various forms data types.
"""
from __future__ import absolute_import, division, print_function
import math
import numpy as np
from . import rectangle, vector, vector3
from .utils import all_parameters_as_numpy_arrays, parameters_as_nu... | 30.604478 | 100 | 0.656181 |
79444a26f9bdb7949357d68acecf69d76291d727 | 50 | py | Python | comicolorization_sr/utility/__init__.py | DwangoMediaVillage/Comicolorization | 98f323e78baceae0b1086f01ac51b5e8a7515abb | [
"MIT"
] | 122 | 2017-08-21T10:01:07.000Z | 2022-03-21T13:52:19.000Z | comicolorization_sr/utility/__init__.py | DwangoMediaVillage/Comicolorization | 98f323e78baceae0b1086f01ac51b5e8a7515abb | [
"MIT"
] | 7 | 2017-10-20T15:12:13.000Z | 2022-01-30T23:04:37.000Z | comicolorization_sr/utility/__init__.py | DwangoMediaVillage/Comicolorization | 98f323e78baceae0b1086f01ac51b5e8a7515abb | [
"MIT"
] | 26 | 2017-08-22T08:11:20.000Z | 2022-03-09T14:59:18.000Z | from . import chainer_utility
from . import image
| 16.666667 | 29 | 0.8 |
79444a3621cf0bd4a7c2b6f8b9e3c8987946d001 | 960 | py | Python | More/E02_Flat/_RunAll.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-06-20T22:01:23.000Z | 2021-08-06T04:39:50.000Z | More/E02_Flat/_RunAll.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-05-17T09:32:27.000Z | 2021-03-15T19:45:52.000Z | More/E02_Flat/_RunAll.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 2 | 2021-02-25T19:07:45.000Z | 2022-01-09T21:14:06.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# Copyright (c) 2017 Thom Janssen <https://github.com/thomgb>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, w... | 26.666667 | 80 | 0.623958 |
79444a54e7f1a0ae1faf508d7f319d74214e5c43 | 680 | py | Python | packages/arb-compiler-evm/arbitrum/messagestack.py | JesseAbram/arbitrum | fc3b96bf165a201d930af65d6ad93777d897e951 | [
"Apache-2.0"
] | 1 | 2021-05-29T11:11:01.000Z | 2021-05-29T11:11:01.000Z | packages/arb-compiler-evm/arbitrum/messagestack.py | JesseAbram/arbitrum | fc3b96bf165a201d930af65d6ad93777d897e951 | [
"Apache-2.0"
] | 120 | 2021-02-18T07:19:59.000Z | 2022-03-30T12:08:45.000Z | packages/arb-compiler-evm/arbitrum/messagestack.py | JesseAbram/arbitrum | fc3b96bf165a201d930af65d6ad93777d897e951 | [
"Apache-2.0"
] | 1 | 2020-09-20T19:25:23.000Z | 2020-09-20T19:25:23.000Z | # Copyright 2020, Offchain Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34 | 74 | 0.752941 |
79444aab197957c6343f2bb406d79112a6df472d | 9,612 | py | Python | uf2conv.py | jeremyherbert/musical-turtle-xiao | 7cbcf097c1be521ff970b2be4a780aec9de50f9e | [
"MIT"
] | 7 | 2020-04-24T09:06:17.000Z | 2021-11-12T05:08:14.000Z | uf2conv.py | jeremyherbert/musical-turtle-xiao | 7cbcf097c1be521ff970b2be4a780aec9de50f9e | [
"MIT"
] | 1 | 2020-08-04T21:47:14.000Z | 2020-08-09T13:05:28.000Z | uf2conv.py | jeremyherbert/musical-turtle-xiao | 7cbcf097c1be521ff970b2be4a780aec9de50f9e | [
"MIT"
] | 1 | 2020-09-02T09:47:03.000Z | 2020-09-02T09:47:03.000Z | #!/usr/bin/env python3
import sys
import struct
import subprocess
import re
import os
import os.path
import argparse
UF2_MAGIC_START0 = 0x0A324655 # "UF2\n"
UF2_MAGIC_START1 = 0x9E5D5157 # Randomly selected
UF2_MAGIC_END = 0x0AB16F30 # Ditto
families = {
'SAMD21': 0x68ed2b88,
'SAML21': 0x1851780a,
'SA... | 31.933555 | 113 | 0.528506 |
79444b17605895eb6105a126a5e3470b566a33cf | 1,025 | py | Python | src/zojax/principal/ban/interfaces.py | Zojax/zojax.principal.ban | fe5ada1b253152469765c34a0fefbd7276b1aae8 | [
"ZPL-2.1"
] | null | null | null | src/zojax/principal/ban/interfaces.py | Zojax/zojax.principal.ban | fe5ada1b253152469765c34a0fefbd7276b1aae8 | [
"ZPL-2.1"
] | null | null | null | src/zojax/principal/ban/interfaces.py | Zojax/zojax.principal.ban | fe5ada1b253152469765c34a0fefbd7276b1aae8 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 32.03125 | 78 | 0.613659 |
79444b2c27c2400f22447ca29fea8ffb3aaf7886 | 2,012 | py | Python | data.py | bilhox/stardust | a808194fdf2b8b88e7ef9ce52c4d05d919609665 | [
"0BSD"
] | null | null | null | data.py | bilhox/stardust | a808194fdf2b8b88e7ef9ce52c4d05d919609665 | [
"0BSD"
] | null | null | null | data.py | bilhox/stardust | a808194fdf2b8b88e7ef9ce52c4d05d919609665 | [
"0BSD"
] | null | null | null |
imgs = {
"button":{
"default":{
"texture":"",
"logo":""
},
"saturation":{
"texture":"./imgs/source/buttons/button design.png",
"logo":"./imgs/source/logos/logo saturation.jpg"
},
"brightness":{
... | 35.298246 | 72 | 0.452783 |
79444bb3eeba48e8cab4df37fc01e3c91312736b | 25 | py | Python | test.py | leemour/flask_extended | e4c99ddc281a092a965b00fd9fb5eae9e9d08e59 | [
"MIT"
] | null | null | null | test.py | leemour/flask_extended | e4c99ddc281a092a965b00fd9fb5eae9e9d08e59 | [
"MIT"
] | null | null | null | test.py | leemour/flask_extended | e4c99ddc281a092a965b00fd9fb5eae9e9d08e59 | [
"MIT"
] | null | null | null | msg = "Hello"
print(msg)
| 8.333333 | 13 | 0.64 |
79444dc9facbd23bc3bdf176ffcc0fca9ebcb6c1 | 22,998 | py | Python | examples/tough_heat/tough.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 16 | 2018-09-09T11:27:20.000Z | 2022-03-09T01:46:37.000Z | examples/tough_heat/tough.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 8 | 2018-03-19T19:36:38.000Z | 2022-01-26T20:09:27.000Z | examples/tough_heat/tough.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 12 | 2018-06-29T13:16:40.000Z | 2022-03-09T01:46:25.000Z | import matplotlib
#matplotlib.use('Agg')
import math
import os
import pandas as pd
import matplotlib.pyplot as plt
import sys
import pandas as pd
# PyTOUGH specific modules
from mulgrids import *
from t2thermo import *
from t2data import *
from t2incons import *
from os import system
import scipy.io a... | 39.447684 | 155 | 0.551744 |
79444dd90f91e18c47a6e28909c674c78388baea | 1,270 | py | Python | setup.py | bouttier/django-crispy-forms | 9a564f3aa1486dc1e7e0f5160c551d2072de5157 | [
"MIT"
] | null | null | null | setup.py | bouttier/django-crispy-forms | 9a564f3aa1486dc1e7e0f5160c551d2072de5157 | [
"MIT"
] | null | null | null | setup.py | bouttier/django-crispy-forms | 9a564f3aa1486dc1e7e0f5160c551d2072de5157 | [
"MIT"
] | null | null | null | import crispy_forms
from setuptools import setup, find_packages
tests_require = [
'Django>=1.3,<1.8',
]
setup(
name='django-crispy-forms',
version=crispy_forms.__version__,
description="Best way to have Django DRY forms",
long_description=open('README.rst').read(),
classifiers=[
"Dev... | 30.97561 | 71 | 0.623622 |
79444e25ce148c1642adf3000d8173970cdd0cb5 | 325 | py | Python | advent2020/d05_binary_boarding.py | LukasGelbmann/advent-of-code | 886747353dd00ed068fcedd45f0965f2cc433bcb | [
"MIT"
] | 6 | 2020-12-01T11:01:33.000Z | 2020-12-12T15:15:24.000Z | advent2020/d05_binary_boarding.py | LukasGelbmann/advent-of-code | 886747353dd00ed068fcedd45f0965f2cc433bcb | [
"MIT"
] | null | null | null | advent2020/d05_binary_boarding.py | LukasGelbmann/advent-of-code | 886747353dd00ed068fcedd45f0965f2cc433bcb | [
"MIT"
] | 1 | 2020-12-03T08:47:59.000Z | 2020-12-03T08:47:59.000Z | def solve(puzzle_input):
binary_input = puzzle_input.translate(str.maketrans('FBLR', '0101'))
seat_ids = {int(line, base=2) for line in binary_input.splitlines()}
print(max(seat_ids))
print(missing(seat_ids))
def missing(seat_ids):
i = min(seat_ids)
while i in seat_ids:
i += 1
retu... | 25 | 72 | 0.661538 |
79444e9dd44de5edfd61f80262b3d7b6978e1ede | 4,839 | py | Python | test/functional/interface_http.py | Chellit/Chellit | 7d804cfc64b4e91234b68f14b82f12c752eb6aae | [
"MIT"
] | 2 | 2021-02-01T08:29:18.000Z | 2021-06-28T23:45:28.000Z | test/functional/interface_http.py | Chellit/Chellit | 7d804cfc64b4e91234b68f14b82f12c752eb6aae | [
"MIT"
] | null | null | null | test/functional/interface_http.py | Chellit/Chellit | 7d804cfc64b4e91234b68f14b82f12c752eb6aae | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Chellit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the RPC HTTP basics."""
from test_framework... | 43.990909 | 108 | 0.634842 |
79445028477c5d67a39ed23425f0739179ebcab2 | 1,193 | py | Python | paso4/edgesAuthors.py | staplezz/datathon2020 | 476bdc85c3152cf1ed2aa1769ed0e4624eb5ca44 | [
"MIT"
] | null | null | null | paso4/edgesAuthors.py | staplezz/datathon2020 | 476bdc85c3152cf1ed2aa1769ed0e4624eb5ca44 | [
"MIT"
] | null | null | null | paso4/edgesAuthors.py | staplezz/datathon2020 | 476bdc85c3152cf1ed2aa1769ed0e4624eb5ca44 | [
"MIT"
] | null | null | null | import pandas as pd
import itertools
'''
Parte 4: Construcción de las aristas usando el catálogo
de autores filtrados.
'''
#Importamos el catálogo de autores.
filtered_authorships = pd.read_csv('filtered_authorships.csv')
#Diccionario para ir guardando los autores de cada artículo.
article_dict = dict()
#Guardamos ... | 29.097561 | 72 | 0.749371 |
794452849ec65fc0697b4dd3023d879697129a4b | 1,217 | py | Python | src/logpipe/models.py | securingsam/django-logpipe | 8db0a5d7df80dbc33708e7ce2f1c939232d39028 | [
"ISC"
] | null | null | null | src/logpipe/models.py | securingsam/django-logpipe | 8db0a5d7df80dbc33708e7ce2f1c939232d39028 | [
"ISC"
] | null | null | null | src/logpipe/models.py | securingsam/django-logpipe | 8db0a5d7df80dbc33708e7ce2f1c939232d39028 | [
"ISC"
] | null | null | null | from django.db import models
class KafkaOffset(models.Model):
topic = models.CharField(max_length=200,
help_text='The Kafka topic name')
partition = models.PositiveIntegerField(
help_text='The Kafka partition identifier')
offset = models.PositiveIntegerField(default=0,
help_text=... | 31.205128 | 116 | 0.667214 |
794452b75b8e12d5d28fafadadb760d7e9eeac64 | 9,511 | py | Python | train_fns.py | dberga/MineGAN | 36b048c2fcaeb80b22f3c03288e33d862d7e3113 | [
"MIT"
] | null | null | null | train_fns.py | dberga/MineGAN | 36b048c2fcaeb80b22f3c03288e33d862d7e3113 | [
"MIT"
] | null | null | null | train_fns.py | dberga/MineGAN | 36b048c2fcaeb80b22f3c03288e33d862d7e3113 | [
"MIT"
] | null | null | null | ''' train_fns.py
Functions for the main loop of training different conditional image models
'''
import torch
import torch.nn as nn
import torchvision
import os
import utils
import losses
import pdb
# Dummy training function for debugging
def dummy_training_function():
def train(x, y):
return {}
return train
... | 45.94686 | 149 | 0.618337 |
79445569166dd37ae8a3ed66f1f40f05d1c5d6a7 | 2,625 | py | Python | workflow.py | ChenMnZ/auto-daily-health-report | cecae78185b27f1a7e9d3ed71c1bab5db4b33002 | [
"MIT"
] | null | null | null | workflow.py | ChenMnZ/auto-daily-health-report | cecae78185b27f1a7e9d3ed71c1bab5db4b33002 | [
"MIT"
] | null | null | null | workflow.py | ChenMnZ/auto-daily-health-report | cecae78185b27f1a7e9d3ed71c1bab5db4b33002 | [
"MIT"
] | null | null | null | import requests
import sys
import os
from checkin import health_report
from recent import check_recent
username = ""
password = ""
def report_with_server_chan(flag, reason="", success=""):
try:
server_chan_secret = os.environ["server_chan_secret"]
push_url = "https://sc.ftqq.com/" ... | 32.012195 | 105 | 0.612952 |
794456ee9d3ffa60a59e2778ae43cccece3bd984 | 5,383 | py | Python | python-package/mlbox/model/supervised/classification/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | python-package/mlbox/model/supervised/classification/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | python-package/mlbox/model/supervised/classification/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null |
# coding: utf-8
# Author: Axel ARONIO DE ROMBLAY <axelderomblay@gmail.com>
# License: BSD 3 clause
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
import warnings
class Clf_feature_selector():
"""
Selects us... | 29.740331 | 197 | 0.567527 |
794457037f02b448be9258e64df59f1d94cd02af | 3,169 | py | Python | member.py | Enon0831/hands-up | c18c61f900644efa1ee46d3b743edcf67cc22424 | [
"MIT"
] | null | null | null | member.py | Enon0831/hands-up | c18c61f900644efa1ee46d3b743edcf67cc22424 | [
"MIT"
] | null | null | null | member.py | Enon0831/hands-up | c18c61f900644efa1ee46d3b743edcf67cc22424 | [
"MIT"
] | null | null | null | import discord
import words
import datetime
class menber:
def __init__(self,text,num): # 初期化: インスタンス作成時に自動的に呼ばれる
self.n = [text,num]
self.name = []
self.res = []
self.resn =["(",0,")"]
self.tmp = 0
def add(self,name):
if(self.n[1] > 0):
... | 32.336735 | 135 | 0.457242 |
7944576a31ed28becd72b58a857a6b15ddb9cd94 | 548 | py | Python | cluster_coords/__init__.py | sonnyparlin/cluster_coords | 13d1872957fedafd9b76f9b2913b297549fb173b | [
"MIT"
] | null | null | null | cluster_coords/__init__.py | sonnyparlin/cluster_coords | 13d1872957fedafd9b76f9b2913b297549fb173b | [
"MIT"
] | null | null | null | cluster_coords/__init__.py | sonnyparlin/cluster_coords | 13d1872957fedafd9b76f9b2913b297549fb173b | [
"MIT"
] | null | null | null | import math
import random
class RandomCoord:
def __init__(self, lng, lat):
self.lng = lng
self.lat = lat
def randomize_coords(self):
#Earth’s radius, sphere
R=6378137
# offsets in meters
dn = random.randint(5,25)
de = random.randint(5,25)
#Coordinate offsets in radians
dLat =... | 19.571429 | 48 | 0.638686 |
794458acb22d4b598726794c0ec6123263812cd6 | 2,718 | py | Python | anime/tests/rubberband_test.py | SodaCookie/pygame-animations | 44546b5254a659a38bed744e81008d999a328fb2 | [
"MIT"
] | 14 | 2015-07-02T03:27:23.000Z | 2017-10-13T09:27:21.000Z | anime/tests/rubberband_test.py | SodaCookie/pygame-animations | 44546b5254a659a38bed744e81008d999a328fb2 | [
"MIT"
] | 2 | 2015-07-30T04:07:37.000Z | 2015-07-30T04:15:43.000Z | anime/tests/rubberband_test.py | SodaCookie/pygame-animations | 44546b5254a659a38bed744e81008d999a328fb2 | [
"MIT"
] | 7 | 2015-09-09T15:04:45.000Z | 2019-11-21T04:52:09.000Z | import unittest
from anime.core.rubberband import RubberBand
from anime.core.filter import linear
class RubberTestClass(RubberBand):
def __init__(self):
super().__init__()
self.addition = 1
self.x = 0
self.y = 0
self.top_level = "test"
def set_pos(self, pos):
... | 28.914894 | 73 | 0.615526 |
79445926a8fbde833ff0699dfc1be53a95d10378 | 20,686 | py | Python | tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | null | null | null | tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | 1 | 2022-03-07T07:39:03.000Z | 2022-03-07T07:39:03.000Z | tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | null | null | null | import boto3
import pytest
import sure # noqa # pylint: disable=unused-import
from boto3.dynamodb.conditions import Key
from botocore.exceptions import ClientError
from moto import mock_dynamodb
table_schema = {
"KeySchema": [{"AttributeName": "partitionKey", "KeyType": "HASH"}],
"GlobalSecondaryIndexes": [
... | 37.610909 | 172 | 0.618293 |
7944598b777cc351d1d273e27b1fd75b69da8ce4 | 1,802 | py | Python | colossalai/nn/layer/parallel_1d/_operation.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 1,630 | 2021-10-30T01:00:27.000Z | 2022-03-31T23:02:41.000Z | colossalai/nn/layer/parallel_1d/_operation.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 166 | 2021-10-30T01:03:01.000Z | 2022-03-31T14:19:07.000Z | colossalai/nn/layer/parallel_1d/_operation.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 253 | 2021-10-30T06:10:29.000Z | 2022-03-31T13:30:06.000Z | import torch
try:
import fused_mix_prec_layer_norm_cuda
except:
fused_mix_prec_layer_norm_cuda = None
class FusedLayerNormAffineFunction1D(torch.autograd.Function):
r"""Layernorm
Args:
input: input matrix.
weight: weight matrix.
bias: bias matrix.
normalized_shape: in... | 39.173913 | 140 | 0.649834 |
79445a7a3578e26f5bf3b7563541d918868fa6b0 | 5,060 | py | Python | opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py | oxeye-nikolay/opentelemetry-python | b59e91472cb178a7fa94e243f3f0952aa720feee | [
"Apache-2.0"
] | null | null | null | opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py | oxeye-nikolay/opentelemetry-python | b59e91472cb178a7fa94e243f3f0952aa720feee | [
"Apache-2.0"
] | null | null | null | opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py | oxeye-nikolay/opentelemetry-python | b59e91472cb178a7fa94e243f3f0952aa720feee | [
"Apache-2.0"
] | null | null | null | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.229299 | 112 | 0.737549 |
79445ad7e44ebce2de5cb4865b449816c15ac321 | 8,629 | py | Python | candidate/Cuckoo.py | pckennethma/NeuralD | 226d7ea5c715c3fe29b311e896268462a4727713 | [
"Apache-2.0"
] | null | null | null | candidate/Cuckoo.py | pckennethma/NeuralD | 226d7ea5c715c3fe29b311e896268462a4727713 | [
"Apache-2.0"
] | null | null | null | candidate/Cuckoo.py | pckennethma/NeuralD | 226d7ea5c715c3fe29b311e896268462a4727713 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from util.solution_util import *
from logging import debug, info, error
import logging, time
logging.basicConfig(level=logging.ERROR)
class CuckooSimulator:
def __init__(self, table_size, keys, hash_func1, hash_func2):
self.hash_table = [-1 for i in range(table_size)]
self.key_n... | 40.70283 | 130 | 0.605053 |
79445b26bb114547a8295c65156c1717ae0e6cec | 4,955 | py | Python | run_experiment_rq1.py | ntban15/retecs | b056d1a6548db3e879286b4017d45ac11e4eebef | [
"MIT"
] | null | null | null | run_experiment_rq1.py | ntban15/retecs | b056d1a6548db3e879286b4017d45ac11e4eebef | [
"MIT"
] | null | null | null | run_experiment_rq1.py | ntban15/retecs | b056d1a6548db3e879286b4017d45ac11e4eebef | [
"MIT"
] | 1 | 2021-05-16T09:37:37.000Z | 2021-05-16T09:37:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Experiment, evaluation and visualization for RQ1
from run_experiment_common import *
# For overriding defaults from run_experiment_common
PARALLEL = True
RUN_EXPERIMENT = True
VISUALIZE_RESULTS = True
def visualize():
search_pattern = 'rq_*_stats.p'
filename =... | 42.715517 | 136 | 0.550151 |
79445b7f457e3aa2c27ce8033541af6e9b145c22 | 7,211 | py | Python | erde/op/sjoin.py | culebron/erde | 9bbaaa1df46629a182c355413a120aa33dc6b377 | [
"BSD-3-Clause"
] | 16 | 2021-08-24T05:59:04.000Z | 2021-11-16T12:30:34.000Z | erde/op/sjoin.py | culebron/erde | 9bbaaa1df46629a182c355413a120aa33dc6b377 | [
"BSD-3-Clause"
] | null | null | null | erde/op/sjoin.py | culebron/erde | 9bbaaa1df46629a182c355413a120aa33dc6b377 | [
"BSD-3-Clause"
] | 2 | 2021-08-30T10:27:13.000Z | 2021-08-31T09:46:49.000Z | import geopandas as gpd
def _sj(left_df, right_df, left_on, right_on, op, how):
left_tmp = _df_on(left_df, left_on, 'left')
right_tmp = _df_on(right_df, right_on, 'right')
return gpd.sjoin(left_tmp, right_tmp, op=op, how=how)
def sjfull(left_df, right_df, left_on='geometry', right_on='geometry', suffixes=('', '_... | 40.284916 | 214 | 0.726113 |
79445c8ea0af7eff2d00ddb50a9acf08bbd4f21f | 17,762 | py | Python | redash/handlers/queries.py | ivanli1990/redash | 4508975749368e5851fd01f88b83a7aa16c58f62 | [
"BSD-2-Clause"
] | 1 | 2019-07-31T01:41:13.000Z | 2019-07-31T01:41:13.000Z | redash/handlers/queries.py | ivanli1990/redash | 4508975749368e5851fd01f88b83a7aa16c58f62 | [
"BSD-2-Clause"
] | 1 | 2019-05-21T14:38:05.000Z | 2019-05-23T09:30:55.000Z | redash/handlers/queries.py | ivanli1990/redash | 4508975749368e5851fd01f88b83a7aa16c58f62 | [
"BSD-2-Clause"
] | 4 | 2019-07-01T06:15:44.000Z | 2021-12-11T11:17:08.000Z | import sqlparse
from flask import jsonify, request, url_for
from flask_login import login_required
from flask_restful import abort
from sqlalchemy.orm.exc import StaleDataError
from funcy import partial
from redash import models, settings
from redash.authentication.org_resolving import current_org
from redash.handlers... | 35.955466 | 127 | 0.633544 |
79445cbd93d3b0ab3da8efb8f15fe2cfd2476d13 | 2,600 | py | Python | parser.py | SerjShepelevich/14-- | 97d020d4680fb7159a8bdd94563f5434a12ee1b9 | [
"MIT"
] | null | null | null | parser.py | SerjShepelevich/14-- | 97d020d4680fb7159a8bdd94563f5434a12ee1b9 | [
"MIT"
] | null | null | null | parser.py | SerjShepelevich/14-- | 97d020d4680fb7159a8bdd94563f5434a12ee1b9 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import re
import pprint
import pandas as pd
URL = 'https://www.drom.ru/reviews/toyota/prius/5kopeek/'
def num_elements(soup,type_, name_):
reviews = soup.find_all(type_, class_= name_)
if len(reviews) > 0:
return reviews
else:
return 0
def tex... | 32.911392 | 124 | 0.651923 |
79445ce81fbd835aa2945a37aaadb7b752c4e27d | 1,999 | py | Python | lab2/text_recognizer/data/mnist.py | wook3024/fsdl-text-recognizer-2021-labs | 06ccc875eaa22971a9c3e78785566739ec75702a | [
"MIT"
] | null | null | null | lab2/text_recognizer/data/mnist.py | wook3024/fsdl-text-recognizer-2021-labs | 06ccc875eaa22971a9c3e78785566739ec75702a | [
"MIT"
] | null | null | null | lab2/text_recognizer/data/mnist.py | wook3024/fsdl-text-recognizer-2021-labs | 06ccc875eaa22971a9c3e78785566739ec75702a | [
"MIT"
] | null | null | null | """MNIST DataModule"""
import argparse
from torch.utils.data import random_split
from torchvision.datasets import MNIST as TorchMNIST
from torchvision import transforms
from text_recognizer.data.base_data_module import BaseDataModule, load_and_print_info
DOWNLOADED_DATA_DIRNAME = BaseDataModule.data_dirname() / "dow... | 34.465517 | 96 | 0.68084 |
794460a05b70998a4f793a12e82c7f15dc6cfee4 | 11,761 | py | Python | tools/client-side/svn-viewspec.py | tux-mind/platform_external_subversion | e3e715b637b0b7c6a6a02316f3be48f2c1d5181c | [
"Apache-2.0"
] | 2 | 2019-10-31T18:33:15.000Z | 2021-09-19T20:04:03.000Z | tools/client-side/svn-viewspec.py | wbond/subversion | 018aaa1933687f28bbfdcad9b7b988fd7435afcd | [
"Apache-2.0"
] | null | null | null | tools/client-side/svn-viewspec.py | wbond/subversion | 018aaa1933687f28bbfdcad9b7b988fd7435afcd | [
"Apache-2.0"
] | 2 | 2019-10-31T18:33:29.000Z | 2020-02-15T03:57:13.000Z | #!/usr/bin/env python
#
# ====================================================================
# 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. ... | 33.893372 | 75 | 0.623671 |
794460a66aa4002165f1877f12cfd5ef85e274d8 | 5,709 | py | Python | venv/Lib/site-packages/pymongo/periodic_executor.py | omar115/face-recognition-opencv | 37d3e29483e55b8ad1a440a40d82003f1052a457 | [
"MIT"
] | 2 | 2019-07-31T16:33:07.000Z | 2019-09-18T21:48:57.000Z | venv/Lib/site-packages/pymongo/periodic_executor.py | omar115/face-recognition-opencv | 37d3e29483e55b8ad1a440a40d82003f1052a457 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pymongo/periodic_executor.py | omar115/face-recognition-opencv | 37d3e29483e55b8ad1a440a40d82003f1052a457 | [
"MIT"
] | null | null | null | # Copyright 2014-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 32.622857 | 80 | 0.592048 |
794462abfa8e4b71adb2b665bd053fe877d55d76 | 659 | py | Python | run.py | iofu728/Chinese_T-Sequence-annotation | a923abe2c8f09dbee752937d80a4c063e581d124 | [
"MIT"
] | 2 | 2019-06-26T04:43:26.000Z | 2020-04-09T06:19:01.000Z | run.py | iofu728/Chinese_T-Sequence-annotation | a923abe2c8f09dbee752937d80a4c063e581d124 | [
"MIT"
] | null | null | null | run.py | iofu728/Chinese_T-Sequence-annotation | a923abe2c8f09dbee752937d80a4c063e581d124 | [
"MIT"
] | 2 | 2020-04-09T06:19:02.000Z | 2020-12-19T13:50:52.000Z | # -*- coding: utf-8 -*-
# @Author: gunjianpan
# @Date: 2019-06-22 23:39:03
# @Last Modified by: gunjianpan
# @Last Modified time: 2019-06-24 02:37:38
import param
from util import echo
import dataLoad
from model import Model
def main(sa_type: param.SA_TYPE, run_id: str):
''' run model '''
param.change_ru... | 25.346154 | 50 | 0.620637 |
79446478f01e8e1f00143b0210ef7a1ee7b61f14 | 2,969 | py | Python | ESN/EchoTorch-master/examples/models/NilsNet_example.py | RogerFu18/drunken-monkey | 2f8498a83105481d0d189b20407f6e3f658b1053 | [
"MIT"
] | null | null | null | ESN/EchoTorch-master/examples/models/NilsNet_example.py | RogerFu18/drunken-monkey | 2f8498a83105481d0d189b20407f6e3f658b1053 | [
"MIT"
] | null | null | null | ESN/EchoTorch-master/examples/models/NilsNet_example.py | RogerFu18/drunken-monkey | 2f8498a83105481d0d189b20407f6e3f658b1053 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# File : examples/timeserie_prediction/switch_attractor_esn
# Description : NARMA 30 prediction with ESN.
# Date : 26th of January, 2018
#
# This file is part of EchoTorch. EchoTorch is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# Licen... | 32.271739 | 80 | 0.67969 |
794465b10e3fd2195e74d7fa3144329140bb111e | 1,354 | py | Python | tensorflow/python/ops/gradients.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 4 | 2021-06-15T17:26:07.000Z | 2021-11-17T10:58:08.000Z | tensorflow/python/ops/gradients.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/gradients.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 4 | 2018-02-18T03:39:01.000Z | 2018-10-18T11:49:17.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 45.133333 | 80 | 0.768095 |
7944661400386d684c6fb2c829a64dc9ec8406e6 | 6,294 | py | Python | local_eval/eval_qnrf.py | hayko1995/JHU-CROWD-Detection | 68808b90a0af168a38743389313ea0e1d28e1a28 | [
"MIT"
] | null | null | null | local_eval/eval_qnrf.py | hayko1995/JHU-CROWD-Detection | 68808b90a0af168a38743389313ea0e1d28e1a28 | [
"MIT"
] | null | null | null | local_eval/eval_qnrf.py | hayko1995/JHU-CROWD-Detection | 68808b90a0af168a38743389313ea0e1d28e1a28 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
from scipy import spatial as ss
import pdb
import cv2
from utils import hungarian, read_pred_and_gt, AverageMeter, AverageCategoryMeter
import argparse
import scipy.io
import math
flagError = False
# id_std = [i for i in range(3110,3610,1)]
# id_std[59] = 3098
id_std = [i for i... | 36.381503 | 112 | 0.592628 |
7944667e94e030270c75291bd4fc903be626d052 | 711 | py | Python | covigator/pipeline/runner.py | TRON-Bioinformatics/covigator | 59cd5012217cb043d97c77ce5273d8930e74390d | [
"MIT"
] | 7 | 2021-07-23T14:09:51.000Z | 2022-01-26T20:26:27.000Z | covigator/pipeline/runner.py | TRON-Bioinformatics/covigator | 59cd5012217cb043d97c77ce5273d8930e74390d | [
"MIT"
] | 2 | 2021-07-27T08:30:22.000Z | 2022-02-22T20:06:05.000Z | covigator/pipeline/runner.py | TRON-Bioinformatics/covigator | 59cd5012217cb043d97c77ce5273d8930e74390d | [
"MIT"
] | null | null | null | from logzero import logger
import time
import subprocess
from covigator.exceptions import CovigatorPipelineError
def run_command(command, temporary_folder):
start = time.time()
p = subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=temporary_folder, shell=True)
stdoutda... | 33.857143 | 111 | 0.721519 |
79446691d93d15e19453033b6272c2e11e593dd8 | 3,000 | py | Python | helper/decorators.py | growsimplee/django-helper | df9e4f80dfe04a18b1a17f9cd4a69a58a2e9b997 | [
"MIT"
] | null | null | null | helper/decorators.py | growsimplee/django-helper | df9e4f80dfe04a18b1a17f9cd4a69a58a2e9b997 | [
"MIT"
] | null | null | null | helper/decorators.py | growsimplee/django-helper | df9e4f80dfe04a18b1a17f9cd4a69a58a2e9b997 | [
"MIT"
] | null | null | null | import traceback
import time
import logging
from .settings import ERROR_QUEUE, SERVICE_NAME, AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, AWS_REGION, ERROR_CODES
import boto3
import json
import json
from functools import lru_cache,wraps
logger = logging.getLogger("django")
def base_handler(func,error_handler,completion_... | 38.961039 | 185 | 0.644 |
794467ea5227d786240a4dc2c21fda99810bd1c3 | 1,162 | py | Python | bpcs/bpcs_steg_decode.py | BburnN123/bpcs | f53caede7e202ce07b51890f028b9caf73a22937 | [
"MIT"
] | 20 | 2017-04-25T21:07:24.000Z | 2022-03-30T11:11:47.000Z | bpcs/bpcs_steg_decode.py | BburnN123/bpcs | f53caede7e202ce07b51890f028b9caf73a22937 | [
"MIT"
] | 4 | 2016-04-06T01:19:27.000Z | 2020-09-26T18:38:29.000Z | bpcs/bpcs_steg_decode.py | BburnN123/bpcs | f53caede7e202ce07b51890f028b9caf73a22937 | [
"MIT"
] | 12 | 2017-04-02T23:10:46.000Z | 2022-03-21T03:43:55.000Z | import numpy as np
from .logger import log
from .array_grid import get_next_grid_dims
from .act_on_image import ActOnImage
from .array_message import write_conjugated_message_grids
from .bpcs_steg import arr_bpcs_complexity
def remove_message_from_vessel(arr, alpha, grid_size):
messages = []
nfound, nkept, nl... | 33.2 | 101 | 0.692771 |
794468dd8c489310c851f3e4ee60453853255174 | 1,908 | py | Python | qa_tool/tests/test_algorithm.py | pg-irc/pathways-backend | 05a8c4e750523d2d081b030a248c5444d1ed7992 | [
"BSD-3-Clause"
] | 12 | 2017-08-30T18:21:00.000Z | 2021-12-09T04:04:17.000Z | qa_tool/tests/test_algorithm.py | pg-irc/pathways-backend | 05a8c4e750523d2d081b030a248c5444d1ed7992 | [
"BSD-3-Clause"
] | 424 | 2017-08-08T18:32:14.000Z | 2022-03-30T21:42:51.000Z | qa_tool/tests/test_algorithm.py | pg-irc/pathways-backend | 05a8c4e750523d2d081b030a248c5444d1ed7992 | [
"BSD-3-Clause"
] | 7 | 2017-09-29T21:14:37.000Z | 2019-12-30T21:07:37.000Z | from rest_framework import test as rest_test
from rest_framework import status
from qa_tool.tests.helpers import AlgorithmBuilder
from common.testhelpers.random_test_values import a_string
class AlgorithmsTests(rest_test.APITestCase):
def setUp(self):
self.data = {
'id': 'The id',
... | 39.75 | 82 | 0.67348 |
79446a9ddf397bc0da1ebfe5b49ce13fd498bbbc | 596 | py | Python | app/grandchallenge/cases/migrations/0006_rawimageuploadsession_user_uploads.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 7 | 2016-11-05T07:16:30.000Z | 2017-11-23T03:38:03.000Z | app/grandchallenge/cases/migrations/0006_rawimageuploadsession_user_uploads.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 113 | 2015-05-26T09:27:59.000Z | 2018-03-21T10:45:56.000Z | app/grandchallenge/cases/migrations/0006_rawimageuploadsession_user_uploads.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 7 | 2015-07-16T20:11:22.000Z | 2017-06-06T02:41:24.000Z | # Generated by Django 3.1.13 on 2021-10-13 09:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("uploads", "0004_auto_20211012_0957"),
("cases", "0005_rawimageuploadsession_import_result"),
]
operations = [
migrations.AddField(
... | 25.913043 | 62 | 0.588926 |
79446ac1e5e04c50de25db8fb4c96ef4c81d994b | 245 | py | Python | cms/templatetags/js.py | eduncan911/django_cms | 66c27f059ca0779157a7c3cc2e007d8090f10351 | [
"BSD-3-Clause"
] | 1 | 2017-04-27T20:00:40.000Z | 2017-04-27T20:00:40.000Z | cms/templatetags/js.py | eduncan911/django_cms | 66c27f059ca0779157a7c3cc2e007d8090f10351 | [
"BSD-3-Clause"
] | null | null | null | cms/templatetags/js.py | eduncan911/django_cms | 66c27f059ca0779157a7c3cc2e007d8090f10351 | [
"BSD-3-Clause"
] | null | null | null | from django import template
from django.utils import simplejson
from django.core.serializers.json import DjangoJSONEncoder
register = template.Library()
@register.filter
def js(value):
return simplejson.dumps(value, cls=DjangoJSONEncoder)
| 24.5 | 58 | 0.816327 |
79446b03be4726a2b3e1713d9cce0ec0b31de0b7 | 556 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/network/eos/argspec/facts/facts.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/network/eos/argspec/facts/facts.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/network/eos/argspec/facts/facts.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | # -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The arg spec for the eos facts module.
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class FactsArgs(object):
""" The arg... | 24.173913 | 92 | 0.652878 |
79446b50e34eec198e9b3c40189ae20f503341c6 | 13,110 | py | Python | apps/equipment/models/recording_model.py | kane-zh/MES_server | d8d28768a054eee6433e3900908afd331fd92281 | [
"Apache-2.0"
] | null | null | null | apps/equipment/models/recording_model.py | kane-zh/MES_server | d8d28768a054eee6433e3900908afd331fd92281 | [
"Apache-2.0"
] | null | null | null | apps/equipment/models/recording_model.py | kane-zh/MES_server | d8d28768a054eee6433e3900908afd331fd92281 | [
"Apache-2.0"
] | null | null | null | from .basicinfor_model import *
class PartsUseRecordModel(models.Model):
"""
配件消耗记录
"""
STATUS = (
("新建", "新建"),
("审核中", "审核中"),
("完成", "完成"),
("作废", "作废"),
)
id = models.AutoField(primary_key=True, unique=True)
name = models.CharField(max_length=32, name="na... | 72.430939 | 143 | 0.704729 |
79446b65ed745f556180326f05ac779f8310e40c | 638 | py | Python | src/compas/datastructures/volmesh/bbox.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas/datastructures/volmesh/bbox.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas/datastructures/volmesh/bbox.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from compas.geometry import bounding_box
__all__ = [
'volmesh_bounding_box',
]
def volmesh_bounding_box(volmesh):
"""Compute the (axis aligned) bounding box of a volmesh.
Parameters
------... | 21.266667 | 79 | 0.69279 |
79446b85365ac00f9d70d829413085387b43bff9 | 3,682 | py | Python | tests/preprocessing/test_clean.py | krisjb/MHDataLearn | 59dcd4a6c3945b4ae6d6777834cbc801cbbf3dab | [
"MIT"
] | null | null | null | tests/preprocessing/test_clean.py | krisjb/MHDataLearn | 59dcd4a6c3945b4ae6d6777834cbc801cbbf3dab | [
"MIT"
] | null | null | null | tests/preprocessing/test_clean.py | krisjb/MHDataLearn | 59dcd4a6c3945b4ae6d6777834cbc801cbbf3dab | [
"MIT"
] | 1 | 2022-01-26T13:23:47.000Z | 2022-01-26T13:23:47.000Z | import pandas as pd
# import numpy as np
# from datetime import timedelta
# from datetime import datetime
from MHDataLearn.preprocessing.clean import age_check, \
gender_replace, \
marital_replace, \
... | 34.092593 | 82 | 0.609451 |
79446c04ca26a30b47e50b8708212b758e762a23 | 790 | py | Python | pydbus_manager/publication.py | Seebz/pydbus-manager | 6b576b969cbda50521dca62a7df929167207f9fc | [
"WTFPL"
] | 2 | 2018-07-22T09:13:47.000Z | 2019-05-06T20:00:35.000Z | pydbus_manager/publication.py | Seebz/pydbus-manager | 6b576b969cbda50521dca62a7df929167207f9fc | [
"WTFPL"
] | 1 | 2019-07-16T06:56:42.000Z | 2019-07-16T21:35:19.000Z | pydbus_manager/publication.py | Seebz/pydbus-manager | 6b576b969cbda50521dca62a7df929167207f9fc | [
"WTFPL"
] | 1 | 2018-07-18T06:10:28.000Z | 2018-07-18T06:10:28.000Z | # -*- coding: utf-8 -*-
NODE_INFO = """
<node>
<interface name="org.freedesktop.DBus.ObjectManager">
<method name="GetManagedObjects">
<arg type="a{oa{sa{sv}}}" name="object_paths_interfaces_and_properties" direction="out"/>
</method>
<signal name="InterfacesAdded">
<arg type="o" name="object_path"/>
<... | 24.6875 | 92 | 0.670886 |
79446cc7b0cfec6535a3e0b6cd5772eac5108595 | 4,443 | py | Python | wzk/files.py | DDDong2666/tum-adlr-ws20-02 | 2e439886e0287777589cd276d614fd03bea4ed0c | [
"MIT"
] | null | null | null | wzk/files.py | DDDong2666/tum-adlr-ws20-02 | 2e439886e0287777589cd276d614fd03bea4ed0c | [
"MIT"
] | null | null | null | wzk/files.py | DDDong2666/tum-adlr-ws20-02 | 2e439886e0287777589cd276d614fd03bea4ed0c | [
"MIT"
] | null | null | null | import os
import pickle
import shutil
import platform
import subprocess
__pickle_extension = '.pkl'
__open_cmd_dict = {'Linux': 'xdg-open',
'Darwin': 'open',
'Windows': 'start'}
def get_pythonpath():
try:
return os.environ['PYTHONPATH'].split(os.pathsep)
except K... | 23.632979 | 94 | 0.595093 |
79446d47400281bbc70de69b1315466087e8a500 | 125 | py | Python | Practice/Regex/Introduction/Matching_Start_End.py | alexanderbauer89/HackerRank | 0fb6face083b0183692c9251ffe4bb635591393f | [
"MIT"
] | 1 | 2021-11-17T02:47:11.000Z | 2021-11-17T02:47:11.000Z | Practice/Regex/Introduction/Matching_Start_End.py | alexanderbauer89/HackerRank | 0fb6face083b0183692c9251ffe4bb635591393f | [
"MIT"
] | null | null | null | Practice/Regex/Introduction/Matching_Start_End.py | alexanderbauer89/HackerRank | 0fb6face083b0183692c9251ffe4bb635591393f | [
"MIT"
] | null | null | null | Regex_Pattern = r"^\d\w{4}[.]$" # Do not delete 'r'.
import re
print(str(bool(re.search(Regex_Pattern, input()))).lower())
| 20.833333 | 59 | 0.64 |
79446d498b339af896f2f0b52c2a3bd925aa38dc | 381 | py | Python | main/migrations/0007_banner_status.py | Dekatron322/IotexChart | 481e117278df8910facb17b0b9099921592e4a50 | [
"Apache-2.0"
] | 1 | 2021-12-22T23:02:59.000Z | 2021-12-22T23:02:59.000Z | main/migrations/0007_banner_status.py | IOTEXCHART/IotexChart | 593dddc4885daedc43af82ea4c388d1bf1938c70 | [
"Apache-2.0"
] | null | null | null | main/migrations/0007_banner_status.py | IOTEXCHART/IotexChart | 593dddc4885daedc43af82ea4c388d1bf1938c70 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.9 on 2021-12-04 23:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0006_banner_pub_date'),
]
operations = [
migrations.AddField(
model_name='banner',
name='status',
... | 20.052632 | 53 | 0.593176 |
79446df956eecceaee5069ab3455dba4b17baafd | 1,063 | py | Python | venv-howto/bin/pilfont.py | frknnlzts/howto | bba8b8080df480c2ee95a7f9913a7153cc02f65e | [
"Apache-2.0"
] | 2 | 2018-02-12T09:54:33.000Z | 2019-03-31T14:32:32.000Z | venv-howto/bin/pilfont.py | frknnlzts/howto | bba8b8080df480c2ee95a7f9913a7153cc02f65e | [
"Apache-2.0"
] | 8 | 2017-12-27T16:19:25.000Z | 2017-12-29T00:21:03.000Z | venv-howto/bin/pilfont.py | frknnlzts/howto | bba8b8080df480c2ee95a7f9913a7153cc02f65e | [
"Apache-2.0"
] | 1 | 2019-12-18T09:33:29.000Z | 2019-12-18T09:33:29.000Z | #!/home/cracker/Desktop/howto/venv-howto/bin/python3.5
#
# The Python Imaging Library
# $Id$
#
# PIL raster font compiler
#
# history:
# 1997-08-25 fl created
# 2002-03-10 fl use "from PIL import"
#
from __future__ import print_function
import glob
import sys
# drivers
from PIL import BdfFontFile
from PIL import... | 18.327586 | 68 | 0.605833 |
79446e1c371f33713514e0bb6d2d58b57035acd6 | 592 | py | Python | CORE/Tools/Helpers/generateComponentImplementation.py | pike4/CORE-Dev-Build-1.0 | 08376bae09a8bb3598f4aa8edfacd1ca1c45eaa3 | [
"MIT"
] | 3 | 2016-10-06T22:42:50.000Z | 2016-10-14T16:04:46.000Z | CORE/Tools/Helpers/generateComponentImplementation.py | pike4/CORE-Dev-Build-1.0 | 08376bae09a8bb3598f4aa8edfacd1ca1c45eaa3 | [
"MIT"
] | null | null | null | CORE/Tools/Helpers/generateComponentImplementation.py | pike4/CORE-Dev-Build-1.0 | 08376bae09a8bb3598f4aa8edfacd1ca1c45eaa3 | [
"MIT"
] | null | null | null | def genCompImpl(className, sourcePath):
sourceFile = open(sourcePath + ".cpp", "w+")
sourceFile.write("#include \"" + className + ".h\"\n\n")
sourceFile.write(className + "::" + className + "()\n")
sourceFile.write("{\n\n}\n");
sourceFile.write("void " + className + "::handle(Event e)\n")
... | 45.538462 | 79 | 0.596284 |
79446efeada386507db2a75ba5af6611eaedd443 | 381 | py | Python | gale/general/errors.py | adamrpah/GALE | 94ab2613c5d53ea471f664a75c7d780a2689302f | [
"WTFPL"
] | null | null | null | gale/general/errors.py | adamrpah/GALE | 94ab2613c5d53ea471f664a75c7d780a2689302f | [
"WTFPL"
] | null | null | null | gale/general/errors.py | adamrpah/GALE | 94ab2613c5d53ea471f664a75c7d780a2689302f | [
"WTFPL"
] | null | null | null | '''
File: errors.py
Author: Adam Pah
Description:
Error Handling
'''
from __future__ import division, print_function
def generic_error_handler(message=''):
'''
Generic handler for custom thrown exceptions.
input:
m - message to display
'''
import sys
print( 'ERROR: Stopped Execution d... | 19.05 | 62 | 0.671916 |
79446f19034528a9b79c78a5be967c7918a9f912 | 41,627 | py | Python | pytoshop/image_resources.py | Aixile/pytoshop | 2cc090dff8ef00ce8cfb97bf7a5fdde34b7f4cd4 | [
"BSD-3-Clause"
] | 1 | 2020-04-15T23:14:39.000Z | 2020-04-15T23:14:39.000Z | pytoshop/image_resources.py | Aixile/pytoshop | 2cc090dff8ef00ce8cfb97bf7a5fdde34b7f4cd4 | [
"BSD-3-Clause"
] | null | null | null | pytoshop/image_resources.py | Aixile/pytoshop | 2cc090dff8ef00ce8cfb97bf7a5fdde34b7f4cd4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The `ImageResources` section.
Image resource blocks are the basic building unit of several file
formats, including Photoshop's native file format, JPEG, and
TIFF. Image resources are used to store non-pixel data associated with
images, such as pen tool paths.
"""
from __future__ import ... | 32.169243 | 90 | 0.53732 |
79446f22b90f95605d8b4f1cbcfefc63f70098db | 5,497 | py | Python | pysit/gallery/marmousi2.py | zfang-slim/PysitForPython3 | dc60537b26018e28d92b7a956a2cf96775f0bdf9 | [
"BSD-3-Clause"
] | null | null | null | pysit/gallery/marmousi2.py | zfang-slim/PysitForPython3 | dc60537b26018e28d92b7a956a2cf96775f0bdf9 | [
"BSD-3-Clause"
] | null | null | null | pysit/gallery/marmousi2.py | zfang-slim/PysitForPython3 | dc60537b26018e28d92b7a956a2cf96775f0bdf9 | [
"BSD-3-Clause"
] | 1 | 2020-06-13T07:13:07.000Z | 2020-06-13T07:13:07.000Z | import numpy as np
from pysit import *
from pysit.gallery.gallery_base import PrecomputedGalleryModel
__all__ = ['MarmousiModel2', 'marmousi2']
class MarmousiModel2(PrecomputedGalleryModel):
""" Marmousi II community velocity model.
"""
# Names
model_name = "Marmousi2"
# A san... | 35.464516 | 106 | 0.549209 |
79446f497ddab2e1251a1da96413ab0052521544 | 51 | py | Python | tests/test.py | sudaning/Floga | d0662daf826275d58c857259e2e6a83cc777adcf | [
"MIT"
] | 2 | 2017-03-15T03:58:26.000Z | 2020-06-27T08:11:51.000Z | tests/test.py | sudaning/Freg | f142af88f79abef6b6954f41264d233a946737aa | [
"MIT"
] | null | null | null | tests/test.py | sudaning/Freg | f142af88f79abef6b6954f41264d233a946737aa | [
"MIT"
] | 3 | 2017-05-21T13:57:26.000Z | 2021-12-29T07:51:08.000Z | import os
if __name__ == "__main__":
print("OK")
| 10.2 | 26 | 0.647059 |
79446fc266b9f3161b36e3ea0da66d0d0ddc281a | 13,076 | py | Python | script/relativeFootPositionQuasiFlat.py | ori-drs/solo-rbprm | 2c8ade18f36a691b9e432302ae6af0724fa2d0f2 | [
"BSD-2-Clause"
] | null | null | null | script/relativeFootPositionQuasiFlat.py | ori-drs/solo-rbprm | 2c8ade18f36a691b9e432302ae6af0724fa2d0f2 | [
"BSD-2-Clause"
] | null | null | null | script/relativeFootPositionQuasiFlat.py | ori-drs/solo-rbprm | 2c8ade18f36a691b9e432302ae6af0724fa2d0f2 | [
"BSD-2-Clause"
] | 2 | 2021-06-01T09:17:36.000Z | 2021-12-13T11:29:02.000Z | from hpp.gepetto import Viewer
from hpp.gepetto import ViewerFactory
from numpy import array, zeros, ones
from numpy.linalg import norm
from solo_rbprm.solo import Robot
from hpp.corbaserver.rbprm.tools.display_tools import *
#from plot_polytopes import *
from pinocchio import Quaternion
NUM_SAMPLES = 6000
IT_DISPLA... | 41.643312 | 180 | 0.556057 |
79446fdf94802002f40fe1a1d80b8e061d04c39b | 6,714 | py | Python | binding/python/porcupine.py | shivasiddharth/porcupine | f637350a1e7c1a4d060f596144a15ab8a6960edb | [
"Apache-2.0"
] | null | null | null | binding/python/porcupine.py | shivasiddharth/porcupine | f637350a1e7c1a4d060f596144a15ab8a6960edb | [
"Apache-2.0"
] | null | null | null | binding/python/porcupine.py | shivasiddharth/porcupine | f637350a1e7c1a4d060f596144a15ab8a6960edb | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018-2021 Picovoice Inc.
#
# You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
# file accompanying this source.
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS ... | 39.034884 | 120 | 0.674561 |
79446ffddb6e950971f67866a17fda2813924fd4 | 779 | py | Python | ABC073/ABC073d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC073/ABC073d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC073/ABC073d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | # ABC073d
import sys
import itertools
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n, m, _ = map(int, input().split())
d = [[float("inf") for i in range(n)] for i in range(n)]
for i in range(n):
d[i][i] = 0 # 自身のところに行くコストは0
r = list(map(int, input().split()))
def warshall_floyd(d):
#d[i][j]: iからj... | 21.054054 | 57 | 0.532734 |
79447126d15ed901a59fc8799acbc5f8d99bb736 | 31,731 | py | Python | lib/datasets/imdb.py | fwtan/who_where | 8bb7081862d49bb288c70c0245ad2bf95b9f3732 | [
"Unlicense",
"MIT"
] | 13 | 2018-04-16T05:00:38.000Z | 2022-03-25T03:16:33.000Z | lib/datasets/imdb.py | fwtan/who_where | 8bb7081862d49bb288c70c0245ad2bf95b9f3732 | [
"Unlicense",
"MIT"
] | 4 | 2018-07-30T02:38:19.000Z | 2022-03-30T23:51:08.000Z | lib/datasets/imdb.py | fwtan/who_where | 8bb7081862d49bb288c70c0245ad2bf95b9f3732 | [
"Unlicense",
"MIT"
] | 7 | 2018-03-27T14:09:04.000Z | 2021-04-19T11:51:59.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# Modified by Fuwen Tan @ U.Va (2017)
# --------------------------------------------------------
import os, sys, math
import cv2, ... | 39.077586 | 130 | 0.498598 |
794471b8acacaf3358bf22c39633226af4c04b33 | 4,304 | py | Python | Views/Application.py | Jack-Dane/clipboard-copy | 2853ce2540298a26a51bc0f627d9e965562dd86d | [
"MIT"
] | null | null | null | Views/Application.py | Jack-Dane/clipboard-copy | 2853ce2540298a26a51bc0f627d9e965562dd86d | [
"MIT"
] | 1 | 2021-10-04T20:54:46.000Z | 2021-10-05T21:34:18.000Z | Views/Application.py | Jack-Dane/clipboard-copy | 2853ce2540298a26a51bc0f627d9e965562dd86d | [
"MIT"
] | null | null | null |
import tkinter as tk
from tkinter import ttk
class StaticViewCreator():
@staticmethod
def initialiseView(model, clipboardQueue):
"""
Intialises the Application View
:param clipboardStack: a list of clipboard items
:param controller: the controller which is calling the view
... | 32.360902 | 100 | 0.608271 |
794471c8af8a47bfb9a6d8f60b13eb24ac782737 | 536 | py | Python | pseudo_labels/voc12/extend_data.py | saramsv/CCT | 27b4fd838a174a3c0fca582aa163e5bd426b055a | [
"MIT"
] | null | null | null | pseudo_labels/voc12/extend_data.py | saramsv/CCT | 27b4fd838a174a3c0fca582aa163e5bd426b055a | [
"MIT"
] | null | null | null | pseudo_labels/voc12/extend_data.py | saramsv/CCT | 27b4fd838a174a3c0fca582aa163e5bd426b055a | [
"MIT"
] | null | null | null | #! /user/bin python3
import sys
file_ = sys.argv[1]
data = open(file_, 'r').readlines()
for line in data:
if line.split(":")[1].strip() =='fullbody':
print(line.split(":")[0].strip() + ":" + "legs")
print(line.split(":")[0].strip() + ":" + "foot")
print(line.split(":")[0].strip() + ":" + "... | 31.529412 | 57 | 0.483209 |
79447270bc6683ef0e148e3e264c2f583e11b9df | 6,103 | py | Python | openmdao_extensions/salib_doe_driver.py | OneraHub/openmdao_extensions | 4d67315db71a572c1807c2e3fb24e176c3dab845 | [
"Apache-2.0"
] | 7 | 2019-03-04T19:34:21.000Z | 2021-11-18T13:32:51.000Z | openmdao_extensions/salib_doe_driver.py | OneraHub/openmdao_extensions | 4d67315db71a572c1807c2e3fb24e176c3dab845 | [
"Apache-2.0"
] | null | null | null | openmdao_extensions/salib_doe_driver.py | OneraHub/openmdao_extensions | 4d67315db71a572c1807c2e3fb24e176c3dab845 | [
"Apache-2.0"
] | 1 | 2019-10-18T13:06:25.000Z | 2019-10-18T13:06:25.000Z | """
Driver for running model on design of experiments cases using Salib sampling methods
"""
import numpy as np
from openmdao.api import DOEDriver, OptionsDictionary
from openmdao.drivers.doe_generators import DOEGenerator
SALIB_NOT_INSTALLED = False
try:
from SALib.sample import morris as ms
from SALib.sampl... | 33.168478 | 96 | 0.566607 |
794472b4bcf6e123d790dd82c85ad04c11539684 | 391 | py | Python | ex69.py | FernandaMakiHirose/programas-jupyter | 40ebfc820fefceb14293715104641ef184acfff4 | [
"MIT"
] | null | null | null | ex69.py | FernandaMakiHirose/programas-jupyter | 40ebfc820fefceb14293715104641ef184acfff4 | [
"MIT"
] | null | null | null | ex69.py | FernandaMakiHirose/programas-jupyter | 40ebfc820fefceb14293715104641ef184acfff4 | [
"MIT"
] | 1 | 2021-06-09T22:33:11.000Z | 2021-06-09T22:33:11.000Z | # Faça um programa que leia o sexo de uma pessoa, mas só aceite os valores ‘M’ ou ‘F’. Caso esteja errado, peça a digitação novamente até ter um valor correto.
sexo = str(input('Informe seu sexo: [M/F] ')).strip().upper()[0]
while sexo not in 'MmFf':
sexo = str(input('Dados inválidos. Informe seu sexo novamente: [... | 55.857143 | 159 | 0.695652 |
79447515fe1becbcb2771438aab29e2357a75f43 | 1,516 | py | Python | piston/web.py | sebwebdesigner/piston-local-node | 85d6f3a74b0f2b822e15099d6626a74764840018 | [
"MIT"
] | null | null | null | piston/web.py | sebwebdesigner/piston-local-node | 85d6f3a74b0f2b822e15099d6626a74764840018 | [
"MIT"
] | null | null | null | piston/web.py | sebwebdesigner/piston-local-node | 85d6f3a74b0f2b822e15099d6626a74764840018 | [
"MIT"
] | null | null | null | import re
from .utils import strfdelta, strfage
from .storage import configStorage as configStore
from .web_app import app, socketio
from .web_steem import WebSteem
from . import web_views, web_assets, web_socketio
import logging
log = logging.getLogger(__name__)
steem = WebSteem().getSteem()
@app.template_filter('ag... | 24.852459 | 58 | 0.639842 |
7944756609635070c072cea0bd71ef2c74a1cb52 | 3,717 | py | Python | app.py | UsernameForGerman/worker_cms_flask | 9503a46ca7253411b72a371f28f5f14cb0653e75 | [
"Apache-2.0"
] | null | null | null | app.py | UsernameForGerman/worker_cms_flask | 9503a46ca7253411b72a371f28f5f14cb0653e75 | [
"Apache-2.0"
] | null | null | null | app.py | UsernameForGerman/worker_cms_flask | 9503a46ca7253411b72a371f28f5f14cb0653e75 | [
"Apache-2.0"
] | null | null | null | import sqlite3
from flask import Flask
from flask_bootstrap import Bootstrap
from werkzeug import exceptions
app = Flask(__name__)
app.url_map.strict_slashes = False
Bootstrap(app)
DBNAME = 'main.db'
def prepare_db():
connection = sqlite3.connect(DBNAME)
cursor = connection.cursor()
statements = [
... | 30.719008 | 117 | 0.583804 |
7944759f1401425a4c13765a4eeed6a428f7ab7f | 2,074 | py | Python | models/tfidf_knn.py | jianguoz/DNNC-few-shot-intent | ea6f39a225d62f87c05f3628206b06dcaeb56f01 | [
"MIT"
] | 30 | 2020-11-13T22:21:51.000Z | 2022-03-02T03:46:46.000Z | models/tfidf_knn.py | jianguoz/DNNC-few-shot-intent | ea6f39a225d62f87c05f3628206b06dcaeb56f01 | [
"MIT"
] | 5 | 2021-04-14T04:48:59.000Z | 2021-08-04T11:22:43.000Z | models/tfidf_knn.py | jianguoz/DNNC-few-shot-intent | ea6f39a225d62f87c05f3628206b06dcaeb56f01 | [
"MIT"
] | 7 | 2020-11-17T08:56:40.000Z | 2022-03-30T06:22:48.000Z | # Copyright 2020, Salesforce.com, Inc.
#
# 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, publish, distri... | 51.85 | 462 | 0.712633 |
7944775738543f79c2b838dea606a85448c88251 | 4,149 | py | Python | t2t_bert/task_module/global_batch_norm.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | t2t_bert/task_module/global_batch_norm.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | t2t_bert/task_module/global_batch_norm.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | # import tensorflow.compat.v1 as tf
import tensorflow as tf
from tensorflow.python.tpu import tpu_function # pylint: disable=g-direct-tensorflow-import
BATCH_NORM_EPSILON = 1e-5
class BatchNormalization(tf.layers.BatchNormalization):
"""Batch Normalization layer that supports cross replica computation on TPU.
T... | 39.141509 | 92 | 0.712461 |
7944777745d4fd49c685fa4730c9b18e10829960 | 1,329 | py | Python | health_predict/setup.py | rockey2016/MachineLearning | 9b0a57ea66f4ec7a233b81f54a456604235b3679 | [
"Apache-2.0"
] | null | null | null | health_predict/setup.py | rockey2016/MachineLearning | 9b0a57ea66f4ec7a233b81f54a456604235b3679 | [
"Apache-2.0"
] | null | null | null | health_predict/setup.py | rockey2016/MachineLearning | 9b0a57ea66f4ec7a233b81f54a456604235b3679 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import io
from setuptools import setup
#with io.open('ReadMe.md','rt',encoding='utf8') as f:
# readme = f.read()
setup(
name='healthpredict', #pypi中的名称,pip或者easy_install安装时使用的名称
version='0.1.2',
#url='https://www.palletsprojects.com/p/flask/',
#project_urls=OrderedDict((
... | 30.906977 | 73 | 0.595937 |
794477acc88cb0a82a868a4df8bcdd46f500f85b | 3,110 | py | Python | test/unit/test_schema_validation.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | null | null | null | test/unit/test_schema_validation.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | 8 | 2019-10-10T08:03:02.000Z | 2022-01-11T11:28:58.000Z | test/unit/test_schema_validation.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | null | null | null | __author__ = 'tinglev@kth.se'
import unittest
import traceback
import mock
import requests
from test import mock_test_data
from modules.steps.report_success import ReportSuccess
from modules.util import data_defs, reporter_service, environment
class TestSchemaValidation(unittest.TestCase):
@unittest.skipIf(envir... | 45.735294 | 91 | 0.705145 |
7944785da4256f8a03a6df515e04745be5fc43a0 | 3,162 | py | Python | src/testbench/gmmset.py | juliia5m/knu_voice | 1f5d150ded23af4c152b8d20f1ab4ecec77b40e1 | [
"Apache-2.0"
] | 717 | 2015-01-03T15:25:46.000Z | 2022-03-30T12:45:45.000Z | src/testbench/gmmset.py | juliia5m/knu_voice | 1f5d150ded23af4c152b8d20f1ab4ecec77b40e1 | [
"Apache-2.0"
] | 91 | 2015-03-19T09:25:23.000Z | 2021-05-19T08:51:26.000Z | src/testbench/gmmset.py | juliia5m/knu_voice | 1f5d150ded23af4c152b8d20f1ab4ecec77b40e1 | [
"Apache-2.0"
] | 315 | 2015-01-21T00:06:00.000Z | 2022-03-29T08:13:36.000Z | #!/usr/bin/python2
# -*- coding: utf-8 -*-
# $File: gmmset.py
# $Date: Sun Feb 22 20:17:14 2015 +0800
# $Author: Xinyu Zhou <zxytim[at]gmail[dot]com>
import operator
import multiprocessing
from collections import defaultdict
import numpy as np
from gmm.python.pygmm import GMM
class GMMSet(object):
def __init__... | 28.745455 | 76 | 0.59709 |
794479052d43892ec769936798b1aebf02addd33 | 1,339 | py | Python | examples/IRT/EM/IRT.py | zelo2/EduCDM | d725dc50ec677dfe409d88a3ffea6dce8effad62 | [
"Apache-2.0"
] | 36 | 2021-04-28T03:22:03.000Z | 2022-03-30T16:54:44.000Z | examples/IRT/EM/IRT.py | zelo2/EduCDM | d725dc50ec677dfe409d88a3ffea6dce8effad62 | [
"Apache-2.0"
] | 21 | 2021-03-18T14:10:11.000Z | 2022-01-29T14:12:45.000Z | examples/IRT/EM/IRT.py | zelo2/EduCDM | d725dc50ec677dfe409d88a3ffea6dce8effad62 | [
"Apache-2.0"
] | 36 | 2021-03-17T14:43:18.000Z | 2022-03-29T07:52:26.000Z | # coding: utf-8
# 2021/5/2 @ liujiayu
import logging
import numpy as np
import pandas as pd
from EduCDM import EMIRT
train_data = pd.read_csv("../../../data/a0910/train.csv")
valid_data = pd.read_csv("../../../data/a0910/valid.csv")
test_data = pd.read_csv("../../../data/a0910/test.csv")
stu_num = max(max(train_data[... | 31.880952 | 109 | 0.668409 |
7944790fe856ead5a0030ba84b8e20f6e719599a | 1,150 | py | Python | tests/core/admin.py | narunbabu/django-import-export | a8506db680bce21feb8f143592e53cea1c46e337 | [
"BSD-2-Clause"
] | null | null | null | tests/core/admin.py | narunbabu/django-import-export | a8506db680bce21feb8f143592e53cea1c46e337 | [
"BSD-2-Clause"
] | null | null | null | tests/core/admin.py | narunbabu/django-import-export | a8506db680bce21feb8f143592e53cea1c46e337 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.contrib import admin
from import_export.resources import ModelResource
from import_export.admin import ImportExportMixin, ImportMixin, ExportActionModelAdmin
from .models import Book, Category, Author, Child, Census, CensusRest
class CensusAdmin(ImportExportMixin,... | 25 | 86 | 0.78087 |
79447a3d6ad6f59b89b837c63e9b291ce6d64f13 | 2,096 | py | Python | tests/unit/bigtop_harness.py | buggtb/layer-apache-bigtop-base | 65cbc24f1803423da2128d43907d02f094550c64 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-09-19T21:01:46.000Z | 2018-09-19T21:01:46.000Z | tests/unit/bigtop_harness.py | buggtb/layer-apache-bigtop-base | 65cbc24f1803423da2128d43907d02f094550c64 | [
"ECL-2.0",
"Apache-2.0"
] | 51 | 2016-04-15T21:33:22.000Z | 2018-08-07T22:04:11.000Z | tests/unit/bigtop_harness.py | buggtb/layer-apache-bigtop-base | 65cbc24f1803423da2128d43907d02f094550c64 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2016-04-14T23:23:07.000Z | 2018-10-02T21:50:12.000Z | #
# bigtop_harness.py -- Harness for out unit tests
#
import logging
import mock
import os
import unittest
from path import Path
LOGGER = logging.getLogger()
LOGGER.addHandler(logging.StreamHandler())
LOGGER.setLevel(logging.DEBUG)
class Harness(unittest.TestCase):
'''
Harness for our unit tests. Automatica... | 21.387755 | 74 | 0.583969 |
79447b07a68ac398e5951b0ecaea40c825b6dba5 | 15,623 | py | Python | syft/nn.py | morgangiraud/PySyft | 79e0505a6e9ec2d78287d8c19b27bbac28455780 | [
"Apache-2.0"
] | 1 | 2018-03-19T01:40:01.000Z | 2018-03-19T01:40:01.000Z | syft/nn.py | morgangiraud/PySyft | 79e0505a6e9ec2d78287d8c19b27bbac28455780 | [
"Apache-2.0"
] | null | null | null | syft/nn.py | morgangiraud/PySyft | 79e0505a6e9ec2d78287d8c19b27bbac28455780 | [
"Apache-2.0"
] | null | null | null | import syft.controller as controller
from syft.utils import Progress
from syft import FloatTensor
import sys, time
import numpy as np
import syft.metrics
class Model():
def __init__(self, id=None):
self.sc = controller
self.params = False
self.type = None
self._layer_type = None
self.id = id
self.type = "... | 29.871893 | 163 | 0.664661 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.