hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73d2bacf75a73ba0bac5889825333c997f9278cb | 8,438 | py | Python | fanficfare/adapters/adapter_thealphagatecom.py | davidferguson/FanFicUpload | dcc3010b9c35c6d0e479cfc2aa07d951d280d9b2 | [
"Apache-2.0"
] | 1 | 2019-06-13T11:20:33.000Z | 2019-06-13T11:20:33.000Z | fanficfare/adapters/adapter_thealphagatecom.py | davidferguson/FanFicUpload | dcc3010b9c35c6d0e479cfc2aa07d951d280d9b2 | [
"Apache-2.0"
] | null | null | null | fanficfare/adapters/adapter_thealphagatecom.py | davidferguson/FanFicUpload | dcc3010b9c35c6d0e479cfc2aa07d951d280d9b2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012 Fanficdownloader team, 2015 FanFicFare team
#
# 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
#
# Un... | 39.246512 | 157 | 0.600735 |
73d2c280cd5a67722e9eb67061b6c744a5188574 | 22,362 | py | Python | ChildTuning/run_glue.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | 15 | 2021-10-02T16:27:54.000Z | 2022-03-13T13:48:38.000Z | ChildTuning/run_glue.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | 1 | 2021-10-04T04:02:33.000Z | 2021-10-08T02:17:40.000Z | ChildTuning/run_glue.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | 2 | 2021-10-02T16:27:56.000Z | 2021-11-23T15:35:13.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team. 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 r... | 43.675781 | 119 | 0.656873 |
73d2de46d782e69b2f4a5c6e163b6f75eb4f82f7 | 437 | py | Python | alipay/aop/api/response/AlipayMerchantAuthCreateResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayMerchantAuthCreateResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayMerchantAuthCreateResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMerchantAuthCreateResponse(AlipayResponse):
def __init__(self):
super(AlipayMerchantAuthCreateResponse, self).__init__()
def parse_response_content(self, response... | 27.3125 | 105 | 0.778032 |
73d2f073d8dfa78b96ca183a5b7669104ab578df | 3,881 | py | Python | botocore/__init__.py | Craigspaz/botocore | 4eae914d8bfab979082c1b4d71a317e3081246c4 | [
"Apache-2.0"
] | null | null | null | botocore/__init__.py | Craigspaz/botocore | 4eae914d8bfab979082c1b4d71a317e3081246c4 | [
"Apache-2.0"
] | null | null | null | botocore/__init__.py | Craigspaz/botocore | 4eae914d8bfab979082c1b4d71a317e3081246c4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http... | 38.81 | 78 | 0.703685 |
73d31c5a3b6803306061f620b7aa307fb6ae95e1 | 814 | py | Python | django_joblog/impl/JobLoggerContext.py | defgsus/django-joblog | 88467f951d7ebc586c69e421cab39e4caa395cca | [
"MIT"
] | null | null | null | django_joblog/impl/JobLoggerContext.py | defgsus/django-joblog | 88467f951d7ebc586c69e421cab39e4caa395cca | [
"MIT"
] | null | null | null | django_joblog/impl/JobLoggerContext.py | defgsus/django-joblog | 88467f951d7ebc586c69e421cab39e4caa395cca | [
"MIT"
] | null | null | null | # encoding=utf-8
from __future__ import unicode_literals
from .JobLoggerBase import JobLoggerBase
class JobLoggerContext(object):
"""
Scoped context change for a Logger instance
with JobLogger("my_task") as log:
with JobLoggerContext(log, "subtask_1"):
the_task_1(log)
with Jo... | 25.4375 | 55 | 0.63145 |
73d332ca5d8366634ead080b5ab50ded026f2a86 | 5,380 | py | Python | asposewordscloud/models/run_insert.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | asposewordscloud/models/run_insert.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | asposewordscloud/models/run_insert.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="run_insert.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this s... | 34.487179 | 85 | 0.564498 |
73d369575cbd3a6df67a1650635faa4a60b17f2d | 194 | py | Python | rootfs/drycc/__init__.py | hanlucen/controller | 2be591d44508bbca8058d3f856d10d425fa4f519 | [
"MIT"
] | null | null | null | rootfs/drycc/__init__.py | hanlucen/controller | 2be591d44508bbca8058d3f856d10d425fa4f519 | [
"MIT"
] | 19 | 2020-07-30T06:31:29.000Z | 2022-03-14T07:33:44.000Z | rootfs/drycc/__init__.py | hanlucen/controller | 2be591d44508bbca8058d3f856d10d425fa4f519 | [
"MIT"
] | 9 | 2020-07-30T02:50:12.000Z | 2020-12-11T06:44:19.000Z | """
The Drycc main package, including the top-level URLs, Django project
settings, and WSGI setup. Most application domain-specific code lives in
the api, provider, cm, and web Django apps.
"""
| 32.333333 | 72 | 0.762887 |
73d3798dc28fea71c68d8b8f984f89209322ecc7 | 9,947 | py | Python | packages/main/src/RPA/Twitter.py | FormulatedAutomation/rpaframework | 7704d20540fe5ada0c10bd48605afb5d4697b497 | [
"Apache-2.0"
] | null | null | null | packages/main/src/RPA/Twitter.py | FormulatedAutomation/rpaframework | 7704d20540fe5ada0c10bd48605afb5d4697b497 | [
"Apache-2.0"
] | null | null | null | packages/main/src/RPA/Twitter.py | FormulatedAutomation/rpaframework | 7704d20540fe5ada0c10bd48605afb5d4697b497 | [
"Apache-2.0"
] | 1 | 2021-02-11T21:00:11.000Z | 2021-02-11T21:00:11.000Z | from dataclasses import dataclass
import datetime
import logging
from robot.libraries.BuiltIn import (
BuiltIn,
RobotNotRunningError,
)
import tweepy
from tweepy.error import TweepError
from RPA.core.helpers import required_env, required_param
from RPA.core.notebook import notebook_json
from RPA.RobotLogListen... | 33.60473 | 80 | 0.57173 |
73d38e1c53f707081801c7b89de1b052f3155d63 | 5,734 | py | Python | plugins/sys_plugin/sys_plugin.py | crossin/yuan-xin | 1c28ef77671293f5e3d40d663f586753a82bbf8b | [
"MIT"
] | null | null | null | plugins/sys_plugin/sys_plugin.py | crossin/yuan-xin | 1c28ef77671293f5e3d40d663f586753a82bbf8b | [
"MIT"
] | null | null | null | plugins/sys_plugin/sys_plugin.py | crossin/yuan-xin | 1c28ef77671293f5e3d40d663f586753a82bbf8b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from micolog_plugin import *
import logging,re
from google.appengine.api import mail
from model import *
from google.appengine.api import users
from base import BaseRequestHandler,urldecode
from google.appengine.ext.webapp import template
SBODY='''New comment on your post "%(title)s"
... | 35.614907 | 115 | 0.681025 |
73d3a8026ce989fb16c63ee04b869da39d0e4c9d | 1,419 | py | Python | node_functions.py | DigiDigi/cerulean_editor | 4a11e5e4b0c3e846270a5162a0b9ce544d2fce4e | [
"MIT"
] | null | null | null | node_functions.py | DigiDigi/cerulean_editor | 4a11e5e4b0c3e846270a5162a0b9ce544d2fce4e | [
"MIT"
] | null | null | null | node_functions.py | DigiDigi/cerulean_editor | 4a11e5e4b0c3e846270a5162a0b9ce544d2fce4e | [
"MIT"
] | null | null | null | import torch
from constants import *
imports = ('torch') # These are Imports for any functions that exists in the sidebar. Written top level.
functions = dict()
noncalling = set() # Non-functions.
# WIP: The ones I have here are for testing and should actually be functions.
functions[CONT_CLASS] = None
functions[T... | 24.894737 | 105 | 0.777308 |
73d3b04ea892a584256077a2115e9da10bb07747 | 2,339 | py | Python | minihack/envs/lab.py | mohamadmansourX/minihack | 3238bf4892ada8aecfe2e71fb493957f7e06b2d8 | [
"Apache-2.0"
] | 1 | 2021-11-19T01:51:38.000Z | 2021-11-19T01:51:38.000Z | minihack/envs/lab.py | mohamadmansourX/minihack | 3238bf4892ada8aecfe2e71fb493957f7e06b2d8 | [
"Apache-2.0"
] | null | null | null | minihack/envs/lab.py | mohamadmansourX/minihack | 3238bf4892ada8aecfe2e71fb493957f7e06b2d8 | [
"Apache-2.0"
] | 1 | 2021-11-17T15:45:02.000Z | 2021-11-17T15:45:02.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
from minihack import MiniHackNavigation, LevelGenerator
from gym.envs import registration
class MiniHackLabyrinth(MiniHackNavigation):
def __init__(self, *args, **kwargs):
map = """
-------------------------------------
|.................|.|................. | 28.180723 | 75 | 0.351432 |
73d3d62f790375c18ac9e34cf96915e5c4330ce4 | 1,045 | py | Python | codegeneration/code_manip/snake_case_vs_CamelCase.py | sacceus/BabylonCpp | 94669cf7cbe3214ec6e905cbf249fa0c9daf6222 | [
"Apache-2.0"
] | 277 | 2017-05-18T08:27:10.000Z | 2022-03-26T01:31:37.000Z | codegeneration/code_manip/snake_case_vs_CamelCase.py | sacceus/BabylonCpp | 94669cf7cbe3214ec6e905cbf249fa0c9daf6222 | [
"Apache-2.0"
] | 77 | 2017-09-03T15:35:02.000Z | 2022-03-28T18:47:20.000Z | codegeneration/code_manip/snake_case_vs_CamelCase.py | sacceus/BabylonCpp | 94669cf7cbe3214ec6e905cbf249fa0c9daf6222 | [
"Apache-2.0"
] | 37 | 2017-03-30T03:36:24.000Z | 2022-01-28T08:28:36.000Z | from types import *
def ToCamelCase(snake_case: str) -> str:
items = snake_case.split("_")
def UpperFirstLetter(word):
if len(word) == 0:
return ""
return word[:1].upper() + word[1:]
itemsCamel = map(UpperFirstLetter, items)
r = "".join(itemsCamel)
return r
def to... | 28.243243 | 81 | 0.576077 |
73d3f93030fe33f3f12155dd2b91464c327544ab | 346 | py | Python | CritsAndCoffee.Quant.API/API_Quant/config.py | srwagsta/critsAndCoffee2.0 | 4d2042b91675c50c2b6938c1e1863f873c80d391 | [
"Apache-1.1"
] | null | null | null | CritsAndCoffee.Quant.API/API_Quant/config.py | srwagsta/critsAndCoffee2.0 | 4d2042b91675c50c2b6938c1e1863f873c80d391 | [
"Apache-1.1"
] | 10 | 2020-07-16T23:43:12.000Z | 2022-03-02T03:52:43.000Z | CritsAndCoffee.Quant.API/API_Quant/config.py | srwagsta/critsAndCoffee2.0 | 4d2042b91675c50c2b6938c1e1863f873c80d391 | [
"Apache-1.1"
] | null | null | null | import os
DEBUG = True
SECRET_KEY = os.environ['QUANT_API_SECRET_KEY']
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = False
QUANDL_API_KEY = os.environ['QUANDL_API_KEY']
ACCEPTED_SCOPE_SET = set([x.strip().lower() for x in
(os.environ.get('ACCEPT_TOK... | 24.714286 | 78 | 0.710983 |
73d4592aa3a5af656bfa2c6ef340e618742d5444 | 15,821 | py | Python | pfdicom_tagSub/pfdicom_tagSub.py | reddigari/pfdicom_tagSub | 0eb8f7be164f6f59db35b18ab94b25b887b8163e | [
"Apache-2.0"
] | null | null | null | pfdicom_tagSub/pfdicom_tagSub.py | reddigari/pfdicom_tagSub | 0eb8f7be164f6f59db35b18ab94b25b887b8163e | [
"Apache-2.0"
] | null | null | null | pfdicom_tagSub/pfdicom_tagSub.py | reddigari/pfdicom_tagSub | 0eb8f7be164f6f59db35b18ab94b25b887b8163e | [
"Apache-2.0"
] | null | null | null | # Turn off all logging for modules in this libary.
import logging
logging.disable(logging.CRITICAL)
# System imports
import os
import getpass
import argparse
import json
import pprint
import csv
import re
# Project specific imports
import pfmisc
from pfmisc._colors ... | 36.203661 | 88 | 0.501422 |
73d45d5f9cade3a3177d5e94521e7b925015fe91 | 14,208 | py | Python | src/google_ads.py | Hojland/paid-media-db-ingestion | 051b4f86796b1b7bcefc4aa361dc9c98f0cac69e | [
"MIT"
] | null | null | null | src/google_ads.py | Hojland/paid-media-db-ingestion | 051b4f86796b1b7bcefc4aa361dc9c98f0cac69e | [
"MIT"
] | null | null | null | src/google_ads.py | Hojland/paid-media-db-ingestion | 051b4f86796b1b7bcefc4aa361dc9c98f0cac69e | [
"MIT"
] | null | null | null | import os
import sys
import re
import pandas as pd
import functools
from datetime import datetime, timedelta
from sqlalchemy.types import String, DateTime, Numeric
from google_auth_oauthlib.flow import InstalledAppFlow
from google.ads.google_ads.client import GoogleAdsClient
from google.ads.google_ads.errors import G... | 52.428044 | 202 | 0.725507 |
73d4af8ee40df72c2719aface0750233de0175ed | 938 | py | Python | demo/yaml_api_usage.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 5 | 2018-09-25T05:49:49.000Z | 2021-12-30T11:06:09.000Z | demo/yaml_api_usage.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 3 | 2018-04-01T04:27:21.000Z | 2019-01-03T11:02:33.000Z | demo/yaml_api_usage.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 7 | 2018-09-25T05:49:51.000Z | 2021-12-30T11:06:11.000Z | # -*- encoding: utf-8 -*-
'''
Current module: demo.yaml_api_usage
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: lkf20031988@163.com
RCS: demo.yaml_api_usage,v 1.0 20... | 30.258065 | 117 | 0.527719 |
73d4b5bbe6797533fa75ac0c8a8d17a0171bf2ef | 6,744 | py | Python | HttpRunnerManager/settings.py | wishchen/HttpRunnerManager | 1e72baa8a84ca70124af908ac683bf88b869d48a | [
"MIT"
] | null | null | null | HttpRunnerManager/settings.py | wishchen/HttpRunnerManager | 1e72baa8a84ca70124af908ac683bf88b869d48a | [
"MIT"
] | null | null | null | HttpRunnerManager/settings.py | wishchen/HttpRunnerManager | 1e72baa8a84ca70124af908ac683bf88b869d48a | [
"MIT"
] | null | null | null | """
Django settings for HttpRunnerManager project.
Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
... | 30.107143 | 113 | 0.626928 |
73d4c79daf334a7f4f508c00d2bf84d468cac437 | 2,902 | py | Python | mialab/filtering/filter.py | mrunibe/MIALab | 82d3f0f4344620fd22384108b022730cde9c7215 | [
"Apache-2.0"
] | 2 | 2018-12-05T09:03:28.000Z | 2019-01-02T15:31:35.000Z | mialab/filtering/filter.py | riedj1/MIALab | 82d3f0f4344620fd22384108b022730cde9c7215 | [
"Apache-2.0"
] | null | null | null | mialab/filtering/filter.py | riedj1/MIALab | 82d3f0f4344620fd22384108b022730cde9c7215 | [
"Apache-2.0"
] | 1 | 2018-10-20T21:27:55.000Z | 2018-10-20T21:27:55.000Z | """This module contains classes to set up a filtering pipeline.
All modules in the filter package implement the basic IFilter interface and can be used to set up a pipeline.
"""
from abc import ABCMeta, abstractmethod
from typing import List
import SimpleITK as sitk
class IFilterParams(metaclass=ABCMeta):
"""Re... | 29.313131 | 109 | 0.614404 |
73d4cfc5fb2cef7e4acb68e1421f00b962c28b1b | 184 | py | Python | binarysearch.io/332_narcissistic_numbers.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | binarysearch.io/332_narcissistic_numbers.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | binarysearch.io/332_narcissistic_numbers.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | class Solution:
def solve(self, n):
n1 = str(n)
l = len(n1)
s = 0
for i in n1:
s += int(i)**l
return n == s
| 18.4 | 27 | 0.336957 |
73d4d62614de8e367e4b5893a5d04367f2faf7ae | 13,348 | py | Python | SinGAN/util/imresize.py | cbosoft/SinGAN | c3c950ddf59ae57e4685adc555f5cb4723bd7e78 | [
"MIT"
] | null | null | null | SinGAN/util/imresize.py | cbosoft/SinGAN | c3c950ddf59ae57e4685adc555f5cb4723bd7e78 | [
"MIT"
] | null | null | null | SinGAN/util/imresize.py | cbosoft/SinGAN | c3c950ddf59ae57e4685adc555f5cb4723bd7e78 | [
"MIT"
] | null | null | null | # This code was taken from: https://github.com/assafshocher/resizer by Assaf Shocher
from math import pi
import warnings
import numpy as np
from scipy.ndimage import filters, measurements, interpolation
from skimage import color
import torch
warnings.filterwarnings('ignore', message='The behavior of rgb2gray will cha... | 46.508711 | 120 | 0.687818 |
73d4f15e0acc1028450667f025a7b28781a8f79b | 29,560 | py | Python | astronomaly/data_management/image_reader.py | nmcardoso/astronomaly | 28c6a7ced2e1553de463a74fc3a19635e45ae548 | [
"BSD-3-Clause"
] | 48 | 2019-11-22T14:41:59.000Z | 2022-03-23T01:48:59.000Z | astronomaly/data_management/image_reader.py | nmcardoso/astronomaly | 28c6a7ced2e1553de463a74fc3a19635e45ae548 | [
"BSD-3-Clause"
] | 12 | 2021-02-23T15:35:29.000Z | 2022-01-26T09:48:35.000Z | astronomaly/data_management/image_reader.py | nmcardoso/astronomaly | 28c6a7ced2e1553de463a74fc3a19635e45ae548 | [
"BSD-3-Clause"
] | 6 | 2019-11-27T10:02:43.000Z | 2021-10-11T02:18:06.000Z | from astropy.io import fits
from astropy.wcs import WCS
import numpy as np
import os
import tracemalloc
import pandas as pd
import matplotlib as mpl
import io
from skimage.transform import resize
import cv2
from astronomaly.base.base_dataset import Dataset
from astronomaly.base import logging_tools
mpl.use('Agg')
from ... | 37.752235 | 95 | 0.54753 |
73d50c87d34d80b156caf768a4918e624d67a76b | 8,764 | py | Python | SCRAPE/Lib/site-packages/IPython/core/tests/test_history.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 2 | 2022-02-26T11:19:40.000Z | 2022-03-28T08:23:25.000Z | SCRAPE/Lib/site-packages/IPython/core/tests/test_history.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/IPython/core/tests/test_history.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2022-03-28T09:19:34.000Z | 2022-03-28T09:19:34.000Z | # coding: utf-8
"""Tests for the IPython tab-completion machinery.
"""
#-----------------------------------------------------------------------------
# Module imports
#-----------------------------------------------------------------------------
# stdlib
import io
import sqlite3
import sys
import tempfile
from datetim... | 38.104348 | 86 | 0.544158 |
73d5a4670f503af92974e8f36a56af383738ce32 | 1,103 | py | Python | yanghui/704Binary_search.py | technologyMz/ALL_IN_ML | bb63fdd9b98adead316c7f6d8e57742bd0a469df | [
"Apache-2.0"
] | 3 | 2021-01-04T13:08:13.000Z | 2021-08-12T13:08:23.000Z | yanghui/704Binary_search.py | technologyMz/ALL_IN_ML | bb63fdd9b98adead316c7f6d8e57742bd0a469df | [
"Apache-2.0"
] | null | null | null | yanghui/704Binary_search.py | technologyMz/ALL_IN_ML | bb63fdd9b98adead316c7f6d8e57742bd0a469df | [
"Apache-2.0"
] | 1 | 2021-01-04T13:13:14.000Z | 2021-01-04T13:13:14.000Z | def search( nums, target) -> int:
if len(nums) == 0:
return -1
def compare(input_list, target, start, end):
print(start, end)
if start > end: #等于的情况,可能就是middle_index值=target的情况
return -1
middle_index = int(start+(end-start)/2)
if input_list[middle_index] ==... | 30.638889 | 71 | 0.574796 |
73d5cf0b5988fbdeeeb7ce4625bbc15a9f618c1c | 1,257 | py | Python | alipay/aop/api/domain/MaterialModifyInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/MaterialModifyInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/MaterialModifyInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"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 MaterialModifyInfo(object):
def __init__(self):
self._content = None
self._type = None
@property
def content(self):
return self._content
@content.setter
... | 22.446429 | 65 | 0.546539 |
73d5ed660753e639202704b771944179e228ee84 | 75 | py | Python | src/gedml/core/metrics/similarity_metrics/__init__.py | wangck20/GeDML | 1f76ac2094d7b88be7fd4eb6145e5586e547b9ca | [
"MIT"
] | 25 | 2021-09-06T13:26:02.000Z | 2022-01-06T13:25:24.000Z | src/gedml/core/metrics/similarity_metrics/__init__.py | wangck20/GeDML | 1f76ac2094d7b88be7fd4eb6145e5586e547b9ca | [
"MIT"
] | 1 | 2021-09-09T08:29:29.000Z | 2021-09-13T15:05:59.000Z | src/gedml/core/metrics/similarity_metrics/__init__.py | wangck20/GeDML | 1f76ac2094d7b88be7fd4eb6145e5586e547b9ca | [
"MIT"
] | 2 | 2021-09-07T08:44:41.000Z | 2021-09-09T08:31:55.000Z | from .cosine_metric import CosineMetric
from .moco_metric import MoCoMetric | 37.5 | 39 | 0.88 |
73d60532ac7e4949a9eeafd7495b11475c281857 | 7,073 | py | Python | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_operation_results_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_operation_results_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_operation_results_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 42.866667 | 291 | 0.692634 |
73d6122d7576d8e2c87dc32902b60298067312f1 | 1,551 | py | Python | project/user/views.py | fv316/flask-template-project | 026459b299c7aa4d82c2b59b98e3c929b4786a78 | [
"MIT"
] | 9 | 2017-02-08T21:42:15.000Z | 2021-12-15T05:18:18.000Z | project/user/views.py | fv316/flask-template-project | 026459b299c7aa4d82c2b59b98e3c929b4786a78 | [
"MIT"
] | 10 | 2016-07-25T11:00:08.000Z | 2019-09-25T14:56:40.000Z | project/user/views.py | fv316/flask-template-project | 026459b299c7aa4d82c2b59b98e3c929b4786a78 | [
"MIT"
] | 7 | 2016-11-01T20:11:03.000Z | 2020-02-04T14:25:49.000Z | # !/usr/bin/python
# -*- coding: utf-8 -*-
from flask import redirect, render_template, request, url_for, Blueprint
from flask_login import login_required, current_user
from project.user.handlers.user_handler import UserHandler
from project.user.forms import LoginForm, RegisterForm
from project.utils import flash
us... | 29.264151 | 79 | 0.684075 |
73d61e5471204fe4a63d69cae97b802124e6c8ef | 11,710 | py | Python | services/traction/acapy_client/model/send_menu.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 12 | 2022-01-29T20:30:03.000Z | 2022-03-29T11:46:14.000Z | services/traction/acapy_client/model/send_menu.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 38 | 2021-11-22T17:52:50.000Z | 2022-03-31T17:52:00.000Z | services/traction/acapy_client/model/send_menu.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 9 | 2021-11-22T18:05:48.000Z | 2022-03-29T11:25:08.000Z | """
Aries Cloud Agent
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0.7.2
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from acapy_cli... | 40.801394 | 124 | 0.56012 |
73d631644f9150d4d2096eb272b4ecce978e767d | 2,878 | py | Python | vec_env/monitor.py | Hwhitetooth/jax_muzero | b8ab36251d22e0246d61514841ba17a22f4b2a36 | [
"MIT"
] | 17 | 2022-02-27T13:40:25.000Z | 2022-03-24T21:06:02.000Z | vec_env/monitor.py | Hwhitetooth/jax_muzero | b8ab36251d22e0246d61514841ba17a22f4b2a36 | [
"MIT"
] | 1 | 2022-03-08T19:47:52.000Z | 2022-03-24T21:05:30.000Z | vec_env/monitor.py | Hwhitetooth/jax_muzero | b8ab36251d22e0246d61514841ba17a22f4b2a36 | [
"MIT"
] | 1 | 2022-03-08T14:58:12.000Z | 2022-03-08T14:58:12.000Z | import time
from gym.core import Wrapper
class Monitor(Wrapper):
f = None
def __init__(self, env, allow_early_resets=False, reset_keywords=(), info_keywords=()):
Wrapper.__init__(self, env=env)
self.tstart = time.time()
self.results_writer = None
self.reset_keywords = reset_k... | 34.261905 | 159 | 0.606324 |
73d64f57aabd3849c4b0bdc17ddbaa6987552a25 | 127 | py | Python | tests/conftest.py | NGalandim/roboai-python-cli | 2e2a4c82a0294dd9a43eb85ebb452791abcba8d8 | [
"MIT"
] | 3 | 2020-10-21T11:11:28.000Z | 2022-02-11T18:00:48.000Z | tests/conftest.py | NGalandim/roboai-python-cli | 2e2a4c82a0294dd9a43eb85ebb452791abcba8d8 | [
"MIT"
] | 35 | 2020-10-21T16:36:47.000Z | 2021-11-04T12:45:39.000Z | tests/conftest.py | NGalandim/roboai-python-cli | 2e2a4c82a0294dd9a43eb85ebb452791abcba8d8 | [
"MIT"
] | 2 | 2020-10-13T10:48:48.000Z | 2022-02-11T16:30:35.000Z | import pytest
from click.testing import CliRunner
@pytest.fixture()
def runner():
runner = CliRunner()
return runner
| 14.111111 | 35 | 0.724409 |
73d6558e43d4355bcf7506d10d8b771cbbdb9c1c | 227 | py | Python | notifications/templatetags/notifications_tags.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | 1 | 2021-11-06T12:08:26.000Z | 2021-11-06T12:08:26.000Z | notifications/templatetags/notifications_tags.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | notifications/templatetags/notifications_tags.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | from django import template
from django.conf import settings
register = template.Library()
@register.filter
def company_profile_url(company_number):
return settings.FAS_COMPANY_PROFILE_URL.format(number=company_number)
| 20.636364 | 73 | 0.828194 |
73d6a6eccf96a91b8399508d45cded62fba6788d | 2,644 | py | Python | tql/algo_ml/features/transformer/DF2FFM.py | Jie-Yuan/1_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 14 | 2019-06-25T13:46:32.000Z | 2020-10-27T02:04:59.000Z | tql/algo_ml/features/transformer/DF2FFM.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | null | null | null | tql/algo_ml/features/transformer/DF2FFM.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 7 | 2019-06-25T13:26:16.000Z | 2020-10-27T02:05:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : tql-Python.
# @File : DF2FFM
# @Time : 2019-08-26 20:18
# @Author : yuanjie
# @Email : yuanjie@xiaomi.com
# @Software : PyCharm
# @Description :
import json
from tqdm import tqdm
from csv import DictReader
def csv2libff... | 37.771429 | 122 | 0.545764 |
73d6b188b6c62a2f4de4fe070a0b7c370cf125a1 | 486 | py | Python | setup.py | JayDwayne/Airtel-Money-Smart-API-SDK-Gateway | 5d5d80655eaa34a2cbf24058bdc0073b9ac72f2d | [
"MIT"
] | 1 | 2021-06-24T10:25:44.000Z | 2021-06-24T10:25:44.000Z | setup.py | JayDwayne/Airtel-Money-Smart-API-SDK-Gateway | 5d5d80655eaa34a2cbf24058bdc0073b9ac72f2d | [
"MIT"
] | null | null | null | setup.py | JayDwayne/Airtel-Money-Smart-API-SDK-Gateway | 5d5d80655eaa34a2cbf24058bdc0073b9ac72f2d | [
"MIT"
] | null | null | null | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='airtel-python-sdk',
version='0.1',
description='Airtel Smart API SDK',
long_description=long_description,
long_description_content_type="text/markdown",
url='https://github.com/sa... | 27 | 56 | 0.644033 |
73d7096030bd46a37a774b7b0368514c1386a232 | 369 | py | Python | blog/migrations/0015_auto_20151217_2002.py | FarmCodeGary/InspirationForge | 2b78e9c388608ac19ed0ecb114ce5e0cc1f33213 | [
"MIT"
] | 1 | 2015-09-16T17:14:36.000Z | 2015-09-16T17:14:36.000Z | blog/migrations/0015_auto_20151217_2002.py | FarmCodeGary/InspirationForge | 2b78e9c388608ac19ed0ecb114ce5e0cc1f33213 | [
"MIT"
] | null | null | null | blog/migrations/0015_auto_20151217_2002.py | FarmCodeGary/InspirationForge | 2b78e9c388608ac19ed0ecb114ce5e0cc1f33213 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0014_auto_20151217_1939'),
]
operations = [
migrations.AlterModelOptions(
name='contributor',
... | 19.421053 | 44 | 0.598916 |
73d73dc54f07804400c42c6577ceaba8529aca5f | 610 | py | Python | modules/mod_cmd/test_mod.py | slashsec-edu/cryton-modules | 4826b5e353f64e3d915d2abaead93b234a296304 | [
"MIT"
] | null | null | null | modules/mod_cmd/test_mod.py | slashsec-edu/cryton-modules | 4826b5e353f64e3d915d2abaead93b234a296304 | [
"MIT"
] | null | null | null | modules/mod_cmd/test_mod.py | slashsec-edu/cryton-modules | 4826b5e353f64e3d915d2abaead93b234a296304 | [
"MIT"
] | null | null | null | from unittest import TestCase
from mock import patch, MagicMock, Mock
from mod import execute
@patch('time.sleep', MagicMock())
class TestModules(TestCase):
@patch('os.remove', MagicMock())
def test_mod(self, *args):
args = {'cmd': "test"}
mock_run = Mock()
mock_run.stdout = b"output"... | 30.5 | 60 | 0.632787 |
73d77fc6b0278c0c2905089747e32df86332df7b | 668 | py | Python | test/fixtures.py | ser/pypayd-ng | 63d0e09ca5e966177874e6e2e82f6036898a56b0 | [
"MIT"
] | 4 | 2015-03-02T04:01:51.000Z | 2020-01-12T04:06:34.000Z | test/fixtures.py | ser/pypayd-ng | 63d0e09ca5e966177874e6e2e82f6036898a56b0 | [
"MIT"
] | 12 | 2015-03-02T06:07:17.000Z | 2016-01-19T00:43:11.000Z | test/fixtures.py | ser/pypayd-ng | 63d0e09ca5e966177874e6e2e82f6036898a56b0 | [
"MIT"
] | 4 | 2015-04-30T01:49:09.000Z | 2019-06-14T11:25:50.000Z | mnemonic= "like just love know never want time out there make look eye"
priv_hwif_main = "xprv9s21ZrQH143K2jhRQJezi4Zw33cwbUUPvJEY4oAEXzzsBT6SvPziuLg1wLyk8aFnB3m3sGqHzD5smZgE4DToj7Pk77dbVy9oWKVDb2b8nVg"
pub_hwif_main = 'xpub661MyMwAqRbcFDmtWLC15CWfb5TRzwCFHXA8sBZr6LXr4FRbTwJyT8zVndatFTL3nGfwyNi6AxhWF5sazTfKXWWZLzRBsAkJ... | 83.5 | 152 | 0.881737 |
73d794f24db300520fb33b9bfe18222c05d842f4 | 1,230 | py | Python | unittests/test_app.py | threathunterX/nebula_query_web | 9c73d82f7e6bc322ea2edfd86ff62727c49d7abb | [
"Apache-2.0"
] | 1 | 2019-05-01T09:42:31.000Z | 2019-05-01T09:42:31.000Z | unittests/test_app.py | threathunterX/nebula_query_web | 9c73d82f7e6bc322ea2edfd86ff62727c49d7abb | [
"Apache-2.0"
] | null | null | null | unittests/test_app.py | threathunterX/nebula_query_web | 9c73d82f7e6bc322ea2edfd86ff62727c49d7abb | [
"Apache-2.0"
] | 5 | 2019-06-24T05:48:54.000Z | 2022-02-18T03:34:30.000Z | # -*- coding: utf-8 -*-
from flask import Flask
from flask import _app_ctx_stack
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker
from flask_sqlalchemy import BaseQuery
# database session registry object, configured from
# create_app factory
DbSess... | 29.285714 | 69 | 0.744715 |
73d7a0d784aa445ec2ed751b207117ac808fb24f | 4,381 | py | Python | sdks/python/appcenter_sdk/models/Deployment.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/Deployment.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/Deployment.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class Deployment(obj... | 25.923077 | 90 | 0.555581 |
73d7b7a2db5ddfe733dfc22fa30afb4454c96313 | 42 | py | Python | custom_components/nexxtsolution_router/__init__.py | luiscbrenes/nexxtsolution_router | 77d1d16b14900fa802a10ec41e2f83eba7c9b985 | [
"Apache-2.0"
] | null | null | null | custom_components/nexxtsolution_router/__init__.py | luiscbrenes/nexxtsolution_router | 77d1d16b14900fa802a10ec41e2f83eba7c9b985 | [
"Apache-2.0"
] | null | null | null | custom_components/nexxtsolution_router/__init__.py | luiscbrenes/nexxtsolution_router | 77d1d16b14900fa802a10ec41e2f83eba7c9b985 | [
"Apache-2.0"
] | null | null | null | """The nexxtsolution_router component."""
| 21 | 41 | 0.761905 |
73d7ceb04d489c831893992b94466d9a8002b00c | 1,609 | py | Python | challenges/networks/treasures-of-polybius/solve/solution.py | infosec-ucalgary/magpieCTF-2021 | 78459a1e16ac3a135e891c2246232c4890960b92 | [
"MIT"
] | 18 | 2021-02-22T00:09:27.000Z | 2022-02-28T14:23:33.000Z | challenges/networks/treasures-of-polybius/solve/solution.py | infosec-ucalgary/magpieCTF-2021 | 78459a1e16ac3a135e891c2246232c4890960b92 | [
"MIT"
] | null | null | null | challenges/networks/treasures-of-polybius/solve/solution.py | infosec-ucalgary/magpieCTF-2021 | 78459a1e16ac3a135e891c2246232c4890960b92 | [
"MIT"
] | 6 | 2021-02-22T01:32:10.000Z | 2022-02-25T15:48:42.000Z | #!/usr/bin/env python3
import requests
import os
import subprocess as subp
def get_ids():
ids = []
with open("link_list.txt", 'r') as link_list:
links = link_list.read().split('\n')
for link in links:
if not link: continue
id_str = link.split('/')[-2]
ids.a... | 26.377049 | 107 | 0.57862 |
73d7d17a683670f223fd2cae9d82c4b835d1b18f | 428 | py | Python | drivers/plot_rotation_X_RUWE.py | lgbouma/earhart | 1d2b65d58655725f43c1bf9705b897bf767d4ca1 | [
"MIT"
] | null | null | null | drivers/plot_rotation_X_RUWE.py | lgbouma/earhart | 1d2b65d58655725f43c1bf9705b897bf767d4ca1 | [
"MIT"
] | null | null | null | drivers/plot_rotation_X_RUWE.py | lgbouma/earhart | 1d2b65d58655725f43c1bf9705b897bf767d4ca1 | [
"MIT"
] | null | null | null | import os
import earhart.plotting as ep
from earhart.paths import RESULTSDIR
PLOTDIR = os.path.join(RESULTSDIR, 'rotation_X_RUWE')
if not os.path.exists(PLOTDIR):
os.mkdir(PLOTDIR)
for yscale in ['linear', 'log']:
ep.plot_rotation_X_RUWE(PLOTDIR, 'viridis', emph_1937=1, yscale=yscale)
ep.plot_rotation_X_R... | 32.923077 | 75 | 0.759346 |
73d7da1efbeba6fb1b29c2f5ae089f7feb48f982 | 3,132 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_daemon_endpoint.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_daemon_endpoint.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_daemon_endpoint.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1Dae... | 27 | 124 | 0.557152 |
73d7de1f2e78084a887ebd685901a5eb8bc95de1 | 3,609 | py | Python | rasa/nlu/featurizers/featurizer.py | venushong667/rasa | dc0af420818e263fb4ef97c0d7f1c65e1da83bd1 | [
"Apache-2.0"
] | null | null | null | rasa/nlu/featurizers/featurizer.py | venushong667/rasa | dc0af420818e263fb4ef97c0d7f1c65e1da83bd1 | [
"Apache-2.0"
] | null | null | null | rasa/nlu/featurizers/featurizer.py | venushong667/rasa | dc0af420818e263fb4ef97c0d7f1c65e1da83bd1 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from abc import abstractmethod, ABC
from collections import Counter
from typing import Generic, Iterable, Text, Optional, Dict, Any, TypeVar
from rasa.nlu.constants import FEATURIZER_CLASS_ALIAS
from rasa.shared.nlu.training_data.features import Features
from rasa.shared.nlu.training... | 35.732673 | 88 | 0.665004 |
73d7ff066982e54a4de8f8f5ba5e89d5f2639c25 | 7,250 | py | Python | tfrecords/readers/driving_reader.py | goodgodgd/vode-2020 | 98e34120d642780576ac51d57c2f0597e7e1e524 | [
"BSD-2-Clause"
] | 4 | 2020-08-15T02:14:03.000Z | 2021-01-30T08:18:18.000Z | tfrecords/readers/driving_reader.py | goodgodgd/vode-2020 | 98e34120d642780576ac51d57c2f0597e7e1e524 | [
"BSD-2-Clause"
] | 23 | 2020-01-24T07:25:40.000Z | 2021-06-02T00:50:32.000Z | tfrecords/readers/driving_reader.py | goodgodgd/vode-2020 | 98e34120d642780576ac51d57c2f0597e7e1e524 | [
"BSD-2-Clause"
] | 1 | 2020-07-02T12:26:45.000Z | 2020-07-02T12:26:45.000Z | import os.path as op
import numpy as np
from glob import glob
from PIL import Image
import zipfile
from tfrecords.readers.reader_base import DataReaderBase
from tfrecords.tfr_util import resize_depth_map, apply_color_map
class DrivingStereoReader(DataReaderBase):
def __init__(self, split=""):
super().__i... | 38.978495 | 108 | 0.620276 |
73d8440e1d7b9b30b0a0204eb271dd7d1cd26d9d | 1,980 | gyp | Python | chrome/installer/mini_installer_syzygy.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | chrome/installer/mini_installer_syzygy.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | chrome/installer/mini_installer_syzygy.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'msvs_use_common_release': 0,
'msvs_use_common_linker_extras': 0,
},
'includes': [
'../../build/win_precompile.gypi',
... | 31.428571 | 72 | 0.473232 |
73d84cdc39b77d84038d654ab8eac7fee2efe81b | 3,263 | py | Python | pathfinder/client/commands.py | ayyess/pathfinder.vim | 3f636aa80388ae78b6fee4837750f66a166b3afb | [
"MIT"
] | null | null | null | pathfinder/client/commands.py | ayyess/pathfinder.vim | 3f636aa80388ae78b6fee4837750f66a166b3afb | [
"MIT"
] | null | null | null | pathfinder/client/commands.py | ayyess/pathfinder.vim | 3f636aa80388ae78b6fee4837750f66a166b3afb | [
"MIT"
] | null | null | null | import time
import vim
import pathfinder.client.output as output
from pathfinder.client.client import client
from pathfinder.window import cursor_in_same_position, winsaveview
class RecordedState:
"""
A snapshot of useful information at a specific time.
Used for comparing the start of a path to the cur... | 29.93578 | 86 | 0.6635 |
73d8659c8e3cfe0a883aa5035393cc6ed5f557c4 | 1,948 | py | Python | alipay/aop/api/domain/AlipayOpenServicemarketPromotiontaskRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenServicemarketPromotiontaskRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenServicemarketPromotiontaskRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenServicemarketPromotiontaskRelationQueryModel(object):
def __init__(self):
self._commodity_id = None
self._page_num = None
self._page_size = None
@property
... | 27.43662 | 75 | 0.600616 |
73d886144b0036b18506997ea053cc28535fbd74 | 2,462 | py | Python | examples/multizone_example.py | Cygn/pychromecast | bccba1d9d84893d243ce5d626878d5f2f5095442 | [
"MIT"
] | null | null | null | examples/multizone_example.py | Cygn/pychromecast | bccba1d9d84893d243ce5d626878d5f2f5095442 | [
"MIT"
] | null | null | null | examples/multizone_example.py | Cygn/pychromecast | bccba1d9d84893d243ce5d626878d5f2f5095442 | [
"MIT"
] | null | null | null | """
Example on how to use the Multizone (Audio Group) Controller
"""
# pylint: disable=invalid-name
import argparse
import logging
import sys
import time
import zeroconf
import pychromecast
from pychromecast.controllers.multizone import (
MultizoneController,
MultiZoneControllerListener,
)
from pychromecast... | 27.355556 | 89 | 0.749797 |
73d8af7cc4a1d0bb170fe489058743deaeced0b9 | 4,284 | py | Python | example/plane_wave_decomposition.py | narahahn/continuous_measurement | 2391f712880ec18957dc5491af6cd3665b97e086 | [
"MIT"
] | null | null | null | example/plane_wave_decomposition.py | narahahn/continuous_measurement | 2391f712880ec18957dc5491af6cd3665b97e086 | [
"MIT"
] | null | null | null | example/plane_wave_decomposition.py | narahahn/continuous_measurement | 2391f712880ec18957dc5491af6cd3665b97e086 | [
"MIT"
] | null | null | null | """
Plane wave decomposition using continuously measured impulse responses
* point source in a free-field
* CARDIOID microphone moving on a circle at a constant speed
* captured signal computed by using fractional delay filters + oversampling
* system identification based on spatial interpolation of a given order
* im... | 31.970149 | 109 | 0.713119 |
73d8c88732500415cdda9e916e73aa91e884590c | 10,314 | py | Python | NumNum/load_data.py | MilesQLi/NumNum | 97851ccb74610c414bf474016915173b8abfe913 | [
"MIT"
] | 42 | 2016-10-26T16:27:26.000Z | 2021-07-11T05:41:11.000Z | NumNum/load_data.py | lg920810/NumNum | 97851ccb74610c414bf474016915173b8abfe913 | [
"MIT"
] | 2 | 2017-08-09T16:10:33.000Z | 2018-08-01T03:09:21.000Z | NumNum/load_data.py | lg920810/NumNum | 97851ccb74610c414bf474016915173b8abfe913 | [
"MIT"
] | 30 | 2016-10-09T02:16:24.000Z | 2021-07-11T05:47:18.000Z | # Import Modules
from __future__ import print_function
from six.moves import cPickle as pickle
from six.moves import range
from six.moves.urllib.request import urlretrieve
from scipy import ndimage
from PIL import Image
import numpy as np
import os
import sys
import tarfile
import h5py
from numpy import random
# Downl... | 35.443299 | 116 | 0.65668 |
73d8e0338542eea89648519e280e841017012985 | 3,540 | py | Python | cases/multi_modal_rating_prediction.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 358 | 2020-06-11T09:34:53.000Z | 2022-03-31T12:56:22.000Z | cases/multi_modal_rating_prediction.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 467 | 2020-06-11T13:49:45.000Z | 2022-03-31T14:19:48.000Z | cases/multi_modal_rating_prediction.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 48 | 2020-07-13T14:50:45.000Z | 2022-03-26T09:37:13.000Z | import datetime
from examples.multi_modal_pipeline import calculate_validation_metric, generate_initial_pipeline_and_data, \
prepare_multi_modal_data
from fedot.core.composer.gp_composer.gp_composer import GPComposerBuilder, GPComposerRequirements
from fedot.core.log import default_log
from fedot.core.optimisers.g... | 45.384615 | 118 | 0.711864 |
73d8f84425464410586db007f133ecd2367b84bb | 2,314 | py | Python | Unsupervised_Learning/PCA.py | shyamsn97/artificial-intelligence | 9f15906f0b342195ba66c20bcc77d895ba64169f | [
"MIT"
] | null | null | null | Unsupervised_Learning/PCA.py | shyamsn97/artificial-intelligence | 9f15906f0b342195ba66c20bcc77d895ba64169f | [
"MIT"
] | null | null | null | Unsupervised_Learning/PCA.py | shyamsn97/artificial-intelligence | 9f15906f0b342195ba66c20bcc77d895ba64169f | [
"MIT"
] | null | null | null | import numpy as np
import sys
sys.path.append('../tools')
import tools
class PCA():
"""
Dimensionality reduction using the diagonalization of a covariance matrix
Can specify whether to use calculate the covariance matrix of the rows or columns of a given data matrix
Parameters:
X: numpy array()... | 44.5 | 115 | 0.652982 |
73d8f9cf56a331fc21e62d5878b7fb370c830212 | 672 | py | Python | LC/253.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/253.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/253.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | # Definition for an interval.
# class Interval(object):
# def __init__(self, s=0, e=0):
# self.start = s
# self.end = e
class Solution(object):
def minMeetingRooms(self, intervals):
"""
:type intervals: List[Interval]
:rtype: int
"""
l=[]
... | 24 | 55 | 0.425595 |
73d910c5e2758a0d08a69f6aef30ab94d53c0d18 | 1,605 | py | Python | python/wordcount.py | KasperD/script-fun | 919c8cfca65ce2177213145e6c553c1f4fa33b63 | [
"MIT"
] | null | null | null | python/wordcount.py | KasperD/script-fun | 919c8cfca65ce2177213145e6c553c1f4fa33b63 | [
"MIT"
] | null | null | null | python/wordcount.py | KasperD/script-fun | 919c8cfca65ce2177213145e6c553c1f4fa33b63 | [
"MIT"
] | null | null | null | #!/usr/bin/python
def main():
'''
Main function
'''
book = open("1984.txt", 'r') # Open the texfile as read-only
bookarray = {} # Create empty directory
for line in book:
if line != '\n': # If the line is only a newline then don't bother
line = line.replace("\n", "") #repl... | 35.666667 | 90 | 0.490343 |
73d916975e494b7766544665b071d3e7a0fed6bc | 24,175 | py | Python | h5py/_hl/group.py | jnsebgosselin/h5py | f525d1c180f6b4bc59726faf833fd50a26d57d83 | [
"BSD-3-Clause"
] | 1 | 2020-08-29T20:40:05.000Z | 2020-08-29T20:40:05.000Z | h5py/_hl/group.py | jnsebgosselin/h5py | f525d1c180f6b4bc59726faf833fd50a26d57d83 | [
"BSD-3-Clause"
] | null | null | null | h5py/_hl/group.py | jnsebgosselin/h5py | f525d1c180f6b4bc59726faf833fd50a26d57d83 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Implements support for high-level access to ... | 36.408133 | 115 | 0.575305 |
73d94b4b368f931299cdfcee36fdfb1db1588774 | 2,883 | py | Python | tests/test__init__.py | tommilligan/OverTheWire | 8862562fd1cd58b5e6c0f22f2bbff21459e770ec | [
"Apache-2.0"
] | null | null | null | tests/test__init__.py | tommilligan/OverTheWire | 8862562fd1cd58b5e6c0f22f2bbff21459e770ec | [
"Apache-2.0"
] | null | null | null | tests/test__init__.py | tommilligan/OverTheWire | 8862562fd1cd58b5e6c0f22f2bbff21459e770ec | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import unittest
import OverTheWire
class TestOTWLevelSetup(unittest.TestCase):
def test_otw_level_setup_known_int(self):
level = OverTheWire.OTWLevel("bandit", 0)
self.assertEqual(level.levelNumber, 0)
self.assertEqual(level.levelName, "bandit0")
... | 37.934211 | 128 | 0.700659 |
73d95b1ff529388e44d116b0be3f84fe9ebb77df | 1,067 | py | Python | soco/__init__.py | oyvindmal/SocoWebService | 3cb8f4c08109d07dced4b09621acaf5ac41c732b | [
"MIT"
] | 2 | 2015-08-08T22:26:39.000Z | 2015-08-16T13:59:04.000Z | soco/__init__.py | silky/SoCo | 6f318df953ebd11d472bba6c85c9b58840d2fed3 | [
"MIT"
] | null | null | null | soco/__init__.py | silky/SoCo | 6f318df953ebd11d472bba6c85c9b58840d2fed3 | [
"MIT"
] | 1 | 2021-07-18T03:19:07.000Z | 2021-07-18T03:19:07.000Z | # -*- coding: utf-8 -*-
""" SoCo (Sonos Controller) is a simple library to control Sonos speakers """
# There is no need for all strings here to be unicode, and Py2 cannot import
# modules with unicode names
# https://github.com/SoCo/SoCo/issues/98
# from __future__ import unicode_literals
# Will be parsed by setup.... | 29.638889 | 77 | 0.740394 |
73d97f9863238ebd21b595902fc7f34f8f632455 | 8,242 | py | Python | python-code/opengl-learning/pyglet-gl/14_batch_groups.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 13 | 2018-09-07T02:29:07.000Z | 2021-06-18T08:40:09.000Z | python-code/opengl-learning/pyglet-gl/14_batch_groups.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | null | null | null | python-code/opengl-learning/pyglet-gl/14_batch_groups.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 4 | 2019-06-20T00:09:39.000Z | 2021-07-15T10:14:36.000Z | #coding:utf-8
from pyglet.gl import *
import numpy as np
import OpenGL.GL.shaders
import ctypes
import pyrr
import time
from math import sin
from pyrr import Vector3, matrix44, Matrix44
import time
import numpy
class ObjLoader:
def __init__(self):
self.vert_coords = []
self.text_coords = []
... | 34.923729 | 124 | 0.643169 |
73d9972f37ab33f8212b22ae61e0c9d5b3821aaa | 166 | py | Python | src/lexico/lexical_error.py | thrnkk/compiler | 15e1ec1848ef432c1dfdf8b1f9ae79641bd253ca | [
"MIT"
] | 1 | 2021-10-05T13:12:09.000Z | 2021-10-05T13:12:09.000Z | src/lexico/lexical_error.py | thrnkk/compiler | 15e1ec1848ef432c1dfdf8b1f9ae79641bd253ca | [
"MIT"
] | null | null | null | src/lexico/lexical_error.py | thrnkk/compiler | 15e1ec1848ef432c1dfdf8b1f9ae79641bd253ca | [
"MIT"
] | null | null | null | from .analysis_error import AnalysisError
class LexicalError(AnalysisError):
def __init__(self, msg, position = None):
super().__init__(msg, position)
| 20.75 | 45 | 0.728916 |
73d99ec8d205a102b0f0a557b5bff3a5294995a4 | 402 | py | Python | tests/test_mantle/mothball/register/reg4rs.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 14 | 2017-10-08T09:16:10.000Z | 2021-11-27T19:12:24.000Z | tests/test_mantle/mothball/register/reg4rs.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 7 | 2018-04-12T21:33:49.000Z | 2018-08-21T22:14:20.000Z | tests/test_mantle/mothball/register/reg4rs.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 3 | 2018-07-24T04:55:02.000Z | 2019-12-30T08:12:39.000Z | import magma as m
from mantle import *
from loam.boards.papilioone import PapilioOne
from loam.shields.megawing import MegaWing
megawing = MegaWing(PapilioOne)
megawing.Clock.on()
megawing.Switch.on(6)
megawing.LED.on(4)
main = megawing.main()
I = main.SWITCH[0:4]
RESET = main.SWITCH[4]
SET = main.SWITCH[5]
O = main.... | 18.272727 | 45 | 0.731343 |
73d9a378cdd5d6aeb3e3a18cfc8c07a0e3d79057 | 4,106 | py | Python | alipay/aop/api/request/AlipayEbppInvoiceEnterpriseconsumeConsumeBatchqueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppInvoiceEnterpriseconsumeConsumeBatchqueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppInvoiceEnterpriseconsumeConsumeBatchqueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayEbppInvoiceEnterpriseconsumeConsumeBatchqueryModel import AlipayEbppInvoiceEnterpriseconsumeConsumeBatchqueryModel
class Alipa... | 28.317241 | 148 | 0.656113 |
73d9b8383b995374d5684a4d3ffb9aee0d89d611 | 6,807 | py | Python | tests/docker_compose/test_docker_compose.py | srbhr/jina | 29fec50f84c86dc23400afc11508669cb631ee15 | [
"Apache-2.0"
] | null | null | null | tests/docker_compose/test_docker_compose.py | srbhr/jina | 29fec50f84c86dc23400afc11508669cb631ee15 | [
"Apache-2.0"
] | null | null | null | tests/docker_compose/test_docker_compose.py | srbhr/jina | 29fec50f84c86dc23400afc11508669cb631ee15 | [
"Apache-2.0"
] | null | null | null | # kind version has to be bumped to v0.11.1 since pytest-kind is just using v0.10.0 which does not work on ubuntu in ci
import pytest
import os
import time
from jina import Flow, Document
class DockerComposeFlow:
def __init__(self, dump_path):
self.dump_path = dump_path
def __enter__(self):
o... | 29.214592 | 118 | 0.603643 |
73d9bee8e07f1bdb72793e539ea09a4ec7114b75 | 979 | py | Python | neatsociety/__init__.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | 2 | 2018-03-03T16:30:09.000Z | 2022-01-02T17:02:22.000Z | neatsociety/__init__.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | null | null | null | neatsociety/__init__.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | null | null | null | from neatsociety import activations
activation_functions = activations.ActivationFunctionSet()
activation_functions.add('sigmoid', activations.sigmoid_activation)
activation_functions.add('tanh', activations.tanh_activation)
activation_functions.add('sin', activations.sin_activation)
activation_functions.add('gauss',... | 51.526316 | 69 | 0.858018 |
73d9c033f4bc2d45ffc4f5f4a9c667a4a940b928 | 7,654 | py | Python | lsstlc.py | ywx649999311/lsst_cadence | fe08fdedb8f45fab33effd40eff43626d81ef10a | [
"MIT"
] | null | null | null | lsstlc.py | ywx649999311/lsst_cadence | fe08fdedb8f45fab33effd40eff43626d81ef10a | [
"MIT"
] | null | null | null | lsstlc.py | ywx649999311/lsst_cadence | fe08fdedb8f45fab33effd40eff43626d81ef10a | [
"MIT"
] | null | null | null | """Module including function lc2file and two sub-classes class lsstlc and class extLC."""
import numpy as np
import kali
from astropy import stats
import os
def lc2file(file_dir, lc, full=False, timescales=None):
"""Save light curve to a .npz file.
Args:
file_path(str): path + file name
l... | 39.05102 | 135 | 0.602691 |
73d9ee265cfe6e744a45b6b3e480b85ade49e699 | 1,035 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ina260_averaging.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ina260_averaging.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 8 | 2019-03-09T22:29:46.000Z | 2021-09-27T16:45:25.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ina260_averaging.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
from adafruit_ina260 import INA260, AveragingCount
i2c = board.I2C()
ina260 = INA260(i2c)
# Raise the averaging count to a larger number to smooth out the results
ina260.averaging_count = AveragingC... | 32.34375 | 78 | 0.71401 |
73da2301016bd0db72b8d57f1da8b9e5e59a04d8 | 5,463 | py | Python | tests/cupy_tests/random_tests/test_permutations.py | andy6975/cupy | 34b388e4a4fe7c59092b4d4c9c96b2f307e49e46 | [
"MIT"
] | 1 | 2019-12-01T09:08:14.000Z | 2019-12-01T09:08:14.000Z | tests/cupy_tests/random_tests/test_permutations.py | hephaex/cupy | 5cf50a93bbdebe825337ed7996c464e84b1495ba | [
"MIT"
] | 1 | 2019-08-05T09:36:13.000Z | 2019-08-06T12:03:01.000Z | tests/cupy_tests/random_tests/test_permutations.py | hephaex/cupy | 5cf50a93bbdebe825337ed7996c464e84b1495ba | [
"MIT"
] | 1 | 2022-03-24T13:19:55.000Z | 2022-03-24T13:19:55.000Z | import unittest
import cupy
from cupy import testing
from cupy.testing import condition
import numpy
@testing.parameterize(
{'seed': None},
{'seed': 0},
)
@testing.gpu
class TestPermutations(unittest.TestCase):
def _xp_random(self, xp):
if self.seed is None:
return xp.random
... | 30.016484 | 79 | 0.632802 |
73da40a5de5134c811652902db08da1803660cd3 | 127,925 | py | Python | google/appengine/ext/ndb/model.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | google/appengine/ext/ndb/model.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | google/appengine/ext/ndb/model.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | """Model and Property classes and associated stuff.
A model class represents the structure of entities stored in the
datastore. Applications define model classes to indicate the
structure of their entities, then instantiate those model classes
to create entities.
All model classes must inherit (directly or indirectl... | 34.705643 | 80 | 0.677334 |
73da5a1ba1e03119ae58f0dadb864976ca2235d0 | 4,440 | py | Python | bin/update_docker.py | bbayles/cibuildwheel | af2014c954cdda356d496732c4d5398c61526b8f | [
"BSD-2-Clause"
] | 702 | 2017-03-23T16:30:24.000Z | 2021-05-19T06:34:41.000Z | bin/update_docker.py | bbayles/cibuildwheel | af2014c954cdda356d496732c4d5398c61526b8f | [
"BSD-2-Clause"
] | 594 | 2017-03-20T23:13:42.000Z | 2021-05-19T14:22:19.000Z | bin/update_docker.py | bbayles/cibuildwheel | af2014c954cdda356d496732c4d5398c61526b8f | [
"BSD-2-Clause"
] | 124 | 2017-03-31T14:13:26.000Z | 2021-05-14T19:48:31.000Z | #!/usr/bin/env python3
from __future__ import annotations
import configparser
from pathlib import Path
from typing import NamedTuple
import requests
DIR = Path(__file__).parent.resolve()
RESOURCES = DIR.parent / "cibuildwheel/resources"
class Image(NamedTuple):
manylinux_version: str
platform: str
imag... | 43.960396 | 98 | 0.682207 |
73da615449127cd818a34f4ca5d22909faa80bcf | 6,928 | py | Python | asposewordscloud/models/requests/update_form_field_online_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | asposewordscloud/models/requests/update_form_field_online_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | asposewordscloud/models/requests/update_form_field_online_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="update_form_field_online_request.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaini... | 49.485714 | 255 | 0.665416 |
73da61bd4a04b12c28d6977f84c04dd1270d0ed9 | 16,308 | py | Python | acq4/drivers/SutterMP285/mp285.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/drivers/SutterMP285/mp285.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/drivers/SutterMP285/mp285.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | import serial, struct, time, collections, threading
from ..SerialDevice import SerialDevice
ErrorVals = {
0: ('SP Over-run', 'The previous character was not unloaded before the latest was received.'),
1: ('Frame Error', 'A valid stop bit was not received during the appropriate time period.'),
2: ('Buffer ... | 36.72973 | 132 | 0.51858 |
73da7031688c1e3fef5dc65c06878b68fd1a8c68 | 938 | py | Python | camply/notifications/base_notifications.py | grantland/camply | aec4c6b82380fdc85f254563d8e8de290edc05ad | [
"MIT"
] | 123 | 2021-05-19T04:56:47.000Z | 2022-03-23T19:04:45.000Z | camply/notifications/base_notifications.py | grantland/camply | aec4c6b82380fdc85f254563d8e8de290edc05ad | [
"MIT"
] | 11 | 2021-05-25T20:22:14.000Z | 2022-03-05T16:31:32.000Z | camply/notifications/base_notifications.py | grantland/camply | aec4c6b82380fdc85f254563d8e8de290edc05ad | [
"MIT"
] | 21 | 2021-05-24T05:53:24.000Z | 2022-03-31T02:03:41.000Z | #!/usr/bin/env python3
# Author:: Justin Flannery (mailto:juftin@juftin.com)
"""
Push Notifications Template
"""
from abc import ABC, abstractmethod
import logging
from typing import List
from camply.containers import AvailableCampsite
logger = logging.getLogger(__name__)
class BaseNotifications(ABC):
""... | 19.142857 | 69 | 0.60661 |
73da7e533ed955d00173b7290eb88c69f98ecf1b | 13,484 | py | Python | Python_paper/smclomo/.ipynb_checkpoints/smc-checkpoint.py | LaGauffre/SMCCompoMo | 242feab1f1a6f923b682cfb8b033bb9c96317dc3 | [
"MIT"
] | 1 | 2021-06-18T01:42:08.000Z | 2021-06-18T01:42:08.000Z | Python_paper/smclomo/.ipynb_checkpoints/smc-checkpoint.py | LaGauffre/SMCCompoMo | 242feab1f1a6f923b682cfb8b033bb9c96317dc3 | [
"MIT"
] | null | null | null | Python_paper/smclomo/.ipynb_checkpoints/smc-checkpoint.py | LaGauffre/SMCCompoMo | 242feab1f1a6f923b682cfb8b033bb9c96317dc3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 3 17:21:21 2020
@author: pierr
"""
import pandas as pd
import numpy as np
import scipy.special as sp
import scipy.stats as st
from joblib import Parallel, delayed
from .loss_distribution import logp_wrap, logd_wrap
from .prior_distribution import sim_prior_wrap, logp_pr... | 40.130952 | 125 | 0.577796 |
73daae0b84aab088147d9a7423bc64f4df502178 | 4,469 | py | Python | optimizers.py | fedetask/reactor-torch | a5f2eeeaa7d8bebb7446a2e8ce996b7ad8913177 | [
"MIT"
] | 2 | 2020-12-19T18:46:18.000Z | 2021-01-18T11:02:11.000Z | optimizers.py | fedetask/reactor-torch | a5f2eeeaa7d8bebb7446a2e8ce996b7ad8913177 | [
"MIT"
] | null | null | null | optimizers.py | fedetask/reactor-torch | a5f2eeeaa7d8bebb7446a2e8ce996b7ad8913177 | [
"MIT"
] | null | null | null | """This module contains shared optimizers.
"""
import math
import torch
import torch.optim as optim
class SharedAdam(optim.Adam):
"""Implements Adam algorithm with shared states, taken from
https://github.com/ikostrikov/pytorch-a3c/
"""
def __init__(self,
params,
l... | 34.643411 | 98 | 0.516894 |
73dabac4cbd7cf9cf502ce9223b7a90337ceb891 | 1,040 | py | Python | bballmain/lib/python2.7/site-packages/model_utils/tests/test_fields/test_status_field.py | bjf2015/bballmain | 81130df9e546211e34da6c4377cf0b19ce773f88 | [
"MIT"
] | 1 | 2017-03-05T01:43:57.000Z | 2017-03-05T01:43:57.000Z | bballmain/lib/python2.7/site-packages/model_utils/tests/test_fields/test_status_field.py | bjf2015/bballmain | 81130df9e546211e34da6c4377cf0b19ce773f88 | [
"MIT"
] | null | null | null | bballmain/lib/python2.7/site-packages/model_utils/tests/test_fields/test_status_field.py | bjf2015/bballmain | 81130df9e546211e34da6c4377cf0b19ce773f88 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.test import TestCase
from model_utils.fields import StatusField
from model_utils.tests.models import (
Article, StatusFieldDefaultFilled, StatusFieldDefaultNotFilled,
StatusFieldChoicesName,
)
class StatusFieldTests(TestCase):
def test_status_with... | 31.515152 | 76 | 0.751923 |
73dafb99b43779dc45629587e28429301df550a0 | 6,441 | py | Python | components/collectors.py | mavroskardia/oworld | 840421818b04c0d7242881519f83acf348efbb5e | [
"MIT"
] | null | null | null | components/collectors.py | mavroskardia/oworld | 840421818b04c0d7242881519f83acf348efbb5e | [
"MIT"
] | null | null | null | components/collectors.py | mavroskardia/oworld | 840421818b04c0d7242881519f83acf348efbb5e | [
"MIT"
] | null | null | null | import pygame
import configuration
import constants
import os
import items
import types
import gui
from cStringIO import StringIO
from zipfile import ZipFile
class DialogCollector(object):
"""This class reads the appropriate data directories for actor dialogs. It then stores them by id
(based on the directory ... | 40.509434 | 122 | 0.565595 |
73db1dbd8bdd1a94772d11b2ccb33eac525fa903 | 635 | py | Python | iced/forms.py | sharonmaswai/IceTube | 98d933132ee684aa5f04926f2bcca88cd84bfbb9 | [
"Unlicense"
] | 1 | 2020-01-13T13:49:53.000Z | 2020-01-13T13:49:53.000Z | iced/forms.py | sharonmaswai/IceTube | 98d933132ee684aa5f04926f2bcca88cd84bfbb9 | [
"Unlicense"
] | 8 | 2020-06-05T21:53:54.000Z | 2022-03-11T23:53:42.000Z | iced/forms.py | sharonmaswai/IceTube | 98d933132ee684aa5f04926f2bcca88cd84bfbb9 | [
"Unlicense"
] | 1 | 2022-03-13T18:08:48.000Z | 2022-03-13T18:08:48.000Z | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Profile, Rating
class UserSignUpForm(UserCreationForm):
email = forms.EmailField(max_length=100, help_text='Required')
class Meta:
model = User
field... | 25.4 | 67 | 0.670866 |
73db1f723307418015aa8029e49d076917c1534e | 2,952 | py | Python | tests/websocket_test.py | TeamJumpstart/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 10 | 2021-04-18T17:54:02.000Z | 2021-07-26T19:58:41.000Z | tests/websocket_test.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-21T15:13:41.000Z | 2021-04-21T15:13:41.000Z | tests/websocket_test.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-20T09:42:50.000Z | 2021-04-20T09:42:50.000Z | import asyncio
import json
import threading
import unittest
import websockets
from environments import WebsocketEnv
class DummyServer:
def __init__(self, url, port):
self.url = url
self.port = port
self.step_counter = 0
file = open("tests/spe_ed-1603124417603.json", "r")
... | 33.545455 | 89 | 0.613144 |
73db380bac8ab06438f3aec72f6175e7a19882be | 12,833 | py | Python | prm/modules/peak_response_mapping.py | FinchZHU/ultra-thin-PRM | 1cdfd1c521f4420164ea55ff8f940fa6d29eb7ac | [
"MIT"
] | null | null | null | prm/modules/peak_response_mapping.py | FinchZHU/ultra-thin-PRM | 1cdfd1c521f4420164ea55ff8f940fa6d29eb7ac | [
"MIT"
] | null | null | null | prm/modules/peak_response_mapping.py | FinchZHU/ultra-thin-PRM | 1cdfd1c521f4420164ea55ff8f940fa6d29eb7ac | [
"MIT"
] | null | null | null | from types import MethodType
import cv2
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
# from scipy.misc import imresize
from PIL import Image
from ..functions import pr_conv2d, peak_stimulation
class PeakResponseMapping(nn.Sequential):
def __init__(self, *... | 46.496377 | 152 | 0.598691 |
73db3affb1c4728a4c1251d0a72b2606ed424428 | 2,998 | py | Python | server/controller/destroy_vm.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 3 | 2019-12-07T17:14:39.000Z | 2022-03-31T06:41:51.000Z | server/controller/destroy_vm.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 10 | 2019-12-08T06:37:55.000Z | 2022-02-10T11:41:09.000Z | server/controller/destroy_vm.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 9 | 2020-06-28T01:08:35.000Z | 2020-07-26T03:51:47.000Z | '''
Destroy VM in vSphere.
'''
from __future__ import print_function
import atexit
from pyVim import connect
from pyVmomi import vim
import argparse
def get_args():
parser = argparse.ArgumentParser(
description='Arguments for talking to vCenter')
parser.add_argument('-s', '--host',
... | 27.759259 | 72 | 0.538359 |
73db92835649a541758da6e1e48dd36c0b4f92ae | 5,362 | py | Python | tests/test_time_entries_adapter.py | damnit/pymite | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | [
"MIT"
] | 4 | 2016-09-25T17:25:41.000Z | 2019-12-28T06:25:10.000Z | tests/test_time_entries_adapter.py | damnit/pymite | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | [
"MIT"
] | null | null | null | tests/test_time_entries_adapter.py | damnit/pymite | 1e9b9bf6aef790af2d8781f9f77c098c54ca0342 | [
"MIT"
] | 2 | 2017-09-23T14:55:59.000Z | 2018-10-28T09:18:14.000Z | # -*- coding: utf-8 -*-
# File: test_time_entries_adapter.py
""" time entries adapter test module. """
import urllib.request
import json
from .conftest import (
mock_urlopen, _get_url, _post_url, _delete_url, parse_params
)
from pymite.adapters import TimeEntries
def test_time_entries_setup(libfactory):
... | 33.936709 | 78 | 0.697874 |
73db93e32cfc911467cd93df1e7d19304df98f9a | 38,581 | py | Python | nyoka/tests/testScoreWithAdapaSklearn.py | nimeshgit/nyoka | 43bf049825922213eeb3e6a8f39864f9b75d01d5 | [
"Apache-2.0"
] | null | null | null | nyoka/tests/testScoreWithAdapaSklearn.py | nimeshgit/nyoka | 43bf049825922213eeb3e6a8f39864f9b75d01d5 | [
"Apache-2.0"
] | 2 | 2021-08-25T16:16:45.000Z | 2022-02-10T05:28:52.000Z | nyoka/tests/testScoreWithAdapaSklearn.py | nimeshgit/nyoka | 43bf049825922213eeb3e6a8f39864f9b75d01d5 | [
"Apache-2.0"
] | null | null | null | import sys, os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.append(BASE_DIR)
import pandas as pd
from sklearn import datasets
from sklearn.pipeline import Pipeline
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler, Imputer, LabelEncoder, LabelBinarizer,\
Binariz... | 47.107448 | 124 | 0.68977 |
73db9a3b2bf1e9880650f38cdf616f5be6981361 | 361 | py | Python | pyinstrument/renderers/__init__.py | sthagen/pyinstrument | 7b52e037bc3b5736037171003ef3318938e081fe | [
"BSD-3-Clause"
] | 1 | 2020-12-13T06:22:51.000Z | 2020-12-13T06:22:51.000Z | pyinstrument/renderers/__init__.py | sthagen/pyinstrument | 7b52e037bc3b5736037171003ef3318938e081fe | [
"BSD-3-Clause"
] | null | null | null | pyinstrument/renderers/__init__.py | sthagen/pyinstrument | 7b52e037bc3b5736037171003ef3318938e081fe | [
"BSD-3-Clause"
] | null | null | null | from pyinstrument.renderers.base import FrameRenderer, Renderer
from pyinstrument.renderers.console import ConsoleRenderer
from pyinstrument.renderers.html import HTMLRenderer
from pyinstrument.renderers.jsonrenderer import JSONRenderer
from pyinstrument.renderers.session import SessionRenderer
from pyinstrument.render... | 51.571429 | 64 | 0.894737 |
73db9ad1c87b8b1e72575ff5460261ffb670e96b | 3,895 | py | Python | src/api/models/userModel.py | 0x6f736f646f/backend-blog-application | e2f5444def814776df5754aaf56e4d1eec9336d6 | [
"MIT"
] | null | null | null | src/api/models/userModel.py | 0x6f736f646f/backend-blog-application | e2f5444def814776df5754aaf56e4d1eec9336d6 | [
"MIT"
] | 33 | 2020-04-20T23:15:59.000Z | 2020-04-24T22:14:05.000Z | src/api/models/userModel.py | 0x6f736f646f/backend-blog-application | e2f5444def814776df5754aaf56e4d1eec9336d6 | [
"MIT"
] | null | null | null | import datetime
import jwt
from api import app, db, bcrypt
class UserModel(db.Model):
"""
User model for storing user related details
"""
__tablename__ = "users"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(255), nullable=False)
photo = db.Co... | 31.41129 | 78 | 0.601027 |
73dbaefc8736cd3da51a43371b6f01360d83c8a8 | 3,076 | py | Python | formalchemy/tests/test_multiple_keys.py | coredumperror/formalchemy | 6d89bb3ac19248e114684df17bbf3885dc26de3e | [
"MIT"
] | 20 | 2015-01-25T13:54:08.000Z | 2021-03-09T16:54:53.000Z | formalchemy/tests/test_multiple_keys.py | coredumperror/formalchemy | 6d89bb3ac19248e114684df17bbf3885dc26de3e | [
"MIT"
] | 11 | 2015-02-05T16:36:19.000Z | 2020-11-13T11:41:19.000Z | formalchemy/tests/test_multiple_keys.py | coredumperror/formalchemy | 6d89bb3ac19248e114684df17bbf3885dc26de3e | [
"MIT"
] | 12 | 2015-02-19T14:06:21.000Z | 2021-07-30T08:44:45.000Z | # -*- coding: utf-8 -*-
from formalchemy.tests import *
def test_renderer_names():
"""
Check that the input name take care of multiple primary keys::
>>> fs = FieldSet(primary1)
>>> print(fs.field.render())
<input id="PrimaryKeys-1_22-field" maxlength="10" name="PrimaryKeys-1_22-field"... | 30.156863 | 118 | 0.559818 |
73dbafa2b2009025c163a91a60c8359d523f8133 | 1,377 | py | Python | commandbased/commandbasedrobot.py | M-Shadow/robotpy-wpilib-utilities | ba95d45041e00842afadaedd2f3cbf2a3ac9cdf7 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | commandbased/commandbasedrobot.py | M-Shadow/robotpy-wpilib-utilities | ba95d45041e00842afadaedd2f3cbf2a3ac9cdf7 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | commandbased/commandbasedrobot.py | M-Shadow/robotpy-wpilib-utilities | ba95d45041e00842afadaedd2f3cbf2a3ac9cdf7 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-14T14:47:41.000Z | 2019-04-14T14:47:41.000Z | from wpilib import TimedRobot
from wpilib.command import Scheduler
class CommandBasedRobot(TimedRobot):
"""
The base class for a Command-Based Robot. To use, instantiate commands and
trigger them.
"""
def startCompetition(self):
"""Initalizes the scheduler before starting robotInit()"""
... | 29.297872 | 79 | 0.648511 |
73dbb24252b0aaaa1f50edafcd1e7c6a35cd4c02 | 438 | py | Python | recipes/how_to_use_odfdo_in_command_line_scripts_odfdo-show.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 18 | 2018-04-19T08:30:48.000Z | 2022-02-14T11:00:27.000Z | recipes/how_to_use_odfdo_in_command_line_scripts_odfdo-show.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 15 | 2018-04-22T00:52:41.000Z | 2021-07-05T10:16:38.000Z | recipes/how_to_use_odfdo_in_command_line_scripts_odfdo-show.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 6 | 2018-04-22T00:14:12.000Z | 2021-12-06T01:42:07.000Z | print(
"Example of the use of odfdo in a script : odfdo-show.py. This command "
"line tool dumps text from an OpenDocument file to the standard "
"output, optionally styles and meta.\n\n"
"odfdo-show.py is available in the script directory of the odfdo-python"
" package.\n"
)
from subprocess import... | 31.285714 | 76 | 0.703196 |
73dbb7285ad1ab1f6850ab21d7b216b2c972b5dc | 14,481 | py | Python | algorithms/maddpg.py | tuladhay/rob538_project | 67a19ee34ca256f6d103018c844165bab68ed96d | [
"MIT"
] | null | null | null | algorithms/maddpg.py | tuladhay/rob538_project | 67a19ee34ca256f6d103018c844165bab68ed96d | [
"MIT"
] | 1 | 2020-06-30T11:47:59.000Z | 2020-06-30T11:47:59.000Z | algorithms/maddpg.py | tuladhay/rob538_project | 67a19ee34ca256f6d103018c844165bab68ed96d | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from gym.spaces import Box, Discrete
from utils.networks import MLPNetwork
from utils.misc import soft_update, average_gradients, onehot_from_logits, gumbel_softmax
from utils.agents import DDPGAgent
import numpy as np
MSELoss = torch.nn.MSELoss()
class MADDPG(object):
... | 43.486486 | 102 | 0.545611 |
73dbe1163c58529cca3dba35315662a9da5c16b0 | 559 | py | Python | build/lib/events/migrations/0005_auto_20180618_0742.py | aswinzz/django-events-rest-framework | f87358b7e416f3d8bbe870da2f56babbb98d741a | [
"MIT"
] | 7 | 2018-06-18T20:30:26.000Z | 2021-01-21T19:16:25.000Z | build/lib/events/migrations/0005_auto_20180618_0742.py | aswinzz/django-events-rest-framework | f87358b7e416f3d8bbe870da2f56babbb98d741a | [
"MIT"
] | null | null | null | build/lib/events/migrations/0005_auto_20180618_0742.py | aswinzz/django-events-rest-framework | f87358b7e416f3d8bbe870da2f56babbb98d741a | [
"MIT"
] | 1 | 2020-01-29T15:42:46.000Z | 2020-01-29T15:42:46.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-06-18 07:42
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0004_auto_20180618_0602'),
]
operations = [
migrations.AlterModelOptions(
... | 23.291667 | 59 | 0.608229 |
73dc024cedb8d11adc0c9bf5705ba347f1385842 | 24,789 | py | Python | heat/tests/functional/util.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | 1 | 2020-08-15T14:29:15.000Z | 2020-08-15T14:29:15.000Z | heat/tests/functional/util.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | null | null | null | heat/tests/functional/util.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicabl... | 38.5521 | 79 | 0.555045 |
73dc0bc667ed21c44f78b6b2cb31cb46480ed39c | 2,668 | py | Python | tests/test_commands.py | pielmach/wuerfelbecher | 8a9cfdab8793983c10853e2e311ff1b98dae7da4 | [
"MIT"
] | null | null | null | tests/test_commands.py | pielmach/wuerfelbecher | 8a9cfdab8793983c10853e2e311ff1b98dae7da4 | [
"MIT"
] | 9 | 2021-06-05T18:46:43.000Z | 2022-03-08T20:25:37.000Z | tests/test_commands.py | pielmach/wuerfelbecher | 8a9cfdab8793983c10853e2e311ff1b98dae7da4 | [
"MIT"
] | 1 | 2021-09-02T21:22:37.000Z | 2021-09-02T21:22:37.000Z | import unittest
from wuerfelbecher import commands, statistics
class TestCommands(unittest.TestCase):
def setUp(self):
statistics.init_statcounter()
def test_roll(self):
self.assertTrue(commands.roll("d2") in ["[ **1** ]", "[ **2** ]"])
self.assertTrue(commands.roll("D2") in ["[ **1*... | 52.313725 | 126 | 0.453523 |
73dc51ea3cceb33884c0c494271b616fd040d038 | 5,930 | py | Python | pyop2/pyparloop.py | chromy/PyOP2 | 8a1955c628b795019485c9771709c338a806e661 | [
"BSD-3-Clause"
] | null | null | null | pyop2/pyparloop.py | chromy/PyOP2 | 8a1955c628b795019485c9771709c338a806e661 | [
"BSD-3-Clause"
] | null | null | null | pyop2/pyparloop.py | chromy/PyOP2 | 8a1955c628b795019485c9771709c338a806e661 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of PyOP2
#
# PyOP2 is Copyright (c) 2012-2014, Imperial College London and
# others. Please see the AUTHORS file in the main source directory for
# a full list of copyright holders. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permi... | 36.832298 | 100 | 0.587184 |
73dc65335d81042de142d1b85b6d6b13e3b10450 | 4,419 | py | Python | drf_haystack/mixins.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | drf_haystack/mixins.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | drf_haystack/mixins.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | from rest_framework.decorators import action
from rest_framework.response import Response
from drf_haystack.filters import HaystackFacetFilter
class MoreLikeThisMixin:
"""
Mixin class for supporting "more like this" on an API View.
"""
@action(detail=True, methods=["get"], url_path="more-like-this")... | 36.825 | 109 | 0.651957 |
73dc771b45e36d7a009a600ea210b7e0b0fdd1ee | 1,156 | py | Python | Python/models.py | hobogalaxy/ISA | aae4b9b4e30d07a4fe2ddc0900973bf134cc8fda | [
"MIT"
] | 1 | 2020-07-23T12:55:01.000Z | 2020-07-23T12:55:01.000Z | Python/models.py | hobogalaxy/ISA | aae4b9b4e30d07a4fe2ddc0900973bf134cc8fda | [
"MIT"
] | 22 | 2020-07-23T12:55:36.000Z | 2021-03-19T00:05:49.000Z | Python/models.py | hobogalaxy/ISA | aae4b9b4e30d07a4fe2ddc0900973bf134cc8fda | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.distributions import Normal
class Actor(nn.Module):
def __init__(self, obs_space, hidden_size, action_space):
super(Actor, self).__init__()
self.actor = nn.Sequential(
nn.Linear(obs_space, hidden_size),
nn.Tanh(),
n... | 26.272727 | 82 | 0.570069 |
73dc823f2d1601947b8e421956d707138415a05f | 14,121 | py | Python | Utils/HandlerUtil.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | Utils/HandlerUtil.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | Utils/HandlerUtil.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | #
# Handler library for Linux IaaS
#
# Copyright 2014 Microsoft 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 requ... | 39.444134 | 636 | 0.638269 |
73dcc0aab7a2c88ba61706b4d89f885d2bfb1b40 | 26,085 | py | Python | DCGAN_FID_batched/model.py | LaudateCorpus1/first_order_gan | ed9d738b6967c269ba23c814c314a156de64a27b | [
"Apache-2.0"
] | 41 | 2018-02-13T12:28:05.000Z | 2021-11-14T17:34:19.000Z | DCGAN_FID_batched/model.py | LaudateCorpus1/first_order_gan | ed9d738b6967c269ba23c814c314a156de64a27b | [
"Apache-2.0"
] | 1 | 2022-02-24T01:51:07.000Z | 2022-02-24T01:51:07.000Z | DCGAN_FID_batched/model.py | LaudateCorpus1/first_order_gan | ed9d738b6967c269ba23c814c314a156de64a27b | [
"Apache-2.0"
] | 11 | 2018-02-15T00:29:55.000Z | 2022-02-24T01:50:57.000Z | import os
import sys
import time
import math
from glob import glob
import tensorflow as tf
import numpy as np
from random import sample
from data_loader import get_loader
from ops import *
from utils import *
# import fid
sys.path.append(os.path.abspath('../'))
import fid
def conv_out_size_same(size, stride):
retu... | 41.208531 | 172 | 0.654821 |
73dcd61fe5dfcc076bec59c1ab78d7fbae2e0679 | 5,846 | py | Python | dynaphopy/analysis/modes.py | faradaymahe/DynaPhopy | 8519ff616386651acf71166bee02c1a2aef89312 | [
"MIT"
] | 76 | 2015-02-24T02:55:09.000Z | 2022-03-31T09:38:09.000Z | dynaphopy/analysis/modes.py | faradaymahe/DynaPhopy | 8519ff616386651acf71166bee02c1a2aef89312 | [
"MIT"
] | 14 | 2017-07-21T12:37:28.000Z | 2021-09-15T08:50:55.000Z | dynaphopy/analysis/modes.py | faradaymahe/DynaPhopy | 8519ff616386651acf71166bee02c1a2aef89312 | [
"MIT"
] | 38 | 2015-07-02T01:17:27.000Z | 2022-03-25T14:24:33.000Z | from matplotlib import pyplot as plt
from matplotlib.patches import FancyArrowPatch
from matplotlib import lines
from mpl_toolkits.mplot3d import proj3d
import numpy as np
class Arrow3D(FancyArrowPatch):
def __init__(self, xs, ys, zs, *args, **kwargs):
FancyArrowPatch.__init__(self, (0.0, 0.0), (0.0, 0.0)... | 26.572727 | 158 | 0.494355 |
73dcee3fc500b4cd4d8d9ca2e4dfbcc6ec11bee6 | 6,381 | py | Python | src/sage/geometry/hyperbolic_space/hyperbolic_interface.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | 3 | 2016-06-19T14:48:31.000Z | 2022-01-28T08:46:01.000Z | src/sage/geometry/hyperbolic_space/hyperbolic_interface.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | src/sage/geometry/hyperbolic_space/hyperbolic_interface.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | # -*- coding: utf-8 -*-
r"""
Interface to Hyperbolic Models
This module provides a convenient interface for interacting with models
of hyperbolic space as well as their points, geodesics, and isometries.
The primary point of this module is to allow the code that implements
hyperbolic space to be sufficiently decouple... | 30.5311 | 98 | 0.62498 |
73dcfaa2855a61522e201feddfc0e638727fd0df | 73,346 | py | Python | pyradio/browser.py | jirikrepl/pyradio | 6fae44aafc24acab3e33cf6b2918709a2c4548cb | [
"MIT"
] | null | null | null | pyradio/browser.py | jirikrepl/pyradio | 6fae44aafc24acab3e33cf6b2918709a2c4548cb | [
"MIT"
] | null | null | null | pyradio/browser.py | jirikrepl/pyradio | 6fae44aafc24acab3e33cf6b2918709a2c4548cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import curses
try:
from dns import resolver
except ImportError:
pass
from copy import deepcopy
import random
import json
import collections
from operator import itemgetter
try:
import requests
except ImportError:
pass
import threading
import logging
from .player import info_dict_... | 35.726254 | 158 | 0.506353 |
73dd4a9ff421cc8166d76162d17d0fdcc1b4054b | 203 | py | Python | maps/off_the_coast/off_the_coast.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | maps/off_the_coast/off_the_coast.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | maps/off_the_coast/off_the_coast.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | from map import Map
class OffTheCoast(Map):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.name = 'off_the_coast'
self.difficulty = 'advanced'
| 20.3 | 41 | 0.62069 |
73dd4d4015168096d7a28af5840ed20440f42cd1 | 842 | py | Python | tensorflow/contrib/nn/python/ops/__init__.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/contrib/nn/python/ops/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/contrib/nn/python/ops/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.1 | 80 | 0.7019 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.