hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7398e5561c13bdbde44990f510ac2fe3a8dfe0c5 | 5,175 | py | Python | src/rbx2/rbx2_tasks/nodes/random_patrol_smach.py | fujy/ROS-Project | b5e3b43c5eb5d3c1d984648f0f61710eea3a1bb8 | [
"MIT"
] | 9 | 2017-08-22T13:07:13.000Z | 2021-07-13T10:02:29.000Z | src/rbx2/rbx2_tasks/nodes/random_patrol_smach.py | vcdanda/ROS-Turtlebot2 | f24356486f55933d52e25a81715f1571aace0224 | [
"MIT"
] | 1 | 2017-12-14T06:46:58.000Z | 2017-12-14T06:46:58.000Z | src/rbx2/rbx2_tasks/nodes/random_patrol_smach.py | vcdanda/ROS-Turtlebot2 | f24356486f55933d52e25a81715f1571aace0224 | [
"MIT"
] | 5 | 2018-02-07T14:09:28.000Z | 2021-01-08T20:41:52.000Z | #!/usr/bin/env python
""" random_patrol_smach.py - Version 1.0 2013-04-12
Control a robot to patrol four waypoints chosen at random
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2014 Patrick Goebel. All rights reserved.
This program is free software; you can redistribute it... | 36.964286 | 108 | 0.627826 |
eb1d6d7b51e344b93fdcff4c7a4911e62c00639a | 7,721 | py | Python | code/models/backbone/ResNet_Dilated.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | 1 | 2021-12-20T07:20:25.000Z | 2021-12-20T07:20:25.000Z | code/models/backbone/ResNet_Dilated.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | code/models/backbone/ResNet_Dilated.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
# try:
# from encoding.nn import SyncBatchNorm
# _BATCH_NORM = SyncBatchNorm
# except:
# _BATCH_NORM = nn.BatchNorm2d
_BOTTLENECK_EXPAN... | 35.417431 | 119 | 0.563787 |
578c96719f4f9d1b222679692854da507ca2dace | 1,278 | py | Python | toontown/classicchars/DistributedSuperGoofy.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 99 | 2019-11-02T22:25:00.000Z | 2022-02-03T03:48:00.000Z | toontown/classicchars/DistributedSuperGoofy.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 42 | 2019-11-03T05:31:08.000Z | 2022-03-16T22:50:32.000Z | toontown/classicchars/DistributedSuperGoofy.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 57 | 2019-11-03T07:47:37.000Z | 2022-03-22T00:41:49.000Z | from pandac.PandaModules import *
from . import DistributedCCharBase
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.classicchars import DistributedGoofySpeedway
from . import CharStateDatas
from toontown.toonbase import ToontownGlob... | 47.333333 | 274 | 0.758216 |
e28408584caa42c156cf02d360f13a7a7a8588f1 | 1,642 | py | Python | tests/integration/test_settings.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | tests/integration/test_settings.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | tests/integration/test_settings.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | from django.test import TestCase
from django.template import loader, TemplateDoesNotExist
import izi
class TestIZICoreAppsList(TestCase):
def test_includes_izi_itself(self):
core_apps = izi.IZI_CORE_APPS
self.assertTrue('izi' in core_apps)
def test_can_be_retrieved_through_fn(self):
... | 32.84 | 66 | 0.68514 |
50b4e20184dc272167160d0754533c31bc405b5a | 1,618 | py | Python | tests/test_docs.py | anosillus/cookiecutter-poetry | 11b2e238e0c2c61d0a7cc6e199787b1bd7e2f413 | [
"MIT"
] | 6 | 2021-01-07T15:39:49.000Z | 2022-03-25T10:06:45.000Z | tests/test_docs.py | anosillus/cookiecutter-poetry | 11b2e238e0c2c61d0a7cc6e199787b1bd7e2f413 | [
"MIT"
] | 16 | 2020-02-24T11:42:21.000Z | 2021-08-31T14:22:21.000Z | tests/test_docs.py | anosillus/cookiecutter-poetry | 11b2e238e0c2c61d0a7cc6e199787b1bd7e2f413 | [
"MIT"
] | 14 | 2020-05-17T15:59:01.000Z | 2022-03-12T03:19:17.000Z | import json
import re
from pathlib import Path
from typing import List, Tuple
import pytest
# @pytest.mark.datafiles("cookiecutter.json", relative_to=ROOT_DIR)
from tests.utils import PROJECT_ROOT_DIR
def get_prompts_from_cookiecutter_json() -> List[str]:
with open(str((PROJECT_ROOT_DIR / "cookiecutter.json")))... | 30.528302 | 83 | 0.689122 |
f3dbb6bc040c7246d1b91b5b095ec17facf1fb22 | 10,103 | py | Python | data/external/repositories/132822/kaggle-driver-telematics-master/weights.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/132822/kaggle-driver-telematics-master/weights.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/132822/kaggle-driver-telematics-master/weights.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | import model_def
import model_run
### - not run on train
#-- - ran on train, small influence
#== - ran on train, not run on test because slow
MODELS = [
#(52, model_run.get_data_accel, model_def.Model_ABC1, 1),
#(53, model_run.get_data_accel, model_def.Model_ABC2, 1),
#(1, model_run.get_data_accel, model_def.Mod... | 56.441341 | 574 | 0.761754 |
ba4e0837688460e1c031c099addaa3858768bc9f | 5,349 | py | Python | nmpc/scripts/state_machine.py | MikeK4y/px4_control | 3b91e2ab9a5c711f63ced680789629f67450fe5f | [
"MIT"
] | null | null | null | nmpc/scripts/state_machine.py | MikeK4y/px4_control | 3b91e2ab9a5c711f63ced680789629f67450fe5f | [
"MIT"
] | null | null | null | nmpc/scripts/state_machine.py | MikeK4y/px4_control | 3b91e2ab9a5c711f63ced680789629f67450fe5f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import rospy as rp
import numpy as np
import quaternion
import threading
from px4_control_msgs.msg import DroneStateMarker, Setpoint, Trajectory
class StateMachineNode():
"""
Simple state machine that checks the state and when the target is found it
sends a setpoint relative to it... | 40.522727 | 88 | 0.539727 |
5fca119c14e835095ad3954646a6f2572d361595 | 46,755 | py | Python | pandas/tseries/period.py | clarkfitzg/pandas | a71ede374a019ea40321d8c1cfd13258b45ff58d | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2019-05-21T21:07:03.000Z | 2019-05-21T21:07:03.000Z | pandas/tseries/period.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tseries/period.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # pylint: disable=E1101,E1103,W0232
import operator
from datetime import datetime, date
import numpy as np
from pandas.core.base import PandasObject
from pandas.tseries.frequencies import (get_freq_code as _gfc,
_month_numbers, FreqGroup)
from pandas.tseries.index import Dateti... | 34.943946 | 97 | 0.516758 |
3277682b66abd00dd437f466d372169960c2e9e1 | 2,761 | py | Python | Lib/site-packages/dill/tests/test_diff.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/dill/tests/test_diff.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/dill/tests/test_diff.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2022 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/di... | 24.873874 | 77 | 0.609924 |
40c0aa47d12c7de182bb29f7e797cc85b90f8834 | 3,350 | py | Python | examples/test_rossler.py | Tarheel-Formal-Methods/kaa-optimize | 35fe7b580df3b5efe7de9314b821c257f68d74bf | [
"MIT"
] | null | null | null | examples/test_rossler.py | Tarheel-Formal-Methods/kaa-optimize | 35fe7b580df3b5efe7de9314b821c257f68d74bf | [
"MIT"
] | 2 | 2020-12-11T17:34:46.000Z | 2020-12-11T21:43:13.000Z | examples/test_rossler.py | Tarheel-Formal-Methods/kaa-optimize | 35fe7b580df3b5efe7de9314b821c257f68d74bf | [
"MIT"
] | 1 | 2020-12-11T17:31:16.000Z | 2020-12-11T17:31:16.000Z | from kaa.reach import ReachSet
from kaa.plotutil import Plot
from models.rossler import Rossler, Rossler_UnitBox
from kaa.trajectory import Traj
from kaa.experi_init import *
from kaa.timer import Timer
def test_sapo_Rossler():
model = Rossler()
num_steps = 150
experi_input = dict(model=model, #Encompass... | 31.018519 | 128 | 0.632537 |
fe042ed38e4c5060ab51fc067de2f04a765c24ea | 11,833 | py | Python | quidel_covidtest/delphi_quidel_covidtest/pull.py | qx-teo/covidcast-indicators | 6eabe62748a206b5e6d65f9e11c65ef1c76cdb0a | [
"MIT"
] | null | null | null | quidel_covidtest/delphi_quidel_covidtest/pull.py | qx-teo/covidcast-indicators | 6eabe62748a206b5e6d65f9e11c65ef1c76cdb0a | [
"MIT"
] | 5 | 2021-08-18T17:33:13.000Z | 2021-08-19T15:09:22.000Z | quidel_covidtest/delphi_quidel_covidtest/pull.py | qx-teo/covidcast-indicators | 6eabe62748a206b5e6d65f9e11c65ef1c76cdb0a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Collect and process Quidel export files."""
from os.path import join
import os
from datetime import datetime, timedelta
import boto3
import pandas as pd
import numpy as np
def get_from_s3(start_date, end_date, bucket):
"""
Get raw data from aws s3 bucket.
Args:
start_da... | 36.862928 | 97 | 0.62444 |
bb0bf7b1e87fce84babcda860dc288ec08f6f188 | 731 | py | Python | proxy/http/exception/__init__.py | zanachka/proxy.py | ab5c155213115d1664ce429ec155184d16ca9be6 | [
"BSD-3-Clause"
] | null | null | null | proxy/http/exception/__init__.py | zanachka/proxy.py | ab5c155213115d1664ce429ec155184d16ca9be6 | [
"BSD-3-Clause"
] | null | null | null | proxy/http/exception/__init__.py | zanachka/proxy.py | ab5c155213115d1664ce429ec155184d16ca9be6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... | 27.074074 | 86 | 0.725034 |
0180f2960398af8e182f2162cc9988bb4e192dbb | 2,811 | py | Python | Examples/Message Types/DirectMESSAGE/main_send_file.py | davidhozic/Discord-Shilling-Bot | 9649344804bf19cdd1a608cecae34939e19af841 | [
"MIT"
] | null | null | null | Examples/Message Types/DirectMESSAGE/main_send_file.py | davidhozic/Discord-Shilling-Bot | 9649344804bf19cdd1a608cecae34939e19af841 | [
"MIT"
] | 1 | 2022-02-13T21:35:57.000Z | 2022-02-13T21:36:11.000Z | Examples/Message Types/DirectMESSAGE/main_send_file.py | davidhozic/Discord-Shilling-Framework | 9649344804bf19cdd1a608cecae34939e19af841 | [
"MIT"
] | null | null | null | import framework, secret
from framework import discord
############################################################################################
# GUILD MESSAGES DEFINITION #
###########################################################################... | 65.372093 | 168 | 0.421558 |
549224fa616b73372bc462cbf4c5129b39b39bd5 | 474 | py | Python | res/paid-origin/Lecture3/DoYourThing.py | mori-c/cs106a | b7764d9dec1d3abb6968ded265a0c4c4d96920c5 | [
"MIT"
] | 1 | 2020-04-13T18:38:26.000Z | 2020-04-13T18:38:26.000Z | res/paid-origin/Lecture3/DoYourThing.py | mori-c/cs106a | b7764d9dec1d3abb6968ded265a0c4c4d96920c5 | [
"MIT"
] | null | null | null | res/paid-origin/Lecture3/DoYourThing.py | mori-c/cs106a | b7764d9dec1d3abb6968ded265a0c4c4d96920c5 | [
"MIT"
] | null | null | null | from karel.stanfordkarel import *
def main():
move()
while beepers_present():
pick_beeper()
move()
putBeeper()
putBeeper()
turn_around()
move()
turn_around()
move()
while beepers_present():
pick_beeper()
turn_around()
move... | 16.928571 | 33 | 0.514768 |
e2f85a25ccef97e544c1b7f41fc37be2520cf6b7 | 5,230 | py | Python | test/unit_tests.py | djsilva99/heatrapy | 91902e8fd9e216638855856ed7c0757bbade11c2 | [
"MIT"
] | 31 | 2019-03-21T15:41:18.000Z | 2022-03-21T15:41:49.000Z | test/unit_tests.py | danieljosesilva/heatrapy | 5d1297d67ea237b2c6537133ace8c1f4a6091518 | [
"MIT"
] | 9 | 2020-09-01T08:50:52.000Z | 2022-03-12T00:55:53.000Z | test/unit_tests.py | djsilva99/heatrapy | 91902e8fd9e216638855856ed7c0757bbade11c2 | [
"MIT"
] | 7 | 2020-03-10T19:34:32.000Z | 2022-03-28T01:12:59.000Z | """unit_tests.
Contains the unit tests for the heatrapy modules
"""
import unittest
from .. import heatrapy as htp
class SingleObjects1D(unittest.TestCase):
"""Test all single_objects components."""
def test_implicit_general(self):
"""Test singleObject with the implicit_general solver."""
s... | 40.859375 | 80 | 0.635946 |
fb6988e06c56e0bfbeb295df47a0d57e73bab159 | 986 | py | Python | eclcli/compute/v2/hypervisor_stats.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 32 | 2016-08-31T04:12:40.000Z | 2020-12-11T04:49:57.000Z | eclcli/compute/v2/hypervisor_stats.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 27 | 2016-09-06T07:50:36.000Z | 2021-09-14T09:46:03.000Z | eclcli/compute/v2/hypervisor_stats.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 24 | 2016-09-02T01:09:09.000Z | 2021-01-19T09:14:16.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | 32.866667 | 77 | 0.739351 |
4be27f649bc478347f17eb5baf3b44e34405cc43 | 1,702 | py | Python | deep-learning-for-image-processing-master/pytorch_classification/Test8_densenet/predict.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | 1 | 2021-07-10T14:16:48.000Z | 2021-07-10T14:16:48.000Z | deep-learning-for-image-processing-master/pytorch_classification/Test8_densenet/predict.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | null | null | null | deep-learning-for-image-processing-master/pytorch_classification/Test8_densenet/predict.py | zpwithme/zzzzpppp | 0f5df647f1e9d6cb8c01b3fc7df25ee543714af3 | [
"MIT"
] | 1 | 2021-07-10T14:16:51.000Z | 2021-07-10T14:16:51.000Z | import os
import json
import torch
from PIL import Image
from torchvision import transforms
import matplotlib.pyplot as plt
from model import densenet121
def main():
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
data_transform = transforms.Compose(
[transforms.Resize(256),... | 28.847458 | 84 | 0.639248 |
e19fe016cc942d75044a04f4e954aaa10202b0d0 | 22,288 | py | Python | python/dask_cudf/dask_cudf/tests/test_core.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | 1 | 2021-12-17T19:28:00.000Z | 2021-12-17T19:28:00.000Z | python/dask_cudf/dask_cudf/tests/test_core.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | 1 | 2021-03-10T20:28:23.000Z | 2021-03-25T15:58:47.000Z | python/dask_cudf/dask_cudf/tests/test_core.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION.
import random
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import dask
from dask import dataframe as dd
from dask.dataframe.core import make_meta, meta_nonempty
from dask.utils import M
import cudf
import dask_cudf as dgd
def test_from_cudf():
... | 28.574359 | 79 | 0.611181 |
af677f2bdf1ae299ac4d230ae4febad9e54e8c40 | 1,280 | py | Python | setup.py | Guillemdb/flake8-per-file-ignores | ab0d3d44764ea834211ca2806bef8694c80cab87 | [
"MIT"
] | null | null | null | setup.py | Guillemdb/flake8-per-file-ignores | ab0d3d44764ea834211ca2806bef8694c80cab87 | [
"MIT"
] | null | null | null | setup.py | Guillemdb/flake8-per-file-ignores | ab0d3d44764ea834211ca2806bef8694c80cab87 | [
"MIT"
] | null | null | null | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as file:
long_description = file.read()
setup(
name='flake8-per-file-ignores',
version='0.8.1',
url='https://github.com/snoack/flake8-per-file-ignores',
description='Ignore individual error codes... | 32.820513 | 72 | 0.635938 |
40ebf7a61213eb6b6e82d64ba98fb1130fc2087a | 13,670 | py | Python | Tests/ML/util.py | johngulliver/InnerEye-DeepLearning | 5b7d57120928483837ae0ef021f35932efac775d | [
"MIT"
] | null | null | null | Tests/ML/util.py | johngulliver/InnerEye-DeepLearning | 5b7d57120928483837ae0ef021f35932efac775d | [
"MIT"
] | null | null | null | Tests/ML/util.py | johngulliver/InnerEye-DeepLearning | 5b7d57120928483837ae0ef021f35932efac775d | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 44.967105 | 120 | 0.701317 |
aa1dbca2c2a5c1bff89f21d8af60b7b9c32f6908 | 452 | py | Python | data/scripts/templates/object/static/item/shared_wp_mle_lance_staff_wood_s02.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/static/item/shared_wp_mle_lance_staff_wood_s02.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/static/item/shared_wp_mle_lance_staff_wood_s02.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/item/shared_wp_mle_lance_staff_wood_s02.iff"
result.attribute_template_... | 26.588235 | 78 | 0.730088 |
56708965d6fec056a956b940dd9b227f3d8fbfd4 | 8,820 | py | Python | dist_train/workers/baseline.py | victorcampos7/edl | ffdf23d4e102ca7d69a1408bafa267b0c7d8bfa0 | [
"MIT"
] | 30 | 2020-02-16T15:52:59.000Z | 2022-03-22T10:54:54.000Z | dist_train/workers/baseline.py | imatge-upc/edl | ffdf23d4e102ca7d69a1408bafa267b0c7d8bfa0 | [
"MIT"
] | null | null | null | dist_train/workers/baseline.py | imatge-upc/edl | ffdf23d4e102ca7d69a1408bafa267b0c7d8bfa0 | [
"MIT"
] | 7 | 2020-02-16T15:53:05.000Z | 2022-01-18T03:41:03.000Z | # Copyright (c) 2019, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: MIT
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
import os
import json
import time
import torch
import numpy as np
from dist_train.utils.shared_optim import SharedAdam a... | 37.372881 | 113 | 0.625057 |
62465d23caea9a55d617b43228f68bc11060176f | 5,668 | py | Python | models/rank/fnn/fm_model.py | michaelwang123/PaddleRec | 4feb0a7f962e918bdfa4f7289a9ddfd08d459824 | [
"Apache-2.0"
] | 3 | 2020-09-22T02:46:30.000Z | 2021-06-17T06:43:37.000Z | models/rank/fnn/fm_model.py | hzj1558718/PaddleRec | 927e363e42ab55dd2961b0fbbb23c2578d289105 | [
"Apache-2.0"
] | null | null | null | models/rank/fnn/fm_model.py | hzj1558718/PaddleRec | 927e363e42ab55dd2961b0fbbb23c2578d289105 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:31:36.000Z | 2021-01-11T06:31:36.000Z | # Copyright (c) 2020 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 app... | 42.298507 | 80 | 0.59933 |
44e845bf3c7c38511147b2005a66084db8612c19 | 3,327 | py | Python | crossing_tree/processes/hermite.py | ivannz/crossing_paper2017 | a33c826b966d0238b96156ec19f462d2f9ed7906 | [
"MIT"
] | 1 | 2019-05-25T21:37:23.000Z | 2019-05-25T21:37:23.000Z | crossing_tree/processes/hermite.py | ivannz/crossing_paper2017 | a33c826b966d0238b96156ec19f462d2f9ed7906 | [
"MIT"
] | null | null | null | crossing_tree/processes/hermite.py | ivannz/crossing_paper2017 | a33c826b966d0238b96156ec19f462d2f9ed7906 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""A module with the Hermite process generator.
"""
import numpy as np
from numpy.polynomial.hermite_e import hermeval
from sklearn.base import BaseEstimator as BaseGenerator
from .gaussian import FractionalGaussianNoise
class HermiteProcess(BaseGenerator):
r"""A derived class to produce... | 35.393617 | 82 | 0.626991 |
c9d9429064d533cd3918c0ac7c474c07b4d52340 | 892 | py | Python | etc/bin/sort_json_file.py | petrosagg/google-apis-rs | 5c071ba03c2c060ce0ff0e40fe12dd7cc9ba6aa3 | [
"MIT-feh",
"Apache-2.0",
"MIT"
] | 663 | 2015-03-13T17:48:25.000Z | 2022-03-28T17:57:24.000Z | etc/bin/sort_json_file.py | petrosagg/google-apis-rs | 5c071ba03c2c060ce0ff0e40fe12dd7cc9ba6aa3 | [
"MIT-feh",
"Apache-2.0",
"MIT"
] | 303 | 2015-03-12T06:35:25.000Z | 2022-03-27T23:36:15.000Z | etc/bin/sort_json_file.py | petrosagg/google-apis-rs | 5c071ba03c2c060ce0ff0e40fe12dd7cc9ba6aa3 | [
"MIT-feh",
"Apache-2.0",
"MIT"
] | 106 | 2015-03-15T11:41:24.000Z | 2022-03-08T09:12:48.000Z | #!/usr/bin/env python
# Sort JSON file and print in fixed format
# This lowers git diffs when a file has only changed by whitespace.
import argparse
import json
import os
def main(json_file_path, skip_missing_file):
if not os.path.isfile(json_file_path) and skip_missing_file:
return
with open(json... | 29.733333 | 119 | 0.714126 |
27c52b09f147502954ae110aaade91b25ccbf4b8 | 2,380 | py | Python | beer/cli/subcommands/hmm/train.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | null | null | null | beer/cli/subcommands/hmm/train.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | null | null | null | beer/cli/subcommands/hmm/train.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | null | null | null |
'train a HMM based model'
import argparse
import pickle
import sys
import beer
def setup(parser):
parser.add_argument('-b', '--batch-size', type=int, default=-1,
help='batch size in number of utterance ' \
'(-1 means all the utterances as one batch)')
pa... | 36.615385 | 125 | 0.560924 |
505b630f4b580015d8080ff830262c1e2e2bb743 | 4,941 | py | Python | test/master/test_scheduler.py | BenjaminHamon/BuildService | 2ca12f9ae74e9cbf732229849f6cd6d13f40151a | [
"MIT"
] | 2 | 2021-01-28T15:56:50.000Z | 2021-03-02T06:27:09.000Z | test/master/test_scheduler.py | BenjaminHamon/BuildService | 2ca12f9ae74e9cbf732229849f6cd6d13f40151a | [
"MIT"
] | null | null | null | test/master/test_scheduler.py | BenjaminHamon/BuildService | 2ca12f9ae74e9cbf732229849f6cd6d13f40151a | [
"MIT"
] | null | null | null | # pylint: disable = protected-access
""" Unit tests for JobScheduler """
import pytest
from bhamon_orchestra_master.job_scheduler import JobScheduler
from bhamon_orchestra_master.supervisor import Supervisor
from bhamon_orchestra_master.worker import Worker
from bhamon_orchestra_model.database.memory_database_client... | 43.725664 | 163 | 0.801255 |
c3da31ca2e9813355c9dbb139f8e0353c7c3ab47 | 325 | py | Python | expjobs/status.py | omangin/joblib | b1ce3b5e16d93bff42c65007b623d5091716771f | [
"BSD-3-Clause"
] | 1 | 2020-01-19T04:01:38.000Z | 2020-01-19T04:01:38.000Z | expjobs/status.py | omangin/joblib | b1ce3b5e16d93bff42c65007b623d5091716771f | [
"BSD-3-Clause"
] | null | null | null | expjobs/status.py | omangin/joblib | b1ce3b5e16d93bff42c65007b623d5091716771f | [
"BSD-3-Clause"
] | null | null | null | class Status(tuple):
def __new__(_cls, i, n):
return tuple.__new__(_cls, (i, n))
def __repr__(self):
return str(self[1])
NOT_READY = Status(0, 'not-ready')
READY = Status(1, 'ready')
QUEUED = Status(2, 'queued')
RUNNING = Status(3, 'running')
FAILED = Status(4, 'failed')
DONE = Status(5, 'do... | 20.3125 | 42 | 0.615385 |
bc64192e65d689a1abb353039fa512f10296c929 | 1,235 | py | Python | models/training_2L.py | ElisaNguyen/tsa-explanations | 0e9db51817c58fa5a09d25d798e20d67cb575a01 | [
"MIT"
] | null | null | null | models/training_2L.py | ElisaNguyen/tsa-explanations | 0e9db51817c58fa5a09d25d798e20d67cb575a01 | [
"MIT"
] | null | null | null | models/training_2L.py | ElisaNguyen/tsa-explanations | 0e9db51817c58fa5a09d25d798e20d67cb575a01 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import random
import sys
import numpy as np
import pandas as pd
import torch
random.seed(123)
torch.manual_seed(123)
np.random.seed(123)
dtype = torch.float
# Check whether a GPU is available
if torch.cuda.is_available():
device = torch.device("cuda")
else:
device = ... | 20.583333 | 69 | 0.68583 |
3d9bb51750c64c4487da7e33fb6f79442c7c78ce | 187 | py | Python | bin/twigs/quasi-polytwigs-123-hexagon-ring-4.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/twigs/quasi-polytwigs-123-hexagon-ring-4.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/twigs/quasi-polytwigs-123-hexagon-ring-4.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | 1 | 2022-01-02T16:54:14.000Z | 2022-01-02T16:54:14.000Z | #!/usr/bin/env python
# $Id$
"""many solutions"""
import puzzler
from puzzler.puzzles.quasipolytwigs123 import QuasiPolytwigs123HexagonRing4
puzzler.run(QuasiPolytwigs123HexagonRing4)
| 18.7 | 75 | 0.812834 |
5b1b823f5e8c7ee6ded35c8b275592bc539bbe56 | 3,755 | py | Python | flexget/plugins/output/sms_ru.py | Crupuk/Flexget | 0ede246fd4b90e3cd75120ba13746187e11968d2 | [
"MIT"
] | null | null | null | flexget/plugins/output/sms_ru.py | Crupuk/Flexget | 0ede246fd4b90e3cd75120ba13746187e11968d2 | [
"MIT"
] | null | null | null | flexget/plugins/output/sms_ru.py | Crupuk/Flexget | 0ede246fd4b90e3cd75120ba13746187e11968d2 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
import logging
import hashlib
from flexget.plugin import register_plugin, priority
from flexget.utils.template import RenderError
__version__ = 0.1
log = logging.getLogger("sms_ru")
client_headers = {"User-Agent": "FlexGet sms_ru plugin/%s" % str(__... | 35.093458 | 118 | 0.61225 |
018fc28a3653062277bdae9d566e5ef6950aeb5a | 1,966 | py | Python | src/sima/post/blueprints/addconstantfilter.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/post/blueprints/addconstantfilter.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/post/blueprints/addconstantfilter.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | #
# Generated with AddConstantFilterBlueprint
from dmt.blueprint import Blueprint
from dmt.dimension import Dimension
from dmt.attribute import Attribute
from dmt.enum_attribute import EnumAttribute
from dmt.blueprint_attribute import BlueprintAttribute
from .operationnode import OperationNodeBlueprint
class AddConst... | 67.793103 | 135 | 0.729908 |
45b3ea8a4457f0d00365d362cbaf1592bf73cdff | 296 | py | Python | payment/templatetags/payment_extras.py | cleobatista/django-paypal-simple | 9bb1f87b3c3d66636437c1ec71a14d87ccacdef6 | [
"BSD-2-Clause"
] | null | null | null | payment/templatetags/payment_extras.py | cleobatista/django-paypal-simple | 9bb1f87b3c3d66636437c1ec71a14d87ccacdef6 | [
"BSD-2-Clause"
] | null | null | null | payment/templatetags/payment_extras.py | cleobatista/django-paypal-simple | 9bb1f87b3c3d66636437c1ec71a14d87ccacdef6 | [
"BSD-2-Clause"
] | null | null | null | from django import template
register = template.Library()
@register.filter(name='subtract')
def subtract(value, arg):
if arg:
return value - arg
else:
return value
@register.filter(name='comma_to_dot')
def comma_to_dot(value):
return str(value).replace(',', '.')
| 17.411765 | 39 | 0.665541 |
78b4828e2b29a5f8e28452b62c51cb15376a25ca | 5,047 | py | Python | demo.py | McManning/DynamicProperties | 36cc81249eed0c5d11c75d079f6b2b081edfa70c | [
"MIT"
] | 1 | 2021-09-02T16:22:25.000Z | 2021-09-02T16:22:25.000Z | demo.py | McManning/DynamicProperties | 36cc81249eed0c5d11c75d079f6b2b081edfa70c | [
"MIT"
] | null | null | null | demo.py | McManning/DynamicProperties | 36cc81249eed0c5d11c75d079f6b2b081edfa70c | [
"MIT"
] | 1 | 2021-05-29T10:14:15.000Z | 2021-05-29T10:14:15.000Z |
class DEMO_OT_change_fizz(bpy.types.Operator):
"""Example of replacing properties in a dynamic property group at runtime"""
bl_idname = 'demo_toggle.change_fizz'
bl_label = 'Change Fizz Properties'
def invoke(self, context, event):
fizz = DynamicProperties.find(bpy.types.Light, 'fizz')
... | 35.293706 | 108 | 0.690707 |
222bc7a247255b38116bfbb6e88d247cf3060896 | 350 | py | Python | fipeapi/__version__.py | deibsoncarvalho/tabela-fipe-api | 2890162e4436611326f0b878f647f344a8d52626 | [
"Apache-2.0"
] | null | null | null | fipeapi/__version__.py | deibsoncarvalho/tabela-fipe-api | 2890162e4436611326f0b878f647f344a8d52626 | [
"Apache-2.0"
] | null | null | null | fipeapi/__version__.py | deibsoncarvalho/tabela-fipe-api | 2890162e4436611326f0b878f647f344a8d52626 | [
"Apache-2.0"
] | null | null | null | __title__ = 'fipeapi'
__description__ = 'Python Extra Oficial API for REST Request to consult Vehicles Prices.'
__url__ = 'https://github.com/deibsoncarvalho/tabela-fipe-api'
__version__ = '0.1.0'
__author__ = 'Deibson Carvalho'
__author_email__ = 'eu@deibsoncarvalho.com'
__license__ = 'Apache 2.0'
__copyright__ = 'Cop... | 38.888889 | 89 | 0.78 |
fcff5585bc12a75f274bd29236648d5b201a2f2d | 31,369 | py | Python | python/paddle/tensor/linalg.py | mamingjie-China/Paddle | 91d2f1e3e6e51142a74a43d0673a8feff056c39b | [
"Apache-2.0"
] | null | null | null | python/paddle/tensor/linalg.py | mamingjie-China/Paddle | 91d2f1e3e6e51142a74a43d0673a8feff056c39b | [
"Apache-2.0"
] | null | null | null | python/paddle/tensor/linalg.py | mamingjie-China/Paddle | 91d2f1e3e6e51142a74a43d0673a8feff056c39b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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 app... | 38.069175 | 147 | 0.566929 |
ccb7c984d9f0691dcd554cd5d6587617d317ec77 | 333 | py | Python | PantherC3D/Environment/Value.py | pablorocad/S2OLC2-C | a452e4de83f315802ad8237d44c477ebf04881f0 | [
"MIT"
] | null | null | null | PantherC3D/Environment/Value.py | pablorocad/S2OLC2-C | a452e4de83f315802ad8237d44c477ebf04881f0 | [
"MIT"
] | null | null | null | PantherC3D/Environment/Value.py | pablorocad/S2OLC2-C | a452e4de83f315802ad8237d44c477ebf04881f0 | [
"MIT"
] | 1 | 2021-09-11T14:43:07.000Z | 2021-09-11T14:43:07.000Z | from Enum.typeExpression import typeExpression
class Value:
def __init__(self,value:str, isTemp:bool, type: typeExpression) -> None:
self.value = value
self.isTemp = isTemp
self.type = type
self.trueLabel = ""
self.falseLabel = ""
def getValue(self) -> str:
retu... | 27.75 | 76 | 0.627628 |
83a78cb80891df123fee3b9d705e77fac914e95b | 498 | py | Python | analis de algoritmos/tarea1/graficadora.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | null | null | null | analis de algoritmos/tarea1/graficadora.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | null | null | null | analis de algoritmos/tarea1/graficadora.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | 1 | 2020-03-03T04:16:42.000Z | 2020-03-03T04:16:42.000Z | import numpy as np
import math
arr = [-1, 0, 1, 2, 3, 5, 15, 20, 100, 409, 500, 593,
1000, 1471, 1500, 2801, 3000, 5000, 10000, 20000]
result = []
def log2(num):
try:
r = (np.log2(num))
r_str = str(r)
if( r_str == 'inf' or r_str == 'nan' or r_str == '-inf'):
return 0
... | 17.785714 | 65 | 0.504016 |
a6e98b5348407f916579808e4efb1196e8e1210b | 2,634 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/CreateDataSourceRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/CreateDataSourceRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/CreateDataSourceRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | # 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... | 32.925 | 74 | 0.762718 |
c75fc38b56dd9bad85e413a5b7e742490c0acc07 | 3,288 | py | Python | mysite/settings.py | UAACC/pro | c5424574427ac3521cb70b0d62b841fa128f5166 | [
"MIT"
] | null | null | null | mysite/settings.py | UAACC/pro | c5424574427ac3521cb70b0d62b841fa128f5166 | [
"MIT"
] | null | null | null | mysite/settings.py | UAACC/pro | c5424574427ac3521cb70b0d62b841fa128f5166 | [
"MIT"
] | null | null | null | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib ... | 25.099237 | 91 | 0.693127 |
1737dd5e07de7d7d700a2e5d8d0f149f779b08a8 | 2,356 | py | Python | api/anubis/rpc/pipeline.py | ShubhamGG/Anubis | 2c538ef258a1edf5463596a33bc66caa2ef7e35b | [
"MIT"
] | null | null | null | api/anubis/rpc/pipeline.py | ShubhamGG/Anubis | 2c538ef258a1edf5463596a33bc66caa2ef7e35b | [
"MIT"
] | null | null | null | api/anubis/rpc/pipeline.py | ShubhamGG/Anubis | 2c538ef258a1edf5463596a33bc66caa2ef7e35b | [
"MIT"
] | null | null | null | from kubernetes import config, client
from anubis.models import db, Config, Submission
from anubis.utils.data import with_context
from anubis.utils.k8s.pipeline import create_pipeline_job_obj, reap_pipeline_jobs
from anubis.utils.logging import logger
from anubis.utils.config import get_config_int
@with_context
def ... | 29.822785 | 81 | 0.688455 |
28ff71a99e3b17dd6ca18301cde485a9b0d4c495 | 8,262 | py | Python | angr/procedures/glibc/__libc_start_main.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | 1 | 2020-11-18T16:39:11.000Z | 2020-11-18T16:39:11.000Z | angr/procedures/glibc/__libc_start_main.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | null | null | null | angr/procedures/glibc/__libc_start_main.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | 1 | 2020-11-18T16:39:13.000Z | 2020-11-18T16:39:13.000Z |
import logging
import pyvex
import angr
l = logging.getLogger(name=__name__)
######################################
# __libc_start_main
######################################
class __libc_start_main(angr.SimProcedure):
#pylint:disable=arguments-differ,unused-argument,attribute-defined-outside-init
ADDS_EXI... | 39.156398 | 118 | 0.547446 |
9a520a06d8da36ae8fbb2c9dd31e346551416954 | 4,478 | py | Python | analysis/plot-recognition-data.py | Dom1L/molassembler | dafc656b1aa846b65b1fd1e06f3740ceedcf22db | [
"BSD-3-Clause"
] | 17 | 2020-11-27T14:59:34.000Z | 2022-03-28T10:31:25.000Z | analysis/plot-recognition-data.py | Dom1L/molassembler | dafc656b1aa846b65b1fd1e06f3740ceedcf22db | [
"BSD-3-Clause"
] | null | null | null | analysis/plot-recognition-data.py | Dom1L/molassembler | dafc656b1aa846b65b1fd1e06f3740ceedcf22db | [
"BSD-3-Clause"
] | 6 | 2020-12-09T09:21:53.000Z | 2021-08-22T15:42:21.000Z | __copyright__ = """This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.
See LICENSE.txt for details.
"""
from recognition_data import symmetrySizes, n_distortion_values, max_distortion, shapes, repeats, results, recognizers
import matplotlib.pyplot... | 37.949153 | 118 | 0.619026 |
21c472d90c252a787119cd18c16cea440e5be5df | 125 | py | Python | lagom/version.py | zuoxingdong/lagom | 3b6710804dbc79c6dffb369ac87c68f4055ab6cd | [
"MIT"
] | 383 | 2018-07-11T17:43:10.000Z | 2022-01-24T08:46:23.000Z | lagom/version.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 90 | 2018-07-11T23:51:45.000Z | 2021-12-16T08:56:42.000Z | lagom/version.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 32 | 2018-07-12T18:21:03.000Z | 2021-09-15T05:47:48.000Z | # Useful for setup.py and when lagom is not installed yet
# Versioning format: Major.Minor.Maintenance
__version__ = '0.0.3'
| 31.25 | 57 | 0.768 |
4a027bd5444be733fdaa5d06b10f3ac5224beeaa | 52,859 | py | Python | pde/grids/base.py | tefavidal/py-pde | 427be3f2f4b096775f46111cd5a5d05af50e94bc | [
"MIT"
] | null | null | null | pde/grids/base.py | tefavidal/py-pde | 427be3f2f4b096775f46111cd5a5d05af50e94bc | [
"MIT"
] | null | null | null | pde/grids/base.py | tefavidal/py-pde | 427be3f2f4b096775f46111cd5a5d05af50e94bc | [
"MIT"
] | null | null | null | """
Bases classes
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""
from __future__ import annotations
import functools
import inspect
import itertools
import json
import logging
import warnings
from abc import ABCMeta, abstractmethod, abstractproperty
from typing import (
TYPE_CHECKING,
Any,
... | 39.125833 | 103 | 0.57572 |
5ab5a04c68f8760c2cf922dfbb192426fda880de | 404 | py | Python | STACK/Rainwater trapped.py | rajansh87/Algorithms-Implementations | 1f3dd1bc2decf10638fe0fdeeede47a650a9057b | [
"MIT"
] | 1 | 2020-05-10T19:01:51.000Z | 2020-05-10T19:01:51.000Z | STACK/Rainwater trapped.py | rajansh87/Algorithms-Implementations | 1f3dd1bc2decf10638fe0fdeeede47a650a9057b | [
"MIT"
] | 9 | 2021-03-17T18:10:18.000Z | 2021-03-29T19:35:06.000Z | STACK/Rainwater trapped.py | rajansh87/Data-Structures-and-Algorithms-Implementations | 0529079fbcd4d1a047210e9f2ff42c194c0818fe | [
"MIT"
] | null | null | null |
arr=[0,1,0,2,1,0,1,3,2,1,2,1]
water=0
lma,rma=0,0
low=0
high=len(arr)-1
while(low<=high):
if(arr[low]<arr[high]):
if(arr[low]>lma):
lma=arr[low]
else:
water+=lma-arr[low]
low+=1
else:
if(arr[high]>rma):
rma=arr[hig... | 18.363636 | 33 | 0.428218 |
0ac2e91b799891e72c41c520c1529b7fd064bcbd | 1,655 | py | Python | tests/datasets/test_customized_data.py | Aliang-CN/cogdl | 01b1dbf7528240457a5fbe8c24b8271e805dc7ec | [
"MIT"
] | 1 | 2021-03-17T07:23:51.000Z | 2021-03-17T07:23:51.000Z | tests/datasets/test_customized_data.py | yingyukexiansheng/cogdl | cf594cdb3a97f45333d08c937205d1a691828a33 | [
"MIT"
] | null | null | null | tests/datasets/test_customized_data.py | yingyukexiansheng/cogdl | cf594cdb3a97f45333d08c937205d1a691828a33 | [
"MIT"
] | null | null | null | import torch
from cogdl.data import Data
from cogdl.datasets import BaseDataset, register_dataset, build_dataset, build_dataset_from_name
from cogdl.utils import build_args_from_dict
@register_dataset("mydataset")
class MyNodeClassificationDataset(BaseDataset):
def __init__(self):
super(MyNodeClassificati... | 33.77551 | 115 | 0.679758 |
c7f86b989dcdcec9f80f276eeba2869dfac1dc74 | 2,536 | py | Python | sdk/connectedvmware/azure-mgmt-connectedvmware/setup.py | moovy2/azure-sdk-for-python | 6b0495dc9917d47a7264f26cbd3221d43461a537 | [
"MIT"
] | null | null | null | sdk/connectedvmware/azure-mgmt-connectedvmware/setup.py | moovy2/azure-sdk-for-python | 6b0495dc9917d47a7264f26cbd3221d43461a537 | [
"MIT"
] | null | null | null | sdk/connectedvmware/azure-mgmt-connectedvmware/setup.py | moovy2/azure-sdk-for-python | 6b0495dc9917d47a7264f26cbd3221d43461a537 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 34.27027 | 91 | 0.606861 |
0f2b5ba04147b3afbb2b735357905e7eac75bc23 | 3,296 | py | Python | yt_handle.py | luceatnobis/yt_handle | f67ddf0f6d312b0af0eda18834a4fe06e8a3002d | [
"Apache-2.0"
] | null | null | null | yt_handle.py | luceatnobis/yt_handle | f67ddf0f6d312b0af0eda18834a4fe06e8a3002d | [
"Apache-2.0"
] | null | null | null | yt_handle.py | luceatnobis/yt_handle | f67ddf0f6d312b0af0eda18834a4fe06e8a3002d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from __future__ import print_function
import os
import sys
import shutil
import httplib2
import oauth2client
try:
import apiclient as googleapiclient
except ImportError:
import googleapiclient
from oauth2client.file import Storage, Credentials
from oauth2client.client import flow_from... | 29.693694 | 77 | 0.698726 |
1478acb5f90a90376f0530dad0835da7b283bba8 | 753 | py | Python | google/cloud/tasks/v2beta3/tasks-v2beta3-py/google/cloud/tasks_v2beta3/services/cloud_tasks/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/tasks/v2beta3/tasks-v2beta3-py/google/cloud/tasks_v2beta3/services/cloud_tasks/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/tasks/v2beta2/tasks-v2beta2-py/google/cloud/tasks_v2beta2/services/cloud_tasks/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 32.73913 | 74 | 0.752988 |
335138d3a43d835ac61dca55298fb3ec9317005d | 28 | py | Python | django_scarface/__init__.py | dreipol/django-scarface | 5d9bed10dbca9d8ee105734adacd03f1cfb09952 | [
"MIT"
] | 53 | 2015-01-05T19:25:48.000Z | 2019-12-23T01:34:03.000Z | django_scarface/__init__.py | dreipol/django-scarface | 5d9bed10dbca9d8ee105734adacd03f1cfb09952 | [
"MIT"
] | 27 | 2015-01-12T07:18:49.000Z | 2019-02-19T06:28:47.000Z | django_scarface/__init__.py | dreipol/django-scarface | 5d9bed10dbca9d8ee105734adacd03f1cfb09952 | [
"MIT"
] | 30 | 2015-01-05T18:05:21.000Z | 2019-04-01T05:54:55.000Z | __version__ = '3.2.1-alpha'
| 14 | 27 | 0.678571 |
6afb1893d0ff813b4122eec35d4a6d4bf5beb88a | 24,845 | py | Python | multiagent/graphicsDisplay.py | dcalacci/ml-expectimax-agent | 1b74a1a02f98b702bf2d21e09f616b590bff481c | [
"MIT"
] | 2 | 2018-05-02T07:51:25.000Z | 2020-05-11T00:55:08.000Z | multiagent/graphicsDisplay.py | dcalacci/ml-expectimax-agent | 1b74a1a02f98b702bf2d21e09f616b590bff481c | [
"MIT"
] | null | null | null | multiagent/graphicsDisplay.py | dcalacci/ml-expectimax-agent | 1b74a1a02f98b702bf2d21e09f616b590bff481c | [
"MIT"
] | 2 | 2017-10-10T22:11:51.000Z | 2019-12-11T16:05:12.000Z | from graphicsUtils import *
import math, time
from game import Directions
###########################
# GRAPHICS DISPLAY CODE #
###########################
# Most code by Dan Klein and John Denero written or rewritten for cs188, UC Berkeley.
# Some code from a Pacman implementation by LiveWires, and used / ... | 37.81583 | 177 | 0.631676 |
01dbd89133f57eb3b3dee626e65f3a7ba088ed1d | 6,545 | py | Python | src/cfnlint/rules/functions/SubNeeded.py | brendangibat/cfn-python-lint | 60500d3926d810352e42b95b09c8e7814033cca6 | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/functions/SubNeeded.py | brendangibat/cfn-python-lint | 60500d3926d810352e42b95b09c8e7814033cca6 | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/functions/SubNeeded.py | brendangibat/cfn-python-lint | 60500d3926d810352e42b95b09c8e7814033cca6 | [
"MIT-0"
] | null | null | null | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import re
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class SubNeeded(CloudFormationLintRule):
"""Check if a substitution string exists without a substitution fun... | 47.427536 | 136 | 0.600764 |
178f882d7f8dffdad2f4b0260e18d06daf9714cb | 559 | py | Python | ClassicalSquareDimer/src/plot/load_binary_file.py | CaoRX/ClassicalDimer | 98f324ab0118455127e6ba8784a6836476cbf843 | [
"MIT"
] | 1 | 2020-03-03T07:32:18.000Z | 2020-03-03T07:32:18.000Z | src/plot/load_binary_file.py | CaoRX/ClassicalDimer | 98f324ab0118455127e6ba8784a6836476cbf843 | [
"MIT"
] | null | null | null | src/plot/load_binary_file.py | CaoRX/ClassicalDimer | 98f324ab0118455127e6ba8784a6836476cbf843 | [
"MIT"
] | null | null | null | import numpy as np
import struct
def load_file(filename, data_shape = (1, -1), data_type = 'double'):
type_dict = {'int': 'i', 'double': 'd'}
file_path = '../../build/data/' + filename
data_file = open(file_path, mode = 'rb')
file_contents = data_file.read()
ret = struct.iter_unpack(type_dict[data_type], file_co... | 31.055556 | 68 | 0.674419 |
da78770aec688ddc3cdbdca3f019be0fc105e977 | 19,782 | py | Python | wfexs_backend/cache_handler.py | Acivico/WfExS-backend | 05173ceca4dfdcd65f2a957e3638a65d76c6eb25 | [
"Apache-2.0"
] | 1 | 2022-01-10T12:21:33.000Z | 2022-01-10T12:21:33.000Z | wfexs_backend/cache_handler.py | Acivico/WfExS-backend | 05173ceca4dfdcd65f2a957e3638a65d76c6eb25 | [
"Apache-2.0"
] | 1 | 2021-11-19T09:10:51.000Z | 2021-11-24T08:55:49.000Z | wfexs_backend/cache_handler.py | Acivico/WfExS-backend | 05173ceca4dfdcd65f2a957e3638a65d76c6eb25 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020-2021 Barcelona Supercomputing Center (BSC), Spain
#
# 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... | 49.208955 | 362 | 0.579567 |
146b8476b322cf593fb315b0098e064e7a41e0b6 | 38,283 | py | Python | vendor/chromium/mojo/public/tools/bindings/generators/mojom_cpp_generator.py | mkljczk/fivem | 187b2e5f922297bcbde5cfb1db70815223c53680 | [
"MIT"
] | 6 | 2021-03-29T05:26:18.000Z | 2021-07-13T12:53:03.000Z | vendor/chromium/mojo/public/tools/bindings/generators/mojom_cpp_generator.py | big-rip/fivem-1 | c08af22110802e77816dfdde29df1662f8dea563 | [
"MIT"
] | 7 | 2021-08-31T22:30:30.000Z | 2022-03-24T06:50:38.000Z | vendor/chromium/mojo/public/tools/bindings/generators/mojom_cpp_generator.py | big-rip/fivem-1 | c08af22110802e77816dfdde29df1662f8dea563 | [
"MIT"
] | 3 | 2020-12-23T02:42:18.000Z | 2021-04-07T12:06:03.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates C++ source files from a mojom.Module."""
import mojom.generate.generator as generator
import mojom.generate.module as mojom
import mojom.genera... | 39.264615 | 80 | 0.690489 |
4687c71a05ea0c88a9336256f2dcac6d58c491db | 2,462 | py | Python | run.py | bhoepner/piradio | e28038af2a3ed304ed085ea1fb868a997b8387a6 | [
"MIT"
] | null | null | null | run.py | bhoepner/piradio | e28038af2a3ed304ed085ea1fb868a997b8387a6 | [
"MIT"
] | null | null | null | run.py | bhoepner/piradio | e28038af2a3ed304ed085ea1fb868a997b8387a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from signal import SIGINT, SIGTERM, signal
from time import sleep
from piradio.rotary import RotaryEncoder
from piradio.settings import Settings
from piradio.vlc import VlcRemote
class Runner:
MODE_VOLUME = 0
MODE_STATIONS = 1
def __init__(self):
self._vlc = VlcRemote()
... | 24.868687 | 55 | 0.572299 |
af30459d974fae6e4fa61abe75cc096e1de08f4f | 18,053 | py | Python | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/rsa/rsa/key.py | mikestaub/arangodb | 1bdf414de29b31bcaf80769a095933f66f8256ce | [
"ICU",
"BSL-1.0",
"Zlib",
"Apache-2.0"
] | 27 | 2016-04-27T01:02:03.000Z | 2021-12-13T08:53:19.000Z | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/rsa/rsa/key.py | mikestaub/arangodb | 1bdf414de29b31bcaf80769a095933f66f8256ce | [
"ICU",
"BSL-1.0",
"Zlib",
"Apache-2.0"
] | 2 | 2017-03-09T09:00:50.000Z | 2017-09-21T15:48:20.000Z | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/rsa/rsa/key.py | mikestaub/arangodb | 1bdf414de29b31bcaf80769a095933f66f8256ce | [
"ICU",
"BSL-1.0",
"Zlib",
"Apache-2.0"
] | 17 | 2016-04-27T02:06:39.000Z | 2019-12-18T08:07:00.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | 29.450245 | 87 | 0.594583 |
f9272700d1d43ad5be4886d2c7f776d88bec3b51 | 35,741 | py | Python | math_eval/test_math_eval.py | molsonkiko/math_eval | e458dd9f1cb702d9b55f53119637ab13490f20bf | [
"MIT"
] | null | null | null | math_eval/test_math_eval.py | molsonkiko/math_eval | e458dd9f1cb702d9b55f53119637ab13490f20bf | [
"MIT"
] | null | null | null | math_eval/test_math_eval.py | molsonkiko/math_eval | e458dd9f1cb702d9b55f53119637ab13490f20bf | [
"MIT"
] | null | null | null | from math_eval import *
import random
import string
import itertools
import traceback
import sys
import math
try:
import pandas as pd
except:
pass # should enable people w/o pandas to use my ComputeTester object for testing
values = lambda dict_: dict_.values()
def five_to_the_x(x): return 5**x
def five_to... | 42.854916 | 156 | 0.499398 |
92613347c7a30571da6e97e101862845c1aad2f5 | 873 | py | Python | code/tmp_rtrip/encodings/utf_7.py | emilyemorehouse/ast-and-me | 3f58117512e125e1ecbe3c72f2f0d26adb80b7b3 | [
"MIT"
] | 24 | 2018-01-23T05:28:40.000Z | 2021-04-13T20:52:59.000Z | code/tmp_rtrip/encodings/utf_7.py | emilyemorehouse/ast-and-me | 3f58117512e125e1ecbe3c72f2f0d26adb80b7b3 | [
"MIT"
] | 17 | 2017-12-21T18:32:31.000Z | 2018-12-18T17:09:50.000Z | code/tmp_rtrip/encodings/utf_7.py | emilyemorehouse/ast-and-me | 3f58117512e125e1ecbe3c72f2f0d26adb80b7b3 | [
"MIT"
] | null | null | null | """ Python 'utf-7' Codec
Written by Brian Quinlan (brian@sweetapp.com).
"""
import codecs
encode = codecs.utf_7_encode
def decode(input, errors='strict'):
return codecs.utf_7_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
retu... | 24.25 | 71 | 0.756014 |
b2c8606da1e32522afef65e00801d52edb9cb597 | 131,274 | py | Python | venv/Lib/site-packages/music21/midi/translate.py | alimirzazadeh/wolfGANg | 5bf56f7d8e6c1c283edb98bdaecfd5a606b4462c | [
"MIT"
] | 1 | 2022-01-28T00:03:19.000Z | 2022-01-28T00:03:19.000Z | venv/Lib/site-packages/music21/midi/translate.py | alimirzazadeh/wolfGANg | 5bf56f7d8e6c1c283edb98bdaecfd5a606b4462c | [
"MIT"
] | null | null | null | venv/Lib/site-packages/music21/midi/translate.py | alimirzazadeh/wolfGANg | 5bf56f7d8e6c1c283edb98bdaecfd5a606b4462c | [
"MIT"
] | 1 | 2021-11-23T00:49:26.000Z | 2021-11-23T00:49:26.000Z | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: midi.translate.py
# Purpose: Translate MIDI and music21 objects
#
# Authors: Christopher Ariza
# Michael Scott Cuthbert
#
# Copyright: Copyright © 2010-2015, 2019 Michael S... | 36.293613 | 100 | 0.60827 |
5212092cef34f4cde9cd1fe8d37ad10a8854065b | 355 | py | Python | Practice/Beginner/CATSDOGS.py | ganeshkumarm1/CodeChef-Solutions | de94a5d06cc1fcfda42bce06e2918c3add81a999 | [
"MIT"
] | null | null | null | Practice/Beginner/CATSDOGS.py | ganeshkumarm1/CodeChef-Solutions | de94a5d06cc1fcfda42bce06e2918c3add81a999 | [
"MIT"
] | null | null | null | Practice/Beginner/CATSDOGS.py | ganeshkumarm1/CodeChef-Solutions | de94a5d06cc1fcfda42bce06e2918c3add81a999 | [
"MIT"
] | null | null | null | t = int(input())
for i in range(t):
cats, dogs, legs = list(map(int, input().split()))
max_legs = 4 * (cats + dogs)
min_legs = 4 * dogs if cats <= 2 * dogs else 4 * (cats - dogs)
if legs % 4 != 0:
print("no")
else:
if min_legs <= legs <= max_legs:
print("yes")
... | 20.882353 | 66 | 0.470423 |
481355fe9f9d6345b43e6ce75b1f1c817fb22842 | 891 | py | Python | examples/slash_commands/old.py | Enegg/disnake | 1d48cbf4e0dfec82fdfb65d7f58396767ce7c009 | [
"MIT"
] | 290 | 2021-11-03T12:33:16.000Z | 2022-03-31T19:30:19.000Z | examples/slash_commands/old.py | Enegg/disnake | 1d48cbf4e0dfec82fdfb65d7f58396767ce7c009 | [
"MIT"
] | 200 | 2021-11-03T10:41:41.000Z | 2022-03-31T08:13:11.000Z | examples/slash_commands/old.py | Enegg/disnake | 1d48cbf4e0dfec82fdfb65d7f58396767ce7c009 | [
"MIT"
] | 118 | 2021-11-03T18:27:09.000Z | 2022-03-25T22:00:45.000Z | """
An example of old-style options.
Not the most convenient syntax.
"""
import disnake
from disnake.ext import commands
bot = commands.Bot(command_prefix=commands.when_mentioned)
@bot.slash_command(
name="slash_command",
description="A Simple Slash Command",
options=[
disnake.Option("string", de... | 29.7 | 94 | 0.682379 |
05e209388b52e73487a350a60c000604928dae0a | 30,242 | py | Python | src/gluonnlp/data/glue.py | davisliang/gluon-nlp | 18a736dbb55c80c2de82d73b923c3cd3d9d53591 | [
"Apache-2.0"
] | null | null | null | src/gluonnlp/data/glue.py | davisliang/gluon-nlp | 18a736dbb55c80c2de82d73b923c3cd3d9d53591 | [
"Apache-2.0"
] | null | null | null | src/gluonnlp/data/glue.py | davisliang/gluon-nlp | 18a736dbb55c80c2de82d73b923c3cd3d9d53591 | [
"Apache-2.0"
] | 3 | 2021-03-12T04:41:00.000Z | 2021-03-12T04:41:24.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... | 43.079772 | 310 | 0.590669 |
d486c7c54e5a1877a92b87a06a775cbc573fb3af | 43,571 | py | Python | tests/shared/core/test_domain.py | theanht1/rasa | eb408bb2d216de3a1cd1f72799d7b80eceeb1fd2 | [
"Apache-2.0"
] | null | null | null | tests/shared/core/test_domain.py | theanht1/rasa | eb408bb2d216de3a1cd1f72799d7b80eceeb1fd2 | [
"Apache-2.0"
] | 21 | 2021-05-27T13:20:53.000Z | 2022-03-01T13:45:04.000Z | tests/shared/core/test_domain.py | theanht1/rasa | eb408bb2d216de3a1cd1f72799d7b80eceeb1fd2 | [
"Apache-2.0"
] | null | null | null | import copy
import json
from pathlib import Path
from typing import Dict, List, Text, Any, Union, Set, Optional
import pytest
from rasa.shared.exceptions import YamlSyntaxException
import rasa.shared.utils.io
from rasa.shared.constants import (
DEFAULT_SESSION_EXPIRATION_TIME_IN_MINUTES,
LATEST_TRAINING_DATA_... | 32.933485 | 481 | 0.621032 |
2f21d513fba4266c7429dbe0ad97c3d93f2190d5 | 552 | py | Python | setup.py | mpasternak/django-emailtemplates | 529e0120c8c3a58605257eff893df636a5cbf8d0 | [
"MIT"
] | 1 | 2015-05-18T13:51:08.000Z | 2015-05-18T13:51:08.000Z | setup.py | mpasternak/django-emailtemplates | 529e0120c8c3a58605257eff893df636a5cbf8d0 | [
"MIT"
] | null | null | null | setup.py | mpasternak/django-emailtemplates | 529e0120c8c3a58605257eff893df636a5cbf8d0 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
import os
from setuptools import setup
setup(name = 'django-emailtemplates',
description = 'Send e-mails using database-stored e-mail templates with Django',
version = '0.2',
author = u'Michał Pasternak - FHU Kagami',
author_email = 'michal.dtz@gmail.com',
... | 34.5 | 82 | 0.605072 |
2caa7fc019e38497ae24aa3ea0498936b014121d | 3,011 | py | Python | python_scripts/linear_models_ex_05.py | miwojc/scikit-learn-mooc | 1dd1e6110ee037c2ce9b9597d769de5eb25fcffb | [
"CC-BY-4.0"
] | 2 | 2021-09-30T11:07:28.000Z | 2021-09-30T11:07:31.000Z | python_scripts/linear_models_ex_05.py | Ravimk07/scikit-learn-mooc | c3aaf8c5a9aa4f1d749ebc1b7d5ae24619fee4bf | [
"CC-BY-4.0"
] | null | null | null | python_scripts/linear_models_ex_05.py | Ravimk07/scikit-learn-mooc | c3aaf8c5a9aa4f1d749ebc1b7d5ae24619fee4bf | [
"CC-BY-4.0"
] | null | null | null | # %% [markdown]
# # 📝 Exercise M4.05
# In the previous notebook, we presented a non-penalized logistic regression
# classifier. This classifier accepts a parameter `penalty` to add a
# regularization. The regularization strength is set using the parameter `C`.
#
# In this exercise, we ask you to train a l2-penalized l... | 31.041237 | 77 | 0.732315 |
968f225fb15828f32f42f6dddb8922c14773a89d | 2,021 | py | Python | backend/app/schemas/user.py | MyjJr/amechii | 8f68acc568f252e491115b8b1ff468b2fcb4dc92 | [
"MIT"
] | 1 | 2021-08-31T15:06:59.000Z | 2021-08-31T15:06:59.000Z | backend/app/schemas/user.py | MyjJr/Amechii | 8f68acc568f252e491115b8b1ff468b2fcb4dc92 | [
"MIT"
] | 8 | 2021-09-03T02:02:45.000Z | 2021-09-06T05:11:58.000Z | backend/app/schemas/user.py | MyjJr/amechii | 8f68acc568f252e491115b8b1ff468b2fcb4dc92 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List, Optional # , TYPE_CHECKING, Dict
from pydantic import BaseModel
from app.schemas.transaction import Transaction
from app.schemas.address import Address
from app.schemas.item import Item
class UserBase(BaseModel):
display_name: Optional[str] = None
icon: ... | 20.009901 | 58 | 0.680356 |
7e75de7a315acc5267cc57beeb7b91f7de5c251a | 1,914 | py | Python | benchmarking/utils/subprocess_with_logger.py | pritamdamania87/FAI-PEP | f5ab2272a435edd75beead651d043d4ad1e6e4d9 | [
"Apache-2.0"
] | null | null | null | benchmarking/utils/subprocess_with_logger.py | pritamdamania87/FAI-PEP | f5ab2272a435edd75beead651d043d4ad1e6e4d9 | [
"Apache-2.0"
] | null | null | null | benchmarking/utils/subprocess_with_logger.py | pritamdamania87/FAI-PEP | f5ab2272a435edd75beead651d043d4ad1e6e4d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
################################... | 37.529412 | 78 | 0.549112 |
f3982f9232a52a29897ac3c810052fd7a58b983b | 5,016 | py | Python | scout/commands/delete/delete_command.py | CHRUdeLille/scout | 0f70bec32e078d1825ebf20237f4a4979585dffb | [
"BSD-3-Clause"
] | null | null | null | scout/commands/delete/delete_command.py | CHRUdeLille/scout | 0f70bec32e078d1825ebf20237f4a4979585dffb | [
"BSD-3-Clause"
] | null | null | null | scout/commands/delete/delete_command.py | CHRUdeLille/scout | 0f70bec32e078d1825ebf20237f4a4979585dffb | [
"BSD-3-Clause"
] | null | null | null | import logging
import click
log = logging.getLogger(__name__)
@click.command('panel', short_help='Delete a gene panel')
@click.option('--panel-id',
help="The panel identifier name",
required=True
)
@click.option('-v', '--version',
type=float,
)
@click.pass_context
def panel(context, panel_id, version):
... | 30.035928 | 77 | 0.653509 |
ea04448f6920da1ddec70650bf7801f74f6efd46 | 1,496 | py | Python | docs/source/auto_examples/image/compute_smooth.py | theislab/squidpy_notebooks | 371ddeab15c26140d74da531ce7e63eda4d5ea89 | [
"MIT"
] | 9 | 2021-02-16T08:22:42.000Z | 2022-02-21T05:49:33.000Z | docs/source/auto_examples/image/compute_smooth.py | theislab/squidpy_notebooks | 371ddeab15c26140d74da531ce7e63eda4d5ea89 | [
"MIT"
] | 32 | 2021-02-14T17:10:40.000Z | 2022-03-09T20:52:26.000Z | docs/source/auto_examples/image/compute_smooth.py | theislab/squidpy_notebooks | 371ddeab15c26140d74da531ce7e63eda4d5ea89 | [
"MIT"
] | 3 | 2021-04-01T17:10:27.000Z | 2022-02-09T12:54:14.000Z | #!/usr/bin/env python
r"""
Smooth an image
---------------
This example shows how to use :func:`squidpy.im.process` to smooth an image layer of :class:`squidpy.im.ImageContainer`.
We use the argument ``method="smooth"`` to smooth the image.
This calls :func:`skimage.filters.gaussian` in the background.
Keyword argume... | 36.487805 | 120 | 0.644385 |
4b5103570b4da681b37a6c63586f59a6c9540d0d | 4,098 | py | Python | app/study/filterCandlePattern.py | kyoungd/material-stock-finder-app | 60b4a274ddb304ae8257f6a53a0d91b65975b649 | [
"MIT"
] | null | null | null | app/study/filterCandlePattern.py | kyoungd/material-stock-finder-app | 60b4a274ddb304ae8257f6a53a0d91b65975b649 | [
"MIT"
] | null | null | null | app/study/filterCandlePattern.py | kyoungd/material-stock-finder-app | 60b4a274ddb304ae8257f6a53a0d91b65975b649 | [
"MIT"
] | 1 | 2022-03-26T06:50:59.000Z | 2022-03-26T06:50:59.000Z | import pandas as pd
import numpy as np
import pandas as pd
import numpy as np
import talib
import os
from datetime import date
from util import AllStocks, StockAnalysis, EnvFile
import logging
class engulfingCandle:
def __init__(self, df, minChangePercent, minChangeValue):
data = df.loc[0:4]
self.d... | 35.327586 | 124 | 0.617862 |
7dfceffa99fee0d71c65e04b36df493ce2c79d8f | 3,804 | py | Python | src/generate.py | kljensen/uBlock-Origin-dev-filter | 40eaca8c8b8b93d309f7a0c0659021d32d5f6f2e | [
"Unlicense"
] | null | null | null | src/generate.py | kljensen/uBlock-Origin-dev-filter | 40eaca8c8b8b93d309f7a0c0659021d32d5f6f2e | [
"Unlicense"
] | null | null | null | src/generate.py | kljensen/uBlock-Origin-dev-filter | 40eaca8c8b8b93d309f7a0c0659021d32d5f6f2e | [
"Unlicense"
] | null | null | null | from glob import glob
from pathlib import Path
LINE_SEP = "\n"
def to_css_attr(url):
return url.replace("*://", "").replace("*.", ".").replace("/*", "")
def to_google(url):
return f'google.*##.g:has(a[href*="{to_css_attr(url)}"])'
def to_duckduckgo(url):
return f'duckduckgo.*##.results > div:has(a[href*... | 36.576923 | 93 | 0.458728 |
f5024800a9643d7bb8baf624cf5b3d19b143b99f | 5,976 | py | Python | ivy/functional/backends/tensorflow/linear_algebra.py | mehtamohit013/ivy | 588621c8f607d7771e7f23c7363bf4b106bbd7ab | [
"Apache-2.0"
] | 1 | 2022-02-28T19:06:12.000Z | 2022-02-28T19:06:12.000Z | ivy/functional/backends/tensorflow/linear_algebra.py | thecoder12/ivy | 84c5fb82ec43c5c7d0154d5110973805e524831c | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/tensorflow/linear_algebra.py | thecoder12/ivy | 84c5fb82ec43c5c7d0154d5110973805e524831c | [
"Apache-2.0"
] | null | null | null | # global
import tensorflow as tf
from tensorflow.python.types.core import Tensor
from typing import Union, Optional, Tuple, Literal
from collections import namedtuple
# local
from ivy import inf
import ivy
from collections import namedtuple
# Array API Standard #
# -------------------#
inv = tf.linalg.inv
pinv = tf... | 31.287958 | 117 | 0.59421 |
a27a5f5e65e08460827a70ededfdb76a1b562fcf | 2,420 | py | Python | Python/Alphabet_rangoli.py | sarathsdev/Hackerrank-Codes | 87bcafae5d11af0bf5a27c9f68e2cfc095943517 | [
"MIT"
] | null | null | null | Python/Alphabet_rangoli.py | sarathsdev/Hackerrank-Codes | 87bcafae5d11af0bf5a27c9f68e2cfc095943517 | [
"MIT"
] | null | null | null | Python/Alphabet_rangoli.py | sarathsdev/Hackerrank-Codes | 87bcafae5d11af0bf5a27c9f68e2cfc095943517 | [
"MIT"
] | null | null | null | Problem: You are given an integer N . Your task is to print an alphabet rangoli of size N . (Rangoli is a form of Indian folk art based on creation of patterns.)
#size 3
----c----
--c-b-c--
c-b-a-b-c
--c-b-c--
----c----
#size 5
--------e--------
------e-d-e------
----e-d-c-d-e----
--e-d-c-b-c-d-e--
e-d-c-b-a-b-c-d-e... | 23.960396 | 161 | 0.42438 |
d95a5bede55b463982b64db265c15da8a489c09a | 1,485 | py | Python | scenario_player/services/rpc/schemas/instances.py | hackaugusto/scenario-player | 0701bb986f47e1ec4a4fb7a469157826da1993e2 | [
"MIT"
] | null | null | null | scenario_player/services/rpc/schemas/instances.py | hackaugusto/scenario-player | 0701bb986f47e1ec4a4fb7a469157826da1993e2 | [
"MIT"
] | null | null | null | scenario_player/services/rpc/schemas/instances.py | hackaugusto/scenario-player | 0701bb986f47e1ec4a4fb7a469157826da1993e2 | [
"MIT"
] | null | null | null | from marshmallow.exceptions import ValidationError
from marshmallow.fields import String, Url
from scenario_player.constants import GAS_STRATEGIES
from scenario_player.services.common.schemas import BytesField, SPSchema
from scenario_player.services.rpc.schemas.base import RPCClientID, RPCCreateResourceSchema
class ... | 29.117647 | 94 | 0.688889 |
fbcfce854d5f46a6c219661def94a18101ef4854 | 2,943 | py | Python | capablerobot_usbhub/registers_main.py | mattvenn/CapableRobot_USBHub_Driver | 19a2eefdbb8afc7e3ebe3277f15a872b509a494d | [
"MIT"
] | 16 | 2019-07-01T23:47:22.000Z | 2022-02-14T21:16:33.000Z | capablerobot_usbhub/registers/main.py | d-c-d/CapableRobot_USBHub_Driver | 27579ac028bc2e71ce94983c7183d18fc82422a4 | [
"MIT"
] | 2 | 2020-01-08T08:30:39.000Z | 2022-02-23T00:49:09.000Z | capablerobot_usbhub/registers/main.py | d-c-d/CapableRobot_USBHub_Driver | 27579ac028bc2e71ce94983c7183d18fc82422a4 | [
"MIT"
] | 6 | 2020-01-07T15:37:23.000Z | 2022-02-07T08:25:36.000Z | # The MIT License (MIT)
#
# Copyright (c) 2019 Chris Osterwood for Capable Robot Components
#
# 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... | 27.764151 | 79 | 0.69385 |
1ba5a7a00768d4eb21c00fd65c3685b631a2b758 | 1,009 | py | Python | examples/building_custom_algorithms/mean_rating_user_item.py | PGBI/Surprise | 76e47037675afc6c0fb017490a88d1b2b2dff0f7 | [
"BSD-3-Clause"
] | 5,572 | 2016-11-24T08:21:53.000Z | 2022-03-31T20:35:00.000Z | examples/building_custom_algorithms/mean_rating_user_item.py | daihui-lu/Surprise | 46b9914995e6c8c7d227b46f2eaeef2d4600580f | [
"BSD-3-Clause"
] | 393 | 2016-11-22T12:48:00.000Z | 2022-03-26T15:09:53.000Z | examples/building_custom_algorithms/mean_rating_user_item.py | daihui-lu/Surprise | 46b9914995e6c8c7d227b46f2eaeef2d4600580f | [
"BSD-3-Clause"
] | 1,096 | 2016-12-08T22:01:57.000Z | 2022-03-29T03:55:54.000Z | """
This module descibes how to build your own prediction algorithm. Please refer
to User Guide for more insight.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from surprise import AlgoBase
from surprise import Dataset
from surpris... | 24.02381 | 77 | 0.656095 |
5bf500fed97423e4b1e1d91c5f47dc80960c4f5b | 6,247 | py | Python | CS_ex4.py | MomenK/WIDC-method | 1c49e56fea88bbb5a563a53c3fa1b4c77172b908 | [
"BSD-3-Clause"
] | null | null | null | CS_ex4.py | MomenK/WIDC-method | 1c49e56fea88bbb5a563a53c3fa1b4c77172b908 | [
"BSD-3-Clause"
] | null | null | null | CS_ex4.py | MomenK/WIDC-method | 1c49e56fea88bbb5a563a53c3fa1b4c77172b908 | [
"BSD-3-Clause"
] | null | null | null | from pylbfgs import owlqn
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import dct, idct
from cosamp_fn import cosamp
import cvxpy as cvx
from os import listdir
from scipy.signal import hilbert, chirp
from scipy import signal
from scipy import interpolate
def dct2(x):
return dct(dct(x.T, ... | 27.04329 | 86 | 0.577397 |
00927b461f6adbe317807c4364610c7d61065aac | 1,608 | py | Python | src/config.py | plasma-chat/plasma-client | e8a59d1ffa158058afab40af5fc1e889a3e4d26c | [
"MIT"
] | null | null | null | src/config.py | plasma-chat/plasma-client | e8a59d1ffa158058afab40af5fc1e889a3e4d26c | [
"MIT"
] | null | null | null | src/config.py | plasma-chat/plasma-client | e8a59d1ffa158058afab40af5fc1e889a3e4d26c | [
"MIT"
] | null | null | null | # Copyright 2022 iiPython
# Modules
import json
import socket
from typing import Any
from iipython import color, clear
# Configuration class
class Configuration(object):
def __init__(self) -> None:
self.data, self.prompted = {}, False
try:
with open("config.json", "r") as f:
... | 25.935484 | 55 | 0.536692 |
ea56a22e273b57e76b3229597ebf9cbdfe4618b9 | 1,326 | py | Python | keystone/common/sql/migrate_repo/versions/066_fixup_service_name_value.py | nuxeh/keystone | ae61c5c081e1917213ef94e33dda43ae0c9c4b55 | [
"Apache-2.0"
] | null | null | null | keystone/common/sql/migrate_repo/versions/066_fixup_service_name_value.py | nuxeh/keystone | ae61c5c081e1917213ef94e33dda43ae0c9c4b55 | [
"Apache-2.0"
] | null | null | null | keystone/common/sql/migrate_repo/versions/066_fixup_service_name_value.py | nuxeh/keystone | ae61c5c081e1917213ef94e33dda43ae0c9c4b55 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 35.837838 | 75 | 0.69457 |
d7437b46c0ef992227ee682711909c21b2a469d8 | 3,979 | py | Python | autotest/gdrivers/blx.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | autotest/gdrivers/blx.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | autotest/gdrivers/blx.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test BLX support.
# Author: Even Rouault < even dot rouault @ mines-paris dot org >
#
############################################################################... | 30.143939 | 90 | 0.562704 |
ba46c9eaf01e8f8fd5a1e5396a2312c06284e555 | 6,375 | py | Python | gpytorch/gpytorch/kernels/drug_response_kernel.py | ltronneb/PIICM | 1305232733920eef3843949ceafd53f3e19e2550 | [
"MIT"
] | null | null | null | gpytorch/gpytorch/kernels/drug_response_kernel.py | ltronneb/PIICM | 1305232733920eef3843949ceafd53f3e19e2550 | [
"MIT"
] | null | null | null | gpytorch/gpytorch/kernels/drug_response_kernel.py | ltronneb/PIICM | 1305232733920eef3843949ceafd53f3e19e2550 | [
"MIT"
] | null | null | null | from copy import deepcopy
import torch
from .kernel import Kernel
from .index_kernel import IndexKernel
from ..lazy import KroneckerProductLazyTensor, GPattKroneckerProductLazyTensor, lazify
from ..lazy.NotPSDNonLazyTensor import notpsdlazify
from ..lazy.permutation_lazy_tensor import PermutationLazyTensor
class Dr... | 53.125 | 116 | 0.599529 |
83a0118c84e0a362b93f673f52dc7cdc8b60c9bc | 1,648 | py | Python | examples/data/preprocessing/earthquake_data.py | maximlt/holoviz | 9f86c3814928225864b9119eac357682faab5f3e | [
"BSD-3-Clause"
] | 207 | 2019-11-14T08:41:44.000Z | 2022-03-31T11:26:18.000Z | examples/data/preprocessing/earthquake_data.py | maximlt/holoviz | 9f86c3814928225864b9119eac357682faab5f3e | [
"BSD-3-Clause"
] | 74 | 2019-11-21T16:39:45.000Z | 2022-02-15T16:46:51.000Z | examples/data/preprocessing/earthquake_data.py | maximlt/holoviz | 9f86c3814928225864b9119eac357682faab5f3e | [
"BSD-3-Clause"
] | 36 | 2020-01-17T08:01:53.000Z | 2022-03-11T01:33:47.000Z | import os
import pandas as pd
import calendar
import datetime as dt
import requests
URL = "https://earthquake.usgs.gov/fdsnws/event/1/query.csv?starttime={start}&endtime={end}&minmagnitude=2.0&orderby=time"
for yr in range(2000, 2019):
for m in range(1, 13):
if os.path.isfile('{yr}_{m}.csv'.format(yr=yr, ... | 35.06383 | 125 | 0.655947 |
3eea85b9cecc23bd89ceb27d5f0a5479e55de532 | 4,705 | py | Python | test/test_info_contact.py | Elen-T/python_training | 69383759e4229441657bd57af28a7a38b04d026d | [
"Apache-2.0"
] | null | null | null | test/test_info_contact.py | Elen-T/python_training | 69383759e4229441657bd57af28a7a38b04d026d | [
"Apache-2.0"
] | null | null | null | test/test_info_contact.py | Elen-T/python_training | 69383759e4229441657bd57af28a7a38b04d026d | [
"Apache-2.0"
] | null | null | null | import re
from model.contacts import Contacts
# Задание №21: Переделать тесты для проверки информации о контактах на главной странице
def test_contact_info_on_home_page(app, db):
contact_from_ui = sorted(app.contact.get_contact_list(), key=Contacts.id_or_max)
contact_from_db = sorted(db.get_contact_list(), ke... | 64.452055 | 305 | 0.692242 |
cacfcfa7423a6aacc7289323997fae0d6aff3a79 | 20,870 | py | Python | tests/test_opt.py | ponponon/loguru | d38ced7539b888e9e9db7495f49f4499b3ee77e1 | [
"MIT"
] | 11,391 | 2018-12-08T17:44:13.000Z | 2022-03-31T17:55:24.000Z | tests/test_opt.py | ponponon/loguru | d38ced7539b888e9e9db7495f49f4499b3ee77e1 | [
"MIT"
] | 610 | 2018-12-08T18:03:03.000Z | 2022-03-31T22:28:14.000Z | tests/test_opt.py | ponponon/loguru | d38ced7539b888e9e9db7495f49f4499b3ee77e1 | [
"MIT"
] | 601 | 2018-12-08T17:46:42.000Z | 2022-03-30T04:23:56.000Z | import sys
from unittest.mock import MagicMock
import pytest
from loguru import logger
from .conftest import parse
def test_record(writer):
logger.add(writer, format="{message}")
logger.opt(record=True).debug("1")
logger.opt(record=True).debug("2 {record[level]}")
logger.opt(record=True).log(11, "... | 34.667774 | 100 | 0.641591 |
0844207decb3a376d443046edefedc5115d873cd | 906 | py | Python | hue_bridge/logger.py | SmartEnergyPlatform/hue-bridge-connector | c3efd650fc6312b9f6ed312e3e5dad2ffb467c1e | [
"Apache-2.0"
] | null | null | null | hue_bridge/logger.py | SmartEnergyPlatform/hue-bridge-connector | c3efd650fc6312b9f6ed312e3e5dad2ffb467c1e | [
"Apache-2.0"
] | null | null | null | hue_bridge/logger.py | SmartEnergyPlatform/hue-bridge-connector | c3efd650fc6312b9f6ed312e3e5dad2ffb467c1e | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 InfAI (CC SES)
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... | 33.555556 | 76 | 0.759382 |
e58e2461b239fdfcce50c6936f123e5e15d0930a | 4,464 | py | Python | label_studio/tests/test_api_integration.py | xhuaustc/label-studio | b787824a9e16f488a9b4cd2cef83e1ac526a64f3 | [
"Apache-2.0"
] | 3 | 2021-07-16T03:48:21.000Z | 2022-01-10T04:58:25.000Z | label_studio/tests/test_api_integration.py | xhuaustc/label-studio | b787824a9e16f488a9b4cd2cef83e1ac526a64f3 | [
"Apache-2.0"
] | 6 | 2022-02-21T15:19:35.000Z | 2022-03-07T15:25:16.000Z | label_studio/tests/test_api_integration.py | xhuaustc/label-studio | b787824a9e16f488a9b4cd2cef83e1ac526a64f3 | [
"Apache-2.0"
] | 1 | 2021-05-24T15:46:08.000Z | 2021-05-24T15:46:08.000Z | """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import pytest
import yaml
import json
import io
import os
import time
from rest_framework.authtoken.models import Token
from rest_framework.test i... | 36.590164 | 168 | 0.705645 |
4e42e50a87c503ce148316a8812f5e44eeed6965 | 11,237 | py | Python | sympy/combinatorics/graycode.py | MartinThoma/sympy | 009d0031bec7222ffa472e52148a2b4e441cd3a5 | [
"BSD-3-Clause"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | sympy/combinatorics/graycode.py | mmelotti/sympy | bea29026d27cc50c2e6a5501b6a70a9629ed3e18 | [
"BSD-3-Clause"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | sympy/combinatorics/graycode.py | mmelotti/sympy | bea29026d27cc50c2e6a5501b6a70a9629ed3e18 | [
"BSD-3-Clause"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | from sympy.core import Basic
import random
class GrayCode(Basic):
"""
A Gray code is essentially a Hamiltonian walk on
a n-dimensional cube with edge length of one.
The vertices of the cube are represented by vectors
whose values are binary. The Hamilton walk visits
each vertex exactly once. ... | 26.071926 | 80 | 0.51633 |
ed7164aac1415d9f22fdd5c061de4ccbb4eea124 | 2,771 | py | Python | lc0819_most_common_word.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | 8 | 2019-03-18T06:37:24.000Z | 2022-01-30T07:50:58.000Z | lc0819_most_common_word.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | lc0819_most_common_word.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | """Leetcode 819. Most Common Word
Easy
URL: https://leetcode.com/problems/most-common-word/
Given a paragraph and a list of banned words, return the most frequent word that
is not in the list of banned words.
It is guaranteed there is at least one word that isn't banned,
and that the answer is unique.
Words in the l... | 29.795699 | 82 | 0.64345 |
6bcb5283074e22d69dd539986eebec81d1af7366 | 8,358 | py | Python | sequencers/tests/test_api_views.py | bihealth/digestiflow-server | 298c53f95dbf56e7be0d0b8bcceacabc21257d5f | [
"MIT"
] | 13 | 2019-11-27T19:12:15.000Z | 2021-12-01T21:32:18.000Z | sequencers/tests/test_api_views.py | bihealth/digestiflow-server | 298c53f95dbf56e7be0d0b8bcceacabc21257d5f | [
"MIT"
] | 60 | 2019-03-27T14:43:19.000Z | 2022-03-22T09:12:53.000Z | sequencers/tests/test_api_views.py | bihealth/digestiflow-server | 298c53f95dbf56e7be0d0b8bcceacabc21257d5f | [
"MIT"
] | 3 | 2020-11-09T07:08:42.000Z | 2022-02-09T11:37:54.000Z | # TODO: check timeline events
import json
from test_plus.test import APITestCase
from digestiflow.test_utils import SetupUserMixin, SetupProjectMixin, AuthenticatedRequestMixin
from ..models import SequencingMachine
from ..tests import SetupSequencingMachineMixin
class SequencingMachineListCreateApiViewTest(
Se... | 43.989474 | 99 | 0.679229 |
9ddbb45c8b304bfb8948b46b219e56621970635d | 620 | py | Python | mainapp/migrations/0001_initial.py | grebenshchikovr/Django_HW | 779dc75839a47920eebdfb96f31a3d4cacce9045 | [
"MIT"
] | null | null | null | mainapp/migrations/0001_initial.py | grebenshchikovr/Django_HW | 779dc75839a47920eebdfb96f31a3d4cacce9045 | [
"MIT"
] | null | null | null | mainapp/migrations/0001_initial.py | grebenshchikovr/Django_HW | 779dc75839a47920eebdfb96f31a3d4cacce9045 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-14 19:44
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ProductCategory',
fields=[
('id', models.Au... | 26.956522 | 114 | 0.6 |
bb02ead662c48590d7b43a547c238c824532e5a6 | 119 | py | Python | WebsiteScanning/Web Scanning.py | SudhansuShakya/Python | 83b369dcc91e3197bc6116cb3aba29edd0fdbf00 | [
"Unlicense"
] | null | null | null | WebsiteScanning/Web Scanning.py | SudhansuShakya/Python | 83b369dcc91e3197bc6116cb3aba29edd0fdbf00 | [
"Unlicense"
] | null | null | null | WebsiteScanning/Web Scanning.py | SudhansuShakya/Python | 83b369dcc91e3197bc6116cb3aba29edd0fdbf00 | [
"Unlicense"
] | null | null | null | import urllib.request
url=input("Enter Url: ")
text=urllib.request.urlopen(url)
print(text.read().decode('utf-8'))
| 23.8 | 35 | 0.714286 |
eaac8c11d4e127749882179ec9a83f22e1f17027 | 438 | py | Python | tests/test_symbol_parser.py | Johnabell/latex2mathml | 2eea4ec348b1cc3d98e9705a568fa7e6981eeed1 | [
"MIT"
] | null | null | null | tests/test_symbol_parser.py | Johnabell/latex2mathml | 2eea4ec348b1cc3d98e9705a568fa7e6981eeed1 | [
"MIT"
] | null | null | null | tests/test_symbol_parser.py | Johnabell/latex2mathml | 2eea4ec348b1cc3d98e9705a568fa7e6981eeed1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# __author__ = "Ronie Martinez"
# __copyright__ = "Copyright 2016-2019, Ronie Martinez"
# __credits__ = ["Ronie Martinez"]
# __license__ = "MIT"
# __maintainer__ = "Ronie Martinez"
# __email__ = "ronmarti18@gmail.com"
from latex2mathml.symbols_parser import convert_symbol
def test_operator_plus(... | 25.764706 | 55 | 0.726027 |
83b19fdacb2cefd3e8eb389bfafe8b85f16347b2 | 1,320 | py | Python | app/pylib/tf_rl/utils/geometry.py | mingkaic/rocnnet | b0e6b9ef1b80ee3d33d68f48dd051a99c2df39ab | [
"MIT"
] | 3 | 2017-01-18T20:42:56.000Z | 2018-11-07T12:56:15.000Z | app/pylib/tf_rl/utils/geometry.py | mingkaic/rocnnet | b0e6b9ef1b80ee3d33d68f48dd051a99c2df39ab | [
"MIT"
] | 10 | 2016-12-01T08:15:28.000Z | 2018-09-28T17:16:32.000Z | app/pylib/tf_rl/utils/geometry.py | mingkaic/rocnnet | b0e6b9ef1b80ee3d33d68f48dd051a99c2df39ab | [
"MIT"
] | null | null | null | """
This module assumes that all geometrical points are
represented as 1D numpy arrays.
It was designed and tested on 2D points,
but if you try it on 3D points you may
be pleasantly surprised ;-)
"""
import numpy as np
def point_distance(x, y):
"""Returns euclidean distance between points x and y"""
return np.lin... | 31.428571 | 91 | 0.777273 |
23a2753f1b19c260bbb933ccf92ce53c2a06861e | 30,049 | py | Python | InceptionV3.py | krishnateja95/Quantization-Test_bed | efdf1fd207d1012a5b1f299952a7837f3cc40f5a | [
"MIT"
] | null | null | null | InceptionV3.py | krishnateja95/Quantization-Test_bed | efdf1fd207d1012a5b1f299952a7837f3cc40f5a | [
"MIT"
] | null | null | null | InceptionV3.py | krishnateja95/Quantization-Test_bed | efdf1fd207d1012a5b1f299952a7837f3cc40f5a | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import argparse
import pickle as pkl
import cv2
import tqdm
import h5py
import sys
def quantize_weights(weights):
abs_weights = np.abs(weights)
vmax = np.max(abs_weights)
s = vmax / 127.
qweights = weights / s
qweights = np.round(qweights)
qweights = q... | 48.0784 | 127 | 0.598988 |
56ff69de5c0b77597019e7ce269a5c5386a35249 | 1,519 | py | Python | uocsecrets/forum/urls.py | jeff-zqiu/uocweb | bb6e99a7ab01c9634f8b8446127c4bd1c0701388 | [
"MIT"
] | 1 | 2018-09-24T13:32:06.000Z | 2018-09-24T13:32:06.000Z | uocsecrets/forum/urls.py | jeff-zqiu/uocweb | bb6e99a7ab01c9634f8b8446127c4bd1c0701388 | [
"MIT"
] | null | null | null | uocsecrets/forum/urls.py | jeff-zqiu/uocweb | bb6e99a7ab01c9634f8b8446127c4bd1c0701388 | [
"MIT"
] | null | null | null | from django.urls import path, include
from . import views
from django.views.generic import TemplateView
app_name = 'forum'
urlpatterns = [
# /forum/
path('about/', TemplateView.as_view(template_name='forum/about.html'),name='about'),
path('', views.IndexView.as_view(), name = 'index'),
path('top/', ... | 41.054054 | 97 | 0.631995 |
3b85930f3ab0a4bf91bbe545bc4374025b56e750 | 6,302 | py | Python | netcam_aioeos/topology/eos_check_lags.py | jeremyschulman/netcam-aioeos | ae8b46bcef1bbd86441342a9a282e404d597d662 | [
"Apache-2.0"
] | null | null | null | netcam_aioeos/topology/eos_check_lags.py | jeremyschulman/netcam-aioeos | ae8b46bcef1bbd86441342a9a282e404d597d662 | [
"Apache-2.0"
] | null | null | null | netcam_aioeos/topology/eos_check_lags.py | jeremyschulman/netcam-aioeos | ae8b46bcef1bbd86441342a9a282e404d597d662 | [
"Apache-2.0"
] | 1 | 2022-01-04T19:55:12.000Z | 2022-01-04T19:55:12.000Z | # Copyright 2021 Jeremy Schulman
#
# 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 ... | 36.639535 | 86 | 0.570295 |
bb48fef753953e1e2be4638951fc417d3dc2a339 | 2,773 | py | Python | azure-mgmt-web/azure/mgmt/web/models/user.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-web/azure/mgmt/web/models/user.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-web/azure/mgmt/web/models/user.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.779412 | 165 | 0.646592 |
656b8656d705bec7dd99d22103e7fcc00a54bf46 | 1,305 | py | Python | figures/cosmo_cost_accuracy_tradeoff.py | deepsphere/paper-deepsphere-iclr2020 | 9d3287bfdbb681760d5d1f8138121838138532ad | [
"CC-BY-4.0"
] | 2 | 2021-08-19T17:31:14.000Z | 2021-11-14T19:21:34.000Z | figures/cosmo_cost_accuracy_tradeoff.py | deepsphere/paper-deepsphere-iclr2020 | 9d3287bfdbb681760d5d1f8138121838138532ad | [
"CC-BY-4.0"
] | null | null | null | figures/cosmo_cost_accuracy_tradeoff.py | deepsphere/paper-deepsphere-iclr2020 | 9d3287bfdbb681760d5d1f8138121838138532ad | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
from os import path
from matplotlib import pyplot as plt
#plt.rc('font', family='Latin Modern Roman') # Latin Modern for text
plt.rc('mathtext', fontset='cm') # Computer Modern for math (default is dejavusans)
# plt.rc('text', usetex=True)
# plt.rc('text.latex', preamble=r'\usepackage{lmoder... | 33.461538 | 87 | 0.63908 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.