hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a95fed84cdb96b208252eb0be36bacbed0b9cfe6 | 1,177 | py | Python | setup.py | GobySoft/pyifcb | f465329e720c826069cdd02b55e35d780f24a3d5 | [
"MIT"
] | 5 | 2018-08-12T02:04:44.000Z | 2021-03-19T02:21:31.000Z | setup.py | GobySoft/pyifcb | f465329e720c826069cdd02b55e35d780f24a3d5 | [
"MIT"
] | 46 | 2016-09-14T21:12:52.000Z | 2022-02-14T20:33:49.000Z | setup.py | GobySoft/pyifcb | f465329e720c826069cdd02b55e35d780f24a3d5 | [
"MIT"
] | 3 | 2018-10-18T16:03:08.000Z | 2021-07-28T14:45:06.000Z | from setuptools import setup, find_packages
def version():
with open('VERSION') as f:
return f.read().strip()
def readme():
with open('README.md', 'rb') as f:
return f.read().decode('utf-8', errors='ignore')
reqs = [line.strip() for line in open('requirements.txt') if not line.startswith('... | 30.179487 | 86 | 0.562447 |
186dd5b1855e5661148030d34f444e10cca6b9c9 | 2,408 | py | Python | nipap-www/nipapwww/config/middleware.py | dlewen/NIPAP | de09cd7c4c55521f26f00201d694ea9e388b21a9 | [
"MIT"
] | 403 | 2015-01-03T15:37:05.000Z | 2022-03-31T12:14:38.000Z | nipap-www/nipapwww/config/middleware.py | dlewen/NIPAP | de09cd7c4c55521f26f00201d694ea9e388b21a9 | [
"MIT"
] | 507 | 2015-01-02T15:02:12.000Z | 2022-01-26T08:47:36.000Z | nipap-www/nipapwww/config/middleware.py | dlewen/NIPAP | de09cd7c4c55521f26f00201d694ea9e388b21a9 | [
"MIT"
] | 153 | 2015-01-13T15:35:51.000Z | 2022-03-17T23:07:42.000Z | """Pylons middleware initialization"""
from beaker.middleware import SessionMiddleware
from paste.cascade import Cascade
from paste.registry import RegistryManager
from paste.urlparser import StaticURLParser
from paste.deploy.converters import asbool
from pylons.middleware import ErrorHandler, StatusCodeRedirect
from p... | 35.411765 | 76 | 0.708056 |
44b5da5d5a9d961c96500b4a16851810c27b771f | 756 | py | Python | gimbal/libraries/gimbal.py | mkinney/rocket-motor-datalogger | 553af6e0357cfb994dc8aa680b2c027ad28d788b | [
"Apache-2.0"
] | null | null | null | gimbal/libraries/gimbal.py | mkinney/rocket-motor-datalogger | 553af6e0357cfb994dc8aa680b2c027ad28d788b | [
"Apache-2.0"
] | 1 | 2021-12-31T16:06:39.000Z | 2021-12-31T16:10:44.000Z | gimbal/libraries/gimbal.py | mkinney/rocket-motor-datalogger | 553af6e0357cfb994dc8aa680b2c027ad28d788b | [
"Apache-2.0"
] | 1 | 2021-12-31T15:59:01.000Z | 2021-12-31T15:59:01.000Z | from adafruit_servokit import ServoKit
class Gimbal:
def __init__(self, pitch_servo=14, yaw_servo=15):
self.kit = ServoKit(channels=16)
self.pitch_servo = pitch_servo
self.yaw_servo = yaw_servo
self.go_home()
def go_home(self):
self.kit.servo[self.pitch_servo].angle ... | 26.068966 | 54 | 0.649471 |
718b6b8abf44ae29e3e81442ec89262a4278ffe9 | 8,582 | py | Python | g2p_en/g2p.py | casonclagg/g2p | 087ca98939befcb84688b77a7bcdf8edcbbaafb0 | [
"Apache-2.0"
] | null | null | null | g2p_en/g2p.py | casonclagg/g2p | 087ca98939befcb84688b77a7bcdf8edcbbaafb0 | [
"Apache-2.0"
] | null | null | null | g2p_en/g2p.py | casonclagg/g2p | 087ca98939befcb84688b77a7bcdf8edcbbaafb0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# /usr/bin/python
# Example extending the heteronym dict:
# g2p.homograph2features["wind"] = ("W AY1 N D".split(), "W IH1 N D".split(), "V")
'''
By kyubyong park(kbpark.linguist@gmail.com) and Jongseok Kim(https://github.com/ozmig77)
https://www.github.com/kyubyong/g2p
'''
from nltk import pos... | 38.484305 | 138 | 0.498718 |
0126eaa610ad95afb2679697d050b61ae8b3a478 | 108,505 | py | Python | saleor/graphql/meta/tests/test_meta_queries.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 15,337 | 2015-01-12T02:11:52.000Z | 2021-10-05T19:19:29.000Z | saleor/graphql/meta/tests/test_meta_queries.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 7,486 | 2015-02-11T10:52:13.000Z | 2021-10-06T09:37:15.000Z | saleor/graphql/meta/tests/test_meta_queries.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 5,864 | 2015-01-16T14:52:54.000Z | 2021-10-05T23:01:15.000Z | from typing import List
import graphene
from django.contrib.auth.models import Permission
from django.http import HttpResponse
from saleor.core.models import ModelWithMetadata
from saleor.payment.models import Payment
from saleor.payment.utils import payment_owned_by_user
from ...tests.fixtures import ApiClient
from... | 28.834706 | 88 | 0.701028 |
61ff08eeb4811a14c25001478cf9e2f0eb596d87 | 1,907 | py | Python | app/extension/confluence/extension_ui.py | vschlemmer/dc-app-performance-toolkit | 354082804e71ff8dc37f80c484081c4a9b2e33a7 | [
"Apache-2.0"
] | null | null | null | app/extension/confluence/extension_ui.py | vschlemmer/dc-app-performance-toolkit | 354082804e71ff8dc37f80c484081c4a9b2e33a7 | [
"Apache-2.0"
] | null | null | null | app/extension/confluence/extension_ui.py | vschlemmer/dc-app-performance-toolkit | 354082804e71ff8dc37f80c484081c4a9b2e33a7 | [
"Apache-2.0"
] | null | null | null | import random
from selenium.webdriver.common.by import By
from selenium_ui.base_page import BasePage
from selenium_ui.conftest import print_timing
from selenium_ui.confluence.pages.pages import Login, AllUpdates
from util.conf import CONFLUENCE_SETTINGS
def app_specific_action(webdriver, datasets):
page = BaseP... | 42.377778 | 127 | 0.705296 |
8186bc89258124fee8b530d11a91a0146d77aad7 | 136 | py | Python | tests/regression/diabetes/ws_diabetes_DecisionTreeRegressor_mssql_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 1 | 2019-07-09T14:45:18.000Z | 2019-07-09T14:45:18.000Z | tests/regression/diabetes/ws_diabetes_DecisionTreeRegressor_mssql_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 5 | 2017-11-13T13:35:37.000Z | 2021-11-11T12:57:20.000Z | tests/regression/diabetes/ws_diabetes_DecisionTreeRegressor_mssql_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 1 | 2021-09-19T15:05:33.000Z | 2021-09-19T15:05:33.000Z | from sklearn2sql_heroku.tests.regression import generic as reg_gen
reg_gen.test_model("DecisionTreeRegressor" , "diabetes" , "mssql")
| 27.2 | 66 | 0.808824 |
5265e5ea6a06d982008485440a5dbe59078aa693 | 1,507 | py | Python | JSScripts/express_installation.py | chalmersteknologkonsulter/Pollux | 9c41fc2a3f961bed2026611c9cffcb363a2985f5 | [
"MIT"
] | null | null | null | JSScripts/express_installation.py | chalmersteknologkonsulter/Pollux | 9c41fc2a3f961bed2026611c9cffcb363a2985f5 | [
"MIT"
] | 1 | 2020-05-10T23:20:42.000Z | 2020-05-10T23:20:42.000Z | JSScripts/express_installation.py | chalmersteknologkonsulter/Pollux | 9c41fc2a3f961bed2026611c9cffcb363a2985f5 | [
"MIT"
] | null | null | null | import os
import platform
install_express = input("Would like to build an express server? Y/n ")
if (install_express == "n" or install_express == "N"):
print("Bye!")
exit()
else:
os_type = platform.system()
print(os_type)
# install node
################ UNIX ###################
npm_installed = input(... | 26.438596 | 75 | 0.609821 |
94291d4ca7f56b6f1b5f7849b5d78b0b56ce0056 | 2,464 | py | Python | utils/utils.py | noamholz/PSPNet-Keras-tensorflow | 48ab6972228776183d76565842adf429ad420522 | [
"MIT"
] | 3 | 2020-12-22T12:50:22.000Z | 2022-03-18T05:54:30.000Z | utils/utils.py | noamholz/PSPNet-Keras-tensorflow | 48ab6972228776183d76565842adf429ad420522 | [
"MIT"
] | null | null | null | utils/utils.py | noamholz/PSPNet-Keras-tensorflow | 48ab6972228776183d76565842adf429ad420522 | [
"MIT"
] | 1 | 2021-04-06T12:41:28.000Z | 2021-04-06T12:41:28.000Z | from __future__ import print_function
import colorsys
import numpy as np
from tensorflow.keras.models import Model
from cityscapes_labels import trainId2label
from ade20k_labels import ade20k_id2label
from pascal_voc_labels import voc_id2label
def class_image_to_image(class_id_image, class_id_to_rgb_map):
"""Map ... | 35.2 | 94 | 0.668831 |
2538e04775a9479c5e5b9139743348ed710e875f | 6,939 | py | Python | py/lvmspec/test/test_ql.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | py/lvmspec/test/test_ql.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | py/lvmspec/test/test_ql.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | """
Test capabilities of QuickLook pipeline
python -m lvmspec.test.test_ql
"""
import os, sys
import shutil
from uuid import uuid4
import unittest
import yaml
import numpy as np
from lvmspec.util import runcmd
from lvmspec.io.raw import write_raw
from lvmspec.io import empty_fibermap
from lvmspec.io.fibermap import w... | 40.109827 | 216 | 0.533794 |
60a4599a05bd33473b0314ddd1b36e1ed5f09eef | 4,578 | py | Python | autodiff/core.py | ceisenach/torchkit | f2b9fe3ca1c13a34f0435c7b2871b6fad8bc4f37 | [
"MIT"
] | 3 | 2019-04-19T16:14:12.000Z | 2020-09-01T11:08:15.000Z | autodiff/core.py | ceisenach/torchkit | f2b9fe3ca1c13a34f0435c7b2871b6fad8bc4f37 | [
"MIT"
] | null | null | null | autodiff/core.py | ceisenach/torchkit | f2b9fe3ca1c13a34f0435c7b2871b6fad8bc4f37 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import copy
import numpy as np
from . import util as util
__all__ = ['JParameter','JTensor']
##########################################################
### Auto-Jacobian
##########################################################
class JParameter(nn.Parameter):
r"""Special type ... | 34.421053 | 134 | 0.572302 |
fcc785342b2cc7976ea8c888ada6939b90f7b7dc | 255 | py | Python | apps/utils/__init__.py | zhangcw/mxonline | f9ccb5dbdc895e2c71e9426392de154d304f2b39 | [
"Apache-2.0"
] | null | null | null | apps/utils/__init__.py | zhangcw/mxonline | f9ccb5dbdc895e2c71e9426392de154d304f2b39 | [
"Apache-2.0"
] | null | null | null | apps/utils/__init__.py | zhangcw/mxonline | f9ccb5dbdc895e2c71e9426392de154d304f2b39 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright(C), 2019, Zhang Chengwei.
#
# Author: zhang
# DATE: 2019/5/24 15:42
# IDE_NAME: PyCharm
# Filename: __init__.py.py
# Version: 1.0.0
# Description:
# History:
| 18.214286 | 37 | 0.552941 |
a0ddef03df9ecf82c52130c39c0589e61110afe9 | 6,541 | py | Python | ConcordAlarm.indigoPlugin/Contents/Server Plugin/concord/concord_alarm_codes.py | csdozier/py-concord | 29256f3ae4b7764e20caf646f5fdc9808cc9f755 | [
"BSD-3-Clause"
] | 7 | 2016-01-27T23:25:08.000Z | 2019-06-01T17:08:32.000Z | ConcordAlarm.indigoPlugin/Contents/Server Plugin/concord/concord_alarm_codes.py | csdozier/py-concord | 29256f3ae4b7764e20caf646f5fdc9808cc9f755 | [
"BSD-3-Clause"
] | 7 | 2020-08-12T20:11:08.000Z | 2022-01-24T00:01:18.000Z | ConcordAlarm.indigoPlugin/Contents/Server Plugin/concord/concord_alarm_codes.py | csdozier/py-concord | 29256f3ae4b7764e20caf646f5fdc9808cc9f755 | [
"BSD-3-Clause"
] | 3 | 2016-11-25T00:15:44.000Z | 2021-02-22T15:55:17.000Z | """
Concord panel general and specific alarm type codes.
"""
ALARM_SPECIFIC_TYPES = {
0: 'Unspecified',
1: 'Fire',
2: 'Fire Panic',
3: 'Police',
4: 'Police Panic',
5: 'Medical',
6: 'Medical Panic',
7: 'Auxiliary',
8: 'Auxiliary Panic',
9: 'Tamper',
10: 'No Activity',
11: 'Suspicion',
12: 'Not used',
13: 'Low Temperatu... | 25.352713 | 80 | 0.696071 |
d1fce95f7c48cd9419261ff37068567634f05238 | 1,462 | py | Python | adminmgr/media/code/A3/task2/task1__ulCvYOT.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/A3/task2/task1__cyjNcXj.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/A3/task1/task1__X56OP5g.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | from pyspark.sql import SparkSession
from pyspark.sql.functions import explode
from pyspark.sql.functions import split
spark = SparkSession \
.builder \
.appName("StructuredNetworkWordCount") \
.getOrCreate()
# Create DataFrame representing the stream of input lines from connection to localhost:9999
# "ID"... | 41.771429 | 325 | 0.687415 |
de41795a68ded83f850fd77aad4d766cc527fcfb | 9,010 | py | Python | papermill/cli.py | VincentKetelaars/papermill | 7d02847e6eb2a33800e9b321539ccf6b05966e3f | [
"BSD-3-Clause"
] | null | null | null | papermill/cli.py | VincentKetelaars/papermill | 7d02847e6eb2a33800e9b321539ccf6b05966e3f | [
"BSD-3-Clause"
] | null | null | null | papermill/cli.py | VincentKetelaars/papermill | 7d02847e6eb2a33800e9b321539ccf6b05966e3f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Main `papermill` interface."""
import os
import sys
from stat import S_ISFIFO
import nbclient
import traceback
import base64
import logging
import click
import yaml
import platform
from .execute import execute_notebook
from .iorw import read_yaml_file, NoDatesSafeLoader
from .inspection ... | 28.878205 | 100 | 0.672253 |
896acdc239ad5ca521692558509beae1e70bbc5f | 17,841 | py | Python | opts.py | sebastianGehrmann/diverse_ensembling | f7a1d4828a0a78105cfa10d126f95fd15085fb08 | [
"MIT"
] | 28 | 2018-10-12T21:43:22.000Z | 2021-11-19T03:04:59.000Z | opts.py | liuheng0111/diverse_ensembling | f7a1d4828a0a78105cfa10d126f95fd15085fb08 | [
"MIT"
] | 1 | 2018-10-22T07:15:42.000Z | 2018-10-22T07:15:42.000Z | opts.py | liuheng0111/diverse_ensembling | f7a1d4828a0a78105cfa10d126f95fd15085fb08 | [
"MIT"
] | 9 | 2018-10-12T21:49:28.000Z | 2021-11-24T16:22:58.000Z | import argparse
from onmt.modules.SRU import CheckSRU
def model_opts(parser):
"""
These options are passed to the construction of the model.
Be careful with these as they will be used during translation.
"""
# Model options
parser.add_argument('-model_type', default='text',
... | 49.97479 | 84 | 0.577154 |
5244fad534c72c98343403e751b8c08cce57f5d5 | 8,655 | py | Python | dual_dice/run.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-01-19T23:35:59.000Z | 2022-01-19T23:35:59.000Z | dual_dice/run.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | dual_dice/run.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 37.145923 | 80 | 0.706181 |
d45010d9125d9824b29498aefbc5bb685aa4b4f8 | 1,878 | py | Python | examples/src/main/python/mllib/logistic_regression.py | hochoy18/spark-2.2 | 421979234f03e698d61b2d14010deb0c6d34d890 | [
"0BSD",
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 9 | 2018-08-08T05:40:20.000Z | 2020-07-25T12:21:41.000Z | examples/src/main/python/mllib/logistic_regression.py | rongyousu/spark-2.2 | 421979234f03e698d61b2d14010deb0c6d34d890 | [
"0BSD",
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 2 | 2020-05-15T21:40:43.000Z | 2021-01-21T00:17:29.000Z | examples/src/main/python/mllib/logistic_regression.py | rongyousu/spark-2.2 | 421979234f03e698d61b2d14010deb0c6d34d890 | [
"0BSD",
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 14 | 2019-01-14T07:01:36.000Z | 2021-01-06T01:45:08.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may n... | 35.433962 | 81 | 0.702343 |
4bfc71d9bb2be1202737d48c7abfe21ab06dc180 | 147 | py | Python | jp.atcoder/abc057/abc057_a/11363186.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc057/abc057_a/11363186.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc057/abc057_a/11363186.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
a, b = map(int, sys.stdin.readline().split())
def main():
print((a + b) % 24)
if __name__ == "__main__":
main()
| 12.25 | 46 | 0.517007 |
d5f16800bd7476684d4642382fa56c5dbac6264a | 2,051 | py | Python | qiubai/qiubai/middlewares.py | aeoluswing/scrapy | ace7792d7fd05df1b15fdf6f71221ce478299bfb | [
"Apache-2.0"
] | null | null | null | qiubai/qiubai/middlewares.py | aeoluswing/scrapy | ace7792d7fd05df1b15fdf6f71221ce478299bfb | [
"Apache-2.0"
] | null | null | null | qiubai/qiubai/middlewares.py | aeoluswing/scrapy | ace7792d7fd05df1b15fdf6f71221ce478299bfb | [
"Apache-2.0"
] | null | null | null | import random
USER_AGENTS = [
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)",
"Mozilla/4.0 (compatible; MSIE 7.0; AOL... | 78.884615 | 192 | 0.681619 |
e429a9ed4a1a794a532b2e3bc72553df33349238 | 438 | py | Python | utilities/scan_tools/polar_scan_matcher/catkin_generated/pkg.installspace.context.pc.py | mrsd16teamd/loco_car | 36e4ed685f9463ad689ca72eec80e0f05f1ad66c | [
"MIT"
] | 48 | 2016-11-10T06:00:27.000Z | 2022-03-01T12:57:23.000Z | utilities/scan_tools/polar_scan_matcher/catkin_generated/pkg.installspace.context.pc.py | mrsd16teamd/loco_car | 36e4ed685f9463ad689ca72eec80e0f05f1ad66c | [
"MIT"
] | 6 | 2017-04-03T05:39:06.000Z | 2017-07-27T02:35:44.000Z | utilities/scan_tools/polar_scan_matcher/catkin_generated/pkg.installspace.context.pc.py | mrsd16teamd/loco_car | 36e4ed685f9463ad689ca72eec80e0f05f1ad66c | [
"MIT"
] | 20 | 2017-02-28T13:24:31.000Z | 2021-12-06T12:36:46.000Z | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/usr/local/include".split(';') if "/usr/local/include" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "-lpolar_scan_matcher".split(';') if "-lpolar_scan_... | 48.666667 | 108 | 0.73516 |
243e90bd94a169619a95308df11544bc3c00165c | 9,699 | py | Python | plenum/test/observer/test_observer_policy_each_batch.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | plenum/test/observer/test_observer_policy_each_batch.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | plenum/test/observer/test_observer_policy_each_batch.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | 2 | 2017-12-13T21:14:54.000Z | 2021-06-06T15:48:03.000Z | import types
import pytest
from common.exceptions import PlenumValueError
from plenum.common.constants import BATCH, DOMAIN_LEDGER_ID, CURRENT_PROTOCOL_VERSION
from plenum.common.messages.node_messages import BatchCommitted, ObservedData
from plenum.common.util import get_utc_epoch
from plenum.server.observer.observe... | 35.789668 | 94 | 0.756779 |
bcc9fb81090146f016c4a958a4935fa86b3e1d4c | 311 | py | Python | jf/get_entries.py | Xderial/Journal | d50ba8ab79123732f98a08d0d5f891e867a39ecd | [
"MIT"
] | null | null | null | jf/get_entries.py | Xderial/Journal | d50ba8ab79123732f98a08d0d5f891e867a39ecd | [
"MIT"
] | null | null | null | jf/get_entries.py | Xderial/Journal | d50ba8ab79123732f98a08d0d5f891e867a39ecd | [
"MIT"
] | null | null | null | import os
import os.path
from .config import config
from .Entry import Entry
def get_entries():
path = config.directory
entries = []
for item in os.listdir(path):
entry = f"{path}/{item}"
if os.path.isfile(entry):
entries.append(Entry.load(item))
return sorted(entries, key=Entry.sort_key)[::-1]
| 18.294118 | 49 | 0.70418 |
87045ef10a9b3ffaefa13bffce7b9a003f41869b | 273 | py | Python | Python-Programming/Teaching-Material/learn-sql-using-python.py | vivekparasharr/Learn-Programming | 1ae07ef5143bff3c504978e1d375698820f59af0 | [
"MIT"
] | null | null | null | Python-Programming/Teaching-Material/learn-sql-using-python.py | vivekparasharr/Learn-Programming | 1ae07ef5143bff3c504978e1d375698820f59af0 | [
"MIT"
] | null | null | null | Python-Programming/Teaching-Material/learn-sql-using-python.py | vivekparasharr/Learn-Programming | 1ae07ef5143bff3c504978e1d375698820f59af0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 30 17:52:48 2020
@author: vivek
"""
import sqlite3
# create new database
conn = sqlite3.connect('.\sql_db\Demo_table.db')
# create Cursor to execute queries
cur = conn.cursor()
print('Databse created.')
| 15.166667 | 49 | 0.637363 |
d7722c385564cc4f09e3dc8fc0b13530df47e931 | 4,572 | py | Python | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/bind_tags_dto.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/bind_tags_dto.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/bind_tags_dto.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class BindTagsDTO:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is att... | 27.542169 | 109 | 0.569335 |
055d4362454fc8be6e93a000bec3797ff0cf3bdd | 230,854 | py | Python | spyder/plugins/editor/widgets/codeeditor.py | Ajax-Light/spyder | f679bffd95bd3b2c1875c284cb26bae1299a986e | [
"MIT"
] | null | null | null | spyder/plugins/editor/widgets/codeeditor.py | Ajax-Light/spyder | f679bffd95bd3b2c1875c284cb26bae1299a986e | [
"MIT"
] | null | null | null | spyder/plugins/editor/widgets/codeeditor.py | Ajax-Light/spyder | f679bffd95bd3b2c1875c284cb26bae1299a986e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Editor widget based on QtGui.QPlainTextEdit
"""
# TODO: Try to separate this module from spyder to create a self
# consistent editor module (Qt ... | 41.386518 | 91 | 0.581926 |
bda9354bf815baec5078a3ec80f5a1f7d39af85a | 1,217 | py | Python | deuce/controllers/vault.py | TheSriram/deuce | 9e8a7a342275aa02d0a59953b5a8c96ffb760b51 | [
"Apache-2.0"
] | null | null | null | deuce/controllers/vault.py | TheSriram/deuce | 9e8a7a342275aa02d0a59953b5a8c96ffb760b51 | [
"Apache-2.0"
] | null | null | null | deuce/controllers/vault.py | TheSriram/deuce | 9e8a7a342275aa02d0a59953b5a8c96ffb760b51 | [
"Apache-2.0"
] | null | null | null |
from pecan import expose, response, request
from pecan.rest import RestController
from deuce.controllers.blocks import BlocksController
from deuce.controllers.files import FilesController
from deuce.controllers.validation import *
from deuce.model import Vault
class VaultController(RestController):
blocks = Blo... | 25.354167 | 60 | 0.66968 |
e949cd0abf7f47fd9bcf4a0c2244cf13b4971171 | 3,097 | py | Python | todo_list/settings.py | Mohamed-Jeafer/todo_list_project | 98a7db4db3e4fcc2835d0fa3f2522b13b1d0a514 | [
"MIT"
] | null | null | null | todo_list/settings.py | Mohamed-Jeafer/todo_list_project | 98a7db4db3e4fcc2835d0fa3f2522b13b1d0a514 | [
"MIT"
] | null | null | null | todo_list/settings.py | Mohamed-Jeafer/todo_list_project | 98a7db4db3e4fcc2835d0fa3f2522b13b1d0a514 | [
"MIT"
] | null | null | null | """
Django settings for todo_list project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... | 25.595041 | 91 | 0.69648 |
38e860cb5529ca11cacf1421f0bcce911f0b8deb | 696 | py | Python | samples/advanced/sources/utils/environment.py | bernardocouto/bottle-postgresql | e1b5a9d09565ebb21f59ae0d41ea2f67319ee53f | [
"MIT"
] | 10 | 2021-03-23T19:49:05.000Z | 2022-01-04T18:15:32.000Z | samples/advanced/sources/utils/environment.py | bernardocouto/bottle-postgresql | e1b5a9d09565ebb21f59ae0d41ea2f67319ee53f | [
"MIT"
] | null | null | null | samples/advanced/sources/utils/environment.py | bernardocouto/bottle-postgresql | e1b5a9d09565ebb21f59ae0d41ea2f67319ee53f | [
"MIT"
] | null | null | null | import os
APPLICATION_DEBUG = os.environ.get('APPLICATION_DEBUG')
APPLICATION_HOST = os.environ.get('APPLICATION_HOST')
APPLICATION_PORT = os.environ.get('APPLICATION_PORT')
APPLICATION_RELOADER = os.environ.get('APPLICATION_RELOADER')
DATABASE_CONNECTION_TIMEOUT = os.environ.get('DATABASE_CONNECTION_TIMEOUT')
DATABA... | 43.5 | 75 | 0.821839 |
4249ea6fcb9ee2e6ab34fcc375befc79f6846235 | 2,119 | py | Python | latexbot/latexbot/xkcd.py | tylertian123/ryver-latexbot | 83e4964911dc2dd5b1f6c0bdc83a1aba13ce6425 | [
"MIT"
] | 2 | 2020-10-07T21:12:28.000Z | 2021-08-23T18:50:30.000Z | latexbot/latexbot/xkcd.py | tylertian123/ryver-latexbot | 83e4964911dc2dd5b1f6c0bdc83a1aba13ce6425 | [
"MIT"
] | 47 | 2020-02-22T04:25:57.000Z | 2021-12-17T23:50:33.000Z | latexbot/latexbot/xkcd.py | tylertian123/ryver-latexbot | 83e4964911dc2dd5b1f6c0bdc83a1aba13ce6425 | [
"MIT"
] | null | null | null | import aiohttp
from typing import Union, Dict, Any
async def get_comic(number: int = None, session: aiohttp.ClientSession = None) -> Union[Dict[str, Any], None]:
"""
Get an xkcd by number or the latest xkcd.
If the comic does not exist, this function returns None.
All other errors will raise a aiohttp... | 39.981132 | 134 | 0.613025 |
fec04ee5a40e3ae9fbfcbd607af3ce93430aea02 | 2,249 | py | Python | remme/rpc_api/block_info.py | FerrySchuller/remme-core | ca58bfcc5ff0ce6d15c2871a4e03e39f1268d789 | [
"Apache-2.0"
] | 129 | 2018-02-13T21:37:13.000Z | 2020-11-01T23:33:52.000Z | remme/rpc_api/block_info.py | FerrySchuller/remme-core | ca58bfcc5ff0ce6d15c2871a4e03e39f1268d789 | [
"Apache-2.0"
] | 95 | 2018-03-27T15:57:36.000Z | 2019-08-26T07:35:23.000Z | remme/rpc_api/block_info.py | FerrySchuller/remme-core | ca58bfcc5ff0ce6d15c2871a4e03e39f1268d789 | [
"Apache-2.0"
] | 30 | 2018-02-24T15:17:37.000Z | 2020-11-14T11:35:25.000Z | # Copyright 2018 REMME
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | 29.986667 | 91 | 0.697643 |
cae14c87a1307620921d14f5f19933a0908f8e2a | 2,999 | py | Python | emmett_assets/webassets/filter/autoprefixer.py | gi0baro/emmett-assets | 6ebbc164ec7270bf8c63e88eeef010d55ecfffc8 | [
"BSD-3-Clause"
] | null | null | null | emmett_assets/webassets/filter/autoprefixer.py | gi0baro/emmett-assets | 6ebbc164ec7270bf8c63e88eeef010d55ecfffc8 | [
"BSD-3-Clause"
] | null | null | null | emmett_assets/webassets/filter/autoprefixer.py | gi0baro/emmett-assets | 6ebbc164ec7270bf8c63e88eeef010d55ecfffc8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import with_statement
from . import ExternalTool
from ..utils import working_directory
class AutoprefixerFilter(ExternalTool):
"""Prefixes vendor-prefixes using `autoprefixer
<https://github.com/ai/autoprefixer>`, which uses the `Can I Use?
<http://www.caniuse.com>` database to know which... | 34.872093 | 91 | 0.653885 |
01c6c9cfc060be26222447793061871d41263c7e | 409 | py | Python | dfi/datafiles.py | avishekrk/DFI | d8eac4531215de6696deac56308c3b6f47489550 | [
"BSD-3-Clause"
] | 3 | 2019-09-29T20:49:03.000Z | 2022-02-21T17:27:57.000Z | dfi/datafiles.py | avishekrk/DFI | d8eac4531215de6696deac56308c3b6f47489550 | [
"BSD-3-Clause"
] | 13 | 2016-11-27T06:31:15.000Z | 2021-12-01T10:51:22.000Z | dfi/datafiles.py | avishekrk/DFI | d8eac4531215de6696deac56308c3b6f47489550 | [
"BSD-3-Clause"
] | null | null | null | from pkg_resources import resource_filename
example_pdb = resource_filename(__name__, 'data/1l2y.pdb')
unipro_pdb = resource_filename(__name__, 'data/unipropdb.csv')
xyz_npy = resource_filename(__name__, 'data/xyz.npy')
example_covar = resource_filename(__name__, 'data/1l2y_covar.dat')
example_fasta = resource_filenam... | 45.444444 | 66 | 0.811736 |
4923be4eae713fc40cc849e92607355582d4d827 | 1,188 | py | Python | nncf/common/initialization/dataloader.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 136 | 2020-06-01T14:03:31.000Z | 2020-10-28T06:10:50.000Z | nncf/common/initialization/dataloader.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 133 | 2020-05-26T13:48:04.000Z | 2020-10-28T05:25:55.000Z | nncf/common/initialization/dataloader.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 36 | 2020-05-28T08:18:39.000Z | 2020-10-27T14:46:58.000Z | """
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 30.461538 | 73 | 0.697811 |
ab714f752181056d17af3f6b4b8df0ad9295b80d | 5,957 | py | Python | src/garage/np/algos/cem.py | blacksph3re/garage | b4abe07f0fa9bac2cb70e4a3e315c2e7e5b08507 | [
"MIT"
] | 1,500 | 2018-06-11T20:36:24.000Z | 2022-03-31T08:29:01.000Z | src/garage/np/algos/cem.py | blacksph3re/garage | b4abe07f0fa9bac2cb70e4a3e315c2e7e5b08507 | [
"MIT"
] | 2,111 | 2018-06-11T04:10:29.000Z | 2022-03-26T14:41:32.000Z | src/garage/np/algos/cem.py | blacksph3re/garage | b4abe07f0fa9bac2cb70e4a3e315c2e7e5b08507 | [
"MIT"
] | 309 | 2018-07-24T11:18:48.000Z | 2022-03-30T16:19:48.000Z | """Cross Entropy Method."""
import collections
from dowel import logger, tabular
import numpy as np
from garage import log_performance
from garage.np.algos.rl_algorithm import RLAlgorithm
class CEM(RLAlgorithm):
"""Cross Entropy Method.
CEM works by iteratively optimizing a gaussian distribution of policy.... | 34.433526 | 78 | 0.605842 |
08dcbd6438b7c5dcce4df3976b77f18d9d9ea1e4 | 5,821 | py | Python | Function.py | LeonAgmonNacht/Genetic-Algorithm-Firewall-TAU | cc29c86a4c60234cbc5091f3b7e560f556347a13 | [
"MIT"
] | null | null | null | Function.py | LeonAgmonNacht/Genetic-Algorithm-Firewall-TAU | cc29c86a4c60234cbc5091f3b7e560f556347a13 | [
"MIT"
] | null | null | null | Function.py | LeonAgmonNacht/Genetic-Algorithm-Firewall-TAU | cc29c86a4c60234cbc5091f3b7e560f556347a13 | [
"MIT"
] | null | null | null | from random import random
class Function:
"""
A class representing a function.
This class improves the work with functions like in math
Note: This class is immutable, f + g returns a new function and is not changing any function.
"""
def __init__(self, param):
"""
This is the c... | 37.314103 | 113 | 0.601443 |
38ae521d1a11d35100712e7def2ba144af7057d5 | 16,418 | py | Python | flappy.py | bparihar/testflappy-py | 2b0603226c365d1e97b516da3328efd492b9f8a1 | [
"MIT"
] | 1 | 2020-12-27T06:48:15.000Z | 2020-12-27T06:48:15.000Z | flappy.py | bparihar/testflappy-py | 2b0603226c365d1e97b516da3328efd492b9f8a1 | [
"MIT"
] | 1 | 2021-05-28T09:18:18.000Z | 2021-05-28T09:18:18.000Z | flappy.py | bparihar/testflappy-py | 2b0603226c365d1e97b516da3328efd492b9f8a1 | [
"MIT"
] | 8 | 2020-04-26T14:14:55.000Z | 2020-08-31T12:19:44.000Z | from itertools import cycle
import random
import sys
import pygame
from pygame.locals import *
FPS = 30
SCREENWIDTH = 288
SCREENHEIGHT = 512
PIPEGAPSIZE = 100 # gap between upper and lower part of pipe
BASEY = SCREENHEIGHT * 0.79
# image, sound and hitmask dicts
IMAGES, SOUNDS, HITMASKS = {}, {}, {}
# lis... | 33.643443 | 90 | 0.58984 |
f41523b03548da127cf407f32680bf45e869f6f6 | 14,252 | py | Python | models/coresnet.py | iduta/coconv | 755147cd0dc7faad242015f245a06a2d72fa221f | [
"MIT"
] | 10 | 2021-05-07T11:31:30.000Z | 2021-12-22T05:45:44.000Z | models/coresnet.py | iduta/coconv | 755147cd0dc7faad242015f245a06a2d72fa221f | [
"MIT"
] | null | null | null | models/coresnet.py | iduta/coconv | 755147cd0dc7faad242015f245a06a2d72fa221f | [
"MIT"
] | 2 | 2021-05-07T11:31:32.000Z | 2021-12-20T13:49:57.000Z | import torch
import torch.nn as nn
import os
from div.download_from_url import download_from_url
try:
from torch.hub import _get_torch_home
torch_cache_home = _get_torch_home()
except ImportError:
torch_cache_home = os.path.expanduser(
os.getenv('TORCH_HOME', os.path.join(
os.getenv('XD... | 39.921569 | 123 | 0.620053 |
4e6a5fdaf1007b12b82bfcd4f380bee38d28a8f7 | 2,326 | py | Python | databass/util.py | MrZhihao/databass-columnar | 6ecab5af257a20be88bf4e67ad3567c26ce0c964 | [
"MIT"
] | null | null | null | databass/util.py | MrZhihao/databass-columnar | 6ecab5af257a20be88bf4e67ad3567c26ce0c964 | [
"MIT"
] | null | null | null | databass/util.py | MrZhihao/databass-columnar | 6ecab5af257a20be88bf4e67ad3567c26ce0c964 | [
"MIT"
] | null | null | null | import numbers
from functools import partial
def pickone(l, attr):
return [(i and getattr(i, attr) or None) for i in l]
def flatten(list_of_lists):
return [item for sublist in list_of_lists for item in sublist]
def deduplicate(iterable, keyf=None):
if keyf is None:
keyf = str
seen = set()
for i in iter... | 24.744681 | 95 | 0.652623 |
895079ec764bbb5b941d088ebdb2ea441d2b78d5 | 2,246 | py | Python | mime/envs/__init__.py | joncrawf/mime | 7be7b1351cabaacc17caddbb6f808f3d37721a81 | [
"MIT"
] | null | null | null | mime/envs/__init__.py | joncrawf/mime | 7be7b1351cabaacc17caddbb6f808f3d37721a81 | [
"MIT"
] | null | null | null | mime/envs/__init__.py | joncrawf/mime | 7be7b1351cabaacc17caddbb6f808f3d37721a81 | [
"MIT"
] | 1 | 2020-10-28T11:51:08.000Z | 2020-10-28T11:51:08.000Z | from gym.envs.registration import register
# Bandit
# ----------------------------------------
for k in [5, 10, 50]:
register(
'Bandit-K{0}-v0'.format(k),
entry_point='mime.envs.bandit:BernoulliBanditEnv',
kwargs={'k': k}
)
# TabularMDP
# ----------------------------------------
regi... | 22.686869 | 83 | 0.643811 |
17a204a1ed2a8118a24f9525bc61265d52c3ccc0 | 1,559 | py | Python | Raspberry Pi 4/pc_server.py | BlindBMan/Autonomous-Object-Recognition-Car | db2ab7c0086577f2614bf524ad761eaa2c51e3fe | [
"MIT"
] | null | null | null | Raspberry Pi 4/pc_server.py | BlindBMan/Autonomous-Object-Recognition-Car | db2ab7c0086577f2614bf524ad761eaa2c51e3fe | [
"MIT"
] | null | null | null | Raspberry Pi 4/pc_server.py | BlindBMan/Autonomous-Object-Recognition-Car | db2ab7c0086577f2614bf524ad761eaa2c51e3fe | [
"MIT"
] | null | null | null | import cv2
import requests
from io import BytesIO
from PIL import Image
import time
import numpy as np
from darkflow.net.build import TFNet
options = {"model": "cfg/yolov2-custom.cfg",
"load": "darkflow/bin/yolov2-custom.weights",
"threshold": 0.2,
"gpu": 1.0}
tresh = 0.7
tfnet = TFN... | 27.350877 | 91 | 0.58499 |
0ffde94ad4d26522a9610c0df921a63e13209c0c | 8,854 | py | Python | Source/prj/reg/ReleaseSourceManager.py | fairhopeweb/Projeny | 4c11ab8f3d2c91765bdf50766f39b2df1d208467 | [
"MIT"
] | 752 | 2016-01-09T04:56:10.000Z | 2022-02-13T14:13:53.000Z | Source/prj/reg/ReleaseSourceManager.py | fairhopeweb/Projeny | 4c11ab8f3d2c91765bdf50766f39b2df1d208467 | [
"MIT"
] | 86 | 2016-01-08T22:48:27.000Z | 2019-10-02T03:15:49.000Z | Source/prj/reg/ReleaseSourceManager.py | fairhopeweb/Projeny | 4c11ab8f3d2c91765bdf50766f39b2df1d208467 | [
"MIT"
] | 108 | 2016-01-10T20:43:52.000Z | 2021-09-17T22:46:26.000Z |
from datetime import datetime
from mtm.ioc.Inject import Inject
from mtm.ioc.Inject import InjectMany
import mtm.ioc.IocAssertions as Assertions
from mtm.util.Assert import *
from prj.reg.LocalFolderReleaseSource import LocalFolderReleaseSource
from prj.reg.AssetStoreCacheReleaseSource import AssetStoreCacheReleaseS... | 47.602151 | 249 | 0.672464 |
7a6dfd8b0c3ac6855b9e5bf751ab5eea0376840f | 2,687 | py | Python | main.py | nutszebra/residual_networks_of_residual_networks | 417b3f5883da5d8b55cbc8feffa3472f0e323cbe | [
"MIT"
] | 3 | 2017-07-18T07:20:36.000Z | 2017-10-29T13:47:49.000Z | main.py | nutszebra/residual_networks_of_residual_networks | 417b3f5883da5d8b55cbc8feffa3472f0e323cbe | [
"MIT"
] | null | null | null | main.py | nutszebra/residual_networks_of_residual_networks | 417b3f5883da5d8b55cbc8feffa3472f0e323cbe | [
"MIT"
] | 1 | 2020-01-15T05:52:23.000Z | 2020-01-15T05:52:23.000Z | import sys
sys.path.append('./trainer')
import argparse
import nutszebra_cifar10
import resnet_of_resnet
import nutszebra_data_augmentation
import nutszebra_optimizer
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='cifar10')
parser.add_argument('--load_model', '-m',
... | 40.712121 | 129 | 0.526982 |
7fba1ab271d560a5d3aaabbb51f56ba354011f9a | 303 | py | Python | tests/_type/test_type_name_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | tests/_type/test_type_name_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | tests/_type/test_type_name_interface.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | from apysc._type.type_name_interface import TypeNameInterface
class TestTypeNameInterface:
def test_type_name(self) -> None:
interface: TypeNameInterface = TypeNameInterface()
interface._type_name = 'test_type_name'
assert interface.type_name == 'test_type_name'
| 30.3 | 62 | 0.729373 |
b7794a304b87e11104e72053a703f518e3d5865c | 1,491 | py | Python | synthesizer.py | uceul/arabic-tacotron-tts | 289ff54f91b77b0a352313bd62b5c4418c23786d | [
"MIT"
] | 92 | 2018-10-14T14:33:52.000Z | 2022-03-04T08:54:12.000Z | synthesizer.py | CODE-BR3AKER/arabic-tacotron-tts | 7e0f35389ae30a6329cf659f46749483be2917e6 | [
"MIT"
] | 17 | 2019-03-04T09:05:15.000Z | 2022-02-16T08:41:49.000Z | synthesizer.py | CODE-BR3AKER/arabic-tacotron-tts | 7e0f35389ae30a6329cf659f46749483be2917e6 | [
"MIT"
] | 41 | 2018-10-31T13:41:33.000Z | 2022-03-01T14:39:48.000Z | import io
import numpy as np
import tensorflow as tf
from hparams import hparams
from librosa import effects
from models import create_model
from text import text_to_sequence
from util import audio
from datasets import arpa
class Synthesizer:
def load(self, checkpoint_path, model_name='tacotron'):
print('Constr... | 34.674419 | 86 | 0.716968 |
8a8f1c82b18d51facb81d39b8226bf9ebbfafe97 | 484 | py | Python | src/ggrc/models/transaction.py | ankit-collective/ggrc-core | 7c94ab6f6cd4f95a0bdfbbd9c81358f35dc1c963 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-20T22:58:44.000Z | 2020-10-20T22:58:44.000Z | src/ggrc/models/transaction.py | ankit-collective/ggrc-core | 7c94ab6f6cd4f95a0bdfbbd9c81358f35dc1c963 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/models/transaction.py | ankit-collective/ggrc-core | 7c94ab6f6cd4f95a0bdfbbd9c81358f35dc1c963 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-10-20T22:58:46.000Z | 2021-03-07T14:44:26.000Z |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By:
# Maintained By:
from ggrc import db
from .mixins import Base, Described
class Transaction(Base, Described, db.Model):
__tablename__ = 'transac... | 25.473684 | 78 | 0.700413 |
d6167ba96d146827de213ddc5cac853bcb34f8f1 | 4,139 | py | Python | igvc_ws/src/igvc_slam/src/igvc_slam_node.py | SoonerRobotics/igvc_software_2022 | 906e6a4fca22d2b0c06ef1b8a4a3a9df7f1d17dd | [
"MIT"
] | null | null | null | igvc_ws/src/igvc_slam/src/igvc_slam_node.py | SoonerRobotics/igvc_software_2022 | 906e6a4fca22d2b0c06ef1b8a4a3a9df7f1d17dd | [
"MIT"
] | null | null | null | igvc_ws/src/igvc_slam/src/igvc_slam_node.py | SoonerRobotics/igvc_software_2022 | 906e6a4fca22d2b0c06ef1b8a4a3a9df7f1d17dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import copy
import numpy as np
import rospy
import math
import itertools
import time
import sys
from geometry_msgs.msg import Pose
from nav_msgs.msg import OccupancyGrid, MapMetaData
from std_msgs.msg import Header
# Configuration
wait_for_vision = True
# Camera Vertical vision (m)
camera_vert... | 31.356061 | 181 | 0.646291 |
2e66b3e86c314b8fc348b6e332b4e572c9107281 | 26,332 | py | Python | zproject/prod_settings_template.py | Morendil/zulip | 49e796e981246535b734bf662068e86e1b87fca9 | [
"Apache-2.0"
] | null | null | null | zproject/prod_settings_template.py | Morendil/zulip | 49e796e981246535b734bf662068e86e1b87fca9 | [
"Apache-2.0"
] | null | null | null | zproject/prod_settings_template.py | Morendil/zulip | 49e796e981246535b734bf662068e86e1b87fca9 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Optional, Tuple
################################################################
# Zulip Server settings.
#
# This file controls settings that affect the whole Zulip server.
# See our documentation at:
# https://zulip.readthedocs.io/en/latest/production/settings.html
#
# For developer d... | 42.1312 | 102 | 0.750076 |
80f380f5c74be973ea4bf420725613e735e24b27 | 8,261 | py | Python | elasticdl/python/elasticdl/image_builder.py | workingloong/elasticdl | 474146e4c347bab53c5f157441a6008dd204575c | [
"MIT"
] | 1 | 2019-09-18T02:55:57.000Z | 2019-09-18T02:55:57.000Z | elasticdl/python/elasticdl/image_builder.py | workingloong/elasticdl | 474146e4c347bab53c5f157441a6008dd204575c | [
"MIT"
] | null | null | null | elasticdl/python/elasticdl/image_builder.py | workingloong/elasticdl | 474146e4c347bab53c5f157441a6008dd204575c | [
"MIT"
] | null | null | null | import os
import tempfile
import uuid
from urllib.parse import urlparse
import docker
from elasticdl.python.common.file_utils import copy_if_not_exists
from elasticdl.python.common.log_utils import default_logger as logger
def build_and_push_docker_image(
model_zoo,
docker_image_repository,
base_image="... | 31.773077 | 79 | 0.640116 |
2004948e7b950ca0ed55635e2df856f80c2c602b | 15,227 | py | Python | csv_utility/csv_lmfit.py | maundersea/csv_tools | b1625c3a72395da67305b35fe2f6ef7874e51607 | [
"MIT"
] | null | null | null | csv_utility/csv_lmfit.py | maundersea/csv_tools | b1625c3a72395da67305b35fe2f6ef7874e51607 | [
"MIT"
] | null | null | null | csv_utility/csv_lmfit.py | maundersea/csv_tools | b1625c3a72395da67305b35fe2f6ef7874e51607 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Name: csv_lmfit.py
# Description:
#
# Author: m.akei
# Copyright: (c) 2020 by m.na.akei
# Time-stamp: <2020-10-11 15:58:11>
# Licence:
# Copyright (c) 2021 Masaharu N. Akei
#
# ... | 34.924312 | 183 | 0.580876 |
b3b4b42b7da07c3f8d9fdfee9f7bfada361c7033 | 11,227 | py | Python | built-in/TensorFlow/Official/cv/detection/ModelZoo_CTPN_TF_HARD/ModelZoo_CTPN_TF_HARD/99-origin/utils/rpn_msr/anchor_target_layer.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/TensorFlow/Official/cv/detection/ModelZoo_CTPN_TF_HARD/ModelZoo_CTPN_TF_HARD/99-origin/utils/rpn_msr/anchor_target_layer.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/TensorFlow/Official/cv/detection/ModelZoo_CTPN_TF_HARD/ModelZoo_CTPN_TF_HARD/99-origin/utils/rpn_msr/anchor_target_layer.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # -*- coding:utf-8 -*-
import numpy as np
import numpy.random as npr
from utils.bbox.bbox import bbox_overlaps
from utils.bbox.bbox_transform import bbox_transform
from utils.rpn_msr.config import Config as cfg
from utils.rpn_msr.generate_anchors import generate_anchors
DEBUG = False
def anchor_target_layer(rpn_cls... | 40.677536 | 116 | 0.637036 |
a0732d0c8f33bf01b6a1bd6fe4b41915d51c273b | 2,071 | py | Python | preproc_annot.py | mananmadan/DeepLogo | ebcd5793c270696cd6c6b1a74da603b017f11718 | [
"MIT"
] | 467 | 2015-06-22T19:45:51.000Z | 2022-03-30T07:37:34.000Z | preproc_annot.py | mananmadan/DeepLogo | ebcd5793c270696cd6c6b1a74da603b017f11718 | [
"MIT"
] | 42 | 2016-09-02T18:22:53.000Z | 2022-03-21T09:51:48.000Z | preproc_annot.py | mananmadan/DeepLogo | ebcd5793c270696cd6c6b1a74da603b017f11718 | [
"MIT"
] | 165 | 2016-07-27T08:41:17.000Z | 2022-03-25T18:18:03.000Z | #!/usr/bin/env python
# -*- coding=utf-8 -*-
import pandas as pd
from skimage import io
import config
import os
import warnings
import numpy as np
def main():
# Load annot file
logos_frame = pd.read_csv(config.ANNOT_FILE, header=None, delim_whitespace=True)
print('Num. of annots:', len(logos_frame))
... | 30.910448 | 86 | 0.587639 |
3da448769319d7c9875a0f2c061a7e38021d2906 | 931 | py | Python | tests/api/test_sun_api.py | doobrie/flask-api-template | f816d8af8633f5eabb9c8b611841a77cf6cd7c9b | [
"MIT"
] | null | null | null | tests/api/test_sun_api.py | doobrie/flask-api-template | f816d8af8633f5eabb9c8b611841a77cf6cd7c9b | [
"MIT"
] | null | null | null | tests/api/test_sun_api.py | doobrie/flask-api-template | f816d8af8633f5eabb9c8b611841a77cf6cd7c9b | [
"MIT"
] | null | null | null | from application.factory import create_app
import pytest
from ..context import application
@pytest.fixture
def client():
return create_app().test_client()
def test_home_route(client):
response = client.get('/sun/')
assert response.get_json() == 'Sun API', 'Route should return "Sun API"'
... | 31.033333 | 77 | 0.650913 |
4079962ba405b58ad27227d547892a20a5f1fda1 | 206,456 | py | Python | thriftinterface/VASSARInterface.py | seakers/command_classifier | 06ca6bfd34ba3c4c8ee0613e00b77ad61a5697d9 | [
"MIT"
] | null | null | null | thriftinterface/VASSARInterface.py | seakers/command_classifier | 06ca6bfd34ba3c4c8ee0613e00b77ad61a5697d9 | [
"MIT"
] | null | null | null | thriftinterface/VASSARInterface.py | seakers/command_classifier | 06ca6bfd34ba3c4c8ee0613e00b77ad61a5697d9 | [
"MIT"
] | null | null | null | #
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... | 35.805758 | 138 | 0.607316 |
e656bdf6b575736467b02354b071253fd6c2d995 | 734 | py | Python | tests/hierarchical/test_hierarchy_AU.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/hierarchical/test_hierarchy_AU.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/hierarchical/test_hierarchy_AU.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pandas as pd
import numpy as np
import pyaf.HierarchicalForecastEngine as hautof
import pyaf.Bench.TS_datasets as tsds
import datetime
#get_ipython().magic('matplotlib inline')
b1 = tsds.load_AU_hierarchical_dataset();
df = b1.mPastData;
lEngine = hautof.cHierarchicalForecastEngine()
lEngine.mOptions.set_act... | 23.677419 | 72 | 0.784741 |
d25533c6745c70cf7014d992de48cefdc7d65388 | 29,712 | py | Python | timesketch/api/v1/resources/event.py | rushattac/timesketch | 0a6fa301aadb36db450ec993c5cf51452c375de2 | [
"Apache-2.0"
] | 1,810 | 2015-01-03T22:34:45.000Z | 2022-03-30T10:23:18.000Z | timesketch/api/v1/resources/event.py | rushattac/timesketch | 0a6fa301aadb36db450ec993c5cf51452c375de2 | [
"Apache-2.0"
] | 1,291 | 2015-01-08T00:00:12.000Z | 2022-03-29T03:26:58.000Z | timesketch/api/v1/resources/event.py | rushattac/timesketch | 0a6fa301aadb36db450ec993c5cf51452c375de2 | [
"Apache-2.0"
] | 519 | 2015-01-20T09:26:06.000Z | 2022-03-29T11:02:10.000Z | # Copyright 2020 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 a... | 35.840772 | 79 | 0.563072 |
120bd7868ec90ad519ff28426e03e70fcb726d24 | 633 | py | Python | jp.atcoder/abc162/abc162_d/28074080.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc162/abc162_d/28074080.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc162/abc162_d/28074080.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import typing
def main() -> typing.NoReturn:
n = int(input())
a = [1 if x == 'R' else 2 if x == 'G' else 3 for x in input()]
s = [[0] * (n + 1) for _ in range(4)]
for i in range(n, 0, -1):
for j in range(4):
s[j][i - 1] = s[j][i]
x = a[i - 1]
s[x][i -... | 22.607143 | 67 | 0.347551 |
dfa61a31f90f77365b4c4bdddbd33dc5f7010456 | 26,528 | py | Python | plotter/agg_01_d5050_runtime.py | kit-tm/fdeval | f6463c1c7549b8ac7fc39854e87c88d3cac858a0 | [
"BSD-2-Clause"
] | 1 | 2021-11-18T02:46:34.000Z | 2021-11-18T02:46:34.000Z | plotter/agg_01_d5050_runtime.py | kit-tm/fdeval | f6463c1c7549b8ac7fc39854e87c88d3cac858a0 | [
"BSD-2-Clause"
] | null | null | null | plotter/agg_01_d5050_runtime.py | kit-tm/fdeval | f6463c1c7549b8ac7fc39854e87c88d3cac858a0 | [
"BSD-2-Clause"
] | null | null | null | import logging, math, json, pickle, os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as mdates
from datetime import datetime
import matplotlib.patches as patches
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.gridspec as gridspec
import statistics
... | 41.001546 | 138 | 0.528234 |
d3f86b9c19e9ec87ddac60f04ef4ba0a65723868 | 518 | py | Python | phyllo/io/cli/args/args.py | ethanjli/phyllo-python | 1fc17737951df9c23a9fae72212e3004a78c4da2 | [
"MIT"
] | null | null | null | phyllo/io/cli/args/args.py | ethanjli/phyllo-python | 1fc17737951df9c23a9fae72212e3004a78c4da2 | [
"MIT"
] | null | null | null | phyllo/io/cli/args/args.py | ethanjli/phyllo-python | 1fc17737951df9c23a9fae72212e3004a78c4da2 | [
"MIT"
] | null | null | null | """Print all data received on the serial port."""
# Builtins
import argparse
# Packages
# Parsing
def parse_args(*arg_adders, grouped_args, **parser_kwargs):
"""Parse the command-line args in groups."""
parser = argparse.ArgumentParser(**parser_kwargs)
for arg_adder in arg_adders:
arg_adder(pa... | 23.545455 | 59 | 0.687259 |
75581787db94d6a9588d464046e9e339adc4ac16 | 1,097 | py | Python | analysis.py | AadityaDeshpande/ExamSurveillance | ea42d1cce7bb161a564a451a58f4b4117d5d0000 | [
"MIT"
] | null | null | null | analysis.py | AadityaDeshpande/ExamSurveillance | ea42d1cce7bb161a564a451a58f4b4117d5d0000 | [
"MIT"
] | null | null | null | analysis.py | AadityaDeshpande/ExamSurveillance | ea42d1cce7bb161a564a451a58f4b4117d5d0000 | [
"MIT"
] | null | null | null | import csv
def analysisCSV():
first = True
row = []
with open('stdlog.csv', 'r') as csvFile:
reader = csv.reader(csvFile)
for row in reader:
#print(row) #isinstance(s, str)
if(first):
first = False
#print(row)
#else:
#print(row)
sample_space = int(row[0])
negati... | 26.756098 | 89 | 0.66454 |
fe4d5a68bf77629e6d3ab9f050e1a138800672c9 | 2,955 | py | Python | alipay/aop/api/domain/MybankCreditSceneprodDataUploadModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/MybankCreditSceneprodDataUploadModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/MybankCreditSceneprodDataUploadModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class MybankCreditSceneprodDataUploadModel(object):
def __init__(self):
self._app_seqno = None
self._data_config = None
self._data_content = None
self._org_code = None
... | 29.257426 | 75 | 0.595939 |
370ad0fb6cef492f0d30c06fe1e2a3e4273d3d02 | 4,642 | py | Python | ros/src/twist_controller/dbw_node.py | rarce/CarND-Capstone | b689933fb2605931e111018626ad3d202067f1a7 | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | rarce/CarND-Capstone | b689933fb2605931e111018626ad3d202067f1a7 | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | rarce/CarND-Capstone | b689933fb2605931e111018626ad3d202067f1a7 | [
"MIT"
] | 3 | 2018-05-13T19:39:20.000Z | 2018-05-17T08:00:07.000Z | #!/usr/bin/env python
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math
from twist_controller import Controller
'''
You can build this node only after you have built (or partially built) the... | 39.338983 | 101 | 0.66997 |
9d91be836afe26675dab431b162b4280992bd575 | 7,368 | py | Python | corehq/ex-submodules/dimagi/utils/couch/migration.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | corehq/ex-submodules/dimagi/utils/couch/migration.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | corehq/ex-submodules/dimagi/utils/couch/migration.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | from dimagi.utils.logging import notify_exception
class SyncCouchToSQLMixin(object):
"""
A mixin to be used for migrating a Couch model
to a SQL model (see also SyncSQLToCouchMixin).
Steps to use it:
1. Create a Django ORM model which inherits from SyncSQLToCouchMixin
and is identical to the... | 38.375 | 92 | 0.664902 |
81f618d2a94955f880dac2ff79dbaf0b6d0d19f1 | 345 | py | Python | Exercicios/Exercicio029.py | RicardoMart922/estudo_Python | cb595c2a5e5aee568b6afa71b3ed9dd9cb7eef72 | [
"MIT"
] | null | null | null | Exercicios/Exercicio029.py | RicardoMart922/estudo_Python | cb595c2a5e5aee568b6afa71b3ed9dd9cb7eef72 | [
"MIT"
] | null | null | null | Exercicios/Exercicio029.py | RicardoMart922/estudo_Python | cb595c2a5e5aee568b6afa71b3ed9dd9cb7eef72 | [
"MIT"
] | null | null | null | # Estrutura condicional
# if condição
# bloco de código
# else:
# bloco de código
nota1 = float(input('Digite a primeira nota: '))
nota2 = float(input('Digite a segunda nota: '))
media = ((nota1 + nota2)/2.0)
print('Sua média foi {:.2f}'.format(media))
if media < 6:
print('Você estar Reprovado!')
else:
prin... | 26.538462 | 48 | 0.666667 |
d42e2ceccb21159db853dfa51ce8282881eb5ce1 | 3,130 | py | Python | tests/test_docs/test_standalone_transaction/test_standalone_transaction.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | tests/test_docs/test_standalone_transaction/test_standalone_transaction.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | tests/test_docs/test_standalone_transaction/test_standalone_transaction.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 35.568182 | 95 | 0.672204 |
573a61c446e5f7c2e0f157f07563bf6f418c2835 | 1,466 | py | Python | source/incqueryserver-jupyter/iqs_jupyter/helpers.py | IncQueryLabs/incquery-server-jupyter | 40072eb8cdfd60ba36783faf5bef4f88e5342f8a | [
"Apache-2.0"
] | 2 | 2019-05-21T07:09:04.000Z | 2020-08-06T09:42:40.000Z | source/incqueryserver-jupyter/iqs_jupyter/helpers.py | IncQueryLabs/incquery-server-jupyter | 40072eb8cdfd60ba36783faf5bef4f88e5342f8a | [
"Apache-2.0"
] | 46 | 2019-05-17T16:24:35.000Z | 2022-03-04T10:15:50.000Z | source/incqueryserver-jupyter/iqs_jupyter/helpers.py | IncQueryLabs/incquery-server-jupyter | 40072eb8cdfd60ba36783faf5bef4f88e5342f8a | [
"Apache-2.0"
] | 1 | 2021-08-02T18:28:18.000Z | 2021-08-02T18:28:18.000Z | # Copyright 2019 IncQuery Labs 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 required by applicable law or agreed to in wr... | 31.191489 | 74 | 0.706685 |
3dc87bca974a1c3063beab8b0edf21245506a725 | 216 | py | Python | web/handlers/api.py | biothings/outbreak.api | a93e876d8d94cbfd8f328ba4acc01f955395c0e4 | [
"Apache-2.0"
] | 10 | 2021-03-16T09:31:19.000Z | 2021-08-08T14:41:43.000Z | web/handlers/api.py | biothings/outbreak.api | a93e876d8d94cbfd8f328ba4acc01f955395c0e4 | [
"Apache-2.0"
] | 26 | 2021-03-08T19:09:44.000Z | 2022-02-02T08:58:49.000Z | web/handlers/api.py | biothings/outbreak.api | a93e876d8d94cbfd8f328ba4acc01f955395c0e4 | [
"Apache-2.0"
] | 4 | 2020-11-04T17:25:36.000Z | 2021-08-06T08:38:41.000Z | from biothings.web.handlers import BiothingHandler, QueryHandler
class OutbreakBiothingHandler(BiothingHandler):
name = 'typed_annotation'
class OutbreakQueryHandler(QueryHandler):
name = 'typed_query'
| 18 | 64 | 0.796296 |
fe3d5336f3c0a9bcb76bbb587a1bc95b44b9d6a6 | 5,068 | py | Python | openslides/users/config_variables.py | swilde/OpenSlides | 23ae32a75892005632784652d108836d1ba09da9 | [
"MIT"
] | null | null | null | openslides/users/config_variables.py | swilde/OpenSlides | 23ae32a75892005632784652d108836d1ba09da9 | [
"MIT"
] | null | null | null | openslides/users/config_variables.py | swilde/OpenSlides | 23ae32a75892005632784652d108836d1ba09da9 | [
"MIT"
] | null | null | null | from textwrap import dedent
from openslides.core.config import ConfigVariable
def get_config_variables():
"""
Generator which yields all config variables of this app.
They are grouped in 'Sorting' and 'PDF'. The generator has to be evaluated
during app loading (see apps.py).
"""
# Sorting
... | 28.312849 | 132 | 0.581886 |
38e265a6eff214c8ba1909ece9506295700c4d27 | 286 | py | Python | Examples/Enemy.py | whitfija/ACTUAL_GAME | 83e02a70b01b30f52e797dded837422a74c2abbe | [
"MIT"
] | null | null | null | Examples/Enemy.py | whitfija/ACTUAL_GAME | 83e02a70b01b30f52e797dded837422a74c2abbe | [
"MIT"
] | null | null | null | Examples/Enemy.py | whitfija/ACTUAL_GAME | 83e02a70b01b30f52e797dded837422a74c2abbe | [
"MIT"
] | null | null | null | import pygame
class Enemy(pygame.sprite.Sprite):
def __init__(self):
super().__init__()
self.image = pygame.image.load("images/asteroid.png").convert_alpha()
self.rect = self.image.get_rect(center=(10, 350))
def update(self):
self.rect.x += 5
| 23.833333 | 77 | 0.632867 |
e1f4d17f32e37d5ce4c5e531f90857cf5cd7415d | 43,819 | py | Python | lnt/tests/compile.py | jobvdl1997/llvm-lnt | f4838441d0ae6ecc3af0e8446e9e4a70f546371f | [
"Apache-2.0"
] | null | null | null | lnt/tests/compile.py | jobvdl1997/llvm-lnt | f4838441d0ae6ecc3af0e8446e9e4a70f546371f | [
"Apache-2.0"
] | null | null | null | lnt/tests/compile.py | jobvdl1997/llvm-lnt | f4838441d0ae6ecc3af0e8446e9e4a70f546371f | [
"Apache-2.0"
] | null | null | null | """Single file compile-time performance testing"""
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
import errno
import hashlib
import json
import os
import platform
import pprint
import re
import shlex
import shutil
import subprocess
import sys
import logging... | 39.871702 | 89 | 0.574226 |
7a50c79649b5e1125c5de96fabe90e52c7e72f67 | 11,522 | py | Python | neurokit/bio/bio_rsp.py | ucohen/NeuroKit.py | 0196fc7cfbf22b499eec51036b3eb492a2893014 | [
"MIT"
] | 338 | 2017-03-28T17:36:18.000Z | 2022-03-25T00:58:56.000Z | neurokit/bio/bio_rsp.py | ucohen/NeuroKit.py | 0196fc7cfbf22b499eec51036b3eb492a2893014 | [
"MIT"
] | 108 | 2017-04-25T12:27:30.000Z | 2021-02-08T21:52:38.000Z | neurokit/bio/bio_rsp.py | ucohen/NeuroKit.py | 0196fc7cfbf22b499eec51036b3eb492a2893014 | [
"MIT"
] | 108 | 2016-12-11T15:41:08.000Z | 2022-03-25T00:59:00.000Z | # -*- coding: utf-8 -*-
"""
Subsubmodule for ecg processing.
"""
import numpy as np
import pandas as pd
import biosppy
from ..signal import *
# ==============================================================================
# ==============================================================================
# ============... | 35.561728 | 154 | 0.528988 |
5f0d98c5c7294bba9d51fcda57bda37b1ee81a32 | 894 | py | Python | tests/test_viewclust_vis.py | plstonge/ViewClust-Vis | 4efd168f501a5ab5671010d192893467ebe20e76 | [
"MIT"
] | 1 | 2021-03-10T20:34:56.000Z | 2021-03-10T20:34:56.000Z | tests/test_viewclust_vis.py | plstonge/ViewClust-Vis | 4efd168f501a5ab5671010d192893467ebe20e76 | [
"MIT"
] | 6 | 2020-07-13T19:13:39.000Z | 2021-04-29T12:48:45.000Z | tests/test_viewclust_vis.py | plstonge/ViewClust-Vis | 4efd168f501a5ab5671010d192893467ebe20e76 | [
"MIT"
] | 2 | 2021-03-24T20:13:30.000Z | 2021-12-15T17:59:00.000Z | #!/usr/bin/env python
"""Tests for `viewclust_vis` package."""
import unittest
from click.testing import CliRunner
from viewclust_vis import viewclust_vis
from viewclust_vis import cli
class TestViewclust_vis(unittest.TestCase):
"""Tests for `viewclust_vis` package."""
def setUp(self):
"""Set up ... | 26.294118 | 74 | 0.655481 |
478cd0151634c7db5bbacc5f986b4af964eca8c7 | 9,559 | py | Python | 3rdParty/boost/1.71.0/libs/python/test/vector_indexing_suite.py | rajeev02101987/arangodb | 817e6c04cb82777d266f3b444494140676da98e2 | [
"Apache-2.0"
] | 12,278 | 2015-01-29T17:11:33.000Z | 2022-03-31T21:12:00.000Z | 3rdParty/boost/1.71.0/libs/python/test/vector_indexing_suite.py | rajeev02101987/arangodb | 817e6c04cb82777d266f3b444494140676da98e2 | [
"Apache-2.0"
] | 9,469 | 2015-01-30T05:33:07.000Z | 2022-03-31T16:17:21.000Z | 3rdParty/boost/1.71.0/libs/python/test/vector_indexing_suite.py | rajeev02101987/arangodb | 817e6c04cb82777d266f3b444494140676da98e2 | [
"Apache-2.0"
] | 892 | 2015-01-29T16:26:19.000Z | 2022-03-20T07:44:30.000Z | # Copyright Joel de Guzman 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
#####################################################################
# Check an object that we will use as container element
#####... | 25.765499 | 71 | 0.28141 |
8329f2cecba830785773857491a9b740df0ca32d | 2,396 | py | Python | python/transpose/transpose_4d_bench.py | apaszke/iree-llvm-sandbox | cf04a17076c0d842f47adb655998929ad7ccbd43 | [
"Apache-2.0"
] | null | null | null | python/transpose/transpose_4d_bench.py | apaszke/iree-llvm-sandbox | cf04a17076c0d842f47adb655998929ad7ccbd43 | [
"Apache-2.0"
] | null | null | null | python/transpose/transpose_4d_bench.py | apaszke/iree-llvm-sandbox | cf04a17076c0d842f47adb655998929ad7ccbd43 | [
"Apache-2.0"
] | null | null | null | # RUN: %PYTHON %s 2>&1 | FileCheck %s
from ..core.experts import *
from ..core.harness import *
from ..core.transforms import *
from .definitions import *
from .ops import *
import typing as tp
fun_name = 'transpose_4d_on_tensors'
op_name = 'linalg.generic'
expert_transpose_4d_0213 = SingleTilingExpert(
fun_na... | 28.52381 | 80 | 0.548831 |
d98ce0c49907d31bb7b4704ac0282b282a51ff02 | 2,513 | py | Python | lstm_market_prediction.py | langgege-cqu/lstm_stock_price_prediction | d3f1dcd5de22f7eb21f73d2b0d32c73caa4a866a | [
"MIT"
] | 1 | 2020-07-17T13:24:12.000Z | 2020-07-17T13:24:12.000Z | lstm_market_prediction.py | langgege-cqu/lstm_stock_price_prediction | d3f1dcd5de22f7eb21f73d2b0d32c73caa4a866a | [
"MIT"
] | null | null | null | lstm_market_prediction.py | langgege-cqu/lstm_stock_price_prediction | d3f1dcd5de22f7eb21f73d2b0d32c73caa4a866a | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from keras.utils import np_utils
from keras.layers.core import Dense, Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
from keras.callbacks import EarlyStopping
import warnings
warnings.filterwarnings("ignore")
path_to_set = '[[PATH TO YOUR STO... | 29.22093 | 132 | 0.685635 |
b9d7d06b217e3814830b6aa4613e30c9cdeca8e3 | 2,531 | py | Python | glance/db/sqlalchemy/migrate_repo/versions/004_add_checksum.py | dreamhost/glance | 1d91a4dc2b74d224ea12947d672aa66a576d9d9a | [
"Apache-2.0"
] | null | null | null | glance/db/sqlalchemy/migrate_repo/versions/004_add_checksum.py | dreamhost/glance | 1d91a4dc2b74d224ea12947d672aa66a576d9d9a | [
"Apache-2.0"
] | null | null | null | glance/db/sqlalchemy/migrate_repo/versions/004_add_checksum.py | dreamhost/glance | 1d91a4dc2b74d224ea12947d672aa66a576d9d9a | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 31.6375 | 78 | 0.680759 |
ba77870fbdb46f087c25921b9e7a9ba795cf85fb | 33,179 | py | Python | sannjida8.py | sanjida9999/loading | 05d22e6130d8e1e08fc34a0e0ae792dcec0f9dd4 | [
"Apache-2.0"
] | null | null | null | sannjida8.py | sanjida9999/loading | 05d22e6130d8e1e08fc34a0e0ae792dcec0f9dd4 | [
"Apache-2.0"
] | null | null | null | sannjida8.py | sanjida9999/loading | 05d22e6130d8e1e08fc34a0e0ae792dcec0f9dd4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
#coding=utf-8
#The Credit For This Code Goes To Sabiha
#If You Wanna Take Credits For This Code, Please Look Yourself Again...
#Reserved2022
import os,sys,time,datetime,random,hashlib,re,threading,json,urllib,cookielib,requests,mechanize
from multiprocessing.pool import ThreadPool
from requests.exc... | 54.570724 | 384 | 0.438802 |
79e4757b40b119c53179bb6cfe3f1c2cd72a8fb6 | 3,203 | py | Python | wavelet/wavelets/__init__.py | AP-Atul/wavelets-ext | 00ced22462c369584ebd32f9b5f357f092de0142 | [
"MIT"
] | 4 | 2021-02-01T07:43:10.000Z | 2021-04-27T06:58:54.000Z | wavelet/wavelets/__init__.py | AP-Atul/wavelets-ext | 00ced22462c369584ebd32f9b5f357f092de0142 | [
"MIT"
] | null | null | null | wavelet/wavelets/__init__.py | AP-Atul/wavelets-ext | 00ced22462c369584ebd32f9b5f357f092de0142 | [
"MIT"
] | null | null | null | """Maps the wavelet name to the Wavelet Class object"""
from . import (db2, db3, db4, db5, db6, db7, db8, db9, db10,
db11, db12, db13, db14, db15, db16, db17, db18, db19, db20,
sym2, sym3, sym4, sym5, sym6, sym7, sym8, sym9, sym10,
sym11, sym12, sym13, sym14, sym15, sym16, ... | 28.598214 | 104 | 0.627537 |
2558347cb8e55f735c93b453b8294dea58a3726e | 755 | py | Python | src/modules/map_finder.py | BLimmie/2020-celeste-collab-bot | be4dd8d7b6d0848d06f525481418674aa76d0469 | [
"MIT"
] | 1 | 2020-09-26T07:15:46.000Z | 2020-09-26T07:15:46.000Z | src/modules/map_finder.py | BLimmie/2020-celeste-collab-bot | be4dd8d7b6d0848d06f525481418674aa76d0469 | [
"MIT"
] | null | null | null | src/modules/map_finder.py | BLimmie/2020-celeste-collab-bot | be4dd8d7b6d0848d06f525481418674aa76d0469 | [
"MIT"
] | null | null | null | from strsimpy import overlap_coefficient
similarity_checker = overlap_coefficient.OverlapCoefficient()
def find_closest(search, target):
similarity = [similarity_checker.similarity(m.lower(), target.lower()) for m in search]
max_score = max(similarity)
if len([i for i in similarity if similarity == max_sc... | 31.458333 | 91 | 0.672848 |
318be8ddaa5177388a535232ae6871aba6b446e9 | 679 | py | Python | dataset/script/move_small_images.py | jireh-father/tensorflow-triplet-loss | c8a3b3efbf4c68f63d58ee3bedaa8e42451f6a80 | [
"MIT"
] | null | null | null | dataset/script/move_small_images.py | jireh-father/tensorflow-triplet-loss | c8a3b3efbf4c68f63d58ee3bedaa8e42451f6a80 | [
"MIT"
] | null | null | null | dataset/script/move_small_images.py | jireh-father/tensorflow-triplet-loss | c8a3b3efbf4c68f63d58ee3bedaa8e42451f6a80 | [
"MIT"
] | null | null | null | import os, glob, shutil
from PIL import Image
image_dir = "D:/data/fashion/image_retrieval/warehouse2shop/3_shop"
moving_dir = "D:/data/fashion/image_retrieval/warehouse2shop/3_shop_moved"
if not os.path.isdir(moving_dir):
os.makedirs(moving_dir)
limit_size = 300
dirs = glob.glob(os.path.join(image_dir, "*"))
fo... | 29.521739 | 74 | 0.637703 |
c12f597417178a92ec716e95176474590e49d4f0 | 157 | py | Python | acmicpc/2455/2455.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 3 | 2019-03-09T05:19:23.000Z | 2019-04-06T09:26:36.000Z | acmicpc/2455/2455.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2020-02-23T10:38:04.000Z | 2020-02-23T10:38:04.000Z | acmicpc/2455/2455.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2019-05-22T13:47:53.000Z | 2019-05-22T13:47:53.000Z | total = 0
candidate = []
for _ in range(4):
m, n = map(int, input().split())
total = total - m + n
candidate.append(total)
print(max(candidate))
| 19.625 | 36 | 0.598726 |
5fe8a291d8181fbcb9a8255acb2a6b857f9b99da | 28,445 | py | Python | src/b3px_gym/b3px_env/singleton/anymal_yu_version.py | Yunaik/drl_env | d284e79847c59daa6ccb222f30fc7e2a86375546 | [
"MIT"
] | null | null | null | src/b3px_gym/b3px_env/singleton/anymal_yu_version.py | Yunaik/drl_env | d284e79847c59daa6ccb222f30fc7e2a86375546 | [
"MIT"
] | null | null | null | src/b3px_gym/b3px_env/singleton/anymal_yu_version.py | Yunaik/drl_env | d284e79847c59daa6ccb222f30fc7e2a86375546 | [
"MIT"
] | null | null | null | import copy
import math
import os
import numpy as np
from numpy import pi
import time
# from pybullet_envs.bullet import motor
from rllab.envs.pybullet.valkyrie_multi_env.utils.filter_array import FilterClass
from rllab.envs.pybullet.valkyrie_multi_env.utils.util import quat_to_rot, rotX, rotY, rotZ
from b3px_gym.b3px_... | 39.506944 | 146 | 0.566251 |
6f740ca4b4a39da7a052ec903409a65ddb200370 | 6,085 | py | Python | i2/itypes.py | i2mint/py2mint | f4dbf4d72eed3018e7c68cf04df2c9bb03e75bf7 | [
"Apache-2.0"
] | null | null | null | i2/itypes.py | i2mint/py2mint | f4dbf4d72eed3018e7c68cf04df2c9bb03e75bf7 | [
"Apache-2.0"
] | null | null | null | i2/itypes.py | i2mint/py2mint | f4dbf4d72eed3018e7c68cf04df2c9bb03e75bf7 | [
"Apache-2.0"
] | 2 | 2019-08-10T19:20:43.000Z | 2019-08-11T16:26:35.000Z | """Types"""
from typing import NewType, Optional, Iterable, Protocol, Any
def new_type(
name,
tp,
doc: Optional[str] = None,
aka: Optional[Iterable] = None,
assign_to_globals=False,
):
"""
Make a new type with (optional) doc and (optional) aka, set of var names it often appears as
Ar... | 31.692708 | 109 | 0.6235 |
3ee711ebcb6cb13545830968c9a2280b0c45240d | 4,094 | py | Python | custom_components/melview_custom/sensor.py | Parlane/ha-melview-custom | b0e7a4edba4bec03e19324b82246efb5bb7d0018 | [
"Apache-2.0"
] | null | null | null | custom_components/melview_custom/sensor.py | Parlane/ha-melview-custom | b0e7a4edba4bec03e19324b82246efb5bb7d0018 | [
"Apache-2.0"
] | null | null | null | custom_components/melview_custom/sensor.py | Parlane/ha-melview-custom | b0e7a4edba4bec03e19324b82246efb5bb7d0018 | [
"Apache-2.0"
] | null | null | null | """Support for MelView device sensors."""
import logging
from pymelview import DEVICE_TYPE_ATA
from homeassistant.const import (
DEVICE_CLASS_TEMPERATURE,
TEMP_CELSIUS,
STATE_ON,
STATE_OFF
)
from homeassistant.components.binary_sensor import DEVICE_CLASS_PROBLEM
from homeassistant.helpers.entity impor... | 28.629371 | 95 | 0.675623 |
f9b50797480457e4fc3d69735742f97243821715 | 7,723 | py | Python | util/pal2bin.py | nicholatian/kerngba | dcbe7168f1636864e0d5ce5fd086b2e88e971d80 | [
"Apache-2.0"
] | 20 | 2016-07-13T03:32:33.000Z | 2021-12-26T15:56:57.000Z | util/pal2bin.py | nicholatian/kerngba | dcbe7168f1636864e0d5ce5fd086b2e88e971d80 | [
"Apache-2.0"
] | 7 | 2016-06-14T05:30:27.000Z | 2018-02-26T07:46:17.000Z | util/pal2bin.py | nicholatian/kerngba | dcbe7168f1636864e0d5ce5fd086b2e88e971d80 | [
"Apache-2.0"
] | 2 | 2019-06-29T15:36:13.000Z | 2021-12-26T15:57:41.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
###############################################################################
## ##
## .d8888b. d8888 88888888888 888 888 8888888b. 888b 888 ##
## d88P Y88b d88888 ... | 43.880682 | 80 | 0.48129 |
eb08f02dcdfd7b21e89b94ecd57f36c409074d49 | 1,071 | py | Python | app_server/src/main.py | detector-m/AppPythonServer | 93494d50a14f172434829db14a9ac920dee6d928 | [
"MIT"
] | null | null | null | app_server/src/main.py | detector-m/AppPythonServer | 93494d50a14f172434829db14a9ac920dee6d928 | [
"MIT"
] | null | null | null | app_server/src/main.py | detector-m/AppPythonServer | 93494d50a14f172434829db14a9ac920dee6d928 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@文件 :main.py
@说明 :
@时间 :2020/07/23 09:08:39
@作者 :Riven
@版本 :1.0.0
'''
from flask import Flask
import sys
sys.path.append('.')
from app_server.src.config import setting
from app_server.src.error import error
from app_server.src.log ... | 19.125 | 84 | 0.604108 |
49c924baef11156708d7b2ece514faf6e95f7db7 | 1,907 | py | Python | conans/server/rest/server.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | null | null | null | conans/server/rest/server.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | null | null | null | conans/server/rest/server.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | null | null | null | import bottle
from conans.server.rest.api_v1 import ApiV1
from conans.model.version import Version
from conans.server.rest.api_v2 import ApiV2
class ConanServer(object):
"""
Server class. Instances api_v1 application and run it.
Receives the store.
"""
store = None
root_app = None
... | 35.981132 | 77 | 0.641846 |
58f8b2bfe138cbec9934959b57dd9d1aebc2239f | 1,517 | py | Python | setup.py | StrajnarFilip/AutoPostgres | 3fbda8d91dc79f90aed43822c19af1fd5bee151e | [
"Apache-2.0"
] | null | null | null | setup.py | StrajnarFilip/AutoPostgres | 3fbda8d91dc79f90aed43822c19af1fd5bee151e | [
"Apache-2.0"
] | null | null | null | setup.py | StrajnarFilip/AutoPostgres | 3fbda8d91dc79f90aed43822c19af1fd5bee151e | [
"Apache-2.0"
] | null | null | null | # This script will make a cryptographically secure random password for database
import os
safe_random=os.urandom(24).hex()
def render(random_number: str):
return f'''# Copyright 2022 Filip Strajnar
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file excep... | 29.173077 | 80 | 0.667106 |
b309d4a7040af27b4cb21340c864bc5e9e34128a | 1,151 | py | Python | awards/migrations/0002_auto_20211215_2229.py | Daniel6996-arch/SiteAwards | cfb033fa982dc29d3d040bd40bdd026f58066623 | [
"MIT"
] | null | null | null | awards/migrations/0002_auto_20211215_2229.py | Daniel6996-arch/SiteAwards | cfb033fa982dc29d3d040bd40bdd026f58066623 | [
"MIT"
] | null | null | null | awards/migrations/0002_auto_20211215_2229.py | Daniel6996-arch/SiteAwards | cfb033fa982dc29d3d040bd40bdd026f58066623 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-12-15 22:29
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
(... | 34.878788 | 120 | 0.622068 |
bcbe3fc9d750bc8df8c3649685e15741ac535887 | 536 | py | Python | iLO HP/Genaral_info_iLO.py | adrianojiu/Pub | acd52fa3d56b83d3b93b825edb70c6a13eefadc8 | [
"MIT"
] | null | null | null | iLO HP/Genaral_info_iLO.py | adrianojiu/Pub | acd52fa3d56b83d3b93b825edb70c6a13eefadc8 | [
"MIT"
] | null | null | null | iLO HP/Genaral_info_iLO.py | adrianojiu/Pub | acd52fa3d56b83d3b93b825edb70c6a13eefadc8 | [
"MIT"
] | null | null | null |
import hpilo
import json
import requests
ilo = hpilo.Ilo('server01-iLO', 'User_name', 'Password')
# Get General info.
print(ilo.get_fw_version())
print ("Product Name: ", ilo.get_product_name())
print("Serial Number: ", ilo.get_host_data()[1]['Serial Number'])
print("Server Name: ",ilo.get_server_name())
print("Serv... | 28.210526 | 65 | 0.729478 |
bef05fabefa7434b08843cd4bc666b11f5a9347b | 421 | py | Python | packages/python/plotly/plotly/validators/sunburst/legendgrouptitle/_text.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/sunburst/legendgrouptitle/_text.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/sunburst/legendgrouptitle/_text.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="sunburst.legendgrouptitle", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | 30.071429 | 83 | 0.655582 |
4840f1375b515ad01b326831579028330ba24692 | 38 | py | Python | colorprint/info.py | apua/colorprint | 4c8b22c21447b587dc827be83feb79084504cdaa | [
"WTFPL"
] | null | null | null | colorprint/info.py | apua/colorprint | 4c8b22c21447b587dc827be83feb79084504cdaa | [
"WTFPL"
] | 10 | 2015-02-10T04:00:30.000Z | 2015-03-01T06:20:36.000Z | colorprint/info.py | apua/colorprint | 4c8b22c21447b587dc827be83feb79084504cdaa | [
"WTFPL"
] | null | null | null | __author__ = 'Apua'
__version__ = '2'
| 12.666667 | 19 | 0.684211 |
ac9eb780aea18e9de5443a4a2d6a9b6ffc9a15c9 | 747 | py | Python | FusionIIIT/applications/online_cms/admin.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 29 | 2019-02-20T15:35:33.000Z | 2022-03-22T11:10:57.000Z | FusionIIIT/applications/online_cms/admin.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 409 | 2019-01-17T19:30:51.000Z | 2022-03-31T16:28:45.000Z | FusionIIIT/applications/online_cms/admin.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 456 | 2019-01-12T11:01:13.000Z | 2022-03-30T17:06:52.000Z | from django.contrib import admin
from .models import (Assignment, CourseDocuments, CourseVideo, Forum,
ForumReply, Quiz, QuizQuestion, QuizResult, StudentAnswer,
StudentAssignment, Topics)
class QuizResultAdmin(admin.ModelAdmin):
model = QuizResult
raw_id_fiel... | 23.34375 | 80 | 0.729585 |
a4520af78ae200afc40a911cdc50ac1a26e87369 | 6,627 | py | Python | tests/test_pca.py | Gscorreia89/pyChemometrics | 16f3b4a1af873cf7240230439b503c5aee751ce7 | [
"BSD-3-Clause"
] | 22 | 2017-11-27T13:24:42.000Z | 2022-01-14T18:09:23.000Z | tests/test_pca.py | phenomecentre/pyChemometrics | 4b675e5d569df36a1a74b2305581b1a699e57047 | [
"BSD-3-Clause"
] | 1 | 2018-04-23T11:12:28.000Z | 2018-04-23T11:12:28.000Z | tests/test_pca.py | Gscorreia89/pyChemometrics | 16f3b4a1af873cf7240230439b503c5aee751ce7 | [
"BSD-3-Clause"
] | 13 | 2017-11-27T13:23:51.000Z | 2021-06-23T17:35:44.000Z | import unittest
import os
import pandas as pds
import numpy as np
from numpy.testing import assert_allclose
from sklearn.model_selection import KFold
from pyChemometrics import ChemometricsScaler, ChemometricsPCA
"""
Suite of tests to assess coherence and functionality of the PCA object.
"""
class TestPCA(unittest... | 40.163636 | 150 | 0.659574 |
34383374cbab2f732869b0b06f6c192b37fefc5b | 7,432 | py | Python | sombrero.py | chapman-phys227-2016s/hw-11-patti102 | 3dfa291110f83466b1d76c34da8c0f283155edbb | [
"MIT"
] | null | null | null | sombrero.py | chapman-phys227-2016s/hw-11-patti102 | 3dfa291110f83466b1d76c34da8c0f283155edbb | [
"MIT"
] | null | null | null | sombrero.py | chapman-phys227-2016s/hw-11-patti102 | 3dfa291110f83466b1d76c34da8c0f283155edbb | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""
File: sombrero.py
Copyright (c) 2016 Taylor Patti
License: MIT
Description: A modified version of the previous sombrero class which uses fourth-order Runga-Kutta to
solve coupled systems of differential equations. The version provides for the implementation of a time
parameter offset and th... | 36.792079 | 150 | 0.548036 |
7e308fee413603d78511ccd86d980b8848af974d | 2,398 | py | Python | torchbenchmark/models/resnet50_quantized_qat/__init__.py | yinghai/benchmark | f91d19395d8b14bf6f0bcc7fec1073d56196c4c8 | [
"BSD-3-Clause"
] | null | null | null | torchbenchmark/models/resnet50_quantized_qat/__init__.py | yinghai/benchmark | f91d19395d8b14bf6f0bcc7fec1073d56196c4c8 | [
"BSD-3-Clause"
] | null | null | null | torchbenchmark/models/resnet50_quantized_qat/__init__.py | yinghai/benchmark | f91d19395d8b14bf6f0bcc7fec1073d56196c4c8 | [
"BSD-3-Clause"
] | null | null | null |
# Generated by gen_torchvision_benchmark.py
import torch
import torch.optim as optim
import torchvision.models as models
from torch.quantization import quantize_fx
from ...util.model import BenchmarkModel
from torchbenchmark.tasks import COMPUTER_VISION
class Model(BenchmarkModel):
task = COMPUTER_VISION.CLASSIF... | 35.264706 | 107 | 0.662219 |
56c21a0c5ffe75dacfa5d9ce8a22b24b4bd8cd9a | 6,516 | py | Python | tools/fuse_bn.py | rickyHong/mini-caffe | 32b1832aff6b3998c4b619f868c14e0bce2d0d21 | [
"BSD-3-Clause"
] | 2 | 2018-01-12T09:41:26.000Z | 2018-02-13T15:12:56.000Z | tools/fuse_bn.py | rickyHong/mini-caffe | 32b1832aff6b3998c4b619f868c14e0bce2d0d21 | [
"BSD-3-Clause"
] | null | null | null | tools/fuse_bn.py | rickyHong/mini-caffe | 32b1832aff6b3998c4b619f868c14e0bce2d0d21 | [
"BSD-3-Clause"
] | 4 | 2018-01-12T05:53:33.000Z | 2018-07-31T11:32:02.000Z | # coding: utf-8
# pylint: disable=invalid-name, no-member, line-too-long
from __future__ import print_function
import os
import argparse
import numpy as np
import caffe_pb2
import google.protobuf as pb2
def fuse(weight, bias, mean, var, scale, shift, eps=1e-5):
"""fuse conv weight with bn parameters
Paramet... | 32.58 | 115 | 0.561387 |
71461f98f720af492ad67a995871e6a8178a8731 | 9,867 | py | Python | src/python/WMCore/WorkQueue/DataLocationMapper.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/WorkQueue/DataLocationMapper.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/WorkQueue/DataLocationMapper.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""Map data to locations for WorkQueue"""
from future.utils import viewitems, viewvalues, listvalues
from builtins import object
from future import standard_library
standard_library.install_aliases()
from collections import defaultdict
import logging
from urllib.parse import urlparse
from WMCo... | 41.987234 | 109 | 0.609 |
5f674ee838b670d17b35cef292d3a7fd19dd297c | 1,132 | py | Python | setup.py | swimlane/ews-builder | 874af59bcface2528ec878ab6f3c11dc8bdb1731 | [
"MIT"
] | 3 | 2021-07-15T20:56:17.000Z | 2022-01-31T22:24:37.000Z | setup.py | swimlane/ews-builder | 874af59bcface2528ec878ab6f3c11dc8bdb1731 | [
"MIT"
] | null | null | null | setup.py | swimlane/ews-builder | 874af59bcface2528ec878ab6f3c11dc8bdb1731 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
def parse_requirements(requirement_file):
with open(requirement_file) as f:
return f.readlines()
version = dict()
with open("./ews_builder/utils/version.py") as fp:
exec(fp.read(), version)
setup(
name='ews-builder',
version=version['__version__'],... | 29.025641 | 62 | 0.616608 |
afcae67527dab4e8c59276d62725fc3b4844e613 | 658 | py | Python | Plant_Disease_Detection_gan_experiments/infoDCGAN/utils.py | qvandenberg/plant-disease-experiments | fc79197a34acc3f03f6562e510255de28461b49d | [
"MIT"
] | 26 | 2018-05-04T15:15:57.000Z | 2021-10-17T21:25:10.000Z | Plant_Disease_Detection_gan_experiments/infoDCGAN/utils.py | qvandenberg/plant-disease-experiments | fc79197a34acc3f03f6562e510255de28461b49d | [
"MIT"
] | 5 | 2018-06-26T12:53:55.000Z | 2019-08-13T10:57:54.000Z | Plant_Disease_Detection_gan_experiments/infoDCGAN/utils.py | qvandenberg/plant-disease-experiments | fc79197a34acc3f03f6562e510255de28461b49d | [
"MIT"
] | 24 | 2018-10-09T07:04:10.000Z | 2021-03-08T17:37:47.000Z | from progress.bar import Bar
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
class ProgressBar(Bar):
message = 'Loading'
fill = '#'
suffix = '%(percent).1f%% | ETA: %(eta)ds'
def plot(samples):
fig = plt.figure(figsize=(4, 4))
gs = gridspec.GridSpec(4, 4)
gs... | 27.416667 | 74 | 0.583587 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.