hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7b6af50f6d74ad5e7bfd1e2bf17a8d2bf0aef831 | 2,001 | py | Python | binjago/prologues.py | zznop/binjago | 52aa7c7d0da6de1b5b3c092a5d18f31e0804697f | [
"MIT"
] | 31 | 2017-10-23T13:01:29.000Z | 2021-06-19T17:25:45.000Z | binjago/prologues.py | zznop/binjago | 52aa7c7d0da6de1b5b3c092a5d18f31e0804697f | [
"MIT"
] | 2 | 2019-07-04T20:16:38.000Z | 2020-07-21T02:26:39.000Z | binjago/prologues.py | zznop/binjago | 52aa7c7d0da6de1b5b3c092a5d18f31e0804697f | [
"MIT"
] | 1 | 2019-03-31T00:22:10.000Z | 2019-03-31T00:22:10.000Z | """prologues.py: identify function entry points in flat file binaries
"""
from binaryninja import *
class PrologSearch(BackgroundTaskThread):
"""Class that assists in locating function prologues in flat files binaries such as firmware
"""
def __init__(self, view):
BackgroundTaskThread.__i... | 35.732143 | 97 | 0.544228 |
c54efeaaa4a219f060c8662145b097b2197f4ec8 | 1,604 | py | Python | test/test_dlna_service_api.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | test/test_dlna_service_api.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | test/test_dlna_service_api.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Emby Server API
Explore the Emby Server API # noqa: E501
OpenAPI spec version: 4.1.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import embyapi
from embyapi.api.dlna_service_api import DlnaS... | 21.105263 | 69 | 0.638404 |
c23a287d18f44375d359013490ffed425ba8badb | 4,841 | py | Python | src/mpi4py/futures/aplus.py | dmitry-kabanov/mpi4py | 91711bd7e7d72df7a68137080ace15595c681ef8 | [
"BSD-2-Clause"
] | 3 | 2021-11-18T20:01:35.000Z | 2021-12-17T17:47:23.000Z | src/mpi4py/futures/aplus.py | dmitry-kabanov/mpi4py | 91711bd7e7d72df7a68137080ace15595c681ef8 | [
"BSD-2-Clause"
] | 1 | 2022-03-16T07:29:30.000Z | 2022-03-31T10:19:07.000Z | src/mpi4py/futures/aplus.py | dmitry-kabanov/mpi4py | 91711bd7e7d72df7a68137080ace15595c681ef8 | [
"BSD-2-Clause"
] | 3 | 2021-01-20T13:57:25.000Z | 2021-08-05T06:48:58.000Z | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
"""Support for Future chaining."""
# pylint: disable=broad-except
# This implementation is heavily inspired in code written by
# Daniel Dotsenko [@dvdotsenko] [dotsa at hotmail.com]
# https://github.com/dvdotsenko/python-future-then
import sys
import weakref
imp... | 33.157534 | 79 | 0.633547 |
3ca3e9f8d0447dc0bff7d6cf766da4f266c57028 | 386 | py | Python | dubitoapp/migrations/0011_auto_20210104_1806.py | samul-1/dubito | 53c22b3a7c77aeb00d19fa61679357808e34ff9a | [
"MIT"
] | 1 | 2021-02-07T19:46:28.000Z | 2021-02-07T19:46:28.000Z | dubitoapp/migrations/0011_auto_20210104_1806.py | samul-1/dubito | 53c22b3a7c77aeb00d19fa61679357808e34ff9a | [
"MIT"
] | null | null | null | dubitoapp/migrations/0011_auto_20210104_1806.py | samul-1/dubito | 53c22b3a7c77aeb00d19fa61679357808e34ff9a | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-04 17:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dubitoapp', '0010_auto_20201206_1955'),
]
operations = [
migrations.AlterField(
model_name='player',
name='name',
... | 20.315789 | 50 | 0.598446 |
e74bff31f58d4c936dc923865a2fae7337948c16 | 703 | py | Python | alembic/versions/40d44f5e7b69_add_party_id_column_to_cosponsorship_.py | minsukkahng/pokr.kr | 169475778c998b4198ac7d6a1cebbc3c389e41b8 | [
"Apache-2.0"
] | 76 | 2015-01-19T12:39:43.000Z | 2021-10-14T06:10:25.000Z | alembic/versions/40d44f5e7b69_add_party_id_column_to_cosponsorship_.py | minsukkahng/pokr.kr | 169475778c998b4198ac7d6a1cebbc3c389e41b8 | [
"Apache-2.0"
] | 22 | 2015-01-03T01:00:53.000Z | 2019-09-14T11:55:06.000Z | alembic/versions/40d44f5e7b69_add_party_id_column_to_cosponsorship_.py | minsukkahng/pokr.kr | 169475778c998b4198ac7d6a1cebbc3c389e41b8 | [
"Apache-2.0"
] | 28 | 2015-01-14T15:45:00.000Z | 2020-06-03T13:29:41.000Z | """add party_id column to cosponsorship table
Revision ID: 40d44f5e7b69
Revises: 225b82afbf55
Create Date: 2014-07-16 19:37:44.977381
"""
# revision identifiers, used by Alembic.
revision = '40d44f5e7b69'
down_revision = '225b82afbf55'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands ... | 27.038462 | 99 | 0.74111 |
0cf87f7c655f9eed0a7158d4157e96e403114306 | 4,053 | py | Python | alipay/aop/api/request/AlipayUserInviteOnlinesummaryQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayUserInviteOnlinesummaryQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayUserInviteOnlinesummaryQueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayUserInviteOnlinesummaryQueryModel import AlipayUserInviteOnlinesummaryQueryModel
class AlipayUserInviteOnlinesum... | 27.951724 | 166 | 0.649889 |
ec6534fdf9968dbb1c86461b5eaf5ad234060fc1 | 8,920 | py | Python | python/http_client/v1/polyaxon_sdk/models/v1_hook.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | python/http_client/v1/polyaxon_sdk/models/v1_hook.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | python/http_client/v1/polyaxon_sdk/models/v1_hook.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | 26.94864 | 192 | 0.585426 |
b44e638940dbd77c561c199c5751699d2563c9fd | 38,953 | py | Python | D_Database.py | grobinson105/HeatSet-Home-Energy-Monitoring | e96e5cf8e5cc03b0deb7886e0f18ab1b11752e01 | [
"BSD-3-Clause"
] | null | null | null | D_Database.py | grobinson105/HeatSet-Home-Energy-Monitoring | e96e5cf8e5cc03b0deb7886e0f18ab1b11752e01 | [
"BSD-3-Clause"
] | null | null | null | D_Database.py | grobinson105/HeatSet-Home-Energy-Monitoring | e96e5cf8e5cc03b0deb7886e0f18ab1b11752e01 | [
"BSD-3-Clause"
] | null | null | null | import sqlite3
from time import gmtime, strftime
from urllib.request import pathname2url
import csv
import threading
import time
import datetime as dt
from datetime import timezone
import C_chart_plots
import G_Check_Time as chk_time
import H_Derived_Values as derived
def create_table_string(dictInstructions, strTech)... | 58.930408 | 258 | 0.58568 |
ee06d282c47178c2b42d1a4f5ec7b6643152fd53 | 246 | py | Python | samples/hello_world_wsgi.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | 2 | 2021-12-10T16:12:51.000Z | 2022-01-06T17:29:12.000Z | samples/hello_world_wsgi.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | samples/hello_world_wsgi.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | # hello_world_wsgi.py
from webpie import WPApp, WPHandler
class Greeter(WPHandler):
def hello(self, request, relpath):
return "Hello, World!\n"
application = WPApp(Greeter)
| 22.363636 | 52 | 0.54878 |
ce0a6f5226dadc1fa18ea51e4978f6443dd6883c | 26,293 | py | Python | my_vim_files/python27/Lib/test/test_strptime.py | satsaeid/dotfiles | 401c3213b31dd941b44e553c6f0441187b01c19a | [
"MIT"
] | null | null | null | my_vim_files/python27/Lib/test/test_strptime.py | satsaeid/dotfiles | 401c3213b31dd941b44e553c6f0441187b01c19a | [
"MIT"
] | null | null | null | my_vim_files/python27/Lib/test/test_strptime.py | satsaeid/dotfiles | 401c3213b31dd941b44e553c6f0441187b01c19a | [
"MIT"
] | null | null | null | """PyUnit testing against strptime"""
import unittest
import time
import locale
import re
import sys
from test import test_support
from datetime import date as datetime_date
import _strptime
class getlang_Tests(unittest.TestCase):
"""Test _getlang"""
def test_basic(self):
self.assertEq... | 46.701599 | 89 | 0.565702 |
d71bde2f4d4924345232111a71731869141791eb | 402 | py | Python | MindfulnessBot/mood_error.py | PhilippRisius/MindfulnessBot | d1cece72b7784e8e19d057c9812f367ecccb9104 | [
"MIT"
] | 1 | 2020-08-13T21:10:27.000Z | 2020-08-13T21:10:27.000Z | MindfulnessBot/mood_error.py | PhilippRisius/MindfulnessBot | d1cece72b7784e8e19d057c9812f367ecccb9104 | [
"MIT"
] | 1 | 2020-08-28T20:12:16.000Z | 2020-08-28T20:12:16.000Z | MindfulnessBot/mood_error.py | PhilippRisius/MindfulnessBot | d1cece72b7784e8e19d057c9812f367ecccb9104 | [
"MIT"
] | 1 | 2020-08-13T21:27:32.000Z | 2020-08-13T21:27:32.000Z | class MoodError(Exception):
"""Base class for other exceptions within the mood bot"""
pass
class InputMoodError(MoodError):
"""Exception raised for errors in the input."""
def __int__(self, *args):
pass
def __str__(self):
if self.args[1] is None:
return sel... | 25.125 | 62 | 0.569652 |
02b84c07d4e2f9797c11a8f28456d6bb562227ae | 6,986 | py | Python | micasense/utils.py | gdslab/p4m | 738fd15a957eaf1a4462f1628d62e30ad33a9f72 | [
"MIT"
] | 2 | 2021-03-17T01:33:19.000Z | 2021-12-01T14:10:17.000Z | micasense/utils.py | gdslab/p4m | 738fd15a957eaf1a4462f1628d62e30ad33a9f72 | [
"MIT"
] | null | null | null | micasense/utils.py | gdslab/p4m | 738fd15a957eaf1a4462f1628d62e30ad33a9f72 | [
"MIT"
] | 1 | 2022-02-09T23:22:28.000Z | 2022-02-09T23:22:28.000Z | #!/usr/bin/env python
# coding: utf-8
"""
MicaSense Image Processing Utilities
Copyright 2017 MicaSense, 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 ... | 39.468927 | 119 | 0.689665 |
cb1a3edf903cd9ad8becacb3d3ea7d1f3814144d | 8,679 | py | Python | DaphneRobot/utils/functions.py | MoeZilla/DaphneRobot | 967833f243b826c1fb1a2f6e1b86fc31ecafd966 | [
"MIT"
] | null | null | null | DaphneRobot/utils/functions.py | MoeZilla/DaphneRobot | 967833f243b826c1fb1a2f6e1b86fc31ecafd966 | [
"MIT"
] | null | null | null | DaphneRobot/utils/functions.py | MoeZilla/DaphneRobot | 967833f243b826c1fb1a2f6e1b86fc31ecafd966 | [
"MIT"
] | null | null | null | """
MIT License
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, distribute, sublicense, and/or ... | 30.667845 | 104 | 0.618965 |
03de64b37c10a6ca8e11c0ed0fe5bbaed603d81e | 11,078 | py | Python | tinygrad/tensor.py | kartik4949/tinygrad | ac229ea750371f7480c4e477d49949944361a001 | [
"MIT"
] | null | null | null | tinygrad/tensor.py | kartik4949/tinygrad | ac229ea750371f7480c4e477d49949944361a001 | [
"MIT"
] | null | null | null | tinygrad/tensor.py | kartik4949/tinygrad | ac229ea750371f7480c4e477d49949944361a001 | [
"MIT"
] | null | null | null | # inspired by https://github.com/karpathy/micrograd/blob/master/micrograd/engine.py
import sys
import inspect
import functools
import os
from collections import defaultdict
import numpy as np
# **** profiler ****
DEBUG = os.getenv("DEBUG", None) is not None
if DEBUG:
import atexit, time
debug_counts, debug_times ... | 33.068657 | 141 | 0.652374 |
45cc534476ab42558f166d9bbd4da0aaf5c033c9 | 1,761 | py | Python | setup.py | jgriss/easypqp | d75abe83a223ca26aa6c73e3bd64dc908c4b0456 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jgriss/easypqp | d75abe83a223ca26aa6c73e3bd64dc908c4b0456 | [
"BSD-3-Clause"
] | null | null | null | setup.py | jgriss/easypqp | d75abe83a223ca26aa6c73e3bd64dc908c4b0456 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='easypqp',
version='0.1.8',
description='EasyPQP: Simple library... | 33.226415 | 131 | 0.621806 |
0482e840467bed8b723eb0e19df55dc47f653d8e | 2,173 | py | Python | adventofcode/solutions/y2021/d09.py | andreasbjornstrom/adventofcode-python | 71db65568bf0f327dd56e5e1c7488e356a24f403 | [
"MIT"
] | null | null | null | adventofcode/solutions/y2021/d09.py | andreasbjornstrom/adventofcode-python | 71db65568bf0f327dd56e5e1c7488e356a24f403 | [
"MIT"
] | null | null | null | adventofcode/solutions/y2021/d09.py | andreasbjornstrom/adventofcode-python | 71db65568bf0f327dd56e5e1c7488e356a24f403 | [
"MIT"
] | null | null | null | '''
Solution for day 9 of the 2021 Advent of Code calendar.
Run it with the command `python -m adventofcode run_solution -y 2021 9` from the project root.
'''
from functools import reduce
from adventofcode.types import Solution
def find_low_points(board):
lowest_points = []
for y, row in enumerate(board):
... | 28.973333 | 94 | 0.544869 |
e2f5eb05cc42892afbfc418be7fa28b55c3a6902 | 363 | py | Python | hsx_01/meiduo_mall/meiduo_mall/utils/BaseModel.py | hsx9527/test01 | 06cd5886af8707dd3c18da7b96cb0192b5c7e861 | [
"MIT"
] | null | null | null | hsx_01/meiduo_mall/meiduo_mall/utils/BaseModel.py | hsx9527/test01 | 06cd5886af8707dd3c18da7b96cb0192b5c7e861 | [
"MIT"
] | 7 | 2021-01-06T20:08:25.000Z | 2022-02-27T09:54:45.000Z | hsx_01/meiduo_mall/meiduo_mall/utils/BaseModel.py | hsx9527/test01 | 06cd5886af8707dd3c18da7b96cb0192b5c7e861 | [
"MIT"
] | null | null | null | from django.db import models
class BaseModel(models.Model):
create_time = models.DateTimeField(auto_now_add=True,
verbose_name="创建时间")
update_time = models.DateTimeField(auto_now=True,
verbose_name="更新时间")
class Meta:
# 说... | 36.3 | 59 | 0.573003 |
c7e9d45016bf13daea90e6461e8bd0491ede842b | 6,001 | py | Python | tests/test_supervised/test_algorithms/test_optimization_algorithms/test_services/test_regularizers.py | j2slab/MLStudio | 7d7c4b1073617968c28f0e496020e4720b552451 | [
"BSD-3-Clause"
] | 1 | 2019-05-13T01:07:23.000Z | 2019-05-13T01:07:23.000Z | tests/test_supervised/test_algorithms/test_optimization_algorithms/test_services/test_regularizers.py | DecisionScients/MLStudio | 7d7c4b1073617968c28f0e496020e4720b552451 | [
"BSD-3-Clause"
] | 1 | 2020-04-11T22:14:42.000Z | 2020-04-11T22:14:42.000Z | tests/test_supervised/test_algorithms/test_optimization_algorithms/test_services/test_regularizers.py | decisionscients/MLStudio | 7d7c4b1073617968c28f0e496020e4720b552451 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# =========================================================================== #
# Project : ML Studio #
# Version : 0.1.14 #
# File : test_objectives.py ... | 45.120301 | 93 | 0.489585 |
ff0c454201c83afbdcda2ed4ca8eb52e3434afcb | 1,807 | py | Python | cechmate/filtrations/rips.py | sauln/cechmate | 9d1516e10e537a3f4126db960b357f1841695a2a | [
"Apache-2.0"
] | 1 | 2021-11-25T00:05:18.000Z | 2021-11-25T00:05:18.000Z | cechmate/filtrations/rips.py | sauln/cechmate | 9d1516e10e537a3f4126db960b357f1841695a2a | [
"Apache-2.0"
] | null | null | null | cechmate/filtrations/rips.py | sauln/cechmate | 9d1516e10e537a3f4126db960b357f1841695a2a | [
"Apache-2.0"
] | null | null | null | import itertools
import numpy as np
from .base import BaseFiltration
class Rips(BaseFiltration):
""" Construct a Rips filtration and the associated diagrams. abcabc
Examples
========
>>> r = Rips(max_dim=3)
>>> simplices = r.fit(X)
>>> diagrams = r.transform(simplices)
"""
... | 25.814286 | 75 | 0.50083 |
9777f7353a99e5b6c91be27538aec71f99837f0c | 912 | py | Python | terafamiliar/individual_therapy/models.py | Icogerard/WEB-TERAFAMILIAR---DJANGO2 | dcf7d6507ef2eda697766ab3b1dd6df4365f0452 | [
"MIT"
] | null | null | null | terafamiliar/individual_therapy/models.py | Icogerard/WEB-TERAFAMILIAR---DJANGO2 | dcf7d6507ef2eda697766ab3b1dd6df4365f0452 | [
"MIT"
] | null | null | null | terafamiliar/individual_therapy/models.py | Icogerard/WEB-TERAFAMILIAR---DJANGO2 | dcf7d6507ef2eda697766ab3b1dd6df4365f0452 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.timezone import now
from ckeditor.fields import RichTextField
# Create your models here.
class Individual_therapy(models.Model):
title = models.CharField(max_length=200, verbose_name="Título")
subtitle = models.CharField(max_length=200, verbose_name="Subtítulo")
... | 43.428571 | 87 | 0.75 |
3789cc468ce216e836b018307540ce0178aca039 | 3,569 | py | Python | tests/test_with_fixtures.py | neumannd/pytest_fun | edd395441c243116860301e84c0ef337dc3a789d | [
"CC0-1.0"
] | 4 | 2020-04-09T09:27:21.000Z | 2020-04-16T13:28:26.000Z | tests/test_with_fixtures.py | neumannd/pytest_fun | edd395441c243116860301e84c0ef337dc3a789d | [
"CC0-1.0"
] | 24 | 2020-04-14T08:58:30.000Z | 2020-05-14T13:08:26.000Z | tests/test_with_fixtures.py | neumannd/pytest_fun | edd395441c243116860301e84c0ef337dc3a789d | [
"CC0-1.0"
] | 1 | 2020-04-14T08:30:25.000Z | 2020-04-14T08:30:25.000Z | from pytest_fun.funs import write_int_to_file, sum_dict
import pytest
from pathlib import Path
# ~~~~ test write_int_to_file ~~~~
@pytest.mark.io_tests
def test_write_int_to_file():
# define a temporary directory
tmpdir = Path('/tmp')
file_path = tmpdir / 'my_file.txt'
write_int_to_file(5, file_path)... | 34.317308 | 79 | 0.724012 |
9c397e3a0fbfdb0b5b61674ddf3dcdc8ac490ad8 | 393 | py | Python | blogsite/wsgi.py | AmineAsli/my-personal-blog | 3ced4ec04c0f75d97db2a31d1291a98f6c852699 | [
"MIT"
] | null | null | null | blogsite/wsgi.py | AmineAsli/my-personal-blog | 3ced4ec04c0f75d97db2a31d1291a98f6c852699 | [
"MIT"
] | null | null | null | blogsite/wsgi.py | AmineAsli/my-personal-blog | 3ced4ec04c0f75d97db2a31d1291a98f6c852699 | [
"MIT"
] | null | null | null | """
WSGI config for blogsite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
d3ec471588539a7dd571abb1335b95b68f93991b | 159 | py | Python | collectors/VMStatsDefaultCollector.py | voigtst/vrops-exporter | d8ed815a2b2716a33bccfdca669fd1886cfc860f | [
"Apache-2.0"
] | 18 | 2019-10-24T03:36:50.000Z | 2022-01-22T20:39:42.000Z | collectors/VMStatsDefaultCollector.py | richardtief/vrops-exporter | 7e7543f5561f85aab1828e4c9d6fada4b687639f | [
"Apache-2.0"
] | 55 | 2019-10-16T09:51:36.000Z | 2022-03-28T11:46:08.000Z | collectors/VMStatsDefaultCollector.py | richardtief/vrops-exporter | 7e7543f5561f85aab1828e4c9d6fada4b687639f | [
"Apache-2.0"
] | 19 | 2019-10-15T14:07:27.000Z | 2022-02-17T21:41:14.000Z | from collectors.VMStatsCollector import VMStatsCollector
class VMStatsDefaultCollector(VMStatsCollector):
def __init__(self):
super().__init__()
| 22.714286 | 56 | 0.779874 |
16ddb29a4946dd8cf648cc583fa098e3eaad1247 | 119,914 | py | Python | ckan/logic/action/get.py | gsplatform/ckan | 0439c61a39619af23049f37003b2caac96cc5bba | [
"Apache-2.0"
] | null | null | null | ckan/logic/action/get.py | gsplatform/ckan | 0439c61a39619af23049f37003b2caac96cc5bba | [
"Apache-2.0"
] | null | null | null | ckan/logic/action/get.py | gsplatform/ckan | 0439c61a39619af23049f37003b2caac96cc5bba | [
"Apache-2.0"
] | null | null | null | '''API functions for searching for and getting data from CKAN.'''
import uuid
import logging
import json
import datetime
import socket
from pylons import config
import sqlalchemy
from paste.deploy.converters import asbool
import ckan.lib.dictization
import ckan.logic as logic
import ckan.logic.action
import ckan.log... | 33.816695 | 99 | 0.656187 |
af80d986503302de257b08d9a2184cb84e4be08b | 6,491 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/os_profile.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 64.267327 | 211 | 0.692651 |
249b7721659e0e7f14260021fe2a84376e17c735 | 23,341 | py | Python | flax/consensus/block_body_validation.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | flax/consensus/block_body_validation.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | flax/consensus/block_body_validation.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | import collections
import logging
from typing import Dict, List, Optional, Set, Tuple, Union, Callable
from blspy import AugSchemeMPL, G1Element
from chiabip158 import PyBIP158
from clvm.casts import int_from_bytes
from flax.consensus.block_record import BlockRecord
from flax.consensus.block_rewards import calculate_... | 48.125773 | 120 | 0.655413 |
5f88b46e9b3833623e966d1ae1c0f82b0f4499b2 | 1,559 | py | Python | tests/test_rme_api.py | baffolobill/HerePy | c6655e9dfde7a5888cc231d7f9f9e8a888f54dcd | [
"MIT"
] | null | null | null | tests/test_rme_api.py | baffolobill/HerePy | c6655e9dfde7a5888cc231d7f9f9e8a888f54dcd | [
"MIT"
] | null | null | null | tests/test_rme_api.py | baffolobill/HerePy | c6655e9dfde7a5888cc231d7f9f9e8a888f54dcd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import time
import unittest
import json
import responses
import herepy
import io
class RmeApiTest(unittest.TestCase):
def setUp(self):
api = herepy.RmeApi('app_id', 'app_code')
self._api = api
def test_initiation(self):
self.assertIsInstance(self._api,... | 35.431818 | 91 | 0.670943 |
efa15e0b633f56dc24c15eeb4e63889cbb084ab3 | 12,424 | py | Python | youtube_dl/extractor/viki.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/viki.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/viki.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import json
import time
import hmac
import hashlib
import itertools
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
parse_iso8601,
sanitized_Request,
)
class VikiBaseIE(InfoExtractor):
... | 34.607242 | 121 | 0.53775 |
ce6524cc5c00f6b6bd575f09d42861bfbf854cbe | 1,814 | py | Python | tool/pipe_join.py | y0ssar1an/CSS3 | 813ec04e1426d81bfa0ce8da4c65a026fdd62e83 | [
"MIT"
] | 192 | 2015-01-03T02:42:23.000Z | 2020-03-10T17:10:52.000Z | tool/pipe_join.py | argyleink/CSS3 | db942b42191b3063d9e0d3bf212083ed3e565a44 | [
"MIT"
] | 89 | 2015-01-02T11:36:32.000Z | 2020-04-26T07:30:45.000Z | tool/pipe_join.py | argyleink/CSS3 | db942b42191b3063d9e0d3bf212083ed3e565a44 | [
"MIT"
] | 37 | 2015-01-04T05:44:09.000Z | 2019-04-11T09:07:58.000Z | import sublime_plugin
class ReversePipeJoinMultilineCommand(sublime_plugin.TextCommand):
def run(self, edit):
"""
BEFORE
blue
red
green
purple
orange
yellow
AFTER
yellow|
red|
purpl... | 24.849315 | 79 | 0.557883 |
e57c1945fd836109f19bb49077d01baa0b2158e0 | 1,781 | py | Python | attacks/single_key/smallfraction.py | matusso/RsaCtfTool | 319acafc5375b473d0ec1d834ff5e0b59e88cdbf | [
"Beerware"
] | 1 | 2021-08-04T21:37:30.000Z | 2021-08-04T21:37:30.000Z | attacks/single_key/smallfraction.py | swzhouu/RsaCtfTool | bf3c0148f7ab0592deba702160f502d29ca7dbe1 | [
"Beerware"
] | null | null | null | attacks/single_key/smallfraction.py | swzhouu/RsaCtfTool | bf3c0148f7ab0592deba702160f502d29ca7dbe1 | [
"Beerware"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from attacks.abstract_attack import AbstractAttack
import subprocess
from lib.keys_wrapper import PrivateKey
from lib.utils import rootpath
class Attack(AbstractAttack):
def __init__(self, timeout=60):
super().__init__(timeout)
self.speed = AbstractA... | 34.921569 | 88 | 0.603032 |
2819de29c9cd771e24ec60355fb564784dd09edd | 1,093 | py | Python | s3-react-website/python/cdk/setup.py | sbstjn/cdk-patterns-serverless | 0da672b7ee13e95286cd65a0c68d8e0427b3be63 | [
"MIT"
] | null | null | null | s3-react-website/python/cdk/setup.py | sbstjn/cdk-patterns-serverless | 0da672b7ee13e95286cd65a0c68d8e0427b3be63 | [
"MIT"
] | null | null | null | s3-react-website/python/cdk/setup.py | sbstjn/cdk-patterns-serverless | 0da672b7ee13e95286cd65a0c68d8e0427b3be63 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md") as fp:
long_description = fp.read()
setuptools.setup(
name="s3_angular_website",
version="0.0.1",
description="An empty CDK Python app",
long_description=long_description,
long_description_content_type="text/markdown",
author="author",
pack... | 23.255319 | 66 | 0.609332 |
bae9be6500543f203509675d0f078e332606c726 | 4,495 | py | Python | qiskit_rng/generator_job.py | nonhermitian/qiskit_rng | 8ecd8c1d7d5b544c1642e221c402fadc46274956 | [
"Apache-2.0"
] | null | null | null | qiskit_rng/generator_job.py | nonhermitian/qiskit_rng | 8ecd8c1d7d5b544c1642e221c402fadc46274956 | [
"Apache-2.0"
] | null | null | null | qiskit_rng/generator_job.py | nonhermitian/qiskit_rng | 8ecd8c1d7d5b544c1642e221c402fadc46274956 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 35.117188 | 94 | 0.623804 |
048afa1bbbe54e559d6cc7712fd810351e132bb6 | 2,205 | py | Python | sandbox/scripts/7_classes_hdf5.py | GOALCLEOPATRA/MLM | 331fd42f8f1f16ad990e66f9f0f873a824f8f849 | [
"MIT"
] | null | null | null | sandbox/scripts/7_classes_hdf5.py | GOALCLEOPATRA/MLM | 331fd42f8f1f16ad990e66f9f0f873a824f8f849 | [
"MIT"
] | 5 | 2020-11-13T18:49:58.000Z | 2021-09-08T02:02:28.000Z | sandbox/scripts/7_classes_hdf5.py | GOALCLEOPATRA/MLM | 331fd42f8f1f16ad990e66f9f0f873a824f8f849 | [
"MIT"
] | 2 | 2020-10-22T09:06:31.000Z | 2021-12-27T21:46:49.000Z | '''
Create HDF5 file with classes embeddings
'''
import os
import time
import h5py
import json
import argparse
import numpy as np
from pathlib import Path
from doc_embeddings import DocEmbeddings
ROOT_PATH = Path(os.path.dirname(__file__)).parent.parent.parent
# Add arguments to parser
parser = argparse.ArgumentParse... | 37.372881 | 133 | 0.663039 |
3e99bfd80623774d56c79314078527ca1ca68ba4 | 3,047 | py | Python | var/spack/repos/builtin/packages/libzmq/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-10-22T00:14:43.000Z | 2020-10-22T00:14:43.000Z | var/spack/repos/builtin/packages/libzmq/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 14 | 2021-07-20T01:04:53.000Z | 2022-03-02T01:08:36.000Z | var/spack/repos/builtin/packages/libzmq/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-05-06T00:17:46.000Z | 2021-05-06T00:17:46.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libzmq(AutotoolsPackage):
"""The ZMQ networking/concurrency library and core API"""
h... | 46.166667 | 95 | 0.710207 |
170bb8188c3af3c39b7411875c2d4e3560b41d4b | 2,885 | py | Python | NeBSS/res/get_thresh_vol.py | PIRCImagingTools/NeBSS | 509b3fdbe08d53ea44da1db5f865ba8e3a534164 | [
"BSD-3-Clause"
] | 2 | 2019-05-23T07:11:04.000Z | 2019-05-24T14:18:21.000Z | NeBSS/res/get_thresh_vol.py | PIRCImagingTools/NeBSS | 509b3fdbe08d53ea44da1db5f865ba8e3a534164 | [
"BSD-3-Clause"
] | 2 | 2018-04-11T12:36:31.000Z | 2019-02-15T00:21:17.000Z | NeBSS/res/get_thresh_vol.py | PIRCImagingTools/NeBSS | 509b3fdbe08d53ea44da1db5f865ba8e3a534164 | [
"BSD-3-Clause"
] | 3 | 2017-07-21T18:05:41.000Z | 2019-01-23T09:32:10.000Z | import csv
from nipype.interfaces.fsl import ImageStats
from nipype.interfaces.fsl.maths import MathsCommand
def get_volume(mask, thresh, out_file):
Mask = MathsCommand(in_file = mask,
args = "-thr {0} -bin".format(thresh),
out_file=out_file)
Mout = Mask.run()
... | 38.466667 | 79 | 0.548354 |
db5a5b0cf20a3d79c082c5b729ca7b71d8fa375e | 3,597 | py | Python | pyconam/middlewares.py | gileno/pyconam2018 | 2a7c0670ad30a71179594122e9cb948b7783277e | [
"MIT"
] | 2 | 2018-08-20T14:48:46.000Z | 2020-04-02T18:43:25.000Z | pyconam/middlewares.py | gileno/pyconam2018 | 2a7c0670ad30a71179594122e9cb948b7783277e | [
"MIT"
] | 4 | 2021-03-31T18:42:16.000Z | 2022-03-02T14:55:18.000Z | pyconam/middlewares.py | gileno/pyconam2018 | 2a7c0670ad30a71179594122e9cb948b7783277e | [
"MIT"
] | 1 | 2018-08-20T14:48:48.000Z | 2018-08-20T14:48:48.000Z | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class PyconamSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy ... | 34.586538 | 78 | 0.666111 |
a15e2b9d2a31daf5c4d6b59df19cf4b12df691c1 | 2,423 | py | Python | version-info.py | gawati/jenkinstest | 5c41ad7838cecdae679cba064b5aa5cc2f65404c | [
"MIT"
] | 1 | 2018-05-04T11:25:44.000Z | 2018-05-04T11:25:44.000Z | version-info.py | gawati/jenkins | 5c41ad7838cecdae679cba064b5aa5cc2f65404c | [
"MIT"
] | null | null | null | version-info.py | gawati/jenkins | 5c41ad7838cecdae679cba064b5aa5cc2f65404c | [
"MIT"
] | null | null | null | import json
import os
import io
import sys
from string import Template
__version__ = "1.0.18"
__mode__ = "dev"
def read_kv_file(fileName):
myvars = {}
if os.path.isfile(fileName):
with open(fileName) as kvfile:
for line in kvfile:
name, var = line.partition("=")[::2]
... | 25.505263 | 102 | 0.683863 |
fea731fa79adc8241bad23156250aa809bf625c1 | 4,525 | py | Python | plotting/plotDataRate.py | will-fawcett/trackerSW | fc097b97539d0b40a15e1d6e112f4048cb4122b4 | [
"MIT"
] | null | null | null | plotting/plotDataRate.py | will-fawcett/trackerSW | fc097b97539d0b40a15e1d6e112f4048cb4122b4 | [
"MIT"
] | null | null | null | plotting/plotDataRate.py | will-fawcett/trackerSW | fc097b97539d0b40a15e1d6e112f4048cb4122b4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Script to make plots of data rate as a function of radial distance
'''
import json
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
import os
def main(verbose):
# get directory where info is stored
STORE_DIR = os.path.dirname(os.path.realpath(__file__)) + ... | 30.369128 | 192 | 0.57768 |
39627f2d69a70c9de84eb8a85d91703965147159 | 2,117 | py | Python | network/util.py | xuyu0010/ARID_UG2_2.2 | 4ce8447d3de6702d36c43d531e74d5f89d1b7f98 | [
"MIT"
] | 12 | 2021-01-30T08:34:26.000Z | 2022-03-28T09:22:52.000Z | network/util.py | xuyu0010/ARID_UG2_2.2 | 4ce8447d3de6702d36c43d531e74d5f89d1b7f98 | [
"MIT"
] | 2 | 2022-02-12T07:59:20.000Z | 2022-02-17T15:03:26.000Z | network/util.py | xuyu0010/ARID_UG2_2.2 | 4ce8447d3de6702d36c43d531e74d5f89d1b7f98 | [
"MIT"
] | 2 | 2021-03-22T02:07:37.000Z | 2022-03-03T08:30:59.000Z | import logging
import os
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Function
try:
from . import initializer
except:
import initializer
# Load pretrained into network
def load_state(network, state_dict):
# customized partialy load function
... | 24.905882 | 87 | 0.751063 |
c5ccdefd1704fb23207fc13ca2e48ddff08f7b3a | 7,783 | py | Python | lib/utils/image.py | tensorboy/centerpose | 555d753cd82693476f91f78c53aa4147f5a83015 | [
"MIT"
] | 245 | 2019-11-29T02:55:25.000Z | 2022-03-30T07:30:18.000Z | lib/utils/image.py | tensorboy/centerpose | 555d753cd82693476f91f78c53aa4147f5a83015 | [
"MIT"
] | 24 | 2019-11-29T10:05:00.000Z | 2022-03-30T07:16:06.000Z | lib/utils/image.py | FishLiuabc/centerpose | 555d753cd82693476f91f78c53aa4147f5a83015 | [
"MIT"
] | 45 | 2019-11-29T05:12:02.000Z | 2022-03-21T02:20:36.000Z | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# Modified by Xingyi Zhou
# ------------------------------------------------------------------------------
from __future__ import a... | 33.692641 | 90 | 0.577798 |
2619f89d22592691335cb707a8c0d9520129862c | 7,736 | py | Python | src/cp/run.py | itrummer/BABOONS | da25cb6e896d0c4f8b7b06db72d4d1cbff031515 | [
"MIT"
] | null | null | null | src/cp/run.py | itrummer/BABOONS | da25cb6e896d0c4f8b7b06db72d4d1cbff031515 | [
"MIT"
] | null | null | null | src/cp/run.py | itrummer/BABOONS | da25cb6e896d0c4f8b7b06db72d4d1cbff031515 | [
"MIT"
] | null | null | null | '''
Created on Jun 6, 2021
@author: immanueltrummer
'''
import argparse
import cp.base
import cp.bench
import cp.cache.dynamic
import cp.cache.static
import cp.rl
import logging
import psycopg2
import time
from stable_baselines3 import A2C, PPO
from cp.pred import all_preds
def print_details(env):
""" Prints det... | 35.324201 | 79 | 0.544467 |
732e46d6619ab04d2497b38bb2a98d329910f555 | 6,211 | py | Python | experiments/shikhar/offline/pointmass_rig2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/shikhar/offline/pointmass_rig2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/shikhar/offline/pointmass_rig2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import rlkit.misc.hyperparameter as hyp
from experiments.murtaza.multiworld.skew_fit.reacher.generate_uniform_dataset import generate_uniform_dataset_reacher
from multiworld.envs.mujoco.cameras import sawyer_init_camera_zoomed_in
from rlkit.launchers.launcher_util import run_experiment
# from rlkit.torch.grill.launcher... | 36.110465 | 117 | 0.571245 |
a90270f31bc4ac3d20288c8332397c53b588c841 | 4,146 | py | Python | src/solutions/common/q_and_a/models.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/q_and_a/models.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/q_and_a/models.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 30.485294 | 90 | 0.683792 |
84a055f2559a842f5ccb4fbe89d4d7864d68190c | 10,937 | py | Python | lower_step_detector-master/scripts/lower_step_detector.py | ricardolfsilva/trajectory_planner_simulator | 3bad162b8281d00bf571f850c40963b009718b67 | [
"MIT"
] | null | null | null | lower_step_detector-master/scripts/lower_step_detector.py | ricardolfsilva/trajectory_planner_simulator | 3bad162b8281d00bf571f850c40963b009718b67 | [
"MIT"
] | null | null | null | lower_step_detector-master/scripts/lower_step_detector.py | ricardolfsilva/trajectory_planner_simulator | 3bad162b8281d00bf571f850c40963b009718b67 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""
fix original laser scan data to detect down step
"""
__author__ = "MasaruMorita <p595201m@mail.kyutech.jp>"
__version__ = "1.01"
__date__ = "18 Oct 2015"
import rospy
import copy
import math
import sys
import numpy as np
from sensor_msgs.msg import LaserScan
NAME_NODE = ... | 42.722656 | 167 | 0.719027 |
43f68c6b488f10a6b645e255c52b35951c1c903a | 751 | py | Python | submissions/network-delay-time/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | submissions/network-delay-time/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | 1 | 2022-03-04T20:24:32.000Z | 2022-03-04T20:31:58.000Z | submissions/network-delay-time/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/network-delay-time
import heapq
from collections import defaultdict
class Solution:
def networkDelayTime(self, times, N, K):
graph = defaultdict(list)
for u, v, w in times:
graph[u - 1].append((v - 1, w))
dist = [float("inf")] * N
dist[... | 27.814815 | 56 | 0.498003 |
33faacc4b4709da0b0b57f1b3679d5ba17142ef2 | 697 | py | Python | train.py | cvamateur/SimDet | aa9bd4d3a34ecf6b882f5f8bba4bb565b747eaac | [
"MIT"
] | 2 | 2021-06-19T17:14:08.000Z | 2021-06-30T05:10:31.000Z | train.py | cvamateur/SimDet | aa9bd4d3a34ecf6b882f5f8bba4bb565b747eaac | [
"MIT"
] | null | null | null | train.py | cvamateur/SimDet | aa9bd4d3a34ecf6b882f5f8bba4bb565b747eaac | [
"MIT"
] | null | null | null | import os
import torch
from config import Configs as cfg
from src.dataset import get_pascal_voc_loader, VOCDataset, map_id_to_cls
from src.solver import detection_solver
from modeling import SingleStageDetector
def main():
print("Build VOC Dataset...")
dataset_train = VOCDataset(cfg.root_dir, image_set="tr... | 23.233333 | 72 | 0.728838 |
07e8103344a09189dcbbb3025e6e45d609ff7859 | 30,839 | py | Python | analyzer/libs/pygments/pygments/lexer.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 182 | 2017-03-05T07:43:13.000Z | 2022-03-15T13:09:07.000Z | analyzer/libs/pygments/pygments/lexer.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 342 | 2015-01-09T10:58:37.000Z | 2022-03-31T22:20:14.000Z | analyzer/libs/pygments/pygments/lexer.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 20 | 2015-02-02T08:13:17.000Z | 2022-02-10T11:08:49.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import re
import sys
import time
import itertools
from pygments.filt... | 35.406429 | 86 | 0.531859 |
36fd2c19ad0bf13a5cc20173ca91ba15f3458b16 | 1,384 | py | Python | src/Utilities/data/convertToNDFAuthors.py | yangdu119/MottoBook | 093370802100494615ad26681038b9b574a21a0f | [
"Apache-2.0"
] | null | null | null | src/Utilities/data/convertToNDFAuthors.py | yangdu119/MottoBook | 093370802100494615ad26681038b9b574a21a0f | [
"Apache-2.0"
] | 14 | 2020-09-05T06:33:23.000Z | 2022-03-08T22:49:39.000Z | src/Utilities/data/convertToNDFAuthors.py | yangdu119/MottoBook | 093370802100494615ad26681038b9b574a21a0f | [
"Apache-2.0"
] | null | null | null | import json
import uuid
from random import *
import sys
with open("allNatureImages.json") as json_file:
images = json_file.read().splitlines()
with open('authors_golden_category.json') as quotes_raw_data:
authors = json.load(quotes_raw_data)
output = {}
output["valueType"] = "nodes"
output["values"] = []
ite... | 20.969697 | 61 | 0.671965 |
2092714c1ebb1a1bd3bd17207bbcb0de0457fd49 | 309 | py | Python | topCoder/srms/200s/srm293/div2/aquarium.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/200s/srm293/div2/aquarium.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/200s/srm293/div2/aquarium.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | class Aquarium:
def peaceful(self, minSize, maxSize, fishSizes):
def is_fine(n):
for i in fishSizes:
if (2*i <= n <= 10*i) or (2*n <= i <= 10*n):
return
return n
return len(filter(None, map(is_fine, xrange(minSize, maxSize+1))))
| 34.333333 | 74 | 0.504854 |
ac35a4cbe3e62ee2ff222f0f069623f95c631399 | 390 | py | Python | opinions/united_states/state/ohioctcl.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | opinions/united_states/state/ohioctcl.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | opinions/united_states/state/ohioctcl.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | """Scraper for the 1st District Court of Appeals
CourtID: ohio
Court Short Name: Ohio
Author: Andrei Chelaru
"""
from juriscraper.opinions.united_states.state import ohio
class Site(ohio.Site):
def __init__(self):
super(Site, self).__init__()
self.court_id = self.__module__
self.court_ind... | 24.375 | 61 | 0.705128 |
ba2db8ec8210faad0a1a099306704086ea4260e2 | 44 | py | Python | PythonCode/CountingWhile.py | aredshaw/CodePractice | 1f5267d5cfc83b803a8b0da3cacc9b306492555e | [
"MIT"
] | 1 | 2019-09-24T03:39:44.000Z | 2019-09-24T03:39:44.000Z | PythonCode/CountingWhile.py | aredshaw/CodePractice | 1f5267d5cfc83b803a8b0da3cacc9b306492555e | [
"MIT"
] | null | null | null | PythonCode/CountingWhile.py | aredshaw/CodePractice | 1f5267d5cfc83b803a8b0da3cacc9b306492555e | [
"MIT"
] | 1 | 2021-07-12T01:15:30.000Z | 2021-07-12T01:15:30.000Z | x = 0
while x <=1000:
print(x)
x +=1 | 11 | 15 | 0.454545 |
0d0321ec4404c1702836e82f45f4809c52b8f740 | 527 | py | Python | samples/slow_server.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | 2 | 2021-12-10T16:12:51.000Z | 2022-01-06T17:29:12.000Z | samples/slow_server.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | samples/slow_server.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | # time_app.py
from webpie import WPApp, WPHandler
import time
class MyHandler(WPHandler):
def lines(self, request, relpath, lines=10, line_delay=1):
return (time.sleep(line_delay) or "line {}\n".format(i,) for i in range(int(lines)))
def data(self, request... | 26.35 | 92 | 0.605313 |
009b12aeca272bb92bf487b0bd38048b1a9594fd | 1,308 | py | Python | ECE579/k.py | achoudh5/HacktoberFestContribute | b949cf2dfd066704f74a604d6f0ae26a0724d813 | [
"MIT"
] | null | null | null | ECE579/k.py | achoudh5/HacktoberFestContribute | b949cf2dfd066704f74a604d6f0ae26a0724d813 | [
"MIT"
] | null | null | null | ECE579/k.py | achoudh5/HacktoberFestContribute | b949cf2dfd066704f74a604d6f0ae26a0724d813 | [
"MIT"
] | null | null | null | import random
res1 = []
def Rand(start, end, num):
for j in range(num):
res1.append(random.uniform(start, end))
return res1
# Driver Code
num = 400
start = 0
end = 1
print "the random values generated for n=400"
print(Rand(start, end, num))
r=0
print "\nthe sorted random values for n=400"
... | 16.769231 | 79 | 0.583333 |
985f4b03594be452b67e7c760de423b4de2e56ae | 1,297 | py | Python | tests/benchmarks/constructs/OperationIntegerAdd.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | 1 | 2022-01-01T18:29:24.000Z | 2022-01-01T18:29:24.000Z | tests/benchmarks/constructs/OperationIntegerAdd.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | 1 | 2021-06-10T06:47:04.000Z | 2021-06-10T06:47:04.000Z | tests/benchmarks/constructs/OperationIntegerAdd.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... | 30.162791 | 78 | 0.713184 |
494f08265409c4435422c38838fddfa1092c3f52 | 10,892 | py | Python | tests/unit/test_milestones.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_milestones.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | 12 | 2019-11-25T14:08:32.000Z | 2021-06-24T10:35:51.000Z | tests/unit/test_milestones.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | null | null | null | import pytest
from .. import factories as f
from taiga.projects.milestones import services
pytestmark = pytest.mark.django_db(transaction=True)
def test_issues_not_closed():
project = f.ProjectFactory()
f.MembershipFactory.create(project=project, user=project.owner,
is_admin=T... | 40.490706 | 73 | 0.666728 |
ee2b66736d8a7185aaf554ff471bfc5f585c40e6 | 4,406 | py | Python | geo_visual/add_location.py | cloudmesh/xsede-reu-metric | 76defe678bc3795027f1e567ad09fce267ec1884 | [
"Apache-2.0"
] | null | null | null | geo_visual/add_location.py | cloudmesh/xsede-reu-metric | 76defe678bc3795027f1e567ad09fce267ec1884 | [
"Apache-2.0"
] | null | null | null | geo_visual/add_location.py | cloudmesh/xsede-reu-metric | 76defe678bc3795027f1e567ad09fce267ec1884 | [
"Apache-2.0"
] | null | null | null | import csv
class AddLocation:
biblio_file = 'data.csv'
stats_file = 'hd2015.csv'
def __init__(self):
self.get_stats()
self.add_location()
def get_stats(self):
'''create list of dicts of stats from National Center for Education Statistics
'''
print '... | 35.532258 | 216 | 0.453926 |
f0793967caba0c5963aa9a39e62d4ae6e01fc59a | 257 | py | Python | demo/tex2csv_ex.py | ChengzhangZhu/PyTex | 86890517cc45db8a85feed286ec2f66daaaabc11 | [
"MIT"
] | null | null | null | demo/tex2csv_ex.py | ChengzhangZhu/PyTex | 86890517cc45db8a85feed286ec2f66daaaabc11 | [
"MIT"
] | null | null | null | demo/tex2csv_ex.py | ChengzhangZhu/PyTex | 86890517cc45db8a85feed286ec2f66daaaabc11 | [
"MIT"
] | null | null | null | from pytex.latex_tools import table2csv, csv2latex
table2csv('latex_table', head=True, save_name='latex_csv')
table2csv('latex_table', head=True, save_name='chapter_6_results', clean_pattern=[])
csv2latex('latex_csv.csv', head=True, save_name='latex_code') | 51.4 | 84 | 0.797665 |
a6a2785b170c408a7835e731a28c9fb7d82752f3 | 2,574 | py | Python | scripts/us_census/acs5yr/subject_tables/common/resolve_geo_id_test.py | rpatil524/data | 9e76c7f22a75ad4e52522444a080ed3f5c6da7dd | [
"Apache-2.0"
] | null | null | null | scripts/us_census/acs5yr/subject_tables/common/resolve_geo_id_test.py | rpatil524/data | 9e76c7f22a75ad4e52522444a080ed3f5c6da7dd | [
"Apache-2.0"
] | null | null | null | scripts/us_census/acs5yr/subject_tables/common/resolve_geo_id_test.py | rpatil524/data | 9e76c7f22a75ad4e52522444a080ed3f5c6da7dd | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.516129 | 90 | 0.704351 |
b2e3dbd3aa1b34827271b122e70e148612b50df3 | 1,764 | py | Python | stacking/XGB.py | JerryJack121/House_price_regression | dec44b8e393d7c37d710d25bfcf8992c6f9c7629 | [
"MIT"
] | 2 | 2021-01-06T15:19:43.000Z | 2021-01-07T04:07:50.000Z | stacking/XGB.py | JerryJack121/House_price_regression | dec44b8e393d7c37d710d25bfcf8992c6f9c7629 | [
"MIT"
] | null | null | null | stacking/XGB.py | JerryJack121/House_price_regression | dec44b8e393d7c37d710d25bfcf8992c6f9c7629 | [
"MIT"
] | null | null | null | import xgboost as xgb
from xgboost import XGBRegressor
import pandas as pd
from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error
from preprocessing import preprocessing as pre
# 讀取預處理資料
train_val, train_x, val_x, test_x, train_y, val_y, ss_x, ss_y = pre()
# 將資料轉換為xgb格式
trn_data = xgb.DMatrix(t... | 28.918033 | 78 | 0.676871 |
c51b84212c1b8e7ca10e89cde27149fd8b475d02 | 9,438 | py | Python | zktraffic/base/server_message.py | fakeNetflix/twitter-repo-zktraffic | ca036cf85438f190ad091723975c5fc5eec4f00a | [
"Apache-2.0"
] | 159 | 2015-01-12T14:58:36.000Z | 2021-12-22T13:15:49.000Z | zktraffic/base/server_message.py | fakeNetflix/twitter-repo-zktraffic | ca036cf85438f190ad091723975c5fc5eec4f00a | [
"Apache-2.0"
] | 42 | 2015-01-06T03:13:53.000Z | 2020-03-12T17:04:05.000Z | zktraffic/base/server_message.py | LaudateCorpus1/zktraffic | 82db04d9aafa13f694d4f5c7265069db42c0307c | [
"Apache-2.0"
] | 42 | 2015-01-12T14:55:43.000Z | 2022-03-21T01:02:43.000Z | # ==================================================================================================
# Copyright 2014 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 29.961905 | 100 | 0.668044 |
ef2f98f83f14901b9494abe247a01b4bcc150aa8 | 3,927 | py | Python | GraphColoring.py | aGupta97uk/FYP | f604f3e60ebd5126fda73e1ab5d4df40ea55da9c | [
"MIT"
] | null | null | null | GraphColoring.py | aGupta97uk/FYP | f604f3e60ebd5126fda73e1ab5d4df40ea55da9c | [
"MIT"
] | null | null | null | GraphColoring.py | aGupta97uk/FYP | f604f3e60ebd5126fda73e1ab5d4df40ea55da9c | [
"MIT"
] | null | null | null | # Vertex Coloring - Greedy Coloring Heuristic
# Greedy coloring to find optimal colorings in polynomial time.
# Implementing the welsh_powell algorithm
import matplotlib.pyplot as plt
import networkx as nx
from Interface import *
from tkinter import messagebox
def get_gc(self):
graph = my_graph()
col_list = ... | 29.977099 | 116 | 0.66081 |
54b4fb7c73a2ed5b9e5f2ae3d6ead98a66832a22 | 274 | py | Python | tests/farm/html/othersrc/other.py | blueyed/coveragepy | ef21d19ca4fe3fc0c88a1135721f2dfbc60506f3 | [
"Apache-2.0"
] | null | null | null | tests/farm/html/othersrc/other.py | blueyed/coveragepy | ef21d19ca4fe3fc0c88a1135721f2dfbc60506f3 | [
"Apache-2.0"
] | null | null | null | tests/farm/html/othersrc/other.py | blueyed/coveragepy | ef21d19ca4fe3fc0c88a1135721f2dfbc60506f3 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
# A file in another directory. We're checking that it ends up in the
# HTML report.
print("This is the other src!")
| 34.25 | 79 | 0.748175 |
f8c8cb97f36ca033f3bdafc54de8e9fbfd2c36ef | 1,585 | py | Python | wot/commands/trajectory_trends.py | sbrt/wot | cb8e2ef2800a93314067d8ec77b8a337e71a337f | [
"BSD-3-Clause"
] | null | null | null | wot/commands/trajectory_trends.py | sbrt/wot | cb8e2ef2800a93314067d8ec77b8a337e71a337f | [
"BSD-3-Clause"
] | null | null | null | wot/commands/trajectory_trends.py | sbrt/wot | cb8e2ef2800a93314067d8ec77b8a337e71a337f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import wot.io
import wot.tmap
def main(argv):
parser = argparse.ArgumentParser(description='Generate mean expression profiles for ' \
'ancestors and descendants of each trajectory')
parser.add_argu... | 45.285714 | 116 | 0.712303 |
6e51a278796804b49c1f811287697129b8910ef3 | 95 | py | Python | carnival/steps/__init__.py | carnival-org/carnival | f7c272a4841db844fc0b165e94c5d3a76d24109f | [
"MIT"
] | 4 | 2020-05-15T12:32:30.000Z | 2022-02-23T11:00:06.000Z | carnival/steps/__init__.py | a1fred/carnival | 178985cc89a8754bcca6381cf0225892f7795b69 | [
"MIT"
] | null | null | null | carnival/steps/__init__.py | a1fred/carnival | 178985cc89a8754bcca6381cf0225892f7795b69 | [
"MIT"
] | 1 | 2020-01-31T16:59:08.000Z | 2020-01-31T16:59:08.000Z | from carnival.steps.step import Step, InlineStep
__all__ = (
"Step",
"InlineStep",
)
| 11.875 | 48 | 0.652632 |
490e245a08ba59f069463918f40443d32ee00eb1 | 1,891 | py | Python | guild/plugins/skopt_gbrt_main.py | timt51/guildai | 8d3aa9b902e29eb60ebbb408b3a1cbd3f40fcaec | [
"Apache-2.0"
] | 694 | 2018-11-30T01:06:30.000Z | 2022-03-31T14:46:26.000Z | guild/plugins/skopt_gbrt_main.py | timt51/guildai | 8d3aa9b902e29eb60ebbb408b3a1cbd3f40fcaec | [
"Apache-2.0"
] | 323 | 2018-11-05T17:44:34.000Z | 2022-03-31T16:56:41.000Z | guild/plugins/skopt_gbrt_main.py | timt51/guildai | 8d3aa9b902e29eb60ebbb408b3a1cbd3f40fcaec | [
"Apache-2.0"
] | 68 | 2019-04-01T04:24:47.000Z | 2022-02-24T17:22:04.000Z | # Copyright 2017-2021 TensorHub, 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 writ... | 25.90411 | 82 | 0.68588 |
2ac0b6123a23a0d494ed6b1d2b2ab36f85a1ad3a | 893 | py | Python | examples/lifelong_example.py | david-abel/mdps | d8fe6007efb4840377f085a4e35ba89aaa2cdf6d | [
"Apache-2.0"
] | 230 | 2016-08-04T12:59:11.000Z | 2022-03-15T04:14:40.000Z | examples/lifelong_example.py | david-abel/mdps | d8fe6007efb4840377f085a4e35ba89aaa2cdf6d | [
"Apache-2.0"
] | 36 | 2016-08-31T19:31:36.000Z | 2021-11-17T03:58:24.000Z | examples/lifelong_example.py | david-abel/mdps | d8fe6007efb4840377f085a4e35ba89aaa2cdf6d | [
"Apache-2.0"
] | 95 | 2016-08-31T19:10:45.000Z | 2022-03-15T04:15:39.000Z | #!/usr/bin/env python
# Python imports.
import sys
# Other imports
import srl_example_setup
from simple_rl.mdp import MDPDistribution
from simple_rl.tasks import GridWorldMDP, RandomMDP, ChainMDP, TaxiOOMDP, FourRoomMDP
from simple_rl.agents import QLearningAgent, RandomAgent, RMaxAgent
from simple_rl.run_experiments... | 34.346154 | 139 | 0.786114 |
1b5fbfe1d2a69ecdaf75a3d2605622976af63155 | 3,165 | py | Python | data_tidy_up.py | mknittel/fair_hierarchical_clustering | e7f84cb744558f380676101e9d7fc6d019651f92 | [
"MIT"
] | 1 | 2020-10-22T16:39:18.000Z | 2020-10-22T16:39:18.000Z | data_tidy_up.py | mknittel/fair_hierarchical_clustering | e7f84cb744558f380676101e9d7fc6d019651f92 | [
"MIT"
] | null | null | null | data_tidy_up.py | mknittel/fair_hierarchical_clustering | e7f84cb744558f380676101e9d7fc6d019651f92 | [
"MIT"
] | 1 | 2022-01-18T22:24:56.000Z | 2022-01-18T22:24:56.000Z | import numpy as np
import matplotlib.pyplot as plt
import math
if __name__ == "__main__":
output_direc = ". /experiments_random_swap_multi_color"
filename = "adult_4_color.csv"
num_list = [2**k * 100 for k in range(5)]
b = 1
r = 7
num_instances = 5
time_file = "{}/{}_{}_{}_... | 40.576923 | 183 | 0.535861 |
b8fd2eb2016e3a1fc4f4e9e743419614eb347cee | 9,997 | py | Python | nova/api/openstack/placement/handlers/resource_provider.py | bopopescu/nova-8 | 768d7cc0a632e1a880f00c5840c1ec8051e161be | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/placement/handlers/resource_provider.py | bopopescu/nova-8 | 768d7cc0a632e1a880f00c5840c1ec8051e161be | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/placement/handlers/resource_provider.py | bopopescu/nova-8 | 768d7cc0a632e1a880f00c5840c1ec8051e161be | [
"Apache-2.0"
] | 1 | 2020-07-22T21:09:15.000Z | 2020-07-22T21:09:15.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 34.832753 | 79 | 0.671401 |
2c3a8b374aef4a45a6a672fa7b43676b92ad2cc5 | 1,288 | py | Python | scripts/bar_plots.py | asreview-ftm-hackathon/data-preprocessing_toogoodtogo_threatlines | ccc4577e842e558a606e22f81e7c1972196df5ef | [
"MIT"
] | 5 | 2021-11-27T18:03:01.000Z | 2021-12-09T10:30:17.000Z | scripts/bar_plots.py | asreview-ftm-hackathon/data-preprocessing_toogoodtogo_threatlines | ccc4577e842e558a606e22f81e7c1972196df5ef | [
"MIT"
] | 1 | 2021-11-27T10:20:13.000Z | 2021-11-27T10:20:41.000Z | scripts/bar_plots.py | asreview-ftm-hackathon/data-preprocessing_toogoodtogo_threatlines | ccc4577e842e558a606e22f81e7c1972196df5ef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 27 20:06:35 2021
@author: dinterr
"""
"""Main script to preprocess FTM data."""
import load_data
import pandas as pd
df = load_data.get_data(r'../data/processed_data.csv')
df['email_sender'] = df['email_sender'].apply(lambda x: x if len(str(x)) < 60 else None)
ax = df... | 30.666667 | 109 | 0.687888 |
042c4e0e3ea36ed7ab4da15649b520c5185d6255 | 1,930 | py | Python | oggm/shop/geodetic_mb.py | Keeptg/oggm | 7555717abefcb67d9fd6e6480aee7b5d0bb0e025 | [
"BSD-3-Clause"
] | null | null | null | oggm/shop/geodetic_mb.py | Keeptg/oggm | 7555717abefcb67d9fd6e6480aee7b5d0bb0e025 | [
"BSD-3-Clause"
] | null | null | null | oggm/shop/geodetic_mb.py | Keeptg/oggm | 7555717abefcb67d9fd6e6480aee7b5d0bb0e025 | [
"BSD-3-Clause"
] | null | null | null | import os
import shutil
try:
import salem
except ImportError:
pass
from oggm import utils
shean_url = 'https://cluster.klima.uni-bremen.de/~lifei/oggm/dshean_mb/'+\
'shean_hma_glacier_ASTER_WV_2000-2018_dhdt.tif'
hugonnet_url = 'https://services-theia.sedoo.fr/glaciers/data/v1_0/downloadtif/2000-2020'
d... | 32.166667 | 89 | 0.579275 |
eddb9b1828bbe1cfd5bf4155dc3a02f2fbf68185 | 11,358 | py | Python | jorldy/core/agent/vmpo.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | jorldy/core/agent/vmpo.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | jorldy/core/agent/vmpo.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn.functional as F
from torch.distributions import Normal
import numpy as np
from .reinforce import REINFORCE
from core.optimizer import Optimizer
class VMPO(REINFORCE):
"""Maximum A Posteriori Policy Optimization (MPO) agent.
Args:
optim_config (dict): dictionary of the op... | 39.165517 | 111 | 0.530639 |
6425c28ee3c1f88e3521dcd0e38b4c1fd5690e16 | 23,433 | py | Python | dev.py | WillTirone/scipy | 93961a8d27b157064d9af8e36aab8542cd1a6c4d | [
"BSD-3-Clause"
] | null | null | null | dev.py | WillTirone/scipy | 93961a8d27b157064d9af8e36aab8542cd1a6c4d | [
"BSD-3-Clause"
] | null | null | null | dev.py | WillTirone/scipy | 93961a8d27b157064d9af8e36aab8542cd1a6c4d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
dev.py [OPTIONS] [-- ARGS]
Run tests, building the project first with Meson
Examples::
$ python dev.py
$ python dev.py -s {SAMPLE_SUBMODULE}
$ python dev.py -t {SAMPLE_TEST}
$ python dev.py --ipython
$ python dev.py --python somescript.py
$ python dev.py --bench
... | 36.556942 | 90 | 0.57769 |
a1dc97dac67bf80c10d46c11f951d41faff00074 | 683 | py | Python | config/config.py | openregister/server | 070e940ab0b716dcc5cb46a2fe312943af810ee6 | [
"MIT"
] | 2 | 2016-02-11T20:58:58.000Z | 2016-02-18T16:57:45.000Z | config/config.py | openregister/openregister | 070e940ab0b716dcc5cb46a2fe312943af810ee6 | [
"MIT"
] | 4 | 2015-04-02T11:54:04.000Z | 2015-04-07T12:34:02.000Z | config/config.py | openregister/server | 070e940ab0b716dcc5cb46a2fe312943af810ee6 | [
"MIT"
] | 4 | 2016-02-08T22:18:20.000Z | 2021-04-11T08:29:29.000Z | import os
class Config(object):
DEBUG = False
REGISTER_DOMAIN=os.environ['REGISTER_DOMAIN']
MONGO_URI = os.environ.get('MONGOLAB_URI', 'mongodb://127.0.0.1:27017/openregister')
PAGE_SIZE = int(os.environ['PAGE_SIZE'])
SECRET_KEY = os.environ['SECRET_KEY']
GITHUB_ORG = os.environ['GITHUB_ORG']
... | 32.52381 | 92 | 0.729136 |
cfb9de12612dddbe0939c4fa834882ec9d4949f3 | 1,007 | py | Python | venv/lib/python3.7/site-packages/pystan/tests/test_ess.py | vchiapaikeo/prophet | e8c250ca7bfffc280baa7dabc80a2c2d1f72c6a7 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/pystan/tests/test_ess.py | vchiapaikeo/prophet | e8c250ca7bfffc280baa7dabc80a2c2d1f72c6a7 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/pystan/tests/test_ess.py | vchiapaikeo/prophet | e8c250ca7bfffc280baa7dabc80a2c2d1f72c6a7 | [
"MIT"
] | null | null | null | import unittest
import pystan
import pystan.chains
import pystan._chains
from pystan.tests.helper import get_model
# NOTE: This test is fragile because the default sampling algorithm used by Stan
# may change in significant ways.
class TestESS(unittest.TestCase):
@classmethod
def setUpClass(cls):
m... | 35.964286 | 87 | 0.660377 |
b61f17a17e649a2535124bb8c1651c147fcb6585 | 399 | py | Python | smartlyrics/asgi.py | kahunacohen/smartlyrics | 6667ec59d2ea328210d146fa5c8bc92f453134c6 | [
"MIT"
] | null | null | null | smartlyrics/asgi.py | kahunacohen/smartlyrics | 6667ec59d2ea328210d146fa5c8bc92f453134c6 | [
"MIT"
] | null | null | null | smartlyrics/asgi.py | kahunacohen/smartlyrics | 6667ec59d2ea328210d146fa5c8bc92f453134c6 | [
"MIT"
] | null | null | null | """
ASGI config for smartlyrics project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
5d4b3a8be9f928380d358a4cf282b528a40eaa9a | 24,392 | py | Python | pi_mqtt_gpio/server.py | shbatm/pi-mqtt-gpio | 759f5b2ed6259c4e2437f5025e7f1aa50c549943 | [
"MIT"
] | null | null | null | pi_mqtt_gpio/server.py | shbatm/pi-mqtt-gpio | 759f5b2ed6259c4e2437f5025e7f1aa50c549943 | [
"MIT"
] | null | null | null | pi_mqtt_gpio/server.py | shbatm/pi-mqtt-gpio | 759f5b2ed6259c4e2437f5025e7f1aa50c549943 | [
"MIT"
] | 1 | 2021-02-22T07:01:50.000Z | 2021-02-22T07:01:50.000Z | import argparse
import logging
import logging.config
import yaml
import sys
import socket
import ssl
from time import sleep, time
from importlib import import_module
from hashlib import sha1
import threading # For callback functions
from fractions import gcd # for calculating the callback periodic time
from functool... | 34.845714 | 98 | 0.625246 |
490742eb7781bb2df83ef753d4e18ad98b26f570 | 5,146 | py | Python | circus/client.py | BradleyKirton/circus | 28214343e3cd85d8e388b9e58997fc7a1a628a1e | [
"Apache-2.0"
] | 820 | 2015-01-08T10:29:57.000Z | 2022-03-21T08:35:59.000Z | circus/client.py | BradleyKirton/circus | 28214343e3cd85d8e388b9e58997fc7a1a628a1e | [
"Apache-2.0"
] | 357 | 2015-01-02T06:59:47.000Z | 2022-02-09T11:41:42.000Z | circus/client.py | BradleyKirton/circus | 28214343e3cd85d8e388b9e58997fc7a1a628a1e | [
"Apache-2.0"
] | 148 | 2015-01-09T01:54:47.000Z | 2022-03-13T16:13:43.000Z | import errno
import uuid
import zmq
import zmq.utils.jsonapi as json
from zmq.eventloop.zmqstream import ZMQStream
import tornado
from tornado import concurrent
from circus.exc import CallError
from circus.util import DEFAULT_ENDPOINT_DEALER, get_connection, to_bytes
def make_message(command, **props):
return {... | 31.570552 | 78 | 0.57637 |
822fc8d9b6acbb7d6d560785215bf5c68c45f0df | 3,292 | py | Python | venv/Lib/site-packages/matplotlib/docstring.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/matplotlib/docstring.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/matplotlib/docstring.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | import inspect
class Substitution:
"""
A decorator that performs %-substitution on an object's docstring.
This decorator should be robust even if ``obj.__doc__`` is None (for
example, if -OO was passed to the interpreter).
Usage: construct a docstring.Substitution with a sequence or di... | 32.27451 | 79 | 0.632139 |
ee101796362277a6bc02e1549d584911e118da34 | 2,382 | py | Python | scripts/quest/q23612s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/quest/q23612s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/quest/q23612s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | # [Job Advancement] Only the Brave (23612) | Xenon 3rd Job
promathus = 2300002
gelimer = 2154009
beryl = 2159417
bwHat = 1003134
mine = 310040000
sm.setSpeakerID(promathus)
sm.flipDialogue()
sm.sendNext("Ah, there you are. I must speak with you. "
"I don't know if you know this, but #p" + str(gelimer) + "# has not e... | 43.309091 | 118 | 0.723762 |
f5ab154c46b3504504e44a50c6a8fb362f5d905e | 2,186 | py | Python | app/core/tests/test_models.py | denisevseev615/python-protecton-backend | 4fce907fd617d590ed40b6af076002a0d53af317 | [
"MIT"
] | 3 | 2020-01-21T15:41:04.000Z | 2020-02-05T13:54:22.000Z | app/core/tests/test_models.py | denisevseev615/python-protecton-backend | 4fce907fd617d590ed40b6af076002a0d53af317 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | denisevseev615/python-protecton-backend | 4fce907fd617d590ed40b6af076002a0d53af317 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(phone_number='4086432477', password='testpass'):
"""Create a sample user"""
return get_user_model().objects.create_user(phone_number, password)
class ModelTests(TestCase):
def test_c... | 29.945205 | 72 | 0.629918 |
06aa97c4c927a46707fbccd3b2c6a5e3e6a79b19 | 1,994 | py | Python | quickfix_doc/datadictionary/messages.py | connamara/QuickFIX-doc | fa75e27dfada2da12148e9ea67d0ceb6a31f1d46 | [
"DOC"
] | 3 | 2018-12-25T19:49:56.000Z | 2021-07-17T01:41:08.000Z | quickfix_doc/datadictionary/messages.py | connamara/QuickFIX-doc | fa75e27dfada2da12148e9ea67d0ceb6a31f1d46 | [
"DOC"
] | 1 | 2018-12-07T20:53:31.000Z | 2018-12-07T20:53:31.000Z | quickfix_doc/datadictionary/messages.py | connamara/QuickFIX-doc | fa75e27dfada2da12148e9ea67d0ceb6a31f1d46 | [
"DOC"
] | 3 | 2020-05-21T03:07:19.000Z | 2021-07-18T03:07:06.000Z | from . import util
MESSAGE_TAG = 'message'
def parse_messages(msgs, header, trailer):
"""Parse Data Dictionary XML Messages
Arguments:
msgs -- XML document element for messages
header -- Special XML document tag for header message
trailer -- Special XML document tag for trailer message... | 42.425532 | 85 | 0.652959 |
eb0b8cbc6f0086dd0308d201c5a8671ebccad353 | 9,435 | py | Python | models/old/layers/attention.py | ErikHumphrey/sustain-seq2seq | c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4 | [
"Apache-2.0"
] | 4 | 2019-05-09T19:47:48.000Z | 2020-04-11T13:58:31.000Z | models/old/layers/attention.py | ErikHumphrey/sustain-seq2seq | c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4 | [
"Apache-2.0"
] | null | null | null | models/old/layers/attention.py | ErikHumphrey/sustain-seq2seq | c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4 | [
"Apache-2.0"
] | 4 | 2018-12-05T01:52:22.000Z | 2019-11-01T01:01:52.000Z | import torch
import torch.nn as nn
import math
import numpy as np
class AdditiveAttention(nn.Module):
def __init__(self, enc_hidden_dim, dec_hidden_dim):
super(AdditiveAttention, self).__init__()
# attention weights
self.attention_w1 = nn.Linear(enc_hidden_dim, enc_hidden_dim) #s... | 48.384615 | 208 | 0.681293 |
5d80f1d9ab3d9c65210e6479598a5ced4cd82106 | 8,346 | py | Python | oauth2_provider/views/base.py | renzocastillo/django-oauth-toolkit-mongoengine | 166308fa60da4dd5c39072f4c06d6c9c6a5c4193 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | oauth2_provider/views/base.py | renzocastillo/django-oauth-toolkit-mongoengine | 166308fa60da4dd5c39072f4c06d6c9c6a5c4193 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | oauth2_provider/views/base.py | renzocastillo/django-oauth-toolkit-mongoengine | 166308fa60da4dd5c39072f4c06d6c9c6a5c4193 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import logging
from django.http import HttpResponse
from django.views.decorators.debug import sensitive_post_parameters
from django.views.generic import View, FormView
from django.utils import timezone
from django.utils.decorators import method_decorator
from oauthlib.oauth2 import Server
from braces.views import Lo... | 42.8 | 116 | 0.676012 |
f49fff7759956894e22bb69a5cb49d53fc1c9a7a | 866 | py | Python | utils/model_utils.py | jojoon99/Barbershop | f5e837166806c27ce8f94dd96dd888a78640fcda | [
"MIT"
] | 492 | 2021-06-03T01:14:03.000Z | 2022-03-31T12:27:41.000Z | utils/model_utils.py | jojoon99/Barbershop | f5e837166806c27ce8f94dd96dd888a78640fcda | [
"MIT"
] | 30 | 2021-06-05T10:14:35.000Z | 2022-03-15T08:13:33.000Z | utils/model_utils.py | jojoon99/Barbershop | f5e837166806c27ce8f94dd96dd888a78640fcda | [
"MIT"
] | 93 | 2021-06-04T11:08:29.000Z | 2022-03-31T12:06:00.000Z | import gdown
import os
weight_dic = {'afhqwild.pt': 'https://drive.google.com/file/d/14OnzO4QWaAytKXVqcfWo_o2MzoR4ygnr/view?usp=sharing',
'afhqdog.pt': 'https://drive.google.com/file/d/16v6jPtKVlvq8rg2Sdi3-R9qZEVDgvvEA/view?usp=sharing',
'afhqcat.pt': 'https://drive.google.com/file/d/1... | 48.111111 | 116 | 0.700924 |
404e5cecff4c0fd029c50b6ea6219fcd62fd0d67 | 155,313 | py | Python | dask/array/core.py | nbrenow/dask | 18b79bd0ff01f82c678448fa1fac3ae94806e8c6 | [
"BSD-3-Clause"
] | null | null | null | dask/array/core.py | nbrenow/dask | 18b79bd0ff01f82c678448fa1fac3ae94806e8c6 | [
"BSD-3-Clause"
] | null | null | null | dask/array/core.py | nbrenow/dask | 18b79bd0ff01f82c678448fa1fac3ae94806e8c6 | [
"BSD-3-Clause"
] | null | null | null | import math
import operator
import os
import pickle
import re
import sys
import traceback
import uuid
import warnings
from bisect import bisect
from collections.abc import Iterable, Iterator, Mapping
from functools import partial, wraps, reduce
from itertools import product, zip_longest
from numbers import Number, Inte... | 31.800369 | 95 | 0.583699 |
675ed93e3a7862bd66df8423c617cd64637b90da | 2,704 | py | Python | app/core/tests/test_models.py | tgupta21/recipe | 8aa0c89f442a053b61a3035f448efeb3cc926496 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | tgupta21/recipe | 8aa0c89f442a053b61a3035f448efeb3cc926496 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | tgupta21/recipe | 8aa0c89f442a053b61a3035f448efeb3cc926496 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@test.com', password='testpass'):
"""Create a sample user"""
return get_user_model().objects.create_user(email, password)
class ModelTests(Test... | 31.08046 | 71 | 0.637944 |
f18142bee85d8074238759f3a2d51cc2614aa512 | 555 | py | Python | extract_color.py | abhishekchetani/ML_18june | 4a6465259c7d0de0cbdc12c1c9f10dd6f925883d | [
"Apache-2.0"
] | null | null | null | extract_color.py | abhishekchetani/ML_18june | 4a6465259c7d0de0cbdc12c1c9f10dd6f925883d | [
"Apache-2.0"
] | null | null | null | extract_color.py | abhishekchetani/ML_18june | 4a6465259c7d0de0cbdc12c1c9f10dd6f925883d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import cv2
import time
img = cv2.imread("Heels.jpg")
grayimg = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
#print height & width
print img.shape
#pause for 2 seconds
#time.sleep(2)
#print matrix
print img
#time.sleep(2)
#check for red colour & extract it
redheels = cv2.inRange(img,(0,0,0),(40,40,255)... | 15.857143 | 47 | 0.722523 |
5ebed465b2abeeb4354a6ddee420de8ebaab0b7d | 14,526 | py | Python | aide-cli.py | OleksiiOleksenko/aide | 50927955800684b242ab069cb358ef9bf57d75e0 | [
"MIT"
] | null | null | null | aide-cli.py | OleksiiOleksenko/aide | 50927955800684b242ab069cb358ef9bf57d75e0 | [
"MIT"
] | null | null | null | aide-cli.py | OleksiiOleksenko/aide | 50927955800684b242ab069cb358ef9bf57d75e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Command-line interface to Aide
"""
import datetime
import logging
import re
import sqlite3
from argparse import ArgumentParser, ArgumentTypeError
import core
import rpg_mod
def get_arguments():
"""
Parse command line arguments
:return Namespace: parsed arguments
"""
pa... | 29.404858 | 119 | 0.536004 |
fd53e3dc478508d65c438b1a29a47b090d4ffbe0 | 6,254 | py | Python | ann/linear_regression.py | yt7589/aqp | c9c1c79facdea7ace73e2421e8a5868d87fb58dd | [
"Apache-2.0"
] | null | null | null | ann/linear_regression.py | yt7589/aqp | c9c1c79facdea7ace73e2421e8a5868d87fb58dd | [
"Apache-2.0"
] | null | null | null | ann/linear_regression.py | yt7589/aqp | c9c1c79facdea7ace73e2421e8a5868d87fb58dd | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function
import numpy as np
import pathlib
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
class PrintDot(keras.callbacks.Callback):
def on_epoc... | 39.582278 | 107 | 0.594979 |
6604e7dc3b32da2e15ecbcb662193769fd4aa264 | 3,543 | py | Python | pose_estimation/configs/top_down/hourglass/mpii/hourglass52_mpii_384x384.py | AK391/UniFormer | 22c6b3b98b68236dda6a8fa7152a32af1af62a20 | [
"MIT"
] | 367 | 2022-01-14T03:32:25.000Z | 2022-03-31T04:48:20.000Z | pose_estimation/configs/top_down/hourglass/mpii/hourglass52_mpii_384x384.py | hadlang/UniFormer | e8024703bffb89cb7c7d09e0d774a0d2a9f96c25 | [
"MIT"
] | 27 | 2022-01-27T07:12:49.000Z | 2022-03-31T04:31:13.000Z | pose_estimation/configs/top_down/hourglass/mpii/hourglass52_mpii_384x384.py | hadlang/UniFormer | e8024703bffb89cb7c7d09e0d774a0d2a9f96c25 | [
"MIT"
] | 53 | 2022-01-18T11:21:43.000Z | 2022-03-31T06:42:41.000Z | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=5, create_symlink=False)
evaluation = dict(interval=10, metric='PCKh', key_indicator='PCKh')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(gr... | 27.465116 | 79 | 0.639571 |
cb61969feb474cc9d0f4f1a73536fbff5c70082b | 5,412 | py | Python | src/pyhf/utils.py | gradhep/pyhf | 5b27f6357b5228ec610639a37c0e80d278d9abff | [
"Apache-2.0"
] | null | null | null | src/pyhf/utils.py | gradhep/pyhf | 5b27f6357b5228ec610639a37c0e80d278d9abff | [
"Apache-2.0"
] | null | null | null | src/pyhf/utils.py | gradhep/pyhf | 5b27f6357b5228ec610639a37c0e80d278d9abff | [
"Apache-2.0"
] | null | null | null | import json
import jsonschema
import pkg_resources
from pathlib import Path
import yaml
import click
import hashlib
from .exceptions import InvalidSpecification
SCHEMA_CACHE = {}
SCHEMA_BASE = "https://scikit-hep.org/pyhf/schemas/"
SCHEMA_VERSION = '1.0.0'
def load_schema(schema_id, version=None):
global SCHEMA... | 32.8 | 624 | 0.649667 |
4728408eb1b9526a797d14f63d795d17c1fc058b | 736 | py | Python | examples/inout/inout.py | makkus/asyncclick | 1dd3721055b8936c0c35a0b4f10735eb82cd097f | [
"BSD-3-Clause"
] | null | null | null | examples/inout/inout.py | makkus/asyncclick | 1dd3721055b8936c0c35a0b4f10735eb82cd097f | [
"BSD-3-Clause"
] | null | null | null | examples/inout/inout.py | makkus/asyncclick | 1dd3721055b8936c0c35a0b4f10735eb82cd097f | [
"BSD-3-Clause"
] | null | null | null | import asyncclick as click
@click.command()
@click.argument('input', type=click.File('rb'), nargs=-1)
@click.argument('output', type=click.File('wb'))
def cli(input, output):
"""This script works similar to the Unix `cat` command but it writes
into a specific file (which could be the standard output as denote... | 23.741935 | 74 | 0.576087 |
5a7ea0e3071636c561482e82d0694f6cc7e7e8cd | 4,176 | py | Python | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/jobs_operations.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/jobs_operations.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/jobs_operations.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 43.051546 | 155 | 0.662117 |
9234540189003e062ef847b605d351195e3ee12e | 1,688 | py | Python | _notebooks/lime_image/datamodule.py | tugot17/data-science-blog | 2e06a91b40c920ca5fac6b4b08c6209e7d90ed3a | [
"Apache-2.0"
] | 3 | 2021-05-18T07:16:00.000Z | 2022-02-08T06:43:46.000Z | _notebooks/lime_image/datamodule.py | tugot17/data-science-blog | 2e06a91b40c920ca5fac6b4b08c6209e7d90ed3a | [
"Apache-2.0"
] | 1 | 2021-09-28T05:32:43.000Z | 2021-09-28T05:32:43.000Z | _notebooks/lime_image/datamodule.py | tugot17/data-science-blog | 2e06a91b40c920ca5fac6b4b08c6209e7d90ed3a | [
"Apache-2.0"
] | 2 | 2021-07-22T17:21:20.000Z | 2022-02-07T09:36:39.000Z | import albumentations as A
from os.path import join, dirname, realpath
import pytorch_lightning as pl
from albumentations.pytorch import ToTensorV2
from torch.utils.data import DataLoader
from torchvision.transforms import transforms
from lime_image.dataset import HuskyWolfDataset
class HuskyWolfDataModule(pl.Light... | 40.190476 | 100 | 0.679502 |
da87795eb964d1f67e3c4b2cfdfb0698c9b0687a | 548 | py | Python | attendees/users/migrations/0002_user_organization.py | xjlin0/attendees | 3c337ee68c00f17cbbbe26f2e33131e57850e4ed | [
"MIT"
] | 1 | 2020-03-26T00:42:04.000Z | 2020-03-26T00:42:04.000Z | attendees/users/migrations/0002_user_organization.py | xjlin0/attendees | 3c337ee68c00f17cbbbe26f2e33131e57850e4ed | [
"MIT"
] | null | null | null | attendees/users/migrations/0002_user_organization.py | xjlin0/attendees | 3c337ee68c00f17cbbbe26f2e33131e57850e4ed | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-02-19 03:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('whereabouts', '0001_organization'),
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
... | 27.4 | 177 | 0.638686 |
e3e558f8bad44cab47267cd6d9f31d493f360f6a | 697 | py | Python | setup.py | tw7613781/ssdp_upnp | 20a1a0713706772b7af49c8d806c1f4e8fb54ed0 | [
"MIT"
] | 8 | 2018-11-23T12:04:48.000Z | 2021-11-09T12:28:01.000Z | setup.py | tw7613781/ssdp_upnp | 20a1a0713706772b7af49c8d806c1f4e8fb54ed0 | [
"MIT"
] | null | null | null | setup.py | tw7613781/ssdp_upnp | 20a1a0713706772b7af49c8d806c1f4e8fb54ed0 | [
"MIT"
] | 4 | 2020-09-25T01:29:25.000Z | 2022-02-16T09:51:54.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="ssdp_upnp",
version="0.1.0",
author="tw7613781",
author_email="tw7613781@gmail.com",
description="ssdp server and client of upnp",
long_description=long_description,
long_descripti... | 27.88 | 50 | 0.642755 |
adc36997dc2cde722bbc64040f44901de0d2114b | 208 | py | Python | e24PaymentPipe/exceptions.py | burhan/e24PaymentPipe | ad4407558bfb62b9f8d6a9f355a123515565f165 | [
"BSD-3-Clause"
] | 6 | 2015-07-05T14:52:21.000Z | 2021-09-27T13:48:28.000Z | e24PaymentPipe/exceptions.py | burhan/e24PaymentPipe | ad4407558bfb62b9f8d6a9f355a123515565f165 | [
"BSD-3-Clause"
] | 74 | 2016-01-04T07:53:46.000Z | 2022-03-27T18:56:17.000Z | e24PaymentPipe/exceptions.py | burhan/e24PaymentPipe | ad4407558bfb62b9f8d6a9f355a123515565f165 | [
"BSD-3-Clause"
] | 6 | 2016-03-13T07:58:10.000Z | 2021-03-29T18:01:18.000Z | __author__ = 'burhan'
class ErrorUrlMissing(Exception):
pass
class ResponseUrlMissing(Exception):
pass
class AmountGreaterThanZero(Exception):
pass
class GatewayError(Exception):
pass
| 11.555556 | 39 | 0.740385 |
a0a9f63f9b3f638f284c1ac36dc638d7754d3a3a | 2,271 | py | Python | code/genetic_salesman_analysis.py | laurencee9/Symposium_optimization | 8d70111c3269f749fc4379023d7103be3091f2a0 | [
"MIT"
] | null | null | null | code/genetic_salesman_analysis.py | laurencee9/Symposium_optimization | 8d70111c3269f749fc4379023d7103be3091f2a0 | [
"MIT"
] | null | null | null | code/genetic_salesman_analysis.py | laurencee9/Symposium_optimization | 8d70111c3269f749fc4379023d7103be3091f2a0 | [
"MIT"
] | null | null | null | #! /usr/local/bin/python3.4
# -*- coding: utf-8 -*-
"""
Description : Analyse the distance / shortest path for the salesman
problem.
Author: Guillaume St-Onge
Version 1.0
Date : 25/04/2016
"""
#----------------
#Import Modules
#----------------
import numpy as np
import matplotlib.pyplot as plt
from os import... | 30.28 | 111 | 0.687362 |
67f5c944bd92dc30022f2d9196476ec0148158b1 | 13,518 | py | Python | NeuroMechFly/experiments/network_optimization/multiobj_optimization.py | NeLy-EPFL/NeuroMechFly | 69f9e2d86caac561a50e3e060d007dd50a20d481 | [
"Apache-2.0"
] | 12 | 2021-05-07T15:27:11.000Z | 2022-01-29T04:26:36.000Z | NeuroMechFly/experiments/network_optimization/multiobj_optimization.py | NeLy-EPFL/NeuroMechFly | 69f9e2d86caac561a50e3e060d007dd50a20d481 | [
"Apache-2.0"
] | 15 | 2021-05-07T14:58:04.000Z | 2021-11-10T21:30:58.000Z | NeuroMechFly/experiments/network_optimization/multiobj_optimization.py | NeLy-EPFL/NeuroMechFly | 69f9e2d86caac561a50e3e060d007dd50a20d481 | [
"Apache-2.0"
] | 1 | 2022-01-13T16:08:49.000Z | 2022-01-13T16:08:49.000Z | """ Drosophila Evolution. """
import logging
import os
from pathlib import Path
import pkgutil
import random
import yaml
from typing import Tuple
from typing import Tuple
import numpy as np
from jmetal.core.observer import Observer
from jmetal.core.problem import DynamicProblem, FloatProblem
from jmetal.core.solution... | 34.050378 | 106 | 0.535434 |
0ac91dddffb7fadcdf5c8a73593d970069ad9f36 | 1,467 | py | Python | polymorphism_and_magic_methods/groups.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | 1 | 2021-05-27T07:59:17.000Z | 2021-05-27T07:59:17.000Z | polymorphism_and_magic_methods/groups.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | null | null | null | polymorphism_and_magic_methods/groups.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | null | null | null | class Person:
def __init__(self, name, surname):
self.name = name
self.surname = surname
def __add__(self, other):
return Person(name=self.name, surname=other.surname)
def __str__(self):
return f"{self.name} {self.surname}"
class Group:
def __init__(self, name, people... | 26.196429 | 90 | 0.660532 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.