hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 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 4 247 | max_forks_repo_name stringlengths 4 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41c89d4d6a3f83e0d87b29709e9ad59fbb4e09ba | 3,437 | py | Python | app/gaqqie_sky/resource/db.py | gaqqie/gaqqie-sky | 9f55a58870e416d0646e3ac73998d430d51bde39 | [
"Apache-2.0"
] | 1 | 2021-08-31T05:18:09.000Z | 2021-08-31T05:18:09.000Z | app/gaqqie_sky/resource/db.py | gaqqie/gaqqie-sky | 9f55a58870e416d0646e3ac73998d430d51bde39 | [
"Apache-2.0"
] | null | null | null | app/gaqqie_sky/resource/db.py | gaqqie/gaqqie-sky | 9f55a58870e416d0646e3ac73998d430d51bde39 | [
"Apache-2.0"
] | null | null | null | from typing import List
# cash of boto3 objects of dynamodb tables
cash = dict()
def insert(table_name: str, record: dict) -> None:
"""insert a record.
Parameters
----------
table_name : str
table name to insert record.
record : dict
record to insert.
"""
table = _get_re... | 25.087591 | 83 | 0.631074 | from typing import List
from datetime import datetime
from decimal import Decimal
import json
import boto3
# cash of boto3 objects of dynamodb tables
cash = dict()
def _get_resource(resource_name: str):
if resource_name not in cash:
dynamodb = boto3.resource("dynamodb")
resource_obj = dynamodb.T... | 0 | 0 | 0 | 0 | 0 | 1,207 | 0 | -5 | 181 |
2cdf6e95f79225f6a6f40577a18cd137d7ea8c5b | 2,550 | py | Python | app/__init__.py | gem-net/portal | 7000e2b133e73b30ec4d58880cc74e3be4535c8e | [
"MIT"
] | null | null | null | app/__init__.py | gem-net/portal | 7000e2b133e73b30ec4d58880cc74e3be4535c8e | [
"MIT"
] | null | null | null | app/__init__.py | gem-net/portal | 7000e2b133e73b30ec4d58880cc74e3be4535c8e | [
"MIT"
] | null | null | null | import os
import sys
import logging
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_moment import Moment
import pandas as pd
from .config import config
logging.basicConfig(level=logging.I... | 24.519231 | 84 | 0.708235 | import os
import sys
from datetime import datetime
import logging
from flask import Flask, g, current_app
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, current_user
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_moment import Moment
import pandas as pd
fro... | 0 | 308 | 0 | 0 | 0 | 604 | 0 | 49 | 182 |
d5d2f4775e2d851fd9c0b699a9676b205b6e7f11 | 5,033 | py | Python | src/juliet/__init__.py | jheddings/porky | b082a14e2891b7fb1b2d4db3de067b6384de8d01 | [
"MIT"
] | 4 | 2021-03-19T16:45:24.000Z | 2022-03-22T02:15:51.000Z | src/juliet/__init__.py | jheddings/porky | b082a14e2891b7fb1b2d4db3de067b6384de8d01 | [
"MIT"
] | null | null | null | src/juliet/__init__.py | jheddings/porky | b082a14e2891b7fb1b2d4db3de067b6384de8d01 | [
"MIT"
] | null | null | null | ##
# juliet - Copyright (c) Jason Heddings. All rights reserved.
# Licensed under the MIT License. See LICENSE for full terms.
##
VERSION = '0.1.1'
################################################################################
| 35.95 | 85 | 0.467713 | ##
# juliet - Copyright (c) Jason Heddings. All rights reserved.
# Licensed under the MIT License. See LICENSE for full terms.
##
VERSION = '0.1.1'
import time
import logging
import irc.bot
from datetime import datetime, timezone
from .event import Event
from .message import MessageBuffer, Message, TextMessage, Cha... | 8 | 0 | 0 | 4,594 | 0 | 0 | 0 | 48 | 157 |
c1c97aca961de3c3c9b6eb260786eebd98b1b1b7 | 465 | py | Python | feed/migrations/0002_auto_20210327_1310.py | hossn75/PhotoShare-Django-Api | e381d72676b4c61e4487123aba93b400784e296d | [
"Apache-2.0"
] | null | null | null | feed/migrations/0002_auto_20210327_1310.py | hossn75/PhotoShare-Django-Api | e381d72676b4c61e4487123aba93b400784e296d | [
"Apache-2.0"
] | null | null | null | feed/migrations/0002_auto_20210327_1310.py | hossn75/PhotoShare-Django-Api | e381d72676b4c61e4487123aba93b400784e296d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.6 on 2021-03-27 17:10
| 21.136364 | 51 | 0.556989 | # Generated by Django 3.1.6 on 2021-03-27 17:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('feed', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='comment',
options={'ordering': ['comment_date']... | 0 | 0 | 0 | 359 | 0 | 0 | 0 | 11 | 46 |
313e4d4f9d08cc7c907f88b214b5e28bc25ae4fe | 6,493 | py | Python | isitfit/cost/redshift_common.py | autofitcloud/isitf | 6ffc0c67c00140120f5d5ad8dfe11c8f0f7dacc1 | [
"Apache-2.0"
] | 82 | 2019-09-04T17:39:10.000Z | 2021-08-10T14:59:18.000Z | isitfit/cost/redshift_common.py | autofitcloud/isitf | 6ffc0c67c00140120f5d5ad8dfe11c8f0f7dacc1 | [
"Apache-2.0"
] | 11 | 2019-09-10T03:54:19.000Z | 2020-02-21T22:58:44.000Z | isitfit/cost/redshift_common.py | autofitcloud/isitf | 6ffc0c67c00140120f5d5ad8dfe11c8f0f7dacc1 | [
"Apache-2.0"
] | 9 | 2019-09-13T15:57:42.000Z | 2021-02-13T15:56:40.000Z | # redshift pricing as of 2019-11-12 in USD per hour, on-demand, ohio
# https://aws.amazon.com/redshift/pricing/
# AWS_DEFAULT_REGION=us-east-2 python3 -m isitfit.cost.test_redshift
# Related
# https://docs.datadoghq.com/integrations/amazon_redshift/
# https://boto3.amazonaws.com/v1/documentation/api/latest/refere... | 28.986607 | 126 | 0.729247 | # redshift pricing as of 2019-11-12 in USD per hour, on-demand, ohio
# https://aws.amazon.com/redshift/pricing/
from isitfit.cost.catalog_redshift import redshiftPricing_dict
from isitfit.cost.base_iterator import BaseIterator
class RedshiftPerformanceIterator(BaseIterator):
service_name = 'redshift'
service_des... | 0 | 0 | 0 | 2,350 | 0 | 0 | 0 | 115 | 204 |
df26715bbc59eaaba2485c3fdc049f0452f075c3 | 17,088 | py | Python | cwto_examples/run_sim.py | sbelo/rlpyt | 6995090f0dd1eb45be8403635172aca277397d44 | [
"MIT"
] | null | null | null | cwto_examples/run_sim.py | sbelo/rlpyt | 6995090f0dd1eb45be8403635172aca277397d44 | [
"MIT"
] | null | null | null | cwto_examples/run_sim.py | sbelo/rlpyt | 6995090f0dd1eb45be8403635172aca277397d44 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
import argparse
import wandb
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--game', help='name of env', default='hiv', type=str, choices=['cartpole','hiv','heparin','halfcheetah'])
parser.add_argument... | 51.93921 | 393 | 0.682292 | from rlpyt.cwto_samplers.serial.sampler import SerialSampler
from rlpyt.cwto_samplers.parallel.cpu.sampler import CpuSampler
from rlpyt.algos.pg.ppo import PPO
from rlpyt.algos.qpg.sac_beta import SACBeta
from rlpyt.agents.qpg.sac_agent_beta import SacAgentBeta
from rlpyt.algos.qpg.sac import SAC
from rlpyt.agent... | 0 | 0 | 0 | 0 | 0 | 12,283 | 0 | 651 | 788 |
2a37abe88a439640f8849b7cd996e64b144ee341 | 148 | py | Python | discord/ext/commands/params.py | kuzaku-developers/disnake | 61cc1ad4c2bafd39726a1447c85f7e469e41af10 | [
"MIT"
] | null | null | null | discord/ext/commands/params.py | kuzaku-developers/disnake | 61cc1ad4c2bafd39726a1447c85f7e469e41af10 | [
"MIT"
] | null | null | null | discord/ext/commands/params.py | kuzaku-developers/disnake | 61cc1ad4c2bafd39726a1447c85f7e469e41af10 | [
"MIT"
] | null | null | null | from disnake.ext.commands.params import __dict__ as __original_dict__
locals().update(__original_dict__)
| 29.6 | 69 | 0.837838 | from disnake.ext.commands.params import *
from disnake.ext.commands.params import __dict__ as __original_dict__
locals().update(__original_dict__)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 22 |
dded92d8180cf957b53b157ce49b5f8caab9dba9 | 4,035 | py | Python | easyscan_app/lib/spacer.py | birkin/easyscan | 1165114a0d8e2be4b21c9a25d256bd78ff9c7e64 | [
"MIT"
] | null | null | null | easyscan_app/lib/spacer.py | birkin/easyscan | 1165114a0d8e2be4b21c9a25d256bd78ff9c7e64 | [
"MIT"
] | 40 | 2015-01-05T21:33:45.000Z | 2020-09-24T18:44:12.000Z | easyscan_app/lib/spacer.py | birkin/easyscan | 1165114a0d8e2be4b21c9a25d256bd78ff9c7e64 | [
"MIT"
] | 1 | 2022-01-08T16:41:04.000Z | 2022-01-08T16:41:04.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
log = logging.getLogger(__name__)
| 43.858696 | 195 | 0.601239 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
log = logging.getLogger(__name__)
class Spacer( object ):
""" Manages left-justified spacer code. """
def __init__( self ):
self.notes_line_length = 50
self.spacer_character = ' '
def add_spacer( self, st... | 0 | 0 | 0 | 3,894 | 0 | 0 | 0 | 0 | 23 |
087429ab7a4df2ee4d2bbf5f37e8321843275811 | 2,069 | py | Python | wave-app/src/app.py | kavindasr/challenge-wildfires | ef3364c5a9f6bfd36964b49bbda76dfa970705de | [
"Apache-2.0"
] | 10 | 2021-11-05T15:03:59.000Z | 2022-02-16T06:58:07.000Z | wave-app/src/app.py | kavindasr/challenge-wildfires | ef3364c5a9f6bfd36964b49bbda76dfa970705de | [
"Apache-2.0"
] | 1 | 2022-02-10T03:37:52.000Z | 2022-02-10T03:37:52.000Z | wave-app/src/app.py | kavindasr/challenge-wildfires | ef3364c5a9f6bfd36964b49bbda76dfa970705de | [
"Apache-2.0"
] | 7 | 2021-11-18T18:19:08.000Z | 2022-02-10T07:51:13.000Z |
# A FLEX LAYOUT FOR AN ADAPTIVE UI
# Handler for tab content.
| 31.830769 | 115 | 0.582407 | from h2o_wave import main, app, Q, ui
from .ui_utils import *
from .initializers import *
from . import data, model, predict
@app('/')
async def serve(q: Q):
# Initialize app and client if not already initialized.
if not q.app.initialized:
await init_app(q)
if not q.client.initialized:
aw... | 0 | 346 | 1,466 | 0 | 0 | 0 | 0 | 37 | 156 |
38657436625b4c39cc5573c92b4f013916031bbf | 1,716 | py | Python | ctp_integration/scripts/plot_trajectory.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 66 | 2018-10-31T04:58:53.000Z | 2022-03-17T02:32:25.000Z | ctp_integration/scripts/plot_trajectory.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 8 | 2018-10-23T21:19:25.000Z | 2018-12-03T02:08:41.000Z | ctp_integration/scripts/plot_trajectory.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 25 | 2018-10-19T00:54:17.000Z | 2021-10-10T08:28:15.000Z |
'''
Usage
python plot_trajectory --filename <path to file>
If data collector is modified, use extra arguments to modify
pose_name: topic name of pose in h5f data
action_name: topic of action name
label_name: topic of label
Due to my configuration, I need to use python2 instead of python
I think life will be eas... | 27.677419 | 82 | 0.724359 | import argparse
import numpy as np
import h5py
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
'''
Usage
python plot_trajectory --filename <path to file>
If data collector is modified, use extra arguments to modify
pose_name: topic name of pose in h5f data
action_name: topic of action name... | 0 | 0 | 0 | 0 | 0 | 1,140 | 0 | 9 | 157 |
393e0b826a0fb9f5e864a5ec04a9559c617e72f0 | 3,149 | py | Python | evaluate_sepp_nlg_2021_subtask2.py | jordimas/fullstop-deep-punctuation-prediction | b776dc91fee52fe35d4ee4b098678144eea3078c | [
"MIT"
] | null | null | null | evaluate_sepp_nlg_2021_subtask2.py | jordimas/fullstop-deep-punctuation-prediction | b776dc91fee52fe35d4ee4b098678144eea3078c | [
"MIT"
] | null | null | null | evaluate_sepp_nlg_2021_subtask2.py | jordimas/fullstop-deep-punctuation-prediction | b776dc91fee52fe35d4ee4b098678144eea3078c | [
"MIT"
] | null | null | null | """
Evaluate subtask 2 of SEPP-NLG 2021: https://sites.google.com/view/sentence-segmentation/
"""
__author__ = 'don.tuggener@zhaw.ch'
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description='Evaluate subtask 1 of SEPP-NLG 2021')
parser.add_argument("data_zip", help="path ... | 48.446154 | 159 | 0.66148 | """
Evaluate subtask 2 of SEPP-NLG 2021: https://sites.google.com/view/sentence-segmentation/
"""
__author__ = 'don.tuggener@zhaw.ch'
import io
import os
import matplotlib.pyplot as plt
from zipfile import ZipFile
from sklearn.metrics import classification_report, confusion_matrix, ConfusionMatrixDisplay
def evalua... | 0 | 0 | 0 | 0 | 0 | 2,034 | 0 | 62 | 134 |
130fdbc14365474133fe3f8835eca942861bfd89 | 1,277 | py | Python | clover_simulation/src/clover_simulation/map_parser.py | vas0x59/clover | 513f4f419a6a2de476d2838db5c1c244de6b3e44 | [
"MIT"
] | 146 | 2020-05-04T10:11:43.000Z | 2022-03-28T04:41:57.000Z | clover_simulation/src/clover_simulation/map_parser.py | vas0x59/clover | 513f4f419a6a2de476d2838db5c1c244de6b3e44 | [
"MIT"
] | 132 | 2017-07-23T11:49:11.000Z | 2020-04-09T01:15:53.000Z | clover_simulation/src/clover_simulation/map_parser.py | vas0x59/clover | 513f4f419a6a2de476d2838db5c1c244de6b3e44 | [
"MIT"
] | 149 | 2020-04-28T07:45:25.000Z | 2022-03-30T13:48:01.000Z | # ArUco map parser (should be kept in sync with aruco_pose)
from .marker import Marker
def _parse_line(line):
'''
Parse a line of map data, returning a Marker object if
parsing succeeded, or None if it failed.
'''
if line.startswith('#'):
return None
elems = line.split()
if len(el... | 27.76087 | 77 | 0.584182 | # ArUco map parser (should be kept in sync with aruco_pose)
from .marker import Marker
def _parse_line(line):
'''
Parse a line of map data, returning a Marker object if
parsing succeeded, or None if it failed.
'''
if line.startswith('#'):
return None
elems = line.split()
if len(el... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4253156f160c0b72e83b32a339c2e5ff6cfe541d | 702 | py | Python | sort/bubbling/BubbleSort.py | zlikun/zlikun-algorithm-python | 257d4004b9b8f66a313c751ca83b11fadeed742a | [
"Apache-2.0"
] | null | null | null | sort/bubbling/BubbleSort.py | zlikun/zlikun-algorithm-python | 257d4004b9b8f66a313c751ca83b11fadeed742a | [
"Apache-2.0"
] | null | null | null | sort/bubbling/BubbleSort.py | zlikun/zlikun-algorithm-python | 257d4004b9b8f66a313c751ca83b11fadeed742a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -- coding: utf-8 --
"""
@AUTHOR : zlikun <zlikun-dev@hotmail.com>
@DATE : 2019/03/07 10:08:49
@DESC :
"""
numbers = [8, 231, 244, 32, 221, 248, 8, 153, 142, 235]
if __name__ == '__main__':
# [8, 231, 244, 32, 221, 248, 8, 153, 142, 235]
print('', numbers)
#
bubble_sort... | 24.206897 | 56 | 0.531339 | #!/usr/bin/env python
# -- coding: utf-8 --
"""
@AUTHOR : zlikun <zlikun-dev@hotmail.com>
@DATE : 2019/03/07 10:08:49
@DESC : 冒泡排序
"""
numbers = [8, 231, 244, 32, 221, 248, 8, 153, 142, 235]
def bubble_sort(lst: "list"):
length = len(lst)
# 外层控制比较轮数
for i in range(length - 1):
# 内层控制每轮比较,大数向右... | 183 | 0 | 0 | 0 | 0 | 212 | 0 | 0 | 23 |
dab2c7e59fd76bc9c97130a03c4035871f2326e4 | 1,676 | py | Python | mafipy/function/tests/test_local_vol.py | i05nagai/mafipy | ea7312065b8abea4c7054203176269637ff346ca | [
"MIT"
] | 6 | 2017-01-15T05:05:09.000Z | 2020-12-29T20:03:37.000Z | mafipy/function/tests/test_local_vol.py | i05nagai/mafipy | ea7312065b8abea4c7054203176269637ff346ca | [
"MIT"
] | 77 | 2016-12-03T12:54:42.000Z | 2018-06-15T14:44:14.000Z | mafipy/function/tests/test_local_vol.py | i05nagai/mafipy | ea7312065b8abea4c7054203176269637ff346ca | [
"MIT"
] | 3 | 2016-12-17T11:09:38.000Z | 2017-11-05T09:15:02.000Z | #!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
| 24.647059 | 67 | 0.563246 | #!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from pytest import approx
import mafipy.function.local_vol as target
class TestLocalVol(object):
# before all tests starts
@classmethod
def setup_class(cls):
pass
# after all tests finish... | 0 | 63 | 0 | 1,415 | 0 | 0 | 0 | 25 | 68 |
a76b275e81fa69530961fc47655428f3ee42d919 | 29,650 | py | Python | csv_addon/profile_creator.py | daudef/sql-orm | 191e53dba65cf4c14574a8db7dec92d55c8d9fcc | [
"MIT"
] | 1 | 2022-03-04T10:41:47.000Z | 2022-03-04T10:41:47.000Z | csv_addon/profile_creator.py | daudef/sql-orm | 191e53dba65cf4c14574a8db7dec92d55c8d9fcc | [
"MIT"
] | null | null | null | csv_addon/profile_creator.py | daudef/sql-orm | 191e53dba65cf4c14574a8db7dec92d55c8d9fcc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from __future__ import annotations
try:
except ModuleNotFoundError:
import sys
sys.path[0] += "/.."
from database import choose_database
from typing import TypeVar
NORMAL_CSV_METHOD_NAME = "Normal CSV"
CONSTANT_METHOD_NAME = "Constant"
AUTO_DETECTED_TYPES: list[PythonType] = [
St... | 47.977346 | 222 | 0.63484 | #!/usr/bin/env python3
from __future__ import annotations
try:
import csv_addon.csv_profile #type: ignore
except ModuleNotFoundError:
import sys
sys.path[0] += "/.."
from csv import DictReader
from csv_addon.util import find_csv_delimiter
from database import choose_database
from typing import Callable,... | 0 | 65 | 0 | 2,012 | 6,117 | 19,477 | 0 | 425 | 786 |
427064077f0fe081789e8e5e3faae048a84a42bc | 1,029 | py | Python | src/bxgateway/connections/eth/eth_remote_connection.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 21 | 2019-11-06T17:37:41.000Z | 2022-03-28T07:18:33.000Z | src/bxgateway/connections/eth/eth_remote_connection.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 4 | 2019-11-06T22:08:00.000Z | 2021-12-08T06:20:51.000Z | src/bxgateway/connections/eth/eth_remote_connection.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 10 | 2020-08-05T15:58:16.000Z | 2022-02-07T23:51:10.000Z | from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 41.16 | 97 | 0.811467 | from typing import TYPE_CHECKING
from bxcommon.connections.connection_type import ConnectionType
from bxcommon.network.abstract_socket_connection_protocol import AbstractSocketConnectionProtocol
from bxgateway.connections.eth.eth_base_connection import EthBaseConnection
from bxgateway.connections.eth.eth_remote_connec... | 0 | 0 | 0 | 543 | 0 | 0 | 0 | 295 | 138 |
0ab3585ba6b38b7e37e0d4576ff09fce31d388f5 | 5,960 | py | Python | middleman/callbacks.py | elokapina/middleman | 53a1dbcc24ca852706ca8a0c98d65a6e3d5c1794 | [
"Apache-2.0"
] | 9 | 2020-12-19T17:01:52.000Z | 2022-03-24T16:02:28.000Z | middleman/callbacks.py | elokapina/middleman | 53a1dbcc24ca852706ca8a0c98d65a6e3d5c1794 | [
"Apache-2.0"
] | 21 | 2020-12-19T19:11:26.000Z | 2022-02-26T21:19:42.000Z | middleman/callbacks.py | elokapina/middleman | 53a1dbcc24ca852706ca8a0c98d65a6e3d5c1794 | [
"Apache-2.0"
] | 3 | 2021-02-04T11:05:00.000Z | 2022-03-19T09:24:46.000Z | import logging
# noinspection PyPackageRequirements
logger = logging.getLogger(__name__)
DUPLICATES_CACHE_SIZE = 1000
| 37.018634 | 110 | 0.627517 | import logging
# noinspection PyPackageRequirements
from nio import JoinError, MatrixRoom, Event
from middleman.bot_commands import Command
from middleman.chat_functions import send_text_to_room
from middleman.message_responses import Message
from middleman.utils import with_ratelimit
logger = logging.getLogger(__na... | 0 | 0 | 4,296 | 1,284 | 0 | 0 | 0 | 124 | 134 |
c7e844e626e71616b17d6f335ccbd3fd31f66ec1 | 1,981 | py | Python | image_vector_distort_test.py | spencels/mnist_cnn | 80ffcae1a453e38c571b62d3e70dd69dc32bfced | [
"MIT"
] | null | null | null | image_vector_distort_test.py | spencels/mnist_cnn | 80ffcae1a453e38c571b62d3e70dd69dc32bfced | [
"MIT"
] | 9 | 2020-01-28T21:40:22.000Z | 2021-02-02T21:43:07.000Z | image_vector_distort_test.py | spencels/mnist_cnn | 80ffcae1a453e38c571b62d3e70dd69dc32bfced | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.python.platform import test
image_vector_distort = tf.load_op_library('bin/image_vector_distort.so')
def expand_to_4d(image):
"""Expands 2d image tensor to 4d."""
return tf.expand_dims(tf.expand_dims(image, 0), 3)
if __name__ == '__main__':
test.main() | 27.901408 | 72 | 0.603231 | import math
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import test
image_vector_distort = tf.load_op_library('bin/image_vector_distort.so')
def expand_to_4d(image):
"""Expands 2d image tensor to 4d."""
return tf.expand_dims(tf.expand_dims(image, 0), 3)
class ImageVectorDistortTes... | 0 | 0 | 0 | 1,625 | 0 | 0 | 0 | -13 | 68 |
609b1ffd39d7f3b1b52f1724d2a5ea80d998a10c | 4,827 | py | Python | models/layers/uper_head.py | usama13o/codeServerEPI | de00366799ae533948b9318d05eaf44802b20fc4 | [
"MIT"
] | null | null | null | models/layers/uper_head.py | usama13o/codeServerEPI | de00366799ae533948b9318d05eaf44802b20fc4 | [
"MIT"
] | null | null | null | models/layers/uper_head.py | usama13o/codeServerEPI | de00366799ae533948b9318d05eaf44802b20fc4 | [
"MIT"
] | null | null | null | from models.networks.utils import conv2DBatchNormRelu
import torch.nn as nn
ConvModule = conv2DBatchNormRelu
| 31.966887 | 83 | 0.559975 | from models.layers.decode_head import BaseDecodeHead, resize
from models.networks.utils import conv2DBatchNormRelu
import torch
import torch.nn as nn
ConvModule = conv2DBatchNormRelu
class UPerHead(BaseDecodeHead):
"""Unified Perceptual Parsing for Scene Understanding.
This head is the implementation of `UP... | 0 | 0 | 0 | 4,596 | 0 | 0 | 0 | 30 | 89 |
e575f5307704872adfc00326f7af409d8b07a867 | 553 | py | Python | chapter12-GluonCV/12.1-GluonCVBasis/12.1.1-data-API/gluoncv_data_imagenet.py | JeremXu/MXNet-Deep-Learning-in-Action | a069e8c75f0799e3be80cd27fdeb67531c7df3dd | [
"Apache-2.0"
] | 110 | 2018-11-21T11:34:41.000Z | 2022-03-06T06:18:28.000Z | chapter12-GluonCV/12.1-GluonCVBasis/12.1.1-data-API/gluoncv_data_imagenet.py | stefanjoe/MXNet-Deep-Learning-in-Action | a069e8c75f0799e3be80cd27fdeb67531c7df3dd | [
"Apache-2.0"
] | 5 | 2019-03-06T07:37:25.000Z | 2019-10-26T03:39:17.000Z | chapter12-GluonCV/12.1-GluonCVBasis/12.1.1-data-API/gluoncv_data_imagenet.py | stefanjoe/MXNet-Deep-Learning-in-Action | a069e8c75f0799e3be80cd27fdeb67531c7df3dd | [
"Apache-2.0"
] | 52 | 2019-02-01T08:02:09.000Z | 2021-12-19T12:25:36.000Z | from gluoncv import data, utils
import matplotlib.pyplot as plt
train_data = data.ImageNet(root='data/ILSVRC2012',
train=True)
val_data = data.ImageNet(root='data/ILSVRC2012',
train=False)
# Number of data
print("Number of train data: {}".format(len(train_data)))
pr... | 27.65 | 60 | 0.679928 | from gluoncv import data, utils
import matplotlib.pyplot as plt
train_data = data.ImageNet(root='data/ILSVRC2012',
train=True)
val_data = data.ImageNet(root='data/ILSVRC2012',
train=False)
# Number of data
print("Number of train data: {}".format(len(train_data)))
pr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e78e6dc8cffd032c8dbc4ec77cd639582040a2f3 | 867 | py | Python | setup.py | lisztomania-Zero/LimitFunc | 03badcb62792dcb0f28dac844c0d0dd3d4cbcc3a | [
"MIT"
] | 1 | 2020-12-16T13:06:44.000Z | 2020-12-16T13:06:44.000Z | setup.py | lisztomania-Zero/LimitFunc | 03badcb62792dcb0f28dac844c0d0dd3d4cbcc3a | [
"MIT"
] | null | null | null | setup.py | lisztomania-Zero/LimitFunc | 03badcb62792dcb0f28dac844c0d0dd3d4cbcc3a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Author : lisztomania
# @Date : 2020/12/16 19:33
# @Software : PyCharm
# @Version : Python 3.9.1
# @Project : LimitFunc
# @FileName : setup.py
# @Function :
import setuptools
with open('README.md', 'r', encoding='utf-8') as readme:
long_description = readme.r... | 27.967742 | 56 | 0.655133 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Author : lisztomania
# @Date : 2020/12/16 19:33
# @Software : PyCharm
# @Version : Python 3.9.1
# @Project : LimitFunc
# @FileName : setup.py
# @Function :
import setuptools
with open('README.md', 'r', encoding='utf-8') as readme:
long_description = readme.r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec2a525139e280f5e547e243c50489f8f71d0dbc | 911 | py | Python | rasotools/plot/__init__.py | MBlaschek/rasotools | a8b954518a1e39b554f850aac0f5bd8fa1f23dc6 | [
"MIT"
] | 1 | 2019-10-06T22:26:43.000Z | 2019-10-06T22:26:43.000Z | rasotools/plot/__init__.py | MBlaschek/rasotools | a8b954518a1e39b554f850aac0f5bd8fa1f23dc6 | [
"MIT"
] | null | null | null | rasotools/plot/__init__.py | MBlaschek/rasotools | a8b954518a1e39b554f850aac0f5bd8fa1f23dc6 | [
"MIT"
] | 1 | 2020-04-19T13:47:52.000Z | 2020-04-19T13:47:52.000Z | # -*- coding: utf-8 -*-
| 41.409091 | 101 | 0.710209 | # -*- coding: utf-8 -*-
from ._helpers import plot_arange, plot_levels, discrete_colormap
from . import map
from . import profile
from . import polar
from .time import *
from .analysis import *
def init_fig_vertical(n=2, ratios=(1, 4), figsize=None, sharex='row', **kwargs):
import matplotlib.pyplot as plt
gri... | 0 | 0 | 0 | 0 | 0 | 669 | 0 | 38 | 178 |
6afd4ac27139e2fec7aa039f61e364267f103115 | 4,179 | py | Python | build/lib/exchange/rest/server.py | raphaelvrosa/md2-nfv | b97e28fad3236fb76344ac3ac5194ef4a94494d0 | [
"Apache-2.0"
] | null | null | null | build/lib/exchange/rest/server.py | raphaelvrosa/md2-nfv | b97e28fad3236fb76344ac3ac5194ef4a94494d0 | [
"Apache-2.0"
] | null | null | null | build/lib/exchange/rest/server.py | raphaelvrosa/md2-nfv | b97e28fad3236fb76344ac3ac5194ef4a94494d0 | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
if __name__ == '__main__':
pass | 31.659091 | 86 | 0.581 | import logging
from urllib import parse as urlparse
from flask import Flask, request, make_response
from flask_restful import Api, Resource
from gevent.pywsgi import WSGIServer
logger = logging.getLogger(__name__)
class Resources(Resource):
settings = {
'content-type':'application/json'
}
api =... | 0 | 2,052 | 0 | 1,824 | 0 | 0 | 0 | 74 | 136 |
4e5b3f9690ab8aa3070952ab11a706f57bfa1465 | 176 | py | Python | mmseg/core/seg/__init__.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | mmseg/core/seg/__init__.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | mmseg/core/seg/__init__.py | vietawake/mmSegmentation | 1f643d6d81708ebf5726c48f66d02c70fe99fe00 | [
"Apache-2.0"
] | null | null | null | from .builder import build_pixel_sampler
from .sampler import BasePixelSampler, OHEMPixelSampler
__all__ = ['build_pixel_sampler', 'BasePixelSampler', 'OHEMPixelSampler']
| 35.2 | 74 | 0.8125 | from .builder import build_pixel_sampler
from .sampler import BasePixelSampler, OHEMPixelSampler
__all__ = ['build_pixel_sampler', 'BasePixelSampler', 'OHEMPixelSampler']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b88d3098eaf8b71205ad91dc24b3bb11575a1bf0 | 6,787 | py | Python | Projects/PyNeural/network.py | fredmorcos/attic | 0da3b94aa525df59ddc977c32cb71c243ffd0dbd | [
"Unlicense"
] | 2 | 2021-01-24T09:00:51.000Z | 2022-01-23T20:52:17.000Z | Projects/PyNeural/network.py | fredmorcos/attic | 0da3b94aa525df59ddc977c32cb71c243ffd0dbd | [
"Unlicense"
] | 6 | 2020-02-29T01:59:03.000Z | 2022-02-15T10:25:40.000Z | Projects/PyNeural/network.py | fredmorcos/attic | 0da3b94aa525df59ddc977c32cb71c243ffd0dbd | [
"Unlicense"
] | 1 | 2019-03-22T14:41:21.000Z | 2019-03-22T14:41:21.000Z | #!/usr/bin/python
'''
This file is part of pynn.
Copyright 2009 Frederic Morcos <fred.morcos@gmail.com>
pynn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at... | 35.534031 | 82 | 0.665242 | #!/usr/bin/python
'''
This file is part of pynn.
Copyright 2009 Frederic Morcos <fred.morcos@gmail.com>
pynn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at... | 0 | 0 | 0 | 5,188 | 0 | 0 | 0 | 0 | 92 |
bbf28723a1155af875190ccadeb7e80c8ff1cd72 | 493 | py | Python | createdataframe.py | srijansatpathy/ComplexReturns | bea4c6506729eb3673cbc008517adfa7a1494220 | [
"MIT"
] | null | null | null | createdataframe.py | srijansatpathy/ComplexReturns | bea4c6506729eb3673cbc008517adfa7a1494220 | [
"MIT"
] | null | null | null | createdataframe.py | srijansatpathy/ComplexReturns | bea4c6506729eb3673cbc008517adfa7a1494220 | [
"MIT"
] | null | null | null | import pickle
import yfinance as yf
#Import tickers_used
filename = 'tickers_used'
infile = open(filename,'rb')
tickers_used = pickle.load(infile)
infile.close()
#Create string of tickers to pass through function
ticker_str = ''
for i in tickers_used:
ticker_str = ticker_str + ' '+ i
#Create dataframe of histori... | 27.388889 | 103 | 0.744422 | import pickle
import yfinance as yf
#Import tickers_used
filename = 'tickers_used'
infile = open(filename,'rb')
tickers_used = pickle.load(infile)
infile.close()
#Create string of tickers to pass through function
ticker_str = ''
for i in tickers_used:
ticker_str = ticker_str + ' '+ i
#Create dataframe of histori... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cb738a5bc16d7158b4bc24dd6c8a1318bf8027bb | 993 | py | Python | 62_uniq_paths.py | xinming365/LeetCode | e56097a60ddd1b5ddba7f15a726661c2aa6633e7 | [
"Apache-2.0"
] | null | null | null | 62_uniq_paths.py | xinming365/LeetCode | e56097a60ddd1b5ddba7f15a726661c2aa6633e7 | [
"Apache-2.0"
] | null | null | null | 62_uniq_paths.py | xinming365/LeetCode | e56097a60ddd1b5ddba7f15a726661c2aa6633e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/3/8 8:25
# @Author : xinming
# @File : 62_uniq_paths.py
if __name__=='__main__':
out = Solution().uniquePaths(3, 7)
print(out) | 25.461538 | 53 | 0.450151 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/3/8 8:25 下午
# @Author : xinming
# @File : 62_uniq_paths.py
class Solution2:
def uniquePaths(self, m:int, n:int) ->int:
f = [[0 for i in range(n)] for i in range(m)]
# 递归的初始条件。转移方程需要处理好初始条件。
for i in range(n):
f[... | 198 | 0 | 0 | 676 | 0 | 0 | 0 | 0 | 46 |
d0f554516f6a78ce7b7e978ee40210ad32a3596b | 398 | py | Python | config.py | Vector254/Api | b6f1f2deae7e9a1e7b0ffc158b4cd0ba178a2354 | [
"MIT"
] | null | null | null | config.py | Vector254/Api | b6f1f2deae7e9a1e7b0ffc158b4cd0ba178a2354 | [
"MIT"
] | null | null | null | config.py | Vector254/Api | b6f1f2deae7e9a1e7b0ffc158b4cd0ba178a2354 | [
"MIT"
] | null | null | null |
config_options = {
'development':DevConfig,
'production':ProdConfig
} | 20.947368 | 82 | 0.758794 | import os
class Config:
SECRET_KEY="some-very-long-string-of-random-characters-CHANGE-TO-YOUR-LIKING"
SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://vector:12345q@localhost/quotes"
class ProdConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
class DevConfig(Config):
DEBUG... | 0 | 0 | 0 | 243 | 0 | 0 | 0 | -12 | 91 |
1c885994527e5a45dd3afb557c1cbd23f071a296 | 19,348 | py | Python | nyc_data/ppe/aggregations.py | usdigitalresponse/rtcovid-nyc-ppe | c6ac9a18e0726c34a523b0b0ad61c599ab3959f3 | [
"MIT"
] | 3 | 2020-04-16T03:24:17.000Z | 2020-09-11T22:12:31.000Z | nyc_data/ppe/aggregations.py | usdigitalresponse/rtcovid-nyc-ppe | c6ac9a18e0726c34a523b0b0ad61c599ab3959f3 | [
"MIT"
] | 47 | 2020-04-10T20:02:09.000Z | 2021-09-08T02:05:09.000Z | nyc_data/ppe/aggregations.py | usdigitalresponse/rtcovid-nyc-ppe | c6ac9a18e0726c34a523b0b0ad61c599ab3959f3 | [
"MIT"
] | 1 | 2020-04-22T19:10:24.000Z | 2020-04-22T19:10:24.000Z | import collections
import datetime
import json
from django.db.models import Sum
import ppe.dataclasses as dc
from ppe.models import (FacilityDelivery)
# NY Forecast from https://covid19.healthdata.org/united-states-of-america/new-york
HOSPITALIZATION = {}
with open("../public-data/hospitalization_projection_new_yor... | 33.358621 | 141 | 0.619134 | import collections
import datetime
import json
from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, Callable, NamedTuple, Set
from django.db.models import Sum
from django.urls import reverse
from django.utils.html import format_html
from django.utils.http import urlencode
from django... | 3 | 3,993 | 0 | 7,697 | 0 | 5,333 | 0 | 259 | 634 |
a1b6151fd0340f918cfb3390371cf8546921f2cf | 4,098 | py | Python | src/ggrc_gdrive_integration/__init__.py | mikecb/ggrc-core | 1cda560cb0920021416e07740c6cca1acba56268 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc_gdrive_integration/__init__.py | mikecb/ggrc-core | 1cda560cb0920021416e07740c6cca1acba56268 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-03-26T00:24:35.000Z | 2021-03-26T00:24:35.000Z | src/ggrc_gdrive_integration/__init__.py | mikecb/ggrc-core | 1cda560cb0920021416e07740c6cca1acba56268 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from flask import Blueprint
blueprint = Blueprint(
'gdrive',
__name__,
te... | 33.048387 | 87 | 0.736945 | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from flask import Blueprint
from ggrc import settings
from ggrc.app import app
... | 0 | 0 | 0 | 1,157 | 0 | 59 | 0 | 106 | 158 |
5dd235954e00e3353720380ad5e4fd1579960a8d | 3,788 | py | Python | examples/scripts/sc/bpdn.py | manvhah/sporco | 9237d7fc37e75089a2a65ebfe02b7491410da7d4 | [
"BSD-3-Clause"
] | null | null | null | examples/scripts/sc/bpdn.py | manvhah/sporco | 9237d7fc37e75089a2a65ebfe02b7491410da7d4 | [
"BSD-3-Clause"
] | null | null | null | examples/scripts/sc/bpdn.py | manvhah/sporco | 9237d7fc37e75089a2a65ebfe02b7491410da7d4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
Basis Pursuit DeNoising
=======================
This example demonstrates the use of class :class:`.admm.bpdn.... | 30.063492 | 406 | 0.694298 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
Basis Pursuit DeNoising
=======================
This example demonstrates the use of class :class:`.admm.bpdn.... | 7 | 0 | 0 | 0 | 0 | 101 | 0 | 0 | 22 |
41d7ce148bc066173427996271d6d830ef33de3c | 14,676 | py | Python | tests/test_crest_endpoint.py | EVEprosper/ProsperAPI | 2d25b9210d32ca777204b1dddb56848d7075dd85 | [
"MIT"
] | 13 | 2017-03-27T13:10:52.000Z | 2020-07-30T09:33:11.000Z | tests/test_crest_endpoint.py | EVEprosper/ProsperAPI | 2d25b9210d32ca777204b1dddb56848d7075dd85 | [
"MIT"
] | 19 | 2016-11-14T00:58:54.000Z | 2018-06-11T16:54:25.000Z | tests/test_crest_endpoint.py | EVEprosper/ProsperAPI | 2d25b9210d32ca777204b1dddb56848d7075dd85 | [
"MIT"
] | 5 | 2017-04-19T01:12:06.000Z | 2021-03-07T02:23:45.000Z | from os import path
from tinymongo import TinyMongoClient
import pytest
import publicAPI.exceptions as exceptions
import helpers
HERE = path.abspath(path.dirname(__file__))
ROOT = path.dirname(HERE)
CONFIG_FILENAME = path.join(HERE, 'test_config.cfg')
CONFIG = helpers.get_config(CONFIG_FILENAME)
ROOT_CONFIG = helpe... | 35.535109 | 88 | 0.570796 | from os import path, listdir, remove
import platform
import io
from datetime import datetime, timedelta
import time
import json
import pandas as pd
from tinymongo import TinyMongoClient
import pytest
from flask import url_for
import publicAPI.exceptions as exceptions
import publicAPI.config as api_utils
import helper... | 0 | 13,383 | 0 | 0 | 0 | 0 | 0 | 15 | 268 |
9d772c0aae973483614d0cae286f7e3a3957c45b | 14,107 | py | Python | Split_and_merge/SAM_worker.py | XxOinvizioNxX/EP_Split_and_Merge | b480e189182b3a7e139f56d56eb942c7960c56d9 | [
"Unlicense"
] | null | null | null | Split_and_merge/SAM_worker.py | XxOinvizioNxX/EP_Split_and_Merge | b480e189182b3a7e139f56d56eb942c7960c56d9 | [
"Unlicense"
] | null | null | null | Split_and_merge/SAM_worker.py | XxOinvizioNxX/EP_Split_and_Merge | b480e189182b3a7e139f56d56eb942c7960c56d9 | [
"Unlicense"
] | null | null | null | """
Licensed under the Unlicense License;
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://unlicense.org
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... | 46.711921 | 112 | 0.549231 | """
Licensed under the Unlicense License;
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://unlicense.org
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... | 0 | 0 | 0 | 12,992 | 0 | 277 | 0 | -27 | 144 |
fe8cb0c067e1d515c8bca06baa4074c84a4c0fc0 | 946 | py | Python | Python/ListVlanMembers.py | krapsusa/netmri-toolkit | 5740cd90e2fe242b8af3ec6192fca10a30cfa94d | [
"MIT"
] | 17 | 2015-09-17T18:25:55.000Z | 2020-08-27T00:16:54.000Z | Python/ListVlanMembers.py | krapsusa/netmri-toolkit | 5740cd90e2fe242b8af3ec6192fca10a30cfa94d | [
"MIT"
] | 2 | 2019-08-08T17:33:32.000Z | 2019-10-10T15:36:55.000Z | Python/ListVlanMembers.py | krapsusa/netmri-toolkit | 5740cd90e2fe242b8af3ec6192fca10a30cfa94d | [
"MIT"
] | 19 | 2016-04-25T12:45:31.000Z | 2020-09-28T18:24:51.000Z | import requests, json
from getpass import getpass
from urllib3 import disable_warnings
from urllib3.exceptions import InsecureRequestWarning
import pprint
disable_warnings(category=InsecureRequestWarning)
# Username and password
user = "admin"
password = getpass("Enter your Infoblox password: ")
# Setup pretty print... | 27.823529 | 114 | 0.778013 | import requests, json
from getpass import getpass
from urllib3 import disable_warnings
from urllib3.exceptions import InsecureRequestWarning
import pprint
disable_warnings(category=InsecureRequestWarning)
# Username and password
user = "admin"
password = getpass("Enter your Infoblox password: ")
# Setup pretty print... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a57e4b4b53401f641c732bd31c9907b367d8a84 | 2,297 | py | Python | footprint.py | ryukinix/mar-footprint | 2c79e559088d770786f21f96b80f3bab0c6cc02e | [
"MIT"
] | null | null | null | footprint.py | ryukinix/mar-footprint | 2c79e559088d770786f21f96b80f3bab0c6cc02e | [
"MIT"
] | null | null | null | footprint.py | ryukinix/mar-footprint | 2c79e559088d770786f21f96b80f3bab0c6cc02e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright Manoel Vilela
#
# @project: Memory Analysis Report Footprint
# @author: Manoel Vilela
# @email: manoel_vilela@engineer.com
#
__version__ = '0.1.1'
__date__ = '2016'
__author__ = 'Manoel Vilela'
__email__ = 'manoel_vilela@engineer.com'
__url_... | 33.779412 | 78 | 0.618633 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © Manoel Vilela
#
# @project: Memory Analysis Report Footprint
# @author: Manoel Vilela
# @email: manoel_vilela@engineer.com
#
from tqdm import tqdm
import pandas as pd
import mar
__version__ = '0.1.1'
__date__ = '2016'
__author__ = 'Manoel ... | 2 | 0 | 0 | 0 | 0 | 1,787 | 0 | -13 | 113 |
6248f9f752e8249ea6d8981c1c5f257d53b698b1 | 2,299 | py | Python | glue/qt/widgets/tests/test_terminal.py | yuvallanger/glue | 1e27b47328db1e9a44eb6734e894a897c4b693be | [
"BSD-3-Clause"
] | null | null | null | glue/qt/widgets/tests/test_terminal.py | yuvallanger/glue | 1e27b47328db1e9a44eb6734e894a897c4b693be | [
"BSD-3-Clause"
] | null | null | null | glue/qt/widgets/tests/test_terminal.py | yuvallanger/glue | 1e27b47328db1e9a44eb6734e894a897c4b693be | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
from ....tests.helpers import IPYTHON_GE_012_INSTALLED
if IPYTHON_GE_012_INSTALLED:
if __name__ == "__main__":
import pytest
pytest.main([__file__])
| 29.101266 | 79 | 0.649848 | from __future__ import absolute_import, division, print_function
from mock import MagicMock, patch
from ....tests.helpers import requires_ipython_ge_012, IPYTHON_GE_012_INSTALLED
if IPYTHON_GE_012_INSTALLED:
from ..terminal import glue_terminal
@requires_ipython_ge_012
class TestTerminal(object):
def test_... | 0 | 1,948 | 0 | 0 | 0 | 0 | 0 | 52 | 72 |
de594fd1bfae5d53405ee11568c64d99f549e318 | 7,603 | py | Python | main_pongv0_konda.py | Abhishek-Rajendra/Actor_critic_methods | 336239d1e1472528b6150ac965a431dc2d2bb5a3 | [
"MIT"
] | 1 | 2021-04-23T19:50:21.000Z | 2021-04-23T19:50:21.000Z | main_pongv0_konda.py | Abhishek-Rajendra/Actor_critic_methods | 336239d1e1472528b6150ac965a431dc2d2bb5a3 | [
"MIT"
] | null | null | null | main_pongv0_konda.py | Abhishek-Rajendra/Actor_critic_methods | 336239d1e1472528b6150ac965a431dc2d2bb5a3 | [
"MIT"
] | null | null | null | '''
This code is used to run pong-v0 using konda actor critic.
Note that you can use linear fully connected network or CNN, please check pongv0_konda.py.
and uncomment.
Also note that for critic input_dims argument put 320, if you are using CNN arcitecture
If you are using fully connected layers then input critic_inpu... | 32.491453 | 157 | 0.621597 | '''
This code is used to run pong-v0 using konda actor critic.
Note that you can use linear fully connected network or CNN, please check pongv0_konda.py.
and uncomment.
Also note that for critic input_dims argument put 320, if you are using CNN arcitecture
If you are using fully connected layers then input critic_inpu... | 0 | 0 | 0 | 0 | 0 | 821 | 0 | 22 | 177 |
16f01f45d649341a7cbd291cd3ad55a5ccba4b09 | 5,850 | py | Python | case_studies/swan_coastal_plain/clayfraction.py | DennisHgj/litho-aem-blending-eda | bfdc34dd3688d79e0b5babee9a46ee82eef5a6e4 | [
"MIT"
] | null | null | null | case_studies/swan_coastal_plain/clayfraction.py | DennisHgj/litho-aem-blending-eda | bfdc34dd3688d79e0b5babee9a46ee82eef5a6e4 | [
"MIT"
] | 1 | 2019-09-27T07:52:26.000Z | 2019-09-27T07:52:26.000Z | case_studies/swan_coastal_plain/clayfraction.py | DennisHgj/litho-aem-blending-eda | bfdc34dd3688d79e0b5babee9a46ee82eef5a6e4 | [
"MIT"
] | null | null | null | from scipy import special
from pykrige.ok import OrdinaryKriging
def bore_to_fraction(interval_len, bore_dict):
"""
convert a single bore hole log to clay fraction. the interval length in depth can be customized
:param interval_len: length for a single interval
:param bore_dict : a dict contains the li... | 42.70073 | 143 | 0.664274 | from scipy import special
import numpy as np
from pykrige.ok import OrdinaryKriging
def bore_to_fraction(interval_len, bore_dict):
"""
convert a single bore hole log to clay fraction. the interval length in depth can be customized
:param interval_len: length for a single interval
:param bore_dict : a d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
ef7cfb9aa1f91cde9e1cbc65678a0798d13e73df | 1,869 | py | Python | Medium/133.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 6 | 2017-09-25T18:05:50.000Z | 2019-03-27T00:23:15.000Z | Medium/133.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 1 | 2017-10-29T12:04:41.000Z | 2018-08-16T18:00:37.000Z | Medium/133.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | null | null | null | # ------------------------------
# 133. Clone Graph
#
# Description:
# Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
# OJ's undirected graph serialization:
# Nodes are labeled uniquely.
#
# We use # as a separator for each node, and , as a separator for node label and... | 31.15 | 108 | 0.606207 | # ------------------------------
# 133. Clone Graph
#
# Description:
# Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
# OJ's undirected graph serialization:
# Nodes are labeled uniquely.
#
# We use # as a separator for each node, and , as a separator for node label and... | 0 | 0 | 0 | 543 | 0 | 0 | 0 | 0 | 23 |
0421f508fbf969b8a0fcd21126c14d04d78510a9 | 1,548 | py | Python | src/list.py | luoweihua7/DouyuFlow | 8fef23d1eb78d9634a3c93ce1be7935d929f2d37 | [
"MIT"
] | null | null | null | src/list.py | luoweihua7/DouyuFlow | 8fef23d1eb78d9634a3c93ce1be7935d929f2d37 | [
"MIT"
] | null | null | null | src/list.py | luoweihua7/DouyuFlow | 8fef23d1eb78d9634a3c93ce1be7935d929f2d37 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#_*_ coding:UTF-8 _*_
#
# Copyright by Larify. All Rights Reserved.
import sys
from workflow import Workflow3
reload(sys)
sys.setdefaultencoding('utf-8')
if __name__ == '__main__':
wf = Workflow3()
DEFAULT_ICON = 'icon.png'
sys.exit(wf.run(main))
| 28.145455 | 186 | 0.591085 | #!/usr/bin/python
#_*_ coding:UTF-8 _*_
#
# Copyright by Larify. All Rights Reserved.
import json
import urllib
import urllib2
import sys
import time
import re
from workflow import Workflow3
from i18n import lang
reload(sys)
sys.setdefaultencoding('utf-8')
def getRoomList(category):
url = 'https://www.douyu.com... | 15 | 0 | 0 | 0 | 0 | 1,130 | 0 | -47 | 179 |
c89e6392aa65a59b35b95487b4398017c0296943 | 12,137 | py | Python | modules/insight/module_index.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 25 | 2015-08-24T16:05:14.000Z | 2020-12-09T20:07:14.000Z | modules/insight/module_index.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 1 | 2016-02-16T21:18:10.000Z | 2016-02-16T21:18:10.000Z | modules/insight/module_index.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 5 | 2016-02-16T20:05:37.000Z | 2020-01-31T11:27:39.000Z | # Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
# had to disable this one due to stupid itkLevelSetNode non-wrapping
# in ITK-2-4-1
# isn't wrapped anymore, no idea why.
#class gvfgac:
# kits = ['itk_kit']
# cats = ['Insight']
# will fix when I rework the regist... | 33.807799 | 80 | 0.688308 | # Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
class ITKtoVTK:
kits = ['itk_kit']
cats = ['Insight']
help = """Use this module to convert from any ITK image type to
the corresponding VTK type.
"""
class VTKtoITK:
kits = ['itk_kit']
cats = ['Ins... | 0 | 0 | 0 | 10,024 | 0 | 0 | 0 | 0 | 531 |
65ca6b23006ddd35d212bac00f4888889bdea06a | 274 | py | Python | Linux/scripts/py/uptime_monitor.py | MrGKanev/MWC | 687fc962833d9f7012742334035b3f041520db9c | [
"MIT"
] | 1 | 2020-02-20T07:09:56.000Z | 2020-02-20T07:09:56.000Z | Linux/scripts/py/uptime_monitor.py | MrGKanev/MWC | 687fc962833d9f7012742334035b3f041520db9c | [
"MIT"
] | null | null | null | Linux/scripts/py/uptime_monitor.py | MrGKanev/MWC | 687fc962833d9f7012742334035b3f041520db9c | [
"MIT"
] | null | null | null | import requests, os, time
SITE_URL=""
SLEEP_SEC=300 #5 mins
while True:
response=requests.get(SITE_URL)
print(response)
if response.status_code!=200:
os.system('notify-send "Website Down" "'+SITE_URL+'is down"')
break
time.sleep(SLEEP_SEC) | 24.909091 | 71 | 0.671533 | import requests,os,time
SITE_URL=""
SLEEP_SEC=300 #5 mins
while True:
response=requests.get(SITE_URL)
print(response)
if response.status_code!=200:
os.system('notify-send "Website Down" "'+SITE_URL+'is down"')
break
time.sleep(SLEEP_SEC) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 0 |
90d64739cf946777cbbd77f37aa5eb646d8c49df | 771 | py | Python | upwork-devs/pranay-sahith/opencensus_poc/main.py | a-khaledf/k8-traffic-generator | 832662afb0131961e6005c3bdd161c1c7dac149b | [
"Apache-2.0"
] | null | null | null | upwork-devs/pranay-sahith/opencensus_poc/main.py | a-khaledf/k8-traffic-generator | 832662afb0131961e6005c3bdd161c1c7dac149b | [
"Apache-2.0"
] | null | null | null | upwork-devs/pranay-sahith/opencensus_poc/main.py | a-khaledf/k8-traffic-generator | 832662afb0131961e6005c3bdd161c1c7dac149b | [
"Apache-2.0"
] | 1 | 2020-09-13T09:47:56.000Z | 2020-09-13T09:47:56.000Z |
if __name__ == "__main__":
Main.main()
| 24.09375 | 69 | 0.677043 | import logging
import asyncio
import os
import time
from pprint import pprint
from opencensus_prometheus import OpenCensusPrometheus
from traffic_generator import TrafficGenerator
class Main():
log = logging.getLogger("GW:traffic_g")
@staticmethod
def set_logging_level(level):
logging.basicConfi... | 0 | 431 | 0 | 90 | 0 | 0 | 0 | 26 | 178 |
eca2650b934f0c66d6fab48653695d8ee00195b4 | 886 | py | Python | native/script/package.py | magneticflux-/skija | 90712df54e0d93e48678746fc2e6b1741c3d26a0 | [
"Apache-2.0"
] | null | null | null | native/script/package.py | magneticflux-/skija | 90712df54e0d93e48678746fc2e6b1741c3d26a0 | [
"Apache-2.0"
] | null | null | null | native/script/package.py | magneticflux-/skija | 90712df54e0d93e48678746fc2e6b1741c3d26a0 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
import os, sys
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..')))
import script.common as common
import script.revision as revision
if __name__ == '__main__':
sys.exit(main()) | 26.058824 | 104 | 0.65237 | #! /usr/bin/env python3
import argparse, os, subprocess, sys
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..')))
import script.common as common
import script.revision as revision
def main():
common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
rev = revision.revision... | 0 | 0 | 0 | 0 | 0 | 602 | 0 | 22 | 23 |
91493a4c0773f4e4c8bc7528408558f257c89516 | 7,256 | py | Python | tests/vm_impl/array_ops_vm_impl.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | 2 | 2020-08-12T16:14:40.000Z | 2020-12-04T03:05:57.000Z | tests/vm_impl/array_ops_vm_impl.py | shaolei-wang/mindspore | 2d50a43be9d17269f6adb41e51b8f7a540ebc9f1 | [
"Apache-2.0"
] | null | null | null | tests/vm_impl/array_ops_vm_impl.py | shaolei-wang/mindspore | 2d50a43be9d17269f6adb41e51b8f7a540ebc9f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 23.790164 | 78 | 0.643605 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 0 | 5,653 | 0 | 0 | 0 | 0 | 0 | 150 | 684 |
8797f8dcf1b4d17c8863697afc4855f213aeeeed | 116 | py | Python | Projects/main.py | Kevinwmiguel/Forca | 61626969a2d2f5168a9acb6c8022f83acf0dda73 | [
"MIT"
] | 2 | 2021-01-29T00:36:32.000Z | 2021-02-03T00:13:04.000Z | Projects/main.py | Kevinwmiguel/Forca | 61626969a2d2f5168a9acb6c8022f83acf0dda73 | [
"MIT"
] | null | null | null | Projects/main.py | Kevinwmiguel/Forca | 61626969a2d2f5168a9acb6c8022f83acf0dda73 | [
"MIT"
] | null | null | null | # ----- Import Zone -----
from Aforca import util
# ----- Loop Zone -----
util.gamestart()
input('Enter to exit')
| 14.5 | 25 | 0.577586 | # ----- Import Zone -----
from Aforca import util
# ----- Loop Zone -----
util.gamestart()
input('Enter to exit')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c38c0217e95296afb9790277ec9184b15f51d419 | 2,752 | py | Python | P3-Task1/121_P2_blue.py | ECOR1051-WINTER2020-Team-121/Python_Image_Filter | 0c7f8aab4152bba9320404c365a4161c23f57bbd | [
"Unlicense"
] | null | null | null | P3-Task1/121_P2_blue.py | ECOR1051-WINTER2020-Team-121/Python_Image_Filter | 0c7f8aab4152bba9320404c365a4161c23f57bbd | [
"Unlicense"
] | null | null | null | P3-Task1/121_P2_blue.py | ECOR1051-WINTER2020-Team-121/Python_Image_Filter | 0c7f8aab4152bba9320404c365a4161c23f57bbd | [
"Unlicense"
] | 1 | 2021-08-17T19:12:45.000Z | 2021-08-17T19:12:45.000Z | import Cimpl
def blue_channel(img: Cimpl.Image) -> Cimpl.Image:
"""
Author: Zakaria Ismail
RETURNS an ImageObject whose
channels except for blue, have
been zeroed, after being
PASSED an Cimpl.Image object
>>> Cimpl.show(blue_channel('p2-original.png'))
-> An a blue filtered image wil... | 30.241758 | 106 | 0.664608 | import Cimpl
def blue_channel(img: Cimpl.Image) -> Cimpl.Image:
"""
Author: Zakaria Ismail
RETURNS an ImageObject whose
channels except for blue, have
been zeroed, after being
PASSED an Cimpl.Image object
>>> Cimpl.show(blue_channel('p2-original.png'))
-> An a blue filtered image wil... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a06c9e5314f843a316d274310f78311f6b276ea | 617 | py | Python | Reverse_Engineering/vault-door1 (100 points)/flag.py | root-ji218at/2019game.picoctf.com | 48ae89edbe06eef3f651cc535615ebfb067d57bc | [
"MIT"
] | null | null | null | Reverse_Engineering/vault-door1 (100 points)/flag.py | root-ji218at/2019game.picoctf.com | 48ae89edbe06eef3f651cc535615ebfb067d57bc | [
"MIT"
] | null | null | null | Reverse_Engineering/vault-door1 (100 points)/flag.py | root-ji218at/2019game.picoctf.com | 48ae89edbe06eef3f651cc535615ebfb067d57bc | [
"MIT"
] | null | null | null | enc = open("enc.txt", "r")
enc_read = enc.readlines()
enc.close()
replaced_enc_lst = []
for line in enc_read:
replaced_enc_lst += [(((((line.replace("' &&", "")).replace("\n", "")).replace(" password.charAt(", "")).replace(")", "")).replace(" ", "")).replace("'", "")]
place = []
flag_chr = []
for sho... | 22.851852 | 173 | 0.598055 | enc = open("enc.txt", "r")
enc_read = enc.readlines()
enc.close()
replaced_enc_lst = []
for line in enc_read:
replaced_enc_lst += [(((((line.replace("' &&", "")).replace("\n", "")).replace(" password.charAt(", "")).replace(")", "")).replace(" ", "")).replace("'", "")]
place = []
flag_chr = []
for sho... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d1f6eb5fe8c637e5ad1ddcfc4e1078d22077405 | 5,576 | py | Python | scripts/indicators/flow_exports.py | hiiq/shared-react-components-example | 0e89c65ed29a85318633070c987cf8b01636552b | [
"MIT"
] | 41 | 2019-05-14T14:23:08.000Z | 2020-08-10T10:37:41.000Z | scripts/indicators/flow_exports.py | hiiq/shared-react-components-example | 0e89c65ed29a85318633070c987cf8b01636552b | [
"MIT"
] | 3 | 2021-05-07T11:40:40.000Z | 2022-02-12T08:57:27.000Z | scripts/indicators/flow_exports.py | hiiq/shared-react-components-example | 0e89c65ed29a85318633070c987cf8b01636552b | [
"MIT"
] | 6 | 2020-10-13T14:58:53.000Z | 2022-02-10T15:53:38.000Z | import glob
import json
import os
GREEN = "\033[0;32;40m "
YELLOW = "\033[1;33;40m "
RED = "\033[1;31;40m "
RESET = "\033[0;37;40m "
def getPackagesList():
"""
Retrieves the list of packages as declared in the "workspaces" property of
package.json
:return: Object whose keys represent the packages' lo... | 36.684211 | 94 | 0.591284 | import glob
import json
import re
import os
GREEN = "\033[0;32;40m "
YELLOW = "\033[1;33;40m "
RED = "\033[1;31;40m "
RESET = "\033[0;37;40m "
def printInColor(color, msg):
print color + msg
def resetColor():
print RESET
def getPackagesList():
"""
Retrieves the list of packages as declared in the "w... | 0 | 0 | 0 | 0 | 0 | 3,504 | 0 | -12 | 91 |
e6facbcf7208636b0685e33005c7749d75c9ee70 | 12,413 | py | Python | blender/2.79/scripts/addons/add_advanced_objects_panels/drop_to_ground.py | uzairakbar/bpy2.79 | 3a3e0004ac6783c4e4b89d939e4432de99026a85 | [
"MIT"
] | 2 | 2019-11-27T09:05:42.000Z | 2020-02-20T01:25:23.000Z | add_advanced_objects_panels/drop_to_ground.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | null | null | null | add_advanced_objects_panels/drop_to_ground.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | 4 | 2020-02-19T20:02:26.000Z | 2022-02-11T18:47:56.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 32.751979 | 96 | 0.627246 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 0 | 285 | 0 | 4,343 | 0 | 6,052 | 0 | 82 | 431 |
77acbbfb954106f20894f43d40b07d048fd2fce1 | 2,012 | py | Python | exeteracovid/scripts/standard_processing.py | deng113jie/ExeTeraCovid | ee9ec90983d7c2c711962c7fe9ac25251392e41b | [
"Apache-2.0"
] | 3 | 2021-03-23T14:23:06.000Z | 2021-12-29T16:54:42.000Z | exeteracovid/scripts/standard_processing.py | deng113jie/ExeTeraCovid | ee9ec90983d7c2c711962c7fe9ac25251392e41b | [
"Apache-2.0"
] | 29 | 2021-02-22T12:12:53.000Z | 2021-09-27T10:52:25.000Z | exeteracovid/scripts/standard_processing.py | deng113jie/ExeTeraCovid | ee9ec90983d7c2c711962c7fe9ac25251392e41b | [
"Apache-2.0"
] | 1 | 2021-03-08T15:00:30.000Z | 2021-03-08T15:00:30.000Z | #!/usr/bin/env python
# Copyright 2020 KCL-BMEIS - King's College London
# 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... | 35.298246 | 99 | 0.71173 | #!/usr/bin/env python
# Copyright 2020 KCL-BMEIS - King's College London
# 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... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0ad0810f47d19b063804f558821473efb7bc8e8a | 8,874 | py | Python | python/bifrost/views/basic_views.py | Radio-Camera-Initiative/bifrost | d4891bcc97335fb6e7955314c40631ef9136f556 | [
"BSD-3-Clause"
] | null | null | null | python/bifrost/views/basic_views.py | Radio-Camera-Initiative/bifrost | d4891bcc97335fb6e7955314c40631ef9136f556 | [
"BSD-3-Clause"
] | 1 | 2022-02-09T00:25:09.000Z | 2022-02-09T00:25:09.000Z | python/bifrost/views/basic_views.py | Radio-Camera-Initiative/bifrost | d4891bcc97335fb6e7955314c40631ef9136f556 | [
"BSD-3-Clause"
] | 1 | 2021-12-14T21:59:46.000Z | 2021-12-14T21:59:46.000Z |
# Copyright (c) 2016, The Bifrost Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | 41.46729 | 81 | 0.619112 |
# Copyright (c) 2016, The Bifrost Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | 0 | 0 | 0 | 0 | 0 | 5,708 | 0 | 42 | 284 |
c30a788ae105c2b171a046395ee2186dda635cd9 | 13,401 | py | Python | pymensago/contact.py | darkwyrm/pymensago | add93a6a87def3b6909666d23b8d885cfbdee5c4 | [
"MIT"
] | 1 | 2021-10-01T01:35:19.000Z | 2021-10-01T01:35:19.000Z | pymensago/contact.py | darkwyrm/pymensago | add93a6a87def3b6909666d23b8d885cfbdee5c4 | [
"MIT"
] | null | null | null | pymensago/contact.py | darkwyrm/pymensago | add93a6a87def3b6909666d23b8d885cfbdee5c4 | [
"MIT"
] | null | null | null | '''This module contains functions to manage the dot-notated contact information used internally
and transforming it to and from the JSON-based format described in the spec.'''
from base64 import b85encode
import os
import tempfile
from typing import Union
from PIL import Image
from retval import RetVal, ErrOutOfRange... | 29.582781 | 102 | 0.679576 | '''This module contains functions to manage the dot-notated contact information used internally
and transforming it to and from the JSON-based format described in the spec.'''
from base64 import b85encode
import os
import tempfile
from typing import Union
from PIL import Image
from retval import RetVal, ErrOutOfRange... | 0 | 0 | 0 | 2,164 | 0 | 1,194 | 0 | 0 | 92 |
d3c34f9004b45ddadcac68e24623ced640ef7af5 | 7,395 | py | Python | demos/tests/data_sequences.py | shashwat623/open_model_zoo | 85165b62fdc4f164260c3f2283f40a9e1a524511 | [
"Apache-2.0"
] | null | null | null | demos/tests/data_sequences.py | shashwat623/open_model_zoo | 85165b62fdc4f164260c3f2283f40a9e1a524511 | [
"Apache-2.0"
] | null | null | null | demos/tests/data_sequences.py | shashwat623/open_model_zoo | 85165b62fdc4f164260c3f2283f40a9e1a524511 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 30.557851 | 84 | 0.609331 | # Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b2d50d11da123491c459a9b7e472d3b8bee11ea9 | 5,801 | py | Python | jamf/models/self_service_settings.py | jensenbox/python-jamf | 85213085b1064a00375a7aa7df5e33c19f5178eb | [
"RSA-MD"
] | 1 | 2021-04-20T15:28:57.000Z | 2021-04-20T15:28:57.000Z | jamf/models/self_service_settings.py | jensenbox/python-jamf | 85213085b1064a00375a7aa7df5e33c19f5178eb | [
"RSA-MD"
] | null | null | null | jamf/models/self_service_settings.py | jensenbox/python-jamf | 85213085b1064a00375a7aa7df5e33c19f5178eb | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and sh... | 33.531792 | 342 | 0.651957 | # coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and sh... | 0 | 1,904 | 0 | 3,290 | 0 | 0 | 0 | -8 | 128 |
a85a283daf090d0df42d15ff8e7aa09de2a19bae | 542 | py | Python | declaraciones/declaracion/migrations/0002_cattiposespecificosinversiones_cat_tipos_inversiones.py | rafaelhn2021/proyecto | 97d01a0524df782985342bf07671ab60e318657f | [
"MIT"
] | null | null | null | declaraciones/declaracion/migrations/0002_cattiposespecificosinversiones_cat_tipos_inversiones.py | rafaelhn2021/proyecto | 97d01a0524df782985342bf07671ab60e318657f | [
"MIT"
] | null | null | null | declaraciones/declaracion/migrations/0002_cattiposespecificosinversiones_cat_tipos_inversiones.py | rafaelhn2021/proyecto | 97d01a0524df782985342bf07671ab60e318657f | [
"MIT"
] | 2 | 2021-07-15T17:20:10.000Z | 2022-03-18T10:26:38.000Z | # Generated by Django 3.0 on 2020-10-27 04:30
| 27.1 | 145 | 0.677122 | # Generated by Django 3.0 on 2020-10-27 04:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('declaracion', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='cattiposespecifi... | 0 | 0 | 0 | 397 | 0 | 0 | 0 | 30 | 68 |
9749828fe210593b5c8916c9530f9827d3ee7304 | 19,507 | py | Python | mjolnir/transform.py | wikimedia/search-MjoLniR | 5ab0e1d590cbbed5d5dd775c62f9b97f8b71a54d | [
"MIT"
] | 48 | 2017-10-27T14:47:06.000Z | 2022-03-27T08:04:37.000Z | mjolnir/transform.py | wikimedia/search-MjoLniR | 5ab0e1d590cbbed5d5dd775c62f9b97f8b71a54d | [
"MIT"
] | null | null | null | mjolnir/transform.py | wikimedia/search-MjoLniR | 5ab0e1d590cbbed5d5dd775c62f9b97f8b71a54d | [
"MIT"
] | 8 | 2018-03-16T05:06:51.000Z | 2022-01-23T11:42:07.000Z | """Helpers to construct a transformation pipeline
A transformer is, broadly speaking, a function that takes a DataFrame as
it's only argument and returns a new DataFrame. Using this fairly simple
definition we can compose together multiple transformations into new
transformations, and we can parameterize the transform... | 38.781312 | 104 | 0.689804 | """Helpers to construct a transformation pipeline
A transformer is, broadly speaking, a function that takes a DataFrame as
it's only argument and returns a new DataFrame. Using this fairly simple
definition we can compose together multiple transformations into new
transformations, and we can parameterize the transform... | 0 | 669 | 0 | 375 | 0 | 1,601 | 0 | -5 | 299 |
83468422d2b01c5ff065f7373c035a631e9f781b | 1,629 | py | Python | indra/preassembler/make_cellular_component_hierarchy.py | qiuhaoling/indra | fa1fb31c4333ea63d023181eaf6f759e3dd3b400 | [
"BSD-2-Clause"
] | null | null | null | indra/preassembler/make_cellular_component_hierarchy.py | qiuhaoling/indra | fa1fb31c4333ea63d023181eaf6f759e3dd3b400 | [
"BSD-2-Clause"
] | null | null | null | indra/preassembler/make_cellular_component_hierarchy.py | qiuhaoling/indra | fa1fb31c4333ea63d023181eaf6f759e3dd3b400 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
from os.path import abspath, dirname, join
from indra.databases import go_client
rdf_file = join(dirname(abspath(__file__)), '..', 'resources',
'cellular_component_hierarchy.rdf')
if __name__ == '__main__':
g = go_client.... | 33.9375 | 76 | 0.677716 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import abspath, dirname, join, exists
import pickle
import rdflib
from rdflib import Namespace, Literal
from indra.databases import go_client
rdf_file = join(dirname(abspath(__file__)), '..', 'resource... | 0 | 0 | 0 | 0 | 0 | 962 | 0 | 17 | 134 |
e1475c1b1da28233a7be9c9e743f318bf222456f | 24,834 | py | Python | tf/dataset/nodemaps.py | ancient-data/text-fabric | c1ccd4a4dc451e94a789f138576576c5d7f13474 | [
"MIT"
] | null | null | null | tf/dataset/nodemaps.py | ancient-data/text-fabric | c1ccd4a4dc451e94a789f138576576c5d7f13474 | [
"MIT"
] | null | null | null | tf/dataset/nodemaps.py | ancient-data/text-fabric | c1ccd4a4dc451e94a789f138576576c5d7f13474 | [
"MIT"
] | null | null | null | """
# Nodemaps
When different versions of a TF dataset exist, it makes sense to map the nodes from the
older version to nodes of the newer version.
If we have annotations on the older version
(possibly created with considerable man-machine labor),
we can use such node mappings to transfer the annotations to the newer... | 35.477143 | 115 | 0.537247 | """
# Nodemaps
When different versions of a TF dataset exist, it makes sense to map the nodes from the
older version to nodes of the newer version.
If we have annotations on the older version
(possibly created with considerable man-machine labor),
we can use such node mappings to transfer the annotations to the newer... | 6 | 0 | 0 | 17,246 | 0 | 1,933 | 0 | -15 | 136 |
4d4b9ef8398be7495090c7325c35d76a2bee7bea | 14,220 | py | Python | pythonx/netranger/fs.py | ipod825/vim-netranger | 8f5864294263d86051d28b697c7ae1c480dd9ca2 | [
"MIT"
] | 199 | 2017-12-02T23:18:54.000Z | 2022-03-03T21:53:13.000Z | pythonx/netranger/fs.py | ipod825/vim-netranger | 8f5864294263d86051d28b697c7ae1c480dd9ca2 | [
"MIT"
] | 45 | 2017-12-04T15:02:07.000Z | 2021-12-06T22:09:38.000Z | pythonx/netranger/fs.py | ipod825/vim-netranger | 8f5864294263d86051d28b697c7ae1c480dd9ca2 | [
"MIT"
] | 8 | 2017-12-06T10:24:40.000Z | 2021-08-15T23:55:42.000Z | from __future__ import absolute_import
from netranger.enum import Enum
FType = Enum('FileType', 'SOCK, LNK, REG, BLK, DIR, CHR, FIFO')
| 30.712743 | 99 | 0.516245 | from __future__ import absolute_import
import json
import os
import pickle
import re
import shutil
import tempfile
import time
from netranger import Vim, util
from netranger.config import file_sz_display_wid
from netranger.enum import Enum
from netranger.shell import Shell
FType = Enum('FileType', 'SOCK, LNK, REG, B... | 0 | 9,464 | 0 | 4,314 | 0 | 5 | 0 | -17 | 314 |
eef0c298cd2a6af2a0ed317916d3f91b7f08071c | 127 | py | Python | opwen_email_server/constants/github.py | kulado/mailserver | d05c0b2e8d8c97b7b7a08028a9eacd4427a59c4b | [
"Apache-2.0"
] | 15 | 2020-07-06T02:33:15.000Z | 2021-08-09T19:24:11.000Z | opwen_email_server/constants/github.py | kulado/mailserver | d05c0b2e8d8c97b7b7a08028a9eacd4427a59c4b | [
"Apache-2.0"
] | 298 | 2016-12-24T20:19:56.000Z | 2020-04-29T03:13:21.000Z | opwen_email_server/constants/github.py | sbathgate/lokole | a4e3fa5da5373880f6783379f7ef8d843e4cc79d | [
"Apache-2.0"
] | 12 | 2017-06-05T12:13:35.000Z | 2020-01-23T03:26:05.000Z |
GRAPHQL_URL = 'https://api.github.com/graphql' # type: Final # noqa: E501
| 31.75 | 75 | 0.724409 | from typing_extensions import Final # noqa: F401
GRAPHQL_URL = 'https://api.github.com/graphql' # type: Final # noqa: E501
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 36 |
3acea141522edbabbe9dcfc8fdb02306077a23f4 | 6,988 | py | Python | pysc2/agents/myAgent/myAgent_6/decisionMaker/hierarchical_learning_structure.py | Hotpotfish/pysc2 | 3d7f7ffc01a50ab69d435b65c892cd0bc11265a8 | [
"Apache-2.0"
] | null | null | null | pysc2/agents/myAgent/myAgent_6/decisionMaker/hierarchical_learning_structure.py | Hotpotfish/pysc2 | 3d7f7ffc01a50ab69d435b65c892cd0bc11265a8 | [
"Apache-2.0"
] | null | null | null | pysc2/agents/myAgent/myAgent_6/decisionMaker/hierarchical_learning_structure.py | Hotpotfish/pysc2 | 3d7f7ffc01a50ab69d435b65c892cd0bc11265a8 | [
"Apache-2.0"
] | null | null | null |
import pysc2.agents.myAgent.myAgent_6.config.config as config
import pysc2.agents.myAgent.myAgent_6.tools.handcraft_function as handcraft_function
| 50.637681 | 148 | 0.680309 | import datetime
import pysc2.agents.myAgent.myAgent_6.config.config as config
from pysc2.agents.myAgent.myAgent_6.decisionMaker.DQN import DQN
import pysc2.agents.myAgent.myAgent_6.smart_actions as sa
import pysc2.agents.myAgent.myAgent_6.tools.handcraft_function as handcraft_function
from pysc2.env.environment impor... | 147 | 0 | 0 | 6,530 | 0 | 0 | 0 | 102 | 157 |
6b58cee07d53a98989cb8180d2c8c6759dd18752 | 5,530 | py | Python | ddpg.py | ratnarajsingh/continous_control_wDDPG | 7d39318451e181d0810e1d58924cae032eca922f | [
"MIT"
] | null | null | null | ddpg.py | ratnarajsingh/continous_control_wDDPG | 7d39318451e181d0810e1d58924cae032eca922f | [
"MIT"
] | null | null | null | ddpg.py | ratnarajsingh/continous_control_wDDPG | 7d39318451e181d0810e1d58924cae032eca922f | [
"MIT"
] | null | null | null | """
This file contains the definition of the DDPDG agent. The DDPG class defines basic construct of the algorigthm
"""
import torch.nn as nn
actor_lr = 1e-4
critic_lr = 1e-3
n_episodes = 2000
max_steps = 5000
tau = 0.01
gamma = 0.9
buffer_size = 10000000
batch_size = 512
| 37.619048 | 139 | 0.657143 | """
This file contains the definition of the DDPDG agent. The DDPG class defines basic construct of the algorigthm
"""
from model import Actor, Critic, ReplayBuffer
from copy import deepcopy
from noise import OUNoise
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
impor... | 0 | 0 | 0 | 4,593 | 0 | 315 | 0 | 47 | 290 |
59627d8530b955b4e1f4b7bf018da22dd383a077 | 413 | py | Python | auditor/migrations/0014_auto_20181220_1634.py | anubrata/fairwork | 735db0360dc29e26a67f28a6ee59831abe1172e2 | [
"MIT"
] | 10 | 2019-05-14T07:00:18.000Z | 2021-03-24T16:34:18.000Z | auditor/migrations/0014_auto_20181220_1634.py | anubrata/fairwork | 735db0360dc29e26a67f28a6ee59831abe1172e2 | [
"MIT"
] | 17 | 2019-05-25T00:19:17.000Z | 2021-06-24T20:13:42.000Z | auditor/migrations/0014_auto_20181220_1634.py | anubrata/fairwork | 735db0360dc29e26a67f28a6ee59831abe1172e2 | [
"MIT"
] | 3 | 2020-02-03T21:58:40.000Z | 2021-01-26T21:10:47.000Z | # Generated by Django 2.0.5 on 2018-12-21 00:34
| 21.736842 | 62 | 0.617433 | # Generated by Django 2.0.5 on 2018-12-21 00:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auditor', '0013_auto_20181220_1031'),
]
operations = [
migrations.AlterField(
model_name='assignmentaudit',
name='me... | 0 | 0 | 0 | 299 | 0 | 0 | 0 | 19 | 46 |
ec000aa196f290599a5ce39ba2062eff30a1d49f | 1,251 | py | Python | osf/migrations/0189_deleted_field_data.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | osf/migrations/0189_deleted_field_data.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | osf/migrations/0189_deleted_field_data.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-12 17:18
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)
| 27.8 | 114 | 0.71223 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-12 17:18
from __future__ import unicode_literals
import logging
from django.db import migrations
from osf.management.commands.migrate_deleted_date import (
FORWARD_BASE_FILE,
FORWARD_ABSTRACT_NODE,
FORWARD_COMMENT,
FORWARD_INSTITUTION,
... | 0 | 0 | 0 | 679 | 0 | 0 | 0 | 312 | 91 |
26f5b21cfaaae03085f424e072bd2505c093bc09 | 6,234 | py | Python | benchbuild/projects/lnt/lnt.py | simbuerg/benchbuild | e7b0c8d1e26c1d60b8dfab66526dcf6d0c0b6563 | [
"MIT"
] | null | null | null | benchbuild/projects/lnt/lnt.py | simbuerg/benchbuild | e7b0c8d1e26c1d60b8dfab66526dcf6d0c0b6563 | [
"MIT"
] | 3 | 2017-02-02T15:54:52.000Z | 2017-06-08T03:52:45.000Z | benchbuild/projects/lnt/lnt.py | simbuerg/benchbuild | e7b0c8d1e26c1d60b8dfab66526dcf6d0c0b6563 | [
"MIT"
] | 1 | 2017-04-01T15:30:16.000Z | 2017-04-01T15:30:16.000Z | """
LNT based measurements.
"""
| 38.012195 | 79 | 0.578601 | """
LNT based measurements.
"""
from benchbuild.project import Project
from benchbuild.settings import CFG
from benchbuild.utils.compiler import lt_clang, lt_clang_cxx
from benchbuild.utils.downloader import Git, CopyNoFail
from benchbuild.utils.run import run
from benchbuild.utils.wrapping import wrap_dynamic
from p... | 0 | 0 | 0 | 5,642 | 0 | 0 | 0 | 193 | 360 |
f9374adc7166bbbdbdd764bc6fff50fb9e501293 | 512 | py | Python | sputnik_scripts/sputnik2.py | loijord/numpyviz | f3cf6939bd91507118480de41ee7e488463658c9 | [
"OML"
] | 5 | 2020-10-06T01:56:18.000Z | 2022-01-25T18:35:54.000Z | sputnik_scripts/sputnik2.py | loijord/numpyviz | f3cf6939bd91507118480de41ee7e488463658c9 | [
"OML"
] | null | null | null | sputnik_scripts/sputnik2.py | loijord/numpyviz | f3cf6939bd91507118480de41ee7e488463658c9 | [
"OML"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from numpyviz import VisualArray
arr = np.random.randint(99, size=8*8*3).reshape((8,8,3))
va = VisualArray(arr)
va.set_colors(argmin_axis2(arr), color='yellow', basecolor='lightblue')
va.vizualize(fixview=True)
va.ax.set_title('argmin on axis=-1')
plt.show()
| 25.6 | 71 | 0.681641 | import numpy as np
import matplotlib.pyplot as plt
from numpyviz import VisualArray
def argmin_axis2(arr):
a3 = np.argmin(arr, axis=2)
print(a3.__repr__())
a1, a2 = np.indices((arr.shape[0], arr.shape[1]))
x, y, z = zip(*np.broadcast(a1, a2, a3))
return x, y, z
arr = np.random.randint(99, size=8*8... | 0 | 0 | 0 | 0 | 0 | 176 | 0 | 0 | 23 |
412e646cc825e39d689290fa167f2223439261e4 | 2,205 | py | Python | NLP/code.py | sannidh/nlp-dl-prework | 0fa4635c4d8000d3411a251418e46518dceb6907 | [
"MIT"
] | null | null | null | NLP/code.py | sannidh/nlp-dl-prework | 0fa4635c4d8000d3411a251418e46518dceb6907 | [
"MIT"
] | null | null | null | NLP/code.py | sannidh/nlp-dl-prework | 0fa4635c4d8000d3411a251418e46518dceb6907 | [
"MIT"
] | null | null | null | # --------------
# Code starts here
import numpy as np
# Code starts here
# Adjacency matrix
adj_mat = np.array([[0,0,0,0,0,0,1/3,0],
[1/2,0,1/2,1/3,0,0,0,0],
[1/2,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1/2,1/3,0,0,1/3,0],
... | 26.566265 | 68 | 0.570975 | # --------------
# Code starts here
import numpy as np
# Code starts here
# Adjacency matrix
adj_mat = np.array([[0,0,0,0,0,0,1/3,0],
[1/2,0,1/2,1/3,0,0,0,0],
[1/2,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1/2,1/3,0,0,1/3,0],
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
153516958f35fbfc44a6b8bf29fb3a53254ec427 | 1,550 | py | Python | questions/longest-univalue-path/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 141 | 2017-12-12T21:45:53.000Z | 2022-03-25T07:03:39.000Z | questions/longest-univalue-path/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 32 | 2015-10-05T14:09:52.000Z | 2021-05-30T10:28:41.000Z | questions/longest-univalue-path/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 56 | 2015-09-30T05:23:28.000Z | 2022-03-08T07:57:11.000Z | """
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root.
Note: The length of path between two nodes is represented by the number of edges between them.
Example 1:
Input:
5
/ \
4... | 23.484848 | 152 | 0.489677 | """
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root.
Note: The length of path between two nodes is represented by the number of edges between them.
Example 1:
Input:
5
/ \
4... | 0 | 0 | 0 | 751 | 0 | 0 | 0 | 0 | 23 |
65e56f9867bd929417f8c5bcbad7a143e9be8e76 | 813 | py | Python | Moderate/rand7_from_rand5.py | will300/Algorithms | 7042756610fbe639c32dcd12b099444d61a0c1b1 | [
"CNRI-Python"
] | null | null | null | Moderate/rand7_from_rand5.py | will300/Algorithms | 7042756610fbe639c32dcd12b099444d61a0c1b1 | [
"CNRI-Python"
] | null | null | null | Moderate/rand7_from_rand5.py | will300/Algorithms | 7042756610fbe639c32dcd12b099444d61a0c1b1 | [
"CNRI-Python"
] | null | null | null |
test()
| 22.583333 | 73 | 0.597786 | from random import randint
from collections import Counter
def rand5():
return randint(0, 4)
def roll_dice(vals):
return {x[0]: rand5() for x in vals}
def num_winners(arr):
if len(arr) == 1:
return 1
val = arr[0][1]
num = 1
for elem in arr[1:]:
if elem[1] == val:
n... | 0 | 0 | 0 | 0 | 0 | 631 | 0 | 15 | 159 |
624473463fe5e7340484e03444011f989cf5d638 | 12,481 | py | Python | aspen_ssh/certificates/ssh_certificate_builder.py | thinkwelltwd/aspen_ssh | 68cfab56187b63b6e22ab96fefe4c87171f7ccce | [
"Apache-2.0"
] | 1 | 2021-09-09T13:02:36.000Z | 2021-09-09T13:02:36.000Z | aspen_ssh/certificates/ssh_certificate_builder.py | thinkwelltwd/aspen_ssh | 68cfab56187b63b6e22ab96fefe4c87171f7ccce | [
"Apache-2.0"
] | null | null | null | aspen_ssh/certificates/ssh_certificate_builder.py | thinkwelltwd/aspen_ssh | 68cfab56187b63b6e22ab96fefe4c87171f7ccce | [
"Apache-2.0"
] | null | null | null | """
.. module: aspen_ssh.ssh.certificates.ssh_certificate_builder
:copyright: (c) 2016 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
from typing import TYPE_CHECKING
if TYPE_CHECKING:
__all__ = (
'SSHCertificateType',
'SSHCertifiedKeyType',
'SSHCerti... | 38.051829 | 99 | 0.653153 | """
.. module: aspen_ssh.ssh.certificates.ssh_certificate_builder
:copyright: (c) 2016 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
import base64
import os
from typing import TYPE_CHECKING
from aspen_ssh.protocol.ssh_protocol import pack_ssh_string, pack_ssh_uint64,... | 0 | 0 | 0 | 11,881 | 0 | 0 | 0 | 100 | 162 |
fa6f5f0b2c5764fd7c935b09158b1b261a7997d6 | 1,889 | py | Python | tests/settings_fake.py | espes/azure-storage-python | 2830c6b4fa477d1f926ec1deb384d82d7fd1f03c | [
"Apache-2.0"
] | 2 | 2017-08-04T18:53:19.000Z | 2021-06-28T01:52:10.000Z | tests/settings_fake.py | espes/azure-storage-python | 2830c6b4fa477d1f926ec1deb384d82d7fd1f03c | [
"Apache-2.0"
] | null | null | null | tests/settings_fake.py | espes/azure-storage-python | 2830c6b4fa477d1f926ec1deb384d82d7fd1f03c | [
"Apache-2.0"
] | 3 | 2017-07-21T06:34:34.000Z | 2019-09-28T17:50:27.000Z | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | 41.977778 | 119 | 0.724722 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d7da48c1b8b59db33b40822613eb7db7854ece7 | 936 | py | Python | 06-bucles/bucle_while.py | tulcas/master-python | ddac8aa1bf3e6448fe237eac239d27ce3fda705c | [
"MIT"
] | null | null | null | 06-bucles/bucle_while.py | tulcas/master-python | ddac8aa1bf3e6448fe237eac239d27ce3fda705c | [
"MIT"
] | null | null | null | 06-bucles/bucle_while.py | tulcas/master-python | ddac8aa1bf3e6448fe237eac239d27ce3fda705c | [
"MIT"
] | null | null | null | """
# BUCLE WHILE
Estructura de control que itera o repite la ejecucion de una serie de instrucciones
tantas veces como sea necesario hasta que deje de cumplrise la condicion.
codigo:
while $condicion:
bloque de instrucciones
//contador
"""
contador = 1
while contador <= 10:
print(f"Mostrando numero... | 18.352941 | 84 | 0.635684 | """
# BUCLE WHILE
Estructura de control que itera o repite la ejecucion de una serie de instrucciones
tantas veces como sea necesario hasta que deje de cumplrise la condicion.
codigo:
while $condicion:
bloque de instrucciones
//contador
"""
contador = 1
while contador <= 10:
print(f"Mostrando numero... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6df8d7ca939f060bb430239d93bfca11bc31bd6a | 626 | py | Python | Flask_site/app.py | jamesanderegg/Bootcamp | bc4224a6a510feea2205bcbbeeb83d2164aa117a | [
"MIT"
] | 1 | 2018-09-12T02:56:20.000Z | 2018-09-12T02:56:20.000Z | Flask_site/app.py | jamesanderegg/Bootcamp | bc4224a6a510feea2205bcbbeeb83d2164aa117a | [
"MIT"
] | null | null | null | Flask_site/app.py | jamesanderegg/Bootcamp | bc4224a6a510feea2205bcbbeeb83d2164aa117a | [
"MIT"
] | 1 | 2018-08-22T00:43:03.000Z | 2018-08-22T00:43:03.000Z | from flask import Flask
from pymongo import MongoClient
app = Flask(__name__)
client = MongoClient('localhost',27017)
db = client.mars_data
collection = db.mars_data
new_data = collection.find_one()
if __name__ == "__main__":
app.run(debug=True) | 19.5625 | 62 | 0.670927 | from flask import Flask, render_template
from pymongo import MongoClient
import get_data
app = Flask(__name__)
client = MongoClient('localhost',27017)
db = client.mars_data
collection = db.mars_data
new_data = collection.find_one()
@app.route('/')
def index():
return(render_templat... | 0 | 244 | 0 | 0 | 0 | 0 | 0 | 11 | 98 |
abe115f55554608c89c95771dd5fbad402e03085 | 3,729 | py | Python | ConfigManager.py | jakehyvonen/PaintByMotors | 6ec568633e0f8bbddeb5d1731d21144a2b6a5ced | [
"MIT"
] | null | null | null | ConfigManager.py | jakehyvonen/PaintByMotors | 6ec568633e0f8bbddeb5d1731d21144a2b6a5ced | [
"MIT"
] | null | null | null | ConfigManager.py | jakehyvonen/PaintByMotors | 6ec568633e0f8bbddeb5d1731d21144a2b6a5ced | [
"MIT"
] | null | null | null | import os
from pathlib import Path
import logging
from datetime import datetime
home = str(Path.home())
configFileName = 'PBMConfig.cfg'
PBMDir = '/Documents/PaintByMotors/'
PBMDirPath = home + PBMDir
SQLDirPath = PBMDirPath + 'SQL/'
DefaultDB = 'test.db'
try:
os.mkdir(PBMDirPath + str(datetime.now().year)
+'/... | 31.601695 | 85 | 0.667203 | import configparser
import os
import sys
from pathlib import Path
import logging
from datetime import datetime
home = str(Path.home())
configFileName = 'PBMConfig.cfg'
PBMDir = '/Documents/PaintByMotors/'
PBMDirPath = home + PBMDir
SQLDirPath = PBMDirPath + 'SQL/'
DefaultDB = 'test.db'
try:
os.mkdir(PBMDirPath + s... | 0 | 0 | 0 | 0 | 0 | 2,270 | 0 | -13 | 136 |
eab10d4c02f8c2b661b9ef326d30288c2c67325e | 226 | py | Python | ocnn/models/__init__.py | octree-nn/ocnn-pytorch | cdff2f5e589fd8a0b79c4f7b90042a8cefabf2d0 | [
"MIT"
] | 4 | 2021-12-18T13:27:59.000Z | 2022-03-19T02:47:16.000Z | ocnn/models/__init__.py | octree-nn/ocnn-pytorch | cdff2f5e589fd8a0b79c4f7b90042a8cefabf2d0 | [
"MIT"
] | null | null | null | ocnn/models/__init__.py | octree-nn/ocnn-pytorch | cdff2f5e589fd8a0b79c4f7b90042a8cefabf2d0 | [
"MIT"
] | null | null | null | from .lenet import LeNet
from .resnet import ResNet
from .segnet import SegNet
from .unet import UNet
from .hrnet import HRNet
__all__ = [
'LeNet',
'ResNet',
'SegNet',
'UNet',
'HRNet'
]
classes = __all__
| 14.125 | 26 | 0.659292 | from .lenet import LeNet
from .resnet import ResNet
from .segnet import SegNet
from .unet import UNet
from .hrnet import HRNet
__all__ = [
'LeNet',
'ResNet',
'SegNet',
'UNet',
'HRNet'
]
classes = __all__
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8b21c2234de0c9e97015ceb0cb6b66f35768995a | 3,373 | py | Python | Template/Template_2.py | SteveMacNZ/Python | 7161cb6bb3fa8818563b536206901331faef34b8 | [
"MIT"
] | null | null | null | Template/Template_2.py | SteveMacNZ/Python | 7161cb6bb3fa8818563b536206901331faef34b8 | [
"MIT"
] | null | null | null | Template/Template_2.py | SteveMacNZ/Python | 7161cb6bb3fa8818563b536206901331faef34b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Short description of this Python module.
Longer description of this module.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of t... | 33.39604 | 137 | 0.573673 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Short description of this Python module.
Longer description of this module.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of t... | 0 | 0 | 0 | 0 | 0 | 101 | 0 | -29 | 90 |
57b5763788c585c7763bcd20c14fa8ac1da4f216 | 1,384 | py | Python | mvpsite/products/migrations/0002_buyerpurchase.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | mvpsite/products/migrations/0002_buyerpurchase.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | mvpsite/products/migrations/0002_buyerpurchase.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-10-12 00:00
import django.db.models.deletion
| 40.705882 | 145 | 0.633671 | # Generated by Django 3.2.7 on 2021-10-12 00:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 0 | 0 | 0 | 1,175 | 0 | 0 | 0 | 37 | 90 |
7cc8102a5827fef4fe3f38102d899697159aba01 | 1,533 | py | Python | 16.Functional Programming with Python - SW/02.Python - Functional Parts/Challenge_converting_to_list_comprehension_2.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 3 | 2020-06-01T04:17:18.000Z | 2020-12-18T03:05:55.000Z | 16.Functional Programming with Python - SW/02.Python - Functional Parts/Challenge_converting_to_list_comprehension_2.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 1 | 2020-04-25T08:01:59.000Z | 2020-04-25T08:01:59.000Z | 16.Functional Programming with Python - SW/02.Python - Functional Parts/Challenge_converting_to_list_comprehension_2.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 7 | 2020-04-26T10:02:36.000Z | 2021-06-08T05:12:46.000Z | from functools import reduce
employees = [{
'name': 'Jane',
'salary': 90000,
'job_title': 'developer'
}, {
'name': 'Bill',
'salary': 50000,
'job_title': 'writer'
}, {
'name': 'Kathy',
'salary': 120000,
'job_title': 'executive'
}, {
'name': 'Anna',
'salary': 100000,
'job_... | 22.880597 | 75 | 0.679713 | from functools import reduce
employees = [{
'name': 'Jane',
'salary': 90000,
'job_title': 'developer'
}, {
'name': 'Bill',
'salary': 50000,
'job_title': 'writer'
}, {
'name': 'Kathy',
'salary': 120000,
'job_title': 'executive'
}, {
'name': 'Anna',
'salary': 100000,
'job_... | 0 | 0 | 0 | 0 | 0 | 164 | 0 | 0 | 91 |
82c252887dea5f15341ee1db8c3a38690f549ee9 | 3,411 | py | Python | base/src/shallowflow/base/transformers/_CallableTransformer.py | waikato-datamining/shallow-flow | 3f1d99921e5138598eb164edeb1d23e6f199501c | [
"MIT"
] | null | null | null | base/src/shallowflow/base/transformers/_CallableTransformer.py | waikato-datamining/shallow-flow | 3f1d99921e5138598eb164edeb1d23e6f199501c | [
"MIT"
] | 2 | 2021-08-18T22:00:08.000Z | 2021-08-18T22:00:47.000Z | base/src/shallowflow/base/transformers/_CallableTransformer.py | waikato-datamining/shallowflow | 3f1d99921e5138598eb164edeb1d23e6f199501c | [
"MIT"
] | null | null | null |
STATE_INPUT = "input"
| 25.840909 | 102 | 0.584579 | from shallowflow.api.actor import InputConsumer, OutputProducer
from shallowflow.api.callable import AbstractCallableActor
from shallowflow.api.compatibility import Unknown
STATE_INPUT = "input"
class CallableTransformer(AbstractCallableActor, InputConsumer, OutputProducer):
"""
Executes the referenced trans... | 0 | 0 | 0 | 3,191 | 0 | 0 | 0 | 107 | 89 |
f9e1f4c1507d9a550bdfb673be79339e67c5f417 | 2,388 | py | Python | base.py | RRRoger/music163_scripts | f421354b7c2b070e24e8e24b08049906f1ee1371 | [
"MIT"
] | null | null | null | base.py | RRRoger/music163_scripts | f421354b7c2b070e24e8e24b08049906f1ee1371 | [
"MIT"
] | null | null | null | base.py | RRRoger/music163_scripts | f421354b7c2b070e24e8e24b08049906f1ee1371 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import configparser
PATH = "./user.conf"
config = configparser.ConfigParser()
config.read(PATH)
options = config['options']
login_way = options['login_way']
account = options['account']
password = options['password']
api_host = options['api_host']
USER_PAGE_URL = "https://music.163.com/#/us... | 25.136842 | 85 | 0.610553 | # -*- coding: utf-8 -*-
import configparser
import requests
PATH = "./user.conf"
config = configparser.ConfigParser()
config.read(PATH)
options = config['options']
login_way = options['login_way']
account = options['account']
password = options['password']
api_host = options['api_host']
USER_PAGE_URL = "https://mu... | 75 | 0 | 0 | 0 | 0 | 764 | 0 | -6 | 114 |
23f1b263f68bd820d91b8babf180408e653bc65b | 2,573 | py | Python | examples/sheet_metal/blanking/punch/punch.py | shanep805/p3l-library | 52c76f86c876290c2ad935ca0b0fcad0e9d4df92 | [
"MIT"
] | null | null | null | examples/sheet_metal/blanking/punch/punch.py | shanep805/p3l-library | 52c76f86c876290c2ad935ca0b0fcad0e9d4df92 | [
"MIT"
] | null | null | null | examples/sheet_metal/blanking/punch/punch.py | shanep805/p3l-library | 52c76f86c876290c2ad935ca0b0fcad0e9d4df92 | [
"MIT"
] | null | null | null | # Simple contours (circles, squares, rectangles, slots, obrounds) below your custom
# max size threshold will be assumed to cut with a single hit from a punch_cost_per_sheet tool. All other contours are assumed
# to be multi-hit features. We provide you the multi-hit cut length to estimate pricing of these operations.
... | 51.46 | 132 | 0.791683 | # Simple contours (circles, squares, rectangles, slots, obrounds) below your custom
# max size threshold will be assumed to cut with a single hit from a punch_cost_per_sheet tool. All other contours are assumed
# to be multi-hit features. We provide you the multi-hit cut length to estimate pricing of these operations.
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
497ea51b2be22274e454e93bda4509cbbf2df1de | 3,884 | py | Python | nncf/experimental/post_training/api/metric.py | openvinotoolkit/nncf_pytorch | 13a483eac6ed891720ba90d7902142c4b3bfa599 | [
"Apache-2.0"
] | 136 | 2020-06-01T14:03:31.000Z | 2020-10-28T06:10:50.000Z | nncf/experimental/post_training/api/metric.py | openvinotoolkit/nncf_pytorch | 13a483eac6ed891720ba90d7902142c4b3bfa599 | [
"Apache-2.0"
] | 133 | 2020-05-26T13:48:04.000Z | 2020-10-28T05:25:55.000Z | nncf/experimental/post_training/api/metric.py | openvinotoolkit/nncf_pytorch | 13a483eac6ed891720ba90d7902142c4b3bfa599 | [
"Apache-2.0"
] | 36 | 2020-05-28T08:18:39.000Z | 2020-10-27T14:46:58.000Z | """
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 29.648855 | 105 | 0.611998 | """
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 0 | 987 | 0 | 2,111 | 0 | 0 | 0 | 10 | 113 |
f9a8d8332049a108771e7616260608aece70a817 | 18,504 | py | Python | main/main.py | Reaction-Space-Explorer/reac-space-exp | 02c91247d9ee5107cbf9fa113e87edaf4bd392b0 | [
"BSD-3-Clause"
] | 4 | 2020-06-27T23:08:41.000Z | 2022-01-09T16:20:48.000Z | main/main.py | sahilrajiv/reac-space-exp | 52f4b4eab755bd4a6830d838828c958149567396 | [
"BSD-3-Clause"
] | 15 | 2020-07-27T23:14:32.000Z | 2022-03-12T00:59:20.000Z | main/main.py | sahilrajiv/reac-space-exp | 52f4b4eab755bd4a6830d838828c958149567396 | [
"BSD-3-Clause"
] | 3 | 2020-06-27T23:08:46.000Z | 2021-04-20T09:29:33.000Z | import os
import matplotlib.pyplot as plt
#from rdkit.Chem import SDMolSupplier, MolFromSmiles, MolToSmiles, Kekulize
include(os.path.join('..', 'rules/all.py'))
include("mod_to_neo4j_exporter.py")
p = GraphPrinter()
p.simpleCarbons = True
p.withColour = True
p.collapseHydrogens = True
# Forbidden substructures (do... | 37.156627 | 153 | 0.706118 | import os
import time
import matplotlib.pyplot as plt
#from rdkit.Chem import SDMolSupplier, MolFromSmiles, MolToSmiles, Kekulize
include(os.path.join('..', 'rules/all.py'))
include("mod_to_neo4j_exporter.py")
p = GraphPrinter()
p.simpleCarbons = True
p.withColour = True
p.collapseHydrogens = True
# Forbidden subst... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
4397b34e5d81a59414f7d02f7d4ba311b7b30c55 | 1,882 | py | Python | atd-etl/app/process/aws.py | cityofaustin/transportation-vz-data | efe3cd95a532720e0f3f83b7cbd8e048a44de5a4 | [
"CC0-1.0"
] | 7 | 2019-11-22T19:04:50.000Z | 2022-03-10T20:07:40.000Z | atd-etl/app/process/aws.py | cityofaustin/atd-vz-data | cb00f0eba6cbb330d4325d2d1f18d862f5573205 | [
"CC0-1.0"
] | 645 | 2019-04-18T19:20:51.000Z | 2022-03-22T19:53:03.000Z | atd-etl/app/process/aws.py | cityofaustin/transportation-vz-data | efe3cd95a532720e0f3f83b7cbd8e048a44de5a4 | [
"CC0-1.0"
] | 1 | 2019-10-31T17:04:54.000Z | 2019-10-31T17:04:54.000Z | """
AWS Helpers
Author: Austin Transportation Department, Data and Technology Services
Description: The purpose of this script is to provide helper methods
associated to AWS services.
"""
import subprocess
import boto3
# We need our AWS configuration variables
from .config import ATD_ETL_CONFIG
def aws_credentials_... | 27.275362 | 83 | 0.676939 | """
AWS Helpers
Author: Austin Transportation Department, Data and Technology Services
Description: The purpose of this script is to provide helper methods
associated to AWS services.
"""
import subprocess
import boto3
# We need our AWS configuration variables
from .config import ATD_ETL_CONFIG
def aws_credentials_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e2d08d12168e42cda95ba4a040e1f581f8ddb096 | 436 | py | Python | tests/channel_tests.py | fanout/pygripcontrol | e139d29203a0bdb5d44904a517a81e3a9c400735 | [
"MIT"
] | 19 | 2015-02-06T13:31:25.000Z | 2021-03-19T03:36:09.000Z | tests/channel_tests.py | fanout/pygripcontrol | e139d29203a0bdb5d44904a517a81e3a9c400735 | [
"MIT"
] | 3 | 2017-10-05T18:20:26.000Z | 2021-04-24T15:06:36.000Z | tests/channel_tests.py | fanout/pygripcontrol | e139d29203a0bdb5d44904a517a81e3a9c400735 | [
"MIT"
] | 5 | 2016-10-08T10:30:07.000Z | 2017-10-06T20:30:17.000Z | import sys
import unittest
sys.path.append('../')
if __name__ == '__main__':
unittest.main()
| 22.947368 | 46 | 0.727064 | import sys
import unittest
sys.path.append('../')
from src.channel import Channel
class TestChannel(unittest.TestCase):
def test_initialize(self):
channel = Channel('name')
self.assertEqual(channel.name, 'name')
self.assertEqual(channel.prev_id, None)
channel = Channel('name', 'prev-id')
self.assertEqual(... | 0 | 0 | 0 | 284 | 0 | 0 | 0 | 10 | 45 |
8c078e4481469e8f86de2e7d2335b5209652a454 | 3,659 | py | Python | samo/model/node.py | AlexMontgomerie/samo | 6e1deaeaadf69950e71d7e5da7ed06e79a830632 | [
"MIT"
] | 13 | 2021-12-06T23:13:11.000Z | 2022-03-12T16:21:59.000Z | samo/model/node.py | AlexMontgomerie/samo | 6e1deaeaadf69950e71d7e5da7ed06e79a830632 | [
"MIT"
] | null | null | null | samo/model/node.py | AlexMontgomerie/samo | 6e1deaeaadf69950e71d7e5da7ed06e79a830632 | [
"MIT"
] | null | null | null | from functools import reduce
def get_factors(n):
"""
helper function for returning all the factors of `n`
"""
return list(set(reduce(list.__add__,
([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
| 29.272 | 153 | 0.654824 | import math
from functools import reduce
from dataclasses import dataclass, field
from typing import List
def get_factors(n):
"""
helper function for returning all the factors of `n`
"""
return list(set(reduce(list.__add__,
([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
@datac... | 0 | 3,322 | 0 | 0 | 0 | 0 | 0 | 11 | 89 |
37fcadbdff89fb1b17a18d3591a640d1af04f97d | 3,859 | py | Python | openGaussBase/testcase/SQL/INNERFUNC/Trigger_Functions/Opengauss_Function_Innerfunc_Trigger_Func_Case0004.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/INNERFUNC/Trigger_Functions/Opengauss_Function_Innerfunc_Trigger_Func_Case0004.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/INNERFUNC/Trigger_Functions/Opengauss_Function_Innerfunc_Trigger_Func_Case0004.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 34.150442 | 84 | 0.623218 | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 489 | 0 | 0 | 2,760 | 0 | 0 | 0 | 44 | 112 |
29b40a63d6011786ca0f4987af958d41107013ca | 16,530 | py | Python | add_trailing_comma.py | mxr/add-trailing-comma | 3cdd7dbd9cbe489ff2fc86011a4a7e5fe9b90a8f | [
"MIT"
] | null | null | null | add_trailing_comma.py | mxr/add-trailing-comma | 3cdd7dbd9cbe489ff2fc86011a4a7e5fe9b90a8f | [
"MIT"
] | null | null | null | add_trailing_comma.py | mxr/add-trailing-comma | 3cdd7dbd9cbe489ff2fc86011a4a7e5fe9b90a8f | [
"MIT"
] | null | null | null |
from tokenize_rt import ESCAPED_NL
from tokenize_rt import UNIMPORTANT_WS
NEWLINES = frozenset((ESCAPED_NL, 'NEWLINE', 'NL'))
INDENT_TOKENS = frozenset(('INDENT', UNIMPORTANT_WS))
START_BRACES = frozenset(('(', '{', '['))
END_BRACES = frozenset((')', '}', ']'))
if __name__ == '__main__':
exit(mai... | 32.797619 | 79 | 0.595705 | import argparse
import ast
import collections
import sys
import warnings
from typing import Dict
from typing import Generator
from typing import List
from typing import NamedTuple
from typing import Optional
from typing import Sequence
from typing import Set
from typing import Tuple
from tokenize_rt import ESCAPED_NL
... | 0 | 0 | 0 | 3,834 | 144 | 11,419 | 0 | 67 | 741 |
c2c38f47afba84f824e79b5897bd0276c2642356 | 56 | py | Python | try1.py | chetanadhikary/weekday_python_inclass | 12014a87140c5f641a4eb382d5a7206863805f8a | [
"MIT"
] | null | null | null | try1.py | chetanadhikary/weekday_python_inclass | 12014a87140c5f641a4eb382d5a7206863805f8a | [
"MIT"
] | null | null | null | try1.py | chetanadhikary/weekday_python_inclass | 12014a87140c5f641a4eb382d5a7206863805f8a | [
"MIT"
] | null | null | null | grade_in = input('Enter your grade between 0.0 and 1.0') | 56 | 56 | 0.732143 | grade_in = input('Enter your grade between 0.0 and 1.0') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f79ed1106e0ed71e5cf18f40e1682df614e48244 | 1,159 | py | Python | objectModel/Python/cdm/objectmodel/cdm_attribute_context_ref.py | rt112000/CDM | 34bd34f9260140a8f8aa02bd87c23033f3daad4c | [
"CC-BY-4.0",
"MIT"
] | 884 | 2019-05-10T02:09:10.000Z | 2022-03-31T14:02:00.000Z | objectModel/Python/cdm/objectmodel/cdm_attribute_context_ref.py | spbast/CDM | bf97a3720c97ee4c9df3625084cf8b3bc65ff9c7 | [
"CC-BY-4.0",
"MIT"
] | 171 | 2019-06-10T11:34:37.000Z | 2022-03-31T22:50:12.000Z | objectModel/Python/cdm/objectmodel/cdm_attribute_context_ref.py | spbast/CDM | bf97a3720c97ee4c9df3625084cf8b3bc65ff9c7 | [
"CC-BY-4.0",
"MIT"
] | 340 | 2019-05-07T18:00:16.000Z | 2022-03-31T12:00:15.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 37.387097 | 164 | 0.749784 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import Union, Optional, TYPE_CHECKING
from cdm.enums import CdmObjectType
from .cdm_object_ref import CdmObjectReference
if TYPE_CHECKING:
from ... | 3 | 85 | 0 | 630 | 0 | 0 | 0 | 113 | 121 |
89e9b355253687c003fc0ab114bfc566f7543dd8 | 8,298 | py | Python | phylip2svdq.py | tkchafin/file_converters | 635beec418bd4593bb6f724e289ab939633c00c3 | [
"MIT"
] | 1 | 2020-11-17T06:19:29.000Z | 2020-11-17T06:19:29.000Z | phylip2svdq.py | tkchafin/file_converters | 635beec418bd4593bb6f724e289ab939633c00c3 | [
"MIT"
] | 2 | 2018-11-03T20:50:31.000Z | 2021-09-15T15:18:11.000Z | phylip2svdq.py | tkchafin/file_converters | 635beec418bd4593bb6f724e289ab939633c00c3 | [
"MIT"
] | 1 | 2020-06-22T20:51:46.000Z | 2020-06-22T20:51:46.000Z | #!/usr/bin/env python3
# Uses argparse library to parse command-line arguments; argparse must be imported
#flatmap = 2D dict where key=pop and value=list of sample IDs
#function reads a tab-delimited popmap file and return dictionary of assignments
#Makes a dict of lists from a popmap
#########################... | 36.555066 | 138 | 0.526633 | #!/usr/bin/env python3
import sys
import os
import argparse
import operator
# Uses argparse library to parse command-line arguments; argparse must be imported
def Get_Arguments():
parser = argparse.ArgumentParser(description="Converts PHYLIP file to NEXUS format and writes taxpartition block for SVDquartets")
... | 0 | 0 | 0 | 0 | 0 | 3,765 | 0 | -35 | 335 |
87a349dcf8924ceb25a22bfeb2195deb220db639 | 505 | py | Python | DynamicProgramming/MaximumChainOfPairs.py | kopok2/algorithms | efb6a423a8447d99584335e9fef8d9b3c74e2ad8 | [
"MIT"
] | null | null | null | DynamicProgramming/MaximumChainOfPairs.py | kopok2/algorithms | efb6a423a8447d99584335e9fef8d9b3c74e2ad8 | [
"MIT"
] | null | null | null | DynamicProgramming/MaximumChainOfPairs.py | kopok2/algorithms | efb6a423a8447d99584335e9fef8d9b3c74e2ad8 | [
"MIT"
] | null | null | null | # coding=utf-8
"""Maximum length chain of pairs dynamic programming solution Python implementation."""
if __name__ == "__main__":
arr = [[5, 24], [15, 25], [27, 40], [50, 60]]
print(mlcp(arr))
| 24.047619 | 87 | 0.518812 | # coding=utf-8
"""Maximum length chain of pairs dynamic programming solution Python implementation."""
def mlcp(pairs):
n = len(pairs)
mcl = [1 for x in range(n)]
for i in range(1, n):
for j in range(i):
if pairs[i][0] > pairs[j][1] and mcl[i] < mcl[j] + 1:
mcl[i] = mcl... | 0 | 0 | 0 | 0 | 0 | 278 | 0 | 0 | 23 |
7a4b1d6b824492c333a58cd7b2564f52febcd873 | 2,063 | py | Python | server/oauth.py | robertkozin/RUGood | 3f5857d6fc071aa798fa96a9a21870d445c0c4cf | [
"MIT"
] | null | null | null | server/oauth.py | robertkozin/RUGood | 3f5857d6fc071aa798fa96a9a21870d445c0c4cf | [
"MIT"
] | null | null | null | server/oauth.py | robertkozin/RUGood | 3f5857d6fc071aa798fa96a9a21870d445c0c4cf | [
"MIT"
] | null | null | null | import os
import server.db as db
from urllib.parse import urlparse
from dotenv import load_dotenv
load_dotenv()
API_ENDPOINT = "https://discord.com/api/v8"
CLIENT_ID = os.environ.get("CLIENT_ID")
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
REDIRECT_URI = os.environ.get("REDIRECT_URI")
DISCORD_AUTH_UR... | 33.819672 | 166 | 0.679108 | import requests, json, os, urllib
from server.user import User
import server.db as db
from urllib.parse import urlparse
from dotenv import load_dotenv
load_dotenv()
API_ENDPOINT = "https://discord.com/api/v8"
CLIENT_ID = os.environ.get("CLIENT_ID")
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
REDIRECT... | 0 | 0 | 0 | 0 | 0 | 1,402 | 0 | 31 | 148 |
0f7a56c7ccae59d5b201da24b0357134293cd37b | 452 | py | Python | script.py | muqsith/stackexchange-mongo-import | b72f0501c251aaae540537932a4e3b87e65d8559 | [
"MIT"
] | null | null | null | script.py | muqsith/stackexchange-mongo-import | b72f0501c251aaae540537932a4e3b87e65d8559 | [
"MIT"
] | null | null | null | script.py | muqsith/stackexchange-mongo-import | b72f0501c251aaae540537932a4e3b87e65d8559 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.5
import argparse
import os
from mod_xml2mongo import xml2mongo
parser = argparse.ArgumentParser(description='7z -> MongoDB')
parser.add_argument("file_path",help='''Please pass the following as argument
7z file path (OR) directory path where xmls are located
''')
args = parser.parse_args()
... | 23.789474 | 77 | 0.780973 | #!/usr/bin/env python3.5
import argparse
import os
import shutil
from mod_xml2mongo import xml2mongo
parser = argparse.ArgumentParser(description='7z -> MongoDB')
parser.add_argument("file_path",help='''Please pass the following as argument
7z file path (OR) directory path where xmls are located
''')
args = parser... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
87e03e3732af16cf0af8a7e0ec23321e5cfa5e35 | 5,332 | py | Python | feature_learning/main_supervised.py | YoniSchirris/SimCLR-1 | 535472ac76d24d368d3bc08c17987df315e0b657 | [
"Apache-2.0"
] | 1 | 2021-12-03T12:59:39.000Z | 2021-12-03T12:59:39.000Z | feature_learning/main_supervised.py | YoniSchirris/SimCLR-1 | 535472ac76d24d368d3bc08c17987df315e0b657 | [
"Apache-2.0"
] | null | null | null | feature_learning/main_supervised.py | YoniSchirris/SimCLR-1 | 535472ac76d24d368d3bc08c17987df315e0b657 | [
"Apache-2.0"
] | null | null | null | ## Yoni Schirris. 06/10/2020
## Exact copy of main.py (now main_unsupervised.py)
## Idea is to keep functionality of both supervised and unsupervised in here, with some switches that change only minor
## things to switch between supervised and unsupervised learning.
## Thus, in the end, we should again have a single "m... | 33.534591 | 135 | 0.655289 | ## Yoni Schirris. 06/10/2020
## Exact copy of main.py (now main_unsupervised.py)
## Idea is to keep functionality of both supervised and unsupervised in here, with some switches that change only minor
## things to switch between supervised and unsupervised learning.
## Thus, in the end, we should again have a single "m... | 0 | 3,009 | 0 | 0 | 0 | 1,225 | 0 | 201 | 361 |
b8681e1bae669bcb7367ceada79ea7a7bf390b43 | 2,937 | py | Python | Docs_Geometry_Mesh_Deformation.py | zhy29563/Tutorial_Open3D | 58d11e5673783855bae267373919355d5085fc24 | [
"MIT"
] | 2 | 2021-11-09T01:59:36.000Z | 2021-12-20T07:04:02.000Z | Docs_Geometry_Mesh_Deformation.py | zhy29563/Tutorial_Open3D | 58d11e5673783855bae267373919355d5085fc24 | [
"MIT"
] | null | null | null | Docs_Geometry_Mesh_Deformation.py | zhy29563/Tutorial_Open3D | 58d11e5673783855bae267373919355d5085fc24 | [
"MIT"
] | 1 | 2021-11-09T01:59:38.000Z | 2021-11-09T01:59:38.000Z | import open3d as o3d
import numpy as np
import python.open3d_tutorial as o3dtut
# http://www.open3d.org/docs/release/tutorial/geometry/mesh_deformation.html
########################################################################################################################
# 1. Mesh deformation
##################... | 51.526316 | 120 | 0.654069 | import open3d as o3d
import numpy as np
import python.open3d_tutorial as o3dtut
# http://www.open3d.org/docs/release/tutorial/geometry/mesh_deformation.html
########################################################################################################################
# 1. Mesh deformation
##################... | 58 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a1685593a3f84281118991d421d9c67d0aa8b039 | 8,012 | py | Python | test/test_core.py | ChikaYan/kubric | ac4e9cba287463f3c6df277189cd0b34d2ed5582 | [
"Apache-2.0"
] | 1,134 | 2020-07-22T20:00:17.000Z | 2022-03-31T23:54:22.000Z | test/test_core.py | ChikaYan/kubric | ac4e9cba287463f3c6df277189cd0b34d2ed5582 | [
"Apache-2.0"
] | 160 | 2020-07-24T16:11:08.000Z | 2022-03-31T17:43:25.000Z | test/test_core.py | ChikaYan/kubric | ac4e9cba287463f3c6df277189cd0b34d2ed5582 | [
"Apache-2.0"
] | 74 | 2020-08-10T16:27:33.000Z | 2022-03-31T21:37:27.000Z | # Copyright 2021 The Kubric 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 w... | 28.614286 | 100 | 0.6831 | # Copyright 2021 The Kubric 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 w... | 0 | 0 | 0 | 0 | 0 | 6,380 | 0 | 67 | 912 |
c4a40529537f1ca67a84f9626152c4a9a3478f88 | 1,152 | py | Python | settings.py | eddowh/flask-react-redux-demo | 68384efe7a4c2999c2cd947208b8f8db887fd802 | [
"Unlicense"
] | 6 | 2017-09-15T08:14:12.000Z | 2021-03-20T06:50:53.000Z | settings.py | eddowh/flask-react-redux-demo | 68384efe7a4c2999c2cd947208b8f8db887fd802 | [
"Unlicense"
] | null | null | null | settings.py | eddowh/flask-react-redux-demo | 68384efe7a4c2999c2cd947208b8f8db887fd802 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from dotenv import load_dotenv
from sqlalchemy.engine.url import URL
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
APP_DIR = os.path.join(BASE_DIR, 'api')
DOTENV_PATH = os.path.join(BASE_DIR, '.env')
load_dotenv(DOTENV_PATH)
INSTALLED_APPS = [
'restaurants',
]
DATABAS... | 24.510638 | 54 | 0.623264 | # -*- coding: utf-8 -*-
import os
from dotenv import load_dotenv
from sqlalchemy.engine.url import URL
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
APP_DIR = os.path.join(BASE_DIR, 'api')
DOTENV_PATH = os.path.join(BASE_DIR, '.env')
load_dotenv(DOTENV_PATH)
INSTALLED_APPS = [
'restaurants',
]
DATABAS... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
445683a614f0cb4984f21548549f291288894b92 | 1,163 | py | Python | students/k3342/practical_works/Evshina_Yana/django_project_evshina/project_first_app/views.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3342/practical_works/Evshina_Yana/django_project_evshina/project_first_app/views.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3342/practical_works/Evshina_Yana/django_project_evshina/project_first_app/views.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z |
from project_first_app.models import Car
| 21.145455 | 83 | 0.691316 | from django.shortcuts import render
from django.http import Http404
from project_first_app.models import Owner, Car
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from .forms import OwnerForm
from .models import Car
def detail(request, owner_id):
try:
own... | 198 | 0 | 0 | 122 | 0 | 545 | 0 | 92 | 248 |