hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f742f2728de50d9c5cb1224b838a0dd411975a1d | 151 | py | Python | app/main/views.py | christianhamamdjian/kotkot | eee9d7f0e091ec680a2ce88f9a2e8816f685b2a2 | [
"MIT"
] | null | null | null | app/main/views.py | christianhamamdjian/kotkot | eee9d7f0e091ec680a2ce88f9a2e8816f685b2a2 | [
"MIT"
] | null | null | null | app/main/views.py | christianhamamdjian/kotkot | eee9d7f0e091ec680a2ce88f9a2e8816f685b2a2 | [
"MIT"
] | null | null | null | from flask import Flask,render_template, request, jsonify
from . import main
@main.route('/')
def index():
return render_template('index.html')
| 16.777778 | 57 | 0.728477 | from flask import Flask,render_template, request, jsonify
from . import main
@main.route('/')
def index():
return render_template('index.html')
| true | true |
f742f2f02b2ab8085e3bd0fe3730b691fb1fb48e | 1,176 | py | Python | mir3/modules/tool/score2label.py | pymir3/pymir3 | c1bcca66a5ef1ff0ebd6373e3820e72dee6b0b70 | [
"MIT"
] | 12 | 2015-08-03T12:41:11.000Z | 2020-08-18T07:55:23.000Z | mir3/modules/tool/score2label.py | pymir3/pymir3 | c1bcca66a5ef1ff0ebd6373e3820e72dee6b0b70 | [
"MIT"
] | 1 | 2015-05-27T18:47:20.000Z | 2015-05-27T18:47:20.000Z | mir3/modules/tool/score2label.py | pymir3/pymir3 | c1bcca66a5ef1ff0ebd6373e3820e72dee6b0b70 | [
"MIT"
] | 3 | 2016-03-18T03:30:02.000Z | 2018-07-05T02:29:16.000Z | import argparse
import mir3.data.score as score
import mir3.module
class Score2Label(mir3.module.Module):
def get_help(self):
return """convert the internal score representation to the 3 column
text"""
def build_arguments(self, parser):
parser.add_argument('infile', type=argpar... | 30.153846 | 81 | 0.567177 | import argparse
import mir3.data.score as score
import mir3.module
class Score2Label(mir3.module.Module):
def get_help(self):
return """convert the internal score representation to the 3 column
text"""
def build_arguments(self, parser):
parser.add_argument('infile', type=argpar... | true | true |
f742f30eb7db0040b2772818cd0bb1905c0d8d78 | 6,566 | py | Python | tests/test_vfs.py | jGaboardi/Fiona | d36e0c897c545e0e51fe759e540c85c117bf3fc1 | [
"BSD-3-Clause"
] | 778 | 2015-01-03T18:29:34.000Z | 2022-03-31T03:17:53.000Z | tests/test_vfs.py | jGaboardi/Fiona | d36e0c897c545e0e51fe759e540c85c117bf3fc1 | [
"BSD-3-Clause"
] | 848 | 2015-01-07T17:16:10.000Z | 2022-03-27T23:14:58.000Z | tests/test_vfs.py | jGaboardi/Fiona | d36e0c897c545e0e51fe759e540c85c117bf3fc1 | [
"BSD-3-Clause"
] | 195 | 2015-01-29T21:48:37.000Z | 2022-03-25T15:18:24.000Z | import logging
import sys
import os
import pytest
import boto3
import fiona
from fiona.errors import FionaDeprecationWarning
from fiona.vfs import vsi_path, parse_paths
from .test_collection import TestReading
from .test_collection_legacy import ReadingTest
# Custom markers (from rasterio)
mingdalversion = pytest.... | 31.873786 | 101 | 0.611483 | import logging
import sys
import os
import pytest
import boto3
import fiona
from fiona.errors import FionaDeprecationWarning
from fiona.vfs import vsi_path, parse_paths
from .test_collection import TestReading
from .test_collection_legacy import ReadingTest
mingdalversion = pytest.mark.skipif(
fiona.gdal_vers... | true | true |
f742f353e963d6084b4ec8b4193142b2c175167b | 4,042 | py | Python | tests/test_swapiutils.py | CarlosDomingues/b2sw | 7cd2d305679951a8bbb09ed95d88a79eec4ae63f | [
"MIT"
] | null | null | null | tests/test_swapiutils.py | CarlosDomingues/b2sw | 7cd2d305679951a8bbb09ed95d88a79eec4ae63f | [
"MIT"
] | 2 | 2019-01-25T01:37:52.000Z | 2019-01-25T23:44:30.000Z | tests/test_swapiutils.py | CarlosDomingues/b2sw | 7cd2d305679951a8bbb09ed95d88a79eec4ae63f | [
"MIT"
] | null | null | null | """
Tests related to the swapiutils module.
"""
import unittest
import unittest.mock
import responses
from b2sw.swapiutils import SwapiSearch
from b2sw.config import SwapiConfig
class TestSwapiSearch(unittest.TestCase):
"""
Tests related to the SwapiSearch class.
"""
def setUp(self):
"""
... | 32.596774 | 79 | 0.518555 |
import unittest
import unittest.mock
import responses
from b2sw.swapiutils import SwapiSearch
from b2sw.config import SwapiConfig
class TestSwapiSearch(unittest.TestCase):
def setUp(self):
SwapiConfig.BASE_URL = 'http://swapi.co/'
SwapiConfig.HEADERS = {'User-Agent': 'swapi-python'}
Sw... | true | true |
f742f3838be062b5393204c25e383e5005dca25c | 447 | py | Python | main/migrations/0002_auto_20211015_1946.py | elhamrazi/ElhamBlog | e10240f16770b3aec505dda27cb0456be05bdddc | [
"MIT"
] | 5 | 2021-10-19T06:23:23.000Z | 2022-03-09T13:57:06.000Z | main/migrations/0002_auto_20211015_1946.py | elhamrazi/ElhamBlog | e10240f16770b3aec505dda27cb0456be05bdddc | [
"MIT"
] | null | null | null | main/migrations/0002_auto_20211015_1946.py | elhamrazi/ElhamBlog | e10240f16770b3aec505dda27cb0456be05bdddc | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-15 16:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Blog',
new_name='Post',
),
migrat... | 19.434783 | 47 | 0.536913 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Blog',
new_name='Post',
),
migrations.RenameField(
model_name='comme... | true | true |
f742f4204067c054ca481ef39da28dfaa69287b2 | 3,102 | py | Python | data/components/labels/defaults.py | iminurnamez/Python_Arcade_Collab | 67702414ed30addd1bf46339bb458df34ed88f2a | [
"CC0-1.0"
] | 2 | 2018-08-02T15:28:45.000Z | 2022-02-09T07:45:18.000Z | data/components/labels/defaults.py | iminurnamez/Python_Arcade_Collab | 67702414ed30addd1bf46339bb458df34ed88f2a | [
"CC0-1.0"
] | null | null | null | data/components/labels/defaults.py | iminurnamez/Python_Arcade_Collab | 67702414ed30addd1bf46339bb458df34ed88f2a | [
"CC0-1.0"
] | null | null | null | import string
import pygame as pg
from data.core.constants import LOW_LIGHT_GREEN, HIGH_LIGHT_GREEN, BACKGROUND_BASE
BUTTON_DEFAULTS = {"call" : None,
"args" : None,
"call_on_up" : True,
"font" : None,
... | 36.069767 | 88 | 0.429078 | import string
import pygame as pg
from data.core.constants import LOW_LIGHT_GREEN, HIGH_LIGHT_GREEN, BACKGROUND_BASE
BUTTON_DEFAULTS = {"call" : None,
"args" : None,
"call_on_up" : True,
"font" : None,
... | true | true |
f742f4e85461619f9445b3eb659fd1228b6b9df4 | 9,580 | py | Python | demo/Tacotron2/tensorrt/convert_onnx2trt.py | leo0519/TensorRT | 498dcb009fe4c2dedbe9c61044d3de4f3c04a41b | [
"Apache-2.0"
] | 5,249 | 2019-06-17T17:20:34.000Z | 2022-03-31T17:56:05.000Z | demo/Tacotron2/tensorrt/convert_onnx2trt.py | leo0519/TensorRT | 498dcb009fe4c2dedbe9c61044d3de4f3c04a41b | [
"Apache-2.0"
] | 1,721 | 2019-06-17T18:13:29.000Z | 2022-03-31T16:09:53.000Z | demo/Tacotron2/tensorrt/convert_onnx2trt.py | leo0519/TensorRT | 498dcb009fe4c2dedbe9c61044d3de4f3c04a41b | [
"Apache-2.0"
] | 1,414 | 2019-06-18T04:01:17.000Z | 2022-03-31T09:16:53.000Z | #
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appl... | 56.686391 | 178 | 0.581211 |
import argparse
import onnx
import pycuda.autoinit
import pycuda.driver as cuda
import sys
import tensorrt as trt
from os.path import join
from trt_utils import build_engine, parse_dynamic_size
def parse_args(parser):
parser.add_argument('-o', '--output', required=True,
hel... | true | true |
f742f5014b0caa9e698eeb4407305a66fcbb47cb | 5,590 | py | Python | google/ads/google_ads/v4/proto/resources/feed_placeholder_view_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v4/proto/resources/feed_placeholder_view_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v4/proto/resources/feed_placeholder_view_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v4/proto/resources/feed_placeholder_view.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protob... | 55.346535 | 1,060 | 0.80644 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f742f5d3bfdefea18e5156e493ecf2e7739f8848 | 4,661 | py | Python | Apps/phtaniumtrace/taniumthreatresponse_view.py | mattsayar-splunk/phantom-apps | b719b78ded609ae3cbd62d7d2cc317db1a613d3b | [
"Apache-2.0"
] | 74 | 2019-10-22T02:00:53.000Z | 2022-03-15T12:56:13.000Z | Apps/phtaniumtrace/taniumthreatresponse_view.py | mattsayar-splunk/phantom-apps | b719b78ded609ae3cbd62d7d2cc317db1a613d3b | [
"Apache-2.0"
] | 375 | 2019-10-22T20:53:50.000Z | 2021-11-09T21:28:43.000Z | Apps/phtaniumtrace/taniumthreatresponse_view.py | mattsayar-splunk/phantom-apps | b719b78ded609ae3cbd62d7d2cc317db1a613d3b | [
"Apache-2.0"
] | 175 | 2019-10-23T15:30:42.000Z | 2021-11-05T21:33:31.000Z | # File: taniumthreatresponse_view.py
# Copyright (c) 2020-2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)def get_events(headers, data):
def get_events(headers, data):
""" Build a list of dictionaries that have the detail and what that detail "contains".
Args:
... | 27.91018 | 107 | 0.490667 |
def get_events(headers, data):
contains_map = {
'source_addr': ['ip'],
'destination_ip': ['ip'],
'username': ['user name'],
'process_table_id': ['threatresponse process table id'],
'process_name': ['file path', 'file name'],
'process_id': ['pid'],
... | true | true |
f742f5e377c2c817a33e14458820610fc42cf8b4 | 7,888 | py | Python | electrum/gui/qt/asset_list.py | kralverde/electrum-raven | d77aba9fc813fd22f2bda31aa8af0106e0f69bfe | [
"MIT"
] | 6 | 2021-03-29T05:21:28.000Z | 2021-08-10T14:20:50.000Z | electrum/gui/qt/asset_list.py | kralverde/electrum-raven | d77aba9fc813fd22f2bda31aa8af0106e0f69bfe | [
"MIT"
] | 6 | 2021-04-10T18:51:09.000Z | 2021-07-07T03:00:07.000Z | electrum/gui/qt/asset_list.py | kralverde/electrum-raven | d77aba9fc813fd22f2bda31aa8af0106e0f69bfe | [
"MIT"
] | 7 | 2021-03-04T15:28:32.000Z | 2021-05-06T00:25:25.000Z | #!/usr/bin/env python
from enum import IntEnum
import re
from PyQt5.QtCore import Qt, QPersistentModelIndex, QModelIndex
from PyQt5.QtGui import QStandardItemModel, QStandardItem, QFont, QMouseEvent
from PyQt5.QtWidgets import QAbstractItemView, QComboBox, QLabel, QMenu, QCheckBox, QHeaderView
from electrum.i18n imp... | 37.561905 | 110 | 0.561486 |
from enum import IntEnum
import re
from PyQt5.QtCore import Qt, QPersistentModelIndex, QModelIndex
from PyQt5.QtGui import QStandardItemModel, QStandardItem, QFont, QMouseEvent
from PyQt5.QtWidgets import QAbstractItemView, QComboBox, QLabel, QMenu, QCheckBox, QHeaderView
from electrum.i18n import _
from electrum.u... | true | true |
f742f6ccf72dfb70e785241470dfda0b2e6a27d5 | 942 | py | Python | python/118.py | HymEric/LeetCode | e32439a76968d67f99881b6d07fb16e21c979c9e | [
"Apache-2.0"
] | 2 | 2019-09-27T11:41:02.000Z | 2019-10-17T21:50:23.000Z | python/118.py | HymEric/LeetCode | e32439a76968d67f99881b6d07fb16e21c979c9e | [
"Apache-2.0"
] | null | null | null | python/118.py | HymEric/LeetCode | e32439a76968d67f99881b6d07fb16e21c979c9e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2019/10/3 0003 21:39
# @Author : Erichym
# @Email : 951523291@qq.com
# @File : 118.py
# @Software: PyCharm
class Solution:
def generate(self, numRows: int) -> list:
if numRows==0:
return []
out=[]
for i in range(numRows):
... | 26.914286 | 65 | 0.393843 |
class Solution:
def generate(self, numRows: int) -> list:
if numRows==0:
return []
out=[]
for i in range(numRows):
if i ==0:
inside=[1]
out.append(inside)
else:
inside=[]
fo... | true | true |
f742f6fa19ed1c43d14da2a3b795d18bdaff498f | 2,367 | py | Python | cfgov/scripts/validate_redirects.py | Colin-Seifer/consumerfinance.gov | a1a943f7170b498707d642d6be97b9a97a2b52e3 | [
"CC0-1.0"
] | 156 | 2015-01-16T15:16:46.000Z | 2020-08-04T04:48:01.000Z | cfgov/scripts/validate_redirects.py | Colin-Seifer/consumerfinance.gov | a1a943f7170b498707d642d6be97b9a97a2b52e3 | [
"CC0-1.0"
] | 3,604 | 2015-01-05T22:09:12.000Z | 2020-08-14T17:09:19.000Z | cfgov/scripts/validate_redirects.py | Colin-Seifer/consumerfinance.gov | a1a943f7170b498707d642d6be97b9a97a2b52e3 | [
"CC0-1.0"
] | 102 | 2015-01-28T14:51:18.000Z | 2020-08-10T00:00:39.000Z | #!/usr/bin/env python
import argparse
import re
import sys
import requests
from tablib import Dataset
def load_redirects(redirects_filename, from_index, to_index):
csv = redirects_filename.endswith(".csv")
mode = "rt" if csv else "rb"
with open(redirects_filename, mode) as f:
dataset = Dataset(... | 25.728261 | 75 | 0.618082 |
import argparse
import re
import sys
import requests
from tablib import Dataset
def load_redirects(redirects_filename, from_index, to_index):
csv = redirects_filename.endswith(".csv")
mode = "rt" if csv else "rb"
with open(redirects_filename, mode) as f:
dataset = Dataset().load(f, format="csv... | true | true |
f742f8b74c8cbd3273413f85e3ceda8a7afac61d | 1,250 | py | Python | backend/db_migrations/versions/cb023cff5fc8_solution_init.py | pixlie/buildgaga | 723bc9a114b3040a5c4d0b1d1b384f174f65b084 | [
"MIT"
] | 1 | 2021-06-19T04:12:24.000Z | 2021-06-19T04:12:24.000Z | backend/db_migrations/versions/cb023cff5fc8_solution_init.py | pixlie/buildgaga | 723bc9a114b3040a5c4d0b1d1b384f174f65b084 | [
"MIT"
] | 4 | 2021-03-10T15:20:52.000Z | 2022-02-27T03:22:01.000Z | backend/db_migrations/versions/cb023cff5fc8_solution_init.py | pixlie/buildgaga | 723bc9a114b3040a5c4d0b1d1b384f174f65b084 | [
"MIT"
] | null | null | null | """Solution init
Revision ID: cb023cff5fc8
Revises: a240cc945c0b
Create Date: 2020-04-25 15:27:37.805075
"""
from alembic import op
from sqlalchemy import Column, Integer, String, ForeignKey, UniqueConstraint
# revision identifiers, used by Alembic.
revision = "cb023cff5fc8"
down_revision = "a240cc945c0b"
branch_la... | 27.173913 | 89 | 0.6832 | from alembic import op
from sqlalchemy import Column, Integer, String, ForeignKey, UniqueConstraint
revision = "cb023cff5fc8"
down_revision = "a240cc945c0b"
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
"solution",
Column("id", Integer, primary_key=True),
Colum... | true | true |
f742f959c15b17f4a74cfeb96c6618d1ce51f73c | 94 | py | Python | akivymd/tools/pyinstaller_hooks.py | JUDE122-MAX/akivymd | b2daddd2f58889859514286606f46a4af6f03828 | [
"MIT"
] | 51 | 2020-06-18T15:14:02.000Z | 2022-03-07T05:46:11.000Z | akivymd/tools/pyinstaller_hooks.py | JUDE122-MAX/akivymd | b2daddd2f58889859514286606f46a4af6f03828 | [
"MIT"
] | 16 | 2020-07-19T08:13:45.000Z | 2021-06-05T20:55:12.000Z | akivymd/tools/pyinstaller_hooks.py | JUDE122-MAX/akivymd | b2daddd2f58889859514286606f46a4af6f03828 | [
"MIT"
] | 15 | 2020-07-18T10:34:10.000Z | 2021-07-03T09:07:37.000Z | from os.path import abspath, basename, dirname, join
hooks_path = dirname(abspath(__file__))
| 23.5 | 52 | 0.787234 | from os.path import abspath, basename, dirname, join
hooks_path = dirname(abspath(__file__))
| true | true |
f742fab8e48468f0211579c372cccb7a5df77823 | 6,418 | py | Python | auto_editor/audiotsm2/base/analysis_synthesis.py | hchyun6086/auto-editor | beef008763bcaad00b83d5b506f436e6edc8963e | [
"Unlicense"
] | null | null | null | auto_editor/audiotsm2/base/analysis_synthesis.py | hchyun6086/auto-editor | beef008763bcaad00b83d5b506f436e6edc8963e | [
"Unlicense"
] | null | null | null | auto_editor/audiotsm2/base/analysis_synthesis.py | hchyun6086/auto-editor | beef008763bcaad00b83d5b506f436e6edc8963e | [
"Unlicense"
] | null | null | null | '''audiotsm2/base/analysis_synthesis.py'''
import numpy as np
from auto_editor.audiotsm2.utils import (windows, CBuffer, NormalizeBuffer)
from .tsm import TSM
EPSILON = 0.0001
class AnalysisSynthesisTSM(TSM):
def __init__(self, converter, channels, frame_length, analysis_hop, synthesis_hop,
analysis_wi... | 38.89697 | 86 | 0.666407 |
import numpy as np
from auto_editor.audiotsm2.utils import (windows, CBuffer, NormalizeBuffer)
from .tsm import TSM
EPSILON = 0.0001
class AnalysisSynthesisTSM(TSM):
def __init__(self, converter, channels, frame_length, analysis_hop, synthesis_hop,
analysis_window, synthesis_window, delta_before=0, del... | true | true |
f742fad106ad1357d622cdf759a06f1d008ef15f | 24,311 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancers_operations.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancers_operations.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancers_operations.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 46.306667 | 170 | 0.667805 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class LoadBalancersOperations(object):
models = models
def __... | true | true |
f742fb333a76d42b9f6f12b225714974a661fa37 | 43,304 | py | Python | great_expectations/dataset/pandas_dataset.py | mastratton3/great_expectations | 151970d776c942bfc23cdd90c7ed00b57a34559d | [
"Apache-2.0"
] | null | null | null | great_expectations/dataset/pandas_dataset.py | mastratton3/great_expectations | 151970d776c942bfc23cdd90c7ed00b57a34559d | [
"Apache-2.0"
] | null | null | null | great_expectations/dataset/pandas_dataset.py | mastratton3/great_expectations | 151970d776c942bfc23cdd90c7ed00b57a34559d | [
"Apache-2.0"
] | null | null | null | from __future__ import division
import inspect
import json
import re
from datetime import datetime
from functools import wraps
import jsonschema
import sys
import numpy as np
import pandas as pd
from dateutil.parser import parse
from scipy import stats
from six import PY3, integer_types, string_types
from numbers impo... | 43.347347 | 245 | 0.583826 | from __future__ import division
import inspect
import json
import re
from datetime import datetime
from functools import wraps
import jsonschema
import sys
import numpy as np
import pandas as pd
from dateutil.parser import parse
from scipy import stats
from six import PY3, integer_types, string_types
from numbers impo... | true | true |
f742fb9d8016e6fb2c2b948c5fdf0de4451481aa | 3,514 | py | Python | public/cantusdata/models/chant.py | jacobsanz97/cantus | 37d139ae20972c36d4abb96a2a5ac5106b0c1b47 | [
"MIT"
] | null | null | null | public/cantusdata/models/chant.py | jacobsanz97/cantus | 37d139ae20972c36d4abb96a2a5ac5106b0c1b47 | [
"MIT"
] | null | null | null | public/cantusdata/models/chant.py | jacobsanz97/cantus | 37d139ae20972c36d4abb96a2a5ac5106b0c1b47 | [
"MIT"
] | null | null | null | from django.db import models
class Chant(models.Model):
"""
A Chant belongs to a image page (or a chant can appear
on multiple pages?)
Feast and Concordances belong to a Chant
(assuming a chant corresponds to exactly one feast(many-to-one)
and many-to-many relationship betw... | 40.390805 | 74 | 0.628344 | from django.db import models
class Chant(models.Model):
class Meta:
app_label = "cantusdata"
ordering = ['sequence']
marginalia = models.CharField(max_length=255, blank=True, null=True)
folio = models.ForeignKey("cantusdata.Folio", blank=True, null=True)
sequence = models.PositiveSmal... | true | true |
f742fbdb80ffe14406863e3efa2afcab8ed89f32 | 4,948 | py | Python | test/test_pytest_aoc.py | j0057/pytest-aoc | 55b3a99ae1efd27e1f6784e10a75e6920a384f9a | [
"MIT"
] | 7 | 2019-06-27T13:15:54.000Z | 2021-12-11T09:59:55.000Z | test/test_pytest_aoc.py | j0057/pytest-aoc | 55b3a99ae1efd27e1f6784e10a75e6920a384f9a | [
"MIT"
] | 1 | 2020-11-30T21:07:54.000Z | 2020-12-01T10:37:45.000Z | test/test_pytest_aoc.py | j0057/pytest-aoc | 55b3a99ae1efd27e1f6784e10a75e6920a384f9a | [
"MIT"
] | null | null | null | import datetime
import pytest
import pytest_aoc
def test_get_cookie(testdir):
testdir.maketxtfile(cookie='spam')
testdir.makepyfile(test_get_cookie='''
import pytest_aoc
def test_get_cookie_from_session_id():
assert pytest_aoc.get_cookie('eggs', 'cookie.txt') == 'eggs'
def... | 38.65625 | 101 | 0.648747 | import datetime
import pytest
import pytest_aoc
def test_get_cookie(testdir):
testdir.maketxtfile(cookie='spam')
testdir.makepyfile(test_get_cookie='''
import pytest_aoc
def test_get_cookie_from_session_id():
assert pytest_aoc.get_cookie('eggs', 'cookie.txt') == 'eggs'
def... | true | true |
f742fbf8ebd00fc169c584290568ffede4ce0d72 | 1,995 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/PanelTypeSetIterator.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/PanelTypeSetIterator.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/PanelTypeSetIterator.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class PanelTypeSetIterator(APIObject, IDisposable, IEnumerator):
"""
An iterator to a panel type set.
PanelTypeSetIterator()
"""
def Dispose(self):
""" Dispose(self: PanelTypeSetIterator,A_0: bool) """
pass
def MoveNext(self):
"""
MoveNext(self: PanelTypeSet... | 24.9375 | 221 | 0.609023 | class PanelTypeSetIterator(APIObject, IDisposable, IEnumerator):
def Dispose(self):
pass
def MoveNext(self):
pass
def next(self, *args):
pass
def ReleaseManagedResources(self, *args):
pass
def ReleaseUnmanagedResources(self, *args):
pass
... | true | true |
f742fc82433ada2190478111da8b5e0487af1ff1 | 7,024 | py | Python | qdev_wrappers/alazar_controllers/alazar_channel.py | Dominik-Vogel/qdev-wrappers | fa28a1899c2dcb2df7da26f3c90644324d3209b4 | [
"MIT"
] | null | null | null | qdev_wrappers/alazar_controllers/alazar_channel.py | Dominik-Vogel/qdev-wrappers | fa28a1899c2dcb2df7da26f3c90644324d3209b4 | [
"MIT"
] | 1 | 2018-11-22T13:06:48.000Z | 2018-11-22T13:06:48.000Z | qdev_wrappers/alazar_controllers/alazar_channel.py | Dominik-Vogel/qdev-wrappers | fa28a1899c2dcb2df7da26f3c90644324d3209b4 | [
"MIT"
] | null | null | null | import math
from qcodes.instrument.channel import InstrumentChannel
from qcodes.utils import validators as vals
from .alazar_multidim_parameters import Alazar0DParameter, Alazar1DParameter, Alazar2DParameter
from .acquisition_parameters import AcqVariablesParam, NonSettableDerivedParameter
class AlazarChannel(Instrume... | 47.459459 | 111 | 0.562215 | import math
from qcodes.instrument.channel import InstrumentChannel
from qcodes.utils import validators as vals
from .alazar_multidim_parameters import Alazar0DParameter, Alazar1DParameter, Alazar2DParameter
from .acquisition_parameters import AcqVariablesParam, NonSettableDerivedParameter
class AlazarChannel(Instrume... | true | true |
f742fd46be89cf94ec136e8139b870e7925fd415 | 2,058 | py | Python | dojo/unittests/tools/test_burp_parser.py | steven-hadfield/django-DefectDojo | 38609f7316cf6bf6cb30736f644fe2c66cc71061 | [
"BSD-3-Clause"
] | 2 | 2021-09-19T23:19:12.000Z | 2022-03-26T10:20:49.000Z | dojo/unittests/tools/test_burp_parser.py | steven-hadfield/django-DefectDojo | 38609f7316cf6bf6cb30736f644fe2c66cc71061 | [
"BSD-3-Clause"
] | 167 | 2021-03-15T13:49:54.000Z | 2022-03-31T09:10:30.000Z | dojo/unittests/tools/test_burp_parser.py | steven-hadfield/django-DefectDojo | 38609f7316cf6bf6cb30736f644fe2c66cc71061 | [
"BSD-3-Clause"
] | 4 | 2016-09-19T17:33:39.000Z | 2018-12-10T07:55:45.000Z | import os.path
from django.test import TestCase
from dojo.tools.burp.parser import BurpParser
from dojo.models import Test
def sample_path(file_name):
return os.path.join("dojo/unittests/scans/burp", file_name)
class TestBurpParser(TestCase):
def test_burp_with_one_vuln_has_one_finding(self):
with... | 38.830189 | 84 | 0.682702 | import os.path
from django.test import TestCase
from dojo.tools.burp.parser import BurpParser
from dojo.models import Test
def sample_path(file_name):
return os.path.join("dojo/unittests/scans/burp", file_name)
class TestBurpParser(TestCase):
def test_burp_with_one_vuln_has_one_finding(self):
with... | true | true |
f742fdb42077d3d5f16c6edd3e3ece86f7ca2dcf | 4,349 | py | Python | contrib/seeds/generate-seeds.py | Betcoincore/betcoin | 68e8997f2119b287cb0ce181899d29ea01e497c4 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | Betcoincore/betcoin | 68e8997f2119b287cb0ce181899d29ea01e497c4 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | Betcoincore/betcoin | 68e8997f2119b287cb0ce181899d29ea01e497c4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... | 31.514493 | 98 | 0.582893 |
from __future__ import print_function, division
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith... | true | true |
f742fdfb40ed62e1543ebe0bb3e57eb73a92b785 | 3,270 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2021_09_01/_configuration.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2021_09_01/_configuration.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2021_09_01/_configuration.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 ... | 45.416667 | 129 | 0.685627 |
from typing import TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from ._version import VERSION
if TYPE_CHECKING:
from typing import Any
from azure.core.credentials import TokenC... | true | true |
f742fe41e01beb9307085f71bb00d443a534a215 | 407 | py | Python | Stack&Queue/truck_passing_trough_bridge.py | Mayner0220/Programmers | 42e4783a526506fb7d8208841a76201909ed5c5c | [
"Apache-2.0"
] | 1 | 2021-04-01T06:19:02.000Z | 2021-04-01T06:19:02.000Z | Stack&Queue/truck_passing_trough_bridge.py | Mayner0220/Programmers | 42e4783a526506fb7d8208841a76201909ed5c5c | [
"Apache-2.0"
] | null | null | null | Stack&Queue/truck_passing_trough_bridge.py | Mayner0220/Programmers | 42e4783a526506fb7d8208841a76201909ed5c5c | [
"Apache-2.0"
] | null | null | null | # https://programmers.co.kr/learn/courses/30/lessons/42583?language=python3
def solution(bridge_length, weight, truck_weights):
time = 0
q = [0] * bridge_length
while q:
time += 1
q.pop(0)
if truck_weights:
if sum(q) + truck_weights[0] <= weight:
q.appe... | 23.941176 | 75 | 0.55774 |
def solution(bridge_length, weight, truck_weights):
time = 0
q = [0] * bridge_length
while q:
time += 1
q.pop(0)
if truck_weights:
if sum(q) + truck_weights[0] <= weight:
q.append(truck_weights.pop(0))
else:
q.append(0)
... | true | true |
f742fe913a1ea108d6ceca35830c8ac16a9f9a8a | 7,023 | py | Python | examples/exp_configs/non_rl/crystal/sc35.py | cwang717/flow | e8e32d7c01243c1b2fe177f575c4f8bec34812db | [
"MIT"
] | null | null | null | examples/exp_configs/non_rl/crystal/sc35.py | cwang717/flow | e8e32d7c01243c1b2fe177f575c4f8bec34812db | [
"MIT"
] | null | null | null | examples/exp_configs/non_rl/crystal/sc35.py | cwang717/flow | e8e32d7c01243c1b2fe177f575c4f8bec34812db | [
"MIT"
] | null | null | null | """Example of a highway section network with on/off ramps."""
from flow.envs.highway_ramps_env import HighwayRampsEnv
from flow.envs.multiagent import highway
from flow.controllers import car_following_models
from flow.controllers.car_following_models import IDMController, LACController
from flow.core.params import Su... | 32.364055 | 90 | 0.704115 |
from flow.envs.highway_ramps_env import HighwayRampsEnv
from flow.envs.multiagent import highway
from flow.controllers import car_following_models
from flow.controllers.car_following_models import IDMController, LACController
from flow.core.params import SumoParams, EnvParams, NetParams, InitialConfig
from flow.core.p... | true | true |
f742ff3922577d8e33fc92bc6252bf723e2907ad | 4,019 | py | Python | ci/create_graphs_for_benchmark_data.py | victimsnino/ReactivePlusPlus | bb187cc52936bce7c1ef4899d7dbb9c970cef291 | [
"MIT"
] | 1 | 2022-03-19T20:15:50.000Z | 2022-03-19T20:15:50.000Z | ci/create_graphs_for_benchmark_data.py | victimsnino/ReactivePlusPlus | bb187cc52936bce7c1ef4899d7dbb9c970cef291 | [
"MIT"
] | 12 | 2022-03-22T21:18:14.000Z | 2022-03-30T05:37:58.000Z | ci/create_graphs_for_benchmark_data.py | victimsnino/ReactivePlusPlus | bb187cc52936bce7c1ef4899d7dbb9c970cef291 | [
"MIT"
] | null | null | null | import plotly.offline as pyo
import plotly.express as px
from plotly.subplots import make_subplots
import pandas as pd
import plotly.graph_objects as go
def rindex(lst, value):
return len(lst) - lst[::-1].index(value) - 1
dashboard = open("./gh-pages/benchmark.html", 'w')
dashboard.write("<html><head></head><... | 41.864583 | 141 | 0.539189 | import plotly.offline as pyo
import plotly.express as px
from plotly.subplots import make_subplots
import pandas as pd
import plotly.graph_objects as go
def rindex(lst, value):
return len(lst) - lst[::-1].index(value) - 1
dashboard = open("./gh-pages/benchmark.html", 'w')
dashboard.write("<html><head></head><... | true | true |
f742ff70cc4000432ebde18ed3688d36631b0d4d | 7,355 | py | Python | src/tissue_purifier/utils/nms_util.py | broadinstitute/tissue_purifier | 989ce9d58bba99a3f1c49743eed22dcc64e5f159 | [
"Apache-2.0"
] | null | null | null | src/tissue_purifier/utils/nms_util.py | broadinstitute/tissue_purifier | 989ce9d58bba99a3f1c49743eed22dcc64e5f159 | [
"Apache-2.0"
] | null | null | null | src/tissue_purifier/utils/nms_util.py | broadinstitute/tissue_purifier | 989ce9d58bba99a3f1c49743eed22dcc64e5f159 | [
"Apache-2.0"
] | null | null | null | import torch
import numpy
from typing import Union, List, Any
class NonMaxSuppression:
"""
Given a set of bounding box defined over possibly different tissue
Use Intersection_over_Minimum criteria to filter out overlapping proposals.
"""
@staticmethod
@torch.no_grad()
def compute_nm_mask(... | 45.96875 | 113 | 0.616859 | import torch
import numpy
from typing import Union, List, Any
class NonMaxSuppression:
@staticmethod
@torch.no_grad()
def compute_nm_mask(score: Union[torch.Tensor, numpy.ndarray],
ids: Union[torch.Tensor, numpy.ndarray, List[Any]],
patches_xywh: Union[to... | true | true |
f742ff8b269ce7c50f63519ecc5db387bf4b7bec | 853 | py | Python | training/networks/discriminators/vgg19.py | Sergio0694/sepconv-gan | 82d908ed5c3dd55d7b2f8603450dac5108751a3b | [
"MIT"
] | 1 | 2021-08-07T16:30:05.000Z | 2021-08-07T16:30:05.000Z | training/networks/discriminators/vgg19.py | Sergio0694/sepconv-gan | 82d908ed5c3dd55d7b2f8603450dac5108751a3b | [
"MIT"
] | null | null | null | training/networks/discriminators/vgg19.py | Sergio0694/sepconv-gan | 82d908ed5c3dd55d7b2f8603450dac5108751a3b | [
"MIT"
] | null | null | null | import tensorflow as tf
def get_network(x):
'''Gets a discriminator network with the shared base of the VGG19 network.
x(tf.Tensor) -- the VGG19 base network
'''
with tf.variable_scope('VGG19_top', None, [x], reuse=tf.AUTO_REUSE):
conv1 = tf.layers.conv2d(x, 512, 3, activation=tf.nn.leaky_rel... | 44.894737 | 96 | 0.647128 | import tensorflow as tf
def get_network(x):
with tf.variable_scope('VGG19_top', None, [x], reuse=tf.AUTO_REUSE):
conv1 = tf.layers.conv2d(x, 512, 3, activation=tf.nn.leaky_relu, padding='same')
conv2 = tf.layers.conv2d(conv1, 512, 3, activation=tf.nn.leaky_relu, padding='same') + x
pool = ... | true | true |
f742ffe7ac1ed220bfc9d01165a6cc6fc4c6b437 | 3,691 | py | Python | app/service/shop_recall.py | zhangadrian/mini-shop-server | 3a1f29784b707d14f2435322cdc2efdaab4ec85e | [
"MIT"
] | 1 | 2020-09-25T09:23:06.000Z | 2020-09-25T09:23:06.000Z | app/service/shop_recall.py | zhangadrian/mini-shop-server | 3a1f29784b707d14f2435322cdc2efdaab4ec85e | [
"MIT"
] | null | null | null | app/service/shop_recall.py | zhangadrian/mini-shop-server | 3a1f29784b707d14f2435322cdc2efdaab4ec85e | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
from math import radians, cos, sin, asin, sqrt
from app.libs.poi_search.es_search_category import search
from app.libs.poi_search.es_search_street import search as search_street
from app.models.new_shop import NewShop as Shop
from app.models.group import Group
from app.models.new_user import Ne... | 33.554545 | 131 | 0.610404 |
from math import radians, cos, sin, asin, sqrt
from app.libs.poi_search.es_search_category import search
from app.libs.poi_search.es_search_street import search as search_street
from app.models.new_shop import NewShop as Shop
from app.models.group import Group
from app.models.new_user import NewUser as User
from app.... | true | true |
f74300cb330738f48b2361b0192cd7294e4b23fa | 2,505 | py | Python | scripts/forces.py | RexGalilae/VASP-tools | f7c8bb9559b03f4f6670a2168a8f5d48bc30e206 | [
"MIT"
] | 7 | 2019-07-29T03:37:05.000Z | 2021-11-16T12:34:04.000Z | scripts/forces.py | RexGalilae/VASP-tools | f7c8bb9559b03f4f6670a2168a8f5d48bc30e206 | [
"MIT"
] | 147 | 2019-07-27T08:37:43.000Z | 2022-03-20T13:01:09.000Z | scripts/forces.py | RexGalilae/VASP-tools | f7c8bb9559b03f4f6670a2168a8f5d48bc30e206 | [
"MIT"
] | 3 | 2019-08-20T09:48:07.000Z | 2021-06-05T15:43:50.000Z | #!/usr/bin/env python
import argparse
import os
import re
import subprocess
from tabulate import tabulate
parser = argparse.ArgumentParser(prog="forces",
description='''A script that parses an OUTCAR file to compute a the net positive
and... | 31.3125 | 115 | 0.528942 |
import argparse
import os
import re
import subprocess
from tabulate import tabulate
parser = argparse.ArgumentParser(prog="forces",
description='''A script that parses an OUTCAR file to compute a the net positive
and negative Forces acti... | true | true |
f743018ad2b8f928853f9677911a21ae6b7cd8b0 | 712 | py | Python | pointofsale_project/users/urls.py | chidibede/django_pos_app | 5ba99f831ce5081e26dcfa550e219570dc4dcb6a | [
"MIT"
] | null | null | null | pointofsale_project/users/urls.py | chidibede/django_pos_app | 5ba99f831ce5081e26dcfa550e219570dc4dcb6a | [
"MIT"
] | 21 | 2020-06-05T21:31:13.000Z | 2022-03-12T00:18:20.000Z | pointofsale_project/users/urls.py | chidibede/django_pos_app | 5ba99f831ce5081e26dcfa550e219570dc4dcb6a | [
"MIT"
] | null | null | null | from django.urls import path
from django.contrib.auth import views as auth_views
from users import views as user_views
urlpatterns = [
path('register/', user_views.register, name='users-register'),
path('employee/', user_views.employee, name='users-employee'),
path('profile/', user_views.profile, name='us... | 50.857143 | 107 | 0.745787 | from django.urls import path
from django.contrib.auth import views as auth_views
from users import views as user_views
urlpatterns = [
path('register/', user_views.register, name='users-register'),
path('employee/', user_views.employee, name='users-employee'),
path('profile/', user_views.profile, name='us... | true | true |
f743021d48149eaf3ddb7faef620f003feacbd27 | 2,403 | py | Python | google-cloud-sdk/lib/surface/deployment_manager/resources/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/deployment_manager/resources/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/deployment_manager/resources/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.04 | 76 | 0.714107 |
from apitools.base.py import exceptions as apitools_exceptions
from googlecloudsdk.api_lib.deployment_manager import dm_api_util
from googlecloudsdk.api_lib.deployment_manager import dm_base
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.comma... | true | true |
f74302fcdea947492767df1658ccbc8f2462519a | 4,359 | py | Python | feng-nlp-python/utils/ReadScelFile.py | JiangFeng07/feng-python-apply | 1dec2d518ea257467c9b253981cfc281d7ac108a | [
"MIT"
] | 12 | 2017-08-05T16:46:25.000Z | 2019-04-18T08:32:16.000Z | feng-nlp-python/utils/ReadScelFile.py | JiangFeng07/feng-python-apply | 1dec2d518ea257467c9b253981cfc281d7ac108a | [
"MIT"
] | null | null | null | feng-nlp-python/utils/ReadScelFile.py | JiangFeng07/feng-python-apply | 1dec2d518ea257467c9b253981cfc281d7ac108a | [
"MIT"
] | 18 | 2017-08-30T10:58:02.000Z | 2019-12-09T13:27:34.000Z | __author__ = 'lionel'
#!/usr/bin/python
# -*- coding: utf-8 -*-
import struct
import sys
# 搜狗的scel词库就是保存的文本的unicode编码,每两个字节一个字符(中文汉字或者英文字母)
# 找出其每部分的偏移位置即可
# 主要两部分
# 1.全局拼音表,貌似是所有的拼音组合,字典序
# 格式为(index,len,pinyin)的列表
# index: 两个字节的整数 代表这个拼音的索引
# len: 两个字节的整数 拼音的字节长度
# pinyin: 当前的拼音,每个字符两个字节,总... | 23.18617 | 104 | 0.53292 | __author__ = 'lionel'
import struct
import sys
startPy = 0x1540
startChinese = 0x2628
GPy_Table = {}
GTable = []
def byte2str(data):
i = 0
length = len(data)
ret = u''
while i < length:
x = data[i] + data[i + 1]
t = unichr(struct.unpack('H', x)... | true | true |
f74303578b003b19094bc47e10881fbd0c96692d | 12,106 | py | Python | assets/src/ba_data/python/bastd/game/conquest.py | Dmitry450/ballistica | 27420d3f64c24bf3c9b4b047177a4769977659b1 | [
"MIT"
] | null | null | null | assets/src/ba_data/python/bastd/game/conquest.py | Dmitry450/ballistica | 27420d3f64c24bf3c9b4b047177a4769977659b1 | [
"MIT"
] | null | null | null | assets/src/ba_data/python/bastd/game/conquest.py | Dmitry450/ballistica | 27420d3f64c24bf3c9b4b047177a4769977659b1 | [
"MIT"
] | null | null | null | # Copyright (c) 2011-2020 Eric Froemling
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | 39.305195 | 79 | 0.561209 |
from __future__ import annotations
import random
from typing import TYPE_CHECKING
import ba
from bastd.actor.flag import Flag
from bastd.actor.playerspaz import PlayerSpazDeathMessage
if TYPE_CHECKING:
from typing import (Any, Optional, Type, List, Tuple, Dict, Sequence,
... | true | true |
f743049a8b54fb38c3daba5aa1b76f63634c7366 | 2,257 | py | Python | seeq/test/test_parametric_control.py | juanjosegarciaripoll/seeq | 3554550c3348fbaae398737cf4ae5510a34d6665 | [
"MIT"
] | 13 | 2019-07-31T17:00:37.000Z | 2021-02-02T18:34:34.000Z | seeq/test/test_parametric_control.py | Ydeh22/seeq | 3554550c3348fbaae398737cf4ae5510a34d6665 | [
"MIT"
] | null | null | null | seeq/test/test_parametric_control.py | Ydeh22/seeq | 3554550c3348fbaae398737cf4ae5510a34d6665 | [
"MIT"
] | 5 | 2019-11-04T17:54:40.000Z | 2022-02-16T23:04:56.000Z |
from seeq.control import *
import unittest
class TestQControl(unittest.TestCase):
π = np.pi
σz = np.array([[1., 0.],[0., -1.]])
σx = np.array([[0., 1.],[1., 0.]])
σy = np.array([[0., -1.j],[1.j, 0.]])
ψ0 = np.eye(2)
def test_nothing(self):
"""For a qubit to remain the same, we do not... | 38.254237 | 95 | 0.549402 |
from seeq.control import *
import unittest
class TestQControl(unittest.TestCase):
π = np.pi
σz = np.array([[1., 0.],[0., -1.]])
σx = np.array([[0., 1.],[1., 0.]])
σy = np.array([[0., -1.j],[1.j, 0.]])
ψ0 = np.eye(2)
def test_nothing(self):
Ug = np.eye(2)
H = lambda t, x, ψ: x... | true | true |
f7430602fac3e3eb6853e0fbea95df8b3c7031ba | 1,990 | py | Python | chemprop/utils/uclass.py | wangdingyan/hybridUQ | c141a4bec0e716a12444f7e9ab0d7c975df93184 | [
"MIT"
] | 6 | 2021-10-01T10:17:29.000Z | 2021-12-29T04:37:10.000Z | chemprop/utils/uclass.py | wangdingyan/hybridUQ | c141a4bec0e716a12444f7e9ab0d7c975df93184 | [
"MIT"
] | null | null | null | chemprop/utils/uclass.py | wangdingyan/hybridUQ | c141a4bec0e716a12444f7e9ab0d7c975df93184 | [
"MIT"
] | 1 | 2021-09-21T17:39:03.000Z | 2021-09-21T17:39:03.000Z | import numpy as np
class uncertainty:
def __init__(self):
pass
class uncertainties:
def __init__(self):
self.uncertainty_collection = {}
self.uncertainty_count = {}
self.norm_func = {'MinMax' : lambda x: (x-np.min(x)) / (np.max(x)-np.min(x)),
'Zscor... | 34.310345 | 144 | 0.588945 | import numpy as np
class uncertainty:
def __init__(self):
pass
class uncertainties:
def __init__(self):
self.uncertainty_collection = {}
self.uncertainty_count = {}
self.norm_func = {'MinMax' : lambda x: (x-np.min(x)) / (np.max(x)-np.min(x)),
'Zscor... | true | true |
f74306c969113d53851af6e4f80bc73d71fafc18 | 4,042 | py | Python | sample-input/benchmarks/takeda/model_1/materials.py | AI-Pranto/OpenMOC | 7f6ce4797aec20ddd916981a56a4ba54ffda9a06 | [
"MIT"
] | 97 | 2015-01-02T02:13:45.000Z | 2022-03-09T14:12:45.000Z | sample-input/benchmarks/takeda/model_1/materials.py | AI-Pranto/OpenMOC | 7f6ce4797aec20ddd916981a56a4ba54ffda9a06 | [
"MIT"
] | 325 | 2015-01-07T17:43:14.000Z | 2022-02-21T17:22:00.000Z | sample-input/benchmarks/takeda/model_1/materials.py | AI-Pranto/OpenMOC | 7f6ce4797aec20ddd916981a56a4ba54ffda9a06 | [
"MIT"
] | 73 | 2015-01-17T19:11:58.000Z | 2022-03-24T16:31:37.000Z | import h5py
import numpy as np
"""
This file writes all of the materials data (multi-group nuclear
cross-sections) for the Takeda
benchmark problem to an HDF5 file. The script uses the h5py Python package
to interact with the HDF5 file format. This may be a good example for those
wishing to write their nuclear data to... | 38.132075 | 79 | 0.580653 | import h5py
import numpy as np
f = h5py.File('takeda-mgxs.h5')
f.attrs["# groups"] = 2
material_group = f.create_group('material')
| true | true |
f74308780d53cae951e9ece6428780c28f37d68e | 6,892 | py | Python | post_fids.py | umernalla/pywspostfids | 13648c0b2a7a6f9e20ce343944a1f5428cdf9c99 | [
"Apache-2.0"
] | null | null | null | post_fids.py | umernalla/pywspostfids | 13648c0b2a7a6f9e20ce343944a1f5428cdf9c99 | [
"Apache-2.0"
] | null | null | null | post_fids.py | umernalla/pywspostfids | 13648c0b2a7a6f9e20ce343944a1f5428cdf9c99 | [
"Apache-2.0"
] | null | null | null | #|-----------------------------------------------------------------------------
#| This source code is provided under the Apache 2.0 license --
#| and is provided AS IS with no warranty or guarantee of fit for purpose. --
#| See the project's LICENSE.md for details. --
... | 31.327273 | 179 | 0.561811 |
#| Copyright (C) 2017-2020 Refinitiv. All rights reserved. --
#|-----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import time
import getopt
import socket
import json
import websocket
import threading
import os
from threading import Th... | true | true |
f743087863f500c69952cd50da0ef9b3824f5d4e | 13,470 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dmac_training.py | jalauzon-msft/azure-sdk-for-python | 15967f5c6d3376f2334a382486ba86339786e028 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dmac_training.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dmac_training.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import uuid
import pytest
import functools
from devtools_testutils import recorded_by_proxy, set_bodiless_matcher, set_custom_default_matcher
from azure.... | 48.27957 | 133 | 0.719599 |
import uuid
import pytest
import functools
from devtools_testutils import recorded_by_proxy, set_bodiless_matcher, set_custom_default_matcher
from azure.core.credentials import AzureKeyCredential
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError
from azure.ai.formrecognizer._generated... | true | true |
f74308a7fdc8571928c2d9c4f4c71b84b3e65635 | 2,015 | py | Python | EZ Queue/screen.py | HSU-S21-CS232/final-th150 | cf0004c7a9e72b08a0c1c9985c8c43e83a0fb650 | [
"Apache-2.0"
] | 16 | 2017-10-04T04:05:55.000Z | 2021-08-28T16:46:32.000Z | EZ Queue/screen.py | HSU-S21-CS232/final-th150 | cf0004c7a9e72b08a0c1c9985c8c43e83a0fb650 | [
"Apache-2.0"
] | null | null | null | EZ Queue/screen.py | HSU-S21-CS232/final-th150 | cf0004c7a9e72b08a0c1c9985c8c43e83a0fb650 | [
"Apache-2.0"
] | 3 | 2017-10-04T13:25:40.000Z | 2020-01-07T16:25:56.000Z | import os
import time
import cv2
import numpy as np
from PIL import ImageGrab
class Screen(object):
WINDOW_NAME = 'data'
def __init__(self):
self.image = None
self.data = None
self.event = None
@property
def inverted_image_size(self):
return (self.image.size[1], se... | 25.506329 | 68 | 0.584119 | import os
import time
import cv2
import numpy as np
from PIL import ImageGrab
class Screen(object):
WINDOW_NAME = 'data'
def __init__(self):
self.image = None
self.data = None
self.event = None
@property
def inverted_image_size(self):
return (self.image.size[1], se... | true | true |
f7430ba937e0b37074f412744151480e3c205508 | 19,652 | py | Python | perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py | antigenius0910/PerfKitBenchmarker | 75ba6007c7b81f43e18be37b698c5b631c4546c7 | [
"Apache-2.0"
] | 1 | 2020-01-23T10:33:50.000Z | 2020-01-23T10:33:50.000Z | perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py | antigenius0910/PerfKitBenchmarker | 75ba6007c7b81f43e18be37b698c5b631c4546c7 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py | antigenius0910/PerfKitBenchmarker | 75ba6007c7b81f43e18be37b698c5b631c4546c7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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... | 37.009416 | 80 | 0.692499 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
import json
import logging
import re
import tempfile
from perfkitbenchmarker import errors
from perfkitbenchmarker import flags
from perfkitbenchmarker import l... | true | true |
f7430bcfeacf7847fa8004d6e4bccb004f8b8467 | 164 | py | Python | manage.py | guoxianru/goodsmovie | d9f3eab8578719a97b9f4328bc9083f1caeedb3d | [
"Apache-2.0"
] | 4 | 2019-03-19T06:41:58.000Z | 2020-10-18T07:24:08.000Z | manage.py | guoxianru/goodsmovie | d9f3eab8578719a97b9f4328bc9083f1caeedb3d | [
"Apache-2.0"
] | 7 | 2020-12-16T02:18:59.000Z | 2020-12-16T02:19:01.000Z | manage.py | guoxianru/goodsmovie | d9f3eab8578719a97b9f4328bc9083f1caeedb3d | [
"Apache-2.0"
] | 2 | 2019-07-12T06:48:11.000Z | 2019-12-04T03:14:40.000Z | # coding:utf8
# author:GXR
from app import app
from flask_script import Manager
manage = Manager(app)
if __name__ == '__main__':
# app.run()
manage.run()
| 14.909091 | 32 | 0.689024 |
from app import app
from flask_script import Manager
manage = Manager(app)
if __name__ == '__main__':
manage.run()
| true | true |
f7430c27d12a9ece79f636db2d09cdd0c7596fb3 | 10,247 | py | Python | contrib/python/numpy/numpy/lib/tests/test_type_check.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 195 | 2016-01-14T16:03:02.000Z | 2021-12-29T09:15:02.000Z | contrib/python/numpy/numpy/lib/tests/test_type_check.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 75 | 2016-01-14T16:03:02.000Z | 2020-04-29T22:51:53.000Z | contrib/python/numpy/numpy/lib/tests/test_type_check.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 31 | 2020-05-25T21:14:56.000Z | 2022-03-25T08:57:43.000Z | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.compat import long
from numpy.testing import (
TestCase, assert_, assert_equal, assert_array_equal, run_module_suite
)
from numpy.lib.type_check import (
common_type, mintypecode, isreal, iscomplex, isposinf, isn... | 30.771772 | 73 | 0.585049 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.compat import long
from numpy.testing import (
TestCase, assert_, assert_equal, assert_array_equal, run_module_suite
)
from numpy.lib.type_check import (
common_type, mintypecode, isreal, iscomplex, isposinf, isn... | true | true |
f7430c73eec2b4d9377ee6a3afd104522ca36eb9 | 2,125 | py | Python | graph.py | yusonghust/gcn | 4cacba4bd3d889a2139b19385774b2ee1cde80d4 | [
"MIT"
] | 5 | 2020-08-07T09:52:02.000Z | 2021-02-14T19:58:09.000Z | graph.py | yusonghust/gcn | 4cacba4bd3d889a2139b19385774b2ee1cde80d4 | [
"MIT"
] | null | null | null | graph.py | yusonghust/gcn | 4cacba4bd3d889a2139b19385774b2ee1cde80d4 | [
"MIT"
] | 1 | 2019-05-03T01:47:29.000Z | 2019-05-03T01:47:29.000Z | # -*- coding: utf-8 -*-
import networkx as nx
import numpy as np
from utils import sparse_to_tuple
import scipy.sparse as sp
class Graph():
def __init__(self,edgelist,weighted,directed,labelfile,featurefile):
self.edgelist = edgelist
self.weighted = weighted
self.directed = directed
... | 31.25 | 114 | 0.553412 |
import networkx as nx
import numpy as np
from utils import sparse_to_tuple
import scipy.sparse as sp
class Graph():
def __init__(self,edgelist,weighted,directed,labelfile,featurefile):
self.edgelist = edgelist
self.weighted = weighted
self.directed = directed
self.G = self.build_gr... | true | true |
f7430cc3ff22d93117f7a080874e2abdb7ee6af9 | 12,978 | py | Python | Fuzzy_clustering/ver_tf2/Models_predict_manager.py | joesider9/forecasting_library | db07ff8f0f2693983058d49004f2fc6f8849d197 | [
"Apache-2.0"
] | null | null | null | Fuzzy_clustering/ver_tf2/Models_predict_manager.py | joesider9/forecasting_library | db07ff8f0f2693983058d49004f2fc6f8849d197 | [
"Apache-2.0"
] | null | null | null | Fuzzy_clustering/ver_tf2/Models_predict_manager.py | joesider9/forecasting_library | db07ff8f0f2693983058d49004f2fc6f8849d197 | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
import numpy as np
import pickle
import logging, shutil, glob
import pymongo, joblib
from Fuzzy_clustering.ver_tf2.Clusterer import clusterer
from Fuzzy_clustering.ver_tf2.Cluster_predict_regressors import cluster_predict
from Fuzzy_clustering.ver_tf2.Global_predict_regressor import global... | 43.550336 | 146 | 0.595932 | import os
import pandas as pd
import numpy as np
import pickle
import logging, shutil, glob
import pymongo, joblib
from Fuzzy_clustering.ver_tf2.Clusterer import clusterer
from Fuzzy_clustering.ver_tf2.Cluster_predict_regressors import cluster_predict
from Fuzzy_clustering.ver_tf2.Global_predict_regressor import global... | true | true |
f7430db301573bee60dd83a36551dde242663332 | 70,200 | py | Python | salt/modules/bigip.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | salt/modules/bigip.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | salt/modules/bigip.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
An execution module which can manipulate an f5 bigip via iControl REST
:maturity: develop
:platform: f5_bigip_11.6
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import salt libs
import salt.exceptions
import salt.utils... | 29.4093 | 120 | 0.617521 |
from __future__ import absolute_import, print_function, unicode_literals
import salt.exceptions
import salt.utils.json
from salt.ext import six
try:
import requests
import requests.exceptions
HAS_LIBS = True
except ImportError:
HAS_LIBS = False
__virtualname__ = "bigip"
def __virtual__():... | true | true |
f7430e43ba37764bf91567786576ddcc59c1320c | 10,628 | py | Python | gitfiti.py | VictorCeballos/PixelArt | ede659eb3b4d5c8b555dd90d99fc64e247b698a0 | [
"MIT"
] | null | null | null | gitfiti.py | VictorCeballos/PixelArt | ede659eb3b4d5c8b555dd90d99fc64e247b698a0 | [
"MIT"
] | null | null | null | gitfiti.py | VictorCeballos/PixelArt | ede659eb3b4d5c8b555dd90d99fc64e247b698a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2013 Eric Romano (@gelstudios)
# released under The MIT license (MIT) http://opensource.org/licenses/MIT
#
"""
gitfiti
noun : Carefully crafted graffiti in a GitHub commit history calendar
"""
from datetime import datetime, timedelta
import itertools
import json
import math
try... | 24.773893 | 80 | 0.570568 |
from datetime import datetime, timedelta
import itertools
import json
import math
try:
from urllib.error import HTTPError, URLError
from urllib.request import urlopen
except ImportError:
from urllib2 import HTTPError, URLError, urlopen
try:
raw_input
except NameError:
raw_... | true | true |
f7430ee6fc3b180f1c049a1fbdfbc05ef0a062f1 | 9,377 | py | Python | espnet/nets/pytorch_backend/transducer/transformer_decoder.py | Johnson-Lsx/espnet | 7ca5e4defc824d9facf3a04d03ec707067289633 | [
"Apache-2.0"
] | 1 | 2021-01-27T02:15:53.000Z | 2021-01-27T02:15:53.000Z | espnet/nets/pytorch_backend/transducer/transformer_decoder.py | tory0820/espnet | 01214cff08cdd737bcab93dd62e127169394d073 | [
"Apache-2.0"
] | null | null | null | espnet/nets/pytorch_backend/transducer/transformer_decoder.py | tory0820/espnet | 01214cff08cdd737bcab93dd62e127169394d073 | [
"Apache-2.0"
] | null | null | null | """Decoder definition for transformer-transducer models."""
import torch
from espnet.nets.pytorch_backend.transducer.blocks import build_blocks
from espnet.nets.pytorch_backend.transducer.joint_network import JointNetwork
from espnet.nets.pytorch_backend.transducer.utils import check_state
from espnet.nets.pytorch_ba... | 32.672474 | 88 | 0.577583 |
import torch
from espnet.nets.pytorch_backend.transducer.blocks import build_blocks
from espnet.nets.pytorch_backend.transducer.joint_network import JointNetwork
from espnet.nets.pytorch_backend.transducer.utils import check_state
from espnet.nets.pytorch_backend.transducer.utils import pad_batch_state
from espnet.ne... | true | true |
f7430f6ac609fa063a5c93eb798b63904e75a5c0 | 1,066 | py | Python | sdks/python/test/test_AlertingGithubBugtrackerSettings.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_AlertingGithubBugtrackerSettings.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_AlertingGithubBugtrackerSettings.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 26.65 | 127 | 0.756098 |
from __future__ import absolute_import
import unittest
import appcenter_sdk
from AlertingGithubBugtrackerSettings.clsAlertingGithubBugtrackerSettings import AlertingGithubBugtrackerSettings
from appcenter_sdk.rest import ApiException
class TestAlertingGithubBugtrackerSettings(unittest.TestCase):
def setUp... | true | true |
f7430f77463f25478c9d9971b285c88f8dcd4ba4 | 1,944 | py | Python | tracker_app/models.py | Lindronics/food_tracker_demo | 4de4904d27bf629c6fa1915e52c6a0b0fd1a7775 | [
"MIT"
] | null | null | null | tracker_app/models.py | Lindronics/food_tracker_demo | 4de4904d27bf629c6fa1915e52c6a0b0fd1a7775 | [
"MIT"
] | 2 | 2019-09-17T16:13:53.000Z | 2019-09-19T16:56:54.000Z | tracker_app/models.py | Lindronics/food_tracker_demo | 4de4904d27bf629c6fa1915e52c6a0b0fd1a7775 | [
"MIT"
] | null | null | null | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class Day(models.Model):
""" A day containing logged meals and foods """
date = models.DateField(default=datetime.now)
user = models.ForeignKey(User, null=False, on_delete=models.CASCADE)
class Food(m... | 36 | 98 | 0.719136 | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class Day(models.Model):
date = models.DateField(default=datetime.now)
user = models.ForeignKey(User, null=False, on_delete=models.CASCADE)
class Food(models.Model):
name = models.CharField(null=False... | true | true |
f7430f90cb11341fc2b5ddac9dafba7fab3fdc98 | 2,823 | py | Python | src/waldur_mastermind/support/extension.py | ahti87/waldur-mastermind | 772268e62dfd8eadb387b2ec3789785817a6e621 | [
"MIT"
] | null | null | null | src/waldur_mastermind/support/extension.py | ahti87/waldur-mastermind | 772268e62dfd8eadb387b2ec3789785817a6e621 | [
"MIT"
] | null | null | null | src/waldur_mastermind/support/extension.py | ahti87/waldur-mastermind | 772268e62dfd8eadb387b2ec3789785817a6e621 | [
"MIT"
] | null | null | null | from datetime import timedelta
from waldur_core.core import WaldurExtension
class SupportExtension(WaldurExtension):
class Settings:
WALDUR_SUPPORT = {
# wiki for global options: https://opennode.atlassian.net/wiki/display/WD/Assembly+plugin+configuration
'ENABLED': False,
... | 32.825581 | 115 | 0.536309 | from datetime import timedelta
from waldur_core.core import WaldurExtension
class SupportExtension(WaldurExtension):
class Settings:
WALDUR_SUPPORT = {
'ENABLED': False,
'ACTIVE_BACKEND': 'waldur_mastermind.support.backend.atlassian:ServiceDe... | true | true |
f7430f9bf69f737e29287ec59200f7dbfa4334ff | 15,010 | py | Python | storm_kit/mpc/control/control_utils.py | rgap/storm | 5f477d6fa58c6c1ec8d8e2b57c3b21844cae17ac | [
"MIT"
] | null | null | null | storm_kit/mpc/control/control_utils.py | rgap/storm | 5f477d6fa58c6c1ec8d8e2b57c3b21844cae17ac | [
"MIT"
] | null | null | null | storm_kit/mpc/control/control_utils.py | rgap/storm | 5f477d6fa58c6c1ec8d8e2b57c3b21844cae17ac | [
"MIT"
] | null | null | null | #
# MIT License
#
# Copyright (c) 2020-2021 NVIDIA CORPORATION.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, ... | 36.256039 | 156 | 0.593205 |
import math
import numpy as np
import torch
from torch.distributions.multivariate_normal import MultivariateNormal
import ghalton
def scale_ctrl(ctrl, action_lows, action_highs, squash_fn='clamp'):
if len(ctrl.shape) == 1:
ctrl = ctrl[np.newaxis, :, np.newaxis]
act_half_range = (... | true | true |
f7430fae2d1359d2ad690d68ecdf586f21f846a2 | 162 | gyp | Python | test/arflags/test.gyp | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | test/arflags/test.gyp | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | test/arflags/test.gyp | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | {
'targets': [
{
'target_name': 'lib',
'type': 'static_library',
'sources': ['lib.cc'],
'arflags': ['--nonexistent'],
},
],
}
| 14.727273 | 35 | 0.425926 | {
'targets': [
{
'target_name': 'lib',
'type': 'static_library',
'sources': ['lib.cc'],
'arflags': ['--nonexistent'],
},
],
}
| true | true |
f743105958220e2945864ebb28b273b0a9871361 | 1,451 | py | Python | kitchen/utils.py | honzas83/kitchen | 749953fe28895ed51cd7283800a9bb591c269da2 | [
"BSD-3-Clause"
] | null | null | null | kitchen/utils.py | honzas83/kitchen | 749953fe28895ed51cd7283800a9bb591c269da2 | [
"BSD-3-Clause"
] | null | null | null | kitchen/utils.py | honzas83/kitchen | 749953fe28895ed51cd7283800a9bb591c269da2 | [
"BSD-3-Clause"
] | null | null | null | def iter_ngram(seq, max_order, min_order=None, sent_start=None, sent_end=None):
if min_order > max_order:
raise ValueError("min_order > max_order (%d > %d)" % (min_order, max_order))
if min_order is None:
min_order = max_order
orders = range(min_order, max_order+1)
it = iter(seq)
... | 26.87037 | 95 | 0.556168 | def iter_ngram(seq, max_order, min_order=None, sent_start=None, sent_end=None):
if min_order > max_order:
raise ValueError("min_order > max_order (%d > %d)" % (min_order, max_order))
if min_order is None:
min_order = max_order
orders = range(min_order, max_order+1)
it = iter(seq)
... | true | true |
f74310eb288aa4a10812a969198c8f5e612a86c5 | 35,301 | py | Python | ktrain/vision/data.py | ReluXingZeng/ktrain | bfbf85f7b60c54ee208e8a22d9a1f4067405021e | [
"Apache-2.0"
] | null | null | null | ktrain/vision/data.py | ReluXingZeng/ktrain | bfbf85f7b60c54ee208e8a22d9a1f4067405021e | [
"Apache-2.0"
] | null | null | null | ktrain/vision/data.py | ReluXingZeng/ktrain | bfbf85f7b60c54ee208e8a22d9a1f4067405021e | [
"Apache-2.0"
] | null | null | null | from ..imports import *
from .. import utils as U
from .preprocessor import ImagePreprocessor
def show_image(img_path):
"""
Given file path to image, show it in Jupyter notebook
"""
if not os.path.isfile(img_path):
raise ValueError('%s is not valid file' % (img_path))
img = plt.imread(img_... | 41.481786 | 133 | 0.574148 | from ..imports import *
from .. import utils as U
from .preprocessor import ImagePreprocessor
def show_image(img_path):
if not os.path.isfile(img_path):
raise ValueError('%s is not valid file' % (img_path))
img = plt.imread(img_path)
out = plt.imshow(img)
return out
def show_random_images(im... | true | true |
f74312310267ab696c61e6bc08b2627e2c3f9faf | 13,508 | py | Python | test/functional/bumpfee.py | okoto-xyz/jagaricoin | 44f0606fbaf2ef0d1ee55cb599b142f5e819f8af | [
"MIT"
] | 1 | 2018-11-08T13:03:28.000Z | 2018-11-08T13:03:28.000Z | test/functional/bumpfee.py | jagaricoin-project/jagaricoin | bc65110d5d685cc5eacf6feab820c15556ede23f | [
"MIT"
] | null | null | null | test/functional/bumpfee.py | jagaricoin-project/jagaricoin | bc65110d5d685cc5eacf6feab820c15556ede23f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when
its ... | 44.728477 | 117 | 0.725274 |
from segwit import send_to_witness
from test_framework.test_framework import BitcoinTestFramework, SkipTest
from test_framework import blocktools
from test_framework.mininode import CTransaction
from test_framework.util import *
import io
BIP125_SEQUENCE_NUMBER = 0xfffffffd
WALLET_PASSPHRASE = "test"
WALLET_PA... | true | true |
f7431234baf623b9f506773b736577dbf89072b7 | 346 | py | Python | project/locations/regions/migrations/0003_auto_20201025_1542.py | CODE-Easyy/dash-back | 202df5d46c09b3639a37de6d65189a55e966be25 | [
"MIT"
] | null | null | null | project/locations/regions/migrations/0003_auto_20201025_1542.py | CODE-Easyy/dash-back | 202df5d46c09b3639a37de6d65189a55e966be25 | [
"MIT"
] | null | null | null | project/locations/regions/migrations/0003_auto_20201025_1542.py | CODE-Easyy/dash-back | 202df5d46c09b3639a37de6d65189a55e966be25 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-25 15:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('regions', '0002_auto_20201025_1128'),
]
operations = [
migrations.AlterModelOptions(
name='region',
options={'ordering': ('n... | 19.222222 | 47 | 0.586705 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('regions', '0002_auto_20201025_1128'),
]
operations = [
migrations.AlterModelOptions(
name='region',
options={'ordering': ('name',)},
),
]
| true | true |
f7431421091836e730020010a30b9108b71d91e1 | 5,827 | py | Python | tests/sparse_product/test_clustered_sparse_product_backward_cpu.py | SamuelCahyawijaya/fast-transformers | 6ae8ed4cc50bd037968db4f5062e4d328aae73fe | [
"MIT"
] | 1,171 | 2020-06-30T01:57:19.000Z | 2022-03-31T15:11:25.000Z | tests/sparse_product/test_clustered_sparse_product_backward_cpu.py | SamuelCahyawijaya/fast-transformers | 6ae8ed4cc50bd037968db4f5062e4d328aae73fe | [
"MIT"
] | 105 | 2020-06-30T14:40:56.000Z | 2022-02-08T16:31:45.000Z | tests/sparse_product/test_clustered_sparse_product_backward_cpu.py | SamuelCahyawijaya/fast-transformers | 6ae8ed4cc50bd037968db4f5062e4d328aae73fe | [
"MIT"
] | 127 | 2020-06-26T09:07:48.000Z | 2022-03-25T06:46:37.000Z | #
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>,
# Apoorv Vyas <avyas@idiap.ch>
#
import os
from os import getenv
import time
import unittest
import torch
from torch.nn.init import normal_
from fast_transformers.aggregate impor... | 29.882051 | 94 | 0.544362 |
import os
from os import getenv
import time
import unittest
import torch
from torch.nn.init import normal_
from fast_transformers.aggregate import aggregate, broadcast
from fast_transformers.hashing import compute_hashes
from fast_transformers.clustering.hamming import cluster
from fast_transformers.sparse_prod... | true | true |
f74314e8098b0d5514852ccaed4872a7e5167f06 | 340 | py | Python | easy_crypto/lesson1/task5.py | PeteCoward/teach-python | 2a63ece83151631ab4dcf868c361acdfe4e6c85f | [
"MIT"
] | 1 | 2015-12-19T00:38:46.000Z | 2015-12-19T00:38:46.000Z | easy_crypto/lesson1/task5.py | PeteCoward/teach-python | 2a63ece83151631ab4dcf868c361acdfe4e6c85f | [
"MIT"
] | null | null | null | easy_crypto/lesson1/task5.py | PeteCoward/teach-python | 2a63ece83151631ab4dcf868c361acdfe4e6c85f | [
"MIT"
] | null | null | null | '''
# TASK 5 - Write a function that takes a string and a shift integer and returns the string with each letter shifted
- you can iterate over the letters in a string
- for letter in str:
'''
def get_shifted_string(string, shift):
''' return the input string with each letter shifted shift steps '''
raise ... | 30.909091 | 115 | 0.729412 |
def get_shifted_string(string, shift):
raise NotImplementedError
| true | true |
f74315046473b99da82445b3a17031084d82eef2 | 12,857 | py | Python | cidian/main.py | shinsenryuu/hskhsk.com | e3a7cf999711058ed6a1d1db3588fc3c1fa0a536 | [
"MIT"
] | 1 | 2020-08-29T09:40:43.000Z | 2020-08-29T09:40:43.000Z | cidian/main.py | shinsenryuu/hskhsk.com | e3a7cf999711058ed6a1d1db3588fc3c1fa0a536 | [
"MIT"
] | null | null | null | cidian/main.py | shinsenryuu/hskhsk.com | e3a7cf999711058ed6a1d1db3588fc3c1fa0a536 | [
"MIT"
] | null | null | null | # coding: utf-8
# https://hskhsk.pythonanywhere.com
# Alan Davies alan@hskhsk.com
import sys
import threading
import time
from flask import Flask, render_template
from pages.cidian import cidian_page
from pages.deprecated import frequency_order_word_link, frequency_order_char_link
from pages.flashcards import flashca... | 34.194149 | 115 | 0.677685 |
import sys
import threading
import time
from flask import Flask, render_template
from pages.cidian import cidian_page
from pages.deprecated import frequency_order_word_link, frequency_order_char_link
from pages.flashcards import flashcards_download
from pages.mandarin_comp import mandarin_companion_page
from page... | true | true |
f74315ae5e4a1b5308db9737c3371fe7d95c63ce | 6,935 | py | Python | cscreendataset.py | caitsithx/dogs-vs-cats-redux | 3ff588cac9048a3c9f5a76de842a9cd2a4140218 | [
"Apache-2.0"
] | null | null | null | cscreendataset.py | caitsithx/dogs-vs-cats-redux | 3ff588cac9048a3c9f5a76de842a9cd2a4140218 | [
"Apache-2.0"
] | null | null | null | cscreendataset.py | caitsithx/dogs-vs-cats-redux | 3ff588cac9048a3c9f5a76de842a9cd2a4140218 | [
"Apache-2.0"
] | null | null | null | import os
import random
import numpy as np
import pandas as pd
import torch
import torch.utils.data as data
from PIL import Image
from torchvision import transforms
import settings
# import transforms
DATA_DIR = settings.DATA_DIR
TRAIN_DIR = DATA_DIR + '/train-640'
TEST_DIR = DATA_DIR + '/test-640'
def pil_load(i... | 32.106481 | 79 | 0.58832 | import os
import random
import numpy as np
import pandas as pd
import torch
import torch.utils.data as data
from PIL import Image
from torchvision import transforms
import settings
DATA_DIR = settings.DATA_DIR
TRAIN_DIR = DATA_DIR + '/train-640'
TEST_DIR = DATA_DIR + '/test-640'
def pil_load(img_path):
with ... | true | true |
f7431688073790c3495dcaf55c51247391d2987e | 9,302 | py | Python | detectron2/layers/batch_norm.py | akashAD98/detectron2 | 295fbb8b96eda271869fc6955280d16596781766 | [
"Apache-2.0"
] | null | null | null | detectron2/layers/batch_norm.py | akashAD98/detectron2 | 295fbb8b96eda271869fc6955280d16596781766 | [
"Apache-2.0"
] | null | null | null | detectron2/layers/batch_norm.py | akashAD98/detectron2 | 295fbb8b96eda271869fc6955280d16596781766 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import torch
import torch.distributed as dist
from fvcore.nn.distributed import differentiable_all_reduce
from torch import nn
from torch.nn import functional as F
from ..utils import comm, env
from .wrappers import BatchNorm2d
class FrozenBatchNorm2d(nn.Module):
... | 40.798246 | 99 | 0.622447 |
import torch
import torch.distributed as dist
from fvcore.nn.distributed import differentiable_all_reduce
from torch import nn
from torch.nn import functional as F
from ..utils import comm, env
from .wrappers import BatchNorm2d
class FrozenBatchNorm2d(nn.Module):
_version = 3
def __init__(self, num_featu... | true | true |
f74316dabe4491b9ebf030b1f937a7743de41c4d | 3,328 | py | Python | rhea/system/memmap/axi4.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | 1 | 2022-03-16T23:56:09.000Z | 2022-03-16T23:56:09.000Z | rhea/system/memmap/axi4.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | null | null | null | rhea/system/memmap/axi4.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
from math import log, ceil
from myhdl import Signal, intbv, always_seq
from . import MemoryMapped
class AXI4Lite(MemoryMapped):
def __init__(self, glbl, data_width=8, address_width=16):
"""
"""
super(AXI4Lite, self).__init__(glbl,
... | 29.714286 | 68 | 0.512921 |
from __future__ import absolute_import
from math import log, ceil
from myhdl import Signal, intbv, always_seq
from . import MemoryMapped
class AXI4Lite(MemoryMapped):
def __init__(self, glbl, data_width=8, address_width=16):
super(AXI4Lite, self).__init__(glbl,
d... | true | true |
f7431770fe49bd7e199f466d3eff353673ba1745 | 1,643 | py | Python | bakerydemo/locations/migrations/0003_auto_20170329_0055.py | lolautruche/bakerydemo | 3c418fc1f2f2831872865668fdbb96942efbf107 | [
"BSD-3-Clause"
] | 594 | 2017-02-09T17:11:27.000Z | 2022-03-24T13:56:38.000Z | bakerydemo/locations/migrations/0003_auto_20170329_0055.py | lolautruche/bakerydemo | 3c418fc1f2f2831872865668fdbb96942efbf107 | [
"BSD-3-Clause"
] | 259 | 2017-02-10T16:25:04.000Z | 2022-03-30T13:49:18.000Z | bakerydemo/locations/migrations/0003_auto_20170329_0055.py | lolautruche/bakerydemo | 3c418fc1f2f2831872865668fdbb96942efbf107 | [
"BSD-3-Clause"
] | 391 | 2017-02-17T14:09:54.000Z | 2022-03-26T16:58:43.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-29 00:55
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = ... | 65.72 | 1,120 | 0.716981 |
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('locations', '0002_remove_locationsindexpage_body'),
]
... | true | true |
f74317f78bef66c71ecf8b843045e4f5b2c8153b | 5,580 | py | Python | otri/utils/key_handler.py | OTRI-Unipd/OTRI | 5d1fce470eeb31f5cc75cadfc06d9d2908736052 | [
"FSFAP"
] | null | null | null | otri/utils/key_handler.py | OTRI-Unipd/OTRI | 5d1fce470eeb31f5cc75cadfc06d9d2908736052 | [
"FSFAP"
] | 34 | 2020-04-18T13:57:05.000Z | 2021-10-05T16:21:56.000Z | otri/utils/key_handler.py | OTRI-Unipd/OTRI | 5d1fce470eeb31f5cc75cadfc06d9d2908736052 | [
"FSFAP"
] | null | null | null | from typing import *
import re
LOWER_ERROR = "Only dictionaries and lists can be modified by this method."
def apply_deep(data: Union[Mapping, List], fun: Callable) -> Union[dict, list]:
'''
Applies fun to all keys in data.
The method is recursive and applies as deep as possible in the dictionary nest.
... | 41.641791 | 109 | 0.655018 | from typing import *
import re
LOWER_ERROR = "Only dictionaries and lists can be modified by this method."
def apply_deep(data: Union[Mapping, List], fun: Callable) -> Union[dict, list]:
if isinstance(data, Mapping):
return __apply_deep_dict(data, fun)
if isinstance(data, List):
return __appl... | true | true |
f743182522dfc832e5d4b9154453c52d23ea516b | 309 | py | Python | src/python/helloworld/helloworld.py | IndraniDey1/path-to-kubernetes | 0d66d7d1b149766eaf4a84a150da1280e6219eba | [
"Apache-2.0"
] | null | null | null | src/python/helloworld/helloworld.py | IndraniDey1/path-to-kubernetes | 0d66d7d1b149766eaf4a84a150da1280e6219eba | [
"Apache-2.0"
] | null | null | null | src/python/helloworld/helloworld.py | IndraniDey1/path-to-kubernetes | 0d66d7d1b149766eaf4a84a150da1280e6219eba | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class Greeting (Resource):
def get(self):
return 'Hello Python World! from Indrani'
api.add_resource(Greeting, '/') # Route_1
if __name__ == '__main__':
app.run('0.0.0.0','3333')
| 20.6 | 49 | 0.686084 | from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class Greeting (Resource):
def get(self):
return 'Hello Python World! from Indrani'
api.add_resource(Greeting, '/')
if __name__ == '__main__':
app.run('0.0.0.0','3333')
| true | true |
f743182e17627dbb55626b12e7c0d88c7014e098 | 5,899 | py | Python | vulcan/data/_attendance.py | v0idzz/vulcan-api | 1ae83d90236e678042a9f85f6c34b6bd82bf279f | [
"MIT"
] | 49 | 2019-01-10T22:10:19.000Z | 2022-01-10T17:07:51.000Z | vulcan/data/_attendance.py | Antoni-Czaplicki/vulcan-api | a1d9127ce156013a7a803f31b55591989f05ba5a | [
"MIT"
] | 47 | 2019-01-08T21:04:17.000Z | 2022-03-21T04:02:37.000Z | vulcan/data/_attendance.py | Antoni-Czaplicki/vulcan-api | a1d9127ce156013a7a803f31b55591989f05ba5a | [
"MIT"
] | 31 | 2019-05-04T14:05:33.000Z | 2021-11-01T18:51:16.000Z | # -*- coding: utf-8 -*-
import datetime
from typing import AsyncIterator, List, Union
from related import BooleanField, ChildField, IntegerField, StringField, immutable
from .._api_helper import FilterType
from .._endpoints import DATA_ATTENDANCE
from ..model import (
DateTime,
Serializable,
Subject,
... | 41.542254 | 115 | 0.69266 |
import datetime
from typing import AsyncIterator, List, Union
from related import BooleanField, ChildField, IntegerField, StringField, immutable
from .._api_helper import FilterType
from .._endpoints import DATA_ATTENDANCE
from ..model import (
DateTime,
Serializable,
Subject,
Teacher,
TeamClass,... | true | true |
f743184d4cd39627c28af619a4d006b1a7433638 | 4,530 | py | Python | {{cookiecutter.project_slug}}/config/settings/base.py | erickgnavar/django_template | bdaa361151296da5670f7698f2ee146edf9dc867 | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/config/settings/base.py | erickgnavar/django_template | bdaa361151296da5670f7698f2ee146edf9dc867 | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/config/settings/base.py | erickgnavar/django_template | bdaa361151296da5670f7698f2ee146edf9dc867 | [
"MIT"
] | null | null | null | """
Django settings for {{cookiecutter.project_name}} project.
Generated by 'django-admin startproject' using Django 3.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/setti... | 29.607843 | 91 | 0.726049 |
import os
import dj_database_url
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
SECRET_KEY = os.environ.get("SECRET_KEY")
DEBUG = False
ALLOWED_HOSTS = os.environ.get("ALLOWED... | true | true |
f74318548a5814b6df0672043323526891ac8930 | 13,843 | py | Python | src/psiopic2/app/setupwiki.py | psiopic2/psiopic2 | c2be97701f023f4396bb5d15e14e1ecc7a71d16b | [
"MIT"
] | null | null | null | src/psiopic2/app/setupwiki.py | psiopic2/psiopic2 | c2be97701f023f4396bb5d15e14e1ecc7a71d16b | [
"MIT"
] | null | null | null | src/psiopic2/app/setupwiki.py | psiopic2/psiopic2 | c2be97701f023f4396bb5d15e14e1ecc7a71d16b | [
"MIT"
] | null | null | null | from docopt import docopt
from appdirs import AppDirs
try:
from urlparse import urlparse
except ImportError:
from urllib import parse as urlparse
import sys
import os
import shutil
import time
import logging
from psiopic2.app.baseApp import Arg, BaseApp
from psiopic2.app.baseApp import BASE_OPTIONS
from psiopic2... | 30.694013 | 143 | 0.656072 | from docopt import docopt
from appdirs import AppDirs
try:
from urlparse import urlparse
except ImportError:
from urllib import parse as urlparse
import sys
import os
import shutil
import time
import logging
from psiopic2.app.baseApp import Arg, BaseApp
from psiopic2.app.baseApp import BASE_OPTIONS
from psiopic2... | true | true |
f743191f49187c7847d3df24481953e56291e1c9 | 564 | py | Python | var/spack/repos/builtin/packages/sicm/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/sicm/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/sicm/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Sicm(CMakePackage):
"""SICM: Simplified Interface to Complex Memory."""
homepage = "h... | 23.5 | 73 | 0.684397 |
from spack import *
class Sicm(CMakePackage):
homepage = "https://github.com/lanl/SICM/"
git = "https://github.com/lanl/SICM.git"
maintainers = []
version('master')
depends_on('jemalloc jemalloc_prefix=je_')
depends_on('numactl')
def cmake_args(self):
return []
| true | true |
f74319565acdb80270904b0757ec157e4c8fc5ca | 127,029 | py | Python | cinder/tests/unit/volume/drivers/test_pure.py | ilay09/cinder | 86f084d42f18bd5971cc7a0df3e6d815543a472d | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/test_pure.py | ilay09/cinder | 86f084d42f18bd5971cc7a0df3e6d815543a472d | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/test_pure.py | ilay09/cinder | 86f084d42f18bd5971cc7a0df3e6d815543a472d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Pure Storage, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 42.785113 | 79 | 0.632848 |
from copy import deepcopy
import sys
import ddt
import mock
from oslo_utils import units
from six.moves import http_client
from cinder import exception
from cinder import test
from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit import fake_group
from cinder.tests.unit import fak... | true | true |
f7431a6db42d8d3cf57ebead99bf4c7181948bf5 | 62,435 | py | Python | build/lib.macosx-10.9-x86_64-3.9/mediapipe/util/tracking/tracking_pb2.py | hanggaoh/mediapipe | 9eafb85cd7daa8986be7e4cc8af2f256f6f83451 | [
"Apache-2.0"
] | 2 | 2021-08-11T15:50:12.000Z | 2021-09-03T17:53:47.000Z | build/lib.macosx-10.9-x86_64-3.9/mediapipe/util/tracking/tracking_pb2.py | hanggaoh/mediapipe | 9eafb85cd7daa8986be7e4cc8af2f256f6f83451 | [
"Apache-2.0"
] | 1 | 2022-01-20T11:17:50.000Z | 2022-01-20T11:17:50.000Z | build/lib.macosx-10.9-x86_64-3.9/mediapipe/util/tracking/tracking_pb2.py | hanggaoh/mediapipe | 9eafb85cd7daa8986be7e4cc8af2f256f6f83451 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/util/tracking/tracking.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refle... | 58.07907 | 6,720 | 0.767807 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from mediapipe.util.tracking import motion_models_pb2 as... | true | true |
f7431b3ed269fa444ae972447d0e3adc072c4510 | 882 | py | Python | private/TrainingHelperServices/operations/onehot.py | microsoft/MaskedLARk | 19da4d6f15be8bab7ca22d695cab37dae2e03c2c | [
"MIT"
] | null | null | null | private/TrainingHelperServices/operations/onehot.py | microsoft/MaskedLARk | 19da4d6f15be8bab7ca22d695cab37dae2e03c2c | [
"MIT"
] | null | null | null | private/TrainingHelperServices/operations/onehot.py | microsoft/MaskedLARk | 19da4d6f15be8bab7ca22d695cab37dae2e03c2c | [
"MIT"
] | null | null | null | from torch.nn.functional import one_hot
from operations.base import Operator
class OneHot(Operator):
def __init__(self, dim=-1, non_zero_values_only=False):
self.dim = dim
self.non_zero_values_only = non_zero_values_only
super().__init__()
def forward(self, indices, depth, values):
... | 32.666667 | 74 | 0.603175 | from torch.nn.functional import one_hot
from operations.base import Operator
class OneHot(Operator):
def __init__(self, dim=-1, non_zero_values_only=False):
self.dim = dim
self.non_zero_values_only = non_zero_values_only
super().__init__()
def forward(self, indices, depth, values):
... | true | true |
f7431b5b73d65fc8cf54c6c55d870a1b03068c14 | 7,999 | py | Python | stai/daemon/keychain_server.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 10 | 2021-10-02T18:33:56.000Z | 2021-11-14T17:10:48.000Z | stai/daemon/keychain_server.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 14 | 2021-10-07T22:10:15.000Z | 2021-12-21T09:13:49.000Z | stai/daemon/keychain_server.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 6 | 2021-10-29T19:36:59.000Z | 2021-12-19T19:52:57.000Z | import logging
from blspy import PrivateKey
from stai.cmds.init_funcs import check_keys
from stai.util.keychain import Keychain
from pathlib import Path
from typing import Any, Dict, List, Optional, cast
# Commands that are handled by the KeychainServer
keychain_commands = [
"add_private_key",
"check_keys",
... | 40.39899 | 106 | 0.623203 | import logging
from blspy import PrivateKey
from stai.cmds.init_funcs import check_keys
from stai.util.keychain import Keychain
from pathlib import Path
from typing import Any, Dict, List, Optional, cast
keychain_commands = [
"add_private_key",
"check_keys",
"delete_all_keys",
"delete_key_by_fingerpr... | true | true |
f7431de137a7ef15d0a2e670889ed07a5ee04385 | 23,244 | py | Python | Python/libraries/recognizers-number/recognizers_number/number/parsers.py | vikhhr/Recognizers-Text | 91c949936535ce558f3f91b4e21d37013b83de4c | [
"MIT"
] | 688 | 2019-05-08T02:56:21.000Z | 2022-03-30T07:26:15.000Z | Python/libraries/recognizers-number/recognizers_number/number/parsers.py | vikhhr/Recognizers-Text | 91c949936535ce558f3f91b4e21d37013b83de4c | [
"MIT"
] | 840 | 2019-05-07T07:00:02.000Z | 2022-03-30T14:52:11.000Z | Python/libraries/recognizers-number/recognizers_number/number/parsers.py | vikhhr/Recognizers-Text | 91c949936535ce558f3f91b4e21d37013b83de4c | [
"MIT"
] | 283 | 2019-05-07T07:52:12.000Z | 2022-03-27T02:27:58.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from abc import ABC, abstractmethod
from typing import Dict, Pattern, Optional, List
from decimal import Decimal, getcontext
import regex
from recognizers_text.utilities import RegExpUtility
from recognizers_text.extractor ... | 37.980392 | 189 | 0.5635 |
from abc import ABC, abstractmethod
from typing import Dict, Pattern, Optional, List
from decimal import Decimal, getcontext
import regex
from recognizers_text.utilities import RegExpUtility
from recognizers_text.extractor import ExtractResult
from recognizers_text.parser import Parser, ParseResult
from recognizers_... | true | true |
f7431f032191310dc4aa0bc6985dc7309b3979e4 | 610 | py | Python | app/forms.py | othienoJoe/The-Neighbourhood | ae7fd7d387cc401dbbe132c0daf8af21bfe0420a | [
"Unlicense"
] | null | null | null | app/forms.py | othienoJoe/The-Neighbourhood | ae7fd7d387cc401dbbe132c0daf8af21bfe0420a | [
"Unlicense"
] | null | null | null | app/forms.py | othienoJoe/The-Neighbourhood | ae7fd7d387cc401dbbe132c0daf8af21bfe0420a | [
"Unlicense"
] | null | null | null | from django import forms
from .models import *
class ProfileForm(forms.ModelForm):
class Meta:
model=Profile
exclude=['username']
class BlogPostForm(forms.ModelForm):
class Meta:
model=BlogPost
exclude=['username','neighborhood','profpic']
class CommentForm(forms.ModelForm):
class Meta:
... | 21.785714 | 48 | 0.7 | from django import forms
from .models import *
class ProfileForm(forms.ModelForm):
class Meta:
model=Profile
exclude=['username']
class BlogPostForm(forms.ModelForm):
class Meta:
model=BlogPost
exclude=['username','neighborhood','profpic']
class CommentForm(forms.ModelForm):
class Meta:
... | true | true |
f7431f3be35f5686791705885ab6ed65a46786d0 | 6,380 | py | Python | custom_components/yandex_smart_home/capability_toggle.py | avbor/HomeAssistantConf | 1f0fe16c8e3f3dcea7cc350f3fb9c233b6a22614 | [
"Unlicense"
] | 35 | 2021-02-25T06:30:42.000Z | 2022-03-09T20:18:47.000Z | custom_components/yandex_smart_home/capability_toggle.py | avbor/HomeAssistantConf | 1f0fe16c8e3f3dcea7cc350f3fb9c233b6a22614 | [
"Unlicense"
] | 1 | 2021-02-09T07:44:33.000Z | 2021-02-22T04:41:32.000Z | custom_components/yandex_smart_home/capability_toggle.py | avbor/HomeAssistantConf | 1f0fe16c8e3f3dcea7cc350f3fb9c233b6a22614 | [
"Unlicense"
] | 19 | 2021-02-20T05:29:58.000Z | 2022-02-05T16:22:30.000Z | """Implement the Yandex Smart Home toggles capabilities."""
from __future__ import annotations
from abc import ABC
import logging
from typing import Any
from homeassistant.components import cover, fan, media_player, vacuum
from homeassistant.const import ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES
from homeassistant.core... | 32.060302 | 105 | 0.655172 | from __future__ import annotations
from abc import ABC
import logging
from typing import Any
from homeassistant.components import cover, fan, media_player, vacuum
from homeassistant.const import ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES
from homeassistant.core import HomeAssistant, State
from . import const
from .capa... | true | true |
f7431fe99b2a70959e161d6c3b2cc3fc712af2b6 | 5,321 | py | Python | CryptoOps.py | TonyZTan/PasswordVault | 0edb84e76e30405e65ba7b653bab3a6bb9c5228a | [
"MIT"
] | 1 | 2021-03-14T05:14:43.000Z | 2021-03-14T05:14:43.000Z | CryptoOps.py | tonyztan/PasswordVault | 0edb84e76e30405e65ba7b653bab3a6bb9c5228a | [
"MIT"
] | null | null | null | CryptoOps.py | tonyztan/PasswordVault | 0edb84e76e30405e65ba7b653bab3a6bb9c5228a | [
"MIT"
] | null | null | null | """
Responsible for cryptographic operations.
"""
# PyCrypto needs to be installed for Crypto to work
import tkMessageBox
from Crypto.Cipher import AES
from Crypto import Random
import hashlib
import base64
# Pads data
def pad(data):
BS = 16 # Block Size
r = data + (BS - len(data) % BS) * chr(BS - len(data) ... | 33.677215 | 95 | 0.62507 |
import tkMessageBox
from Crypto.Cipher import AES
from Crypto import Random
import hashlib
import base64
def pad(data):
BS = 16
r = data + (BS - len(data) % BS) * chr(BS - len(data) % BS)
return r
def unpad(data):
r = data[0:-ord(data[-1])]
return r
def encrypt(plaintext, key):
plain... | true | true |
f74320ae44c35f1d98ff3cb548b025593287ad97 | 1,934 | py | Python | app/models.py | Garlinsk/Blog | 3c688bf5cbb8903be3d13c631782d83351e20007 | [
"MIT"
] | null | null | null | app/models.py | Garlinsk/Blog | 3c688bf5cbb8903be3d13c631782d83351e20007 | [
"MIT"
] | null | null | null | app/models.py | Garlinsk/Blog | 3c688bf5cbb8903be3d13c631782d83351e20007 | [
"MIT"
] | null | null | null | from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from . import login_manager
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(UserMixin, db.Model):
__tab... | 28.441176 | 75 | 0.688211 | from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from . import login_manager
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(UserMixin, db.Model):
__tab... | true | true |
f7432162cbab20deffad83064eb67a4176dde8d1 | 40,089 | py | Python | tensorflow/contrib/distribute/python/mirrored_strategy.py | DeuroIO/Deuro-tensorflow | 7d0fa4948a6232976c4828ef9041f92993503fd5 | [
"Apache-2.0"
] | 5 | 2018-07-04T22:14:02.000Z | 2018-07-04T22:21:43.000Z | tensorflow/contrib/distribute/python/mirrored_strategy.py | DeuroIO/Deuro-tensorflow | 7d0fa4948a6232976c4828ef9041f92993503fd5 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distribute/python/mirrored_strategy.py | DeuroIO/Deuro-tensorflow | 7d0fa4948a6232976c4828ef9041f92993503fd5 | [
"Apache-2.0"
] | 1 | 2018-11-30T01:35:01.000Z | 2018-11-30T01:35:01.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.287975 | 118 | 0.697872 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
from functools import partial
import threading
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.distribute import cross_device_ops as cross_device_ops_lib... | true | true |
f743235272ebb51bb7c8d443f94599c29d97bb48 | 1,490 | py | Python | PyPoll/main_p.py | mtbulut/python-challenge | 6b0dcd512e3e48688841d8806ec6e5a716f26294 | [
"ADSL"
] | null | null | null | PyPoll/main_p.py | mtbulut/python-challenge | 6b0dcd512e3e48688841d8806ec6e5a716f26294 | [
"ADSL"
] | null | null | null | PyPoll/main_p.py | mtbulut/python-challenge | 6b0dcd512e3e48688841d8806ec6e5a716f26294 | [
"ADSL"
] | null | null | null | import os
import csv
import pprint
import math
import decimal
with open(os.path.join("Resources","election_data.csv"), "r") as in_file:
in_csv = csv.reader(in_file)
header = next(in_csv) # activating this will exculede the firs line.
data = list(in_csv)
# print(data)
################################... | 21.911765 | 80 | 0.447651 | import os
import csv
import pprint
import math
import decimal
with open(os.path.join("Resources","election_data.csv"), "r") as in_file:
in_csv = csv.reader(in_file)
header = next(in_csv)
data = list(in_csv)
| true | true |
f74323e78085c47ea0703447ca76d035859540e1 | 2,921 | py | Python | attacks/wilcoxon.py | joeybose/Adversarial-Example-Games | 4219137e5263cd7de86687ed74cc1cef7497bb78 | [
"MIT"
] | 17 | 2020-10-21T20:29:10.000Z | 2022-02-04T23:15:02.000Z | attacks/wilcoxon.py | joeybose/Adversarial-Example-Games | 4219137e5263cd7de86687ed74cc1cef7497bb78 | [
"MIT"
] | 2 | 2021-04-14T05:32:44.000Z | 2022-03-05T05:37:20.000Z | attacks/wilcoxon.py | joeybose/Adversarial-Example-Games | 4219137e5263cd7de86687ed74cc1cef7497bb78 | [
"MIT"
] | 4 | 2020-11-28T02:51:33.000Z | 2022-03-04T03:57:45.000Z | import numpy as np
import ipdb
from scipy.stats import wilcoxon, ttest_rel
# MNIST
mi_attack = [90.000000, 87.575768, 81.515160, 90.909088, 84.848480, 88.787872,
89.090904]
di_attack = [90.606056, 90.000000, 85.454552, 91.818176, 88.484856, 89.696968,
0.606071]
tid_attack = [90.000000, 83.939... | 44.257576 | 94 | 0.667237 | import numpy as np
import ipdb
from scipy.stats import wilcoxon, ttest_rel
mi_attack = [90.000000, 87.575768, 81.515160, 90.909088, 84.848480, 88.787872,
89.090904]
di_attack = [90.606056, 90.000000, 85.454552, 91.818176, 88.484856, 89.696968,
0.606071]
tid_attack = [90.000000, 83.939400, 84... | true | true |
f74323f277fdc1344eb7aa18edb6a0697ec37363 | 1,706 | py | Python | profiles_api/migrations/0001_initial.py | Mrfad/profiles-rest-api | 8ea83e596e348cd9905d8ec751eff88db8ccc25f | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | Mrfad/profiles-rest-api | 8ea83e596e348cd9905d8ec751eff88db8ccc25f | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | Mrfad/profiles-rest-api | 8ea83e596e348cd9905d8ec751eff88db8ccc25f | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2021-03-21 19:39
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... | 50.176471 | 266 | 0.638921 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.Au... | true | true |
f74327106c583d08cfb1cd13e0bec626ae5b2d12 | 1,472 | py | Python | scream/commands/deploy.py | r-kells/scream | 3f5d325cd05a0f3eccc4b579b4929be49029ab09 | [
"MIT"
] | 26 | 2018-11-29T13:33:25.000Z | 2021-11-22T18:45:19.000Z | scream/commands/deploy.py | r-kells/scream | 3f5d325cd05a0f3eccc4b579b4929be49029ab09 | [
"MIT"
] | 14 | 2019-01-20T00:07:13.000Z | 2020-07-15T13:19:29.000Z | scream/commands/deploy.py | r-kells/scream | 3f5d325cd05a0f3eccc4b579b4929be49029ab09 | [
"MIT"
] | 2 | 2019-02-25T17:31:47.000Z | 2020-01-22T22:10:41.000Z | import subprocess
import sys
from scream import detect_changed_packages
from scream.package import Package, PackageDoesNotExistException
from .install import install
def deploy_packages(all_packages=None, package_name=None):
"""
Run a deploy script.
For packages that have changed or if your dependencies ... | 35.047619 | 115 | 0.650815 | import subprocess
import sys
from scream import detect_changed_packages
from scream.package import Package, PackageDoesNotExistException
from .install import install
def deploy_packages(all_packages=None, package_name=None):
if package_name is None:
if all_packages is None:
raise Exception(
... | true | true |
f7432744340a930c7448b2c201aaa795526853b0 | 2,244 | py | Python | readers/readers.py | patozavala/spectrareader | ebd77ca568726936832e909c2f38c7b35fb35134 | [
"MIT"
] | 1 | 2021-04-30T23:35:52.000Z | 2021-04-30T23:35:52.000Z | readers/readers.py | patozavala/widespectrum | ebd77ca568726936832e909c2f38c7b35fb35134 | [
"MIT"
] | null | null | null | readers/readers.py | patozavala/widespectrum | ebd77ca568726936832e909c2f38c7b35fb35134 | [
"MIT"
] | null | null | null | import os
import glob
import pandas as pd
class BaseReader():
"""
Implements several verifications and utilities for handling spectral files.
"""
def __init__(self):
pass
def check_file_if_exists(self,filepath):
"""
Verifies that a required file exists.
"""
... | 27.703704 | 159 | 0.584225 | import os
import glob
import pandas as pd
class BaseReader():
def __init__(self):
pass
def check_file_if_exists(self,filepath):
try:
f = open(filepath)
f.close()
except:
raise Exception (filepath + ' does not exists.')
def check_file_is... | true | true |
f7432772ce2b654622a496807b5b06a8a963864f | 15,438 | py | Python | codenets/codesearchnet/query_code_ast/dataset.py | mandubian/codenets | 63be72b706d57dbfb2ecec94adc203fc7bdfa3cf | [
"Apache-2.0"
] | 19 | 2020-02-12T22:01:13.000Z | 2021-06-13T21:50:51.000Z | codenets/codesearchnet/query_code_ast/dataset.py | Tubbz-alt/codenets | 63be72b706d57dbfb2ecec94adc203fc7bdfa3cf | [
"Apache-2.0"
] | 1 | 2020-06-28T06:50:19.000Z | 2020-08-12T14:03:25.000Z | codenets/codesearchnet/query_code_ast/dataset.py | Tubbz-alt/codenets | 63be72b706d57dbfb2ecec94adc203fc7bdfa3cf | [
"Apache-2.0"
] | 1 | 2020-12-15T16:52:42.000Z | 2020-12-15T16:52:42.000Z | import os
import sys
from typing import Iterable, Union, Dict, Tuple, List, Callable, TypeVar, Optional, Any, cast
import numpy as np
from pathlib import Path
from loguru import logger
from pathos.pools import ProcessPool
import itertools
import pickle
import random
from dpu_utils.codeutils import split_identifier_into... | 40.413613 | 120 | 0.686164 | import os
import sys
from typing import Iterable, Union, Dict, Tuple, List, Callable, TypeVar, Optional, Any, cast
import numpy as np
from pathlib import Path
from loguru import logger
from pathos.pools import ProcessPool
import itertools
import pickle
import random
from dpu_utils.codeutils import split_identifier_into... | true | true |
f7432786ece7ea6bf1ebe397e560324c357b1756 | 9,151 | py | Python | src/ramp_to_hill/hill_system.py | will-duncan/ramp_systems | 7db1964af6bdb26ee4fed25131a12f9294c4cc1d | [
"MIT"
] | null | null | null | src/ramp_to_hill/hill_system.py | will-duncan/ramp_systems | 7db1964af6bdb26ee4fed25131a12f9294c4cc1d | [
"MIT"
] | null | null | null | src/ramp_to_hill/hill_system.py | will-duncan/ramp_systems | 7db1964af6bdb26ee4fed25131a12f9294c4cc1d | [
"MIT"
] | null | null | null | import numpy as np
from scipy.integrate import solve_ivp
def HS_ode(t,y,HS):
rhs = -HS.gamma*y + HS.lambda_value(y)
return rhs
def at_HS_equilibrium(t,y,HS,tol = 1e-3):
val = np.linalg.norm(HS_ode(t,y,HS)) - tol
if val < 0:
return 0
else:
return val
def simulate_HS(x0,HS,max_time... | 32.108772 | 112 | 0.581904 | import numpy as np
from scipy.integrate import solve_ivp
def HS_ode(t,y,HS):
rhs = -HS.gamma*y + HS.lambda_value(y)
return rhs
def at_HS_equilibrium(t,y,HS,tol = 1e-3):
val = np.linalg.norm(HS_ode(t,y,HS)) - tol
if val < 0:
return 0
else:
return val
def simulate_HS(x0,HS,max_time... | true | true |
f74329187a47c01bdd3f0ec7b8f2da16fa8b1ce9 | 320 | py | Python | src/expression_evaluator/operators/basic/concatenate.py | Xett/expression_evaluator | eca895d79f015843a262e9636b86c6dd3d06a69d | [
"MIT"
] | null | null | null | src/expression_evaluator/operators/basic/concatenate.py | Xett/expression_evaluator | eca895d79f015843a262e9636b86c6dd3d06a69d | [
"MIT"
] | null | null | null | src/expression_evaluator/operators/basic/concatenate.py | Xett/expression_evaluator | eca895d79f015843a262e9636b86c6dd3d06a69d | [
"MIT"
] | null | null | null | from expression_evaluator.token import *
class Concatenate(BasicOperator):
symbols = ['||']
priority = PriorityLevel.String
@classmethod
def _function(cls, a, b,*args):
result=u'{0}{1}'.format(a, b)
for arg in args:
result=u'{0}{1}'.format(result, arg)
return result | 26.666667 | 48 | 0.609375 | from expression_evaluator.token import *
class Concatenate(BasicOperator):
symbols = ['||']
priority = PriorityLevel.String
@classmethod
def _function(cls, a, b,*args):
result=u'{0}{1}'.format(a, b)
for arg in args:
result=u'{0}{1}'.format(result, arg)
return result | true | true |
f74329576bef15b05ebecc16ec4831e26b73caa7 | 1,264 | py | Python | tests/data23/recipe-511429.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-06-05T08:53:26.000Z | 2020-06-05T08:53:26.000Z | tests/data23/recipe-511429.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-06-04T13:47:19.000Z | 2020-06-04T13:47:57.000Z | tests/data23/recipe-511429.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-11-07T17:02:46.000Z | 2020-11-07T17:02:46.000Z | import os
def main():
try:
while True:
while True:
mode = input('Mode: ').lower()
if 'search'.startswith(mode):
mode = False
break
elif 'destroy'.startswith(mode):
mode = True
... | 30.095238 | 66 | 0.482595 | import os
def main():
try:
while True:
while True:
mode = input('Mode: ').lower()
if 'search'.startswith(mode):
mode = False
break
elif 'destroy'.startswith(mode):
mode = True
... | true | true |
f74329ddc8a2702d31098c65111aa2dbd4a95103 | 2,963 | py | Python | spug_api/spug/settings.py | k8stech/spug | a5a763de98129f136aa9c9f327265aaf465078d0 | [
"MIT"
] | 2 | 2021-04-10T00:13:09.000Z | 2022-03-12T17:00:54.000Z | spug_api/spug/settings.py | k8stech/spug | a5a763de98129f136aa9c9f327265aaf465078d0 | [
"MIT"
] | null | null | null | spug_api/spug/settings.py | k8stech/spug | a5a763de98129f136aa9c9f327265aaf465078d0 | [
"MIT"
] | 1 | 2021-04-09T16:14:05.000Z | 2021-04-09T16:14:05.000Z | """
# Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
# Copyright: (c) <spug.dev@gmail.com>
# Released under the MIT License.
Django settings for spug project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/... | 22.618321 | 72 | 0.668579 |
import os
import re
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'vk0do47)egwzz!uk49%(y3s(fpx4+ha@ugt-hcv&%&d@hwr&p7'
DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1']
# Application definition
INSTALLED_APPS = [
'channels',
'apps.account',
'apps.host',
'apps.... | true | true |
f7432a9f4d07fa91163c09415237a626442bc178 | 15,633 | py | Python | eahub/profiles/models.py | rtcharity/eahub.org | 0abb235e9b99f3d35cf69c3d630aeea9496d9220 | [
"MIT"
] | 36 | 2019-02-22T23:07:14.000Z | 2022-02-10T13:24:27.000Z | eahub/profiles/models.py | rtcharity/eahub.org | 0abb235e9b99f3d35cf69c3d630aeea9496d9220 | [
"MIT"
] | 717 | 2019-02-21T22:07:55.000Z | 2022-02-26T15:17:49.000Z | eahub/profiles/models.py | rtcharity/eahub.org | 0abb235e9b99f3d35cf69c3d630aeea9496d9220 | [
"MIT"
] | 19 | 2019-04-14T14:37:56.000Z | 2022-02-14T22:05:16.000Z | import uuid
from typing import List, Optional
from django import urls
from django.conf import settings
from django.contrib.contenttypes import fields as contenttypes_fields
from django.contrib.postgres import fields as postgres_fields
from django.core.validators import MaxLengthValidator
from django.db import models
f... | 35.209459 | 127 | 0.693149 | import uuid
from typing import List, Optional
from django import urls
from django.conf import settings
from django.contrib.contenttypes import fields as contenttypes_fields
from django.contrib.postgres import fields as postgres_fields
from django.core.validators import MaxLengthValidator
from django.db import models
f... | true | true |
f7432ad9e46aeacde40581829a1a338a80ba9dd5 | 10,214 | py | Python | tests/test_dagather.py | bentheiii/dagather | ff0370994ca62c3341e2fe4912f7c4dd80eb3d86 | [
"MIT"
] | 2 | 2020-11-28T10:42:56.000Z | 2022-01-09T09:59:47.000Z | tests/test_dagather.py | bentheiii/dagather | ff0370994ca62c3341e2fe4912f7c4dd80eb3d86 | [
"MIT"
] | 1 | 2020-11-29T17:05:10.000Z | 2020-11-29T17:05:10.000Z | tests/test_dagather.py | bentheiii/dagather | ff0370994ca62c3341e2fe4912f7c4dd80eb3d86 | [
"MIT"
] | null | null | null | from asyncio import sleep, CancelledError, wait_for, TimeoutError
from pytest import mark, raises
from dagather import Dagather, PropagateError, ContinueResult, CancelPolicy, Abort, sibling_tasks, SiblingTaskState
from dagather.exceptions import CycleError, DiscardedTask
atest = mark.asyncio
@atest
async def test_... | 19.455238 | 118 | 0.5841 | from asyncio import sleep, CancelledError, wait_for, TimeoutError
from pytest import mark, raises
from dagather import Dagather, PropagateError, ContinueResult, CancelPolicy, Abort, sibling_tasks, SiblingTaskState
from dagather.exceptions import CycleError, DiscardedTask
atest = mark.asyncio
@atest
async def test_... | true | true |
f7432af695b8e209bf1adf0aef2219b9a3560a98 | 1,959 | py | Python | python/cuml/test/test_tsne.py | taureandyernv/cuml | c92b594d3bda342c64d88a9c44b5d6e507b13f6c | [
"Apache-2.0"
] | 3 | 2019-10-17T21:46:07.000Z | 2019-10-22T20:13:55.000Z | python/cuml/test/test_tsne.py | taureandyernv/cuml | c92b594d3bda342c64d88a9c44b5d6e507b13f6c | [
"Apache-2.0"
] | null | null | null | python/cuml/test/test_tsne.py | taureandyernv/cuml | c92b594d3bda342c64d88a9c44b5d6e507b13f6c | [
"Apache-2.0"
] | null | null | null |
from cuml.manifold import TSNE
from sklearn.manifold.t_sne import trustworthiness
from sklearn import datasets
import pandas as pd
import numpy as np
import cudf
import pytest
dataset_names = ['digits', 'boston', 'iris', 'breast_cancer',
'diabetes']
@pytest.mark.parametrize('name', dataset_names)
... | 27.208333 | 72 | 0.59367 |
from cuml.manifold import TSNE
from sklearn.manifold.t_sne import trustworthiness
from sklearn import datasets
import pandas as pd
import numpy as np
import cudf
import pytest
dataset_names = ['digits', 'boston', 'iris', 'breast_cancer',
'diabetes']
@pytest.mark.parametrize('name', dataset_names)
... | true | true |
f7432b8f126a768469999b443e88db23a5006721 | 533 | py | Python | src/sage/symbolic/all.py | swewers/mein_sage | 0e4e2d14aab0a1a2e63292939a9baa997f0e986b | [
"BSL-1.0"
] | 1 | 2020-11-12T04:06:19.000Z | 2020-11-12T04:06:19.000Z | src/sage/symbolic/all.py | swewers/mein_sage | 0e4e2d14aab0a1a2e63292939a9baa997f0e986b | [
"BSL-1.0"
] | 1 | 2020-04-18T16:30:43.000Z | 2020-04-18T16:30:43.000Z | src/sage/symbolic/all.py | dimpase/sage | 468f23815ade42a2192b0a9cd378de8fdc594dcd | [
"BSL-1.0"
] | null | null | null | from __future__ import absolute_import
from sage.libs.pynac.pynac import I
i = I
from .ring import SR
from .constants import (pi, e, NaN, golden_ratio, log2, euler_gamma, catalan,
khinchin, twinprime, mertens, glaisher)
from .expression import Expression, solve_diophantine, hold
from .callable ... | 29.611111 | 77 | 0.774859 | from __future__ import absolute_import
from sage.libs.pynac.pynac import I
i = I
from .ring import SR
from .constants import (pi, e, NaN, golden_ratio, log2, euler_gamma, catalan,
khinchin, twinprime, mertens, glaisher)
from .expression import Expression, solve_diophantine, hold
from .callable ... | true | true |
f7432c6d1be3f02dbbcdcf46f9a2a75477c68e0a | 27,265 | py | Python | tests/test_serialization.py | KiriLev/albumentations | c91b67c710d20755d04166b7b5e41d430aef9662 | [
"MIT"
] | null | null | null | tests/test_serialization.py | KiriLev/albumentations | c91b67c710d20755d04166b7b5e41d430aef9662 | [
"MIT"
] | null | null | null | tests/test_serialization.py | KiriLev/albumentations | c91b67c710d20755d04166b7b5e41d430aef9662 | [
"MIT"
] | null | null | null | import random
from unittest.mock import patch
import cv2
import pytest
import numpy as np
import imgaug as ia
import albumentations as A
import albumentations.augmentations.functional as F
from .utils import OpenMock
TEST_SEEDS = (0, 1, 42, 111, 9999)
def set_seed(seed):
random.seed(seed)
np.random.seed(se... | 36.548257 | 119 | 0.570402 | import random
from unittest.mock import patch
import cv2
import pytest
import numpy as np
import imgaug as ia
import albumentations as A
import albumentations.augmentations.functional as F
from .utils import OpenMock
TEST_SEEDS = (0, 1, 42, 111, 9999)
def set_seed(seed):
random.seed(seed)
np.random.seed(se... | true | true |
f7432c8d2f49120d3e4805bd6b898d33e57ccba2 | 5,727 | py | Python | synapse/server_notices/server_notices_manager.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | 2 | 2020-04-30T18:38:02.000Z | 2020-07-08T21:38:28.000Z | synapse/server_notices/server_notices_manager.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | null | null | null | synapse/server_notices/server_notices_manager.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | 2 | 2020-03-03T18:34:52.000Z | 2022-03-31T11:06:18.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector 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 la... | 35.351852 | 86 | 0.640475 |
import logging
from twisted.internet import defer
from synapse.api.constants import EventTypes, Membership, RoomCreationPreset
from synapse.types import create_requester
from synapse.util.caches.descriptors import cachedInlineCallbacks
logger = logging.getLogger(__name__)
SERVER_NOTICE_ROOM_TAG = "m.s... | true | true |
f7432ed646ae0cfcb7c588ff2576e6efde6542b8 | 36,739 | py | Python | train.py | SarahGuo1999/SiamR-CNN | b06208d293e3a2fe86343ebf306a20154b7d7b31 | [
"MIT"
] | 195 | 2020-04-04T13:50:08.000Z | 2022-03-24T03:29:38.000Z | train.py | SanyWind/SiamR-CNN | df9b428aeb90da0c8b2c8076f54f632efb07366c | [
"MIT"
] | 30 | 2020-04-12T08:14:34.000Z | 2021-09-20T13:36:12.000Z | train.py | SanyWind/SiamR-CNN | df9b428aeb90da0c8b2c8076f54f632efb07366c | [
"MIT"
] | 40 | 2020-04-05T00:10:49.000Z | 2022-03-09T08:34:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: train.py
import argparse
import itertools
import numpy as np
import os
import cv2
import six
import shutil
assert six.PY3, "FasterRCNN requires Python 3!"
import tensorflow as tf
import tqdm
import tensorpack.utils.viz as tpviz
from tensorpack import *
from tenso... | 48.340789 | 119 | 0.63453 |
import argparse
import itertools
import numpy as np
import os
import cv2
import six
import shutil
assert six.PY3, "FasterRCNN requires Python 3!"
import tensorflow as tf
import tqdm
import tensorpack.utils.viz as tpviz
from tensorpack import *
from tensorpack.tfutils import optimizer
from tensorpack.tfutils.commo... | true | true |
f7432fe698d37a611a3a83e22cb44057bbe132c0 | 4,867 | py | Python | TreeLSTM.py | yxfish13/plan_enumerator | e081b4c6eb3b373c4b8d97fdb88c5c4de9c77ba3 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-08-20T07:31:21.000Z | 2022-03-17T15:36:02.000Z | TreeLSTM.py | yxfish13/plan_enumerator | e081b4c6eb3b373c4b8d97fdb88c5c4de9c77ba3 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | TreeLSTM.py | yxfish13/plan_enumerator | e081b4c6eb3b373c4b8d97fdb88c5c4de9c77ba3 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2022-01-15T12:27:25.000Z | 2022-02-16T01:20:06.000Z | # Copyright 2018-2021 Xiang Yu(x-yu17(at)mails.tsinghua.edu.cn)
#
# 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... | 44.651376 | 156 | 0.6579 |
import torch
from torch.nn import init
import torchfold
import torch.nn as nn
from ImportantConfig import Config
config = Config()
class TreeLSTM(nn.Module):
def __init__(self, num_units):
super(TreeLSTM, self).__init__()
self.num_units = num_units
self.FC1 = nn.Linear(num_uni... | true | true |
f7432fee2b4973dfdb73f1f5ec15510891862523 | 3,462 | py | Python | options/train_options.py | syenn2896/pix2pix-batik | e3d05e2c10a89be55acab83773e8f38c52fbccbe | [
"BSD-2-Clause"
] | null | null | null | options/train_options.py | syenn2896/pix2pix-batik | e3d05e2c10a89be55acab83773e8f38c52fbccbe | [
"BSD-2-Clause"
] | 1 | 2021-07-13T02:16:15.000Z | 2021-07-13T02:16:15.000Z | options/train_options.py | syenn2896/pix2pix-batik | e3d05e2c10a89be55acab83773e8f38c52fbccbe | [
"BSD-2-Clause"
] | null | null | null | from .base_options import BaseOptions
class TrainOptions(BaseOptions):
"""This class includes training options.
It also includes shared options defined in BaseOptions.
"""
def initialize(self, parser):
parser = BaseOptions.initialize(self, parser)
# visdom and HTML visuali... | 84.439024 | 211 | 0.702773 | from .base_options import BaseOptions
class TrainOptions(BaseOptions):
def initialize(self, parser):
parser = BaseOptions.initialize(self, parser)
parser.add_argument('--display_freq', type=int, default=400, help='frequency of showing training results on screen')
parser.a... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.