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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
540974b01b23268f6d433583746dfaade82d9a64 | 6,190 | py | Python | Compass_gait_biped_simulations/Animate_posterior_compass_biped.py | ernovoseller/CoSpar | 2a9584dc9d1cdda5f7c0376ce744a18edab56cbb | [
"MIT"
] | 5 | 2020-11-18T14:05:13.000Z | 2021-05-18T15:00:33.000Z | Compass_gait_biped_simulations/Animate_posterior_compass_biped.py | ernovoseller/CoSpar | 2a9584dc9d1cdda5f7c0376ce744a18edab56cbb | [
"MIT"
] | null | null | null | Compass_gait_biped_simulations/Animate_posterior_compass_biped.py | ernovoseller/CoSpar | 2a9584dc9d1cdda5f7c0376ce744a18edab56cbb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
For the ICRA video, we made some animations of how the preference model
posteriors evolve after each iteration. This script saves the stack of images
to make such an animation for the compass-gait biped's model posterior. For
every iteration, we save an image of the model posterior from on... | 35.780347 | 82 | 0.639742 | # -*- coding: utf-8 -*-
"""
For the ICRA video, we made some animations of how the preference model
posteriors evolve after each iteration. This script saves the stack of images
to make such an animation for the compass-gait biped's model posterior. For
every iteration, we save an image of the model posterior from on... | 0 | 0 | 0 |
c37a56745c7c38908f76b7304b7460e23194957e | 11,107 | py | Python | gym_minigrid/envs/fourrooms_memory.py | andreykurenkov/gym-minigrid | 2c053e8f78ebe6f7aa92cdf81c7539a4fffc12ec | [
"Apache-2.0"
] | null | null | null | gym_minigrid/envs/fourrooms_memory.py | andreykurenkov/gym-minigrid | 2c053e8f78ebe6f7aa92cdf81c7539a4fffc12ec | [
"Apache-2.0"
] | null | null | null | gym_minigrid/envs/fourrooms_memory.py | andreykurenkov/gym-minigrid | 2c053e8f78ebe6f7aa92cdf81c7539a4fffc12ec | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gym_minigrid.minigrid import *
from gym_minigrid.register import register
from gym_minigrid.wrappers import RGBImgPartialObsWrapper
from gym_minigrid.wrappers import FrameStack
from collections import deque
from gym.spaces import Box
from gym import Wrapper
import num... | 33.966361 | 102 | 0.545062 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gym_minigrid.minigrid import *
from gym_minigrid.register import register
from gym_minigrid.wrappers import RGBImgPartialObsWrapper
from gym_minigrid.wrappers import FrameStack
from collections import deque
from gym.spaces import Box
from gym import Wrapper
import num... | 10,205 | 17 | 227 |
53c98d607588d8ce88a263df9e07ac14a254f1e0 | 3,518 | py | Python | Equation_Solver8.py | mmankowski/Loewe-additivity-calculator | 43f7135429a992d932d805dfa8a4c3b0b8fc769c | [
"MIT"
] | null | null | null | Equation_Solver8.py | mmankowski/Loewe-additivity-calculator | 43f7135429a992d932d805dfa8a4c3b0b8fc769c | [
"MIT"
] | null | null | null | Equation_Solver8.py | mmankowski/Loewe-additivity-calculator | 43f7135429a992d932d805dfa8a4c3b0b8fc769c | [
"MIT"
] | null | null | null | # to run open terminal window in location then type 'python "scriptname.py" "filename.csv" ' - "" indicates that these portions are replaced with actual file names
# import necessary libraries
import csv
import sys
import math
# read in the file & convert "that memory" into a csv read file
f = open(sys.argv[1],'rb')... | 24.774648 | 163 | 0.627345 | # to run open terminal window in location then type 'python "scriptname.py" "filename.csv" ' - "" indicates that these portions are replaced with actual file names
# import necessary libraries
import csv
import sys
import math
# read in the file & convert "that memory" into a csv read file
f = open(sys.argv[1],'rb')... | 595 | 0 | 71 |
f4fbe171060d67aad65e5f5de62f76eb891714f0 | 800 | py | Python | setup.py | beaumartinez/twittercide | 5ef74560f17f7e2497edb3ae915dc0172e4fcf5d | [
"0BSD"
] | 2 | 2015-01-04T04:34:03.000Z | 2018-04-18T20:35:29.000Z | setup.py | beaumartinez/twittercide | 5ef74560f17f7e2497edb3ae915dc0172e4fcf5d | [
"0BSD"
] | null | null | null | setup.py | beaumartinez/twittercide | 5ef74560f17f7e2497edb3ae915dc0172e4fcf5d | [
"0BSD"
] | null | null | null | #! /usr/bin/env python
from setuptools import find_packages
from setuptools import setup
with open('README.md') as readme_file:
readme = readme_file.read()
setup(
author='Beau Martinez',
classifiers=[
'Programming Language :: Python :: 2.7',
],
description='Delete your tweets and backup... | 22.857143 | 80 | 0.61375 | #! /usr/bin/env python
from setuptools import find_packages
from setuptools import setup
with open('README.md') as readme_file:
readme = readme_file.read()
setup(
author='Beau Martinez',
classifiers=[
'Programming Language :: Python :: 2.7',
],
description='Delete your tweets and backup... | 0 | 0 | 0 |
9c4590f9f6a92336f506f82a881a87cbc141ae94 | 10,753 | py | Python | backend/database/result.py | brownben/munro | 2beeae23f29fd064b102a44a1c2d3d852eed65e0 | [
"MIT"
] | 5 | 2020-02-02T14:58:15.000Z | 2022-01-07T08:24:37.000Z | backend/database/result.py | brownben/munro | 2beeae23f29fd064b102a44a1c2d3d852eed65e0 | [
"MIT"
] | 773 | 2020-01-04T22:54:01.000Z | 2022-03-31T16:07:56.000Z | backend/database/result.py | brownben/munro | 2beeae23f29fd064b102a44a1c2d3d852eed65e0 | [
"MIT"
] | 1 | 2021-12-25T14:32:25.000Z | 2021-12-25T14:32:25.000Z | from __future__ import annotations
from typing import Any, Dict, List, Literal, Optional, Union
from .event import Event
from .database import query, queryWithResult, queryWithResults
properties = [
"time",
"position",
"points",
"incomplete",
"event",
"competitor",
"type",
"course",
... | 28.149215 | 75 | 0.464894 | from __future__ import annotations
from typing import Any, Dict, List, Literal, Optional, Union
from .event import Event
from .database import query, queryWithResult, queryWithResults
properties = [
"time",
"position",
"points",
"incomplete",
"event",
"competitor",
"type",
"course",
... | 9,384 | 944 | 23 |
4c974887fd1b1b9962ef96e605440ab8067fc6be | 2,952 | py | Python | plotdev.py | SABSR3-Group-2/PKLibaryGroup2 | 99b065e75aed0a5e640f218455b9c9e452613fa6 | [
"MIT"
] | null | null | null | plotdev.py | SABSR3-Group-2/PKLibaryGroup2 | 99b065e75aed0a5e640f218455b9c9e452613fa6 | [
"MIT"
] | 11 | 2020-10-21T13:41:53.000Z | 2020-10-28T10:16:56.000Z | plotdev.py | SABSR3-Group-2/PKLibaryGroup2 | 99b065e75aed0a5e640f218455b9c9e452613fa6 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# solveData = pd.DataFrame(data = [[1,2,4,8,16,32,64,128],[1,1,2,3,4,3,2,1]], columns=[0,1,2,3,4,5,6,7])
# solveData = solveData.transpose()
# a = [[1,2,3,4],[4,3,2,1,2,3,4,3,2,1]]
# #b= np.array(a)
# c = np.array(a).T
# newData = pd.DataF... | 25.230769 | 104 | 0.602304 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def __unitsFormat(unitsInput):
if unitsInput != "":
unitsOutput = " ("+unitsInput+")"
else:
unitsOutput = unitsInput
return unitsOutput
# solveData = pd.DataFrame(data = [[1,2,4,8,16,32,64,128],[1,1,2,3,4,3,2,1]], co... | 937 | 1,039 | 46 |
52b2b8048d01ad33751970a0ccba10527e01ab2d | 7,194 | py | Python | attack_methods/Jpeg_compression.py | ASU-Active-Perception-Group/decentralized_attribution_of_generative_models | b57c38b215cff4df24744262ffa02d41c61151ac | [
"MIT"
] | 3 | 2021-03-19T08:34:57.000Z | 2021-03-20T04:06:43.000Z | attack_methods/Jpeg_compression.py | ASU-Active-Perception-Group/decentralized_attribution_of_generative_models | b57c38b215cff4df24744262ffa02d41c61151ac | [
"MIT"
] | null | null | null | attack_methods/Jpeg_compression.py | ASU-Active-Perception-Group/decentralized_attribution_of_generative_models | b57c38b215cff4df24744262ffa02d41c61151ac | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# def zigzag_indices(shape: (int, int), count):
# x_range, y_range = shape
# index_order = sorted(((x, y) for x in range(x_range) for y in range(y_range)),
# key=lambda p: (p[0] + p[1], -p[1] if (p[0]... | 43.077844 | 155 | 0.578121 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def gen_filters(size_x: int, size_y: int, dct_or_idct_fun: callable) -> np.ndarray:
tile_size_x = 8
filters = np.zeros((size_x * size_y, size_x, size_y))
for k_y in range(size_y):
for k_x in range(size_x):
... | 5,473 | 12 | 249 |
ffedf602d2f9c7fa1d071765a091d64c3cb50e73 | 413 | py | Python | session/migrations/0006_auto_20190415_1247.py | tonymontaro/mentorci_server | 527885a38da60e80698624309f99455e0c8b1192 | [
"MIT"
] | 2 | 2019-07-11T09:46:11.000Z | 2020-02-14T19:47:30.000Z | session/migrations/0006_auto_20190415_1247.py | tonymontaro/mentorci_server | 527885a38da60e80698624309f99455e0c8b1192 | [
"MIT"
] | 14 | 2019-07-05T08:52:17.000Z | 2022-02-10T08:25:03.000Z | session/migrations/0006_auto_20190415_1247.py | tonymontaro/mentorci_server | 527885a38da60e80698624309f99455e0c8b1192 | [
"MIT"
] | 2 | 2019-07-11T09:46:14.000Z | 2020-02-14T20:57:55.000Z | # Generated by Django 2.2 on 2019-04-15 12:47
from django.db import migrations, models
| 21.736842 | 74 | 0.607748 | # Generated by Django 2.2 on 2019-04-15 12:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('session', '0005_auto_20190415_0524'),
]
operations = [
migrations.AlterField(
model_name='sessionlog',
name='concern',... | 0 | 301 | 23 |
2020c53b7f2ac02ac70f17066db5bac7ae6d6bf8 | 2,643 | py | Python | trend/src/zutils/tensorflow/tf_store.py | limingmax/WFCode | f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3 | [
"Apache-2.0"
] | 2 | 2018-10-23T01:56:46.000Z | 2018-10-23T01:56:49.000Z | trend/src/zutils/tensorflow/tf_store.py | limingmax/WFCode | f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3 | [
"Apache-2.0"
] | null | null | null | trend/src/zutils/tensorflow/tf_store.py | limingmax/WFCode | f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3 | [
"Apache-2.0"
] | null | null | null | # @Time : 2018-9-10
# @Author : zxh
import os
import tensorflow as tf
import sys
from zutils.utils import relative_project_path
| 39.447761 | 99 | 0.67045 | # @Time : 2018-9-10
# @Author : zxh
import os
import tensorflow as tf
import sys
from zutils.utils import relative_project_path
class TFStore:
def __init__(self, sess, model_name, net_name, max_to_keep=500):
self.sess = sess
self.model_name= model_name
self.net_name = net_name
sel... | 2,250 | -7 | 265 |
72bc8a1878b0d62c89218738d3dca18323b62324 | 5,997 | py | Python | otter/database/model.py | pathob/odoo-otter | 1bf5dbab3c3ef12a12cae604d82d4e6f855f37fc | [
"Apache-2.0"
] | null | null | null | otter/database/model.py | pathob/odoo-otter | 1bf5dbab3c3ef12a12cae604d82d4e6f855f37fc | [
"Apache-2.0"
] | 1 | 2022-01-10T15:05:53.000Z | 2022-01-10T15:05:53.000Z | otter/database/model.py | pathob/odoo-otter | 1bf5dbab3c3ef12a12cae604d82d4e6f855f37fc | [
"Apache-2.0"
] | null | null | null | # based on https://realpython.com/python-sqlite-sqlalchemy/#using-flat-files-for-data-storage
from datetime import datetime
import sqlalchemy
from sqlalchemy import Column, String, Boolean, Integer, Float, Date, DateTime, ForeignKey, select, func, cast
from sqlalchemy.exc import NoResultFound
from sqlalchemy.ext.decla... | 30.135678 | 113 | 0.629148 | # based on https://realpython.com/python-sqlite-sqlalchemy/#using-flat-files-for-data-storage
from datetime import datetime
import sqlalchemy
from sqlalchemy import Column, String, Boolean, Integer, Float, Date, DateTime, ForeignKey, select, func, cast
from sqlalchemy.exc import NoResultFound
from sqlalchemy.ext.decla... | 2,597 | 2,343 | 115 |
f17683f3d27673d7aef5f527130d3c6b329fd12a | 3,553 | py | Python | golfshot-downloader.py | tinman6/golfshot-downloader | c5093c670a673fc0ee26fd0dceb9bba0c7675ad2 | [
"MIT"
] | null | null | null | golfshot-downloader.py | tinman6/golfshot-downloader | c5093c670a673fc0ee26fd0dceb9bba0c7675ad2 | [
"MIT"
] | null | null | null | golfshot-downloader.py | tinman6/golfshot-downloader | c5093c670a673fc0ee26fd0dceb9bba0c7675ad2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
from bs4 import BeautifulSoup
from html.parser import HTMLParser
from lxml import etree
import json
import re
import requests
GOLFSHOT_URL = 'https://play.golfshot.com'
parser = argparse.ArgumentParser(description='Download GolfShot data')
parser.add_argument('username', he... | 33.838095 | 160 | 0.687025 | #!/usr/bin/python
import argparse
from bs4 import BeautifulSoup
from html.parser import HTMLParser
from lxml import etree
import json
import re
import requests
GOLFSHOT_URL = 'https://play.golfshot.com'
class RoundParser(HTMLParser):
def handle_data(self, data):
# the golfshot model is available in a script b... | 2,151 | 19 | 163 |
195f9f62c5e9e58bb63a7defda4ff1c86c175351 | 1,719 | py | Python | examples/pyqtcom/mainwindow_UI.py | chinnurtb/distrex | a97a086050af6c799c86dadd3d2eb5c4ecb9b21c | [
"BSD-4-Clause"
] | 1 | 2015-01-12T01:19:13.000Z | 2015-01-12T01:19:13.000Z | examples/pyqtcom/mainwindow_UI.py | chinnurtb/distrex | a97a086050af6c799c86dadd3d2eb5c4ecb9b21c | [
"BSD-4-Clause"
] | null | null | null | examples/pyqtcom/mainwindow_UI.py | chinnurtb/distrex | a97a086050af6c799c86dadd3d2eb5c4ecb9b21c | [
"BSD-4-Clause"
] | null | null | null | from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
| 47.75 | 139 | 0.706225 | from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 756)
self.centralw... | 1,496 | 7 | 81 |
4b805d7ef26b22a989836bce1b521bf8bf18807d | 5,618 | py | Python | src/os-specific/windows/token/modify_token.py | shownadda/Malware-Dev | a3fb40371bb4c4f41c582747af41ae8800050f5c | [
"Unlicense"
] | 46 | 2022-01-30T14:29:02.000Z | 2022-03-25T03:49:13.000Z | src/os-specific/windows/token/modify_token.py | shownadda/Malware-Dev | a3fb40371bb4c4f41c582747af41ae8800050f5c | [
"Unlicense"
] | null | null | null | src/os-specific/windows/token/modify_token.py | shownadda/Malware-Dev | a3fb40371bb4c4f41c582747af41ae8800050f5c | [
"Unlicense"
] | 1 | 2022-03-05T03:42:55.000Z | 2022-03-05T03:42:55.000Z | ## Modify Process Token
# Global Imports
import ctypes
from ctypes.wintypes import DWORD
# Grab a handle on Advapi.dll, User32.dll and Kernel32.dll
a_handle = ctypes.WinDLL("Advapi32.dll")
u_handle = ctypes.WinDLL("User32.dll")
k_handle = ctypes.WinDLL("Kernel32.dll")
# Shortcut to give "All Access" right... | 33.242604 | 122 | 0.681737 | ## Modify Process Token
# Global Imports
import ctypes
from ctypes.wintypes import DWORD
# Grab a handle on Advapi.dll, User32.dll and Kernel32.dll
a_handle = ctypes.WinDLL("Advapi32.dll")
u_handle = ctypes.WinDLL("User32.dll")
k_handle = ctypes.WinDLL("Kernel32.dll")
# Shortcut to give "All Access" right... | 0 | 478 | 100 |
3a7284fda4bbc14d07099918c87da08e457cc884 | 277 | py | Python | doodledashboard/filters/filter.py | fossabot/Doodle-Dashboard | 147f5074afd594c47553a115358783b3f91043f0 | [
"MIT"
] | null | null | null | doodledashboard/filters/filter.py | fossabot/Doodle-Dashboard | 147f5074afd594c47553a115358783b3f91043f0 | [
"MIT"
] | null | null | null | doodledashboard/filters/filter.py | fossabot/Doodle-Dashboard | 147f5074afd594c47553a115358783b3f91043f0 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
| 17.3125 | 35 | 0.66065 | from abc import ABC, abstractmethod
class MessageFilter(ABC):
def __init__(self):
self._successor = None
@abstractmethod
def filter(self, text_entity):
pass
@staticmethod
@abstractmethod
def get_config_factory():
return None
| 75 | 142 | 23 |
e176e8f1cee58c069ecdbb88cf40ac41ba41119d | 709 | py | Python | Taller_Estructuras_de_Control_Secuenciales/Ejercicio_15.py | LeonardoJimenezUbaque/Algoritmos_y_Programacion_C4_G2 | 7bb6fffa7d5d99ac2b5c0a3724f97a84e145bbb7 | [
"MIT"
] | null | null | null | Taller_Estructuras_de_Control_Secuenciales/Ejercicio_15.py | LeonardoJimenezUbaque/Algoritmos_y_Programacion_C4_G2 | 7bb6fffa7d5d99ac2b5c0a3724f97a84e145bbb7 | [
"MIT"
] | null | null | null | Taller_Estructuras_de_Control_Secuenciales/Ejercicio_15.py | LeonardoJimenezUbaque/Algoritmos_y_Programacion_C4_G2 | 7bb6fffa7d5d99ac2b5c0a3724f97a84e145bbb7 | [
"MIT"
] | null | null | null | """
Ejercicio 15
Dados como datos el precio final pagado por un producto y su precio de venta al pรบblico (PVP), se requiere
que calcule y muestre el porcentaje de descuento que le ha sido aplicado.
Entradas
Precio_Final_Pagado --> Float --> P_F
Precio_Venta_Publico --> Float --> P_V_P
Salidas
Porcentaje_Descuento -->... | 32.227273 | 106 | 0.744711 | """
Ejercicio 15
Dados como datos el precio final pagado por un producto y su precio de venta al pรบblico (PVP), se requiere
que calcule y muestre el porcentaje de descuento que le ha sido aplicado.
Entradas
Precio_Final_Pagado --> Float --> P_F
Precio_Venta_Publico --> Float --> P_V_P
Salidas
Porcentaje_Descuento -->... | 0 | 0 | 0 |
ffd083841407fefac167ebacd9988307729e3322 | 3,021 | py | Python | source/brailleInput.py | davidhilton936/clone | 0889f95ef2d74f43b2c98f4d45bf09b0c605f1de | [
"bzip2-1.0.6"
] | 1 | 2019-10-26T04:13:35.000Z | 2019-10-26T04:13:35.000Z | source/brailleInput.py | davidhilton936/clone | 0889f95ef2d74f43b2c98f4d45bf09b0c605f1de | [
"bzip2-1.0.6"
] | 1 | 2017-08-08T00:44:17.000Z | 2017-08-08T00:44:17.000Z | source/brailleInput.py | davidhilton936/clone | 0889f95ef2d74f43b2c98f4d45bf09b0c605f1de | [
"bzip2-1.0.6"
] | 1 | 2020-04-30T19:14:00.000Z | 2020-04-30T19:14:00.000Z | #brailleInput.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2012-2013 NV Access Limited, Rui Batista
import os.path
import louis
import braille
import config
from logHandler import log
import winUser
import ... | 28.5 | 86 | 0.709037 | #brailleInput.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2012-2013 NV Access Limited, Rui Batista
import os.path
import louis
import braille
import config
from logHandler import log
import winUser
import ... | 1,381 | 0 | 118 |
3dcf6942a7a97ee219cc62d3971216e7115616cc | 3,477 | py | Python | gutenTAG/base_oscillations/utils/consolidator.py | HPI-Information-Systems/gutentag | 5638dadf9b1e83699ca317ce9eb4569a6c350064 | [
"MIT"
] | 1 | 2022-03-01T13:29:16.000Z | 2022-03-01T13:29:16.000Z | gutenTAG/base_oscillations/utils/consolidator.py | HPI-Information-Systems/gutentag | 5638dadf9b1e83699ca317ce9eb4569a6c350064 | [
"MIT"
] | null | null | null | gutenTAG/base_oscillations/utils/consolidator.py | HPI-Information-Systems/gutentag | 5638dadf9b1e83699ca317ce9eb4569a6c350064 | [
"MIT"
] | null | null | null | from typing import List, Optional, Tuple
import numpy as np
from gutenTAG.anomalies import AnomalyProtocol, LabelRange, Anomaly
from gutenTAG.base_oscillations.interface import BaseOscillationInterface
| 47.630137 | 155 | 0.67472 | from typing import List, Optional, Tuple
import numpy as np
from gutenTAG.anomalies import AnomalyProtocol, LabelRange, Anomaly
from gutenTAG.base_oscillations.interface import BaseOscillationInterface
class Consolidator:
def __init__(self, base_oscillations: List[BaseOscillationInterface], anomalies: List[Anom... | 3,008 | -2 | 265 |
927514758cfa6089deece09c9319a8bda7feab28 | 1,064 | py | Python | CEGO/testFunctions/DTLZ8.py | napa-jmm/CEGO | 172d511133a608ca5bf265d9ebd2937b8a171b3e | [
"MIT"
] | 6 | 2018-07-18T06:38:42.000Z | 2021-11-17T21:01:40.000Z | CEGO/testFunctions/DTLZ8.py | napa-jmm/CEGO | 172d511133a608ca5bf265d9ebd2937b8a171b3e | [
"MIT"
] | null | null | null | CEGO/testFunctions/DTLZ8.py | napa-jmm/CEGO | 172d511133a608ca5bf265d9ebd2937b8a171b3e | [
"MIT"
] | 6 | 2018-10-15T09:35:24.000Z | 2021-05-08T13:40:19.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 11:06:16 2018
@author: r.dewinter
"""
import numpy as np
#import matplotlib.pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
#rngMin = np.zeros(9)
#rngMax = np.ones(9)
#nVar = 9
#ref = np.array([1,1,1])
#parameters = np.empty((200,9))
#objecti... | 23.644444 | 72 | 0.56391 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 11:06:16 2018
@author: r.dewinter
"""
import numpy as np
def DTLZ8(x):
f1 = 1/3*np.sum(x[:3])
f2 = 1/3*np.sum(x[3:6])
f3 = 1/3*np.sum(x[6:])
g1 = f3+4*f1-1
g2 = f3+4*f2-1
g3 = 2*f3+f1+f2-1
return np.array([f... | 217 | 0 | 25 |
583b74e40fc0ea58b61f300685cd5e11e60972b3 | 2,747 | py | Python | vectorize.py | orestislabridis/X-SPELLS | 4285888ef2c9cc5ef59756d363319599d8599e69 | [
"Apache-2.0"
] | 1 | 2021-01-09T09:21:02.000Z | 2021-01-09T09:21:02.000Z | vectorize.py | orestislabridis/X-SPELLS | 4285888ef2c9cc5ef59756d363319599d8599e69 | [
"Apache-2.0"
] | 1 | 2020-11-26T14:34:08.000Z | 2021-02-03T12:48:35.000Z | vectorize.py | orestislampridis/X-SPELLS | 4285888ef2c9cc5ef59756d363319599d8599e69 | [
"Apache-2.0"
] | null | null | null | """
Helper script used for turning text into tf-idf vector for the knn experiment
"""
import re
import numpy
from nltk import pos_tag
from nltk.corpus import stopwords
from nltk.corpus import wordnet
from nltk.stem import SnowballStemmer
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import wo... | 32.317647 | 112 | 0.625774 | """
Helper script used for turning text into tf-idf vector for the knn experiment
"""
import re
import numpy
from nltk import pos_tag
from nltk.corpus import stopwords
from nltk.corpus import wordnet
from nltk.stem import SnowballStemmer
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import wo... | 1,151 | 0 | 58 |
1de486ee204679bd8893f40a41b6333021fd84bd | 81 | py | Python | ichnaea/tests/__init__.py | crankycoder/ichnaea | fb54000e92c605843b7a41521e36fd648c11ae94 | [
"Apache-2.0"
] | 1 | 2018-01-18T16:02:43.000Z | 2018-01-18T16:02:43.000Z | ichnaea/tests/__init__.py | crankycoder/ichnaea | fb54000e92c605843b7a41521e36fd648c11ae94 | [
"Apache-2.0"
] | null | null | null | ichnaea/tests/__init__.py | crankycoder/ichnaea | fb54000e92c605843b7a41521e36fd648c11ae94 | [
"Apache-2.0"
] | 1 | 2018-01-19T17:56:48.000Z | 2018-01-19T17:56:48.000Z | import os.path
DATA_DIRECTORY = os.path.join(os.path.dirname(__file__), 'data')
| 20.25 | 64 | 0.753086 | import os.path
DATA_DIRECTORY = os.path.join(os.path.dirname(__file__), 'data')
| 0 | 0 | 0 |
66bacfd2c886a3e584925a335ad2ea71c33c9b69 | 1,524 | py | Python | algo_test3.py | pflun/learningAlgorithms | 3101e989488dfc8a56f1bf256a1c03a837fe7d97 | [
"MIT"
] | null | null | null | algo_test3.py | pflun/learningAlgorithms | 3101e989488dfc8a56f1bf256a1c03a837fe7d97 | [
"MIT"
] | null | null | null | algo_test3.py | pflun/learningAlgorithms | 3101e989488dfc8a56f1bf256a1c03a837fe7d97 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# test = Solution()
# # print test.lexicographical('apple', 'appld')
# print test.trySet()
test = Solution3()
print test.canFinish([[1, 0], [2, 1], [2, 0]]) | 24.190476 | 63 | 0.489501 | # -*- coding: utf-8 -*-
class Solution(object):
# ้ๆๅ้
TAG = "Person"
def lexicographical(self, a, b):
for i in range(5, -1, -1):
print i
matrix = [
[1, 5, 9],
[10, 11, 13],
[12, 13, 15]
],
r... | 1,103 | 126 | 120 |
8d4eba3c2060dccdffd308731cd2c7d3744a9820 | 2,751 | py | Python | terrascript/resource/phillbaker/elasticsearch.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/resource/phillbaker/elasticsearch.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/resource/phillbaker/elasticsearch.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/resource/phillbaker/elasticsearch.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:15:48 UTC)
import terrascript
__all__ = [
"elasticsearch_component_template",
"elasticsearch_composable_index_template",
"elasticsearch_index",
"elasticsearch_index_... | 22.365854 | 74 | 0.811705 | # terrascript/resource/phillbaker/elasticsearch.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:15:48 UTC)
import terrascript
class elasticsearch_component_template(terrascript.Resource):
pass
class elasticsearch_composable_index_template(terrascript.Resource):
pass
class elasticsearch_i... | 0 | 1,123 | 529 |
3dbd97084674df281038a2e53d7b34d293b49d15 | 1,579 | py | Python | pydm/tests/utilities/test_iconfont.py | klauer/pydm | e26aad58a7a0eb6f7321c61aa1dace646ff652bd | [
"BSD-3-Clause-LBNL"
] | null | null | null | pydm/tests/utilities/test_iconfont.py | klauer/pydm | e26aad58a7a0eb6f7321c61aa1dace646ff652bd | [
"BSD-3-Clause-LBNL"
] | null | null | null | pydm/tests/utilities/test_iconfont.py | klauer/pydm | e26aad58a7a0eb6f7321c61aa1dace646ff652bd | [
"BSD-3-Clause-LBNL"
] | null | null | null | import pytest
from ...utilities import iconfont
from ...PyQt import QtGui, QtCore
| 30.960784 | 93 | 0.69981 | import pytest
from ...utilities import iconfont
from ...PyQt import QtGui, QtCore
def test_icon_font_constructor(qtbot):
icon_f = iconfont.IconFont()
icon_f2 = iconfont.IconFont()
assert (icon_f is icon_f2)
def test_icon_font_load_font(qtbot):
icon_f = iconfont.IconFont()
with pytest.raises(OSEr... | 1,354 | 0 | 138 |
5d8d397e6a8ca3fdf09cc0422991f6bb28d600a0 | 3,758 | py | Python | ex4/4_2_binary_classification/4_2_binary_classification.py | Jeilef/FoSA | d4b53bd687d06af80f91d4c7c96c1ef97708933f | [
"MIT"
] | null | null | null | ex4/4_2_binary_classification/4_2_binary_classification.py | Jeilef/FoSA | d4b53bd687d06af80f91d4c7c96c1ef97708933f | [
"MIT"
] | null | null | null | ex4/4_2_binary_classification/4_2_binary_classification.py | Jeilef/FoSA | d4b53bd687d06af80f91d4c7c96c1ef97708933f | [
"MIT"
] | null | null | null | import argparse, os
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVR
import pandas as pd
from scipy.io import arff
# to get the summary both logistic-regression and support-vector-machines have to be run once with the output errors option
if __name__ == "__main__":
parser = ar... | 37.207921 | 135 | 0.685737 | import argparse, os
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVR
import pandas as pd
from scipy.io import arff
def train_svm(train_dataset):
cols = train_dataset.columns.values
x = train_dataset[cols[:-1]].to_numpy()
y = train_dataset[cols[-1]].to_numpy()
y = [i[0] f... | 2,246 | 0 | 114 |
327fc17dee8a883eb99c23c7dc2a82bf1781a06f | 757 | py | Python | ElectrospraySimulator/GUI_scripts/PredefinedFuns.py | DavidPoves/Liquid-meniscus-in-the-ionic-regime-simulator | 9a8cfce64ae2adb06c39418fdbbb187c75431c69 | [
"MIT"
] | null | null | null | ElectrospraySimulator/GUI_scripts/PredefinedFuns.py | DavidPoves/Liquid-meniscus-in-the-ionic-regime-simulator | 9a8cfce64ae2adb06c39418fdbbb187c75431c69 | [
"MIT"
] | null | null | null | ElectrospraySimulator/GUI_scripts/PredefinedFuns.py | DavidPoves/Liquid-meniscus-in-the-ionic-regime-simulator | 9a8cfce64ae2adb06c39418fdbbb187c75431c69 | [
"MIT"
] | null | null | null | import numpy as np
"""
Within this file, the predefined functions appearing in the main menu may be defined. If a new one is added, it must be
added to the attributes self.predef_funs_show and self.predef_funs of the PredefinedFunctions class from the MainMenu.py
file. Moreover, these functions must be added to the se... | 24.419355 | 120 | 0.660502 | import numpy as np
"""
Within this file, the predefined functions appearing in the main menu may be defined. If a new one is added, it must be
added to the attributes self.predef_funs_show and self.predef_funs of the PredefinedFunctions class from the MainMenu.py
file. Moreover, these functions must be added to the se... | 297 | 0 | 92 |
727e5a69e567a4226eac8c6955f63566c5e67590 | 1,284 | py | Python | algorithm/graph_theory/connected_cell/solution.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2017-07-02T01:35:39.000Z | 2017-07-02T01:35:39.000Z | algorithm/graph_theory/connected_cell/solution.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | null | null | null | algorithm/graph_theory/connected_cell/solution.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2018-04-03T15:11:56.000Z | 2018-04-03T15:11:56.000Z | #!/usr/bin/env python3
"""
:problem: https://www.hackerrank.com/challenges/ctci-connected-cell-in-a-grid/problem
"""
from typing import List, Set, Tuple
Cell = Tuple[int, int]
if __name__ == '__main__':
main()
| 24.226415 | 85 | 0.492212 | #!/usr/bin/env python3
"""
:problem: https://www.hackerrank.com/challenges/ctci-connected-cell-in-a-grid/problem
"""
from typing import List, Set, Tuple
Cell = Tuple[int, int]
def dfs_region(grid: List[List[int]], visited: Set[Cell], start: Cell) -> int:
area = 0
if start in visited:
return 1
ce... | 1,018 | 0 | 46 |
bfb08d3994e7214fb72cf9fbaa7086621a4d8da3 | 4,713 | py | Python | FC.py | mahootiha-maryam/DL-for-image-analysis | 2e645341a6d3c54b2dbe31a04f96c2a06a5793c9 | [
"Apache-2.0"
] | null | null | null | FC.py | mahootiha-maryam/DL-for-image-analysis | 2e645341a6d3c54b2dbe31a04f96c2a06a5793c9 | [
"Apache-2.0"
] | null | null | null | FC.py | mahootiha-maryam/DL-for-image-analysis | 2e645341a6d3c54b2dbe31a04f96c2a06a5793c9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
This is a fully connected neural network.
It contains data batching , using Relu activation function,
using adam optimizer and dropout for overfitting.
'''
import torch
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sklearn
data = pd.read_csv('bike_sharing.c... | 30.406452 | 97 | 0.663484 | # -*- coding: utf-8 -*-
'''
This is a fully connected neural network.
It contains data batching , using Relu activation function,
using adam optimizer and dropout for overfitting.
'''
import torch
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sklearn
data = pd.read_csv('bike_sharing.c... | 0 | 0 | 0 |
9b0433912348ba45b8e9413dd40fe8c371f9ea92 | 11,956 | py | Python | HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2L3MuonsNoID_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2L3MuonsNoID_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2L3MuonsNoID_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
hltPhase2L3MuonsNoID = cms.EDProducer("MuonIdProducer",
CaloExtractorPSet = cms.PSet(
CenterConeOnCalIntersection = cms.bool(False),
ComponentName = cms.string('CaloExtractorByAssociator'),
DR_Max = cms.double(1.0),
DR_Veto_E = cms.double(0.0... | 43.794872 | 128 | 0.610572 | import FWCore.ParameterSet.Config as cms
hltPhase2L3MuonsNoID = cms.EDProducer("MuonIdProducer",
CaloExtractorPSet = cms.PSet(
CenterConeOnCalIntersection = cms.bool(False),
ComponentName = cms.string('CaloExtractorByAssociator'),
DR_Max = cms.double(1.0),
DR_Veto_E = cms.double(0.0... | 0 | 0 | 0 |
932abde0780a030533a6b3666904bc58b1662fa8 | 754 | py | Python | 01. Searching & Sorting/Python files/Insertion_sort.py | Ansh-cell/Data-structure-Algorithms-using-Python | 2074bd1aece7ea95a8ae12bd3e4de8139711eba1 | [
"MIT"
] | 2 | 2021-07-06T21:27:33.000Z | 2021-08-24T14:28:34.000Z | 01. Searching & Sorting/Python files/Insertion_sort.py | Ansh-cell/Data-structure-Algorithms-using-Python | 2074bd1aece7ea95a8ae12bd3e4de8139711eba1 | [
"MIT"
] | null | null | null | 01. Searching & Sorting/Python files/Insertion_sort.py | Ansh-cell/Data-structure-Algorithms-using-Python | 2074bd1aece7ea95a8ae12bd3e4de8139711eba1 | [
"MIT"
] | null | null | null |
arr = [2, 4, 1, 2, 8, 3]
insertionSort(arr)
print(arr) | 47.125 | 108 | 0.600796 | def insertionSort(arr): # argument: (arr) --> arr = array / list
length = len(arr) # find the length of array
for i in range(1, length): # starting from 1st index till end
temp = arr[i] # store the value of ith index in temp so it can be access later
j = i - 1 # as we are starting from 1st... | 676 | 0 | 22 |
d5389c2ca4d0f76395925e219d955743ce469ed0 | 11,483 | py | Python | feeds/tests/test_models.py | ralphqq/rss-apifier | cd056654abf24fd178f1e5d8661cafcb3cc1236b | [
"MIT"
] | null | null | null | feeds/tests/test_models.py | ralphqq/rss-apifier | cd056654abf24fd178f1e5d8661cafcb3cc1236b | [
"MIT"
] | 5 | 2020-06-06T01:01:48.000Z | 2021-09-22T18:16:22.000Z | feeds/tests/test_models.py | ralphqq/rss-apifier | cd056654abf24fd178f1e5d8661cafcb3cc1236b | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.conf import settings
from django.db import IntegrityError
from django.test import TestCase
from feeds.tests.helpers import (
make_fake_feedparser_dict, make_feed_entries_list,
make_preprocessed_entries_list
)
from feeds.models import Entry, Feed
@... | 38.023179 | 77 | 0.634764 | from unittest.mock import patch
from django.conf import settings
from django.db import IntegrityError
from django.test import TestCase
from feeds.tests.helpers import (
make_fake_feedparser_dict, make_feed_entries_list,
make_preprocessed_entries_list
)
from feeds.models import Entry, Feed
class... | 10,342 | 43 | 682 |
469949c76743edf2d55f59e5b288ae57e2e866c5 | 70,296 | py | Python | intensio/examples/python/intermediate/output/basicRAT-example/ItAvGNeiuyvPMOGsZIzXIVBRyHPHRAwkpnsoyvPsfARqNqWfJInnIyGCFSGxjyC.py | Warlockk/Intensio-Obfuscator | befaf1cfd2f7320266f07ef036542413317b3d9b | [
"MIT"
] | 1 | 2020-02-25T10:54:44.000Z | 2020-02-25T10:54:44.000Z | intensio/examples/python/intermediate/output/basicRAT-example/ItAvGNeiuyvPMOGsZIzXIVBRyHPHRAwkpnsoyvPsfARqNqWfJInnIyGCFSGxjyC.py | Warlockk/Intensio-Obfuscator | befaf1cfd2f7320266f07ef036542413317b3d9b | [
"MIT"
] | null | null | null | intensio/examples/python/intermediate/output/basicRAT-example/ItAvGNeiuyvPMOGsZIzXIVBRyHPHRAwkpnsoyvPsfARqNqWfJInnIyGCFSGxjyC.py | Warlockk/Intensio-Obfuscator | befaf1cfd2f7320266f07ef036542413317b3d9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
FjRNtSCJtxQIHzHCBANyvSDFfkHSAoEHzzByCQCtzEQRIPEGztHSpPBmIAjBJFF = 'RXLQksAGmIIuwhBJUptxVuytBrDBAdGQAQvkSrGtgiSFnGSZospnORAnCEZHCBz'
zmNDzvGHuIEXFHBBtGtCEpxpAQSFvzsESQMwGFYFyGQyEUBBoMCOCFPCRARREmS = 'RICsbwNkCOqPrHxHGDwjHTJCAhHPGiRZSFzrFITzFLmZFDDAuBRtAxtkQzDUuGg'
xJOxLDDlmqmAmyPHrDJSJSCFCitymFVQqv... | 126.431655 | 278 | 0.865753 | #!/usr/bin/env python
FjRNtSCJtxQIHzHCBANyvSDFfkHSAoEHzzByCQCtzEQRIPEGztHSpPBmIAjBJFF = 'RXLQksAGmIIuwhBJUptxVuytBrDBAdGQAQvkSrGtgiSFnGSZospnORAnCEZHCBz'
zmNDzvGHuIEXFHBBtGtCEpxpAQSFvzsESQMwGFYFyGQyEUBBoMCOCFPCRARREmS = 'RICsbwNkCOqPrHxHGDwjHTJCAhHPGiRZSFzrFITzFLmZFDDAuBRtAxtkQzDUuGg'
xJOxLDDlmqmAmyPHrDJSJSCFCitymFVQqv... | 34,464 | 0 | 22 |
c608b7e78abd3f1e926ac291a49708e420d785ec | 2,057 | py | Python | topfarm/examples/data/parque_ficticio_offshore.py | DTUWindEnergy/TopFarm2 | cba70b20431f7a828370447117fe2e7533edf7c2 | [
"MIT"
] | 4 | 2019-02-18T08:46:00.000Z | 2021-01-28T06:35:52.000Z | topfarm/examples/data/parque_ficticio_offshore.py | DTUWindEnergy/TopFarm2 | cba70b20431f7a828370447117fe2e7533edf7c2 | [
"MIT"
] | 1 | 2019-11-26T12:12:12.000Z | 2019-11-26T12:12:12.000Z | topfarm/examples/data/parque_ficticio_offshore.py | DTUWindEnergy/TopFarm2 | cba70b20431f7a828370447117fe2e7533edf7c2 | [
"MIT"
] | 8 | 2019-01-14T09:33:26.000Z | 2021-06-30T11:56:03.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 28 10:55:12 2021
@author: mikf
"""
import numpy as np
from py_wake.examples.data.ParqueFicticio import ParqueFicticio_path
from py_wake.site import WaspGridSite
from py_wake.site.xrsite import XRSite
x = np.asarray([262403., 262553., 262703., 262853., 263003., 263153., ... | 39.557692 | 83 | 0.613515 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 28 10:55:12 2021
@author: mikf
"""
import numpy as np
from py_wake.examples.data.ParqueFicticio import ParqueFicticio_path
from py_wake.site import WaspGridSite
from py_wake.site.xrsite import XRSite
x = np.asarray([262403., 262553., 262703., 262853., 263003., 263153., ... | 441 | 30 | 49 |
f59e767ecc296ece5f2f229615f34bfb6522912e | 44,883 | py | Python | neural_style_pattern_transfer (1).py | Solidity-Coder/Paperspace | 65f128f85dea1d0f9efb8ab7ee8352f43e933ddc | [
"BSD-Source-Code"
] | null | null | null | neural_style_pattern_transfer (1).py | Solidity-Coder/Paperspace | 65f128f85dea1d0f9efb8ab7ee8352f43e933ddc | [
"BSD-Source-Code"
] | null | null | null | neural_style_pattern_transfer (1).py | Solidity-Coder/Paperspace | 65f128f85dea1d0f9efb8ab7ee8352f43e933ddc | [
"BSD-Source-Code"
] | null | null | null | # -*- coding: utf-8 -*-
"""Neural Style Pattern Transfer.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ijYjSvGfWm1aUkw0stn6P7U8pYwhsbU0
"""
#!nvcc --version
print("Your GPU is a ")
!nvidia-smi -L
print("GPU Logs")
print("Nvidia K80 is not enou... | 318.319149 | 850 | 0.812646 | # -*- coding: utf-8 -*-
"""Neural Style Pattern Transfer.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ijYjSvGfWm1aUkw0stn6P7U8pYwhsbU0
"""
#!nvcc --version
print("Your GPU is a ")
!nvidia-smi -L
print("GPU Logs")
print("Nvidia K80 is not enou... | 0 | 0 | 0 |
4638f5ba6e3f686cec58d6f8ca423b3545ee3d5f | 3,856 | py | Python | io_utils.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | null | null | null | io_utils.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2020-12-16T18:21:11.000Z | 2020-12-30T10:08:27.000Z | io_utils.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2021-03-29T20:58:26.000Z | 2021-03-29T20:58:26.000Z | import logging
from os import path
from os.path import dirname, join
from arekit.common.utils import create_dir_if_not_exists
from arekit.contrib.experiments.cv.default import SimpleCVFolding
from arekit.contrib.experiments.cv.doc_stat.rusentrel import RuSentRelDocStatGenerator
from arekit.contrib.experiments.cv.senten... | 37.436893 | 110 | 0.747666 | import logging
from os import path
from os.path import dirname, join
from arekit.common.utils import create_dir_if_not_exists
from arekit.contrib.experiments.cv.default import SimpleCVFolding
from arekit.contrib.experiments.cv.doc_stat.rusentrel import RuSentRelDocStatGenerator
from arekit.contrib.experiments.cv.senten... | 2,207 | 657 | 23 |
75cfe90c3d565a83d48164ad50bd25b3298e863e | 1,038 | py | Python | image_utils.py | Raiszo/facenet-testing | 563ff85a2aec50f86a49e1b1054651584872cb02 | [
"MIT"
] | null | null | null | image_utils.py | Raiszo/facenet-testing | 563ff85a2aec50f86a49e1b1054651584872cb02 | [
"MIT"
] | null | null | null | image_utils.py | Raiszo/facenet-testing | 563ff85a2aec50f86a49e1b1054651584872cb02 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.misc import imread, imresize
FACENET_MEAN = np.array([ 0.52591038, 0.40204082, 0.34178183], dtype=np.float32)
FACENET_STD = np.sqrt(np.array([3941.30175781, 2856.94287109, 2519.35791016], dtype=np.float32) / 255.**2)
def preprocess_image(img):
"""Preprocess an image for squeezenet.... | 34.6 | 106 | 0.685934 | import numpy as np
from scipy.misc import imread, imresize
def load_image(filename, size=None):
img = imread(filename)
if size is not None:
orig_shape = np.array(img.shape[:2])
min_idx = np.argmin(orig_shape)
scale_factor = float(size) / orig_shape[min_idx]
new_shape = (orig_sha... | 519 | 0 | 46 |
ab65c055bcd0082903a22b251f7cfa1e0ddbad07 | 3,466 | py | Python | pizza_cell.py | hex7c0/google-hashcode | a0aecc6a08fe3ffcdd362c2c4abccd58d9b73937 | [
"MIT"
] | null | null | null | pizza_cell.py | hex7c0/google-hashcode | a0aecc6a08fe3ffcdd362c2c4abccd58d9b73937 | [
"MIT"
] | null | null | null | pizza_cell.py | hex7c0/google-hashcode | a0aecc6a08fe3ffcdd362c2c4abccd58d9b73937 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""PizzaCell class."""
from enum import Enum, unique
from cell import Cell
from slice import Slice
@unique
class Ingredient(Enum):
"""Ingredient enum."""
MUSHROOM = 'M'
TOMATO = 'T'
class PizzaCell(object):
"""Cell of Pizza.
:type ingredient: Ingredient or None
... | 19.255556 | 69 | 0.540681 | # -*- coding: utf-8 -*-
"""PizzaCell class."""
from enum import Enum, unique
from cell import Cell
from slice import Slice
@unique
class Ingredient(Enum):
"""Ingredient enum."""
MUSHROOM = 'M'
TOMATO = 'T'
class PizzaCell(object):
"""Cell of Pizza.
:type ingredient: Ingredient or None
... | 0 | 0 | 0 |
beca77095f01db98212b8a9f91256b225a689bb8 | 1,945 | py | Python | moses/junction_tree/trainer.py | GT4SD/moses | 2fb13dc757f82484beaae19140be335affb60c4b | [
"MIT"
] | null | null | null | moses/junction_tree/trainer.py | GT4SD/moses | 2fb13dc757f82484beaae19140be335affb60c4b | [
"MIT"
] | null | null | null | moses/junction_tree/trainer.py | GT4SD/moses | 2fb13dc757f82484beaae19140be335affb60c4b | [
"MIT"
] | null | null | null | import torch.optim as optim
import tqdm
from moses.utils import Logger
import torch
| 35.363636 | 103 | 0.488432 | import torch.optim as optim
import tqdm
from moses.utils import Logger
import torch
class JTreeTrainer:
def __init__(self, config):
self.config = config
def fit(self, model, data):
def get_params():
return (p for p in model.parameters() if p.requires_grad)
model.train()
... | 1,786 | -2 | 76 |
ef259f88b97a2ce21f13a711e7f4694b88d463ec | 4,136 | py | Python | src/deploy/builder/stacks/stack_processor.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | src/deploy/builder/stacks/stack_processor.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | src/deploy/builder/stacks/stack_processor.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | import requests
from django.core.files import File
from tempfile import mkdtemp
from shutil import copy, rmtree
import os
import yaml
import zipfile
from django.conf import settings
from docker.client import DockerClient
from docker.models.images import ImageCollection
from docker_registry_client import DockerRegistry... | 33.088 | 112 | 0.735493 | import requests
from django.core.files import File
from tempfile import mkdtemp
from shutil import copy, rmtree
import os
import yaml
import zipfile
from django.conf import settings
from docker.client import DockerClient
from docker.models.images import ImageCollection
from docker_registry_client import DockerRegistry... | 3,064 | 56 | 253 |
17670b80b678e8575dd39c563e1e3a2f22fe7ac1 | 45,313 | py | Python | Software/Network plotters/elec_only_OMEGA_plot.py | JonasVind/Master_Project_Code-Plots | f3efea1a30738b119bf6958cc490b940c90e2909 | [
"CC-BY-4.0"
] | null | null | null | Software/Network plotters/elec_only_OMEGA_plot.py | JonasVind/Master_Project_Code-Plots | f3efea1a30738b119bf6958cc490b940c90e2909 | [
"CC-BY-4.0"
] | null | null | null | Software/Network plotters/elec_only_OMEGA_plot.py | JonasVind/Master_Project_Code-Plots | f3efea1a30738b119bf6958cc490b940c90e2909 | [
"CC-BY-4.0"
] | null | null | null | # Import libraries
import os
import sys
import pypsa
import numpy as np
import pandas as pd
#from sympy import latex
import time
import math
# Timer
t0 = time.time() # Start a timer
# Import functions file
sys.path.append(os.path.split(os.getcwd())[0])
from functions_file import *
# Directory of file
#dir... | 42.828922 | 213 | 0.664489 | # Import libraries
import os
import sys
import pypsa
import numpy as np
import pandas as pd
#from sympy import latex
import time
import math
# Timer
t0 = time.time() # Start a timer
# Import functions file
sys.path.append(os.path.split(os.getcwd())[0])
from functions_file import *
# Directory of file
#dir... | 0 | 0 | 0 |
ba87651683190064a49de123288bc017d6c365cd | 4,017 | py | Python | scratch/scratch5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | 1 | 2020-06-14T13:50:28.000Z | 2020-06-14T13:50:28.000Z | scratch/scratch5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | scratch/scratch5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | # Similar to scratch3, but with the BAN channel
from sys_simulator.channels import BANChannel
from sys_simulator import general as gen
from sys_simulator.pathloss import pathloss_bs_users
from sys_simulator.plots import plot_positions_actions_pie
from sys_simulator.q_learning.environments.completeEnvironment5 \
imp... | 34.930435 | 73 | 0.731641 | # Similar to scratch3, but with the BAN channel
from sys_simulator.channels import BANChannel
from sys_simulator import general as gen
from sys_simulator.pathloss import pathloss_bs_users
from sys_simulator.plots import plot_positions_actions_pie
from sys_simulator.q_learning.environments.completeEnvironment5 \
imp... | 1,238 | 0 | 23 |
c5fd6aab5a84d25789ea2f8ec3a5bf04566738c0 | 8,691 | py | Python | reps/cmore.py | hanyas/reps | 447c461b89dec516ce3368d841cfe9734be78199 | [
"MIT"
] | 8 | 2021-06-21T18:58:56.000Z | 2021-12-13T09:47:41.000Z | reps/cmore.py | hanyas/reps | 447c461b89dec516ce3368d841cfe9734be78199 | [
"MIT"
] | null | null | null | reps/cmore.py | hanyas/reps | 447c461b89dec516ce3368d841cfe9734be78199 | [
"MIT"
] | 1 | 2021-06-29T04:42:45.000Z | 2021-06-29T04:42:45.000Z | import autograd.numpy as np
import scipy as sc
from scipy import optimize
from scipy import special
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import Ridge
import copy
| 30.928826 | 108 | 0.5149 | import autograd.numpy as np
import scipy as sc
from scipy import optimize
from scipy import special
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import Ridge
import copy
class Policy:
def __init__(self, context_dim, act_dim, degree, cov0):
self.context_dim = context_d... | 8,033 | -26 | 474 |
2e15e14410009c204ee1fd1d8c430864f2e208fa | 681 | py | Python | tests/test_losses.py | feng-y16/Hamiltonian-Generative-Networks | 702d3ff3aec40eba20e17c5a1612b5b0b1e2f831 | [
"MIT"
] | 29 | 2020-09-14T11:59:03.000Z | 2022-03-10T16:31:19.000Z | tests/test_losses.py | feng-y16/Hamiltonian-Generative-Networks | 702d3ff3aec40eba20e17c5a1612b5b0b1e2f831 | [
"MIT"
] | 49 | 2020-09-14T12:33:51.000Z | 2021-01-21T22:52:17.000Z | tests/test_losses.py | feng-y16/Hamiltonian-Generative-Networks | 702d3ff3aec40eba20e17c5a1612b5b0b1e2f831 | [
"MIT"
] | 7 | 2020-11-10T16:20:31.000Z | 2022-01-09T10:49:59.000Z | import torch
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from utilities.losses import kld_loss
test_kld_loss() | 29.608696 | 81 | 0.668135 | import torch
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from utilities.losses import kld_loss
def test_kld_loss():
batch_sizes = [1, 10, 100]
latent_size = 8
for batch_size in [10]: #batch_sizes:
mu = torch.randn((batch_size, latent_size))
... | 493 | 0 | 23 |
4c9f191f559541a62f958864ace3c9c32de00e4d | 257 | py | Python | python-mundo1/ex023.py | abm-astro/estudos-python | c0dcd71489e528d445efa25d4986bf2fd08f8fe6 | [
"MIT"
] | 1 | 2021-08-15T18:18:43.000Z | 2021-08-15T18:18:43.000Z | python-mundo1/ex023.py | abm-astro/estudos-python | c0dcd71489e528d445efa25d4986bf2fd08f8fe6 | [
"MIT"
] | null | null | null | python-mundo1/ex023.py | abm-astro/estudos-python | c0dcd71489e528d445efa25d4986bf2fd08f8fe6 | [
"MIT"
] | null | null | null | number = int(input('Digite um nรบmero de atรฉ 4 algarismos: '))
print(f'Analisando o nรบmero {number} ...')
u = number // 1 % 10
d = number // 10 % 10
c = number // 100 % 10
m = number // 1000 % 10
print(f'Unidade: {u}\nDezena: {d}\nCentena: {c}\nMilhar: {m}') | 36.714286 | 62 | 0.614786 | number = int(input('Digite um nรบmero de atรฉ 4 algarismos: '))
print(f'Analisando o nรบmero {number} ...')
u = number // 1 % 10
d = number // 10 % 10
c = number // 100 % 10
m = number // 1000 % 10
print(f'Unidade: {u}\nDezena: {d}\nCentena: {c}\nMilhar: {m}') | 0 | 0 | 0 |
0445556ee9637cca8a8f03fdbe424f60d870d8ec | 1,351 | py | Python | python/lockfile/Lockfile.py | devastating/misc | f9922e14a9305808e668d8412b7a2443a7f45a0d | [
"MIT"
] | null | null | null | python/lockfile/Lockfile.py | devastating/misc | f9922e14a9305808e668d8412b7a2443a7f45a0d | [
"MIT"
] | null | null | null | python/lockfile/Lockfile.py | devastating/misc | f9922e14a9305808e668d8412b7a2443a7f45a0d | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Simple implementation for Linux lockfile
'''
import os
import time
def LockFile(target, retry=30, timeout=1):
'''
Use this method if you want to make sure only one process opens
the "target" file. The "target" path should be a path to a file
in an existing folder.
Create a ... | 27.02 | 77 | 0.646188 | #!/usr/bin/python
'''
Simple implementation for Linux lockfile
'''
import os
import time
def LockFile(target, retry=30, timeout=1):
'''
Use this method if you want to make sure only one process opens
the "target" file. The "target" path should be a path to a file
in an existing folder.
Create a ... | 0 | 0 | 0 |
8a4eee6bbaa12039e95643fb0658e9efe65e588b | 18,494 | py | Python | oidc_example/op3/server.py | kschu91/pyoidc | ae5702a8b2f13d5e7af173a58355cd738ec79a31 | [
"Apache-2.0"
] | 373 | 2017-03-08T21:37:03.000Z | 2022-03-24T13:37:23.000Z | oidc_example/op3/server.py | kschu91/pyoidc | ae5702a8b2f13d5e7af173a58355cd738ec79a31 | [
"Apache-2.0"
] | 523 | 2017-03-02T17:03:12.000Z | 2022-03-24T18:34:51.000Z | oidc_example/op3/server.py | kschu91/pyoidc | ae5702a8b2f13d5e7af173a58355cd738ec79a31 | [
"Apache-2.0"
] | 165 | 2017-03-02T16:54:42.000Z | 2022-02-26T18:34:00.000Z | #!/usr/bin/env python
__author__ = 'Vahid Jalili'
from urllib.parse import parse_qs
import json
import os
import re
import sys
import traceback
import argparse
import importlib
import logging
from mako.lookup import TemplateLookup
from oic import rndstr
from oic.oic.provider import AuthorizationEndpoint
from oic.o... | 37.975359 | 119 | 0.610414 | #!/usr/bin/env python
__author__ = 'Vahid Jalili'
from urllib.parse import parse_qs
import json
import os
import re
import sys
import traceback
import argparse
import importlib
import logging
from mako.lookup import TemplateLookup
from oic import rndstr
from oic.oic.provider import AuthorizationEndpoint
from oic.o... | 6,234 | 2,979 | 164 |
7eae67215162eb3733569a02295ab225f4a06ab6 | 8,636 | py | Python | tools/phenomics/gol_blood/gol_blood.py | skitchen19/galaxy_tools | b935f36cfe430263564503ebb71f78dc79315acb | [
"MIT"
] | 3 | 2017-04-05T18:01:59.000Z | 2019-05-03T14:15:31.000Z | tools/phenomics/gol_blood/gol_blood.py | skitchen19/galaxy_tools | b935f36cfe430263564503ebb71f78dc79315acb | [
"MIT"
] | 6 | 2019-02-27T15:45:58.000Z | 2021-01-12T15:18:50.000Z | tools/phenomics/gol_blood/gol_blood.py | skitchen19/galaxy_tools | b935f36cfe430263564503ebb71f78dc79315acb | [
"MIT"
] | 2 | 2018-10-26T18:36:39.000Z | 2019-01-28T15:12:39.000Z | #!/usr/bin/env python
import argparse
import numpy as np
import os
import data_utils
import mle_sphere
import gen_sphere
import gen_sphere_grid
import gen_r_sig_3d
import gen_selection_in_g_3d
import metrics
import param_ss
import mle_priors_3d
DEFAULT_MLE_SPHERE_PARAM_DICT = dict(xc=0, yc=0, zc=0, r=1, rSig=0.3, xE... | 49.919075 | 172 | 0.596225 | #!/usr/bin/env python
import argparse
import numpy as np
import os
import data_utils
import mle_sphere
import gen_sphere
import gen_sphere_grid
import gen_r_sig_3d
import gen_selection_in_g_3d
import metrics
import param_ss
import mle_priors_3d
DEFAULT_MLE_SPHERE_PARAM_DICT = dict(xc=0, yc=0, zc=0, r=1, rSig=0.3, xE... | 1,085 | 0 | 69 |
e8550a5932930f1b2d7a5aff94124ea076b04b7a | 2,208 | py | Python | gnuradio-3.7.13.4/gr-filter/python/filter/qa_hilbert.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/gr-filter/python/filter/qa_hilbert.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/gr-filter/python/filter/qa_hilbert.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or... | 30.246575 | 73 | 0.658967 | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or... | 1,066 | 20 | 150 |
a195a12bcbb2de73d5ba7db88a8a27392864dc58 | 1,539 | py | Python | reagent/net_builder/discrete_actor_net_builder.py | wall-ed-coder/ReAgent | 14d9906d74f943e74c6a6f95d129e18741168f9c | [
"BSD-3-Clause"
] | null | null | null | reagent/net_builder/discrete_actor_net_builder.py | wall-ed-coder/ReAgent | 14d9906d74f943e74c6a6f95d129e18741168f9c | [
"BSD-3-Clause"
] | null | null | null | reagent/net_builder/discrete_actor_net_builder.py | wall-ed-coder/ReAgent | 14d9906d74f943e74c6a6f95d129e18741168f9c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import abc
from typing import List
import torch
from reagent.core.fb_checker import IS_FB_ENVIRONMENT
from reagent.core.registry_meta import RegistryMeta
from reagent.models.base import ModelBase
from reagent.parameters import NormalizationData
from reagent.prediction.predictor_wrapper import A... | 28.5 | 82 | 0.725796 | #!/usr/bin/env python3
import abc
from typing import List
import torch
from reagent.core.fb_checker import IS_FB_ENVIRONMENT
from reagent.core.registry_meta import RegistryMeta
from reagent.models.base import ModelBase
from reagent.parameters import NormalizationData
from reagent.prediction.predictor_wrapper import A... | 121 | 0 | 26 |
5af783943b8c376293c1b3b150c9dca00877a8eb | 668 | py | Python | 6 semester/Computer graphics/lab7.2.py | vladtsap/study | 87bc1aae4db67fdc18d5203f4e2af1dee1220ec5 | [
"MIT"
] | 1 | 2021-07-13T14:35:21.000Z | 2021-07-13T14:35:21.000Z | 6 semester/Computer graphics/lab7.2.py | vladtsap/study | 87bc1aae4db67fdc18d5203f4e2af1dee1220ec5 | [
"MIT"
] | null | null | null | 6 semester/Computer graphics/lab7.2.py | vladtsap/study | 87bc1aae4db67fdc18d5203f4e2af1dee1220ec5 | [
"MIT"
] | null | null | null | show_process = False
iterations = 50
import turtle
if not show_process:
turtle.tracer(0)
turtle.colormode(255)
turtle.color((0, 150, 0))
turtle.penup()
turtle.goto(-330, 0)
turtle.pendown()
fern(iterations)
turtle.update()
turtle.exitonclick()
| 17.128205 | 36 | 0.535928 | show_process = False
iterations = 50
import turtle
if not show_process:
turtle.tracer(0)
def fern(length):
if length <= 0.50:
turtle.fd(length)
turtle.bk(length)
else:
turtle.fd(length)
turtle.lt(90)
fern(length * 0.35)
turtle.... | 370 | 0 | 25 |
ba33f9c40a30d9716e2192d6b3a8e6d34446b9b5 | 282 | py | Python | crowdgezwitscher/crowdgezwitscher/auth.py | Strassengezwitscher/Crowdgezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 4 | 2016-07-22T07:20:31.000Z | 2016-11-13T18:13:34.000Z | crowdgezwitscher/crowdgezwitscher/auth.py | Strassengezwitscher/Strassengezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 402 | 2016-04-26T08:38:17.000Z | 2022-03-11T23:26:49.000Z | crowdgezwitscher/crowdgezwitscher/auth.py | Strassengezwitscher/Crowdgezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 1 | 2018-01-14T16:58:57.000Z | 2018-01-14T16:58:57.000Z | # source: https://stackoverflow.com/a/30875830
from rest_framework.authentication import SessionAuthentication
| 31.333333 | 68 | 0.804965 | # source: https://stackoverflow.com/a/30875830
from rest_framework.authentication import SessionAuthentication
class CsrfExemptSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, request):
return # To not perform the csrf check previously happening
| 80 | 40 | 50 |
8e2e46cf37ae73b3ff79a8eddbcfb3b598dec0c0 | 51 | py | Python | nbmolviz/base/__init__.py | jparkhill/notebook-molecular-visualization | 2dd61fedcf363d7362b727669b86c5f1c07656fd | [
"Apache-2.0"
] | 55 | 2016-07-21T23:25:59.000Z | 2022-02-14T01:04:49.000Z | nbmolviz/base/__init__.py | jparkhill/notebook-molecular-visualization | 2dd61fedcf363d7362b727669b86c5f1c07656fd | [
"Apache-2.0"
] | 40 | 2016-07-26T20:57:04.000Z | 2021-09-06T02:31:52.000Z | nbmolviz/base/__init__.py | Autodesk/notebook-molecular-visualization | 2dd61fedcf363d7362b727669b86c5f1c07656fd | [
"Apache-2.0"
] | 18 | 2016-07-25T21:49:02.000Z | 2020-10-03T11:17:03.000Z | from .base_widget import *
from .mdt2json import *
| 17 | 26 | 0.764706 | from .base_widget import *
from .mdt2json import *
| 0 | 0 | 0 |
88ad5ef34c4f5e74c468301747172d1d70c18248 | 1,765 | py | Python | library/explorerhat/ads1015.py | DT-was-an-ET/explorer-hat | 9dd8624a094b9a7663fbcbb95be72fdb946eecc7 | [
"MIT"
] | null | null | null | library/explorerhat/ads1015.py | DT-was-an-ET/explorer-hat | 9dd8624a094b9a7663fbcbb95be72fdb946eecc7 | [
"MIT"
] | null | null | null | library/explorerhat/ads1015.py | DT-was-an-ET/explorer-hat | 9dd8624a094b9a7663fbcbb95be72fdb946eecc7 | [
"MIT"
] | null | null | null | import time
from sys import exit, version_info
try:
from smbus import SMBus
except ImportError:
if version_info[0] < 3:
exit("This library requires python-smbus\nInstall with: sudo apt-get install python-smbus")
elif version_info[0] == 3:
exit("This library requires python3-smbus\nInstall w... | 27.153846 | 119 | 0.692918 | import time
from sys import exit, version_info
try:
from smbus import SMBus
except ImportError:
if version_info[0] < 3:
exit("This library requires python-smbus\nInstall with: sudo apt-get install python-smbus")
elif version_info[0] == 3:
exit("This library requires python3-smbus\nInstall w... | 796 | 0 | 46 |
7c12abd47a52ad7e02410a984ccfe624d0b9deeb | 230 | py | Python | pyvolt/types/category.py | Gael-devv/Pyvolt | 1d84ba95f1fd3f959a933051c25f8a3e60500c5d | [
"MIT"
] | null | null | null | pyvolt/types/category.py | Gael-devv/Pyvolt | 1d84ba95f1fd3f959a933051c25f8a3e60500c5d | [
"MIT"
] | null | null | null | pyvolt/types/category.py | Gael-devv/Pyvolt | 1d84ba95f1fd3f959a933051c25f8a3e60500c5d | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING, TypedDict
if TYPE_CHECKING:
from .snowflake import Snowflake, SnowflakeList
__all__ = ("Category",)
| 17.692308 | 51 | 0.743478 | from typing import TYPE_CHECKING, TypedDict
if TYPE_CHECKING:
from .snowflake import Snowflake, SnowflakeList
__all__ = ("Category",)
class Category(TypedDict):
id: Snowflake
title: str
channels: SnowflakeList
| 0 | 66 | 23 |
7076ef271d06a797450c907543f266df5539f478 | 841 | py | Python | test/digits_1112.py | Radenz/my-convex-hull | e887d84dd646ae046b10633218d0bf9b266fb8f6 | [
"MIT"
] | null | null | null | test/digits_1112.py | Radenz/my-convex-hull | e887d84dd646ae046b10633218d0bf9b266fb8f6 | [
"MIT"
] | null | null | null | test/digits_1112.py | Radenz/my-convex-hull | e887d84dd646ae046b10633218d0bf9b266fb8f6 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets
from myConvexHull import convex_hull, random_color
from myConvexHull.point_utils import X, Y
data = datasets.load_digits()
df = pd.DataFrame(data.data, columns=data.feature_names)
df['Target'] = pd.DataFrame(data.target... | 30.035714 | 56 | 0.699168 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets
from myConvexHull import convex_hull, random_color
from myConvexHull.point_utils import X, Y
data = datasets.load_digits()
df = pd.DataFrame(data.data, columns=data.feature_names)
df['Target'] = pd.DataFrame(data.target... | 0 | 0 | 0 |
89a1617fe951435594bb047f64e8489024798ba7 | 497 | py | Python | World 1/Modules/ex020 - Choosing a Order.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 2 | 2021-04-23T19:18:06.000Z | 2021-05-15T17:45:21.000Z | World 1/Modules/ex020 - Choosing a Order.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:29:23.000Z | 2021-05-14T00:29:23.000Z | World 1/Modules/ex020 - Choosing a Order.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:19:33.000Z | 2021-05-14T00:19:33.000Z | from random import sample
from time import sleep
colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
order = ["Breno", "Edu", "Miguel", "Lucas"]
print("{}Hmm..... | 33.133333 | 69 | 0.527163 | from random import sample
from time import sleep
colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
order = ["Breno", "Edu", "Miguel", "Lucas"]
print("{}Hmm..... | 0 | 0 | 0 |
d96784146bd766dcccea9ce0e829666670d8dddd | 2,689 | py | Python | video_background_dynamic_mode_decomposition_582HW5/subtractLRvideo.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | video_background_dynamic_mode_decomposition_582HW5/subtractLRvideo.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | video_background_dynamic_mode_decomposition_582HW5/subtractLRvideo.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | # AP Ruymgaart DMD, main script
import numpy as np, time, sys, copy, matplotlib.pyplot as plt
from videoFunctions import *
from tensorFiles import *
from plottingFunctions import *
from dmd import *
#==== input (command line, from run.sh) ====
print('===================================== start DMD ====================... | 36.337838 | 106 | 0.641502 | # AP Ruymgaart DMD, main script
import numpy as np, time, sys, copy, matplotlib.pyplot as plt
from videoFunctions import *
from tensorFiles import *
from plottingFunctions import *
from dmd import *
#==== input (command line, from run.sh) ====
print('===================================== start DMD ====================... | 0 | 0 | 0 |
483599ed8536eddf29b6ea87ea65105e1967fb97 | 2,479 | py | Python | payment_rounding/settings.py | adrian-kalinin/payment-rounding-api | d4639a2e7e733a40dccc3fe98605352c594b4332 | [
"MIT"
] | null | null | null | payment_rounding/settings.py | adrian-kalinin/payment-rounding-api | d4639a2e7e733a40dccc3fe98605352c594b4332 | [
"MIT"
] | null | null | null | payment_rounding/settings.py | adrian-kalinin/payment-rounding-api | d4639a2e7e733a40dccc3fe98605352c594b4332 | [
"MIT"
] | null | null | null | from pathlib import Path
import environ
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=True)
if READ_DOT_ENV_FILE:
env.read_env()
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG')
ALLOWED_HOSTS = ['127.0.0.1', 'payment-... | 22.536364 | 117 | 0.673255 | from pathlib import Path
import environ
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=True)
if READ_DOT_ENV_FILE:
env.read_env()
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG')
ALLOWED_HOSTS = ['127.0.0.1', 'payment-... | 0 | 0 | 0 |
e90ce6e277dc1dee758c86d3003b819de9af1d2f | 12,772 | py | Python | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages/picamera/display.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | 1 | 2021-05-30T08:20:37.000Z | 2021-05-30T08:20:37.000Z | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages/picamera/display.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages/picamera/display.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | null | null | null | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 39.788162 | 104 | 0.633104 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 4,188 | 6,458 | 23 |
312ace47627ecca7abc37b266c2ad03723ce1d59 | 4,484 | py | Python | tests/stairlight/source/test_redash.py | tosh223/stairlight | a9b01d3453c34bd1af66e8a9c353576f0eeefb5d | [
"MIT"
] | null | null | null | tests/stairlight/source/test_redash.py | tosh223/stairlight | a9b01d3453c34bd1af66e8a9c353576f0eeefb5d | [
"MIT"
] | null | null | null | tests/stairlight/source/test_redash.py | tosh223/stairlight | a9b01d3453c34bd1af66e8a9c353576f0eeefb5d | [
"MIT"
] | null | null | null | import os
from typing import Any, Dict
import pytest
from src.stairlight.config import Configurator
from src.stairlight.key import StairlightConfigKey
from src.stairlight.source.redash import (
RedashTemplate,
RedashTemplateSource,
TemplateSourceType,
)
@pytest.mark.parametrize(
"env_key, path",
... | 29.5 | 86 | 0.634701 | import os
from typing import Any, Dict
import pytest
from src.stairlight.config import Configurator
from src.stairlight.key import StairlightConfigKey
from src.stairlight.source.redash import (
RedashTemplate,
RedashTemplateSource,
TemplateSourceType,
)
@pytest.mark.parametrize(
"env_key, path",
... | 3,193 | 304 | 44 |
016bbec27abd5c066c9c544b6cd0e4027d21bf59 | 6,680 | py | Python | data_loaders/citation_networks.py | hcnoh/gcn-pytorch | 2ef4ada8ae60ff4402ee5430def49e441f650e8c | [
"MIT"
] | null | null | null | data_loaders/citation_networks.py | hcnoh/gcn-pytorch | 2ef4ada8ae60ff4402ee5430def49e441f650e8c | [
"MIT"
] | null | null | null | data_loaders/citation_networks.py | hcnoh/gcn-pytorch | 2ef4ada8ae60ff4402ee5430def49e441f650e8c | [
"MIT"
] | null | null | null | import os
import pickle
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
DATASET_DIR = "datasets"
| 31.809524 | 79 | 0.570359 | import os
import pickle
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
DATASET_DIR = "datasets"
class CitationNetworks(Dataset):
def __init__(self, dataset_dir=DATASET_DIR) -> None:
super().__init__()
# will be defined in child classes
self.dataset_name = ... | 3,053 | 3,374 | 121 |
4763556f9202f9225d54195f6543fae5e3581e1f | 573 | py | Python | Course 01 - Getting Started with Python/Extra Studies/Conditionals/ex013.py | marcoshsq/python_practical_exercises | 77136cd4bc0f34acde3380ffdc5af74f7a960670 | [
"MIT"
] | 9 | 2022-03-22T16:45:17.000Z | 2022-03-25T20:22:35.000Z | Course 01 - Getting Started with Python/Extra Studies/Conditionals/ex013.py | marcoshsq/python_practical_exercises | 77136cd4bc0f34acde3380ffdc5af74f7a960670 | [
"MIT"
] | null | null | null | Course 01 - Getting Started with Python/Extra Studies/Conditionals/ex013.py | marcoshsq/python_practical_exercises | 77136cd4bc0f34acde3380ffdc5af74f7a960670 | [
"MIT"
] | 3 | 2022-03-22T17:03:38.000Z | 2022-03-29T17:20:55.000Z | # Exercise 013 - That Classic Average
"""Create a program that reads two grades from a student and calculates their average, showing a message at the end, according to the average achieved:
- Average below 5.0: FAIL"""
grade_01 = float(input("Enter the first grade: "))
grade_02 = float(input("Enter the second grade: ... | 31.833333 | 151 | 0.69808 | # Exercise 013 - That Classic Average
"""Create a program that reads two grades from a student and calculates their average, showing a message at the end, according to the average achieved:
- Average below 5.0: FAIL"""
grade_01 = float(input("Enter the first grade: "))
grade_02 = float(input("Enter the second grade: ... | 0 | 0 | 0 |
ab02a7d8eba9cd4cd4bb02af22d39257d4337a1f | 4,549 | py | Python | Solutions/CrowdStrike Falcon Endpoint Protection/DataConnectors/CrowdstrikeReplicator/CrowdstrikeFalconAPISentinelConnector/sentinel_connector_async.py | relion365/Azure-Sentinel | a13083269ff046928062c9f565db5797e867282b | [
"MIT"
] | 11 | 2019-02-04T13:37:14.000Z | 2019-02-22T20:47:06.000Z | Solutions/CrowdStrike Falcon Endpoint Protection/DataConnectors/CrowdstrikeReplicator/CrowdstrikeFalconAPISentinelConnector/sentinel_connector_async.py | relion365/Azure-Sentinel | a13083269ff046928062c9f565db5797e867282b | [
"MIT"
] | 6 | 2019-02-03T13:58:50.000Z | 2019-02-25T02:01:16.000Z | Solutions/CrowdStrike Falcon Endpoint Protection/DataConnectors/CrowdstrikeReplicator/CrowdstrikeFalconAPISentinelConnector/sentinel_connector_async.py | relion365/Azure-Sentinel | a13083269ff046928062c9f565db5797e867282b | [
"MIT"
] | 12 | 2021-05-11T07:56:50.000Z | 2022-02-11T03:44:01.000Z | import datetime
import logging
import json
import hashlib
import hmac
import base64
import aiohttp
import asyncio
from collections import deque
| 41.733945 | 158 | 0.625852 | import datetime
import logging
import json
import hashlib
import hmac
import base64
import aiohttp
import asyncio
from collections import deque
class AzureSentinelConnectorAsync:
def __init__(self, session: aiohttp.ClientSession, log_analytics_uri, workspace_id, shared_key, log_type, queue_size=1000, queue_size_b... | 4,125 | 13 | 265 |
18bb3bc7809f2da3e09891859e20660934914e96 | 1,788 | py | Python | ebp/config.py | ttimasdf/ebp | 994e3f5d40446098b02491f6b6449cb705397d95 | [
"Apache-2.0"
] | 4 | 2018-01-29T09:13:19.000Z | 2021-08-10T06:58:08.000Z | ebp/config.py | ttimasdf/uni-patcher | 994e3f5d40446098b02491f6b6449cb705397d95 | [
"Apache-2.0"
] | 2 | 2017-07-11T13:30:48.000Z | 2020-06-01T07:15:22.000Z | ebp/config.py | ttimasdf/uni-patcher | 994e3f5d40446098b02491f6b6449cb705397d95 | [
"Apache-2.0"
] | 1 | 2020-06-01T07:01:17.000Z | 2020-06-01T07:01:17.000Z | import configparser
BACKUP_SUFFIX = ".bak"
_parser = configparser.ConfigParser()
def parse_file(filename):
"""Return all infomation you needed to patch files"""
_parser.read(filename)
result = {'files': {}}
result['metadata'] = {
"name": _parser['metadata']['name'],
"description": _p... | 30.305085 | 65 | 0.480984 | import configparser
BACKUP_SUFFIX = ".bak"
_parser = configparser.ConfigParser()
def parse_file(filename):
"""Return all infomation you needed to patch files"""
_parser.read(filename)
result = {'files': {}}
result['metadata'] = {
"name": _parser['metadata']['name'],
"description": _p... | 132 | 0 | 23 |
5859c97e18fc8e9f8c17c8655f9db9df190cf387 | 467 | py | Python | python/5.py | kylekanos/project-euler-1 | af7089356a4cea90f8ef331cfdc65e696def6140 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | python/5.py | kylekanos/project-euler-1 | af7089356a4cea90f8ef331cfdc65e696def6140 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | python/5.py | kylekanos/project-euler-1 | af7089356a4cea90f8ef331cfdc65e696def6140 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-09-17T00:55:58.000Z | 2019-09-17T00:55:58.000Z | #!/usr/bin/env python
# for i from 2 to 20
# compute prime factorization of i.
# use largest multiplicity in any
# prime factor seen thus far
facs = {}
for i in xrange(2,21):
f = factorize(i)
for j in f:
facs[j] = max(facs.get(j,0),f[j])
print reduce(lambda x,y: x*y, (i**facs[i] for i in facs))
| 19.458333 | 57 | 0.537473 | #!/usr/bin/env python
# for i from 2 to 20
# compute prime factorization of i.
# use largest multiplicity in any
# prime factor seen thus far
def factorize(n):
d = {}
p=2
while n>=p:
while not n%p:
n//=p
d[p] = d.get(p,0)+1
p+=1
return d
facs = {}
for i in xran... | 130 | 0 | 23 |
a88f21775f07697d182770e156e849a1936e4122 | 9,973 | py | Python | python/onos/config/diags/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 9 | 2021-03-24T10:40:05.000Z | 2022-01-22T08:55:25.000Z | python/onos/config/diags/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 23 | 2020-11-26T01:29:48.000Z | 2022-03-01T00:33:34.000Z | python/onos/config/diags/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 29 | 2020-11-25T17:25:45.000Z | 2022-03-30T05:54:15.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/config/diags/diags.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, Dict
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
import grpclib
class Type(betterproto.En... | 36.937037 | 89 | 0.682242 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/config/diags/diags.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, Dict
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
import grpclib
class Type(betterproto.En... | 4,476 | 328 | 407 |
6258be964f0d0f522fe9c811d890fe76ef476459 | 1,551 | py | Python | setup.py | fusionbox/django-reversion | a7899ead7348dcd45eb34aa3f0bbfbc9a3c5596b | [
"BSD-3-Clause"
] | null | null | null | setup.py | fusionbox/django-reversion | a7899ead7348dcd45eb34aa3f0bbfbc9a3c5596b | [
"BSD-3-Clause"
] | null | null | null | setup.py | fusionbox/django-reversion | a7899ead7348dcd45eb34aa3f0bbfbc9a3c5596b | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.path.insert(0, 'src/reversion')
from distutils.core import setup
from version import __version__
# Load in babel support, if available.
try:
from babel.messages import frontend as babel
cmdclass = {"compile_catalog": babel.compile_catalog,
"extract_messages": babel.extract_messa... | 41.918919 | 116 | 0.636364 | import sys
sys.path.insert(0, 'src/reversion')
from distutils.core import setup
from version import __version__
# Load in babel support, if available.
try:
from babel.messages import frontend as babel
cmdclass = {"compile_catalog": babel.compile_catalog,
"extract_messages": babel.extract_messa... | 0 | 0 | 0 |
c23556b460ef2746f72d4cabfc3efd0e0a592a70 | 634 | py | Python | password.py | nziokaivy/password_locker | 9406dda22dea807c1157b4a4168dc4a943eff3e0 | [
"MIT"
] | null | null | null | password.py | nziokaivy/password_locker | 9406dda22dea807c1157b4a4168dc4a943eff3e0 | [
"MIT"
] | null | null | null | password.py | nziokaivy/password_locker | 9406dda22dea807c1157b4a4168dc4a943eff3e0 | [
"MIT"
] | null | null | null | import random
class Account_user:
"""
Class to create new user accounts and save information
"""
users_list = []
def __init__(self,first_name,password):
'''
Method that helps us define properties that each user account will have
Args:
first_name : main ... | 19.8125 | 79 | 0.594637 | import random
class Account_user:
"""
Class to create new user accounts and save information
"""
users_list = []
def __init__(self,first_name,password):
'''
Method that helps us define properties that each user account will have
Args:
first_name : main ... | 0 | 0 | 0 |
ac8bbc8720f9c64445fe9a7d755e4c38fead6d25 | 14,429 | py | Python | plot.py | nsg-ethz/SDNRacer | 33353177998947580e879941f05862f0173a0c48 | [
"Apache-2.0"
] | 5 | 2016-03-18T15:12:04.000Z | 2019-01-28T20:18:24.000Z | plot.py | nsg-ethz/SDNRacer | 33353177998947580e879941f05862f0173a0c48 | [
"Apache-2.0"
] | null | null | null | plot.py | nsg-ethz/SDNRacer | 33353177998947580e879941f05862f0173a0c48 | [
"Apache-2.0"
] | 1 | 2019-11-02T22:04:48.000Z | 2019-11-02T22:04:48.000Z | #!/usr/bin/env python
import argparse
import csv
import glob
import os
import itertools
from pylab import *
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from asyncore import loop
# Values we care about
keys = []
keys.append('num_read')
keys.append('num_writes')
keys.append('n... | 37.871391 | 168 | 0.662069 | #!/usr/bin/env python
import argparse
import csv
import glob
import os
import itertools
from pylab import *
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from asyncore import loop
# Values we care about
keys = []
keys.append('num_read')
keys.append('num_writes')
keys.append('n... | 8,783 | 0 | 92 |
1c59c47850aa708f1f8006c09f199f92f56b6546 | 6,881 | py | Python | src/pack/bin/simple_setup.py | mbari-media-management/vampire-squid | 4e9c380daf47fbdb4215e614e65eb504bb63cda1 | [
"Apache-2.0"
] | 5 | 2019-06-26T18:18:53.000Z | 2021-12-04T18:12:43.000Z | src/pack/bin/simple_setup.py | mbari-media-management/vampire-squid | 4e9c380daf47fbdb4215e614e65eb504bb63cda1 | [
"Apache-2.0"
] | 1 | 2019-02-28T18:06:56.000Z | 2019-03-01T00:50:06.000Z | src/pack/bin/simple_setup.py | mbari-media-management/vampire-squid | 4e9c380daf47fbdb4215e614e65eb504bb63cda1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# This is a script for loading some test data into the video-asset-manager using
# REST calls. Each insert is being done as a separate call, which is the only type of
# insert that the API supports at this point.
#
# Note that for production loads, we would not do this in this manner. Instead, we... | 43.828025 | 99 | 0.46098 | #!/usr/bin/env python
# This is a script for loading some test data into the video-asset-manager using
# REST calls. Each insert is being done as a separate call, which is the only type of
# insert that the API supports at this point.
#
# Note that for production loads, we would not do this in this manner. Instead, we... | 75 | 0 | 23 |
4c405f7cef7119b297f3b6a357e3b86b8b9f4ec5 | 28,254 | py | Python | wolfism8/ism8.py | nanosonde/python-wolfism8 | 20f4ac2e40a2f711f00a833107e286f802a21364 | [
"MIT"
] | null | null | null | wolfism8/ism8.py | nanosonde/python-wolfism8 | 20f4ac2e40a2f711f00a833107e286f802a21364 | [
"MIT"
] | null | null | null | wolfism8/ism8.py | nanosonde/python-wolfism8 | 20f4ac2e40a2f711f00a833107e286f802a21364 | [
"MIT"
] | null | null | null | """
Module for gathering info from Wolf Heating System via ISM8 adapter
"""
import logging
import asyncio
class Ism8(asyncio.Protocol):
"""
This protocol class is invoked to listen to message from ISM8 module and
feed data into internal data array
"""
ISM_HEADER = b'\x06\x20\xf0\x80'... | 51.9375 | 80 | 0.537552 | """
Module for gathering info from Wolf Heating System via ISM8 adapter
"""
import logging
import asyncio
class Ism8(asyncio.Protocol):
"""
This protocol class is invoked to listen to message from ISM8 module and
feed data into internal data array
"""
ISM_HEADER = b'\x06\x20\xf0\x80'... | 238 | 0 | 29 |
7c11d04529484bac5ffcaf0ec1b0a0573a4a23f4 | 18,027 | py | Python | tests/deserialize_test.py | linhuiwzqu/clxcommunications | 5f5fe593402fdb014c17fa5ef200ee9b39d42caf | [
"Apache-2.0"
] | 3 | 2018-01-23T14:18:25.000Z | 2019-02-12T07:35:37.000Z | tests/deserialize_test.py | linhuiwzqu/clxcommunications | 5f5fe593402fdb014c17fa5ef200ee9b39d42caf | [
"Apache-2.0"
] | 3 | 2017-01-20T08:23:05.000Z | 2017-01-20T10:38:10.000Z | tests/deserialize_test.py | linhuiwzqu/clxcommunications | 5f5fe593402fdb014c17fa5ef200ee9b39d42caf | [
"Apache-2.0"
] | 2 | 2019-03-07T18:33:52.000Z | 2021-06-24T01:23:03.000Z | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
# pylint: disable=invalid-name
from datetime import datetime
import json
from clx.xms import api, exceptions, deserialize
from nose.tools import *
from iso8601 import UTC
@raises(exce... | 31.626316 | 287 | 0.552283 | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
# pylint: disable=invalid-name
from datetime import datetime
import json
from clx.xms import api, exceptions, deserialize
from nose.tools import *
from iso8601 import UTC
class MockRe... | 16,850 | 6 | 576 |
8a2c28fd9c3b626ba88c7c0aa37a2c2f9aae24a5 | 3,390 | py | Python | tensorflow_similarity/retrieval_metrics/recall_at_k.py | phillips96/similarity | 3794f288f17f47f1f90b5368e5c0eeac1e81e10d | [
"Apache-2.0"
] | 706 | 2021-09-04T02:11:05.000Z | 2022-03-31T13:29:14.000Z | tensorflow_similarity/retrieval_metrics/recall_at_k.py | phillips96/similarity | 3794f288f17f47f1f90b5368e5c0eeac1e81e10d | [
"Apache-2.0"
] | 119 | 2021-09-01T22:32:40.000Z | 2022-03-30T22:39:27.000Z | tensorflow_similarity/retrieval_metrics/recall_at_k.py | phillips96/similarity | 3794f288f17f47f1f90b5368e5c0eeac1e81e10d | [
"Apache-2.0"
] | 57 | 2021-09-04T02:11:14.000Z | 2022-03-31T13:29:15.000Z | # Copyright 2021 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 34.948454 | 78 | 0.646608 | # Copyright 2021 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 195 | 0 | 27 |
a9c8778b124fe87293be9117678ef66587e179af | 21,994 | py | Python | rdflib/namespace/_ODRL2.py | gtfierro/rdflib | be3d026e9065c8f60f59ac79a70da9f3199f5f43 | [
"BSD-3-Clause"
] | 1 | 2022-02-02T23:04:51.000Z | 2022-02-02T23:04:51.000Z | rdflib/namespace/_ODRL2.py | gtfierro/rdflib | be3d026e9065c8f60f59ac79a70da9f3199f5f43 | [
"BSD-3-Clause"
] | 6 | 2021-11-22T19:10:32.000Z | 2022-01-31T19:16:37.000Z | rdflib/namespace/_ODRL2.py | jjon/rdflib | 4c2ab7b392b353bf3c6088017ec9351ce8ac3db6 | [
"BSD-3-Clause"
] | null | null | null | from rdflib.namespace import DefinedNamespace, Namespace
from rdflib.term import URIRef
class ODRL2(DefinedNamespace):
"""
ODRL Version 2.2
The ODRL Vocabulary and Expression defines a set of concepts and terms (the vocabulary) and encoding mechanism
(the expression) for permissions and obligations s... | 83.310606 | 329 | 0.747067 | from rdflib.namespace import DefinedNamespace, Namespace
from rdflib.term import URIRef
class ODRL2(DefinedNamespace):
"""
ODRL Version 2.2
The ODRL Vocabulary and Expression defines a set of concepts and terms (the vocabulary) and encoding mechanism
(the expression) for permissions and obligations s... | 0 | 0 | 0 |
846536ef805d07aa120fe6037fec9a5a37e67b93 | 493 | py | Python | app/blueprints.py | excalibur1987/team-management | ed6dfaf83280dad947edb31b404680d6083d7e62 | [
"MIT"
] | 1 | 2021-06-05T16:18:10.000Z | 2021-06-05T16:18:10.000Z | app/blueprints.py | excalibur1987/flask-api-backend-boilerplate | 3f0933599f12b9632a3fc697eb3dde534ec93ce1 | [
"MIT"
] | null | null | null | app/blueprints.py | excalibur1987/flask-api-backend-boilerplate | 3f0933599f12b9632a3fc697eb3dde534ec93ce1 | [
"MIT"
] | null | null | null | from flask import Flask
from app.apis.v1 import api_v1_bp
def register_blueprints(app: "Flask") -> "Flask":
"""A function to register flask blueprint.
To register blueprints add them like the example
Example usage:
from app.blueprints import blueprint
app.register_blueprint(blueprint)
... | 23.47619 | 52 | 0.693712 | from flask import Flask
from app.apis.v1 import api_v1_bp
def register_blueprints(app: "Flask") -> "Flask":
"""A function to register flask blueprint.
To register blueprints add them like the example
Example usage:
from app.blueprints import blueprint
app.register_blueprint(blueprint)
... | 0 | 0 | 0 |
09cc33ccba4b0ca212dc86714544f05c4ce8cead | 2,007 | py | Python | experiments/benchmark/run_sampler.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | 3 | 2017-01-18T21:20:26.000Z | 2019-01-22T19:11:58.000Z | experiments/benchmark/run_sampler.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | null | null | null | experiments/benchmark/run_sampler.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | 3 | 2016-10-13T06:31:25.000Z | 2021-11-08T19:09:03.000Z | import networkx as nx
from cStringIO import StringIO
from Bio import Phylo
import matplotlib.pyplot as plt
import random
import logging
from tqdm import tqdm
logger = logging.getLogger()
logger.setLevel(logging.INFO)
import numpy as np
import trees
from trees.ddt import DirichletDiffusionTree, Inverse, GaussianLikeliho... | 26.064935 | 105 | 0.715994 | import networkx as nx
from cStringIO import StringIO
from Bio import Phylo
import matplotlib.pyplot as plt
import random
import logging
from tqdm import tqdm
logger = logging.getLogger()
logger.setLevel(logging.INFO)
import numpy as np
import trees
from trees.ddt import DirichletDiffusionTree, Inverse, GaussianLikeliho... | 972 | 0 | 23 |
37dd96679211af25ef8e409406d45a4f07bce62d | 8,666 | py | Python | scripts/qos-exp/nn2-sweep.py | ixent/qosa-snee | cc103a2f50262cad1927976a0b7f99554362581d | [
"BSD-3-Clause"
] | 1 | 2019-01-19T06:45:42.000Z | 2019-01-19T06:45:42.000Z | scripts/qos-exp/nn2-sweep.py | ixent/qosa-snee | cc103a2f50262cad1927976a0b7f99554362581d | [
"BSD-3-Clause"
] | null | null | null | scripts/qos-exp/nn2-sweep.py | ixent/qosa-snee | cc103a2f50262cad1927976a0b7f99554362581d | [
"BSD-3-Clause"
] | 3 | 2017-03-08T17:42:16.000Z | 2021-05-28T16:01:30.000Z | #!/usr/bin/python
import getopt, logging, sys, SneeqlLib, UtilLib, AvroraLib, os, checkTupleCount
queryMap = {'Q2' : 'input/pipes/Q2.txt', 'Q4' : 'input/pipes/QNest4.txt', 'Q5' : 'input/pipes/QNest5.txt'}
networkMap = {'10' : 'input/networks/10-node-topology.xml', '30' : 'scripts/qos-exp/scenarios/30-dense-net.xml... | 35.371429 | 381 | 0.681168 | #!/usr/bin/python
import getopt, logging, sys, SneeqlLib, UtilLib, AvroraLib, os, checkTupleCount
def usage():
print '''Usage: nn-sweep.py <parameters>
--query=[Q2|Q4|Q5]
--network_size=[n]
--network_type=[A|B]
--num_sources=[3|10|min|maj]
--optimization-goal=[min_delivery,min_energy,max_lifetime]
-... | 7,161 | 0 | 269 |
54fa8cb4636d823aa634912d24017e8db3798df3 | 704 | py | Python | UsePhoneticName.py | fishy/scripts | 91abd0451cae916d885f4ff0fd2f69d335d37cf3 | [
"BSD-3-Clause"
] | 4 | 2016-05-09T13:42:23.000Z | 2021-11-29T15:16:11.000Z | UsePhoneticName.py | fishy/scripts | 91abd0451cae916d885f4ff0fd2f69d335d37cf3 | [
"BSD-3-Clause"
] | null | null | null | UsePhoneticName.py | fishy/scripts | 91abd0451cae916d885f4ff0fd2f69d335d37cf3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import sys
from Foundation import *
from ScriptingBridge import *
ab = SBApplication.applicationWithBundleIdentifier_("com.apple.AddressBook")
for person in ab.people():
fname = person.firstName()
pfname = person.phoneticFirstName()
lname = person.lastName()
plname = person.phonetic... | 22.709677 | 76 | 0.697443 | #!/usr/bin/python
import sys
from Foundation import *
from ScriptingBridge import *
ab = SBApplication.applicationWithBundleIdentifier_("com.apple.AddressBook")
for person in ab.people():
fname = person.firstName()
pfname = person.phoneticFirstName()
lname = person.lastName()
plname = person.phonetic... | 0 | 0 | 0 |
aef7622db3edeec58c535a35d0af6b1e392615d4 | 450 | py | Python | pyconca2017/utils/models.py | merwok-forks/pyconca-2017-web | 4c1fca758e54f7799e7f557236a5b7c3db8dcb2b | [
"MIT"
] | null | null | null | pyconca2017/utils/models.py | merwok-forks/pyconca-2017-web | 4c1fca758e54f7799e7f557236a5b7c3db8dcb2b | [
"MIT"
] | null | null | null | pyconca2017/utils/models.py | merwok-forks/pyconca-2017-web | 4c1fca758e54f7799e7f557236a5b7c3db8dcb2b | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.text import ugettext_lazy as _
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
class BaseModel(models.Model):
"""
An abstract base class model that providers self-updating `created` and
`modified` fields.
"""
date_added = AutoC... | 26.470588 | 75 | 0.731111 | from django.db import models
from django.utils.text import ugettext_lazy as _
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
class BaseModel(models.Model):
"""
An abstract base class model that providers self-updating `created` and
`modified` fields.
"""
date_added = AutoC... | 0 | 14 | 27 |
3d49ec04019e9889366c1843e35834272201e46f | 9,163 | py | Python | src/probnum/quad/_integration_measures.py | christopheroates/probnum | 4ae63da307bd7279c3ce477ef68cbd0b8e30c73a | [
"MIT"
] | 226 | 2019-11-01T09:44:09.000Z | 2022-03-30T23:17:17.000Z | src/probnum/quad/_integration_measures.py | christopheroates/probnum | 4ae63da307bd7279c3ce477ef68cbd0b8e30c73a | [
"MIT"
] | 590 | 2019-11-21T08:32:30.000Z | 2022-03-31T12:37:37.000Z | src/probnum/quad/_integration_measures.py | christopheroates/probnum | 4ae63da307bd7279c3ce477ef68cbd0b8e30c73a | [
"MIT"
] | 39 | 2020-01-13T16:29:45.000Z | 2022-03-28T16:16:54.000Z | """Contains integration measures."""
import abc
from typing import Optional, Tuple, Union
import numpy as np
import scipy.stats
from probnum.randvars import Normal
from probnum.typing import FloatArgType, IntArgType
class IntegrationMeasure(abc.ABC):
"""An abstract class for a measure against which a target fu... | 34.708333 | 88 | 0.582451 | """Contains integration measures."""
import abc
from typing import Optional, Tuple, Union
import numpy as np
import scipy.stats
from probnum.randvars import Normal
from probnum.typing import FloatArgType, IntArgType
class IntegrationMeasure(abc.ABC):
"""An abstract class for a measure against which a target fu... | 3,214 | 0 | 135 |
a41dca34310966caf3e8427d639781fcb0598d18 | 761 | py | Python | resources/lib/helpers/exceptions.py | CastagnaIT/script.appcast | a9c0d6c30316599d6892f944ac185a9331af4ec1 | [
"BSD-2-Clause",
"MIT"
] | 2 | 2021-01-16T21:45:57.000Z | 2021-01-24T06:31:16.000Z | resources/lib/helpers/exceptions.py | CastagnaIT/script.appcast | a9c0d6c30316599d6892f944ac185a9331af4ec1 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | resources/lib/helpers/exceptions.py | CastagnaIT/script.appcast | a9c0d6c30316599d6892f944ac185a9331af4ec1 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2021 Stefano Gottardo (script.appcast)
Exceptions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
# Exceptions for DATABASE
class DBSQLiteConnectionError(Exception):
"""An error occurred in the database connection"""
class DBS... | 22.382353 | 56 | 0.720105 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2021 Stefano Gottardo (script.appcast)
Exceptions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
# Exceptions for DATABASE
class DBSQLiteConnectionError(Exception):
"""An error occurred in the database connection"""
class DBS... | 0 | 0 | 0 |
b8830ac7964ef91a4f94e8863c8ef461e382bb37 | 18,342 | py | Python | tripleo_common/actions/derive_params.py | AllenJSebastian/tripleo-common | d510a30266e002e90c358e69cb720bfdfa736134 | [
"Apache-2.0"
] | null | null | null | tripleo_common/actions/derive_params.py | AllenJSebastian/tripleo-common | d510a30266e002e90c358e69cb720bfdfa736134 | [
"Apache-2.0"
] | null | null | null | tripleo_common/actions/derive_params.py | AllenJSebastian/tripleo-common | d510a30266e002e90c358e69cb720bfdfa736134 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 39.360515 | 79 | 0.602061 | # Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 13,802 | 0 | 583 |
a1a1aa9f7cbbc6265cfe3b922867e0bc944af177 | 12,974 | py | Python | appion/build/scripts-2.7/tiltStackSync.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/build/scripts-2.7/tiltStackSync.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/build/scripts-2.7/tiltStackSync.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | #!/bin/python
#python
import sys
import os
import time
import re
import shutil
import MySQLdb
#appion
from appionlib import appionScript
from appionlib import apStack
from appionlib import apDisplay
from appionlib import apEMAN
from appionlib import apFile
from appionlib.apSpider import operations
from appionlib.apTil... | 35.545205 | 108 | 0.697934 | #!/bin/python
#python
import sys
import os
import time
import re
import shutil
import MySQLdb
#appion
from appionlib import appionScript
from appionlib import apStack
from appionlib import apDisplay
from appionlib import apEMAN
from appionlib import apFile
from appionlib.apSpider import operations
from appionlib.apTil... | 11,568 | 870 | 23 |
7c5fb9f45657ecafdf1c38f92248649f38bb6604 | 260 | py | Python | 05_debugging/solutions/bug_03.py | nachrisman/PHY494 | bac0dd5a7fe6f59f9e2ccaee56ebafcb7d97e2e7 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/solutions/bug_03.py | nachrisman/PHY494 | bac0dd5a7fe6f59f9e2ccaee56ebafcb7d97e2e7 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/solutions/bug_03.py | nachrisman/PHY494 | bac0dd5a7fe6f59f9e2ccaee56ebafcb7d97e2e7 | [
"CC-BY-4.0"
] | null | null | null | # bug 3
# http://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/2017/01/24/04_Debugging_1/#activity-fix-as-many-bugs-as-possible
# Print "error" for input 0:
x = float(input("Enter non-zero number --> "))
if x == 0:
print("ERROR: number cannot be 0")
| 28.888889 | 124 | 0.7 | # bug 3
# http://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/2017/01/24/04_Debugging_1/#activity-fix-as-many-bugs-as-possible
# Print "error" for input 0:
x = float(input("Enter non-zero number --> "))
if x == 0:
print("ERROR: number cannot be 0")
| 0 | 0 | 0 |
e009120c4e68c7222536c86157b18d6d0fc86315 | 5,348 | py | Python | test/automl/test_notebook_example.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | test/automl/test_notebook_example.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | test/automl/test_notebook_example.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | import sys
from openml.exceptions import OpenMLServerException
from requests.exceptions import ChunkedEncodingError
if __name__ == "__main__":
test_automl(600)
| 36.882759 | 152 | 0.663426 | import sys
from openml.exceptions import OpenMLServerException
from requests.exceptions import ChunkedEncodingError
def test_automl(budget=5, dataset_format="dataframe", hpo_method=None):
from flaml.data import load_openml_dataset
import urllib3
performance_check_budget = 600
if (
sys.platfor... | 5,110 | 0 | 69 |
c1e967e0502cb36c1b0d66fa783de85952b4bbed | 241 | py | Python | neighbor_app/admin.py | FloiceNyota98/Neighborhood | ef60aa45e50ec093fcccad583ccb914114d7d71f | [
"MIT"
] | 1 | 2021-07-31T07:59:56.000Z | 2021-07-31T07:59:56.000Z | neighbor_app/admin.py | FloiceNyota98/Neighborhood | ef60aa45e50ec093fcccad583ccb914114d7d71f | [
"MIT"
] | null | null | null | neighbor_app/admin.py | FloiceNyota98/Neighborhood | ef60aa45e50ec093fcccad583ccb914114d7d71f | [
"MIT"
] | 1 | 2021-08-31T09:36:53.000Z | 2021-08-31T09:36:53.000Z | from django.contrib import admin
from .models import Business, NeighborHood, Post, Profile
# Register your models here.
admin.site.register(Profile)
admin.site.register(Business)
admin.site.register(Post)
admin.site.register(NeighborHood)
| 24.1 | 57 | 0.813278 | from django.contrib import admin
from .models import Business, NeighborHood, Post, Profile
# Register your models here.
admin.site.register(Profile)
admin.site.register(Business)
admin.site.register(Post)
admin.site.register(NeighborHood)
| 0 | 0 | 0 |
d296585d1c8d998824941555345adc6ce57ce849 | 1,142 | py | Python | divico_ctrl/translation.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | 2 | 2019-12-12T20:57:37.000Z | 2021-09-29T02:59:19.000Z | divico_ctrl/translation.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | null | null | null | divico_ctrl/translation.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | null | null | null | import json
import os
T = Translation()
| 30.864865 | 95 | 0.585814 | import json
import os
class Translation(object):
def __init__(self, default_lang='de'):
self.__langs = {}
self.__default_lang = default_lang
# loading translations
path = os.path.dirname(os.path.abspath(__file__))
lang_files = {
'de': path + '/../assets/transla... | 1,018 | 5 | 76 |
cbec29e23f3954ee6849cec0a554ca2c1e06eec3 | 439 | py | Python | rudra/rudra/urls.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | rudra/rudra/urls.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | rudra/rudra/urls.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from inventory import views as inventory_index
urlpatterns = [
# Examples:
# url(r'^$', 'rudra.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', inventory_index.index, name='index'),
url(r'^... | 29.266667 | 80 | 0.651481 | from django.conf.urls import include, url
from django.contrib import admin
from inventory import views as inventory_index
urlpatterns = [
# Examples:
# url(r'^$', 'rudra.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', inventory_index.index, name='index'),
url(r'^... | 0 | 0 | 0 |
1314845f31133e2f039af920f60d0139625cdac7 | 51,179 | py | Python | twords/twords.py | ddandur/Twords | 63675d89af8d8c7fda939a3e3911ccc4417644a9 | [
"MIT"
] | 17 | 2017-08-16T12:27:16.000Z | 2021-05-23T12:41:56.000Z | twords/twords.py | ddandur/Twords | 63675d89af8d8c7fda939a3e3911ccc4417644a9 | [
"MIT"
] | null | null | null | twords/twords.py | ddandur/Twords | 63675d89af8d8c7fda939a3e3911ccc4417644a9 | [
"MIT"
] | 7 | 2017-08-15T13:20:42.000Z | 2020-03-01T16:59:50.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import datetime
import string
from os import listdir
from os.path import join as pathjoin
from math import log, ceil
import subprocess
import pandas as pd
import nltk
from nltk.corpus import stopwords
import matplotlib.pyplot as plt
import tailer
from ttp import t... | 46.611111 | 147 | 0.605502 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import datetime
import string
from os import listdir
from os.path import join as pathjoin
from math import log, ceil
import subprocess
import pandas as pd
import nltk
from nltk.corpus import stopwords
import matplotlib.pyplot as plt
import tailer
from ttp import t... | 396 | 0 | 54 |
35399c5f7200466f779bc16de6978d488fb725b7 | 399 | py | Python | parameter/__init__.py | coldnight/parameter | 70a9f5e21ebb78d526d074eea64a16242b129848 | [
"Apache-2.0"
] | 2 | 2017-08-08T03:30:25.000Z | 2017-12-02T19:10:38.000Z | parameter/__init__.py | coldnight/parameter | 70a9f5e21ebb78d526d074eea64a16242b129848 | [
"Apache-2.0"
] | null | null | null | parameter/__init__.py | coldnight/parameter | 70a9f5e21ebb78d526d074eea64a16242b129848 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Reexport"""
from __future__ import print_function, division, unicode_literals
from .model import Model, Argument, BaseAdapter
from .exception import ArgumentError, ArgumentMissError, ArgumentInvalidError
__version__ = "0.0.2"
__all__ = ["ArgumentError", "ArgumentMiss... | 26.6 | 77 | 0.736842 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Reexport"""
from __future__ import print_function, division, unicode_literals
from .model import Model, Argument, BaseAdapter
from .exception import ArgumentError, ArgumentMissError, ArgumentInvalidError
__version__ = "0.0.2"
__all__ = ["ArgumentError", "ArgumentMiss... | 0 | 0 | 0 |
eea6820d66c1cc7a727aa191616c827de43dab06 | 433 | py | Python | kattis/missingnumbers.py | btjanaka/competitive-programming-solutions | e3df47c18451802b8521ebe61ca71ee348e5ced7 | [
"MIT"
] | 3 | 2020-06-25T21:04:02.000Z | 2021-05-12T03:33:19.000Z | kattis/missingnumbers.py | btjanaka/competitive-programming-solutions | e3df47c18451802b8521ebe61ca71ee348e5ced7 | [
"MIT"
] | null | null | null | kattis/missingnumbers.py | btjanaka/competitive-programming-solutions | e3df47c18451802b8521ebe61ca71ee348e5ced7 | [
"MIT"
] | 1 | 2020-06-25T21:04:06.000Z | 2020-06-25T21:04:06.000Z | # Author: btjanaka (Bryon Tjanaka)
# Problem: (Kattis) missingnumbers
# Title: Missing Numbers
# Link: https://open.kattis.com/problems/missingnumbers
# Idea: Keep counting.
# Difficulty: easy
# Tags: implementation
n = int(input())
cur = 1
num_printed = 0
for _ in range(n):
k = int(input())
while cur < k:
... | 21.65 | 55 | 0.632794 | # Author: btjanaka (Bryon Tjanaka)
# Problem: (Kattis) missingnumbers
# Title: Missing Numbers
# Link: https://open.kattis.com/problems/missingnumbers
# Idea: Keep counting.
# Difficulty: easy
# Tags: implementation
n = int(input())
cur = 1
num_printed = 0
for _ in range(n):
k = int(input())
while cur < k:
... | 0 | 0 | 0 |
f490e6a25b99549407a4432f866c4c80cbdaff53 | 339 | py | Python | dag_03.py | harkabeeparolus/kodkalender-2020 | ad6ca9c6e067ad206c54854771c8c6bb1bf27cfa | [
"MIT"
] | null | null | null | dag_03.py | harkabeeparolus/kodkalender-2020 | ad6ca9c6e067ad206c54854771c8c6bb1bf27cfa | [
"MIT"
] | null | null | null | dag_03.py | harkabeeparolus/kodkalender-2020 | ad6ca9c6e067ad206c54854771c8c6bb1bf27cfa | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
"""Unga programmerare kodkalender 2020, lucka 3."""
# https://ungaprogrammerare.se/kodkalender/lucka-3/
import functools
import math
import operator
a = math.factorial(100)
b = functools.reduce(operator.mul, range(2, 165, 2))
how_many = round(a / b)
print(f"Antal delar: {how_many}")
# Antal ... | 21.1875 | 52 | 0.731563 | #! /usr/bin/env python3
"""Unga programmerare kodkalender 2020, lucka 3."""
# https://ungaprogrammerare.se/kodkalender/lucka-3/
import functools
import math
import operator
a = math.factorial(100)
b = functools.reduce(operator.mul, range(2, 165, 2))
how_many = round(a / b)
print(f"Antal delar: {how_many}")
# Antal ... | 0 | 0 | 0 |
d25e0e3402b84408e43fdbf5a922a14a3ddebf16 | 13,327 | py | Python | utils/face.py | foamliu/i-Cloud | c5eb0a22c1c0c78d5195d4f62237fd6c2b5e6a32 | [
"MIT"
] | 1 | 2020-02-27T07:46:24.000Z | 2020-02-27T07:46:24.000Z | utils/face.py | foamliu/i-Cloud | c5eb0a22c1c0c78d5195d4f62237fd6c2b5e6a32 | [
"MIT"
] | null | null | null | utils/face.py | foamliu/i-Cloud | c5eb0a22c1c0c78d5195d4f62237fd6c2b5e6a32 | [
"MIT"
] | 2 | 2019-04-25T22:56:41.000Z | 2019-07-01T21:12:21.000Z | import datetime
import math
import os
import pickle
import random
import shutil
import time
import zipfile
import cv2 as cv
import numpy as np
import torch
from PIL import Image
from flask import request
from scipy.stats import norm
from torch import nn
from torch.utils.data import Dataset
from torchvision import tran... | 29.161926 | 109 | 0.648758 | import datetime
import math
import os
import pickle
import random
import shutil
import time
import zipfile
import cv2 as cv
import numpy as np
import torch
from PIL import Image
from flask import request
from scipy.stats import norm
from torch import nn
from torch.utils.data import Dataset
from torchvision import tran... | 10,954 | 2 | 543 |
64f5c80b80caea8f767009f87333b4de2d60eb43 | 2,344 | py | Python | reip/blocks/video/effects.py | reip-project/reip-pipelines | c6a8341e963b73f6fd08d63513876590e5af3d62 | [
"BSD-3-Clause-Clear"
] | null | null | null | reip/blocks/video/effects.py | reip-project/reip-pipelines | c6a8341e963b73f6fd08d63513876590e5af3d62 | [
"BSD-3-Clause-Clear"
] | null | null | null | reip/blocks/video/effects.py | reip-project/reip-pipelines | c6a8341e963b73f6fd08d63513876590e5af3d62 | [
"BSD-3-Clause-Clear"
] | null | null | null | import numpy as np
import cv2
import reip
class OpticalFlow(reip.Block):
'''
https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.html#dense-optical-flow-in-opencv
'''
hsv = None
_prev = None
# pyr_scale=0.5, levels=3, winsize=15, iter... | 37.206349 | 147 | 0.605375 | import numpy as np
import cv2
import reip
class OpticalFlow(reip.Block):
'''
https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.html#dense-optical-flow-in-opencv
'''
hsv = None
_prev = None
# pyr_scale=0.5, levels=3, winsize=15, iter... | 1,868 | 0 | 107 |
ea34fd7e600804241350bd0344bbe8d8d9dd67f3 | 1,409 | py | Python | Homework/2019/Task7/4/Code/filter_opcode.py | ohhuola/Data-Mining-for-Cybersecurity | 7c04b2519810970227777fc1a1a29bb87d47a41e | [
"MIT"
] | null | null | null | Homework/2019/Task7/4/Code/filter_opcode.py | ohhuola/Data-Mining-for-Cybersecurity | 7c04b2519810970227777fc1a1a29bb87d47a41e | [
"MIT"
] | null | null | null | Homework/2019/Task7/4/Code/filter_opcode.py | ohhuola/Data-Mining-for-Cybersecurity | 7c04b2519810970227777fc1a1a29bb87d47a41e | [
"MIT"
] | null | null | null | import re
import subprocess
import os
from tqdm import tqdm
| 29.354167 | 97 | 0.53868 | import re
import subprocess
import os
from tqdm import tqdm
def php_to_opcode(phpfilename):
try:
# ๆง่กๆๅฎ็ๅฝไปค๏ผๅฆๆๆง่ก็ถๆ็ ไธบ0ๅ่ฟๅๅฝไปคๆง่ก็ปๆ๏ผๅฆๅๆๅบๅผๅธธใ
output = subprocess.check_output(
['php', '-dvld.active=1', '-dvld.execute=0', phpfilename], stderr=subprocess.STDOUT)
output = str(output, enco... | 1,367 | 0 | 46 |
7ae8c7f7b52099998030d4155daa298e682c086a | 630 | py | Python | Assignment Solution/Module5-master/Module5_CaseStudy1_Q2_Ans.py | krdhakal/Edureka-HW-Solutions-of-Data-Science-for-Python-Certification | 2332839d25cca3ee8036d6dda7360a3b31824d6b | [
"MIT"
] | null | null | null | Assignment Solution/Module5-master/Module5_CaseStudy1_Q2_Ans.py | krdhakal/Edureka-HW-Solutions-of-Data-Science-for-Python-Certification | 2332839d25cca3ee8036d6dda7360a3b31824d6b | [
"MIT"
] | null | null | null | Assignment Solution/Module5-master/Module5_CaseStudy1_Q2_Ans.py | krdhakal/Edureka-HW-Solutions-of-Data-Science-for-Python-Certification | 2332839d25cca3ee8036d6dda7360a3b31824d6b | [
"MIT"
] | null | null | null | # Find the genre in which there has been the greatest number of movie releases
import pandas as pd
import numpy as np
dataset=pd.read_csv('c:\\temp\\HollywoodMovies.csv')
selected_data=dataset.loc[:,['WorldGross','Genre']]
df=pd.DataFrame(selected_data)
df_notnull_genre=df[df.Genre.notnull()]
df_notnull_worldgross=df... | 39.375 | 106 | 0.803175 | # Find the genre in which there has been the greatest number of movie releases
import pandas as pd
import numpy as np
dataset=pd.read_csv('c:\\temp\\HollywoodMovies.csv')
selected_data=dataset.loc[:,['WorldGross','Genre']]
df=pd.DataFrame(selected_data)
df_notnull_genre=df[df.Genre.notnull()]
df_notnull_worldgross=df... | 0 | 0 | 0 |
a943368dd77b94ada6edbbab0c76bd8593bd383e | 634 | py | Python | esphome/components/homeassistant/binary_sensor/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 249 | 2018-04-07T12:04:11.000Z | 2019-01-25T01:11:34.000Z | esphome/components/homeassistant/binary_sensor/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 243 | 2018-04-11T16:37:11.000Z | 2019-01-25T16:50:37.000Z | esphome/components/homeassistant/binary_sensor/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 40 | 2018-04-10T05:50:14.000Z | 2019-01-25T15:20:36.000Z | import esphome.codegen as cg
from esphome.components import binary_sensor
from .. import (
HOME_ASSISTANT_IMPORT_SCHEMA,
homeassistant_ns,
setup_home_assistant_entity,
)
DEPENDENCIES = ["api"]
HomeassistantBinarySensor = homeassistant_ns.class_(
"HomeassistantBinarySensor", binary_sensor.BinarySensor... | 25.36 | 85 | 0.801262 | import esphome.codegen as cg
from esphome.components import binary_sensor
from .. import (
HOME_ASSISTANT_IMPORT_SCHEMA,
homeassistant_ns,
setup_home_assistant_entity,
)
DEPENDENCIES = ["api"]
HomeassistantBinarySensor = homeassistant_ns.class_(
"HomeassistantBinarySensor", binary_sensor.BinarySensor... | 151 | 0 | 23 |
89089996ae8b20945ecd282a5d4e36d1c88f9623 | 658 | py | Python | Programming/python/cookbook/n_base_conversion.py | kwangjunechoi7/TIL | 99403791eb77fd9190d7d6f60ade67bb48122b33 | [
"MIT"
] | null | null | null | Programming/python/cookbook/n_base_conversion.py | kwangjunechoi7/TIL | 99403791eb77fd9190d7d6f60ade67bb48122b33 | [
"MIT"
] | null | null | null | Programming/python/cookbook/n_base_conversion.py | kwangjunechoi7/TIL | 99403791eb77fd9190d7d6f60ade67bb48122b33 | [
"MIT"
] | null | null | null | # -*-coding:utf-8-*-
"""
์ง๋ฒ ๋ณํ recursive ์๊ณ ๋ฆฌ์ฆ
2 <= n <= 16๊น์ง ๊ฐ๋ฅ
"""
"""
def test(n,t):
answer = ''
while t//n >= 1:
re = t%n
t = t//n
answer = str(re) + answer
print(answer)
if t < n:
answer = str(t) + answer
return int(answer)
"""
"""
# ์ง๋ฒ ๋ณํ ํจ์ ์ฌ๋์
d... | 16.04878 | 36 | 0.410334 | # -*-coding:utf-8-*-
"""
์ง๋ฒ ๋ณํ recursive ์๊ณ ๋ฆฌ์ฆ
2 <= n <= 16๊น์ง ๊ฐ๋ฅ
"""
def convert(n,t):
T = "0123456789ABCDEF"
q,r = divmod(n, t)
if q ==0:
return T[r]
else:
return convert(q, t) + T[r]
"""
def test(n,t):
answer = ''
while t//n >= 1:
re = t%n
t = t//n
an... | 126 | 0 | 23 |
893bf952793b1d79a10262685f8eb26e6c8e37fa | 391 | py | Python | src/opera/parser/tosca/v_1_3/policy_definition.py | sstanovnik/xopera-opera | 06031d37268913c6ba6dbc30ec6b4acb3a17dc5a | [
"Apache-2.0"
] | null | null | null | src/opera/parser/tosca/v_1_3/policy_definition.py | sstanovnik/xopera-opera | 06031d37268913c6ba6dbc30ec6b4acb3a17dc5a | [
"Apache-2.0"
] | null | null | null | src/opera/parser/tosca/v_1_3/policy_definition.py | sstanovnik/xopera-opera | 06031d37268913c6ba6dbc30ec6b4acb3a17dc5a | [
"Apache-2.0"
] | null | null | null | from ..entity import Entity
from ..map import Map
from ..reference import Reference
from ..string import String
from ..void import Void
| 23 | 44 | 0.657289 | from ..entity import Entity
from ..map import Map
from ..reference import Reference
from ..string import String
from ..void import Void
class PolicyDefinition(Entity):
ATTRS = dict(
type=Reference("policy_types"),
description=String,
metadata=Map(String),
properties=Map(Void),
... | 0 | 231 | 23 |
c33f07b92a9ea6c9b5d80e72c591cec5aeaf2a35 | 2,591 | py | Python | setup.py | Robert-96/websocket-client | fd56fd35d2a933745814afd23253a33d71306bb9 | [
"Apache-2.0"
] | 1 | 2022-03-25T09:03:23.000Z | 2022-03-25T09:03:23.000Z | setup.py | Robert-96/websocket-client | fd56fd35d2a933745814afd23253a33d71306bb9 | [
"Apache-2.0"
] | null | null | null | setup.py | Robert-96/websocket-client | fd56fd35d2a933745814afd23253a33d71306bb9 | [
"Apache-2.0"
] | null | null | null | import sys
import pkg_resources
from setuptools import setup, find_packages
"""
setup.py
websocket - WebSocket client library for Python
Copyright 2022 engn33r
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... | 32.797468 | 81 | 0.661521 | import sys
import pkg_resources
from setuptools import setup, find_packages
"""
setup.py
websocket - WebSocket client library for Python
Copyright 2022 engn33r
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... | 0 | 0 | 0 |
c656d81b7ac6d0b7d7e2fea232113d472dda5096 | 10,112 | py | Python | on_policy/algorithms/ppo.py | marsXyr/RL_Pytorch | cc80bfb442c45c8e87849a7d0a1fb8bc837448a5 | [
"MIT"
] | null | null | null | on_policy/algorithms/ppo.py | marsXyr/RL_Pytorch | cc80bfb442c45c8e87849a7d0a1fb8bc837448a5 | [
"MIT"
] | null | null | null | on_policy/algorithms/ppo.py | marsXyr/RL_Pytorch | cc80bfb442c45c8e87849a7d0a1fb8bc837448a5 | [
"MIT"
] | null | null | null | import numpy as np
import argparse, gym, time, os
import os.path as osp
import torch
import torch.nn as nn
import torch.optim as optim
from on_policy.utils import core
from on_policy.utils.model import ActorCritic
from on_policy.utils.replay_buffer import ReplayBuffer
from utils.logx import EpochLogger
from u... | 42.666667 | 122 | 0.601563 | import numpy as np
import argparse, gym, time, os
import os.path as osp
import torch
import torch.nn as nn
import torch.optim as optim
from on_policy.utils import core
from on_policy.utils.model import ActorCritic
from on_policy.utils.replay_buffer import ReplayBuffer
from utils.logx import EpochLogger
from u... | 8,048 | -11 | 197 |