hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f745fea4070433b6ecbd4ba012837496db16396c | 3,537 | py | Python | discord/bot2.py | Javascript-void0/FarminFarmReworked | b2e44fa88d84d48184fb10766422d4794fbdb9dd | [
"MIT"
] | 1 | 2021-04-24T04:45:15.000Z | 2021-04-24T04:45:15.000Z | discord/bot2.py | Javascript-void0/FarminFarmReworked | b2e44fa88d84d48184fb10766422d4794fbdb9dd | [
"MIT"
] | null | null | null | discord/bot2.py | Javascript-void0/FarminFarmReworked | b2e44fa88d84d48184fb10766422d4794fbdb9dd | [
"MIT"
] | null | null | null | import discord
import os
from discord.ext import commands
from discord.utils import get
client = commands.Bot(command_prefix='.')
client.remove_command('help')
TOKEN = os.getenv("CHAT")
guild = None
@client.event
async def on_ready():
global guild
print('[ + ] Started {0.user}'.format(client))
await client.wait_un... | 66.735849 | 866 | 0.775516 | import discord
import os
from discord.ext import commands
from discord.utils import get
client = commands.Bot(command_prefix='.')
client.remove_command('help')
TOKEN = os.getenv("CHAT")
guild = None
@client.event
async def on_ready():
global guild
print('[ + ] Started {0.user}'.format(client))
await client.wait_un... | true | true |
f745ff8dd7e5cd13c76268ec00ac04d0d98b3bf5 | 295 | py | Python | libs/imageExtensionChecker.py | rocketbot-cl/recognition | cca8a87070ccaca3a26e37345c36ab1bf836e258 | [
"MIT"
] | null | null | null | libs/imageExtensionChecker.py | rocketbot-cl/recognition | cca8a87070ccaca3a26e37345c36ab1bf836e258 | [
"MIT"
] | null | null | null | libs/imageExtensionChecker.py | rocketbot-cl/recognition | cca8a87070ccaca3a26e37345c36ab1bf836e258 | [
"MIT"
] | null | null | null | def imageExtensionChecker(filename):
filenameExtension = filename.split(".")[-1]
filenameExtension = filenameExtension.lower()
if (filenameExtension == "pdf"):
return False
# return True
elif (filenameExtension in ("png", "jpg", "jpeg")):
return True
| 32.777778 | 56 | 0.637288 | def imageExtensionChecker(filename):
filenameExtension = filename.split(".")[-1]
filenameExtension = filenameExtension.lower()
if (filenameExtension == "pdf"):
return False
elif (filenameExtension in ("png", "jpg", "jpeg")):
return True
| true | true |
f74601e8c3ffcf004e89b6b1afec139899cb4c4f | 253 | py | Python | remove-duplicates-from-sorted-array/Solution.6597734.py | rahul-ramadas/leetcode | 6c84c2333a613729361c5cdb63dc3fc80203b340 | [
"MIT"
] | null | null | null | remove-duplicates-from-sorted-array/Solution.6597734.py | rahul-ramadas/leetcode | 6c84c2333a613729361c5cdb63dc3fc80203b340 | [
"MIT"
] | 1 | 2016-09-11T22:26:17.000Z | 2016-09-13T01:49:48.000Z | remove-duplicates-from-sorted-array/Solution.6597734.py | rahul-ramadas/leetcode | 6c84c2333a613729361c5cdb63dc3fc80203b340 | [
"MIT"
] | null | null | null | class Solution:
def removeDuplicates(self, A):
if not A:
return 0
j = 0
for i in xrange(1, len(A)):
if A[i] != A[j]:
j += 1
A[j] = A[i]
return j + 1
| 21.083333 | 36 | 0.351779 | class Solution:
def removeDuplicates(self, A):
if not A:
return 0
j = 0
for i in xrange(1, len(A)):
if A[i] != A[j]:
j += 1
A[j] = A[i]
return j + 1
| true | true |
f74601f83296b54911b942819e6d53c8b10c0f2e | 178 | py | Python | python_touch/cli.py | takeshi0406/python-touch | 1dde8bdfef945404f763500d4043cabd07e07546 | [
"MIT"
] | null | null | null | python_touch/cli.py | takeshi0406/python-touch | 1dde8bdfef945404f763500d4043cabd07e07546 | [
"MIT"
] | null | null | null | python_touch/cli.py | takeshi0406/python-touch | 1dde8bdfef945404f763500d4043cabd07e07546 | [
"MIT"
] | null | null | null | import click
from pathlib import Path
from . import PythonTouch
@click.command()
@click.argument("directory")
def main(directory):
x = PythonTouch()
x.touch(directory)
| 16.181818 | 28 | 0.730337 | import click
from pathlib import Path
from . import PythonTouch
@click.command()
@click.argument("directory")
def main(directory):
x = PythonTouch()
x.touch(directory)
| true | true |
f746028ed415eb45b51d72258c9ab10b0953f241 | 14,479 | py | Python | rule_based_decision_making.py | QianLabUSC/cognitively-enhanced-decision-framework | 1797ddd41edcbfbfafca5b599ff7ab70f5fdc37f | [
"MIT"
] | null | null | null | rule_based_decision_making.py | QianLabUSC/cognitively-enhanced-decision-framework | 1797ddd41edcbfbfafca5b599ff7ab70f5fdc37f | [
"MIT"
] | 3 | 2021-06-28T15:35:21.000Z | 2021-07-01T06:02:57.000Z | rule_based_decision_making.py | QianLabUSC/cognitively-enhanced-decision-framework | 1797ddd41edcbfbfafca5b599ff7ab70f5fdc37f | [
"MIT"
] | null | null | null | # This FILE is part of multi-legged robot field exploration model
# env_wrapper.py - to obtain user interaction data from website
#
# This programm is explained by roboLAND in university of southern california.
# Please notify the source if you use it
#
# Copyright(c) 2021-2025 Ryoma Liu
# Email: 1196075299@qq.... | 41.133523 | 123 | 0.57794 |
from env_wrapper import *
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import optimize
import random
import matplotlib.pylab as pylab
import numpy as np
from PIL import Image
from math import *
class rule_state_machine:
def __init__(self):
self.states = ['Initial',... | true | true |
f74603a9f978ff004e16048b2fa038db3b279fb5 | 3,471 | py | Python | train.py | GT-AcerZhang/yolov3.insects_challenge | 1ac6ee5a8a5c534ec11723542f4c10583935a2ad | [
"MIT"
] | 1 | 2021-02-27T17:59:32.000Z | 2021-02-27T17:59:32.000Z | train.py | GT-AcerZhang/yolov3.insects_challenge | 1ac6ee5a8a5c534ec11723542f4c10583935a2ad | [
"MIT"
] | 1 | 2020-06-12T07:29:27.000Z | 2020-06-12T07:29:27.000Z | train.py | GT-AcerZhang/yolov3.insects_challenge | 1ac6ee5a8a5c534ec11723542f4c10583935a2ad | [
"MIT"
] | 1 | 2021-03-05T11:08:50.000Z | 2021-03-05T11:08:50.000Z | # -*- coding: utf-8 -*-
import time
import os
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph.base import to_variable
from reader import data_loader, test_data_loader, multithread_loader
from yolov3 import YOLOv3
# train.py
# 提升点: 可以改变anchor的大小,注意训练和测试时要使用同样的anchor
ANCHORS = [... | 41.321429 | 115 | 0.537885 |
import time
import os
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph.base import to_variable
from reader import data_loader, test_data_loader, multithread_loader
from yolov3 import YOLOv3
ANCHORS = [10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 3... | true | true |
f74603ed1db8d4d97327c9942770f3c43726c5d3 | 895 | py | Python | mi/dataset/driver/flord_g/ctdbp_p/dcl/test/test_flord_g_ctdbp_p_dcl_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 1 | 2018-09-14T23:28:29.000Z | 2018-09-14T23:28:29.000Z | mi/dataset/driver/flord_g/ctdbp_p/dcl/test/test_flord_g_ctdbp_p_dcl_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 33 | 2017-04-25T19:53:45.000Z | 2022-03-18T17:42:18.000Z | mi/dataset/driver/flord_g/ctdbp_p/dcl/test/test_flord_g_ctdbp_p_dcl_telemetered_driver.py | cdobs/mi-instrument | 99f9322a4afabc5dff9b0fad12166075efce838c | [
"BSD-2-Clause"
] | 31 | 2015-03-04T01:01:09.000Z | 2020-10-28T14:42:12.000Z | import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdbp_p.dcl.resource import RESOURCE_PATH
from mi.dataset.driver.flord_g.ctdbp_p.dcl.flord_g_ctdbp_p_dcl_telemetered_driver import parse
_author__ = 'jeff roy'
log = get_logger... | 27.96875 | 94 | 0.763128 | import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdbp_p.dcl.resource import RESOURCE_PATH
from mi.dataset.driver.flord_g.ctdbp_p.dcl.flord_g_ctdbp_p_dcl_telemetered_driver import parse
_author__ = 'jeff roy'
log = get_logger... | true | true |
f74604c957411b143ae41da8468ddf3824c353af | 709 | py | Python | gui.py | unchangedusername/SimpleMultithreadedDownloader | 5c5d32a7247d98ab189277ed9a416b6c4b4296a4 | [
"MIT"
] | null | null | null | gui.py | unchangedusername/SimpleMultithreadedDownloader | 5c5d32a7247d98ab189277ed9a416b6c4b4296a4 | [
"MIT"
] | null | null | null | gui.py | unchangedusername/SimpleMultithreadedDownloader | 5c5d32a7247d98ab189277ed9a416b6c4b4296a4 | [
"MIT"
] | null | null | null | import tkinter as tk
class GUI(tk.Frame):
def __init__(self,master=None):
super().__init__(master)
self.pack()
self.create_wigets()
def create_wigets(self):
self.hi_there = tk.Button(self)
self.hi_there["width"] = 15
self.hi_there["height"] = 10
self... | 27.269231 | 77 | 0.607898 | import tkinter as tk
class GUI(tk.Frame):
def __init__(self,master=None):
super().__init__(master)
self.pack()
self.create_wigets()
def create_wigets(self):
self.hi_there = tk.Button(self)
self.hi_there["width"] = 15
self.hi_there["height"] = 10
self... | true | true |
f74604f3d90bd1bd6abc39c8ec84ba84fd154377 | 178 | py | Python | mortgage_platform/mortgage/views/tests/mock_data.py | MihailButnaru/MortgageLen | e05a6a3dce7d84de7a49cd3370d67c8b92b0010f | [
"MIT"
] | 2 | 2021-02-12T21:00:09.000Z | 2022-03-12T17:39:07.000Z | mortgage_platform/mortgage/views/tests/mock_data.py | MihailButnaru/MortgageLen | e05a6a3dce7d84de7a49cd3370d67c8b92b0010f | [
"MIT"
] | null | null | null | mortgage_platform/mortgage/views/tests/mock_data.py | MihailButnaru/MortgageLen | e05a6a3dce7d84de7a49cd3370d67c8b92b0010f | [
"MIT"
] | null | null | null | def input_calculator_data() -> dict:
return {
"property_value": 150000,
"deposit_amount": 0,
"mortgage_term": 10,
"interest_rate": 3.0,
}
| 22.25 | 36 | 0.55618 | def input_calculator_data() -> dict:
return {
"property_value": 150000,
"deposit_amount": 0,
"mortgage_term": 10,
"interest_rate": 3.0,
}
| true | true |
f7460650b64984787109392083038fa2a55975a4 | 690 | py | Python | godot_tools/setup/libraries.py | WilliamTambellini/godopy | 7b4142ddf7acafa66e1b2b201afa5fa37a4c7f4e | [
"MIT"
] | 30 | 2020-02-09T22:30:06.000Z | 2022-01-26T04:23:09.000Z | godot_tools/setup/libraries.py | WilliamTambellini/godopy | 7b4142ddf7acafa66e1b2b201afa5fa37a4c7f4e | [
"MIT"
] | 1 | 2020-10-12T04:12:52.000Z | 2020-12-19T07:07:51.000Z | godot_tools/setup/libraries.py | WilliamTambellini/godopy | 7b4142ddf7acafa66e1b2b201afa5fa37a4c7f4e | [
"MIT"
] | 5 | 2020-02-10T02:49:13.000Z | 2021-01-25T18:18:16.000Z | from setuptools import Extension
from .enums import ExtType
class GenericGDNativeLibrary(Extension):
def __init__(self, name, **gdnative_options):
self._gdnative_type = ExtType.GENERIC_LIBRARY
self._gdnative_options = gdnative_options
super().__init__(name, sources=[])
class GDNativeLib... | 27.6 | 72 | 0.684058 | from setuptools import Extension
from .enums import ExtType
class GenericGDNativeLibrary(Extension):
def __init__(self, name, **gdnative_options):
self._gdnative_type = ExtType.GENERIC_LIBRARY
self._gdnative_options = gdnative_options
super().__init__(name, sources=[])
class GDNativeLib... | true | true |
f74606d5f3f379047f4102525ca2b1bb9deeaa69 | 130 | py | Python | www/config_override.py | bupt075225/xilingxue | e5da770ae54de7dab0536b590775af0eee0b5ecc | [
"Apache-2.0"
] | null | null | null | www/config_override.py | bupt075225/xilingxue | e5da770ae54de7dab0536b590775af0eee0b5ecc | [
"Apache-2.0"
] | null | null | null | www/config_override.py | bupt075225/xilingxue | e5da770ae54de7dab0536b590775af0eee0b5ecc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
生产环境标准配置
'''
configs = {
'db':{
'host':'127.0.0.1'
}
}
| 10 | 30 | 0.4 |
configs = {
'db':{
'host':'127.0.0.1'
}
}
| true | true |
f746078d7acafc80ae9517248457649e8148b656 | 17,511 | py | Python | tf_slim/nets/vgg_test.py | ShanuDey/tf-slim | 19c840abfa6de567d760254c42ea68760cf5d9f0 | [
"Apache-2.0"
] | 1 | 2020-10-01T23:37:41.000Z | 2020-10-01T23:37:41.000Z | tf_slim/nets/vgg_test.py | ShanuDey/tf-slim | 19c840abfa6de567d760254c42ea68760cf5d9f0 | [
"Apache-2.0"
] | null | null | null | tf_slim/nets/vgg_test.py | ShanuDey/tf-slim | 19c840abfa6de567d760254c42ea68760cf5d9f0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 40.534722 | 80 | 0.646565 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tf_slim.nets import vgg
from tf_slim.ops import variables as variables_lib
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops... | true | true |
f74609e8ba4eb471d1ec0822212b79ef5a5be5b7 | 1,144 | py | Python | elib_config/_validate.py | etcher-be/elib_config | ec7e06cbf53de608b4071a91de108d15a09c8cc4 | [
"MIT"
] | null | null | null | elib_config/_validate.py | etcher-be/elib_config | ec7e06cbf53de608b4071a91de108d15a09c8cc4 | [
"MIT"
] | 47 | 2018-10-15T12:18:50.000Z | 2019-11-12T12:17:06.000Z | elib_config/_validate.py | etcher-be/elib_config | ec7e06cbf53de608b4071a91de108d15a09c8cc4 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Verifies that all configuration values have a valid setting
"""
from elib_config._setup import ELIBConfig
# noinspection PyProtectedMember
from elib_config._value._config_value import ConfigValue
# noinspection PyProtectedMember
from elib_config._value._exc import DuplicateConfigValueError, MissingV... | 31.777778 | 80 | 0.729021 |
from elib_config._setup import ELIBConfig
from elib_config._value._config_value import ConfigValue
from elib_config._value._exc import DuplicateConfigValueError, MissingValueError
def validate_config(raise_=True):
ELIBConfig.check()
known_paths = set()
duplicate_values = set()
missing_values = set... | true | true |
f7460ad72ad255d63cd25ce9599338abe8c4dfad | 4,062 | py | Python | plotly/validators/scattergeo/marker/_line.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2018-07-16T01:51:47.000Z | 2018-07-16T01:51:47.000Z | plotly/validators/scattergeo/marker/_line.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/scattergeo/marker/_line.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='line', parent_name='scattergeo.marker', **kwargs
):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | 47.788235 | 75 | 0.548006 | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='line', parent_name='scattergeo.marker', **kwargs
):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | true | true |
f7460b01267d747fa68c0e4d8d0fd1c8ba1a9185 | 3,303 | py | Python | ponai/data/grid_dataset.py | pedrob37/PhysicsPyTorch | a892dfe89740b6fa75d3de5319f99d41bcf4ca63 | [
"MIT"
] | null | null | null | ponai/data/grid_dataset.py | pedrob37/PhysicsPyTorch | a892dfe89740b6fa75d3de5319f99d41bcf4ca63 | [
"MIT"
] | null | null | null | ponai/data/grid_dataset.py | pedrob37/PhysicsPyTorch | a892dfe89740b6fa75d3de5319f99d41bcf4ca63 | [
"MIT"
] | 1 | 2021-01-07T15:47:37.000Z | 2021-01-07T15:47:37.000Z | # Copyright 2020 ponai Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | 45.875 | 119 | 0.666061 |
import math
from typing import Union
import torch
from torch.utils.data import IterableDataset
from ponai.data.utils import iter_patch
from ponai.utils import NumpyPadMode
class GridPatchDataset(IterableDataset):
def __init__(
self, dataset, patch_size, start_pos=(), mode: Union[NumpyPadMode... | true | true |
f7460c5d27d33c92dffb5cebb5d485ba4fe6501a | 54,366 | py | Python | mne/channels/tests/test_montage.py | kylemath/mne-python | 586c5d918a673ab5d5c92ffb4479fe57fee5559d | [
"BSD-3-Clause"
] | null | null | null | mne/channels/tests/test_montage.py | kylemath/mne-python | 586c5d918a673ab5d5c92ffb4479fe57fee5559d | [
"BSD-3-Clause"
] | 28 | 2020-05-07T00:58:34.000Z | 2020-08-29T23:02:17.000Z | mne/channels/tests/test_montage.py | kylemath/mne-python | 586c5d918a673ab5d5c92ffb4479fe57fee5559d | [
"BSD-3-Clause"
] | 1 | 2020-07-29T15:48:58.000Z | 2020-07-29T15:48:58.000Z | # Author: Teon Brooks <teon.brooks@gmail.com>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD (3-clause)
from itertools import chain
import os
import os.path as op
import pytest
import numpy as np
from functools import partial
from string import ascii_lowercase
from numpy.testing import (... | 37.93859 | 122 | 0.597708 |
from itertools import chain
import os
import os.path as op
import pytest
import numpy as np
from functools import partial
from string import ascii_lowercase
from numpy.testing import (assert_array_equal,
assert_allclose, assert_equal)
import matplotlib.pyplot as plt
from mne import _... | true | true |
f7460cde230285204cb0fa0def331c8e30173361 | 4,295 | py | Python | admin/users/views.py | JonnyFunFun/pyParty | 972690881c88d27139b076d2acb50b69275759b8 | [
"MIT"
] | 1 | 2017-03-23T18:07:33.000Z | 2017-03-23T18:07:33.000Z | admin/users/views.py | JonnyFunFun/pyParty | 972690881c88d27139b076d2acb50b69275759b8 | [
"MIT"
] | null | null | null | admin/users/views.py | JonnyFunFun/pyParty | 972690881c88d27139b076d2acb50b69275759b8 | [
"MIT"
] | null | null | null | from global_decorators import render_to
from accounts.models import UserProfile, FLAG_ADMIN, FLAG_OP, FLAG_VIP
from admin.decorators import admin_only
from django.contrib import messages
from django.http import HttpResponseRedirect
from admin.users.forms import AdminProfileForm
from django.contrib.auth.models import Us... | 42.524752 | 93 | 0.610943 | from global_decorators import render_to
from accounts.models import UserProfile, FLAG_ADMIN, FLAG_OP, FLAG_VIP
from admin.decorators import admin_only
from django.contrib import messages
from django.http import HttpResponseRedirect
from admin.users.forms import AdminProfileForm
from django.contrib.auth.models import Us... | true | true |
f7460eccac76e279c99d5856c0026ad549ad303c | 1,217 | py | Python | Secure-Password-Generator/password-gen.py | allenwest24/Ethical-Hacking-Toolbox | 9003f4eb1ac1f52cc697c98223e862b8f541144e | [
"MIT"
] | null | null | null | Secure-Password-Generator/password-gen.py | allenwest24/Ethical-Hacking-Toolbox | 9003f4eb1ac1f52cc697c98223e862b8f541144e | [
"MIT"
] | null | null | null | Secure-Password-Generator/password-gen.py | allenwest24/Ethical-Hacking-Toolbox | 9003f4eb1ac1f52cc697c98223e862b8f541144e | [
"MIT"
] | 3 | 2020-05-26T12:43:14.000Z | 2021-09-27T00:08:32.000Z | import argparse
import random
parser = argparse.ArgumentParser(prog='xkcdpwgen', description='Generate a secure, memorable password using the XKCD method')
parser.add_argument("-w", "--words", type=int, default=4, help='include WORDS words in the password (default=4)')
parser.add_argument("-c", "--caps", type=int, def... | 45.074074 | 134 | 0.72309 | import argparse
import random
parser = argparse.ArgumentParser(prog='xkcdpwgen', description='Generate a secure, memorable password using the XKCD method')
parser.add_argument("-w", "--words", type=int, default=4, help='include WORDS words in the password (default=4)')
parser.add_argument("-c", "--caps", type=int, def... | true | true |
f7460f10dc9527c6fca29f42128e9dc8e0daa1cb | 1,367 | py | Python | juriscraper/opinions/united_states/federal_appellate/ca10.py | Alex-Devoid/juriscraper | 6ac2d5182dbf3aea14d918e645d582e9b42c9dd6 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states/federal_appellate/ca10.py | Alex-Devoid/juriscraper | 6ac2d5182dbf3aea14d918e645d582e9b42c9dd6 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states/federal_appellate/ca10.py | Alex-Devoid/juriscraper | 6ac2d5182dbf3aea14d918e645d582e9b42c9dd6 | [
"BSD-2-Clause"
] | null | null | null | from juriscraper.OpinionSite import OpinionSite
import time
from datetime import date
from lxml import html
class Site(OpinionSite):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.url = 'http://www.ca10.uscourts.gov/opinions/new/daily_decisions.rss'
se... | 37.972222 | 97 | 0.657644 | from juriscraper.OpinionSite import OpinionSite
import time
from datetime import date
from lxml import html
class Site(OpinionSite):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.url = 'http://www.ca10.uscourts.gov/opinions/new/daily_decisions.rss'
se... | true | true |
f7460fce596d8c252c27b572138a0d488c8a0852 | 6,496 | py | Python | pytest_django_test/db_helpers.py | bh/pytest_django | 4957b6f1efd004a6591976b86bee288055118962 | [
"BSD-3-Clause"
] | null | null | null | pytest_django_test/db_helpers.py | bh/pytest_django | 4957b6f1efd004a6591976b86bee288055118962 | [
"BSD-3-Clause"
] | null | null | null | pytest_django_test/db_helpers.py | bh/pytest_django | 4957b6f1efd004a6591976b86bee288055118962 | [
"BSD-3-Clause"
] | 1 | 2020-06-12T09:56:48.000Z | 2020-06-12T09:56:48.000Z | import os
import subprocess
import sqlite3
import pytest
from django.conf import settings
from django.db import connection
from django.db import transaction
from .compat import force_text
from .app.models import Item
DB_NAME = settings.DATABASES['default']['NAME']
if DB_NAME == ':memory:':
TEST_DB_NAME = DB_NA... | 30.213953 | 80 | 0.615764 | import os
import subprocess
import sqlite3
import pytest
from django.conf import settings
from django.db import connection
from django.db import transaction
from .compat import force_text
from .app.models import Item
DB_NAME = settings.DATABASES['default']['NAME']
if DB_NAME == ':memory:':
TEST_DB_NAME = DB_NA... | true | true |
f7460ff3f1d7cefd6e851edf9589b94ce7760918 | 2,374 | py | Python | src/peregrinus/world/celestial/star.py | tom65536/sabio | 406ef2f680c2c7b2b075250d060e223e6b3c55a9 | [
"Apache-2.0"
] | null | null | null | src/peregrinus/world/celestial/star.py | tom65536/sabio | 406ef2f680c2c7b2b075250d060e223e6b3c55a9 | [
"Apache-2.0"
] | null | null | null | src/peregrinus/world/celestial/star.py | tom65536/sabio | 406ef2f680c2c7b2b075250d060e223e6b3c55a9 | [
"Apache-2.0"
] | null | null | null | """Data model of a star."""
import typing
import pint
from . import base, planet
from .. import UNITS
_LUM_SUN: pint.Quantity = 382.8e24 * UNITS.watt
_MASS_SUN: pint.Quantity = 1988500e24 * UNITS.kg
class Star(base.LuminousCelestialBody[planet.Planet]):
"""Class describing a star.
:param luminosity: the ... | 30.050633 | 101 | 0.628475 | import typing
import pint
from . import base, planet
from .. import UNITS
_LUM_SUN: pint.Quantity = 382.8e24 * UNITS.watt
_MASS_SUN: pint.Quantity = 1988500e24 * UNITS.kg
class Star(base.LuminousCelestialBody[planet.Planet]):
def __init__(
self,
luminosity: pint.Quantity,
temperature:... | true | true |
f746103c08700c089aee749e7733438ed0619383 | 1,197 | py | Python | media.py | skehokin/gross-tomatoes | 305d3d4b848a3c20653e034499152ff6ebff4ef3 | [
"MIT"
] | null | null | null | media.py | skehokin/gross-tomatoes | 305d3d4b848a3c20653e034499152ff6ebff4ef3 | [
"MIT"
] | null | null | null | media.py | skehokin/gross-tomatoes | 305d3d4b848a3c20653e034499152ff6ebff4ef3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu May 18 05:18:02 2017
@author: Siobhan
"""
import webbrowser
class Movie():
"""
A class which provides a way to store movie data.
Attributes:
title(str): value is the movie title given as the first argument.
storyline (str): value is the mov... | 32.351351 | 76 | 0.6533 |
import webbrowser
class Movie():
def __init__(self, movie_title, movie_storyline, movie_image,
movie_trailer):
self.title = movie_title
self.storyline = movie_storyline
self.poster_image_url = movie_image
self.trailer_youtube_url = movie_trailer
def show_tr... | true | true |
f746104cb692d45b351d0de5cc678fad927d158d | 1,158 | py | Python | module_unit_tests.py | NYC00kie/PhysWikiQuiz | 4243fd6fa6f23670b9743b6a2c79339a9f3d32fc | [
"Apache-2.0"
] | 5 | 2021-11-04T20:15:04.000Z | 2022-03-03T15:03:52.000Z | module_unit_tests.py | NYC00kie/PhysWikiQuiz | 4243fd6fa6f23670b9743b6a2c79339a9f3d32fc | [
"Apache-2.0"
] | 6 | 2021-08-30T06:57:53.000Z | 2021-11-16T23:25:33.000Z | module_unit_tests.py | NYC00kie/PhysWikiQuiz | 4243fd6fa6f23670b9743b6a2c79339a9f3d32fc | [
"Apache-2.0"
] | 1 | 2021-11-16T19:40:18.000Z | 2021-11-16T19:40:18.000Z | import unittest
from old import module0_formula_and_identifier_retrieval
import pandas as pd
# Python Tutorial: Unit Testing Your Code with the unittest Module:
#https://www.youtube.com/watch?v=6tNS--WetLI
# Retrieve sample QIDs
sample_IDs_filepath = r'evaluation\sample_IDs.csv'
QIDs_column_name = 'QID'
def get_sa... | 28.95 | 74 | 0.700345 | import unittest
from old import module0_formula_and_identifier_retrieval
import pandas as pd
sample_IDs_filepath = r'evaluation\sample_IDs.csv'
QIDs_column_name = 'QID'
def get_sample_QIDs():
sample_IDs_table = pd.read_csv(sample_IDs_filepath,delimiter=';')
sample_QIDs = list(sample_IDs_table[QIDs_colum... | true | true |
f7461078593cd80211109733e820cf140b7988a3 | 7,674 | py | Python | preprocess_google_dataset_main.py | googleinterns/smart-content-summary | 595c8e2cb0e160a87cacb954a2a030953fdce6c5 | [
"Apache-2.0"
] | 5 | 2020-05-25T23:27:42.000Z | 2022-01-15T08:57:47.000Z | preprocess_google_dataset_main.py | googleinterns/smart-content-summary | 595c8e2cb0e160a87cacb954a2a030953fdce6c5 | [
"Apache-2.0"
] | 6 | 2020-11-13T18:56:37.000Z | 2022-02-10T02:13:31.000Z | preprocess_google_dataset_main.py | googleinterns/smart-content-summary | 595c8e2cb0e160a87cacb954a2a030953fdce6c5 | [
"Apache-2.0"
] | 2 | 2020-09-02T08:06:18.000Z | 2021-10-31T16:56:16.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.802956 | 120 | 0.641386 |
import argparse
import csv
import os
import subprocess
import preprocess_utils
TEMP_FOLDER_NAME = "temp_preprocess_google_dataset"
TEMP_FOLDER_DIR = "~/" + TEMP_FOLDER_NAME
DATASET_NAME = "sentence-compression"
DATASET_DIR = "~/" + DATASET_NAME + "/data"
PREPROCESSED_FILE_PATH = "~/preprocessed_google_d... | true | true |
f746108ad13e1f82ebb17b098e44a9e821d785b8 | 8,919 | py | Python | numpy/f2py/func2subr.py | walshb/numpy | 073bc39c58a6788ffda6aaa7549955cc3d4fdc93 | [
"BSD-3-Clause"
] | 343 | 2015-01-07T05:58:44.000Z | 2022-03-15T14:55:21.000Z | numpy/f2py/func2subr.py | walshb/numpy | 073bc39c58a6788ffda6aaa7549955cc3d4fdc93 | [
"BSD-3-Clause"
] | 61 | 2015-03-19T18:20:21.000Z | 2019-10-23T12:58:23.000Z | numpy/f2py/func2subr.py | walshb/numpy | 073bc39c58a6788ffda6aaa7549955cc3d4fdc93 | [
"BSD-3-Clause"
] | 66 | 2015-01-20T15:35:05.000Z | 2021-11-25T16:49:41.000Z | #!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS... | 30.649485 | 97 | 0.531113 |
__version__ = "$Revision: 1.16 $"[10:-1]
f2py_version='See `f2py -v`'
import pprint
import copy
import sys
errmess=sys.stderr.write
outmess=sys.stdout.write
show=pprint.pprint
from auxfuncs import *
def var2fixfortran(vars,a,fa=None,f90mode=None):
if fa is None:
fa = a
if a not in vars:
sho... | true | true |
f746109631b50a3708cfb1ee8e577900716bc42a | 3,222 | py | Python | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/ModifyLifecycleHookRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/ModifyLifecycleHookRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/ModifyLifecycleHookRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.8 | 78 | 0.787089 |
from aliyunsdkcore.request import RpcRequest
class ModifyLifecycleHookRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Ess', '2014-08-28', 'ModifyLifecycleHook','ess')
def get_DefaultResult(self):
return self.get_query_params().get('DefaultResult')
def set_DefaultRes... | true | true |
f74610e48641c26ae3888afc09900a7df6b7efa4 | 692 | py | Python | src/libs/allauth/__init__.py | ivanjo39191/ivankao-erp | 04ed4e5128b419c995dfcb57f2eead2af498b156 | [
"Apache-2.0"
] | null | null | null | src/libs/allauth/__init__.py | ivanjo39191/ivankao-erp | 04ed4e5128b419c995dfcb57f2eead2af498b156 | [
"Apache-2.0"
] | null | null | null | src/libs/allauth/__init__.py | ivanjo39191/ivankao-erp | 04ed4e5128b419c995dfcb57f2eead2af498b156 | [
"Apache-2.0"
] | null | null | null | r"""
_ ___ __ __ .___________. __ __
/\| |/\ / \ | | | | | || | | |
\ ` ' / / ^ \ | | | | `---| |----`| |__| |
|_ _| / /_\ \ | | | | | | | __ |
/ , . \ / _____ \ | `--' | | | | | | |
\/|_|\//__/ \__\ \______/ ... | 32.952381 | 81 | 0.410405 |
VERSION = (0, 47, 0, "final", 0)
__title__ = "django-allauth"
__version_info__ = VERSION
__version__ = ".".join(map(str, VERSION[:3])) + (
"-{}{}".format(VERSION[3], VERSION[4] or "") if VERSION[3] != "final" else ""
)
__author__ = "Raymond Penners"
__license__ = "MIT"
__copyright__ = "Copyright 2010-2021 Raymond... | true | true |
f746111e500233142c3a5bf39faea75459aa14b6 | 1,111 | py | Python | molsysmt/native/io/molsys/mdanalysis_Universe.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/native/io/molsys/mdanalysis_Universe.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/native/io/molsys/mdanalysis_Universe.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | from molsysmt._private_tools.exceptions import *
def from_mdanalysis_Universe (item, molecular_system=None, atom_indices='all', frame_indices='all'):
from molsysmt.native.molsys import MolSys
from molsysmt.native.io.topology import from_mdanalysis_Universe as mdanalysis_Universe_to_molsysmt_Topology
from ... | 46.291667 | 133 | 0.818182 | from molsysmt._private_tools.exceptions import *
def from_mdanalysis_Universe (item, molecular_system=None, atom_indices='all', frame_indices='all'):
from molsysmt.native.molsys import MolSys
from molsysmt.native.io.topology import from_mdanalysis_Universe as mdanalysis_Universe_to_molsysmt_Topology
from ... | true | true |
f746115ff1558ffec2e205d5842a764ab530704b | 160 | py | Python | program_examples/utilities_main.py | Maelstrom6/mandelpy | f5b541258fcb1518d7c46a24553bf1749ae976f3 | [
"Apache-2.0"
] | null | null | null | program_examples/utilities_main.py | Maelstrom6/mandelpy | f5b541258fcb1518d7c46a24553bf1749ae976f3 | [
"Apache-2.0"
] | null | null | null | program_examples/utilities_main.py | Maelstrom6/mandelpy | f5b541258fcb1518d7c46a24553bf1749ae976f3 | [
"Apache-2.0"
] | null | null | null | from user_utilities import make_gif
# you must create a folder `increasing_powers` in images
make_gif(r"../images/increasing_powers",
"test.mp4", 30)
| 26.666667 | 56 | 0.7375 | from user_utilities import make_gif
make_gif(r"../images/increasing_powers",
"test.mp4", 30)
| true | true |
f74611d5ad44635ee5530bc0bae6b976cd814512 | 163 | py | Python | tests/__init__.py | astanin/flickr-download | 3bddf074896ea11f1468b1a1d127ef83394bb93b | [
"Apache-2.0"
] | 192 | 2015-01-12T08:48:11.000Z | 2022-02-15T11:21:00.000Z | tests/__init__.py | astanin/flickr-download | 3bddf074896ea11f1468b1a1d127ef83394bb93b | [
"Apache-2.0"
] | 48 | 2015-02-19T13:32:49.000Z | 2020-10-02T14:29:10.000Z | tests/__init__.py | astanin/flickr-download | 3bddf074896ea11f1468b1a1d127ef83394bb93b | [
"Apache-2.0"
] | 72 | 2015-02-09T11:07:45.000Z | 2022-01-28T06:26:02.000Z | import os.path
import unittest2
def get_tests():
start_dir = os.path.dirname(__file__)
return unittest2.TestLoader().discover(start_dir, pattern="*.py")
| 20.375 | 69 | 0.736196 | import os.path
import unittest2
def get_tests():
start_dir = os.path.dirname(__file__)
return unittest2.TestLoader().discover(start_dir, pattern="*.py")
| true | true |
f74611e6bedf44f0960654e4d1d157cd604df2f0 | 1,847 | py | Python | editor/mode.py | ChrnyaevEK/petnetsim | f7beebf4372012343a6f91be948d1d8d9b0c2b8a | [
"MIT"
] | null | null | null | editor/mode.py | ChrnyaevEK/petnetsim | f7beebf4372012343a6f91be948d1d8d9b0c2b8a | [
"MIT"
] | null | null | null | editor/mode.py | ChrnyaevEK/petnetsim | f7beebf4372012343a6f91be948d1d8d9b0c2b8a | [
"MIT"
] | null | null | null | import enum
class Mode(enum.IntEnum):
Normal = 0
ArcSource = 1
ArcTarget = 2
Simulation = 100
ModeStrings = {Mode.Normal: 'Editor: Normal',
Mode.ArcSource: 'Editor: Arc source',
Mode.ArcTarget: 'Editor: Arc target',
Mode.Simulation: 'Simulation',
... | 32.403509 | 92 | 0.653492 | import enum
class Mode(enum.IntEnum):
Normal = 0
ArcSource = 1
ArcTarget = 2
Simulation = 100
ModeStrings = {Mode.Normal: 'Editor: Normal',
Mode.ArcSource: 'Editor: Arc source',
Mode.ArcTarget: 'Editor: Arc target',
Mode.Simulation: 'Simulation',
... | true | true |
f7461201509b593ef9dba7785d5fc0540de00c84 | 101 | py | Python | python/testData/pyi/type/genericClassDefinitionInOtherFile/other.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/pyi/type/genericClassDefinitionInOtherFile/other.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/pyi/type/genericClassDefinitionInOtherFile/other.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class Holder:
def __init__(self, x):
self.x = x
def get(self):
return self.x | 16.833333 | 26 | 0.534653 | class Holder:
def __init__(self, x):
self.x = x
def get(self):
return self.x | true | true |
f74612205c0cec901249468d28965489f75519ff | 8,424 | py | Python | action-philips_hue.py | fighterii/snips-skill-hue-pro | 196e65a9bebc38c145d1ca89e4f4d567582098e7 | [
"MIT"
] | null | null | null | action-philips_hue.py | fighterii/snips-skill-hue-pro | 196e65a9bebc38c145d1ca89e4f4d567582098e7 | [
"MIT"
] | null | null | null | action-philips_hue.py | fighterii/snips-skill-hue-pro | 196e65a9bebc38c145d1ca89e4f4d567582098e7 | [
"MIT"
] | 2 | 2019-02-03T19:41:18.000Z | 2019-11-25T15:58:35.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hermes_python.hermes import Hermes
from os.path import expanduser
import os
from snipshue.snipshue import SnipsHue
from snipshelpers.thread_handler import ThreadHandler
from snipshelpers.config_parser import SnipsConfigParser
import queue
CONFIGURATION_ENCODING_FORM... | 38.465753 | 88 | 0.620252 |
from hermes_python.hermes import Hermes
from os.path import expanduser
import os
from snipshue.snipshue import SnipsHue
from snipshelpers.thread_handler import ThreadHandler
from snipshelpers.config_parser import SnipsConfigParser
import queue
CONFIGURATION_ENCODING_FORMAT = "utf-8"
CONFIG_INI = "config.ini"
CACHE... | true | true |
f746126b61cb0613a0142d4e5f9819ca3e84fea7 | 1,342 | py | Python | CountryIMG.py | AGH-Narzedzia-Informatyczne/Project-Maze | 61af3f79dc6e9054c5391fd11774bdafd00653c1 | [
"MIT"
] | null | null | null | CountryIMG.py | AGH-Narzedzia-Informatyczne/Project-Maze | 61af3f79dc6e9054c5391fd11774bdafd00653c1 | [
"MIT"
] | 19 | 2020-10-29T09:10:26.000Z | 2020-12-15T14:45:58.000Z | CountryIMG.py | AGH-Narzedzia-Informatyczne/Project-Maze | 61af3f79dc6e9054c5391fd11774bdafd00653c1 | [
"MIT"
] | null | null | null | from tkinter import *
from PIL import Image,ImageTk
from resizeimage import resizeimage
#import os
class CountryIMG:
def __init__(self):
self.size = 400
self.TXT =open('CountryImages\Europ\Panstwa.txt',"r",encoding="utf-8")
self.CountryName=[]
self.CountryImage = []
for li... | 36.27027 | 93 | 0.610283 | from tkinter import *
from PIL import Image,ImageTk
from resizeimage import resizeimage
class CountryIMG:
def __init__(self):
self.size = 400
self.TXT =open('CountryImages\Europ\Panstwa.txt',"r",encoding="utf-8")
self.CountryName=[]
self.CountryImage = []
for line in self... | true | true |
f746132cbacbff59a070def448838959ca597e01 | 18,723 | py | Python | src/sage/interfaces/scilab.py | defeo/sage | d8822036a9843bd4d75845024072515ede56bcb9 | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/interfaces/scilab.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | src/sage/interfaces/scilab.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | r"""
Interface to Scilab
Scilab is a scientific software package for numerical computations
providing a powerful open computing environment for engineering and
scientific applications. Scilab includes hundreds of mathematical
functions with the possibility to add interactively programs from
various languages (C, C++,... | 33.196809 | 151 | 0.467019 | true | true | |
f74616062fc651a30d0b5825d48b2c780d9472e8 | 9,993 | py | Python | 2_Training/Train_YOLO.py | bertelschmitt/multistreamYOLO | 827a1d2ae11653fe5fde2cee3b52cda8baae9899 | [
"CC-BY-4.0"
] | 6 | 2020-10-31T15:31:59.000Z | 2021-07-10T14:41:16.000Z | 2_Training/Train_YOLO.py | bertelschmitt/multistreamYOLO | 827a1d2ae11653fe5fde2cee3b52cda8baae9899 | [
"CC-BY-4.0"
] | 7 | 2020-11-04T07:00:24.000Z | 2022-03-12T00:50:38.000Z | 2_Training/Train_YOLO.py | bertelschmitt/multistreamYOLO | 827a1d2ae11653fe5fde2cee3b52cda8baae9899 | [
"CC-BY-4.0"
] | 2 | 2021-04-16T09:17:55.000Z | 2021-06-22T12:03:44.000Z |
"""
MODIFIED FROM keras-yolo3 PACKAGE, https://github.com/qqwweee/keras-yolo3
Retrain the YOLO model for your own dataset.
10-26-20 MODIFIED by bertelschmitt to use new repo name if changed to something else than "TrainYourOwnYOLO"
10-31-20 UPDATED by bertelschmitt to reflect TrainYourOwnYOLO versions as of 10-31-20... | 32.444805 | 117 | 0.667567 |
import os
import sys
import argparse
import warnings
def get_parent_dir(n=1):
current_path = os.path.dirname(os.path.abspath(__file__))
for _ in range(n):
current_path = os.path.dirname(current_path)
return current_path
src_path = os.path.join(get_parent_dir(0), "src")
sys.path.append(src_path... | true | true |
f746171fb07952ebc842ee24ddbf70edf958a8d6 | 1,128 | py | Python | main_board/models.py | ralphqq/pse-indices-scoreboard | f11a01915ac5a17b663db604afe996c5ed928fb9 | [
"MIT"
] | 1 | 2019-10-08T16:54:07.000Z | 2019-10-08T16:54:07.000Z | main_board/models.py | ralphqq/pse-indices-scoreboard | f11a01915ac5a17b663db604afe996c5ed928fb9 | [
"MIT"
] | 8 | 2020-02-12T01:17:41.000Z | 2021-12-13T20:06:12.000Z | main_board/models.py | ralphqq/pse-indices-scoreboard | f11a01915ac5a17b663db604afe996c5ed928fb9 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
class MarketIndex(models.Model):
ticker = models.CharField(max_length=100, unique=True)
name = models.CharField(max_length=100, unique=True)
class Meta:
verbose_name_plural = 'market_indices'
def __str__(self):
... | 34.181818 | 76 | 0.703901 | from django.db import models
from django.utils import timezone
class MarketIndex(models.Model):
ticker = models.CharField(max_length=100, unique=True)
name = models.CharField(max_length=100, unique=True)
class Meta:
verbose_name_plural = 'market_indices'
def __str__(self):
... | true | true |
f74617c36ee06a3cd88beaf054ab8b5f9d04ca4b | 70 | py | Python | netbox/tenancy/tables/__init__.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | null | null | null | netbox/tenancy/tables/__init__.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | null | null | null | netbox/tenancy/tables/__init__.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | null | null | null | from .columns import *
from .contacts import *
from .tenants import *
| 17.5 | 23 | 0.742857 | from .columns import *
from .contacts import *
from .tenants import *
| true | true |
f74619f2f5f308a24da02e8ecca9fb0400626c81 | 6,750 | py | Python | async_upnp_client/aiohttp.py | brgerig/async_upnp_client | 680c4f5f7c80c417338e5c498179cb2af2f7bf1c | [
"Apache-2.0"
] | null | null | null | async_upnp_client/aiohttp.py | brgerig/async_upnp_client | 680c4f5f7c80c417338e5c498179cb2af2f7bf1c | [
"Apache-2.0"
] | null | null | null | async_upnp_client/aiohttp.py | brgerig/async_upnp_client | 680c4f5f7c80c417338e5c498179cb2af2f7bf1c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""aiohttp requester module."""
import asyncio
import logging
import socket
from asyncio.events import AbstractEventLoop, AbstractServer
from typing import Any, Mapping, Optional, Tuple, Union
import aiohttp
import aiohttp.web
import async_timeout
from async_upnp_client import UpnpEventHandle... | 33.415842 | 80 | 0.585926 |
import asyncio
import logging
import socket
from asyncio.events import AbstractEventLoop, AbstractServer
from typing import Any, Mapping, Optional, Tuple, Union
import aiohttp
import aiohttp.web
import async_timeout
from async_upnp_client import UpnpEventHandler, UpnpRequester
_LOGGER = logging.getLogger(__name__)... | true | true |
f7461bb61959a934c4200b0be06207b207f7aa73 | 1,312 | py | Python | assignments/05_hamming/hamming.py | cvk1988/biosystems-analytics-2020 | 68ef2146b3b1b38406f1452ba90c469068a663b2 | [
"MIT"
] | null | null | null | assignments/05_hamming/hamming.py | cvk1988/biosystems-analytics-2020 | 68ef2146b3b1b38406f1452ba90c469068a663b2 | [
"MIT"
] | null | null | null | assignments/05_hamming/hamming.py | cvk1988/biosystems-analytics-2020 | 68ef2146b3b1b38406f1452ba90c469068a663b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : cory
Date : 2020-03-03
Purpose: Rock the Casbah
"""
import argparse
import os
import sys
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Rock the Casbah',
... | 24.754717 | 83 | 0.429878 |
import argparse
import os
import sys
def get_args():
parser = argparse.ArgumentParser(
description='Rock the Casbah',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('file',
metavar='FILE',
type=argparse.FileType(... | true | true |
f7461bdb7f747c444ed6138308e0b03fa72e497b | 14,365 | py | Python | sdk/python/pulumi_aws/sns/topic.py | dixler/pulumi-aws | 88838ed6d412c092717a916b0b5b154f68226c3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/sns/topic.py | dixler/pulumi-aws | 88838ed6d412c092717a916b0b5b154f68226c3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/sns/topic.py | dixler/pulumi-aws | 88838ed6d412c092717a916b0b5b154f68226c3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Topic(... | 63.844444 | 697 | 0.744379 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Topic(pulumi.CustomResource):
application_failure_feedback_role_arn: pulumi.Output[str]
application_success_feedback_role_arn: pulumi.Output[str]
application_success_feedback_... | true | true |
f7461c85d34791efa1141493be7c1611de8a761d | 10,850 | py | Python | dash_labs/component_plugins/datatable.py | neumann-nico/dash-labs | 0bb9ef244919bf8882f97b183f0c7ab0f88762bb | [
"MIT"
] | 1 | 2021-09-01T12:53:15.000Z | 2021-09-01T12:53:15.000Z | dash_labs/component_plugins/datatable.py | neumann-nico/dash-labs | 0bb9ef244919bf8882f97b183f0c7ab0f88762bb | [
"MIT"
] | null | null | null | dash_labs/component_plugins/datatable.py | neumann-nico/dash-labs | 0bb9ef244919bf8882f97b183f0c7ab0f88762bb | [
"MIT"
] | null | null | null | import math
from dash_labs.dependency import Output, Input
from dash_labs.util import build_id, filter_kwargs
from .base import ComponentPlugin
from dash_labs.templates import FlatDiv
from dash.development.base_component import Component
operators = [
["ge ", ">="],
["le ", "<="],
["lt ", "<"],
["gt ... | 36.655405 | 95 | 0.602304 | import math
from dash_labs.dependency import Output, Input
from dash_labs.util import build_id, filter_kwargs
from .base import ComponentPlugin
from dash_labs.templates import FlatDiv
from dash.development.base_component import Component
operators = [
["ge ", ">="],
["le ", "<="],
["lt ", "<"],
["gt ... | true | true |
f7461cc42bbeb4885cbce89eb7d38e3494246e33 | 74 | py | Python | comic_dl/__version__.py | edimusxero/comic-dl | 3aac1cbdb5d460c992dff3d125ee105d70e96119 | [
"MIT"
] | null | null | null | comic_dl/__version__.py | edimusxero/comic-dl | 3aac1cbdb5d460c992dff3d125ee105d70e96119 | [
"MIT"
] | null | null | null | comic_dl/__version__.py | edimusxero/comic-dl | 3aac1cbdb5d460c992dff3d125ee105d70e96119 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = "2019.05.26"
| 14.8 | 26 | 0.594595 |
__version__ = "2019.05.26"
| true | true |
f7461cede0fbcf987f3ac000cc78346d2bc5178c | 2,528 | py | Python | tests/test_decorator_time_elapsed.py | thobiast/pcof | f94883b372a79014efdb4d28e3bde6eeb1a54d5a | [
"MIT"
] | 1 | 2020-08-06T23:03:03.000Z | 2020-08-06T23:03:03.000Z | tests/test_decorator_time_elapsed.py | thobiast/pcof | f94883b372a79014efdb4d28e3bde6eeb1a54d5a | [
"MIT"
] | 16 | 2020-06-02T17:51:32.000Z | 2020-09-02T17:59:04.000Z | tests/test_decorator_time_elapsed.py | thobiast/pcof | f94883b372a79014efdb4d28e3bde6eeb1a54d5a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test decorator time_elapsed."""
import pytest
import time
from pcof import decorators
def myfunc(*args, **kwargs):
return "{}; {}".format(args, kwargs)
def myfunc_two(*args, **kwargs):
time.sleep(0.1)
return "{}; {}".format(args, kwargs)
@pytest.mark.parametrize(
"args,... | 25.28 | 85 | 0.639636 |
import pytest
import time
from pcof import decorators
def myfunc(*args, **kwargs):
return "{}; {}".format(args, kwargs)
def myfunc_two(*args, **kwargs):
time.sleep(0.1)
return "{}; {}".format(args, kwargs)
@pytest.mark.parametrize(
"args, kwargs, result",
[
([], {}, "(); {}"),
... | true | true |
f7461d23f3bf96ba79249c217c42085c94e950c6 | 663 | py | Python | neutron/agent/metadata/__init__.py | ksshanam/neutron-dvr | c0854ea0d1023ab42e1ef861f9b6ff480e985ac5 | [
"Apache-2.0"
] | 3 | 2015-02-02T02:51:39.000Z | 2015-02-23T10:20:23.000Z | neutron/agent/metadata/__init__.py | ksshanam/neutron-dvr | c0854ea0d1023ab42e1ef861f9b6ff480e985ac5 | [
"Apache-2.0"
] | 4 | 2015-02-23T10:21:11.000Z | 2015-03-04T09:28:20.000Z | neutron/agent/metadata/__init__.py | ksshanam/neutron-dvr | c0854ea0d1023ab42e1ef861f9b6ff480e985ac5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | 41.4375 | 78 | 0.726998 | true | true | |
f7461ecef1f4d5895c07f899a6046b97b5b0f900 | 2,692 | py | Python | disf_gen_coarse2fine/table/ParseResult.py | GT-SALT/Disfluency-Generation-and-Detection | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 11 | 2020-10-19T21:52:58.000Z | 2022-02-23T02:28:57.000Z | disf_gen_coarse2fine/table/ParseResult.py | JingfengYang/Disfluency-Generation-and-Detection-1 | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 4 | 2021-07-09T11:59:03.000Z | 2022-02-10T00:58:25.000Z | disf_gen_coarse2fine/table/ParseResult.py | JingfengYang/Disfluency-Generation-and-Detection-1 | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 5 | 2021-06-18T08:05:51.000Z | 2022-02-18T04:09:17.000Z | import json
from collections import defaultdict
def is_eq(pred,gold):
return pred==gold
class GenResult(object):
def __init__(self, idx, lay, tgt,disf_frags, tags):
self.idx = idx
self.lay = lay
self.tgt = tgt
#print(tags)
self.tgt_tags=tags
self.gold_tgt=[]
... | 30.590909 | 142 | 0.51263 | import json
from collections import defaultdict
def is_eq(pred,gold):
return pred==gold
class GenResult(object):
def __init__(self, idx, lay, tgt,disf_frags, tags):
self.idx = idx
self.lay = lay
self.tgt = tgt
self.tgt_tags=tags
self.gold_tgt=[]
self.di... | true | true |
f7461ee6dab699064153332116449c8e20a0bac0 | 4,739 | py | Python | python/paddle/fluid/tests/unittests/test_bipartite_match_op.py | limeng357/Paddle | dbd25805c88c48998eb9dc0f4b2ca1fd46326482 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2019-04-28T13:29:41.000Z | 2022-01-09T16:54:20.000Z | python/paddle/fluid/tests/unittests/test_bipartite_match_op.py | limeng357/Paddle | dbd25805c88c48998eb9dc0f4b2ca1fd46326482 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2018-04-11T10:25:51.000Z | 2018-04-12T01:17:22.000Z | python/paddle/fluid/tests/unittests/test_bipartite_match_op.py | limeng357/Paddle | dbd25805c88c48998eb9dc0f4b2ca1fd46326482 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-11-04T08:01:39.000Z | 2020-11-06T08:33:28.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicabl... | 34.093525 | 80 | 0.612576 |
import unittest
import numpy as np
from op_test import OpTest
def bipartite_match(distance, match_indices, match_dist):
match_pair = []
row, col = distance.shape
for i in range(row):
for j in range(col):
match_pair.append((i, j, distance[i][j]))
match_sorted = sorted(... | true | true |
f7461fba05ea797f0369ccb3dec235f7d5b0968a | 1,373 | py | Python | setup.py | stegm/mystrom2mqtt | eb97d17b3a02ad0884bb430d2446772d97bf30e0 | [
"Apache-2.0"
] | 3 | 2020-06-21T15:47:43.000Z | 2020-12-22T19:43:20.000Z | setup.py | stegm/mystrom2mqtt | eb97d17b3a02ad0884bb430d2446772d97bf30e0 | [
"Apache-2.0"
] | null | null | null | setup.py | stegm/mystrom2mqtt | eb97d17b3a02ad0884bb430d2446772d97bf30e0 | [
"Apache-2.0"
] | 3 | 2020-07-28T18:41:42.000Z | 2020-11-23T17:05:01.000Z | """Set up mystrom2mqtt gateway."""
import os
from setuptools import find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.rst"), encoding="utf-8") as readme:
long_description = readme.read()
setup(
name="mystrom2mqtt",
version="0.1.0",
descripti... | 34.325 | 99 | 0.662054 | import os
from setuptools import find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.rst"), encoding="utf-8") as readme:
long_description = readme.read()
setup(
name="mystrom2mqtt",
version="0.1.0",
description="Transfer HTTP requests from myS... | true | true |
f7462088023877e3fa7e319347548111026590cb | 2,090 | py | Python | code.py | Nrico/MagTagLightSensor | 0e38b52af04d3bb74c44f3b43afe3685e9ad4cb4 | [
"MIT"
] | null | null | null | code.py | Nrico/MagTagLightSensor | 0e38b52af04d3bb74c44f3b43afe3685e9ad4cb4 | [
"MIT"
] | null | null | null | code.py | Nrico/MagTagLightSensor | 0e38b52af04d3bb74c44f3b43afe3685e9ad4cb4 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
Basic display_text.label example script
adapted for use on MagTag.
"""
import time
import board
import displayio
import terminalio
from adafruit_magtag.magtag import MagTag # Bit that allows the light sensor
from adafru... | 25.487805 | 98 | 0.751196 |
import time
import board
import displayio
import terminalio
from adafruit_magtag.magtag import MagTag
from adafruit_display_text import label
magtag = MagTag()
print(magtag.peripherals.light)
display = board.DISPLAY
time.sleep(display.time_to_refresh)
main_group = displayio.Group()
bg_bitmap = displa... | true | true |
f746211f667f9006fea8f6ab5626f3b922ce6c61 | 19,004 | py | Python | SimModel_Python_API/simmodel_swig/Release/SimSpace_Occupied_Default.py | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | 3 | 2016-05-30T15:12:16.000Z | 2022-03-22T08:11:13.000Z | SimModel_Python_API/simmodel_swig/Release/SimSpace_Occupied_Default.py | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | 21 | 2016-06-13T11:33:45.000Z | 2017-05-23T09:46:52.000Z | SimModel_Python_API/simmodel_swig/Release/SimSpace_Occupied_Default.py | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | 40.868817 | 124 | 0.756051 |
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_SimSpace_Occupied_Default', [dirname(__file__)])
except ImportError:
... | true | true |
f7462192e6ae51d76d36442383c84bd9c97b5fb9 | 864 | py | Python | introduction/37_people_detection.py | Tenjin0/python-opencv-base | b9732f24de688547b6d45b9d796d0ff458902874 | [
"MIT"
] | null | null | null | introduction/37_people_detection.py | Tenjin0/python-opencv-base | b9732f24de688547b6d45b9d796d0ff458902874 | [
"MIT"
] | null | null | null | introduction/37_people_detection.py | Tenjin0/python-opencv-base | b9732f24de688547b6d45b9d796d0ff458902874 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import os
import sys
this_dir = os.path.dirname(os.path.abspath(__file__))
needed_dir = os.path.abspath(os.path.join(this_dir, '../.'))
sys.path.insert(0, needed_dir)
from helpers.detect_people import Detect_people
# https://www.pyimagesearch.com/2015/11/09/pedestrian-detection-opencv/
... | 29.793103 | 89 | 0.783565 | import cv2
import numpy as np
import os
import sys
this_dir = os.path.dirname(os.path.abspath(__file__))
needed_dir = os.path.abspath(os.path.join(this_dir, '../.'))
sys.path.insert(0, needed_dir)
from helpers.detect_people import Detect_people
detector = Detect_people()
currentDirectory = os.path.dirname(os.pa... | true | true |
f74621fd670cc35fcb4ddce17fc87ea4ddcbe7af | 180 | py | Python | ABC/abc101-abc150/abc102/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc101-abc150/abc102/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc101-abc150/abc102/a.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# AtCoder Beginner Contest
if __name__ == '__main__':
n = int(input())
if n % 2 == 0:
print(n)
else:
print(n * 2)
| 15 | 27 | 0.45 |
if __name__ == '__main__':
n = int(input())
if n % 2 == 0:
print(n)
else:
print(n * 2)
| true | true |
f74624854dc167a03ff49486bad08da3539d17ab | 2,339 | py | Python | molo/surveys/migrations/0005_add_surveys_permissions_to_groups.py | praekelt/molo.surveys | c86d231f7cee669eb1c91db49ec05cf711984e30 | [
"BSD-3-Clause"
] | null | null | null | molo/surveys/migrations/0005_add_surveys_permissions_to_groups.py | praekelt/molo.surveys | c86d231f7cee669eb1c91db49ec05cf711984e30 | [
"BSD-3-Clause"
] | 88 | 2016-06-14T18:36:18.000Z | 2018-09-21T07:33:58.000Z | molo/surveys/migrations/0005_add_surveys_permissions_to_groups.py | praekeltfoundation/molo.surveys | c86d231f7cee669eb1c91db49ec05cf711984e30 | [
"BSD-3-Clause"
] | 1 | 2017-10-02T09:27:45.000Z | 2017-10-02T09:27:45.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-10-23 12:29
from __future__ import unicode_literals
from django.db import migrations
from django.core.management.sql import emit_post_migrate_signal
class Migration(migrations.Migration):
def add_surveys_permissions_to_groups(apps, schema_editor):
... | 31.608108 | 79 | 0.6118 |
from __future__ import unicode_literals
from django.db import migrations
from django.core.management.sql import emit_post_migrate_signal
class Migration(migrations.Migration):
def add_surveys_permissions_to_groups(apps, schema_editor):
db_alias = schema_editor.connection.alias
try:
... | true | true |
f74624c2e736bef6cbbf662d661e7836effdb8bc | 936 | py | Python | zerver/migrations/0015_attachment.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | 1 | 2017-07-27T19:49:12.000Z | 2017-07-27T19:49:12.000Z | zerver/migrations/0015_attachment.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | 9 | 2021-02-08T20:22:36.000Z | 2022-03-11T23:22:45.000Z | zerver/migrations/0015_attachment.py | tobby2002/zulip | 66e7c455759f9368bae16b9a604cf63f8e3524cd | [
"Apache-2.0"
] | 1 | 2021-04-09T05:50:23.000Z | 2021-04-09T05:50:23.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('zerver', '0014_realm_emoji_url_length'),
]
operations = [
migr... | 33.428571 | 114 | 0.621795 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('zerver', '0014_realm_emoji_url_length'),
]
operations = [
migrations.CreateModel(
... | true | true |
f74624cf9f2880e4507d63f9c9676056408ad149 | 7,482 | py | Python | catalyst/rl/scripts/run_samplers.py | Felix-neko/catalyst | df80986f1c12ef6a3776637453a0c04aaef0068c | [
"Apache-2.0"
] | 1 | 2022-03-13T21:40:17.000Z | 2022-03-13T21:40:17.000Z | catalyst/rl/scripts/run_samplers.py | Felix-neko/catalyst | df80986f1c12ef6a3776637453a0c04aaef0068c | [
"Apache-2.0"
] | null | null | null | catalyst/rl/scripts/run_samplers.py | Felix-neko/catalyst | df80986f1c12ef6a3776637453a0c04aaef0068c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["MKL_NUM_THREADS"] = "1"
import copy # noqa E402
import time # noqa E402
import atexit # noqa E402
import argparse # noqa E402
import multiprocessing as mp # noqa E402
import torch # noqa E402
torch.set_num_threads(1)
from catalyst... | 27.306569 | 79 | 0.616947 |
import os
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["MKL_NUM_THREADS"] = "1"
import copy
import time
import atexit
import argparse
import multiprocessing as mp
import torch
torch.set_num_threads(1)
from catalyst.rl.core import Sampler, ValidSampler, \
ExplorationHandler
from catalyst.rl.regi... | true | true |
f7462589684fea12426c835730418ee5e701b6ff | 11,602 | py | Python | tensorflow_addons/image/interpolate_spline.py | jahau/addons | 11b842781b0f022830f35f2e6ee1cc93c80abe50 | [
"Apache-2.0"
] | 1 | 2020-01-20T17:48:35.000Z | 2020-01-20T17:48:35.000Z | tensorflow_addons/image/interpolate_spline.py | jahau/addons | 11b842781b0f022830f35f2e6ee1cc93c80abe50 | [
"Apache-2.0"
] | null | null | null | tensorflow_addons/image/interpolate_spline.py | jahau/addons | 11b842781b0f022830f35f2e6ee1cc93c80abe50 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.54485 | 80 | 0.640493 |
import tensorflow as tf
EPSILON = 0.0000000001
def _cross_squared_distance_matrix(x, y):
x_norm_squared = tf.reduce_sum(tf.square(x), 2)
y_norm_squared = tf.reduce_sum(tf.square(y), 2)
x_norm_squared_tile = tf.expand_dims(x_norm_squared, 2)
y_norm_squared_tile = tf.expand_dims(y_... | true | true |
f746258b5845bb207349b88e05cef01f78c54527 | 3,992 | py | Python | pycorrector/seq2seq/infer.py | awesome-archive/pycorrector | ce4d8c5f251ee28b2f40802a08bd2697d9c8d6fc | [
"Apache-2.0"
] | 1 | 2018-12-26T07:33:46.000Z | 2018-12-26T07:33:46.000Z | pycorrector/seq2seq/infer.py | yingtingHuang/pycorrector | 022da83ab794d9f9ddc40caef67b0578e7e3f513 | [
"Apache-2.0"
] | null | null | null | pycorrector/seq2seq/infer.py | yingtingHuang/pycorrector | 022da83ab794d9f9ddc40caef67b0578e7e3f513 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: XuMing <xuming624@qq.com>
# Brief:
import numpy as np
import tensorflow as tf
from keras.models import load_model
from pycorrector.seq2seq import cged_config as config
from pycorrector.seq2seq.corpus_reader import CGEDReader, load_word_dict
from pycorrector.seq2seq.reader import EOS... | 38.757282 | 97 | 0.642034 |
import numpy as np
import tensorflow as tf
from keras.models import load_model
from pycorrector.seq2seq import cged_config as config
from pycorrector.seq2seq.corpus_reader import CGEDReader, load_word_dict
from pycorrector.seq2seq.reader import EOS_TOKEN, GO_TOKEN
from pycorrector.utils.io_utils import get_logger
... | true | true |
f74626165bb4f05896ccbbb932f6271770c961b7 | 6,040 | py | Python | pybind/slxos/v17r_2_00/interface/ethernet/delay_link_event/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_2_00/interface/ethernet/delay_link_event/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_2_00/interface/ethernet/delay_link_event/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 48.709677 | 502 | 0.713576 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f74626fa7fb341d9207dbafe1437441fe8cfb11b | 41 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/ocelot/__init__.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/ocelot/__init__.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/ocelot/__init__.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | """
Ocelot specific code lives here
"""
| 8.2 | 31 | 0.658537 | true | true | |
f746285d3a222cd7e196f45a4e19fcec2b65d966 | 994 | py | Python | var/spack/repos/builtin/packages/py-lscsoft-glue/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/py-lscsoft-glue/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/py-lscsoft-glue/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyLscsoftGlue(PythonPackage):
"""Glue (Grid LSC User Environment) is a suite of python mod... | 41.416667 | 95 | 0.712274 |
from spack import *
class PyLscsoftGlue(PythonPackage):
homepage = "https://www.lsc-group.phys.uwm.edu/daswg/projects/glue.html"
url = "https://pypi.io/packages/source/l/lscsoft-glue/lscsoft-glue-2.0.0.tar.gz"
version('2.0.0', sha256='9bdfaebe4c921d83d1e3d1ca24379a644665e9d7530e7070665f387767c... | true | true |
f7462905b43aeff04f1dfc251032af1507d22572 | 624 | py | Python | Snake/Fruit.py | JaredsGames/Snake | ff0ae856455e974e891586d37361a283f1783580 | [
"MIT"
] | null | null | null | Snake/Fruit.py | JaredsGames/Snake | ff0ae856455e974e891586d37361a283f1783580 | [
"MIT"
] | null | null | null | Snake/Fruit.py | JaredsGames/Snake | ff0ae856455e974e891586d37361a283f1783580 | [
"MIT"
] | null | null | null | # Jared Dyreson
# CPSC 386-01
# 2021-11-29
# jareddyreson@csu.fullerton.edu
# @JaredDyreson
#
# Lab 00-04
#
# Some filler text
#
"""
Simple class for the fruit
"""
import dataclasses
import random
from Snake.Cell import Cell
from Snake.Point import Point
@dataclasses.dataclass
class Fruit:
"""
Represents f... | 16.864865 | 59 | 0.63141 |
import dataclasses
import random
from Snake.Cell import Cell
from Snake.Point import Point
@dataclasses.dataclass
class Fruit:
value: int = 1
instance: Cell = None
def __post_init__(self):
self.instance = Cell(
Point(random.randint(0, 16), random.randint(
... | true | true |
f746298477b29fb3ed25fe995db86ae593c1ed79 | 269 | py | Python | fbtimer/__init__.py | amcintosh/FreshBooks-Timer | 72d43bc2e698113bf4682faa8e2186aff2fc2f1d | [
"MIT"
] | 2 | 2018-07-23T13:36:05.000Z | 2020-11-16T00:18:01.000Z | fbtimer/__init__.py | amcintosh/FreshBooks-Timer | 72d43bc2e698113bf4682faa8e2186aff2fc2f1d | [
"MIT"
] | 7 | 2017-11-28T02:06:50.000Z | 2018-10-04T02:29:51.000Z | fbtimer/__init__.py | amcintosh/FreshBooks-Timer | 72d43bc2e698113bf4682faa8e2186aff2fc2f1d | [
"MIT"
] | 1 | 2018-04-19T12:57:34.000Z | 2018-04-19T12:57:34.000Z | import os
__version__ = '0.1.1'
__date__ = '2017/20/10'
__updated__ = '2018/27/04'
__author__ = 'Andrew McIntosh'
__copyright__ = 'Copyright 2017, Andrew McIntosh'
__license__ = 'MIT'
FRESHBOOKS_BASE_URL = os.getenv('FBTIMER_API_URL', 'https://api.freshbooks.com/')
| 22.416667 | 81 | 0.736059 | import os
__version__ = '0.1.1'
__date__ = '2017/20/10'
__updated__ = '2018/27/04'
__author__ = 'Andrew McIntosh'
__copyright__ = 'Copyright 2017, Andrew McIntosh'
__license__ = 'MIT'
FRESHBOOKS_BASE_URL = os.getenv('FBTIMER_API_URL', 'https://api.freshbooks.com/')
| true | true |
f74629bde46e9eec2b88d3e3f9c3d44899f50383 | 754 | py | Python | stocal/examples/brusselator.py | MrLiono21/stocal | 7f7110c5b6401e7332d5d35c843b6fedafd464c2 | [
"MIT"
] | null | null | null | stocal/examples/brusselator.py | MrLiono21/stocal | 7f7110c5b6401e7332d5d35c843b6fedafd464c2 | [
"MIT"
] | null | null | null | stocal/examples/brusselator.py | MrLiono21/stocal | 7f7110c5b6401e7332d5d35c843b6fedafd464c2 | [
"MIT"
] | null | null | null | """Brusselator
A stochastic realization of the famous Brusselator system, first
proposed in I. Prigogine and R. Lefever, Symmetry Breaking Instabilities
in Dissipative Systems, J. Chem. Phys. 48, 1695 (1968).
This is a simple example of a process with only static (non-infered)
reactions. The deterministic system exhi... | 29 | 72 | 0.649867 |
import stocal
a = 2.
b = 10.
traj = stocal.Process([
stocal.MassAction({}, {"x": 1}, a),
stocal.MassAction({"x": 2, "y": 1}, {"x": 3}, 1.),
stocal.MassAction({"x": 1}, {"y": 1, "c": 1}, b),
stocal.MassAction({"x": 1}, {"d": 1}, 1.),
]).trajectory({}, tmax=50)
print("# time\tx\ty\tc\td")
for transiti... | true | true |
f7462ac7c5ac5e712a88cf9551322732b096d85e | 1,448 | py | Python | libs/models/DotProductClassifier.py | rahulvigneswaran/TailCalibX | 0ed18cc8903715c0e31934c54226a53b1bbfc198 | [
"MIT"
] | 34 | 2021-11-09T01:24:03.000Z | 2022-03-07T08:13:12.000Z | libs/models/DotProductClassifier.py | rahulvigneswaran/TailCalibX | 0ed18cc8903715c0e31934c54226a53b1bbfc198 | [
"MIT"
] | 6 | 2021-12-06T10:09:40.000Z | 2022-03-11T03:15:02.000Z | libs/models/DotProductClassifier.py | rahulvigneswaran/TailCalibX | 0ed18cc8903715c0e31934c54226a53b1bbfc198 | [
"MIT"
] | null | null | null | # Imports
import torch.nn as nn
from os import path
import torch
import torch.nn.functional as F
class DotProduct_Classifier(nn.Module):
def __init__(self, num_classes=1000, feat_dim=2048, *args):
super(DotProduct_Classifier, self).__init__()
self.fc = nn.Linear(feat_dim, num_classes)
def forw... | 30.166667 | 87 | 0.618785 |
import torch.nn as nn
from os import path
import torch
import torch.nn.functional as F
class DotProduct_Classifier(nn.Module):
def __init__(self, num_classes=1000, feat_dim=2048, *args):
super(DotProduct_Classifier, self).__init__()
self.fc = nn.Linear(feat_dim, num_classes)
def forward(self,... | true | true |
f7462ace2147906df3c974bbeec2ef419e52b2bb | 7,061 | py | Python | test/functional/maxuploadtarget.py | bwsnetwork/bwscoin | 3e71428f47a9923a024ea7b63dbdc9fd84afa266 | [
"MIT"
] | null | null | null | test/functional/maxuploadtarget.py | bwsnetwork/bwscoin | 3e71428f47a9923a024ea7b63dbdc9fd84afa266 | [
"MIT"
] | null | null | null | test/functional/maxuploadtarget.py | bwsnetwork/bwscoin | 3e71428f47a9923a024ea7b63dbdc9fd84afa266 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of -maxuploadtarget.
* Verify that getdata requests for old blocks (>1week) are dropped
... | 40.58046 | 107 | 0.67186 |
from collections import defaultdict
import time
from test_framework.mininode import *
from test_framework.test_framework import BWScoinTestFramework
from test_framework.util import *
class TestNode(NodeConnCB):
def __init__(self):
super().__init__()
self.block_receive_map = defaultdict(int)
... | true | true |
f7462bd2d298f20531e034a878027d0c57e34fba | 28,849 | py | Python | contrib/sign-releases.py | zebra-lucky/electrum-zcash | 2e66d47fa043d8c5ea536cd27a09dfb9e4ec314b | [
"MIT"
] | 11 | 2018-08-06T22:37:42.000Z | 2021-09-19T12:44:16.000Z | contrib/sign-releases.py | zebra-lucky/electrum-zcash | 2e66d47fa043d8c5ea536cd27a09dfb9e4ec314b | [
"MIT"
] | 9 | 2019-04-28T18:33:24.000Z | 2021-07-12T07:17:48.000Z | contrib/sign-releases.py | zebra-lucky/electrum-zcash | 2e66d47fa043d8c5ea536cd27a09dfb9e4ec314b | [
"MIT"
] | 14 | 2018-04-29T16:30:44.000Z | 2022-03-25T13:42:40.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Sign releases on github, make/upload ppa to launchpad.net
NOTE on ppa: To build a ppa you may need to install some more packages.
On ubuntu:
sudo apt-get install devscripts libssl-dev python3-dev \
debhelper python3-setuptools dh-python
NOTE on apk sig... | 37.760471 | 90 | 0.556622 |
import os
import os.path
import re
import sys
import time
import getpass
import shutil
import hashlib
import tempfile
import json
import zipfile
from subprocess import check_call, CalledProcessError
from functools import cmp_to_key
from time import localtime, strftime
try:
import click
import certifi
im... | true | true |
f7462bda0cfdece53a7a310429c15cc95cd30192 | 6,668 | py | Python | testing.py | Pavivenkatesan/TicTacToe-RL-MM- | fbaab6bb9574b82ae0d79c818ba74d049375bfd4 | [
"MIT"
] | null | null | null | testing.py | Pavivenkatesan/TicTacToe-RL-MM- | fbaab6bb9574b82ae0d79c818ba74d049375bfd4 | [
"MIT"
] | null | null | null | testing.py | Pavivenkatesan/TicTacToe-RL-MM- | fbaab6bb9574b82ae0d79c818ba74d049375bfd4 | [
"MIT"
] | null | null | null | import numpy as np
from math import inf as infinity
from itertools import product
from collections import defaultdict
import random
import time
# Initializing the Tic-Tac-Toe environment
# Three rows-Three columns, creating an empty list of three empty lists
state_space = [[' ', ' ', ' '], [' ', ' ', ' '], [' ', ' ', ... | 36.637363 | 115 | 0.589232 | import numpy as np
from math import inf as infinity
from itertools import product
from collections import defaultdict
import random
import time
state_space = [[' ', ' ', ' '], [' ', ' ', ' '], [' ', ' ', ' ']]
players = ['X', 'O']
def play(sv, each_player, cell):
if sv[int((cell - 1) / 3)][(cell - 1) % 3] is... | true | true |
f7462ce37ba91d11ca56ac67776e936d9e0ccbae | 672 | py | Python | osmchadjango/changeset/migrations/0011_import.py | juusokor/osmcha-django | 5daafa015d5e341aa8ad6f847be2b7cc1a204e2b | [
"BSD-2-Clause"
] | 27 | 2015-09-06T00:39:39.000Z | 2021-12-09T10:30:52.000Z | osmchadjango/changeset/migrations/0011_import.py | juusokor/osmcha-django | 5daafa015d5e341aa8ad6f847be2b7cc1a204e2b | [
"BSD-2-Clause"
] | 494 | 2015-09-10T19:39:38.000Z | 2022-03-29T08:07:37.000Z | osmchadjango/changeset/migrations/0011_import.py | juusokor/osmcha-django | 5daafa015d5e341aa8ad6f847be2b7cc1a204e2b | [
"BSD-2-Clause"
] | 17 | 2015-08-10T22:58:56.000Z | 2021-09-24T17:03:16.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('changeset', '0010_auto_20151227_1306'),
]
operations = [
migrations.CreateModel(
name='Import',
fiel... | 28 | 114 | 0.580357 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('changeset', '0010_auto_20151227_1306'),
]
operations = [
migrations.CreateModel(
name='Import',
fields=[
('... | true | true |
f7462d85c6a556d88fe2addea11601d34715df15 | 313 | py | Python | composite/errors.py | Skydipper/Composite | 5b44e0d773331cc586a02769d21fb7603fa4027d | [
"MIT"
] | null | null | null | composite/errors.py | Skydipper/Composite | 5b44e0d773331cc586a02769d21fb7603fa4027d | [
"MIT"
] | null | null | null | composite/errors.py | Skydipper/Composite | 5b44e0d773331cc586a02769d21fb7603fa4027d | [
"MIT"
] | null | null | null | """ERRORS"""
class Error(Exception):
"""Main Error Class"""
def __init__(self, message):
self.message = message
@property
def serialize(self):
return {
'message': self.message
}
class CompositeError(Error):
pass
class GeostoreNotFound(Error):
pass | 15.65 | 35 | 0.591054 |
class Error(Exception):
def __init__(self, message):
self.message = message
@property
def serialize(self):
return {
'message': self.message
}
class CompositeError(Error):
pass
class GeostoreNotFound(Error):
pass | true | true |
f7463004147e32c288f83832b3dab0761e6836fd | 1,207 | py | Python | Blob Rage App/random/PongBall.py | povellesto/blobydouche | 7d9eda9d262fa3ea99661b1a419a17f85dd21b17 | [
"Unlicense"
] | 1 | 2015-07-30T20:52:55.000Z | 2015-07-30T20:52:55.000Z | Blob Rage App/random/PongBall.py | povellesto/blobydouche | 7d9eda9d262fa3ea99661b1a419a17f85dd21b17 | [
"Unlicense"
] | 1 | 2015-11-23T23:56:08.000Z | 2015-11-23T23:56:08.000Z | Blob Rage App/random/PongBall.py | povellesto/blobydouche | 7d9eda9d262fa3ea99661b1a419a17f85dd21b17 | [
"Unlicense"
] | null | null | null | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty,\
ObjectProperty
from kivy.vector import Vector
from kivy.clock import Clock
from random import randint
class PongBall(Widget):
velocity_x = NumericProperty(0)
velocity_y = Numeri... | 25.680851 | 68 | 0.652858 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty,\
ObjectProperty
from kivy.vector import Vector
from kivy.clock import Clock
from random import randint
class PongBall(Widget):
velocity_x = NumericProperty(0)
velocity_y = Numeri... | true | true |
f746305cdd91687d07ef5dfd8ff69e0ba361e3d4 | 158 | py | Python | test/test_sample.py | gbroiles/tax | 1f0873db85a8ee489b991e9d129fd2395087b95a | [
"MIT"
] | 1 | 2022-03-03T13:15:31.000Z | 2022-03-03T13:15:31.000Z | test/test_sample.py | gbroiles/tax | 1f0873db85a8ee489b991e9d129fd2395087b95a | [
"MIT"
] | null | null | null | test/test_sample.py | gbroiles/tax | 1f0873db85a8ee489b991e9d129fd2395087b95a | [
"MIT"
] | null | null | null | # pylint: disable=invalid-name,missing-module-docstring,missing-function-docstring
def func(x):
return x + 1
def test_answer():
assert func(3) == 4
| 19.75 | 82 | 0.708861 |
def func(x):
return x + 1
def test_answer():
assert func(3) == 4
| true | true |
f74632014b9c8bab8859a4a3e60fc8a2885d2413 | 6,058 | py | Python | myvenv/lib/python3.5/site-packages/allauth/socialaccount/providers/twitter/south_migrations/0002_snowflake.py | tuvapp/tuvappcom | 5ca2be19f4b0c86a1d4a9553711a4da9d3f32841 | [
"MIT"
] | 3 | 2018-10-28T13:45:22.000Z | 2021-06-14T11:20:53.000Z | myvenv/lib/python3.5/site-packages/allauth/socialaccount/providers/twitter/south_migrations/0002_snowflake.py | tuvapp/tuvappcom | 5ca2be19f4b0c86a1d4a9553711a4da9d3f32841 | [
"MIT"
] | 9 | 2020-06-05T17:18:43.000Z | 2022-03-11T23:15:04.000Z | myvenv/lib/python3.5/site-packages/allauth/socialaccount/providers/twitter/south_migrations/0002_snowflake.py | tuvapp/tuvappcom | 5ca2be19f4b0c86a1d4a9553711a4da9d3f32841 | [
"MIT"
] | 3 | 2018-10-28T13:45:24.000Z | 2020-03-28T02:27:56.000Z | # encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'TwitterAccount.social_id'
db.alter_column('twitter_twitteraccount', 'social_id', self.gf('django.db.models.fields.BigIntegerField')(u... | 67.311111 | 182 | 0.572961 |
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
db.alter_column('twitter_twitteraccount', 'social_id', self.gf('django.db.models.fields.BigIntegerField')(unique=True))
def backwards(self, orm):
... | true | true |
f746329abd608811188266f337aeff7de7396a2c | 8,090 | py | Python | ondewo/nlu/convenience/shared_request_data.py | foldvaridominic/ondewo-nlu-client-python | a4e766252fc2fdd2372860755082480b4234609a | [
"Apache-2.0"
] | null | null | null | ondewo/nlu/convenience/shared_request_data.py | foldvaridominic/ondewo-nlu-client-python | a4e766252fc2fdd2372860755082480b4234609a | [
"Apache-2.0"
] | 5 | 2021-11-23T09:43:28.000Z | 2021-12-17T15:09:06.000Z | ondewo/nlu/convenience/shared_request_data.py | foldvaridominic/ondewo-nlu-client-python | a4e766252fc2fdd2372860755082480b4234609a | [
"Apache-2.0"
] | 1 | 2022-02-22T08:54:57.000Z | 2022-02-22T08:54:57.000Z | # Copyright 2021 ONDEWO GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 40.049505 | 118 | 0.630532 |
from dataclasses import dataclass
from typing import Optional, TypeVar, Dict, Type, Any
from uuid import uuid4
from google.protobuf.message import Message
from ondewo.nlu.context_pb2 import CreateContextRequest, ListContextsRequest, UpdateContextRequest, \
DeleteContextRequest, DeleteAllContextsReq... | true | true |
f74632a77271f1c3e58a85e3b3b8550fe87b7433 | 6,226 | py | Python | adafruit_epd/il0373.py | ladyada/Adafruit_CircuitPython_EPD | 4b2bbed6096cc9febb36abf71bc9f093ca175b3f | [
"MIT"
] | null | null | null | adafruit_epd/il0373.py | ladyada/Adafruit_CircuitPython_EPD | 4b2bbed6096cc9febb36abf71bc9f093ca175b3f | [
"MIT"
] | null | null | null | adafruit_epd/il0373.py | ladyada/Adafruit_CircuitPython_EPD | 4b2bbed6096cc9febb36abf71bc9f093ca175b3f | [
"MIT"
] | 1 | 2019-10-08T14:05:52.000Z | 2019-10-08T14:05:52.000Z | # The MIT License (MIT)
#
# Copyright (c) 2018 Dean Miller for Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the righ... | 38.432099 | 86 | 0.676839 |
import time
from micropython import const
import adafruit_framebuf
from adafruit_epd.epd import Adafruit_EPD
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_EPD.git"
_IL0373_PANEL_SETTING = const(0x00)
_IL0373_POWER_SETTING = const(0x01)
_IL0373_POWER_... | true | true |
f74632da87bc118e8ef70accfd01c8d085a9cbd9 | 2,299 | py | Python | modspectra/tests/test_spectrum_creation.py | Deech08/modspectra | 4af177418f9ac3e1ff30bf99968251ac143a96bc | [
"BSD-3-Clause"
] | 2 | 2020-06-04T13:09:50.000Z | 2020-06-04T13:10:03.000Z | modspectra/tests/test_spectrum_creation.py | Deech08/modspectra | 4af177418f9ac3e1ff30bf99968251ac143a96bc | [
"BSD-3-Clause"
] | 1 | 2020-10-29T19:55:57.000Z | 2020-10-29T19:55:57.000Z | modspectra/tests/test_spectrum_creation.py | Deech08/modspectra | 4af177418f9ac3e1ff30bf99968251ac143a96bc | [
"BSD-3-Clause"
] | null | null | null | import pytest
from numpy.random import randn
from numpy.random import random
import numpy as np
def test_non_detection():
from ..cube import EmissionCube
from astropy.coordinates import SkyCoord
import astropy.units as u
'''
Test that an anti-center pointing returns zero emission
'''
l = 18... | 32.842857 | 94 | 0.638104 | import pytest
from numpy.random import randn
from numpy.random import random
import numpy as np
def test_non_detection():
from ..cube import EmissionCube
from astropy.coordinates import SkyCoord
import astropy.units as u
l = 180. + randn()*130.
b = 0. + randn()*20.
while (l > 340.) | (l < 20.):... | true | true |
f74633c22a37d101ac85f8910da6786906416b29 | 1,144 | py | Python | tests/test_compress_string_in_memory.py | chrisbrake/PythonSandbox | 8cd2ea847676d6a300b55c560f49cd980f760b00 | [
"BSD-3-Clause"
] | 1 | 2018-10-19T17:35:01.000Z | 2018-10-19T17:35:01.000Z | tests/test_compress_string_in_memory.py | chrisbrake/PythonSandbox | 8cd2ea847676d6a300b55c560f49cd980f760b00 | [
"BSD-3-Clause"
] | null | null | null | tests/test_compress_string_in_memory.py | chrisbrake/PythonSandbox | 8cd2ea847676d6a300b55c560f49cd980f760b00 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from hypothesis import given, settings
from hypothesis.strategies import text
from sys import getsizeof
from compressStr import compress_string, decompress_string
class TestMyGzip(unittest.TestCase):
"""
Unit tests for the my_gzip module.
"""
@given(string=text())
@settings(max_ex... | 28.6 | 78 | 0.687937 | import unittest
from hypothesis import given, settings
from hypothesis.strategies import text
from sys import getsizeof
from compressStr import compress_string, decompress_string
class TestMyGzip(unittest.TestCase):
@given(string=text())
@settings(max_examples=100)
def test_combined(self, string):
... | true | true |
f7463443523d397e921c65423c1b8bc69d31ce42 | 3,908 | py | Python | Non-React Stuff/alexa/lambda/skill_env/ask_sdk_model/interfaces/geolocation/altitude.py | ReciPull/reciprogram | b8c7e4610f95c5beafad3c9880fc5beceec523e7 | [
"MIT"
] | 1 | 2019-09-16T19:13:13.000Z | 2019-09-16T19:13:13.000Z | Non-React Stuff/alexa/lambda/skill_env/ask_sdk_model/interfaces/geolocation/altitude.py | ReciPull/reciprogram | b8c7e4610f95c5beafad3c9880fc5beceec523e7 | [
"MIT"
] | 5 | 2021-03-09T03:30:14.000Z | 2022-02-26T10:42:17.000Z | alexa/reciPullLambda/ask_sdk_model/interfaces/geolocation/altitude.py | ReciPull/recipull.github.io | e6b800af02658bb7948297c4ddc1b7af6d978839 | [
"MIT"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 33.982609 | 108 | 0.614893 |
import pprint
import re
import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional
from datetime import datetime
class Altitude(object):
deserialized_types = {
'altitude_in_meters': 'float',
'accuracy_in_meters': 'floa... | true | true |
f74634f6d834e3416a312a3b1d3e86102db1d471 | 13,687 | py | Python | pymatgen/util/provenance.py | frssp/pymatgen | bdd977f065b66191557c7398b31a1571bc541fdb | [
"MIT"
] | 5 | 2019-04-11T20:57:38.000Z | 2021-12-01T05:00:42.000Z | pymatgen/util/provenance.py | frssp/pymatgen | bdd977f065b66191557c7398b31a1571bc541fdb | [
"MIT"
] | null | null | null | pymatgen/util/provenance.py | frssp/pymatgen | bdd977f065b66191557c7398b31a1571bc541fdb | [
"MIT"
] | 3 | 2019-10-14T19:47:34.000Z | 2020-07-02T08:10:45.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
import sys
import re
import datetime
from collections import namedtuple
import json
from six.moves import map, cStringIO
from six import string_types
from monty.json i... | 37.914127 | 79 | 0.582597 |
from __future__ import unicode_literals
import sys
import re
import datetime
from collections import namedtuple
import json
from six.moves import map, cStringIO
from six import string_types
from monty.json import MontyDecoder, MontyEncoder
from monty.string import remove_non_ascii
from pymatgen.core.structure i... | true | true |
f746354c8bc97f12b0e70462cad6ce3a683e32d9 | 14,735 | py | Python | weather_class.py | RickyMexx/ML-weather | 6d0a1b718b7b946ebb0c5df6ae990de9724ca5a0 | [
"Apache-2.0"
] | null | null | null | weather_class.py | RickyMexx/ML-weather | 6d0a1b718b7b946ebb0c5df6ae990de9724ca5a0 | [
"Apache-2.0"
] | null | null | null | weather_class.py | RickyMexx/ML-weather | 6d0a1b718b7b946ebb0c5df6ae990de9724ca5a0 | [
"Apache-2.0"
] | null | null | null | # *************** SETTINGS *************** #
MODEL_NAME = 'VGG16-TL'
BATCH_SIZE = 6
EPOCHS = 100
EXIF_FLAG = 0 # Set on 1 if the program is running for the first time with a dataset D, 0 otherwise.
MODELS_DIR = 'models/'
trainingset = "Train_New/"
testset1 = "Test_New/"
testset2 = "Weather_Testset/"
blindtest = "Bli... | 34.267442 | 122 | 0.612827 | MODEL_NAME = 'VGG16-TL'
BATCH_SIZE = 6
EPOCHS = 100
EXIF_FLAG = 0
MODELS_DIR = 'models/'
trainingset = "Train_New/"
testset1 = "Test_New/"
testset2 = "Weather_Testset/"
blindtest = "BlindTest/"
mytestset = "MyTestSet/"
imgstype = "*/*.jpg"
csv_file = '1743168.csv'
img_w = 136
img_h = 136
import tensorflow as tf... | true | true |
f7463705b85deb5e40fa3c6ea526af21d0c215db | 18,952 | py | Python | trax/supervised/trainer_lib_test.py | pkozakowski/trax | 31215c378017347e0b66ba51c37cd3cbedf60b17 | [
"Apache-2.0"
] | null | null | null | trax/supervised/trainer_lib_test.py | pkozakowski/trax | 31215c378017347e0b66ba51c37cd3cbedf60b17 | [
"Apache-2.0"
] | null | null | null | trax/supervised/trainer_lib_test.py | pkozakowski/trax | 31215c378017347e0b66ba51c37cd3cbedf60b17 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Trax 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 a... | 32.067682 | 113 | 0.64732 |
import functools
import os
from absl.testing import absltest
from absl.testing import parameterized
from jax import test_util
from jax.config import config
from jax.lib import xla_bridge
import tensorflow.compat.v2 as tf
from trax import fastmath
from trax import layers as tl
from trax import models
... | true | true |
f746380c9e6babb6ad16bd75200d914d0728130a | 570 | py | Python | modules/test/test_wuvt.py | shardulc/phenny | 950a247cc9f3335e671d7c68ddbae6abdca1c9db | [
"EFL-2.0"
] | null | null | null | modules/test/test_wuvt.py | shardulc/phenny | 950a247cc9f3335e671d7c68ddbae6abdca1c9db | [
"EFL-2.0"
] | null | null | null | modules/test/test_wuvt.py | shardulc/phenny | 950a247cc9f3335e671d7c68ddbae6abdca1c9db | [
"EFL-2.0"
] | null | null | null | """
test_wuvt.py - tests for the wuvt module
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
"""
import re
import unittest
from mock import MagicMock
from modules import wuvt
from web import catch_timeout
@catch_timeout
class TestWuvt(unittest.TestCase):
def setUp(self):
self.phenny = MagicMock()
... | 22.8 | 63 | 0.664912 | import re
import unittest
from mock import MagicMock
from modules import wuvt
from web import catch_timeout
@catch_timeout
class TestWuvt(unittest.TestCase):
def setUp(self):
self.phenny = MagicMock()
@catch_timeout
def test_wuvt(self):
wuvt.wuvt(self.phenny, None)
out = self.phe... | true | true |
f7463ae1524cfa45817e7c26efac69fb7460cdbb | 1,126 | py | Python | 30 Days of Code/day24_more_linked_lists.py | quqixun/Hackerrank_Python | 024084a5a77878ce2b4b99d731be28b221f58e41 | [
"MIT"
] | 1 | 2018-11-12T01:48:22.000Z | 2018-11-12T01:48:22.000Z | 30 Days of Code/day24_more_linked_lists.py | quqixun/Hackerrank_Python | 024084a5a77878ce2b4b99d731be28b221f58e41 | [
"MIT"
] | null | null | null | 30 Days of Code/day24_more_linked_lists.py | quqixun/Hackerrank_Python | 024084a5a77878ce2b4b99d731be28b221f58e41 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Solution:
def insert(self, head, data):
p = Node(data)
if head is None:
head = p
elif head.next is None:
head.next = p
else:
start = head
... | 21.653846 | 49 | 0.525755 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Solution:
def insert(self, head, data):
p = Node(data)
if head is None:
head = p
elif head.next is None:
head.next = p
else:
start = head
... | true | true |
f7463d2fac9a8c36fcec7fb3b00aff253cdd4fbe | 2,741 | py | Python | libs/networks/builder.py | liyongsheng-tech/pkuseg | e5bd8a4f7e2589a3c132c291433abd3be5c69dba | [
"Apache-2.0"
] | 2 | 2020-02-03T13:33:23.000Z | 2020-05-13T07:24:37.000Z | libs/networks/builder.py | liyongsheng-tech/pkuseg | e5bd8a4f7e2589a3c132c291433abd3be5c69dba | [
"Apache-2.0"
] | null | null | null | libs/networks/builder.py | liyongsheng-tech/pkuseg | e5bd8a4f7e2589a3c132c291433abd3be5c69dba | [
"Apache-2.0"
] | null | null | null | import importlib
import torch
from torch import nn
from torch.nn import functional as F
from heads import FCNHead
class ModelBuilder(nn.Module):
def __init__(self, net_config, aux_config=None):
super(ModelBuilder, self).__init__()
num_classes = net_config['num_classes']
out_planes = int... | 28.257732 | 68 | 0.556731 | import importlib
import torch
from torch import nn
from torch.nn import functional as F
from heads import FCNHead
class ModelBuilder(nn.Module):
def __init__(self, net_config, aux_config=None):
super(ModelBuilder, self).__init__()
num_classes = net_config['num_classes']
out_planes = int... | true | true |
f7463d6a84bc7270044b8aa02b63f623251d1087 | 8,397 | py | Python | src/population.py | Eccsx/CVRP-Genetic-Tournament | 8b428ec8ef976489bd701e2d11253249fe46ff88 | [
"MIT"
] | null | null | null | src/population.py | Eccsx/CVRP-Genetic-Tournament | 8b428ec8ef976489bd701e2d11253249fe46ff88 | [
"MIT"
] | null | null | null | src/population.py | Eccsx/CVRP-Genetic-Tournament | 8b428ec8ef976489bd701e2d11253249fe46ff88 | [
"MIT"
] | null | null | null | from math import floor
from numpy import delete, fliplr
from itertools import chain
from random import random, sample
from copy import deepcopy
from chromosome import fitness, pmx, obx
from utils import create_shuffle_array
from genetic import POPULATION_SIZE, PROBABILITY_ELITISM, \
NUMBER_TOURNAMENT_SELECTION, CRO... | 28.272727 | 79 | 0.572705 | from math import floor
from numpy import delete, fliplr
from itertools import chain
from random import random, sample
from copy import deepcopy
from chromosome import fitness, pmx, obx
from utils import create_shuffle_array
from genetic import POPULATION_SIZE, PROBABILITY_ELITISM, \
NUMBER_TOURNAMENT_SELECTION, CRO... | true | true |
f7463d91867620389278280cba3c2424f7c4cd8b | 1,241 | py | Python | duo_client/accounts.py | Shoobx/duo_client_python | 3e1fa81073aa19a68197236b77a42c7a9cf17ff2 | [
"Apache-2.0"
] | null | null | null | duo_client/accounts.py | Shoobx/duo_client_python | 3e1fa81073aa19a68197236b77a42c7a9cf17ff2 | [
"Apache-2.0"
] | null | null | null | duo_client/accounts.py | Shoobx/duo_client_python | 3e1fa81073aa19a68197236b77a42c7a9cf17ff2 | [
"Apache-2.0"
] | null | null | null | """
Duo Security Accounts API reference client implementation.
<http://www.duosecurity.com/docs/accountsapi>
"""
import client
class Accounts(client.Client):
def get_child_accounts(self):
"""
Return a list of all child accounts of the integration's account.
"""
params = {}
... | 29.547619 | 73 | 0.489122 | import client
class Accounts(client.Client):
def get_child_accounts(self):
params = {}
response = self.json_api_call('POST',
'/accounts/v1/account/list',
params)
return response
def create_account(self, name):
... | true | true |
f7463e5c895ffa8076e2f5d973fb48afea709f68 | 9,101 | py | Python | docs/conf.py | Wh1t3Fox/CS547-Project | 55c60704a4cdced5131bec8784cd4712fd925676 | [
"MIT"
] | null | null | null | docs/conf.py | Wh1t3Fox/CS547-Project | 55c60704a4cdced5131bec8784cd4712fd925676 | [
"MIT"
] | null | null | null | docs/conf.py | Wh1t3Fox/CS547-Project | 55c60704a4cdced5131bec8784cd4712fd925676 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# PIR documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 13 20:02:20 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 32.159011 | 79 | 0.717723 |
import sys
import os
import shlex
extensions = []
templates_path = ['_templates']
source_suffix = ['.rst']
master_doc = 'index'
project = u'PIR'
copyright = u'2015, Craig West and Michael Kouremetis'
author = u'Craig West and Michael Kouremetis'
# |version| and |release|, also u... | true | true |
f7463ef1c588fb0dcb0adaec3d4247e196e26037 | 5,583 | py | Python | imf/tests/test_distributions.py | segasai/imf | 9a33b9e68b0af677dab86511e343d6099d9ea530 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | imf/tests/test_distributions.py | segasai/imf | 9a33b9e68b0af677dab86511e343d6099d9ea530 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | imf/tests/test_distributions.py | segasai/imf | 9a33b9e68b0af677dab86511e343d6099d9ea530 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | import numpy as np
import scipy.interpolate
from .. import distributions as D
np.random.seed(1)
def sampltest(distr, left=None, right=None, bounds=None):
# check that mean and stddev from the generated sample
# match what we get from integrating the PDF
def FF1(x):
return distr.pdf(x) * x
d... | 29.539683 | 88 | 0.535913 | import numpy as np
import scipy.interpolate
from .. import distributions as D
np.random.seed(1)
def sampltest(distr, left=None, right=None, bounds=None):
def FF1(x):
return distr.pdf(x) * x
def FF2(x):
return distr.pdf(x) * x**2
if left is None:
left = 0
if right ... | true | true |
f7463ff2558c9bd41bca5ff6fb1a5c665f095f51 | 14,935 | py | Python | arsrl/ars.py | Seanny123/ARS | f445a870feac13286fe2d8b14ee508f789c9ef7d | [
"BSD-2-Clause"
] | null | null | null | arsrl/ars.py | Seanny123/ARS | f445a870feac13286fe2d8b14ee508f789c9ef7d | [
"BSD-2-Clause"
] | null | null | null | arsrl/ars.py | Seanny123/ARS | f445a870feac13286fe2d8b14ee508f789c9ef7d | [
"BSD-2-Clause"
] | null | null | null | '''
Parallel implementation of the Augmented Random Search method.
Horia Mania --- hmania@berkeley.edu
Aurelia Guy
Benjamin Recht
'''
import os
import socket
import time
import gym
import numpy as np
import ray
from arsrl import utils, logz, optimizers
from arsrl.policies import LinearPolicy
from arsrl.shared_noise ... | 36.25 | 104 | 0.584064 |
import os
import socket
import time
import gym
import numpy as np
import ray
from arsrl import utils, logz, optimizers
from arsrl.policies import LinearPolicy
from arsrl.shared_noise import SharedNoiseTable, create_shared_noise
@ray.remote
class Worker(object):
def __init__(self, env_seed,
en... | true | true |
f7464013eeebcdb4986304f0e5c49ade64cbb57c | 113 | py | Python | commit_checker/tests/__main__.py | hrome/commit_checker | b212cb9cf6728b6bb9006097fa8211e9a06537b8 | [
"MIT"
] | 2 | 2017-11-24T12:28:50.000Z | 2018-12-28T10:13:40.000Z | commit_checker/tests/functional/__main__.py | hrome/commit_checker | b212cb9cf6728b6bb9006097fa8211e9a06537b8 | [
"MIT"
] | null | null | null | commit_checker/tests/functional/__main__.py | hrome/commit_checker | b212cb9cf6728b6bb9006097fa8211e9a06537b8 | [
"MIT"
] | null | null | null | import os
from nose.core import TestProgram
os.chdir(os.path.abspath(os.path.dirname(__file__)))
TestProgram()
| 16.142857 | 52 | 0.787611 | import os
from nose.core import TestProgram
os.chdir(os.path.abspath(os.path.dirname(__file__)))
TestProgram()
| true | true |
f7464034718df8a60b7d3a7755fdaeb277227ff4 | 7,900 | py | Python | synthesizer/audio.py | vitek2577/Multi-Tacotron-Voice-Cloning-GST | a47d7f8412add19f7a154d70cc55698e2bb0a6da | [
"MIT"
] | 1 | 2020-04-12T08:03:11.000Z | 2020-04-12T08:03:11.000Z | synthesizer/audio.py | vitek2577/Multi-Tacotron-Voice-Cloning-GST | a47d7f8412add19f7a154d70cc55698e2bb0a6da | [
"MIT"
] | null | null | null | synthesizer/audio.py | vitek2577/Multi-Tacotron-Voice-Cloning-GST | a47d7f8412add19f7a154d70cc55698e2bb0a6da | [
"MIT"
] | 1 | 2020-04-12T07:30:59.000Z | 2020-04-12T07:30:59.000Z | import librosa
import librosa.filters
import numpy as np
import tensorflow as tf
from scipy import signal
from scipy.io import wavfile
def load_wav(path, sr):
return librosa.core.load(path, sr=sr)[0]
def save_wav(wav, path, sr):
wav *= 32767 / max(0.01, np.max(np.abs(wav)))
#proposed by @dsmiller
wav... | 37.980769 | 136 | 0.671139 | import librosa
import librosa.filters
import numpy as np
import tensorflow as tf
from scipy import signal
from scipy.io import wavfile
def load_wav(path, sr):
return librosa.core.load(path, sr=sr)[0]
def save_wav(wav, path, sr):
wav *= 32767 / max(0.01, np.max(np.abs(wav)))
wavfile.write(path, sr, w... | true | true |
f746409aadfc9ec61b870cc2f1b6a4dcaafbdf13 | 27,431 | py | Python | pandas/tseries/tools.py | tacaswell/pandas | 81c57e20da278494dfebc2f1043f5ff361a234f3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-28T13:48:34.000Z | 2019-04-28T13:48:34.000Z | pandas/tseries/tools.py | tacaswell/pandas | 81c57e20da278494dfebc2f1043f5ff361a234f3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/tseries/tools.py | tacaswell/pandas | 81c57e20da278494dfebc2f1043f5ff361a234f3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2021-02-20T14:17:15.000Z | 2021-02-20T14:17:15.000Z | from datetime import datetime, timedelta, time
import numpy as np
from collections import MutableMapping
import pandas.lib as lib
import pandas.tslib as tslib
from pandas.types.common import (_ensure_object,
is_datetime64_ns_dtype,
is_datetime64_dtype,... | 34.899491 | 79 | 0.567387 | from datetime import datetime, timedelta, time
import numpy as np
from collections import MutableMapping
import pandas.lib as lib
import pandas.tslib as tslib
from pandas.types.common import (_ensure_object,
is_datetime64_ns_dtype,
is_datetime64_dtype,... | true | true |
f746419d08b41ede9d1b4f9211822d4765fdfaf3 | 156,686 | py | Python | chb/mips/MIPSOpcode.py | psifertex/CodeHawk-Binary | 1711d7b16d32a2e9ffa9d22af483182b3f9ded77 | [
"MIT"
] | null | null | null | chb/mips/MIPSOpcode.py | psifertex/CodeHawk-Binary | 1711d7b16d32a2e9ffa9d22af483182b3f9ded77 | [
"MIT"
] | null | null | null | chb/mips/MIPSOpcode.py | psifertex/CodeHawk-Binary | 1711d7b16d32a2e9ffa9d22af483182b3f9ded77 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Access to the CodeHawk Binary Analyzer Analysis Results
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
# C... | 40.529229 | 101 | 0.565156 |
import chb.util.fileutil as UF
import chb.api.LinuxSyscalls as SC
import chb.mips.MIPSOpcodeBase as X
import chb.simulate.SimUtil as SU
import chb.simulate.SimSymbolicValue as SSV
import chb.simulate.SimValue as SV
mips_opcode_constructors = {
'add' : lambda x: MIPSAdd(*x),
'and'... | true | true |
f74641a56b99504347024e167afbc98719ef7b52 | 40,120 | py | Python | src/onelogin/saml2/utils.py | maykinmedia/python3-saml | e000b39ed0ce38270e6351ec6634e6b3a53bbc3d | [
"MIT"
] | null | null | null | src/onelogin/saml2/utils.py | maykinmedia/python3-saml | e000b39ed0ce38270e6351ec6634e6b3a53bbc3d | [
"MIT"
] | 1 | 2021-10-01T14:41:51.000Z | 2021-10-01T14:41:51.000Z | src/onelogin/saml2/utils.py | maykinmedia/python3-saml | e000b39ed0ce38270e6351ec6634e6b3a53bbc3d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" OneLogin_Saml2_Utils class
Copyright (c) 2010-2021 OneLogin, Inc.
MIT License
Auxiliary class of OneLogin's Python Toolkit.
"""
import base64
import warnings
from copy import deepcopy
import calendar
from datetime import datetime
from hashlib import sha1, sha256, sha384, sha512
from iso... | 35.789474 | 165 | 0.619392 |
import base64
import warnings
from copy import deepcopy
import calendar
from datetime import datetime
from hashlib import sha1, sha256, sha384, sha512
from isodate import parse_duration as duration_parser
import re
from textwrap import wrap
from functools import wraps
from uuid import uuid4
from xml.dom.minidom impo... | true | true |
f74641a5b08e7bfc833a89b717f43281e0c19e5c | 897 | py | Python | test/py/boolean/test11h.py | cvdlab/lar-cc | 7092965acf7c0c78a5fab4348cf2c2aa01c4b130 | [
"MIT",
"Unlicense"
] | 1 | 2016-09-20T04:48:12.000Z | 2016-09-20T04:48:12.000Z | test/py/boolean/test11h.py | Ahdhn/lar-cc | 7092965acf7c0c78a5fab4348cf2c2aa01c4b130 | [
"MIT",
"Unlicense"
] | 1 | 2018-02-20T21:57:07.000Z | 2018-02-21T07:18:11.000Z | test/py/boolean/test11h.py | Ahdhn/lar-cc | 7092965acf7c0c78a5fab4348cf2c2aa01c4b130 | [
"MIT",
"Unlicense"
] | 7 | 2016-11-04T10:47:42.000Z | 2018-04-10T17:32:50.000Z |
from larlib import *
""" Visualization of indices of the boundary triangulation """
V,[VV,EV,FV,CV] = larCuboids([1,1,1],True)
cubeGrid = Struct([(V,FV,EV)],"cubeGrid")
cubeGrids = Struct(2*[cubeGrid,t(1.5,1.5,0),r(0,0,PI/6)])
V,FV,EV = struct2lar(cubeGrids)
VIEW(EXPLODE(1.2,1.2,1.2)(MKPOLS((V,FV))))
V,CV,FV,EV,CF,... | 35.88 | 127 | 0.654404 |
from larlib import *
V,[VV,EV,FV,CV] = larCuboids([1,1,1],True)
cubeGrid = Struct([(V,FV,EV)],"cubeGrid")
cubeGrids = Struct(2*[cubeGrid,t(1.5,1.5,0),r(0,0,PI/6)])
V,FV,EV = struct2lar(cubeGrids)
VIEW(EXPLODE(1.2,1.2,1.2)(MKPOLS((V,FV))))
V,CV,FV,EV,CF,CE,COE,FE = thePartition(V,FV,EV)
cellLengths = AA(len)(CF)
bo... | true | true |
f74642a2a6f3111cde6d0ca1929794acd601c5dd | 814 | py | Python | megnet/utils/tests/test_general.py | Lalf-Klein/megnet | e3977ce372b74380268659e964c85bf59c1aac34 | [
"BSD-3-Clause"
] | 1 | 2019-10-04T09:39:16.000Z | 2019-10-04T09:39:16.000Z | megnet/utils/tests/test_general.py | Lalf-Klein/megnet | e3977ce372b74380268659e964c85bf59c1aac34 | [
"BSD-3-Clause"
] | null | null | null | megnet/utils/tests/test_general.py | Lalf-Klein/megnet | e3977ce372b74380268659e964c85bf59c1aac34 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import numpy as np
from megnet.utils.general import expand_1st, to_list, fast_label_binarize
class TestGeneralUtils(unittest.TestCase):
def test_expand_dim(self):
x = np.array([1, 2, 3])
self.assertListEqual(list(expand_1st(x).shape), [1, 3])
def test_to_list(self):
x... | 27.133333 | 73 | 0.589681 | import unittest
import numpy as np
from megnet.utils.general import expand_1st, to_list, fast_label_binarize
class TestGeneralUtils(unittest.TestCase):
def test_expand_dim(self):
x = np.array([1, 2, 3])
self.assertListEqual(list(expand_1st(x).shape), [1, 3])
def test_to_list(self):
x... | true | true |
f74642f8c5d44381bccf8a928734777c60abd7ba | 394 | py | Python | prado/datasets/constants.py | suflaj/prado | 844ff63cfab1198e717cf72c72ec74caf9f4888d | [
"Apache-2.0"
] | 2 | 2021-03-31T18:34:31.000Z | 2021-07-15T09:11:48.000Z | prado/datasets/constants.py | suflaj/prado | 844ff63cfab1198e717cf72c72ec74caf9f4888d | [
"Apache-2.0"
] | null | null | null | prado/datasets/constants.py | suflaj/prado | 844ff63cfab1198e717cf72c72ec74caf9f4888d | [
"Apache-2.0"
] | null | null | null | import re
DECORATOR_GROUP_PATTERN = r"([^\w\d\s\']+)"
DECORATOR_GROUP_REGEX = re.compile(DECORATOR_GROUP_PATTERN)
DOUBLE_QUOTE_PATTERN = r"\""
DOUBLE_QUOTE_REGEX = re.compile(DOUBLE_QUOTE_PATTERN)
QUOTED_TEXT_PATTERN = r"\'([^\"\'\s]+)\'"
QUOTED_TEXT_REGEX = re.compile(QUOTED_TEXT_PATTERN)
MEANINGLESS_PATTERN = r"^... | 30.307692 | 59 | 0.733503 | import re
DECORATOR_GROUP_PATTERN = r"([^\w\d\s\']+)"
DECORATOR_GROUP_REGEX = re.compile(DECORATOR_GROUP_PATTERN)
DOUBLE_QUOTE_PATTERN = r"\""
DOUBLE_QUOTE_REGEX = re.compile(DOUBLE_QUOTE_PATTERN)
QUOTED_TEXT_PATTERN = r"\'([^\"\'\s]+)\'"
QUOTED_TEXT_REGEX = re.compile(QUOTED_TEXT_PATTERN)
MEANINGLESS_PATTERN = r"^... | true | true |
f746443516aecfc2df8df7fe43126f74827cdeb8 | 1,879 | py | Python | apps/web/anandtech/anandtech_pages.py | timo95/knausj_talon | 735b6fda064b12c832fce2ba4ca8e0186e7db48a | [
"MIT"
] | 1 | 2021-09-08T05:45:03.000Z | 2021-09-08T05:45:03.000Z | apps/web/anandtech/anandtech_pages.py | timo95/knausj_talon | 735b6fda064b12c832fce2ba4ca8e0186e7db48a | [
"MIT"
] | null | null | null | apps/web/anandtech/anandtech_pages.py | timo95/knausj_talon | 735b6fda064b12c832fce2ba4ca8e0186e7db48a | [
"MIT"
] | null | null | null | from talon import Context, actions, scope
# Main page (subpath 2)
# /[Page/<page>]
ctx = Context()
ctx.matches = r"""
app: anandtech
browser.path: /^\/(Page\/\d+\/?)?$/
"""
ctx.tags = ["user.pages"]
@ctx.action_class("user")
class UserActions:
# user.pages
def page_current():
tokens = scope.get("brows... | 28.907692 | 71 | 0.597126 | from talon import Context, actions, scope
ctx = Context()
ctx.matches = r"""
app: anandtech
browser.path: /^\/(Page\/\d+\/?)?$/
"""
ctx.tags = ["user.pages"]
@ctx.action_class("user")
class UserActions:
def page_current():
tokens = scope.get("browser.path").rstrip("/").split("/")
return int... | true | true |
f74645c19a1e74a465669a231fb077330b4d64f6 | 23,649 | py | Python | src/solutions/common/models/loyalty.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/models/loyalty.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/models/loyalty.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 36.439137 | 186 | 0.729756 |
import urllib
from google.appengine.api import images
from google.appengine.ext import db, blobstore
from rogerthat.bizz.gcs import get_serving_url
from rogerthat.dal import parent_key, parent_key_unsafe
from rogerthat.rpc import users
from rogerthat.utils import now
from rogerthat.utils.app import c... | true | true |
f74646ee02291bfaa3082692f130646578db9f51 | 16,332 | py | Python | sdk/python/v1beta1/kubeflow/katib/api/katib_client.py | oneconvergence/katib | 16e0574647ace79ccedd248d072c77139feab5e5 | [
"Apache-2.0"
] | 1,177 | 2018-04-23T08:45:19.000Z | 2022-03-23T19:09:13.000Z | sdk/python/v1beta1/kubeflow/katib/api/katib_client.py | oneconvergence/katib | 16e0574647ace79ccedd248d072c77139feab5e5 | [
"Apache-2.0"
] | 1,791 | 2018-04-20T00:10:17.000Z | 2022-03-31T18:18:36.000Z | sdk/python/v1beta1/kubeflow/katib/api/katib_client.py | oneconvergence/katib | 16e0574647ace79ccedd248d072c77139feab5e5 | [
"Apache-2.0"
] | 349 | 2018-04-20T01:03:28.000Z | 2022-03-30T16:11:35.000Z | # Copyright 2021 The Kubeflow 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 in ... | 38.248244 | 103 | 0.601763 |
import multiprocessing
from kubeflow.katib import V1beta1Experiment
from kubeflow.katib import V1beta1Trial
from kubeflow.katib.api_client import ApiClient
from kubeflow.katib.constants import constants
from kubeflow.katib.utils import utils
from kubernetes import client, config
class KatibClient(objec... | true | true |
f746475b55103d17017ae1c963104242a624369b | 2,392 | py | Python | client_example.py | izevg/ProstoPyPleer | d6a8d0411991d91771d3dc520f032c13ac017571 | [
"MIT"
] | 2 | 2015-03-02T11:55:13.000Z | 2015-04-13T14:56:26.000Z | client_example.py | izevg/ProstoPyPleer | d6a8d0411991d91771d3dc520f032c13ac017571 | [
"MIT"
] | null | null | null | client_example.py | izevg/ProstoPyPleer | d6a8d0411991d91771d3dc520f032c13ac017571 | [
"MIT"
] | null | null | null | '''
The MIT License (MIT)
Copyright (c) 2014 Eugene Zhukov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... | 34.666667 | 105 | 0.743729 |
import pleer
from vars import debug
my_pleer = pleer.Pleer()
app_id = 'Insert here your App ID'
app_secret_key = 'Insert here your App Secret Key'
query = {
'query': 'artist:Red hot chilli peppers',
'quality': 'best'
}
my_pleer.token = my_pleer.get_access_token(app_id, app_secret_key)
if de... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.