hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f65ae266878a3c8b2ea3208da278c2a7c7afa863 | 6,451 | py | Python | examples/local/run_pt_dataset_local_example.py | bhky/targetran | ae836949448c383d58bb5b5ce70b3a4547f32102 | [
"MIT"
] | 13 | 2021-08-29T19:18:27.000Z | 2022-03-22T02:21:30.000Z | examples/local/run_pt_dataset_local_example.py | bhky/targetran | ae836949448c383d58bb5b5ce70b3a4547f32102 | [
"MIT"
] | null | null | null | examples/local/run_pt_dataset_local_example.py | bhky/targetran | ae836949448c383d58bb5b5ce70b3a4547f32102 | [
"MIT"
] | 2 | 2021-11-10T06:12:54.000Z | 2021-11-10T20:16:14.000Z | #!/usr/bin/env python3
"""
PyTorch Dataset local example.
"""
import glob
import json
import os
from typing import Dict, List, Optional, Sequence, Tuple
import cv2
import matplotlib.pylab as plt
import numpy as np
import numpy.typing
from torch.utils.data import Dataset, DataLoader
from targetran.np import (
Com... | 27.926407 | 79 | 0.602697 | #!/usr/bin/env python3
"""
PyTorch Dataset local example.
"""
import glob
import json
import os
from typing import Dict, List, Optional, Sequence, Tuple
import cv2
import matplotlib.pylab as plt
import numpy as np
import numpy.typing
from torch.utils.data import Dataset, DataLoader
from targetran.np import (
Com... | 2,384 | 0 | 104 |
6f9d7fb7903f0ba98a9930ab205eaa48150f8005 | 3,179 | py | Python | shop/views/signup.py | ujjawal30/online-electronic-store-django-postgresql | 14744066bba9d75c932cbf09e45ab7a4188bbfff | [
"MIT"
] | 1 | 2021-08-21T11:30:02.000Z | 2021-08-21T11:30:02.000Z | shop/views/signup.py | ujjawal30/online-electronic-store-django-postgresql | 14744066bba9d75c932cbf09e45ab7a4188bbfff | [
"MIT"
] | null | null | null | shop/views/signup.py | ujjawal30/online-electronic-store-django-postgresql | 14744066bba9d75c932cbf09e45ab7a4188bbfff | [
"MIT"
] | 1 | 2021-08-21T11:30:04.000Z | 2021-08-21T11:30:04.000Z | from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.http.response import HttpResponseRedirect
from django.views import View
from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from shop.models import Customer
| 35.322222 | 97 | 0.57754 | from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.http.response import HttpResponseRedirect
from django.views import View
from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from shop.models import Customer
class Signup(View):
... | 2,802 | -2 | 76 |
51624b6789e3f19fd8a238c3b0b912a8efd7ec89 | 2,484 | py | Python | dataset.py | t-zhong/DeepComplexCRN | ecde09722d6ca441c3cc9ee57cf15cf4ae083750 | [
"Apache-2.0"
] | null | null | null | dataset.py | t-zhong/DeepComplexCRN | ecde09722d6ca441c3cc9ee57cf15cf4ae083750 | [
"Apache-2.0"
] | null | null | null | dataset.py | t-zhong/DeepComplexCRN | ecde09722d6ca441c3cc9ee57cf15cf4ae083750 | [
"Apache-2.0"
] | null | null | null | # 数据集
import os
import glob
import librosa
import numpy as np
import torch
from torch.utils.data import Dataset
if __name__ == '__main__':
from torch.utils.data import DataLoader
trainset = WavDataset('../data/trunc_noisy_train2', '../data/trunc_speech_train')
trainloader = DataLoader(trainset)
... | 33.12 | 104 | 0.663446 | # 数据集
import os
import glob
import librosa
import numpy as np
import torch
from torch.utils.data import Dataset
def _load_wav(path, frame_dur, sr=16000):
y, _ = librosa.load(path, sr=sr)
# win = int(frame_dur / 1000 * sr)
# return torch.tensor(np.split(y, int(len(y) / win), axis=0))
return y
class... | 1,855 | 13 | 252 |
79ce563f9bd2520490e0bac569dee84da256801d | 2,197 | py | Python | yabgp/tests/unit/message/attribute/nlri/test_mpls_vpn.py | mengjunyi/yabgp | 45b050b401851b2ea94a6a70de124c02487ca677 | [
"Apache-2.0"
] | 203 | 2015-05-15T12:07:30.000Z | 2022-03-13T16:36:03.000Z | yabgp/tests/unit/message/attribute/nlri/test_mpls_vpn.py | mengjunyi/yabgp | 45b050b401851b2ea94a6a70de124c02487ca677 | [
"Apache-2.0"
] | 109 | 2015-05-19T16:07:59.000Z | 2022-03-09T08:18:23.000Z | yabgp/tests/unit/message/attribute/nlri/test_mpls_vpn.py | mengjunyi/yabgp | 45b050b401851b2ea94a6a70de124c02487ca677 | [
"Apache-2.0"
] | 74 | 2015-05-14T15:24:10.000Z | 2022-03-09T06:21:51.000Z | # Copyright 2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 37.237288 | 84 | 0.702321 | # Copyright 2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 1,241 | 16 | 158 |
bca109701e1f543c9dcb2beb37c4a08a6bd7a1d2 | 2,240 | py | Python | bot.py | E2r7hN07Fl47/Telegram-VideoToGif | 7a00f35d874267ac1852a9e14718695589dc2d65 | [
"MIT"
] | null | null | null | bot.py | E2r7hN07Fl47/Telegram-VideoToGif | 7a00f35d874267ac1852a9e14718695589dc2d65 | [
"MIT"
] | null | null | null | bot.py | E2r7hN07Fl47/Telegram-VideoToGif | 7a00f35d874267ac1852a9e14718695589dc2d65 | [
"MIT"
] | 1 | 2021-12-21T00:47:09.000Z | 2021-12-21T00:47:09.000Z | import traceback
import os
import json
import asyncio
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.types.message import ContentType
from aiogram.utils import executor
from moviepy.editor import VideoFileClip
from moviepy.video.fx.resize import resize
from aiogram.utils.exception... | 31.111111 | 101 | 0.708929 | import traceback
import os
import json
import asyncio
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.types.message import ContentType
from aiogram.utils import executor
from moviepy.editor import VideoFileClip
from moviepy.video.fx.resize import resize
from aiogram.utils.exception... | 1,442 | 0 | 89 |
0498924440d37ccdf6502ff34e4571a8f301fb3e | 2,482 | py | Python | release_watcher/watchers/watcher_manager.py | ExternalRepositories/release-watcher | b282d63d9887f16ab509a2223e3807c0a0b402ee | [
"MIT"
] | null | null | null | release_watcher/watchers/watcher_manager.py | ExternalRepositories/release-watcher | b282d63d9887f16ab509a2223e3807c0a0b402ee | [
"MIT"
] | null | null | null | release_watcher/watchers/watcher_manager.py | ExternalRepositories/release-watcher | b282d63d9887f16ab509a2223e3807c0a0b402ee | [
"MIT"
] | 1 | 2021-02-27T23:32:09.000Z | 2021-02-27T23:32:09.000Z | import logging
import abc
import time
from typing import Dict
from release_watcher.base_models import WatcherConfig
from release_watcher.config_models import CommonConfig
from release_watcher.watchers.watcher_models import WatchResult
logger = logging.getLogger(__name__)
WATCHER_TYPES = {}
class Watcher(metaclass=a... | 29.2 | 79 | 0.663578 | import logging
import abc
import time
from typing import Dict
from release_watcher.base_models import WatcherConfig
from release_watcher.config_models import CommonConfig
from release_watcher.watchers.watcher_models import WatchResult
logger = logging.getLogger(__name__)
WATCHER_TYPES = {}
class Watcher(metaclass=a... | 174 | 0 | 107 |
86163464e90840938537a29e4ce3f90f1b0ff47f | 4,806 | py | Python | src/step2_entity_linking.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | 1 | 2021-01-04T03:15:50.000Z | 2021-01-04T03:15:50.000Z | src/step2_entity_linking.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | null | null | null | src/step2_entity_linking.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | null | null | null | import argparse
import logging
import os
from multiprocessing import Process
from tqdm import tqdm
from util.load_sentence import LoadSentences
from util.logger import get_logger
from util.trie import Trie, TrieMatchResult, TrieNode
logger = logging.getLogger(__name__)
if __name__ == "__main__":
parser = ar... | 36.135338 | 99 | 0.571577 | import argparse
import logging
import os
from multiprocessing import Process
from tqdm import tqdm
from util.load_sentence import LoadSentences
from util.logger import get_logger
from util.trie import Trie, TrieMatchResult, TrieNode
logger = logging.getLogger(__name__)
class NERresult:
def __init__(self, art_i... | 2,778 | -8 | 229 |
7863eafa7620fb63043e04713e5af35bd97959ff | 1,143 | py | Python | PyMOTW/source/sys/sys_settrace_line.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | PyMOTW/source/sys/sys_settrace_line.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2020-07-18T03:52:03.000Z | 2020-07-18T04:18:01.000Z | PyMOTW/source/sys/sys_settrace_line.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 2 | 2021-03-06T04:28:32.000Z | 2021-03-06T04:59:17.000Z | #!/usr/bin/env python3
# encoding: utf-8
import functools
import sys
tracer = functools.partial(trace_calls, to_be_traced=['b'])
sys.settrace(tracer)
a()
| 20.052632 | 59 | 0.609799 | #!/usr/bin/env python3
# encoding: utf-8
import functools
import sys
def trace_lines(frame, event, arg):
if event != 'line':
return
co = frame.f_code
func_name = co.co_name
line_no = frame.f_lineno
print('* {} line {}'.format(func_name, line_no))
def trace_calls(frame, event, arg, to_b... | 866 | 0 | 115 |
2f15b3b662010e584721b099ffb01d6a409b67d2 | 463 | py | Python | scripts/cool_btc_address.py | mckev/bitcoin | a54f9732d59577757729f57c44867afe870b89e7 | [
"MIT"
] | null | null | null | scripts/cool_btc_address.py | mckev/bitcoin | a54f9732d59577757729f57c44867afe870b89e7 | [
"MIT"
] | null | null | null | scripts/cool_btc_address.py | mckev/bitcoin | a54f9732d59577757729f57c44867afe870b89e7 | [
"MIT"
] | null | null | null | """
Generate BTC addresses which have predefined prefix.
"""
import secrets
from classes.btc_address import BtcAddress
while True:
btc_private_key = secrets.token_bytes(nbytes=32)
btc_address = BtcAddress.compute_btc_address(btc_private_key)
if btc_address.lower().startswith('1kev'):
btc_private_... | 30.866667 | 93 | 0.768898 | """
Generate BTC addresses which have predefined prefix.
"""
import secrets
from classes.btc_address import BtcAddress
while True:
btc_private_key = secrets.token_bytes(nbytes=32)
btc_address = BtcAddress.compute_btc_address(btc_private_key)
if btc_address.lower().startswith('1kev'):
btc_private_... | 0 | 0 | 0 |
8151faca9e56db01bcc3af5654bf9283a26c0436 | 3,162 | py | Python | tests/test_dats_validator.py | mathdugre/conp-dataset | f117b9a2f8191d654de6d3aad57e6c352a6e881e | [
"MIT"
] | null | null | null | tests/test_dats_validator.py | mathdugre/conp-dataset | f117b9a2f8191d654de6d3aad57e6c352a6e881e | [
"MIT"
] | null | null | null | tests/test_dats_validator.py | mathdugre/conp-dataset | f117b9a2f8191d654de6d3aad57e6c352a6e881e | [
"MIT"
] | null | null | null | import unittest
import json
import os
import sys
import copy
sys.path.append(os.path.join(os.getcwd(), 'scripts'))
from dats_validator.validator import (validate_json, # noqa: E402
validate_non_schema_required,
validate_extra_properties,
... | 37.2 | 109 | 0.645161 | import unittest
import json
import os
import sys
import copy
sys.path.append(os.path.join(os.getcwd(), 'scripts'))
from dats_validator.validator import (validate_json, # noqa: E402
validate_non_schema_required,
validate_extra_properties,
... | 2,149 | 43 | 181 |
6f07547ceaeecde2fcf77db3bbfc330d2df253c6 | 191 | py | Python | apps/enquiries/serializers.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | null | null | null | apps/enquiries/serializers.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | 9 | 2022-03-22T04:30:50.000Z | 2022-03-22T04:49:13.000Z | apps/enquiries/serializers.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Enquiry
| 19.1 | 53 | 0.732984 | from rest_framework import serializers
from .models import Enquiry
class EnquirySerializer(serializers.ModelSerializer):
class Meta:
model = Enquiry
fields = "__all__"
| 0 | 99 | 23 |
b2add9d9fcdf80d93800980efa78940fd72dd658 | 2,845 | py | Python | board.py | imarrero1/CSC_120_Tic_Tac_Toe | b798282dc8a2ae9f3886d7579e4352946d02fe67 | [
"MIT"
] | null | null | null | board.py | imarrero1/CSC_120_Tic_Tac_Toe | b798282dc8a2ae9f3886d7579e4352946d02fe67 | [
"MIT"
] | null | null | null | board.py | imarrero1/CSC_120_Tic_Tac_Toe | b798282dc8a2ae9f3886d7579e4352946d02fe67 | [
"MIT"
] | null | null | null | # Global Variables
board = ["-", "-", "-",
"-", "-", "-",
"-", "-", "-"]
player_id = "X"
continue_game = True
winner = None
#Functions
# Starts the game
game()
| 18.966667 | 105 | 0.609842 | # Global Variables
board = ["-", "-", "-",
"-", "-", "-",
"-", "-", "-"]
player_id = "X"
continue_game = True
winner = None
#Functions
def print_board():
print(board[0], board[1], board[2])
print(board[3], board[4], board[5])
print(board[6], board[7], board[8])
def game():
print_board()
... | 2,425 | 0 | 229 |
a9e6d46ec4bfcae93d5e63075494036f6989a034 | 1,543 | py | Python | src/day006.py | zhangxinyong12/my-python-demo | 3ac121073749ad9caf42531603e921b04e1e7c6c | [
"MIT"
] | null | null | null | src/day006.py | zhangxinyong12/my-python-demo | 3ac121073749ad9caf42531603e921b04e1e7c6c | [
"MIT"
] | null | null | null | src/day006.py | zhangxinyong12/my-python-demo | 3ac121073749ad9caf42531603e921b04e1e7c6c | [
"MIT"
] | null | null | null | # #
# def func():
# n = 0
# while True:
# n += 1
# yield n # yield = return + 暂停
#
#
# # g = func()
# # print(g)
# # print(g.__next__())
# # print(next(g))
#
#
# def fid(length):
# a, b = 0, 1
# n = 0
# while n < length:
# yield b
# a, b = b, a + b
# n += 1
#... | 14.420561 | 43 | 0.48477 | # #
# def func():
# n = 0
# while True:
# n += 1
# yield n # yield = return + 暂停
#
#
# # g = func()
# # print(g)
# # print(g.__next__())
# # print(next(g))
#
#
# def fid(length):
# a, b = 0, 1
# n = 0
# while n < length:
# yield b
# a, b = b, a + b
# n += 1
#... | 0 | 0 | 0 |
7a70c72440606d7ad6fd4ad48ab4652557312e50 | 248 | py | Python | Intermediate/collections_deque.py | BjornChrisnach/Python_6hour_course | 0949387c2e423ed0ba7914db7c58af2f913bda1c | [
"MIT"
] | null | null | null | Intermediate/collections_deque.py | BjornChrisnach/Python_6hour_course | 0949387c2e423ed0ba7914db7c58af2f913bda1c | [
"MIT"
] | null | null | null | Intermediate/collections_deque.py | BjornChrisnach/Python_6hour_course | 0949387c2e423ed0ba7914db7c58af2f913bda1c | [
"MIT"
] | null | null | null | # collections deque nr8
import collections
from collections import deque
d = deque("hello", maxlen=5)
d.extend([1, 2, 3])
# d.pop()
# d.popleft()
# d.clear()
# d.extend("456")
# d.extend([1, 2, 3])
# d.extendleft("hey")
# d.rotate(-2)
print(d)
| 13.777778 | 29 | 0.629032 | # collections deque nr8
import collections
from collections import deque
d = deque("hello", maxlen=5)
d.extend([1, 2, 3])
# d.pop()
# d.popleft()
# d.clear()
# d.extend("456")
# d.extend([1, 2, 3])
# d.extendleft("hey")
# d.rotate(-2)
print(d)
| 0 | 0 | 0 |
9b0072e1e89c9a499d1082c31c74942345dc50ae | 1,732 | py | Python | torch_utils.py | hducg/B-Rep_GNN | 086cca1e6ea7b2d05e99823d32d88c266634cc52 | [
"MIT"
] | 1 | 2021-12-05T13:20:43.000Z | 2021-12-05T13:20:43.000Z | torch_utils.py | hducg/B-Rep_GNN | 086cca1e6ea7b2d05e99823d32d88c266634cc52 | [
"MIT"
] | null | null | null | torch_utils.py | hducg/B-Rep_GNN | 086cca1e6ea7b2d05e99823d32d88c266634cc52 | [
"MIT"
] | 1 | 2021-11-13T04:24:46.000Z | 2021-11-13T04:24:46.000Z | import os
import shutil
import torch
def save_checkpoint(state, is_best, checkpoint):
"""Saves model and training parameters at checkpoint + 'last.pth.tar'. If is_best==True, also saves
checkpoint + 'best.pth.tar'
Args:
state: (dict) contains model's state_dict, may contain other keys s... | 39.363636 | 110 | 0.683603 | import os
import shutil
import torch
def save_checkpoint(state, is_best, checkpoint):
"""Saves model and training parameters at checkpoint + 'last.pth.tar'. If is_best==True, also saves
checkpoint + 'best.pth.tar'
Args:
state: (dict) contains model's state_dict, may contain other keys s... | 0 | 0 | 0 |
0acaabfad8f8c6529659fa2cf3057c09bfb33096 | 336 | py | Python | exercícios/EX_CursoEmVideo/ex063.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | 1 | 2021-01-11T15:10:36.000Z | 2021-01-11T15:10:36.000Z | exercícios/EX_CursoEmVideo/ex063.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | null | null | null | exercícios/EX_CursoEmVideo/ex063.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | null | null | null | print('-'*30)
print('sequencia de fibonacci')
print('-'*30)
n = int(input('quantos termos voce quer mostrar?: '))
t1 = 0
t2 = 1
print('~'*30)
print(f'{t1} - {t2}', end='')
contador = 3
while contador <= n:
t3 = t1 + t2
print(f' - {t3}', end='')
t1 = t2
t2 = t3
contador = contador + 1
print(' - FIM',... | 19.764706 | 53 | 0.541667 | print('-'*30)
print('sequencia de fibonacci')
print('-'*30)
n = int(input('quantos termos voce quer mostrar?: '))
t1 = 0
t2 = 1
print('~'*30)
print(f'{t1} - {t2}', end='')
contador = 3
while contador <= n:
t3 = t1 + t2
print(f' - {t3}', end='')
t1 = t2
t2 = t3
contador = contador + 1
print(' - FIM',... | 0 | 0 | 0 |
b783f6e20b4940d15fb2deccfb44b27e44332116 | 2,468 | py | Python | isi_sdk_8_0_1/test/test_network_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_0_1/test/test_network_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_0_1/test/test_network_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0_1
from i... | 19.744 | 75 | 0.632901 | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0_1
from i... | 82 | 0 | 54 |
5dfe3859a209225ebe068a26db8a59291cc643d2 | 4,802 | py | Python | azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | null | null | null | azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | null | null | null | azure-mgmt-resource/azure/mgmt/resource/managedapplications/models/application_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 45.733333 | 259 | 0.645564 | # 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 ... | 706 | 0 | 27 |
803452b399dc96ace5eba36cc53db3135af8c253 | 5,876 | py | Python | ucsmsdk/mometa/lstorage/LstorageVirtualDriveDef.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 78 | 2015-11-30T14:10:05.000Z | 2022-02-13T00:29:08.000Z | ucsmsdk/mometa/lstorage/LstorageVirtualDriveDef.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 113 | 2015-11-20T09:42:46.000Z | 2022-03-16T16:53:29.000Z | ucsmsdk/mometa/lstorage/LstorageVirtualDriveDef.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 86 | 2015-12-12T08:22:18.000Z | 2022-01-23T03:56:34.000Z | """This module contains the general information for LstorageVirtualDriveDef ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class LstorageVirtualDriveDef(ManagedObject):
"""This is LstorageVirtualDriveDef class."""
co... | 57.607843 | 361 | 0.689074 | """This module contains the general information for LstorageVirtualDriveDef ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class LstorageVirtualDriveDefConsts:
ACCESS_POLICY_BLOCKED = "blocked"
ACCESS_POLICY_HIDDEN = "... | 458 | 1,576 | 50 |
cb661003040114eccc210b0aee65b2157f6132d3 | 281 | py | Python | ABC/abc201-abc250/abc229/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc201-abc250/abc229/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc201-abc250/abc229/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
| 13.380952 | 34 | 0.44484 | # -*- coding: utf-8 -*-
def main():
import sys
input = sys.stdin.readline
s1 = input().rstrip()
s2 = input().rstrip()
s = s1 + s2
if s == "#..#" or s == ".##.":
print("No")
else:
print("Yes")
if __name__ == "__main__":
main()
| 193 | 0 | 23 |
0aaf918a1828edf2b790185e1b5ccfbbdc3886c6 | 13,408 | py | Python | venv/Lib/site-packages/setuptools/_distutils/filelist.py | camehu2022/cotacao_moeda | 0f161b58184c783e64b76803596862c45fb4a947 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/setuptools/_distutils/filelist.py | camehu2022/cotacao_moeda | 0f161b58184c783e64b76803596862c45fb4a947 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/setuptools/_distutils/filelist.py | camehu2022/cotacao_moeda | 0f161b58184c783e64b76803596862c45fb4a947 | [
"MIT"
] | null | null | null | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
import os
import re
import fnmatch
import functools
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
... | 37.662921 | 79 | 0.589499 | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
import os
import re
import fnmatch
import functools
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
... | 5,512 | 0 | 269 |
3e00ff2da4b4364bb00b8b901f1ed02a664066fc | 264 | py | Python | smsbrana/urls.py | bstepa/django-smsbrana | e8ea56366a848a2eebfb70133d9f7883b0c48651 | [
"BSD-3-Clause"
] | 4 | 2015-06-10T16:20:01.000Z | 2016-03-16T19:36:13.000Z | smsbrana/urls.py | bstepa/django-smsbrana | e8ea56366a848a2eebfb70133d9f7883b0c48651 | [
"BSD-3-Clause"
] | 1 | 2016-07-25T16:30:17.000Z | 2020-10-01T12:11:57.000Z | smsbrana/urls.py | bstepa/django-smsbrana | e8ea56366a848a2eebfb70133d9f7883b0c48651 | [
"BSD-3-Clause"
] | 1 | 2015-10-19T22:56:42.000Z | 2015-10-19T22:56:42.000Z | # -*- coding: utf-8 -*-
try:
from django.conf.urls import url
except ImportError:
from django.conf.urls.defaults import url
from . import views
urlpatterns = [
url(r'^notification/$', views.smsconnect_notification, name='smsconnect_notification'),
]
| 22 | 91 | 0.715909 | # -*- coding: utf-8 -*-
try:
from django.conf.urls import url
except ImportError:
from django.conf.urls.defaults import url
from . import views
urlpatterns = [
url(r'^notification/$', views.smsconnect_notification, name='smsconnect_notification'),
]
| 0 | 0 | 0 |
3cd9b7222131320bda8b7ed69581336029b963d9 | 2,192 | py | Python | appengine/components/components/auth/config.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/components/components/auth/config.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/components/components/auth/config.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | 1 | 2021-12-06T03:37:36.000Z | 2021-12-06T03:37:36.000Z | # Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Auth component configuration hooks.
Application that use 'auth' component can override settings defined here by
adding the following lines to appengi... | 31.314286 | 78 | 0.734033 | # Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Auth component configuration hooks.
Application that use 'auth' component can override settings defined here by
adding the following lines to appengi... | 0 | 0 | 0 |
4bd33c51fd680443d897479f80753de2a7a98445 | 490 | py | Python | ORM/configs.py | LenoxWong/simpleORM | 6f8eaabe41a6d6384b4c9bcc07ee26fa7bf78a92 | [
"MIT"
] | null | null | null | ORM/configs.py | LenoxWong/simpleORM | 6f8eaabe41a6d6384b4c9bcc07ee26fa7bf78a92 | [
"MIT"
] | null | null | null | ORM/configs.py | LenoxWong/simpleORM | 6f8eaabe41a6d6384b4c9bcc07ee26fa7bf78a92 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'LenoxWong'
# for creating database
database = {
'name': 'Test',
'host': 'localhost',
'user': 'test',
'password': 'test'
},
# for creating the pool
pool = {
'host': 'localhost',
'port': 3306,
'user': tuple(database)[0]['user'],
... | 18.846154 | 47 | 0.55102 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'LenoxWong'
# for creating database
database = {
'name': 'Test',
'host': 'localhost',
'user': 'test',
'password': 'test'
},
# for creating the pool
pool = {
'host': 'localhost',
'port': 3306,
'user': tuple(database)[0]['user'],
... | 0 | 0 | 0 |
a7431d81a46af507ae6ff0b228df3d99848aa2fb | 1,682 | py | Python | src/05_landcover/01_compute_proportions.py | ranarango/fuegos-orinoquia | d82941ef0c90fe66162c8678b6f4a4c010d4313b | [
"MIT"
] | null | null | null | src/05_landcover/01_compute_proportions.py | ranarango/fuegos-orinoquia | d82941ef0c90fe66162c8678b6f4a4c010d4313b | [
"MIT"
] | null | null | null | src/05_landcover/01_compute_proportions.py | ranarango/fuegos-orinoquia | d82941ef0c90fe66162c8678b6f4a4c010d4313b | [
"MIT"
] | null | null | null | """
"""
import os
import numpy as np
import pandas as pd
import xarray as xr
from osgeo import gdal
from src.utils.constants import (
REGIONS,
LANDCOVER_MAP,
LANDCOVER_PERIODS,
LANDCOVER_PADDING
)
if __name__ == "__main__":
# Project's root
os.chdir("../..")
for region in REGIONS:
... | 29.508772 | 82 | 0.604043 | """
"""
import os
import numpy as np
import pandas as pd
import xarray as xr
from osgeo import gdal
from src.utils.constants import (
REGIONS,
LANDCOVER_MAP,
LANDCOVER_PERIODS,
LANDCOVER_PADDING
)
if __name__ == "__main__":
# Project's root
os.chdir("../..")
for region in REGIONS:
... | 0 | 0 | 0 |
f00607d5de898c0a5f408b092be12ec1b500cea9 | 4,030 | py | Python | pa/calc_spectra.py | mlipatov/paint_atmospheres | 75b494010a728e0682645de739752ff20a47d717 | [
"MIT"
] | 4 | 2020-07-28T08:06:07.000Z | 2020-08-01T04:25:32.000Z | pa/calc_spectra.py | mlipatov/paint_atmospheres | 75b494010a728e0682645de739752ff20a47d717 | [
"MIT"
] | null | null | null | pa/calc_spectra.py | mlipatov/paint_atmospheres | 75b494010a728e0682645de739752ff20a47d717 | [
"MIT"
] | null | null | null | # calculates spectra of a given star at different inclinations
from pa.lib import limbdark
from pa.lib import fit as ft
from pa.lib import star
from pa.lib import util as ut
import numpy as np
from numpy.core import defchararray as ch
import sys
import time
import argparse
import pickle
import os
# in case we are ru... | 34.741379 | 111 | 0.656576 | # calculates spectra of a given star at different inclinations
from pa.lib import limbdark
from pa.lib import fit as ft
from pa.lib import star
from pa.lib import util as ut
import numpy as np
from numpy.core import defchararray as ch
import sys
import time
import argparse
import pickle
import os
def run():
parser = ... | 3,618 | 0 | 23 |
533c281b9935449bfa470f9fe5904c7c97f5aff9 | 4,582 | py | Python | tensorflow_estimator/python/estimator/canned/linear_optimizer/python/utils/sharded_mutable_dense_hashtable_test.py | burgerkingeater/estimator | 4c38177f1a842d2169f90e1095f85e49e794a564 | [
"Apache-2.0"
] | 288 | 2018-10-10T14:35:11.000Z | 2022-03-26T14:49:13.000Z | tensorflow_estimator/python/estimator/canned/linear_optimizer/python/utils/sharded_mutable_dense_hashtable_test.py | burgerkingeater/estimator | 4c38177f1a842d2169f90e1095f85e49e794a564 | [
"Apache-2.0"
] | 49 | 2018-10-19T08:49:10.000Z | 2021-11-23T02:52:04.000Z | tensorflow_estimator/python/estimator/canned/linear_optimizer/python/utils/sharded_mutable_dense_hashtable_test.py | burgerkingeater/estimator | 4c38177f1a842d2169f90e1095f85e49e794a564 | [
"Apache-2.0"
] | 228 | 2018-10-10T14:41:08.000Z | 2022-03-28T10:54:05.000Z | # Copyright 2018 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... | 38.183333 | 148 | 0.629201 | # Copyright 2018 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... | 3,269 | 0 | 75 |
46daf1c20cac94292d8ca272a96258554d245961 | 32,653 | py | Python | teapal-backend/qa/views.py | LGU-Starup/TeaPal-Proj | 242d61786dc792fe924b3e697c9635ca9dd672be | [
"MIT"
] | null | null | null | teapal-backend/qa/views.py | LGU-Starup/TeaPal-Proj | 242d61786dc792fe924b3e697c9635ca9dd672be | [
"MIT"
] | null | null | null | teapal-backend/qa/views.py | LGU-Starup/TeaPal-Proj | 242d61786dc792fe924b3e697c9635ca9dd672be | [
"MIT"
] | null | null | null | import collections
from django.shortcuts import get_object_or_404
from django.http import JsonResponse, HttpResponse
from .models import *
from django.db.utils import IntegrityError
from django.views.decorators.http import require_http_methods
from django.forms.models import model_to_dict
from itertools import chain
fr... | 37.446101 | 136 | 0.635286 | import collections
from django.shortcuts import get_object_or_404
from django.http import JsonResponse, HttpResponse
from .models import *
from django.db.utils import IntegrityError
from django.views.decorators.http import require_http_methods
from django.forms.models import model_to_dict
from itertools import chain
fr... | 22,996 | 0 | 599 |
fa3287451859fbbd8f63533dcfe9c458aef5e239 | 1,295 | py | Python | dev/profiling/profiling-versus-bw2.py | mixib/matrix_utils | 6e59f4179980d705face350d839ca4bd951e3c3c | [
"BSD-3-Clause"
] | 1 | 2021-02-22T11:57:43.000Z | 2021-02-22T11:57:43.000Z | dev/profiling/profiling-versus-bw2.py | mixib/matrix_utils | 6e59f4179980d705face350d839ca4bd951e3c3c | [
"BSD-3-Clause"
] | 5 | 2021-05-27T13:08:42.000Z | 2021-11-01T20:52:55.000Z | dev/profiling/profiling-versus-bw2.py | mixib/matrix_utils | 6e59f4179980d705face350d839ca4bd951e3c3c | [
"BSD-3-Clause"
] | 2 | 2021-06-14T09:04:08.000Z | 2021-09-17T12:30:36.000Z | from functools import partial
import psutil
import time
# Code for bw2
import bw2data as bd, bw2calc as bc
bd.projects.set_current("ecoinvent 3.7.1 bw2")
bd.databases
a = bd.get_activity(('ecoinvent 3.7.1', 'f57568b2e553864152a6ac920595216f'))
a
ipcc = ('IPCC 2013', 'climate change', 'GWP 100a')
curry = parti... | 23.125 | 104 | 0.705792 | from functools import partial
import psutil
import time
def run_curried_lca(func):
lca = func()
lca.lci()
lca.lcia()
print(lca.score)
def profile_func(func):
# Logging code adapted from https://github.com/rasbt/pyprind/blob/master/pyprind/prog_class.py
start = time.time()
process = psuti... | 425 | 0 | 46 |
14db163e8d3bf528c299b62c698afda85435885e | 861 | py | Python | simple_pubsub_python/simple_pubsub_python/natural_number_generator.py | jyhh1992/test_ros2 | 98c70b6012ab11a51f5ac3792a4cbdc8b28a5a28 | [
"Apache-2.0"
] | null | null | null | simple_pubsub_python/simple_pubsub_python/natural_number_generator.py | jyhh1992/test_ros2 | 98c70b6012ab11a51f5ac3792a4cbdc8b28a5a28 | [
"Apache-2.0"
] | null | null | null | simple_pubsub_python/simple_pubsub_python/natural_number_generator.py | jyhh1992/test_ros2 | 98c70b6012ab11a51f5ac3792a4cbdc8b28a5a28 | [
"Apache-2.0"
] | null | null | null | import rclpy
from rclpy.node import Node
from std_msgs.msg import Int64
if __name__ == '__main__':
main() | 26.90625 | 83 | 0.684088 | import rclpy
from rclpy.node import Node
from std_msgs.msg import Int64
class NaturalNumberGenerator(Node):
def __init__(self):
super().__init__('natural_number_genertor')
self.publisher_ = self.create_publisher(Int64, 'natural_number_signal', 10)
timer_period = 3
self.timer = sel... | 635 | 14 | 100 |
7d94cfc8d0c6fe2f760a7e2d509c5c6e09e8b2bc | 1,298 | py | Python | app/core/case_constructor.py | dudongpeng/pity | 11577429127dd175fc32e89890befbfb0c982f6d | [
"Apache-2.0"
] | 1 | 2022-02-09T10:56:34.000Z | 2022-02-09T10:56:34.000Z | app/core/case_constructor.py | dudongpeng/pity | 11577429127dd175fc32e89890befbfb0c982f6d | [
"Apache-2.0"
] | null | null | null | app/core/case_constructor.py | dudongpeng/pity | 11577429127dd175fc32e89890befbfb0c982f6d | [
"Apache-2.0"
] | null | null | null | import json
from app.core.constructor import ConstructorAbstract
from app.dao.test_case.TestCaseDao import TestCaseDao
from app.models.constructor import Constructor
| 41.870968 | 112 | 0.628659 | import json
from app.core.constructor import ConstructorAbstract
from app.dao.test_case.TestCaseDao import TestCaseDao
from app.models.constructor import Constructor
class TestcaseConstructor(ConstructorAbstract):
@staticmethod
async def run(executor, env, index, path, params, req_params, constructor: Const... | 1,098 | 71 | 23 |
6d45a10e0e375e6e1f3c88aada3b9c599761cd62 | 491 | py | Python | easy/2D_array.py | YANG007SUN/hackerrank_challenge | 0c055c9e5129f1625fe86174435a89c141d256d6 | [
"Apache-2.0"
] | null | null | null | easy/2D_array.py | YANG007SUN/hackerrank_challenge | 0c055c9e5129f1625fe86174435a89c141d256d6 | [
"Apache-2.0"
] | null | null | null | easy/2D_array.py | YANG007SUN/hackerrank_challenge | 0c055c9e5129f1625fe86174435a89c141d256d6 | [
"Apache-2.0"
] | null | null | null | # https://www.hackerrank.com/challenges/2d-array/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays
arr = []
for _ in range(6):
arr.append(list(map(int, input().rstrip().split())))
hourglassSum(arr) | 30.6875 | 145 | 0.627291 | # https://www.hackerrank.com/challenges/2d-array/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays
def hourglassSum(arr):
results = []
for i in range(4):
for j in range(4):
results.append(arr[i][j]+arr[i][j+1]+arr[i][j+2]+arr[i+1][j+1]+arr[i+2]... | 217 | 0 | 23 |
b989d907fb0ad9e404c2d26101ba5adb24f02308 | 9,085 | py | Python | storm_optimizer/storm_optimizer.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | storm_optimizer/storm_optimizer.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | storm_optimizer/storm_optimizer.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 39.159483 | 79 | 0.667694 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 4,982 | 0 | 201 |
e5d82ed564d1ea2ea3c2cf56c666c2f6dc238168 | 3,663 | py | Python | fn/sub_main.py | elsou/ETSE-Warbot | 4fd5351688e3cd81d9eeed50586027830dba0c5b | [
"MIT"
] | 2 | 2021-11-09T23:14:53.000Z | 2021-11-11T01:09:28.000Z | fn/sub_main.py | elsou/etse-warbot | 4fd5351688e3cd81d9eeed50586027830dba0c5b | [
"MIT"
] | null | null | null | fn/sub_main.py | elsou/etse-warbot | 4fd5351688e3cd81d9eeed50586027830dba0c5b | [
"MIT"
] | null | null | null | import random
from fn import build_tweet
from fn import get
from fn import instaAPI
from fn import media
from fn import storage
from fn import twitterAPI
from fn.classes import Ftext
| 26.933824 | 84 | 0.607153 | import random
from fn import build_tweet
from fn import get
from fn import instaAPI
from fn import media
from fn import storage
from fn import twitterAPI
from fn.classes import Ftext
class Fighters:
def __init__(self, asesino, asesino2, victima, victima2):
self.asesino = asesino
self.asesino2 = as... | 3,299 | -6 | 187 |
406567a6afd0b6d7aa0146a6b1ebb5faf208542b | 1,619 | py | Python | figures/apps.py | bvenkatr/figures | 8724cfac8d8bd3b60f1394eb5eda2fef282770c0 | [
"MIT"
] | null | null | null | figures/apps.py | bvenkatr/figures | 8724cfac8d8bd3b60f1394eb5eda2fef282770c0 | [
"MIT"
] | null | null | null | figures/apps.py | bvenkatr/figures | 8724cfac8d8bd3b60f1394eb5eda2fef282770c0 | [
"MIT"
] | null | null | null | """
Provides application configuration for Figures.
As well as default values for running Figures along with functions to
add entries to the Django conf settings needed to run Figures.
"""
from django.apps import AppConfig
try:
from openedx.core.djangoapps.plugins.constants import (
ProjectType, Settings... | 26.983333 | 86 | 0.596665 | """
Provides application configuration for Figures.
As well as default values for running Figures along with functions to
add entries to the Django conf settings needed to run Figures.
"""
from django.apps import AppConfig
try:
from openedx.core.djangoapps.plugins.constants import (
ProjectType, Settings... | 0 | 0 | 0 |
b0fb038ca16eec236e6568df954a1a48cbb60bfe | 6,504 | py | Python | WWTManager.py | FWMSH/WWTManager | 919440492f7fd9a5209ee7fafe4c04f2010d1745 | [
"MIT"
] | null | null | null | WWTManager.py | FWMSH/WWTManager | 919440492f7fd9a5209ee7fafe4c04f2010d1745 | [
"MIT"
] | null | null | null | WWTManager.py | FWMSH/WWTManager | 919440492f7fd9a5209ee7fafe4c04f2010d1745 | [
"MIT"
] | null | null | null | import requests
import subprocess
import time
import sched
import xml.etree.ElementTree as xmlET
import configparser
from pyautogui import press
parser = configparser.ConfigParser()
#parser.read('C:\\Users\\user\\Desktop\\config.INI')
parser.read('C:\\Users\\Morgan.Rehnberg\\Desktop\\config.INI')
config = parser['Conf... | 29.429864 | 123 | 0.617774 | import requests
import subprocess
import time
import sched
import xml.etree.ElementTree as xmlET
import configparser
from pyautogui import press
parser = configparser.ConfigParser()
#parser.read('C:\\Users\\user\\Desktop\\config.INI')
parser.read('C:\\Users\\Morgan.Rehnberg\\Desktop\\config.INI')
config = parser['Conf... | 5,069 | 0 | 219 |
b6607d633cee9ef82cbd1e8478f6981a9e97f3e2 | 677 | py | Python | src/reduce_squared_matrix.py | mgalardini/2018_ecoli_pathogenicity | f6bfec0fa91bdbea00f55184aa231c56a94daacb | [
"Apache-2.0"
] | 2 | 2018-05-01T14:59:13.000Z | 2019-07-23T18:16:31.000Z | src/reduce_squared_matrix.py | mgalardini/2018_ecoli_pathogenicity | f6bfec0fa91bdbea00f55184aa231c56a94daacb | [
"Apache-2.0"
] | null | null | null | src/reduce_squared_matrix.py | mgalardini/2018_ecoli_pathogenicity | f6bfec0fa91bdbea00f55184aa231c56a94daacb | [
"Apache-2.0"
] | 1 | 2021-09-21T14:47:18.000Z | 2021-09-21T14:47:18.000Z | #!/usr/bin/env python
import sys
import argparse
import pandas as pd
if __name__ == "__main__":
options = get_options()
m = pd.read_csv(options.df, sep='\t', index_col=0)
s = pd.read_csv(options.matrix, sep='\t', index_col=0)
idx = s.index.intersection(m.index)
s.loc[idx, idx].to_csv(sys.stdou... | 24.178571 | 65 | 0.645495 | #!/usr/bin/env python
import sys
import argparse
import pandas as pd
def get_options():
description = 'Reduce squared matrix using another dataframe'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('df',
help='Samples dataframe')
parser.add_argu... | 321 | 0 | 23 |
c057ec7be98f1a6b220432ffaaaf03796c99afa0 | 39 | py | Python | bql/__init__.py | BiznetGIO/bql | 15b1c8ab7306acdab488a475887c1ec865190550 | [
"MIT"
] | 1 | 2019-10-23T04:45:28.000Z | 2019-10-23T04:45:28.000Z | bql/__init__.py | BiznetGIO/bql | 15b1c8ab7306acdab488a475887c1ec865190550 | [
"MIT"
] | null | null | null | bql/__init__.py | BiznetGIO/bql | 15b1c8ab7306acdab488a475887c1ec865190550 | [
"MIT"
] | null | null | null | from bql.bql import BQLParser, BQLError | 39 | 39 | 0.846154 | from bql.bql import BQLParser, BQLError | 0 | 0 | 0 |
b5c73c48c92da0c223bf6e12ce5c5dab0f39a836 | 4,137 | py | Python | HeatMap.py | robertklee/SENG474-DataMining | 1996e263fb9a84d62ceab2b2402cbbcaf7a1e2d7 | [
"MIT"
] | 14 | 2021-03-09T06:38:39.000Z | 2022-03-11T16:21:46.000Z | HeatMap.py | axjing/PoseEstimate | 85b6ff300e18320fe8b40c89d5f22fde51ba588e | [
"MIT"
] | 23 | 2021-03-07T20:50:50.000Z | 2022-01-17T04:01:08.000Z | HeatMap.py | axjing/PoseEstimate | 85b6ff300e18320fe8b40c89d5f22fde51ba588e | [
"MIT"
] | 9 | 2021-04-13T16:21:44.000Z | 2022-02-23T06:08:30.000Z | import io
import os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.ndimage as ndimage
from PIL import Image
#Plot the figure
###Save the figure
#Return heatmap array
| 35.663793 | 133 | 0.591733 | import io
import os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.ndimage as ndimage
from PIL import Image
class HeatMap:
def __init__(self,image,heat_map,gaussian_std=10):
#if image is numpy array
if isinstance(image,np.ndarray):
height = image.sha... | 3,799 | -7 | 127 |
7c1adb7539cebd31cecc2d4235bba82164f11409 | 667 | py | Python | scripts/maintenance/se/simpleslugger.py | OpendataCH/publicbodies | f0c825df05e3c9d0edddabd14ecd993dafa01983 | [
"MIT"
] | 32 | 2015-02-04T14:41:16.000Z | 2022-03-31T15:34:11.000Z | scripts/maintenance/se/simpleslugger.py | OpendataCH/publicbodies | f0c825df05e3c9d0edddabd14ecd993dafa01983 | [
"MIT"
] | 67 | 2015-01-06T18:09:46.000Z | 2022-03-29T13:28:23.000Z | scripts/maintenance/se/simpleslugger.py | OpendataCH/publicbodies | f0c825df05e3c9d0edddabd14ecd993dafa01983 | [
"MIT"
] | 18 | 2015-09-12T17:29:18.000Z | 2021-11-04T13:05:13.000Z | # -*- coding: utf-8 -*-
from nltk.corpus import stopwords as _stopwords
from curses.ascii import isascii
import unicodedata
language = "swedish"
stopwords = list(_stopwords.words(language))
punctuation = u'!(),-.:;?'
make_ascii = lambda text: \
filter(isascii, unicodedata.normalize('NFD', text).encode('utf-8'))
| 30.318182 | 108 | 0.658171 | # -*- coding: utf-8 -*-
from nltk.corpus import stopwords as _stopwords
from curses.ascii import isascii
import unicodedata
language = "swedish"
stopwords = list(_stopwords.words(language))
punctuation = u'!(),-.:;?'
make_ascii = lambda text: \
filter(isascii, unicodedata.normalize('NFD', text).encode('utf-8'))
... | 302 | 0 | 46 |
a6cd0ec583f47a6bf05bc8fe2005b4e0ccb44c3a | 90 | py | Python | rustproj/utils/error.py | frankhart2018/rustproj | 76e74fc0ee261b26ce23436e83f11b41e6c57a51 | [
"MIT"
] | null | null | null | rustproj/utils/error.py | frankhart2018/rustproj | 76e74fc0ee261b26ce23436e83f11b41e6c57a51 | [
"MIT"
] | null | null | null | rustproj/utils/error.py | frankhart2018/rustproj | 76e74fc0ee261b26ce23436e83f11b41e6c57a51 | [
"MIT"
] | null | null | null | import sys
| 15 | 40 | 0.633333 | import sys
def throw_error(msg):
print(f"\033[91mError: {msg}\033[m")
sys.exit() | 56 | 0 | 23 |
104a7d4b08a1d0978c53e3b11e9f6682cd8f95e5 | 3,806 | py | Python | backend/twipcrawler.py | cloudhs7/team-project-team4 | c9f784209636b52c4373c38a121d10688d8a6cae | [
"MIT"
] | 4 | 2019-05-02T07:40:24.000Z | 2019-05-22T01:16:58.000Z | backend/twipcrawler.py | cloudhs7/team-project-team4 | c9f784209636b52c4373c38a121d10688d8a6cae | [
"MIT"
] | 9 | 2019-05-29T12:35:09.000Z | 2019-06-22T07:30:08.000Z | backend/twipcrawler.py | cloudhs7/team-project-team4 | c9f784209636b52c4373c38a121d10688d8a6cae | [
"MIT"
] | 7 | 2019-05-12T12:45:14.000Z | 2019-06-21T17:09:48.000Z | from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSo... | 32.810345 | 131 | 0.671571 | from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSo... | 1,466 | 0 | 44 |
8f833765d9caedf3232ffc63110ef1e509ea0f3f | 3,227 | py | Python | multifield_batch_update/db/change_log.py | matthayes/anki_multifield_batch_update | 4960a6e969256ff0df2ebf37312e80fa009fcddb | [
"Apache-2.0"
] | 4 | 2019-07-16T21:09:45.000Z | 2021-11-27T12:13:44.000Z | multifield_batch_update/db/change_log.py | matthayes/anki_multifield_batch_update | 4960a6e969256ff0df2ebf37312e80fa009fcddb | [
"Apache-2.0"
] | null | null | null | multifield_batch_update/db/change_log.py | matthayes/anki_multifield_batch_update | 4960a6e969256ff0df2ebf37312e80fa009fcddb | [
"Apache-2.0"
] | 1 | 2020-07-05T23:55:24.000Z | 2020-07-05T23:55:24.000Z | # Copyright 2019 Matthew Hayes
# 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, s... | 34.329787 | 86 | 0.574837 | # Copyright 2019 Matthew Hayes
# 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, s... | 2,254 | 0 | 188 |
43aacf6bcd034afc60084586c76aefc9844dab92 | 4,942 | py | Python | genQues/APIv1/getRanking.py | aotella/calcoff_backend | 7f25ff494ea2e1e4119fe7450d805c986fa77f0c | [
"Apache-2.0",
"MIT"
] | null | null | null | genQues/APIv1/getRanking.py | aotella/calcoff_backend | 7f25ff494ea2e1e4119fe7450d805c986fa77f0c | [
"Apache-2.0",
"MIT"
] | null | null | null | genQues/APIv1/getRanking.py | aotella/calcoff_backend | 7f25ff494ea2e1e4119fe7450d805c986fa77f0c | [
"Apache-2.0",
"MIT"
] | null | null | null | from ..models import *
from login.models import *
#
| 46.186916 | 136 | 0.527317 | from ..models import *
from login.models import *
#
def rankingFunction(data):
try:
rankingObj = rankingSet.objects.filter(questionID=data['questionID'])
sendData = []
userList = []
rank = 0
for i in rankingObj:
rank = rank+1
sendData.append({"userName... | 4,840 | 0 | 45 |
ffad203edf2deb99e9254250c1720f11ed1f3478 | 33 | py | Python | config.py | codexgigassys/neokanji | d58da181ff0220f5e676e66db3a384c3419a99e7 | [
"MIT"
] | 8 | 2017-10-31T18:11:19.000Z | 2020-12-05T02:54:14.000Z | config.py | codexgigassys/neokanji | d58da181ff0220f5e676e66db3a384c3419a99e7 | [
"MIT"
] | null | null | null | config.py | codexgigassys/neokanji | d58da181ff0220f5e676e66db3a384c3419a99e7 | [
"MIT"
] | 3 | 2017-10-13T14:36:34.000Z | 2020-12-05T02:54:25.000Z | user = ""
password = ""
port = "" | 11 | 13 | 0.484848 | user = ""
password = ""
port = "" | 0 | 0 | 0 |
4087c71c1237c3dbe539237d251d91b04f2c594d | 9,609 | py | Python | engine/visualize_infer.py | neolixcn/MonoFlex | 1c4c2f02e0739fd1e34ef68737a4a6d04a0a8559 | [
"MIT"
] | null | null | null | engine/visualize_infer.py | neolixcn/MonoFlex | 1c4c2f02e0739fd1e34ef68737a4a6d04a0a8559 | [
"MIT"
] | null | null | null | engine/visualize_infer.py | neolixcn/MonoFlex | 1c4c2f02e0739fd1e34ef68737a4a6d04a0a8559 | [
"MIT"
] | 1 | 2021-10-20T02:02:02.000Z | 2021-10-20T02:02:02.000Z | import numpy as np
import matplotlib.pyplot as plt
import torch
import cv2
cv2.setNumThreads(0)
import os
import pdb
from PIL import Image
from scipy.optimize import minimize
from config import TYPE_ID_CONVERSION
from shapely.geometry import Polygon
from config import cfg
from utils.visualizer import Visualizer
from ... | 36.957692 | 129 | 0.676241 | import numpy as np
import matplotlib.pyplot as plt
import torch
import cv2
cv2.setNumThreads(0)
import os
import pdb
from PIL import Image
from scipy.optimize import minimize
from config import TYPE_ID_CONVERSION
from shapely.geometry import Polygon
from config import cfg
from utils.visualizer import Visualizer
from ... | 8,736 | 0 | 113 |
cc094e30e3c3cc292151eb3c33ee620b5d9e0806 | 56 | py | Python | booru_extension/__init__.py | Oreko/YABA | 7bd655e77668db2852d123a080cff0c5b1e52f11 | [
"MIT"
] | null | null | null | booru_extension/__init__.py | Oreko/YABA | 7bd655e77668db2852d123a080cff0c5b1e52f11 | [
"MIT"
] | 1 | 2021-05-04T03:52:35.000Z | 2021-05-04T03:52:35.000Z | booru_extension/__init__.py | Oreko/YABA | 7bd655e77668db2852d123a080cff0c5b1e52f11 | [
"MIT"
] | null | null | null | from booru_extension.altbooru import Gelbooru, Safebooru | 56 | 56 | 0.892857 | from booru_extension.altbooru import Gelbooru, Safebooru | 0 | 0 | 0 |
ac6573d639886432ae77e1850cf4995b5a652159 | 1,357 | py | Python | src/sentry/api/endpoints/organization_integration_repos.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | 1 | 2019-05-28T06:18:03.000Z | 2019-05-28T06:18:03.000Z | src/sentry/api/endpoints/organization_integration_repos.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | 6 | 2018-10-19T10:04:23.000Z | 2019-12-09T20:29:12.000Z | src/sentry/api/endpoints/organization_integration_repos.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.http import Http404
from sentry.constants import ObjectStatus
from sentry.api.bases.organization import (
OrganizationEndpoint, OrganizationIntegrationsPermission
)
from sentry.integrations.exceptions import IntegrationError
from sentry.integrations.repositories ... | 34.794872 | 96 | 0.713338 | from __future__ import absolute_import
from django.http import Http404
from sentry.constants import ObjectStatus
from sentry.api.bases.organization import (
OrganizationEndpoint, OrganizationIntegrationsPermission
)
from sentry.integrations.exceptions import IntegrationError
from sentry.integrations.repositories ... | 817 | 135 | 23 |
f45f6851322398a0e3171e53f140b7a4fe76e7c5 | 171 | py | Python | launchable/test_runners/rspec.py | Songmu/cli | f4814e30cedad3feb5e46fd4617238a44717d4bb | [
"Apache-2.0"
] | null | null | null | launchable/test_runners/rspec.py | Songmu/cli | f4814e30cedad3feb5e46fd4617238a44717d4bb | [
"Apache-2.0"
] | null | null | null | launchable/test_runners/rspec.py | Songmu/cli | f4814e30cedad3feb5e46fd4617238a44717d4bb | [
"Apache-2.0"
] | null | null | null | from . import launchable
subset = launchable.CommonSubsetImpls(__name__).scan_files('*_spec.rb')
record_tests = launchable.CommonRecordTestImpls(__name__).report_files()
| 34.2 | 72 | 0.824561 | from . import launchable
subset = launchable.CommonSubsetImpls(__name__).scan_files('*_spec.rb')
record_tests = launchable.CommonRecordTestImpls(__name__).report_files()
| 0 | 0 | 0 |
8e9b1402c70366352db03068fabcd05ac6be740a | 151 | py | Python | spidey_simulation/spidey_py/spidey_python/omniverse/robot/spidey/__init__.py | JasonJZLiu/Spidey-Quadruped | 74c1817f997b354bae4fffd2728f2cc94947062c | [
"MIT"
] | 5 | 2021-06-14T03:12:18.000Z | 2021-12-23T12:58:56.000Z | spidey_simulation/spidey_py/spidey_python/omniverse/robot/spidey/__init__.py | JasonJZLiu/Spidey-Quadruped | 74c1817f997b354bae4fffd2728f2cc94947062c | [
"MIT"
] | null | null | null | spidey_simulation/spidey_py/spidey_python/omniverse/robot/spidey/__init__.py | JasonJZLiu/Spidey-Quadruped | 74c1817f997b354bae4fffd2728f2cc94947062c | [
"MIT"
] | null | null | null | """
This module defines classes for various parts of the franka-allegro robot.
"""
from .types import SpideyDim
from .spidey import SpideyBot
# EOF
| 15.1 | 74 | 0.754967 | """
This module defines classes for various parts of the franka-allegro robot.
"""
from .types import SpideyDim
from .spidey import SpideyBot
# EOF
| 0 | 0 | 0 |
071eaae4f3253bf43d5348db29a42642d687db6d | 2,975 | py | Python | client/oauth_ssh/config.py | globus/globus-ssh-client | 84b8fb1b1badd948c15cd8ac9b277ed75b5e70c6 | [
"Apache-2.0"
] | 2 | 2018-05-08T19:57:23.000Z | 2019-03-13T04:54:56.000Z | client/oauth_ssh/config.py | globus/globus-ssh-client | 84b8fb1b1badd948c15cd8ac9b277ed75b5e70c6 | [
"Apache-2.0"
] | 35 | 2018-03-13T14:50:03.000Z | 2019-04-10T13:29:22.000Z | client/oauth_ssh/config.py | globus/globus-ssh-client | 84b8fb1b1badd948c15cd8ac9b277ed75b5e70c6 | [
"Apache-2.0"
] | null | null | null | import stat
import ast
import os
import configparser
from .constants import *
from .exceptions import OAuthSSHError
class ConfigError(OAuthSSHError):
"""Base exception for all Config exceptions"""
| 27.803738 | 78 | 0.635966 | import stat
import ast
import os
import configparser
from .constants import *
from .exceptions import OAuthSSHError
class ConfigError(OAuthSSHError):
"""Base exception for all Config exceptions"""
def _check_permissions(path):
if os.path.exists(path):
if not os.path.isfile(path):
raise ... | 2,555 | 0 | 207 |
8301dbe90a3fbe39dec3014f801bd24d3949516e | 516 | py | Python | examples/arduino/basic.py | kimsooyoung/rtcbot | 4f495fbc2189da04701641e0301c684e9dd74f91 | [
"MIT"
] | 35 | 2019-09-19T16:27:21.000Z | 2022-03-23T10:10:08.000Z | examples/arduino/basic.py | kimsooyoung/rtcbot | 4f495fbc2189da04701641e0301c684e9dd74f91 | [
"MIT"
] | 25 | 2019-08-15T07:30:29.000Z | 2021-12-09T22:49:40.000Z | examples/arduino/basic.py | kimsooyoung/rtcbot | 4f495fbc2189da04701641e0301c684e9dd74f91 | [
"MIT"
] | 20 | 2019-03-10T22:39:07.000Z | 2022-03-15T12:24:28.000Z | import asyncio
from rtcbot import SerialConnection
import logging
logging.basicConfig(level=logging.DEBUG)
loop = asyncio.get_event_loop()
conn = SerialConnection("/dev/ttyACM0", startByte=bytes([192, 105]))
@conn.onReady
asyncio.ensure_future(sendAndReceive(conn))
loop.run_forever()
| 17.793103 | 68 | 0.705426 | import asyncio
from rtcbot import SerialConnection
import logging
logging.basicConfig(level=logging.DEBUG)
async def sendAndReceive(conn):
conn.put_nowait("Hello world!")
while True:
msg = (await conn.get()).decode("ascii")
print(msg)
await asyncio.sleep(1)
loop = asyncio.get_event... | 176 | 0 | 45 |
ea9a2cf279b24b7f2b4b8f7b1f05805e07be312c | 3,781 | py | Python | weather.py | JJBarata/weatherpy | d2ef33436fb19566863cba9dc4ce24ac4d33c8f1 | [
"MIT"
] | null | null | null | weather.py | JJBarata/weatherpy | d2ef33436fb19566863cba9dc4ce24ac4d33c8f1 | [
"MIT"
] | null | null | null | weather.py | JJBarata/weatherpy | d2ef33436fb19566863cba9dc4ce24ac4d33c8f1 | [
"MIT"
] | null | null | null | from configparser import ConfigParser
import argparse
import json
import sys
from urllib import parse, request, error
from pprint import pp
import style
BASE_WEATHER_API_URL = 'http://api.openweathermap.org/data/2.5/weather'
# Weather Condition Codes
THUNDERSTORM = range(200, 300)
DRIZZLE = range(300, 400)
RAIN = ra... | 31.247934 | 89 | 0.66649 | from configparser import ConfigParser
import argparse
import json
import sys
from urllib import parse, request, error
from pprint import pp
import style
BASE_WEATHER_API_URL = 'http://api.openweathermap.org/data/2.5/weather'
# Weather Condition Codes
THUNDERSTORM = range(200, 300)
DRIZZLE = range(300, 400)
RAIN = ra... | 2,699 | 0 | 133 |
65142e09165494e91275464804b35ceef0ddc32b | 84 | py | Python | abc/abc152/abc152a.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | abc/abc152/abc152a.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | abc/abc152/abc152a.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | N, M = map(int, input().split())
if N == M:
print('Yes')
else:
print('No')
| 12 | 32 | 0.488095 | N, M = map(int, input().split())
if N == M:
print('Yes')
else:
print('No')
| 0 | 0 | 0 |
1d0037311a2f57c0438c0a9399c484fb5f3b63b9 | 1,246 | py | Python | utils/logutil.py | SpatialPerceptionNeuralNetwork/SOA_DORN_TF | 33814467e9135036abf28f2da19c5984c8744089 | [
"Unlicense"
] | 17 | 2019-02-17T07:39:39.000Z | 2021-08-17T05:20:19.000Z | utils/logutil.py | SpatialPerceptionNeuralNetwork/SOA_DORN_TF | 33814467e9135036abf28f2da19c5984c8744089 | [
"Unlicense"
] | 6 | 2019-03-04T14:17:22.000Z | 2019-11-07T15:06:55.000Z | utils/logutil.py | SpatialPerceptionNeuralNetwork/SOA_DORN_TF | 33814467e9135036abf28f2da19c5984c8744089 | [
"Unlicense"
] | 4 | 2019-02-17T07:39:47.000Z | 2019-08-13T17:13:23.000Z | import os as _os
import tensorflow as _tf
from time import gmtime, strftime
import logging
import logging.handlers
_logger = None
_FLAGS = _tf.app.flags.FLAGS
| 28.976744 | 102 | 0.691814 | import os as _os
import tensorflow as _tf
from time import gmtime, strftime
import logging
import logging.handlers
_logger = None
_FLAGS = _tf.app.flags.FLAGS
def _generate_logger():
# log_format = "%(asctime)s [%(levelname)s]: %(filename)s(%(funcName)s:%(lineno)s) >> %(message)s"
log_format = "%(asctime)s [... | 1,038 | 0 | 46 |
fb2a2f55fc4b8520d4d1d757c3e950ea21fafe19 | 6,597 | py | Python | compute_strength.py | CLArg-group/Aspect-Item-Recommender-Systems | 6fe98657cb17bcb8f4eb4606bdea7446909f4a71 | [
"Apache-2.0"
] | 1 | 2021-02-09T21:40:08.000Z | 2021-02-09T21:40:08.000Z | compute_strength.py | CLArg-group/Aspect-Item-Recommender-Systems | 6fe98657cb17bcb8f4eb4606bdea7446909f4a71 | [
"Apache-2.0"
] | null | null | null | compute_strength.py | CLArg-group/Aspect-Item-Recommender-Systems | 6fe98657cb17bcb8f4eb4606bdea7446909f4a71 | [
"Apache-2.0"
] | 1 | 2021-02-09T21:40:55.000Z | 2021-02-09T21:40:55.000Z | ''' calculate film strength'''
import operator
| 39.267857 | 151 | 0.674397 | ''' calculate film strength'''
import operator
def film_strength(MUR, MUG, MUA, MUD, user_id, film_id, films, ratings, similarities_for_user, movies_genres, movies_directors, movies_actors):
nSimUsers = 20 # number of similar users to use
simsSorted = sorted(similarities_for_user, key = operator.itemgetter(1), re... | 6,501 | 0 | 46 |
93fdb1e914f110f361666725352474d6a596ffc7 | 8,771 | py | Python | training/utils.py | NeoBoy/tarteel-ml | c85a7f116335dd3f1386904f74f395caef98d402 | [
"MIT"
] | 94 | 2019-11-04T22:15:32.000Z | 2022-03-17T15:40:13.000Z | training/utils.py | NeoBoy/tarteel-ml | c85a7f116335dd3f1386904f74f395caef98d402 | [
"MIT"
] | 28 | 2018-12-31T23:34:01.000Z | 2019-09-07T17:15:57.000Z | training/utils.py | NeoBoy/tarteel-ml | c85a7f116335dd3f1386904f74f395caef98d402 | [
"MIT"
] | 28 | 2019-12-25T01:00:41.000Z | 2022-03-28T14:35:17.000Z | """
Contains helper methods that are used to train and infer Tarteel ML models
"""
import dill as pickle
import numpy as np
import os
def convert_list_of_arrays_to_padded_array(list_varying_sizes, pad_value=0):
"""
Converts a list of 2D arrays of varying sizes to a single 3D numpy array. The extra elements ar... | 44.75 | 120 | 0.695588 | """
Contains helper methods that are used to train and infer Tarteel ML models
"""
import dill as pickle
import numpy as np
import os
def convert_list_of_arrays_to_padded_array(list_varying_sizes, pad_value=0):
"""
Converts a list of 2D arrays of varying sizes to a single 3D numpy array. The extra elements ar... | 1,598 | 0 | 27 |
aee3ba303dbcf0980823146a51f3e991111cff65 | 45 | py | Python | slack/models/__init__.py | oditorium/django-slack | b79534f7da5917934997aad033592bbfcefe51d8 | [
"MIT"
] | 2 | 2016-03-26T17:02:46.000Z | 2018-03-19T06:06:05.000Z | slack/models/__init__.py | oditorium/django-slack | b79534f7da5917934997aad033592bbfcefe51d8 | [
"MIT"
] | null | null | null | slack/models/__init__.py | oditorium/django-slack | b79534f7da5917934997aad033592bbfcefe51d8 | [
"MIT"
] | null | null | null | from .models import *
from .keyvalue import * | 22.5 | 23 | 0.755556 | from .models import *
from .keyvalue import * | 0 | 0 | 0 |
5c11437158cb3b93c0fcc3b86da00612f99c2f96 | 3,871 | py | Python | gempa/tasks.py | ekaputra07/gempa-monitor | 445684efaaabacd021f256be629308caa3e91187 | [
"MIT"
] | 5 | 2015-01-19T07:35:36.000Z | 2019-12-19T03:28:37.000Z | gempa/tasks.py | ekaputra07/gempa-monitor | 445684efaaabacd021f256be629308caa3e91187 | [
"MIT"
] | 2 | 2015-01-19T06:57:57.000Z | 2016-05-11T11:29:33.000Z | gempa/tasks.py | ekaputra07/gempa-monitor | 445684efaaabacd021f256be629308caa3e91187 | [
"MIT"
] | 1 | 2021-01-10T03:16:40.000Z | 2021-01-10T03:16:40.000Z | import csv
import urllib2
import re
from datetime import datetime, timedelta
from django.conf import settings
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from bs4 import BeautifulSoup
from gempa.models import Gempa, Event
def str_to_datetime(datetime_str):
"""
Conve... | 28.255474 | 88 | 0.576337 | import csv
import urllib2
import re
from datetime import datetime, timedelta
from django.conf import settings
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from bs4 import BeautifulSoup
from gempa.models import Gempa, Event
def str_to_datetime(datetime_str):
"""
Conve... | 0 | 0 | 0 |
f8ce741714c0df21bc55b6862fef9c269cdd67f7 | 557 | py | Python | setup.py | bcb/mpup | fc672aea978a5ee67a515f95efae479dc94677b6 | [
"MIT"
] | 1 | 2019-02-26T20:53:49.000Z | 2019-02-26T20:53:49.000Z | setup.py | bcb/mpup | fc672aea978a5ee67a515f95efae479dc94677b6 | [
"MIT"
] | 3 | 2016-09-06T03:48:11.000Z | 2016-09-06T03:48:49.000Z | setup.py | bcb/mpup | fc672aea978a5ee67a515f95efae479dc94677b6 | [
"MIT"
] | 3 | 2017-05-04T08:01:28.000Z | 2020-01-17T00:42:54.000Z | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.rst', 'r', 'utf-8') as f:
readme = f.read()
setup(
name='mipy',
version='0.0.1',
description='Copy files to Micropython',
long_description=readme,
author='Beau Barker',
author_email... | 22.28 | 50 | 0.631957 | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.rst', 'r', 'utf-8') as f:
readme = f.read()
setup(
name='mipy',
version='0.0.1',
description='Copy files to Micropython',
long_description=readme,
author='Beau Barker',
author_email... | 0 | 0 | 0 |
82a17ce5ec530d47f1ea2e894eb1bdcd0240f158 | 957 | py | Python | server/core/models/menu.py | firzad/WaitLess | 98d1c436712176a4a144f3aaf851fc7ac912d26f | [
"MIT"
] | null | null | null | server/core/models/menu.py | firzad/WaitLess | 98d1c436712176a4a144f3aaf851fc7ac912d26f | [
"MIT"
] | null | null | null | server/core/models/menu.py | firzad/WaitLess | 98d1c436712176a4a144f3aaf851fc7ac912d26f | [
"MIT"
] | null | null | null | from core import db
from .category import Category
| 34.178571 | 85 | 0.691745 | from core import db
from .category import Category
class Menu(db.Model):
__tablename__ = 'menu'
menu_id = db.Column(db.Integer, primary_key=True)
category_id = db.Column(db.Integer, db.ForeignKey('category.category_id'))
item_name = db.Column(db.String)
description = db.Column(db.String)
price... | 338 | 545 | 23 |
61299b380b2f6fd4b8cef0606ac3e684510311c0 | 718 | py | Python | python/max_profit.py | mohamedabdelbary/algo-exercises | 3b2b700453c010f61c0d4099762727e988e2b124 | [
"MIT"
] | null | null | null | python/max_profit.py | mohamedabdelbary/algo-exercises | 3b2b700453c010f61c0d4099762727e988e2b124 | [
"MIT"
] | null | null | null | python/max_profit.py | mohamedabdelbary/algo-exercises | 3b2b700453c010f61c0d4099762727e988e2b124 | [
"MIT"
] | null | null | null | def max_profit(a):
"""
write a function that takes a list of prices a and returns the max profit possible by buying at a given
price then selling at a future price, for e.g.
[2, 5, 1, 3, 10] should return 9 (10 - 1)
[4, 3, 2, 1] should return 0 (prices are always decreasing)
"""
if len(a) =... | 28.72 | 107 | 0.584958 | def max_profit(a):
"""
write a function that takes a list of prices a and returns the max profit possible by buying at a given
price then selling at a future price, for e.g.
[2, 5, 1, 3, 10] should return 9 (10 - 1)
[4, 3, 2, 1] should return 0 (prices are always decreasing)
"""
if len(a) =... | 0 | 0 | 0 |
02cd3536a1a80b18c932d57a0b353e13d26fb1a3 | 2,017 | py | Python | advanced/mathematical_optimization/examples/plot_compare_optimizers.py | tbarron/scipy-lecture-notes | 4b4e56492ab6bd37d3f8a78f406f255db69428db | [
"CC-BY-4.0"
] | 1 | 2020-02-20T17:36:14.000Z | 2020-02-20T17:36:14.000Z | advanced/mathematical_optimization/examples/plot_compare_optimizers.py | helixcn/scipy-lecture-notes | 4b4e56492ab6bd37d3f8a78f406f255db69428db | [
"CC-BY-4.0"
] | null | null | null | advanced/mathematical_optimization/examples/plot_compare_optimizers.py | helixcn/scipy-lecture-notes | 4b4e56492ab6bd37d3f8a78f406f255db69428db | [
"CC-BY-4.0"
] | null | null | null | """
Plotting the comparison of optimizers
======================================
Plots the results from the comparison of optimizers.
"""
import pickle
import sys
import numpy as np
import matplotlib.pyplot as plt
results = pickle.load(open(
'helper/compare_optimizers_py%s.pkl' % sys.version_info[0],
'rb')... | 28.814286 | 76 | 0.637581 | """
Plotting the comparison of optimizers
======================================
Plots the results from the comparison of optimizers.
"""
import pickle
import sys
import numpy as np
import matplotlib.pyplot as plt
results = pickle.load(open(
'helper/compare_optimizers_py%s.pkl' % sys.version_info[0],
'rb')... | 0 | 0 | 0 |
7313c6ae4a2ff76225a6986a466ad3a81fd91c04 | 1,367 | py | Python | data/external/repositories/282756/dsb_caffe-master/scripts/crps.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/282756/dsb_caffe-master/scripts/crps.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/282756/dsb_caffe-master/scripts/crps.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | from IPython.utils import io
import numpy as np
import sys
import math
import re
import csv
distFile = sys.argv[1]
gtFile = sys.argv[2]
dataV = np.transpose(np.loadtxt(gtFile, delimiter=",",skiprows=1)).astype('float')
ids, t_esv, t_edv= dataV
smallest_id=100000
with open(distFile, 'r') as csvfile:
distsCV=csv.re... | 21.698413 | 82 | 0.621068 | from IPython.utils import io
import numpy as np
import sys
import math
import re
import csv
distFile = sys.argv[1]
gtFile = sys.argv[2]
dataV = np.transpose(np.loadtxt(gtFile, delimiter=",",skiprows=1)).astype('float')
ids, t_esv, t_edv= dataV
smallest_id=100000
with open(distFile, 'r') as csvfile:
distsCV=csv.re... | 250 | 0 | 23 |
76b49df3cae6a662dff58a9fd76903dda7db1adf | 1,070 | py | Python | address/migrations/0001_initial.py | dasundev/django-ecommerce-project | e6187e3f70f0e1f7b4cc0003b03696b4088534f8 | [
"Apache-2.0"
] | null | null | null | address/migrations/0001_initial.py | dasundev/django-ecommerce-project | e6187e3f70f0e1f7b4cc0003b03696b4088534f8 | [
"Apache-2.0"
] | null | null | null | address/migrations/0001_initial.py | dasundev/django-ecommerce-project | e6187e3f70f0e1f7b4cc0003b03696b4088534f8 | [
"Apache-2.0"
] | 1 | 2021-10-03T05:45:55.000Z | 2021-10-03T05:45:55.000Z | # Generated by Django 2.2.12 on 2020-05-13 07:43
from django.db import migrations, models
| 36.896552 | 127 | 0.585047 | # Generated by Django 2.2.12 on 2020-05-13 07:43
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Address',
fields=[
('id', models.AutoField... | 0 | 955 | 23 |
14bfd0b77bba883d5299d1126f50c21ac4c8efb9 | 2,930 | py | Python | src/main.py | yosipy/asagao-minecraft | 56ac05e2539e15faed11c994af4ff2c5f81f6bb1 | [
"MIT"
] | null | null | null | src/main.py | yosipy/asagao-minecraft | 56ac05e2539e15faed11c994af4ff2c5f81f6bb1 | [
"MIT"
] | 15 | 2021-03-08T18:59:16.000Z | 2021-03-21T18:24:05.000Z | src/main.py | yosipy/asagao-minecraft | 56ac05e2539e15faed11c994af4ff2c5f81f6bb1 | [
"MIT"
] | 3 | 2021-03-08T03:37:52.000Z | 2021-07-14T22:08:12.000Z | # python3 -m pip install -U discord.py
# pip install requests
import sys
import time
import discord
from discord.ext import tasks
import requests
import json
import conoha_wrap
import conoha_main
import conoha_sub
import utility
import datetime
from config import *
client = discord.Client()
client.isProcessing = Fal... | 29.3 | 125 | 0.750512 | # python3 -m pip install -U discord.py
# pip install requests
import sys
import time
import discord
from discord.ext import tasks
import requests
import json
import conoha_wrap
import conoha_main
import conoha_sub
import utility
import datetime
from config import *
client = discord.Client()
client.isProcessing = Fal... | 2,299 | 0 | 114 |
4eccd534e55b2de919a661a0749c96ece4331251 | 9,527 | py | Python | deep_rf/deep_rf_learner.py | solstat/snake_learning | 5d8403f2f72751ca1fcbfffb248300d104fcfce3 | [
"BSD-3-Clause"
] | null | null | null | deep_rf/deep_rf_learner.py | solstat/snake_learning | 5d8403f2f72751ca1fcbfffb248300d104fcfce3 | [
"BSD-3-Clause"
] | null | null | null | deep_rf/deep_rf_learner.py | solstat/snake_learning | 5d8403f2f72751ca1fcbfffb248300d104fcfce3 | [
"BSD-3-Clause"
] | null | null | null |
#!/usr/bin/env python
"""
Does Deep Q-Learning for Snake
"""
# Import Modules
import numpy as np
import tensorflow as tf
import os
from single_player_game import SinglePlayerGame
from q_graph import QGraph
import epsilon_method
class ExperienceTuple:
""" ExperienceTuple data structure for DeepRFLearner """
cla... | 36.783784 | 103 | 0.602498 |
#!/usr/bin/env python
"""
Does Deep Q-Learning for Snake
"""
# Import Modules
import numpy as np
import tensorflow as tf
import os
from single_player_game import SinglePlayerGame
from q_graph import QGraph
import epsilon_method
class ExperienceTuple:
""" ExperienceTuple data structure for DeepRFLearner """
... | 3,718 | 0 | 214 |
3d94fa901580f8ff540a47c643a62d697871b8ac | 270 | py | Python | language_features/exception/dict_keyerror_exception.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 3 | 2018-08-20T13:00:01.000Z | 2021-09-18T04:19:46.000Z | language_features/exception/dict_keyerror_exception.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 1 | 2021-06-25T20:25:02.000Z | 2021-08-19T22:44:31.000Z | language_features/exception/dict_keyerror_exception.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 1 | 2021-09-18T23:51:20.000Z | 2021-09-18T23:51:20.000Z | student = {
"firstName": "Prasad",
"lastName": "Honrao",
"age": 37
}
try:
#try to get wrong value from dictionary
last_name = student["last_name"]
except KeyError as error:
print("Exception thrown!")
print(error)
print("Done!") | 19.285714 | 44 | 0.596296 | student = {
"firstName": "Prasad",
"lastName": "Honrao",
"age": 37
}
try:
#try to get wrong value from dictionary
last_name = student["last_name"]
except KeyError as error:
print("Exception thrown!")
print(error)
print("Done!") | 0 | 0 | 0 |
3761572252963ddf49998c7fd0fee2bd1c25e8ed | 2,616 | py | Python | Krakatau-master/Krakatau/disassemble.py | orneryhippo/saturdays | 525ce086452e96a01d1762418c79d4c84fd605b5 | [
"Apache-2.0"
] | null | null | null | Krakatau-master/Krakatau/disassemble.py | orneryhippo/saturdays | 525ce086452e96a01d1762418c79d4c84fd605b5 | [
"Apache-2.0"
] | null | null | null | Krakatau-master/Krakatau/disassemble.py | orneryhippo/saturdays | 525ce086452e96a01d1762418c79d4c84fd605b5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
import functools
import os.path
import time, zipfile, sys
import StringIO
import Krakatau
from Krakatau import script_util
from Krakatau.classfileformat.reader import Reader
from Krakatau.classfileformat.classdata import ClassData
from Krakatau.assembler.disassembly import Disassembler
if __nam... | 37.913043 | 126 | 0.675459 | #!/usr/bin/env python2
import functools
import os.path
import time, zipfile, sys
import StringIO
import Krakatau
from Krakatau import script_util
from Krakatau.classfileformat.reader import Reader
from Krakatau.classfileformat.classdata import ClassData
from Krakatau.assembler.disassembly import Disassembler
def read... | 1,027 | 0 | 69 |
8666ed4a13f01918505951a923925ab74a639df8 | 376 | py | Python | main.py | FausticSun/NoveltyDQN | 01eb2fd57d1d27a82d06267ea36c4dc76161b3b9 | [
"MIT"
] | null | null | null | main.py | FausticSun/NoveltyDQN | 01eb2fd57d1d27a82d06267ea36c4dc76161b3b9 | [
"MIT"
] | null | null | null | main.py | FausticSun/NoveltyDQN | 01eb2fd57d1d27a82d06267ea36c4dc76161b3b9 | [
"MIT"
] | 2 | 2019-07-05T03:34:20.000Z | 2020-12-12T07:12:48.000Z | import gym
if __name__ == "__main__":
env = gym.make('BipedalWalkerHardcore-v2')
# get initial obsevation of the environment
observation = env.reset()
while (True):
env.render()
print(observation);
# choose the action to take
action = env.action_space.sample()
... | 20.888889 | 60 | 0.630319 | import gym
if __name__ == "__main__":
env = gym.make('BipedalWalkerHardcore-v2')
# get initial obsevation of the environment
observation = env.reset()
while (True):
env.render()
print(observation);
# choose the action to take
action = env.action_space.sample()
... | 0 | 0 | 0 |
f5426a7d5be55a89bc8adaec9add523a7f25a11e | 459 | py | Python | tests/vmobjects/test_string.py | QDucasse/PySOM | 0b8801838a8902894dd606c0f84f1dcde79061d8 | [
"MIT"
] | 1 | 2020-10-06T13:57:43.000Z | 2020-10-06T13:57:43.000Z | tests/vmobjects/test_string.py | QDucasse/PySOM | 0b8801838a8902894dd606c0f84f1dcde79061d8 | [
"MIT"
] | null | null | null | tests/vmobjects/test_string.py | QDucasse/PySOM | 0b8801838a8902894dd606c0f84f1dcde79061d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Quentin DUCASSE
"""
import unittest
from som.vmobjects.object import Object
from som.vmobjects.string import String
| 21.857143 | 67 | 0.686275 | # -*- coding: utf-8 -*-
"""
@author: Quentin DUCASSE
"""
import unittest
from som.vmobjects.object import Object
from som.vmobjects.string import String
class StringTestCase(unittest.TestCase):
def setUp(self):
self.string = String(Object(None), "test")
def test_get_embedded_string(self):
s... | 181 | 19 | 104 |
d356618dbeb929ff0e3dddcf42c9929784b739f5 | 4,593 | py | Python | german_experiment.py | laurensalvarez/Fooling-LIME-SHAP | e7505795b239406e11f838f27b2ca5da09139d6b | [
"MIT"
] | 55 | 2019-11-29T14:43:57.000Z | 2022-03-26T13:57:16.000Z | german_experiment.py | laurensalvarez/Fooling-LIME-SHAP | e7505795b239406e11f838f27b2ca5da09139d6b | [
"MIT"
] | 7 | 2020-04-21T17:53:31.000Z | 2022-03-10T20:42:57.000Z | german_experiment.py | laurensalvarez/Fooling-LIME-SHAP | e7505795b239406e11f838f27b2ca5da09139d6b | [
"MIT"
] | 13 | 2020-02-21T20:11:37.000Z | 2022-02-16T07:39:01.000Z | """
The experiment MAIN for GERMAN.
"""
import warnings
warnings.filterwarnings('ignore')
from adversarial_models import *
from utils import *
from get_data import *
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import numpy as np
import pandas as pd
import ... | 37.647541 | 442 | 0.747442 | """
The experiment MAIN for GERMAN.
"""
import warnings
warnings.filterwarnings('ignore')
from adversarial_models import *
from utils import *
from get_data import *
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import numpy as np
import pandas as pd
import ... | 364 | 5 | 150 |
98f72b425961acffade8508abc2487f5a10582a3 | 332 | py | Python | machine-learning-ex1/ex1/normalEqn.py | GuoHongke/coursera-ml-py | 8b1e9fb238aafbeb387c46cacd72aea2592be82e | [
"MIT"
] | null | null | null | machine-learning-ex1/ex1/normalEqn.py | GuoHongke/coursera-ml-py | 8b1e9fb238aafbeb387c46cacd72aea2592be82e | [
"MIT"
] | null | null | null | machine-learning-ex1/ex1/normalEqn.py | GuoHongke/coursera-ml-py | 8b1e9fb238aafbeb387c46cacd72aea2592be82e | [
"MIT"
] | null | null | null | import numpy as np
| 27.666667 | 74 | 0.548193 | import numpy as np
def normal_eqn(X, y):
# ===================== Your Code Here =====================
# Instructions : Complete the code to compute the closed form solution
# to linear regression and put the result in theta
#
theta = np.linalg.pinv(X.T.dot(X)).dot(X.T).dot(y)
r... | 289 | 0 | 23 |
afb5477ecd07f2ad55cf64b5cf3600da4e114452 | 493 | py | Python | 2020-03-26-Python-Object-Model/examples/dict-vs-slots.py | s3rvac/talks | 469ea5d2d3d90527f77863b85746bbc2d7236cb1 | [
"BSD-3-Clause"
] | 2 | 2019-05-15T06:42:32.000Z | 2020-08-01T11:48:40.000Z | 2020-03-26-Python-Object-Model/examples/dict-vs-slots.py | s3rvac/talks | 469ea5d2d3d90527f77863b85746bbc2d7236cb1 | [
"BSD-3-Clause"
] | null | null | null | 2020-03-26-Python-Object-Model/examples/dict-vs-slots.py | s3rvac/talks | 469ea5d2d3d90527f77863b85746bbc2d7236cb1 | [
"BSD-3-Clause"
] | 1 | 2017-03-28T21:14:37.000Z | 2017-03-28T21:14:37.000Z | # __dict__ vs __slots__
import sys
a = A(1, 2)
assert '__dict__' in dir(a)
# 'b' will have a lower memory footprint (no dict) and provide faster attribute
# access (again, no need to go through a dict when accessing them) than 'a' due
# to the use of __slots__:
b = B(1, 2)
assert '__dict__' not in dir(b)
| 19.72 | 79 | 0.604462 | # __dict__ vs __slots__
import sys
class A:
def __init__(self, x, y):
self.x = x
self.y = y
class B:
__slots__ = ('x', 'y')
def __init__(self, x, y):
self.x = x
self.y = y
a = A(1, 2)
assert '__dict__' in dir(a)
# 'b' will have a lower memory footprint (no dict) and pro... | 84 | 28 | 72 |
1874dd5bb21245b476ba90bfc545f3ffc047af29 | 5,622 | py | Python | tests/test_udp_message.py | pwitab/dlms-cosem | aa9e18e6ef8a4fee30da8b797dad03b0b7847780 | [
"MIT"
] | 35 | 2018-05-24T08:16:35.000Z | 2022-02-24T16:07:07.000Z | tests/test_udp_message.py | Layty/dlms-cosem | 95b67054a1dfb928e960547b0246b7b6794f0594 | [
"MIT"
] | 41 | 2020-12-18T16:31:40.000Z | 2021-12-13T20:59:42.000Z | tests/test_udp_message.py | Layty/dlms-cosem | 95b67054a1dfb928e960547b0246b7b6794f0594 | [
"MIT"
] | 19 | 2019-04-02T14:32:01.000Z | 2021-12-14T13:24:29.000Z | import pytest
from dlms_cosem.protocol.wrappers import DlmsUdpMessage, WrapperHeader
data_examples_encrypted_data_nofication = [
b"\x00\x01\x00\x01\x00\x01\x00F\xdb\x08/\x19\"\x91\x99\x16A\x03;0\x00\x00\x01\xe5\x02\\\xe9\xd2'\x1f\xd7\x8b\xe8\xc2\x04!\x1a\x91j\x9d\x7fX~\nz\x81L\xad\xea\x89\xe9Y?\x01\xf9.\xa8\xc0\x... | 80.314286 | 257 | 0.706866 | import pytest
from dlms_cosem.protocol.wrappers import DlmsUdpMessage, WrapperHeader
data_examples_encrypted_data_nofication = [
b"\x00\x01\x00\x01\x00\x01\x00F\xdb\x08/\x19\"\x91\x99\x16A\x03;0\x00\x00\x01\xe5\x02\\\xe9\xd2'\x1f\xd7\x8b\xe8\xc2\x04!\x1a\x91j\x9d\x7fX~\nz\x81L\xad\xea\x89\xe9Y?\x01\xf9.\xa8\xc0\x... | 1,564 | 0 | 46 |
020a4f18e685df3e5fa88d82431b69c4b7b5e66a | 16,284 | py | Python | clifford/numba/_multivector.py | pygae/clifford | e63f8564d64d6a5dad5fbb415772eb8aecbc2d8f | [
"BSD-3-Clause"
] | 642 | 2017-11-17T09:49:48.000Z | 2022-03-21T22:02:25.000Z | clifford/numba/_multivector.py | pygae/clifford | e63f8564d64d6a5dad5fbb415772eb8aecbc2d8f | [
"BSD-3-Clause"
] | 347 | 2017-11-17T13:57:43.000Z | 2022-01-20T09:40:15.000Z | clifford/numba/_multivector.py | pygae/clifford | e63f8564d64d6a5dad5fbb415772eb8aecbc2d8f | [
"BSD-3-Clause"
] | 61 | 2017-11-19T17:15:26.000Z | 2022-01-15T05:18:27.000Z | """
Numba support for MultiVector objects.
For now, this just supports .value wrapping / unwrapping
"""
import numba
import operator
import numpy as np
from numba.extending import NativeValue
import llvmlite.ir
try:
# module locations as of numba 0.49.0
import numba.np.numpy_support as _numpy_support
from... | 37.178082 | 112 | 0.682081 | """
Numba support for MultiVector objects.
For now, this just supports .value wrapping / unwrapping
"""
import numba
import operator
import numpy as np
from numba.extending import NativeValue
import llvmlite.ir
try:
# module locations as of numba 0.49.0
import numba.np.numpy_support as _numpy_support
from... | 12,491 | 118 | 731 |
d19f046ebf19852f138a125dbf5c40474c8ce183 | 464 | py | Python | pants_plugins/sendwave/pants_docker/utils.py | waveremit/pants-docker | 9540f10262eab1b3ec2e6862899772cac9902166 | [
"Apache-2.0"
] | 1 | 2021-05-12T03:52:41.000Z | 2021-05-12T03:52:41.000Z | pants_plugins/sendwave/pants_docker/utils.py | waveremit/pants-docker | 9540f10262eab1b3ec2e6862899772cac9902166 | [
"Apache-2.0"
] | 2 | 2021-07-27T17:56:41.000Z | 2022-02-24T20:19:10.000Z | pants_plugins/sendwave/pants_docker/utils.py | waveremit/pants-docker | 9540f10262eab1b3ec2e6862899772cac9902166 | [
"Apache-2.0"
] | 2 | 2021-07-08T21:39:14.000Z | 2022-02-24T17:00:23.000Z | """Plugin-wide utility data."""
# Docker uses all of these env variables to connect to the docker
# server process
DOCKER_ENV_VARS = [
"DOCKER_CERT_PATH",
"DOCKER_CONFIG",
"DOCKER_CONTENT_TRUST_SERVER",
"DOCKER_CONTENT_TRUST",
"DOCKER_CONTEXT",
"DOCKER_DEFAULT_PLATFORM",
"DOCKER_HIDE_LEGACY... | 23.2 | 65 | 0.696121 | """Plugin-wide utility data."""
# Docker uses all of these env variables to connect to the docker
# server process
DOCKER_ENV_VARS = [
"DOCKER_CERT_PATH",
"DOCKER_CONFIG",
"DOCKER_CONTENT_TRUST_SERVER",
"DOCKER_CONTENT_TRUST",
"DOCKER_CONTEXT",
"DOCKER_DEFAULT_PLATFORM",
"DOCKER_HIDE_LEGACY... | 0 | 0 | 0 |
2ddca774f658cdae1882d981f1c4876a6b1932f6 | 698 | py | Python | ae_dev.py | varennes/autoencoder-mnist | dd12d79bd823dc98cb965305da6e9ca9a49f38a8 | [
"MIT"
] | null | null | null | ae_dev.py | varennes/autoencoder-mnist | dd12d79bd823dc98cb965305da6e9ca9a49f38a8 | [
"MIT"
] | null | null | null | ae_dev.py | varennes/autoencoder-mnist | dd12d79bd823dc98cb965305da6e9ca9a49f38a8 | [
"MIT"
] | null | null | null | # Autoencoder development
import numpy as np
import matplotlib.pyplot as plt
from ae_module import AE_model
from keras.datasets import mnist
if __name__ == '__main__':
# load and prep MNIST data
(x_train, _), (x_test, _) = mnist.load_data()
x_train = x_train.astype('float32') / 255.
x_test = x_test... | 29.083333 | 72 | 0.680516 | # Autoencoder development
import numpy as np
import matplotlib.pyplot as plt
from ae_module import AE_model
from keras.datasets import mnist
if __name__ == '__main__':
# load and prep MNIST data
(x_train, _), (x_test, _) = mnist.load_data()
x_train = x_train.astype('float32') / 255.
x_test = x_test... | 0 | 0 | 0 |
1c108320463f0ca0d24d165864ebd90da29c9fc2 | 2,496 | py | Python | qiskit/aqua/utils/qp_solver.py | georgesbarron/qiskit-aqua | b38ca9893c5f9509693a2de48680781bed300987 | [
"Apache-2.0"
] | 1 | 2019-10-12T16:20:25.000Z | 2019-10-12T16:20:25.000Z | qiskit/aqua/utils/qp_solver.py | georgesbarron/qiskit-aqua | b38ca9893c5f9509693a2de48680781bed300987 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/utils/qp_solver.py | georgesbarron/qiskit-aqua | b38ca9893c5f9509693a2de48680781bed300987 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 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... | 31.2 | 91 | 0.626603 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 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... | 0 | 0 | 0 |
a7faffc9e95641920f723ecf2295861e841151f0 | 329 | py | Python | RewardCalculator.py | tezosland/tezos-reward-distributer | f9825affe172f7cef88c72e63ead8feb064188f4 | [
"MIT"
] | 5 | 2018-11-04T16:57:43.000Z | 2019-07-24T20:22:45.000Z | RewardCalculator.py | tezosland/tezos-reward-distributer | f9825affe172f7cef88c72e63ead8feb064188f4 | [
"MIT"
] | 1 | 2018-11-04T13:06:44.000Z | 2018-11-04T13:06:44.000Z | RewardCalculator.py | tezosland/tezos-reward-distributer | f9825affe172f7cef88c72e63ead8feb064188f4 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
| 20.5625 | 40 | 0.671733 | from abc import ABC, abstractmethod
class RewardCalculator(ABC):
def __init__(self, founders_map):
self.founders_map = founders_map
self.total_rewards=0
super().__init__()
@abstractmethod
def calculate(self):
pass
def get_total_rewards(self):
return self.total_... | 162 | 107 | 23 |
a57284baaa4e9bb23c08a86b16c31efd4b0a2c60 | 8,432 | py | Python | draw_q_function3d.py | jaraujo98/SinglePartitionAdaptiveQLearning | 4084a27fdbfcfefd31e9be3f82628bdc50244998 | [
"MIT"
] | 1 | 2020-11-05T02:16:12.000Z | 2020-11-05T02:16:12.000Z | draw_q_function3d.py | jaraujo98/SinglePartitionAdaptiveQLearning | 4084a27fdbfcfefd31e9be3f82628bdc50244998 | [
"MIT"
] | null | null | null | draw_q_function3d.py | jaraujo98/SinglePartitionAdaptiveQLearning | 4084a27fdbfcfefd31e9be3f82628bdc50244998 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 16:38:07 2020
This file includes functions which are helpful to visualize the partitions and
the Q functions for the Oil and Ambulance problems.
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d, Axes... | 26.939297 | 80 | 0.594165 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 16:38:07 2020
This file includes functions which are helpful to visualize the partitions and
the Q functions for the Oil and Ambulance problems.
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d, Axes... | 0 | 0 | 0 |
1a49e5fe07248f4cdf4ee33ffa8461be58432ceb | 247 | py | Python | bubbleSort.py | Lioncat2002/computerProjPy | accb584443796967a4c3f0e8afce3d39e44cb113 | [
"MIT"
] | null | null | null | bubbleSort.py | Lioncat2002/computerProjPy | accb584443796967a4c3f0e8afce3d39e44cb113 | [
"MIT"
] | null | null | null | bubbleSort.py | Lioncat2002/computerProjPy | accb584443796967a4c3f0e8afce3d39e44cb113 | [
"MIT"
] | null | null | null | '''5.WAP to input a list and arrange the list in ascending order with bubble sort'''
l=eval(input("Enter the list: "))
for j in range(0,len(l)):
for i in range(0,len(l)-1):
if(l[i]>l[i+1]):
l[i+1],l[i]=l[i],l[i+1]
print(l) | 30.875 | 84 | 0.57085 | '''5.WAP to input a list and arrange the list in ascending order with bubble sort'''
l=eval(input("Enter the list: "))
for j in range(0,len(l)):
for i in range(0,len(l)-1):
if(l[i]>l[i+1]):
l[i+1],l[i]=l[i],l[i+1]
print(l) | 0 | 0 | 0 |
e2c7ee10aa531ec65d63ec72ac9930f90f047f89 | 1,543 | py | Python | petri_net_plan/scripts/example.py | cdondrup/petri_net | 2ae725b41b73db5b81611a11a3d10a39fdef3a1b | [
"MIT"
] | 1 | 2019-09-11T10:55:52.000Z | 2019-09-11T10:55:52.000Z | petri_net_plan/scripts/example.py | cdondrup/petri_net | 2ae725b41b73db5b81611a11a3d10a39fdef3a1b | [
"MIT"
] | null | null | null | petri_net_plan/scripts/example.py | cdondrup/petri_net | 2ae725b41b73db5b81611a11a3d10a39fdef3a1b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from pnp_gen.generator import Generator
from pnp_actions.pn_action import PNAction
from pnp_actions.recovery import Recovery, Before, During, After
from pnp_kb.queries import LocalQuery, RemoteQuery, Query
from pnp_kb.external_knowledge_base import ExternalKnowledgeBase
from p... | 32.145833 | 75 | 0.695399 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from pnp_gen.generator import Generator
from pnp_actions.pn_action import PNAction
from pnp_actions.recovery import Recovery, Before, During, After
from pnp_kb.queries import LocalQuery, RemoteQuery, Query
from pnp_kb.external_knowledge_base import ExternalKnowledgeBase
from p... | 764 | 1 | 130 |
7f0bf61de90c6de206d16e3f9b136afbf541717c | 5,520 | py | Python | obsim/models/spectral/data_driven.py | fjfaggingerauer/obsim | a5a9a48841fc13e822fbbfbbd0fb0fd0953cdd5a | [
"MIT"
] | null | null | null | obsim/models/spectral/data_driven.py | fjfaggingerauer/obsim | a5a9a48841fc13e822fbbfbbd0fb0fd0953cdd5a | [
"MIT"
] | null | null | null | obsim/models/spectral/data_driven.py | fjfaggingerauer/obsim | a5a9a48841fc13e822fbbfbbd0fb0fd0953cdd5a | [
"MIT"
] | null | null | null | import numpy as np
import astropy.units as u
from astropy import constants as const
from ...util import set_units
from ...config import default_units
from ...field import Field
from ...external import get_PHOENIX_spectrum, get_BT_SETTL_spectrum
from .base import SpectralModel
from .util import make_spectrum_unit_field... | 37.297297 | 139 | 0.648732 | import numpy as np
import astropy.units as u
from astropy import constants as const
from ...util import set_units
from ...config import default_units
from ...field import Field
from ...external import get_PHOENIX_spectrum, get_BT_SETTL_spectrum
from .base import SpectralModel
from .util import make_spectrum_unit_field... | 4,385 | 431 | 274 |
97c1e8efc59482131a7e9838dc27043aedb01374 | 750 | py | Python | lsql/lsql/settings.py | Tamiflu9/lsql | 5e2620eedd32949af85ea885cb54fe0f16defd0d | [
"MIT"
] | 2 | 2020-07-23T18:44:46.000Z | 2021-04-19T07:10:48.000Z | lsql/lsql/settings.py | Tamiflu9/lsql | 5e2620eedd32949af85ea885cb54fe0f16defd0d | [
"MIT"
] | 93 | 2020-09-14T12:35:44.000Z | 2021-12-13T21:08:47.000Z | lsql/lsql/settings.py | Tamiflu9/lsql | 5e2620eedd32949af85ea885cb54fe0f16defd0d | [
"MIT"
] | 18 | 2020-09-24T13:38:28.000Z | 2021-04-19T09:24:19.000Z | """
Django settings for lsql project. Loads settings_shared and settings_dev or settings_deploy
depending on the value of DJANGO_DEVELOPMENT
Generated by 'django-admin startproject' using Django 3.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of ... | 27.777778 | 91 | 0.777333 | """
Django settings for lsql project. Loads settings_shared and settings_dev or settings_deploy
depending on the value of DJANGO_DEVELOPMENT
Generated by 'django-admin startproject' using Django 3.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of ... | 0 | 0 | 0 |
cb26a8936a4f9351b6fca2844c6bc7e8134f3b0a | 9,521 | py | Python | introspection/dundermethods.py | Aran-Fey/introspection | 0ce3a16688b51bdcb72c7b070d571a1004f5151b | [
"MIT"
] | 1 | 2022-03-02T23:13:06.000Z | 2022-03-02T23:13:06.000Z | introspection/dundermethods.py | Aran-Fey/introspection | 0ce3a16688b51bdcb72c7b070d571a1004f5151b | [
"MIT"
] | null | null | null | introspection/dundermethods.py | Aran-Fey/introspection | 0ce3a16688b51bdcb72c7b070d571a1004f5151b | [
"MIT"
] | null | null | null |
from typing import Iterator, Iterable, Tuple, Dict, Any, Callable, Optional
from .misc import static_vars
__all__ = ['DUNDERMETHOD_NAMES', 'AUGMENTED_ASSIGNMENT_DUNDERMETHOD_NAMES',
'iter_class_dundermethods', 'class_implements_dundermethod', 'class_implements_any_dundermethod', 'class_implements_dunderme... | 40.172996 | 1,485 | 0.647726 |
from typing import Iterator, Iterable, Tuple, Dict, Any, Callable, Optional
from .misc import static_vars
__all__ = ['DUNDERMETHOD_NAMES', 'AUGMENTED_ASSIGNMENT_DUNDERMETHOD_NAMES',
'iter_class_dundermethods', 'class_implements_dundermethod', 'class_implements_any_dundermethod', 'class_implements_dunderme... | 104 | 0 | 23 |
c86437c317fef3a04fee97738d25e0c4a3be6d96 | 8,912 | py | Python | pytorch/torch_model.py | LianShuaiLong/Codebook | fd67440d2de80b48aa90b9f7ea5d459baee0a6d8 | [
"MIT"
] | null | null | null | pytorch/torch_model.py | LianShuaiLong/Codebook | fd67440d2de80b48aa90b9f7ea5d459baee0a6d8 | [
"MIT"
] | null | null | null | pytorch/torch_model.py | LianShuaiLong/Codebook | fd67440d2de80b48aa90b9f7ea5d459baee0a6d8 | [
"MIT"
] | null | null | null | # copy from https://github.com/LianShuaiLong/CV_Applications/blob/master/classification/classification-pytorch/backbones/vgg19.py
import torch
import torch.nn as nn
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = ConvNet(in_channels=3,num_classes=1000,bn=True).to(device)
# 双线性汇合 biliear pooling ????... | 37.288703 | 129 | 0.638128 | # copy from https://github.com/LianShuaiLong/CV_Applications/blob/master/classification/classification-pytorch/backbones/vgg19.py
import torch
import torch.nn as nn
class ConvNet(nn.Module):
def __init__(self,in_channels,num_classes,bn=False):
super(ConvNet,self).__init__()#调用父类的初始化函数
self.num_clas... | 5,202 | 3 | 317 |
d9c8a034bf4b87c98de88288d545f61c473a3f2d | 17,360 | py | Python | src/Sorption_PB_functions/four_layer_model_LNX_withFixSpeciesOption_Scaling_2surface.py | Whatsoever/SurfComp | 4887162fef765d0c84e2bb72f0c26974aef30aec | [
"MIT"
] | 1 | 2019-05-17T10:46:08.000Z | 2019-05-17T10:46:08.000Z | src/Sorption_PB_functions/four_layer_model_LNX_withFixSpeciesOption_Scaling_2surface.py | Whatsoever/SurfComp | 4887162fef765d0c84e2bb72f0c26974aef30aec | [
"MIT"
] | null | null | null | src/Sorption_PB_functions/four_layer_model_LNX_withFixSpeciesOption_Scaling_2surface.py | Whatsoever/SurfComp | 4887162fef765d0c84e2bb72f0c26974aef30aec | [
"MIT"
] | 1 | 2018-08-02T06:54:38.000Z | 2018-08-02T06:54:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 6 21:38:42 2019
"""
import numpy as np
from scipy import linalg
# try to keep it in block
##################### basic functions ################################################
def mass_action_law (ln_X, ln_K, A):
'''
all inputs are numpy arrays!!!
... | 49.17847 | 265 | 0.641129 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 6 21:38:42 2019
"""
import numpy as np
from scipy import linalg
# try to keep it in block
##################### basic functions ################################################
def mass_action_law (ln_X, ln_K, A):
'''
all inputs are numpy arrays!!!
... | 8,147 | -5 | 340 |
1d09e940ea82d2393f7ba152f4bedbce59d28164 | 2,830 | py | Python | examples/hvi2/liveplottest_hvi_queueing_markers.py | peendebak/core_tools | 2e43edf0bbc1d7ceb7042559db499535e8f6a076 | [
"BSD-2-Clause"
] | 1 | 2022-02-11T09:24:35.000Z | 2022-02-11T09:24:35.000Z | examples/hvi2/liveplottest_hvi_queueing_markers.py | peendebak/core_tools | 2e43edf0bbc1d7ceb7042559db499535e8f6a076 | [
"BSD-2-Clause"
] | null | null | null | examples/hvi2/liveplottest_hvi_queueing_markers.py | peendebak/core_tools | 2e43edf0bbc1d7ceb7042559db499535e8f6a076 | [
"BSD-2-Clause"
] | 2 | 2020-07-06T14:31:27.000Z | 2021-07-07T13:57:19.000Z | import time
import logging
from PyQt5 import QtCore
import qcodes
import qcodes.logger as logger
from qcodes.logger import start_all_logging
from keysight_fpga.sd1.fpga_utils import \
print_fpga_info, config_fpga_debug_log, print_fpga_log
from keysight_fpga.sd1.dig_iq import load_iq_image
from keysight_fpga.qcod... | 26.203704 | 104 | 0.701413 | import time
import logging
from PyQt5 import QtCore
import qcodes
import qcodes.logger as logger
from qcodes.logger import start_all_logging
from keysight_fpga.sd1.fpga_utils import \
print_fpga_info, config_fpga_debug_log, print_fpga_log
from keysight_fpga.sd1.dig_iq import load_iq_image
from keysight_fpga.qcod... | 0 | 0 | 0 |
f54b05cc857a074f404c751cd98bf1d6a15de9ed | 1,667 | py | Python | tests/test_revnet.py | tbung/pytorch-revnet | c75f82b03989e9341cc4723954d3dcc567aa461b | [
"MIT"
] | 83 | 2018-02-01T10:16:10.000Z | 2022-03-10T10:08:32.000Z | tests/test_revnet.py | tbung/pytorch-revnet | c75f82b03989e9341cc4723954d3dcc567aa461b | [
"MIT"
] | 7 | 2018-02-14T15:18:18.000Z | 2021-06-10T06:54:02.000Z | tests/test_revnet.py | tbung/revnet | c75f82b03989e9341cc4723954d3dcc567aa461b | [
"MIT"
] | 15 | 2018-02-16T23:04:43.000Z | 2022-02-04T01:09:22.000Z | import torch
import torch.autograd
from torch.autograd import Variable
from revnet import RevBlock, RevBlockFunction
import unittest
from .common import TestCase
if __name__ == '__main__':
unittest.main()
| 27.783333 | 65 | 0.60228 | import torch
import torch.autograd
from torch.autograd import Variable
from revnet import RevBlock, RevBlockFunction
import unittest
from .common import TestCase
class TestRevNet(TestCase):
def setUp(self):
self.x = torch.rand(4, 4, 4, 4)
self.model = RevBlock(4, 4, [])
parameters = lis... | 1,343 | 6 | 103 |
98a4e9c19b6c5c560be20357b8d179d1458d811b | 10,210 | py | Python | pymcxray/FileFormat/Results/DetectorParameters.py | drix00/pymcxray | bf650aa0f31c635040a6cb79fe1cb7ecf27b8990 | [
"Apache-2.0"
] | 1 | 2020-07-23T12:13:30.000Z | 2020-07-23T12:13:30.000Z | pymcxray/FileFormat/Results/DetectorParameters.py | drix00/pymcxray | bf650aa0f31c635040a6cb79fe1cb7ecf27b8990 | [
"Apache-2.0"
] | 3 | 2017-03-05T16:09:30.000Z | 2017-03-05T16:11:41.000Z | pymcxray/FileFormat/Results/DetectorParameters.py | drix00/pymcxray | bf650aa0f31c635040a6cb79fe1cb7ecf27b8990 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Results.DetectorParameters
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
MCXRay detector parameters from results file.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version_... | 38.528302 | 114 | 0.729089 | #!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Results.DetectorParameters
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
MCXRay detector parameters from results file.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version_... | 5,964 | 2,337 | 24 |
f5ca30910d45a409b8ee908b3ae92948fcccb141 | 8,718 | py | Python | MEA_Network_Analysis.py | alanbalugu/MEA-Analysis | 2851ea437ddab243212e051fa043b4a8b34e9076 | [
"MIT"
] | null | null | null | MEA_Network_Analysis.py | alanbalugu/MEA-Analysis | 2851ea437ddab243212e051fa043b4a8b34e9076 | [
"MIT"
] | null | null | null | MEA_Network_Analysis.py | alanbalugu/MEA-Analysis | 2851ea437ddab243212e051fa043b4a8b34e9076 | [
"MIT"
] | null | null | null | #network of nodes
#Alan Balu
#import statements
import numpy as np, math
import matplotlib.pyplot as plt
import pandas as pd
from pprint import pprint
import networkx as nx
import matplotlib.pyplot as plt
import community
import glob
import statistics
#function to examine the degree of nodes in ... | 32.288889 | 190 | 0.685478 | #network of nodes
#Alan Balu
#import statements
import numpy as np, math
import matplotlib.pyplot as plt
import pandas as pd
from pprint import pprint
import networkx as nx
import matplotlib.pyplot as plt
import community
import glob
import statistics
#function to examine the degree of nodes in ... | 7,844 | 0 | 114 |
8cc7a5a5650e6d206b6a4f2056636fb1d9968487 | 2,846 | py | Python | camelot/core/resources.py | FrDeGraux/camelot | 56aa93f774edbb0c31a21109e187cf81f49a68d8 | [
"BSD-3-Clause"
] | 12 | 2020-08-02T17:00:37.000Z | 2022-01-22T17:49:23.000Z | camelot/core/resources.py | FrDeGraux/camelot | 56aa93f774edbb0c31a21109e187cf81f49a68d8 | [
"BSD-3-Clause"
] | 124 | 2020-08-19T15:03:54.000Z | 2022-03-31T07:12:16.000Z | camelot/core/resources.py | FrDeGraux/camelot | 56aa93f774edbb0c31a21109e187cf81f49a68d8 | [
"BSD-3-Clause"
] | 17 | 2020-04-25T19:22:20.000Z | 2022-01-25T08:46:19.000Z | # ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / info@conceptive.be
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... | 45.174603 | 82 | 0.725228 | # ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / info@conceptive.be
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... | 0 | 0 | 0 |
ac1cbfe1106b10d27ccc3fbe02d6b6f70d874a66 | 51 | py | Python | enthought/traits/ui/key_bindings.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/traits/ui/key_bindings.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/traits/ui/key_bindings.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from traitsui.key_bindings import *
| 17 | 35 | 0.803922 | # proxy module
from traitsui.key_bindings import *
| 0 | 0 | 0 |
d76ea4b411c0953fc184fb5f37e71434089f3530 | 101 | py | Python | src/core/cmp/cool/parser.py | 2kodevs/cool-compiler-2020 | 7b4e36706562d616c6bf900049edf52281ac2e2b | [
"MIT"
] | 3 | 2020-02-11T23:45:43.000Z | 2021-09-03T15:18:06.000Z | src/core/cmp/cool/parser.py | 2kodevs/cool-compiler-2020 | 7b4e36706562d616c6bf900049edf52281ac2e2b | [
"MIT"
] | null | null | null | src/core/cmp/cool/parser.py | 2kodevs/cool-compiler-2020 | 7b4e36706562d616c6bf900049edf52281ac2e2b | [
"MIT"
] | 3 | 2022-02-23T21:41:26.000Z | 2022-02-26T20:53:27.000Z | from ..parser import LR1Parser
from .grammar import CoolGrammar
CoolParser = LR1Parser(CoolGrammar)
| 20.2 | 35 | 0.821782 | from ..parser import LR1Parser
from .grammar import CoolGrammar
CoolParser = LR1Parser(CoolGrammar)
| 0 | 0 | 0 |
7a16b3d2592d834fcb01072722db07b06256d1f5 | 467 | py | Python | tests/test_make_dataset.py | ElisaRMA/mlops_project | 860c651db6fa93638fac38b2c9b9079a6e48d30e | [
"MIT"
] | 12 | 2022-01-16T18:40:07.000Z | 2022-02-19T20:08:51.000Z | tests/test_make_dataset.py | ElisaRMA/mlops_project | 860c651db6fa93638fac38b2c9b9079a6e48d30e | [
"MIT"
] | 35 | 2022-01-22T14:51:04.000Z | 2022-03-31T15:14:55.000Z | tests/test_make_dataset.py | ElisaRMA/mlops_project | 860c651db6fa93638fac38b2c9b9079a6e48d30e | [
"MIT"
] | 23 | 2022-01-17T14:23:11.000Z | 2022-03-25T19:51:22.000Z | """Test make_dataset.py."""
import configparser
import yaml
def test_download_data():
"""test if the output parameters of the make_dataset module are correct."""
config = configparser.ConfigParser()
config.read("configs.ini")
output_dir = config["datasets"]["raw_folder"]
with open("dvc.yaml", "r"... | 27.470588 | 79 | 0.683084 | """Test make_dataset.py."""
import configparser
import yaml
def test_download_data():
"""test if the output parameters of the make_dataset module are correct."""
config = configparser.ConfigParser()
config.read("configs.ini")
output_dir = config["datasets"]["raw_folder"]
with open("dvc.yaml", "r"... | 0 | 0 | 0 |
d9cb50a444f94eb0cee47694b3bcf96567124dae | 451 | py | Python | reset.py | JBEI/prpr | 6492b3468be600c868abcb7d2fef2b364023217c | [
"BSD-3-Clause-LBNL"
] | 7 | 2015-06-16T17:45:36.000Z | 2020-05-15T19:08:26.000Z | reset.py | nstawski/prpr | 22a9d9d4d1b454aa530f77e9d705df864bb5d14a | [
"BSD-3-Clause-LBNL"
] | null | null | null | reset.py | nstawski/prpr | 22a9d9d4d1b454aa530f77e9d705df864bb5d14a | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-08-12T07:20:53.000Z | 2019-08-12T07:20:53.000Z | __author__ = 'Nina Stawski'
__contact__ = 'me@ninastawski.com'
import os
def resetPrpr():
"""
Removes all files from working directories, invokes prpr setup.
"""
os.remove('prpr.db')
dirs = ['esc', 'incoming', 'logs', 'tables']
for dir in dirs:
files = os.listdir(dir)
for file ... | 22.55 | 67 | 0.600887 | __author__ = 'Nina Stawski'
__contact__ = 'me@ninastawski.com'
import os
def resetPrpr():
"""
Removes all files from working directories, invokes prpr setup.
"""
os.remove('prpr.db')
dirs = ['esc', 'incoming', 'logs', 'tables']
for dir in dirs:
files = os.listdir(dir)
for file ... | 0 | 0 | 0 |
48a331e9fc7fd8d1f1f0d09be14d3fbe44d4db08 | 6,372 | py | Python | dojo/tools/ibm_app/parser.py | everable/django-DefectDojo | 1548982c1f197f3f702162846d314b16bb687c78 | [
"BSD-3-Clause"
] | 1 | 2020-03-27T06:58:40.000Z | 2020-03-27T06:58:40.000Z | dojo/tools/ibm_app/parser.py | viral-sangani/django-DefectDojo | e0fa585ee770bd0b15ba4a73bd81e6cc043650fd | [
"BSD-3-Clause"
] | 30 | 2020-08-11T21:29:57.000Z | 2022-03-17T19:02:50.000Z | dojo/tools/ibm_app/parser.py | viral-sangani/django-DefectDojo | e0fa585ee770bd0b15ba4a73bd81e6cc043650fd | [
"BSD-3-Clause"
] | 1 | 2020-09-30T13:01:50.000Z | 2020-09-30T13:01:50.000Z | from xml.dom import NamespaceErr
import hashlib
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
from defusedxml import ElementTree
__author__ = 'propersam'
| 43.346939 | 113 | 0.47489 | from xml.dom import NamespaceErr
import hashlib
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
from defusedxml import ElementTree
__author__ = 'propersam'
class IbmAppScanDASTXMLParser(object):
def __init__(self, file, test):
self.items = ()
if file is None:
... | 5,548 | 615 | 23 |
5878ab5b8ab99dcd60b8b4b7efe10b8a5f719f58 | 427 | py | Python | 05_CovidProj/data_science/processer.py | QApolo/CS | 44e3c547544ac06da095641160b8d5956b31e149 | [
"MIT"
] | 2 | 2019-03-17T23:38:48.000Z | 2019-03-23T06:12:34.000Z | 05_CovidProj/data_science/processer.py | QApolo/CS | 44e3c547544ac06da095641160b8d5956b31e149 | [
"MIT"
] | null | null | null | 05_CovidProj/data_science/processer.py | QApolo/CS | 44e3c547544ac06da095641160b8d5956b31e149 | [
"MIT"
] | null | null | null |
pre_processData("Population.csv") | 26.6875 | 83 | 0.571429 |
def pre_processData(path):
csv_file = open(path, "r")
csv_processed = open(path.split(".")[0]+"_processed."+ path.split(".")[1], "w")
for line in csv_file:
spl = line.split(",")
#print(spl)
line2 = spl[0]+","+spl[1].replace(" ", "").rstrip("\n")+"\n"
print(line2)
c... | 368 | 0 | 23 |
8115763d9484254820ae78b3b17d3a2a339de0c2 | 3,982 | py | Python | jc/parsers/lsof.py | shaikustin/jc | b59e38cfd2c8a7f5868e05d5562557b1c27e5e56 | [
"MIT"
] | 3,215 | 2019-10-24T15:25:56.000Z | 2022-03-31T15:43:01.000Z | jc/parsers/lsof.py | shaikustin/jc | b59e38cfd2c8a7f5868e05d5562557b1c27e5e56 | [
"MIT"
] | 109 | 2019-11-02T16:22:29.000Z | 2022-03-30T17:32:17.000Z | jc/parsers/lsof.py | shaikustin/jc | b59e38cfd2c8a7f5868e05d5562557b1c27e5e56 | [
"MIT"
] | 75 | 2020-02-07T00:16:32.000Z | 2022-03-29T09:29:53.000Z | """jc - JSON CLI output utility `lsof` command output parser
Usage (cli):
$ lsof | jc --lsof
or
$ jc lsof
Usage (module):
import jc.parsers.lsof
result = jc.parsers.lsof.parse(lsof_command_output)
Schema:
[
{
"command": string,
"pid": integer,
"tid... | 20.957895 | 74 | 0.476143 | """jc - JSON CLI output utility `lsof` command output parser
Usage (cli):
$ lsof | jc --lsof
or
$ jc lsof
Usage (module):
import jc.parsers.lsof
result = jc.parsers.lsof.parse(lsof_command_output)
Schema:
[
{
"command": string,
"pid": integer,
"tid... | 0 | 0 | 0 |