hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e500e5e44932d22bec329b49d0c02e6c9e60ba18 | 10,187 | py | Python | salt/states/netyang.py | xiaowei582648206/saltx | 1d17b030b973ce5422e0fbe7e17c98c7ca91c49b | [
"Apache-2.0"
] | 1 | 2022-02-09T06:40:14.000Z | 2022-02-09T06:40:14.000Z | salt/states/netyang.py | xiaowei582648206/saltx | 1d17b030b973ce5422e0fbe7e17c98c7ca91c49b | [
"Apache-2.0"
] | null | null | null | salt/states/netyang.py | xiaowei582648206/saltx | 1d17b030b973ce5422e0fbe7e17c98c7ca91c49b | [
"Apache-2.0"
] | 4 | 2020-11-04T06:28:05.000Z | 2022-02-09T10:54:49.000Z | # -*- coding: utf-8 -*-
'''
NAPALM YANG state
=================
Manage the configuration of network devices according to
the YANG models (OpenConfig/IETF).
.. versionadded:: 2017.7.0
Dependencies
------------
- napalm-yang
- pyangbing > 0.5.11
To be able to load configuration on network devices,
it requires NAPALM... | 35.371528 | 113 | 0.52194 |
0af5033bb269c91d17e8ec3622a5e20b0f0044f6 | 18,152 | py | Python | tbonlineproject/post/migrations/0013_auto__add_editorchoice.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | null | null | null | tbonlineproject/post/migrations/0013_auto__add_editorchoice.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | 3 | 2021-06-08T23:57:13.000Z | 2022-01-13T03:42:01.000Z | tbonlineproject/post/migrations/0013_auto__add_editorchoice.py | nathangeffen/tbonline-2 | 0d5869197e66a0057fa07cb99f21dde7f5b47c30 | [
"MIT"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'EditorChoice'
db.create_table('post_editorchoice', (
('id', self.g... | 81.035714 | 210 | 0.55498 |
8d352f7a6d126cb9ca9388638dfaae9c860b5f91 | 3,045 | py | Python | src/igfeedservice/IgFeedService/serializers.py | MatthewWong68/Social_Media_RESTful_API_Django_Web_App | 60d0f2af067071bc8fc6f9da4a810d35bfad3443 | [
"MIT"
] | null | null | null | src/igfeedservice/IgFeedService/serializers.py | MatthewWong68/Social_Media_RESTful_API_Django_Web_App | 60d0f2af067071bc8fc6f9da4a810d35bfad3443 | [
"MIT"
] | null | null | null | src/igfeedservice/IgFeedService/serializers.py | MatthewWong68/Social_Media_RESTful_API_Django_Web_App | 60d0f2af067071bc8fc6f9da4a810d35bfad3443 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Post, Hashtag, Page
# from .models import PostHistory
class PostSerializer(serializers.Serializer):
id = serializers.CharField(max_length=31)
full_text = serializers.CharField(max_length=8191)
author_name = serializers.CharField(max_length=2... | 41.148649 | 87 | 0.693596 |
3a8fb87ee84b095d3cdc59036a74c044a9258674 | 24,763 | py | Python | cellpose/guiparts.py | Czaki/cellpose | fe3a0f9c18323faffd05fffe760dc29db22624f6 | [
"BSD-3-Clause"
] | 1 | 2020-08-11T13:04:37.000Z | 2020-08-11T13:04:37.000Z | cellpose/guiparts.py | Czaki/cellpose | fe3a0f9c18323faffd05fffe760dc29db22624f6 | [
"BSD-3-Clause"
] | null | null | null | cellpose/guiparts.py | Czaki/cellpose | fe3a0f9c18323faffd05fffe760dc29db22624f6 | [
"BSD-3-Clause"
] | null | null | null | from PyQt5 import QtGui, QtCore, QtWidgets
import pyqtgraph as pg
from pyqtgraph import functions as fn
from pyqtgraph import Point
import numpy as np
class HelpWindow(QtGui.QDialog):
def __init__(self, parent=None):
super(HelpWindow, self).__init__(parent)
self.setGeometry(100,100,700,800)
... | 42.042445 | 538 | 0.556112 |
135552180ceffcb58bc36685e806a055285d3a13 | 1,108 | py | Python | module02/ex01/main.py | kotabrog/bootcamp_python | 41251363d8f62d39451650dcd55e0c1522b1ddcb | [
"MIT"
] | null | null | null | module02/ex01/main.py | kotabrog/bootcamp_python | 41251363d8f62d39451650dcd55e0c1522b1ddcb | [
"MIT"
] | null | null | null | module02/ex01/main.py | kotabrog/bootcamp_python | 41251363d8f62d39451650dcd55e0c1522b1ddcb | [
"MIT"
] | null | null | null | def what_are_the_vars(*args, **kwargs):
try:
obj = ObjectC()
attr_count = 0
for value in args:
setattr(obj, 'var_' + str(attr_count), value)
attr_count += 1
for key, value in kwargs.items():
if hasattr(obj, key):
raise Exception()
... | 24.622222 | 70 | 0.554152 |
f4820bad6a46a7c4ed84a37547aab25e223253d8 | 1,276 | py | Python | 00.Basic_Data_Structure_and_Algorithms/Sortings/merge_sort.py | mr-beaver/CtCI-Exercises | f28a579ca0af110c43cb8b1451efd7786ac573ad | [
"MIT"
] | null | null | null | 00.Basic_Data_Structure_and_Algorithms/Sortings/merge_sort.py | mr-beaver/CtCI-Exercises | f28a579ca0af110c43cb8b1451efd7786ac573ad | [
"MIT"
] | null | null | null | 00.Basic_Data_Structure_and_Algorithms/Sortings/merge_sort.py | mr-beaver/CtCI-Exercises | f28a579ca0af110c43cb8b1451efd7786ac573ad | [
"MIT"
] | null | null | null | '''
Implementation of Merge Sort
06/24/2018
Do NOT return an array every time and then combine them.
Use an empty and write the result into it to save space complexity.
'''
def mergeSort(arr):
if not len(arr):
return []
else:
result = [0] * len(arr)
split(arr, 0, len(arr) - 1, result)
return arr
def split(... | 20.918033 | 77 | 0.615204 |
74ece6285aad79304a4370b589c630218f913da8 | 3,680 | py | Python | repos/system_upgrade/el7toel8/actors/postgresqlcheck/libraries/postgresqlcheck.py | winndows/leapp-repository | e4fd7c3fc14e5630b53998bfa3e4869d3e76cf4f | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/postgresqlcheck/libraries/postgresqlcheck.py | winndows/leapp-repository | e4fd7c3fc14e5630b53998bfa3e4869d3e76cf4f | [
"Apache-2.0"
] | 9 | 2020-01-27T14:20:59.000Z | 2020-02-04T12:58:57.000Z | repos/system_upgrade/el7toel8/actors/postgresqlcheck/libraries/postgresqlcheck.py | winndows/leapp-repository | e4fd7c3fc14e5630b53998bfa3e4869d3e76cf4f | [
"Apache-2.0"
] | null | null | null | from leapp import reporting
from leapp.libraries.common.rpms import has_package
from leapp.libraries.stdlib import api
from leapp.models import InstalledRedHatSignedRPM
# Summary for postgresql-server report
report_server_inst_summary = (
'PostgreSQL server component will be upgraded. Since RHEL-8 includes'
'... | 40.888889 | 265 | 0.73913 |
0593a1620d2d00ae9772d61b767c62fc7cfd51ad | 548 | py | Python | ogusa/tests/test_parameter_tables.py | rkasher/OG-USA | 220651fe7f444e66d838971288b10f6932f405fb | [
"CC0-1.0"
] | null | null | null | ogusa/tests/test_parameter_tables.py | rkasher/OG-USA | 220651fe7f444e66d838971288b10f6932f405fb | [
"CC0-1.0"
] | 5 | 2019-08-13T20:04:52.000Z | 2019-11-16T23:10:48.000Z | ogusa/tests/test_parameter_tables.py | rkasher/OG-USA | 220651fe7f444e66d838971288b10f6932f405fb | [
"CC0-1.0"
] | null | null | null | '''
Tests of parameter_table.py module
'''
import pytest
import os
from ogusa import utils, parameter_tables
# Load in test results and parameters
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, 'test_io_data', 'model_params_baseline.pkl'))
base... | 24.909091 | 73 | 0.775547 |
76bfb7cdb622df0668fe8744bcc618274a26ed2c | 32,114 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_packet_captures_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_packet_captures_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_packet_captures_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.712074 | 240 | 0.668307 |
ba844ebd09cc97060b1b27ccb2d8ea5471f82990 | 41,811 | py | Python | PointRCNNV1/tools/eval_rcnn.py | kangpl/semester_project_cvlab | fca8e47c619b03599e8f878aae3371a0060e45a7 | [
"Artistic-1.0-cl8"
] | 4 | 2021-03-14T17:41:21.000Z | 2021-11-04T07:16:39.000Z | PointRCNNV1/tools/eval_rcnn.py | kangpl/semester_project_cvlab | fca8e47c619b03599e8f878aae3371a0060e45a7 | [
"Artistic-1.0-cl8"
] | 1 | 2021-04-17T14:50:41.000Z | 2021-04-17T14:50:41.000Z | PointRCNNV1/tools/eval_rcnn.py | kangpl/semester_project_cvlab | fca8e47c619b03599e8f878aae3371a0060e45a7 | [
"Artistic-1.0-cl8"
] | 1 | 2021-02-01T09:25:49.000Z | 2021-02-01T09:25:49.000Z | import _init_path
import os
import numpy as np
import torch
from torch.utils.data import DataLoader
import torch.nn.functional as F
from lib.net.point_rcnn import PointRCNN
from lib.datasets.kitti_rcnn_dataset import KittiRCNNDataset
import tools.train_utils.train_utils as train_utils
from lib.utils.bbox_transform impo... | 45.946154 | 125 | 0.626558 |
babb365f884a236a29073fcb4bae1f9aa9a365a7 | 50,874 | py | Python | cunt/consensus/block_header_validation.py | CallMeBrado/cunt-blockchain | 9b140b7e5541f3baffabe02a55b75d9aeb889999 | [
"Apache-2.0"
] | 7 | 2021-08-09T19:01:51.000Z | 2021-12-09T04:32:09.000Z | cunt/consensus/block_header_validation.py | CallMeBrado/cunt-blockchain | 9b140b7e5541f3baffabe02a55b75d9aeb889999 | [
"Apache-2.0"
] | 22 | 2021-08-17T04:12:11.000Z | 2022-03-29T04:10:38.000Z | cunt/consensus/block_header_validation.py | CallMeBrado/cunt-blockchain | 9b140b7e5541f3baffabe02a55b75d9aeb889999 | [
"Apache-2.0"
] | 4 | 2021-09-05T12:04:51.000Z | 2022-03-15T08:44:32.000Z | import dataclasses
import logging
import time
from typing import Optional, Tuple
from blspy import AugSchemeMPL
from cunt.consensus.block_record import BlockRecord
from cunt.consensus.blockchain_interface import BlockchainInterface
from cunt.consensus.constants import ConsensusConstants
from cunt.consensus.deficit im... | 47.81391 | 120 | 0.639521 |
ac5ee8b234d3426c2dcef6f03615ff75e3083dd8 | 1,408 | py | Python | my_lambdata/my_mod.py | KristineYW/lambdata-kristine | 3ace36fb1abdd9caaa86385fba9d06b6faba546a | [
"MIT"
] | null | null | null | my_lambdata/my_mod.py | KristineYW/lambdata-kristine | 3ace36fb1abdd9caaa86385fba9d06b6faba546a | [
"MIT"
] | null | null | null | my_lambdata/my_mod.py | KristineYW/lambdata-kristine | 3ace36fb1abdd9caaa86385fba9d06b6faba546a | [
"MIT"
] | 1 | 2020-06-02T23:44:10.000Z | 2020-06-02T23:44:10.000Z | # my_lambdata/my_mod.py
from sklearn.model_selection import train_test_split
import pandas as pd
def enlarge(n):
"""
Param n is a number
Function will enlarge the number
"""
return n * 100
# Split a dataframe into train, val, and test sets
def df_split(df, target):
train1, val = train_test... | 30.608696 | 84 | 0.693892 |
7a876b0f344d9ea7c80390421c5db695701e6a46 | 6,266 | py | Python | dsfs/statistics/stats_base.py | Infi-Knight/data_science_from_scratch | a78317728f218d4259fab925112413ddddfc30ca | [
"MIT"
] | null | null | null | dsfs/statistics/stats_base.py | Infi-Knight/data_science_from_scratch | a78317728f218d4259fab925112413ddddfc30ca | [
"MIT"
] | null | null | null | dsfs/statistics/stats_base.py | Infi-Knight/data_science_from_scratch | a78317728f218d4259fab925112413ddddfc30ca | [
"MIT"
] | null | null | null | from dsfs.linear_algebra.vectors import sum_of_squares, dot
from collections import Counter
import math
import matplotlib.pyplot as plt
num_friends = [100, 49, 41, 40, 25, 21, 21, 19, 19, 18, 18, 16, 15, 15, 15, 15, 14, 14, 13, 13, 13, 13, 12, 12, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9... | 40.166667 | 719 | 0.600543 |
bd0ff62b257fa147518e8e037082629c867e80e6 | 4,684 | py | Python | word_embedder/embedders/keyed_vectors.py | Yoctol/word-embedder | 0b4a0afc4c5f9a2af596a3ada060a2360a51579e | [
"MIT"
] | 3 | 2019-04-29T21:59:49.000Z | 2020-04-01T15:34:21.000Z | word_embedder/embedders/keyed_vectors.py | Yoctol/word-embedder | 0b4a0afc4c5f9a2af596a3ada060a2360a51579e | [
"MIT"
] | 2 | 2018-09-17T05:48:52.000Z | 2018-09-19T04:26:46.000Z | word_embedder/embedders/keyed_vectors.py | Yoctol/word-embedder | 0b4a0afc4c5f9a2af596a3ada060a2360a51579e | [
"MIT"
] | 2 | 2019-06-03T02:19:00.000Z | 2020-09-23T15:29:15.000Z | import io
import warnings
from os.path import isfile, basename
import os
from typing import List
import numpy as np
from .base import Embedder
from .oov_error import OOVError
from .utils import download_data, extract_gz
def _load_text_file(path: str):
fin = io.open(
path, 'r',
encoding='utf-8',
... | 28.736196 | 93 | 0.554868 |
bd51b134a8f2523e200140f66f26e661b1632915 | 2,080 | py | Python | dotbak/controllers/base.py | datafolklabs/dotbak | c2d63a8f2c5d36d4e57a98f55602cd32a8f846ad | [
"BSD-3-Clause"
] | 2 | 2021-01-18T01:46:29.000Z | 2021-10-06T01:57:06.000Z | dotbak/controllers/base.py | datafolklabs/dotbak | c2d63a8f2c5d36d4e57a98f55602cd32a8f846ad | [
"BSD-3-Clause"
] | 2 | 2021-09-30T19:53:53.000Z | 2021-12-18T19:45:05.000Z | dotbak/controllers/base.py | datafolklabs/dotbak | c2d63a8f2c5d36d4e57a98f55602cd32a8f846ad | [
"BSD-3-Clause"
] | null | null | null |
import os
from datetime import datetime
from cement import Controller, ex
from cement.utils import fs
from cement.utils.version import get_version_banner
from ..core.version import get_version
from ..core import exc
VERSION_BANNER = """
Lazily Backup Files and Directories %s
%s
""" % (get_version(), get_version_banne... | 30.144928 | 69 | 0.546154 |
cc9f7c4abd96b899e296760c9132c78e77a3a2a3 | 1,358 | py | Python | 006 - Simple Netcat Replacement/attacker_server.py | Danziger/Pluralsight-Network-Penetration-Testing-Using-Python-and-Kali-Linux | 040acfb55470f97a3a1c6e6d392cd0cdfc84eff8 | [
"MIT"
] | 5 | 2017-11-12T12:53:28.000Z | 2020-11-02T06:16:45.000Z | 006 - Simple Netcat Replacement/attacker_server.py | cyborix/Pluralsight-Network-Penetration-Testing-Using-Python-and-Kali-Linux | 5bcbc41889c6bd65aaad312b9b429dc189b8d0d1 | [
"MIT"
] | null | null | null | 006 - Simple Netcat Replacement/attacker_server.py | cyborix/Pluralsight-Network-Penetration-Testing-Using-Python-and-Kali-Linux | 5bcbc41889c6bd65aaad312b9b429dc189b8d0d1 | [
"MIT"
] | 6 | 2016-06-20T00:27:31.000Z | 2019-02-14T14:28:45.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import socket
import argparse
import threading
clients = {}
def client_serve(client):
try:
print 'Enter a command to execute: '
command = sys.stdin.read()
client.send(command)
while True:
# Wait for data from ... | 22.633333 | 103 | 0.613402 |
f70e640ff57f2e199fac15fbee0fe2c1a0c1d44c | 2,362 | py | Python | src/api/infrastructure/utils/TypeChecker.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 14 | 2020-12-19T15:06:13.000Z | 2022-01-12T19:52:17.000Z | src/process/infrastructure/utils/TypeChecker.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 43 | 2021-01-06T22:05:22.000Z | 2022-03-10T10:30:30.000Z | src/api/infrastructure/utils/TypeChecker.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 4 | 2020-12-18T23:10:09.000Z | 2021-04-02T13:03:12.000Z | import inspect
import typing
from abc import ABC
import builtins
def get_builtins():
return list(filter(lambda x: not x.startswith('_'), dir(builtins)))
class ITypeChecker(ABC):
def is_class(self, obj):
if inspect.isclass(obj) and not self.is_primitive(obj):
return True
return Fals... | 31.493333 | 104 | 0.6105 |
547791321adae390e0e905b7d7ad1108b3118ad2 | 10,939 | py | Python | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_StartOrStopHostApd.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_StartOrStopHostApd.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_StartOrStopHostApd.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2020 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 50.643519 | 163 | 0.668617 |
0f56accaa660269e0141f7f93780696b44c86881 | 7,746 | py | Python | cli/tests/pcluster/config/test_section_raid.py | gkao123/aws-parallelcluster | e46b91d5a6d8d8ba39e43188e19fdb7525313473 | [
"Apache-2.0"
] | null | null | null | cli/tests/pcluster/config/test_section_raid.py | gkao123/aws-parallelcluster | e46b91d5a6d8d8ba39e43188e19fdb7525313473 | [
"Apache-2.0"
] | null | null | null | cli/tests/pcluster/config/test_section_raid.py | gkao123/aws-parallelcluster | e46b91d5a6d8d8ba39e43188e19fdb7525313473 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 46.383234 | 119 | 0.596179 |
c781fefb1bc780b142909aaa30ed9c1e25a3b26f | 89,039 | py | Python | synapse/handlers/presence.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 1 | 2022-01-14T05:37:16.000Z | 2022-01-14T05:37:16.000Z | synapse/handlers/presence.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | null | null | null | synapse/handlers/presence.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2016 OpenMarket Ltd
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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
#
# U... | 39.241516 | 120 | 0.630263 |
f81aeeec280f77bc24902490501e04982a13ac5c | 4,474 | py | Python | calico/felix/masq.py | robbrockbank/felix | 3429099d677bec0caa3dd9b8d69d1553304741ca | [
"Apache-2.0"
] | null | null | null | calico/felix/masq.py | robbrockbank/felix | 3429099d677bec0caa3dd9b8d69d1553304741ca | [
"Apache-2.0"
] | null | null | null | calico/felix/masq.py | robbrockbank/felix | 3429099d677bec0caa3dd9b8d69d1553304741ca | [
"Apache-2.0"
] | 1 | 2016-12-02T12:08:32.000Z | 2016-12-02T12:08:32.000Z | # Copyright (c) Metaswitch Networks 2015. All rights reserved.
import logging
from calico.felix.actor import Actor, actor_message
from calico.felix.futils import IPV4, IPV6
from calico.felix.ipsets import Ipset, FELIX_PFX
_log = logging.getLogger(__name__)
ALL_POOLS_SET_NAME = FELIX_PFX + "all-ipam-pools"
MASQ_POOL... | 45.653061 | 78 | 0.55342 |
70051a80a6fe715d06d72097c84ac89cd03e85c7 | 6,384 | py | Python | tests/lib/bes/env/test_env_dir.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | tests/lib/bes/env/test_env_dir.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | tests/lib/bes/env/test_env_dir.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import copy, os, os.path as path
from bes.testing.unit_test import unit_test
from bes.system.os_env import os_env
from bes.system.env_override import env_override
from bes.fs.file_util import file_util
from... | 33.957447 | 90 | 0.597901 |
e3efff21bbc524059fb54383569b88071d6cca1f | 85 | py | Python | foo_package/private_module.py | peter-stoyanov/Python | 52ddb70537c05caa0d87740493b7b1f974191984 | [
"MIT"
] | null | null | null | foo_package/private_module.py | peter-stoyanov/Python | 52ddb70537c05caa0d87740493b7b1f974191984 | [
"MIT"
] | null | null | null | foo_package/private_module.py | peter-stoyanov/Python | 52ddb70537c05caa0d87740493b7b1f974191984 | [
"MIT"
] | null | null | null | """Doc"""
def privateDoSmth():
"""Doc"""
if __name__ == '__main__':
main()
| 10.625 | 26 | 0.517647 |
8234be1c19c6ebcd79e07a92d9101d86f3ebc14c | 415 | py | Python | orm/migrations/0004_auto_20180903_0140.py | chateval/chatevalv2 | 7ba96d81842db00427a6d6351d5cea76a8766450 | [
"Apache-2.0"
] | 5 | 2018-06-11T19:47:23.000Z | 2020-03-04T01:29:15.000Z | orm/migrations/0004_auto_20180903_0140.py | chateval/app | 7ba96d81842db00427a6d6351d5cea76a8766450 | [
"Apache-2.0"
] | 12 | 2018-07-11T18:50:13.000Z | 2022-02-10T10:45:58.000Z | orm/migrations/0004_auto_20180903_0140.py | chateval/app | 7ba96d81842db00427a6d6351d5cea76a8766450 | [
"Apache-2.0"
] | 1 | 2018-06-29T14:52:16.000Z | 2018-06-29T14:52:16.000Z | # Generated by Django 2.0.7 on 2018-09-03 01:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0003_auto_20180903_0136'),
]
operations = [
migrations.AlterField(
model_name='evaluationdataset',
name='base... | 21.842105 | 69 | 0.612048 |
845945d70de95927130daf2672c055b3430ed8b2 | 553,648 | py | Python | badass.py | remingtonsexton/BADASS | 905e03c57ece61f11db81544bb7b9167f831c08c | [
"MIT"
] | null | null | null | badass.py | remingtonsexton/BADASS | 905e03c57ece61f11db81544bb7b9167f831c08c | [
"MIT"
] | null | null | null | badass.py | remingtonsexton/BADASS | 905e03c57ece61f11db81544bb7b9167f831c08c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Bayesian AGN Decomposition Analysis for SDSS Spectra (BADASS3)
BADASS is an open-source spectral analysis tool designed for detailed decomposition
of Sloan Digital Sky Survey (SDSS) spectra, and specifically designed for the
fitting of Type 1 ("broad line") Active Galactic Nuclei (AGN) in th... | 52.703284 | 422 | 0.555167 |
17242f4e9686c30f4fa1ca40ff3bf0ed67f7aaa3 | 409 | py | Python | django/notes/usr/urls.py | AgbaD/apis | e88ecd11820651c8fa5d670ed21ca55ebd8877c2 | [
"MIT"
] | null | null | null | django/notes/usr/urls.py | AgbaD/apis | e88ecd11820651c8fa5d670ed21ca55ebd8877c2 | [
"MIT"
] | null | null | null | django/notes/usr/urls.py | AgbaD/apis | e88ecd11820651c8fa5d670ed21ca55ebd8877c2 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('dash/', views.dash, name='dash'),
path('personal_notes/', views.get_private_notes, name='get_private_notes'),
path('create_note/', views.create_note, name='create_note'),
path('delete_note/<str:public_id>/', views.delete_note, name=... | 37.181818 | 80 | 0.706601 |
cad19e5fa77ba7ef46bd852d8a0971021c7824de | 4,123 | py | Python | exercise_03/exercise_code/tests/image_folder_dataset_tests.py | stanley-chang/I2DL | 78740460e1f52ce7643358fc548281f1bbe73a42 | [
"RSA-MD"
] | 1 | 2021-03-14T20:39:06.000Z | 2021-03-14T20:39:06.000Z | exercise2/exercise_04/exercise_code/tests/image_folder_dataset_tests.py | UtkarshTrehan-icloud/I2DL-TUM | 7624ce84eebfd125f7c08bcb0b87cf25ba2e984c | [
"MIT"
] | null | null | null | exercise2/exercise_04/exercise_code/tests/image_folder_dataset_tests.py | UtkarshTrehan-icloud/I2DL-TUM | 7624ce84eebfd125f7c08bcb0b87cf25ba2e984c | [
"MIT"
] | null | null | null | """Tests for ImageFolderDataset in data/image_folder_dataset.py"""
import random
from .base_tests import UnitTest, MethodTest, ClassTest, test_results_to_score
from .len_tests import LenTest
class MakeDatasetTestImageType(UnitTest):
"""Test whether make_dataset() loads paths only and not actual images"""
de... | 31.715385 | 78 | 0.639825 |
344e6a5a48c0fd5dbe673b747ae8946b9353a6f0 | 1,442 | py | Python | tests/test_1_sub.py | timsears/imagezmq | 258453be9d86d213b31d83dcbcfcc68f26198328 | [
"MIT"
] | null | null | null | tests/test_1_sub.py | timsears/imagezmq | 258453be9d86d213b31d83dcbcfcc68f26198328 | [
"MIT"
] | null | null | null | tests/test_1_sub.py | timsears/imagezmq | 258453be9d86d213b31d83dcbcfcc68f26198328 | [
"MIT"
] | null | null | null | """test_1_sub.py -- basic receive images test in PUB/SUB mode.
A simple test program that uses imagezmq to receive images from a program that
is sending images. This test pair uses the PUB/SUB messaging pattern.
1. Run this program in its own terminal window:
python test_1_sub.py
There is no particular order in whic... | 36.05 | 79 | 0.776699 |
decc9935e8e0db90ac5c20492c331e59de8e29c4 | 401 | py | Python | venv/Scripts/pip3.6-script.py | olderlong/DataTransport | 583b6693e209258051b69029ba6e622daecdaf72 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3.6-script.py | olderlong/DataTransport | 583b6693e209258051b69029ba6e622daecdaf72 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3.6-script.py | olderlong/DataTransport | 583b6693e209258051b69029ba6e622daecdaf72 | [
"Apache-2.0"
] | null | null | null | #!E:\py_works\DataTransport\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.3','console_scripts','pip3.6'
__requires__ = 'pip==9.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.e... | 30.846154 | 69 | 0.660848 |
44e44f9e6fc124391554c71d01e0e60376494db2 | 2,269 | py | Python | backend/smartguard/recognize_faces.py | edibusl/smart_guard | f2f86310ebc745bc81060a43a3e4eeecf1a7f158 | [
"MIT"
] | null | null | null | backend/smartguard/recognize_faces.py | edibusl/smart_guard | f2f86310ebc745bc81060a43a3e4eeecf1a7f158 | [
"MIT"
] | null | null | null | backend/smartguard/recognize_faces.py | edibusl/smart_guard | f2f86310ebc745bc81060a43a3e4eeecf1a7f158 | [
"MIT"
] | null | null | null | try:
import unzip_requirements
except ImportError:
pass
import pickle
import numpy as np
import sklearn
def handler(event, context):
# load the actual face recognition model along with the label encoder
recognizer = pickle.loads(open(args["recognizer"], "rb").read())
le = pickle.loads(open(args["le"... | 33.367647 | 107 | 0.57338 |
1a8123c1be82576969e163a0a2f3a97eaab26437 | 85,633 | py | Python | pymatgen/core/surface.py | JRSuckert/pymatgen | f3f54792219035604f39e8ecbc544a410f4b7c97 | [
"MIT"
] | 2 | 2019-03-14T17:58:33.000Z | 2021-01-26T13:17:59.000Z | pymatgen/core/surface.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | null | null | null | pymatgen/core/surface.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | 1 | 2015-10-12T20:03:27.000Z | 2015-10-12T20:03:27.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from functools import reduce
from math import gcd
import math
import itertools
import logging
import warnings
import copy
import os
import json
import numpy as np
from scipy.spatial.distance import squareform
... | 45.093734 | 112 | 0.599313 |
1b54d8d24a9c5c39de4c9cd54795773506b7f991 | 19,368 | py | Python | src/pyasn1/type/base.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 184 | 2017-12-20T21:50:06.000Z | 2022-03-19T13:24:58.000Z | src/pyasn1/type/base.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 15 | 2018-01-17T17:30:51.000Z | 2021-12-16T14:25:09.000Z | src/pyasn1/type/base.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 136 | 2018-01-09T22:52:06.000Z | 2022-02-24T13:26:18.000Z | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import sys
from pyasn1.type import constraint, tagmap, tag
from pyasn1.compat import calling
from pyasn1 import error
__all__ = ['Asn1Item', 'Asn1ItemBase', 'AbstractSi... | 32.172757 | 120 | 0.618494 |
99acdf9d1b7fc59ebee5a0b6486841c29760478d | 3,733 | py | Python | hog-svm-detection/train.py | duytq99/trafficsigns-detection-hog-svm | fb0f67b78839f166557cc1c2d81aa4d6ef30394b | [
"MIT"
] | null | null | null | hog-svm-detection/train.py | duytq99/trafficsigns-detection-hog-svm | fb0f67b78839f166557cc1c2d81aa4d6ef30394b | [
"MIT"
] | null | null | null | hog-svm-detection/train.py | duytq99/trafficsigns-detection-hog-svm | fb0f67b78839f166557cc1c2d81aa4d6ef30394b | [
"MIT"
] | null | null | null | import os, sys, shutil
import numpy as np
import cv2
from skimage.feature import hog
from sklearn import metrics
from sklearn.linear_model import SGDClassifier
from sklearn.calibration import CalibratedClassifierCV
from imutils import paths
import argparse
import time
import pickle
import random
from tqdm import tqdm
... | 39.712766 | 277 | 0.750871 |
ccbb070dba6e7b395b818e34afb4450f9e967987 | 571 | py | Python | beautifulsoup4_test/jsonpath_lagou.py | fuandenghuo/100-days-of-python | 50f3263b0984bb6690e565d58604c1882aaf465e | [
"MIT"
] | null | null | null | beautifulsoup4_test/jsonpath_lagou.py | fuandenghuo/100-days-of-python | 50f3263b0984bb6690e565d58604c1882aaf465e | [
"MIT"
] | null | null | null | beautifulsoup4_test/jsonpath_lagou.py | fuandenghuo/100-days-of-python | 50f3263b0984bb6690e565d58604c1882aaf465e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'abbot'
from urllib import request
import json
import jsonpath
import ssl
url = 'http://www.lagou.com/lbs/getAllCitySearchLabels.json'
context = ssl._create_unverified_context()
req = request.Request(url)
response = request.urlopen(req,context=context)
html = response.read()
pr... | 16.794118 | 60 | 0.739054 |
c57a71d2bcfde5e1b4a48dc239b082ed9c347d24 | 4,756 | py | Python | flexfolio/cli.py | grananqvist/flexfolio | 4c69332cc7511a455dbddb006b7c9b9c8bd0a8ff | [
"Apache-2.0"
] | 5 | 2019-09-08T19:30:21.000Z | 2020-05-07T07:27:13.000Z | flexfolio/cli.py | grananqvist/flexfolio | 4c69332cc7511a455dbddb006b7c9b9c8bd0a8ff | [
"Apache-2.0"
] | 1 | 2021-06-01T23:37:22.000Z | 2021-06-01T23:37:22.000Z | flexfolio/cli.py | grananqvist/flexfolio | 4c69332cc7511a455dbddb006b7c9b9c8bd0a8ff | [
"Apache-2.0"
] | 2 | 2020-01-05T17:57:39.000Z | 2020-05-23T01:28:11.000Z | # -*- coding: utf-8 -*-
"""Console script for flexfolio."""
import sys
import logging
import os.path
from typing import Tuple, Optional, cast
from xml.etree import ElementTree
import click
import polling
import requests
from flexfolio.flex_statement import FlexStatement, ALL_MODELS
FLEX_SERVICE_BASE_URL = \
'h... | 28.479042 | 78 | 0.622792 |
16efc76c4197bde7bfdeb31f4500145cd6c0064d | 136 | py | Python | testapp/models.py | ppiyakk2/django-markdownx | bb2dfe2528fcedca880a8a78c96ec57c10f8290b | [
"BSD-2-Clause-FreeBSD"
] | 628 | 2017-04-23T19:09:49.000Z | 2022-03-30T19:59:44.000Z | testapp/models.py | ppiyakk2/django-markdownx | bb2dfe2528fcedca880a8a78c96ec57c10f8290b | [
"BSD-2-Clause-FreeBSD"
] | 142 | 2017-04-23T20:23:08.000Z | 2022-03-09T15:42:16.000Z | testapp/models.py | ppiyakk2/django-markdownx | bb2dfe2528fcedca880a8a78c96ec57c10f8290b | [
"BSD-2-Clause-FreeBSD"
] | 142 | 2017-04-24T13:55:26.000Z | 2022-03-11T14:45:57.000Z | from django.db import models
from markdownx.models import MarkdownxField
class MyModel(models.Model):
myfield = MarkdownxField()
| 17 | 43 | 0.786765 |
87ba318146d8c0099addf7608c68cccccae5ec0d | 474 | py | Python | lambda/notifier/main.py | igorgorbenko/aviasales_kinesis | 46c099e0f8a96e85244954a6dca1aab81405b91f | [
"MIT"
] | 1 | 2020-05-12T08:34:57.000Z | 2020-05-12T08:34:57.000Z | lambda/notifier/main.py | igorgorbenko/aviasales_kinesis | 46c099e0f8a96e85244954a6dca1aab81405b91f | [
"MIT"
] | null | null | null | lambda/notifier/main.py | igorgorbenko/aviasales_kinesis | 46c099e0f8a96e85244954a6dca1aab81405b91f | [
"MIT"
] | null | null | null | import boto3
import base64
import os
SNS_CLIENT = boto3.client('sns')
TOPIC_ARN = os.environ['TOPIC_ARN']
def lambda_handler(event, context):
try:
SNS_CLIENT.publish(TopicArn=TOPIC_ARN,
Message='Hi! I have found an interesting stuff!',
Subject='Airlin... | 27.882353 | 76 | 0.637131 |
80bfa6410fc376c9d06370bdef4e1b0da179a305 | 4,015 | py | Python | server/external/youtube-dl/youtube_dl/extractor/abcotvs.py | yycc179/urlp | d272b74c4aed18f03ccada8817ecf5c572a1bf71 | [
"MIT"
] | null | null | null | server/external/youtube-dl/youtube_dl/extractor/abcotvs.py | yycc179/urlp | d272b74c4aed18f03ccada8817ecf5c572a1bf71 | [
"MIT"
] | null | null | null | server/external/youtube-dl/youtube_dl/extractor/abcotvs.py | yycc179/urlp | d272b74c4aed18f03ccada8817ecf5c572a1bf71 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class ABCOTVSIE(InfoExtractor):
IE_NAME = 'abcotvs'
IE_DESC = 'ABC Owned Television Stations'
_VALID_URL = r'https?://(?:abc(?:7(... | 35.530973 | 130 | 0.534247 |
0c7f6095ec7e830cc7fb0a0eaadedcc556ce15c2 | 27,149 | py | Python | custom_components/lennoxs30/__init__.py | HyperActiveJ/lennoxs30 | 28efd9a447ec82dd84d61d9c631e183a4168cdce | [
"MIT"
] | null | null | null | custom_components/lennoxs30/__init__.py | HyperActiveJ/lennoxs30 | 28efd9a447ec82dd84d61d9c631e183a4168cdce | [
"MIT"
] | null | null | null | custom_components/lennoxs30/__init__.py | HyperActiveJ/lennoxs30 | 28efd9a447ec82dd84d61d9c631e183a4168cdce | [
"MIT"
] | null | null | null | """Support for Lennoxs30 cloud api"""
import asyncio
from asyncio.locks import Event, Lock
import logging
from lennoxs30api.s30exception import EC_COMMS_ERROR, EC_CONFIG_TIMEOUT
from lennoxs30api import (
EC_HTTP_ERR,
EC_LOGIN,
EC_SUBSCRIBE,
EC_UNAUTHORIZED,
S30Exception,
s30api_async,
)
impor... | 39.232659 | 270 | 0.617223 |
f5a4accaa2e438696ca90a817c010ee81b29e7fa | 1,750 | py | Python | main.py | osilkin98/HappyMail | 6bc34cd2b35d58757973a267bf01077332770b6d | [
"MIT"
] | 1 | 2018-09-20T01:06:11.000Z | 2018-09-20T01:06:11.000Z | main.py | osilkin98/HappyMail | 6bc34cd2b35d58757973a267bf01077332770b6d | [
"MIT"
] | null | null | null | main.py | osilkin98/HappyMail | 6bc34cd2b35d58757973a267bf01077332770b6d | [
"MIT"
] | null | null | null | from src.classifier import EmailClassifier
from src.email_filter import classify_messages, get_email_list
from src.scraper import get_gmail_service
import src.configuration_files.keys as keys
from colorama import Fore
from time import sleep
def run_main_function(sleep_time=60, max_emails=200):
""" This function c... | 38.043478 | 115 | 0.651429 |
06d7bde752486fa316fbabd883cf065b4b6ca286 | 1,589 | py | Python | examples/sock/barplot.py | iliar-rabet/SDMob | 14516dece72d57ccf0fcb9c6af17a0bfeeab635f | [
"BSD-3-Clause"
] | 1 | 2021-01-21T05:43:32.000Z | 2021-01-21T05:43:32.000Z | examples/sock/barplot.py | iliar-rabet/dao-projection | e24a00ba29ce92f37bfbcb2595713f2764cd8e9d | [
"BSD-3-Clause"
] | null | null | null | examples/sock/barplot.py | iliar-rabet/dao-projection | e24a00ba29ce92f37bfbcb2595713f2764cd8e9d | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# set width of bar
barWidth = 0.025
#fig = plt.subplots(figsize =(12, 8))
# set height of bar
particle_line = [0.566147244933,0.566147244933]
particle_cir = [0.63188589771,0.972161651262]
ukf_line = [0.724651076994, 0.89]
ukf_cir = [0.824651076994, 1.9732604154... | 26.04918 | 85 | 0.676526 |
3d54e218d8c4df42e79e29235ec26da13c0002cd | 11,025 | py | Python | lnbits/core/services.py | pseudozach/lnbits-legend | b90eb0a3ba403d60cc151af12ffabb74fd529db0 | [
"MIT"
] | 76 | 2021-11-02T22:19:59.000Z | 2022-03-30T18:01:33.000Z | lnbits/core/services.py | pseudozach/lnbits-legend | b90eb0a3ba403d60cc151af12ffabb74fd529db0 | [
"MIT"
] | 100 | 2021-11-04T16:33:28.000Z | 2022-03-30T15:03:52.000Z | lnbits/core/services.py | pseudozach/lnbits-legend | b90eb0a3ba403d60cc151af12ffabb74fd529db0 | [
"MIT"
] | 57 | 2021-11-08T06:43:59.000Z | 2022-03-31T08:53:16.000Z | import asyncio
import json
from binascii import unhexlify
from io import BytesIO
from typing import Dict, Optional, Tuple
from urllib.parse import parse_qs, urlparse
import httpx
from lnurl import LnurlErrorResponse
from lnurl import decode as decode_lnurl # type: ignore
from lnbits import bolt11
from lnbits.db impo... | 32.331378 | 155 | 0.613515 |
8c6ffad3da94808f92de7f58938db9565c717324 | 5,457 | py | Python | src/communities/migrations/0004_auto__add_field_community_is_public.py | ofirr/OpenCommunity | 7786ac2996530af8f545f4398c071793c73634c8 | [
"BSD-3-Clause"
] | 1 | 2015-05-12T17:59:35.000Z | 2015-05-12T17:59:35.000Z | src/communities/migrations/0004_auto__add_field_community_is_public.py | Niros/OpenCommunity | 4c91136db6243a1cd65b55ecf5a44c2bce24a45a | [
"BSD-3-Clause"
] | null | null | null | src/communities/migrations/0004_auto__add_field_community_is_public.py | Niros/OpenCommunity | 4c91136db6243a1cd65b55ecf5a44c2bce24a45a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Community.is_public'
db.add_column(u'communities_community', 'is_public',
... | 70.87013 | 197 | 0.584754 |
8839b9355ce7b19065b9bdf6689c2480ccee112b | 5,143 | py | Python | legacy/examples/graphsage/reader.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 1,389 | 2019-06-11T03:29:20.000Z | 2022-03-29T18:25:43.000Z | legacy/examples/graphsage/reader.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 232 | 2019-06-21T06:52:10.000Z | 2022-03-29T08:20:31.000Z | legacy/examples/graphsage/reader.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 229 | 2019-06-20T12:13:58.000Z | 2022-03-25T12:04:48.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 32.550633 | 78 | 0.564845 |
ba061a263a4b34fc6395f02806c77c4b9504f927 | 1,257 | py | Python | SROMPy/target/__init__.py | omunroe-com/nasasrompy | 35ae060b6a032d085a31574fbe3bf390b023631d | [
"Apache-2.0"
] | null | null | null | SROMPy/target/__init__.py | omunroe-com/nasasrompy | 35ae060b6a032d085a31574fbe3bf390b023631d | [
"Apache-2.0"
] | null | null | null | SROMPy/target/__init__.py | omunroe-com/nasasrompy | 35ae060b6a032d085a31574fbe3bf390b023631d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 United States Government as represented by the Administrator of
# the National Aeronautics and Space Administration. No copyright is claimed in
# the United States under Title 17, U.S. Code. All Other Rights Reserved.
# The Stochastic Reduced Order Models with Python (SROMPy) platform is licensed
# un... | 44.892857 | 80 | 0.824185 |
0b71c177ad6160aec2ce234b9b5ce20650ba7d3b | 5,566 | py | Python | airflow/www/app.py | maxcountryman/incubator-airflow | 59e35981905c2c1947782d7a0ec508fd9a329fbe | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/www/app.py | maxcountryman/incubator-airflow | 59e35981905c2c1947782d7a0ec508fd9a329fbe | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/www/app.py | maxcountryman/incubator-airflow | 59e35981905c2c1947782d7a0ec508fd9a329fbe | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 33.733333 | 92 | 0.630075 |
ed1575d3ea4c589e9f88f13a54e9cba41725f6dd | 1,068 | py | Python | idunn/places/latlon.py | QwantResearch/idunn | 88b6862f1036187855b5541bbb6758ddd4df33c1 | [
"Apache-2.0"
] | 26 | 2018-11-30T09:17:17.000Z | 2020-11-07T01:53:07.000Z | idunn/places/latlon.py | QwantResearch/idunn | 88b6862f1036187855b5541bbb6758ddd4df33c1 | [
"Apache-2.0"
] | 38 | 2018-06-08T09:41:04.000Z | 2020-12-07T17:39:12.000Z | idunn/places/latlon.py | Qwant/idunn | 65582dfed732093778bf7c2998db1e2cd78255b8 | [
"Apache-2.0"
] | 9 | 2018-05-18T13:07:00.000Z | 2020-08-01T16:42:40.000Z | from .address import Address
from .base import BasePlace
from .exceptions import InvalidPlaceId
class Latlon(BasePlace):
PLACE_TYPE = "latlon"
PLACE_ID_NAMESPACE = "latlon"
def __init__(self, lat, lon, closest_address=None):
self.lat = round(float(lat), 5)
self.lon = round(float(lon), 5)
... | 28.864865 | 73 | 0.636704 |
fd66fc8c80495c9c32d43febf25a087c071fcd40 | 2,040 | py | Python | setup.py | aleph-im/py-libp2p | 3dfb5c49abf37fd95db12ae5766757332be70d08 | [
"Apache-2.0",
"MIT"
] | null | null | null | setup.py | aleph-im/py-libp2p | 3dfb5c49abf37fd95db12ae5766757332be70d08 | [
"Apache-2.0",
"MIT"
] | null | null | null | setup.py | aleph-im/py-libp2p | 3dfb5c49abf37fd95db12ae5766757332be70d08 | [
"Apache-2.0",
"MIT"
] | 2 | 2020-10-13T07:43:55.000Z | 2020-10-27T08:51:53.000Z | import setuptools
py_classifiers = [f"Programming Language :: Python :: {version}" for version in ["3.7"]]
extras_require = {
"test": [
"factory-boy>=2.12.0,<3.0.0",
"pytest>=4.6.3,<5.0.0",
"pytest-asyncio>=0.10.0,<1.0.0",
"pytest-xdist>=1.30.0",
],
"lint": [
"mypy... | 26.493506 | 88 | 0.556373 |
132572c88cf26b5d0d2fa3efc33aa290b3140755 | 137,527 | py | Python | youtube_dl/extractor/youtube.py | inshadsajeev143/utube | f3914b06a0eb0f90b0a2326468e792f107968884 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/youtube.py | inshadsajeev143/utube | f3914b06a0eb0f90b0a2326468e792f107968884 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/youtube.py | inshadsajeev143/utube | f3914b06a0eb0f90b0a2326468e792f107968884 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import os.path
import random
import re
import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from ..jsinterp import JSInterpreter
from ..swfinterp import SWFInterpreter
from ..compat import (
compa... | 45.418428 | 348 | 0.523723 |
a9d07202caf3a081a27c0d5c2f56c1d4203f143c | 12,291 | py | Python | utils/tools.py | ttslr/Expressive-FastSpeech2 | 7f1c463d0f10053596de62e5c112ee952f58d924 | [
"MIT"
] | 79 | 2021-05-17T10:19:40.000Z | 2022-03-27T09:01:58.000Z | utils/tools.py | KunZhou9646/Expressive-FastSpeech2 | 7f1c463d0f10053596de62e5c112ee952f58d924 | [
"MIT"
] | 13 | 2021-05-16T23:07:29.000Z | 2022-03-20T23:45:04.000Z | utils/tools.py | KunZhou9646/Expressive-FastSpeech2 | 7f1c463d0f10053596de62e5c112ee952f58d924 | [
"MIT"
] | 22 | 2021-05-16T09:35:50.000Z | 2022-03-04T09:52:58.000Z | import os
import json
import torch
import torch.nn.functional as F
import numpy as np
import matplotlib
from scipy.io import wavfile
from matplotlib import pyplot as plt
matplotlib.use("Agg")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def to_device(data, device):
if len(data) == 12... | 32.430079 | 128 | 0.582947 |
6833e78420e6d3ddde6a3665d232a5e31f7615e6 | 6,524 | py | Python | modeling/backbones/senet_ibn_a.py | ZHUXUHAN/reid-baseline | 43e8734be52a90d8131af8c4b43536ba6911bdaa | [
"MIT"
] | 2 | 2019-11-30T08:11:22.000Z | 2019-12-11T14:35:01.000Z | modeling/backbones/senet_ibn_a.py | ZHUXUHAN/reid-baseline | 43e8734be52a90d8131af8c4b43536ba6911bdaa | [
"MIT"
] | 1 | 2020-01-09T03:48:26.000Z | 2020-03-07T01:22:37.000Z | modeling/backbones/senet_ibn_a.py | ZHUXUHAN/reid-baseline | 43e8734be52a90d8131af8c4b43536ba6911bdaa | [
"MIT"
] | 1 | 2019-11-30T09:24:17.000Z | 2019-11-30T09:24:17.000Z | from .se_module import SELayer
import torch.nn as nn
import torch
import math
__all__ = ['se_resnet50_ibn_a', 'se_resnet101_ibn_a', 'se_resnet152_ibn_a']
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)
class IBN(nn.Modul... | 31.066667 | 96 | 0.583691 |
fb7849dcd8a3bad4aa8f9e9d9c1b460d92e6ac7a | 95 | py | Python | Python/pierwszy.py | amundsenscott4/helloworld | f14e77c5a3a3bb2d3d88d730d658589f9a007330 | [
"MIT"
] | null | null | null | Python/pierwszy.py | amundsenscott4/helloworld | f14e77c5a3a3bb2d3d88d730d658589f9a007330 | [
"MIT"
] | null | null | null | Python/pierwszy.py | amundsenscott4/helloworld | f14e77c5a3a3bb2d3d88d730d658589f9a007330 | [
"MIT"
] | null | null | null | import random
print("Hello world")
for i in range(10):
print(round(random.random()*100))
| 13.571429 | 37 | 0.684211 |
ccd9b267a6514b826b2accc6a9c70e28110c5d11 | 7,316 | py | Python | sdk/python/pulumi_azure_native/network/v20200801/get_packet_capture.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200801/get_packet_capture.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200801/get_packet_capture.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 39.122995 | 225 | 0.675642 |
77b61ab9a3daebbd13f33095349945a7af868ca2 | 6,792 | py | Python | app/tests/api/test_auth.py | hollyfoxx/ace2-ams-api | 08ecf3f3dc8ac9abd224465731458950d4f78b7d | [
"Apache-2.0"
] | null | null | null | app/tests/api/test_auth.py | hollyfoxx/ace2-ams-api | 08ecf3f3dc8ac9abd224465731458950d4f78b7d | [
"Apache-2.0"
] | null | null | null | app/tests/api/test_auth.py | hollyfoxx/ace2-ams-api | 08ecf3f3dc8ac9abd224465731458950d4f78b7d | [
"Apache-2.0"
] | null | null | null | import pytest
import time
from datetime import datetime, timedelta
from fastapi import status, testclient
from jose import jwt
from core.config import get_settings, Settings
from tests.helpers import create_test_user
from main import app
#
# INVALID TESTS
#
@pytest.mark.parametrize(
"username,password",
[... | 35.375 | 117 | 0.684776 |
afb298e8268114b83aaa96c02238bc5f0ffa86e7 | 2,757 | py | Python | setup.py | derpferd/smart_open | 8f64d5b491b3f2f559059f8e16755e30ad2382fa | [
"MIT"
] | null | null | null | setup.py | derpferd/smart_open | 8f64d5b491b3f2f559059f8e16755e30ad2382fa | [
"MIT"
] | null | null | null | setup.py | derpferd/smart_open | 8f64d5b491b3f2f559059f8e16755e30ad2382fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import io
import os
import sys
from setuptools import setup, find_packages
def _get_version():
curr_dir = os.path.di... | 25.766355 | 91 | 0.636924 |
00ed16733bf43d576cddf829ce6f7e6529a2e296 | 4,230 | py | Python | mp/core/io.py | kerryeon/mp_python | 1aca4069bc635959fa4f3ce94507c55226219039 | [
"MIT"
] | 1 | 2021-04-08T01:59:11.000Z | 2021-04-08T01:59:11.000Z | mp/core/io.py | kerryeon/mp_python | 1aca4069bc635959fa4f3ce94507c55226219039 | [
"MIT"
] | null | null | null | mp/core/io.py | kerryeon/mp_python | 1aca4069bc635959fa4f3ce94507c55226219039 | [
"MIT"
] | null | null | null | import os
from mp.core.expression import Expression as Exp
from mp.core.framework import np
class IO:
def __init__(self, dir_main: str, permission: int = 0o775):
if len(dir_main) == 0:
dir_main = os.path.curdir
self.dir_main = dir_main
self.permission = permission
def ge... | 33.571429 | 79 | 0.576832 |
07578e6deca671fd66928ce73a3335fb19697f29 | 5,815 | py | Python | python/oneflow/compatible/single_client/test/ops/test_bce_loss.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/compatible/single_client/test/ops/test_bce_loss.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/compatible/single_client/test/ops/test_bce_loss.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 36.118012 | 88 | 0.672227 |
26d122a6a49b1c4dce691898b25ed907e2bb0259 | 900 | py | Python | src/dxtbx/format/FormatCBFMiniPilatusSPring8_6MSN125.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | 3 | 2019-08-16T05:46:29.000Z | 2020-09-18T08:38:37.000Z | src/dxtbx/format/FormatCBFMiniPilatusSPring8_6MSN125.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | 448 | 2019-04-06T01:20:56.000Z | 2022-03-31T15:58:48.000Z | src/dxtbx/format/FormatCBFMiniPilatusSPring8_6MSN125.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | 10 | 2019-04-08T13:30:32.000Z | 2021-09-30T14:48:50.000Z | from dxtbx.format.FormatCBFMiniPilatus import FormatCBFMiniPilatus
class FormatCBFMiniPilatusSPring8_6MSN125(FormatCBFMiniPilatus):
"""A class for reading mini CBF format Pilatus images for 6M SN 125, normally
at Spring8 BL41XU"""
@staticmethod
def understand(image_file):
"""Check to see if t... | 31.034483 | 84 | 0.641111 |
ed1dec2d46ebc4640a424e6cab39c5da0b92720a | 3,502 | py | Python | onnx2keras/normalization_layers.py | ag169/onnx2keras | 0c817fb7bd776f38bab0fcca00b1af26753bf02f | [
"MIT"
] | 2 | 2021-04-24T00:57:53.000Z | 2021-11-17T11:27:15.000Z | onnx2keras/normalization_layers.py | ag169/onnx2keras | 0c817fb7bd776f38bab0fcca00b1af26753bf02f | [
"MIT"
] | null | null | null | onnx2keras/normalization_layers.py | ag169/onnx2keras | 0c817fb7bd776f38bab0fcca00b1af26753bf02f | [
"MIT"
] | null | null | null | import keras.layers
import logging
from .utils import ensure_tf_type, ensure_numpy_type
def convert_batchnorm(node, params, layers, node_name):
"""
Convert BatchNorm2d layer
:param node: current operation node
:param params: operation attributes
:param layers: available keras layers
:param nod... | 32.728972 | 112 | 0.655625 |
a43ce84b8f270025748ed891e957a0cbf5e41c0a | 6,888 | py | Python | python/goals-api-sfdc/src/asana_goals/__main__.py | Asana/DevRel-Examples | 6ac7bcedd3843cfa7ac00bb7df28b886b61e3a6c | [
"MIT"
] | 2 | 2018-07-06T20:34:29.000Z | 2018-07-13T04:05:18.000Z | python/goals-api-sfdc/src/asana_goals/__main__.py | Asana/DevRel-Examples | 6ac7bcedd3843cfa7ac00bb7df28b886b61e3a6c | [
"MIT"
] | 2 | 2018-07-30T23:32:42.000Z | 2018-08-01T05:59:29.000Z | python/goals-api-sfdc/src/asana_goals/__main__.py | Asana/DevRel-Examples | 6ac7bcedd3843cfa7ac00bb7df28b886b61e3a6c | [
"MIT"
] | 1 | 2018-07-03T03:30:25.000Z | 2018-07-03T03:30:25.000Z | import logging
import logging.config
from time import time, sleep
from argparse import ArgumentParser
from decimal import Decimal
from typing import Optional, Union, Dict
import toml
from croniter import croniter
from asana_goals.asana import Asana
from asana_goals.asana.goal import Goal
from asana_goals.data_source.... | 31.027027 | 95 | 0.594367 |
8712dee1aa80a32d2ac6e789d04576d4e0af2ec7 | 1,519 | py | Python | venv/Lib/site-packages/numpy/core/tests/test_cpu_dispatcher.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | venv/Lib/site-packages/numpy/core/tests/test_cpu_dispatcher.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | venv/Lib/site-packages/numpy/core/tests/test_cpu_dispatcher.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | from numpy.core._multiarray_umath import __cpu_features__, __cpu_baseline__, __cpu_dispatch__
from numpy.core import _umath_tests
from numpy.testing import assert_equal
def test_dispatcher():
"""
Testing the utilites of the CPU dispatcher
"""
targets = (
"SSE2", "SSE41", "AVX2",
"VSX", ... | 35.325581 | 97 | 0.646478 |
c267783d2d44e7b9998cb4e8cd27fbdc9de9d6e5 | 13,158 | py | Python | fanficfare/mobi.py | AlexRiina/FanFicFare | 2cd6f53f766e74052c6ca7ab5c2eabff24f59742 | [
"Apache-2.0"
] | 3 | 2020-11-10T16:43:43.000Z | 2021-04-09T07:12:31.000Z | fanficfare/mobi.py | AlexRiina/FanFicFare | 2cd6f53f766e74052c6ca7ab5c2eabff24f59742 | [
"Apache-2.0"
] | 5 | 2021-11-18T00:20:38.000Z | 2021-11-18T00:21:40.000Z | fanficfare/mobi.py | AlexRiina/FanFicFare | 2cd6f53f766e74052c6ca7ab5c2eabff24f59742 | [
"Apache-2.0"
] | 1 | 2021-04-08T12:25:09.000Z | 2021-04-08T12:25:09.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright(c) 2009 Andrew Chatham and Vijay Pandurangan
# Changes Copyright 2018 FanFicFare team
from __future__ import absolute_import
import struct
import time
import random
import logging
# py2 vs py3 transition
from .six import ensure_binary
from io import BytesIO
logg... | 32.25 | 136 | 0.611263 |
416e6ea9f412d86db877fc36175e8b910b0613fe | 4,262 | py | Python | python/paddle/fluid/tests/unittests/test_yolo_box_op.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 3 | 2019-07-17T09:30:31.000Z | 2021-12-27T03:16:55.000Z | python/paddle/fluid/tests/unittests/test_yolo_box_op.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 1 | 2019-05-26T14:23:24.000Z | 2019-05-26T14:23:51.000Z | python/paddle/fluid/tests/unittests/test_yolo_box_op.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 4 | 2019-09-30T02:15:34.000Z | 2019-09-30T02:41:30.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 36.118644 | 80 | 0.561708 |
fddb4a0361df86b718d4c75e7b6ec40f832e4132 | 15,781 | py | Python | anchore_engine/services/policy_engine/engine/vulnerabilities.py | Btodhunter/anchore-engine | 0f7ce6dea5f6c24c07616355affc64fdbfe1d6ef | [
"Apache-2.0"
] | null | null | null | anchore_engine/services/policy_engine/engine/vulnerabilities.py | Btodhunter/anchore-engine | 0f7ce6dea5f6c24c07616355affc64fdbfe1d6ef | [
"Apache-2.0"
] | null | null | null | anchore_engine/services/policy_engine/engine/vulnerabilities.py | Btodhunter/anchore-engine | 0f7ce6dea5f6c24c07616355affc64fdbfe1d6ef | [
"Apache-2.0"
] | null | null | null | """
Interface for the vulnerabilities subsystem.
This component of the engine is hydrated by data from feeds or a local source.
The evaluation and model side of the system are specific to the data, so this is a layer on top of the
general feeds implementation as it consumes the feed data. Other components should inte... | 43.836111 | 246 | 0.694379 |
b1432c59774d01c7b6c307fe92656a61571b8540 | 19,743 | py | Python | submodules/teachDeepRL/teachDRL/spinup/utils/run_utils.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | submodules/teachDeepRL/teachDRL/spinup/utils/run_utils.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | submodules/teachDeepRL/teachDRL/spinup/utils/run_utils.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | from teachDRL.spinup.user_config import DEFAULT_DATA_DIR, FORCE_DATESTAMP, \
DEFAULT_SHORTHAND, WAIT_BEFORE_LAUNCH
from teachDRL.spinup.utils.logx import colorize
from teachDRL.spinup.utils.mpi_tools import mpi_fork, msg
from teachDRL.spinup.utils.serialization_utils import convert_json
i... | 35.38172 | 90 | 0.591906 |
55061520fa145c1d78ea8a4de832e39c43a273fc | 1,956 | py | Python | src/tests/audition_tests/test_model_group_performance.py | josephbajor/triage_NN | cbaee6e5a06e597c91fec372717d89a2b5f34fa5 | [
"MIT"
] | 160 | 2017-06-13T09:59:59.000Z | 2022-03-21T22:00:35.000Z | src/tests/audition_tests/test_model_group_performance.py | josephbajor/triage_NN | cbaee6e5a06e597c91fec372717d89a2b5f34fa5 | [
"MIT"
] | 803 | 2016-10-21T19:44:02.000Z | 2022-03-29T00:02:33.000Z | src/tests/audition_tests/test_model_group_performance.py | josephbajor/triage_NN | cbaee6e5a06e597c91fec372717d89a2b5f34fa5 | [
"MIT"
] | 59 | 2017-01-31T22:10:22.000Z | 2022-03-19T12:35:03.000Z | from unittest.mock import patch
import numpy as np
import testing.postgresql
from sqlalchemy import create_engine
from triage.component.audition.model_group_performance import (
ModelGroupPerformancePlotter,
)
from .utils import create_sample_distance_table
def test_ModelGroupPerformancePlotter_generate_plot_d... | 36.90566 | 79 | 0.652863 |
58700c67e9ae604119edd594ee45b591c98cca0c | 850 | py | Python | esphomeyaml/components/switch/gpio.py | johnerikhalse/esphomeyaml | 490743c26e3226f95181d00ded522b3f41372cb4 | [
"MIT"
] | 1 | 2021-01-14T13:43:37.000Z | 2021-01-14T13:43:37.000Z | esphomeyaml/components/switch/gpio.py | lobradov/esphomeyaml | 27a77c685d30c1f113469d26d929d4ce9f1ed720 | [
"MIT"
] | null | null | null | esphomeyaml/components/switch/gpio.py | lobradov/esphomeyaml | 27a77c685d30c1f113469d26d929d4ce9f1ed720 | [
"MIT"
] | null | null | null | import voluptuous as vol
import esphomeyaml.config_validation as cv
from esphomeyaml import pins
from esphomeyaml.components import switch
from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_PIN
from esphomeyaml.helpers import App, Application, gpio_output_pin_expression, variable
MakeGPIOSwitch = Application... | 31.481481 | 86 | 0.794118 |
5aa87a7525d449eed0e505215ef36da477449b6b | 2,595 | py | Python | s3/replication/common/tests/system/s3_async_transfer_object.py | hessio/cortx-multisite | 544cdef1a4cf08e97ca0757fcd9a32fbbc7b1997 | [
"Apache-2.0"
] | 1 | 2022-01-13T12:26:30.000Z | 2022-01-13T12:26:30.000Z | s3/replication/common/tests/system/s3_async_transfer_object.py | hessio/cortx-multisite | 544cdef1a4cf08e97ca0757fcd9a32fbbc7b1997 | [
"Apache-2.0"
] | null | null | null | s3/replication/common/tests/system/s3_async_transfer_object.py | hessio/cortx-multisite | 544cdef1a4cf08e97ca0757fcd9a32fbbc7b1997 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
#
# 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
#... | 35.547945 | 88 | 0.7079 |
4e09886166af9089fff66a97ff1df96ee08e6a93 | 539 | py | Python | aslprep/pybids/__init__.py | krmurtha/aslprep | 5c00c2c9ad1daf93b056907596b7798ae8059efb | [
"BSD-3-Clause"
] | 2 | 2022-03-18T18:31:12.000Z | 2022-03-18T18:31:26.000Z | aslprep/pybids/__init__.py | krmurtha/aslprep | 5c00c2c9ad1daf93b056907596b7798ae8059efb | [
"BSD-3-Clause"
] | null | null | null | aslprep/pybids/__init__.py | krmurtha/aslprep | 5c00c2c9ad1daf93b056907596b7798ae8059efb | [
"BSD-3-Clause"
] | 1 | 2020-04-13T20:04:21.000Z | 2020-04-13T20:04:21.000Z | from .due import due, Doi
from .layout import BIDSLayout
# For backwards compatibility
from bids_validator import BIDSValidator
__all__ = [
"analysis",
"BIDSLayout",
"BIDSValidator",
"config",
"layout",
"reports",
"utils",
"variables"
]
due.cite(Doi("10.1038/sdata.2016.44"),
... | 17.966667 | 52 | 0.667904 |
ed2a36bce2a8202fda36f38cf1377e92e915378f | 13,071 | py | Python | skimage/draw/_random_shapes.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 1 | 2019-01-12T13:17:32.000Z | 2019-01-12T13:17:32.000Z | skimage/draw/_random_shapes.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | skimage/draw/_random_shapes.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 2 | 2020-03-12T23:20:22.000Z | 2021-02-15T21:54:02.000Z | import numpy as np
from . import polygon as draw_polygon, circle as draw_circle
from .._shared.utils import warn
def _generate_rectangle_mask(point, image, shape, random):
"""Generate a mask for a filled rectangle shape.
The height and width of the rectangle are generated randomly.
Parameters
-----... | 36.819718 | 86 | 0.620764 |
e103d4313ed170e05b2038c665a4e481787eb33e | 951 | py | Python | S1/TP6/ex1.py | HerbeMalveillante/ecole | bebbc73cd678c58c9cd40389ea1cf229a0200308 | [
"MIT"
] | null | null | null | S1/TP6/ex1.py | HerbeMalveillante/ecole | bebbc73cd678c58c9cd40389ea1cf229a0200308 | [
"MIT"
] | null | null | null | S1/TP6/ex1.py | HerbeMalveillante/ecole | bebbc73cd678c58c9cd40389ea1cf229a0200308 | [
"MIT"
] | null | null | null | from time import time
from random import randint
def comp():
for m in range(5, 25):
debut = time()
print(sum([n ** 2 for n in range(2 ** m)]))
print(m, ":", time() - debut)
# le code est de plus en plus long à s'éxecuter à mesure que
# m augmente.
def tri_bulle(liste_entree):
... | 23.775 | 64 | 0.542587 |
efefe625607ceaa7ad5f7cefe124bff7f588b9e0 | 2,022 | py | Python | repoxplorer/tests/test_yamlbackend.py | morucci2/repoxplorer | 640455bfa22cc344146644d4e0d72cb6c1e7ba48 | [
"Apache-2.0"
] | null | null | null | repoxplorer/tests/test_yamlbackend.py | morucci2/repoxplorer | 640455bfa22cc344146644d4e0d72cb6c1e7ba48 | [
"Apache-2.0"
] | null | null | null | repoxplorer/tests/test_yamlbackend.py | morucci2/repoxplorer | 640455bfa22cc344146644d4e0d72cb6c1e7ba48 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017, Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 27.324324 | 75 | 0.638971 |
66089e34ff0088d41585376c9776b24fb823a595 | 1,502 | gyp | Python | gyp/sfnt.gyp | coltorchen/android-skia | 91bb0c6f4224715ab78e3f64ba471a42d5d5a307 | [
"BSD-3-Clause"
] | 2 | 2017-05-19T08:53:12.000Z | 2017-08-28T11:59:26.000Z | gyp/sfnt.gyp | coltorchen/android-skia | 91bb0c6f4224715ab78e3f64ba471a42d5d5a307 | [
"BSD-3-Clause"
] | 2 | 2017-07-25T09:37:22.000Z | 2017-08-04T07:18:56.000Z | gyp/sfnt.gyp | coltorchen/android-skia | 91bb0c6f4224715ab78e3f64ba471a42d5d5a307 | [
"BSD-3-Clause"
] | 2 | 2017-08-09T09:03:23.000Z | 2020-05-26T09:14:49.000Z | {
'targets': [
{
'target_name': 'sfnt',
'product_name': 'skia_sfnt',
'type': 'static_library',
'standalone_static_library': 1,
'dependencies': [
'core.gyp:core',
],
'include_dirs': [
'../src/sfnt',
],
'sources': [
'../src/sfnt/SkIBMFami... | 27.309091 | 44 | 0.52996 |
01f8289c8f94e10ff000dbc3597f1e83c6dd8d73 | 11,551 | py | Python | Notebooks/0-TFRecords/preprocess/ee_data_preprocess.py | ikerey/Deep-Learning-with-TensorFlow2-Keras | 865b07b445e45122c62434fe853d422a95cfe07a | [
"MIT"
] | null | null | null | Notebooks/0-TFRecords/preprocess/ee_data_preprocess.py | ikerey/Deep-Learning-with-TensorFlow2-Keras | 865b07b445e45122c62434fe853d422a95cfe07a | [
"MIT"
] | null | null | null | Notebooks/0-TFRecords/preprocess/ee_data_preprocess.py | ikerey/Deep-Learning-with-TensorFlow2-Keras | 865b07b445e45122c62434fe853d422a95cfe07a | [
"MIT"
] | null | null | null | import ee
import time
import json
import folium
from shapely.geometry import shape
from . import ee_collection_specifics
from .utils import Polygons_to_MultiPolygon, GeoJSONs_to_FeatureCollections, get_geojson_string, check_status_data
class Preprocess(object):
"""
Training of Deep Learning models in Skydippe... | 40.672535 | 154 | 0.584019 |
4774851a3a74886cd627478ab92aeb93dde703ff | 277 | py | Python | factorial.py | phsantosjr/python-algorithms | 4683b66eb3b7e934ccb8f7bb263f3988a661c202 | [
"CNRI-Python"
] | null | null | null | factorial.py | phsantosjr/python-algorithms | 4683b66eb3b7e934ccb8f7bb263f3988a661c202 | [
"CNRI-Python"
] | null | null | null | factorial.py | phsantosjr/python-algorithms | 4683b66eb3b7e934ccb8f7bb263f3988a661c202 | [
"CNRI-Python"
] | null | null | null | from utils import timer_decorator
@timer_decorator
def fact_1(n: int) -> int:
product = 1
for i in range(n):
product = product * (i+1)
return product
@timer_decorator
def fact_2(n: int) -> int:
if n == 0:
return 1
return n * fact_2(n-1)
| 16.294118 | 33 | 0.602888 |
c2640e665c5a574cd9b095a2f8c64075ea820ad2 | 13,280 | py | Python | stubs.min/Autodesk/Revit/DB/__init___parts/FabricationConfiguration.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/Autodesk/Revit/DB/__init___parts/FabricationConfiguration.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/Autodesk/Revit/DB/__init___parts/FabricationConfiguration.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class FabricationConfiguration(Element,IDisposable):
""" This element contains the information about the fabrication configuration settings used by the project. """
def CanBeSwapped(self):
"""
CanBeSwapped(self: FabricationConfiguration) -> bool
Checks if the fabrication configuration can be swapped... | 35.603217 | 215 | 0.731175 |
0ffee91744eabf13ec286da0906dce52c6ee1f3e | 4,587 | py | Python | examples/reinforcement_learning/tutorial_atari_pong.py | KuKuXia/tensorlayer | 654de4a37892cde54495350f99f5f3b38b2c6eb3 | [
"Apache-2.0"
] | 1 | 2019-10-21T13:33:52.000Z | 2019-10-21T13:33:52.000Z | examples/reinforcement_learning/tutorial_atari_pong.py | Mesica/tensorlayer | c5def14c4d66d150863f975d9001a5e1891d003f | [
"Apache-2.0"
] | null | null | null | examples/reinforcement_learning/tutorial_atari_pong.py | Mesica/tensorlayer | c5def14c4d66d150863f975d9001a5e1891d003f | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""Monte-Carlo Policy Network π(a|s) (REINFORCE).
To understand Reinforcement Learning, we let computer to learn how to play
Pong game from the original screen inputs. Before we start, we highly recommend
you to go through a famous blog called “Deep Reinforcement Learning: P... | 29.785714 | 112 | 0.640942 |
0d4d664b6ba31fbcd5c4aece1c7d950093da6d87 | 2,180 | py | Python | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/DetachClassicLinkVpcRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/DetachClassicLinkVpcRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/DetachClassicLinkVpcRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.16129 | 79 | 0.769725 |
0ba67a75237432d9da5fcfef3a8e84f0d6873583 | 3,680 | py | Python | tests/test_template_filters.py | Frojd/wagtail-systemtext | 27579f7b261572a59e48993ae21a44f789f64b0f | [
"MIT"
] | 8 | 2016-12-31T12:00:56.000Z | 2022-03-23T08:12:04.000Z | tests/test_template_filters.py | Frojd/wagtail-systemtext | 27579f7b261572a59e48993ae21a44f789f64b0f | [
"MIT"
] | 8 | 2017-01-02T19:29:49.000Z | 2019-01-30T06:31:54.000Z | tests/test_template_filters.py | Frojd/wagtail-systemtext | 27579f7b261572a59e48993ae21a44f789f64b0f | [
"MIT"
] | 4 | 2016-12-20T11:44:39.000Z | 2020-08-12T09:10:01.000Z | from django.conf import global_settings
from django.template import Context, Template
from django.test import TestCase, modify_settings, override_settings
from wagtailsystemtext.utils import (
set_site, fill_cache, preload, _cleanup,
)
from tests.factories import SiteFactory, PageFactory, SystemStringFactory
@ov... | 27.878788 | 73 | 0.547283 |
d17366ae2f87e56dba79b44d7a7c481fafe3d55d | 609 | bzl | Python | source/bazel/deps/cpp_httplib/get.bzl | luxe/unilang | 6c8a431bf61755f4f0534c6299bd13aaeba4b69e | [
"MIT"
] | 33 | 2019-05-30T07:43:32.000Z | 2021-12-30T13:12:32.000Z | source/bazel/deps/cpp_httplib/get.bzl | luxe/unilang | 6c8a431bf61755f4f0534c6299bd13aaeba4b69e | [
"MIT"
] | 371 | 2019-05-16T15:23:50.000Z | 2021-09-04T15:45:27.000Z | source/bazel/deps/cpp_httplib/get.bzl | luxe/unilang | 6c8a431bf61755f4f0534c6299bd13aaeba4b69e | [
"MIT"
] | 6 | 2019-08-22T17:37:36.000Z | 2020-11-07T07:15:32.000Z | # Do not edit this file directly.
# It was auto-generated by: code/programs/reflexivity/reflexive_refresh
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def cppHttplib():
http_archive(
name="cpp_httplib" ,
build_file="//bazel/deps/cpp_httplib:build.BUILD" ,
sha256="1... | 35.823529 | 109 | 0.71757 |
57ab365f446fbe7edf7d6a69e72c24d384cdb703 | 1,981 | py | Python | testsuite/tests/ui/apiap/test_config_version_update_azp_values.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 5 | 2021-11-04T14:09:24.000Z | 2021-12-23T13:48:36.000Z | testsuite/tests/ui/apiap/test_config_version_update_azp_values.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 41 | 2021-11-03T14:27:21.000Z | 2022-03-29T14:46:16.000Z | testsuite/tests/ui/apiap/test_config_version_update_azp_values.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 12 | 2021-11-03T17:28:31.000Z | 2021-11-30T12:28:25.000Z | """
"https://issues.redhat.com/browse/THREESCALE-6468"
"""
import pytest
from testsuite.ui.views.admin.product.integration.configuration import ProductConfigurationView
from testsuite.ui.views.admin.product.integration.settings import ProductSettingsView
# pylint: disable=unused-argument
@pytest.mark.issue("https:/... | 42.148936 | 100 | 0.759717 |
3bcd6b7c8111cfd644ddfa6a792d4eaae4d1d916 | 2,807 | py | Python | rubber.py | flexarts/giprouter-qgis-plugin | 1008753b1183a59cb6f1f99f541c2e3f89438059 | [
"MIT"
] | null | null | null | rubber.py | flexarts/giprouter-qgis-plugin | 1008753b1183a59cb6f1f99f541c2e3f89438059 | [
"MIT"
] | null | null | null | rubber.py | flexarts/giprouter-qgis-plugin | 1008753b1183a59cb6f1f99f541c2e3f89438059 | [
"MIT"
] | null | null | null | from qgis.core import *
from qgis.gui import *
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
class RectangleMapTool(QgsMapToolEmitPoint):
onExtentChanged = pyqtSignal(QgsRectangle)
def __init__(self, canvas):
self.canvas = canvas
QgsMapToolEmitPoint.__init__(self, self.canvas)
self... | 33.023529 | 96 | 0.685073 |
ce44d83210d3c0bd730166874852d103eb8dbbd1 | 4,924 | py | Python | analysis/utils.py | chrrel/extensions | 1151924b462f9d7516f6b341e4c5300a5a2707af | [
"CC-BY-4.0"
] | 1 | 2020-07-08T15:48:48.000Z | 2020-07-08T15:48:48.000Z | analysis/utils.py | chrrel/extensions | 1151924b462f9d7516f6b341e4c5300a5a2707af | [
"CC-BY-4.0"
] | 2 | 2020-07-08T15:44:22.000Z | 2020-07-08T15:44:22.000Z | analysis/utils.py | chrrel/extensions | 1151924b462f9d7516f6b341e4c5300a5a2707af | [
"CC-BY-4.0"
] | null | null | null | import csv
import json
import logging
import os
from collections import defaultdict
import matplotlib.pyplot as plt
import tikzplotlib
from pandas import DataFrame
def write_json_file(file_path: str, results):
with open(file_path, "w") as json_file:
json.dump(results, json_file, default=_set_default, indent=4)
... | 31.164557 | 115 | 0.710804 |
52e866d563eec61b61a107ce31659aa0d5e7ab8b | 385 | py | Python | project-socialdistribution/accounts/admin.py | CMPUT404-2021F/CMPUT404-project-socialdistribution | feaf28b75a38a8c474a6a17d8c0134be99fb2479 | [
"W3C-20150513"
] | null | null | null | project-socialdistribution/accounts/admin.py | CMPUT404-2021F/CMPUT404-project-socialdistribution | feaf28b75a38a8c474a6a17d8c0134be99fb2479 | [
"W3C-20150513"
] | null | null | null | project-socialdistribution/accounts/admin.py | CMPUT404-2021F/CMPUT404-project-socialdistribution | feaf28b75a38a8c474a6a17d8c0134be99fb2479 | [
"W3C-20150513"
] | null | null | null | from django.contrib import admin
# Register your models here.
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserCreationForm, CustomUserChangeForm
from .models import CustomUser
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = CustomUserChangeForm
model... | 27.5 | 63 | 0.815584 |
3bdcc576dba411555e2f9943e100aba6a79cded0 | 9,709 | py | Python | grafana/grafana.py | Malarne/predacogs | 350c97468e587827df3ed87237aac6f7baab60de | [
"MIT"
] | 38 | 2019-05-13T19:42:31.000Z | 2022-02-28T10:09:30.000Z | grafana/grafana.py | Malarne/predacogs | 350c97468e587827df3ed87237aac6f7baab60de | [
"MIT"
] | 39 | 2019-05-26T01:55:26.000Z | 2022-01-28T15:53:29.000Z | grafana/grafana.py | Malarne/predacogs | 350c97468e587827df3ed87237aac6f7baab60de | [
"MIT"
] | 50 | 2019-03-27T15:59:36.000Z | 2022-03-12T09:33:56.000Z | import time
from datetime import datetime, timedelta
from io import BytesIO
from typing import Optional
import aiohttp
import discord
from redbot.core import Config, commands
from redbot.core.bot import Red
from redbot.core.commands.converter import TimedeltaConverter
from redbot.core.utils.chat_formatting import box,... | 41.139831 | 107 | 0.554846 |
c3e8f8abdf0f49c8b21f5dba32ff584f7938d78e | 10,855 | py | Python | pymatflow/elk/post/md.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 6 | 2020-03-06T16:13:08.000Z | 2022-03-09T07:53:34.000Z | pymatflow/exciting/post/md.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-10-02T02:23:08.000Z | 2021-11-08T13:29:37.000Z | pymatflow/elk/post/md.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-07-10T16:28:14.000Z | 2021-07-10T16:28:14.000Z | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
import os
import sys
import datetime
import subprocess
import matplotlib.pyplot as plt
from pymatflow.vasp.base.xyz import Atom
class md_post:
"""
Note:
md_post can extract information for the molecular dynamics running,
it will p... | 45.41841 | 184 | 0.532289 |
a80601d924a26c8803353ee345b114fe209f940a | 20,873 | py | Python | models.py | zplizzi/dreamer-pytorch | 582d534023c4e145489d59915c16e19d054d91b0 | [
"MIT"
] | null | null | null | models.py | zplizzi/dreamer-pytorch | 582d534023c4e145489d59915c16e19d054d91b0 | [
"MIT"
] | null | null | null | models.py | zplizzi/dreamer-pytorch | 582d534023c4e145489d59915c16e19d054d91b0 | [
"MIT"
] | null | null | null | from typing import List, Tuple
from typing import Optional
from torch import Tensor
import numpy as np
import torch
import torch.distributions
from einops import rearrange
from torch import jit
from torch import nn
from torch.distributions.normal import Normal
from torch.distributions.transformed_distribution import T... | 42.597959 | 193 | 0.621904 |
e09ec15d26c708a9cc3d72354e0fd70a756d4349 | 3,922 | py | Python | chanjo/converter/stages.py | nuin/chanjo | 9a1b4aa247c3fe5bf150ac24952d04be43befaa1 | [
"MIT"
] | null | null | null | chanjo/converter/stages.py | nuin/chanjo | 9a1b4aa247c3fe5bf150ac24952d04be43befaa1 | [
"MIT"
] | null | null | null | chanjo/converter/stages.py | nuin/chanjo | 9a1b4aa247c3fe5bf150ac24952d04be43befaa1 | [
"MIT"
] | 1 | 2018-07-18T14:56:09.000Z | 2018-07-18T14:56:09.000Z | # -*- coding: utf-8 -*-
"""
chanjo.converter.stages
~~~~~~~~~~~~~~~~~~~~~~~~
Pipeline stages only used by the Chanjo converter.
"""
from __future__ import absolute_import
from operator import attrgetter
from toolz import curry, mapcat
from ..utils import BaseInterval
@curry
def grep(pattern, string):
"""Match a ... | 28.838235 | 72 | 0.642784 |
d454e7eaa77072fbe095e6672c3b95619dd22c66 | 45,082 | py | Python | perfkitbenchmarker/linux_packages/ycsb.py | dPhanekham/PerfKitBenchmarker | e9fe13fb826ef875d3100c164a50dac638b756c3 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/linux_packages/ycsb.py | dPhanekham/PerfKitBenchmarker | e9fe13fb826ef875d3100c164a50dac638b756c3 | [
"Apache-2.0"
] | 1 | 2021-03-26T00:41:05.000Z | 2021-03-26T00:41:05.000Z | perfkitbenchmarker/linux_packages/ycsb.py | sachinpatkar/PerfKitBenchmarker | ed2898278244d71501de87bb181d50b3561dcf44 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.011804 | 99 | 0.663613 |
8a17f493b4631892182bfd29f2c5464d100983cb | 1,509 | py | Python | RasPi_Dev/ros_ws/src/xtark_driver/scripts/joy_teleop.py | QianheYu/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T03:31:15.000Z | 2022-03-11T03:31:15.000Z | RasPi_Dev/ros_ws/src/xtark_driver/scripts/joy_teleop.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | RasPi_Dev/ros_ws/src/xtark_driver/scripts/joy_teleop.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import importlib
import rospy
from sensor_msgs.msg import Joy
import time
from geometry_msgs.msg import Twist, Vector3
from std_msgs.msg import String as StringMsg
class JoyTeleop:
def __init__(self):
self.x_speed_scale = rospy.get_param('~x_speed_scale')
self.y_speed_scale = rospy.get_para... | 29.019231 | 75 | 0.669317 |
5e773bc627c9b04f6739a39c1d6e2198318f3a9d | 1,735 | py | Python | django/contrib/gis/tests/relatedapp/models.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 3 | 2016-07-08T23:49:32.000Z | 2018-04-15T22:55:01.000Z | django/contrib/gis/tests/relatedapp/models.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 27 | 2017-02-05T15:57:04.000Z | 2018-04-15T22:57:26.000Z | django/contrib/gis/tests/relatedapp/models.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | null | null | null | from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_len... | 34.7 | 72 | 0.711816 |
b4df4720f98d8c0313ff7d7fcfc8643adcf99534 | 2,795 | py | Python | train/semantic_segmentation/models/unet.py | iva-dtis/DISIR | 0b4c6c41712ab88de982412e80510545cc17dd09 | [
"MIT"
] | 38 | 2020-02-19T14:23:32.000Z | 2022-01-21T09:22:40.000Z | train/semantic_segmentation/models/unet.py | iva-dtis/DISIR | 0b4c6c41712ab88de982412e80510545cc17dd09 | [
"MIT"
] | 6 | 2020-02-19T11:14:15.000Z | 2022-03-12T00:16:25.000Z | train/semantic_segmentation/models/unet.py | iva-dtis/DISIR | 0b4c6c41712ab88de982412e80510545cc17dd09 | [
"MIT"
] | 7 | 2020-04-07T20:07:52.000Z | 2022-01-26T16:10:09.000Z | """
Source: https://github.com/milesial/Pytorch-UNet
"""
import torch.nn as nn
import torch.nn.functional as F
import torch
class double_conv(nn.Module):
"""(conv => BN => ReLU) * 2"""
def __init__(self, in_ch, out_ch):
super(double_conv, self).__init__()
self.conv = nn.Sequential(
... | 26.619048 | 80 | 0.549911 |
bf7e61f403f5a2b169aa3343d4074b7755b81f27 | 631 | py | Python | 0x02-python-import_modules/100-my_calculator.py | coding-max/holbertonschool-higher_level_programming | 392fed1ae686642b6cca6bb6752050882bbf79fc | [
"MIT"
] | 1 | 2021-04-26T03:45:12.000Z | 2021-04-26T03:45:12.000Z | 0x02-python-import_modules/100-my_calculator.py | coding-max/holbertonschool-higher_level_programming | 392fed1ae686642b6cca6bb6752050882bbf79fc | [
"MIT"
] | null | null | null | 0x02-python-import_modules/100-my_calculator.py | coding-max/holbertonschool-higher_level_programming | 392fed1ae686642b6cca6bb6752050882bbf79fc | [
"MIT"
] | 1 | 2022-02-02T02:44:35.000Z | 2022-02-02T02:44:35.000Z | #!/usr/bin/python3
if __name__ == "__main__":
from calculator_1 import add, sub, mul, div
import sys
argv = sys.argv
if len(argv) != 4:
print("Usage: ./100-my_calculator.py <a> <operator> <b>")
sys.exit(1)
elif argv[2] == '+':
op = add
elif argv[2] == '-':
op = s... | 26.291667 | 78 | 0.494453 |
8ce7be4cb048e76c8125be5adcb766c8da03ae38 | 19,804 | py | Python | piwebasync/api/controllers/assetdatabases.py | newvicx/piwebasync | fc0d159aa4b99667777f428a090fe7a102481fea | [
"MIT"
] | null | null | null | piwebasync/api/controllers/assetdatabases.py | newvicx/piwebasync | fc0d159aa4b99667777f428a090fe7a102481fea | [
"MIT"
] | 2 | 2022-03-02T17:42:21.000Z | 2022-03-29T19:24:01.000Z | piwebasync/api/controllers/assetdatabases.py | newvicx/piwebasync | fc0d159aa4b99667777f428a090fe7a102481fea | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List, Tuple, Union
from ...types import APIRequestType, ControllerType, QueryStrType
class AssetDatabases:
"""
https://docs.osisoft.com/bundle/pi-web-api-reference/page/help/controllers/assetdatabase.html
"""
CONTROLLER = "assetdatabases"
def __i... | 33.172529 | 134 | 0.599071 |
4585c96702e4043e4513a02cfc34aeaa2e511ed6 | 1,760 | py | Python | sippy/SipRSeq.py | jevonearth/b2bua | 0bbc6f2d62b6473408cea2542b8ef1be38dea814 | [
"BSD-2-Clause"
] | null | null | null | sippy/SipRSeq.py | jevonearth/b2bua | 0bbc6f2d62b6473408cea2542b8ef1be38dea814 | [
"BSD-2-Clause"
] | null | null | null | sippy/SipRSeq.py | jevonearth/b2bua | 0bbc6f2d62b6473408cea2542b8ef1be38dea814 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2015 Sippy Software, Inc. All rights reserved.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
... | 40.930233 | 82 | 0.753977 |
45d5a8773190ff4585826e2472fa81569d434550 | 15,269 | py | Python | src/model_all.py | sw1001/ENLP-Project | 79e1257665a4c3ecc342505061041bed886891b5 | [
"Apache-2.0"
] | 1 | 2021-12-20T13:39:02.000Z | 2021-12-20T13:39:02.000Z | src/model_all.py | sw1001/ENLP-Project | 79e1257665a4c3ecc342505061041bed886891b5 | [
"Apache-2.0"
] | null | null | null | src/model_all.py | sw1001/ENLP-Project | 79e1257665a4c3ecc342505061041bed886891b5 | [
"Apache-2.0"
] | 2 | 2018-04-02T02:41:04.000Z | 2018-04-04T16:36:40.000Z | import logging
import re
import time
import warnings
import nltk.data
import numpy as np
import pandas as pd
import sklearn
from bs4 import BeautifulSoup
from gensim.models import KeyedVectors, word2vec
from nltk.corpus import stopwords
from sklearn import metrics
from sklearn import naive_bayes, svm, preprocessing
fr... | 37.794554 | 116 | 0.653088 |
c2f4b3c02eb2f730f704bd2c88c43da560caa5ac | 158 | py | Python | neurobiba/helpers.py | rundleman/neurobiba | 2fc0a05b71b83fa1b2a621575c43ef08762b0161 | [
"MIT"
] | null | null | null | neurobiba/helpers.py | rundleman/neurobiba | 2fc0a05b71b83fa1b2a621575c43ef08762b0161 | [
"MIT"
] | null | null | null | neurobiba/helpers.py | rundleman/neurobiba | 2fc0a05b71b83fa1b2a621575c43ef08762b0161 | [
"MIT"
] | null | null | null | def counter():
def count():
nonlocal value
value += 1
return value
value = -1
return count
default_counter = counter()
| 13.166667 | 27 | 0.550633 |
01f4bb1a65d9c6acc73567edb26763e241595669 | 1,576 | py | Python | tests/small/test_examples.py | Scalr/pecha | 40525bfca9fe2bea319ac18ea454a24ead5c405a | [
"Apache-2.0"
] | 8 | 2016-07-21T13:03:22.000Z | 2020-07-18T13:34:09.000Z | tests/small/test_examples.py | Scalr/scalr-ctl | 40525bfca9fe2bea319ac18ea454a24ead5c405a | [
"Apache-2.0"
] | 18 | 2016-04-04T16:00:23.000Z | 2019-04-17T12:04:15.000Z | tests/small/test_examples.py | Scalr/pecha | 40525bfca9fe2bea319ac18ea454a24ead5c405a | [
"Apache-2.0"
] | 8 | 2017-01-03T00:13:18.000Z | 2019-05-14T17:53:40.000Z | # -*- coding: utf-8 -*-
import json
import pytest
import requests
from scalrctl import defaults, examples
@pytest.fixture(scope="module")
def specs():
data = {}
for api_level in defaults.API_LEVELS:
data[api_level] = json.loads(examples._read_spec(api_level))
return data
@pytest.fixture(scope=... | 30.307692 | 77 | 0.659898 |
22b1bdde359a0529302800fc07b9b14fab847347 | 819 | py | Python | vae_sweep.py | dedbox/TOAD-GAN | 8a0a84d10f9c5975ae4b1c54f7da99567c8ffd67 | [
"MIT"
] | 1 | 2021-03-26T21:05:54.000Z | 2021-03-26T21:05:54.000Z | vae_sweep.py | dedbox/TOAD-GAN | 8a0a84d10f9c5975ae4b1c54f7da99567c8ffd67 | [
"MIT"
] | null | null | null | vae_sweep.py | dedbox/TOAD-GAN | 8a0a84d10f9c5975ae4b1c54f7da99567c8ffd67 | [
"MIT"
] | null | null | null | import subprocess
levels = ['lvl_1-1.txt'] #, 'lvl_1-3.txt']
N = 5
# for level in levels:
# for L in range(0, 49, N):
# print("=" * 80)
# print(f'I={level} H=24 L={list(range(L+1,L+N+1))}')
# procs = [subprocess.Popen(f"python VAE_patches2.py --input-name {level} --hidden-dim 24 --l... | 37.227273 | 183 | 0.549451 |
95a3668c4c56f3479dcc2578fb062a7dfebb4097 | 2,630 | py | Python | GM2AUTOSAR_MM/Properties/from_eclipse/HM2_if_ConnectedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | GM2AUTOSAR_MM/Properties/from_eclipse/HM2_if_ConnectedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | GM2AUTOSAR_MM/Properties/from_eclipse/HM2_if_ConnectedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HM2_if_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HM2_if_ConnectedLHS.
"""
# Flag th... | 42.419355 | 125 | 0.482129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.